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

Subversion Repositories mkjpeg

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

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 36 mikel262
  constant C_HDR_SIZE         : integer := 623;
31 25 mikel262
 
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 42 mikel262
  constant C_MAX_LINE_WIDTH   : integer := 1280;
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 42 mikel262
  constant C_MEMORY_OPTIMIZED : integer := 0;
40 28 mikel262
 
41 49 mikel262
  -- 24 bit format RGB 888 bits
42
  -- 16 bit format RGB 565 bits
43
  constant C_PIXEL_BITS    : integer := 16;
44
 
45 25 mikel262
  type T_SM_SETTINGS is record
46
    x_cnt               : unsigned(15 downto 0);
47
    y_cnt               : unsigned(15 downto 0);
48
    cmp_idx             : unsigned(1 downto 0);
49
  end record;
50
 
51
  constant C_SM_SETTINGS : T_SM_SETTINGS :=
52
  (
53
    (others => '0'),
54
    (others => '0'),
55
    (others => '0')
56
  );
57
 
58
  function log2(n : natural) return natural;
59
 
60
end package JPEG_PKG;
61
 
62
package body JPEG_PKG is
63
 
64
  -----------------------------------------------------------------------------
65
  function log2(n : natural)
66
  return natural is
67
  begin
68
    for i in 0 to 31 loop
69
      if (2**i) >= n then
70
        return i;
71
      end if;
72
    end loop;
73
    return 32;
74
  end log2;
75
  -----------------------------------------------------------------------------
76
 
77
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.