mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-01-12 00:06:51 +08:00
avcodec/libdav1d: only consider colorspace when choosing between YUV and GBR
Several files use values for primaries and transfer characteristics other than BT709 and IEC_61966 respectively, while still being GBR. Also always set color_range while at it. It's always coded in the bistream. Fixes part of #21304. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -147,13 +147,10 @@ static void libdav1d_init_params(AVCodecContext *c, const Dav1dSequenceHeader *s
|
||||
c->colorspace = (enum AVColorSpace) seq->mtrx;
|
||||
c->color_primaries = (enum AVColorPrimaries) seq->pri;
|
||||
c->color_trc = (enum AVColorTransferCharacteristic) seq->trc;
|
||||
c->color_range = seq->color_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
|
||||
}
|
||||
c->color_range = seq->color_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
|
||||
|
||||
if (seq->layout == DAV1D_PIXEL_LAYOUT_I444 &&
|
||||
c->colorspace == AVCOL_SPC_RGB &&
|
||||
c->color_primaries == AVCOL_PRI_BT709 &&
|
||||
c->color_trc == AVCOL_TRC_IEC61966_2_1)
|
||||
if (seq->layout == DAV1D_PIXEL_LAYOUT_I444 && c->colorspace == AVCOL_SPC_RGB)
|
||||
c->pix_fmt = pix_fmt_rgb[seq->hbd];
|
||||
else
|
||||
c->pix_fmt = pix_fmt[seq->layout][seq->hbd];
|
||||
|
||||
Reference in New Issue
Block a user