ffmpeg | branch: master | Hendrik Leppkes <h.lepp...@gmail.com> | Wed Apr 11 
13:46:10 2018 +0200| [8ee6557c2e93166a03ef8588a09674e4a083d43b] | committer: 
Hendrik Leppkes

avcodec/hevc: export chroma sample location

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

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

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index c9e28f5826..b63cba6c25 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -348,6 +348,15 @@ static void export_stream_params(HEVCContext *s, const 
HEVCSPS *sps)
         avctx->colorspace      = AVCOL_SPC_UNSPECIFIED;
     }
 
+    avctx->chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;
+    if (sps->chroma_format_idc == 1) {
+        if (sps->vui.chroma_loc_info_present_flag) {
+            if (sps->vui.chroma_sample_loc_type_top_field <= 5)
+                avctx->chroma_sample_location = 
sps->vui.chroma_sample_loc_type_top_field + 1;
+        } else
+            avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
+    }
+
     if (vps->vps_timing_info_present_flag) {
         num = vps->vps_num_units_in_tick;
         den = vps->vps_time_scale;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to