Skip to content

Commit 7b7c323

Browse files
committed
swscale/utils: fix XYZ primaries tagging
Swscale currently handles XYZ by embedding a forced conversion to BT.709 RGB with a hardcoded matrix. This is not ideal, but to preserve the status quo and avoid any unexpected changes in behavior, this patch merely fixes the inferred primaries tag to match the reality. In the future, I would like to handle XYZ properly, via direct conversion to the target colorspace (or possibly simply by using a more fitting RGB intermediate like SMPTE428), but for now just keep the status quo.
1 parent 1f0c500 commit 7b7c323

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libswscale/utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2684,7 +2684,7 @@ SwsFormat ff_fmt_from_frame(const AVFrame *frame, int field)
26842684
} else if (desc->flags & AV_PIX_FMT_FLAG_XYZ) {
26852685
fmt.csp = AVCOL_SPC_UNSPECIFIED;
26862686
fmt.color = (SwsColor) {
2687-
.prim = AVCOL_PRI_SMPTE428,
2687+
.prim = AVCOL_PRI_BT709, /* swscale currently hard-codes this XYZ matrix */
26882688
.trc = AVCOL_TRC_SMPTE428,
26892689
};
26902690
} else if (desc->nb_components < 3) {

0 commit comments

Comments
 (0)