diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-06 16:59:32 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-06 16:59:32 +0100 |
commit | 78dc4cb26d5a4070a719c085a9d35451711b0b38 (patch) | |
tree | e0315f6b0b2a577f33b9c221dd182419129981d6 | |
parent | d71f8d74db5473fc11cf766a334d43506adbb35a (diff) | |
parent | 293065bdb56e603589ad8a29326406c39323e153 (diff) | |
download | ffmpeg-78dc4cb26d5a4070a719c085a9d35451711b0b38.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
mpegvideo: initialize dummy reference frames.
Conflicts:
libavcodec/mpegvideo.c
tests/ref/fate/filter-yadif-mode1
The luma init is left at 0x80 as it was previously, and tested and
working since a long time. Its also mandated to be 0x80 by at least
one specification. Cases that need different values already had
code in place to handle them.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mpegvideo.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 33e275826b..0c7b02b3c7 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1465,6 +1465,9 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) s->last_picture_ptr->f.data[0] == NULL) && (s->pict_type != AV_PICTURE_TYPE_I || s->picture_structure != PICT_FRAME)) { + int h_chroma_shift, v_chroma_shift; + av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, + &h_chroma_shift, &v_chroma_shift); if (s->pict_type != AV_PICTURE_TYPE_I) av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n"); @@ -1485,6 +1488,15 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) return -1; } + memset(s->last_picture_ptr->f.data[0], 0x80, + avctx->height * s->last_picture_ptr->f.linesize[0]); + memset(s->last_picture_ptr->f.data[1], 0x80, + (avctx->height >> v_chroma_shift) * + s->last_picture_ptr->f.linesize[1]); + memset(s->last_picture_ptr->f.data[2], 0x80, + (avctx->height >> v_chroma_shift) * + s->last_picture_ptr->f.linesize[2]); + if(s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263){ for(i=0; i<avctx->height; i++) memset(s->last_picture_ptr->f.data[0] + s->last_picture_ptr->f.linesize[0]*i, 16, avctx->width); |