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

Subversion Repositories mkjpeg

[/] [mkjpeg/] [trunk/] [design/] [common/] [JPEG_PKG.vhd] - Blame information for rev 28

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) 2009                                --
5
--                                                                            --
6
--------------------------------------------------------------------------------
7
--
8
-- Title       : JPEG_PKG
9
-- Design      : JPEG_ENC
10
-- Author      : Michal Krepa
11
--
12
--------------------------------------------------------------------------------
13
--
14
-- File        : JPEG_PKG.VHD
15
-- Created     : Sat Mar 7 2009
16
--
17
--------------------------------------------------------------------------------
18
--
19
--  Description : Package for JPEG core
20
--
21
--------------------------------------------------------------------------------
22
 
23
library IEEE;
24
  use IEEE.STD_LOGIC_1164.all;
25
  use ieee.numeric_std.all;
26
 
27
package JPEG_PKG is
28
 
29
  -- do not change, constant
30
  constant C_HDR_SIZE         : integer := 338;
31
 
32
  -- warning! this parameter heavily affects memory size required
33
  -- if expected image width is known change this parameter to match this
34
  -- otherwise some onchip RAM will be wasted and never used
35 28 mikel262
  constant C_MAX_LINE_WIDTH   : integer := 1024;
36 25 mikel262
 
37
  -- 0=highest clock per pixel performance
38
  -- 1=memory used by BUF_FIFO halved, speed performance reduced by circa 18%
39 28 mikel262
  constant C_MEMORY_OPTIMIZED : integer := 1;
40
 
41 25 mikel262
  type T_SM_SETTINGS is record
42
    x_cnt               : unsigned(15 downto 0);
43
    y_cnt               : unsigned(15 downto 0);
44
    cmp_idx             : unsigned(1 downto 0);
45
  end record;
46
 
47
  constant C_SM_SETTINGS : T_SM_SETTINGS :=
48
  (
49
    (others => '0'),
50
    (others => '0'),
51
    (others => '0')
52
  );
53
 
54
  function log2(n : natural) return natural;
55
 
56
end package JPEG_PKG;
57
 
58
package body JPEG_PKG is
59
 
60
  -----------------------------------------------------------------------------
61
  function log2(n : natural)
62
  return natural is
63
  begin
64
    for i in 0 to 31 loop
65
      if (2**i) >= n then
66
        return i;
67
      end if;
68
    end loop;
69
    return 32;
70
  end log2;
71
  -----------------------------------------------------------------------------
72
 
73
end package body JPEG_PKG;

powered by: WebSVN 2.1.0

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