TKT-2431 SoC design. Introduction to exercises. SoC design / September 10

Similar documents
TKT-2431 SoC design. Introduction to exercises

2014 Summer School on MPEG/VCEG Video. Video Coding Concept

Video Compression An Introduction

Digital Video Processing

Multimedia Decoder Using the Nios II Processor

IMAGE COMPRESSION. Image Compression. Why? Reducing transportation times Reducing file size. A two way event - compression and decompression

ECE 417 Guest Lecture Video Compression in MPEG-1/2/4. Min-Hsuan Tsai Apr 02, 2013

An H.264/AVC Main Profile Video Decoder Accelerator in a Multimedia SOC Platform

DigiPoints Volume 1. Student Workbook. Module 8 Digital Compression

Index. 1. Motivation 2. Background 3. JPEG Compression The Discrete Cosine Transformation Quantization Coding 4. MPEG 5.

MPEG-4: Simple Profile (SP)

Interframe coding A video scene captured as a sequence of frames can be efficiently coded by estimating and compensating for motion between frames pri

Video Compression MPEG-4. Market s requirements for Video compression standard

NIOS CPU Based Embedded Computer System on Programmable Chip

Digital Image Representation Image Compression

VC 12/13 T16 Video Compression

Interactive Progressive Encoding System For Transmission of Complex Images

Lecture 5: Compression I. This Week s Schedule

ESE532: System-on-a-Chip Architecture. Today. Message. Project. Expect. Why MPEG Encode? MPEG Encoding Project Motion Estimation DCT Entropy Encoding

Compression II: Images (JPEG)

CHAPTER 1 Introduction of the tnano Board CHAPTER 2 tnano Board Architecture CHAPTER 3 Using the tnano Board... 8

Professor Laurence S. Dooley. School of Computing and Communications Milton Keynes, UK

COMP 249 Advanced Distributed Systems Multimedia Networking. The Video Data Type Coding & Compression Basics

Hardware Software Co-design and SoC. Neeraj Goel IIT Delhi

CPE 200L LABORATORY 4: INTRODUCTION TO DE2 BOARD UNIVERSITY OF NEVADA, LAS VEGAS GOALS: BACKGROUND:

Video Compression Standards (II) A/Prof. Jian Zhang

VIDEO COMPRESSION STANDARDS

Introduction to Video Compression

Cross Layer Protocol Design

CS 335 Graphics and Multimedia. Image Compression

The Implement of MPEG-4 Video Encoding Based on NiosII Embedded Platform

Multimedia Standards

Fundamentals of Video Compression. Video Compression

Introduction to VHDL Design on Quartus II and DE2 Board

CMPT 365 Multimedia Systems. Media Compression - Video

Fernando Pereira. Instituto Superior Técnico

Topic 5 Image Compression

DE2 Board & Quartus II Software

Week 14. Video Compression. Ref: Fundamentals of Multimedia

NIOS CPU Based Embedded Computer System on Programmable Chip

FPGA based High Performance CAVLC Implementation for H.264 Video Coding

EMBEDDED SOPC DESIGN WITH NIOS II PROCESSOR AND VHDL EXAMPLES

DSP Solutions For High Quality Video Systems. Todd Hiers Texas Instruments

ECE332, Week 2, Lecture 3. September 5, 2007

ECE332, Week 2, Lecture 3

Lecture 6: Compression II. This Week s Schedule

Low power context adaptive variable length encoder in H.264

Module 6 STILL IMAGE COMPRESSION STANDARDS

Lecture 8 JPEG Compression (Part 3)

7.5 Dictionary-based Coding

In the name of Allah. the compassionate, the merciful

Lecture 12: Compression

Computer and Machine Vision

Multi-level Design Methodology using SystemC and VHDL for JPEG Encoder

CMPT 365 Multimedia Systems. Media Compression - Image

Multimedia Systems Image III (Image Compression, JPEG) Mahdi Amiri April 2011 Sharif University of Technology

Pipelined Fast 2-D DCT Architecture for JPEG Image Compression

Image Coding and Data Compression

15 Data Compression 2014/9/21. Objectives After studying this chapter, the student should be able to: 15-1 LOSSLESS COMPRESSION

ESE532 Spring University of Pennsylvania Department of Electrical and System Engineering System-on-a-Chip Architecture

Upcoming Video Standards. Madhukar Budagavi, Ph.D. DSPS R&D Center, Dallas Texas Instruments Inc.

Image and Video Coding I: Fundamentals

CSEE W4840 Embedded System Design Lab 1

Table 1: Example Implementation Statistics for Xilinx FPGAs

Chapter 10. Basic Video Compression Techniques Introduction to Video Compression 10.2 Video Compression with Motion Compensation

Welcome Back to Fundamentals of Multimedia (MR412) Fall, 2012 Chapter 10 ZHU Yongxin, Winson

JPEG decoding using end of block markers to concurrently partition channels on a GPU. Patrick Chieppe (u ) Supervisor: Dr.

IMAGE COMPRESSION. Chapter - 5 : (Basic)

Digital Systems Design. System on a Programmable Chip

Part 1 of 4. MARCH

Implementing the specification. SoC design / September 09

DIGITAL TELEVISION 1. DIGITAL VIDEO FUNDAMENTALS

MPEG-2. And Scalability Support. Nimrod Peleg Update: July.2004

Advanced course on Embedded Systems design using FPGA

AUDIOVISUAL COMMUNICATION

Laboratoire d'informatique, de Robotique et de Microélectronique de Montpellier Montpellier Cedex 5 France

An introduction to JPEG compression using MATLAB

LIST OF TABLES. Table 5.1 Specification of mapping of idx to cij for zig-zag scan 46. Table 5.2 Macroblock types 46

Lecture 4: Video Compression Standards (Part1) Tutorial 2 : Image/video Coding Techniques. Basic Transform coding Tutorial 2

Ch. 4: Video Compression Multimedia Systems

Outline Introduction MPEG-2 MPEG-4. Video Compression. Introduction to MPEG. Prof. Pratikgiri Goswami

MULTIMEDIA COMMUNICATION

Chapter 1. Digital Data Representation and Communication. Part 2

ROI Based Image Compression in Baseline JPEG

JPEG: An Image Compression System. Nimrod Peleg update: Nov. 2003

NIOS CPU Based Embedded Computer System on Programmable Chip

Fernando Pereira. Instituto Superior Técnico. Comunicação de Áudio e Vídeo, Fernando Pereira

Rate Distortion Optimization in Video Compression

Digital Video Compression and H.261 Recommendation

ALMA TECHNOLOGIES VIDEO ENCODING & IMAGE COMPRESSION PRODUCTS CATALOG. Copyright 2012 ALMA TECHNOLOGIES S.A. All rights reserved.

Perceptual Coding. Lossless vs. lossy compression Perceptual models Selecting info to eliminate Quantization and entropy encoding

Review and Implementation of DWT based Scalable Video Coding with Scalable Motion Coding.

Audio and video compression

IMPLEMENTATION OF TIME EFFICIENT SYSTEM FOR MEDIAN FILTER USING NIOS II PROCESSOR

Compression Part 2 Lossy Image Compression (JPEG) Norm Zeck

Multimedia Networking ECE 599

Megapixel Video for. Part 2 of 4. Brought to You by. Presented by Video Security Consultants

Lecture 5: Video Compression Standards (Part2) Tutorial 3 : Introduction to Histogram

The Basics of Video Compression

10.2 Video Compression with Motion Compensation 10.4 H H.263

Transcription:

TKT-2431 SoC design Introduction to exercises

Assistants: Exercises and the project work Juha Arvio juha.arvio@tut.fi, Otto Esko otto.esko@tut.fi In the project work, a simplified H.263 video encoder is implemented on Altera DE2 FPGA Development and Education board The projects work consists of a set of exercises After successfully finishing each exercise, one should have a working H.263 video encoder Exercises: Mon 14-16, Tue 14-16, Thu 8-10 (TC417) Assistance not available in any other time All needed software is installed on the PCs of the class and can be used whenever the class is not reserved for other courses

Exercises and the project work Attending the exercise hours is voluntary The following assignment is introduced Tools and algorithms are introduced Hints are given Questions are answered Completing each of the exercises is mandatory The returns have to be in time The returns have to be accepted Project work is carried out in groups of 1-2 students Groups of 2 persons are preferred

Exercises and the project work The project work consists of several phases and sub-tasks Receiving and understanding the system requirements Writing a system specification Software implementation of the encoder Functional verification on PC workstation Migrating the SW implementation onto FPGA Verification and performance profiling for pure SW implementation HW/SW partitioning and hardware acceleration Verification and performance profiling for accelerated implementation Documentation

Exercises and the project work Completed project work is valid for three successive exams Bonus points The maximum amount of bonus points is 6 Given according to the quality of returned exercises Bonus point criteria will be explained during the first exercises More detailed description about the project work will be given during the first exercises http://www.tkt.cs.tut.fi/kurssit/2431

Exercise 1 / Part 1 Introduction to topic

Topic of the work A simplified H.263 video encoder on DE2 FPGA Education and Development board The system design flow Introducing the requirements for video encoder Functional specification is written Software implementation written in ANSI C language of the video encoder algorithm is made and verified on PC workstation Initial hardware architecture containing a single Nios II softcore CPU and necessary peripherals is synthesized for FPGA Software version is migrated to Nios II processor on FPGA Design is partitioned into software and hardware according to the profiling result of software implementation DCT algorithm is accelerated with dedicated logic Accelerated system is implemented and verified on FPGA Performance analysis is carried out for the accelerated system as well and compared with the pure software implementation

H.263 The basics of H.263 video encoding are explained during following exercises Students are encouraged to get familiar with video encoding algorithms in general before they start the project H.263 has a lot in common with algorithms like JPEG and MPEG-2 A very simplified version of H.263 video encoder (resembling motion JPEG) is used. Only INTRA coding (i.e. prediction of subsequent frames is not applied) Algorithms used are DCT (Discrete Cosine Transform), Quantization, RLE (Run-Length Encoding), and VLC coding

Software Altera Quartus II v7.2 System development front-end Schematic editing FPGA synthesis SOPC builder for building Avalon/Nios based systems Integrated Iogic analyzer Nios II IDE Software development environment for Nios II processor Part of Nios II development kit Mentor Graphics ModelSim Simulating own VHDL blocks/designs ffplay video player tmndec H.263 decoder nios2-terminal Terminal software for reading from jtag uart

Hardware Altera DE2 Development and Education Board Cyclone II 2C35 FPGA 33,216 logic elements 483,840 bits of embedded RAM 35 Embedded multipliers 4 PLLs 475 User I/O pins (at maximum) External memory devices 4 MB Flash 512 KB SRAM 8 MB SDRAM RS-232 serial port Used for communication between PC and Nios II processor USB blaster port Used for programming the FPGA (memory contents and HW configuration) In addition, the board contains following peripherals (not so relevant for the project) Ethernet MAC/PHY device 4x user push-buttons, 18x toggle switches 18x red user leds, 9x green user leds 8x dual 7-segment display 2x expansion headers (40 user I/O pins / header) SD flash connector header 50 MHz and 27 MHz Oscillators

Exercise returns Exercises are returned as follows: Return for an exercise has to be made before the next week s sunday at 23:59 by E-mail The return has to be made to the corresponding assistant (Juha Arvio or Otto Esko) All the required documents have to be in either pdf or pure text-file format The subject for the email has the following form: SOCD_Ex<exercise_number>_G<group_number> where <exercise_number> is the number of the exercise in question and <group_number> is the number of your group.

Bonus points Three main exercise returns are rated Excellent: 1 bonus point for the exam The returned document is very good and/or the returned source codes work correctly and are well done Accepted: no bonus The returned document or code is acceptable Rejected: no bonus, the return has to be corrected Use common sense: Do not return rubbish! All the exercises have to be accepted At maximum six bonus points for the exam can be obtained 1 point can be obtained from each of the exercises 2, 5, 12 1 point for the first functional (HW accelerated) encoder implementation 2 points for the fastest encoder implementation 1 point for the second fastest encoder

Exercise 1, Part 2 Introduction to algorithms

Requirements for Video Transmission Communication delay More important in video conferencing applications than in file-based streaming applications Should be as low as possible (< 250 ms, even 150 ms) Should be kept as constant as possible Avoiding burst of frames followed by a still image Buffering Frame rate Affects to perceived smoothness of motion Under 10 fps video stream is perceived as fast slide show Image resolution Directly proportional to data size of a raw image Depends on the application

