From: Anton Mitrofanov Date: Wed, 3 Mar 2010 18:14:20 +0000 (-0800) Subject: Fix two nondeterminisms X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=6951964c87029b4786ccbd558dfa4d3c5be353ae;p=x264.git Fix two nondeterminisms Move noise reduction data into thread-specific data. Use correct reference list for L1 temporal predictors. --- diff --git a/common/common.h b/common/common.h index 8b79e92a..ff74e54d 100644 --- a/common/common.h +++ b/common/common.h @@ -420,10 +420,6 @@ struct x264_t const uint8_t *chroma_qp_table; /* includes both the nonlinear luma->chroma mapping and chroma_qp_offset */ - ALIGNED_16( uint32_t nr_residual_sum[2][64] ); - ALIGNED_16( uint16_t nr_offset[2][64] ); - uint32_t nr_count[2]; - /* Slice header */ x264_slice_header_t sh; @@ -752,6 +748,10 @@ struct x264_t } stat; + ALIGNED_16( uint32_t nr_residual_sum[2][64] ); + ALIGNED_16( uint16_t nr_offset[2][64] ); + uint32_t nr_count[2]; + void *scratch_buffer; /* for any temporary storage that doesn't want repeated malloc */ /* CPU functions dependents */ diff --git a/common/macroblock.c b/common/macroblock.c index 0d4f1557..23f98ca0 100644 --- a/common/macroblock.c +++ b/common/macroblock.c @@ -450,9 +450,10 @@ void x264_mb_predict_mv_ref16x16( x264_t *h, int i_list, int i_ref, int16_t mvc[ if( h->fref0[0]->i_ref[0] > 0 ) { x264_frame_t *l0 = h->fref0[0]; + x264_frame_t **fref = i_list ? h->fref1 : h->fref0; int field = h->mb.i_mb_y&1; int curpoc = h->fdec->i_poc + field*h->sh.i_delta_poc_bottom; - int refpoc = h->fref0[i_ref>>h->sh.b_mbaff]->i_poc; + int refpoc = fref[i_ref>>h->sh.b_mbaff]->i_poc; if( h->sh.b_mbaff && field^(i_ref&1) ) refpoc += h->sh.i_delta_poc_bottom; diff --git a/encoder/encoder.c b/encoder/encoder.c index 0b620a88..5aa2d875 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -2624,7 +2624,7 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current, h->out.i_nal = 0; - x264_noise_reduction_update( thread_current ); + x264_noise_reduction_update( h ); /* ---------------------- Compute/Print statistics --------------------- */ x264_thread_sync_stat( h, h->thread[0] );