]> git.videolan.org Git - x264.git/commitdiff
Fix two nondeterminisms
authorAnton Mitrofanov <BugMaster@narod.ru>
Wed, 3 Mar 2010 18:14:20 +0000 (10:14 -0800)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Sat, 27 Mar 2010 19:47:04 +0000 (12:47 -0700)
Move noise reduction data into thread-specific data.
Use correct reference list for L1 temporal predictors.

common/common.h
common/macroblock.c
encoder/encoder.c

index 8b79e92aaa5b1c56ae1a85e6855c045d69e4fa3c..ff74e54d61c875becf6b02f6a9e5803e6009ddf8 100644 (file)
@@ -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 */
index 0d4f1557da295703a3b607bad3ed98ea72645fdc..23f98ca05864030cc7a188bdbc01549c4bb5dc9c 100644 (file)
@@ -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;
 
index 0b620a88f8eddf42dfd8690d4da364a6c25d5575..5aa2d8759cf3bd498afba6b31a2cb72ab606d3c0 100644 (file)
@@ -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] );