View
221
Download
0
Tags:
Embed Size (px)
Citation preview
1
CABAC Based Bit
Estimation for Fast H.264
RD Optimization DecisionLi Liu Xinhua Zhuang
CCNC 2009
2
Outline
Introduction
Based on CAVLC [1] Mohammed Golam Sarwer and Lai-Man Po, “Fast Bit Rate
Estimation for Mode Decision of H.264/AVC,” Circuits and Systems for Video Technology, IEEE Transactions on,Vol.17, no. 10, pp 1402-1407, Nov. 2007.
Based on CABAC
Experimental Results
Related paper
3
Introduction
Rate distortion optimization(RDO) is used to decide the best coding mode of a macroblock in H.264/AVC. Efficient to improve coding performance. Considerable complexity increase of the encoder.
Lagrange cost function:
Fast bit estimation is adopted to avoid entropy coding computation during the mode decision.
)( RRRSSDJ resmotionheadermRD
4
Introduction
DCT & QEntropy coding
DCT’& Q’
RD cost calculation
Residue data
Rate Distortion
RDO computation
)( RRRSSDJ resmotionheadermRD
5
Based on CAVLC
Estimate the number of bits for each of five different types of symbols of CAVLC separately.
CAVLC encoding of a block of transform coefficients proceeds as follow: Encode the number of coefficients and trailing
ones. Encode the sigh of each TrailingOne. Encode the levels of the remaining nonzero
coefficients. Encode the total number of zeros before the last
coefficient. Encode each run of zeros.
4x4 Block
Reordered Block: 0,3,0,1,-1,-1,0,1,0,0,0,0,0,0,0,0 TotalCoeff = 5; TotalZeros=3; T1s =3 (max value)
Encoding
1
2
3
4
5
Transmitted bitstream 000010001110010111101101 (24 bits)
CAVLC exampleStep1: Encode the number of coefficients and trailing ones.Step2: Encode the sigh of each TrailingOne.Step3: Encode the levels of the remaining nonzero coefficients.Step4: Encode the total number of zeros before the last coefficient.Step5: Encode each run of zeros.
7
Based on CAVLC
Encode the number of coefficients and trailing ones.
Four VLC tables are used for encoding coefficient token.
Bit consumption to encode the coefficient token is increased with number of coefficients.
Bit consumption to encode the coefficient token is decreased with number of trailing .
x-axis: number of nonzero coefficientsy-axis: true rate of Coeff_token
1
8
Based on CAVLC
The number of bits required to encode the coefficient token is :
is the total number of nonzero coefficients. is the number of trailing . are weighting constants. Experiments show that at and
better RD performance was found.
wTwTwR occoeff 321
1
T c
T o
www 321,,
121ww 0
3w
TTR occoeff
9
Encode the sigh of each TrailingOne
For each , a single bit encodes the sigh(0+, 1-).
The number of bits to encode the trailing ones is :
T o
TR otrail
1
Encode the levels of the remaining nonzero coefficients From the observation of level-VLC tables, it is shown
that bit requirement is increased with magnitude of nonzero coefficients.
The number of bits to encode the level information is :
is the absolute values of all levels of quantized transform residual block.
is the sum of absolute values of all levels of quantized transform residual block.
is a positive constant. Better results were found with .
10SATwR llevel 4
TC
kkl LSAT
1
||
||Lk
SAT l
w4
14w
x-axis: SATy-axis: true rate of level
SATR llevel
11
Encode the total number of zeros before the last coefficient.
From the observation of total zero VLC tables, it is shown that bit consumption to encode the total zero is increased with number of total zero.
The number of bits for total zero is :
is a positive constant. is the total number of zeros before the last
nonzero coefficients. Better results were found with .
TwR zzero 5
w5
T z
15w
TR zzero
12
Encode each run of zeros
After DCT, the high-frequency coefficient usually has small energy. By quantization, more zeros are found at the high-frequency position of quantized transform block, so the value of run for high-frequency nonzero coefficients is larger.
From the observation of run VLC tables, it is shown that more bits are required for large value of run, so bit consumption is higher to encode the run of high-frequency nonzero coefficient.
4x4 Block
Reordered Block: 0,3,0,1,-1,-1,0,1,0,0,0,0,0,0,0,0
13
Encode each run of zeros
The rate for run of each nonzero coefficients is :
is the frequency of th nonzero coefficient reordered block.
Example:
A string of coefficients [0,3,0,1,-1,-1,-1,0,1,0,0…]
frequency of (3) is 1
frequency of (1) is 7 Better results were found with .
150,run 6R
(k)
kfw k
fk k
3.06w
150,3.0runR
(k)
kfk
14
Total estimated bits
From previous analysis, the total estimated bits needed to encode a 4x4 residual block are:
T
runest
c
kres kzeroleveltrailcoeff RRRRRR
11
)()(
T
est
c
res kklzc fSATTTR
1
3.0)(
x-axis: Estimation error of a symbol is the absolute difference between actual bit rate and estimated bit rate of that symbol.
Perfectly match
Most of estimation error
15
Experimental Results
JM 8.3
CAVLC is enabled
Frame rate is 30
Motion vector search range is 32
Number of frame is 100
Percentage of difference coding time
16
Experimental Results
All frames are I frames
Foreman sequence
[9] C. H. Tseng, H. M.Wang, and J. F. Yang, “Enhanced intra 4x4 mode decision for H.264/AVC coders,” IEEE Trans. Circuits Syst. Video Technol., vol. 16, no. 8, pp. 1027–1032, Aug. 2006.
17
Experimental Results All frames are I frames: 47% time reduction
IPP + fast motion estimation algorithm[15] 34% time reduction
IBPBP + fast motion estimation algorithm[15] 32% time reduction
[15] Z. Chen, P. Zhou, and Y. He, “Fast integer pel and fractional pel motionestimation for JVT,” Joint Video Team (JVT) Docs, JVT-F017, Dec. 2002.
18
Experimental Results
All I frames
IPP
IBPBP
19
Experimental Results
Experiments with full search motion estimation
IPP + number of frames is set to 50 17% time reduction
20
Experimental Results
Comparison with other method[9]
Only intra 4x4 modes are used
[9] C. H. Tseng, H. M.Wang, and J. F. Yang, “Enhanced intra 4x4 mode decision for H.264/AVC coders,” IEEE Trans. Circuits Syst. Video Technol., vol. 16, no. 8, pp. 1027–1032, Aug. 2006.
21
Based on CABAC
The CABAC encoding process of a symbol consists of three elementary steps: Binarization Context modeling Binary arithmetic coding
22
Flow diagram of the CABAC
23
Coding of residual data with CABAC
For each block:
coded_block_flag 0: The coded block flag is insignificant, no
further information is transmitted. 1: a significance map specifying the positions of
significant. The absolute value of the coefficient level as well as the sign is encoded for each significant transform coefficient.
Number of bits: 1 bit for each block.
24
Coding of residual data with CABAC For each coefficient:
significant_coeff_flag 1: current scanning position contains a significant
coefficient.(nonzero) 0: current scanning position contains a insignificant
coefficient.(zero)
last_significant_flag 1: current significant coefficient is the last one inside the
block. 0: current significant coefficient is not the last one inside
the block.
Number of bits:
is the total number of zero coefficients before the last
nonzero coefficient. is the total number of nonzero coefficients. and are weighted coefficients.
NCNCR ssmzztMapSignifican
N s
C z C sm
N z
25
Coding of residual data with CABAC
For each significant coefficient:
coeff_abs_level_minus1 The absolute value of the significant coefficient
level minus one.
coeff_sign_flag The sigh of the significant coefficient level. Number of bits:
NCR ssisign
26
Coding of residual data with CABAC
Estimate total number of bits to encode all symbol coeff_abs_level_minus1
is the absolute value of the i-th nonzero coefficient.
is estimated number of bits to encode .
stands for average number of bits encoding absolute level value k calculated from previous frames.
Total number of bits:
coefftotal
iilevelabscoeff LR Est
_
1__
)(
Li
)(LiEst
Li
otherwise
Tkif
kavg
kkEst
)(
)(
)(kavg
otherwise
QPT
15
8
5
RNCR levelabscoeffssilevel __
27
Coding of residual data with CABAC
The total number of bits estimated to code a coefficient block using CABAC entropy coding as:
where
1__
RNCNCR levelabscoeffsszzestimate
15.2__
RNNR levelabscoeffszestimate
CCC smsis
28
Experimental Results
JM 10.1
Saving ratio of total encoding time
29
Experimental Results
30
Experimental Results
30% RDO time saving
0.02 dB less
0.22% bit rate reducing
31
Related paper
Jongmin Hahm and Chong-Min Kyung, “Efficient CABAC Rate Estimation for H.264/AVC Mode Decision, IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS FOR VIDEO TECHNOLOGY, VOL. 20, NO. 2, FEBRUARY 2010
Arithmetic coding is replaced by a table lookup .