X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Ferror_resilience.c;h=b2e1465b968f7cb1d1bf4c910e61244686119095;hb=93a0f4a3cbb823b2ddcb66a3a4c8f08aa7934078;hp=5a75faddf560a28bf41a8b923b25b9eba825f99c;hpb=04747c5a73af4a83574dde878688d2f8406034b4;p=ffmpeg diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index 5a75faddf56..b2e1465b968 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -393,6 +393,8 @@ static void guess_mv(ERContext *s) set_mv_strides(s, &mot_step, &mot_stride); num_avail = 0; + if (s->last_pic.motion_val[0]) + ff_thread_await_progress(s->last_pic.tf, mb_height-1, 0); for (i = 0; i < mb_width * mb_height; i++) { const int mb_xy = s->mb_index2xy[i]; int f = 0; @@ -580,24 +582,9 @@ skip_mean_and_median: /* zero MV */ pred_count++; - if (!fixed[mb_xy] && 0) { - if (s->avctx->codec_id == AV_CODEC_ID_H264) { - // FIXME - } else { - ff_thread_await_progress(s->last_pic.tf, - mb_y, 0); - } - if (!s->last_pic.motion_val[0] || - !s->last_pic.ref_index[0]) - goto skip_last_mv; - prev_x = s->last_pic.motion_val[0][mot_index][0]; - prev_y = s->last_pic.motion_val[0][mot_index][1]; - prev_ref = s->last_pic.ref_index[0][4 * mb_xy]; - } else { - prev_x = s->cur_pic.motion_val[0][mot_index][0]; - prev_y = s->cur_pic.motion_val[0][mot_index][1]; - prev_ref = s->cur_pic.ref_index[0][4 * mb_xy]; - } + prev_x = s->cur_pic.motion_val[0][mot_index][0]; + prev_y = s->cur_pic.motion_val[0][mot_index][1]; + prev_ref = s->cur_pic.ref_index[0][4 * mb_xy]; /* last MV */ mv_predictor[pred_count][0] = prev_x; @@ -897,7 +884,7 @@ void ff_er_frame_end(ERContext *s) if ( mb_x == s->mb_width && s->avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO - && (s->avctx->height&16) + && (FFALIGN(s->avctx->height, 16)&16) && s->error_count == 3 * s->mb_width * (s->avctx->skip_top + s->avctx->skip_bottom + 1) ) { av_log(s->avctx, AV_LOG_DEBUG, "ignoring last missing slice\n");