Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the H273 URL to something that exists. #2419

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
wantehchang marked this conversation as resolved.
Show resolved Hide resolved
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
Loading