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

Subversion Repositories mkjpeg

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

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

Rev 36 Rev 38
Line 125... Line 125...
  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_size    : std_logic_vector(3 downto 0);
  signal VLC_CR_DC         : unsigned(10 downto 0);
  signal VLC_CR_DC         : unsigned(10 downto 0);
  signal VLC_CR_AC_size    : unsigned(4 downto 0);
  signal VLC_CR_AC_size    : unsigned(4 downto 0);
  signal VLC_CR_AC         : unsigned(15 downto 0);
  signal VLC_CR_AC         : unsigned(15 downto 0);
 
  signal start_pb_d1       : std_logic;
 
 
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Architecture: begin
-- Architecture: begin
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
begin
begin
Line 346... Line 347...
      ready_HFW    <= '0';
      ready_HFW    <= '0';
      fifo_wrt_cnt <= (others => '0');
      fifo_wrt_cnt <= (others => '0');
      fifo_wren    <= '0';
      fifo_wren    <= '0';
      fifo_wbyte   <= (others => '0');
      fifo_wbyte   <= (others => '0');
      rd_en_s      <= '0';
      rd_en_s      <= '0';
 
      start_pb_d1  <= '0';
    elsif CLK'event and CLK = '1' then
    elsif CLK'event and CLK = '1' then
      fifo_wren <= '0';
      fifo_wren <= '0';
      ready_HFW <= '0';
      ready_HFW <= '0';
      rd_en_s   <= '0';
      rd_en_s   <= '0';
 
      start_pb_d1 <= start_pb;
 
 
      if start_pb = '1' then
      if start_pb_d1 = '1' then
        rd_en_s     <= '1';
        rd_en_s     <= '1' and not rle_fifo_empty;
      end if;
      end if;
 
 
      if HFW_running = '1' and ready_HFW = '0' then
      if HFW_running = '1' and ready_HFW = '0' then
        -- there is no at least one integer byte to write this time
        -- there is no at least one integer byte to write this time
        if num_fifo_wrs = 0 then
        if num_fifo_wrs = 0 then
          ready_HFW    <= '1';
          ready_HFW    <= '1';
          if state = RUN_VLI then
          if state = RUN_VLI then
            rd_en_s      <= '1';
            rd_en_s      <= '1' and not rle_fifo_empty;
          end if;
          end if;
        -- single byte write to FIFO
        -- single byte write to FIFO
        else
        else
          fifo_wrt_cnt <= fifo_wrt_cnt + 1;
          fifo_wrt_cnt <= fifo_wrt_cnt + 1;
          fifo_wren    <= '1';
          fifo_wren    <= '1';
          -- last byte write
          -- last byte write
          if fifo_wrt_cnt + 1 = num_fifo_wrs then
          if fifo_wrt_cnt + 1 = num_fifo_wrs then
            ready_HFW    <= '1';
            ready_HFW    <= '1';
            if state = RUN_VLI then
            if state = RUN_VLI then
              rd_en_s      <= '1';
              rd_en_s      <= '1' and not rle_fifo_empty;
            end if;
            end if;
            fifo_wrt_cnt <= (others => '0');
            fifo_wrt_cnt <= (others => '0');
          end if;
          end if;
        end if;
        end if;
      end if;
      end if;
Line 423... Line 426...
            state       <= RUN_VLC;
            state       <= RUN_VLC;
          end if;
          end if;
 
 
        when RUN_VLC =>
        when RUN_VLC =>
          -- data valid DC or data valid AC
          -- data valid DC or data valid AC
          if (d_val_d2 = '1' and first_rle_word = '1') or
          if (d_val_d1 = '1' and first_rle_word = '1') or
             (d_val = '1' and first_rle_word = '0') then
             (d_val = '1' and first_rle_word = '0') then
            for i in 0 to C_M-1 loop
            for i in 0 to C_M-1 loop
              if i < to_integer(VLC_size) then
              if i < to_integer(VLC_size) then
                word_reg(C_M-1-to_integer(bit_ptr)-i) <= VLC(to_integer(VLC_size)-1-i);
                word_reg(C_M-1-to_integer(bit_ptr)-i) <= VLC(to_integer(VLC_size)-1-i);
              end if;
              end if;

powered by: WebSVN 2.1.0

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