📄 inter_pred_lpe.v
字号:
//--------------------------------------------------------------------------------------------------// Design : nova// Author(s) : Ke Xu// Email : eexuke@yahoo.com// File : Inter_pred_LPE.v// Generated : Oct 11, 2005// Copyright (C) 2008 Ke Xu //-------------------------------------------------------------------------------------------------// Description // Processing Element for Inter prediction of Luma pixels//-------------------------------------------------------------------------------------------------// synopsys translate_off`include "timescale.v"// synopsys translate_on`include "nova_defines.v"module Inter_pred_LPE (clk,reset_n,pos_FracL,IsInterLuma, blk4x4_inter_calculate_counter, Inter_H_window_0_0,Inter_H_window_1_0,Inter_H_window_2_0,Inter_H_window_3_0,Inter_H_window_4_0,Inter_H_window_5_0, Inter_H_window_0_1,Inter_H_window_1_1,Inter_H_window_2_1,Inter_H_window_3_1,Inter_H_window_4_1,Inter_H_window_5_1, Inter_H_window_0_2,Inter_H_window_1_2,Inter_H_window_2_2,Inter_H_window_3_2,Inter_H_window_4_2,Inter_H_window_5_2, Inter_H_window_0_3,Inter_H_window_1_3,Inter_H_window_2_3,Inter_H_window_3_3,Inter_H_window_4_3,Inter_H_window_5_3, Inter_H_window_0_4,Inter_H_window_1_4,Inter_H_window_2_4,Inter_H_window_3_4,Inter_H_window_4_4,Inter_H_window_5_4, Inter_H_window_0_5,Inter_H_window_1_5,Inter_H_window_2_5,Inter_H_window_3_5,Inter_H_window_4_5,Inter_H_window_5_5, Inter_H_window_0_6,Inter_H_window_1_6,Inter_H_window_2_6,Inter_H_window_3_6,Inter_H_window_4_6,Inter_H_window_5_6, Inter_H_window_0_7,Inter_H_window_1_7,Inter_H_window_2_7,Inter_H_window_3_7,Inter_H_window_4_7,Inter_H_window_5_7, Inter_H_window_0_8,Inter_H_window_1_8,Inter_H_window_2_8,Inter_H_window_3_8,Inter_H_window_4_8,Inter_H_window_5_8, Inter_V_window_0,Inter_V_window_1,Inter_V_window_2,Inter_V_window_3,Inter_V_window_4, Inter_V_window_5,Inter_V_window_6,Inter_V_window_7,Inter_V_window_8, Inter_bi_window_0,Inter_bi_window_1,Inter_bi_window_2,Inter_bi_window_3, LPE0_out,LPE1_out,LPE2_out,LPE3_out ); input clk,reset_n; input [3:0] pos_FracL; input IsInterLuma; input [3:0] blk4x4_inter_calculate_counter; input [7:0] Inter_H_window_0_0,Inter_H_window_1_0,Inter_H_window_2_0,Inter_H_window_3_0,Inter_H_window_4_0,Inter_H_window_5_0; input [7:0] Inter_H_window_0_1,Inter_H_window_1_1,Inter_H_window_2_1,Inter_H_window_3_1,Inter_H_window_4_1,Inter_H_window_5_1; input [7:0] Inter_H_window_0_2,Inter_H_window_1_2,Inter_H_window_2_2,Inter_H_window_3_2,Inter_H_window_4_2,Inter_H_window_5_2; input [7:0] Inter_H_window_0_3,Inter_H_window_1_3,Inter_H_window_2_3,Inter_H_window_3_3,Inter_H_window_4_3,Inter_H_window_5_3; input [7:0] Inter_H_window_0_4,Inter_H_window_1_4,Inter_H_window_2_4,Inter_H_window_3_4,Inter_H_window_4_4,Inter_H_window_5_4; input [7:0] Inter_H_window_0_5,Inter_H_window_1_5,Inter_H_window_2_5,Inter_H_window_3_5,Inter_H_window_4_5,Inter_H_window_5_5; input [7:0] Inter_H_window_0_6,Inter_H_window_1_6,Inter_H_window_2_6,Inter_H_window_3_6,Inter_H_window_4_6,Inter_H_window_5_6; input [7:0] Inter_H_window_0_7,Inter_H_window_1_7,Inter_H_window_2_7,Inter_H_window_3_7,Inter_H_window_4_7,Inter_H_window_5_7; input [7:0] Inter_H_window_0_8,Inter_H_window_1_8,Inter_H_window_2_8,Inter_H_window_3_8,Inter_H_window_4_8,Inter_H_window_5_8; input [7:0] Inter_V_window_0,Inter_V_window_1,Inter_V_window_2,Inter_V_window_3,Inter_V_window_4; input [7:0] Inter_V_window_5,Inter_V_window_6,Inter_V_window_7,Inter_V_window_8; input [7:0] Inter_bi_window_0,Inter_bi_window_1,Inter_bi_window_2,Inter_bi_window_3; output [7:0] LPE0_out,LPE1_out,LPE2_out,LPE3_out; reg [7:0] LPE0_out,LPE1_out,LPE2_out,LPE3_out; reg [14:0] b0_raw_reg,b1_raw_reg,b2_raw_reg,b3_raw_reg,b4_raw_reg,b5_raw_reg,b6_raw_reg,b7_raw_reg,b8_raw_reg; reg [7:0] b0_reg,b1_reg,b2_reg,b3_reg; reg [7:0] h0_reg,h1_reg,h2_reg,h3_reg; //------------------------ //Vertical 6tap filter //------------------------ wire Is_V_jfqik; //Is_V_jfqik: whether read from original [7:0] integer pixels and round as +16 >> 5 or read from b_raw[14:0] and round as +512 >> 10 wire [14:0] V_6tapfilter0_A,V_6tapfilter0_B,V_6tapfilter0_C,V_6tapfilter0_D,V_6tapfilter0_E,V_6tapfilter0_F; wire [14:0] V_6tapfilter1_A,V_6tapfilter1_B,V_6tapfilter1_C,V_6tapfilter1_D,V_6tapfilter1_E,V_6tapfilter1_F; wire [14:0] V_6tapfilter2_A,V_6tapfilter2_B,V_6tapfilter2_C,V_6tapfilter2_D,V_6tapfilter2_E,V_6tapfilter2_F; wire [14:0] V_6tapfilter3_A,V_6tapfilter3_B,V_6tapfilter3_C,V_6tapfilter3_D,V_6tapfilter3_E,V_6tapfilter3_F; wire [7:0] V_6tapfilter0_round_out,V_6tapfilter1_round_out,V_6tapfilter2_round_out,V_6tapfilter3_round_out; filterV_6tap V_6tapfilter0 ( .A(V_6tapfilter0_A), .B(V_6tapfilter0_B), .C(V_6tapfilter0_C), .D(V_6tapfilter0_D), .E(V_6tapfilter0_E), .F(V_6tapfilter0_F), .Is_jfqik(Is_V_jfqik), .round_out(V_6tapfilter0_round_out) ); filterV_6tap V_6tapfilter1 ( .A(V_6tapfilter1_A), .B(V_6tapfilter1_B), .C(V_6tapfilter1_C), .D(V_6tapfilter1_D), .E(V_6tapfilter1_E), .F(V_6tapfilter1_F), .Is_jfqik(Is_V_jfqik), .round_out(V_6tapfilter1_round_out) ); filterV_6tap V_6tapfilter2 ( .A(V_6tapfilter2_A), .B(V_6tapfilter2_B), .C(V_6tapfilter2_C), .D(V_6tapfilter2_D), .E(V_6tapfilter2_E), .F(V_6tapfilter2_F), .Is_jfqik(Is_V_jfqik), .round_out(V_6tapfilter2_round_out) ); filterV_6tap V_6tapfilter3 ( .A(V_6tapfilter3_A), .B(V_6tapfilter3_B), .C(V_6tapfilter3_C), .D(V_6tapfilter3_D), .E(V_6tapfilter3_E), .F(V_6tapfilter3_F), .Is_jfqik(Is_V_jfqik), .round_out(V_6tapfilter3_round_out) ); assign Is_V_jfqik = ( (pos_FracL == `pos_j && ( blk4x4_inter_calculate_counter == 4'd4 || blk4x4_inter_calculate_counter == 4'd3 || blk4x4_inter_calculate_counter == 4'd2 || blk4x4_inter_calculate_counter == 4'd1)) || ((pos_FracL == `pos_f || pos_FracL == `pos_q) && ( blk4x4_inter_calculate_counter == 4'd4 || blk4x4_inter_calculate_counter == 4'd3 || blk4x4_inter_calculate_counter == 4'd2 || blk4x4_inter_calculate_counter == 4'd1)) || ((pos_FracL == `pos_i || pos_FracL == `pos_k) && ( blk4x4_inter_calculate_counter == 4'd7 || blk4x4_inter_calculate_counter == 4'd5 || blk4x4_inter_calculate_counter == 4'd3 || blk4x4_inter_calculate_counter == 4'd1)))? 1'b1:1'b0; assign V_6tapfilter0_A = (Is_V_jfqik)? b0_raw_reg:{7'b0,Inter_V_window_0}; assign V_6tapfilter0_B = (Is_V_jfqik)? b1_raw_reg:{7'b0,Inter_V_window_1}; assign V_6tapfilter0_C = (Is_V_jfqik)? b2_raw_reg:{7'b0,Inter_V_window_2}; assign V_6tapfilter0_D = (Is_V_jfqik)? b3_raw_reg:{7'b0,Inter_V_window_3}; assign V_6tapfilter0_E = (Is_V_jfqik)? b4_raw_reg:{7'b0,Inter_V_window_4}; assign V_6tapfilter0_F = (Is_V_jfqik)? b5_raw_reg:{7'b0,Inter_V_window_5}; assign V_6tapfilter1_A = (Is_V_jfqik)? b1_raw_reg:{7'b0,Inter_V_window_1}; assign V_6tapfilter1_B = (Is_V_jfqik)? b2_raw_reg:{7'b0,Inter_V_window_2}; assign V_6tapfilter1_C = (Is_V_jfqik)? b3_raw_reg:{7'b0,Inter_V_window_3}; assign V_6tapfilter1_D = (Is_V_jfqik)? b4_raw_reg:{7'b0,Inter_V_window_4}; assign V_6tapfilter1_E = (Is_V_jfqik)? b5_raw_reg:{7'b0,Inter_V_window_5}; assign V_6tapfilter1_F = (Is_V_jfqik)? b6_raw_reg:{7'b0,Inter_V_window_6}; assign V_6tapfilter2_A = (Is_V_jfqik)? b2_raw_reg:{7'b0,Inter_V_window_2}; assign V_6tapfilter2_B = (Is_V_jfqik)? b3_raw_reg:{7'b0,Inter_V_window_3}; assign V_6tapfilter2_C = (Is_V_jfqik)? b4_raw_reg:{7'b0,Inter_V_window_4}; assign V_6tapfilter2_D = (Is_V_jfqik)? b5_raw_reg:{7'b0,Inter_V_window_5}; assign V_6tapfilter2_E = (Is_V_jfqik)? b6_raw_reg:{7'b0,Inter_V_window_6}; assign V_6tapfilter2_F = (Is_V_jfqik)? b7_raw_reg:{7'b0,Inter_V_window_7}; assign V_6tapfilter3_A = (Is_V_jfqik)? b3_raw_reg:{7'b0,Inter_V_window_3}; assign V_6tapfilter3_B = (Is_V_jfqik)? b4_raw_reg:{7'b0,Inter_V_window_4}; assign V_6tapfilter3_C = (Is_V_jfqik)? b5_raw_reg:{7'b0,Inter_V_window_5}; assign V_6tapfilter3_D = (Is_V_jfqik)? b6_raw_reg:{7'b0,Inter_V_window_6}; assign V_6tapfilter3_E = (Is_V_jfqik)? b7_raw_reg:{7'b0,Inter_V_window_7}; assign V_6tapfilter3_F = (Is_V_jfqik)? b8_raw_reg:{7'b0,Inter_V_window_8}; //------------------------ //Horizontal 6tap filter //------------------------ wire H_need_round; wire [14:0] H_6tapfilter0_raw_out; wire [14:0] H_6tapfilter1_raw_out; wire [14:0] H_6tapfilter2_raw_out; wire [14:0] H_6tapfilter3_raw_out; wire [14:0] H_6tapfilter4_raw_out; wire [14:0] H_6tapfilter5_raw_out; wire [14:0] H_6tapfilter6_raw_out; wire [14:0] H_6tapfilter7_raw_out; wire [14:0] H_6tapfilter8_raw_out; wire [7:0] H_6tapfilter0_round_out; wire [7:0] H_6tapfilter1_round_out; wire [7:0] H_6tapfilter2_round_out; wire [7:0] H_6tapfilter3_round_out; wire [7:0] H_6tapfilter4_round_out; wire [7:0] H_6tapfilter5_round_out; wire [7:0] H_6tapfilter6_round_out; wire [7:0] H_6tapfilter7_round_out; wire [7:0] H_6tapfilter8_round_out; assign H_need_round = (blk4x4_inter_calculate_counter != 0 && pos_FracL != `pos_Int && pos_FracL != `pos_i && pos_FracL != `pos_j && pos_FracL != `pos_k && pos_FracL != `pos_d && pos_FracL != `pos_n); filterH_6tap H_6tapfilter0 ( .A(Inter_H_window_0_0), .B(Inter_H_window_1_0), .C(Inter_H_window_2_0), .D(Inter_H_window_3_0), .E(Inter_H_window_4_0), .F(Inter_H_window_5_0), .H_need_round(1'b0), .raw_out(H_6tapfilter0_raw_out), .round_out(H_6tapfilter0_round_out) ); filterH_6tap H_6tapfilter1 ( .A(Inter_H_window_0_1), .B(Inter_H_window_1_1), .C(Inter_H_window_2_1), .D(Inter_H_window_3_1), .E(Inter_H_window_4_1), .F(Inter_H_window_5_1), .H_need_round(1'b0), .raw_out(H_6tapfilter1_raw_out), .round_out(H_6tapfilter1_round_out) ); filterH_6tap H_6tapfilter2 ( .A(Inter_H_window_0_2), .B(Inter_H_window_1_2), .C(Inter_H_window_2_2), .D(Inter_H_window_3_2), .E(Inter_H_window_4_2), .F(Inter_H_window_5_2), .H_need_round(H_need_round), .raw_out(H_6tapfilter2_raw_out), .round_out(H_6tapfilter2_round_out) ); filterH_6tap H_6tapfilter3 ( .A(Inter_H_window_0_3), .B(Inter_H_window_1_3), .C(Inter_H_window_2_3), .D(Inter_H_window_3_3), .E(Inter_H_window_4_3), .F(Inter_H_window_5_3), .H_need_round(H_need_round), .raw_out(H_6tapfilter3_raw_out), .round_out(H_6tapfilter3_round_out) ); filterH_6tap H_6tapfilter4 ( .A(Inter_H_window_0_4), .B(Inter_H_window_1_4), .C(Inter_H_window_2_4), .D(Inter_H_window_3_4), .E(Inter_H_window_4_4), .F(Inter_H_window_5_4), .H_need_round(H_need_round), .raw_out(H_6tapfilter4_raw_out), .round_out(H_6tapfilter4_round_out) ); filterH_6tap H_6tapfilter5 ( .A(Inter_H_window_0_5), .B(Inter_H_window_1_5), .C(Inter_H_window_2_5), .D(Inter_H_window_3_5), .E(Inter_H_window_4_5), .F(Inter_H_window_5_5), .H_need_round(H_need_round), .raw_out(H_6tapfilter5_raw_out), .round_out(H_6tapfilter5_round_out) ); filterH_6tap H_6tapfilter6 ( .A(Inter_H_window_0_6), .B(Inter_H_window_1_6), .C(Inter_H_window_2_6), .D(Inter_H_window_3_6), .E(Inter_H_window_4_6), .F(Inter_H_window_5_6), .H_need_round(H_need_round), .raw_out(H_6tapfilter6_raw_out), .round_out(H_6tapfilter6_round_out) ); filterH_6tap H_6tapfilter7 ( .A(Inter_H_window_0_7), .B(Inter_H_window_1_7), .C(Inter_H_window_2_7), .D(Inter_H_window_3_7), .E(Inter_H_window_4_7), .F(Inter_H_window_5_7), .H_need_round(1'b0), .raw_out(H_6tapfilter7_raw_out), .round_out(H_6tapfilter7_round_out) ); filterH_6tap H_6tapfilter8 ( .A(Inter_H_window_0_8), .B(Inter_H_window_1_8), .C(Inter_H_window_2_8), .D(Inter_H_window_3_8), .E(Inter_H_window_4_8), .F(Inter_H_window_5_8), .H_need_round(1'b0), .raw_out(H_6tapfilter8_raw_out), .round_out(H_6tapfilter8_round_out) ); //-------------------- //bilinear filter //-------------------- reg [7:0] bilinear0_A,bilinear0_B; reg [7:0] bilinear1_A,bilinear1_B; reg [7:0] bilinear2_A,bilinear2_B; reg [7:0] bilinear3_A,bilinear3_B; wire [7:0] bilinear0_out; wire [7:0] bilinear1_out; wire [7:0] bilinear2_out; wire [7:0] bilinear3_out; bilinear bilinear0 ( .A(bilinear0_A), .B(bilinear0_B), .bilinear_out(bilinear0_out) ); bilinear bilinear1 ( .A(bilinear1_A), .B(bilinear1_B), .bilinear_out(bilinear1_out) ); bilinear bilinear2 ( .A(bilinear2_A),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -