1 |
2 |
eexuke |
//--------------------------------------------------------------------------------------------------
|
2 |
|
|
// Design : nova
|
3 |
|
|
// Author(s) : Ke Xu
|
4 |
|
|
// Email : eexuke@yahoo.com
|
5 |
|
|
// File : end_of_blk_decoding.v
|
6 |
|
|
// Generated : June 12, 2005
|
7 |
|
|
// Copyright (C) 2008 Ke Xu
|
8 |
|
|
//-------------------------------------------------------------------------------------------------
|
9 |
|
|
// Description
|
10 |
|
|
// Decoding end_of_one_residual_block signal for 1 cycle duration
|
11 |
|
|
// 1)for BitStream_parser_FSM to update signals such as i4x4 and direct state switch
|
12 |
|
|
// 2)for nC_decoding to update LumaLevel/ChromaLevel CurrMb,mbAddrA,mbAddrB
|
13 |
|
|
// Decoding end_of_residual signal for 1 cycle duration
|
14 |
|
|
// 1)for nC_decoding to update general control regs such as Luma_8x8_AllZeroCoeff_mbAddrA,Luma_8x8_AllZeroCoeff_mbAddrB_reg,Chroma_8x8_AllZeroCoeff_mbAddrA,Chroma_8x8_AllZeroCoeff_mbAddrB_reg
|
15 |
|
|
// 2)Note:for P_skip MBs,their general control regs as *8x8_ALLZeroCoeff* are directly controlled by the state instead of end_of_residual signal
|
16 |
|
|
//-------------------------------------------------------------------------------------------------
|
17 |
|
|
// Revise log
|
18 |
|
|
// 1. March 24,2006
|
19 |
|
|
// Add signal end_of_NonZeroCoeff_CAVLC for IQIT to update res_AC/res_DC/... signals.
|
20 |
|
|
// end_of_NonZeroCoeff_CAVLC:combinational logic,active one cycle at the end of CAVLC decoding of one non zero coefficient residual.
|
21 |
|
|
// 2. March 29,2006
|
22 |
|
|
// Add signal lumaDC_IsAllZero,ChromaDC_Cb_IsAllZero,ChromaDC_Cr_IsAllZero to deal with special case:zero DC coeff,but non-zero AC coeff
|
23 |
|
|
//-------------------------------------------------------------------------------------------------
|
24 |
|
|
|
25 |
|
|
// synopsys translate_off
|
26 |
|
|
`include "timescale.v"
|
27 |
|
|
// synopsys translate_on
|
28 |
|
|
`include "nova_defines.v"
|
29 |
|
|
|
30 |
|
|
module end_of_blk_decoding (reset_n,cavlc_decoder_state,
|
31 |
|
|
TotalCoeff,i_TotalCoeff,end_of_one_residual_block,end_of_NonZeroCoeff_CAVLC
|
32 |
|
|
);
|
33 |
|
|
input reset_n;
|
34 |
|
|
input [3:0] cavlc_decoder_state;
|
35 |
|
|
input [4:0] TotalCoeff;
|
36 |
|
|
input [3:0] i_TotalCoeff;
|
37 |
|
|
output end_of_one_residual_block;
|
38 |
|
|
output end_of_NonZeroCoeff_CAVLC;
|
39 |
|
|
|
40 |
|
|
reg end_of_one_residual_block;
|
41 |
|
|
reg end_of_NonZeroCoeff_CAVLC;
|
42 |
|
|
reg lumaDC_IsAllZero;
|
43 |
|
|
reg ChromaDC_Cb_IsAllZero;
|
44 |
|
|
reg ChromaDC_Cr_IsAllZero;
|
45 |
|
|
|
46 |
|
|
always @ (reset_n or cavlc_decoder_state or TotalCoeff or i_TotalCoeff)
|
47 |
|
|
if (reset_n == 0)
|
48 |
|
|
end_of_one_residual_block <= 0;
|
49 |
|
|
else if (cavlc_decoder_state == `NumCoeffTrailingOnes_LUT && TotalCoeff == 0)
|
50 |
|
|
end_of_one_residual_block <= 1;
|
51 |
|
|
else if (cavlc_decoder_state == `LevelRunCombination && i_TotalCoeff == 0)
|
52 |
|
|
end_of_one_residual_block <= 1;
|
53 |
|
|
else
|
54 |
|
|
end_of_one_residual_block <= 0;
|
55 |
|
|
|
56 |
|
|
always @ (reset_n or cavlc_decoder_state or i_TotalCoeff)
|
57 |
|
|
if (reset_n == 0)
|
58 |
|
|
end_of_NonZeroCoeff_CAVLC <= 0;
|
59 |
|
|
else if (cavlc_decoder_state == `LevelRunCombination && i_TotalCoeff == 0)
|
60 |
|
|
end_of_NonZeroCoeff_CAVLC <= 1;
|
61 |
|
|
else
|
62 |
|
|
end_of_NonZeroCoeff_CAVLC <= 0;
|
63 |
|
|
|
64 |
|
|
endmodule
|