18
Optimum Bit Optimum Bit Allocation and Allocation and Rate Control Rate Control for H.264/AVC for H.264/AVC Wu Yuan, Shouxun Lin, Yo Wu Yuan, Shouxun Lin, Yo ngdong Zhang, Wen Yuan, ngdong Zhang, Wen Yuan, and Haiyong Luo and Haiyong Luo CSVT 2006

Optimum Bit Allocation and Rate Control for H.264/AVC

  • Upload
    lang

  • View
    80

  • Download
    2

Embed Size (px)

DESCRIPTION

Optimum Bit Allocation and Rate Control for H.264/AVC. Wu Yuan, Shouxun Lin, Yongdong Zhang, Wen Yuan, and Haiyong Luo. CSVT 2006. Outline. Introduction Rate-Distortion Modeling Rate Distortion Optimization Macroblock-Layer Rate Control Experimental Results Comparisons with JVT-G012. - PowerPoint PPT Presentation

Citation preview

Page 1: Optimum Bit Allocation and Rate Control for H.264/AVC

Optimum Bit Optimum Bit Allocation and Allocation and

Rate Control for Rate Control for H.264/AVCH.264/AVC

Wu Yuan, Shouxun Lin, YongdWu Yuan, Shouxun Lin, Yongdong Zhang, Wen Yuan, and Haong Zhang, Wen Yuan, and Haiyong Luoiyong LuoCSVT 2006

Page 2: Optimum Bit Allocation and Rate Control for H.264/AVC

OutlineOutline• Introduction• Rate-Distortion Modeling• Rate Distortion Optimization• Macroblock-Layer Rate Control• Experimental Results

– Comparisons with JVT-G012

Page 3: Optimum Bit Allocation and Rate Control for H.264/AVC

Introduction (1)Introduction (1)• H.264/AVC Rate Controller

http://www.pixeltools.com/rate_control_paper.html#bas

Intra/Interprediction

Residual

Page 4: Optimum Bit Allocation and Rate Control for H.264/AVC

Introduction (2)Introduction (2)• The Chicken and Egg Dilemma

Rate Control

QP

RDO

MAD

Coding

(Intra/Inter mode selection)

!?

(Residual calculation)

Solution: Guess!MAD = MADprev +

MADprev

MAD

Page 5: Optimum Bit Allocation and Rate Control for H.264/AVC

Rate-Distortion Modeling (1)Rate-Distortion Modeling (1)• Overhead Bit-Rate Prediction

– Overhead bits: QP, MV, MB mode, …– Using history

• Coding Complexity Prediction– Complexity: Residual (MAD)– Using history

• R-D Behavior Prediction– Using overhead bits, residual, and initial QP

• Distortion Prediction– Using history

Residual(org - pred)

Overhead(MV, QP, …)

Encoded frame

Entropycoding

Page 6: Optimum Bit Allocation and Rate Control for H.264/AVC

Rate-Distortion Modeling (2)Rate-Distortion Modeling (2)• Overhead Bit-Rate Prediction

– JVT-G012: Hi = Hiave

– Proposed: Hi = Hiprev

n-1 n

Page 7: Optimum Bit Allocation and Rate Control for H.264/AVC

Rate-Distortion Modeling (3)Rate-Distortion Modeling (3)• Coding Complexity Prediction

– MAD = MADprev + • Data points are first selected by the spatial and temporal distance, and then removing outliers.

%100MAD

|MAD-MAD|

pred

realpred

JVT-G012

n-1 n

RPE < 3%QP JVT-G012 Proposed32 20.58% 23.05%34 47.98% 58.12%

Page 8: Optimum Bit Allocation and Rate Control for H.264/AVC

Rate-Distortion Modeling (4)Rate-Distortion Modeling (4)• R-D Behavior Prediction

– Assumption: DCT coefficients of residual can be approximated by

– Distortion

xexP

x

