X264 Code Tracing 9762827 陳俊達. Outlines x264_macroblock_cache_load x264_ratecontrol_mb x264_macroblock_cache_save x264_cabac_mb_skip macroblock.c/315.

Slides:



Advertisements
Similar presentations
What is output line of the following C++ code? Please trace int i = 1, QP; DATA: 4, B, 3, A double credit, totCredit=0.0; double num = 0.0; string LG;
Advertisements

1 A HIGH THROUGHPUT PIPELINED ARCHITECTURE FOR H.264/AVC DEBLOCKING FILTER Kefalas Nikolaos, Theodoridis George VLSI Design Lab. Electrical & Computer.
Formal Language, chapter 4, slide 1Copyright © 2007 by Adam Webber Chapter Four: DFA Applications.
One Dimensional Arrays
INSTRUCTION SET ARCHITECTURES
Hand Trace and Output for: int digit = 0; int number = 1423; do { digit = number % 10; System.out.println(digit); number = number / 10; } while (number.
1 RTL Example: Video Compression – Sum of Absolute Differences Video is a series of frames (e.g., 30 per second) Most frames similar to previous frame.
Week 8 Arrays Part 2 String & Pointer
Computer Architecture CSCE 350
MIPS Function Continued
Csci136 Computer Architecture II Lab#4. - Stack and Nested Procedures
The University of Adelaide, School of Computer Science
H.264 Intra Frame Coder System Design Özgür Taşdizen Microelectronics Program at Sabanci University 4/8/2005.
Memory Management in Linux (Chap. 8 in Understanding the Linux Kernel)
Computer Organization. This module surveys the physical resources of a computer system. –Basic components CPUMemoryBus I/O devices –CPU structure Registers.
Fast Mode Decision for Multiview Video Coding Liquan Shen, Tao Yan, Zhi Liu, Zhaoyang Zhang, Ping An, Lei Yang ICIP
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
Arrays in CCS-2301, B-Term Arrays in C (including a brief introduction to pointers) CS-2301, System Programming for Non-Majors (Slides include materials.
FAST MACROBLOCK MODE SELECTION BASED ON MOTION CONTENT CLASSIFICATION IN H.264/AVC Ming Yang, Wensheng Wang ICIP 2004.
1 Storage Registers vs. memory Access to registers is much faster than access to memory Goal: store as much data as possible in registers Limitations/considerations:
Binary Search Visualization i j.
1 Chapter 7: Runtime Environments. int * larger (int a, int b) { if (a > b) return &a; //wrong else return &b; //wrong } int * larger (int *a, int *b)
Analysis, Fast Algorithm, and VLSI Architecture Design for H
H.264 / MPEG-4 Part 10 Nimrod Peleg March 2003.
Arrays in CCS-2301 B-term Arrays in C (with a brief Introduction to Pointers) CS-2301, System Programming for Non-majors (Slides include materials.
Run time vs. Compile time
10 ThinkOfANumber program1July ThinkOfANumber program CE : Fundamental Programming Techniques.
H.264/AVC.
MIPS function continued. Recursive functions So far, we have seen how to write – A simple function – A simple function that have to use the stack to save.
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 7: MIPS Instructions III
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.
CS320n –Visual Programming
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Guillaume Laroche, Joel Jung, Beatrice Pesquet-Popescu CSVT
Arrays in CCIS 1057 Fall Arrays in C (with a brief Introduction to Pointers) CIS 1057 Computer Programming in C Fall 2013 (Slides include materials.
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
Computational Complexity Management of a Real-Time H.264/AVC Encoder C S Kannangara, I E Richardson, and A J Miller CSVT
IEEE Transactions on Consumer Electronics, Vol. 58, No. 2, May 2012 Kyungmin Lim, Seongwan Kim, Jaeho Lee, Daehyun Pak and Sangyoun Lee, Member, IEEE 報告者:劉冠宇.
Lookup Function (Think of a Book Index).  Need to fill based on what is in the these fields Array table.
CSC 8505 Compiler Construction Runtime Environments.
Recitation 7 Collections. Array List and Linked List Array List and Linked List are implementations of the same interface: List. As a result, they have.
 2008 Pearson Education, Inc. All rights reserved. 1 Arrays and Vectors.
Video Compression—From Concepts to the H.264/AVC Standard
Data Structures and Algorithms Searching Algorithms M. B. Fayek CUFE 2006.
Review. Problem 1 What is the output of the following piece of code void increment(int x) { x++; } int main() { int y = 10; increment(y); cout
Outline  Introduction  Observations and analysis  Proposed algorithm  Experimental results 2.
Arrays. Arrays are objects that help us organize large amounts of information.
CS 多媒體編碼技術導論 P ROJECT II H.264 C ODE T RACING x264_macroblock_write_cabac 朱逸樵.
江振揚 functions  x264_mb_encode_i4x4  x264_predict_loseless_4x4  idct_4x4_dc  dequant_4x4_dc.
H.264/AVC Reference Software Group 3 11 簡嘉宏 /05/22.
Fine-granular Motion Matching for Inter-view Motion Skip Mode in Multi-view Video Coding Haitao Yanh, Yilin Chang, Junyan Huo CSVT.
Fast disparity motion estimation in MVC based on range prediction Xiao Zhong Xu, Yun He ICIP 2008.
X.264 Code Tracing Group 薛伊倩 張書瑜 游智詮 邱漢坤 王芳瑜 張宇蓓 廖航緯.
Present by 楊信弘 Advisor: 鄭芳炫
HEVC Intra Prediction Prepared by Shevach Riabtsev
Storage Classes There are three places in memory where data may be placed: In Data section declared with .data in assembly language in C - Static) On the.
No.3 encode_one_slice() DeblockMb()
Video-in-Video Insertion into a Pre-encoded Bit-stream
Notes Over 2.1 Function {- 3, - 1, 1, 2 } { 0, 2, 5 }
Vectors.
Supplement, Chapters 6 MC Course, 2009.
MPEG4 Natural Video Coding
H.264 code tracing Group 徐君潔.
Functions What is a function? What are the different ways to represent a function?
Li Li, Zhu Li, Vladyslav Zakharchenko, Jianle Chen, Houqiang Li
Presentation transcript:

X264 Code Tracing 陳俊達

Outlines x264_macroblock_cache_load x264_ratecontrol_mb x264_macroblock_cache_save x264_cabac_mb_skip macroblock.c/315 cabac.c/6 macroblock.c/163 ratecontrol.c/94 x264_slices_write

x264_macroblock_cache_load() Brief: load neighbor info to cache. Input: – x264_t *h; // a structure that save the encoder info. – int i_mb_x, i_mb_y; // MB position inside a frame. Output: – x264_t *h; Caller: x264_slice_write().

x264_macroblock_cache_load() init index load cache – load intra4x4 – load non_zero_count – load picture pointers – load ref/mv/mvd – load skip init index load cache load intra4x4 load non_zero_count load picture pointers load ref/mv/mvd load skip Start

x264_scan8 To deal with the relative positions between the current Mb and its neighbors, x264 define some arrays with the 48 elements, like – mb.cache.intra4x4_pred_mode, – mb.cache.non_zero_count, – mb.cache. ref, – mb.cache. mv, – mb.cache. mvd Each element in those array means a 4x4 block. static const int x264_scan8[16+2*4+3] = { /* Luma */ 4+1*8, 5+1*8, 4+2*8, 5+2*8, 6+1*8, 7+1*8, 6+2*8, 7+2*8, 4+3*8, 5+3*8, 4+4*8, 5+4*8, 6+3*8, 7+3*8, 6+4*8, 7+4*8, /* Cb */ 1+1*8, 2+1*8, 1+2*8, 2+2*8, /* Cr */ 1+4*8, 2+4*8, 1+5*8, 2+5*8, /* Luma DC */ 4+5*8, /* Chroma DC */ 5+5*8, 6+5*8 };

Indexing of mb.pred_mode and mb.non_zero_count mb.intra4x4_pred_mode mb.non_zero_count Y Cb Cr

pred_mode and non_zero_count : top

pred_mode and non_zero_count: left

pred_mode and non_zero_count: topright and topleft

i_neighbour8 and i_neighbour i_neighbour8 records whether the intra neighbors of each 8x8 block that are available i_neighbour4 records whether the intra neighbors of each 4x4 block that are available we can determine their neighbors by i_neighbour_intra (16x16 block) Indexing of i_neighbour8Indexing of i_neighbour4

x264_macroblock_cache_save() Brief: save neighbor info. Input: – x264_t *h; // a structure that save the encoder info. Output: – x264_t *h; Caller: x264_slice_write().

x264_macroblock_cache_save() save cache – save intra4x4 – save non zero count – save picture pointers – save ref/mv/mvd – save skip Start save cache save intra4x4 save non_zero_count save picture pointers save ref/mv/mvd save skip

x264_cabac_mb_skip() Brief: Deal with skip MB in RDO CABAC. Encode the mb_skip_flag of P, SP, or B slice Input: – x264_t *h; // a structure that save the encoder info. – int b_skip; // mb_skip_flag Output: – x264_t *h; Caller: x264_slice_write().

x264_cabac_mb_skip() Deal with skip MB in RDO CABAC Encode the mb_skip_flag of P, SP, or B slice

x264_ratecontrol_mb() Brief: Row MB level rate control Input: – x264_t *h; // a structure that save the encoder info. – int bits; // mb bit size Output: – x264_t *h; Caller: x264_slice_write().

x264_ratecontrol_mb() Update row QP Start Row MB level rate control: Modify the row QPs when a sufficient amount of the bits of the frame have been processed. Is it the last MB in a row? Yes Check QP range Modify QP