summaryrefslogtreecommitdiff
path: root/libavcodec/hevcdec.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2018-04-11 13:46:10 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2020-06-24 12:02:13 +0200
commit8ee6557c2e93166a03ef8588a09674e4a083d43b (patch)
tree1324276003bc8ac7f94a52af05b3c1038b2cc64c /libavcodec/hevcdec.c
parentce297b44d3b107150c07017993c267a4b9bb41b0 (diff)
avcodec/hevc: export chroma sample location
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r--libavcodec/hevcdec.c9
1 files changed, 9 insertions, 0 deletions
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;