Commit 7495186f authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/h263dec: fix aspect of lead h263 EHC

Fixes part of ticket925
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6067186f
...@@ -107,6 +107,9 @@ int ff_flv_decode_picture_header(MpegEncContext *s) ...@@ -107,6 +107,9 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
} }
s->f_code = 1; s->f_code = 1;
if (s->ehc_mode)
s->avctx->sample_aspect_ratio= (AVRational){1,2};
if(s->avctx->debug & FF_DEBUG_PICT_INFO){ if(s->avctx->debug & FF_DEBUG_PICT_INFO){
av_log(s->avctx, AV_LOG_DEBUG, "%c esc_type:%d, qp:%d num:%d\n", 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), s->droppable ? 'D' : av_get_picture_type_char(s->pict_type),
......
...@@ -113,6 +113,9 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) ...@@ -113,6 +113,9 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
s->codec_id= avctx->codec->id; s->codec_id= avctx->codec->id;
avctx->hwaccel= ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt); 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 */ /* 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 (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) if ((ret = ff_MPV_common_init(s)) < 0)
......
...@@ -1033,6 +1033,7 @@ int ff_h263_decode_picture_header(MpegEncContext *s) ...@@ -1033,6 +1033,7 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
height = ff_h263_format[format][1]; height = ff_h263_format[format][1];
s->avctx->sample_aspect_ratio= (AVRational){12,11}; s->avctx->sample_aspect_ratio= (AVRational){12,11};
} }
s->avctx->sample_aspect_ratio.den <<= s->ehc_mode;
if ((width == 0) || (height == 0)) if ((width == 0) || (height == 0))
return -1; return -1;
s->width = width; s->width = width;
......
...@@ -545,6 +545,7 @@ typedef struct MpegEncContext { ...@@ -545,6 +545,7 @@ typedef struct MpegEncContext {
int prev_mb_info, last_mb_info; int prev_mb_info, last_mb_info;
uint8_t *mb_info_ptr; uint8_t *mb_info_ptr;
int mb_info_size; int mb_info_size;
int ehc_mode;
/* H.263+ specific */ /* H.263+ specific */
int umvplus; ///< == H263+ && unrestricted_mv int umvplus; ///< == H263+ && unrestricted_mv
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment