summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-06 16:59:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-06 16:59:32 +0100
commit78dc4cb26d5a4070a719c085a9d35451711b0b38 (patch)
treee0315f6b0b2a577f33b9c221dd182419129981d6 /libavcodec/mpegvideo.c
parentd71f8d74db5473fc11cf766a334d43506adbb35a (diff)
parent293065bdb56e603589ad8a29326406c39323e153 (diff)
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>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c12
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);