[x264-devel] commit: Fix two nondeterminisms (Anton Mitrofanov )

git at videolan.org git at videolan.org
Sun Mar 28 04:44:21 CEST 2010


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Wed Mar  3 10:14:20 2010 -0800| [6951964c87029b4786ccbd558dfa4d3c5be353ae] | committer: Jason Garrett-Glaser 

Fix two nondeterminisms
Move noise reduction data into thread-specific data.
Use correct reference list for L1 temporal predictors.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=6951964c87029b4786ccbd558dfa4d3c5be353ae
---

 common/common.h     |    8 ++++----
 common/macroblock.c |    3 ++-
 encoder/encoder.c   |    2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/common/common.h b/common/common.h
index 8b79e92..ff74e54 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 0d4f155..23f98ca 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 0b620a8..5aa2d87 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] );



More information about the x264-devel mailing list