From a84fb6e06f7f13e61b5dad0224fa392ebe65e294 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Wed, 23 Jan 2013 12:26:59 +0100 Subject: h264: Allow discarding the cropping information from SPS Some 3D systems overload the meaning of the field for other purposes. Signed-off-by: Luca Barbato --- libavcodec/h264_ps.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libavcodec/h264_ps.c') diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c index ff6c077ed3..63f371c80c 100644 --- a/libavcodec/h264_ps.c +++ b/libavcodec/h264_ps.c @@ -425,6 +425,20 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){ sps->crop_right = get_ue_golomb(&s->gb); sps->crop_top = get_ue_golomb(&s->gb); sps->crop_bottom= get_ue_golomb(&s->gb); + if (h->s.avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) { + av_log(h->s.avctx, AV_LOG_DEBUG, + "discarding sps cropping, " + "original values are l:%u r:%u t:%u b:%u\n", + sps->crop_left, + sps->crop_right, + sps->crop_top, + sps->crop_bottom); + + sps->crop_left = + sps->crop_right = + sps->crop_top = + sps->crop_bottom = 0; + } if(sps->crop_left || sps->crop_top){ av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ...\n"); } -- cgit v1.2.3