⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dct_cos_table.v

📁 基于FPGA的JPEG图像压缩芯片设计
💻 V
📖 第 1 页 / 共 5 页
字号:
/////////////////////////////////////////////////////////////////////
////                                                             ////
////  Discrete Cosine Transform, cosine table                    ////
////                                                             ////
////  Author: Richard Herveille                                  ////
////          richard@asics.ws                                   ////
////          www.asics.ws                                       ////
////                                                             ////
/////////////////////////////////////////////////////////////////////
////                                                             ////
//// Copyright (C) 2001 Richard Herveille                        ////
////                    richard@asics.ws                         ////
////                                                             ////
//// 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.                                 ////
////                                                             ////
/////////////////////////////////////////////////////////////////////

//  CVS Log
//
//  $Id: dct_cos_table.v,v 1.2 2002/10/23 09:06:59 rherveille Exp $
//
//  $Date: 2002/10/23 09:06:59 $
//  $Revision: 1.2 $
//  $Author: rherveille $
//  $Locker:  $
//  $State: Exp $
//
// Change History:
//               $Log: dct_cos_table.v,v $//               Revision 1.2  2002/10/23 09:06:59  rherveille//               Improved many files.//               Fixed some bugs in Run-Length-Encoder.//               Removed dependency on ud_cnt and ro_cnt.//               Started (Motion)JPEG hardware encoder project.//


function [31:0] dct_cos_table;

	//
	// inputs & outputs
	//
	input [2:0] x,y,u,v; // table entry

begin
	//
	// Table definition
	//
	// Function: cos( (2x +1) * u * pi)/16) * cos( (2y +1) * v * pi)/16)
	//
	// select bits:
	// 11:9 - V
	//  8:6 - U
	//  5:3 - Y
	//  2:0 - X

	case ( {v,u} ) // synopsys full_case parallel_case
		6'h00:
			case ( {y,x} )	// synopsys full_case parallel_case
				6'h00: dct_cos_table = 32'h20000000; // = +0.500000
				6'h01: dct_cos_table = 32'h20000000; // = +0.500000
				6'h02: dct_cos_table = 32'h20000000; // = +0.500000
				6'h03: dct_cos_table = 32'h20000000; // = +0.500000
				6'h04: dct_cos_table = 32'h20000000; // = +0.500000
				6'h05: dct_cos_table = 32'h20000000; // = +0.500000
				6'h06: dct_cos_table = 32'h20000000; // = +0.500000
				6'h07: dct_cos_table = 32'h20000000; // = +0.500000
				6'h08: dct_cos_table = 32'h20000000; // = +0.500000
				6'h09: dct_cos_table = 32'h20000000; // = +0.500000
				6'h0a: dct_cos_table = 32'h20000000; // = +0.500000
				6'h0b: dct_cos_table = 32'h20000000; // = +0.500000
				6'h0c: dct_cos_table = 32'h20000000; // = +0.500000
				6'h0d: dct_cos_table = 32'h20000000; // = +0.500000
				6'h0e: dct_cos_table = 32'h20000000; // = +0.500000
				6'h0f: dct_cos_table = 32'h20000000; // = +0.500000
				6'h10: dct_cos_table = 32'h20000000; // = +0.500000
				6'h11: dct_cos_table = 32'h20000000; // = +0.500000
				6'h12: dct_cos_table = 32'h20000000; // = +0.500000
				6'h13: dct_cos_table = 32'h20000000; // = +0.500000
				6'h14: dct_cos_table = 32'h20000000; // = +0.500000
				6'h15: dct_cos_table = 32'h20000000; // = +0.500000
				6'h16: dct_cos_table = 32'h20000000; // = +0.500000
				6'h17: dct_cos_table = 32'h20000000; // = +0.500000
				6'h18: dct_cos_table = 32'h20000000; // = +0.500000
				6'h19: dct_cos_table = 32'h20000000; // = +0.500000
				6'h1a: dct_cos_table = 32'h20000000; // = +0.500000
				6'h1b: dct_cos_table = 32'h20000000; // = +0.500000
				6'h1c: dct_cos_table = 32'h20000000; // = +0.500000
				6'h1d: dct_cos_table = 32'h20000000; // = +0.500000
				6'h1e: dct_cos_table = 32'h20000000; // = +0.500000
				6'h1f: dct_cos_table = 32'h20000000; // = +0.500000
				6'h20: dct_cos_table = 32'h20000000; // = +0.500000
				6'h21: dct_cos_table = 32'h20000000; // = +0.500000
				6'h22: dct_cos_table = 32'h20000000; // = +0.500000
				6'h23: dct_cos_table = 32'h20000000; // = +0.500000
				6'h24: dct_cos_table = 32'h20000000; // = +0.500000
				6'h25: dct_cos_table = 32'h20000000; // = +0.500000
				6'h26: dct_cos_table = 32'h20000000; // = +0.500000
				6'h27: dct_cos_table = 32'h20000000; // = +0.500000
				6'h28: dct_cos_table = 32'h20000000; // = +0.500000
				6'h29: dct_cos_table = 32'h20000000; // = +0.500000
				6'h2a: dct_cos_table = 32'h20000000; // = +0.500000
				6'h2b: dct_cos_table = 32'h20000000; // = +0.500000
				6'h2c: dct_cos_table = 32'h20000000; // = +0.500000
				6'h2d: dct_cos_table = 32'h20000000; // = +0.500000
				6'h2e: dct_cos_table = 32'h20000000; // = +0.500000
				6'h2f: dct_cos_table = 32'h20000000; // = +0.500000
				6'h30: dct_cos_table = 32'h20000000; // = +0.500000
				6'h31: dct_cos_table = 32'h20000000; // = +0.500000
				6'h32: dct_cos_table = 32'h20000000; // = +0.500000
				6'h33: dct_cos_table = 32'h20000000; // = +0.500000
				6'h34: dct_cos_table = 32'h20000000; // = +0.500000
				6'h35: dct_cos_table = 32'h20000000; // = +0.500000
				6'h36: dct_cos_table = 32'h20000000; // = +0.500000
				6'h37: dct_cos_table = 32'h20000000; // = +0.500000
				6'h38: dct_cos_table = 32'h20000000; // = +0.500000
				6'h39: dct_cos_table = 32'h20000000; // = +0.500000
				6'h3a: dct_cos_table = 32'h20000000; // = +0.500000
				6'h3b: dct_cos_table = 32'h20000000; // = +0.500000
				6'h3c: dct_cos_table = 32'h20000000; // = +0.500000
				6'h3d: dct_cos_table = 32'h20000000; // = +0.500000
				6'h3e: dct_cos_table = 32'h20000000; // = +0.500000
				6'h3f: dct_cos_table = 32'h20000000; // = +0.500000
			endcase
		6'h01:
			case ( {y,x} )	// synopsys full_case parallel_case
				6'h00: dct_cos_table = 32'h2c62a162; // = +0.693520
				6'h01: dct_cos_table = 32'h25a0c5df; // = +0.587938
				6'h02: dct_cos_table = 32'h192469c0; // = +0.392847
				6'h03: dct_cos_table = 32'h08d42aef; // = +0.137950
				6'h04: dct_cos_table = 32'hf72bd511; // = -0.137950
				6'h05: dct_cos_table = 32'he6db9640; // = -0.392847
				6'h06: dct_cos_table = 32'hda5f3a21; // = -0.587938
				6'h07: dct_cos_table = 32'hd39d5e9e; // = -0.693520
				6'h08: dct_cos_table = 32'h2c62a162; // = +0.693520
				6'h09: dct_cos_table = 32'h25a0c5df; // = +0.587938
				6'h0a: dct_cos_table = 32'h192469c0; // = +0.392847
				6'h0b: dct_cos_table = 32'h08d42aef; // = +0.137950
				6'h0c: dct_cos_table = 32'hf72bd511; // = -0.137950
				6'h0d: dct_cos_table = 32'he6db9640; // = -0.392847
				6'h0e: dct_cos_table = 32'hda5f3a21; // = -0.587938
				6'h0f: dct_cos_table = 32'hd39d5e9e; // = -0.693520
				6'h10: dct_cos_table = 32'h2c62a162; // = +0.693520
				6'h11: dct_cos_table = 32'h25a0c5df; // = +0.587938
				6'h12: dct_cos_table = 32'h192469c0; // = +0.392847
				6'h13: dct_cos_table = 32'h08d42aef; // = +0.137950
				6'h14: dct_cos_table = 32'hf72bd511; // = -0.137950
				6'h15: dct_cos_table = 32'he6db9640; // = -0.392847
				6'h16: dct_cos_table = 32'hda5f3a21; // = -0.587938
				6'h17: dct_cos_table = 32'hd39d5e9e; // = -0.693520
				6'h18: dct_cos_table = 32'h2c62a162; // = +0.693520
				6'h19: dct_cos_table = 32'h25a0c5df; // = +0.587938
				6'h1a: dct_cos_table = 32'h192469c0; // = +0.392847
				6'h1b: dct_cos_table = 32'h08d42aef; // = +0.137950
				6'h1c: dct_cos_table = 32'hf72bd511; // = -0.137950
				6'h1d: dct_cos_table = 32'he6db9640; // = -0.392847
				6'h1e: dct_cos_table = 32'hda5f3a21; // = -0.587938
				6'h1f: dct_cos_table = 32'hd39d5e9e; // = -0.693520
				6'h20: dct_cos_table = 32'h2c62a162; // = +0.693520
				6'h21: dct_cos_table = 32'h25a0c5df; // = +0.587938
				6'h22: dct_cos_table = 32'h192469c0; // = +0.392847
				6'h23: dct_cos_table = 32'h08d42aef; // = +0.137950
				6'h24: dct_cos_table = 32'hf72bd511; // = -0.137950
				6'h25: dct_cos_table = 32'he6db9640; // = -0.392847
				6'h26: dct_cos_table = 32'hda5f3a21; // = -0.587938
				6'h27: dct_cos_table = 32'hd39d5e9e; // = -0.693520
				6'h28: dct_cos_table = 32'h2c62a162; // = +0.693520
				6'h29: dct_cos_table = 32'h25a0c5df; // = +0.587938
				6'h2a: dct_cos_table = 32'h192469c0; // = +0.392847
				6'h2b: dct_cos_table = 32'h08d42aef; // = +0.137950
				6'h2c: dct_cos_table = 32'hf72bd511; // = -0.137950
				6'h2d: dct_cos_table = 32'he6db9640; // = -0.392847
				6'h2e: dct_cos_table = 32'hda5f3a21; // = -0.587938
				6'h2f: dct_cos_table = 32'hd39d5e9e; // = -0.693520
				6'h30: dct_cos_table = 32'h2c62a162; // = +0.693520
				6'h31: dct_cos_table = 32'h25a0c5df; // = +0.587938
				6'h32: dct_cos_table = 32'h192469c0; // = +0.392847
				6'h33: dct_cos_table = 32'h08d42aef; // = +0.137950
				6'h34: dct_cos_table = 32'hf72bd511; // = -0.137950
				6'h35: dct_cos_table = 32'he6db9640; // = -0.392847
				6'h36: dct_cos_table = 32'hda5f3a21; // = -0.587938
				6'h37: dct_cos_table = 32'hd39d5e9e; // = -0.693520
				6'h38: dct_cos_table = 32'h2c62a162; // = +0.693520
				6'h39: dct_cos_table = 32'h25a0c5df; // = +0.587938
				6'h3a: dct_cos_table = 32'h192469c0; // = +0.392847
				6'h3b: dct_cos_table = 32'h08d42aef; // = +0.137950
				6'h3c: dct_cos_table = 32'hf72bd511; // = -0.137950
				6'h3d: dct_cos_table = 32'he6db9640; // = -0.392847
				6'h3e: dct_cos_table = 32'hda5f3a21; // = -0.587938
				6'h3f: dct_cos_table = 32'hd39d5e9e; // = -0.693520
			endcase
		6'h02:
			case ( {y,x} )	// synopsys full_case parallel_case
				6'h00: dct_cos_table = 32'h29cf5d22; // = +0.653281
				6'h01: dct_cos_table = 32'h11517a7b; // = +0.270598
				6'h02: dct_cos_table = 32'heeae8585; // = -0.270598
				6'h03: dct_cos_table = 32'hd630a2de; // = -0.653281
				6'h04: dct_cos_table = 32'hd630a2de; // = -0.653281
				6'h05: dct_cos_table = 32'heeae8585; // = -0.270598
				6'h06: dct_cos_table = 32'h11517a7b; // = +0.270598
				6'h07: dct_cos_table = 32'h29cf5d22; // = +0.653281
				6'h08: dct_cos_table = 32'h29cf5d22; // = +0.653281
				6'h09: dct_cos_table = 32'h11517a7b; // = +0.270598
				6'h0a: dct_cos_table = 32'heeae8585; // = -0.270598
				6'h0b: dct_cos_table = 32'hd630a2de; // = -0.653281
				6'h0c: dct_cos_table = 32'hd630a2de; // = -0.653281
				6'h0d: dct_cos_table = 32'heeae8585; // = -0.270598
				6'h0e: dct_cos_table = 32'h11517a7b; // = +0.270598
				6'h0f: dct_cos_table = 32'h29cf5d22; // = +0.653281
				6'h10: dct_cos_table = 32'h29cf5d22; // = +0.653281
				6'h11: dct_cos_table = 32'h11517a7b; // = +0.270598
				6'h12: dct_cos_table = 32'heeae8585; // = -0.270598
				6'h13: dct_cos_table = 32'hd630a2de; // = -0.653281
				6'h14: dct_cos_table = 32'hd630a2de; // = -0.653281
				6'h15: dct_cos_table = 32'heeae8585; // = -0.270598
				6'h16: dct_cos_table = 32'h11517a7b; // = +0.270598
				6'h17: dct_cos_table = 32'h29cf5d22; // = +0.653281
				6'h18: dct_cos_table = 32'h29cf5d22; // = +0.653281
				6'h19: dct_cos_table = 32'h11517a7b; // = +0.270598
				6'h1a: dct_cos_table = 32'heeae8585; // = -0.270598
				6'h1b: dct_cos_table = 32'hd630a2de; // = -0.653281
				6'h1c: dct_cos_table = 32'hd630a2de; // = -0.653281

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -