From: Anton Mitrofanov Date: Tue, 26 Mar 2013 14:56:21 +0000 (+0400) Subject: Disable mbtree asm with cpu-independent option X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=1db46210d525856a8f9e59944913127287d956c5;p=x264.git Disable mbtree asm with cpu-independent option Results vary between versions because of different rounding results. --- diff --git a/common/mc.c b/common/mc.c index a44c2afa..68104840 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 018e2fac..262e2016 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 efe7c7dd..e5c7c3f7 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 bbda21a2..7467574e 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 ) \