avcodec/libaomdec: fix pix_fmt w/AVCOL_SPC_RGB

Signed-off-by: James Zern <jzern@google.com>
Reviewed-by: Vignesh Venkatasubramanian <vigneshv@google.com>
This commit is contained in:
James Zern 2022-10-25 11:26:49 -07:00
parent 539777f008
commit fff4dbd90b
2 changed files with 7 additions and 3 deletions

View File

@ -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 {

View File

@ -30,7 +30,7 @@
#include "version_major.h"
#define LIBAVCODEC_VERSION_MINOR 51
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \