pre_fifo.v
Go to the documentation of this file.
/////////////////////////////////////////////////////////////////////
//// ////
//// JPEG Encoder Core - Verilog ////
//// ////
//// Author: David Lundgren ////
//// davidklun@gmail.com ////
//// ////
/////////////////////////////////////////////////////////////////////
//// ////
//// Copyright (C) 2009 David Lundgren ////
//// davidklun@gmail.com ////
//// ////
//// This source file may be used and distributed without ////
//// restriction provided that this copyright statement is not ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer.////
//// ////
//// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ////
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ////
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ////
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR ////
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ////
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ////
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ////
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR ////
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ////
//// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ////
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ////
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ////
//// POSSIBILITY OF SUCH DAMAGE. ////
//// ////
/////////////////////////////////////////////////////////////////////
/* This module combines the Y, Cb, and Cr blocks, and the RGB to Y, Cb, and Cr
converter. **/
`timescale 1ns / 100ps
module pre_fifo(clk, rst, enable, data_in, cr_JPEG_bitstream, cr_data_ready,
cr_orc, cb_JPEG_bitstream, cb_data_ready, cb_orc, y_JPEG_bitstream,
y_data_ready, y_orc, y_eob_output,
y_eob_empty, cb_eob_empty, cr_eob_empty);
input clk, rst, enable;
input [23:0] data_in;
output [31:0] cr_JPEG_bitstream;
output cr_data_ready;
output [4:0] cr_orc;
output [31:0] cb_JPEG_bitstream;
output cb_data_ready;
output [4:0] cb_orc;
output [31:0] y_JPEG_bitstream;
output y_data_ready;
output [4:0] y_orc;
output y_eob_output;
output y_eob_empty, cb_eob_empty, cr_eob_empty;
wire rgb_enable;
wire [23:0] dct_data_in;
RGB2YCBCR u4(.clk(clk), .rst(rst), .enable(enable),
.data_in(data_in), .data_out(dct_data_in), .enable_out(rgb_enable));
crd_q_h u11(.clk(clk), .rst(rst), .enable(rgb_enable), .data_in(dct_data_in[23:16]),
.JPEG_bitstream(cr_JPEG_bitstream),
.data_ready(cr_data_ready), .cr_orc(cr_orc),
.end_of_block_empty(cr_eob_empty));
cbd_q_h u12(.clk(clk), .rst(rst), .enable(rgb_enable), .data_in(dct_data_in[15:8]),
.JPEG_bitstream(cb_JPEG_bitstream),
.data_ready(cb_data_ready), .cb_orc(cb_orc),
.end_of_block_empty(cb_eob_empty));
yd_q_h u13(.clk(clk), .rst(rst), .enable(rgb_enable), .data_in(dct_data_in[7:0]),
.JPEG_bitstream(y_JPEG_bitstream),
.data_ready(y_data_ready), .y_orc(y_orc),
.end_of_block_output(y_eob_output), .end_of_block_empty(y_eob_empty));
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