AN-ENG-001. Using the AVR32 SoC for real-time video applications. Written by Matteo Vit, Approved by Andrea Marson, VERSION: 1.0.0

Similar documents
EECS150 - Digital Design Lecture 12 Project Description, Part 2

Graduate Institute of Electronics Engineering, NTU Digital Video Recorder

Pivoting Object Tracking System

PMC-704 Dual Independent Graphics Input/Output PMC

Section 14 Parallel Peripheral Interface (PPI)

Sapera LT 8.0 Acquisition Parameters Reference Manual

The World Leader in High Performance Signal Processing Solutions. Section 15. Parallel Peripheral Interface (PPI)

STPC Video Pipeline Driver Writer s Guide

Obsolete Product(s) - Obsolete Product(s)

PCI Express JPEG Frame Grabber Hardware Manual Model 817 Rev.E April 09

To discuss. Types of video signals Analog Video Digital Video. Multimedia Computing (CSIT 410) 2

Video 1 Video October 16, 2001

picasso TM 3C/3Cpro series Datasheet picasso TM 3C/3Cpro models Key features

Software Analog Video Inputs

Motion Video Compression

ATSC DVB. Macrovision COMB FILTER. SAA7130 PAL/NTSC/SECAM/TS PCI 9-Bit Video Decoder

Chrontel CH7015 SDTV / HDTV Encoder

Design and Implementation of an AHB VGA Peripheral

MIPI D-PHY Bandwidth Matrix Table User Guide. UG110 Version 1.0, June 2015

An Overview of Video Coding Algorithms

From Synchronous to Asynchronous Design

Parallel Peripheral Interface (PPI)

EAN-Performance and Latency

TMS320DM646x DMSoC Video Port Interface (VPIF) User's Guide

Digital Blocks Semiconductor IP

DT3162. Ideal Applications Machine Vision Medical Imaging/Diagnostics Scientific Imaging

7inch Resistive Touch LCD User Manual

NOW Handout Page 1. Traversing Digital Design. EECS Components and Design Techniques for Digital Systems. Lec 13 Project Overview.

MULTIMEDIA TECHNOLOGIES

Digital Blocks Semiconductor IP

EECS150 - Digital Design Lecture 12 - Video Interfacing. Recap and Outline

Lecture 2 Video Formation and Representation

The Research of Video Image Overlay Based on DM6446 Platform

OL_H264e HDTV H.264/AVC Baseline Video Encoder Rev 1.0. General Description. Applications. Features

ANDpSi025TD-LED 320 x 240 Pixels TFT LCD Color Monitor

OL_H264MCLD Multi-Channel HDTV H.264/AVC Limited Baseline Video Decoder V1.0. General Description. Applications. Features

Digital Media. Daniel Fuller ITEC 2110

06 Video. Multimedia Systems. Video Standards, Compression, Post Production

Checkpoint 2 Video Encoder

Block Diagram. dw*3 pixin (RGB) pixin_vsync pixin_hsync pixin_val pixin_rdy. clk_a. clk_b. h_s, h_bp, h_fp, h_disp, h_line

Bitec. HSMC Quad Video Mosaic Reference Design. DSP Solutions for Industry & Research. Version 0.1

UFG-10 Family USER MANUAL. Frame Grabbers. Windows 8 Windows 7 Windows XP

CONEXANT 878A Video Decoder Manual

MPEG decoder Case. K.A. Vissers UC Berkeley Chamleon Systems Inc. and Pieter van der Wolf. Philips Research Eindhoven, The Netherlands

Epiphan Frame Grabber User Guide

Building Video and Audio Test Systems. NI Technical Symposium 2008

DATASHEET HMP8154, HMP8156A. Features. Ordering Information. Applications. NTSC/PAL Encoders. FN4343 Rev.5.00 Page 1 of 34.

Alain Legault Hardent. Create Higher Resolution Displays With VESA Display Stream Compression

Frame Processing Time Deviations in Video Processors

Chapter 3 Fundamental Concepts in Video. 3.1 Types of Video Signals 3.2 Analog Video 3.3 Digital Video

Design and Implementation of Nios II-based LCD Touch Panel Application System

Dan Schuster Arusha Technical College March 4, 2010

TV Synchronism Generation with PIC Microcontroller

Hitachi Europe Ltd. ISSUE : app084/1.0 APPLICATION NOTE DATE : 28/04/99

Transitioning from NTSC (analog) to HD Digital Video

Video Output and Graphics Acceleration

Hello and welcome to this presentation of the STM32L4 Analog-to-Digital Converter block. It will cover the main features of this block, which is used

By David Acker, Broadcast Pix Hardware Engineering Vice President, and SMPTE Fellow Bob Lamm, Broadcast Pix Product Specialist

An FPGA Based Solution for Testing Legacy Video Displays

IEEE802.11a Based Wireless AV Module(WAVM) with Digital AV Interface. Outline

User's Manual for BT656Pro SDI Mod. Kit

4.3inch 480x272 Touch LCD (B) User Manual

VGA 8-bit VGA Controller

MACROVISION RGB / YUV TEMP. RANGE PART NUMBER

Multimedia. Course Code (Fall 2017) Fundamental Concepts in Video

1 Terasic Inc. D8M-GPIO User Manual

USING FUSION SYSTEM ARCHITECTURE FOR BROADCAST VIDEO. Edward Callway AMD

Presented by: Amany Mohamed Yara Naguib May Mohamed Sara Mahmoud Maha Ali. Supervised by: Dr.Mohamed Abd El Ghany

New GRABLINK Frame Grabbers

Block Diagram. pixin. pixin_field. pixin_vsync. pixin_hsync. pixin_val. pixin_rdy. pixels_per_line. lines_per_field. pixels_per_line [11:0]

Monitor and Display Adapters UNIT 4

Multimedia Systems Video I (Basics of Analog and Digital Video) Mahdi Amiri April 2011 Sharif University of Technology

A Low-Power 0.7-V H p Video Decoder

CAPTURE CAPTURE. VERSiON 1.2. Specialists in Medical. Digital Imaging Solutions

AL330B-DMB-A0 Digital LCD Display SOC Demo Board

10 Digital TV Introduction Subsampling

Technical Note PowerPC Embedded Processors Video Security with PowerPC

ATSC vs NTSC Spectrum. ATSC 8VSB Data Framing

Digital Blocks Semiconductor IP

The Project & Digital Video. Today. The Project (1) EECS150 Fall Lab Lecture #7. Arjun Singh

SHARE CONVERTER P/N SHARE PRODUCT HIGHLIGHTS EASY! No drivers required. Dual Uncompressed 1080p Video & Audio Capture Ideal for Video streaming and

NI 5431 Video Generator Instrument Driver Quick Reference Guide

Video and Image Processing Suite User Guide

Altera's 28-nm FPGAs Optimized for Broadcast Video Applications

TV Character Generator

Hi3518A Professional HD IP Camera SoC. Brief Data Sheet. Issue 03. Date Baseline Date

Rec. ITU-R BT RECOMMENDATION ITU-R BT * WIDE-SCREEN SIGNALLING FOR BROADCASTING

The Multistandard Full Hd Video-Codec Engine On Low Power Devices

RESEARCH AND DEVELOPMENT LOW-COST BOARD FOR EXPERIMENTAL VERIFICATION OF VIDEO PROCESSING ALGORITHMS USING FPGA IMPLEMENTATION

FPGA Laboratory Assignment 4. Due Date: 06/11/2012

Checkpoint 2 Video Encoder and Basic User Interface

Teletext Inserter Firmware. User s Manual. Contents

Analog Television, WiMAX and DVB-H on the Same SoC Platform

About... D 3 Technology TM.

D5CE Serial Digital Encoder

XC-77 (EIA), XC-77CE (CCIR)

Group 1. C.J. Silver Geoff Jean Will Petty Cody Baxley

GAUGE M7 Connected Display 7

5.1 Types of Video Signals. Chapter 5 Fundamental Concepts in Video. Component video

DT3130 Series for Machine Vision

Transcription:

Written by Matteo Vit, R&D Engineer Dave S.r.l. Approved by Andrea Marson, CTO Dave S.r.l. DAVE S.r.l. www.dave.eu VERSION: 1.0.0 DOCUMENT CODE: AN-ENG-001 NO. OF PAGES: 8 AN-ENG-001 Using the AVR32 SoC for real-time video applications

Printed in Italy Trademarks Ethernet is a registered trademark of XEROX Corporation All other trademarks are the property of their respective owners Copyright All rights reserved. Specifications may change any time without notification. Company Address DAVE S.r.L. Via Forniz 2 33080 Porcia (PN) Italy Phone: +39 0434 921215 e-mail: info@dave.eu URL: www.dave.eu 2

1.0.0 November 2007 First release History 3

Introduction The AVR32 is a System on Chip (SoC) from Atmel [1] specifically designed for multimedia applications like mobile media player, GPS, hand held devices and so on. The aim of this application note is to show the performance of this platform with real-time video applications. The hardware and the software described in this application note is developed under contract for one of our customers. Block Diagram The block diagram below represents the system used for this application note. The operating system is a Linux kernel 2.6.20. A user application opens the video device and copies the frames for displaying them to the LCD panel. PAL CVBS Cameras CVBS 1 CVBS 2 CVBS 3 CVBS 4 Video Decoder ITU-R BT 601 PiCo ISI 64 Mbyte SDRAM CPU core SDRAM controller LCD controller AVR32 AP7000 7 24 bit TFT LCD Capturing video from cameras The camera output is an analog CVBS PAL signal with 625 lines per frame (576 visible lines, the rest being used for other information such as sync data and captioning) and a refresh rate of 50 interlaced fields per second (i.e. 25 full frames per second). This analog signal is then sampled from the video decoder. Its output is an ITU-R BT.601 digital stream [2]. Each frame is composed of 720 x 576 pixels. According to the ITU standard, the two chrominance components 4

are sampled at half the sample rate of luminance. Since each sample is 8 bits wide, each pixel pair is stored as four bytes: two for luminance, one for blue chroma and one for red chroma. The output digital stream from the video decoder is interlaced like the analog PAL input. This means that the video decoder outputs odd and even lines separately. AVR32 Image Sensor Interface ( ISI ) The AVR32 Image Sensor Interface connects the video decoder to the processor core and to the system SDRAM. The grabbed frames are copied to system memory without CPU intervention through DMA operations. It accepts both YCrCb and RGB inputs up to a resolution of 2048 x 2048. Even if, from the datasheet, the ISI is supposed to work with ITU-R BT.601 streams, it's designed for only progressive devices (like CMOS sensors used on mobile phones and so on). This affected how the device driver is written. The ISI support both VSYNC/HSYNC synchronization and ITU-R BT.656 embedded SAV/EAV synchronization. In this application note the first synchronization method is used. Two different video paths are supported: the codec path and the preview path. The former is used for grabbing video frames (i.e. for saving them to disk), the latter for displaying directly to a LCD panel. Inside the preview path there is a scaler that can be used to match the video input size with the LCD one. The same ratio is applied for both horizontal and vertical resize. A color conversion module is also present. The maximum output resolution of the preview path is 640 x 480. The ISI block can generate an interrupt due to various reasons. The most important is Start Of Frame (SOF). This interrupt is triggered every time a new frame is detected. Because of the VSYNC/HSYNC synchronization method, the SOF interrupt rate is equal to the VSYNC frequency. Video for Linux ( V4L2 ) driver Video for Linux is the capture/overlay API for Linux kernels. The advantage of using a standard API is that every video device driver and application compliant with it can be used together. For example you can use the driver with a custom application or mainstream media player/encoder like mplayer/mencode. The driver for the ISI used in this application note is based on the Corbet's cafe_ccic driver (for the One Laptop Per Child - OLPC project). Before describing how the device driver works, a few trade-offs need to be explained. As previously stated, the video decoder output is a frame of 720 x 576 pixels with 50 interlaced fields per second. This means that the first 720 x 288 (576 / 2) pixels field contains odd lines only, the second one contains even lines only and so on. Since the ISI doesn't provide any support for interlaced input, there is no way to know if a frame contains even or odd lines. With this constraints the driver actually grabs only one field and discards the next one. A software decimation factor of 2 is applied on each line to obtain a standard 360 x 288 pixels format. The 5

