avcodec/h263dec: fix aspect of lead h263 EHC

Fixes part of ticket925

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-08-24 18:44:24 +02:00
parent 6067186f3a
commit 7495186fd4
4 changed files with 8 additions and 0 deletions

View File

@ -107,6 +107,9 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
}
s->f_code = 1;
if (s->ehc_mode)
s->avctx->sample_aspect_ratio= (AVRational){1,2};
if(s->avctx->debug & FF_DEBUG_PICT_INFO){
av_log(s->avctx, AV_LOG_DEBUG, "%c esc_type:%d, qp:%d num:%d\n",
s->droppable ? 'D' : av_get_picture_type_char(s->pict_type),

View File

@ -113,6 +113,9 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
s->codec_id= avctx->codec->id;
avctx->hwaccel= ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);
if (avctx->stream_codec_tag == AV_RL32("l263") && avctx->extradata_size == 56 && avctx->extradata[0] == 1)
s->ehc_mode = 1;
/* for h263, we allocate the images after having read the header */
if (avctx->codec->id != AV_CODEC_ID_H263 && avctx->codec->id != AV_CODEC_ID_H263P && avctx->codec->id != AV_CODEC_ID_MPEG4)
if ((ret = ff_MPV_common_init(s)) < 0)

View File

@ -1033,6 +1033,7 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
height = ff_h263_format[format][1];
s->avctx->sample_aspect_ratio= (AVRational){12,11};
}
s->avctx->sample_aspect_ratio.den <<= s->ehc_mode;
if ((width == 0) || (height == 0))
return -1;
s->width = width;

View File

@ -545,6 +545,7 @@ typedef struct MpegEncContext {
int prev_mb_info, last_mb_info;
uint8_t *mb_info_ptr;
int mb_info_size;
int ehc_mode;
/* H.263+ specific */
int umvplus; ///< == H263+ && unrestricted_mv