+ All Categories
Home > Documents > Fast Inter Mode Decision Algorithm NEW

Fast Inter Mode Decision Algorithm NEW

Date post: 08-Apr-2018
Category:
Upload: sukritisingh900
View: 223 times
Download: 0 times
Share this document with a friend
12
 Fast Inter Mode Decision Algorithm Implementation in H.264 Technical Report Abstract: This document presents a Fast Inter Mode Decision Algorithm in H.264 to reduce the computational burden on the encoder and hence improve the encoding speed of H.264, keeping the qualit y and file size almost the same.  Authors : Anant Kaushik, Sukriti Singh  Approved by : Sumit Johar Date : July 27 th , 2010
Transcript
Page 1: Fast Inter Mode Decision Algorithm NEW

8/6/2019 Fast Inter Mode Decision Algorithm NEW

http://slidepdf.com/reader/full/fast-inter-mode-decision-algorithm-new 1/11

 

Fast Inter Mode DecisionAlgorithm Implementation in

H.264

Technical Report

Abstract: This document presents a Fast Inter Mode Decision Algorithm in H.264 toreduce the computational burden on the encoder and hence improve the encodingspeed of H.264, keeping the quality and file size almost the same. 

  Authors : Anant Kaushik, Sukriti Singh  Approved by : Sumit Johar Date : July 27

th, 2010

Page 2: Fast Inter Mode Decision Algorithm NEW

8/6/2019 Fast Inter Mode Decision Algorithm NEW

http://slidepdf.com/reader/full/fast-inter-mode-decision-algorithm-new 2/11

 

Table Of Contents

Table of Contents

1  Introduction To H.264 ................................................................ ........................... 3 

2 Inter Prediction Modes ................................ ................................ ........................... 3 

3 Rate Distortion Optimization ................................ ................................ .................. 4 

4 Fast Inter Mode Decision Algorithms ................................ ................................ ..... 4 

5 Algorithm Implemented ................................ ................................ .......................... 5 

6  Configuration File ............................................................................................... 87 

7  Results For Test Streams ................................ ................................ ..................... 9 

8  Conclusion ........................................................................................................ 119 

9  Future Work .................................................................................................... 1110 

10  References ..................................................................................................... 1110 

Field

Field

Field

Field

Field

Field

Field

Field

Field

Field

Page 3: Fast Inter Mode Decision Algorithm NEW

8/6/2019 Fast Inter Mode Decision Algorithm NEW

http://slidepdf.com/reader/full/fast-inter-mode-decision-algorithm-new 3/11

Page 4: Fast Inter Mode Decision Algorithm NEW

8/6/2019 Fast Inter Mode Decision Algorithm NEW

http://slidepdf.com/reader/full/fast-inter-mode-decision-algorithm-new 4/11

Page 5: Fast Inter Mode Decision Algorithm NEW

8/6/2019 Fast Inter Mode Decision Algorithm NEW

http://slidepdf.com/reader/full/fast-inter-mode-decision-algorithm-new 5/11

 

Fast Inter Mode Decision Algorithms can reduce the computational burden bychecking only a fe a lesser number of modes and decide the best mode. Thesealgorithms can be based on Macro block Motion Activity [2] or comparing the cost of the Macro block coded in a particular mode ith some threshold [3]. Thedisadvantage of the Macro block Motion Activity based algorithms is that they arememory intensive as the activity of neighboring blocks and the block in prev ious

frame has to be saved and then only the decision can be taken. The disadvantage of Threshold based methods is that the set thresholds vary from stream to stream andthus fail in case of certain test streams.

5  A RITHM IMP EME TED

5.1 verview

The algorithm checks the monotonic nature of error surface. According to theproperties of the stream viz. high or lo te ture, fast/ slo motion, only some modesare enabled for checking. Thus, the SAD operations of the remaining modes are

saved consecutively reducing the computation time of the encoder. Mention thereference number of the paper   

Page 6: Fast Inter Mode Decision Algorithm NEW

8/6/2019 Fast Inter Mode Decision Algorithm NEW

http://slidepdf.com/reader/full/fast-inter-mode-decision-algorithm-new 6/11

 

5.2 Algorithm Flow

.

5.3 Description of Algorithm

 All Inter Prediction modes other than 16 16, 8 8 and 4 4 are deactivated in the start.The costs for only these three modes are calculated. If the costs are found to be inmonotonic pattern in their magnitudes, i.e., if the macro block has a tendency to becoded using a larger block or a smaller block, then only those modes are activated.If cost of 16 16 mode is minimum, follo ed by cost of 8 8 mode and cost 4 4 modethen, 16 8 and 8 16 modes ill be activated and the minimum ill be decided from16 16, 16 8, and 8 16. This signifies the macro block had either less motion or lote ture and thus could be coded using larger block size.

Start

Deactivate all modese£ 

cept 4£ 

4, 8£ 

8 and 16

£ 

16 

Check and savecosts for the

activated modes

If 8£ 

8 cost

is minimum

or  ma£ 

imum 

If 16£ 

16cost is 

minimum

Compare costs andchose best mode

 Activate 8

£ 

4 and 4

£ 

8  Activate 16£ 

8 and8

£ 

16

 Activate all modes

Yes

Yeso

o

Page 7: Fast Inter Mode Decision Algorithm NEW

8/6/2019 Fast Inter Mode Decision Algorithm NEW

http://slidepdf.com/reader/full/fast-inter-mode-decision-algorithm-new 7/11

Page 8: Fast Inter Mode Decision Algorithm NEW

8/6/2019 Fast Inter Mode Decision Algorithm NEW

http://slidepdf.com/reader/full/fast-inter-mode-decision-algorithm-new 8/11

 

y Added a function SubmacroblockModeDecision_ e inTestInterPredSubMb_ e _1 hich used all the arguments of SubmacroblockModeDecision along ith t o additional arguments ascost_4 4 and cost_8 8 .

y Stored the cost for modes 8 8 and 4 4 in cost_8 8 and cost_4 4 usingSubmacroblockModeDecision .

y Stored the cost for modes 8 8 and 4 4 for each block of macroblock incost_function[4][4] .

y Stored the minimum cost out of cost_4 4 and cost_8 8 in min_cost8 8 .

6. In function TestInterPredMb

y Set SearchFlag 1.

7. In function SubmacroblockModeDecision

y Set SearchFlag 1 if 4 4 and 8 8 modes are being checked.

y Reset SearchFlag 0 if 8 4 and 4 8 modes are being checked.

y Stored the cost for particular block in bmcost_tmp[ IST_0][ref] from array

cost_function in case of 8 8 and 4 4 modes.

8. In function MV_MotionSearch

y If SearchFlag is set, used MV_SetMotionVectorPredictor to get predictedmotion vectors and dont call BlockMotionSea rch.

y If SearchFlag is reset, call BlockMotionSearch to get the costs and actualmotion vectors.

6 FI RATI FI E SED F R SIM ATI S 

AST H.264/AVC Encoder version 8.3 (JM 16.0 compatible) configuration file

[input/output]Input_image "Input File Name" # Input images file

# nameOutput_image "Output File Name" # Output images file

# name;# "-" don't store

VideoInSeq_file_format 1 # Input images file# format:# 0=*.Y,*.U,*.V# 1=*.raw, 2=*.yuv

VideoOutSeq_file_format 1 # Output images file# format: 0=*.Y,*.U,# *.V, 1=*.raw# 2= *.yuv

Input_chroma_format 0 # Chroma format:# 0->4:2:0,1->4:2:2

Number_first_frame 0 # Number of the first# frame to encode

Total_frames_number Total Number of Frames # Number of total# frames to encode

Page 9: Fast Inter Mode Decision Algorithm NEW

8/6/2019 Fast Inter Mode Decision Algorithm NEW

http://slidepdf.com/reader/full/fast-inter-mode-decision-algorithm-new 9/11

 

FrameSkip 0 # Code one frame# every N

Image_width Image Width # Input image widthImage_height Image Height # Input image heightStatistics_File "-" # Statistic file name

[coding_mode]CABAC_Symbol_mode FALSE # Entropy coding method:# FALSE->CAVLC, TRUE->CABAC

