diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2016-03-09 14:00:57 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2016-03-09 14:00:57 +0100 |
commit | a6a52ef29ac2e8b9cdba110f076b544f98fbf646 (patch) | |
tree | 4dca193c8fd216ccece5bd5e769f62b86cf28d1b /libavcodec | |
parent | 144ef773c7140d1ea49d54e65e989f4edcfe9958 (diff) | |
download | ffmpeg-a6a52ef29ac2e8b9cdba110f076b544f98fbf646.tar.gz |
lavc/hevc_ps: Fix offset for yuv422 and yuv444.
Fixes ticket #4980.
Analyzed-by: kurosu and Hendrik
Reviewed-by: Ronald
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/hevc_ps.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index 64d6e2f064..bcb63a36d0 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -856,11 +856,12 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id, return ret; if (get_bits1(gb)) { // pic_conformance_flag - //TODO: * 2 is only valid for 420 - sps->pic_conf_win.left_offset = get_ue_golomb_long(gb) * 2; - sps->pic_conf_win.right_offset = get_ue_golomb_long(gb) * 2; - sps->pic_conf_win.top_offset = get_ue_golomb_long(gb) * 2; - sps->pic_conf_win.bottom_offset = get_ue_golomb_long(gb) * 2; + int vert_mult = 1 + (sps->chroma_format_idc < 2); + int horiz_mult = 1 + (sps->chroma_format_idc < 3); + sps->pic_conf_win.left_offset = get_ue_golomb_long(gb) * horiz_mult; + sps->pic_conf_win.right_offset = get_ue_golomb_long(gb) * horiz_mult; + sps->pic_conf_win.top_offset = get_ue_golomb_long(gb) * vert_mult; + sps->pic_conf_win.bottom_offset = get_ue_golomb_long(gb) * vert_mult; if (avctx->flags2 & AV_CODEC_FLAG2_IGNORE_CROP) { av_log(avctx, AV_LOG_DEBUG, |