1 |
145 |
lanttu |
------------------------------------------------------------------------------
|
2 |
|
|
-- Author : Timo Alho
|
3 |
|
|
-- e-mail : timo.a.alho@tut.fi
|
4 |
|
|
-- Date : 21.06.2004 11:33:04
|
5 |
|
|
-- File : Rom_idct_odd.vhd
|
6 |
|
|
-- Design : VHDL Entity Rom_idct_odd.rtl
|
7 |
|
|
------------------------------------------------------------------------------
|
8 |
|
|
-- Description : Pre-calculated 1D-IDCT coefficients for odd-half of idct
|
9 |
|
|
-- kernel
|
10 |
|
|
------------------------------------------------------------------------------
|
11 |
|
|
LIBRARY ieee;
|
12 |
|
|
USE ieee.std_logic_1164.ALL;
|
13 |
|
|
USE ieee.std_logic_arith.ALL;
|
14 |
|
|
|
15 |
|
|
ENTITY Rom_idct_odd IS
|
16 |
|
|
GENERIC(
|
17 |
|
|
coeffw_g : integer := 14
|
18 |
|
|
);
|
19 |
|
|
PORT(
|
20 |
|
|
addr_in : IN std_logic_vector (3 DOWNTO 0);
|
21 |
|
|
clk : IN std_logic;
|
22 |
|
|
data_out : OUT std_logic_vector (4*coeffw_g-1 DOWNTO 0)
|
23 |
|
|
);
|
24 |
|
|
|
25 |
|
|
-- Declarations
|
26 |
|
|
|
27 |
|
|
END Rom_idct_odd ;
|
28 |
|
|
|
29 |
|
|
--
|
30 |
|
|
ARCHITECTURE rtl OF Rom_idct_odd IS
|
31 |
|
|
TYPE Rom16x4x15 IS ARRAY (0 TO 15) OF signed(15*4-1 DOWNTO 0);
|
32 |
|
|
CONSTANT ROM_IDCT_ODD : Rom16x4x15 := (
|
33 |
|
|
conv_signed(0, 15) & conv_signed(0, 15) & conv_signed(0, 15) & conv_signed(0, 15),
|
34 |
|
|
conv_signed(4096, 15) & conv_signed(4096, 15) & conv_signed(4096, 15) & conv_signed(4096, 15),
|
35 |
|
|
conv_signed(5352, 15) & conv_signed(2217, 15) & conv_signed(-2217, 15) & conv_signed(-5352, 15),
|
36 |
|
|
conv_signed(9448, 15) & conv_signed(6313, 15) & conv_signed(1879, 15) & conv_signed(-1256, 15),
|
37 |
|
|
conv_signed(4096, 15) & conv_signed(-4096, 15) & conv_signed(-4096, 15) & conv_signed(4096, 15),
|
38 |
|
|
conv_signed(8192, 15) & conv_signed(0, 15) & conv_signed(0, 15) & conv_signed(8192, 15),
|
39 |
|
|
conv_signed(9448, 15) & conv_signed(-1879, 15) & conv_signed(-6313, 15) & conv_signed(-1256, 15),
|
40 |
|
|
conv_signed(13544, 15) & conv_signed(2217, 15) & conv_signed(-2217, 15) & conv_signed(2840, 15),
|
41 |
|
|
conv_signed(2217, 15) & conv_signed(-5352, 15) & conv_signed(5352, 15) & conv_signed(-2217, 15),
|
42 |
|
|
conv_signed(6313, 15) & conv_signed(-1256, 15) & conv_signed(9448, 15) & conv_signed(1879, 15),
|
43 |
|
|
conv_signed(7568, 15) & conv_signed(-3135, 15) & conv_signed(3135, 15) & conv_signed(-7568, 15),
|
44 |
|
|
conv_signed(11664, 15) & conv_signed(961, 15) & conv_signed(7231, 15) & conv_signed(-3472, 15),
|
45 |
|
|
conv_signed(6313, 15) & conv_signed(-9448, 15) & conv_signed(1256, 15) & conv_signed(1879, 15),
|
46 |
|
|
conv_signed(10409, 15) & conv_signed(-5352, 15) & conv_signed(5352, 15) & conv_signed(5975, 15),
|
47 |
|
|
conv_signed(11664, 15) & conv_signed(-7231, 15) & conv_signed(-961, 15) & conv_signed(-3472, 15),
|
48 |
|
|
conv_signed(15760, 15) & conv_signed(-3135, 15) & conv_signed(3135, 15) & conv_signed(624, 15));
|
49 |
|
|
|
50 |
|
|
SIGNAL addr_r : std_logic_vector(3 DOWNTO 0);
|
51 |
|
|
BEGIN
|
52 |
|
|
|
53 |
|
|
clocked : PROCESS (clk)
|
54 |
|
|
BEGIN -- PROCESS clocked
|
55 |
|
|
IF clk'event AND clk = '1' THEN -- rising clock edge
|
56 |
|
|
addr_r <= addr_in;
|
57 |
|
|
END IF;
|
58 |
|
|
END PROCESS clocked;
|
59 |
|
|
|
60 |
|
|
access_rom : PROCESS (addr_r)
|
61 |
|
|
VARIABLE address : integer;
|
62 |
|
|
BEGIN
|
63 |
|
|
address := conv_integer(unsigned(addr_r));
|
64 |
|
|
data_out <= conv_std_logic_vector(ROM_IDCT_ODD(address), 4*coeffw_g);
|
65 |
|
|
END PROCESS access_rom;
|
66 |
|
|
|
67 |
|
|
END rtl;
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
|