1 |
2 |
eexuke |
//--------------------------------------------------------------------------------------------------
|
2 |
|
|
// Design : nova
|
3 |
|
|
// Author(s) : Ke Xu
|
4 |
|
|
// Email : eexuke@yahoo.com
|
5 |
|
|
// File : dependent_variable_decoding.v
|
6 |
|
|
// Generated : June 6,2005
|
7 |
|
|
// Copyright (C) 2008 Ke Xu
|
8 |
|
|
//-------------------------------------------------------------------------------------------------
|
9 |
|
|
// Description
|
10 |
|
|
// for u(v) decoding as frame_num,pic_order_cnt_lsb
|
11 |
|
|
//-------------------------------------------------------------------------------------------------
|
12 |
|
|
|
13 |
|
|
// synopsys translate_off
|
14 |
|
|
`include "timescale.v"
|
15 |
|
|
// synopsys translate_on
|
16 |
|
|
`include "nova_defines.v"
|
17 |
|
|
|
18 |
|
|
module dependent_variable_decoding (slice_header_state,log2_max_frame_num_minus4,
|
19 |
|
|
log2_max_pic_order_cnt_lsb_minus4,BitStream_buffer_output,
|
20 |
|
|
dependent_variable_len,dependent_variable_decoding_output);
|
21 |
|
|
input [3:0] slice_header_state;
|
22 |
|
|
input [3:0] log2_max_frame_num_minus4;
|
23 |
|
|
input [3:0] log2_max_pic_order_cnt_lsb_minus4;
|
24 |
|
|
input [15:0] BitStream_buffer_output;
|
25 |
|
|
output [3:0] dependent_variable_len;
|
26 |
|
|
output [9:0] dependent_variable_decoding_output;
|
27 |
|
|
reg [3:0] dependent_variable_len;
|
28 |
|
|
reg [9:0] dependent_variable_decoding_output;
|
29 |
|
|
|
30 |
|
|
always @ (slice_header_state or log2_max_frame_num_minus4 or log2_max_pic_order_cnt_lsb_minus4)
|
31 |
|
|
if (slice_header_state == `frame_num_s)
|
32 |
|
|
dependent_variable_len <= log2_max_frame_num_minus4 + 4;
|
33 |
|
|
else if (slice_header_state == `pic_order_cnt_lsb_s)
|
34 |
|
|
dependent_variable_len <= log2_max_pic_order_cnt_lsb_minus4 + 4;
|
35 |
|
|
else
|
36 |
|
|
dependent_variable_len <= 0;
|
37 |
|
|
|
38 |
|
|
always @ (slice_header_state or dependent_variable_len or BitStream_buffer_output)
|
39 |
|
|
if (slice_header_state == `frame_num_s || slice_header_state == `pic_order_cnt_lsb_s)
|
40 |
|
|
case (dependent_variable_len)
|
41 |
|
|
4 :dependent_variable_decoding_output <= {6'b0,BitStream_buffer_output[15:12]};
|
42 |
|
|
5 :dependent_variable_decoding_output <= {5'b0,BitStream_buffer_output[15:11]};
|
43 |
|
|
6 :dependent_variable_decoding_output <= {4'b0,BitStream_buffer_output[15:10]};
|
44 |
|
|
7 :dependent_variable_decoding_output <= {3'b0,BitStream_buffer_output[15:9]};
|
45 |
|
|
8 :dependent_variable_decoding_output <= {2'b0,BitStream_buffer_output[15:8]};
|
46 |
|
|
9 :dependent_variable_decoding_output <= {1'b0,BitStream_buffer_output[15:7]};
|
47 |
|
|
10:dependent_variable_decoding_output <= BitStream_buffer_output[15:6];
|
48 |
|
|
default:dependent_variable_decoding_output <= 0;
|
49 |
|
|
endcase
|
50 |
|
|
else
|
51 |
|
|
dependent_variable_decoding_output <= 0;
|
52 |
|
|
endmodule
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
|