Fpga video capturing

33
IMPLEMENTATION OF AN FPGA BASED VIDEO CAPTURE CARD 1 PRESENTED BY: SHEHRYAR

description

fpga video capturing

Transcript of Fpga video capturing

Page 1: Fpga video capturing

IMPLEMENTATION OF AN FPGA BASED VIDEO CAPTURE CARD

1

PRESENTED BY: SHEHRYAR

Page 2: Fpga video capturing

SEQUENCE

• Project Aim• Spartan 3A Board Overview• Available Tools• Adopted Path• Xilinx Platform Studios• Video Capture• Universal Serial Bus• Challenges

2

Page 3: Fpga video capturing

SEQUENCE (CONTD.)

• Video Compression• AccelDSP• Challenges• Future Work• Questions

3

Page 4: Fpga video capturing

PROJECT AIM

• FPGA based video capture card • Input from an Analog VGA source– Resolution = 1024x768 pixels– Frame Rate= 30 fps– Format = RGB (8:8:8)– Data Rate = 566 Mbps

• Output through a USB 2.0 port – Interfacing VGA with USB– Data Rate = 480 Mbps at hi-speed

4

Page 5: Fpga video capturing

PROJECT AIM (CONTD.)

• Video compression– Data Rate reduction– Memory reduction

• Capture and storage of compressed video data on PC– Standard video format

• Play back through media player• Major parts of project– Video capturing– USB interfacing– Video compression

5

Page 6: Fpga video capturing

SPARTAN 3A BOARD OVERVIEW

6

Page 7: Fpga video capturing

SPARTAN 3A BOARD OVERVIEW (contd.)

• FMC-Video daughter board

7

Page 8: Fpga video capturing

AVAILABLE TOOLS

• Integrated Software Environment

• Xilinx Platform Studios

• System Generator

• AccelDSP

8

Page 9: Fpga video capturing

ADOPTED PATH

• Xilinx Platform Studios– Video Capturing– USB Interface

• AccelDSP– Video compression core

9

Page 10: Fpga video capturing

XILINX PLATFORM STUDIOS

• Embedded processor system– Microblaze– Libraries and drivers– Integration of hardware with software

10

Page 11: Fpga video capturing

XILINX PLATFORM STUDIOS (CONTD.)

11

Page 12: Fpga video capturing

VIDEO CAPTURE

• VGA Analog input– RGB Intensity Signal– Hsync, Vsync

• IIC Programming– Desired mode and resolution– XPS IIC PCORE

• DVI input PCORE– Unified bus interface

12

Analog Interface AD9984A

Page 13: Fpga video capturing

VIDEO CAPTURE

13

Microblaze Processor

Processor Local Bus

BRAM

ILMB DLMB

XPS IIC PCORE

IIC MUXPCA 9546A

Analog Interface AD9984A

Digital ReceiverTFP403

DVI Input PCORE

DVI-I Port

FPGA

Page 14: Fpga video capturing

VIDEO CAPTURE (CONTD.)

• DE-Gen PCORE– Data Enable signal – Generated from HSYNC and VSYNC signals combined with

front porch and back porch values– Output fully captured video signal

14

Page 15: Fpga video capturing

VIDEO CAPTURE (CONTD.)

15

Microblaze Processor

Processor Local Bus

BRAM

ILMB DLMB

XPS IIC PCORE

IIC MUXPCA 9546A

Analog Interface AD9984A

Digital ReceiverTFP403

DVI Input PCORE

DVI-I Port

FPGA

DE-GenOther Cores

Page 16: Fpga video capturing

UNIVERSAL SERIAL BUS

• Introduction– Serial Bus– 4 Wires– Host Controlled– USB Devices

• Unique Addresses• 8 Endpoints

– USB protocol• Token packet• Data packet• Status packet

16

Page 17: Fpga video capturing

FPGA

UNIVERSAL SERIAL BUS (CONTD.)

17

Cypress CY7C67300

MICROBLAZE

USB PortPC

USB Controller RISC Core

Proc

esso

r Loc

al B

us

BRAM

ILMB DLMB

SIE

Host Port

Interface

Spartan 3A DSP 3400 Board

USB port

Page 18: Fpga video capturing

CHALLANGES

• Understanding of different languages– HDL– C/C++

• Learning of XPS– Integration of PCOREs– Developing the driver – Integrating software with hardware

• Development of USB controller– Difficult as RISC processor is involved

18

Page 19: Fpga video capturing

VIDEO COMPRESSION

• What is Video• What is Compression• Need for Compression– Space requirements

• Storage constraints

– Bandwidth requirements• Channel constraints

Page 20: Fpga video capturing

VIDEO COMPRESSION (CONTD.)

• Spatial Redundancies– Correlation between adjacent data points– Intra –within the frame

• Temporal Redundancies– Correlation between different frames in a video– Inter –across the frames– uses block-based motion compensation

20

Page 21: Fpga video capturing

VIDEO COMPRESSION (CONTD.)

• Three types of frames– I frame –key frame– P frame –Predicted frame– B frame –Bidirectional predicted frame

21

Page 22: Fpga video capturing

VIDEO COMPRESSION (CONTD.)

• To encode a frame each operation is performed at macroblock (MB) level (n x n block of pixel. n=16 )– Intra coded frame (I): every MB of the frame is coded using spatial

redundancy– Inter coded frame (P): most of the MBs of the frame are coded

exploiting temporal redundancy (in the past) – Bi-predictive frame (B): most of the MBs of the frame are coded

exploiting temporal redundancy in the past and in the future

• Group of Picture (GOP): – sequence of pictures between two I-frames

22

Page 23: Fpga video capturing

VIDEO COMPRESSION (CONTD.)

• Exploiting Spatial Redundancies– RGB to YCC

• Chrominance vs luminance• Chroma-sub sampling• Sensation of human eye

– 8x8 Blocks– DCT2

• Frequency Domain• Real part of FFT• DC and AC coefficients • Easy to implement

Page 24: Fpga video capturing

VIDEO COMPRESSION (CONTD.)

• Exploiting Spatial Redundancies– Zig Zag Scan

• Scan Pattern

– Quantization• Quantization Table• Quantization threshold value• Truncation of coefficients• High frequency values approaching zero

Page 25: Fpga video capturing

VIDEO COMPRESSION (CONTD.)

• Exploiting Spatial Redundancies– Run Length Encoding

• Consecutive coefficients with the same value• Assigning number of repetitions of same value

– Huffman Encoding• Order of probability of occurrence• Huffman Table

25

Page 26: Fpga video capturing

VIDEO COMPRESSION (CONTD.)

26

Page 27: Fpga video capturing

VIDEO COMPRESSION (CONTD.)

• Exploiting Temporal Redundancies– Motion Estimation

• Two consecutive frames • Macroblock comparison• Recovery of motion vector

– Motion Compensation• Frame segmentation• Block matching • Motion vector correction(prediction error)• Sending prediction error

Page 28: Fpga video capturing

VIDEO COMPRESSION (CONTD.)

28

Page 29: Fpga video capturing

VIDEO COMPRESSION (CONTD.)

Page 30: Fpga video capturing

AccelDSP

• Xilinx FPGA tool • Transform Matlab syntax to HDL• Exports the HDL design to System Generator

30

BITSTRAEM

Page 31: Fpga video capturing

COMPLETE DESIGN IN FPGA

31

DVI-I in DE-Gen Frame Buffer

USB Controller

Video Compression

Microblaze Processor

Processor Local Bus

BRAM

ILMB

DLMB

XPS IIC PCORE

Page 32: Fpga video capturing

THANKYOU

32

Page 33: Fpga video capturing

QUESTIONS?

33