1 |
2 |
eexuke |
//--------------------------------------------------------------------------------------------------
|
2 |
|
|
// Design : nova
|
3 |
|
|
// Author(s) : Ke Xu
|
4 |
|
|
// Email : eexuke@yahoo.com
|
5 |
|
|
// File : cavlc_consumed_bits_decoding.v
|
6 |
|
|
// Generated : June 12,2005
|
7 |
|
|
// Copyright (C) 2008 Ke Xu
|
8 |
|
|
//-------------------------------------------------------------------------------------------------
|
9 |
|
|
// Description
|
10 |
|
|
// Calculate the consumed bit length of CAVLC decoder of each clock cycle
|
11 |
|
|
//-------------------------------------------------------------------------------------------------
|
12 |
|
|
|
13 |
|
|
// synopsys translate_off
|
14 |
|
|
`include "timescale.v"
|
15 |
|
|
// synopsys translate_on
|
16 |
|
|
`include "nova_defines.v"
|
17 |
|
|
|
18 |
|
|
module cavlc_consumed_bits_decoding (cavlc_decoder_state,NumCoeffTrailingOnes_len,TrailingOnes,
|
19 |
|
|
heading_one_pos,levelSuffixSize,total_zeros_len,run_of_zeros_len,cavlc_consumed_bits_len);
|
20 |
|
|
input [3:0] cavlc_decoder_state;
|
21 |
|
|
input [4:0] NumCoeffTrailingOnes_len;
|
22 |
|
|
input [1:0] TrailingOnes;
|
23 |
|
|
input [3:0] heading_one_pos;
|
24 |
|
|
input [3:0] levelSuffixSize;
|
25 |
|
|
input [3:0] total_zeros_len;
|
26 |
|
|
input [3:0] run_of_zeros_len;
|
27 |
|
|
output [4:0] cavlc_consumed_bits_len;
|
28 |
|
|
reg [4:0] cavlc_consumed_bits_len;
|
29 |
|
|
|
30 |
|
|
always @ (cavlc_decoder_state or NumCoeffTrailingOnes_len or TrailingOnes or heading_one_pos or
|
31 |
|
|
levelSuffixSize or total_zeros_len or run_of_zeros_len)
|
32 |
|
|
case (cavlc_decoder_state)
|
33 |
|
|
`NumCoeffTrailingOnes_LUT:cavlc_consumed_bits_len <= NumCoeffTrailingOnes_len;
|
34 |
|
|
`TrailingOnesSignFlag :cavlc_consumed_bits_len <= TrailingOnes;
|
35 |
|
|
`LevelPrefix :cavlc_consumed_bits_len <= heading_one_pos + 1;
|
36 |
|
|
`LevelSuffix :cavlc_consumed_bits_len <= levelSuffixSize;
|
37 |
|
|
`total_zeros_LUT :cavlc_consumed_bits_len <= total_zeros_len;
|
38 |
|
|
`run_before_LUT :cavlc_consumed_bits_len <= run_of_zeros_len;
|
39 |
|
|
default :cavlc_consumed_bits_len <= 0;
|
40 |
|
|
endcase
|
41 |
|
|
endmodule
|
42 |
|
|
|