Introduction to H.263 Standard May 1996, ITU-T recommendation v1 Block-based ( Macroblock size is 16 pixels by 16 lines ) Motion estimation for temporal redundancy reduction Same objects are likely to be present in adjacent frames Half pixel accurate motion vectors DCT for spatial redundancy reduction 8 x 8 blocks Adjacent pixel values have only a little difference Quantization (lossy) Control of compression ratio RLE and Huffman as entropy coding algorithms

Block Diagram of H.263 Encoder + pre-processing + DCT Q Entropy coding 1/2 pixel accurate (interpolation) - Mot. Comp v(u,v) Mot. Est. Prediction error computation In Intra mode, MBs are coded directly Q -1 IDCT motion vector v(u,v) Previous reconstructed pictures (same image as the decoder observes) 7 0 4 0 0 0 0 1 1 9 3 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 bits out (Huffman, VLC) No need to send zeros in 8x8 block to the decoder

Motion Estimation Previous reconstructed frame Current frame Motion vector (u,v) -p -p p 16 16 p claire.qcif original Detected motion - + + Macroblock's prediction error ( to be encoded ) claire.qcif previous reconstructed

Discrete Cosine Transform (DCT) Assumption: Adjacent pixels differ only a little from each other Thus, data in the frequency domain is easier to compress Spatial domain compression Pixels are grouped into blocks and the blocks are then transformed into frequency domain Essential information is then in more compact form Important DCT-coefficients in upper-left corner, that is, in low frequencies Compression is achieved by discarding the less important information of the transformed block Quantization of coefficients DCT itself is a lossless transform Limited accuracy with coefficients, however, leads to some loss of information

Entropy Encoding After quantization, the quantized coefficients are compressed in a lossless manner using entropy encoding Run-length coding Lower amplitude coefficient likely to be zero Arrange successive quantized non-zero coefficients into combinations of (LAST, RUN, LEVEL) Last = Whether this is the final non-zero coefficient in the block RUN =Number of preceding zeros LEVEL = sign and magnitude of the non-zero coefficient Coefficients are processed in zig-zag order Due to the fact that running zeros are most likely located at higher frequencies Huffman coding (variable length coding) After RLE coefficients are encoded based on the statistical characteristics Shorter codewords for symbols which occur with high probability

H.263 Project work A simplified version of H.263 video encoder (resembling motion JPEG) is used. only INTRA coding (i.e. prediction of subsequent frames is not applied) used algorithms are DCT (Discrete Cosine Transform), quantization, RLE (Run-Length Encoding), and VLC coding. Image resolution used is QCIF (176 x 144) Encoder: pre-processing DCT Q Entropy coding 011001011 Decoder: 011001011 Entropy decoding Q -1 IDCT Reconstructed pictures

Documentation Verification Design flow Requirements Specification Performance analysis SW Implementation Performance analysis HW/SW partitioning Performance analysis Final Implementation

Specification In this week the specification of the encoder is started Required C source codes for the encoder are pre-given Can be downloaded from course web-pages You have to write a simple specification for the video encoder system you are going to implement Specification does not have to be long It is the quality of the contents that matters 4-7 pages in total (including the chapters introduced on next week) The specification should be written before the implementation An implementation document will be written later A diagram of the video encoding flow is required Control and data flow diagram describing how the pre-given H.263 functions are used

Specification (2) 1. Introduction What is being specified 2. Flow of encoding Present different phases of the encoding Explain the encoding flow briefly A flow diagram of encoding is required! 3. Encoder interface Inputs and outputs of encoder What kind of data is read in? What is the output data like? 4.Description of algorithms Function prototypes Description of function parameters and return values Description of function behavior and purpose in this design At least DCT, quantization, RLE, and VLC have to be covered here The subsequent sections will be written in exercise 2.

Links on H.263 related material http://www.itu.int/rec/t-rec-h.263/ ITU-T specification of H.263 http://www.jaxstream.com/products/jaxspeed/wp_m4venc.pdf Basics of MPEG-4 video encoding http://www.ece.purdue.edu/~ace/jpeg-tut/jpegtut1.html JPEG tutorial