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

Subversion Repositories ima_adpcm_encoder

[/] [ima_adpcm_encoder/] [trunk/] [IMA_adpcm_steptable_rom.vhd] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 galland
----------------------------------------------------------------------------------
2
-- Company:       VISENGI S.L. (www.visengi.com)
3
-- Engineer:      Victor Lopez Lorenzo (victor.lopez (at) visengi (dot) com)
4
-- 
5 7 galland
-- Create Date:    19:34:36 04/November/2008
6 6 galland
-- Project Name:   IMA ADPCM Encoder
7
-- Tool versions:  Xilinx ISE 9.2i
8
-- Description: 
9
--
10
-- Description: This project features a full-hardware sound compressor using the well known algorithm IMA ADPCM.
11
--              The core acts as a slave WISHBONE device. The output is perfectly compatible with any sound player
12
--              with the IMA ADPCM codec (included by default in every Windows). Includes a testbench that takes
13
--              an uncompressed PCM 16 bits Mono WAV file and outputs an IMA ADPCM compressed WAV file.
14
--              Compression ratio is fixed for IMA-ADPCM, being 4:1.
15
--
16
--
17 7 galland
-- LICENSE TERMS: GNU GENERAL PUBLIC LICENSE Version 3
18
--
19
--     That is you may use it only in NON-COMMERCIAL projects.
20
--     You are only required to include in the copyrights/about section 
21
--     that your system contains a "IMA ADPCM Encoder (C) VISENGI S.L. under GPL license"
22 6 galland
--     This holds also in the case where you modify the core, as the resulting core
23
--     would be a derived work.
24
--     Also, we would like to know if you use this core in a project of yours, just an email will do.
25
--
26 7 galland
--    Please take good note of the disclaimer section of the GPL license, as we don't
27 6 galland
--    take any responsability for anything that this core does.
28
----------------------------------------------------------------------------------
29
 
30
--------------------------------------------------------------------------------
31
--
32
--      static const uint16_t IMA_ADPCMStepTable[89] =
33
--              {
34
--                      7,        8,    9,       10,   11,       12,   13,       14,
35
--                      16,      17,   19,       21,   23,       25,   28,       31,
36
--                      34,      37,   41,       45,   50,       55,   60,       66,
37
--                      73,      80,   88,       97,  107,      118,  130,      143,
38
--                157,  173,  190,      209,  230,      253,  279,      307,
39
--                337,  371,  408,      449,  494,      544,  598,      658,
40
--                724,  796,  876,      963, 1060, 1166, 1282, 1411,
41
--               1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024,
42
--               3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484,
43
--               7132, 7845, 8630, 9493,10442,11487,12635,13899,
44
--              15289,16818,18500,20350,22385,24623,27086,29794,
45
--              32767
46
--              };
47
--
48
--------------------------------------------------------------------------------
49
 
50
library IEEE;
51
use IEEE.STD_LOGIC_1164.all;
52
use ieee.numeric_std.all;
53
 
54
entity IMA_adpcm_steptable_rom is
55
        generic (ROMADDR_W : integer := 7;
56
                                ROMDATA_W : integer := 15);
57
        port(
58
       addr0         : in  STD_LOGIC_VECTOR(ROMADDR_W-1 downto 0);
59
       clk           : in  STD_LOGIC;
60
       datao0        : out STD_LOGIC_VECTOR(ROMDATA_W-1 downto 0));
61
end IMA_adpcm_steptable_rom;
62
 
63
architecture RTL of IMA_adpcm_steptable_rom is
64
 
65
  type ROM_TYPE is array (0 to 2**ROMADDR_W-1)
66
            of STD_LOGIC_VECTOR(ROMDATA_W-1 downto 0);
67
  constant rom : ROM_TYPE :=
