亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? framegrabber.vhd

?? xst3_video.ZIP是基于XILINX的XST3開發(fā)板的視頻采集源碼
?? VHD
字號:
--------------------------------------------------------------------
-- Company       : XESS Corp.
-- Engineer      : Dave Vanden Bout
-- Creation Date : 2/9/2006
-- Copyright     : 2006, XESS Corp
-- Tool Versions : WebPACK 6.3.03i
--
-- Description:
--    This is a finite-state machine that grabs frames of video in
--    ITU-R BT.656 4:2:2 format and creates grayscale pixels from each
--    8-bit luminance value.  The pixels are then stored in a FIFO.
--
-- Revision:
--    1.0.0
--
-- Additional Comments:
--    1.0.0:
--        Initial release.
--
-- License:
--    This code can be freely distributed and modified as long as
--    this header is not removed.
--------------------------------------------------------------------

library ieee;
use ieee.std_logic_1164.all;


package framegrabber_pckg is

  component framegrabber
    port(
      reset       : in  std_logic;      -- initiate a reset
      grab_frame  : in  std_logic;      -- initiate capture of a video frame
      -- video decoder interface
      video_clk   : in  std_logic;      -- clock from video codec (27 MHz)
      video_in    : in  std_logic_vector(7 downto 0);  -- sampled video data from codec
      -- pixel data output
      pixel_clk   : in  std_logic;      -- clock for outputing pixels from FIFO
      pixel_avail : out std_logic;      -- indicates pixel data is available in the FIFO
      pixel_rd    : in  std_logic;      -- initiate read of pixel data from the FIFO
      pixel_out   : out std_logic_vector(15 downto 0);  -- pixel data output from the FIFO
      -- miscellaneous
      status      : out std_logic_vector(7 downto 0)  -- FSM status for debugging
      );
  end component framegrabber;

end package framegrabber_pckg;



library ieee, work;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
use work.fifo_pckg.all;
use work.common.all;


entity framegrabber is
  port(
      reset       : in  std_logic;      -- initiate a reset
      grab_frame  : in  std_logic;      -- initiate capture of a video frame
      -- video decoder interface
      video_clk   : in  std_logic;      -- clock from video codec (27 MHz)
      video_in    : in  std_logic_vector(7 downto 0);  -- sampled video data from codec
      -- pixel data output
      pixel_clk   : in  std_logic;      -- clock for outputing pixels from FIFO
      pixel_avail : out std_logic;      -- indicates pixel data is available in the FIFO
      pixel_rd    : in  std_logic;      -- initiate read of pixel data from the FIFO
      pixel_out   : out std_logic_vector(15 downto 0);  -- pixel data output from the FIFO
      -- miscellaneous
      status      : out std_logic_vector(7 downto 0)  -- FSM status for debugging
    );
end framegrabber;


architecture arch of framegrabber is

