From: Fiona Glaser Date: Wed, 19 Mar 2008 01:17:22 +0000 (-0600) Subject: continue instead of crash when the threading mv constraint is violated. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8727a01bf21a52224c5de130e1173de31062ab87;p=libx264 continue instead of crash when the threading mv constraint is violated. doesn't fix the underlying bug, but hopefully less annoying until we find it. --- diff --git a/encoder/analyse.c b/encoder/analyse.c index cdfd08e9..741ab1eb 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -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 ); } } }