]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/error_resilience.c
Merge commit '4012fe1ee819edc7689e182189e66c5401fb4b41'
[ffmpeg] / libavcodec / error_resilience.c
index 5a75faddf560a28bf41a8b923b25b9eba825f99c..b2e1465b968f7cb1d1bf4c910e61244686119095 100644 (file)
@@ -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");