scaler of the preview path (and the preview path itself) isn't used since the maximum output is 640 x 480 pixels and only symmetrical resize ratios can be used. From the V4L perspective, the driver can support both MMAP and read I/O method. After the device is open, the application can obtain information about the format supported (360 x 288 YUV). The ISI registers are written with video input resolution and the codec path is started. A ring of frame buffer is used for storing the image captured from the ISI. If the application performs MMAP I/O method another ring of buffer is used for frames interchange between kernel and user space. Displaying video After the video stream is grabbed from the V4L2 driver, it's displayed on the 7 480 x 234 LCD panel. Before doing this, a color space conversion is required because the video decoder output is YUV format while the LCD format is RGB. The matrix below is used for the color space conversion. [ R G C 10 C 11 C 12 C 20 C 21 C 22][ Y ] [O0 U O 2] 1 V O B] =[C 00 C 01 C 02 Since input and output pixels are 8 bit integer values, an optimized version can be used: R = clip(( 298 * C + 409 * E + 128) >> 8) G = clip(( 298 * C - 100 * D - 208 * E + 128) >> 8) B = clip(( 298 * C + 516 * D + 128) >> 8) The color space converter inside the preview path can't be used since its maximum output is 640 x 480 pixels, while it's supposed to be 720 x 288 for the analysis done below. Color conversion with AVR32 Pixel Coprocessor ( PiCo ) The color conversion is a computational complex task. Even if 8 bit integer math is used, for each RGB pixel seven MACs (multiplication and accumulation) are required (two matrix coefficients are zero). This means 725760 MACs for a 360 x 288 pixels frame. Using this implementation, a performance of 14 fps with 100% CPU load is achieved (with AT32AP7000 @ 140 MHz). Of course, a system with a 100% of CPU load can't be used for doing anything else useful. The next step is to use the internal AVR32 pixel coprocessor, PiCo, to speed up the color conversion process. The Pixel Coprocessor (PiCo) consists of three Vector Multiplication Units (VMU), an Input Pixel Selector and Output Pixel Inserter. Each VMU can perform a vector multiplication of a 1x3 12-bit coefficient vector with 3x1 8-bit pixel vector plus a 12-bit offset. The Input Pixel Selector is used to choose which pixel enters the VMU. The Output Pixel Inserter is used to store pixels in packed or planar format. The PiCo is composed of three pipeline stages with a throughput of one operation per CPU clock cycle. It can be used to accelerate color conversion due to the matrix like operations involved. 6

The color conversion routine loads the PiCo matrix coefficients first. Four pixel (eight bytes) at time are loaded inside the PiCo registers. Due to the chroma subsampling, two RGB pixels are computed using the same U and V value, but with adjacent Y values. Before storing the RGB pixels, four new pixels are loaded inside PiCo registers. This is used to keep full the PiCo pipeline and thus to achieve more throughput. The RGB pixels are stored in packet format directly inside the frame buffer. Enabling debugfs * Opening frame buffer... * Mmapping frame buffer... mmapfb x = 480, y = 234, bpp = 24 * Init PiCo... * Opening isi... * Initializing isi... * Start capturing... * Main loop... frame rate 25.022520 fps frame rate 25.002178 fps frame rate 25.002711 fps frame rate 25.001405 fps frame rate 25.002203 fps frame rate 25.002649 fps frame rate 25.001547 fps frame rate 25.001999 fps frame rate 25.002630 fps frame rate 25.002463 fps frame rate 25.002079 fps frame rate 25.002432 fps frame rate 25.001751 fps frame rate 25.002005 fps * Stop capturing... * Uninitialze isi... * Closing isi... * Unmapping FB... Capture done Box 1: The demo application running at 25 fps Using the PiCo for color space conversion, a performance of 25 fps (full frame rate) with only 27% CPU load is achieved (with the same AT32AP7000 @ 140 MHz). Box 2: CPU load 7

Box 3: Frame buffer screenshot Conclusion The results presented in this application note are impressive. A 360 x 288 full frame rate video stream is grabbed from the video decoder and then displayed on LCD using only the 27% of the AVR32 CPU load at 140 MHz. This means that there is room for other tasks (like user interface, other I/O operations, and so on ) using a low clock frequency and thus a low power consumption. Before the AVR32 SoC, real-time video applications can be done only using high end ARM processor (like ARM11) or dedicated DSP coprocessor. References 1: Atmel, http://www.atmel.com 2: ITU, http://www.itu.int 8