aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libaomdec.c
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2022-10-25 11:26:49 -0700
committerJames Zern <jzern@google.com>2022-10-31 10:06:55 -0700
commitfff4dbd90b87f5dc5298394cb0ab38d4aa147bda (patch)
tree0eb37184366fc3483246120f5999e9647201b191 /libavcodec/libaomdec.c
parent539777f00859be5392a4c9d284b88fd9509d9f39 (diff)
downloadffmpeg-fff4dbd90b87f5dc5298394cb0ab38d4aa147bda.tar.gz
avcodec/libaomdec: fix pix_fmt w/AVCOL_SPC_RGB
Signed-off-by: James Zern <jzern@google.com> Reviewed-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Diffstat (limited to 'libavcodec/libaomdec.c')
-rw-r--r--libavcodec/libaomdec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 378d638a89..53982559d9 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -113,15 +113,19 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
case AOM_IMG_FMT_I444:
case AOM_IMG_FMT_I44416:
if (img->bit_depth == 8) {
- avctx->pix_fmt = AV_PIX_FMT_YUV444P;
+ avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
+ AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
avctx->profile = FF_PROFILE_AV1_HIGH;
return 0;
} else if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
+ avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
+ AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10;
avctx->profile = FF_PROFILE_AV1_HIGH;
return 0;
} else if (img->bit_depth == 12) {
- avctx->pix_fmt = AV_PIX_FMT_YUV444P12;
+ avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
+ AV_PIX_FMT_GBRP12 : AV_PIX_FMT_YUV444P12;
avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
return 0;
} else {