I_P_B_mean_Quantizers 31 31 31 # Default Quantization parameter# for I, P and B picture (0 -51)

Reference_frames_num 1 # Number of previous reference# frames used for inter motion# search (1-5)

Use_Hadamard TRUE # Enable Hadamard trasformFrameField_Coding 0 # Frame/Field coding: 0 ->Frame,

# 1->Field# 2->AFF (JVT), 3->AFF (AST)

RTP_stream FALSE # RTP bit -stream formatLevel 40 # Level

[intra_coding]IntraPeriod 12 # Intra Frame Period

[motion_est]MotionEstAlg 1 # Motion Estimation Algorithm:

# 0->FullSearch, 1->SLIMH264Number_B_pictures 0 # Number of B -picturesSearchRange 64 # Motion vector search rangeDirectPredType 2 # Direct prediction type: 0 ->None

# 1->Temporal, 2->Spatial,# 3->AST Adaptive

[Slim_me]UpdType 1 # Update types: 0 ->1 Step,

# 1->3 Step,2->Fixed Position

[rate_control]Rate_Control 0 # Rate control type: 0 ->None,

# 1->JVT, 2->AST-2bCBR, 3->AST-CQBit_rate 4000000 # Target bit-rate (bits/s)Frame_rate 25.000 # Frames per secondStorage_Avail 0 # AST -CQ RC: Storage Availability

#(millions of bytes, DVD -R = 4700)Rec_Time 0 # AST -CQ RC: Recording Time,

# 0=don't care else value

# in minutesTarget_Quality 0 # AST -CQ RC: Target Quality[0 -50],# 0=don't care, 30=High,# 20=Good 10=Average

Integer_GOPs FALSE # Force integer num. of GOPsHRD_VUI_SEI FALSE # Enables HRD (VUI SEI messages)

7 RES TS F R TEST STREAMS 

Page 10: Fast Inter Mode Decision Algorithm NEW

8/6/2019 Fast Inter Mode Decision Algorithm NEW

http://slidepdf.com/reader/full/fast-inter-mode-decision-algorithm-new 10/11

Page 11: Fast Inter Mode Decision Algorithm NEW

8/6/2019 Fast Inter Mode Decision Algorithm NEW

http://slidepdf.com/reader/full/fast-inter-mode-decision-algorithm-new 11/11

 

 AVERA E E CODI TIME DIFFERE CE 18.53 %

8  SI  

Fast Inter mode decision algorithm sho ed improved performance over the brute

force traditional technique in terms of lesser computations and faster encoding ascan be seen from the table. Improvement in case of uniform motion streams or lomotion content streams like Jets is considerably high at 30.8% seen. There is alsoimprovement in case of random motion streams like Preakness.

The implemented algorithm doesn¶t need require any additional memory as the costsused for comparison have to be any ays calculated and stored for comparison.

The PS R variation, hich is less than 0.1% and File Size variation, less than 1%,bet een the brute forcetraditional method and the Fast Inter Mode Decision Methodsho s that no compromise has been made on stream quality or file sizecompression

hich complies ith Rate Distortion Optimization .

9 F T RE W RK 

The current algorithm has been only implemented on P slices and can be further e tended to B slices and for intra frames. Methods based on checking Skip andDirect modes cost can also be checked prior to other modes can also be tested for further improvements in speed.

10 REFERE ES 

1. P. Yin, H. Y. Cheong, A. M. Tourapis, and J. Boyce, ³Fast mode decision andmotion estimation for JVT/H.264,´ in Proc. IEEE ICIP, vol. 3, Sep 200 3.

2. ³Fast Mode Decision for H.264/AVC Based on Macroblock Motion Activity´Huanqiang eng, Canhui Cai and Kai Kuang Ma, IEEE Transactions oncircuits and systems for video technology, vol. 19, no. 4, APRI 2009.

3. ³Fast mode decision algorithm for H.264 based on motion cost´, eun YongKim, Seung H an Kim, Hee Soon Kim, and Yo Sung Ho, EUSIPCO 2005proceedings

4. Thomas Wiegand, ary J. Sullivan ³Overvie of the H.264/AVC Video CodingStandard´ IEEE Transactions on CSVT, July 2003


Recommended