OpenCores
URL https://opencores.org/ocsvn/mkjpeg/mkjpeg/trunk

Subversion Repositories mkjpeg

[/] [mkjpeg/] [trunk/] [tb/] [vhdl/] [DCT_TROM.vhd] - Blame information for rev 27

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 25 mikel262
--------------------------------------------------------------------------------
2
--                                                                            --
3
--                          V H D L    F I L E                                --
4
--                          COPYRIGHT (C) 2006                                --
5
--                                                                            --
6
--------------------------------------------------------------------------------
7
--
8
-- Title       : DCT
9
-- Design      : MDCT Core
10
-- Author      : Michal Krepa
11
--
12
--------------------------------------------------------------------------------
13
--
14
-- File        : DCT_TROM.VHD
15
-- Created     : Sun Aug 27 18:09 2006
16
--
17
--------------------------------------------------------------------------------
18
--
19
--  Description : ROM for DCT quantizer matrix
20
--
21
--------------------------------------------------------------------------------
22
 
23
library IEEE;
24
  use IEEE.STD_LOGIC_1164.all;
25
  use ieee.numeric_std.all;
26
 
27
entity DCT_TROM is
28
  generic
29
    (
30
      ROMADDR_W     : INTEGER := 9;
31
      ROMDATA_W     : INTEGER := 8
32
    );
33
  port(
34
       addr         : in  STD_LOGIC_VECTOR(ROMADDR_W-1 downto 0);
35
       clk          : in  STD_LOGIC;
36
 
37
       datao        : out STD_LOGIC_VECTOR(ROMDATA_W-1 downto 0)
38
  );
39
 
40
end DCT_TROM;
41
 
42
architecture RTL of DCT_TROM is
43
 
44
  type DCT_TROM_TYPE is array (0 to 2**ROMADDR_W-1)
45
            of INTEGER;
46
 
47
  constant rom : DCT_TROM_TYPE :=
48
  -- (
49
  -- 16,11,10,16,24,40,51,61,
50
  -- 12,12,14,19,26,58,60,55,
51
  -- 14,13,16,24,40,57,69,56,
52
  -- 14,17,22,29,51,87,80,62,
53
  -- 18,22,37,56,68,109,103,77,
54
  -- 24,35,55,64,81,104,113,92,
55
  -- 49,64,78,87,103,121,120,101,
56
  -- 72,92,95,98,112,100,103,99);
57
                          (
58
    -280,    48,   -20,    16,   -26,    46,   -42,    27,
59
      45,    12,   -34,   -31,    11,    -1,    16,   -44,
60
      -5,   -63,   -34,    36,    24,   -27,     6,     1,
61
     -12,    12,    -8,    34,     5,     2,   -12,     5,
62
      22,   -18,    15,     9,    12,    -5,     1,   -11,
63
       1,    10,     6,    12,   -15,   -11,    -5,   -10,
64
       5,   -16,    -4,    10,    -1,   -11,    -5,   -11,
65
      -9,    11,     5,    -3,   -14,     4,     0,     0,
66
    -213,  -110,   -78,    38,    32,     2,    -1,    -9,
67
      28,    62,    -7,    -7,    22,   -11,     5,     7,
68
      85,   -21,    33,   -28,   -37,    36,   -11,     5,
69
     -34,   -18,     2,   -24,     8,   -12,   -11,    -8,
70
     -13,     8,    39,   -63,    27,     0,     1,    -4,
71
     -32,    -4,    -8,    24,   -22,    11,    20,    -4,
72
     -12,     8,    43,    41,   -16,   -12,     4,   -10,
73
     -11,    14,    15,     7,   -11,     9,   -32,     0,
74
    -225,    10,    25,    18,   -30,    18,   -14,     7,
75
      44,   -13,   -93,    -7,    20,    -7,     5,   -11,
76
     -88,   -53,     6,    36,     2,     1,    22,     2,
77
     -46,   -10,    17,    23,    16,    32,    -7,     8,
78
      66,    46,   -10,    -3,   -17,     4,    -5,    -5,
79
     -51,   -18,    -9,     6,    37,    15,    23,    -4,
80
     -21,    22,    44,    49,    25,    21,     1,   -12,
81
      25,    12,    -5,    -2,   -19,    -8,   -15,     0,
82
     390,   -97,   -41,   -15,    20,     6,     0,    12,
83
       4,   -62,    21,    -5,   -31,    -7,    -3,   -20,
84
    -352,    44,    27,    36,    35,     6,     5,    10,
85
      33,    48,    48,    14,    -8,    14,    10,    -9,
86
     -95,   108,     5,     1,   -11,   -23,   -20,     1,
87
      54,    -7,   -43,   -32,   -15,     3,     9,     3,
88
     -42,    57,   -32,   -19,    -4,     6,     5,    -3,
89
      23,   -31,   -22,    -1,    19,    24,    22,     1,
90
     -14,   148,    70,    67,    54,    30,     2,   -10,
91
      76,    20,    20,   -39,    14,   -10,    -8,   -11,
92
     -86,   -65,   -15,   -33,   -33,   -38,    -2,    10,
93
      61,    20,    50,    18,   -15,   -25,   -23,     2,
94
      11,    -3,    12,    12,    15,     8,   -18,    -5,
95
     -13,   -14,   -13,    16,    34,    15,   -22,   -18,
96
      -8,   -13,    -3,    11,    19,    26,     9,    -5,
97
       1,     1,     2,    -9,   -11,     2,     7,     0,
98
    -317,    -9,    63,    17,    10,   -26,     1,   -11,
99
     159,   -41,   -29,    42,    -3,    21,    11,     1,
100
      -6,   -13,   -18,     9,   -19,     5,    15,     7,
101
      -8,    -9,   -11,    16,    -4,    -1,   -12,    -3,
102
       1,    15,    -1,     3,   -13,    -8,     5,    -1,
103
      -9,     3,     2,     5,     7,    -6,    12,   -11,
104
      -3,     1,    -6,     1,    -5,    -4,     9,     6,
105
       3,     7,     7,     3,    -3,    -5,    -2,     0,
106
 
107
 
108
     -404,   148,    70,    67,    54,    30,     2,   -10,
109
      76,    20,    20,   -39,    14,   -10,    -8,   -11,
110
     -86,   -65,   -15,   -33,   -33,   -38,    -2,    10,
111
      61,    20,    50,    18,   -15,   -25,   -23,     2,
112
      11,    -3,    12,    12,    15,     8,   -18,    -5,
113
     -13,   -14,   -13,    16,    34,    15,   -22,   -18,
114
      -8,   -13,    -3,    11,    19,    26,     9,    -5,
115
       1,     1,     2,    -9,   -11,     2,     7,     0,
116
       -404,   148,    70,    67,    54,    30,     2,   -10,
117
      76,    20,    20,   -39,    14,   -10,    -8,   -11,
118
     -86,   -65,   -15,   -33,   -33,   -38,    -2,    10,
119
      61,    20,    50,    18,   -15,   -25,   -23,     2,
120
      11,    -3,    12,    12,    15,     8,   -18,    -5,
121
     -13,   -14,   -13,    16,    34,    15,   -22,   -18,
122
      -8,   -13,    -3,    11,    19,    26,     9,    -5,
123
       1,     1,     2,    -9,   -11,     2,     7,     0
124
 
125
 
126
 
127
                          );
128
 
129
 
130
 
131
  signal addr_reg : STD_LOGIC_VECTOR(ROMADDR_W-1 downto 0);
132
begin
133
 
134
  datao <= STD_LOGIC_VECTOR(TO_SIGNED( rom( TO_INTEGER(UNSIGNED(addr_reg)) ), ROMDATA_W));
135
 
136
  process(clk)
137
  begin
138
   if clk = '1' and clk'event then
139
     addr_reg <= addr;
140
   end if;
141
  end process;
142
 
143
end RTL;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.