| |
| |
| #### 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_skip_coeff | L(1) | |
| | if (mb_no_skip_coeff) | | |
| | prob_skip_false | L(8) | |
| | if (!key_frame) { | | |
| | prob_intra | L(8) | |
| | prob_last | L(8) | |
| | prob_gf | 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 |
| ([Section 9.2](#h-09-02)) |
| |
| * `clamping_type` specifies if the decoder is required to clamp the |
| reconstructed pixel values ([Section 9.2](#h-09-02)) |
| |
| * `segmentation_enabled` enables the segmentation feature for the |
| current frame ([Section 9.3](#h-09-03)) |
| |
| * `filter_type` determines whether the normal or the simple loop |
| filter is used ([Sections 9.4](#h-09-04), [15](#h-15-00)) |
| |
| * `loop_filter_level` controls the deblocking filter |
| ([Sections 9.4](#h-09-04), [15](#h-15-00)) |
| |
| * `sharpness_level` controls the deblocking filter |
| ([Sections 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 |
| ([Section 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 ([Section 9.7](#h-09-07)) |
| |
| * `refresh_alternate_frame` determines if the current decoded frame |
| refreshes the alternate reference frame ([Section 9.7](#h-09-07)) |
| |
| * `copy_buffer_to_golden` determines if the golden reference is |
| replaced by another reference ([Section 9.7](#h-09-07)) |
| |
| * `copy_buffer_to_alternate` determines if the alternate reference is |
| replaced by another reference ([Section 9.7](#h-09-07)) |
| |
| * `sign_bias_golden` controls the sign of motion vectors when the |
| golden frame is referenced ([Section 9.7](#h-09-07)) |
| |
| * `sign_bias_alternate` controls the sign of motion vectors when the |
| alternate frame is referenced ([Section 9.7](#h-09-07)) |
| |
| * `refresh_last` determines if the current decoded frame refreshes the |
| last frame reference buffer ([Section 9.8](#h-09-08)) |
| |
| * `mb_no_skip_coeff` enables or disables the skipping of macroblocks |
| containing no non-zero coefficients ([Section 9.10](#h-09-10)) |
| |
| * `prob_skip_false` indicates the probability that the macroblock is |
| not skipped (flag indicating skipped macroblock is false) |
| ([Section 9.10](#h-09-10)) |
| |
| * `prob_intra` indicates the probability of an intra macroblock |
| ([Section 9.10](#h-09-10)) |
| |
| * `prob_last` indicates the probability that the last reference frame |
| is used for inter-prediction ([Section 9.10](#h-09-10)) |
| |
| * `prob_gf` indicates the probability that the golden reference frame |
| is used for inter-prediction ([Section 9.10](#h-09-10)) |
| |
| * `intra_16x16_prob_update_flag` indicates if the branch probabilities |
| used in the decoding of the luma intra-prediction mode are updated |
| ([Section 9.10](#h-09-10)) |
| |
| * `intra_16x16_prob` indicates the branch probabilities of the luma |
| intra-prediction mode decoding tree |
| |
| * `intra_chroma_prob_update_flag` indicates if the branch |
| probabilities used in the decoding of the chroma intra-prediction |
| mode are updated ([Section 9.10](#h-09-10)) |
| |
| * `intra_chroma_prob` indicates 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 ([Section 9.3](#h-09-03)) |
| |
| * `update_segment_feature_data` indicates if the segment feature data |
| is updated in the current frame ([Section 9.3](#h-09-03)) |
| |
| * `segment_feature_mode` indicates the feature data update mode, 0 |
| for delta and 1 for the absolute value ([Section 9.3](#h-09-03)) |
| |
| * `quantizer_update` indicates if the quantizer value is updated for |
| the i^(th) segment ([Section 9.3](#h-09-03)) |
| |
| * `quantizer_update_value` indicates the update value for the segment |
| quantizer ([Section 9.3](#h-09-03)) |
| |
| * `quantizer_update_sign` indicates the update sign for the segment |
| quantizer ([Section 9.3](#h-09-03)) |
| |
| * `loop_filter_update` indicates if the loop filter level value is |
| updated for the i^(th) segment ([Section 9.3](#h-09-03)) |
| |
| * `lf_update_value` indicates the update value for the loop filter |
| level ([Section 9.3](#h-09-03)) |
| |
| * `lf_update_sign` indicates the update sign for the loop filter level |
| ([Section 9.3](#h-09-03)) |
| |
| * `segment_prob_update` indicates whether 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 ([Section 9.3](#h-09-03)) |
| |
| * `segment_prob` indicates the branch probabilities of the `segment_id` |
| decoding tree ([Section 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 ([Section 9.4](#h-09-04)) |
| |
| * `mode_ref_lf_delta_update` indicates if the delta values used in an |
| adjustment are updated in the current frame ([Section 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 |
| ([Section 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 a certain MB prediction mode is updated |
| ([Section 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) ([Section 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 ([Section 9.6](#h-09-06)) |
| |
| * `y_dc_delta_magnitude` is the magnitude of the delta value |
| ([Section 9.6](#h-09-06)) |
| |
| * `y_dc_delta_sign` is the sign of the delta value ([Section 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 ([Section 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 ([Section 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 ([Section 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 ([Section 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 ([Section 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 ([Section 17.2](#h-17-02)) |
| |
| * `prob` is the updated probability ([Section 17.2](#h-17-02)) |
| |