FAST MODE DECISION IN H264/AVC VIDEO CODEC NIRANJAN MULAY (0393251) CHEN GAO(0401840) (EL6123: PROJECT PRESENTATION) 05/06/2010.

Slides:



Advertisements
Similar presentations
Introduction to H.264 / AVC Video Coding Standard Multimedia Systems Sharif University of Technology November 2008.
Advertisements

H.264 Intra Frame Coder System Design Özgür Taşdizen Microelectronics Program at Sabanci University 4/8/2005.
MPEG4 Natural Video Coding Functionalities: –Coding of arbitrary shaped objects –Efficient compression of video and images over wide range of bit rates.
A Performance Analysis of the ITU-T Draft H.26L Video Coding Standard Anthony Joch, Faouzi Kossentini, Panos Nasiopoulos Packetvideo Workshop 2002 Department.
-1/20- MPEG 4, H.264 Compression Standards Presented by Dukhyun Chang
Technion - IIT Dept. of Electrical Engineering Signal and Image Processing lab Transrating and Transcoding of Coded Video Signals David Malah Ran Bar-Sella.
1 Video Coding Concept Kai-Chao Yang. 2 Video Sequence and Picture Video sequence Large amount of temporal redundancy Intra Picture/VOP/Slice (I-Picture)
A Highly Parallel Framework for HEVC Coding Unit Partitioning Tree Decision on Many-core Processors Chenggang Yan, Yongdong Zhang, Jizheng Xu, Feng Dai,
H.264/AVC Baseline Profile Decoder Complexity Analysis Michael Horowitz, Anthony Joch, Faouzi Kossentini, and Antti Hallapuro IEEE TRANSACTIONS ON CIRCUITS.
1 Adaptive slice-level parallelism for H.264/AVC encoding using pre macroblock mode selection Bongsoo Jung, Byeungwoo Jeon Journal of Visual Communication.
Li Liu, Robert Cohen, Huifang Sun, Anthony Vetro, Xinhua Zhuang BMSB
CABAC Based Bit Estimation for Fast H.264 RD Optimization Decision
Wei Zhu, Xiang Tian, Fan Zhou and Yaowu Chen IEEE TCE, 2010.
Ch. 6- H.264/AVC Part I (pp.160~199) Sheng-kai Lin
Outline Introduction Introduction Fast Inter Prediction Mode Decision for H.264 – –Pre-encoding An Efficient Inter Mode Decision Approach for H.264 Video.
Overview of the H.264/AVC Video Coding Standard
H.264/Advanced Video Coding – A New Standard Song Jiqiang Oct 21, 2003.
Low-complexity mode decision for MVC Liquan Shen, Zhi Liu, Ping An, Ran Ma and Zhaoyang Zhang CSVT
1 Single Reference Frame Multiple Current Macroblocks Scheme for Multiple Reference IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS FOR VIDEO TECHNOLOGY Tung-Chien.
Analysis, Fast Algorithm, and VLSI Architecture Design for H
H.264 / MPEG-4 Part 10 Nimrod Peleg March 2003.
2005/12/06 1 Fast Intermode Decision in H.264/AVC Video Coding D. Wu, F. Pan, K. P. Lim, S. Wu, Z. G. Li, X. Lin, S. Rahardja, and C. C. Ko 老師 : 楊士萱 博士.
2015/6/271 Intra-Prediction in H.264(JM82) Student : 林鴻志 Advisor : 杭學鳴 教授.
1 An Efficient Mode Decision Algorithm for H.264/AVC Encoding Optimization IEEE TRANSACTION ON MULTIMEDIA Hanli Wang, Student Member, IEEE, Sam Kwong,
Feature-Based Intra-/InterCoding Mode Selection for H.264/AVC C. Kim and C.-C. Jay Kuo CSVT, April 2007.
Source-Channel Prediction in Error Resilient Video Coding Hua Yang and Kenneth Rose Signal Compression Laboratory ECE Department University of California,
BY AMRUTA KULKARNI STUDENT ID : UNDER SUPERVISION OF DR. K.R. RAO Complexity Reduction Algorithm for Intra Mode Selection in H.264/AVC Video.
BY AMRUTA KULKARNI STUDENT ID : UNDER SUPERVISION OF DR. K.R. RAO Complexity Reduction Algorithm for Intra Mode Selection in H.264/AVC Video.
Optimizing Baseline Profile in H
An Introduction to H.264/AVC and 3D Video Coding.
EE 5359 H.264 to VC 1 Transcoding Vidhya Vijayakumar Multimedia Processing Lab MSEE, University of Arlington Guided.
Liquan Shen Zhi Liu Xinpeng Zhang Wenqiang Zhao Zhaoyang Zhang An Effective CU Size Decision Method for HEVC Encoders IEEE TRANSACTIONS ON MULTIMEDIA,
By Sudeep Gangavati ID EE5359 Spring 2012, UT Arlington
Kai-Chao Yang Hierarchical Prediction Structures in H.264/AVC.
Digital Video Compression Fundamentals and Standards Web Technology.
Outline JVT/H.26L: History, Goals, Applications, Structure
Adaptive Multi-path Prediction for Error Resilient H.264 Coding Xiaosong Zhou, C.-C. Jay Kuo University of Southern California Multimedia Signal Processing.
- By Naveen Siddaraju - Under the guidance of Dr K R Rao Study and comparison of H.264/MPEG4.
Video Compression Standards for High Definition Video : A Comparative Study Of H.264, Dirac pro And AVS P2 By Sudeep Gangavati EE5359 Spring 2012, UT Arlington.
EE 5359 TOPICS IN SIGNAL PROCESSING PROJECT ANALYSIS OF AVS-M FOR LOW PICTURE RESOLUTION MOBILE APPLICATIONS Under Guidance of: Dr. K. R. Rao Dept. of.
High Efficiency Video Coding Kiana Calagari CMPT 880: Large-scale Multimedia Systems and Cloud Computing.
2 3 Be introduced in H.264 FRExt profile, but most H.264 profiles do not support it. Do not need motion estimation operation.
- By Naveen Siddaraju - Under the guidance of Dr K R Rao Study and comparison between H.264.
Figure 1.a AVS China encoder [3] Video Bit stream.
Study and Optimization of the Deblocking Filter in H.265 and its Advantages over H.264 By: Valay Shah Under the guidance of: Dr. K. R. Rao.
Computational Complexity Management of a Real-Time H.264/AVC Encoder C S Kannangara, I E Richardson, and A J Miller CSVT
Fast motion estimation and mode decision for H.264 video coding in packet loss environment Li Liu, Xinhua Zhuang Computer Science Department, University.
Video Coding Using Spatially Varying Transform Cixun Zhang, Kermal Ugur, Jani Lainema, Antti Hallapuro and Moncef IEEE TRANSACTIONS ON CIRCUITS AND SYSTEM.
High-efficiency video coding: tools and complexity Oct
Vamsi Krishna Vegunta University of Texas, Arlington
IEEE Transactions on Consumer Electronics, Vol. 58, No. 2, May 2012 Kyungmin Lim, Seongwan Kim, Jaeho Lee, Daehyun Pak and Sangyoun Lee, Member, IEEE 報告者:劉冠宇.
UNDER THE GUIDANCE DR. K. R. RAO SUBMITTED BY SHAHEER AHMED ID : Encoding H.264 by Thread Level Parallelism.
-BY KUSHAL KUNIGAL UNDER GUIDANCE OF DR. K.R.RAO. SPRING 2011, ELECTRICAL ENGINEERING DEPARTMENT, UNIVERSITY OF TEXAS AT ARLINGTON FPGA Implementation.
Porting of Fast Intra Prediction in HM7.0 to HM9.2
Transcoding from H.264/AVC to HEVC
Video Compression—From Concepts to the H.264/AVC Standard
UNDER THE GUIDANCE DR. K. R. RAO SUBMITTED BY SHAHEER AHMED ID : Encoding H.264 by Thread Level Parallelism.
Outline  Introduction  Observations and analysis  Proposed algorithm  Experimental results 2.
Implementation and comparison study of H.264 and AVS china EE 5359 Multimedia Processing Spring 2012 Guidance : Prof K R Rao Pavan Kumar Reddy Gajjala.
Multi-Frame Motion Estimation and Mode Decision in H.264 Codec Shauli Rozen Amit Yedidia Supervised by Dr. Shlomo Greenberg Communication Systems Engineering.
Computational Controlled Mode Selection for H.264/AVC June Computational Controlled Mode Selection for H.264/AVC Ariel Kit & Amir Nusboim Supervised.
Perceptually-Driven Video Coding with the Daala Video Codec
Complexity varying intra prediction in H.264 Supervisors: Dr. Ofer Hadar, Mr. Evgeny Kaminsky Students: Amit David, Yoav Galon.
Introduction to H.264 / AVC Video Coding Standard Multimedia Systems Sharif University of Technology November 2008.
Overview of the Scalable Video Coding
Research Topic Error Concealment Techniques in H.264/AVC for Wireless Video Transmission Vineeth Shetty Kolkeri EE Graduate,UTA.
Study and Optimization of the Deblocking Filter in H
Fast Decision of Block size, Prediction Mode and Intra Block for H
MPEG4 Natural Video Coding
Bongsoo Jung, Byeungwoo Jeon
Presentation transcript:

