[FFmpeg-cvslog] avcodec/libaomdec: fix pix_fmt w/AVCOL_SPC_RGB

James Zern git at videolan.org
Mon Oct 31 19:23:25 EET 2022


ffmpeg | branch: master | James Zern <jzern at google.com> | Tue Oct 25 11:26:49 2022 -0700| [fff4dbd90b87f5dc5298394cb0ab38d4aa147bda] | committer: James Zern

avcodec/libaomdec: fix pix_fmt w/AVCOL_SPC_RGB

Signed-off-by: James Zern <jzern at google.com>
Reviewed-by: Vignesh Venkatasubramanian <vigneshv at google.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fff4dbd90b87f5dc5298394cb0ab38d4aa147bda
---

 libavcodec/libaomdec.c | 8 ++++++--
 libavcodec/version.h   | 2 +-
 2 files changed, 7 insertions(+), 3 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 {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index f8abc803b6..43d0d9a9fc 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -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, \



More information about the ffmpeg-cvslog mailing list