Skip to content

Commit

Permalink
Use variables like ArCoeffsCbPlus128 instead of the syntax element names
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-norkin committed Jan 5, 2024
1 parent 1125c0d commit 635ef34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions 07.bitstream.semantics.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,30 +496,30 @@ luma and chroma.

**ar_coeffs_y[ i ]** specifies the auto-regressive coefficients used for the Y plane.

The values of AR coefficients for the Y component are derived as follows
The values of auto-regressive coefficients plus 128 for the Y component ArCoeffsYPlus128[ i ] are derived as follows
~~~~~ c
for ( i = 0; i < numPosLuma; i++ )
ar_coeffs_y[ i ] = ar_coeffs_y[ i ] - (1<<(BitsArY - 1)).
ArCoeffsYPlus128[ i ] = ar_coeffs_y[ i ] - (1<<(BitsArY - 1)).
~~~~~

**bits_per_ar_coeff_cb_minus5** plus 5 specifies the number of bits used to ar_coeffs_cb[ i ].

**ar_coeffs_cb[ i ]** specifies auto-regressive coefficients used for the Cb plane.

The values of AR coefficients for the Cb component are derived as follows
The values of auto-regressive coefficients plus 128 for the Cb component ArCoeffsCbPlus128[ i ] are derived as follows
~~~~~ c
for ( i = 0; i < numPosChroma; i++ )
ar_coeffs_cb[ i ] = ar_coeffs_cb[ i ] - (1<<(BitsArCb - 1)).
ArCoeffsCbPlus128[ i ] = ar_coeffs_cb[ i ] - (1<<(BitsArCb - 1)).
~~~~~

**bits_per_ar_coeff_cr_minus5** plus 5 specifies the number of bits used to singal ar_coeffs_cr[ i ].

**ar_coeffs_cr[ i ]** specifies the auto-regressive coefficients used for the Cr plane.

The values of AR coefficients for the Cr component are derived as follows
The values of auto-regressive coefficients plus 128 for the Cr component ArCoeffsCrPlus128[ i ] are derived as follows
~~~~~ c
for ( i = 0; i < numPosChroma; i++ )
ar_coeffs_cr[ i ] = ar_coeffs_cr[ i ] - (1<<(BitsArCr - 1)).
ArCoeffsCrPlus128[ i ] = ar_coeffs_cr[ i ] - (1<<(BitsArCr - 1)).
~~~~~

**ar_coeff_shift_minus_6** specifies the range of the auto-regressive coefficients. Values of 0, 1, 2, and 3
Expand Down
8 changes: 4 additions & 4 deletions 08.decoding.process.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ for ( y = 3; y < 73; y++ ) {
for ( deltaCol = -ar_coeff_lag; deltaCol <= ar_coeff_lag; deltaCol++ ) {
if ( deltaRow == 0 && deltaCol == 0 )
break
c = ar_coeffs_y_plus_128[ pos ] - 128
c = ArCoeffsYPlus128[ pos ] - 128
s += LumaGrain[ y + deltaRow ][ x + deltaCol ] * c
pos++
}
Expand Down Expand Up @@ -209,8 +209,8 @@ for ( y = 3; y < chromaH; y++ ) {
pos = 0
for ( deltaRow = -ar_coeff_lag; deltaRow <= 0; deltaRow++ ) {
for ( deltaCol = -ar_coeff_lag; deltaCol <= ar_coeff_lag; deltaCol++ ) {
c0 = ar_coeffs_cb_plus_128[ pos ] - 128
c1 = ar_coeffs_cr_plus_128[ pos ] - 128
c0 = ArCoeffsCbPlus128[ pos ] - 128
c1 = ArCoeffsCrPlus128[ pos ] - 128
if ( deltaRow == 0 && deltaCol == 0 ) {
if ( num_y_points > 0 ) {
luma = 0
Expand All @@ -236,7 +236,7 @@ for ( y = 3; y < chromaH; y++ ) {
}
~~~~~

**Note:** When num_y_points is equal to 0, this process may use uninitialized values within ar_coeffs_y_plus_128 to compute LumaGrain.
**Note:** When num_y_points is equal to 0, this process may use uninitialized values within ArCoeffsYPlus128 to compute LumaGrain.
However, LumaGrain will never be read in this case so it does not matter what values are constucted.
Similarly, when num_cr_points/num_cb_points are equal to 0 and chroma_scaling_from_luma_flag is equal to 0, the CbGrain/CrGrain arrays will never be read.
{:.alert .alert-info }
Expand Down

0 comments on commit 635ef34

Please sign in to comment.