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>
This commit is contained in:
commit
78dc4cb26d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user