< draft-bankoski-vp8-bitstream-03.txt   draft-bankoski-vp8-bitstream-04.txt >
Network Working Group J. Bankoski Network Working Group J. Bankoski
Internet-Draft J. Koleszar Internet-Draft J. Koleszar
Intended status: Informational L. Quillio Intended status: Informational L. Quillio
Expires: December 17, 2011 J. Salonen Expires: December 18, 2011 J. Salonen
P. Wilkins P. Wilkins
Y. Xu Y. Xu
Google Inc. Google Inc.
June 15, 2011 June 16, 2011
VP8 Data Format and Decoding Guide VP8 Data Format and Decoding Guide
draft-bankoski-vp8-bitstream-03 draft-bankoski-vp8-bitstream-04
Abstract Abstract
This document describes the VP8 compressed video data format, This document describes the VP8 compressed video data format,
together with a discussion of the decoding procedure for the format. together with a discussion of the decoding procedure for the format.
Status of this Memo Status of this Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
skipping to change at page 1, line 35 skipping to change at page 1, line 35
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on December 17, 2011. This Internet-Draft will expire on December 18, 2011.
Copyright Notice Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the Copyright (c) 2011 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 3, line 27 skipping to change at page 3, line 27
17.1. Coding of Each Component . . . . . . . . . . . . . . . . 117 17.1. Coding of Each Component . . . . . . . . . . . . . . . . 117
17.2. Probability Updates . . . . . . . . . . . . . . . . . . 119 17.2. Probability Updates . . . . . . . . . . . . . . . . . . 119
18. Interframe Prediction . . . . . . . . . . . . . . . . . . . . 122 18. Interframe Prediction . . . . . . . . . . . . . . . . . . . . 122
18.1. Bounds on and Adjustment of Motion Vectors . . . . . . . 122 18.1. Bounds on and Adjustment of Motion Vectors . . . . . . . 122
18.2. Prediction Subblocks . . . . . . . . . . . . . . . . . . 123 18.2. Prediction Subblocks . . . . . . . . . . . . . . . . . . 123
18.3. Sub-pixel Interpolation . . . . . . . . . . . . . . . . 124 18.3. Sub-pixel Interpolation . . . . . . . . . . . . . . . . 124
18.4. Filter Properties . . . . . . . . . . . . . . . . . . . 127 18.4. Filter Properties . . . . . . . . . . . . . . . . . . . 127
19. Annex A: Bitstream Syntax . . . . . . . . . . . . . . . . . . 130 19. Annex A: Bitstream Syntax . . . . . . . . . . . . . . . . . . 130
19.1. Uncompressed Data Chunk . . . . . . . . . . . . . . . . 130 19.1. Uncompressed Data Chunk . . . . . . . . . . . . . . . . 130
19.2. Frame Header . . . . . . . . . . . . . . . . . . . . . . 132 19.2. Frame Header . . . . . . . . . . . . . . . . . . . . . . 132
19.3. Macroblock Data . . . . . . . . . . . . . . . . . . . . 144 19.3. Macroblock Data . . . . . . . . . . . . . . . . . . . . 143
20. Attachment One: Reference Decoder Source Code . . . . . . . . 148 20. Attachment One: Reference Decoder Source Code . . . . . . . . 147
20.1. bit_ops.h . . . . . . . . . . . . . . . . . . . . . . . 148 20.1. bit_ops.h . . . . . . . . . . . . . . . . . . . . . . . 147
20.2. bool_decoder.h . . . . . . . . . . . . . . . . . . . . . 148 20.2. bool_decoder.h . . . . . . . . . . . . . . . . . . . . . 147
20.3. dequant_data.h . . . . . . . . . . . . . . . . . . . . . 152 20.3. dequant_data.h . . . . . . . . . . . . . . . . . . . . . 151
20.4. dixie.c . . . . . . . . . . . . . . . . . . . . . . . . 152 20.4. dixie.c . . . . . . . . . . . . . . . . . . . . . . . . 151
20.5. dixie.h . . . . . . . . . . . . . . . . . . . . . . . . 164 20.5. dixie.h . . . . . . . . . . . . . . . . . . . . . . . . 163
20.6. dixie_loopfilter.c . . . . . . . . . . . . . . . . . . . 171 20.6. dixie_loopfilter.c . . . . . . . . . . . . . . . . . . . 170
20.7. dixie_loopfilter.h . . . . . . . . . . . . . . . . . . . 183 20.7. dixie_loopfilter.h . . . . . . . . . . . . . . . . . . . 182
20.8. idct_add.c . . . . . . . . . . . . . . . . . . . . . . . 183 20.8. idct_add.c . . . . . . . . . . . . . . . . . . . . . . . 182
20.9. idct_add.h . . . . . . . . . . . . . . . . . . . . . . . 187 20.9. idct_add.h . . . . . . . . . . . . . . . . . . . . . . . 186
20.10. mem.h . . . . . . . . . . . . . . . . . . . . . . . . . 187 20.10. mem.h . . . . . . . . . . . . . . . . . . . . . . . . . 186
20.11. modemv.c . . . . . . . . . . . . . . . . . . . . . . . . 189 20.11. modemv.c . . . . . . . . . . . . . . . . . . . . . . . . 188
20.12. modemv.h . . . . . . . . . . . . . . . . . . . . . . . . 204 20.12. modemv.h . . . . . . . . . . . . . . . . . . . . . . . . 203
20.13. modemv_data.h . . . . . . . . . . . . . . . . . . . . . 204 20.13. modemv_data.h . . . . . . . . . . . . . . . . . . . . . 203
20.14. predict.c . . . . . . . . . . . . . . . . . . . . . . . 209 20.14. predict.c . . . . . . . . . . . . . . . . . . . . . . . 208
20.15. predict.h . . . . . . . . . . . . . . . . . . . . . . . 239 20.15. predict.h . . . . . . . . . . . . . . . . . . . . . . . 238
20.16. tokens.c . . . . . . . . . . . . . . . . . . . . . . . . 239 20.16. tokens.c . . . . . . . . . . . . . . . . . . . . . . . . 238
20.17. tokens.h . . . . . . . . . . . . . . . . . . . . . . . . 249 20.17. tokens.h . . . . . . . . . . . . . . . . . . . . . . . . 248
20.18. vp8_prob_data.h . . . . . . . . . . . . . . . . . . . . 258 20.18. vp8_prob_data.h . . . . . . . . . . . . . . . . . . . . 257
20.19. vpx_codec_internal.h . . . . . . . . . . . . . . . . . . 267 20.19. vpx_codec_internal.h . . . . . . . . . . . . . . . . . . 266
20.20. vpx_decoder.h . . . . . . . . . . . . . . . . . . . . . 277 20.20. vpx_decoder.h . . . . . . . . . . . . . . . . . . . . . 276
20.21. vpx_integer.h . . . . . . . . . . . . . . . . . . . . . 284 20.21. vpx_integer.h . . . . . . . . . . . . . . . . . . . . . 283
20.22. AUTHORS . . . . . . . . . . . . . . . . . . . . . . . . 286 20.22. AUTHORS . . . . . . . . . . . . . . . . . . . . . . . . 285
20.23. LICENSE . . . . . . . . . . . . . . . . . . . . . . . . 287 20.23. LICENSE . . . . . . . . . . . . . . . . . . . . . . . . 286
20.24. PATENTS . . . . . . . . . . . . . . . . . . . . . . . . 288 20.24. PATENTS . . . . . . . . . . . . . . . . . . . . . . . . 287
21. References . . . . . . . . . . . . . . . . . . . . . . . . . 290 21. References . . . . . . . . . . . . . . . . . . . . . . . . . 289
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 291 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 290
1. Introduction 1. Introduction
This document describes the VP8 compressed video data format, This document describes the VP8 compressed video data format,
together with a discussion of the decoding procedure for the format. together with a discussion of the decoding procedure for the format.
It is intended to be used in conjunction with and as a guide to the It is intended to be used in conjunction with and as a guide to the
reference decoder source code provided in Attachment One. If there reference decoder source code provided in Attachment One. If there
are any conflicts between this narrative and the reference source are any conflicts between this narrative and the reference source
code, the reference source code should be considered correct. The code, the reference source code should be considered correct. The
bitstream is defined by the reference source code and not this bitstream is defined by the reference source code and not this
skipping to change at page 11, line 33 skipping to change at page 11, line 33
All partitions are decoded using separate instances of the boolean All partitions are decoded using separate instances of the boolean
entropy decoder described in Chapter 7. Although some of the data entropy decoder described in Chapter 7. Although some of the data
represented within the partitions is conceptually "flat" (a bit is represented within the partitions is conceptually "flat" (a bit is
just a bit with no probabilistic expectation one way or the other), just a bit with no probabilistic expectation one way or the other),
because of the way such coders work, there is never a direct because of the way such coders work, there is never a direct
correspondence between a "conceptual bit" and an actual physical bit correspondence between a "conceptual bit" and an actual physical bit
in the compressed data partitions. Only in the 3 or 10 byte in the compressed data partitions. Only in the 3 or 10 byte
uncompressed chunk described above is there such a physical uncompressed chunk described above is there such a physical
correspondence. correspondence.
A related matter, which is true for most lossless compression A related matter is that seeking within a partition is not supported.
formats, is that seeking within a partition is not supported. The The data must be decompressed and processed (or at least stored) in
data must be decompressed and processed (or at least stored) in the the order in which it occurs in the partition.
order in which it occurs in the partition.
While this document specifies the ordering of the partition data While this document specifies the ordering of the partition data
correctly, the details and semantics of this data are discussed in a correctly, the details and semantics of this data are discussed in a
more logical fashion to facilitate comprehension. For example, the more logical fashion to facilitate comprehension. For example, the
frame header contains updates to many probability tables used in frame header contains updates to many probability tables used in
decoding per-macroblock data. The latter is often described before decoding per-macroblock data. The latter is often described before
the layouts of the probabilities and their updates, even though this the layouts of the probabilities and their updates, even though this
is the opposite of their order in the bitstream. is the opposite of their order in the bitstream.
5. Overview of the Decoding Process 5. Overview of the Decoding Process
skipping to change at page 68, line 46 skipping to change at page 68, line 46
cat2 = "111101" */ cat2 = "111101" */
18, 20, 18, 20,
-dct_cat3, -dct_cat4, /* cat3 = "1111100", -dct_cat3, -dct_cat4, /* cat3 = "1111100",
cat4 = "1111101" */ cat4 = "1111101" */
-dct_cat5, -dct_cat6 /* cat4 = "1111110", -dct_cat5, -dct_cat6 /* cat4 = "1111110",
cat4 = "1111111" */ cat4 = "1111111" */
}; };
---- End code block ---------------------------------------- ---- End code block ----------------------------------------
While in general all DCT coefficients are decoded using the same In general, all DCT coefficients are decoded using the same tree.
tree, decoding of certain DCT coefficients may skip the first branch, However, if the preceding coefficient is a DCT_0, decoding will skip
whose preceding coefficient is a DCT_0. This makes use of the fact the first branch since it is not possible for dct_eob to follow a
that in any block last non zero coefficient before the end of the DCT_0.
block is not 0, therefore no dct_eob follows a DCT_0 coefficient in
any block.
The tokens dct_cat1 ... dct_cat6 specify ranges of unsigned values, The tokens dct_cat1 ... dct_cat6 specify ranges of unsigned values,
the value within the range being formed by adding an unsigned offset the value within the range being formed by adding an unsigned offset
(whose width is 1, 2, 3, 4, 5, or 11 bits, respectively) to the base (whose width is 1, 2, 3, 4, 5, or 11 bits, respectively) to the base
of the range, using the following algorithm and fixed probability of the range, using the following algorithm and fixed probability
tables. tables.
---- Begin code block -------------------------------------- ---- Begin code block --------------------------------------
uint DCTextra( bool_decoder *d, const Prob *p) uint DCTextra( bool_decoder *d, const Prob *p)
skipping to change at page 70, line 4 skipping to change at page 69, line 49
The probability specification for the token tree (unlike that for the The probability specification for the token tree (unlike that for the
"extra bits" described above) is rather involved. It uses three "extra bits" described above) is rather involved. It uses three
pieces of context to index a large probability table, the contents of pieces of context to index a large probability table, the contents of
which may be incrementally modified in the frame header. The full which may be incrementally modified in the frame header. The full
(non-constant) probability table is laid out as follows. (non-constant) probability table is laid out as follows.
---- Begin code block -------------------------------------- ---- Begin code block --------------------------------------
Prob coef_probs [4] [8] [3] [num_dct_tokens-1]; Prob coef_probs [4] [8] [3] [num_dct_tokens-1];
---- End code block ----------------------------------------
---- End code block ----------------------------------------
Working from the outside in, the outermost dimension is indexed by Working from the outside in, the outermost dimension is indexed by
the type of plane being decoded: the type of plane being decoded:
o 0 - Y beginning at coefficient 1 (i.e., Y after Y2) o 0 - Y beginning at coefficient 1 (i.e., Y after Y2)
o 1 - Y2 o 1 - Y2
o 2 - U or V o 2 - U or V
o 3 - Y beginning at coefficient 0 (i.e., Y in the absence of Y2). o 3 - Y beginning at coefficient 0 (i.e., Y in the absence of Y2).
skipping to change at page 70, line 48 skipping to change at page 70, line 46
is a fixed mapping of position to "band". is a fixed mapping of position to "band".
The third dimension is the trickiest. Roughly speaking, it measures The third dimension is the trickiest. Roughly speaking, it measures
the "local complexity" or extent to which nearby coefficients are the "local complexity" or extent to which nearby coefficients are
non-zero. non-zero.
For the first coefficient (DC, unless the block type is 0), we For the first coefficient (DC, unless the block type is 0), we
consider the (already encoded) blocks within the same plane (Y2, Y, consider the (already encoded) blocks within the same plane (Y2, Y,
U, or V) above and to the left of the current block. The context U, or V) above and to the left of the current block. The context
index is then the number (0, 1 or 2) of these blocks that had at index is then the number (0, 1 or 2) of these blocks that had at
least one non-zero coefficient in their residue record. least one non-zero coefficient in their residue record. Specifically
for Y2, because macroblocks above and to the left may or may not have
a Y2 block, the block above is determined by the most recent
macroblock in the same column that has a Y2 block, and the block to
the left is determined by the most recent macroblock in the same row
that has a Y2 block.
Beyond the first coefficient, the context index is determined by the Beyond the first coefficient, the context index is determined by the
absolute value of the most recently decoded coefficient (necessarily absolute value of the most recently decoded coefficient (necessarily
within the current block) and is 0 if the last coefficient was a within the current block) and is 0 if the last coefficient was a
zero, 1 if it was plus or minus one, and 2 if its absolute value zero, 1 if it was plus or minus one, and 2 if its absolute value
exceeded one. exceeded one.
Note that the intuitive meaning of this measure changes as Note that the intuitive meaning of this measure changes as
coefficients are decoded. For example, prior to the first token, a coefficients are decoded. For example, prior to the first token, a
zero means that the neighbors are empty, suggesting that the current zero means that the neighbors are empty, suggesting that the current
skipping to change at page 141, line 4 skipping to change at page 140, line 19
value corresponding to a certain used reference frame is updated value corresponding to a certain used reference frame is updated
(Section 9.4) (Section 9.4)
o delta_magnitude is the absolute value of the delta value o delta_magnitude is the absolute value of the delta value
o delta_sign is the sign of the delta value o delta_sign is the sign of the delta value
o mb_mode_delta_update_flag indicates if the adjustment delta value o mb_mode_delta_update_flag indicates if the adjustment delta value
corresponding to certain MB prediction mode is updated corresponding to certain MB prediction mode is updated
(Section 9.4) (Section 9.4)
+----------------------------+------+ +----------------------------+------+
| quant_indices() | Type | | quant_indices() | Type |
+----------------------------+------+ +----------------------------+------+
| y_ac_qi | L(7) | | y_ac_qi | L(7) |
| | | | | |
| y_dc_delta_present | L(1) | | y_dc_delta_present | L(1) |
| | | | | |
| if (y_dc_delta_present) { | | | if (y_dc_delta_present) { | |
| | | | | |
| y_dc_delta_magnitude | L(4) | | y_dc_delta_magnitude | L(4) |
| | | | | |
| y_dc_delta_sign | L(1) | | y_dc_delta_sign | L(1) |
| | | | | |
| } | | | } | |
| | | | | |
| y2_dc_delta_present | L(1) |
| | |
| if (y2_dc_delta_present) { | | | if (y2_dc_delta_present) { | |
| | | | | |
| y2_dc_delta_magnitude | L(4) | | y2_dc_delta_magnitude | L(4) |
| | | | | |
| y2_dc_delta_sign | L(1) | | y2_dc_delta_sign | L(1) |
| | | | | |
| } | | | } | |
| | | | | |
| y2_ac_delta_present | L(1) |
| | |
| if (y2_ac_delta_present) { | | | if (y2_ac_delta_present) { | |
| | | | | |
| y2_ac_delta_magnitude | L(4) | | y2_ac_delta_magnitude | L(4) |
| | | | | |
| y2_ac_delta_sign | L(1) | | y2_ac_delta_sign | L(1) |
| | | | | |
| } | | | } | |
| | | | | |
| uv_dc_delta_present | L(1) |
| | |
| if (uv_dc_delta_present) { | | | if (uv_dc_delta_present) { | |
| | | | | |
| uv_dc_delta_magnitude | L(4) | | uv_dc_delta_magnitude | L(4) |
| | | | | |
| uv_dc_delta_sign | L(1) | | uv_dc_delta_sign | L(1) |
| | | | | |
| } | | | } | |
| | | | | |
| uv_ac_delta_present | L(1) |
| | |
| if (uv_ac_delta_present) { | | | if (uv_ac_delta_present) { | |
| | | | | |
| uv_ac_delta_magnitude | L(4) | | uv_ac_delta_magnitude | L(4) |
| | | | | |
| uv_ac_delta_sign | L(1) | | uv_ac_delta_sign | L(1) |
| | | | | |
| } | | | } | |
+----------------------------+------+ +----------------------------+------+
o y_ac_qi is the dequantization table index used for the luma AC o y_ac_qi is the dequantization table index used for the luma AC
 End of changes. 15 change blocks. 
44 lines changed or deleted 55 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/