where,2

)(

||

(Laplace distribution)||),( xxxxD

DD

DR 0 where,)ln()(

* A. Viterbi and J. Omura, Principles of Digital Comuunicatin and Coding. New York: McGraw-Hill Electrical Engineering Series,1979

*

)()1(21)1()( 3

2 QstepRQstepQstep

QstepR

2

2MADMAD)(Qstepb

QstepaQstepR

Taylor expansion

Residual rate

Let /D = 1+x

Page 9: Optimum Bit Allocation and Rate Control for H.264/AVC

Rate-Distortion Modeling (5)Rate-Distortion Modeling (5)• R-D Behavior Prediction

– Taylor expansion of R(Qstep) at Qstepave

– – –

• Rate of the ith MB:

QPmaxQPaveQPmin)()(

2)("

)()(')()(~

ave32

aveave

aveaveave

QstepQstepRQstepQstepQstepRQstepQstepQstepRQstepRQstepR

CQstepBQstepAQstepR 2)(

previiiiiii HCQstepBQstepAR 2

2)(" aveQstepRA

aveaveave )(")(' QstepQstepRQstepRB

ave2aveave)( QstepBQstepAQstepRC

(Rate of residual)

Rate of residual Rate of overhead

Page 10: Optimum Bit Allocation and Rate Control for H.264/AVC

Rate-Distortion Modeling (6)Rate-Distortion Modeling (6)• Distortion Prediction

– Assumption 1: Distortion of DCT coefficients is uniformly distributed• D = 2 = |x-y|2/12 (Qstep2/12)

– Assumption 2: Qstepi Qstepiprev

• Qstepi (Diprev/Qstepi

prev)

• Di Qstepi2 (Qstepi Di

prev/Qstepiprev)

Di = iQstepi, where i = Diprev/Qstepi

prev

Set as 1

pred

real

DD

(For scalability)

Page 11: Optimum Bit Allocation and Rate Control for H.264/AVC

Rate Distortion OptimizationRate Distortion Optimization• Consider Di = iQstepi for the ith MB

– subject to

N

iiiQstepQstep

QstepNN 1

,...,

1min1

TTN

ii

1

][1min11

,,...,1

N

ii

N

iiiQstepQstep

TTQstepNN

])([1min1

prev2

1,,...,1

N

iiiiiii

N

iiiQstepQstep

THCQstepBQstepAQstepNN

N

ki

k

N

k

N

k kk

kN

k k

i

i

i

ii

A

CA

BHT

AABQstep

1

2

1 1

2

1prev

* 42

(Lagrange theory)

Rate of the ith MB

Page 12: Optimum Bit Allocation and Rate Control for H.264/AVC

Macroblock-Layer Rate Macroblock-Layer Rate Control (1)Control (1)

Page 13: Optimum Bit Allocation and Rate Control for H.264/AVC

Macroblock-Layer Rate ControMacroblock-Layer Rate Control (2)l (2)

Page 14: Optimum Bit Allocation and Rate Control for H.264/AVC

Macroblock-Layer Rate ControMacroblock-Layer Rate Control (3)l (3)• Rate Controller

1. Initialization: QPave = QPstart, QPmin = max(QPave-3, 0), and QPmax = min(QPave+3, 51). Let i = 0

2. Optimum Bit Allocation for ith MB:1) k = i.2) R-D modeling:

3) Optimum Computations:

4) k = k+1. If k N, jump to 2).5) Compute optimal QPi

*:

prevMADMAD kk

2max

2

max

kmax

MADMAD)(Qstepb

QstepaQstepR kkk

kH

N

ki

k

N

k

N

k kk

kN

k k

i

i

i

ii

A

CA

BHT

AABQstep

1

2

1 1

2

1prev

* 42

2)(" aveQstepRAk aveaveave )(")(' QstepQstepRQstepRBk

ave2aveave)( QstepBQstepAQstepRC kkk kkk CQstepBQstepAQstepR 2)(

(overhead bits)

(check if > T when adding with Hk)

2max

2

maxmax

MADMAD)(Qstepb

QstepaQstepR kkkk

(by linear regression)

(by linear regression)

Page 15: Optimum Bit Allocation and Rate Control for H.264/AVC

Macroblock-Layer Rate ControMacroblock-Layer Rate Control (4)l (4)• Rate Controller

3. Adjust QPi*: QPi

* = max{QPi-1*-1, min{QPi

*,QPi-1*+1}}. Then QPi

* = max{1,QPave-3, min{51,QPave+3,QPi

*}}4. Encoding5. Update

(Reducing blocking effect)

(For smoothness)

Page 16: Optimum Bit Allocation and Rate Control for H.264/AVC

Experimental Results (1)Experimental Results (1)CIF: Mobile, Paris

%100rateTarget

rate RealRate Prediction Error Ratio:

Page 17: Optimum Bit Allocation and Rate Control for H.264/AVC

Experimental Results (2)Experimental Results (2)

Page 18: Optimum Bit Allocation and Rate Control for H.264/AVC

Experimental Results (3)Experimental Results (3)