From: Loren Merritt Date: Wed, 3 Aug 2011 14:57:06 +0000 (+0000) Subject: Remove some unused, broken, and/or useless functions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52f287e84a9965f652221f535a3298c7ce0846b9;p=libx264 Remove some unused, broken, and/or useless functions Unused frame_sort. Unused x86_64 dequant_4x4dc_mmx2, predict_8x8_vr_mmx2. Unused and broken high_depth integral_init*h_sse4, optimize_chroma_*, dequant_flat_*, sub8x8_dct_dc_*, zigzag_sub_*. Useless high_depth dequant_sse4, dequant_dc_sse4. --- diff --git a/common/frame.c b/common/frame.c index 26670042..b3b55765 100644 --- a/common/frame.c +++ b/common/frame.c @@ -691,26 +691,6 @@ x264_frame_t *x264_frame_pop_blank_unused( x264_t *h ) return frame; } -void x264_frame_sort( x264_frame_t **list, int b_dts ) -{ - int b_ok; - do { - b_ok = 1; - for( int i = 0; list[i+1]; i++ ) - { - int dtype = list[i]->i_type - list[i+1]->i_type; - int dtime = list[i]->i_frame - list[i+1]->i_frame; - int swap = b_dts ? dtype > 0 || ( dtype == 0 && dtime > 0 ) - : dtime > 0; - if( swap ) - { - XCHG( x264_frame_t*, list[i], list[i+1] ); - b_ok = 0; - } - } - } while( !b_ok ); -} - void x264_weight_scale_plane( x264_t *h, pixel *dst, int i_dst_stride, pixel *src, int i_src_stride, int i_width, int i_height, x264_weight_t *w ) { diff --git a/common/frame.h b/common/frame.h index 8cf5f8df..0cd561d2 100644 --- a/common/frame.h +++ b/common/frame.h @@ -222,7 +222,6 @@ x264_frame_t *x264_frame_pop_blank_unused( x264_t *h ); void x264_weight_scale_plane( x264_t *h, pixel *dst, int i_dst_stride, pixel *src, int i_src_stride, int i_width, int i_height, x264_weight_t *w ); x264_frame_t *x264_frame_pop_unused( x264_t *h, int b_fdec ); -void x264_frame_sort( x264_frame_t **list, int b_dts ); void x264_frame_delete_list( x264_frame_t **list ); int x264_sync_frame_list_init( x264_sync_frame_list_t *slist, int nelem ); @@ -230,7 +229,4 @@ void x264_sync_frame_list_delete( x264_sync_frame_list_t *slist ); void x264_sync_frame_list_push( x264_sync_frame_list_t *slist, x264_frame_t *frame ); x264_frame_t *x264_sync_frame_list_pop( x264_sync_frame_list_t *slist ); -#define x264_frame_sort_dts(list) x264_frame_sort(list, 1) -#define x264_frame_sort_pts(list) x264_frame_sort(list, 0) - #endif diff --git a/common/macroblock.c b/common/macroblock.c index a5c1d9b7..9f97aa0c 100644 --- a/common/macroblock.c +++ b/common/macroblock.c @@ -824,7 +824,7 @@ static void ALWAYS_INLINE x264_macroblock_cache_load_neighbours( x264_t *h, int # define LBOT 0 #endif -void ALWAYS_INLINE x264_macroblock_cache_load( x264_t *h, int mb_x, int mb_y, int b_mbaff ) +static void ALWAYS_INLINE x264_macroblock_cache_load( x264_t *h, int mb_x, int mb_y, int b_mbaff ) { x264_macroblock_cache_load_neighbours( h, mb_x, mb_y, b_mbaff ); diff --git a/common/macroblock.h b/common/macroblock.h index 83011879..7f5d5661 100644 --- a/common/macroblock.h +++ b/common/macroblock.h @@ -308,7 +308,6 @@ void x264_macroblock_thread_free( x264_t *h, int b_lookahead ); void x264_macroblock_slice_init( x264_t *h ); void x264_macroblock_thread_init( x264_t *h ); -void x264_macroblock_cache_load( x264_t *h, int mb_x, int mb_y, int b_interlaced ); void x264_macroblock_cache_load_progressive( x264_t *h, int mb_x, int mb_y ); void x264_macroblock_cache_load_interlaced( x264_t *h, int mb_x, int mb_y ); void x264_macroblock_deblock_strength( x264_t *h ); diff --git a/common/x86/dct-a.asm b/common/x86/dct-a.asm index 9db4ee31..4e58f7ae 100644 --- a/common/x86/dct-a.asm +++ b/common/x86/dct-a.asm @@ -765,6 +765,7 @@ ADD16x16 psubw mm0, mm1 ; d02-d13 s02-s13 d02+d13 s02+s13 %endmacro +%ifndef HIGH_BIT_DEPTH INIT_MMX cglobal sub8x8_dct_dc_mmx2, 3,3 DCTDC_2ROW_MMX m0, m4, 0 @@ -819,6 +820,7 @@ cglobal sub8x8_dct_dc_sse2, 3,3,8 DCT2x2 mm0, mm7 movq [r0], mm0 RET +%endif ; !HIGH_BIT_DEPTH ;----------------------------------------------------------------------------- ; void zigzag_scan_8x8_frame( int16_t level[64], int16_t dct[8][8] ) @@ -1294,6 +1296,7 @@ cglobal zigzag_sub_4x4%1_%2, 3,3,8 RET %endmacro +%ifndef HIGH_BIT_DEPTH INIT_XMM ssse3 ZIGZAG_SUB_4x4 , frame ZIGZAG_SUB_4x4 ac, frame @@ -1304,6 +1307,7 @@ ZIGZAG_SUB_4x4 , frame ZIGZAG_SUB_4x4 ac, frame ZIGZAG_SUB_4x4 , field ZIGZAG_SUB_4x4 ac, field +%endif ; !HIGH_BIT_DEPTH ;----------------------------------------------------------------------------- ; void zigzag_interleave_8x8_cavlc( int16_t *dst, int16_t *src, uint8_t *nnz ) diff --git a/common/x86/mc-a2.asm b/common/x86/mc-a2.asm index 1295662c..a47f52e9 100644 --- a/common/x86/mc-a2.asm +++ b/common/x86/mc-a2.asm @@ -1224,6 +1224,7 @@ MEMZERO +%ifndef HIGH_BIT_DEPTH ;----------------------------------------------------------------------------- ; void integral_init4h( uint16_t *sum, uint8_t *pix, int stride ) ;----------------------------------------------------------------------------- @@ -1276,6 +1277,7 @@ INIT_XMM sse4 INTEGRAL_INIT8H INIT_XMM avx INTEGRAL_INIT8H +%endif ; !HIGH_BIT_DEPTH %macro INTEGRAL_INIT_8V 0 ;----------------------------------------------------------------------------- diff --git a/common/x86/mc-c.c b/common/x86/mc-c.c index 5d62114e..3d018fcc 100644 --- a/common/x86/mc-c.c +++ b/common/x86/mc-c.c @@ -82,7 +82,6 @@ MC_WEIGHT( 20, avx ) void x264_mc_copy_w4_mmx( pixel *, int, pixel *, int, int ); void x264_mc_copy_w8_mmx( pixel *, int, pixel *, int, int ); void x264_mc_copy_w8_sse2( pixel *, int, pixel *, int, int ); -void x264_mc_copy_w8_aligned_sse2( pixel *, int, pixel *, int, int ); void x264_mc_copy_w16_mmx( pixel *, int, pixel *, int, int ); void x264_mc_copy_w16_sse2( pixel *, int, pixel *, int, int ); void x264_mc_copy_w16_aligned_sse2( pixel *, int, pixel *, int, int ); diff --git a/common/x86/predict-a.asm b/common/x86/predict-a.asm index 7befed5a..566648ec 100644 --- a/common/x86/predict-a.asm +++ b/common/x86/predict-a.asm @@ -998,7 +998,7 @@ INIT_XMM ssse3 PREDICT_8x8_VR w, dq, 2 INIT_XMM avx PREDICT_8x8_VR w, dq, 2 -%else +%elifndef ARCH_X86_64 INIT_MMX mmx2 PREDICT_8x8_VR b, q , 8 %endif diff --git a/common/x86/quant-a.asm b/common/x86/quant-a.asm index b09e2c93..62df0fb7 100644 --- a/common/x86/quant-a.asm +++ b/common/x86/quant-a.asm @@ -525,6 +525,7 @@ cglobal dequant_%1x%1, 0,3,6 psrld m3, 1 DEQUANT_LOOP DEQUANT32_R, %1*%1/4, %3 +%ifndef HIGH_BIT_DEPTH %if notcpuflag(avx) cglobal dequant_%1x%1_flat16, 0,3 movifnidn t2d, r2m @@ -566,15 +567,13 @@ cglobal dequant_%1x%1_flat16, 0,3 %endif RET %endif ; !AVX +%endif ; !HIGH_BIT_DEPTH %endmacro ; DEQUANT %ifdef HIGH_BIT_DEPTH INIT_XMM sse2 DEQUANT 4, 4, 1 DEQUANT 8, 6, 1 -INIT_XMM sse4 -DEQUANT 4, 4, 1 -DEQUANT 8, 6, 1 %else %ifndef ARCH_X86_64 INIT_MMX mmx @@ -656,13 +655,11 @@ cglobal dequant_4x4dc, 0,3,6 %ifdef HIGH_BIT_DEPTH INIT_XMM sse2 DEQUANT_DC d, pmaddwd -INIT_XMM sse4 -DEQUANT_DC d, pmaddwd -INIT_XMM avx -DEQUANT_DC d, pmaddwd %else +%ifndef ARCH_X86_64 INIT_MMX mmx2 DEQUANT_DC w, pmullw +%endif INIT_XMM sse2 DEQUANT_DC w, pmullw INIT_XMM avx @@ -780,6 +777,7 @@ cglobal optimize_chroma_dc, 0,%%regs,7 REP_RET %endmacro +%ifndef HIGH_BIT_DEPTH INIT_XMM sse2 OPTIMIZE_CHROMA_DC INIT_XMM ssse3 @@ -788,6 +786,7 @@ INIT_XMM sse4 OPTIMIZE_CHROMA_DC INIT_XMM avx OPTIMIZE_CHROMA_DC +%endif ; !HIGH_BIT_DEPTH %ifdef HIGH_BIT_DEPTH ;-----------------------------------------------------------------------------