From be3c1492db255a3b3db7196eae0abe804d094985 Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Thu, 8 Oct 2020 21:16:53 +0300 Subject: [PATCH] x86: Remove workaround for nasm on macho64 --- common/bitstream.c | 4 ++-- common/pixel.c | 12 ------------ common/quant.c | 4 ---- encoder/cabac.c | 6 +++--- encoder/rdo.c | 2 +- 5 files changed, 6 insertions(+), 22 deletions(-) diff --git a/common/bitstream.c b/common/bitstream.c index 5e6a5bde..3de3445f 100644 --- a/common/bitstream.c +++ b/common/bitstream.c @@ -109,7 +109,7 @@ void x264_bitstream_init( uint32_t cpu, x264_bitstream_function_t *pf ) pf->nal_escape = nal_escape_c; #if HAVE_MMX -#if ARCH_X86_64 && !defined( __MACH__ ) +#if ARCH_X86_64 pf->cabac_block_residual_internal = x264_cabac_block_residual_internal_sse2; pf->cabac_block_residual_rd_internal = x264_cabac_block_residual_rd_internal_sse2; pf->cabac_block_residual_8x8_rd_internal = x264_cabac_block_residual_8x8_rd_internal_sse2; @@ -122,7 +122,7 @@ void x264_bitstream_init( uint32_t cpu, x264_bitstream_function_t *pf ) if( cpu&X264_CPU_SSE2_IS_FAST ) pf->nal_escape = x264_nal_escape_sse2; } -#if ARCH_X86_64 && !defined( __MACH__ ) +#if ARCH_X86_64 if( cpu&X264_CPU_LZCNT ) { pf->cabac_block_residual_internal = x264_cabac_block_residual_internal_lzcnt; diff --git a/common/pixel.c b/common/pixel.c index 46bf6397..768ae2e4 100644 --- a/common/pixel.c +++ b/common/pixel.c @@ -960,9 +960,7 @@ void x264_pixel_init( uint32_t cpu, x264_pixel_function_t *pixf ) INIT7( sad, _ssse3 ); INIT7( sad_x3, _ssse3 ); INIT7( sad_x4, _ssse3 ); -#if ARCH_X86 || !defined( __MACH__ ) INIT_ADS( _ssse3 ); -#endif INIT6( satd, _ssse3 ); pixf->satd[PIXEL_4x16] = x264_pixel_satd_4x16_ssse3; @@ -1002,9 +1000,7 @@ void x264_pixel_init( uint32_t cpu, x264_pixel_function_t *pixf ) if( cpu&X264_CPU_AVX ) { INIT5_NAME( sad_aligned, sad, _ssse3 ); /* AVX-capable CPUs doesn't benefit from an aligned version */ -#if ARCH_X86 || !defined( __MACH__ ) INIT_ADS( _avx ); -#endif INIT6( satd, _avx ); pixf->satd[PIXEL_4x16] = x264_pixel_satd_4x16_avx; if( !(cpu&X264_CPU_STACK_MOD4) ) @@ -1042,9 +1038,7 @@ void x264_pixel_init( uint32_t cpu, x264_pixel_function_t *pixf ) INIT2_NAME( sad_aligned, sad, _avx2 ); INIT2( sad_x3, _avx2 ); INIT2( sad_x4, _avx2 ); -#if ARCH_X86 || !defined( __MACH__ ) INIT_ADS( _avx2 ); -#endif pixf->var[PIXEL_16x16] = x264_pixel_var_16x16_avx2; pixf->var2[PIXEL_8x8] = x264_pixel_var2_8x8_avx2; pixf->var2[PIXEL_8x16] = x264_pixel_var2_8x16_avx2; @@ -1203,9 +1197,7 @@ void x264_pixel_init( uint32_t cpu, x264_pixel_function_t *pixf ) pixf->intra_sa8d_x9_8x8 = x264_intra_sa8d_x9_8x8_ssse3; #endif } -#if ARCH_X86 || !defined( __MACH__ ) INIT_ADS( _ssse3 ); -#endif if( cpu&X264_CPU_SLOW_ATOM ) { pixf->sa8d[PIXEL_16x16]= x264_pixel_sa8d_16x16_ssse3_atom; @@ -1288,9 +1280,7 @@ void x264_pixel_init( uint32_t cpu, x264_pixel_function_t *pixf ) INIT8( satd, _avx ); INIT7( satd_x3, _avx ); INIT7( satd_x4, _avx ); -#if ARCH_X86 || !defined( __MACH__ ) INIT_ADS( _avx ); -#endif INIT4( hadamard_ac, _avx ); if( !(cpu&X264_CPU_STACK_MOD4) ) { @@ -1343,9 +1333,7 @@ void x264_pixel_init( uint32_t cpu, x264_pixel_function_t *pixf ) INIT2( sad_x4, _avx2 ); INIT4( satd, _avx2 ); INIT2( hadamard_ac, _avx2 ); -#if ARCH_X86 || !defined( __MACH__ ) INIT_ADS( _avx2 ); -#endif pixf->sa8d[PIXEL_8x8] = x264_pixel_sa8d_8x8_avx2; pixf->var[PIXEL_16x16] = x264_pixel_var_16x16_avx2; pixf->var2[PIXEL_8x16] = x264_pixel_var2_8x16_avx2; diff --git a/common/quant.c b/common/quant.c index 80177064..967af2be 100644 --- a/common/quant.c +++ b/common/quant.c @@ -648,7 +648,6 @@ void x264_quant_init( x264_t *h, uint32_t cpu, x264_quant_function_t *pf ) pf->decimate_score16 = x264_decimate_score16_ssse3; pf->decimate_score64 = x264_decimate_score64_ssse3; INIT_TRELLIS( ssse3 ); -#if ARCH_X86 || !defined( __MACH__ ) pf->coeff_level_run4 = x264_coeff_level_run4_ssse3; pf->coeff_level_run8 = x264_coeff_level_run8_ssse3; pf->coeff_level_run[ DCT_LUMA_AC] = x264_coeff_level_run15_ssse3; @@ -660,7 +659,6 @@ void x264_quant_init( x264_t *h, uint32_t cpu, x264_quant_function_t *pf ) pf->coeff_level_run[ DCT_LUMA_AC] = x264_coeff_level_run15_ssse3_lzcnt; pf->coeff_level_run[DCT_LUMA_4x4] = x264_coeff_level_run16_ssse3_lzcnt; } -#endif } if( cpu&X264_CPU_SSE4 ) @@ -711,10 +709,8 @@ void x264_quant_init( x264_t *h, uint32_t cpu, x264_quant_function_t *pf ) pf->decimate_score64 = x264_decimate_score64_avx2; pf->denoise_dct = x264_denoise_dct_avx2; pf->coeff_last[DCT_LUMA_8x8] = x264_coeff_last64_avx2; -#if ARCH_X86 || !defined( __MACH__ ) pf->coeff_level_run[ DCT_LUMA_AC] = x264_coeff_level_run15_avx2; pf->coeff_level_run[DCT_LUMA_4x4] = x264_coeff_level_run16_avx2; -#endif } if( cpu&X264_CPU_AVX512 ) { diff --git a/encoder/cabac.c b/encoder/cabac.c index 53f8e796..3974dac4 100644 --- a/encoder/cabac.c +++ b/encoder/cabac.c @@ -754,7 +754,7 @@ void x264_cabac_block_residual_c( x264_t *h, x264_cabac_t *cb, int ctx_block_cat static ALWAYS_INLINE void cabac_block_residual( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l ) { -#if ARCH_X86_64 && HAVE_MMX && !defined( __MACH__ ) +#if ARCH_X86_64 && HAVE_MMX h->bsf.cabac_block_residual_internal( l, MB_INTERLACED, ctx_block_cat, cb ); #else x264_cabac_block_residual_c( h, cb, ctx_block_cat, l ); @@ -868,7 +868,7 @@ void x264_cabac_block_residual_rd_c( x264_t *h, x264_cabac_t *cb, int ctx_block_ static ALWAYS_INLINE void cabac_block_residual_8x8( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l ) { -#if ARCH_X86_64 && HAVE_MMX && !defined( __MACH__ ) +#if ARCH_X86_64 && HAVE_MMX h->bsf.cabac_block_residual_8x8_rd_internal( l, MB_INTERLACED, ctx_block_cat, cb ); #else x264_cabac_block_residual_8x8_rd_c( h, cb, ctx_block_cat, l ); @@ -876,7 +876,7 @@ static ALWAYS_INLINE void cabac_block_residual_8x8( x264_t *h, x264_cabac_t *cb, } static ALWAYS_INLINE void cabac_block_residual( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l ) { -#if ARCH_X86_64 && HAVE_MMX && !defined( __MACH__ ) +#if ARCH_X86_64 && HAVE_MMX h->bsf.cabac_block_residual_rd_internal( l, MB_INTERLACED, ctx_block_cat, cb ); #else x264_cabac_block_residual_rd_c( h, cb, ctx_block_cat, l ); diff --git a/encoder/rdo.c b/encoder/rdo.c index 317be8a5..564ec25f 100644 --- a/encoder/rdo.c +++ b/encoder/rdo.c @@ -704,7 +704,7 @@ int quant_trellis_cabac( x264_t *h, dctcoef *dct, return !!dct[0]; } -#if HAVE_MMX && ARCH_X86_64 && !defined( __MACH__ ) +#if HAVE_MMX && ARCH_X86_64 uint64_t level_state0; memcpy( &level_state0, cabac_state, sizeof(uint64_t) ); uint16_t level_state1; -- 2.49.0