blob: d0d16934c042c8799da7b4001771a99e60da6cad [file] [log] [blame]
#### A.2 Frame Header {#h-0a-02}
| Frame Header | Type |
|----------------------------------------------|-------|
| `if (key_frame) {` | |
| ` color_space` | L(1) |
| ` clamping_type` | L(1) |
| `}` | |
| `segmentation_enabled` | L(1) |
| `if (segmentation_enabled) {` | |
| ` update_segmentation()` | |
| `}` | |
| `filter_type` | L(1) |
| `loop_filter_level` | L(6) |
| `sharpness_level` | L(3) |
| `mb_lf_adjustments()` | |
| `log2_nbr_of_dct_partitions` | L(2) |
| `quant_indices()` | |
| `if (key_frame) {` | |
| ` refresh_entropy_probs` | L(1) |
| `} else {` | |
| ` refresh_golden_frame` | L(1) |
| ` refresh_alternate_frame` | L(1) |
| ` if (!refresh_golden_frame)` | |
| ` copy_buffer_to_golden` | L(2) |
| ` if (!refresh_alternate_frame)` | |
| ` copy_buffer_to_alternate` | L(2) |
| ` sign_bias_golden` | L(1) |
| ` sign_bias_alternate` | L(1) |
| ` refresh_entropy_probs` | L(1) |
| ` refresh_last` | L(1) |
| `}` | |
| `token_prob_update()` | |
| `mb_no_coeff_skip` | L(1) |
{:.col1-pre}
| Frame Header | Type |
|----------------------------------------------|-------|
| `prob_skip_false` | L(8) |
| `if (!key_frame) {` | |
| ` prob_intra` | L(8) |
| ` prob_last` | L(8) |
| ` prob_golden` | L(8) |
| ` intra_16x16_prob_update_flag` | L(1) |
| ` if (intra_16x16_prob_update_flag) {` | |
| ` for (i = 0; i < 4; i++)` | |
| ` intra_16x16_prob` | L(8) |
| } | |
| ` intra_chroma prob_update_flag` | L(1) |
| ` if (intra_chroma_prob_update_flag) {` | |
| ` for (i = 0; i < 3; i++)` | |
| ` intra_chroma_prob` | L(8) |
| ` }` | |
| ` mv_prob_update()` | |
| `}` | |
{:.col1-pre}
* `color_space` defines the YUV color space of the sequence ([9.2](#h-09-02))
* `clamping_type` specifies if the decoder is required to clamp the reconstructed pixel values ([9.2](#h-09-02))
* `segmentation_enabled` enables the segmentation feature for the current frame ([9.3](#h-09-03))
* `filter_type` determines whether the normal or the simple loop filter is used ([9.4](#h-09-04), [15](#h-15-00))
* `loop_filter_level` controls the deblocking filter ([9.4](#h-09-04), [15](#h-15-00))
* `sharpness_level` controls the deblocking filter ([9.4](#h-09-04), [15](#h-15-00))
* `log2_nbr_of_dct_partitions` determines the number of separate partitions containing the DCT coefficients of the macroblocks ([9.5](#h-09-05))
* `refresh_entropy_probs` determines whether updated token probabilities are used only for this frame or until further update
* `refresh_golden_frame` determines if the current decoded frame refreshes the golden frame ([9.7](#h-09-07))
* `refresh_alternate_frame` determines if the current decoded frame refreshes the alternate reference frame ([9.7](#h-09-07))
* `copy_buffer_to_golden` determines if the golden reference is replaced by another reference ([9.7](#h-09-07))
* `copy_buffer_to_alternate` determines if the alternate reference is replaced by another reference ([9.7](#h-09-07))
* `sign_bias_golden` controls the sign of motion vectors when the golden frame is referenced ([9.7](#h-09-07))
* `sign_bias_alternate` controls the sign of motion vectors when the alternate frame is referenced ([9.7](#h-09-07))
* `refresh_last` determines if the current decoded frame refreshes the last frame reference buffer ([9.8](#h-09-08))
* `mb_no_coeff_skip` enables or disables the skipping of macroblocks containing no non-zero coefficients ([9.10](#h-09-10))
* `prob_skip_false` the probability that the macroblock is not skipped (flag indicating skipped macroblock is false) ([9.10](#h-09-10))
* `prob_intra` the probability of an intra macroblock ([9.10](#h-09-10))
* `prob_last` the probability that the last reference frame is used for inter prediction ([9.10](#h-09-10))
* `prob_golden` the probability that the golden reference frame is used for inter prediction ([9.10](#h-09-10))
* `intra_16x16_prob_update_flag` indicates if the branch probabilies used in the decoding of luma intra prediction mode are updated ([9.10](#h-09-10))
* `intra_16x16_prob` the branch probabilities of the luma intra prediction mode decoding tree
* `intra_chroma_prob_update_flag` indicates if the branch probabilies used in the decoding of chroma intra prediction mode are updated ([9.10](#h-09-10))
* `intra_chroma_prob` the branch probabilities of the chroma intra prediction mode decoding tree
| update_segmentation() | Type |
| -------------------------------------------- | ----- |
| `update_mb_segmentation_map` | L(1) |
| `update_segment_feature_data` | L(1) |
| `if (update_segment_feature_data) {` | |
| ` segment_feature_mode` | L(1) |
| ` for (i = 0; i < 4; i++) {` | |
| ` quantizer_update` | L(1) |
| ` if (quantizer_update) {` | |
| ` quantizer_update_value` | L(7) |
| ` quantizer_update_sign` | L(1) |
| ` }` | |
| ` }` | |
| ` for (i = 0; i < 4; i++) {` | |
| ` loop_filter_update` | L(1) |
| ` if (loop_filter_update) {` | |
| ` lf_update_value` | L(6) |
| ` lf_update_sign` | L(1) |
| ` }` | |
| ` }` | |
| `}` | |
| `if (update_mb_segmentation_map) {` | |
| ` for (i = 0; i < 3; i++) {` | |
| ` segment_prob_update` | L(1) |
| ` if (segment_prob_update) {` | |
| ` segment_prob` | L(8) |
| ` }` | |
| ` }` | |
| `}` | |
{:.col1-pre}
* `update_mb_segmentation_map` determines if the MB segmentation map is updated in the current frame ([9.3](#h-09-03))
* `update_segment_feature_data` indicates if the segment feature data is updated in the current frame ([9.3](#h-09-03))
* `segment_feature_mode` indicates the feature data update mode, 0 for delta and 1 for the absolute value ([9.3](#h-09-03))
* `quantizer_update` indicates if the quantizer value is updated for the [[ i^(th) ]] segment ([9.3](#h-09-03))
* `quantizer_update_value` indicates the update value for the segment quantizer ([9.3](#h-09-03))
* `quantizer_update_sign` indicates the update sign for the segment quantizer ([9.3](#h-09-03))
* `loop_filter_update` indicates if the loop filter level value is updated for the [[ i^(th) ]] segment ([9.3](#h-09-03))
* `lf_update_value` indicates the update value for the loop filter level ([9.3](#h-09-03))
* `lf_update_sign` indicates the update sign for the loop filter level ([9.3](#h-09-03))
* `segment_prob_update` indicates if the branch probabilities used to decode the `segment_id` in the MB header are decoded from the stream or use the default value of 255 ([9.3](#h-09-03))
* `segment_prob` the branch probabilities of the `segment_id` decoding tree ([9.3](#h-09-03))
| mb_lf_adjustments() | Type |
|----------------------------------------------|-------|
| `loop_filter_adj_enable` | L(1) |
| `if (loop_filter_adj_enable) {` | |
| ` mode_ref_lf_delta_update` | L(1) |
| ` if (mode_ref_lf_delta_update) {` | |
| ` for (i = 0; i < 4; i++) {` | |
| ` ref_frame_delta_update_flag` | L(1) |
| ` if (ref_frame_delta_update_flag) {` | |
| ` delta_magnitude` | L(6) |
| ` delta_sign` | L(1) |
| ` }` | |
| ` }` | |
| ` for (i = 0; i < 4; i++) {` | |
| ` mb_mode_delta_update_flag` | L(1) |
| ` if (mb_mode_delta_update_flag) {` | |
| ` delta_magnitude` | L(6) |
| ` delta_sign` | L(1) |
| ` }` | |
| ` }` | |
| ` }` | |
| `}` | |
{:.col1-pre}
* `loop_filter_adj_enable` indicates if the MB-level loop filter adjustment (based on the used reference frame and coding mode) is on for the current frame ([9.4](#h-09-04))
* `mode_ref_lf_delta_update` indicates if the delta values used in adjustment are updated in the current frame ([9.4](#h-09-04))
* `ref_frame_delta_update_flag` indicates if the adjustment delta value corresponding to a certain used reference frame is updated ([9.4](#h-09-04))
* `delta_magnitude` is the absolute value of the delta value
* `delta_sign` is the sign of the delta value
* `mb_mode_delta_update_flag` indicates if the adjustment delta value corresponding to certain MB prediction mode is updated ([9.4](#h-09-04))
| quant_indices() | Type |
|----------------------------------------------|-------|
| `y_ac_qi` | L(7) |
| `y_dc_delta_present` | L(1) |
| `if (y_dc_delta_present) {` | |
| ` y_dc_delta_magnitude` | L(4) |
| ` y_dc_delta_sign` | L(1) |
| `}` | |
| `y2_dc_delta_present` | L(1) |
| `if (y2_dc_delta_present) {` | |
| ` y2_dc_delta_magnitude` | L(4) |
| ` y2_dc_delta_sign` | L(1) |
| `}` | |
| `y2_ac_delta_present` | L(1) |
| `if (y2_ac_delta_present) {` | |
| ` y2_ac_delta_magnitude` | L(4) |
| ` y2_ac_delta_sign` | L(1) |
| `}` | |
| `uv_dc_delta_present` | L(1) |
| `if (uv_dc_delta_present) {` | |
| ` uv_dc_delta_magnitude` | L(4) |
| ` uv_dc_delta_sign` | L(1) |
| `}` | |
| `uv_ac_delta_present` | L(1) |
| `if (uv_ac_delta_present) {` | |
| ` uv_ac_delta_magnitude` | L(4) |
| ` uv_ac_delta_sign` | L(1) |
| } | |
{:.col1-pre}
* `y_ac_qi` is the dequantization table index used for the luma AC coefficients (and other coefficient groups if no delta value is present) ([9.6](#h-09-06))
* `y_dc_delta_present` indicates if the stream contains a delta value that is added to the baseline index to obtain the luma DC coefficient dequantization index ([9.6](#h-09-06))
* `y_dc_delta_magnitude` the magnitude of the delta value ([9.6](#h-09-06))
* `y_dc_delta_sign` the sign of the delta value ([9.6](#h-09-06))
* `y2_dc_delta_present` indicates if the stream contains a delta value that is added to the baseline index to obtain the Y2 block DC coefficient dequantization index ([9.6](#h-09-06))
* `y2_ac_delta_present` indicates if the stream contains a delta value that is added to the baseline index to obtain the Y2 block AC coefficient dequantization index ([9.6](#h-09-06))
* `uv_dc_delta_present` indicates if the stream contains a delta value that is added to the baseline index to obtain the chroma DC coefficient dequantization index ([9.6](#h-09-06))
* `uv_ac_delta_present` indicates if the stream contains a delta value that is added to the baseline index to obtain the chroma AC coefficient dequantization index ([9.6](#h-09-06))
| token_prob_update() | Type |
| -------------------------------------------- | ----- |
| `for (i = 0; i < 4; i++) {` | |
| ` for (j = 0; j < 8; j++) {` | |
| ` for (k = 0; k < 3; k++) {` | |
| ` for (l = 0; l < 11; l++) {` | |
| ` coeff_prob_update_flag` | L(1) |
| ` if (coeff_prob_update_flag) {` | |
| ` coeff_prob` | L(8) |
| ` }` | |
| ` }` | |
| ` }` | |
| ` }` | |
| `}` | |
{:.col1-pre}
* `coeff_prob_update_flag` indicates if the corresponding branch probability is updated in the current frame ([13.4](#h-13-04))
* `coeff_prob` is the new branch probability ([13.4](#h-13-04))
| mv_prob_update() | Type |
| -------------------------------------------- | ----- |
| `for (i = 0; i < 2; i++) {` | |
| ` for (j = 0; j < 19; j++) {` | |
| ` mv_prob_update_flag` | L(1) |
| ` if (mv_prob_update_flag) {` | |
| ` prob` | L(7) |
| ` }` | |
| ` }` | |
| `}` | |
{:.col1-pre}
* `mv_prob_update_flag` indicates if the corresponding MV decoding probability is updated in the current frame ([17.2](#h-17-02))
* `prob` is the updated probability ([17.2](#h-17-02))