FAST MODE DECISION IN H264/AVC VIDEO CODEC NIRANJAN MULAY ( ) CHEN GAO( ) (EL6123: PROJECT PRESENTATION) 05/06/2010

Outline: Introduction to H.264/AVC coding standard Mode decisions in H.264/AVC - Intra Block - Inter Block RDO algorithm and the need for FMD FMD (for Intra and Inter) Literature survey: edge-map based FMD Study of x264 code and encoding options Implementation: -Generation of MB mode statistics file from X264 -Visualize the modes in Matlab -Intra FMD; Inter FMD Summary and future work

Introduction to H.264/AVC Coding Standard The key features of H.264:  Improved Intra prediction: Directional spatial prediction  Enhanced Temporal Prediction: -Motion compensation with variable block sizes from 4x4 to 16x16: reduces ‘prediction error’ -Quarter-pel accurate motion estimation -Multiple reference for motion estimation -Weighted prediction (for B and P frames)  DCT-like integer transform: No mismatch between encoder and decoder

Introduction to H.264/AVC Coding Standard(Cntd)  Efficient entropy coding: -Uses arithmetic entropy coding, has option for VLC coding -Context adaptive entropy coding: 2 options – CAVLC and CABAC  Variable size (primarily 4x4 along with 8x8,16x16) transform: - Smaller size helps to represent a signal in locally adaptive manner which reduces ringing artifacts. - Generally high frequency=> 4x4 and low frequency=> 16x16  In-loop deblocking filter: Reduces blocking artifacts, improves quality.  Special Error Resilient Tools

H.264 Intra Modes:  Intra 4x4 : useful for a MB with significant detail  Intra 16x16 : good for coding very smooth areas (Intra 8x8 chroma: similar to intra 16x16)  I_PCM : no prediction or transform

‘Intra 16x16’:  Mode 0 (vertical): extrapolation from upper samples.  Mode 1 (horizontal): extrapolation from left samples.  Mode 2 (DC): mean of upper and left-hand samples.  Mode 3 (Plane): plane prediction based on a linear spatial interpolation by using the upper and left-hand samples of the MB.

Intra 4x4’: ‘Intra 4x4’: Figure:4x4 luma prediction mode

Intra 4x4 Intra 4x4(Cntd):  Mode 0: Vertical  Mode 1: Horizontal  Mode 2: DC prediction  Mode 3: Diagonal down-left  Mode 4: Diagonal down-right  Mode 5: Vertical-right  Mode 6: Horizontal-down  Mode 7: Vertical-left  Mode 8: Horizontal-up

H.264 Inter Modes:  Hierarchical Decision  Level-1 (Partition): Compute RD-cost for: 16x16, 16x8, 8x16, 8x8.  Level-2 (Sub-Partition): If level-1 => 8x8, Then, compute RD cost of 8x4,4x8 and 4x4 Select the most optimal block!  P_Skip Mode

RDO Algorithm  Formula: RD_cost(s,c,MODE|Qp) = D +. R   Computational Complexity of brute-force RDO:  INTRA block: Total Modes = 4 (16x16) + 9 (4x4) + 1 (I_PCM) + 4 (chroma_8x8) = 18 Total # of RDO calculations = M8 * ( M4*16 + M16) Theoretical Bound for a MB: 4 x (9x16+4)= 592!  INTER block: Total Modes = [ 7+1 (P_SKIP) ] + Intra counterparts HUGE Computations!! Problem for real time application => So, Need of FMD!

Intra : Edge-Histogram approach FMD-Intra : Edge-Histogram approach  Main Idea: Use Prediction in Edge Direction Generate edge map using Sobel operator Build edge direction histogram Fast intra mode decision

Generate Edge Map  Sobel Operator (Compute Gradients):

Edge Direction Histogram for Intra_4x4

FMD for Intra_4x4 Contd… As per observations in Reference[5]: - The ideal 4x4 mode is either the primary mode or one of the two neighboring modes - DC mode (Mode 2) is always evaluated - Total Modes = 1(Prime) + 2 (neighbors) + DC = 4

6x16 Edge Direction Histogram for Intra_16x16 Total Modes = 1(Prime) + DC = 2

Inter Fast Mode Decision-Inter  Main idea: If we can reasonably decide that MB is temporally stationary or spatially homogeneous, we can encode MB using larger block-size and safely skip all other modes!

Stationary Region Determination  Refers to the stillness between consecutive frames in the temporal dimension  Evaluate Zero-MV Diff :  If (Diff “Stationary” So, choose16x16 mode and skip other sizes !  Threshold Ts = 200 (Reference[6])

Homogeneous Region Determination  Refers to texture similarities inside a single video frame  Edge amplitude computation is already done in fast intra mode decision  Threshold values (Reference[6]): for 16x16 block : for 8x8 block : 5000

Flow Chart of FMD_Inter

Wait... Changing the mode:Theory to Practice!

H.264/AVC Profiles  H264/AVC Profiles

Q. What is X264 ?  ‘x.264’ :  Open source H264/AVC encoder by VideoLAN  ‘C’ code library, Platform : Linux  Optimized as compared to reference JSVM software  Bunch of encoding options!  We finalized the options for “benchmarking” performance of Non- FMD vs FMD case E.g.: Command to encode ‘foreman_qcif.yuv’ sequence…./x264 -o foreman_qcif.264 foreman_qcif.yuv 176x profile baseline --frame 30 --verbose --keyint 15 --min- keyint 15 --no-scenecut --bframes 0 --ref 1 --slices 1 --fps 15 --qp 25 --partitions all --weightp 0 --me esa --subme 7 - -no-chroma-me --no-8x8dct --trellis 0 --no-fast-pskip -- visualize

X264 Coding Options:  --keyint 15/--min-keyint 15: Sets GOP size to 15  --bframes 0: Disables B-frame  --slices 1: Sets 1 slices per frame  --ref 1: Only 1 frame can be used as reference  --me esa: Select exhaustive motion estimation  --no-chroma-me: Ignore chroma in motion estimation  --qp 25: Fixed quantization step-size  --partitions all: Do all possible partitions  --no-scenecut: Disables adaptive I-frame decision

Implementation I: ‘Generation of Mode Statistics’  Intra MB: 3 Types :: I_4x4=0 ( 11 Modes), I_16x16=2 (4 Modes), I_PCM=3,  Inter MB: 3 Types :: P_L0=4, P_8x8=5, P_SKIP=6  P_LO (Level-1): can have 3 Partitions: D_16x8=14, D_8x16=15, D_16x16=16  P_8x8 (Level-2): has D_8x8 partition and can have 4 Sub-partitions: D_L0_8x8=3, D_L0_4x4=0, D_L0_8x4=1, D_L0_4x8=2

Implementation II: ‘Visualization Utility’ I-Frame RED : Intra_4x4 CYAN: Intra_16x16 P-Frame GREEN: P_SKIP BLUE: P_8X8 (and below) MAGENTA: P_16x16,P_16x8, P_8x16 Motive: “Seeing is Believing !” Let’s see a Demo…

Key observations:  I- Frame:  16x16 size chosen for spatially homogeneous region  4x4 size chosen for a MB with many spatial details/local edges  P-Frame: % of Skipped% of Inter% of Intra Akiyo Football Foreman

Contd… Though H.264 allows variable size MC up-to 4x4 size…  Real world video sequences: Certain percentage of ‘Skipped’ blocks  Spatially Homogeneous regions gets best compensated with 16x16 (such blocks have similar motion; very seldom split to smaller blocks)  Temporally Stationary blocks ( e.g. stationary background even with strong edges) gets best compensated with 16x16 or P_SKIP  Nonetheless, Blocks containing motion boundaries or motion in smaller objects benefit from 8x8 or 4x4 MC

Implementation III: FMD Intra in x264 Block SizeTotal # of modes# of modes selected Luma(Y)4x494 Luma(Y)16x1642 Chroma(U,V)8x843 or 2  ~1000 lines of C code: Edge Map computation, Prime mode computation based on histogram, Modification of mode decision logic in.x264  Number of candidate modes in Intra-FMD:

Results: Intra FMD (All I frames, Qp=25) RESULTS △ TIME(%) △ PSNR_Y △ PSNR_U △ PSNR_V △ PSNR_AVG Mobile Akiyo Paris Foreman Football Avg. Time Saving: 36.70% Avg. PSNR drop: 0.11 dB

Results: Intra FMD (PSNR vs R) Sequence: Mobile, Coding: All I, Qp= 37,33,29,25 Avg PSNR drop: dB, Avg. Increase in R: ~6%, Avg Time Saving: 37.51%

Summary and future work: To Conclude:  Learnt x264 code-flow, different encoding options  Matlab ‘mode visualization script’ is ready  Intra-FMD ready, Inter-FMD (in progress)  Important: FMD framework is ready! Different FMD algorithms can be plugged in to evaluate prime mode selection… Future Work:  Inter FMD  FMD enhancement: Analysis of different modes with conditional probabilistic model

Reference  [1] URL:  [2] Thomas Wiegand, Gary J Sullivan, “Overview of the H264/AVC Video Coding Standard”, IEEE Transactions on Circuits and Systems for Video Technology, Vol. 13, No. 7,July 2003  [3]URL: White Paper: An Overview of H.264 Advanced Video Codinghttp://  [4] Iain E G Richardson, “H.264 and MPEG4 Video Compression”, WILEY Publications, 2003  [5] Feng Pan et al, “Fast Mode Decision Algorithm for Intra-prediction in H264/AVC Video Coding”, IEEE Transactions on Circuits and Systems for Video Technology, Vol. 15, No. 7,July 2005  [6] D. Wu et al, “Fast Intermode Decision in H264/AVC Video Coding”, IEEE Transactions on Circuits and Systems for Video Technology, Vol. 15, No. 6,July 2005  [7] Rui Su, Guizhong Liu, Tongyu Zhang,”Fast Mode Decision Algorithm for Intra Prediction In H264/AVC”, ICASSP-2006