1 ------------------------------------------------------------------------------
2 -- Copyright (C) 20011 , Kenichi Kurimoto
4 -- This program is free software; you can redistribute it and/or modify
5 -- it under the terms of the GNU General Public License as published by
6 -- the Free Software Foundation; either version 2 of the License, or
7 -- (at your option) any later version.
9 -- This program is distributed in the hope that it will be useful,
10 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- GNU General Public License for more details.
14 -- You should have received a copy of the GNU General Public License
15 -- along with this program; if not, write to the Free Software
16 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -----------------------------------------------------------------------------
18 -- Entity: mjpeg package
20 -- Author: Kenichi Kurimoto
21 -- Description: motion JPEG package
22 ------------------------------------------------------------------------------
27 use ieee.std_logic_1164.all;
28 use ieee.numeric_std.all;
33 use grlib.devices.all;
36 use techmap.gencomp.all;
40 type jpg_set_type is record
41 samp_fact : std_logic;
42 xmcumax : std_logic_vector(5 downto 0);
43 ymcumax : std_logic_vector(4 downto 0);
44 incaddy : std_logic_vector(15 downto 0);
45 incaddmcux : std_logic_vector(15 downto 0);
46 incaddmcuy : std_logic_vector(10 downto 0);
47 fbstartadd : std_logic_vector(31 downto 0);
50 component huffdctycc is
52 memtech : integer := DEFMEMTECH;
53 shindex : integer := 0;
55 hmask : integer := 16#fff#;
57 pindex : integer := 0;
59 pmask : integer := 16#fff#;
60 mhindex : integer := 0;
61 chprot : integer := 3);
66 ahbmi : in ahb_mst_in_type;
67 ahbmo : out ahb_mst_out_type;
68 ahbsi : in ahb_slv_in_type;
69 ahbso : out ahb_slv_out_type;
70 apbi : in apb_slv_in_type;
71 apbo : out apb_slv_out_type;
72 logan_sig : out std_logic_vector(31 downto 0)
78 memtech : integer := DEFMEMTECH;
79 shindex : integer := 0;
81 hmask : integer := 16#fff#;
83 pindex : integer := 0;
85 pmask : integer := 16#fff#;
86 mhindex : integer := 0;
87 chprot : integer := 3);
91 ahbsi : in ahb_slv_in_type;
92 ahbso : out ahb_slv_out_type;
93 apbi : in apb_slv_in_type;
94 apbo : out apb_slv_out_type;
95 kready : in std_logic;
96 kstrobe : out std_logic;
97 kdata : out std_logic_vector(11 downto 0);
98 kaddress : out std_logic_vector(5 downto 0);
99 jpg_setting : out jpg_set_type;
100 error : in std_logic_vector(2 downto 0);
101 startgen : out std_logic;
102 kstrobeq : out std_logic;
103 kdataq : out std_logic_vector(7 downto 0);
104 kaddq : out std_logic_vector(7 downto 0);
105 krddataq : in std_logic_vector(7 downto 0);
110 component huffmemcont is
112 memtech : integer := DEFMEMTECH);
116 kready1 : out std_logic;
117 kstrobe1 : in std_logic;
118 kaddress1 : in std_logic_vector(5 downto 0);
119 kdata1 : in std_logic_vector(11 downto 0);
120 kready2 : in std_logic;
121 kstrobe2 : out std_logic;
122 kdata2 : out std_logic_vector(11 downto 0);
123 error : out std_logic;
124 samp_fact : in std_logic;
125 kstrobeq1 : in std_logic;
126 kdataq1 : in std_logic_vector(7 downto 0);
127 kdataq2 : out std_logic_vector(7 downto 0);
128 kaddq : in std_logic_vector(7 downto 0);
130 krddataq : out std_logic_vector(7 downto 0);
131 startgen : in std_logic
135 component dctmem1cont is
137 memtech : integer := DEFMEMTECH);
141 kready1 : out std_logic;
142 kstrobe1 : in std_logic;
143 kdata1 : in std_logic_vector(11 downto 0);
144 kready2 : in std_logic;
145 kstrobe2 : out std_logic;
146 kdata2 : out std_logic_vector(11 downto 0);
147 error : out std_logic;
148 samp_fact : in std_logic;
149 kstrobeq1 : in std_logic;
150 kdataq1 : in std_logic_vector(7 downto 0);
151 kdataq2 : out std_logic_vector(7 downto 0)
155 component dctmem2cont is
157 memtech : integer := DEFMEMTECH);
161 kready1 : out std_logic;
162 kstrobe1 : in std_logic;
163 kdata1 : in std_logic_vector(15 downto 0);
164 kready2 : in std_logic;
165 kstrobe2 : out std_logic;
166 kdata2 : out std_logic_vector(15 downto 0);
167 error : out std_logic;
168 startgen : in std_logic
173 port ( rst : in std_ulogic;
175 ready1 : out std_logic;
176 strobe1 : in std_logic;
177 coeffin : in std_logic_vector (11 downto 0);
178 quantin : in std_logic_vector (7 downto 0);
179 outdata : out std_logic_vector (15 downto 0);
180 ready2 : in std_logic;
181 strobe2 : out std_logic;
182 startgen : in std_logic
187 port ( rst : in std_ulogic;
189 ready1 : out std_logic;
190 strobe1 : in std_logic;
191 coeffin : in std_logic_vector (15 downto 0);
192 outdata : out std_logic_vector (7 downto 0);
193 ready2 : in std_logic;
194 strobe2 : out std_logic;
195 startgen : in std_logic
201 memtech : integer := DEFMEMTECH;
202 shindex : integer := 0;
203 haddr : integer := 0;
204 hmask : integer := 16#fff#;
206 pindex : integer := 0;
207 paddr : integer := 0;
208 pmask : integer := 16#fff#);
212 ahbsi : in ahb_slv_in_type;
213 ahbso : out ahb_slv_out_type;
214 apbi : in apb_slv_in_type;
215 apbo : out apb_slv_out_type;
216 kready : in std_logic;
217 kstrobe : out std_logic;
218 kdata : out std_logic_vector(11 downto 0);
219 samp_fact : out std_logic;
220 error : in std_logic_vector(2 downto 0);
221 xmcumax : out std_logic_vector(5 downto 0);
222 ymcumax : out std_logic_vector(4 downto 0);
223 incaddy : out std_logic_vector(15 downto 0);
224 incaddmcux : out std_logic_vector(15 downto 0);
225 incaddmcuy : out std_logic_vector(10 downto 0);
226 fbstartadd : out std_logic_vector(31 downto 0);
227 startgen : out std_logic;
228 kstrobeq : out std_logic;
229 kdataq : out std_logic_vector(7 downto 0)
235 memtech : integer := DEFMEMTECH);
239 kready1 : out std_logic;
240 kstrobe1 : in std_logic;
241 kdata1 : in std_logic_vector(7 downto 0);
242 kready2 : in std_logic;
243 kstrobe2 : out std_logic;
244 kdata2 : out std_logic_vector(23 downto 0);
245 samp_fact : in std_logic;
246 error : out std_logic;
247 startgen : in std_logic
253 memtech : integer := DEFMEMTECH;
255 mhindex : integer := 0;
256 chprot : integer := 3);
260 ahbmi : in ahb_mst_in_type;
261 ahbmo : out ahb_mst_out_type;
262 kready : out std_logic;
263 kstrobe : in std_logic;
264 kdata : in std_logic_vector(23 downto 0);
265 xmcumax : in std_logic_vector(5 downto 0);
266 ymcumax : in std_logic_vector(4 downto 0);
267 incaddy : in std_logic_vector(15 downto 0);
268 incaddmcux : in std_logic_vector(15 downto 0);
269 incaddmcuy : in std_logic_vector(10 downto 0);
270 fbstartadd : in std_logic_vector(31 downto 0);
271 startgen : in std_logic