This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <1>Introduction on Video Coding Standards
Variable Length Coding Information entropy
Huffman code vs. arithmetic code Arithmetic coding Why CABAC? Rescaling and integer arithmetic coding Golomb codes Binary arithmetic coding CABAC
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <2>Introduction on Video Coding Standards
Information Entropy Information entropy: Claude E. ShannonClaude E. Shannon 1948, “A Mathematical
Theory of Communication”
The information contained in a statement asserting the occurrence of an event depends on the probability p(f), of occurrence of the event
f. - lg p(f)
The unit of the above information quantity is referred as a bit, since it is the amount of information carried by one (equally likely) binary digit.
Entropy H is a measure of uncertainty or information content
- Very uncertain high information content
p
AffpfpH )(lg)(
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <3>Introduction on Video Coding Standards
Entropy Rate Conditional entropy H(F|G) between F and G: uncertainty of F given
G
Nth order entropy
Mth order conditional entropy
Entropy rate (lossless coding bound)
gAg G gFHgpGFH )|()()|(
),...,()( 1 NN FFHFH
NCN
NN
HHN
H ,lim1
lim
),...,|()( 11, FFFHFH MMNC
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <4>Introduction on Video Coding Standards
Bound for Lossless Coding Scalar coding: could differ from the entropy by up to 1 bit/symbol
Vector (block) coding: assign one codeword for each group of N symbols
Conditional coding (predictive coding, context-based coding): The codeword of the current symbol depends on the pattern (context) formed by the previous M symbol
1111 HRH
HR
NNHRNH
HRH
NN
NNN
NNN
lim
/1//
1
1lim ,
HRH MCM
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <5>Introduction on Video Coding Standards
Exploiting symbol correlations by using contexts Non-integer number of bits per symbol by using
arithmetic codes Restriction to binary arithmetic coding
• Simple and fast adaptation mechanism• But: Binarization is needed for non-binary symbols• Binarization enables partitioning of state space
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <14>Introduction on Video Coding Standards
Implementation of Arithmetic Coding
Rescaling and Incremental coding Integer arithmetic coding Binary arithmetic coding
Hoffman Trees
Exp-Golomb Codes
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <15>Introduction on Video Coding Standards
Issues Finite precision (underflow & overflow): As n gets larger, these
two values, l(n) and u(n) come closer and closer together. This means that in order to represent all the subintervals uniquely we need to increase the precision as the length of the sequence increases.
Incremental transmission: transmit portions of the code as the sequence is being observed.
Integer implementation
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <16>Introduction on Video Coding Standards
Rescaling & Incremental Coding
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <17>Introduction on Video Coding Standards
Incremental Encoding
U
L
L
L
U
U
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <18>Introduction on Video Coding Standards
Question for Decoding How do we start decoding? decode the first symbol
unambiguously
How do we continue decoding? mimic the encoder
How do we stop decoding?
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <19>Introduction on Video Coding Standards
Incremental Decoding
Top 18% of [0,0.8)
U
0.80.82
1.0
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <20>Introduction on Video Coding Standards
Issues in the Incremental Coding
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <21>Introduction on Video Coding Standards
Solution
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <22>Introduction on Video Coding Standards
Solution (2)
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <23>Introduction on Video Coding Standards
Incremental Encoding
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <24>Introduction on Video Coding Standards
Incremental Decoding
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <25>Introduction on Video Coding Standards
Integer Implementation
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <26>Introduction on Video Coding Standards
Integer Implementation • nj: the # of times the symbol j
occurs in a sequence of length Total Count.
• FX(k) can be estimated by• Define
we have
• E3: if (E3 holds)Shift l to the left by 1 and shift 0 into LSBShift u to the left by 1 and shift 0 into LSBComplement (new) MSB of l and uIncrement Scale3
TotalCount
nkF
k
i iX
1)(
k
i inCountCum1
_
1)(_)1(
)1(_)1(
)1()1()1()(
)1()1()1()(
TotalCount
xCountCumlulu
TotalCount
xCountCumlull
nnn
nn
nnn
nn
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <27>Introduction on Video Coding Standards
Golomb Codes Golomb-Rice code: a family of codes designed to encode integers with
the assumption that the larger an integer, the lower its probability of occurrence.
An example (the simplest, unary code): for integer n, codes as n 1s followed by a 0. This code is the same as the Huffman code for {1, 2, …} with probability model
Golomb code with m: code n > 0 using two numbers q and r: Q is coded by unary code of q; r is represented by binary code using
bits. the first – m values, uses bits the rest values: uses bits
Golomb code for m = 5:
.2
1][
kkp
qmnrm
nq
mlg
mlg2 mlg
mr m lg2
n q r code n q r code
0 0 0 000 5 1 0 1000
1 0 1 001 6 1 1 1001
2 0 2 010 7 1 2 1010
3 0 3 0110 8 1 3 10110
4 0 4 0111 9 1 4 10111
3+3=110
VLC 2006 PART 1112/04/18 VLC 2006 PART 1 <28>Introduction on Video Coding Standards
Golomb Codes Golomb code is optimal for the probability model