[x264-devel] Remove some unused, broken, and/or useless functions
Loren Merritt
git at videolan.org
Wed Aug 10 05:15:14 CEST 2011
x264 | branch: master | Loren Merritt <pengvado at akuvian.org> | Wed Aug 3 14:57:06 2011 +0000| [444dae123cc0f41508a0172e29e83327aaed47e6] | committer: Jason Garrett-Glaser
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.
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=444dae123cc0f41508a0172e29e83327aaed47e6
---
common/frame.c | 20 --------------------
common/frame.h | 4 ----
common/macroblock.c | 2 +-
common/macroblock.h | 1 -
common/x86/dct-a.asm | 4 ++++
common/x86/mc-a2.asm | 2 ++
common/x86/mc-c.c | 1 -
common/x86/predict-a.asm | 2 +-
common/x86/quant-a.asm | 13 ++++++-------
9 files changed, 14 insertions(+), 35 deletions(-)
diff --git a/common/frame.c b/common/frame.c
index 7aabaf5..ffda67f 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 9fafe56..1214672 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 0caf793..2a65dc2 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 55f3d45..aa6d59a 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 6dfa66e..df6e34a 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 44ca31e..c3c8061 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 f80f13c..81dd1ca 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 6582aa9..5ce6087 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 b8c1e21..3e04a5f 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
;-----------------------------------------------------------------------------
More information about the x264-devel
mailing list