Skip to content

Commit

Permalink
Update the H273 URL to something that exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud committed Aug 29, 2024
1 parent 3dc10e2 commit cccbfb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/colr.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct avifMatrixCoefficientsTable
const float kb;
};

// https://www.itu.int/rec/T-REC-H.273-201612-I/en
// https://www.itu.int/rec/T-REC-H.273-201612-S
static const struct avifMatrixCoefficientsTable matrixCoefficientsTables[] = {
//{ AVIF_MATRIX_COEFFICIENTS_IDENTITY, "Identity", 0.0f, 0.0f, }, // Handled elsewhere
{ AVIF_MATRIX_COEFFICIENTS_BT709, "BT.709", 0.2126f, 0.0722f },
Expand Down
10 changes: 5 additions & 5 deletions src/reformat.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static avifBool avifPrepareReformatState(const avifImage * image, const avifRGBI
return AVIF_TRUE;
}

// Formulas 20-31 from https://www.itu.int/rec/T-REC-H.273-201612-I/en
// Formulas 20-31 from https://www.itu.int/rec/T-REC-H.273-201612-S
static int avifYUVColorSpaceInfoYToUNorm(avifYUVColorSpaceInfo * info, float v)
{
int unorm = (int)avifRoundf(v * info->rangeY + info->biasY);
Expand Down Expand Up @@ -350,12 +350,12 @@ avifResult avifImageRGBToYUV(avifImage * image, const avifRGBImage * rgb)

// RGB -> YUV conversion
if (state.yuv.mode == AVIF_REFORMAT_MODE_IDENTITY) {
// Formulas 41,42,43 from https://www.itu.int/rec/T-REC-H.273-201612-I/en
// Formulas 41,42,43 from https://www.itu.int/rec/T-REC-H.273-201612-S
yuvBlock[bI][bJ].y = rgbPixel[1]; // G
yuvBlock[bI][bJ].u = rgbPixel[2]; // B
yuvBlock[bI][bJ].v = rgbPixel[0]; // R
} else if (state.yuv.mode == AVIF_REFORMAT_MODE_YCGCO) {
// Formulas 44,45,46 from https://www.itu.int/rec/T-REC-H.273-201612-I/en
// Formulas 44,45,46 from https://www.itu.int/rec/T-REC-H.273-201612-S
yuvBlock[bI][bJ].y = 0.5f * rgbPixel[1] + 0.25f * (rgbPixel[0] + rgbPixel[2]);
yuvBlock[bI][bJ].u = 0.5f * rgbPixel[1] - 0.25f * (rgbPixel[0] + rgbPixel[2]);
yuvBlock[bI][bJ].v = 0.5f * (rgbPixel[0] - rgbPixel[2]);
Expand Down Expand Up @@ -759,12 +759,12 @@ static avifResult avifImageYUVAnyToRGBAnySlow(const avifImage * image,
float R, G, B;
if (hasColor) {
if (state->yuv.mode == AVIF_REFORMAT_MODE_IDENTITY) {
// Identity (GBR): Formulas 41,42,43 from https://www.itu.int/rec/T-REC-H.273-201612-I/en
// Identity (GBR): Formulas 41,42,43 from https://www.itu.int/rec/T-REC-H.273-201612-S
G = Y;
B = Cb;
R = Cr;
} else if (state->yuv.mode == AVIF_REFORMAT_MODE_YCGCO) {
// YCgCo: Formulas 47,48,49,50 from https://www.itu.int/rec/T-REC-H.273-201612-I/en
// YCgCo: Formulas 47,48,49,50 from https://www.itu.int/rec/T-REC-H.273-201612-S
const float t = Y - Cb;
G = Y + Cb;
B = t - Cr;
Expand Down

0 comments on commit cccbfb7

Please sign in to comment.