]> granicus.if.org Git - libx264/commitdiff
continue instead of crash when the threading mv constraint is violated.
authorFiona Glaser <fiona@x264.com>
Wed, 19 Mar 2008 01:17:22 +0000 (19:17 -0600)
committerLoren Merritt <pengvado@akuvian.org>
Wed, 19 Mar 2008 01:17:22 +0000 (19:17 -0600)
doesn't fix the underlying bug, but hopefully less annoying until we find it.

encoder/analyse.c

index cdfd08e9df2419ef08c534bff3a49f139748dc8a..741ab1eb73afcffd764155b19e0cd1740db24d17 100644 (file)
@@ -2713,6 +2713,7 @@ static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a  )
             completed = (l ? h->fref1 : h->fref0)[ ref >> h->mb.b_interlaced ]->i_lines_completed;
             if( (h->mb.cache.mv[l][x264_scan8[15]][1] >> (2 - h->mb.b_interlaced)) + h->mb.i_mb_y*16 > completed )
             {
+                x264_log( h, X264_LOG_WARNING, "internal error (MV out of thread range)\n");
                 fprintf(stderr, "mb type: %d \n", h->mb.i_type);
                 fprintf(stderr, "mv: l%dr%d (%d,%d) \n", l, ref,
                                 h->mb.cache.mv[l][x264_scan8[15]][0],
@@ -2720,7 +2721,11 @@ static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a  )
                 fprintf(stderr, "limit: %d \n", h->mb.mv_max_spel[1]);
                 fprintf(stderr, "mb_xy: %d,%d \n", h->mb.i_mb_x, h->mb.i_mb_y);
                 fprintf(stderr, "completed: %d \n", completed );
-                assert(0);
+                x264_log( h, X264_LOG_WARNING, "recovering by using intra mode\n");
+                x264_mb_analyse_intra( h, a, COST_MAX );
+                h->mb.i_type = I_16x16;
+                h->mb.i_intra16x16_pred_mode = a->i_predict16x16;
+                x264_mb_analyse_intra_chroma( h, a );
             }
         }
     }