[x264-devel] Disable mbtree asm with cpu-independent option

Anton Mitrofanov git at videolan.org
Tue Apr 23 23:03:04 CEST 2013


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Tue Mar 26 18:56:21 2013 +0400| [1db46210d525856a8f9e59944913127287d956c5] | committer: Jason Garrett-Glaser

Disable mbtree asm with cpu-independent option

Results vary between versions because of different rounding results.

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

 common/mc.c       |    5 ++++-
 common/mc.h       |    2 +-
 encoder/encoder.c |    2 +-
 tools/checkasm.c  |    6 +++---
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/common/mc.c b/common/mc.c
index a44c2af..6810484 100644
--- a/common/mc.c
+++ b/common/mc.c
@@ -469,7 +469,7 @@ static void mbtree_propagate_cost( int *dst, uint16_t *propagate_in, uint16_t *i
     }
 }
 
-void x264_mc_init( int cpu, x264_mc_functions_t *pf )
+void x264_mc_init( int cpu, x264_mc_functions_t *pf, int cpu_independent )
 {
     pf->mc_luma   = mc_luma;
     pf->get_ref   = get_ref;
@@ -534,6 +534,9 @@ void x264_mc_init( int cpu, x264_mc_functions_t *pf )
 #if HAVE_ARMV6
     x264_mc_init_arm( cpu, pf );
 #endif
+
+    if( cpu_independent )
+        pf->mbtree_propagate_cost = mbtree_propagate_cost;
 }
 
 void x264_frame_filter( x264_t *h, x264_frame_t *frame, int mb_y, int b_end )
diff --git a/common/mc.h b/common/mc.h
index 018e2fa..262e201 100644
--- a/common/mc.h
+++ b/common/mc.h
@@ -123,6 +123,6 @@ typedef struct
                                    uint16_t *inter_costs, uint16_t *inv_qscales, float *fps_factor, int len );
 } x264_mc_functions_t;
 
-void x264_mc_init( int cpu, x264_mc_functions_t *pf );
+void x264_mc_init( int cpu, x264_mc_functions_t *pf, int cpu_independent );
 
 #endif
diff --git a/encoder/encoder.c b/encoder/encoder.c
index efe7c7d..e5c7c3f 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -1263,7 +1263,7 @@ x264_t *x264_encoder_open( x264_param_t *param )
     x264_dct_init( h->param.cpu, &h->dctf );
     x264_zigzag_init( h->param.cpu, &h->zigzagf_progressive, &h->zigzagf_interlaced );
     memcpy( &h->zigzagf, PARAM_INTERLACED ? &h->zigzagf_interlaced : &h->zigzagf_progressive, sizeof(h->zigzagf) );
-    x264_mc_init( h->param.cpu, &h->mc );
+    x264_mc_init( h->param.cpu, &h->mc, h->param.b_cpu_independent );
     x264_quant_init( h, h->param.cpu, &h->quantf );
     x264_deblock_init( h->param.cpu, &h->loopf, PARAM_INTERLACED );
     x264_bitstream_init( h->param.cpu, &h->bsf );
diff --git a/tools/checkasm.c b/tools/checkasm.c
index bbda21a..7467574 100644
--- a/tools/checkasm.c
+++ b/tools/checkasm.c
@@ -1120,9 +1120,9 @@ static int check_mc( int cpu_ref, int cpu_new )
 
     int ret = 0, ok, used_asm;
 
-    x264_mc_init( 0, &mc_c );
-    x264_mc_init( cpu_ref, &mc_ref );
-    x264_mc_init( cpu_new, &mc_a );
+    x264_mc_init( 0, &mc_c, 0 );
+    x264_mc_init( cpu_ref, &mc_ref, 0 );
+    x264_mc_init( cpu_new, &mc_a, 0 );
     x264_pixel_init( 0, &pixf );
 
 #define MC_TEST_LUMA( w, h ) \



More information about the x264-devel mailing list