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

Subversion Repositories mkjpeg

[/] [mkjpeg/] [trunk/] [design/] [huffman/] [Huffman.vhd] - Diff between revs 25 and 36

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 25 Rev 36
Line 32... Line 32...
  use ieee.numeric_std.all;
  use ieee.numeric_std.all;
 
 
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- user packages/libraries:
-- user packages/libraries:
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
 
library work;
 
  use work.JPEG_PKG.all;
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
----------------------------------- ENTITY ------------------------------------
----------------------------------- ENTITY ------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Line 46... Line 47...
        CLK                : in  std_logic;
        CLK                : in  std_logic;
        RST                : in  std_logic;
        RST                : in  std_logic;
        -- CTRL
        -- CTRL
        start_pb           : in  std_logic;
        start_pb           : in  std_logic;
        ready_pb           : out std_logic;
        ready_pb           : out std_logic;
 
        huf_sm_settings    : in  T_SM_SETTINGS;
 
 
        -- HOST IF
        -- HOST IF
        sof                : in  std_logic;
        sof                : in  std_logic;
        img_size_x         : in  std_logic_vector(15 downto 0);
        img_size_x         : in  std_logic_vector(15 downto 0);
        img_size_y         : in  std_logic_vector(15 downto 0);
        img_size_y         : in  std_logic_vector(15 downto 0);
Line 119... Line 121...
  signal VLI_size_r        : std_logic_vector(3 downto 0);
  signal VLI_size_r        : std_logic_vector(3 downto 0);
  signal VLI_r             : std_logic_vector(11 downto 0);
  signal VLI_r             : std_logic_vector(11 downto 0);
  signal rd_en_s           : std_logic;
  signal rd_en_s           : std_logic;
  signal pad_byte          : std_logic_vector(7 downto 0);
  signal pad_byte          : std_logic_vector(7 downto 0);
  signal pad_reg           : std_logic;
  signal pad_reg           : std_logic;
 
  signal VLC_CR_DC_size    : std_logic_vector(3 downto 0);
 
  signal VLC_CR_DC         : unsigned(10 downto 0);
 
  signal VLC_CR_AC_size    : unsigned(4 downto 0);
 
  signal VLC_CR_AC         : unsigned(15 downto 0);
 
 
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Architecture: begin
-- Architecture: begin
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
begin
begin
Line 147... Line 153...
      end if;
      end if;
    end if;
    end if;
  end process;
  end process;
 
 
  -------------------------------------------------------------------
  -------------------------------------------------------------------
  -- DC_ROM
  -- DC_ROM Luminance
  -------------------------------------------------------------------
  -------------------------------------------------------------------
  U_DC_ROM : entity work.DC_ROM
  U_DC_ROM : entity work.DC_ROM
  port map
  port map
  (
  (
        CLK                => CLK,
        CLK                => CLK,
Line 161... Line 167...
        VLC_DC_size        => VLC_DC_size,
        VLC_DC_size        => VLC_DC_size,
        VLC_DC             => VLC_DC
        VLC_DC             => VLC_DC
  );
  );
 
 
  -------------------------------------------------------------------
  -------------------------------------------------------------------
  -- AC_ROM
  -- AC_ROM Luminance
  -------------------------------------------------------------------
  -------------------------------------------------------------------
  U_AC_ROM : entity work.AC_ROM
  U_AC_ROM : entity work.AC_ROM
  port map
  port map
  (
  (
        CLK                => CLK,
        CLK                => CLK,
Line 176... Line 182...
        VLC_AC_size        => VLC_AC_size,
        VLC_AC_size        => VLC_AC_size,
        VLC_AC             => VLC_AC
        VLC_AC             => VLC_AC
    );
    );
 
 
  -------------------------------------------------------------------
  -------------------------------------------------------------------
 
  -- DC_ROM Chrominance
 
  -------------------------------------------------------------------
 
  U_DC_CR_ROM : entity work.DC_CR_ROM
 
  port map
 
  (
 
        CLK                => CLK,
 
        RST                => RST,
 
        VLI_size           => VLI_size,
 
 
 
        VLC_DC_size        => VLC_CR_DC_size,
 
        VLC_DC             => VLC_CR_DC
 
  );
 
 
 
  -------------------------------------------------------------------
 
  -- AC_ROM Chrominance
 
  -------------------------------------------------------------------
 
  U_AC_CR_ROM : entity work.AC_CR_ROM
 
  port map
 
  (
 
        CLK                => CLK,
 
        RST                => RST,
 
        runlength          => runlength,
 
        VLI_size           => VLI_size,
 
 
 
        VLC_AC_size        => VLC_CR_AC_size,
 
        VLC_AC             => VLC_CR_AC
 
    );
 
 
 
  -------------------------------------------------------------------
  -- Double Fifo
  -- Double Fifo
  -------------------------------------------------------------------
  -------------------------------------------------------------------
  U_DoubleFifo : entity work.DoubleFifo
  U_DoubleFifo : entity work.DoubleFifo
  port map
  port map
  (
  (
Line 208... Line 243...
      end if;
      end if;
    end if;
    end if;
  end process;
  end process;
 
 
  -------------------------------------------------------------------
  -------------------------------------------------------------------
  -- mux for DC/AC ROM
  -- mux for DC/AC ROM Luminance/Chrominance
  -------------------------------------------------------------------
  -------------------------------------------------------------------
  p_mux : process(CLK, RST)
  p_mux : process(CLK, RST)
  begin
  begin
    if RST = '1' then
    if RST = '1' then
      VLC_size <= (others => '0');
      VLC_size <= (others => '0');
      VLC      <= (others => '0');
      VLC      <= (others => '0');
    elsif CLK'event and CLK = '1' then
    elsif CLK'event and CLK = '1' then
 
      -- DC
      if first_rle_word = '1' then
      if first_rle_word = '1' then
 
        -- luminance
 
        if huf_sm_settings.cmp_idx = 0 then
        VLC_size <= unsigned('0' & VLC_DC_size);
        VLC_size <= unsigned('0' & VLC_DC_size);
        VLC      <= resize(VLC_DC, VLC'length);
        VLC      <= resize(VLC_DC, VLC'length);
 
        -- chrominance
 
        else
 
          VLC_size <= unsigned('0' & VLC_CR_DC_size);
 
          VLC      <= resize(VLC_CR_DC, VLC'length);
 
        end if;
 
      -- AC
      else
      else
 
        -- luminance
 
        if huf_sm_settings.cmp_idx = 0 then
        VLC_size <= VLC_AC_size;
        VLC_size <= VLC_AC_size;
        VLC      <= VLC_AC;
        VLC      <= VLC_AC;
 
        -- chrominance
 
        else
 
          VLC_size <= VLC_CR_AC_size;
 
          VLC      <= VLC_CR_AC;
 
        end if;
      end if;
      end if;
    end if;
    end if;
  end process;
  end process;
 
 
  -------------------------------------------------------------------
  -------------------------------------------------------------------

powered by: WebSVN 2.1.0

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