[FFmpeg-cvslog] avcodec/av1dec: set chroma_sample_location

James Almer git at videolan.org
Sat Sep 12 19:51:17 EEST 2020


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Sep  9 18:42:00 2020 -0300| [b80c66bb6b23334666dbbb7b132fa5d49523d461] | committer: James Almer

avcodec/av1dec: set chroma_sample_location

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavcodec/av1dec.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 9e71a2e5f6..b39a509f31 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -417,6 +417,15 @@ static int set_context_with_sequence(AVCodecContext *avctx,
     avctx->colorspace = seq->color_config.color_primaries;
     avctx->color_trc = seq->color_config.transfer_characteristics;
 
+    switch (seq->color_config.chroma_sample_position) {
+    case AV1_CSP_VERTICAL:
+        avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
+        break;
+    case AV1_CSP_COLOCATED:
+        avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
+        break;
+    }
+
     if (seq->timing_info.num_units_in_display_tick &&
         seq->timing_info.time_scale) {
         av_reduce(&avctx->framerate.den, &avctx->framerate.num,



More information about the ffmpeg-cvslog mailing list