On2 VP5

From MultimediaWiki
Revision as of 07:53, 11 April 2007 by Mkhodor (talk | contribs) (revert vandalism by QxvP4q)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Format

The aim here is to open this standard with a full description of the bitstream format and decoding process. Contributors from On2 especially encouraged here, but it is anticipated that this section will be completed through reverse engineering.

Please do not submit any copyrighted text or code here.

Introduction

VP5 uses unidirectional ("P-frame") and intra-frame (within the current frame) prediction. Entropy coding is performed using range coding and an 8x8 iDCT is used. The format supports dynamic adjustment of encoded video resolution.

Macroblock types

Each video frame is composed of an array of 16x16 macroblocks, just like MPEG-2, MPEG-4 parts 2 and 10. Each MB (macroblock) takes one of the following modes ("MV" means "motion vector"):

  • INTRA (1): Intra MB
  • INTER_NOVEC_PF (0): Inter MB, null MV, previous frame reference
  • INTER_DELTA_PF (2): Inter MB, differential MV, previous frame reference
  • INTER_4V (7): Inter MB, four MVs, previous frame reference
  • INTER_V1_PF (3): Inter MB, MV 1, previous frame reference
  • INTER_V2_PF (4): Inter MB, MV 2, previous frame reference
  • INTER_NOVEC_GF (5): Inter MB, null MV, golden frame reference
  • INTER_DELTA_GF (6): Inter MB, differential MV, golden frame reference
  • INTER_V1_GF (8): Inter MB, MV 1, golden frame reference
  • INTER_V2_GF (9): Inter MB, MV 2, golden frame reference

Frame Header

Range coding commences at the very begining of this frame header.

Syntax Number of bits Probability Semantics
frame_mode 1 128 0 signifies an intra frame
value0 1 128 unused
qp 6 128 Quantization parameter valid range 0..63
if (frame_mode == 0) { 0 signifies intra frame
version_minor 8 128 should be 0
version_major 5 128 should be 5
value3 2 128 unknown
interlace 1 128 true (1) means interlace will be used
dim_y 8 128 Macroblock height of video
dim_x 8 128 Macroblock width of video
render_y 8 128 Displayed macroblock height of video
render_x 8 128 Displayed macroblock width of video
value4 2 128 unknown
}

If dim_x or dim_y have values different from the previous intra frame, then the resolution of the encoded image has changed.

Model for macroblock type parsing

This section allows to calculate a model used to parse macroblock type. This model is stored in the mb_type_model[3][10][10] table. To calculate this model, an intermediate table (mb_types_stats[3][10][2]) is extracted from the input stream. The macroblock type model is useful only for non-key frames (ie. frames which can contain macroblock type other than intra). So this procedure is not used for intra frame, which instead reset the value of mb_types_stats to the content of def_mb_types_stats.

So first here is how the input stream must be parsed:

Syntax Number of bits Probability Semantics
for (ctx=0; ctx<3; ctx++) {
if (flag1) { 1 174
index 4 128
mb_types_stats[ctx] = pre_def_mb_type_stats[index][ctx]
}
if (flag2) { 1 254
for (type=0; type<10; type++) {
for(i=0; i<2; i++) {
if (flag3) { 1 205
sign 1 128
if (flag4) { 1 171
if (flag5) { 1 199
delta 7 128 quater of delta...
} else if (flag6) { 1 140
delta = 12
} else if (flag7) { 1 125
delta = 16
} else if (flag8) { 1 104
delta = 20
} else {
delta = 24
}
} else {
if (flag9) { 1 83
delta = 4
} else {
delta = 8
}
}
if (sign) {
delta = -delta
}
mb_types_stats[ctx][type][i] += delta
}
}
}
}
}

Then mb_type_model is derived from mb_types_stats. The first index of mb_type_model is the number of predictors (0, 1 or 2). The second index is the type of the previous macroblock. A probablity is associated to each value of the third index as follow:

mb_type_model[ctx][type][0] is calculated with the following formula:

 255 - (255 * mb_types_stats[ctx][type][0]) / (1 + mb_types_stats[ctx][type][0] + mb_types_stats[ctx][type][1])

All the other probabilities are conditional probabilities noted P(A|B) and are calculated with:

 1 + 255 * P(A) / (1+P(B))

For each macroblock type, it's probability is noted P(A) and calculated with:

 100 * mb_types_stats[ctx][type][1]

with one exception: when calculating mb_type_model[ctx][type][i], P(type) is 0.

Models for macroblock type parsing

This header contains various models used to parse motion vectors. It is only present in non-key frames. For key frames, all those modeles are filled with 0x80 instead, except vector_model_pdi[comp][0] which is filled with 0x55.

Syntax Number of bits Probability Semantics
for (comp=0; comp<2; comp++) {
if (flag1) { 1 vmc_pct[comp][0]
vector_model_dct[comp] 7 128
}
if (flag2) { 1 vmc_pct[comp][1]
vector_model_sig[comp] 7 128
}
if (flag3) { 1 vmc_pct[comp][2]
vector_model_pdi[comp][0] 7 128
}
if (flag4) { 1 vmc_pct[comp][3]
vector_model_pdi[comp][1] 7 128
}
}
for (comp=0; comp<2; comp++) {
for (node=0; node<7; node++) {
if (flag5) { 1 vmc_pct[comp][4+node]
vector_model_pdv[comp][node] 7 128
}
}
}

All the value in thoses models must be multiplied by 2. Those models can't contain a 0 value, so every 0 must then be replaced by a 1.

Models for DCT coefficient parsing

This header contains various models used to parse DCT coefficient. Theses parsing are using a default_probability table which is initially filled with 0x80. The value read from the bitstream must be multiplied by 2. If the value is 0, it must be replaced by 1. The last two models are derived from the first two.

DC coefficient model

Syntax Number of bits Probability Semantics
for (pt=0; pt<2; pt++) {
for (node=0; node<11; node++) {
if (flag1) { 1 dccv_pct[pt][node]
coeff_model_dccv[pt][node] = default_probability[node] 7 128
} else if (frame_mode == 0) {
coeff_model_dccv[pt][node] = default_probability[node]
}
}
}

AC coefficient model

The value read from the bitstream must be multiplied by 2. If the value is 0, it must be replaced by 1.

Syntax Number of bits Probability Semantics
for (ct=0; ct<3; ct++) {
for (pt=0; pt<2; pt++) {
for (cg=0; cg<6; cg++) {
for (node=0; node<11; node++) {
if (flag1) { 1 ract_pct[ct][pt][cg][node]
coeff_model_ract[pt][ct][cg][node] = default_probability[node] 7 128
} else if (frame_mode == 0) {
coeff_model_ract[pt][ct][cg][node] = default_probability[node]
}
}
}
}
}

DC coefficient coding type model

Every value in this model is calculated with the folowing formula:

 coeff_model_dcct[pt][ctx][node] = ceil((coeff_model_dccv[pt][node] * dccv_lc[node][ctx][0]) / 256)
                                   + dccv_lc[node][ctx][1];

All the values in this model must be clipped between 1 and 254.

AC coefficient coding type model

Every value in this model is calculated with the folowing formula:

 coeff_model_act[pt][ct][cg][ctx][node] = ceil((coeff_model_ract[pt][ct][cg][node] * ract_lc[ct][cg][node][ctx][0]) / 256)
                                          + ract_lc[ct][cg][node][ctx][1];

All the values in this model must be clipped between 1 and 254.

Macroblocks

Here starts the main macroblocks parsing loop. Macroblocks are coded from left to right and from top to bottom of the final picture.

MB type

For non-key frames, MB parsing begin with the decoding of the type of the MB.

First we need to get the ctx value from vector_predictor with frame_type set to FRAME_PREVIOUS. Then we select the proper model which is mb_type_model[ctx][prev_type] (prev_type is the type of the MB which was parsed just before this one). The MB type parsing itself is done according to the selected mb_type_model which defines a binary tree of probabilities. This tree is described right below. In this tree, each [x] means get 1 bit in the input stream using mb_type_model[x] as probability for this bit. If bit is 0, go to the top branch, if it's 1, go to the bottom branch. The leaf indicate the final type of this MB.

                                       +-- INTER_NOVEC_PF
                                       |
                             +-- [4] --+
                             |         |
                             |         +-- INTER_DELTA_PF
                             |
                   +-- [2] --+
                   |         |
                   |         |         +-- INTER_V1_PF
                   |         |         |
                   |         +-- [5] --+
                   |                   |
                   |                   +-- INTER_V2_PF
                   |
         +-- [1] --+
         |         |
         |         |                   +-- INTRA
         |         |                   |
         |         |         +-- [6] --+
         |         |         |         |
         |         |         |         +-- INTER_4V
         |         |         |
         |         +-- [3] --+
         |                   |
         |                   |                   +-- INTER_NOVEC_GF
         |                   |                   |
         |                   |         +-- [8] --+
         |                   |         |         |
         |                   |         |         +-- INTER_DELTA_GF
         |                   |         |
         |                   +-- [7] --+
         |                             |
         |                             |         +-- INTER_V1_GF
         |                             |         |
         |                             +-- [9] --+
         |                                       |
         |                                       +-- INTER_V2_GF
         |
-- [0] --+
         |
         +-- prev_type

Motion vector

The motion vector applies to all the blocks in the MB except in the case of four motion vectors There are different kind of MV decoding depending on MB type :

Straight vector candidate

Apply to the following MB types: INTER_V1_PF, INTER_V2_PF, INTER_V1_GF, INTER_V2_GF

The motion vector is the first (for V1) or second (for V2) candidate from vector_predictor with frame_type set either to FRAME_PREVIOUS (for PF) or to FRAME_GOLDEN (for GF).

Delta vector

Apply to the following MB types: INTER_DELTA_PF, INTER_DELTA_GF

Default delta, di1, di2 and neg value is 0. You then need to apply the following parsing first with comp = 0 (for component x of the vector) and then with comp = 1 (for component y of the vector):

Syntax Number of bits Probability Semantics
if (flag1) { 1 vector_model_dct[comp]
neg 1 vector_model_sig[comp]
di1 1 vector_model_pdi[comp][0]
di2 1 vector_model_pdi[comp][1]
delta here a binary tree parsing happens (see below)
}

The delta parsing itself is done according to vector_model_pdv[comp] which defines a binary tree of probabilities. This tree is described right below. In this tree, each [x] means get 1 bit in the input stream using vector_model_pdv[comp][x] as probability for this bit. If bit is 0, go to the top branch, if it's 1, go to the bottom branch. The leaf indicate the final value of delta.

                             +-- 0
                   +-- [2] --+
                   |         +-- 1
         +-- [1] --+
         |         |         +-- 2
         |         +-- [3] --+
         |                   +-- 3
-- [0] --+
         |                   +-- 4
         |         +-- [5] --+
         |         |         +-- 5
         +-- [4] --+
                   |         +-- 6
                   +-- [6] --+
                             +-- 7

When the value of delta, di1, di2 and neg are parsed, the value of the current vector component can be calculated this way:

 component = (1-2*neg) * (di1 | (di2 << 1) | (delta << 2))
Four motion vectors

Apply to the following MB types: INTER_4V

For this type of MB each of the 4 luma block of the MB use a different MV. So each of this 4 luma block has it's own block type. This block type can only be one which refers to PREVIOUS_FRAME (ie. INTER_V1_PF, INTER_V2_PF, INTER_DELTA_PF, INTER_NOVEC_PF).

Those 4 block types should be parsed this way:

Syntax Number of bits Probability Semantics
for (block=0; block<4; block++) {
type[block] 2 128
if (type[block] != INTER_NOVEC_PF) {
type[block]++
}
}

Then for each of the 4 luma blocks it's MV is calculated the same way as if it were a full MB, according to it's block type.

The MV of the 2 chroma block is then calculated as the average of the 4 luma MV.

Zero vector

Apply to all the other MB types.

This is simply a null vector.

MB coefficients

This is the real content of the MB, ie. the data which will be feeded to the Inverse DCT.

This procedure is repeated 6 times (for each block in the MB, with block_num being the num of the block in the MB between 0 and 5). It uses several initialized variables :

  • ct: code type, initialized to 1
  • pt: plane type, initialized to 0 for luma blocks and 1 for chroma blocks
  • ctx_last: initialized to the maximum coeff_idx of previous block on the same row and normalized to a maximal value of 24 (initialized to 24 at the start of a row).
  • above_block_ndc: initialized to 0 if the DC coefficient of the block just above the current one is null, 1 else
  • bi: initialized to 0 for blocks 0 and 1, 1 for blocks 2 and 3, 2 for block 4, and 3 for block 5
  • coeff_ctx: this array is filled with 0 at the begining of each macroblock row
 for (coeff_idx=0; coeff_idx<64; coeff_idx++) {
     /* select the correct models */
     if (coeff_idx == 0) {  /* DC coeff */
         ctx = 6*coeff_ctx[bi][0] + above_block_ndc;
         m1 = coeff_model_dccv[pt];
         m2 = coeff_model_dcct[pt][ctx];
     } else {               /* AC coeff */
         int cg = coeff_groups[coeff_idx];
         ctx = coeff_ctx[bi][coeff_idx];
         m1 = coeff_model_ract[pt][ct][cg];
         m2 = cg > 2 ? model : coeff_model_act[pt][ct][cg][ctx];
     }
     
     /*
      * Here applies a binary tree parssing as defined below.
      */
     
     block_coeff[block_num][coeff_idx] = (coeff ^ -sign) + sign;
     coeff_ctx[bi][coeff_idx] = cctx;
 }
 
 if (coeff_idx < ctx_last) {
     for (i=coeff_idx; i<=ctx_last; i++)
         coeff_ctx[bi][i] = 5;
 }

The following binary tree parsing allows to extract coefficients of the block plus other parameters useful for the decoding procedure itself. In this tree, each m1[x] or m2[x] means get 1 bit in the input stream using m1[x] or m2[x] as probability for this bit. If bit is 0, go to the top branch, if it's 1, go to the bottom branch. The leaf indicate the value extracted at the end of this tree parsing.

                   +-- end of this block (break out of the loop)
                   |
         +- m2[1] -+
         |         |
         | if !ct  |
         +---------+-- ct=0, cctx=0
         |
- m2[0] -+
         |
         |         +-- ct=1, cctx=1, sign=get_bit(), coeff=1
         |         |
         +- m2[2] -+
                   |                   +-- ct=2, cctx=2, sign=get_bit(), coeff=2
                   |                   |
                   |         +- m2[4] -+
                   |         |         |         +-- ct=2, cctx=3, sign=get_bit(), coeff=3
                   |         |         |         |
                   |         |         +- m2[5] -+
                   |         |                   |
                   |         |                   +-- ct=2, cctx=3, sign=get_bit(), coeff=4
                   +- m2[3] -+
                             |
                             |
                             |                   +-- ct=2, cctx=4, sign=get_bit(), coeff=coeff_parse(0)
                             |                   |
                             |         +- m1[7] -+
                             |         |         |
                             |         |         +-- ct=2, cctx=4, sign=get_bit(), coeff=coeff_parse(1)
                             |         |
                             +- m1[6] -+
                                       |
                                       |                   +-- ct=2, cctx=4, sign=get_bit(), coeff=coeff_parse(2)
                                       |                   |
                                       |         +- m1[9] -+
                                       |         |         |
                                       |         |         +-- ct=2, cctx=4, sign=get_bit(), coeff=coeff_parse(3)
                                       |         |
                                       +- m1[8] -+
                                                 |
                                                 |         +-- ct=2, cctx=4, sign=get_bit(), coeff=coeff_parse(4)
                                                 |         |
                                                 +- m1[10] +
                                                           |
                                                           +-- ct=2, cctx=4, sign=get_bit(), coeff=coeff_parse(5)

The coeff_parse algorithm used by the previous binary tree parsing takes one parameter called idx and behave like this :

Syntax Number of bits Probability Semantics
coeff = coeff_bias[idx]
for (i=coeff_bit_length[idx]; i>=0; i--) {
v 1 coeff_parse_table[idx][i]
coeff += v << i
}


Algorithms

Entropy Coding

Described here is the decoding process for the arithmetically-coded (AC) parts of the bitstream. VP5 uses a 16-bit range coding scheme to code binary symbols.

The AC decoder maintains three state variables: code, mask and high.

Initialization

At initialization, the first two bytes of the AC bitstream are shifted into code. The variable high is set to 0xff00. The variable mask is set to 0xffff.

Decoding a Binary Value

Each binary symbol has an associated probability p in the range 0 to 0xff.

A threshold, t, is computed thus:

t = 0x100 + ( 0xff00 & ( ( (high-0x100) * p ) >> 8 ) )

Equiprobable binary symbols are treated somewhat differently:

t = 0xff00 & ( (high+0x100) >> 1 )

The binary value may then be decoded by comparing code and t. If code is less than t, the binary value is decoded as 0. If code is equal to or greater than t, the binary value is decoded as 1.

If a 1 was decoded, then

high = high - t
code = code - t

If a 0 was decoded, then

high = t

The following renormalization is now repeated while (high & 0x8000) is non-zero.

high = 2 * high
code = 2 * code
mask = 2 * mask
if ((mask & 0xff) == 0x00) {
code = code | next byte from bitstream
mask = mask | 0xff
}

Decoding an Equiprobable n-bit Integer Value

Integer values are coded as a big-endian sequence of equiprobable binary values. To decode an n-bit equiprobable integer value, n equiprobable binary values should be decoded using the sequence above and left-shifted into an integral result variable.


Inverse DCT

Inverse DCT is performed on 8x8 blocks of pixels. The algorithm used is the same than the one used for the VP3 decoder in FFmpeg [1], the original vp3 iDCT code is here [2].


vector_predictor

This algorithm allows to get the valid candidate MV for current MB regarding frame_type (which is a parameter of this algorithm).

It checks all the candidate macroblocks for motion compensation. Store in nb_predictor the number of candidate MB whose last type was refering to frame_type and whose last MV was not null (no need to check for more than 2 valid candidate). The first 2 valid candidate MV are stored in the vector_candidate table.

ctx is then derived from nb_predictor with the following formula:

 ctx = (nb_predictor + 1) % 3

The candidate [MB]] are defined as (x,y) positions relative to current MB. All those possible relative position are defined in candidate_predictor_pos.

The last MB type and MV are stored in an array of size dim_x by dim_y. This array is updated as soon a we parse a new MB.


Data tables

def_mb_types_stats

 { { {  69, 42 }, {   1,  2 }, {  1,   7 }, {  44, 42 }, {  6, 22 },
     {   1,  3 }, {   0,  2 }, {  1,   5 }, {   0,  1 }, {  0,  0 }, },
   { { 229,  8 }, {   1,  1 }, {  0,   8 }, {   0,  0 }, {  0,  0 },
     {   1,  2 }, {   0,  1 }, {  0,   0 }, {   1,  1 }, {  0,  0 }, },
   { { 122, 35 }, {   1,  1 }, {  1,   6 }, {  46, 34 }, {  0,  0 },
     {   1,  2 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, }, }

pre_def_mb_type_stats

 { { { {   9, 15 }, {  32, 25 }, {  7,  19 }, {   9, 21 }, {  1, 12 },
       {  14, 12 }, {   3, 18 }, { 14,  23 }, {   3, 10 }, {  0,  4 }, },
     { {  41, 22 }, {   1,  0 }, {  1,  31 }, {   0,  0 }, {  0,  0 },
       {   0,  1 }, {   1,  7 }, {  0,   1 }, {  98, 25 }, {  4, 10 }, },
     { {   2,  3 }, {   2,  3 }, {  0,   2 }, {   0,  2 }, {  0,  0 },
       {  11,  4 }, {   1,  4 }, {  0,   2 }, {   3,  2 }, {  0,  4 }, }, },
   { { {  48, 39 }, {   1,  2 }, { 11,  27 }, {  29, 44 }, {  7, 27 },
       {   1,  4 }, {   0,  3 }, {  1,   6 }, {   1,  2 }, {  0,  0 }, },
     { { 123, 37 }, {   6,  4 }, {  1,  27 }, {   0,  0 }, {  0,  0 },
       {   5,  8 }, {   1,  7 }, {  0,   1 }, {  12, 10 }, {  0,  2 }, },
     { {  49, 46 }, {   3,  4 }, {  7,  31 }, {  42, 41 }, {  0,  0 },
       {   2,  6 }, {   1,  7 }, {  1,   4 }, {   2,  4 }, {  0,  1 }, }, },
   { { {  21, 32 }, {   1,  2 }, {  4,  10 }, {  32, 43 }, {  6, 23 },
       {   2,  3 }, {   1, 19 }, {  1,   6 }, {  12, 21 }, {  0,  7 }, },
     { {  26, 14 }, {  14, 12 }, {  0,  24 }, {   0,  0 }, {  0,  0 },
       {  55, 17 }, {   1,  9 }, {  0,  36 }, {   5,  7 }, {  1,  3 }, },
     { {  26, 25 }, {   1,  1 }, {  2,  10 }, {  67, 39 }, {  0,  0 },
       {   1,  1 }, {   0, 14 }, {  0,   2 }, {  31, 26 }, {  1,  6 }, }, },
   { { {  69, 83 }, {   0,  0 }, {  0,   2 }, {  10, 29 }, {  3, 12 },
       {   0,  1 }, {   0,  3 }, {  0,   3 }, {   2,  2 }, {  0,  0 }, },
     { { 209,  5 }, {   0,  0 }, {  0,  27 }, {   0,  0 }, {  0,  0 },
       {   0,  1 }, {   0,  1 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, },
     { { 103, 46 }, {   1,  2 }, {  2,  10 }, {  33, 42 }, {  0,  0 },
       {   1,  4 }, {   0,  3 }, {  0,   1 }, {   1,  3 }, {  0,  0 }, }, },
   { { {  11, 20 }, {   1,  4 }, { 18,  36 }, {  43, 48 }, { 13, 35 },
       {   0,  2 }, {   0,  5 }, {  3,  12 }, {   1,  2 }, {  0,  0 }, },
     { {   2,  5 }, {   4,  5 }, {  0, 121 }, {   0,  0 }, {  0,  0 },
       {   0,  3 }, {   2,  4 }, {  1,   4 }, {   2,  2 }, {  0,  1 }, },
     { {  14, 31 }, {   9, 13 }, { 14,  54 }, {  22, 29 }, {  0,  0 },
       {   2,  6 }, {   4, 18 }, {  6,  13 }, {   1,  5 }, {  0,  1 }, }, },
   { { {  70, 44 }, {   0,  1 }, {  2,  10 }, {  37, 46 }, {  8, 26 },
       {   0,  2 }, {   0,  2 }, {  0,   2 }, {   0,  1 }, {  0,  0 }, },
     { { 175,  5 }, {   0,  1 }, {  0,  48 }, {   0,  0 }, {  0,  0 },
       {   0,  2 }, {   0,  1 }, {  0,   2 }, {   0,  1 }, {  0,  0 }, },
     { {  85, 39 }, {   0,  0 }, {  1,   9 }, {  69, 40 }, {  0,  0 },
       {   0,  1 }, {   0,  3 }, {  0,   1 }, {   2,  3 }, {  0,  0 }, }, },
   { { {   8, 15 }, {   0,  1 }, {  8,  21 }, {  74, 53 }, { 22, 42 },
       {   0,  1 }, {   0,  2 }, {  0,   3 }, {   1,  2 }, {  0,  0 }, },
     { {  83,  5 }, {   2,  3 }, {  0, 102 }, {   0,  0 }, {  0,  0 },
       {   1,  3 }, {   0,  2 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, },
     { {  31, 28 }, {   0,  0 }, {  3,  14 }, { 130, 34 }, {  0,  0 },
       {   0,  1 }, {   0,  3 }, {  0,   1 }, {   3,  3 }, {  0,  1 }, }, },
   { { { 141, 42 }, {   0,  0 }, {  1,   4 }, {  11, 24 }, {  1, 11 },
       {   0,  1 }, {   0,  1 }, {  0,   2 }, {   0,  0 }, {  0,  0 }, },
     { { 233,  6 }, {   0,  0 }, {  0,   8 }, {   0,  0 }, {  0,  0 },
       {   0,  1 }, {   0,  1 }, {  0,   0 }, {   0,  1 }, {  0,  0 }, },
     { { 171, 25 }, {   0,  0 }, {  1,   5 }, {  25, 21 }, {  0,  0 },
       {   0,  1 }, {   0,  1 }, {  0,   0 }, {   0,  0 }, {  0,  0 }, }, },
   { { {   8, 19 }, {   4, 10 }, { 24,  45 }, {  21, 37 }, {  9, 29 },
       {   0,  3 }, {   1,  7 }, { 11,  25 }, {   0,  2 }, {  0,  1 }, },
     { {  34, 16 }, { 112, 21 }, {  1,  28 }, {   0,  0 }, {  0,  0 },
       {   6,  8 }, {   1,  7 }, {  0,   3 }, {   2,  5 }, {  0,  2 }, },
     { {  17, 21 }, {  68, 29 }, {  6,  15 }, {  13, 22 }, {  0,  0 },
       {   6, 12 }, {   3, 14 }, {  4,  10 }, {   1,  7 }, {  0,  3 }, }, },
   { { {  46, 42 }, {   0,  1 }, {  2,  10 }, {  54, 51 }, { 10, 30 },
       {   0,  2 }, {   0,  2 }, {  0,   1 }, {   0,  1 }, {  0,  0 }, },
     { { 159, 35 }, {   2,  2 }, {  0,  25 }, {   0,  0 }, {  0,  0 },
       {   3,  6 }, {   0,  5 }, {  0,   1 }, {   4,  4 }, {  0,  1 }, },
     { {  51, 39 }, {   0,  1 }, {  2,  12 }, {  91, 44 }, {  0,  0 },
       {   0,  2 }, {   0,  3 }, {  0,   1 }, {   2,  3 }, {  0,  1 }, }, },
   { { {  28, 32 }, {   0,  0 }, {  3,  10 }, {  75, 51 }, { 14, 33 },
       {   0,  1 }, {   0,  2 }, {  0,   1 }, {   1,  2 }, {  0,  0 }, },
     { {  75, 39 }, {   5,  7 }, {  2,  48 }, {   0,  0 }, {  0,  0 },
       {   3, 11 }, {   2, 16 }, {  1,   4 }, {   7, 10 }, {  0,  2 }, },
     { {  81, 25 }, {   0,  0 }, {  2,   9 }, { 106, 26 }, {  0,  0 },
       {   0,  1 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, }, },
   { { { 100, 46 }, {   0,  1 }, {  3,   9 }, {  21, 37 }, {  5, 20 },
       {   0,  1 }, {   0,  2 }, {  1,   2 }, {   0,  1 }, {  0,  0 }, },
     { { 212, 21 }, {   0,  1 }, {  0,   9 }, {   0,  0 }, {  0,  0 },
       {   1,  2 }, {   0,  2 }, {  0,   0 }, {   2,  2 }, {  0,  0 }, },
     { { 140, 37 }, {   0,  1 }, {  1,   8 }, {  24, 33 }, {  0,  0 },
       {   1,  2 }, {   0,  2 }, {  0,   1 }, {   1,  2 }, {  0,  0 }, }, },
   { { {  27, 29 }, {   0,  1 }, {  9,  25 }, {  53, 51 }, { 12, 34 },
       {   0,  1 }, {   0,  3 }, {  1,   5 }, {   0,  2 }, {  0,  0 }, },
     { {   4,  2 }, {   0,  0 }, {  0, 172 }, {   0,  0 }, {  0,  0 },
       {   0,  1 }, {   0,  2 }, {  0,   0 }, {   2,  0 }, {  0,  0 }, },
     { {  14, 23 }, {   1,  3 }, { 11,  53 }, {  90, 31 }, {  0,  0 },
       {   0,  3 }, {   1,  5 }, {  2,   6 }, {   1,  2 }, {  0,  0 }, }, },
   { { {  80, 38 }, {   0,  0 }, {  1,   4 }, {  69, 33 }, {  5, 16 },
       {   0,  1 }, {   0,  1 }, {  0,   0 }, {   0,  1 }, {  0,  0 }, },
     { { 187, 22 }, {   1,  1 }, {  0,  17 }, {   0,  0 }, {  0,  0 },
       {   3,  6 }, {   0,  4 }, {  0,   1 }, {   4,  4 }, {  0,  1 }, },
     { { 123, 29 }, {   0,  0 }, {  1,   7 }, {  57, 30 }, {  0,  0 },
       {   0,  1 }, {   0,  1 }, {  0,   1 }, {   0,  1 }, {  0,  0 }, }, },
   { { {  16, 20 }, {   0,  0 }, {  2,   8 }, { 104, 49 }, { 15, 33 },
       {   0,  1 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, },
     { { 133,  6 }, {   1,  2 }, {  1,  70 }, {   0,  0 }, {  0,  0 },
       {   0,  2 }, {   0,  4 }, {  0,   3 }, {   1,  1 }, {  0,  0 }, },
     { {  13, 14 }, {   0,  0 }, {  4,  20 }, { 175, 20 }, {  0,  0 },
       {   0,  1 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, }, },
   { { { 194, 16 }, {   0,  0 }, {  1,   1 }, {   1,  9 }, {  1,  3 },
       {   0,  0 }, {   0,  1 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, },
     { { 251,  1 }, {   0,  0 }, {  0,   2 }, {   0,  0 }, {  0,  0 },
       {   0,  0 }, {   0,  0 }, {  0,   0 }, {   0,  0 }, {  0,  0 }, },
     { { 202, 23 }, {   0,  0 }, {  1,   3 }, {   2,  9 }, {  0,  0 },
       {   0,  1 }, {   0,  1 }, {  0,   1 }, {   0,  0 }, {  0,  0 }, }, }, }

vmc_pct

 { { 243, 220, 251, 253, 237, 232, 241, 245, 247, 251, 253 },
   { 235, 211, 246, 249, 234, 231, 248, 249, 252, 252, 254 }, }

dccv_pct

 { { 146, 197, 181, 207, 232, 243, 238, 251, 244, 250, 249 },
   { 179, 219, 214, 240, 250, 254, 244, 254, 254, 254, 254 }, }

ract_pct

 { { { { 227, 246, 230, 247, 244, 254, 254, 254, 254, 254, 254 },
       { 202, 254, 209, 231, 231, 249, 249, 253, 254, 254, 254 },
       { 206, 254, 225, 242, 241, 251, 253, 254, 254, 254, 254 },
       { 235, 254, 241, 253, 252, 254, 254, 254, 254, 254, 254 },
       { 234, 254, 248, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, },
     { { 240, 254, 248, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 238, 254, 240, 253, 254, 254, 254, 254, 254, 254, 254 },
       { 244, 254, 251, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, }, },
   { { { 206, 203, 227, 239, 247, 254, 253, 254, 254, 254, 254 },
       { 207, 199, 220, 236, 243, 252, 252, 254, 254, 254, 254 },
       { 212, 219, 230, 243, 244, 253, 252, 254, 254, 254, 254 },
       { 236, 237, 247, 252, 253, 254, 254, 254, 254, 254, 254 },
       { 240, 240, 248, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, },
     { { 230, 233, 249, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 238, 238, 250, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 248, 251, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, }, },
   { { { 225, 239, 227, 231, 244, 253, 243, 254, 254, 253, 254 },
       { 232, 234, 224, 228, 242, 249, 242, 252, 251, 251, 254 },
       { 235, 249, 238, 240, 251, 254, 249, 254, 253, 253, 254 },
       { 249, 253, 251, 250, 254, 254, 254, 254, 254, 254, 254 },
       { 251, 250, 249, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, },
     { { 243, 244, 250, 250, 254, 254, 254, 254, 254, 254, 254 },
       { 249, 248, 250, 253, 254, 254, 254, 254, 254, 254, 254 },
       { 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 },
       { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, }, }, }

dccv_lc

 { { {154,  61}, {141,  54}, { 90,  45}, { 54,  34}, { 54,  13}, {128, 109},
     {136,  54}, {148,  45}, { 92,  41}, { 54,  33}, { 51,  15}, { 87, 113},
     { 87,  44}, { 97,  40}, { 67,  36}, { 46,  29}, { 41,  15}, { 64,  80},
     { 59,  33}, { 61,  31}, { 51,  28}, { 44,  22}, { 33,  12}, { 49,  63},
     { 69,  12}, { 59,  16}, { 46,  14}, { 31,  13}, { 26,   6}, { 92,  26},
     {128, 108}, { 77, 119}, { 54,  84}, { 26,  71}, { 87,  19}, { 95, 155}, },
   { {154,   4}, {182,   0}, {159,  -8}, {128,  -5}, {143,  -5}, {187,  55},
     {182,   0}, {228,  -3}, {187,  -7}, {174,  -9}, {189, -11}, {169,  79},
     {161,  -9}, {192,  -8}, {187,  -9}, {169, -10}, {136,  -9}, {184,  40},
     {164, -11}, {179, -10}, {174, -10}, {161, -10}, {115,  -7}, {197,  20},
     {195, -11}, {195, -11}, {146, -10}, {110,  -6}, { 95,  -4}, {195,  39},
     {182,  55}, {172,  77}, {177,  37}, {169,  29}, {172,  52}, { 92, 162}, },
   { {174,  80}, {164,  80}, { 95,  80}, { 46,  66}, { 56,  24}, { 36, 193},
     {164,  80}, {166,  77}, {105,  76}, { 49,  68}, { 46,  31}, { 49, 186},
     { 97,  78}, {110,  74}, { 72,  72}, { 44,  60}, { 33,  30}, { 69, 131},
     { 61,  61}, { 69,  63}, { 51,  57}, { 31,  48}, { 26,  27}, { 64,  89},
     { 67,  23}, { 51,  32}, { 36,  33}, { 26,  28}, { 20,  12}, { 44,  68},
     { 26, 197}, { 41, 189}, { 61, 129}, { 28, 103}, { 49,  52}, {-12, 245}, },
   { {102, 141}, { 79, 166}, { 72, 162}, { 97, 125}, {179,   4}, {307,   0},
     { 72, 168}, { 69, 175}, { 84, 160}, {105, 127}, {148,  34}, {310,   0},
     { 84, 151}, { 82, 161}, { 87, 153}, { 87, 135}, {115,  51}, {317,   0},
     { 97, 125}, {102, 131}, {105, 125}, { 87, 122}, { 84,  64}, { 54, 184},
     {166,  18}, {146,  43}, {125,  51}, { 90,  64}, { 95,   7}, { 38, 154},
     {294,   0}, { 13, 225}, { 10, 225}, { 67, 168}, {  0, 167}, {161,  94}, },
   { {172,  76}, {172,  75}, {136,  80}, { 64,  98}, { 74,  67}, {315,   0},
     {169,  76}, {207,  56}, {164,  66}, { 97,  80}, { 67,  72}, {328,   0},
     {136,  80}, {187,  53}, {154,  62}, { 72,  85}, { -2, 105}, {305,   0},
     { 74,  91}, {128,  64}, {113,  64}, { 61,  77}, { 41,  75}, {259,   0},
     { 46,  84}, { 51,  81}, { 28,  89}, { 31,  78}, { 23,  77}, {202,   0},
     {323,   0}, {323,   0}, {300,   0}, {236,   0}, {195,   0}, {328,   0}, }, }

ract_lc

 { { { { {276,  0}, {238,  0}, {195,  0}, {156,  0}, {113,  0}, {274,  0} },
       { {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1} },
       { {192, 59}, {182, 50}, {141, 48}, {110, 40}, { 92, 19}, {125,128} },
       { {169, 87}, {169, 83}, {184, 62}, {220, 16}, {184,  0}, {264,  0} },
       { {212, 40}, {212, 36}, {169, 49}, {174, 27}, {  8,120}, {182, 71} }, },
     { { {259, 10}, {197, 19}, {143, 22}, {123, 16}, {110,  8}, {133, 88} },
       { {  0,  1}, {256,  0}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1} },
       { {207, 46}, {187, 50}, { 97, 83}, { 23,100}, { 41, 56}, { 56,188} },
       { {166, 90}, {146,108}, {161, 88}, {136, 95}, {174,  0}, {266,  0} },
       { {264,  7}, {243, 18}, {184, 43}, {-14,154}, { 20,112}, { 20,199} }, },
     { { {230, 26}, {197, 22}, {159, 20}, {146, 12}, {136,  4}, { 54,162} },
       { {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1}, {  0,  1} },
       { {192, 59}, {156, 72}, { 84,101}, { 49,101}, { 79, 47}, { 79,167} },
       { {138,115}, {136,116}, {166, 80}, {238,  0}, {195,  0}, {261,  0} },
       { {225, 33}, {205, 42}, {159, 61}, { 79, 96}, { 92, 66}, { 28,195} }, },
   }, {
     { { {200, 37}, {197, 18}, {159, 13}, {143,  7}, {102,  5}, {123,126} },
       { {197,  3}, {220, -9}, {210,-12}, {187, -6}, {151, -2}, {174, 80} },
       { {200, 53}, {187, 47}, {159, 40}, {118, 38}, {100, 18}, {141,111} },
       { {179, 78}, {166, 86}, {197, 50}, {207, 27}, {187,  0}, {115,139} },
       { {218, 34}, {220, 29}, {174, 46}, {128, 61}, { 54, 89}, {187, 65} }, },
     { { {238, 14}, {197, 18}, {125, 26}, { 90, 25}, { 82, 13}, {161, 86} },
       { {189,  1}, {205, -2}, {156, -4}, {143, -4}, {146, -4}, {172, 72} },
       { {230, 31}, {192, 45}, {102, 76}, { 38, 85}, { 56, 41}, { 64,173} },
       { {166, 91}, {141,111}, {128,116}, {118,109}, {177,  0}, { 23,222} },
       { {253, 14}, {236, 21}, {174, 49}, { 33,118}, { 44, 93}, { 23,187} }, },
     { { {218, 28}, {179, 28}, {118, 35}, { 95, 30}, { 72, 24}, {128,108} },
       { {187,  1}, {174, -1}, {125, -1}, {110, -1}, {108, -1}, {202, 52} },
       { {197, 53}, {146, 75}, { 46,118}, { 33,103}, { 64, 50}, {118,126} },
       { {138,114}, {128,122}, {161, 86}, {243, -6}, {195,  0}, { 38,210} },
       { {215, 39}, {179, 58}, { 97,101}, { 95, 85}, { 87, 70}, { 69,152} }, },
   }, {
     { { {236, 24}, {205, 18}, {172, 12}, {154,  6}, {125,  1}, {169, 75} },
       { {187,  4}, {230, -2}, {228, -4}, {236, -4}, {241, -2}, {192, 66} },
       { {200, 46}, {187, 42}, {159, 34}, {136, 25}, {105, 10}, {179, 62} },
       { {207, 55}, {192, 63}, {192, 54}, {195, 36}, {177,  1}, {143, 98} },
       { {225, 27}, {207, 34}, {200, 30}, {131, 57}, { 97, 60}, {197, 45} }, },
     { { {271,  8}, {218, 13}, {133, 19}, { 90, 19}, { 72,  7}, {182, 51} },
       { {179,  1}, {225, -1}, {154, -2}, {110, -1}, { 92,  0}, {195, 41} },
       { {241, 26}, {189, 40}, { 82, 64}, { 33, 60}, { 67, 17}, {120, 94} },
       { {192, 68}, {151, 94}, {146, 90}, {143, 72}, {161,  0}, {113,128} },
       { {256, 12}, {218, 29}, {166, 48}, { 44, 99}, { 31, 87}, {148, 78} }, },
     { { {238, 20}, {184, 22}, {113, 27}, { 90, 22}, { 74,  9}, {192, 37} },
       { {184,  0}, {215, -1}, {141, -1}, { 97,  0}, { 49,  0}, {264, 13} },
       { {182, 51}, {138, 61}, { 95, 63}, { 54, 59}, { 64, 25}, {200, 45} },
       { {179, 75}, {156, 87}, {174, 65}, {177, 44}, {174,  0}, {164, 85} },
       { {195, 45}, {148, 65}, {105, 79}, { 95, 72}, { 87, 60}, {169, 63} }, }, }
};

coeff_groups

 { -1, 0, 1, 1, 2, 1, 1, 2,
    2, 1, 1, 2, 2, 2, 1, 2,
    2, 2, 2, 2, 1, 1, 2, 2,
    3, 3, 4, 3, 4, 4, 4, 3,
    3, 3, 3, 3, 4, 3, 3, 3,
    4, 4, 4, 4, 4, 3, 3, 4,
    4, 4, 3, 4, 4, 4, 4, 4,
    4, 4, 5, 5, 5, 5, 5, 5, }

coeff_bias

 { 5, 7, 11, 19, 35, 67 }

coeff_bit_length

 { 0, 1, 2, 3, 4, 10 }

coeff_parse_table

 { { 159,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0 },
   { 145, 165,   0,   0,   0,   0,   0,   0,   0,   0,   0 },
   { 140, 148, 173,   0,   0,   0,   0,   0,   0,   0,   0 },
   { 135, 140, 155, 176,   0,   0,   0,   0,   0,   0,   0 },
   { 130, 134, 141, 157, 180,   0,   0,   0,   0,   0,   0 },
   { 129, 130, 133, 140, 153, 177, 196, 230, 243, 254, 254 }, }

candidate_predictor_pos

 { {  0, -1 },
   { -1,  0 },
   { -1, -1 },
   {  1, -1 },
   {  0, -2 },
   { -2,  0 },
   { -2, -1 },
   { -1, -2 },
   {  1, -2 },
   {  2, -1 },
   { -2, -2 },
   {  2, -2 }, }