diff --git a/06.bitstream.syntax.md b/06.bitstream.syntax.md index acbff2d..0671112 100644 --- a/06.bitstream.syntax.md +++ b/06.bitstream.syntax.md @@ -30,8 +30,8 @@ each of the syntax elements is presented in [Section 6][]. | /* Add reserved bits so that av1_film_grain_payload is byte aligned */ | @@reserved_4bits | f(4) | @@num_film_grain_sets_minus1 | f(3) -| for ( i = 0; i < num_film_grain_sets_minus1 + 1; i++ ) { | -| av1_film_grain_payload( ) +| for ( setIdx = 0; setIdx < num_film_grain_sets_minus1 + 1; setIdx++ ) { | +| av1_film_grain_payload( setIdx ) | } | selectedParamSet = select_film_grain_param_set( ) | load_grain_params( selectedParamSet ) @@ -41,7 +41,7 @@ each of the syntax elements is presented in [Section 6][]. ### Film grain parameter payload syntax | ----------------------------------------------------------------- | ---------------- | -| av1_film_grain_payload( ) { | **Type** +| av1_film_grain_payload( setIdx ) { | **Type** | /* Store the current bit-stream position */ | startPosition = get_position( ) | @@ -55,7 +55,7 @@ each of the syntax elements is presented in [Section 6][]. | @@payload_size | f(n) | | /* Receive the film grain parameters */ -| av1_film_grain_params( ) +| av1_film_grain_params( setIdx ) | | /* Determine the number of bits consumed by the payload */ | currentPosition = get_position( ) @@ -70,8 +70,10 @@ each of the syntax elements is presented in [Section 6][]. ### Film grain parameters syntax | --------------------------------------------------------- | ---------------- | -| av1_film_grain_params( ) { | **Type** +| av1_film_grain_params( setIdx ) { | **Type** | @@film_grain_param_set_idx | f(3) +| if (!setIdx) +| filmGrainParamSetIdxForPrediction = film_grain_param_set_idx | @@apply_grain_flag | f(1) | if ( !apply_grain_flag ) { | load_grain_params( film_grain_param_set_idx ) @@ -112,8 +114,8 @@ each of the syntax elements is presented in [Section 6][]. | video_full_range_flag | f(1) | } | } -| @@predict_scaling_flag | f(1) -| if (predict_scaling_flag) { +| @@predict_scaling_flag | f(1) +| if (predict_scaling_flag && setIdx) { | @@predict_y_scaling_flag | f(1) | } else { | predict_y_scaling_flag = 0 @@ -130,6 +132,8 @@ each of the syntax elements is presented in [Section 6][]. | } | } else { | @@num_y_points | f(4) +| if (!setIdx) +| numYPointsInRef = num_y_points | if (num_y_points) { | @@point_y_value_increment_bits_minus1 | f(3) | bitsIncr = point_y_value_increment_bits_minus1 + 1 @@ -150,7 +154,7 @@ each of the syntax elements is presented in [Section 6][]. | num_cb_points = 0 | num_cr_points = 0 | } else { -| if (predict_scaling_flag) { +| if (predict_scaling_flag && setIdx) { | @@predict_cb_scaling_flag | f(1) | } else | predict_cb_scaling_flag = 0 @@ -166,6 +170,8 @@ each of the syntax elements is presented in [Section 6][]. | } | } else { | @@num_cb_points | f(4) +| if (!setIdx) +| numCbPointsInRef = num_cb_points | if (num_cb_points) { | @@point_cb_value_increment_bits_minus1 | f(3) | bitsIncr = point_cb_value_increment_bits_minus1 + 1 @@ -178,7 +184,7 @@ each of the syntax elements is presented in [Section 6][]. | } | } | } -| if (predict_scaling_flag) { +| if (predict_scaling_flag && setIdx) { | @@predict_cr_scaling_flag | f(1) | } else | predict_cr_scaling_flag = 0 @@ -194,6 +200,8 @@ each of the syntax elements is presented in [Section 6][]. | } | } else { | @@num_cr_points | f(4) +| if (!setIdx) +| numCrPointsInRef = num_cr_points | if (num_cr_points) { | @@point_cr_value_increment_bits_minus1 | f(3) | bitsIncr = point_cr_value_increment_bits_minus1 + 1