-- states for the framegrabber FSM
  type fgs is (
    wait_for_embedded_sync,
    wait_for_embedded_sync_1,
    wait_for_embedded_sync_2,
    check_embedded_sync,
    grab_chromab,
    grab_luminance1,
    grab_chromar,
    grab_luminance2
    );
  signal framegrabber_state : fgs; -- framegrabber state register
	alias  es                 : std_logic_vector(video_in'range) is video_in; -- embedded sync
  signal prev_es            : std_logic_vector(video_in'range); -- previous embedded sync value
  signal prev_grab_frame    : std_logic; -- previous value for grab frame initiator
  signal grab_in_progress   : std_logic; -- indicates when frame grabbing is occuring
  signal field_id           : std_logic; -- current field of a frame of video
  signal field_change       : std_logic; -- indicates when the video field has switched from odd-to-even or even-to-odd
  signal luminance          : std_logic_vector(7 downto 0); -- luminance portion of ITU-R BT.656 format
  signal chromar            : std_logic_vector(7 downto 0); -- red chromiance portion
  signal chromab            : std_logic_vector(7 downto 0); -- blue chromiance portion
  signal pixel_wr           : std_logic; -- initiates a write of a pixel to the FIFO buffer
  signal pixel_in           : std_logic_vector(15 downto 0); -- pixel going into FIFO
  signal empty              : std_logic; -- indicates when the are no pixels in the FIFO

begin

  ----------------------------------------------------------------------------------------------
  -- Simple state machine that interprets the ITU-R BT.656 4:2:2 pixel stream from the video 
	-- decoder and latches the luminance component of the video (grayscale frame grabbing).
	-- The pixel stream is formatted as follows:
  --                    __    __    __    __    __    __    __    __         
  --       27 MHz clock   \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/.....
  --                     ____  ____  ____  ____  ____  ____  ____  ____      
  -- ITU-R BT.656 4:2:2 / FF \/ 00 \/ 00 \/ ES \/ Cb \/ Y0 \/ Cr \/ Y1 \.....
  --       Pixel Stream \____/\____/\____/\____/\____/\____/\____/\____/     
  --                    <----Embedded Sync-----><--------Pixels---------.....
	--
	-- A marker (FF-00-00) is followed by the embedded sync byte (ES).  This is followed by
	-- 1440 bytes - 720 luminance values (Y), 360 blue chromiance values (Cb) and 360 red
	-- chromiance values (Cr).
  ----------------------------------------------------------------------------------------------
  process(video_clk, reset)
  begin
    if reset = YES then
      grab_in_progress   <= NO;
      prev_grab_frame    <= NO;
      framegrabber_state <= wait_for_embedded_sync;
      status             <= "00000000";  -- Indicate the FSM is in the reset state.
    elsif rising_edge(video_clk) then
      -- Set default values for these control signals.
      field_id     <= '0';
      field_change <= NO;
      pixel_wr     <= NO;

      case framegrabber_state is

        -- The following three states look for the marker FF-00-00 that precedes
        -- the embedded sync in the pixel stream.
        when wait_for_embedded_sync =>
          if video_in = 16#FF# then
            framegrabber_state <= wait_for_embedded_sync_1;
          else
            framegrabber_state <= wait_for_embedded_sync;
          end if;
          status               <= "00000001";
        when wait_for_embedded_sync_1 =>
          if video_in = 16#00# then
            framegrabber_state <= wait_for_embedded_sync_2;
          else
            framegrabber_state <= wait_for_embedded_sync;
          end if;
          status               <= "00000010";
        when wait_for_embedded_sync_2 =>
          if video_in = 16#00# then
            framegrabber_state <= check_embedded_sync;
          else
            framegrabber_state <= wait_for_embedded_sync;
          end if;
          status               <= "00000010";

          -- Now look at the embedded sync to determine where we are in the video frame.
          -- Embedded sync bit functions:
          --   Bit 4: Horizontal sync bit.  1=end-active-video (EAV); 0=start-active-video (SAV).
          --   Bit 5: Vertical sync bit.  1=vertical blanking; 0=active video.
          --   Bit 6: Interleaved field identifier.  1=field 1; 0=field 0.
        when check_embedded_sync =>
          -- Look for EAV because all the important signals change state then.
          if es(4) = HI then
					  -- Now look for the start of a video frame as indicated by a field id of 0 and
						-- a transition of the vertical sync bit from 1 to 0.
            if es(6 downto 5) = "00" and prev_es(6 downto 5) = "01" then
						  -- Now look and see if a frame capture has just been requested and only capture
							-- a single frame per request.
              if grab_frame = YES and prev_grab_frame = NO then
                grab_in_progress <= YES;         -- Start capturing the frame.
              else
                grab_in_progress <= NO; 
              end if;
              prev_grab_frame    <= grab_frame;  -- Store the state of the frame capture request.
              -- Set the field id and the change-of-field indicator and write the pixel to
							-- the FIFO.  This pixel contains no actual image data.  It serves only to indicate
							-- the start of a frame of pixels to whatever reads from the FIFO.
              field_id           <= '0';
              field_change       <= YES;
              pixel_wr           <= YES;
            end if;

					  -- Look for the start of the interleaved field 1 in a video frame as indicated by a
						-- field id of 1 and a transition of the vertical sync bit from 1 to 0.
            if es(6 downto 5) = "10" and prev_es(6 downto 5) = "11" and grab_in_progress = YES then
              field_id     <= '1';
              field_change <= YES;
              pixel_wr     <= YES;
            end if;

            prev_es <= es; -- Store the embedded sync so we can check for field changes.
          end if;

          if es(5 downto 4)="00" and grab_in_progress=YES then
					  framegrabber_state <= grab_chromab; -- Start storing pixels if video is active and a capture is in progress.
          else
					  framegrabber_state <= wait_for_embedded_sync; -- Otherwise, wait for the next embedded sync and check again.
          end if;
          status               <= "00000100";

        -- The blue chromiance is output by the video decoder during this cycle.  Pixel values of
				-- 0xFF and 0x00 are not valid.  If 0xFF is received, then it would have to be the start
				-- of the marker preceding an embedded sync.  Any other value is a valid blue chromiance
				-- value which is ignored and the FSM moves to the next state.
        when grab_chromab =>
				  case video_in is
					  when "11111111" => framegrabber_state <= wait_for_embedded_sync_1;
						when others => framegrabber_state <= grab_luminance1;
          end case;
          status               <= "00001000";

        -- The luminance is output by the video decoder during this cycle.  If a valid luminance
				-- value is seen, the luminance is written into the FIFO and the FSM moves to the next state.
        when grab_luminance1 =>
				  case video_in is
					  when "11111111" => framegrabber_state <= wait_for_embedded_sync_1;
						when others =>
              luminance          <= video_in;
              pixel_wr           <= YES;
						  framegrabber_state <= grab_chromar;
          end case;
          status               <= "00010000";

        -- The red chromiance is output by the video decoder during this cycle.  If a valid
				-- chromiance value is seen, it is ignored and the FSM moves to the next state.
        when grab_chromar =>
				  case video_in is
					  when "11111111" => framegrabber_state <= wait_for_embedded_sync_1;
						when others => framegrabber_state <= grab_luminance2;
          end case;
          status               <= "00100000";

        -- The luminance is output by the video decoder during this cycle.  If a valid luminance
				-- value is seen, the luminance is written into the FIFO and the FSM returns to the
				-- beginning of the four-state cycle.
        when grab_luminance2 =>
				  case video_in is
					  when "11111111" => framegrabber_state <= wait_for_embedded_sync_1;
						when others =>
              luminance          <= video_in;
              pixel_wr           <= YES;
						  framegrabber_state <= grab_chromab;
          end case;
          status               <= "01000000";

        -- Handle erroneous states.
        when others =>
          framegrabber_state <= wait_for_embedded_sync;
          status             <= "10000000";
      end case;
    end if;
  end process;

  ----------------------------------------------------------------------------------------------
  -- Create a grayscale pixel by making each three-bit RGB component equal to the upper three bits
	-- of the luminance.  Also embed in the upper two bits of the pixel the current field of the
	-- frame and an indicator of whether the field has changed.  These are used to determine the
	-- start of a frame by whatever reads the pixels from the FIFO.  The format of the 16-bit pixel
	-- is CF00 000R RRGG GBBB where C = field change bit, F = field id bit, R = red, G = green,
	-- and B = blue.
  ----------------------------------------------------------------------------------------------
  pixel_in <= field_change & field_id & "00000" 
	            & luminance(7 downto 5) & luminance(7 downto 5) & luminance(7 downto 5);

  ----------------------------------------------------------------------------------------------
  -- This FIFO buffers the pixels.  The FIFO supports independent read and write clocks because
	-- whatever reads pixels from the FIFO may not be synchronized to the 27 MHz clock from the
	-- video codec that is used to write pixels to the FIFO. 
  ----------------------------------------------------------------------------------------------
  u0 : fifo_255x16_ic
    port map (
      rst      => reset,
      wr_clk   => video_clk,
      wr       => pixel_wr,
      data_in  => pixel_in,
      rd_clk   => pixel_clk,
      rd       => pixel_rd,
      data_out => pixel_out,
      full     => open,
      empty    => empty,
      level    => open
      );
  pixel_avail <= not empty; -- Pixels are available to be read if the FIFO is not empty.

end arch;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区三区乱码在线 | 91电影在线观看| 国产精品亚洲一区二区三区妖精| 五月婷婷激情综合网| 中文字幕一区二区在线观看| 亚洲国产高清aⅴ视频| 最新国产精品久久精品| 亚洲一区二区三区在线播放| 亚洲国产aⅴ天堂久久| 午夜影视日本亚洲欧洲精品| 免费精品视频在线| 粉嫩aⅴ一区二区三区四区| 成人av电影在线| 欧美精品色一区二区三区| 精品日韩99亚洲| 亚洲在线视频网站| 精彩视频一区二区三区| 在线观看免费一区| 最新不卡av在线| 久热成人在线视频| 欧美视频一二三区| √…a在线天堂一区| 韩国三级在线一区| 日韩一级免费观看| 亚洲另类春色校园小说| 国产a精品视频| 久久一夜天堂av一区二区三区 | 国内成+人亚洲+欧美+综合在线| 成人小视频免费在线观看| 在线不卡欧美精品一区二区三区| 国产精品丝袜91| 麻豆一区二区三区| 色欧美日韩亚洲| 国产亚洲精品中文字幕| 亚洲成av人影院| 99麻豆久久久国产精品免费 | 日韩久久一区二区| 久久99精品久久久久久动态图| 一本大道久久a久久综合| 日本一区二区三区免费乱视频| 日韩精品午夜视频| 欧美三级日韩三级| 亚洲国产综合色| www.欧美亚洲| 亚洲欧美视频在线观看视频| 成人网页在线观看| 久久影院电视剧免费观看| 裸体一区二区三区| 国产天堂亚洲国产碰碰| 成人性色生活片| 一区二区三区四区中文字幕| 欧美伊人精品成人久久综合97| 亚洲精品视频在线观看免费 | 国产欧美一区二区三区沐欲| 豆国产96在线|亚洲| 欧美精品一区二区久久婷婷| 国产老女人精品毛片久久| 久久综合九色综合久久久精品综合 | 久久蜜桃av一区二区天堂| 国产成人自拍网| 日本不卡123| 国产精品黄色在线观看| 欧美在线观看视频在线| 成人精品国产一区二区4080| 亚洲sss视频在线视频| 精品乱人伦小说| 欧洲一区二区三区在线| 久久国产精品99久久人人澡| 国产精品国产精品国产专区不片| 666欧美在线视频| 豆国产96在线|亚洲| 国产麻豆视频精品| 日韩在线a电影| 亚洲欧美日韩中文播放| 欧美xxxx老人做受| 欧美色图免费看| 成年人网站91| 国产另类ts人妖一区二区| 粉嫩一区二区三区性色av| 奇米影视在线99精品| 综合激情成人伊人| 久久久国产精华| 日韩欧美国产一区二区三区| 6080国产精品一区二区| 欧美人与性动xxxx| 欧美性大战久久久久久久蜜臀| 欧美在线啊v一区| 欧美日韩一卡二卡三卡 | 一区二区在线观看免费视频播放| 国产日韩欧美一区二区三区乱码 | 久久精品国内一区二区三区| 亚洲国产aⅴ天堂久久| 午夜视频一区在线观看| 亚洲成av人影院| 日本亚洲三级在线| 亚洲精品视频免费观看| 精品久久国产老人久久综合| 欧美一级片免费看| 欧美精品一区二区蜜臀亚洲| 中文字幕精品综合| 亚洲亚洲精品在线观看| 三级在线观看一区二区| 成人av在线观| 678五月天丁香亚洲综合网| 国产精品人妖ts系列视频| 国产在线国偷精品产拍免费yy| www..com久久爱| 69精品人人人人| 国产精品乱人伦中文| 亚洲综合色网站| 韩国女主播一区二区三区| 欧美视频在线一区二区三区 | 在线观看日韩一区| 精品99一区二区三区| 亚洲高清免费一级二级三级| 国产黑丝在线一区二区三区| 欧美在线观看视频在线| 午夜欧美在线一二页| 色综合咪咪久久| 国产精品看片你懂得| 韩国女主播一区| 欧美在线观看视频在线| 欧美经典三级视频一区二区三区| 亚洲成人第一页| 色香色香欲天天天影视综合网| 精品电影一区二区| 亚洲高清免费观看| 一本到三区不卡视频| 国产精品超碰97尤物18| 国产成人精品免费视频网站| 久久精品欧美日韩精品| 久久国产夜色精品鲁鲁99| 精品视频一区 二区 三区| 亚洲国产精品自拍| 日韩精品专区在线影院重磅| 极品美女销魂一区二区三区 | 亚洲欧美另类久久久精品 | 日韩欧美国产一区在线观看| 日日嗨av一区二区三区四区| 欧美日韩黄色一区二区| 天天操天天干天天综合网| 欧美视频三区在线播放| 午夜激情一区二区三区| 久久色在线观看| av中文字幕一区| 亚洲大型综合色站| 欧美变态tickle挠乳网站| 国产一区二区三区蝌蚪| 中文字幕在线视频一区| 色88888久久久久久影院按摩| 亚洲国产日韩在线一区模特| 在线视频观看一区| 久久精品国产久精国产爱| 91麻豆精品国产91久久久| 国产成人亚洲综合a∨婷婷| 一区二区三区在线观看网站| 6080国产精品一区二区| 国产福利不卡视频| 看国产成人h片视频| 亚洲男人的天堂av| 精品日韩一区二区三区| 日本高清不卡在线观看| 国产一区二区三区四区五区入口 | 亚洲毛片av在线| 国产午夜精品久久| 日韩写真欧美这视频| 色综合久久99| 色8久久精品久久久久久蜜| 国内精品伊人久久久久av影院| 欧美成人性福生活免费看| 久久99精品久久久久| 亚洲国产日韩a在线播放性色| 国产精品欧美综合在线| 26uuu亚洲| 久久久蜜臀国产一区二区| 欧美一区二区私人影院日本| 欧美日韩的一区二区| 在线一区二区观看| 精品视频1区2区3区| 欧美专区在线观看一区| 91蝌蚪porny成人天涯| 色婷婷狠狠综合| 91蜜桃网址入口| 欧美偷拍一区二区| 欧美一区二区黄色| 国产女人aaa级久久久级| 欧美高清在线视频| 一区在线观看免费| 亚洲第一久久影院| 蜜臀av一级做a爰片久久| 激情欧美一区二区| 99久久精品国产一区| 激情另类小说区图片区视频区| 一区二区三区免费网站| 亚洲欧美国产高清| 亚洲综合小说图片| 亚洲大片精品永久免费| 国产在线播放一区二区三区| 国产成人午夜电影网| 国产高清不卡二三区|