X-Git-Url: http://git.videolan.org/?p=ffmpeg.git;a=blobdiff_plain;f=libavcodec%2Fh264_slice.c;h=c70814f0c31460e63a116e96c36176338b0dee95;hp=7db5179685b09840846a3559d239c6a348f2899e;hb=7ef01a7878149de43aa49e676a343ca67b24c6b2;hpb=ffd77f94a26be22b8ead3178ceec3ed39e68abc5 diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 7db5179685..c70814f0c3 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -576,6 +576,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst, memset(&h->mb, 0, sizeof(h->mb)); memset(&h->mb_luma_dc, 0, sizeof(h->mb_luma_dc)); memset(&h->mb_padding, 0, sizeof(h->mb_padding)); + memset(&h->cur_pic, 0, sizeof(h->cur_pic)); h->avctx = dst; h->DPB = NULL; @@ -743,6 +744,7 @@ static int h264_frame_start(H264Context *h) pic->mmco_reset = 0; pic->recovered = 0; pic->invalid_gap = 0; + pic->sei_recovery_frame_cnt = h->sei_recovery_frame_cnt; if ((ret = alloc_picture(h, pic)) < 0) return ret; @@ -753,7 +755,7 @@ static int h264_frame_start(H264Context *h) h->cur_pic_ptr = pic; ff_h264_unref_picture(h, &h->cur_pic); if (CONFIG_ERROR_RESILIENCE) { - memset(&h->er.cur_pic, 0, sizeof(h->er.cur_pic)); + ff_h264_set_erpic(&h->er.cur_pic, NULL); } if ((ret = ff_h264_ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0) @@ -761,8 +763,8 @@ static int h264_frame_start(H264Context *h) if (CONFIG_ERROR_RESILIENCE) { ff_er_frame_start(&h->er); - memset(&h->er.last_pic, 0, sizeof(h->er.last_pic)); - memset(&h->er.next_pic, 0, sizeof(h->er.next_pic)); + ff_h264_set_erpic(&h->er.last_pic, NULL); + ff_h264_set_erpic(&h->er.next_pic, NULL); } assert(h->linesize && h->uvlinesize); @@ -778,9 +780,6 @@ static int h264_frame_start(H264Context *h) h->block_offset[48 + 32 + i] = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 8 * h->uvlinesize * ((scan8[i] - scan8[0]) >> 3); } - // s->decode = (h->flags & CODEC_FLAG_PSNR) || !s->encoding || - // h->cur_pic.reference /* || h->contains_intra */ || 1; - /* We mark the current picture as non-reference after allocating it, so * that if we break out due to an error it can be released automatically * in the next ff_MPV_frame_start(). @@ -1419,10 +1418,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0) } if (h->context_initialized && - (h->width != h->avctx->coded_width || - h->height != h->avctx->coded_height || - must_reinit || - needs_reinit)) { + (must_reinit || needs_reinit)) { if (h != h0) { av_log(h->avctx, AV_LOG_ERROR, "changing width %d -> %d / height %d -> %d on " @@ -2407,10 +2403,10 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg) return 0; } if (h->cabac.bytestream > h->cabac.bytestream_end + 2 ) - av_log(h->avctx, AV_LOG_DEBUG, "bytestream overread %td\n", h->cabac.bytestream_end - h->cabac.bytestream); + av_log(h->avctx, AV_LOG_DEBUG, "bytestream overread %"PTRDIFF_SPECIFIER"\n", h->cabac.bytestream_end - h->cabac.bytestream); if (ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 4) { av_log(h->avctx, AV_LOG_ERROR, - "error while decoding MB %d %d, bytestream %td\n", + "error while decoding MB %d %d, bytestream %"PTRDIFF_SPECIFIER"\n", h->mb_x, h->mb_y, h->cabac.bytestream_end - h->cabac.bytestream); er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,