68
    (
69
                "000000000000111",
70
                "000000000001000",
71
                "000000000001001",
72
                "000000000001010",
73
                "000000000001011",
74
                "000000000001100",
75
                "000000000001101",
76
                "000000000001110",
77
                "000000000010000",
78
                "000000000010001",
79
                "000000000010011",
80
                "000000000010101",
81
                "000000000010111",
82
                "000000000011001",
83
                "000000000011100",
84
                "000000000011111",
85
                "000000000100010",
86
                "000000000100101",
87
                "000000000101001",
88
                "000000000101101",
89
                "000000000110010",
90
                "000000000110111",
91
                "000000000111100",
92
                "000000001000010",
93
                "000000001001001",
94
                "000000001010000",
95
                "000000001011000",
96
                "000000001100001",
97
                "000000001101011",
98
                "000000001110110",
99
                "000000010000010",
100
                "000000010001111",
101
                "000000010011101",
102
                "000000010101101",
103
                "000000010111110",
104
                "000000011010001",
105
                "000000011100110",
106
                "000000011111101",
107
                "000000100010111",
108
                "000000100110011",
109
                "000000101010001",
110
                "000000101110011",
111
                "000000110011000",
112
                "000000111000001",
113
                "000000111101110",
114
                "000001000100000",
115
                "000001001010110",
116
                "000001010010010",
117
                "000001011010100",
118
                "000001100011100",
119
                "000001101101100",
120
                "000001111000011",
121
                "000010000100100",
122
                "000010010001110",
123
                "000010100000010",
124
                "000010110000011",
125
                "000011000010000",
126
                "000011010101011",
127
                "000011101010110",
128
                "000100000010010",
129
                "000100011100000",
130
                "000100111000011",
131
                "000101010111101",
132
                "000101111010000",
133
                "000110011111111",
134
                "000111001001100",
135
                "000111110111010",
136
                "001000101001100",
137
                "001001100000111",
138
                "001010011101110",
139
                "001011100000110",
140
                "001100101010100",
141
                "001101111011100",
142
                "001111010100101",
143
                "010000110110110",
144
                "010010100010101",
145
                "010100011001010",
146
                "010110011011111",
147
                "011000101011011",
148
                "011011001001011",
149
                "011101110111001",
150
                "100000110110010",
151
                "100100001000100",
152
                "100111101111110",
153
                "101011101110001",
154
                "110000000101111",
155
                "110100111001110",
156
                "111010001100010",
157
                "111111111111111",
158
                "000000000000000",
159
                "000000000000000",
160
                "000000000000000",
161
                "000000000000000",
162
                "000000000000000",
163
                "000000000000000",
164
                "000000000000000",
165
                "000000000000000",
166
                "000000000000000",
167
                "000000000000000",
168
                "000000000000000",
169
                "000000000000000",
170
                "000000000000000",
171
                "000000000000000",
172
                "000000000000000",
173
                "000000000000000",
174
                "000000000000000",
175
                "000000000000000",
176
                "000000000000000",
177
                "000000000000000",
178
                "000000000000000",
179
                "000000000000000",
180
                "000000000000000",
181
                "000000000000000",
182
                "000000000000000",
183
                "000000000000000",
184
                "000000000000000",
185
                "000000000000000",
186
                "000000000000000",
187
                "000000000000000",
188
                "000000000000000",
189
                "000000000000000",
190
                "000000000000000",
191
                "000000000000000",
192
                "000000000000000",
193
                "000000000000000",
194
                "000000000000000",
195
                "000000000000000",
196
                "000000000000000"
197
     );
198
  signal addr_reg0 : STD_LOGIC_VECTOR(ROMADDR_W-1 downto 0);
199
 
200
begin
201
 
202
  datao0 <= rom( TO_INTEGER(UNSIGNED(addr_reg0)) );
203
 
204
  process(clk)
205
  begin
206
   if clk = '1' and clk'event then
207
     addr_reg0 <= addr0;
208
   end if;
209
  end process;
210
 
211
end RTL;

powered by: WebSVN 2.1.0

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