diff options
author | Andreas Cadhalpun <[email protected]> | 2015-06-14 12:40:18 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2015-06-18 22:09:01 +0200 |
commit | 3ba55ea4aec2ce6c179017e12a933e20a20a14d1 (patch) | |
tree | 8d932363be89ee75e3df392b3800e768c0730e88 | |
parent | 265db4154097a754107dcc7dcd8e13a8bd755db1 (diff) |
h264: er: Copy from the previous reference only if compatible
Also use the frame pixel format instead of the one from the codec
context, which is more robust.
Signed-off-by: Luca Barbato <[email protected]>
Reviewed-by: Michael Niedermayer <[email protected]>
Signed-off-by: Andreas Cadhalpun <[email protected]>
(cherry picked from commit fdc64a104410f5fcc7f35b62287b0ae502b7061a)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavcodec/h264_slice.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 9c4d613195..0712f2d73a 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1549,12 +1549,15 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl) * vectors. Given we are concealing a lost frame, this probably * is not noticeable by comparison, but it should be fixed. */ if (h->short_ref_count) { - if (prev) { + if (prev && + h->short_ref[0]->f->width == prev->f->width && + h->short_ref[0]->f->height == prev->f->height && + h->short_ref[0]->f->format == prev->f->format) { av_image_copy(h->short_ref[0]->f->data, h->short_ref[0]->f->linesize, (const uint8_t **)prev->f->data, prev->f->linesize, - h->avctx->pix_fmt, + prev->f->format, h->mb_width * 16, h->mb_height * 16); h->short_ref[0]->poc = prev->poc + 2; |