oc_jpegencode 1.0 JPEGencoder

pre_fifo.v
Go to the documentation of this file.
1 /////////////////////////////////////////////////////////////////////
2 //// ////
3 //// JPEG Encoder Core - Verilog ////
4 //// ////
5 //// Author: David Lundgren ////
6 //// davidklun@gmail.com ////
7 //// ////
8 /////////////////////////////////////////////////////////////////////
9 //// ////
10 //// Copyright (C) 2009 David Lundgren ////
11 //// davidklun@gmail.com ////
12 //// ////
13 //// This source file may be used and distributed without ////
14 //// restriction provided that this copyright statement is not ////
15 //// removed from the file and that any derivative work contains ////
16 //// the original copyright notice and the associated disclaimer.////
17 //// ////
18 //// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ////
19 //// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ////
20 //// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ////
21 //// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR ////
22 //// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ////
23 //// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ////
24 //// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ////
25 //// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR ////
26 //// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ////
27 //// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ////
28 //// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ////
29 //// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ////
30 //// POSSIBILITY OF SUCH DAMAGE. ////
31 //// ////
32 /////////////////////////////////////////////////////////////////////
33
34
35 /* This module combines the Y, Cb, and Cr blocks, and the RGB to Y, Cb, and Cr
36 converter. **/
37
38 `timescale 1ns / 100ps
39
40 module pre_fifo(clk, rst, enable, data_in, cr_JPEG_bitstream, cr_data_ready,
41 cr_orc, cb_JPEG_bitstream, cb_data_ready, cb_orc, y_JPEG_bitstream,
42 y_data_ready, y_orc, y_eob_output,
43 y_eob_empty, cb_eob_empty, cr_eob_empty);
44 input clk, rst, enable;
45 input [23:0] data_in;
46 output [31:0] cr_JPEG_bitstream;
47 output cr_data_ready;
48 output [4:0] cr_orc;
49 output [31:0] cb_JPEG_bitstream;
50 output cb_data_ready;
51 output [4:0] cb_orc;
52 output [31:0] y_JPEG_bitstream;
53 output y_data_ready;
54 output [4:0] y_orc;
55 output y_eob_output;
56 output y_eob_empty, cb_eob_empty, cr_eob_empty;
57
58
59 wire rgb_enable;
60 wire [23:0] dct_data_in;
61
62
63 RGB2YCBCR u4(.clk(clk), .rst(rst), .enable(enable),
64 .data_in(data_in), .data_out(dct_data_in), .enable_out(rgb_enable));
65
66 crd_q_h u11(.clk(clk), .rst(rst), .enable(rgb_enable), .data_in(dct_data_in[23:16]),
67 .JPEG_bitstream(cr_JPEG_bitstream),
68 .data_ready(cr_data_ready), .cr_orc(cr_orc),
69 .end_of_block_empty(cr_eob_empty));
70
71 cbd_q_h u12(.clk(clk), .rst(rst), .enable(rgb_enable), .data_in(dct_data_in[15:8]),
72 .JPEG_bitstream(cb_JPEG_bitstream),
73 .data_ready(cb_data_ready), .cb_orc(cb_orc),
74 .end_of_block_empty(cb_eob_empty));
75
76 yd_q_h u13(.clk(clk), .rst(rst), .enable(rgb_enable), .data_in(dct_data_in[7:0]),
77 .JPEG_bitstream(y_JPEG_bitstream),
78 .data_ready(y_data_ready), .y_orc(y_orc),
79 .end_of_block_output(y_eob_output), .end_of_block_empty(y_eob_empty));
80
81 endmodule
RGB2YCBCR.3424data_in
[23:0] 3424data_in
Definition: rgb2ycbcr.v:49
yd_q_h.4911JPEG_bitstream
[31:0] 4911JPEG_bitstream
Definition: yd_q_h.v:46
yd_q_h.4915end_of_block_empty
4915end_of_block_empty
Definition: yd_q_h.v:50
pre_fifo.crd_q_h
u11 crd_q_h
Definition: pre_fifo.v:66
cbd_q_h.1418clk
1418clk
Definition: cbd_q_h.v:42
crd_q_h.2974clk
2974clk
Definition: crd_q_h.v:41
pre_fifo
Definition: pre_fifo.v:40
pre_fifo.3418cr_eob_empty
3418cr_eob_empty
Definition: pre_fifo.v:56
cbd_q_h.1422JPEG_bitstream
[31:0] 1422JPEG_bitstream
Definition: cbd_q_h.v:46
pre_fifo.3419rgb_enable
3419rgb_enablewire
Definition: pre_fifo.v:59
pre_fifo.3417cb_eob_empty
3417cb_eob_empty
Definition: pre_fifo.v:56
cbd_q_h.1425end_of_block_empty
1425end_of_block_empty
Definition: cbd_q_h.v:49
pre_fifo.yd_q_h
u13 yd_q_h
Definition: pre_fifo.v:76
pre_fifo.3414y_orc
[4:0] 3414y_orc
Definition: pre_fifo.v:54
crd_q_h.2980cr_orc
[4:0] 2980cr_orc
Definition: crd_q_h.v:47
pre_fifo.3415y_eob_output
3415y_eob_output
Definition: pre_fifo.v:55
crd_q_h.2979data_ready
2979data_ready
Definition: crd_q_h.v:46
pre_fifo.3403rst
3403rst
Definition: pre_fifo.v:44
pre_fifo.3409cb_JPEG_bitstream
[31:0] 3409cb_JPEG_bitstream
Definition: pre_fifo.v:49
cbd_q_h.1420enable
1420enable
Definition: cbd_q_h.v:44
yd_q_h.4910data_in
[7:0] 4910data_in
Definition: yd_q_h.v:45
pre_fifo.3420dct_data_in
3420dct_data_inwire[23:0]
Definition: pre_fifo.v:60
cbd_q_h.1424cb_orc
[4:0] 1424cb_orc
Definition: cbd_q_h.v:48
pre_fifo.RGB2YCBCR
u4 RGB2YCBCR
Definition: pre_fifo.v:63
yd_q_h.4907clk
4907clk
Definition: yd_q_h.v:42
pre_fifo.cbd_q_h
u12 cbd_q_h
Definition: pre_fifo.v:71
crd_q_h.2978JPEG_bitstream
[31:0] 2978JPEG_bitstream
Definition: crd_q_h.v:45
RGB2YCBCR.3422rst
3422rst
Definition: rgb2ycbcr.v:47
yd_q_h.4913y_orc
[4:0] 4913y_orc
Definition: yd_q_h.v:48
yd_q_h.4912data_ready
4912data_ready
Definition: yd_q_h.v:47
pre_fifo.3410cb_data_ready
3410cb_data_ready
Definition: pre_fifo.v:50
pre_fifo.3404enable
3404enable
Definition: pre_fifo.v:44
pre_fifo.3402clk
3402clk
Definition: pre_fifo.v:44
yd_q_h.4914end_of_block_output
4914end_of_block_output
Definition: yd_q_h.v:49
yd_q_h.4908rst
4908rst
Definition: yd_q_h.v:43
pre_fifo.3416y_eob_empty
3416y_eob_empty
Definition: pre_fifo.v:56
crd_q_h.2976enable
2976enable
Definition: crd_q_h.v:43
cbd_q_h.1421data_in
[7:0] 1421data_in
Definition: cbd_q_h.v:45
cbd_q_h.1423data_ready
1423data_ready
Definition: cbd_q_h.v:47
crd_q_h.2977data_in
[7:0] 2977data_in
Definition: crd_q_h.v:44
pre_fifo.3405data_in
[23:0] 3405data_in
Definition: pre_fifo.v:45
pre_fifo.3412y_JPEG_bitstream
[31:0] 3412y_JPEG_bitstream
Definition: pre_fifo.v:52
RGB2YCBCR.3454data_out
3454data_outwire[23:0]
Definition: rgb2ycbcr.v:69
cbd_q_h.1419rst
1419rst
Definition: cbd_q_h.v:43
pre_fifo.3413y_data_ready
3413y_data_ready
Definition: pre_fifo.v:53
pre_fifo.3406cr_JPEG_bitstream
[31:0] 3406cr_JPEG_bitstream
Definition: pre_fifo.v:46
pre_fifo.3411cb_orc
[4:0] 3411cb_orc
Definition: pre_fifo.v:51
pre_fifo.3408cr_orc
[4:0] 3408cr_orc
Definition: pre_fifo.v:48
crd_q_h.2981end_of_block_empty
2981end_of_block_empty
Definition: crd_q_h.v:48
RGB2YCBCR.3421clk
3421clk
Definition: rgb2ycbcr.v:46
pre_fifo.3407cr_data_ready
3407cr_data_ready
Definition: pre_fifo.v:47
RGB2YCBCR.3423enable
3423enable
Definition: rgb2ycbcr.v:48
crd_q_h.2975rst
2975rst
Definition: crd_q_h.v:42
yd_q_h.4909enable
4909enable
Definition: yd_q_h.v:44
RGB2YCBCR.3453enable_out
3453enable_outreg
Definition: rgb2ycbcr.v:68