Commit 89183a0e authored by Anton Mitrofanov's avatar Anton Mitrofanov Committed by Fiona Glaser

Fix two nondeterminisms

Move noise reduction data into thread-specific data.
Use correct reference list for L1 temporal predictors.
parent 7ff23daa
......@@ -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 */
......
......@@ -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;
......
......@@ -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] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment