[FFmpeg-devel] [PATCH 2/2 v2] avcodec/libaomdec: export chroma sample location

James Almer jamrial at gmail.com
Wed Sep 19 04:14:47 EEST 2018


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/libaomdec.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 2530c9f76b..68157b253d 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -94,6 +94,15 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
     avctx->colorspace  = img->mc;
     avctx->color_trc   = img->tc;
 
+    switch (img->csp) {
+    case AOM_CSP_VERTICAL:
+        avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
+        break;
+    case AOM_CSP_COLOCATED:
+        avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
+        break;
+    }
+
     switch (img->fmt) {
     case AOM_IMG_FMT_I420:
     case AOM_IMG_FMT_I42016:
-- 
2.19.0



More information about the ffmpeg-devel mailing list