Skip to content

Commit

Permalink
Change some AVIF_COLOR_PRIMARIES_SRGB to BT709
Browse files Browse the repository at this point in the history
In these places the use of AVIF_COLOR_PRIMARIES_BT709 is clearer.
  • Loading branch information
wantehchang authored Dec 13, 2023
1 parent e0778af commit 34b60fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/obu.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ static avifBool parseSequenceHeaderColorConfig(avifBits * bits, avifSequenceHead
header->av1C.chromaSubsamplingX = 1;
header->av1C.chromaSubsamplingY = 1;
header->yuvFormat = AVIF_PIXEL_FORMAT_YUV400;
} else if (header->colorPrimaries == AVIF_COLOR_PRIMARIES_SRGB && header->transferCharacteristics == AVIF_TRANSFER_CHARACTERISTICS_SRGB &&
} else if (header->colorPrimaries == AVIF_COLOR_PRIMARIES_BT709 &&
header->transferCharacteristics == AVIF_TRANSFER_CHARACTERISTICS_SRGB &&
header->matrixCoefficients == AVIF_MATRIX_COEFFICIENTS_IDENTITY) {
header->range = AVIF_RANGE_FULL;
header->av1C.chromaSubsamplingX = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/reformat_libyuv.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ static void getLibYUVConstants(const avifImage * image, const struct YuvConstant
break;
case AVIF_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL:
switch (image->colorPrimaries) {
case AVIF_COLOR_PRIMARIES_SRGB:
case AVIF_COLOR_PRIMARIES_BT709:
case AVIF_COLOR_PRIMARIES_UNSPECIFIED:
#if LIBYUV_VERSION >= 1772
*matrixYUV = &kYuvF709Constants;
Expand Down Expand Up @@ -844,7 +844,7 @@ static void getLibYUVConstants(const avifImage * image, const struct YuvConstant
break;
case AVIF_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL:
switch (image->colorPrimaries) {
case AVIF_COLOR_PRIMARIES_SRGB:
case AVIF_COLOR_PRIMARIES_BT709:
case AVIF_COLOR_PRIMARIES_UNSPECIFIED:
*matrixYUV = &kYuvH709Constants;
*matrixYVU = &kYvuH709Constants;
Expand Down

0 comments on commit 34b60fc

Please sign in to comment.