]> granicus.if.org Git - libx264/commitdiff
Drop the x264 prefix from static functions and variables
authorVittorio Giovara <vittorio.giovara@gmail.com>
Fri, 27 Jan 2017 10:58:33 +0000 (11:58 +0100)
committerAnton Mitrofanov <BugMaster@narod.ru>
Sun, 24 Dec 2017 20:11:30 +0000 (23:11 +0300)
40 files changed:
common/aarch64/mc-c.c
common/arm/mc-c.c
common/bitstream.c
common/cabac.c
common/common.c
common/deblock.c
common/frame.c
common/macroblock.c
common/mc.c
common/mc.h
common/mips/mc-c.c
common/mvpred.c
common/opencl.c
common/osdep.c
common/pixel.c
common/ppc/mc.c
common/ppc/pixel.c
common/predict.c
common/quant.c
common/rectangle.c
common/set.c
common/threadpool.c
common/win32thread.c
common/x86/mc-c.c
common/x86/predict-c.c
encoder/analyse.c
encoder/cabac.c
encoder/cavlc.c
encoder/encoder.c
encoder/lookahead.c
encoder/macroblock.c
encoder/me.c
encoder/ratecontrol.c
encoder/rdo.c
encoder/slicetype-cl.c
encoder/slicetype.c
filters/video/resize.c
input/avs.c
input/input.c
tools/checkasm.c

index f94aa5e517a578dd8e72dfb27c7e61716b6e274a..793662afd6111e3b27b8c556d7c6b8ce0571507b 100644 (file)
@@ -74,7 +74,7 @@ void x264_mc_weight_w16##func##_neon( uint8_t *, intptr_t, uint8_t *, intptr_t,
 void x264_mc_weight_w8##func##_neon ( uint8_t *, intptr_t, uint8_t *, intptr_t, const x264_weight_t *, int );\
 void x264_mc_weight_w4##func##_neon ( uint8_t *, intptr_t, uint8_t *, intptr_t, const x264_weight_t *, int );\
 \
-static void (* x264_mc##func##_wtab_neon[6])( uint8_t *, intptr_t, uint8_t *, intptr_t, const x264_weight_t *, int ) =\
+static void (* mc##func##_wtab_neon[6])( uint8_t *, intptr_t, uint8_t *, intptr_t, const x264_weight_t *, int ) =\
 {\
     x264_mc_weight_w4##func##_neon,\
     x264_mc_weight_w4##func##_neon,\
@@ -106,28 +106,28 @@ void x264_mbtree_fix8_pack_neon( uint16_t *dst, float *src, int count );
 void x264_mbtree_fix8_unpack_neon( float *dst, uint16_t *src, int count );
 
 #if !HIGH_BIT_DEPTH
-static void x264_weight_cache_neon( x264_t *h, x264_weight_t *w )
+static void weight_cache_neon( x264_t *h, x264_weight_t *w )
 {
     if( w->i_scale == 1<<w->i_denom )
     {
         if( w->i_offset < 0 )
         {
-            w->weightfn = x264_mc_offsetsub_wtab_neon;
+            w->weightfn = mc_offsetsub_wtab_neon;
             w->cachea[0] = -w->i_offset;
         }
         else
         {
-            w->weightfn = x264_mc_offsetadd_wtab_neon;
+            w->weightfn = mc_offsetadd_wtab_neon;
             w->cachea[0] = w->i_offset;
         }
     }
     else if( !w->i_denom )
-        w->weightfn = x264_mc_nodenom_wtab_neon;
+        w->weightfn = mc_nodenom_wtab_neon;
     else
-        w->weightfn = x264_mc_wtab_neon;
+        w->weightfn = mc_wtab_neon;
 }
 
-static void (* const x264_pixel_avg_wtab_neon[6])( uint8_t *, intptr_t, uint8_t *, intptr_t, uint8_t *, int ) =
+static void (* const pixel_avg_wtab_neon[6])( uint8_t *, intptr_t, uint8_t *, intptr_t, uint8_t *, int ) =
 {
     NULL,
     x264_pixel_avg2_w4_neon,
@@ -137,7 +137,7 @@ static void (* const x264_pixel_avg_wtab_neon[6])( uint8_t *, intptr_t, uint8_t
     x264_pixel_avg2_w20_neon,
 };
 
-static void (* const x264_mc_copy_wtab_neon[5])( uint8_t *, intptr_t, uint8_t *, intptr_t, int ) =
+static void (* const mc_copy_wtab_neon[5])( uint8_t *, intptr_t, uint8_t *, intptr_t, int ) =
 {
     NULL,
     x264_mc_copy_w4_neon,
@@ -160,7 +160,7 @@ static void mc_luma_neon( uint8_t *dst,    intptr_t i_dst_stride,
     if( qpel_idx & 5 ) /* qpel interpolation needed */
     {
         uint8_t *src2 = src[x264_hpel_ref1[qpel_idx]] + offset + ((mvx&3) == 3);
-        x264_pixel_avg_wtab_neon[i_width>>2](
+        pixel_avg_wtab_neon[i_width>>2](
                 dst, i_dst_stride, src1, i_src_stride,
                 src2, i_height );
         if( weight->weightfn )
@@ -169,7 +169,7 @@ static void mc_luma_neon( uint8_t *dst,    intptr_t i_dst_stride,
     else if( weight->weightfn )
         weight->weightfn[i_width>>2]( dst, i_dst_stride, src1, i_src_stride, weight, i_height );
     else
-        x264_mc_copy_wtab_neon[i_width>>2]( dst, i_dst_stride, src1, i_src_stride, i_height );
+        mc_copy_wtab_neon[i_width>>2]( dst, i_dst_stride, src1, i_src_stride, i_height );
 }
 
 static uint8_t *get_ref_neon( uint8_t *dst,   intptr_t *i_dst_stride,
@@ -186,7 +186,7 @@ static uint8_t *get_ref_neon( uint8_t *dst,   intptr_t *i_dst_stride,
     if( qpel_idx & 5 ) /* qpel interpolation needed */
     {
         uint8_t *src2 = src[x264_hpel_ref1[qpel_idx]] + offset + ((mvx&3) == 3);
-        x264_pixel_avg_wtab_neon[i_width>>2](
+        pixel_avg_wtab_neon[i_width>>2](
                 dst, *i_dst_stride, src1, i_src_stride,
                 src2, i_height );
         if( weight->weightfn )
@@ -234,11 +234,11 @@ void x264_mc_init_aarch64( int cpu, x264_mc_functions_t *pf )
     pf->copy[PIXEL_8x8]      = x264_mc_copy_w8_neon;
     pf->copy[PIXEL_4x4]      = x264_mc_copy_w4_neon;
 
-    pf->plane_copy                  = x264_plane_copy_neon;
-    pf->plane_copy_swap             = x264_plane_copy_swap_neon;
+    pf->plane_copy                  = plane_copy_neon;
+    pf->plane_copy_swap             = plane_copy_swap_neon;
     pf->plane_copy_deinterleave     = x264_plane_copy_deinterleave_neon;
     pf->plane_copy_deinterleave_rgb = x264_plane_copy_deinterleave_rgb_neon;
-    pf->plane_copy_interleave       = x264_plane_copy_interleave_neon;
+    pf->plane_copy_interleave       = plane_copy_interleave_neon;
 
     pf->load_deinterleave_chroma_fdec = x264_load_deinterleave_chroma_fdec_neon;
     pf->load_deinterleave_chroma_fenc = x264_load_deinterleave_chroma_fenc_neon;
@@ -254,10 +254,10 @@ void x264_mc_init_aarch64( int cpu, x264_mc_functions_t *pf )
     pf->avg[PIXEL_4x4]   = x264_pixel_avg_4x4_neon;
     pf->avg[PIXEL_4x2]   = x264_pixel_avg_4x2_neon;
 
-    pf->weight       = x264_mc_wtab_neon;
-    pf->offsetadd    = x264_mc_offsetadd_wtab_neon;
-    pf->offsetsub    = x264_mc_offsetsub_wtab_neon;
-    pf->weight_cache = x264_weight_cache_neon;
+    pf->weight       = mc_wtab_neon;
+    pf->offsetadd    = mc_offsetadd_wtab_neon;
+    pf->offsetsub    = mc_offsetsub_wtab_neon;
+    pf->weight_cache = weight_cache_neon;
 
     pf->mc_chroma = x264_mc_chroma_neon;
     pf->mc_luma = mc_luma_neon;
@@ -271,7 +271,7 @@ void x264_mc_init_aarch64( int cpu, x264_mc_functions_t *pf )
     pf->integral_init8v = x264_integral_init8v_neon;
 
     pf->mbtree_propagate_cost = x264_mbtree_propagate_cost_neon;
-    pf->mbtree_propagate_list = x264_mbtree_propagate_list_neon;
+    pf->mbtree_propagate_list = mbtree_propagate_list_neon;
     pf->mbtree_fix8_pack      = x264_mbtree_fix8_pack_neon;
     pf->mbtree_fix8_unpack    = x264_mbtree_fix8_unpack_neon;
 
index ab4722914a6855fc9a8435835cf7f5e1dde5ca3f..7fe9f273a2d221ef9a905b919c4236e4584b592d 100644 (file)
@@ -74,7 +74,7 @@ void x264_mc_weight_w16##func##_neon( uint8_t *, intptr_t, uint8_t *, intptr_t,
 void x264_mc_weight_w8##func##_neon ( uint8_t *, intptr_t, uint8_t *, intptr_t, const x264_weight_t *, int );\
 void x264_mc_weight_w4##func##_neon ( uint8_t *, intptr_t, uint8_t *, intptr_t, const x264_weight_t *, int );\
 \
-static weight_fn_t x264_mc##func##_wtab_neon[6] =\
+static weight_fn_t mc##func##_wtab_neon[6] =\
 {\
     x264_mc_weight_w4##func##_neon,\
     x264_mc_weight_w4##func##_neon,\
@@ -113,28 +113,28 @@ void x264_mbtree_fix8_pack_neon( uint16_t *dst, float *src, int count );
 void x264_mbtree_fix8_unpack_neon( float *dst, uint16_t *src, int count );
 
 #if !HIGH_BIT_DEPTH
-static void x264_weight_cache_neon( x264_t *h, x264_weight_t *w )
+static void weight_cache_neon( x264_t *h, x264_weight_t *w )
 {
     if( w->i_scale == 1<<w->i_denom )
     {
         if( w->i_offset < 0 )
         {
-            w->weightfn = x264_mc_offsetsub_wtab_neon;
+            w->weightfn = mc_offsetsub_wtab_neon;
             w->cachea[0] = -w->i_offset;
         }
         else
         {
-            w->weightfn = x264_mc_offsetadd_wtab_neon;
+            w->weightfn = mc_offsetadd_wtab_neon;
             w->cachea[0] = w->i_offset;
         }
     }
     else if( !w->i_denom )
-        w->weightfn = x264_mc_nodenom_wtab_neon;
+        w->weightfn = mc_nodenom_wtab_neon;
     else
-        w->weightfn = x264_mc_wtab_neon;
+        w->weightfn = mc_wtab_neon;
 }
 
-static void (* const x264_pixel_avg_wtab_neon[6])( uint8_t *, intptr_t, uint8_t *, intptr_t, uint8_t *, int ) =
+static void (* const pixel_avg_wtab_neon[6])( uint8_t *, intptr_t, uint8_t *, intptr_t, uint8_t *, int ) =
 {
     NULL,
     x264_pixel_avg2_w4_neon,
@@ -144,7 +144,7 @@ static void (* const x264_pixel_avg_wtab_neon[6])( uint8_t *, intptr_t, uint8_t
     x264_pixel_avg2_w20_neon,
 };
 
-static void (* const x264_mc_copy_wtab_neon[5])( uint8_t *, intptr_t, uint8_t *, intptr_t, int ) =
+static void (* const mc_copy_wtab_neon[5])( uint8_t *, intptr_t, uint8_t *, intptr_t, int ) =
 {
     NULL,
     x264_mc_copy_w4_neon,
@@ -167,7 +167,7 @@ static void mc_luma_neon( uint8_t *dst,    intptr_t i_dst_stride,
     if( qpel_idx & 5 ) /* qpel interpolation needed */
     {
         uint8_t *src2 = src[x264_hpel_ref1[qpel_idx]] + offset + ((mvx&3) == 3);
-        x264_pixel_avg_wtab_neon[i_width>>2](
+        pixel_avg_wtab_neon[i_width>>2](
                 dst, i_dst_stride, src1, i_src_stride,
                 src2, i_height );
         if( weight->weightfn )
@@ -176,7 +176,7 @@ static void mc_luma_neon( uint8_t *dst,    intptr_t i_dst_stride,
     else if( weight->weightfn )
         weight->weightfn[i_width>>2]( dst, i_dst_stride, src1, i_src_stride, weight, i_height );
     else
-        x264_mc_copy_wtab_neon[i_width>>2]( dst, i_dst_stride, src1, i_src_stride, i_height );
+        mc_copy_wtab_neon[i_width>>2]( dst, i_dst_stride, src1, i_src_stride, i_height );
 }
 
 static uint8_t *get_ref_neon( uint8_t *dst,   intptr_t *i_dst_stride,
@@ -193,7 +193,7 @@ static uint8_t *get_ref_neon( uint8_t *dst,   intptr_t *i_dst_stride,
     if( qpel_idx & 5 ) /* qpel interpolation needed */
     {
         uint8_t *src2 = src[x264_hpel_ref1[qpel_idx]] + offset + ((mvx&3) == 3);
-        x264_pixel_avg_wtab_neon[i_width>>2](
+        pixel_avg_wtab_neon[i_width>>2](
                 dst, *i_dst_stride, src1, i_src_stride,
                 src2, i_height );
         if( weight->weightfn )
@@ -260,11 +260,11 @@ void x264_mc_init_arm( int cpu, x264_mc_functions_t *pf )
     pf->copy[PIXEL_8x8]   = x264_mc_copy_w8_neon;
     pf->copy[PIXEL_4x4]   = x264_mc_copy_w4_neon;
 
-    pf->plane_copy              = x264_plane_copy_neon;
+    pf->plane_copy              = plane_copy_neon;
     pf->plane_copy_deinterleave = x264_plane_copy_deinterleave_neon;
     pf->plane_copy_deinterleave_rgb = x264_plane_copy_deinterleave_rgb_neon;
-    pf->plane_copy_interleave = x264_plane_copy_interleave_neon;
-    pf->plane_copy_swap = x264_plane_copy_swap_neon;
+    pf->plane_copy_interleave = plane_copy_interleave_neon;
+    pf->plane_copy_swap = plane_copy_swap_neon;
 
     pf->store_interleave_chroma = x264_store_interleave_chroma_neon;
     pf->load_deinterleave_chroma_fdec = x264_load_deinterleave_chroma_fdec_neon;
@@ -280,10 +280,10 @@ void x264_mc_init_arm( int cpu, x264_mc_functions_t *pf )
     pf->avg[PIXEL_4x4]   = x264_pixel_avg_4x4_neon;
     pf->avg[PIXEL_4x2]   = x264_pixel_avg_4x2_neon;
 
-    pf->weight    = x264_mc_wtab_neon;
-    pf->offsetadd = x264_mc_offsetadd_wtab_neon;
-    pf->offsetsub = x264_mc_offsetsub_wtab_neon;
-    pf->weight_cache = x264_weight_cache_neon;
+    pf->weight    = mc_wtab_neon;
+    pf->offsetadd = mc_offsetadd_wtab_neon;
+    pf->offsetsub = mc_offsetsub_wtab_neon;
+    pf->weight_cache = weight_cache_neon;
 
     pf->mc_chroma = x264_mc_chroma_neon;
     pf->mc_luma = mc_luma_neon;
@@ -297,7 +297,7 @@ void x264_mc_init_arm( int cpu, x264_mc_functions_t *pf )
     pf->integral_init8v = x264_integral_init8v_neon;
 
     pf->mbtree_propagate_cost = x264_mbtree_propagate_cost_neon;
-    pf->mbtree_propagate_list = x264_mbtree_propagate_list_neon;
+    pf->mbtree_propagate_list = mbtree_propagate_list_neon;
     pf->mbtree_fix8_pack      = x264_mbtree_fix8_pack_neon;
     pf->mbtree_fix8_unpack    = x264_mbtree_fix8_unpack_neon;
 #endif // !HIGH_BIT_DEPTH
index cc7630009abf9e601a0923ea1087bb762b1ceb89..e11d6133369a81b3d7d3ea43ab6b2187082eac3a 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "common.h"
 
-static uint8_t *x264_nal_escape_c( uint8_t *dst, uint8_t *src, uint8_t *end )
+static uint8_t *nal_escape_c( uint8_t *dst, uint8_t *src, uint8_t *end )
 {
     if( src < end ) *dst++ = *src++;
     if( src < end ) *dst++ = *src++;
@@ -117,7 +117,7 @@ void x264_bitstream_init( int cpu, x264_bitstream_function_t *pf )
 {
     memset( pf, 0, sizeof(*pf) );
 
-    pf->nal_escape = x264_nal_escape_c;
+    pf->nal_escape = nal_escape_c;
 #if HAVE_MMX
 #if ARCH_X86_64 && !defined( __MACH__ )
     pf->cabac_block_residual_internal = x264_cabac_block_residual_internal_sse2;
index 0342ac5ac6525b041157b51ebac1a30e031c7120..04264ac2912787d840d0cbc3737f3cac33421f0f 100644 (file)
@@ -1364,7 +1364,7 @@ void x264_cabac_encode_init( x264_cabac_t *cb, uint8_t *p_data, uint8_t *p_end )
     cb->p_end   = p_end;
 }
 
-static inline void x264_cabac_putbyte( x264_cabac_t *cb )
+static inline void cabac_putbyte( x264_cabac_t *cb )
 {
     if( cb->i_queue >= 0 )
     {
@@ -1396,13 +1396,13 @@ static inline void x264_cabac_putbyte( x264_cabac_t *cb )
     }
 }
 
-static inline void x264_cabac_encode_renorm( x264_cabac_t *cb )
+static inline void cabac_encode_renorm( x264_cabac_t *cb )
 {
     int shift = x264_cabac_renorm_shift[cb->i_range>>3];
     cb->i_range <<= shift;
     cb->i_low   <<= shift;
     cb->i_queue  += shift;
-    x264_cabac_putbyte( cb );
+    cabac_putbyte( cb );
 }
 
 /* Making custom versions of this function, even in asm, for the cases where
@@ -1419,7 +1419,7 @@ void x264_cabac_encode_decision_c( x264_cabac_t *cb, int i_ctx, int b )
         cb->i_range = i_range_lps;
     }
     cb->state[i_ctx] = x264_cabac_transition[i_state][b];
-    x264_cabac_encode_renorm( cb );
+    cabac_encode_renorm( cb );
 }
 
 /* Note: b is negated for this function */
@@ -1428,7 +1428,7 @@ void x264_cabac_encode_bypass_c( x264_cabac_t *cb, int b )
     cb->i_low <<= 1;
     cb->i_low += b & cb->i_range;
     cb->i_queue += 1;
-    x264_cabac_putbyte( cb );
+    cabac_putbyte( cb );
 }
 
 static const int bypass_lut[16] =
@@ -1449,7 +1449,7 @@ void x264_cabac_encode_ue_bypass( x264_cabac_t *cb, int exp_bits, int val )
         cb->i_low <<= i;
         cb->i_low += ((x>>k)&0xff) * cb->i_range;
         cb->i_queue += i;
-        x264_cabac_putbyte( cb );
+        cabac_putbyte( cb );
         i = 8;
     } while( k > 0 );
 }
@@ -1457,7 +1457,7 @@ void x264_cabac_encode_ue_bypass( x264_cabac_t *cb, int exp_bits, int val )
 void x264_cabac_encode_terminal_c( x264_cabac_t *cb )
 {
     cb->i_range -= 2;
-    x264_cabac_encode_renorm( cb );
+    cabac_encode_renorm( cb );
 }
 
 void x264_cabac_encode_flush( x264_t *h, x264_cabac_t *cb )
@@ -1466,12 +1466,12 @@ void x264_cabac_encode_flush( x264_t *h, x264_cabac_t *cb )
     cb->i_low |= 1;
     cb->i_low <<= 9;
     cb->i_queue += 9;
-    x264_cabac_putbyte( cb );
-    x264_cabac_putbyte( cb );
+    cabac_putbyte( cb );
+    cabac_putbyte( cb );
     cb->i_low <<= -cb->i_queue;
     cb->i_low |= (0x35a4e4f5 >> (h->i_frame & 31) & 1) << 10;
     cb->i_queue = 0;
-    x264_cabac_putbyte( cb );
+    cabac_putbyte( cb );
 
     while( cb->i_bytes_outstanding > 0 )
     {
index 561212d3fcd866667e2bf52580b30e9fc40203a4..5018cf2f38483f969dec3bb1b6ca05cffa450c18 100644 (file)
@@ -39,7 +39,7 @@ const int x264_bit_depth = BIT_DEPTH;
 
 const int x264_chroma_format = X264_CHROMA_FORMAT;
 
-static void x264_log_default( void *, int, const char *, va_list );
+static void log_default( void *, int, const char *, va_list );
 
 /****************************************************************************
  * x264_param_default:
@@ -123,7 +123,7 @@ void x264_param_default( x264_param_t *param )
     param->rc.b_mb_tree = 1;
 
     /* Log */
-    param->pf_log = x264_log_default;
+    param->pf_log = log_default;
     param->p_log_private = NULL;
     param->i_log_level = X264_LOG_INFO;
 
@@ -179,7 +179,7 @@ void x264_param_default( x264_param_t *param )
     param->psz_clbin_file = NULL;
 }
 
-static int x264_param_apply_preset( x264_param_t *param, const char *preset )
+static int param_apply_preset( x264_param_t *param, const char *preset )
 {
     char *end;
     int i = strtol( preset, &end, 10 );
@@ -301,7 +301,7 @@ static int x264_param_apply_preset( x264_param_t *param, const char *preset )
     return 0;
 }
 
-static int x264_param_apply_tune( x264_param_t *param, const char *tune )
+static int param_apply_tune( x264_param_t *param, const char *tune )
 {
     char *tmp = x264_malloc( strlen( tune ) + 1 );
     if( !tmp )
@@ -411,9 +411,9 @@ int x264_param_default_preset( x264_param_t *param, const char *preset, const ch
 {
     x264_param_default( param );
 
-    if( preset && x264_param_apply_preset( param, preset ) < 0 )
+    if( preset && param_apply_preset( param, preset ) < 0 )
         return -1;
-    if( tune && x264_param_apply_tune( param, tune ) < 0 )
+    if( tune && param_apply_tune( param, tune ) < 0 )
         return -1;
     return 0;
 }
@@ -534,7 +534,7 @@ static int parse_cqm( const char *str, uint8_t *cqm, int length )
     return (i == length) ? 0 : -1;
 }
 
-static int x264_atobool( const char *str, int *b_error )
+static int atobool_internal( const char *str, int *b_error )
 {
     if( !strcmp(str, "1") ||
         !strcasecmp(str, "true") ||
@@ -548,7 +548,7 @@ static int x264_atobool( const char *str, int *b_error )
     return 0;
 }
 
-static int x264_atoi( const char *str, int *b_error )
+static int atoi_internal( const char *str, int *b_error )
 {
     char *end;
     int v = strtol( str, &end, 0 );
@@ -557,7 +557,7 @@ static int x264_atoi( const char *str, int *b_error )
     return v;
 }
 
-static double x264_atof( const char *str, int *b_error )
+static double atof_internal( const char *str, int *b_error )
 {
     char *end;
     double v = strtod( str, &end );
@@ -566,11 +566,11 @@ static double x264_atof( const char *str, int *b_error )
     return v;
 }
 
-#define atobool(str) ( name_was_bool = 1, x264_atobool( str, &b_error ) )
+#define atobool(str) ( name_was_bool = 1, atobool_internal( str, &b_error ) )
 #undef atoi
 #undef atof
-#define atoi(str) x264_atoi( str, &b_error )
-#define atof(str) x264_atof( str, &b_error )
+#define atoi(str) atoi_internal( str, &b_error )
+#define atof(str) atof_internal( str, &b_error )
 
 int x264_param_parse( x264_param_t *p, const char *name, const char *value )
 {
@@ -1079,14 +1079,14 @@ void x264_log( x264_t *h, int i_level, const char *psz_fmt, ... )
         va_list arg;
         va_start( arg, psz_fmt );
         if( !h )
-            x264_log_default( NULL, i_level, psz_fmt, arg );
+            log_default( NULL, i_level, psz_fmt, arg );
         else
             h->param.pf_log( h->param.p_log_private, i_level, psz_fmt, arg );
         va_end( arg );
     }
 }
 
-static void x264_log_default( void *p_unused, int i_level, const char *psz_fmt, va_list arg )
+static void log_default( void *p_unused, int i_level, const char *psz_fmt, va_list arg )
 {
     char *psz_prefix;
     switch( i_level )
@@ -1134,7 +1134,7 @@ int x264_picture_alloc( x264_picture_t *pic, int i_csp, int i_width, int i_heigh
         int height_fix8[3];
     } x264_csp_tab_t;
 
-    static const x264_csp_tab_t x264_csp_tab[] =
+    static const x264_csp_tab_t csp_tab[] =
     {
         [X264_CSP_I420] = { 3, { 256*1, 256/2, 256/2 }, { 256*1, 256/2, 256/2 } },
         [X264_CSP_YV12] = { 3, { 256*1, 256/2, 256/2 }, { 256*1, 256/2, 256/2 } },
@@ -1157,14 +1157,14 @@ int x264_picture_alloc( x264_picture_t *pic, int i_csp, int i_width, int i_heigh
         return -1;
     x264_picture_init( pic );
     pic->img.i_csp = i_csp;
-    pic->img.i_plane = x264_csp_tab[csp].planes;
+    pic->img.i_plane = csp_tab[csp].planes;
     int depth_factor = i_csp & X264_CSP_HIGH_DEPTH ? 2 : 1;
     int plane_offset[3] = {0};
     int frame_size = 0;
     for( int i = 0; i < pic->img.i_plane; i++ )
     {
-        int stride = (((int64_t)i_width * x264_csp_tab[csp].width_fix8[i]) >> 8) * depth_factor;
-        int plane_size = (((int64_t)i_height * x264_csp_tab[csp].height_fix8[i]) >> 8) * stride;
+        int stride = (((int64_t)i_width * csp_tab[csp].width_fix8[i]) >> 8) * depth_factor;
+        int plane_size = (((int64_t)i_height * csp_tab[csp].height_fix8[i]) >> 8) * stride;
         pic->img.i_stride[i] = stride;
         plane_offset[i] = frame_size;
         frame_size += plane_size;
index 0c7f128c69eb577b348a7d70250b47312cd8f90e..cd80199d3ee5031c2ffccfc950406e3e07eef7c7 100644 (file)
@@ -337,7 +337,7 @@ static ALWAYS_INLINE void deblock_edge_intra( x264_t *h, pixel *pix, intptr_t i_
     pf_intra( pix, i_stride, alpha, beta );
 }
 
-static ALWAYS_INLINE void x264_macroblock_cache_load_neighbours_deblock( x264_t *h, int mb_x, int mb_y )
+static ALWAYS_INLINE void macroblock_cache_load_neighbours_deblock( x264_t *h, int mb_x, int mb_y )
 {
     int deblock_on_slice_edges = h->sh.i_disable_deblocking_filter_idc != 2;
 
@@ -390,7 +390,7 @@ void x264_frame_deblock_row( x264_t *h, int mb_y )
     for( int mb_x = 0; mb_x < h->mb.i_mb_width; mb_x += (~b_interlaced | mb_y)&1, mb_y ^= b_interlaced )
     {
         x264_prefetch_fenc( h, h->fdec, mb_x, mb_y );
-        x264_macroblock_cache_load_neighbours_deblock( h, mb_x, mb_y );
+        macroblock_cache_load_neighbours_deblock( h, mb_x, mb_y );
 
         int mb_xy = h->mb.i_mb_xy;
         int transform_8x8 = h->mb.mb_transform_size[mb_xy];
index 4d80cbb064ee3d4215322fb75f66893df6a8ba6c..49ea899422bb140c05e28086e98aeb3a3743a623 100644 (file)
@@ -42,7 +42,7 @@ static int align_plane_size( int x, int disalign )
     return x;
 }
 
-static int x264_frame_internal_csp( int external_csp )
+static int frame_internal_csp( int external_csp )
 {
     switch( external_csp & X264_CSP_MASK )
     {
@@ -69,10 +69,10 @@ static int x264_frame_internal_csp( int external_csp )
     }
 }
 
-static x264_frame_t *x264_frame_new( x264_t *h, int b_fdec )
+static x264_frame_t *frame_new( x264_t *h, int b_fdec )
 {
     x264_frame_t *frame;
-    int i_csp = x264_frame_internal_csp( h->param.i_csp );
+    int i_csp = frame_internal_csp( h->param.i_csp );
     int i_mb_count = h->mb.i_mb_count;
     int i_stride, i_width, i_lines, luma_plane_count;
     int i_padv = PADV << PARAM_INTERLACED;
@@ -366,7 +366,7 @@ static int get_plane_ptr( x264_t *h, x264_picture_t *src, uint8_t **pix, int *st
 int x264_frame_copy_picture( x264_t *h, x264_frame_t *dst, x264_picture_t *src )
 {
     int i_csp = src->img.i_csp & X264_CSP_MASK;
-    if( dst->i_csp != x264_frame_internal_csp( i_csp ) )
+    if( dst->i_csp != frame_internal_csp( i_csp ) )
     {
         x264_log( h, X264_LOG_ERROR, "Invalid input colorspace\n" );
         return -1;
@@ -784,7 +784,7 @@ x264_frame_t *x264_frame_pop_unused( x264_t *h, int b_fdec )
     if( h->frames.unused[b_fdec][0] )
         frame = x264_frame_pop( h->frames.unused[b_fdec] );
     else
-        frame = x264_frame_new( h, b_fdec );
+        frame = frame_new( h, b_fdec );
     if( !frame )
         return NULL;
     frame->b_last_minigop_bframe = 0;
index 6168671591da4c905aca2d82287c821a79c9e5ab..86cadfb6ca3ef272e38a326ec2709c80d3785e5a 100644 (file)
@@ -34,7 +34,7 @@
                    mvx, mvy, 4*width, 4*height, \
                    list ? x264_weight_none : &h->sh.weight[i_ref][p] );
 
-static NOINLINE void x264_mb_mc_0xywh( x264_t *h, int x, int y, int width, int height )
+static NOINLINE void mb_mc_0xywh( x264_t *h, int x, int y, int width, int height )
 {
     int i8    = x264_scan8[0]+x+8*y;
     int i_ref = h->mb.cache.ref[0][i8];
@@ -73,7 +73,7 @@ static NOINLINE void x264_mb_mc_0xywh( x264_t *h, int x, int y, int width, int h
                                                        &h->sh.weight[i_ref][2], height );
     }
 }
-static NOINLINE void x264_mb_mc_1xywh( x264_t *h, int x, int y, int width, int height )
+static NOINLINE void mb_mc_1xywh( x264_t *h, int x, int y, int width, int height )
 {
     int i8    = x264_scan8[0]+x+8*y;
     int i_ref = h->mb.cache.ref[1][i8];
@@ -109,7 +109,7 @@ static NOINLINE void x264_mb_mc_1xywh( x264_t *h, int x, int y, int width, int h
     h->mc.avg[i_mode]( &h->mb.pic.p_fdec[p][4*y*FDEC_STRIDE+4*x], FDEC_STRIDE, \
                        src0, i_stride0, src1, i_stride1, weight );
 
-static NOINLINE void x264_mb_mc_01xywh( x264_t *h, int x, int y, int width, int height )
+static NOINLINE void mb_mc_01xywh( x264_t *h, int x, int y, int width, int height )
 {
     int i8 = x264_scan8[0]+x+8*y;
     int i_ref0 = h->mb.cache.ref[0][i8];
@@ -165,21 +165,21 @@ void x264_mb_mc_8x8( x264_t *h, int i8 )
         switch( h->mb.i_sub_partition[i8] )
         {
             case D_L0_8x8:
-                x264_mb_mc_0xywh( h, x, y, 2, 2 );
+                mb_mc_0xywh( h, x, y, 2, 2 );
                 break;
             case D_L0_8x4:
-                x264_mb_mc_0xywh( h, x, y+0, 2, 1 );
-                x264_mb_mc_0xywh( h, x, y+1, 2, 1 );
+                mb_mc_0xywh( h, x, y+0, 2, 1 );
+                mb_mc_0xywh( h, x, y+1, 2, 1 );
                 break;
             case D_L0_4x8:
-                x264_mb_mc_0xywh( h, x+0, y, 1, 2 );
-                x264_mb_mc_0xywh( h, x+1, y, 1, 2 );
+                mb_mc_0xywh( h, x+0, y, 1, 2 );
+                mb_mc_0xywh( h, x+1, y, 1, 2 );
                 break;
             case D_L0_4x4:
-                x264_mb_mc_0xywh( h, x+0, y+0, 1, 1 );
-                x264_mb_mc_0xywh( h, x+1, y+0, 1, 1 );
-                x264_mb_mc_0xywh( h, x+0, y+1, 1, 1 );
-                x264_mb_mc_0xywh( h, x+1, y+1, 1, 1 );
+                mb_mc_0xywh( h, x+0, y+0, 1, 1 );
+                mb_mc_0xywh( h, x+1, y+0, 1, 1 );
+                mb_mc_0xywh( h, x+0, y+1, 1, 1 );
+                mb_mc_0xywh( h, x+1, y+1, 1, 1 );
                 break;
         }
     }
@@ -189,11 +189,11 @@ void x264_mb_mc_8x8( x264_t *h, int i8 )
 
         if( h->mb.cache.ref[0][scan8] >= 0 )
             if( h->mb.cache.ref[1][scan8] >= 0 )
-                x264_mb_mc_01xywh( h, x, y, 2, 2 );
+                mb_mc_01xywh( h, x, y, 2, 2 );
             else
-                x264_mb_mc_0xywh( h, x, y, 2, 2 );
+                mb_mc_0xywh( h, x, y, 2, 2 );
         else
-            x264_mb_mc_1xywh( h, x, y, 2, 2 );
+            mb_mc_1xywh( h, x, y, 2, 2 );
     }
 }
 
@@ -214,33 +214,33 @@ void x264_mb_mc( x264_t *h )
         if( h->mb.i_partition == D_16x16 )
         {
             if( ref0a >= 0 )
-                if( ref1a >= 0 ) x264_mb_mc_01xywh( h, 0, 0, 4, 4 );
-                else             x264_mb_mc_0xywh ( h, 0, 0, 4, 4 );
-            else                 x264_mb_mc_1xywh ( h, 0, 0, 4, 4 );
+                if( ref1a >= 0 ) mb_mc_01xywh( h, 0, 0, 4, 4 );
+                else             mb_mc_0xywh ( h, 0, 0, 4, 4 );
+            else                 mb_mc_1xywh ( h, 0, 0, 4, 4 );
         }
         else if( h->mb.i_partition == D_16x8 )
         {
             if( ref0a >= 0 )
-                if( ref1a >= 0 ) x264_mb_mc_01xywh( h, 0, 0, 4, 2 );
-                else             x264_mb_mc_0xywh ( h, 0, 0, 4, 2 );
-            else                 x264_mb_mc_1xywh ( h, 0, 0, 4, 2 );
+                if( ref1a >= 0 ) mb_mc_01xywh( h, 0, 0, 4, 2 );
+                else             mb_mc_0xywh ( h, 0, 0, 4, 2 );
+            else                 mb_mc_1xywh ( h, 0, 0, 4, 2 );
 
             if( ref0b >= 0 )
-                if( ref1b >= 0 ) x264_mb_mc_01xywh( h, 0, 2, 4, 2 );
-                else             x264_mb_mc_0xywh ( h, 0, 2, 4, 2 );
-            else                 x264_mb_mc_1xywh ( h, 0, 2, 4, 2 );
+                if( ref1b >= 0 ) mb_mc_01xywh( h, 0, 2, 4, 2 );
+                else             mb_mc_0xywh ( h, 0, 2, 4, 2 );
+            else                 mb_mc_1xywh ( h, 0, 2, 4, 2 );
         }
         else if( h->mb.i_partition == D_8x16 )
         {
             if( ref0a >= 0 )
-                if( ref1a >= 0 ) x264_mb_mc_01xywh( h, 0, 0, 2, 4 );
-                else             x264_mb_mc_0xywh ( h, 0, 0, 2, 4 );
-            else                 x264_mb_mc_1xywh ( h, 0, 0, 2, 4 );
+                if( ref1a >= 0 ) mb_mc_01xywh( h, 0, 0, 2, 4 );
+                else             mb_mc_0xywh ( h, 0, 0, 2, 4 );
+            else                 mb_mc_1xywh ( h, 0, 0, 2, 4 );
 
             if( ref0b >= 0 )
-                if( ref1b >= 0 ) x264_mb_mc_01xywh( h, 2, 0, 2, 4 );
-                else             x264_mb_mc_0xywh ( h, 2, 0, 2, 4 );
-            else                 x264_mb_mc_1xywh ( h, 2, 0, 2, 4 );
+                if( ref1b >= 0 ) mb_mc_01xywh( h, 2, 0, 2, 4 );
+                else             mb_mc_0xywh ( h, 2, 0, 2, 4 );
+            else                 mb_mc_1xywh ( h, 2, 0, 2, 4 );
         }
     }
 }
@@ -562,7 +562,7 @@ NOINLINE void x264_copy_column8( pixel *dst, pixel *src )
         dst[i*FDEC_STRIDE] = src[i*FDEC_STRIDE];
 }
 
-static void ALWAYS_INLINE x264_macroblock_load_pic_pointers( x264_t *h, int mb_x, int mb_y, int i, int b_chroma, int b_mbaff )
+static void ALWAYS_INLINE macroblock_load_pic_pointers( x264_t *h, int mb_x, int mb_y, int i, int b_chroma, int b_mbaff )
 {
     int mb_interlaced = b_mbaff && MB_INTERLACED;
     int height = b_chroma ? 16 >> CHROMA_V_SHIFT : 16;
@@ -666,7 +666,7 @@ static const x264_left_table_t left_indices[4] =
     {{ 4, 5, 6, 3}, { 3,  7, 11, 15}, {16+1, 16+5, 32+1, 32+5}, {0, 1, 2, 3}, {0, 0, 1, 1}}
 };
 
-static void ALWAYS_INLINE x264_macroblock_cache_load_neighbours( x264_t *h, int mb_x, int mb_y, int b_interlaced )
+static void ALWAYS_INLINE macroblock_cache_load_neighbours( x264_t *h, int mb_x, int mb_y, int b_interlaced )
 {
     const int mb_interlaced = b_interlaced && MB_INTERLACED;
     int top_y = mb_y - (1 << mb_interlaced);
@@ -848,9 +848,9 @@ static void ALWAYS_INLINE x264_macroblock_cache_load_neighbours( x264_t *h, int
 #   define LBOT 0
 #endif
 
-static void ALWAYS_INLINE x264_macroblock_cache_load( x264_t *h, int mb_x, int mb_y, int b_mbaff )
+static void ALWAYS_INLINE 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 );
+    macroblock_cache_load_neighbours( h, mb_x, mb_y, b_mbaff );
 
     int *left = h->mb.i_mb_left_xy;
     int top  = h->mb.i_mb_top_xy;
@@ -996,15 +996,15 @@ static void ALWAYS_INLINE x264_macroblock_cache_load( x264_t *h, int mb_x, int m
     {
         x264_copy_column8( h->mb.pic.p_fdec[0]-1+ 4*FDEC_STRIDE, h->mb.pic.p_fdec[0]+15+ 4*FDEC_STRIDE );
         x264_copy_column8( h->mb.pic.p_fdec[0]-1+12*FDEC_STRIDE, h->mb.pic.p_fdec[0]+15+12*FDEC_STRIDE );
-        x264_macroblock_load_pic_pointers( h, mb_x, mb_y, 0, 0, 0 );
+        macroblock_load_pic_pointers( h, mb_x, mb_y, 0, 0, 0 );
         if( CHROMA444 )
         {
             x264_copy_column8( h->mb.pic.p_fdec[1]-1+ 4*FDEC_STRIDE, h->mb.pic.p_fdec[1]+15+ 4*FDEC_STRIDE );
             x264_copy_column8( h->mb.pic.p_fdec[1]-1+12*FDEC_STRIDE, h->mb.pic.p_fdec[1]+15+12*FDEC_STRIDE );
             x264_copy_column8( h->mb.pic.p_fdec[2]-1+ 4*FDEC_STRIDE, h->mb.pic.p_fdec[2]+15+ 4*FDEC_STRIDE );
             x264_copy_column8( h->mb.pic.p_fdec[2]-1+12*FDEC_STRIDE, h->mb.pic.p_fdec[2]+15+12*FDEC_STRIDE );
-            x264_macroblock_load_pic_pointers( h, mb_x, mb_y, 1, 0, 0 );
-            x264_macroblock_load_pic_pointers( h, mb_x, mb_y, 2, 0, 0 );
+            macroblock_load_pic_pointers( h, mb_x, mb_y, 1, 0, 0 );
+            macroblock_load_pic_pointers( h, mb_x, mb_y, 2, 0, 0 );
         }
         else
         {
@@ -1015,19 +1015,19 @@ static void ALWAYS_INLINE x264_macroblock_cache_load( x264_t *h, int mb_x, int m
                 x264_copy_column8( h->mb.pic.p_fdec[1]-1+12*FDEC_STRIDE, h->mb.pic.p_fdec[1]+ 7+12*FDEC_STRIDE );
                 x264_copy_column8( h->mb.pic.p_fdec[2]-1+12*FDEC_STRIDE, h->mb.pic.p_fdec[2]+ 7+12*FDEC_STRIDE );
             }
-            x264_macroblock_load_pic_pointers( h, mb_x, mb_y, 1, 1, 0 );
+            macroblock_load_pic_pointers( h, mb_x, mb_y, 1, 1, 0 );
         }
     }
     else
     {
-        x264_macroblock_load_pic_pointers( h, mb_x, mb_y, 0, 0, 1 );
+        macroblock_load_pic_pointers( h, mb_x, mb_y, 0, 0, 1 );
         if( CHROMA444 )
         {
-            x264_macroblock_load_pic_pointers( h, mb_x, mb_y, 1, 0, 1 );
-            x264_macroblock_load_pic_pointers( h, mb_x, mb_y, 2, 0, 1 );
+            macroblock_load_pic_pointers( h, mb_x, mb_y, 1, 0, 1 );
+            macroblock_load_pic_pointers( h, mb_x, mb_y, 2, 0, 1 );
         }
         else
-            x264_macroblock_load_pic_pointers( h, mb_x, mb_y, 1, 1, 1 );
+            macroblock_load_pic_pointers( h, mb_x, mb_y, 1, 1, 1 );
     }
 
     if( h->fdec->integral )
@@ -1348,15 +1348,15 @@ static void ALWAYS_INLINE x264_macroblock_cache_load( x264_t *h, int mb_x, int m
 
 void x264_macroblock_cache_load_progressive( x264_t *h, int mb_x, int mb_y )
 {
-    x264_macroblock_cache_load( h, mb_x, mb_y, 0 );
+    macroblock_cache_load( h, mb_x, mb_y, 0 );
 }
 
 void x264_macroblock_cache_load_interlaced( x264_t *h, int mb_x, int mb_y )
 {
-    x264_macroblock_cache_load( h, mb_x, mb_y, 1 );
+    macroblock_cache_load( h, mb_x, mb_y, 1 );
 }
 
-static void x264_macroblock_deblock_strength_mbaff( x264_t *h, uint8_t (*bs)[8][4] )
+static void macroblock_deblock_strength_mbaff( x264_t *h, uint8_t (*bs)[8][4] )
 {
     if( (h->mb.i_neighbour & MB_LEFT) && h->mb.field[h->mb.i_mb_left_xy[0]] != MB_INTERLACED )
     {
@@ -1613,10 +1613,10 @@ void x264_macroblock_deblock_strength( x264_t *h )
                                bs, 4 >> MB_INTERLACED, h->sh.i_type == SLICE_TYPE_B );
 
     if( SLICE_MBAFF )
-        x264_macroblock_deblock_strength_mbaff( h, bs );
+        macroblock_deblock_strength_mbaff( h, bs );
 }
 
-static void ALWAYS_INLINE x264_macroblock_store_pic( x264_t *h, int mb_x, int mb_y, int i, int b_chroma, int b_mbaff )
+static void ALWAYS_INLINE macroblock_store_pic( x264_t *h, int mb_x, int mb_y, int i, int b_chroma, int b_mbaff )
 {
     int height = b_chroma ? 16>>CHROMA_V_SHIFT : 16;
     int i_stride = h->fdec->i_stride[i];
@@ -1630,7 +1630,7 @@ static void ALWAYS_INLINE x264_macroblock_store_pic( x264_t *h, int mb_x, int mb
         h->mc.copy[PIXEL_16x16]( &h->fdec->plane[i][i_pix_offset], i_stride2, h->mb.pic.p_fdec[i], FDEC_STRIDE, 16 );
 }
 
-static void ALWAYS_INLINE x264_macroblock_backup_intra( x264_t *h, int mb_x, int mb_y, int b_mbaff )
+static void ALWAYS_INLINE macroblock_backup_intra( x264_t *h, int mb_x, int mb_y, int b_mbaff )
 {
     /* In MBAFF we store the last two rows in intra_border_backup[0] and [1].
      * For progressive mbs this is the bottom two rows, and for interlaced the
@@ -1688,27 +1688,27 @@ void x264_macroblock_cache_save( x264_t *h )
 
     if( SLICE_MBAFF )
     {
-        x264_macroblock_backup_intra( h, h->mb.i_mb_x, h->mb.i_mb_y, 1 );
-        x264_macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 0, 0, 1 );
+        macroblock_backup_intra( h, h->mb.i_mb_x, h->mb.i_mb_y, 1 );
+        macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 0, 0, 1 );
         if( CHROMA444 )
         {
-            x264_macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 1, 0, 1 );
-            x264_macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 2, 0, 1 );
+            macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 1, 0, 1 );
+            macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 2, 0, 1 );
         }
         else
-            x264_macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 1, 1, 1 );
+            macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 1, 1, 1 );
     }
     else
     {
-        x264_macroblock_backup_intra( h, h->mb.i_mb_x, h->mb.i_mb_y, 0 );
-        x264_macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 0, 0, 0 );
+        macroblock_backup_intra( h, h->mb.i_mb_x, h->mb.i_mb_y, 0 );
+        macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 0, 0, 0 );
         if( CHROMA444 )
         {
-            x264_macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 1, 0, 0 );
-            x264_macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 2, 0, 0 );
+            macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 1, 0, 0 );
+            macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 2, 0, 0 );
         }
         else
-            x264_macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 1, 1, 0 );
+            macroblock_store_pic( h, h->mb.i_mb_x, h->mb.i_mb_y, 1, 1, 0 );
     }
 
     x264_prefetch_fenc( h, h->fdec, h->mb.i_mb_x, h->mb.i_mb_y );
index 65af5b9e25ad25290451e7df600acc4b12fe7632..31a14935f443196f3e4c4b3810278388538d2c11 100644 (file)
@@ -107,7 +107,7 @@ PIXEL_AVG_C( pixel_avg_2x8,   2, 8 )
 PIXEL_AVG_C( pixel_avg_2x4,   2, 4 )
 PIXEL_AVG_C( pixel_avg_2x2,   2, 2 )
 
-static void x264_weight_cache( x264_t *h, x264_weight_t *w )
+static void weight_cache( x264_t *h, x264_weight_t *w )
 {
     w->weightfn = h->mc.weight;
 }
@@ -134,7 +134,7 @@ static void mc_weight( pixel *dst, intptr_t i_dst_stride, pixel *src, intptr_t i
 }
 
 #define MC_WEIGHT_C( name, width ) \
-    static void name( pixel *dst, intptr_t i_dst_stride, pixel *src, intptr_t i_src_stride, const x264_weight_t *weight, int height ) \
+static void name( pixel *dst, intptr_t i_dst_stride, pixel *src, intptr_t i_src_stride, const x264_weight_t *weight, int height ) \
 { \
     mc_weight( dst, i_dst_stride, src, i_src_stride, weight, width, height );\
 }
@@ -146,7 +146,7 @@ MC_WEIGHT_C( mc_weight_w8,   8 )
 MC_WEIGHT_C( mc_weight_w4,   4 )
 MC_WEIGHT_C( mc_weight_w2,   2 )
 
-static weight_fn_t x264_mc_weight_wtab[6] =
+static weight_fn_t mc_weight_wtab[6] =
 {
     mc_weight_w2,
     mc_weight_w4,
@@ -336,10 +336,10 @@ void x264_plane_copy_deinterleave_c( pixel *dsta, intptr_t i_dsta, pixel *dstb,
         }
 }
 
-static void x264_plane_copy_deinterleave_rgb_c( pixel *dsta, intptr_t i_dsta,
-                                                pixel *dstb, intptr_t i_dstb,
-                                                pixel *dstc, intptr_t i_dstc,
-                                                pixel *src,  intptr_t i_src, int pw, int w, int h )
+static void plane_copy_deinterleave_rgb_c( pixel *dsta, intptr_t i_dsta,
+                                           pixel *dstb, intptr_t i_dstb,
+                                           pixel *dstc, intptr_t i_dstc,
+                                           pixel *src,  intptr_t i_src, int pw, int w, int h )
 {
     for( int y=0; y<h; y++, dsta+=i_dsta, dstb+=i_dstb, dstc+=i_dstc, src+=i_src )
     {
@@ -361,9 +361,9 @@ static ALWAYS_INLINE uint32_t v210_endian_fix32( uint32_t x )
 #define v210_endian_fix32(x) (x)
 #endif
 
-static void x264_plane_copy_deinterleave_v210_c( pixel *dsty, intptr_t i_dsty,
-                                                 pixel *dstc, intptr_t i_dstc,
-                                                 uint32_t *src, intptr_t i_src, int w, int h )
+static void plane_copy_deinterleave_v210_c( pixel *dsty, intptr_t i_dsty,
+                                            pixel *dstc, intptr_t i_dstc,
+                                            uint32_t *src, intptr_t i_src, int w, int h )
 {
     for( int l = 0; l < h; l++ )
     {
@@ -630,10 +630,10 @@ void x264_mc_init( int cpu, x264_mc_functions_t *pf, int cpu_independent )
     pf->avg[PIXEL_2x4]  = pixel_avg_2x4;
     pf->avg[PIXEL_2x2]  = pixel_avg_2x2;
 
-    pf->weight    = x264_mc_weight_wtab;
-    pf->offsetadd = x264_mc_weight_wtab;
-    pf->offsetsub = x264_mc_weight_wtab;
-    pf->weight_cache = x264_weight_cache;
+    pf->weight    = mc_weight_wtab;
+    pf->offsetadd = mc_weight_wtab;
+    pf->offsetsub = mc_weight_wtab;
+    pf->weight_cache = weight_cache;
 
     pf->copy_16x16_unaligned = mc_copy_w16;
     pf->copy[PIXEL_16x16] = mc_copy_w16;
@@ -647,10 +647,11 @@ void x264_mc_init( int cpu, x264_mc_functions_t *pf, int cpu_independent )
     pf->plane_copy = x264_plane_copy_c;
     pf->plane_copy_swap = x264_plane_copy_swap_c;
     pf->plane_copy_interleave = x264_plane_copy_interleave_c;
+
     pf->plane_copy_deinterleave = x264_plane_copy_deinterleave_c;
     pf->plane_copy_deinterleave_yuyv = x264_plane_copy_deinterleave_c;
-    pf->plane_copy_deinterleave_rgb = x264_plane_copy_deinterleave_rgb_c;
-    pf->plane_copy_deinterleave_v210 = x264_plane_copy_deinterleave_v210_c;
+    pf->plane_copy_deinterleave_rgb = plane_copy_deinterleave_rgb_c;
+    pf->plane_copy_deinterleave_v210 = plane_copy_deinterleave_v210_c;
 
     pf->hpel_filter = hpel_filter;
 
index f3e7079d338339d70409133983383735148891c5..bbc8d27eea24903fb532bfe70232c0bb73ec4613 100644 (file)
@@ -39,9 +39,9 @@ void x264_mbtree_propagate_list_internal_##cpu( int16_t (*mvs)[2], int16_t *prop
                                                 uint16_t *lowres_costs, int16_t *output,\
                                                 int bipred_weight, int mb_y, int len );\
 \
-static void x264_mbtree_propagate_list_##cpu( x264_t *h, uint16_t *ref_costs, int16_t (*mvs)[2],\
-                                              int16_t *propagate_amount, uint16_t *lowres_costs,\
-                                              int bipred_weight, int mb_y, int len, int list )\
+static void mbtree_propagate_list_##cpu( x264_t *h, uint16_t *ref_costs, int16_t (*mvs)[2],\
+                                         int16_t *propagate_amount, uint16_t *lowres_costs,\
+                                         int bipred_weight, int mb_y, int len, int list )\
 {\
     int16_t *current = h->scratch_buffer2;\
 \
@@ -103,7 +103,7 @@ static void x264_mbtree_propagate_list_##cpu( x264_t *h, uint16_t *ref_costs, in
 void x264_plane_copy_c( pixel *, intptr_t, pixel *, intptr_t, int w, int h );
 
 #define PLANE_COPY(align, cpu)\
-static void x264_plane_copy_##cpu( pixel *dst, intptr_t i_dst, pixel *src, intptr_t i_src, int w, int h )\
+static void plane_copy_##cpu( pixel *dst, intptr_t i_dst, pixel *src, intptr_t i_src, int w, int h )\
 {\
     int c_w = (align) / sizeof(pixel) - 1;\
     if( w < 256 ) /* tiny resolutions don't want non-temporal hints. dunno the exact threshold. */\
@@ -131,7 +131,7 @@ static void x264_plane_copy_##cpu( pixel *dst, intptr_t i_dst, pixel *src, intpt
 void x264_plane_copy_swap_c( pixel *, intptr_t, pixel *, intptr_t, int w, int h );
 
 #define PLANE_COPY_SWAP(align, cpu)\
-static void x264_plane_copy_swap_##cpu( pixel *dst, intptr_t i_dst, pixel *src, intptr_t i_src, int w, int h )\
+static void plane_copy_swap_##cpu( pixel *dst, intptr_t i_dst, pixel *src, intptr_t i_src, int w, int h )\
 {\
     int c_w = (align>>1) / sizeof(pixel) - 1;\
     if( !(w&c_w) )\
@@ -166,8 +166,8 @@ void x264_plane_copy_deinterleave_c( pixel *dsta, intptr_t i_dsta, pixel *dstb,
 /* We can utilize existing plane_copy_deinterleave() functions for YUYV/UYUV
  * input with the additional constraint that we cannot overread src. */
 #define PLANE_COPY_YUYV(align, cpu)\
-static void x264_plane_copy_deinterleave_yuyv_##cpu( pixel *dsta, intptr_t i_dsta, pixel *dstb, intptr_t i_dstb,\
-                                                     pixel *src, intptr_t i_src, int w, int h )\
+static void plane_copy_deinterleave_yuyv_##cpu( pixel *dsta, intptr_t i_dsta, pixel *dstb, intptr_t i_dstb,\
+                                                pixel *src, intptr_t i_src, int w, int h )\
 {\
     int c_w = (align>>1) / sizeof(pixel) - 1;\
     if( !(w&c_w) )\
@@ -198,9 +198,9 @@ void x264_plane_copy_interleave_c( pixel *dst,  intptr_t i_dst,
                                    pixel *srcv, intptr_t i_srcv, int w, int h );
 
 #define PLANE_INTERLEAVE(cpu) \
-static void x264_plane_copy_interleave_##cpu( pixel *dst,  intptr_t i_dst,\
-                                              pixel *srcu, intptr_t i_srcu,\
-                                              pixel *srcv, intptr_t i_srcv, int w, int h )\
+static void plane_copy_interleave_##cpu( pixel *dst,  intptr_t i_dst,\
+                                         pixel *srcu, intptr_t i_srcu,\
+                                         pixel *srcv, intptr_t i_srcv, int w, int h )\
 {\
     int c_w = 16 / sizeof(pixel) - 1;\
     if( !(w&c_w) )\
index 0fa339e84e072ba7c859f3c5231316c351a0b561..51720731bdee2bc3e7054dd9f5143cebc6a91b51 100644 (file)
@@ -51,129 +51,6 @@ static const uint8_t pu_chroma_mask_arr[16 * 5] =
     0, 1, 1, 2, 16, 17, 17, 18, 16, 17, 17, 18, 18, 19, 19, 20
 };
 
-void x264_mc_copy_w16_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                           uint8_t *p_src, intptr_t i_src_stride,
-                           int32_t i_height );
-void x264_mc_copy_w8_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                          uint8_t *p_src, intptr_t i_src_stride,
-                          int32_t i_height );
-void x264_mc_copy_w4_msa( uint8_t *p_dst, intptr_t i_dst_stride, uint8_t *p_src,
-                          intptr_t i_src_stride, int32_t i_height );
-void x264_memzero_aligned_msa( void *p_dst, size_t n );
-
-void x264_pixel_avg_16x16_msa( uint8_t *p_pix1, intptr_t i_pix1_stride,
-                               uint8_t *p_pix2, intptr_t i_pix2_stride,
-                               uint8_t *p_pix3, intptr_t i_pix3_stride,
-                               int32_t i_weight );
-void x264_pixel_avg_16x8_msa( uint8_t *p_pix1, intptr_t i_pix1_stride,
-                              uint8_t *p_pix2, intptr_t i_pix2_stride,
-                              uint8_t *p_pix3, intptr_t i_pix3_stride,
-                              int32_t i_weight );
-void x264_pixel_avg_8x16_msa( uint8_t *p_pix1, intptr_t i_pix1_stride,
-                              uint8_t *p_pix2, intptr_t i_pix2_stride,
-                              uint8_t *p_pix3, intptr_t i_pix3_stride,
-                              int32_t i_weight );
-void x264_pixel_avg_8x8_msa( uint8_t *p_pix1, intptr_t i_pix1_stride,
-                             uint8_t *p_pix2, intptr_t i_pix2_stride,
-                             uint8_t *p_pix3, intptr_t i_pix3_stride,
-                             int32_t i_weight );
-void x264_pixel_avg_8x4_msa( uint8_t *p_pix1, intptr_t i_pix1_stride,
-                             uint8_t *p_pix2, intptr_t i_pix2_stride,
-                             uint8_t *p_pix3, intptr_t i_pix3_stride,
-                             int32_t i_weight );
-void x264_pixel_avg_4x16_msa( uint8_t *p_pix1, intptr_t pix1_stride,
-                              uint8_t *p_pix2, intptr_t pix2_stride,
-                              uint8_t *p_pix3, intptr_t pix3_stride,
-                              int32_t i_weight );
-void x264_pixel_avg_4x8_msa( uint8_t *p_pix1, intptr_t i_pix1_stride,
-                             uint8_t *p_pix2, intptr_t i_pix2_stride,
-                             uint8_t *p_pix3, intptr_t i_pix3_stride,
-                             int32_t i_weight );
-void x264_pixel_avg_4x4_msa( uint8_t *p_pix1, intptr_t i_pix1_stride,
-                             uint8_t *p_pix2, intptr_t i_pix2_stride,
-                             uint8_t *p_pix3, intptr_t i_pix3_stride,
-                             int32_t i_weight );
-void x264_pixel_avg_4x2_msa( uint8_t *p_pix1, intptr_t i_pix1_stride,
-                             uint8_t *p_pix2, intptr_t i_pix2_stride,
-                             uint8_t *p_pix3, intptr_t i_pix3_stride,
-                             int32_t i_weight );
-
-void x264_mc_weight_w20_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                             uint8_t *p_src, intptr_t i_src_stride,
-                             const x264_weight_t *pWeight, int32_t i_height );
-void x264_mc_weight_w4_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                            uint8_t *p_src, intptr_t i_src_stride,
-                            const x264_weight_t *pWeight, int32_t i_height );
-void x264_mc_weight_w8_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                            uint8_t *p_src, intptr_t i_src_stride,
-                            const x264_weight_t *pWeight, int32_t i_height );
-void x264_mc_weight_w16_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                             uint8_t *p_src, intptr_t i_src_stride,
-                             const x264_weight_t *pWeight, int32_t i_height );
-
-weight_fn_t x264_mc_weight_wtab_msa[6] =
-{
-    x264_mc_weight_w4_msa,
-    x264_mc_weight_w4_msa,
-    x264_mc_weight_w8_msa,
-    x264_mc_weight_w16_msa,
-    x264_mc_weight_w16_msa,
-    x264_mc_weight_w20_msa,
-};
-
-void x264_mc_luma_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                       uint8_t *p_src[4], intptr_t i_src_stride,
-                       int32_t m_vx, int32_t m_vy,
-                       int32_t i_width, int32_t i_height,
-                       const x264_weight_t *pWeight );
-uint8_t *x264_get_ref_msa( uint8_t *p_dst,   intptr_t *p_dst_stride,
-                           uint8_t *p_src[4], intptr_t i_src_stride,
-                           int32_t m_vx, int32_t m_vy,
-                           int32_t i_width, int32_t i_height,
-                           const x264_weight_t *pWeight );
-void x264_mc_chroma_msa( uint8_t *p_dst_u, uint8_t *p_dst_v,
-                         intptr_t i_dst_stride,
-                         uint8_t *p_src, intptr_t i_src_stride,
-                         int32_t m_vx, int32_t m_vy,
-                         int32_t i_width, int32_t i_height );
-void x264_hpel_filter_msa( uint8_t *p_dsth, uint8_t *p_dst_v,
-                           uint8_t *p_dstc, uint8_t *p_src,
-                           intptr_t i_stride, int32_t i_width,
-                           int32_t i_height, int16_t *p_buf );
-
-void x264_plane_copy_interleave_msa( uint8_t *p_dst,  intptr_t i_dst_stride,
-                                     uint8_t *p_src0, intptr_t i_src_stride0,
-                                     uint8_t *p_src1, intptr_t i_src_stride1,
-                                     int32_t i_width, int32_t i_height );
-void x264_plane_copy_deinterleave_msa( uint8_t *p_dst0, intptr_t i_dst_stride0,
-                                       uint8_t *p_dst1, intptr_t i_dst_stride1,
-                                       uint8_t *p_src,  intptr_t i_src_stride,
-                                       int32_t i_width, int32_t i_height );
-void x264_plane_copy_deinterleave_rgb_msa( uint8_t *p_dst0,
-                                           intptr_t i_dst_stride0,
-                                           uint8_t *p_dst1,
-                                           intptr_t i_dst_stride1,
-                                           uint8_t *p_dst2,
-                                           intptr_t i_dst_stride2,
-                                           uint8_t *p_src,
-                                           intptr_t i_src_stride,
-                                           int32_t i_src_width, int32_t i_width,
-                                           int32_t i_height );
-void x264_store_interleave_chroma_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                                       uint8_t *p_src0, uint8_t *p_src1,
-                                       int32_t i_height );
-void x264_load_deinterleave_chroma_fenc_msa( uint8_t *p_dst, uint8_t *p_src,
-                                             intptr_t i_src_stride,
-                                             int32_t i_height );
-void x264_load_deinterleave_chroma_fdec_msa( uint8_t *p_dst, uint8_t *p_src,
-                                             intptr_t i_src_stride,
-                                             int32_t i_height );
-void x264_frame_init_lowres_core_msa( uint8_t *p_src, uint8_t *p_dst0,
-                                      uint8_t *p_dst1, uint8_t *p_dst2,
-                                      uint8_t *p_dst3, intptr_t i_src_stride,
-                                      intptr_t i_dst_stride, int32_t i_width,
-                                      int32_t i_height );
-
 static void avc_luma_hz_16w_msa( uint8_t *p_src, int32_t i_src_stride,
                                  uint8_t *p_dst, int32_t i_dst_stride,
                                  int32_t i_height )
@@ -1861,10 +1738,10 @@ static void memset_zero_16width_msa( uint8_t *p_src, int32_t i_stride,
     }
 }
 
-static void plane_copy_interleave_msa( uint8_t *p_src0, int32_t i_src0_stride,
-                                       uint8_t *p_src1, int32_t i_src1_stride,
-                                       uint8_t *p_dst, int32_t i_dst_stride,
-                                       int32_t i_width, int32_t i_height )
+static void core_plane_copy_interleave_msa( uint8_t *p_src0, int32_t i_src0_stride,
+                                            uint8_t *p_src1, int32_t i_src1_stride,
+                                            uint8_t *p_dst, int32_t i_dst_stride,
+                                            int32_t i_width, int32_t i_height )
 {
     int32_t i_loop_width, i_loop_height, i_w_mul8, i_h4w;
     v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
@@ -1966,10 +1843,10 @@ static void plane_copy_interleave_msa( uint8_t *p_src0, int32_t i_src0_stride,
     }
 }
 
-static void plane_copy_deinterleave_msa( uint8_t *p_src, int32_t i_src_stride,
-                                         uint8_t *p_dst0, int32_t dst0_stride,
-                                         uint8_t *p_dst1, int32_t dst1_stride,
-                                         int32_t i_width, int32_t i_height )
+static void core_plane_copy_deinterleave_msa( uint8_t *p_src, int32_t i_src_stride,
+                                              uint8_t *p_dst0, int32_t dst0_stride,
+                                              uint8_t *p_dst1, int32_t dst1_stride,
+                                              int32_t i_width, int32_t i_height )
 {
     int32_t i_loop_width, i_loop_height, i_w_mul4, i_w_mul8, i_h4w;
     uint32_t u_res_w0, u_res_w1;
@@ -2098,16 +1975,16 @@ static void plane_copy_deinterleave_msa( uint8_t *p_src, int32_t i_src_stride,
 }
 
 
-static void plane_copy_deinterleave_rgb_msa( uint8_t *p_src,
-                                             int32_t i_src_stride,
-                                             uint8_t *p_dst0,
-                                             int32_t i_dst0_stride,
-                                             uint8_t *p_dst1,
-                                             int32_t i_dst1_stride,
-                                             uint8_t *p_dst2,
-                                             int32_t i_dst2_stride,
-                                             int32_t i_width,
-                                             int32_t i_height )
+static void core_plane_copy_deinterleave_rgb_msa( uint8_t *p_src,
+                                                  int32_t i_src_stride,
+                                                  uint8_t *p_dst0,
+                                                  int32_t i_dst0_stride,
+                                                  uint8_t *p_dst1,
+                                                  int32_t i_dst1_stride,
+                                                  uint8_t *p_dst2,
+                                                  int32_t i_dst2_stride,
+                                                  int32_t i_width,
+                                                  int32_t i_height )
 {
     uint8_t *p_src_orig = p_src;
     uint8_t *p_dst0_orig = p_dst0;
@@ -2234,16 +2111,16 @@ static void plane_copy_deinterleave_rgb_msa( uint8_t *p_src,
     }
 }
 
-static void plane_copy_deinterleave_rgba_msa( uint8_t *p_src,
-                                              int32_t i_src_stride,
-                                              uint8_t *p_dst0,
-                                              int32_t i_dst0_stride,
-                                              uint8_t *p_dst1,
-                                              int32_t i_dst1_stride,
-                                              uint8_t *p_dst2,
-                                              int32_t i_dst2_stride,
-                                              int32_t i_width,
-                                              int32_t i_height )
+static void core_plane_copy_deinterleave_rgba_msa( uint8_t *p_src,
+                                                   int32_t i_src_stride,
+                                                   uint8_t *p_dst0,
+                                                   int32_t i_dst0_stride,
+                                                   uint8_t *p_dst1,
+                                                   int32_t i_dst1_stride,
+                                                   uint8_t *p_dst2,
+                                                   int32_t i_dst2_stride,
+                                                   int32_t i_width,
+                                                   int32_t i_height )
 {
     uint8_t *p_src_orig = p_src;
     uint8_t *p_dst0_orig = p_dst0;
@@ -2441,10 +2318,10 @@ static void plane_copy_deinterleave_rgba_msa( uint8_t *p_src,
     }
 }
 
-static void store_interleave_chroma_msa( uint8_t *p_src0, int32_t i_src0_stride,
-                                         uint8_t *p_src1, int32_t i_src1_stride,
-                                         uint8_t *p_dst, int32_t i_dst_stride,
-                                         int32_t i_height )
+static void core_store_interleave_chroma_msa( uint8_t *p_src0, int32_t i_src0_stride,
+                                              uint8_t *p_src1, int32_t i_src1_stride,
+                                              uint8_t *p_dst, int32_t i_dst_stride,
+                                              int32_t i_height )
 {
     int32_t i_loop_height, i_h4w;
     v16u8 in0, in1, in2, in3, in4, in5, in6, in7;
@@ -2476,12 +2353,12 @@ static void store_interleave_chroma_msa( uint8_t *p_src0, int32_t i_src0_stride,
     }
 }
 
-static void frame_init_lowres_core_msa( uint8_t *p_src, int32_t i_src_stride,
-                                        uint8_t *p_dst0, int32_t dst0_stride,
-                                        uint8_t *p_dst1, int32_t dst1_stride,
-                                        uint8_t *p_dst2, int32_t dst2_stride,
-                                        uint8_t *p_dst3, int32_t dst3_stride,
-                                        int32_t i_width, int32_t i_height )
+static void core_frame_init_lowres_core_msa( uint8_t *p_src, int32_t i_src_stride,
+                                             uint8_t *p_dst0, int32_t dst0_stride,
+                                             uint8_t *p_dst1, int32_t dst1_stride,
+                                             uint8_t *p_dst2, int32_t dst2_stride,
+                                             uint8_t *p_dst3, int32_t dst3_stride,
+                                             int32_t i_width, int32_t i_height )
 {
     int32_t i_loop_width, i_loop_height, i_w16_mul;
     v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8;
@@ -2583,29 +2460,29 @@ static void frame_init_lowres_core_msa( uint8_t *p_src, int32_t i_src_stride,
     }
 }
 
-void x264_mc_copy_w16_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                           uint8_t *p_src, intptr_t i_src_stride,
-                           int32_t i_height )
+static void mc_copy_w16_msa( uint8_t *p_dst, intptr_t i_dst_stride,
+                             uint8_t *p_src, intptr_t i_src_stride,
+                             int32_t i_height )
 {
     copy_width16_msa( p_src, i_src_stride, p_dst, i_dst_stride, i_height );
 }
 
-void x264_mc_copy_w8_msa( uint8_t *p_dst, intptr_t i_dst_stride, uint8_t *p_src,
-                          intptr_t i_src_stride, int32_t i_height )
+static void mc_copy_w8_msa( uint8_t *p_dst, intptr_t i_dst_stride, uint8_t *p_src,
+                            intptr_t i_src_stride, int32_t i_height )
 {
     copy_width8_msa( p_src, i_src_stride, p_dst, i_dst_stride, i_height );
 }
 
-void x264_mc_copy_w4_msa( uint8_t *p_dst, intptr_t i_dst_stride, uint8_t *p_src,
-                          intptr_t i_src_stride, int32_t i_height )
+static void mc_copy_w4_msa( uint8_t *p_dst, intptr_t i_dst_stride, uint8_t *p_src,
+                            intptr_t i_src_stride, int32_t i_height )
 {
     copy_width4_msa( p_src, i_src_stride, p_dst, i_dst_stride, i_height );
 }
 
-void x264_pixel_avg_16x16_msa( uint8_t *p_pix1, intptr_t pix1_stride,
-                               uint8_t *p_pix2, intptr_t pix2_stride,
-                               uint8_t *p_pix3, intptr_t pix3_stride,
-                               int32_t i_weight )
+static void pixel_avg_16x16_msa( uint8_t *p_pix1, intptr_t pix1_stride,
+                                 uint8_t *p_pix2, intptr_t pix2_stride,
+                                 uint8_t *p_pix3, intptr_t pix3_stride,
+                                 int32_t i_weight )
 {
     if( 32 == i_weight )
     {
@@ -2630,10 +2507,10 @@ void x264_pixel_avg_16x16_msa( uint8_t *p_pix1, intptr_t pix1_stride,
     }
 }
 
-void x264_pixel_avg_16x8_msa( uint8_t *p_pix1, intptr_t pix1_stride,
-                              uint8_t *p_pix2, intptr_t pix2_stride,
-                              uint8_t *p_pix3, intptr_t pix3_stride,
-                              int32_t i_weight )
+static void pixel_avg_16x8_msa( uint8_t *p_pix1, intptr_t pix1_stride,
+                                uint8_t *p_pix2, intptr_t pix2_stride,
+                                uint8_t *p_pix3, intptr_t pix3_stride,
+                                int32_t i_weight )
 {
     if( 32 == i_weight )
     {
@@ -2658,10 +2535,10 @@ void x264_pixel_avg_16x8_msa( uint8_t *p_pix1, intptr_t pix1_stride,
     }
 }
 
-void x264_pixel_avg_8x16_msa( uint8_t *p_pix1, intptr_t pix1_stride,
-                              uint8_t *p_pix2, intptr_t pix2_stride,
-                              uint8_t *p_pix3, intptr_t pix3_stride,
-                              int32_t i_weight )
+static void pixel_avg_8x16_msa( uint8_t *p_pix1, intptr_t pix1_stride,
+                                uint8_t *p_pix2, intptr_t pix2_stride,
+                                uint8_t *p_pix3, intptr_t pix3_stride,
+                                int32_t i_weight )
 {
     if( 32 == i_weight )
     {
@@ -2684,10 +2561,10 @@ void x264_pixel_avg_8x16_msa( uint8_t *p_pix1, intptr_t pix1_stride,
     }
 }
 
-void x264_pixel_avg_8x8_msa( uint8_t *p_pix1, intptr_t pix1_stride,
-                             uint8_t *p_pix2, intptr_t pix2_stride,
-                             uint8_t *p_pix3, intptr_t pix3_stride,
-                             int32_t i_weight )
+static void pixel_avg_8x8_msa( uint8_t *p_pix1, intptr_t pix1_stride,
+                               uint8_t *p_pix2, intptr_t pix2_stride,
+                               uint8_t *p_pix3, intptr_t pix3_stride,
+                               int32_t i_weight )
 {
     if( 32 == i_weight )
     {
@@ -2710,10 +2587,10 @@ void x264_pixel_avg_8x8_msa( uint8_t *p_pix1, intptr_t pix1_stride,
     }
 }
 
-void x264_pixel_avg_8x4_msa( uint8_t *p_pix1, intptr_t pix1_stride,
-                             uint8_t *p_pix2, intptr_t pix2_stride,
-                             uint8_t *p_pix3, intptr_t pix3_stride,
-                             int32_t i_weight )
+static void pixel_avg_8x4_msa( uint8_t *p_pix1, intptr_t pix1_stride,
+                               uint8_t *p_pix2, intptr_t pix2_stride,
+                               uint8_t *p_pix3, intptr_t pix3_stride,
+                               int32_t i_weight )
 {
     if( 32 == i_weight )
     {
@@ -2736,10 +2613,10 @@ void x264_pixel_avg_8x4_msa( uint8_t *p_pix1, intptr_t pix1_stride,
     }
 }
 
-void x264_pixel_avg_4x16_msa( uint8_t *p_pix1, intptr_t pix1_stride,
-                              uint8_t *p_pix2, intptr_t pix2_stride,
-                              uint8_t *p_pix3, intptr_t pix3_stride,
-                              int32_t i_weight )
+static void pixel_avg_4x16_msa( uint8_t *p_pix1, intptr_t pix1_stride,
+                                uint8_t *p_pix2, intptr_t pix2_stride,
+                                uint8_t *p_pix3, intptr_t pix3_stride,
+                                int32_t i_weight )
 {
     if( 32 == i_weight )
     {
@@ -2762,10 +2639,10 @@ void x264_pixel_avg_4x16_msa( uint8_t *p_pix1, intptr_t pix1_stride,
     }
 }
 
-void x264_pixel_avg_4x8_msa( uint8_t *p_pix1, intptr_t pix1_stride,
-                             uint8_t *p_pix2, intptr_t pix2_stride,
-                             uint8_t *p_pix3, intptr_t pix3_stride,
-                             int32_t i_weight )
+static void pixel_avg_4x8_msa( uint8_t *p_pix1, intptr_t pix1_stride,
+                               uint8_t *p_pix2, intptr_t pix2_stride,
+                               uint8_t *p_pix3, intptr_t pix3_stride,
+                               int32_t i_weight )
 {
     if( 32 == i_weight )
     {
@@ -2788,10 +2665,10 @@ void x264_pixel_avg_4x8_msa( uint8_t *p_pix1, intptr_t pix1_stride,
     }
 }
 
-void x264_pixel_avg_4x4_msa( uint8_t *p_pix1, intptr_t pix1_stride,
-                             uint8_t *p_pix2, intptr_t pix2_stride,
-                             uint8_t *p_pix3, intptr_t pix3_stride,
-                             int32_t i_weight )
+static void pixel_avg_4x4_msa( uint8_t *p_pix1, intptr_t pix1_stride,
+                               uint8_t *p_pix2, intptr_t pix2_stride,
+                               uint8_t *p_pix3, intptr_t pix3_stride,
+                               int32_t i_weight )
 {
     if( 32 == i_weight )
     {
@@ -2814,10 +2691,10 @@ void x264_pixel_avg_4x4_msa( uint8_t *p_pix1, intptr_t pix1_stride,
     }
 }
 
-void x264_pixel_avg_4x2_msa( uint8_t *p_pix1, intptr_t pix1_stride,
-                             uint8_t *p_pix2, intptr_t pix2_stride,
-                             uint8_t *p_pix3, intptr_t pix3_stride,
-                             int32_t i_weight )
+static void pixel_avg_4x2_msa( uint8_t *p_pix1, intptr_t pix1_stride,
+                               uint8_t *p_pix2, intptr_t pix2_stride,
+                               uint8_t *p_pix3, intptr_t pix3_stride,
+                               int32_t i_weight )
 {
     if( 32 == i_weight )
     {
@@ -2841,7 +2718,7 @@ void x264_pixel_avg_4x2_msa( uint8_t *p_pix1, intptr_t pix1_stride,
 }
 
 
-void x264_memzero_aligned_msa( void *p_dst, size_t n )
+static void memzero_aligned_msa( void *p_dst, size_t n )
 {
     uint32_t u_tot32_mul_lines = n >> 5;
     uint32_t u_remaining = n - ( u_tot32_mul_lines << 5 );
@@ -2854,9 +2731,9 @@ void x264_memzero_aligned_msa( void *p_dst, size_t n )
     }
 }
 
-void x264_mc_weight_w4_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                            uint8_t *p_src, intptr_t i_src_stride,
-                            const x264_weight_t *pWeight, int32_t i_height )
+static void mc_weight_w4_msa( uint8_t *p_dst, intptr_t i_dst_stride,
+                              uint8_t *p_src, intptr_t i_src_stride,
+                              const x264_weight_t *pWeight, int32_t i_height )
 {
     int32_t i_log2_denom = pWeight->i_denom;
     int32_t i_offset = pWeight->i_offset;
@@ -2866,9 +2743,9 @@ void x264_mc_weight_w4_msa( uint8_t *p_dst, intptr_t i_dst_stride,
                                 i_height, i_log2_denom, i_weight, i_offset );
 }
 
-void x264_mc_weight_w8_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                            uint8_t *p_src, intptr_t i_src_stride,
-                            const x264_weight_t *pWeight, int32_t i_height )
+static void mc_weight_w8_msa( uint8_t *p_dst, intptr_t i_dst_stride,
+                              uint8_t *p_src, intptr_t i_src_stride,
+                              const x264_weight_t *pWeight, int32_t i_height )
 {
     int32_t i_log2_denom = pWeight->i_denom;
     int32_t i_offset = pWeight->i_offset;
@@ -2878,9 +2755,9 @@ void x264_mc_weight_w8_msa( uint8_t *p_dst, intptr_t i_dst_stride,
                                 i_height, i_log2_denom, i_weight, i_offset );
 }
 
-void x264_mc_weight_w16_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                             uint8_t *p_src, intptr_t i_src_stride,
-                             const x264_weight_t *pWeight, int32_t i_height )
+static void mc_weight_w16_msa( uint8_t *p_dst, intptr_t i_dst_stride,
+                               uint8_t *p_src, intptr_t i_src_stride,
+                               const x264_weight_t *pWeight, int32_t i_height )
 {
     int32_t i_log2_denom = pWeight->i_denom;
     int32_t i_offset = pWeight->i_offset;
@@ -2890,21 +2767,21 @@ void x264_mc_weight_w16_msa( uint8_t *p_dst, intptr_t i_dst_stride,
                                  i_height, i_log2_denom, i_weight, i_offset );
 }
 
-void x264_mc_weight_w20_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                             uint8_t *p_src, intptr_t i_src_stride,
-                             const x264_weight_t *pWeight, int32_t i_height )
+static void mc_weight_w20_msa( uint8_t *p_dst, intptr_t i_dst_stride,
+                               uint8_t *p_src, intptr_t i_src_stride,
+                               const x264_weight_t *pWeight, int32_t i_height )
 {
-    x264_mc_weight_w16_msa( p_dst, i_dst_stride, p_src, i_src_stride,
-                            pWeight, i_height );
-    x264_mc_weight_w4_msa( p_dst + 16, i_dst_stride, p_src + 16, i_src_stride,
-                           pWeight, i_height );
+    mc_weight_w16_msa( p_dst, i_dst_stride, p_src, i_src_stride,
+                       pWeight, i_height );
+    mc_weight_w4_msa( p_dst + 16, i_dst_stride, p_src + 16, i_src_stride,
+                      pWeight, i_height );
 }
 
-void x264_mc_luma_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                       uint8_t *p_src[4], intptr_t i_src_stride,
-                       int32_t m_vx, int32_t m_vy,
-                       int32_t i_width, int32_t i_height,
-                       const x264_weight_t *pWeight )
+static void mc_luma_msa( uint8_t *p_dst, intptr_t i_dst_stride,
+                         uint8_t *p_src[4], intptr_t i_src_stride,
+                         int32_t m_vx, int32_t m_vy,
+                         int32_t i_width, int32_t i_height,
+                         const x264_weight_t *pWeight )
 {
     int32_t  i_qpel_idx;
     int32_t  i_offset;
@@ -2940,19 +2817,19 @@ void x264_mc_luma_msa( uint8_t *p_dst, intptr_t i_dst_stride,
         {
             if( 16 == i_width )
             {
-                x264_mc_weight_w16_msa( p_dst, i_dst_stride,
-                                        p_dst, i_dst_stride,
-                                        pWeight, i_height );
+                mc_weight_w16_msa( p_dst, i_dst_stride,
+                                   p_dst, i_dst_stride,
+                                   pWeight, i_height );
             }
             else if( 8 == i_width )
             {
-                x264_mc_weight_w8_msa( p_dst, i_dst_stride, p_dst, i_dst_stride,
-                                       pWeight, i_height );
+                mc_weight_w8_msa( p_dst, i_dst_stride, p_dst, i_dst_stride,
+                                  pWeight, i_height );
             }
             else if( 4 == i_width )
             {
-                x264_mc_weight_w4_msa( p_dst, i_dst_stride, p_dst, i_dst_stride,
-                                       pWeight, i_height );
+                mc_weight_w4_msa( p_dst, i_dst_stride, p_dst, i_dst_stride,
+                                  pWeight, i_height );
             }
         }
     }
@@ -2960,18 +2837,18 @@ void x264_mc_luma_msa( uint8_t *p_dst, intptr_t i_dst_stride,
     {
         if( 16 == i_width )
         {
-            x264_mc_weight_w16_msa( p_dst, i_dst_stride, p_src1, i_src_stride,
-                                    pWeight, i_height );
+            mc_weight_w16_msa( p_dst, i_dst_stride, p_src1, i_src_stride,
+                               pWeight, i_height );
         }
         else if( 8 == i_width )
         {
-            x264_mc_weight_w8_msa( p_dst, i_dst_stride, p_src1, i_src_stride,
-                                   pWeight, i_height );
+            mc_weight_w8_msa( p_dst, i_dst_stride, p_src1, i_src_stride,
+                              pWeight, i_height );
         }
         else if( 4 == i_width )
         {
-            x264_mc_weight_w4_msa( p_dst, i_dst_stride, p_src1, i_src_stride,
-                                   pWeight, i_height );
+            mc_weight_w4_msa( p_dst, i_dst_stride, p_src1, i_src_stride,
+                              pWeight, i_height );
         }
     }
     else
@@ -2994,11 +2871,11 @@ void x264_mc_luma_msa( uint8_t *p_dst, intptr_t i_dst_stride,
     }
 }
 
-void x264_mc_chroma_msa( uint8_t *p_dst_u, uint8_t *p_dst_v,
-                         intptr_t i_dst_stride,
-                         uint8_t *p_src, intptr_t i_src_stride,
-                         int32_t m_vx, int32_t m_vy,
-                         int32_t i_width, int32_t i_height )
+static void mc_chroma_msa( uint8_t *p_dst_u, uint8_t *p_dst_v,
+                           intptr_t i_dst_stride,
+                           uint8_t *p_src, intptr_t i_src_stride,
+                           int32_t m_vx, int32_t m_vy,
+                           int32_t i_width, int32_t i_height )
 {
     int32_t i_d8x = m_vx & 0x07;
     int32_t i_d8y = m_vy & 0x07;
@@ -3035,10 +2912,10 @@ void x264_mc_chroma_msa( uint8_t *p_dst_u, uint8_t *p_dst_v,
     }
 }
 
-void x264_hpel_filter_msa( uint8_t *p_dsth, uint8_t *p_dst_v,
-                           uint8_t *p_dstc, uint8_t *p_src,
-                           intptr_t i_stride, int32_t i_width,
-                           int32_t i_height, int16_t *p_buf )
+static void hpel_filter_msa( uint8_t *p_dsth, uint8_t *p_dst_v,
+                             uint8_t *p_dstc, uint8_t *p_src,
+                             intptr_t i_stride, int32_t i_width,
+                             int32_t i_height, int16_t *p_buf )
 {
     for( int32_t i = 0; i < ( i_width / 16 ); i++ )
     {
@@ -3055,96 +2932,96 @@ void x264_hpel_filter_msa( uint8_t *p_dsth, uint8_t *p_dst_v,
     }
 }
 
-void x264_plane_copy_interleave_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                                     uint8_t *p_src0, intptr_t i_src_stride0,
-                                     uint8_t *p_src1, intptr_t i_src_stride1,
-                                     int32_t i_width, int32_t i_height )
+static void plane_copy_interleave_msa( uint8_t *p_dst, intptr_t i_dst_stride,
+                                       uint8_t *p_src0, intptr_t i_src_stride0,
+                                       uint8_t *p_src1, intptr_t i_src_stride1,
+                                       int32_t i_width, int32_t i_height )
 {
-    plane_copy_interleave_msa( p_src0, i_src_stride0, p_src1, i_src_stride1,
-                               p_dst, i_dst_stride, i_width, i_height );
+    core_plane_copy_interleave_msa( p_src0, i_src_stride0, p_src1, i_src_stride1,
+                                    p_dst, i_dst_stride, i_width, i_height );
 }
 
-void x264_plane_copy_deinterleave_msa( uint8_t *p_dst0, intptr_t i_dst_stride0,
-                                       uint8_t *p_dst1, intptr_t i_dst_stride1,
-                                       uint8_t *p_src, intptr_t i_src_stride,
-                                       int32_t i_width, int32_t i_height )
+static void plane_copy_deinterleave_msa( uint8_t *p_dst0, intptr_t i_dst_stride0,
+                                         uint8_t *p_dst1, intptr_t i_dst_stride1,
+                                         uint8_t *p_src, intptr_t i_src_stride,
+                                         int32_t i_width, int32_t i_height )
 {
-    plane_copy_deinterleave_msa( p_src, i_src_stride, p_dst0, i_dst_stride0,
-                                 p_dst1, i_dst_stride1, i_width, i_height );
+    core_plane_copy_deinterleave_msa( p_src, i_src_stride, p_dst0, i_dst_stride0,
+                                      p_dst1, i_dst_stride1, i_width, i_height );
 }
 
-void x264_plane_copy_deinterleave_rgb_msa( uint8_t *p_dst0,
-                                           intptr_t i_dst_stride0,
-                                           uint8_t *p_dst1,
-                                           intptr_t i_dst_stride1,
-                                           uint8_t *p_dst2,
-                                           intptr_t i_dst_stride2,
-                                           uint8_t *p_src,
-                                           intptr_t i_src_stride,
-                                           int32_t i_src_width,
-                                           int32_t i_width,
-                                           int32_t i_height )
+static void plane_copy_deinterleave_rgb_msa( uint8_t *p_dst0,
+                                             intptr_t i_dst_stride0,
+                                             uint8_t *p_dst1,
+                                             intptr_t i_dst_stride1,
+                                             uint8_t *p_dst2,
+                                             intptr_t i_dst_stride2,
+                                             uint8_t *p_src,
+                                             intptr_t i_src_stride,
+                                             int32_t i_src_width,
+                                             int32_t i_width,
+                                             int32_t i_height )
 {
     if( 3 == i_src_width )
     {
-        plane_copy_deinterleave_rgb_msa( p_src, i_src_stride,
-                                         p_dst0, i_dst_stride0,
-                                         p_dst1, i_dst_stride1,
-                                         p_dst2, i_dst_stride2,
-                                         i_width, i_height );
+        core_plane_copy_deinterleave_rgb_msa( p_src, i_src_stride,
+                                              p_dst0, i_dst_stride0,
+                                              p_dst1, i_dst_stride1,
+                                              p_dst2, i_dst_stride2,
+                                              i_width, i_height );
     }
     else if( 4 == i_src_width )
     {
-        plane_copy_deinterleave_rgba_msa( p_src, i_src_stride,
-                                          p_dst0, i_dst_stride0,
-                                          p_dst1, i_dst_stride1,
-                                          p_dst2, i_dst_stride2,
-                                          i_width, i_height );
+        core_plane_copy_deinterleave_rgba_msa( p_src, i_src_stride,
+                                               p_dst0, i_dst_stride0,
+                                               p_dst1, i_dst_stride1,
+                                               p_dst2, i_dst_stride2,
+                                               i_width, i_height );
     }
 }
 
-void x264_store_interleave_chroma_msa( uint8_t *p_dst, intptr_t i_dst_stride,
-                                       uint8_t *p_src0, uint8_t *p_src1,
-                                       int32_t i_height )
+static void store_interleave_chroma_msa( uint8_t *p_dst, intptr_t i_dst_stride,
+                                         uint8_t *p_src0, uint8_t *p_src1,
+                                         int32_t i_height )
 {
-    store_interleave_chroma_msa( p_src0, FDEC_STRIDE, p_src1, FDEC_STRIDE,
-                                 p_dst, i_dst_stride, i_height );
+    core_store_interleave_chroma_msa( p_src0, FDEC_STRIDE, p_src1, FDEC_STRIDE,
+                                      p_dst, i_dst_stride, i_height );
 }
 
-void x264_load_deinterleave_chroma_fenc_msa( uint8_t *p_dst, uint8_t *p_src,
-                                             intptr_t i_src_stride,
-                                             int32_t i_height )
+static void load_deinterleave_chroma_fenc_msa( uint8_t *p_dst, uint8_t *p_src,
+                                               intptr_t i_src_stride,
+                                               int32_t i_height )
 {
-    plane_copy_deinterleave_msa( p_src, i_src_stride, p_dst, FENC_STRIDE,
-                                 ( p_dst + ( FENC_STRIDE / 2 ) ), FENC_STRIDE,
-                                 8, i_height );
+    core_plane_copy_deinterleave_msa( p_src, i_src_stride, p_dst, FENC_STRIDE,
+                                     ( p_dst + ( FENC_STRIDE / 2 ) ), FENC_STRIDE,
+                                     8, i_height );
 }
 
-void x264_load_deinterleave_chroma_fdec_msa( uint8_t *p_dst, uint8_t *p_src,
-                                             intptr_t i_src_stride,
-                                             int32_t i_height )
+static void load_deinterleave_chroma_fdec_msa( uint8_t *p_dst, uint8_t *p_src,
+                                               intptr_t i_src_stride,
+                                               int32_t i_height )
 {
-    plane_copy_deinterleave_msa( p_src, i_src_stride, p_dst, FDEC_STRIDE,
-                                 ( p_dst + ( FDEC_STRIDE / 2 ) ), FDEC_STRIDE,
-                                 8, i_height );
+    core_plane_copy_deinterleave_msa( p_src, i_src_stride, p_dst, FDEC_STRIDE,
+                                      ( p_dst + ( FDEC_STRIDE / 2 ) ), FDEC_STRIDE,
+                                      8, i_height );
 }
 
-void x264_frame_init_lowres_core_msa( uint8_t *p_src, uint8_t *p_dst0,
-                                      uint8_t *p_dst1, uint8_t *p_dst2,
-                                      uint8_t *p_dst3, intptr_t i_src_stride,
-                                      intptr_t i_dst_stride, int32_t i_width,
-                                      int32_t i_height )
+static void frame_init_lowres_core_msa( uint8_t *p_src, uint8_t *p_dst0,
+                                        uint8_t *p_dst1, uint8_t *p_dst2,
+                                        uint8_t *p_dst3, intptr_t i_src_stride,
+                                        intptr_t i_dst_stride, int32_t i_width,
+                                        int32_t i_height )
 {
-    frame_init_lowres_core_msa( p_src, i_src_stride, p_dst0, i_dst_stride,
-                                p_dst1, i_dst_stride, p_dst2, i_dst_stride,
-                                p_dst3, i_dst_stride, i_width, i_height );
+    core_frame_init_lowres_core_msa( p_src, i_src_stride, p_dst0, i_dst_stride,
+                                     p_dst1, i_dst_stride, p_dst2, i_dst_stride,
+                                     p_dst3, i_dst_stride, i_width, i_height );
 }
 
-uint8_t *x264_get_ref_msa( uint8_t *p_dst, intptr_t *p_dst_stride,
-                           uint8_t *p_src[4], intptr_t i_src_stride,
-                           int32_t m_vx, int32_t m_vy,
-                           int32_t i_width, int32_t i_height,
-                           const x264_weight_t *pWeight )
+static uint8_t *get_ref_msa( uint8_t *p_dst, intptr_t *p_dst_stride,
+                             uint8_t *p_src[4], intptr_t i_src_stride,
+                             int32_t m_vx, int32_t m_vy,
+                             int32_t i_width, int32_t i_height,
+                             const x264_weight_t *pWeight )
 {
     int32_t i_qpel_idx, i_cnt, i_h4w;
     int32_t i_offset;
@@ -3289,9 +3166,9 @@ uint8_t *x264_get_ref_msa( uint8_t *p_dst, intptr_t *p_dst_stride,
 
             if( 16 == i_width || 12 == i_width )
             {
-                x264_mc_weight_w16_msa( p_dst, *p_dst_stride,
-                                        p_dst, *p_dst_stride,
-                                        pWeight, i_h4w );
+                mc_weight_w16_msa( p_dst, *p_dst_stride,
+                                   p_dst, *p_dst_stride,
+                                   pWeight, i_h4w );
                 for( i_cnt = i_h4w; i_cnt < i_height; i_cnt++ )
                 {
                     v16i8 zero = {0};
@@ -3349,9 +3226,9 @@ uint8_t *x264_get_ref_msa( uint8_t *p_dst, intptr_t *p_dst_stride,
             }
             else if( 20 == i_width )
             {
-                x264_mc_weight_w20_msa( p_dst, *p_dst_stride,
-                                        p_dst, *p_dst_stride,
-                                        pWeight, i_h4w );
+                mc_weight_w20_msa( p_dst, *p_dst_stride,
+                                   p_dst, *p_dst_stride,
+                                   pWeight, i_h4w );
                 for( i_cnt = i_h4w; i_cnt < i_height; i_cnt++ )
                 {
                     uint32_t temp0;
@@ -3427,9 +3304,9 @@ uint8_t *x264_get_ref_msa( uint8_t *p_dst, intptr_t *p_dst_stride,
             }
             else if( 8 == i_width )
             {
-                x264_mc_weight_w8_msa( p_dst, *p_dst_stride,
-                                       p_dst, *p_dst_stride,
-                                       pWeight, i_h4w );
+                mc_weight_w8_msa( p_dst, *p_dst_stride,
+                                  p_dst, *p_dst_stride,
+                                  pWeight, i_h4w );
                 for( i_cnt = i_h4w; i_cnt < i_height; i_cnt++ )
                 {
                     uint64_t temp0;
@@ -3473,9 +3350,9 @@ uint8_t *x264_get_ref_msa( uint8_t *p_dst, intptr_t *p_dst_stride,
             }
             else if( 4 == i_width )
             {
-                x264_mc_weight_w4_msa( p_dst, *p_dst_stride,
-                                       p_dst, *p_dst_stride,
-                                       pWeight, i_h4w );
+                mc_weight_w4_msa( p_dst, *p_dst_stride,
+                                  p_dst, *p_dst_stride,
+                                  pWeight, i_h4w );
                 for( i_cnt = i_h4w; i_cnt < i_height; i_cnt++ )
                 {
                     uint32_t temp0;
@@ -3537,8 +3414,8 @@ uint8_t *x264_get_ref_msa( uint8_t *p_dst, intptr_t *p_dst_stride,
 
         if( 16 == i_width || 12 == i_width )
         {
-            x264_mc_weight_w16_msa( p_dst, *p_dst_stride, p_src1, i_src_stride,
-                                    pWeight, i_h4w );
+            mc_weight_w16_msa( p_dst, *p_dst_stride, p_src1, i_src_stride,
+                               pWeight, i_h4w );
             p_src1 = src1_org + i_h4w * i_src_stride;
 
             for( i_cnt = i_h4w; i_cnt < i_height; i_cnt++ )
@@ -3591,8 +3468,8 @@ uint8_t *x264_get_ref_msa( uint8_t *p_dst, intptr_t *p_dst_stride,
         }
         else if( 20 == i_width )
         {
-            x264_mc_weight_w20_msa( p_dst, *p_dst_stride, p_src1, i_src_stride,
-                                    pWeight, i_h4w );
+            mc_weight_w20_msa( p_dst, *p_dst_stride, p_src1, i_src_stride,
+                               pWeight, i_h4w );
             p_src1 = src1_org + i_h4w * i_src_stride;
 
             for( i_cnt = i_h4w; i_cnt < i_height; i_cnt++ )
@@ -3662,8 +3539,8 @@ uint8_t *x264_get_ref_msa( uint8_t *p_dst, intptr_t *p_dst_stride,
         }
         else if( 8 == i_width )
         {
-            x264_mc_weight_w8_msa( p_dst, *p_dst_stride, p_src1, i_src_stride,
-                                   pWeight, i_h4w );
+            mc_weight_w8_msa( p_dst, *p_dst_stride, p_src1, i_src_stride,
+                              pWeight, i_h4w );
             p_src1 = src1_org + i_h4w * i_src_stride;
 
             for( i_cnt = i_h4w; i_cnt < i_height; i_cnt++ )
@@ -3707,8 +3584,8 @@ uint8_t *x264_get_ref_msa( uint8_t *p_dst, intptr_t *p_dst_stride,
         }
         else if( 4 == i_width )
         {
-            x264_mc_weight_w4_msa( p_dst, *p_dst_stride, p_src1, i_src_stride,
-                                   pWeight, i_h4w );
+            mc_weight_w4_msa( p_dst, *p_dst_stride, p_src1, i_src_stride,
+                              pWeight, i_h4w );
             p_src1 = src1_org + i_h4w * i_src_stride;
 
             for( i_cnt = i_h4w; i_cnt < i_height; i_cnt++ )
@@ -3761,6 +3638,16 @@ uint8_t *x264_get_ref_msa( uint8_t *p_dst, intptr_t *p_dst_stride,
         return p_src1;
     }
 }
+
+static weight_fn_t mc_weight_wtab_msa[6] =
+{
+    mc_weight_w4_msa,
+    mc_weight_w4_msa,
+    mc_weight_w8_msa,
+    mc_weight_w16_msa,
+    mc_weight_w16_msa,
+    mc_weight_w20_msa,
+};
 #endif // !HIGH_BIT_DEPTH
 
 void x264_mc_init_mips( int32_t cpu, x264_mc_functions_t *pf  )
@@ -3768,42 +3655,42 @@ void x264_mc_init_mips( int32_t cpu, x264_mc_functions_t *pf  )
 #if !HIGH_BIT_DEPTH
     if( cpu & X264_CPU_MSA )
     {
-        pf->mc_luma = x264_mc_luma_msa;
-        pf->mc_chroma = x264_mc_chroma_msa;
-        pf->get_ref = x264_get_ref_msa;
+        pf->mc_luma = mc_luma_msa;
+        pf->mc_chroma = mc_chroma_msa;
+        pf->get_ref = get_ref_msa;
 
-        pf->avg[PIXEL_16x16]= x264_pixel_avg_16x16_msa;
-        pf->avg[PIXEL_16x8] = x264_pixel_avg_16x8_msa;
-        pf->avg[PIXEL_8x16] = x264_pixel_avg_8x16_msa;
-        pf->avg[PIXEL_8x8] = x264_pixel_avg_8x8_msa;
-        pf->avg[PIXEL_8x4] = x264_pixel_avg_8x4_msa;
-        pf->avg[PIXEL_4x16] = x264_pixel_avg_4x16_msa;
-        pf->avg[PIXEL_4x8] = x264_pixel_avg_4x8_msa;
-        pf->avg[PIXEL_4x4] = x264_pixel_avg_4x4_msa;
-        pf->avg[PIXEL_4x2] = x264_pixel_avg_4x2_msa;
+        pf->avg[PIXEL_16x16]= pixel_avg_16x16_msa;
+        pf->avg[PIXEL_16x8] = pixel_avg_16x8_msa;
+        pf->avg[PIXEL_8x16] = pixel_avg_8x16_msa;
+        pf->avg[PIXEL_8x8] = pixel_avg_8x8_msa;
+        pf->avg[PIXEL_8x4] = pixel_avg_8x4_msa;
+        pf->avg[PIXEL_4x16] = pixel_avg_4x16_msa;
+        pf->avg[PIXEL_4x8] = pixel_avg_4x8_msa;
+        pf->avg[PIXEL_4x4] = pixel_avg_4x4_msa;
+        pf->avg[PIXEL_4x2] = pixel_avg_4x2_msa;
 
-        pf->weight = x264_mc_weight_wtab_msa;
-        pf->offsetadd = x264_mc_weight_wtab_msa;
-        pf->offsetsub = x264_mc_weight_wtab_msa;
+        pf->weight = mc_weight_wtab_msa;
+        pf->offsetadd = mc_weight_wtab_msa;
+        pf->offsetsub = mc_weight_wtab_msa;
 
-        pf->copy_16x16_unaligned = x264_mc_copy_w16_msa;
-        pf->copy[PIXEL_16x16] = x264_mc_copy_w16_msa;
-        pf->copy[PIXEL_8x8] = x264_mc_copy_w8_msa;
-        pf->copy[PIXEL_4x4] = x264_mc_copy_w4_msa;
+        pf->copy_16x16_unaligned = mc_copy_w16_msa;
+        pf->copy[PIXEL_16x16] = mc_copy_w16_msa;
+        pf->copy[PIXEL_8x8] = mc_copy_w8_msa;
+        pf->copy[PIXEL_4x4] = mc_copy_w4_msa;
 
-        pf->store_interleave_chroma = x264_store_interleave_chroma_msa;
-        pf->load_deinterleave_chroma_fenc = x264_load_deinterleave_chroma_fenc_msa;
-        pf->load_deinterleave_chroma_fdec = x264_load_deinterleave_chroma_fdec_msa;
+        pf->store_interleave_chroma = store_interleave_chroma_msa;
+        pf->load_deinterleave_chroma_fenc = load_deinterleave_chroma_fenc_msa;
+        pf->load_deinterleave_chroma_fdec = load_deinterleave_chroma_fdec_msa;
 
-        pf->plane_copy_interleave = x264_plane_copy_interleave_msa;
-        pf->plane_copy_deinterleave = x264_plane_copy_deinterleave_msa;
-        pf->plane_copy_deinterleave_rgb = x264_plane_copy_deinterleave_rgb_msa;
+        pf->plane_copy_interleave = plane_copy_interleave_msa;
+        pf->plane_copy_deinterleave = plane_copy_deinterleave_msa;
+        pf->plane_copy_deinterleave_rgb = plane_copy_deinterleave_rgb_msa;
 
-        pf->hpel_filter = x264_hpel_filter_msa;
+        pf->hpel_filter = hpel_filter_msa;
 
         pf->memcpy_aligned = memcpy;
-        pf->memzero_aligned = x264_memzero_aligned_msa;
-        pf->frame_init_lowres_core = x264_frame_init_lowres_core_msa;
+        pf->memzero_aligned = memzero_aligned_msa;
+        pf->frame_init_lowres_core = frame_init_lowres_core_msa;
     }
 #endif // !HIGH_BIT_DEPTH
 }
index a7e34487952eb5c5f553f3ea23cfa6e5e441c6d2..5fbe0d6f61347de3689234580d186a45d348066e 100644 (file)
@@ -180,7 +180,7 @@ void x264_mb_predict_mv_pskip( x264_t *h, int16_t mv[2] )
         x264_mb_predict_mv_16x16( h, 0, 0, mv );
 }
 
-static int x264_mb_predict_mv_direct16x16_temporal( x264_t *h )
+static int mb_predict_mv_direct16x16_temporal( x264_t *h )
 {
     int mb_x = h->mb.i_mb_x;
     int mb_y = h->mb.i_mb_y;
@@ -286,7 +286,7 @@ static int x264_mb_predict_mv_direct16x16_temporal( x264_t *h )
     return 1;
 }
 
-static ALWAYS_INLINE int x264_mb_predict_mv_direct16x16_spatial( x264_t *h, int b_interlaced )
+static ALWAYS_INLINE int mb_predict_mv_direct16x16_spatial( x264_t *h, int b_interlaced )
 {
     int8_t ref[2];
     ALIGNED_ARRAY_8( int16_t, mv,[2],[2] );
@@ -441,14 +441,14 @@ static ALWAYS_INLINE int x264_mb_predict_mv_direct16x16_spatial( x264_t *h, int
 }
 
 
-static int x264_mb_predict_mv_direct16x16_spatial_interlaced( x264_t *h )
+static int mb_predict_mv_direct16x16_spatial_interlaced( x264_t *h )
 {
-    return x264_mb_predict_mv_direct16x16_spatial( h, 1 );
+    return mb_predict_mv_direct16x16_spatial( h, 1 );
 }
 
-static int x264_mb_predict_mv_direct16x16_spatial_progressive( x264_t *h )
+static int mb_predict_mv_direct16x16_spatial_progressive( x264_t *h )
 {
-    return x264_mb_predict_mv_direct16x16_spatial( h, 0 );
+    return mb_predict_mv_direct16x16_spatial( h, 0 );
 }
 
 int x264_mb_predict_mv_direct16x16( x264_t *h, int *b_changed )
@@ -459,12 +459,12 @@ int x264_mb_predict_mv_direct16x16( x264_t *h, int *b_changed )
     else if( h->sh.b_direct_spatial_mv_pred )
     {
         if( SLICE_MBAFF )
-            b_available = x264_mb_predict_mv_direct16x16_spatial_interlaced( h );
+            b_available = mb_predict_mv_direct16x16_spatial_interlaced( h );
         else
-            b_available = x264_mb_predict_mv_direct16x16_spatial_progressive( h );
+            b_available = mb_predict_mv_direct16x16_spatial_progressive( h );
     }
     else
-        b_available = x264_mb_predict_mv_direct16x16_temporal( h );
+        b_available = mb_predict_mv_direct16x16_temporal( h );
 
     if( b_changed != NULL && b_available )
     {
index 7f26ed98c94273568b8d490e7d7de9f370561d8c..3c11aef7bbe2ab7fec1ce7dea0609c18522ff69b 100644 (file)
@@ -115,11 +115,11 @@ void x264_opencl_close_library( x264_opencl_function_t *ocl )
 /* Requires full include path in case of out-of-tree builds */
 #include "common/oclobj.h"
 
-static int x264_detect_switchable_graphics( void );
+static int detect_switchable_graphics( void );
 
 /* Try to load the cached compiled program binary, verify the device context is
  * still valid before reuse */
-static cl_program x264_opencl_cache_load( x264_t *h, const char *dev_name, const char *dev_vendor, const char *driver_version )
+static cl_program opencl_cache_load( x264_t *h, const char *dev_name, const char *dev_vendor, const char *driver_version )
 {
     /* try to load cached program binary */
     FILE *fp = x264_fopen( h->param.psz_clbin_file, "rb" );
@@ -168,7 +168,7 @@ fail:
 
 /* Save the compiled program binary to a file for later reuse.  Device context
  * is also saved in the cache file so we do not reuse stale binaries */
-static void x264_opencl_cache_save( x264_t *h, cl_program program, const char *dev_name, const char *dev_vendor, const char *driver_version )
+static void opencl_cache_save( x264_t *h, cl_program program, const char *dev_name, const char *dev_vendor, const char *driver_version )
 {
     FILE *fp = x264_fopen( h->param.psz_clbin_file, "wb" );
     if( !fp )
@@ -216,7 +216,7 @@ fail:
  * the Makefile. It defines a x264_opencl_source byte array which we will pass
  * to clCreateProgramWithSource().  We also attempt to use a cache file for the
  * compiled binary, stored in the current working folder. */
-static cl_program x264_opencl_compile( x264_t *h )
+static cl_program opencl_compile( x264_t *h )
 {
     x264_opencl_function_t *ocl = h->opencl.ocl;
     cl_program program = NULL;
@@ -239,7 +239,7 @@ static cl_program x264_opencl_compile( x264_t *h )
     if( vectorize )
     {
         /* Disable OpenCL on Intel/AMD switchable graphics devices */
-        if( x264_detect_switchable_graphics() )
+        if( detect_switchable_graphics() )
         {
             x264_log( h, X264_LOG_INFO, "OpenCL acceleration disabled, switchable graphics detected\n" );
             return NULL;
@@ -257,7 +257,7 @@ static cl_program x264_opencl_compile( x264_t *h )
 
     x264_log( h, X264_LOG_INFO, "OpenCL acceleration enabled with %s %s %s\n", dev_vendor, dev_name, h->opencl.b_device_AMD_SI ? "(SI)" : "" );
 
-    program = x264_opencl_cache_load( h, dev_name, dev_vendor, driver_version );
+    program = opencl_cache_load( h, dev_name, dev_vendor, driver_version );
     if( !program )
     {
         /* clCreateProgramWithSource() requires a pointer variable, you cannot just use &x264_opencl_source */
@@ -277,7 +277,7 @@ static cl_program x264_opencl_compile( x264_t *h )
     status = ocl->clBuildProgram( program, 1, &h->opencl.device, buildopts, NULL, NULL );
     if( status == CL_SUCCESS )
     {
-        x264_opencl_cache_save( h, program, dev_name, dev_vendor, driver_version );
+        opencl_cache_save( h, program, dev_name, dev_vendor, driver_version );
         return program;
     }
 
@@ -322,7 +322,7 @@ fail:
     return NULL;
 }
 
-static int x264_opencl_lookahead_alloc( x264_t *h )
+static int opencl_lookahead_alloc( x264_t *h )
 {
     if( !h->param.rc.i_lookahead )
         return -1;
@@ -360,7 +360,7 @@ static int x264_opencl_lookahead_alloc( x264_t *h )
     x264_opencl_function_t *ocl = h->opencl.ocl;
     cl_int status;
 
-    h->opencl.lookahead_program = x264_opencl_compile( h );
+    h->opencl.lookahead_program = opencl_compile( h );
     if( !h->opencl.lookahead_program )
         goto fail;
 
@@ -394,7 +394,7 @@ fail:
     return -1;
 }
 
-static void CL_CALLBACK x264_opencl_error_notify( const char *errinfo, const void *private_info, size_t cb, void *user_data )
+static void CL_CALLBACK opencl_error_notify( const char *errinfo, const void *private_info, size_t cb, void *user_data )
 {
     /* Any error notification can be assumed to be fatal to the OpenCL context.
      * We need to stop using it immediately to prevent further damage. */
@@ -470,7 +470,7 @@ int x264_opencl_lookahead_init( x264_t *h )
 
             if( context )
                 ocl->clReleaseContext( context );
-            context = ocl->clCreateContext( NULL, 1, &h->opencl.device, (void*)x264_opencl_error_notify, (void*)h, &status );
+            context = ocl->clCreateContext( NULL, 1, &h->opencl.device, (void*)opencl_error_notify, (void*)h, &status );
             if( status != CL_SUCCESS || !context )
                 continue;
 
@@ -540,7 +540,7 @@ int x264_opencl_lookahead_init( x264_t *h )
     if( ret )
         x264_log( h, X264_LOG_WARNING, "OpenCL: Unable to find a compatible device\n" );
     else
-        ret = x264_opencl_lookahead_alloc( h );
+        ret = opencl_lookahead_alloc( h );
 
 fail:
     if( context )
@@ -551,7 +551,7 @@ fail:
     return ret;
 }
 
-static void x264_opencl_lookahead_free( x264_t *h )
+static void opencl_lookahead_free( x264_t *h )
 {
     x264_opencl_function_t *ocl = h->opencl.ocl;
 
@@ -600,7 +600,7 @@ void x264_opencl_lookahead_delete( x264_t *h )
     if( h->opencl.queue )
         ocl->clFinish( h->opencl.queue );
 
-    x264_opencl_lookahead_free( h );
+    opencl_lookahead_free( h );
 
     if( h->opencl.queue )
     {
@@ -663,7 +663,7 @@ static void* ADL_CALLBACK adl_malloc_wrapper( int iSize )
     return x264_malloc( iSize );
 }
 
-static int x264_detect_switchable_graphics( void )
+static int detect_switchable_graphics( void )
 {
     void *hDLL;
     ADL_MAIN_CONTROL_CREATE          ADL_Main_Control_Create;
index 9bc926a1ffd61433e99764d8826e81e3a00e6546..2b1fdd517ba52ea245e8fccd431f9d930c3fbf16 100644 (file)
@@ -60,9 +60,9 @@ int64_t x264_mdate( void )
 
 #if HAVE_WIN32THREAD || PTW32_STATIC_LIB
 /* state of the threading library being initialized */
-static volatile LONG x264_threading_is_init = 0;
+static volatile LONG threading_is_init = 0;
 
-static void x264_threading_destroy( void )
+static void threading_destroy( void )
 {
 #if PTW32_STATIC_LIB
     pthread_win32_thread_detach_np();
@@ -75,7 +75,7 @@ static void x264_threading_destroy( void )
 int x264_threading_init( void )
 {
     /* if already init, then do nothing */
-    if( InterlockedCompareExchange( &x264_threading_is_init, 1, 0 ) )
+    if( InterlockedCompareExchange( &threading_is_init, 1, 0 ) )
         return 0;
 #if PTW32_STATIC_LIB
     /* if static pthread-win32 is already initialized, then do nothing */
@@ -88,7 +88,7 @@ int x264_threading_init( void )
         return -1;
 #endif
     /* register cleanup to run at process termination */
-    atexit( x264_threading_destroy );
+    atexit( threading_destroy );
 
     return 0;
 }
index 516310458cc0b63d9107dc1a28bc984632359183..7e81b2eb71c7d280f4471273971c5ab7eb41ea02 100644 (file)
@@ -194,9 +194,9 @@ static uint64_t name( pixel *pix, intptr_t i_stride ) \
     return sum + ((uint64_t)sqr << 32);       \
 }
 
-PIXEL_VAR_C( x264_pixel_var_16x16, 16, 16 )
-PIXEL_VAR_C( x264_pixel_var_8x16,   8, 16 )
-PIXEL_VAR_C( x264_pixel_var_8x8,    8,  8 )
+PIXEL_VAR_C( pixel_var_16x16, 16, 16 )
+PIXEL_VAR_C( pixel_var_8x16,   8, 16 )
+PIXEL_VAR_C( pixel_var_8x8,    8,  8 )
 
 /****************************************************************************
  * pixel_var2_wxh
@@ -225,8 +225,8 @@ static int name( pixel *fenc, pixel *fdec, int ssd[2] ) \
            sqr_v - ((int64_t)sum_v * sum_v >> shift); \
 }
 
-PIXEL_VAR2_C( x264_pixel_var2_8x16, 16, 7 )
-PIXEL_VAR2_C( x264_pixel_var2_8x8,   8, 6 )
+PIXEL_VAR2_C( pixel_var2_8x16, 16, 7 )
+PIXEL_VAR2_C( pixel_var2_8x8,   8, 6 )
 
 #if BIT_DEPTH > 8
     typedef uint32_t sum_t;
@@ -514,7 +514,7 @@ SATD_X_DECL7( _neon )
 #endif // !HIGH_BIT_DEPTH
 
 #define INTRA_MBCMP_8x8( mbcmp, cpu, cpu2 )\
-void x264_intra_##mbcmp##_x3_8x8##cpu( pixel *fenc, pixel edge[36], int res[3] )\
+static void intra_##mbcmp##_x3_8x8##cpu( pixel *fenc, pixel edge[36], int res[3] )\
 {\
     ALIGNED_ARRAY_16( pixel, pix, [8*FDEC_STRIDE] );\
     x264_predict_8x8_v##cpu2( pix, edge );\
@@ -538,7 +538,7 @@ INTRA_MBCMP_8x8(sa8d, _neon, _neon )
 #endif
 
 #define INTRA_MBCMP( mbcmp, size, pred1, pred2, pred3, chroma, cpu, cpu2 )\
-void x264_intra_##mbcmp##_x3_##size##chroma##cpu( pixel *fenc, pixel *fdec, int res[3] )\
+static void intra_##mbcmp##_x3_##size##chroma##cpu( pixel *fenc, pixel *fdec, int res[3] )\
 {\
     x264_predict_##size##chroma##_##pred1##cpu2( fdec );\
     res[0] = x264_pixel_##mbcmp##_##size##cpu( fdec, FDEC_STRIDE, fenc, FENC_STRIDE );\
@@ -614,7 +614,7 @@ INTRA_MBCMP(satd, 16x16,  v, h, dc,  , _neon, _neon )
 #endif
 
 // No C implementation of intra_satd_x9. See checkasm for its behavior,
-// or see x264_mb_analyse_intra for the entirely different algorithm we
+// or see mb_analyse_intra for the entirely different algorithm we
 // use when lacking an asm implementation of it.
 
 
@@ -852,11 +852,11 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
 
     pixf->sa8d[PIXEL_16x16] = x264_pixel_sa8d_16x16;
     pixf->sa8d[PIXEL_8x8]   = x264_pixel_sa8d_8x8;
-    pixf->var[PIXEL_16x16] = x264_pixel_var_16x16;
-    pixf->var[PIXEL_8x16]  = x264_pixel_var_8x16;
-    pixf->var[PIXEL_8x8]   = x264_pixel_var_8x8;
-    pixf->var2[PIXEL_8x16]  = x264_pixel_var2_8x16;
-    pixf->var2[PIXEL_8x8]   = x264_pixel_var2_8x8;
+    pixf->var[PIXEL_16x16] = pixel_var_16x16;
+    pixf->var[PIXEL_8x16]  = pixel_var_8x16;
+    pixf->var[PIXEL_8x8]   = pixel_var_8x8;
+    pixf->var2[PIXEL_8x16]  = pixel_var2_8x16;
+    pixf->var2[PIXEL_8x8]   = pixel_var2_8x8;
 
     pixf->ssd_nv12_core = pixel_ssd_nv12_core;
     pixf->ssim_4x4x2_core = ssim_4x4x2_core;
@@ -864,16 +864,16 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
     pixf->vsad = pixel_vsad;
     pixf->asd8 = pixel_asd8;
 
-    pixf->intra_sad_x3_4x4    = x264_intra_sad_x3_4x4;
-    pixf->intra_satd_x3_4x4   = x264_intra_satd_x3_4x4;
-    pixf->intra_sad_x3_8x8    = x264_intra_sad_x3_8x8;
-    pixf->intra_sa8d_x3_8x8   = x264_intra_sa8d_x3_8x8;
-    pixf->intra_sad_x3_8x8c   = x264_intra_sad_x3_8x8c;
-    pixf->intra_satd_x3_8x8c  = x264_intra_satd_x3_8x8c;
-    pixf->intra_sad_x3_8x16c  = x264_intra_sad_x3_8x16c;
-    pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c;
-    pixf->intra_sad_x3_16x16  = x264_intra_sad_x3_16x16;
-    pixf->intra_satd_x3_16x16 = x264_intra_satd_x3_16x16;
+    pixf->intra_sad_x3_4x4    = intra_sad_x3_4x4;
+    pixf->intra_satd_x3_4x4   = intra_satd_x3_4x4;
+    pixf->intra_sad_x3_8x8    = intra_sad_x3_8x8;
+    pixf->intra_sa8d_x3_8x8   = intra_sa8d_x3_8x8;
+    pixf->intra_sad_x3_8x8c   = intra_sad_x3_8x8c;
+    pixf->intra_satd_x3_8x8c  = intra_satd_x3_8x8c;
+    pixf->intra_sad_x3_8x16c  = intra_sad_x3_8x16c;
+    pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c;
+    pixf->intra_sad_x3_16x16  = intra_sad_x3_16x16;
+    pixf->intra_satd_x3_16x16 = intra_satd_x3_16x16;
 
 #if HIGH_BIT_DEPTH
 #if HAVE_MMX
@@ -890,14 +890,14 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
         INIT8( ssd, _mmx2 );
         INIT_ADS( _mmx2 );
 
-        pixf->intra_sad_x3_4x4    = x264_intra_sad_x3_4x4_mmx2;
+        pixf->intra_sad_x3_4x4    = intra_sad_x3_4x4_mmx2;
         pixf->intra_satd_x3_4x4   = x264_intra_satd_x3_4x4_mmx2;
-        pixf->intra_sad_x3_8x8    = x264_intra_sad_x3_8x8_mmx2;
-        pixf->intra_sad_x3_8x8c   = x264_intra_sad_x3_8x8c_mmx2;
+        pixf->intra_sad_x3_8x8    = intra_sad_x3_8x8_mmx2;
+        pixf->intra_sad_x3_8x8c   = intra_sad_x3_8x8c_mmx2;
         pixf->intra_satd_x3_8x8c  = x264_intra_satd_x3_8x8c_mmx2;
-        pixf->intra_sad_x3_8x16c  = x264_intra_sad_x3_8x16c_mmx2;
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_mmx2;
-        pixf->intra_sad_x3_16x16  = x264_intra_sad_x3_16x16_mmx2;
+        pixf->intra_sad_x3_8x16c  = intra_sad_x3_8x16c_mmx2;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_mmx2;
+        pixf->intra_sad_x3_16x16  = intra_sad_x3_16x16_mmx2;
         pixf->intra_satd_x3_16x16 = x264_intra_satd_x3_16x16_mmx2;
     }
     if( cpu&X264_CPU_SSE2 )
@@ -907,21 +907,22 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
         INIT6( satd, _sse2 );
         pixf->satd[PIXEL_4x16] = x264_pixel_satd_4x16_sse2;
 
-        pixf->sa8d[PIXEL_16x16] = x264_pixel_sa8d_16x16_sse2;
-        pixf->sa8d[PIXEL_8x8]   = x264_pixel_sa8d_8x8_sse2;
-#if ARCH_X86_64
-        pixf->intra_sa8d_x3_8x8 = x264_intra_sa8d_x3_8x8_sse2;
-        pixf->sa8d_satd[PIXEL_16x16] = x264_pixel_sa8d_satd_16x16_sse2;
-#endif
-        pixf->intra_sad_x3_4x4  = x264_intra_sad_x3_4x4_sse2;
-        pixf->ssd_nv12_core = x264_pixel_ssd_nv12_core_sse2;
+        pixf->ssd_nv12_core    = x264_pixel_ssd_nv12_core_sse2;
         pixf->ssim_4x4x2_core  = x264_pixel_ssim_4x4x2_core_sse2;
         pixf->ssim_end4        = x264_pixel_ssim_end4_sse2;
         pixf->var[PIXEL_16x16] = x264_pixel_var_16x16_sse2;
         pixf->var[PIXEL_8x8]   = x264_pixel_var_8x8_sse2;
         pixf->var2[PIXEL_8x8]  = x264_pixel_var2_8x8_sse2;
         pixf->var2[PIXEL_8x16] = x264_pixel_var2_8x16_sse2;
-        pixf->intra_sad_x3_8x8 = x264_intra_sad_x3_8x8_sse2;
+
+        pixf->sa8d[PIXEL_16x16] = x264_pixel_sa8d_16x16_sse2;
+        pixf->sa8d[PIXEL_8x8]   = x264_pixel_sa8d_8x8_sse2;
+#if ARCH_X86_64
+        pixf->sa8d_satd[PIXEL_16x16] = x264_pixel_sa8d_satd_16x16_sse2;
+#endif
+        pixf->intra_sad_x3_4x4  = x264_intra_sad_x3_4x4_sse2;
+        pixf->intra_sad_x3_8x8  = x264_intra_sad_x3_8x8_sse2;
+        pixf->intra_sa8d_x3_8x8 = intra_sa8d_x3_8x8_sse2;
     }
     if( (cpu&X264_CPU_SSE2) && !(cpu&X264_CPU_SSE2_IS_SLOW) )
     {
@@ -937,10 +938,10 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
         pixf->vsad = x264_pixel_vsad_sse2;
         pixf->asd8 = x264_pixel_asd8_sse2;
         pixf->intra_sad_x3_8x8    = x264_intra_sad_x3_8x8_sse2;
-        pixf->intra_sad_x3_8x8c   = x264_intra_sad_x3_8x8c_sse2;
-        pixf->intra_sad_x3_8x16c  = x264_intra_sad_x3_8x16c_sse2;
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_sse2;
-        pixf->intra_sad_x3_16x16  = x264_intra_sad_x3_16x16_sse2;
+        pixf->intra_sad_x3_8x8c   = intra_sad_x3_8x8c_sse2;
+        pixf->intra_sad_x3_8x16c  = intra_sad_x3_8x16c_sse2;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_sse2;
+        pixf->intra_sad_x3_16x16  = intra_sad_x3_16x16_sse2;
     }
     if( cpu&X264_CPU_SSE2_IS_FAST )
     {
@@ -972,7 +973,6 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
         }
         pixf->vsad = x264_pixel_vsad_ssse3;
         pixf->asd8 = x264_pixel_asd8_ssse3;
-        pixf->intra_sad_x3_4x4  = x264_intra_sad_x3_4x4_ssse3;
         pixf->sa8d[PIXEL_16x16]= x264_pixel_sa8d_16x16_ssse3;
         pixf->sa8d[PIXEL_8x8]  = x264_pixel_sa8d_8x8_ssse3;
 #if ARCH_X86_64
@@ -980,10 +980,10 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
 #endif
         pixf->intra_sad_x3_4x4    = x264_intra_sad_x3_4x4_ssse3;
         pixf->intra_sad_x3_8x8    = x264_intra_sad_x3_8x8_ssse3;
-        pixf->intra_sad_x3_8x8c   = x264_intra_sad_x3_8x8c_ssse3;
-        pixf->intra_sad_x3_8x16c  = x264_intra_sad_x3_8x16c_ssse3;
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_ssse3;
-        pixf->intra_sad_x3_16x16  = x264_intra_sad_x3_16x16_ssse3;
+        pixf->intra_sad_x3_8x8c   = intra_sad_x3_8x8c_ssse3;
+        pixf->intra_sad_x3_8x16c  = intra_sad_x3_8x16c_ssse3;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_ssse3;
+        pixf->intra_sad_x3_16x16  = intra_sad_x3_16x16_ssse3;
     }
     if( cpu&X264_CPU_SSE4 )
     {
@@ -998,7 +998,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
 #if ARCH_X86_64
         pixf->sa8d_satd[PIXEL_16x16] = x264_pixel_sa8d_satd_16x16_sse4;
 #endif
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_sse4;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_sse4;
     }
     if( cpu&X264_CPU_AVX )
     {
@@ -1023,7 +1023,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
 #if ARCH_X86_64
         pixf->sa8d_satd[PIXEL_16x16] = x264_pixel_sa8d_satd_16x16_avx;
 #endif
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_avx;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_avx;
     }
     if( cpu&X264_CPU_XOP )
     {
@@ -1109,8 +1109,8 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
 #endif
         pixf->intra_satd_x3_16x16 = x264_intra_satd_x3_16x16_mmx2;
         pixf->intra_sad_x3_16x16  = x264_intra_sad_x3_16x16_mmx2;
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_mmx2;
-        pixf->intra_sad_x3_8x16c  = x264_intra_sad_x3_8x16c_mmx2;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_mmx2;
+        pixf->intra_sad_x3_8x16c  = intra_sad_x3_8x16c_mmx2;
         pixf->intra_satd_x3_8x8c  = x264_intra_satd_x3_8x8c_mmx2;
         pixf->intra_sad_x3_8x8c   = x264_intra_sad_x3_8x8c_mmx2;
         pixf->intra_sad_x3_8x8    = x264_intra_sad_x3_8x8_mmx2;
@@ -1152,8 +1152,8 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
         pixf->var[PIXEL_8x8] = x264_pixel_var_8x8_sse2;
         pixf->var[PIXEL_8x16] = x264_pixel_var_8x16_sse2;
         pixf->intra_sad_x3_16x16 = x264_intra_sad_x3_16x16_sse2;
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_sse2;
-        pixf->intra_sad_x3_8x16c  = x264_intra_sad_x3_8x16c_sse2;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_sse2;
+        pixf->intra_sad_x3_8x16c  = intra_sad_x3_8x16c_sse2;
         if( cpu&X264_CPU_CACHELINE_64 )
         {
             INIT2( ssd, _sse2); /* faster for width 16 on p4 */
@@ -1232,7 +1232,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
         pixf->intra_satd_x3_16x16 = x264_intra_satd_x3_16x16_ssse3;
         if( !(cpu&X264_CPU_SLOW_PSHUFB) )
             pixf->intra_sad_x3_16x16  = x264_intra_sad_x3_16x16_ssse3;
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_ssse3;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_ssse3;
         pixf->intra_satd_x3_8x8c  = x264_intra_satd_x3_8x8c_ssse3;
         pixf->intra_sad_x3_8x8c   = x264_intra_sad_x3_8x8c_ssse3;
         pixf->var2[PIXEL_8x8] = x264_pixel_var2_8x8_ssse3;
@@ -1272,7 +1272,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
         }
         pixf->sa8d[PIXEL_16x16]= x264_pixel_sa8d_16x16_sse4;
         pixf->sa8d[PIXEL_8x8]  = x264_pixel_sa8d_8x8_sse4;
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_sse4;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_sse4;
 #if ARCH_X86_64
         pixf->sa8d_satd[PIXEL_16x16] = x264_pixel_sa8d_satd_16x16_sse4;
 #endif
@@ -1302,7 +1302,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
         INIT5( ssd, _avx );
         pixf->sa8d[PIXEL_16x16]= x264_pixel_sa8d_16x16_avx;
         pixf->sa8d[PIXEL_8x8]  = x264_pixel_sa8d_8x8_avx;
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_avx;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_avx;
         pixf->ssd_nv12_core    = x264_pixel_ssd_nv12_core_avx;
         pixf->var[PIXEL_16x16] = x264_pixel_var_16x16_avx;
         pixf->var[PIXEL_8x16]  = x264_pixel_var_8x16_avx;
@@ -1327,7 +1327,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
         INIT5( ssd, _xop );
         pixf->sa8d[PIXEL_16x16]= x264_pixel_sa8d_16x16_xop;
         pixf->sa8d[PIXEL_8x8]  = x264_pixel_sa8d_8x8_xop;
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_xop;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_xop;
         pixf->ssd_nv12_core    = x264_pixel_ssd_nv12_core_xop;
 #if ARCH_X86_64
         pixf->sa8d_satd[PIXEL_16x16] = x264_pixel_sa8d_satd_16x16_xop;
@@ -1405,16 +1405,16 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
         pixf->vsad = x264_pixel_vsad_neon;
         pixf->asd8 = x264_pixel_asd8_neon;
 
-        pixf->intra_sad_x3_4x4    = x264_intra_sad_x3_4x4_neon;
-        pixf->intra_satd_x3_4x4   = x264_intra_satd_x3_4x4_neon;
-        pixf->intra_sad_x3_8x8    = x264_intra_sad_x3_8x8_neon;
-        pixf->intra_sa8d_x3_8x8   = x264_intra_sa8d_x3_8x8_neon;
-        pixf->intra_sad_x3_8x8c   = x264_intra_sad_x3_8x8c_neon;
-        pixf->intra_satd_x3_8x8c  = x264_intra_satd_x3_8x8c_neon;
-        pixf->intra_sad_x3_8x16c  = x264_intra_sad_x3_8x16c_neon;
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_neon;
-        pixf->intra_sad_x3_16x16  = x264_intra_sad_x3_16x16_neon;
-        pixf->intra_satd_x3_16x16 = x264_intra_satd_x3_16x16_neon;
+        pixf->intra_sad_x3_4x4    = intra_sad_x3_4x4_neon;
+        pixf->intra_satd_x3_4x4   = intra_satd_x3_4x4_neon;
+        pixf->intra_sad_x3_8x8    = intra_sad_x3_8x8_neon;
+        pixf->intra_sa8d_x3_8x8   = intra_sa8d_x3_8x8_neon;
+        pixf->intra_sad_x3_8x8c   = intra_sad_x3_8x8c_neon;
+        pixf->intra_satd_x3_8x8c  = intra_satd_x3_8x8c_neon;
+        pixf->intra_sad_x3_8x16c  = intra_sad_x3_8x16c_neon;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_neon;
+        pixf->intra_sad_x3_16x16  = intra_sad_x3_16x16_neon;
+        pixf->intra_satd_x3_16x16 = intra_satd_x3_16x16_neon;
 
         pixf->ssd_nv12_core     = x264_pixel_ssd_nv12_core_neon;
         pixf->ssim_4x4x2_core   = x264_pixel_ssim_4x4x2_core_neon;
@@ -1460,16 +1460,16 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
         pixf->vsad = x264_pixel_vsad_neon;
         pixf->asd8 = x264_pixel_asd8_neon;
 
-        pixf->intra_sad_x3_4x4    = x264_intra_sad_x3_4x4_neon;
-        pixf->intra_satd_x3_4x4   = x264_intra_satd_x3_4x4_neon;
-        pixf->intra_sad_x3_8x8    = x264_intra_sad_x3_8x8_neon;
-        pixf->intra_sa8d_x3_8x8   = x264_intra_sa8d_x3_8x8_neon;
-        pixf->intra_sad_x3_8x8c   = x264_intra_sad_x3_8x8c_neon;
-        pixf->intra_satd_x3_8x8c  = x264_intra_satd_x3_8x8c_neon;
-        pixf->intra_sad_x3_8x16c  = x264_intra_sad_x3_8x16c_neon;
-        pixf->intra_satd_x3_8x16c = x264_intra_satd_x3_8x16c_neon;
-        pixf->intra_sad_x3_16x16  = x264_intra_sad_x3_16x16_neon;
-        pixf->intra_satd_x3_16x16 = x264_intra_satd_x3_16x16_neon;
+        pixf->intra_sad_x3_4x4    = intra_sad_x3_4x4_neon;
+        pixf->intra_satd_x3_4x4   = intra_satd_x3_4x4_neon;
+        pixf->intra_sad_x3_8x8    = intra_sad_x3_8x8_neon;
+        pixf->intra_sa8d_x3_8x8   = intra_sa8d_x3_8x8_neon;
+        pixf->intra_sad_x3_8x8c   = intra_sad_x3_8x8c_neon;
+        pixf->intra_satd_x3_8x8c  = intra_satd_x3_8x8c_neon;
+        pixf->intra_sad_x3_8x16c  = intra_sad_x3_8x16c_neon;
+        pixf->intra_satd_x3_8x16c = intra_satd_x3_8x16c_neon;
+        pixf->intra_sad_x3_16x16  = intra_sad_x3_16x16_neon;
+        pixf->intra_satd_x3_16x16 = intra_satd_x3_16x16_neon;
 
         pixf->ssd_nv12_core     = x264_pixel_ssd_nv12_core_neon;
         pixf->ssim_4x4x2_core   = x264_pixel_ssim_4x4x2_core_neon;
index 6b248738c0414641e4ea747b4acbf03ff54b242a..d1507548e645a6984e1b2ee99ccf24e2c78a346e 100644 (file)
@@ -32,9 +32,9 @@
 typedef void (*pf_mc_t)( uint8_t *src, intptr_t i_src,
                          uint8_t *dst, intptr_t i_dst, int i_height );
 
-static inline void x264_pixel_avg2_w4_altivec( uint8_t *dst,  intptr_t i_dst,
-                                               uint8_t *src1, intptr_t i_src1,
-                                               uint8_t *src2, int i_height )
+static inline void pixel_avg2_w4_altivec( uint8_t *dst,  intptr_t i_dst,
+                                          uint8_t *src1, intptr_t i_src1,
+                                          uint8_t *src2, int i_height )
 {
     for( int y = 0; y < i_height; y++ )
     {
@@ -46,9 +46,9 @@ static inline void x264_pixel_avg2_w4_altivec( uint8_t *dst,  intptr_t i_dst,
     }
 }
 
-static inline void x264_pixel_avg2_w8_altivec( uint8_t *dst,  intptr_t i_dst,
-                                               uint8_t *src1, intptr_t i_src1,
-                                               uint8_t *src2, int i_height )
+static inline void pixel_avg2_w8_altivec( uint8_t *dst,  intptr_t i_dst,
+                                          uint8_t *src1, intptr_t i_src1,
+                                          uint8_t *src2, int i_height )
 {
     vec_u8_t src1v, src2v;
     PREP_STORE8;
@@ -67,9 +67,9 @@ static inline void x264_pixel_avg2_w8_altivec( uint8_t *dst,  intptr_t i_dst,
     }
 }
 
-static inline void x264_pixel_avg2_w16_altivec( uint8_t *dst,  intptr_t i_dst,
-                                                uint8_t *src1, intptr_t i_src1,
-                                                uint8_t *src2, int i_height )
+static inline void pixel_avg2_w16_altivec( uint8_t *dst,  intptr_t i_dst,
+                                           uint8_t *src1, intptr_t i_src1,
+                                           uint8_t *src2, int i_height )
 {
     vec_u8_t src1v, src2v;
 
@@ -86,12 +86,12 @@ static inline void x264_pixel_avg2_w16_altivec( uint8_t *dst,  intptr_t i_dst,
     }
 }
 
-static inline void x264_pixel_avg2_w20_altivec( uint8_t *dst,  intptr_t i_dst,
-                                                uint8_t *src1, intptr_t i_src1,
-                                                uint8_t *src2, int i_height )
+static inline void pixel_avg2_w20_altivec( uint8_t *dst,  intptr_t i_dst,
+                                           uint8_t *src1, intptr_t i_src1,
+                                           uint8_t *src2, int i_height )
 {
-    x264_pixel_avg2_w16_altivec(dst, i_dst, src1, i_src1, src2, i_height);
-    x264_pixel_avg2_w4_altivec(dst+16, i_dst, src1+16, i_src1, src2+16, i_height);
+    pixel_avg2_w16_altivec(dst, i_dst, src1, i_src1, src2, i_height);
+    pixel_avg2_w4_altivec(dst+16, i_dst, src1+16, i_src1, src2+16, i_height);
 }
 
 /* mc_copy: plain c */
@@ -108,11 +108,11 @@ static void name( uint8_t *dst, intptr_t i_dst,           \
         dst += i_dst;                                     \
     }                                                     \
 }
-MC_COPY( x264_mc_copy_w4_altivec,  4  )
-MC_COPY( x264_mc_copy_w8_altivec,  8  )
+MC_COPY( mc_copy_w4_altivec,  4  )
+MC_COPY( mc_copy_w8_altivec,  8  )
 
-static void x264_mc_copy_w16_altivec( uint8_t *dst, intptr_t i_dst,
-                                      uint8_t *src, intptr_t i_src, int i_height )
+static void mc_copy_w16_altivec( uint8_t *dst, intptr_t i_dst,
+                                 uint8_t *src, intptr_t i_src, int i_height )
 {
     vec_u8_t cpyV;
 
@@ -127,8 +127,8 @@ static void x264_mc_copy_w16_altivec( uint8_t *dst, intptr_t i_dst,
 }
 
 
-static void x264_mc_copy_w16_aligned_altivec( uint8_t *dst, intptr_t i_dst,
-                                              uint8_t *src, intptr_t i_src, int i_height )
+static void mc_copy_w16_aligned_altivec( uint8_t *dst, intptr_t i_dst,
+                                         uint8_t *src, intptr_t i_src, int i_height )
 {
     for( int y = 0; y < i_height; ++y )
     {
@@ -287,14 +287,14 @@ static void mc_luma_altivec( uint8_t *dst,    intptr_t i_dst_stride,
         switch( i_width )
         {
             case 4:
-                x264_pixel_avg2_w4_altivec( dst, i_dst_stride, src1, i_src_stride, src2, i_height );
+                pixel_avg2_w4_altivec( dst, i_dst_stride, src1, i_src_stride, src2, i_height );
                 break;
             case 8:
-                x264_pixel_avg2_w8_altivec( dst, i_dst_stride, src1, i_src_stride, src2, i_height );
+                pixel_avg2_w8_altivec( dst, i_dst_stride, src1, i_src_stride, src2, i_height );
                 break;
             case 16:
             default:
-                x264_pixel_avg2_w16_altivec( dst, i_dst_stride, src1, i_src_stride, src2, i_height );
+                pixel_avg2_w16_altivec( dst, i_dst_stride, src1, i_src_stride, src2, i_height );
         }
         if( weight->weightfn )
             weight->weightfn[i_width>>2]( dst, i_dst_stride, dst, i_dst_stride, weight, i_height );
@@ -306,13 +306,13 @@ static void mc_luma_altivec( uint8_t *dst,    intptr_t i_dst_stride,
         switch( i_width )
         {
             case 4:
-                x264_mc_copy_w4_altivec( dst, i_dst_stride, src1, i_src_stride, i_height );
+                mc_copy_w4_altivec( dst, i_dst_stride, src1, i_src_stride, i_height );
                 break;
             case 8:
-                x264_mc_copy_w8_altivec( dst, i_dst_stride, src1, i_src_stride, i_height );
+                mc_copy_w8_altivec( dst, i_dst_stride, src1, i_src_stride, i_height );
                 break;
             case 16:
-                x264_mc_copy_w16_altivec( dst, i_dst_stride, src1, i_src_stride, i_height );
+                mc_copy_w16_altivec( dst, i_dst_stride, src1, i_src_stride, i_height );
                 break;
         }
     }
@@ -334,18 +334,18 @@ static uint8_t *get_ref_altivec( uint8_t *dst,   intptr_t *i_dst_stride,
         switch( i_width )
         {
             case 4:
-                x264_pixel_avg2_w4_altivec( dst, *i_dst_stride, src1, i_src_stride, src2, i_height );
+                pixel_avg2_w4_altivec( dst, *i_dst_stride, src1, i_src_stride, src2, i_height );
                 break;
             case 8:
-                x264_pixel_avg2_w8_altivec( dst, *i_dst_stride, src1, i_src_stride, src2, i_height );
+                pixel_avg2_w8_altivec( dst, *i_dst_stride, src1, i_src_stride, src2, i_height );
                 break;
             case 12:
             case 16:
             default:
-                x264_pixel_avg2_w16_altivec( dst, *i_dst_stride, src1, i_src_stride, src2, i_height );
+                pixel_avg2_w16_altivec( dst, *i_dst_stride, src1, i_src_stride, src2, i_height );
                 break;
             case 20:
-                x264_pixel_avg2_w20_altivec( dst, *i_dst_stride, src1, i_src_stride, src2, i_height );
+                pixel_avg2_w20_altivec( dst, *i_dst_stride, src1, i_src_stride, src2, i_height );
                 break;
         }
         if( weight->weightfn )
@@ -1274,7 +1274,7 @@ static void mc_weight_w20_altivec( uint8_t *dst, intptr_t i_dst, uint8_t *src, i
     }
 }
 
-static weight_fn_t x264_mc_weight_wtab_altivec[6] =
+static weight_fn_t mc_weight_wtab_altivec[6] =
 {
     mc_weight_w2_altivec,
     mc_weight_w4_altivec,
@@ -1384,16 +1384,16 @@ void x264_mc_init_altivec( x264_mc_functions_t *pf )
     pf->get_ref   = get_ref_altivec;
     pf->mc_chroma = mc_chroma_altivec;
 
-    pf->copy_16x16_unaligned = x264_mc_copy_w16_altivec;
-    pf->copy[PIXEL_16x16] = x264_mc_copy_w16_aligned_altivec;
+    pf->copy_16x16_unaligned = mc_copy_w16_altivec;
+    pf->copy[PIXEL_16x16] = mc_copy_w16_aligned_altivec;
 
     pf->hpel_filter = x264_hpel_filter_altivec;
     pf->frame_init_lowres_core = frame_init_lowres_core_altivec;
 
-    pf->weight = x264_mc_weight_wtab_altivec;
+    pf->weight = mc_weight_wtab_altivec;
 
-    pf->plane_copy_swap = x264_plane_copy_swap_altivec;
-    pf->plane_copy_interleave = x264_plane_copy_interleave_altivec;
+    pf->plane_copy_swap = plane_copy_swap_altivec;
+    pf->plane_copy_interleave = plane_copy_interleave_altivec;
     pf->store_interleave_chroma = x264_store_interleave_chroma_altivec;
     pf->plane_copy_deinterleave = x264_plane_copy_deinterleave_altivec;
 #if HAVE_VSX
index 04ad435ec387cc3f5500425b4ca76e93a23635ff..9958e5fbe9ddd32cd3ef81554adc33c4083e2c82 100644 (file)
@@ -1315,7 +1315,7 @@ static int pixel_ssd_8x8_altivec( uint8_t *pix1, intptr_t i_stride_pix1,
 /****************************************************************************
  * variance
  ****************************************************************************/
-static uint64_t x264_pixel_var_16x16_altivec( uint8_t *pix, intptr_t i_stride )
+static uint64_t pixel_var_16x16_altivec( uint8_t *pix, intptr_t i_stride )
 {
     ALIGNED_16(uint32_t sum_tab[4]);
     ALIGNED_16(uint32_t sqr_tab[4]);
@@ -1342,7 +1342,7 @@ static uint64_t x264_pixel_var_16x16_altivec( uint8_t *pix, intptr_t i_stride )
     return sum + ((uint64_t)sqr<<32);
 }
 
-static uint64_t x264_pixel_var_8x8_altivec( uint8_t *pix, intptr_t i_stride )
+static uint64_t pixel_var_8x8_altivec( uint8_t *pix, intptr_t i_stride )
 {
     ALIGNED_16(uint32_t sum_tab[4]);
     ALIGNED_16(uint32_t sqr_tab[4]);
@@ -1634,7 +1634,7 @@ static const vec_u8_t hadamard_permtab[] =
        0x1C,0x0C,0x1D,0x0D, 0x1E,0x0E,0x1F,0x0F )
  };
 
-static uint64_t x264_pixel_hadamard_ac_16x16_altivec( uint8_t *pix, intptr_t stride )
+static uint64_t pixel_hadamard_ac_16x16_altivec( uint8_t *pix, intptr_t stride )
 {
     int idx =  ((uintptr_t)pix & 8) >> 3;
     vec_u8_t permh = hadamard_permtab[idx];
@@ -1646,7 +1646,7 @@ static uint64_t x264_pixel_hadamard_ac_16x16_altivec( uint8_t *pix, intptr_t str
     return ((sum>>34)<<32) + ((uint32_t)sum>>1);
 }
 
-static uint64_t x264_pixel_hadamard_ac_16x8_altivec( uint8_t *pix, intptr_t stride )
+static uint64_t pixel_hadamard_ac_16x8_altivec( uint8_t *pix, intptr_t stride )
 {
     int idx =  ((uintptr_t)pix & 8) >> 3;
     vec_u8_t permh = hadamard_permtab[idx];
@@ -1656,7 +1656,7 @@ static uint64_t x264_pixel_hadamard_ac_16x8_altivec( uint8_t *pix, intptr_t stri
     return ((sum>>34)<<32) + ((uint32_t)sum>>1);
 }
 
-static uint64_t x264_pixel_hadamard_ac_8x16_altivec( uint8_t *pix, intptr_t stride )
+static uint64_t pixel_hadamard_ac_8x16_altivec( uint8_t *pix, intptr_t stride )
 {
     vec_u8_t perm = hadamard_permtab[ (((uintptr_t)pix & 8) >> 3) ];
     uint64_t sum = pixel_hadamard_ac_altivec( pix, stride, perm );
@@ -1664,7 +1664,7 @@ static uint64_t x264_pixel_hadamard_ac_8x16_altivec( uint8_t *pix, intptr_t stri
     return ((sum>>34)<<32) + ((uint32_t)sum>>1);
 }
 
-static uint64_t x264_pixel_hadamard_ac_8x8_altivec( uint8_t *pix, intptr_t stride )
+static uint64_t pixel_hadamard_ac_8x8_altivec( uint8_t *pix, intptr_t stride )
 {
     vec_u8_t perm = hadamard_permtab[ (((uintptr_t)pix & 8) >> 3) ];
     uint64_t sum = pixel_hadamard_ac_altivec( pix, stride, perm );
@@ -1739,7 +1739,7 @@ SATD_X( 4x4 )
 
 
 #define INTRA_MBCMP_8x8( mbcmp )\
-void intra_##mbcmp##_x3_8x8_altivec( uint8_t *fenc, uint8_t edge[36], int res[3] )\
+static void intra_##mbcmp##_x3_8x8_altivec( uint8_t *fenc, uint8_t edge[36], int res[3] )\
 {\
     ALIGNED_8( uint8_t pix[8*FDEC_STRIDE] );\
     x264_predict_8x8_v_c( pix, edge );\
@@ -1754,7 +1754,7 @@ INTRA_MBCMP_8x8(sad)
 INTRA_MBCMP_8x8(sa8d)
 
 #define INTRA_MBCMP( mbcmp, size, pred1, pred2, pred3, chroma )\
-void intra_##mbcmp##_x3_##size##x##size##chroma##_altivec( uint8_t *fenc, uint8_t *fdec, int res[3] )\
+static void intra_##mbcmp##_x3_##size##x##size##chroma##_altivec( uint8_t *fenc, uint8_t *fdec, int res[3] )\
 {\
     x264_predict_##size##x##size##chroma##_##pred1##_c( fdec );\
     res[0] = pixel_##mbcmp##_##size##x##size##_altivec( fdec, FDEC_STRIDE, fenc, FENC_STRIDE );\
@@ -1832,13 +1832,13 @@ void x264_pixel_init_altivec( x264_pixel_function_t *pixf )
 
     pixf->intra_sa8d_x3_8x8   = intra_sa8d_x3_8x8_altivec;
 
-    pixf->var[PIXEL_16x16] = x264_pixel_var_16x16_altivec;
-    pixf->var[PIXEL_8x8]   = x264_pixel_var_8x8_altivec;
+    pixf->var[PIXEL_16x16] = pixel_var_16x16_altivec;
+    pixf->var[PIXEL_8x8]   = pixel_var_8x8_altivec;
 
-    pixf->hadamard_ac[PIXEL_16x16] = x264_pixel_hadamard_ac_16x16_altivec;
-    pixf->hadamard_ac[PIXEL_16x8]  = x264_pixel_hadamard_ac_16x8_altivec;
-    pixf->hadamard_ac[PIXEL_8x16]  = x264_pixel_hadamard_ac_8x16_altivec;
-    pixf->hadamard_ac[PIXEL_8x8]   = x264_pixel_hadamard_ac_8x8_altivec;
+    pixf->hadamard_ac[PIXEL_16x16] = pixel_hadamard_ac_16x16_altivec;
+    pixf->hadamard_ac[PIXEL_16x8]  = pixel_hadamard_ac_16x8_altivec;
+    pixf->hadamard_ac[PIXEL_8x16]  = pixel_hadamard_ac_8x16_altivec;
+    pixf->hadamard_ac[PIXEL_8x8]   = pixel_hadamard_ac_8x8_altivec;
 
     pixf->ssim_4x4x2_core = ssim_4x4x2_core_altivec;
 #endif // !HIGH_BIT_DEPTH
index 8163f94219259289b97da1c3f7dc28d74b3c05ac..986bdc01eb908c0588cb3b59af95956f98da64f6 100644 (file)
@@ -74,7 +74,7 @@ void x264_predict_16x16_dc_c( pixel *src )
 
     PREDICT_16x16_DC( dcsplat );
 }
-static void x264_predict_16x16_dc_left_c( pixel *src )
+static void predict_16x16_dc_left_c( pixel *src )
 {
     int dc = 0;
 
@@ -84,7 +84,7 @@ static void x264_predict_16x16_dc_left_c( pixel *src )
 
     PREDICT_16x16_DC( dcsplat );
 }
-static void x264_predict_16x16_dc_top_c( pixel *src )
+static void predict_16x16_dc_top_c( pixel *src )
 {
     int dc = 0;
 
@@ -94,7 +94,7 @@ static void x264_predict_16x16_dc_top_c( pixel *src )
 
     PREDICT_16x16_DC( dcsplat );
 }
-static void x264_predict_16x16_dc_128_c( pixel *src )
+static void predict_16x16_dc_128_c( pixel *src )
 {
     PREDICT_16x16_DC( PIXEL_SPLAT_X4( 1 << (BIT_DEPTH-1) ) );
 }
@@ -161,7 +161,7 @@ void x264_predict_16x16_p_c( pixel *src )
  * 8x8 prediction for intra chroma block (4:2:0)
  ****************************************************************************/
 
-static void x264_predict_8x8c_dc_128_c( pixel *src )
+static void predict_8x8c_dc_128_c( pixel *src )
 {
     for( int y = 0; y < 8; y++ )
     {
@@ -170,7 +170,7 @@ static void x264_predict_8x8c_dc_128_c( pixel *src )
         src += FDEC_STRIDE;
     }
 }
-static void x264_predict_8x8c_dc_left_c( pixel *src )
+static void predict_8x8c_dc_left_c( pixel *src )
 {
     int dc0 = 0, dc1 = 0;
 
@@ -196,7 +196,7 @@ static void x264_predict_8x8c_dc_left_c( pixel *src )
     }
 
 }
-static void x264_predict_8x8c_dc_top_c( pixel *src )
+static void predict_8x8c_dc_top_c( pixel *src )
 {
     int dc0 = 0, dc1 = 0;
 
@@ -308,7 +308,7 @@ void x264_predict_8x8c_p_c( pixel *src )
  * 8x16 prediction for intra chroma block (4:2:2)
  ****************************************************************************/
 
-static void x264_predict_8x16c_dc_128_c( pixel *src )
+static void predict_8x16c_dc_128_c( pixel *src )
 {
     for( int y = 0; y < 16; y++ )
     {
@@ -317,7 +317,7 @@ static void x264_predict_8x16c_dc_128_c( pixel *src )
         src += FDEC_STRIDE;
     }
 }
-static void x264_predict_8x16c_dc_left_c( pixel *src )
+static void predict_8x16c_dc_left_c( pixel *src )
 {
     for( int i = 0; i < 4; i++ )
     {
@@ -336,7 +336,7 @@ static void x264_predict_8x16c_dc_left_c( pixel *src )
         }
     }
 }
-static void x264_predict_8x16c_dc_top_c( pixel *src )
+static void predict_8x16c_dc_top_c( pixel *src )
 {
     int dc0 = 0, dc1 = 0;
 
@@ -475,16 +475,16 @@ void x264_predict_8x16c_p_c( pixel *src )
 #define PREDICT_4x4_DC(v)\
     SRC_X4(0,0) = SRC_X4(0,1) = SRC_X4(0,2) = SRC_X4(0,3) = v;
 
-static void x264_predict_4x4_dc_128_c( pixel *src )
+static void predict_4x4_dc_128_c( pixel *src )
 {
     PREDICT_4x4_DC( PIXEL_SPLAT_X4( 1 << (BIT_DEPTH-1) ) );
 }
-static void x264_predict_4x4_dc_left_c( pixel *src )
+static void predict_4x4_dc_left_c( pixel *src )
 {
     pixel4 dc = PIXEL_SPLAT_X4( (SRC(-1,0) + SRC(-1,1) + SRC(-1,2) + SRC(-1,3) + 2) >> 2 );
     PREDICT_4x4_DC( dc );
 }
-static void x264_predict_4x4_dc_top_c( pixel *src )
+static void predict_4x4_dc_top_c( pixel *src )
 {
     pixel4 dc = PIXEL_SPLAT_X4( (SRC(0,-1) + SRC(1,-1) + SRC(2,-1) + SRC(3,-1) + 2) >> 2 );
     PREDICT_4x4_DC( dc );
@@ -528,7 +528,7 @@ void x264_predict_4x4_v_c( pixel *src )
 #define F1(a,b)   (((a)+(b)+1)>>1)
 #define F2(a,b,c) (((a)+2*(b)+(c)+2)>>2)
 
-static void x264_predict_4x4_ddl_c( pixel *src )
+static void predict_4x4_ddl_c( pixel *src )
 {
     PREDICT_4x4_LOAD_TOP
     PREDICT_4x4_LOAD_TOP_RIGHT
@@ -540,7 +540,7 @@ static void x264_predict_4x4_ddl_c( pixel *src )
     SRC(3,2)=SRC(2,3)= F2(t5,t6,t7);
     SRC(3,3)= F2(t6,t7,t7);
 }
-static void x264_predict_4x4_ddr_c( pixel *src )
+static void predict_4x4_ddr_c( pixel *src )
 {
     int lt = SRC(-1,-1);
     PREDICT_4x4_LOAD_LEFT
@@ -554,7 +554,7 @@ static void x264_predict_4x4_ddr_c( pixel *src )
     SRC(0,3)= F2(l1,l2,l3);
 }
 
-static void x264_predict_4x4_vr_c( pixel *src )
+static void predict_4x4_vr_c( pixel *src )
 {
     int lt = SRC(-1,-1);
     PREDICT_4x4_LOAD_LEFT
@@ -571,7 +571,7 @@ static void x264_predict_4x4_vr_c( pixel *src )
     SRC(3,0)= F1(t2,t3);
 }
 
-static void x264_predict_4x4_hd_c( pixel *src )
+static void predict_4x4_hd_c( pixel *src )
 {
     int lt= SRC(-1,-1);
     PREDICT_4x4_LOAD_LEFT
@@ -588,7 +588,7 @@ static void x264_predict_4x4_hd_c( pixel *src )
     SRC(3,0)= F2(t2,t1,t0);
 }
 
-static void x264_predict_4x4_vl_c( pixel *src )
+static void predict_4x4_vl_c( pixel *src )
 {
     PREDICT_4x4_LOAD_TOP
     PREDICT_4x4_LOAD_TOP_RIGHT
@@ -604,7 +604,7 @@ static void x264_predict_4x4_vl_c( pixel *src )
     SRC(3,3)= F2(t4,t5,t6);
 }
 
-static void x264_predict_4x4_hu_c( pixel *src )
+static void predict_4x4_hu_c( pixel *src )
 {
     PREDICT_4x4_LOAD_LEFT
     SRC(0,0)= F1(l0,l1);
@@ -626,7 +626,7 @@ static void x264_predict_4x4_hu_c( pixel *src )
 #define PT(x) \
     edge[16+x] = F2(SRC(x-1,-1), SRC(x,-1), SRC(x+1,-1));
 
-static void x264_predict_8x8_filter_c( pixel *src, pixel edge[36], int i_neighbor, int i_filters )
+static void predict_8x8_filter_c( pixel *src, pixel edge[36], int i_neighbor, int i_filters )
 {
     /* edge[7..14] = l7..l0
      * edge[15] = lt
@@ -694,17 +694,17 @@ static void x264_predict_8x8_filter_c( pixel *src, pixel edge[36], int i_neighbo
         src += FDEC_STRIDE; \
     }
 
-static void x264_predict_8x8_dc_128_c( pixel *src, pixel edge[36] )
+static void predict_8x8_dc_128_c( pixel *src, pixel edge[36] )
 {
     PREDICT_8x8_DC( PIXEL_SPLAT_X4( 1 << (BIT_DEPTH-1) ) );
 }
-static void x264_predict_8x8_dc_left_c( pixel *src, pixel edge[36] )
+static void predict_8x8_dc_left_c( pixel *src, pixel edge[36] )
 {
     PREDICT_8x8_LOAD_LEFT
     pixel4 dc = PIXEL_SPLAT_X4( (l0+l1+l2+l3+l4+l5+l6+l7+4) >> 3 );
     PREDICT_8x8_DC( dc );
 }
-static void x264_predict_8x8_dc_top_c( pixel *src, pixel edge[36] )
+static void predict_8x8_dc_top_c( pixel *src, pixel edge[36] )
 {
     PREDICT_8x8_LOAD_TOP
     pixel4 dc = PIXEL_SPLAT_X4( (t0+t1+t2+t3+t4+t5+t6+t7+4) >> 3 );
@@ -735,7 +735,7 @@ void x264_predict_8x8_v_c( pixel *src, pixel edge[36] )
         MPIXEL_X4( src+y*FDEC_STRIDE+4 ) = top[1];
     }
 }
-static void x264_predict_8x8_ddl_c( pixel *src, pixel edge[36] )
+static void predict_8x8_ddl_c( pixel *src, pixel edge[36] )
 {
     PREDICT_8x8_LOAD_TOP
     PREDICT_8x8_LOAD_TOPRIGHT
@@ -755,7 +755,7 @@ static void x264_predict_8x8_ddl_c( pixel *src, pixel edge[36] )
     SRC(6,7)=SRC(7,6)= F2(t13,t14,t15);
     SRC(7,7)= F2(t14,t15,t15);
 }
-static void x264_predict_8x8_ddr_c( pixel *src, pixel edge[36] )
+static void predict_8x8_ddr_c( pixel *src, pixel edge[36] )
 {
     PREDICT_8x8_LOAD_TOP
     PREDICT_8x8_LOAD_LEFT
@@ -777,7 +777,7 @@ static void x264_predict_8x8_ddr_c( pixel *src, pixel edge[36] )
     SRC(7,0)= F2(t5,t6,t7);
 
 }
-static void x264_predict_8x8_vr_c( pixel *src, pixel edge[36] )
+static void predict_8x8_vr_c( pixel *src, pixel edge[36] )
 {
     PREDICT_8x8_LOAD_TOP
     PREDICT_8x8_LOAD_LEFT
@@ -805,7 +805,7 @@ static void x264_predict_8x8_vr_c( pixel *src, pixel edge[36] )
     SRC(7,1)= F2(t5,t6,t7);
     SRC(7,0)= F1(t6,t7);
 }
-static void x264_predict_8x8_hd_c( pixel *src, pixel edge[36] )
+static void predict_8x8_hd_c( pixel *src, pixel edge[36] )
 {
     PREDICT_8x8_LOAD_TOP
     PREDICT_8x8_LOAD_LEFT
@@ -832,7 +832,7 @@ static void x264_predict_8x8_hd_c( pixel *src, pixel edge[36] )
     SRC_X4(4,1)= pack_pixel_2to4(p9,p10);
     SRC_X4(4,0)= pack_pixel_2to4(p10,p11);
 }
-static void x264_predict_8x8_vl_c( pixel *src, pixel edge[36] )
+static void predict_8x8_vl_c( pixel *src, pixel edge[36] )
 {
     PREDICT_8x8_LOAD_TOP
     PREDICT_8x8_LOAD_TOPRIGHT
@@ -859,7 +859,7 @@ static void x264_predict_8x8_vl_c( pixel *src, pixel edge[36] )
     SRC(7,6)= F1(t10,t11);
     SRC(7,7)= F2(t10,t11,t12);
 }
-static void x264_predict_8x8_hu_c( pixel *src, pixel edge[36] )
+static void predict_8x8_hu_c( pixel *src, pixel edge[36] )
 {
     PREDICT_8x8_LOAD_LEFT
     int p1 = pack_pixel_1to2(F1(l0,l1), F2(l0,l1,l2));
@@ -889,9 +889,9 @@ void x264_predict_16x16_init( int cpu, x264_predict_t pf[7] )
     pf[I_PRED_16x16_H ]     = x264_predict_16x16_h_c;
     pf[I_PRED_16x16_DC]     = x264_predict_16x16_dc_c;
     pf[I_PRED_16x16_P ]     = x264_predict_16x16_p_c;
-    pf[I_PRED_16x16_DC_LEFT]= x264_predict_16x16_dc_left_c;
-    pf[I_PRED_16x16_DC_TOP ]= x264_predict_16x16_dc_top_c;
-    pf[I_PRED_16x16_DC_128 ]= x264_predict_16x16_dc_128_c;
+    pf[I_PRED_16x16_DC_LEFT]= predict_16x16_dc_left_c;
+    pf[I_PRED_16x16_DC_TOP ]= predict_16x16_dc_top_c;
+    pf[I_PRED_16x16_DC_128 ]= predict_16x16_dc_128_c;
 
 #if HAVE_MMX
     x264_predict_16x16_init_mmx( cpu, pf );
@@ -932,9 +932,9 @@ void x264_predict_8x8c_init( int cpu, x264_predict_t pf[7] )
     pf[I_PRED_CHROMA_H ]     = x264_predict_8x8c_h_c;
     pf[I_PRED_CHROMA_DC]     = x264_predict_8x8c_dc_c;
     pf[I_PRED_CHROMA_P ]     = x264_predict_8x8c_p_c;
-    pf[I_PRED_CHROMA_DC_LEFT]= x264_predict_8x8c_dc_left_c;
-    pf[I_PRED_CHROMA_DC_TOP ]= x264_predict_8x8c_dc_top_c;
-    pf[I_PRED_CHROMA_DC_128 ]= x264_predict_8x8c_dc_128_c;
+    pf[I_PRED_CHROMA_DC_LEFT]= predict_8x8c_dc_left_c;
+    pf[I_PRED_CHROMA_DC_TOP ]= predict_8x8c_dc_top_c;
+    pf[I_PRED_CHROMA_DC_128 ]= predict_8x8c_dc_128_c;
 
 #if HAVE_MMX
     x264_predict_8x8c_init_mmx( cpu, pf );
@@ -969,9 +969,9 @@ void x264_predict_8x16c_init( int cpu, x264_predict_t pf[7] )
     pf[I_PRED_CHROMA_H ]     = x264_predict_8x16c_h_c;
     pf[I_PRED_CHROMA_DC]     = x264_predict_8x16c_dc_c;
     pf[I_PRED_CHROMA_P ]     = x264_predict_8x16c_p_c;
-    pf[I_PRED_CHROMA_DC_LEFT]= x264_predict_8x16c_dc_left_c;
-    pf[I_PRED_CHROMA_DC_TOP ]= x264_predict_8x16c_dc_top_c;
-    pf[I_PRED_CHROMA_DC_128 ]= x264_predict_8x16c_dc_128_c;
+    pf[I_PRED_CHROMA_DC_LEFT]= predict_8x16c_dc_left_c;
+    pf[I_PRED_CHROMA_DC_TOP ]= predict_8x16c_dc_top_c;
+    pf[I_PRED_CHROMA_DC_128 ]= predict_8x16c_dc_128_c;
 
 #if HAVE_MMX
     x264_predict_8x16c_init_mmx( cpu, pf );
@@ -991,16 +991,16 @@ void x264_predict_8x8_init( int cpu, x264_predict8x8_t pf[12], x264_predict_8x8_
     pf[I_PRED_8x8_V]      = x264_predict_8x8_v_c;
     pf[I_PRED_8x8_H]      = x264_predict_8x8_h_c;
     pf[I_PRED_8x8_DC]     = x264_predict_8x8_dc_c;
-    pf[I_PRED_8x8_DDL]    = x264_predict_8x8_ddl_c;
-    pf[I_PRED_8x8_DDR]    = x264_predict_8x8_ddr_c;
-    pf[I_PRED_8x8_VR]     = x264_predict_8x8_vr_c;
-    pf[I_PRED_8x8_HD]     = x264_predict_8x8_hd_c;
-    pf[I_PRED_8x8_VL]     = x264_predict_8x8_vl_c;
-    pf[I_PRED_8x8_HU]     = x264_predict_8x8_hu_c;
-    pf[I_PRED_8x8_DC_LEFT]= x264_predict_8x8_dc_left_c;
-    pf[I_PRED_8x8_DC_TOP] = x264_predict_8x8_dc_top_c;
-    pf[I_PRED_8x8_DC_128] = x264_predict_8x8_dc_128_c;
-    *predict_filter       = x264_predict_8x8_filter_c;
+    pf[I_PRED_8x8_DDL]    = predict_8x8_ddl_c;
+    pf[I_PRED_8x8_DDR]    = predict_8x8_ddr_c;
+    pf[I_PRED_8x8_VR]     = predict_8x8_vr_c;
+    pf[I_PRED_8x8_HD]     = predict_8x8_hd_c;
+    pf[I_PRED_8x8_VL]     = predict_8x8_vl_c;
+    pf[I_PRED_8x8_HU]     = predict_8x8_hu_c;
+    pf[I_PRED_8x8_DC_LEFT]= predict_8x8_dc_left_c;
+    pf[I_PRED_8x8_DC_TOP] = predict_8x8_dc_top_c;
+    pf[I_PRED_8x8_DC_128] = predict_8x8_dc_128_c;
+    *predict_filter       = predict_8x8_filter_c;
 
 #if HAVE_MMX
     x264_predict_8x8_init_mmx( cpu, pf, predict_filter );
@@ -1029,15 +1029,15 @@ void x264_predict_4x4_init( int cpu, x264_predict_t pf[12] )
     pf[I_PRED_4x4_V]      = x264_predict_4x4_v_c;
     pf[I_PRED_4x4_H]      = x264_predict_4x4_h_c;
     pf[I_PRED_4x4_DC]     = x264_predict_4x4_dc_c;
-    pf[I_PRED_4x4_DDL]    = x264_predict_4x4_ddl_c;
-    pf[I_PRED_4x4_DDR]    = x264_predict_4x4_ddr_c;
-    pf[I_PRED_4x4_VR]     = x264_predict_4x4_vr_c;
-    pf[I_PRED_4x4_HD]     = x264_predict_4x4_hd_c;
-    pf[I_PRED_4x4_VL]     = x264_predict_4x4_vl_c;
-    pf[I_PRED_4x4_HU]     = x264_predict_4x4_hu_c;
-    pf[I_PRED_4x4_DC_LEFT]= x264_predict_4x4_dc_left_c;
-    pf[I_PRED_4x4_DC_TOP] = x264_predict_4x4_dc_top_c;
-    pf[I_PRED_4x4_DC_128] = x264_predict_4x4_dc_128_c;
+    pf[I_PRED_4x4_DDL]    = predict_4x4_ddl_c;
+    pf[I_PRED_4x4_DDR]    = predict_4x4_ddr_c;
+    pf[I_PRED_4x4_VR]     = predict_4x4_vr_c;
+    pf[I_PRED_4x4_HD]     = predict_4x4_hd_c;
+    pf[I_PRED_4x4_VL]     = predict_4x4_vl_c;
+    pf[I_PRED_4x4_HU]     = predict_4x4_hu_c;
+    pf[I_PRED_4x4_DC_LEFT]= predict_4x4_dc_left_c;
+    pf[I_PRED_4x4_DC_TOP] = predict_4x4_dc_top_c;
+    pf[I_PRED_4x4_DC_128] = predict_4x4_dc_128_c;
 
 #if HAVE_MMX
     x264_predict_4x4_init_mmx( cpu, pf );
index ae9622260636c5f7e924cd758d51cea32b98632b..b160cf5efde79686f4e3c1f3fff84a1123d3cd04 100644 (file)
@@ -298,7 +298,7 @@ static int optimize_chroma_2x4_dc( dctcoef dct[8], int dequant_mf )
     return optimize_chroma_dc_internal( dct, dequant_mf, 1 );
 }
 
-static void x264_denoise_dct( dctcoef *dct, uint32_t *sum, udctcoef *offset, int size )
+static void denoise_dct( dctcoef *dct, uint32_t *sum, udctcoef *offset, int size )
 {
     for( int i = 0; i < size; i++ )
     {
@@ -332,7 +332,7 @@ const uint8_t x264_decimate_table8[64] =
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
 };
 
-static int ALWAYS_INLINE x264_decimate_score_internal( dctcoef *dct, int i_max )
+static int ALWAYS_INLINE decimate_score_internal( dctcoef *dct, int i_max )
 {
     const uint8_t *ds_table = (i_max == 64) ? x264_decimate_table8 : x264_decimate_table4;
     int i_score = 0;
@@ -359,21 +359,21 @@ static int ALWAYS_INLINE x264_decimate_score_internal( dctcoef *dct, int i_max )
     return i_score;
 }
 
-static int x264_decimate_score15( dctcoef *dct )
+static int decimate_score15( dctcoef *dct )
 {
-    return x264_decimate_score_internal( dct+1, 15 );
+    return decimate_score_internal( dct+1, 15 );
 }
-static int x264_decimate_score16( dctcoef *dct )
+static int decimate_score16( dctcoef *dct )
 {
-    return x264_decimate_score_internal( dct, 16 );
+    return decimate_score_internal( dct, 16 );
 }
-static int x264_decimate_score64( dctcoef *dct )
+static int decimate_score64( dctcoef *dct )
 {
-    return x264_decimate_score_internal( dct, 64 );
+    return decimate_score_internal( dct, 64 );
 }
 
 #define last(num)\
-static int x264_coeff_last##num( dctcoef *l )\
+static int coeff_last##num( dctcoef *l )\
 {\
     int i_last = num-1;\
     while( i_last >= 0 && l[i_last] == 0 )\
@@ -388,9 +388,9 @@ last(16)
 last(64)
 
 #define level_run(num)\
-static int x264_coeff_level_run##num( dctcoef *dct, x264_run_level_t *runlevel )\
+static int coeff_level_run##num( dctcoef *dct, x264_run_level_t *runlevel )\
 {\
-    int i_last = runlevel->last = x264_coeff_last##num(dct);\
+    int i_last = runlevel->last = coeff_last##num(dct);\
     int i_total = 0;\
     int mask = 0;\
     do\
@@ -438,20 +438,20 @@ void x264_quant_init( x264_t *h, int cpu, x264_quant_function_t *pf )
     pf->optimize_chroma_2x2_dc = optimize_chroma_2x2_dc;
     pf->optimize_chroma_2x4_dc = optimize_chroma_2x4_dc;
 
-    pf->denoise_dct = x264_denoise_dct;
-    pf->decimate_score15 = x264_decimate_score15;
-    pf->decimate_score16 = x264_decimate_score16;
-    pf->decimate_score64 = x264_decimate_score64;
-
-    pf->coeff_last4 = x264_coeff_last4;
-    pf->coeff_last8 = x264_coeff_last8;
-    pf->coeff_last[  DCT_LUMA_AC] = x264_coeff_last15;
-    pf->coeff_last[ DCT_LUMA_4x4] = x264_coeff_last16;
-    pf->coeff_last[ DCT_LUMA_8x8] = x264_coeff_last64;
-    pf->coeff_level_run4 = x264_coeff_level_run4;
-    pf->coeff_level_run8 = x264_coeff_level_run8;
-    pf->coeff_level_run[  DCT_LUMA_AC] = x264_coeff_level_run15;
-    pf->coeff_level_run[ DCT_LUMA_4x4] = x264_coeff_level_run16;
+    pf->denoise_dct = denoise_dct;
+    pf->decimate_score15 = decimate_score15;
+    pf->decimate_score16 = decimate_score16;
+    pf->decimate_score64 = decimate_score64;
+
+    pf->coeff_last4 = coeff_last4;
+    pf->coeff_last8 = coeff_last8;
+    pf->coeff_last[  DCT_LUMA_AC] = coeff_last15;
+    pf->coeff_last[ DCT_LUMA_4x4] = coeff_last16;
+    pf->coeff_last[ DCT_LUMA_8x8] = coeff_last64;
+    pf->coeff_level_run4 = coeff_level_run4;
+    pf->coeff_level_run8 = coeff_level_run8;
+    pf->coeff_level_run[  DCT_LUMA_AC] = coeff_level_run15;
+    pf->coeff_level_run[ DCT_LUMA_4x4] = coeff_level_run16;
 
 #if HIGH_BIT_DEPTH
 #if HAVE_MMX
index 4057b683148f07c9ba33b4257d37afbce84f23de..9da821f1f5356b99b7c4797aa50330cbe0d31382 100644 (file)
@@ -26,7 +26,7 @@
 #include "common.h"
 
 #define CACHE_FUNC(name,size,width,height)\
-static void x264_macroblock_cache_##name##_##width##_##height( void *target, uint32_t val )\
+static void macroblock_cache_##name##_##width##_##height( void *target, uint32_t val )\
 {\
     x264_macroblock_cache_rect( target, width*size, height, size, val );\
 }
@@ -41,16 +41,16 @@ CACHE_FUNC(name,size,1,2)\
 CACHE_FUNC(name,size,1,1)\
 void (*x264_cache_##name##_func_table[10])(void *, uint32_t) =\
 {\
-    x264_macroblock_cache_##name##_1_1,\
-    x264_macroblock_cache_##name##_2_1,\
-    x264_macroblock_cache_##name##_1_2,\
-    x264_macroblock_cache_##name##_2_2,\
+    macroblock_cache_##name##_1_1,\
+    macroblock_cache_##name##_2_1,\
+    macroblock_cache_##name##_1_2,\
+    macroblock_cache_##name##_2_2,\
     NULL,\
-    x264_macroblock_cache_##name##_4_2,\
+    macroblock_cache_##name##_4_2,\
     NULL,\
-    x264_macroblock_cache_##name##_2_4,\
+    macroblock_cache_##name##_2_4,\
     NULL,\
-    x264_macroblock_cache_##name##_4_4\
+    macroblock_cache_##name##_4_4\
 };\
 
 CACHE_FUNCS(mv, 4)
index b9d94fd840569a327bd4f83a6e32af047b45f657..6659db2388afb3da901e22070d9b289d0e9251cb 100644 (file)
@@ -300,7 +300,7 @@ void x264_cqm_delete( x264_t *h )
     x264_free( h->nr_offset_emergency );
 }
 
-static int x264_cqm_parse_jmlist( x264_t *h, const char *buf, const char *name,
+static int cqm_parse_jmlist( x264_t *h, const char *buf, const char *name,
                                   uint8_t *cqm, const uint8_t *jvt, int length )
 {
     int i;
@@ -361,16 +361,16 @@ int x264_cqm_parse_file( x264_t *h, const char *filename )
     while( (p = strchr( buf, '#' )) != NULL )
         memset( p, ' ', strcspn( p, "\n" ) );
 
-    b_error |= x264_cqm_parse_jmlist( h, buf, "INTRA4X4_LUMA",   h->param.cqm_4iy, x264_cqm_jvt4i, 16 );
-    b_error |= x264_cqm_parse_jmlist( h, buf, "INTER4X4_LUMA",   h->param.cqm_4py, x264_cqm_jvt4p, 16 );
-    b_error |= x264_cqm_parse_jmlist( h, buf, "INTRA4X4_CHROMA", h->param.cqm_4ic, x264_cqm_jvt4i, 16 );
-    b_error |= x264_cqm_parse_jmlist( h, buf, "INTER4X4_CHROMA", h->param.cqm_4pc, x264_cqm_jvt4p, 16 );
-    b_error |= x264_cqm_parse_jmlist( h, buf, "INTRA8X8_LUMA",   h->param.cqm_8iy, x264_cqm_jvt8i, 64 );
-    b_error |= x264_cqm_parse_jmlist( h, buf, "INTER8X8_LUMA",   h->param.cqm_8py, x264_cqm_jvt8p, 64 );
+    b_error |= cqm_parse_jmlist( h, buf, "INTRA4X4_LUMA",   h->param.cqm_4iy, x264_cqm_jvt4i, 16 );
+    b_error |= cqm_parse_jmlist( h, buf, "INTER4X4_LUMA",   h->param.cqm_4py, x264_cqm_jvt4p, 16 );
+    b_error |= cqm_parse_jmlist( h, buf, "INTRA4X4_CHROMA", h->param.cqm_4ic, x264_cqm_jvt4i, 16 );
+    b_error |= cqm_parse_jmlist( h, buf, "INTER4X4_CHROMA", h->param.cqm_4pc, x264_cqm_jvt4p, 16 );
+    b_error |= cqm_parse_jmlist( h, buf, "INTRA8X8_LUMA",   h->param.cqm_8iy, x264_cqm_jvt8i, 64 );
+    b_error |= cqm_parse_jmlist( h, buf, "INTER8X8_LUMA",   h->param.cqm_8py, x264_cqm_jvt8p, 64 );
     if( CHROMA444 )
     {
-        b_error |= x264_cqm_parse_jmlist( h, buf, "INTRA8X8_CHROMA", h->param.cqm_8ic, x264_cqm_jvt8i, 64 );
-        b_error |= x264_cqm_parse_jmlist( h, buf, "INTER8X8_CHROMA", h->param.cqm_8pc, x264_cqm_jvt8p, 64 );
+        b_error |= cqm_parse_jmlist( h, buf, "INTRA8X8_CHROMA", h->param.cqm_8ic, x264_cqm_jvt8i, 64 );
+        b_error |= cqm_parse_jmlist( h, buf, "INTER8X8_CHROMA", h->param.cqm_8pc, x264_cqm_jvt8p, 64 );
     }
 
     x264_free( buf );
index 72eb86d0a1d14fb0128a9289aad0212c927c1232..61d75ce0c6516c956825bc965cdb8f30c537186a 100644 (file)
@@ -47,7 +47,7 @@ struct x264_threadpool_t
     x264_sync_frame_list_t done;   /* list of jobs that have finished processing */
 };
 
-static void *x264_threadpool_thread( x264_threadpool_t *pool )
+static void *threadpool_thread( x264_threadpool_t *pool )
 {
     if( pool->init_func )
         pool->init_func( pool->init_arg );
@@ -100,7 +100,7 @@ int x264_threadpool_init( x264_threadpool_t **p_pool, int threads,
        x264_sync_frame_list_push( &pool->uninit, (void*)job );
     }
     for( int i = 0; i < pool->threads; i++ )
-        if( x264_pthread_create( pool->thread_handle+i, NULL, (void*)x264_threadpool_thread, pool ) )
+        if( x264_pthread_create( pool->thread_handle+i, NULL, (void*)threadpool_thread, pool ) )
             goto fail;
 
     return 0;
@@ -137,7 +137,7 @@ void *x264_threadpool_wait( x264_threadpool_t *pool, void *arg )
     }
 }
 
-static void x264_threadpool_list_delete( x264_sync_frame_list_t *slist )
+static void threadpool_list_delete( x264_sync_frame_list_t *slist )
 {
     for( int i = 0; slist->list[i]; i++ )
     {
@@ -156,9 +156,9 @@ void x264_threadpool_delete( x264_threadpool_t *pool )
     for( int i = 0; i < pool->threads; i++ )
         x264_pthread_join( pool->thread_handle[i], NULL );
 
-    x264_threadpool_list_delete( &pool->uninit );
-    x264_threadpool_list_delete( &pool->run );
-    x264_threadpool_list_delete( &pool->done );
+    threadpool_list_delete( &pool->uninit );
+    threadpool_list_delete( &pool->run );
+    threadpool_list_delete( &pool->done );
     x264_free( pool->thread_handle );
     x264_free( pool );
 }
index 94e9d898fa0adc0a70a051655d265d086c3d6b09..8f878d94277224ada946bf50ad2c7b426436fa35 100644 (file)
@@ -51,7 +51,7 @@
 static x264_pthread_mutex_t static_mutex;
 
 /* _beginthreadex requires that the start routine is __stdcall */
-static unsigned __stdcall x264_win32thread_worker( void *arg )
+static unsigned __stdcall win32thread_worker( void *arg )
 {
     x264_pthread_t *h = arg;
     *h->p_ret = h->func( h->arg );
@@ -65,7 +65,7 @@ int x264_pthread_create( x264_pthread_t *thread, const x264_pthread_attr_t *attr
     thread->arg    = arg;
     thread->p_ret  = &thread->ret;
     thread->ret    = NULL;
-    thread->handle = (void*)_beginthreadex( NULL, 0, x264_win32thread_worker, thread, 0, NULL );
+    thread->handle = (void*)_beginthreadex( NULL, 0, win32thread_worker, thread, 0, NULL );
     return !thread->handle;
 }
 
index c06691c9526230fe8dd8f7fd77de894b0b386f4c..e617c2e0b6b140d7d7ce2b6dd78654601e6ab9fa 100644 (file)
@@ -216,7 +216,7 @@ PIXEL_AVG_WALL(cache64_ssse3)
 PIXEL_AVG_WALL(avx2)
 
 #define PIXEL_AVG_WTAB(instr, name1, name2, name3, name4, name5)\
-static void (* const x264_pixel_avg_wtab_##instr[6])( pixel *, intptr_t, pixel *, intptr_t, pixel *, intptr_t ) =\
+static void (* const pixel_avg_wtab_##instr[6])( pixel *, intptr_t, pixel *, intptr_t, pixel *, intptr_t ) =\
 {\
     NULL,\
     x264_pixel_avg2_w4_##name1,\
@@ -259,7 +259,7 @@ PIXEL_AVG_WTAB(avx2, mmx2, mmx2, sse2, sse2, avx2)
 #endif // HIGH_BIT_DEPTH
 
 #define MC_COPY_WTAB(instr, name1, name2, name3)\
-static void (* const x264_mc_copy_wtab_##instr[5])( pixel *, intptr_t, pixel *, intptr_t, int ) =\
+static void (* const mc_copy_wtab_##instr[5])( pixel *, intptr_t, pixel *, intptr_t, int ) =\
 {\
     NULL,\
     x264_mc_copy_w4_##name1,\
@@ -277,7 +277,7 @@ MC_COPY_WTAB(sse,mmx,mmx,sse)
 #endif
 
 #define MC_WEIGHT_WTAB(function, instr, name1, name2, w12version)\
-    static void (* x264_mc_##function##_wtab_##instr[6])( pixel *, intptr_t, pixel *, intptr_t, const x264_weight_t *, int ) =\
+static void (* mc_##function##_wtab_##instr[6])( pixel *, intptr_t, pixel *, intptr_t, const x264_weight_t *, int ) =\
 {\
     x264_mc_##function##_w4_##name1,\
     x264_mc_##function##_w4_##name1,\
@@ -295,7 +295,7 @@ MC_WEIGHT_WTAB(weight,sse2,mmx2,sse2,12)
 MC_WEIGHT_WTAB(offsetadd,sse2,mmx2,sse2,16)
 MC_WEIGHT_WTAB(offsetsub,sse2,mmx2,sse2,16)
 
-static void x264_weight_cache_mmx2( x264_t *h, x264_weight_t *w )
+static void weight_cache_mmx2( x264_t *h, x264_weight_t *w )
 {
     if( w->i_scale == 1<<w->i_denom )
     {
@@ -327,7 +327,7 @@ MC_WEIGHT_WTAB(offsetsub,sse2,mmx2,mmx2,16)
 MC_WEIGHT_WTAB(weight,ssse3,ssse3,ssse3,16)
 MC_WEIGHT_WTAB(weight,avx2,ssse3,avx2,16)
 
-static void x264_weight_cache_mmx2( x264_t *h, x264_weight_t *w )
+static void weight_cache_mmx2( x264_t *h, x264_weight_t *w )
 {
     int i;
     int16_t den1;
@@ -350,7 +350,7 @@ static void x264_weight_cache_mmx2( x264_t *h, x264_weight_t *w )
     }
 }
 
-static void x264_weight_cache_ssse3( x264_t *h, x264_weight_t *w )
+static void weight_cache_ssse3( x264_t *h, x264_weight_t *w )
 {
     int i, den1;
     if( w->i_scale == 1<<w->i_denom )
@@ -385,7 +385,7 @@ static void mc_luma_##name( pixel *dst,    intptr_t i_dst_stride,\
     if( qpel_idx & 5 ) /* qpel interpolation needed */\
     {\
         pixel *src2 = src[x264_hpel_ref1[qpel_idx]] + offset + ((mvx&3) == 3);\
-        x264_pixel_avg_wtab_##instr1[i_width>>2](\
+        pixel_avg_wtab_##instr1[i_width>>2](\
                 dst, i_dst_stride, src1, i_src_stride,\
                 src2, i_height );\
         if( weight->weightfn )\
@@ -394,7 +394,7 @@ static void mc_luma_##name( pixel *dst,    intptr_t i_dst_stride,\
     else if( weight->weightfn )\
         weight->weightfn[i_width>>2]( dst, i_dst_stride, src1, i_src_stride, weight, i_height );\
     else\
-        x264_mc_copy_wtab_##instr2[i_width>>2](dst, i_dst_stride, src1, i_src_stride, i_height );\
+        mc_copy_wtab_##instr2[i_width>>2](dst, i_dst_stride, src1, i_src_stride, i_height );\
 }
 
 MC_LUMA(mmx2,mmx2,mmx)
@@ -423,7 +423,7 @@ static pixel *get_ref_##name( pixel *dst,   intptr_t *i_dst_stride,\
     if( qpel_idx & 5 ) /* qpel interpolation needed */\
     {\
         pixel *src2 = src[x264_hpel_ref1[qpel_idx]] + offset + ((mvx&3) == 3);\
-        x264_pixel_avg_wtab_##name[i_width>>2](\
+        pixel_avg_wtab_##name[i_width>>2](\
                 dst, *i_dst_stride, src1, i_src_stride,\
                 src2, i_height );\
         if( weight->weightfn )\
@@ -559,9 +559,9 @@ void x264_mbtree_propagate_list_internal_avx512( size_t len, uint16_t *ref_costs
                                                  uint16_t *lowres_costs, int bipred_weight, int mb_y,
                                                  int width, int height, int stride, int list_mask );
 
-static void x264_mbtree_propagate_list_avx512( x264_t *h, uint16_t *ref_costs, int16_t (*mvs)[2],
-                                               int16_t *propagate_amount, uint16_t *lowres_costs,
-                                               int bipred_weight, int mb_y, int len, int list )
+static void mbtree_propagate_list_avx512( x264_t *h, uint16_t *ref_costs, int16_t (*mvs)[2],
+                                          int16_t *propagate_amount, uint16_t *lowres_costs,
+                                          int bipred_weight, int mb_y, int len, int list )
 {
     x264_mbtree_propagate_list_internal_avx512( len, ref_costs, mvs, propagate_amount, lowres_costs, bipred_weight << 9,
                                                 mb_y << 16, h->mb.i_mb_width, h->mb.i_mb_height, h->mb.i_mb_stride,
@@ -588,7 +588,7 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
     pf->prefetch_fenc_422 = x264_prefetch_fenc_422_mmx2;
     pf->prefetch_ref  = x264_prefetch_ref_mmx2;
 
-    pf->plane_copy_interleave = x264_plane_copy_interleave_mmx2;
+    pf->plane_copy_interleave = plane_copy_interleave_mmx2;
     pf->store_interleave_chroma = x264_store_interleave_chroma_mmx2;
 
     pf->avg[PIXEL_16x16] = x264_pixel_avg_16x16_mmx2;
@@ -605,10 +605,10 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
     pf->get_ref = get_ref_mmx2;
     pf->mc_chroma = x264_mc_chroma_mmx2;
     pf->hpel_filter = x264_hpel_filter_mmx2;
-    pf->weight = x264_mc_weight_wtab_mmx2;
-    pf->weight_cache = x264_weight_cache_mmx2;
-    pf->offsetadd = x264_mc_offsetadd_wtab_mmx2;
-    pf->offsetsub = x264_mc_offsetsub_wtab_mmx2;
+    pf->weight = mc_weight_wtab_mmx2;
+    pf->weight_cache = weight_cache_mmx2;
+    pf->offsetadd = mc_offsetadd_wtab_mmx2;
+    pf->offsetsub = mc_offsetsub_wtab_mmx2;
 
     pf->frame_init_lowres_core = x264_frame_init_lowres_core_mmx2;
 
@@ -616,7 +616,7 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
     {
         pf->memcpy_aligned  = x264_memcpy_aligned_sse;
         pf->memzero_aligned = x264_memzero_aligned_sse;
-        pf->plane_copy = x264_plane_copy_sse;
+        pf->plane_copy = plane_copy_sse;
     }
 
 #if HIGH_BIT_DEPTH
@@ -633,9 +633,9 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
     pf->load_deinterleave_chroma_fenc = x264_load_deinterleave_chroma_fenc_sse2;
     pf->load_deinterleave_chroma_fdec = x264_load_deinterleave_chroma_fdec_sse2;
 
-    pf->plane_copy_interleave   = x264_plane_copy_interleave_sse2;
+    pf->plane_copy_interleave   = plane_copy_interleave_sse2;
     pf->plane_copy_deinterleave = x264_plane_copy_deinterleave_sse2;
-    pf->plane_copy_deinterleave_yuyv = x264_plane_copy_deinterleave_yuyv_sse2;
+    pf->plane_copy_deinterleave_yuyv = plane_copy_deinterleave_yuyv_sse2;
 
     if( cpu&X264_CPU_SSE2_IS_FAST )
     {
@@ -648,8 +648,8 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
     pf->integral_init8v = x264_integral_init8v_sse2;
     pf->mbtree_propagate_cost = x264_mbtree_propagate_cost_sse2;
     pf->store_interleave_chroma = x264_store_interleave_chroma_sse2;
-    pf->offsetadd = x264_mc_offsetadd_wtab_sse2;
-    pf->offsetsub = x264_mc_offsetsub_wtab_sse2;
+    pf->offsetadd = mc_offsetadd_wtab_sse2;
+    pf->offsetsub = mc_offsetsub_wtab_sse2;
 
     if( cpu&X264_CPU_SSE2_IS_SLOW )
         return;
@@ -665,7 +665,7 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
     pf->avg[PIXEL_4x2]   = x264_pixel_avg_4x2_sse2;
 
     pf->copy[PIXEL_16x16] = x264_mc_copy_w16_aligned_sse;
-    pf->weight = x264_mc_weight_wtab_sse2;
+    pf->weight = mc_weight_wtab_sse2;
 
     if( !(cpu&X264_CPU_STACK_MOD4) )
         pf->mc_chroma = x264_mc_chroma_sse2;
@@ -674,9 +674,9 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
         return;
 
     pf->frame_init_lowres_core = x264_frame_init_lowres_core_ssse3;
-    pf->plane_copy_swap = x264_plane_copy_swap_ssse3;
+    pf->plane_copy_swap = plane_copy_swap_ssse3;
     pf->plane_copy_deinterleave_v210 = x264_plane_copy_deinterleave_v210_ssse3;
-    pf->mbtree_propagate_list = x264_mbtree_propagate_list_ssse3;
+    pf->mbtree_propagate_list = mbtree_propagate_list_ssse3;
     pf->mbtree_fix8_pack      = x264_mbtree_fix8_pack_ssse3;
     pf->mbtree_fix8_unpack    = x264_mbtree_fix8_unpack_ssse3;
 
@@ -689,9 +689,9 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
     pf->frame_init_lowres_core = x264_frame_init_lowres_core_avx;
     pf->load_deinterleave_chroma_fenc = x264_load_deinterleave_chroma_fenc_avx;
     pf->load_deinterleave_chroma_fdec = x264_load_deinterleave_chroma_fdec_avx;
-    pf->plane_copy_interleave        = x264_plane_copy_interleave_avx;
+    pf->plane_copy_interleave        = plane_copy_interleave_avx;
     pf->plane_copy_deinterleave      = x264_plane_copy_deinterleave_avx;
-    pf->plane_copy_deinterleave_yuyv = x264_plane_copy_deinterleave_yuyv_avx;
+    pf->plane_copy_deinterleave_yuyv = plane_copy_deinterleave_yuyv_avx;
     pf->plane_copy_deinterleave_v210 = x264_plane_copy_deinterleave_v210_avx;
     pf->store_interleave_chroma      = x264_store_interleave_chroma_avx;
     pf->copy[PIXEL_16x16]            = x264_mc_copy_w16_aligned_avx;
@@ -738,18 +738,18 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
     pf->hpel_filter = x264_hpel_filter_sse2_amd;
     pf->mbtree_propagate_cost = x264_mbtree_propagate_cost_sse2;
     pf->plane_copy_deinterleave = x264_plane_copy_deinterleave_sse2;
-    pf->plane_copy_deinterleave_yuyv = x264_plane_copy_deinterleave_yuyv_sse2;
+    pf->plane_copy_deinterleave_yuyv = plane_copy_deinterleave_yuyv_sse2;
     pf->load_deinterleave_chroma_fenc = x264_load_deinterleave_chroma_fenc_sse2;
     pf->load_deinterleave_chroma_fdec = x264_load_deinterleave_chroma_fdec_sse2;
     pf->plane_copy_deinterleave_rgb = x264_plane_copy_deinterleave_rgb_sse2;
 
     if( !(cpu&X264_CPU_SSE2_IS_SLOW) )
     {
-        pf->weight = x264_mc_weight_wtab_sse2;
+        pf->weight = mc_weight_wtab_sse2;
         if( !(cpu&X264_CPU_SLOW_ATOM) )
         {
-            pf->offsetadd = x264_mc_offsetadd_wtab_sse2;
-            pf->offsetsub = x264_mc_offsetsub_wtab_sse2;
+            pf->offsetadd = mc_offsetadd_wtab_sse2;
+            pf->offsetsub = mc_offsetsub_wtab_sse2;
         }
 
         pf->copy[PIXEL_16x16] = x264_mc_copy_w16_aligned_sse;
@@ -766,7 +766,7 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
         if( cpu&X264_CPU_SSE2_IS_FAST )
         {
             pf->store_interleave_chroma = x264_store_interleave_chroma_sse2; // FIXME sse2fast? sse2medium?
-            pf->plane_copy_interleave   = x264_plane_copy_interleave_sse2;
+            pf->plane_copy_interleave   = plane_copy_interleave_sse2;
             pf->mc_luma = mc_luma_sse2;
             pf->get_ref = get_ref_sse2;
             if( cpu&X264_CPU_CACHELINE_64 )
@@ -789,9 +789,9 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
     pf->avg[PIXEL_4x8]   = x264_pixel_avg_4x8_ssse3;
     pf->avg[PIXEL_4x4]   = x264_pixel_avg_4x4_ssse3;
     pf->avg[PIXEL_4x2]   = x264_pixel_avg_4x2_ssse3;
-    pf->plane_copy_swap = x264_plane_copy_swap_ssse3;
+    pf->plane_copy_swap  = plane_copy_swap_ssse3;
     pf->plane_copy_deinterleave_rgb = x264_plane_copy_deinterleave_rgb_ssse3;
-    pf->mbtree_propagate_list = x264_mbtree_propagate_list_ssse3;
+    pf->mbtree_propagate_list = mbtree_propagate_list_ssse3;
     pf->mbtree_fix8_pack      = x264_mbtree_fix8_pack_ssse3;
     pf->mbtree_fix8_unpack    = x264_mbtree_fix8_unpack_ssse3;
 
@@ -800,7 +800,7 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
         pf->load_deinterleave_chroma_fenc = x264_load_deinterleave_chroma_fenc_ssse3;
         pf->load_deinterleave_chroma_fdec = x264_load_deinterleave_chroma_fdec_ssse3;
         pf->plane_copy_deinterleave = x264_plane_copy_deinterleave_ssse3;
-        pf->plane_copy_deinterleave_yuyv = x264_plane_copy_deinterleave_yuyv_ssse3;
+        pf->plane_copy_deinterleave_yuyv = plane_copy_deinterleave_yuyv_ssse3;
     }
 
     if( !(cpu&X264_CPU_SLOW_PALIGNR) )
@@ -827,8 +827,8 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
         }
     }
 
-    pf->weight_cache = x264_weight_cache_ssse3;
-    pf->weight = x264_mc_weight_wtab_ssse3;
+    pf->weight_cache = weight_cache_ssse3;
+    pf->weight = mc_weight_wtab_ssse3;
 
     if( !(cpu&(X264_CPU_SLOW_SHUFFLE|X264_CPU_SLOW_ATOM|X264_CPU_SLOW_PALIGNR)) )
         pf->integral_init4v = x264_integral_init4v_ssse3;
@@ -856,7 +856,7 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
     {
         pf->hpel_filter = x264_hpel_filter_avx2;
         pf->mc_chroma = x264_mc_chroma_avx2;
-        pf->weight = x264_mc_weight_wtab_avx2;
+        pf->weight = mc_weight_wtab_avx2;
         pf->avg[PIXEL_16x16] = x264_pixel_avg_16x16_avx2;
         pf->avg[PIXEL_16x8]  = x264_pixel_avg_16x8_avx2;
         pf->integral_init8v = x264_integral_init8v_avx2;
@@ -881,22 +881,22 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
         return;
     pf->memcpy_aligned  = x264_memcpy_aligned_avx;
     pf->memzero_aligned = x264_memzero_aligned_avx;
-    pf->plane_copy = x264_plane_copy_avx;
+    pf->plane_copy = plane_copy_avx;
     pf->mbtree_propagate_cost = x264_mbtree_propagate_cost_avx;
-    pf->mbtree_propagate_list = x264_mbtree_propagate_list_avx;
+    pf->mbtree_propagate_list = mbtree_propagate_list_avx;
 
     if( cpu&X264_CPU_FMA4 )
         pf->mbtree_propagate_cost = x264_mbtree_propagate_cost_fma4;
 
     if( !(cpu&X264_CPU_AVX2) )
         return;
-    pf->plane_copy_swap = x264_plane_copy_swap_avx2;
+    pf->plane_copy_swap = plane_copy_swap_avx2;
     pf->plane_copy_deinterleave = x264_plane_copy_deinterleave_avx2;
-    pf->plane_copy_deinterleave_yuyv = x264_plane_copy_deinterleave_yuyv_avx2;
+    pf->plane_copy_deinterleave_yuyv = plane_copy_deinterleave_yuyv_avx2;
     pf->load_deinterleave_chroma_fenc = x264_load_deinterleave_chroma_fenc_avx2;
     pf->get_ref = get_ref_avx2;
     pf->mbtree_propagate_cost = x264_mbtree_propagate_cost_avx2;
-    pf->mbtree_propagate_list = x264_mbtree_propagate_list_avx2;
+    pf->mbtree_propagate_list = mbtree_propagate_list_avx2;
     pf->mbtree_fix8_pack      = x264_mbtree_fix8_pack_avx2;
     pf->mbtree_fix8_unpack    = x264_mbtree_fix8_unpack_avx2;
 
@@ -906,6 +906,6 @@ void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf )
     pf->memzero_aligned = x264_memzero_aligned_avx512;
     pf->mbtree_propagate_cost = x264_mbtree_propagate_cost_avx512;
 #if ARCH_X86_64
-    pf->mbtree_propagate_list = x264_mbtree_propagate_list_avx512;
+    pf->mbtree_propagate_list = mbtree_propagate_list_avx512;
 #endif
 }
index 27da63a211114666267ed1577cc1dde198729158..aca2504550ebd01178ee6ced98ef57706888615b 100644 (file)
@@ -70,7 +70,7 @@ ALIGNED_8( static const int8_t pb_m32101234[8] ) = {-3,-2,-1,0,1,2,3,4};
         x264_predict_16x16_p_core_##name( src, i00, b, c );
 
 #define PREDICT_16x16_P(name, name2)\
-static void x264_predict_16x16_p_##name( pixel *src )\
+static void predict_16x16_p_##name( pixel *src )\
 {\
     PREDICT_16x16_P_CORE\
     PREDICT_16x16_P_END(name2)\
@@ -128,7 +128,7 @@ static void x264_predict_16x16_p_##name( pixel *src )\
       + 1 * ( src[ 8*FDEC_STRIDE-1] - src[ 6*FDEC_STRIDE-1] );
 
 #define PREDICT_16x16_P_INLINE(name, name2)\
-static void x264_predict_16x16_p_##name( pixel *src )\
+static void predict_16x16_p_##name( pixel *src )\
 {\
     PREDICT_16x16_P_CORE_INLINE\
     PREDICT_16x16_P_END(name2)\
@@ -174,7 +174,7 @@ PREDICT_16x16_P_INLINE( avx2, avx2 )
 #endif // HIGH_BIT_DEPTH
 
 #define PREDICT_8x16C_P(name)\
-static void x264_predict_8x16c_p_##name( pixel *src )\
+static void predict_8x16c_p_##name( pixel *src )\
 {\
     PREDICT_8x16C_P_CORE\
     PREDICT_8x16C_P_END(name)\
@@ -211,7 +211,7 @@ PREDICT_8x16C_P( avx2 )
 #endif // HIGH_BIT_DEPTH
 
 #define PREDICT_8x8C_P(name, name2)\
-static void x264_predict_8x8c_p_##name( pixel *src )\
+static void predict_8x8c_p_##name( pixel *src )\
 {\
     PREDICT_8x8C_P_CORE\
     PREDICT_8x8C_P_END(name2)\
@@ -257,7 +257,7 @@ static void x264_predict_8x8c_p_##name( pixel *src )\
     H += -4 * src[-1*FDEC_STRIDE -1];
 
 #define PREDICT_8x8C_P_INLINE(name, name2)\
-static void x264_predict_8x8c_p_##name( pixel *src )\
+static void predict_8x8c_p_##name( pixel *src )\
 {\
     PREDICT_8x8C_P_CORE_INLINE\
     PREDICT_8x8C_P_END(name2)\
@@ -281,7 +281,7 @@ PREDICT_8x8C_P_INLINE( avx, avx )
 PREDICT_8x8C_P_INLINE( avx2, avx2 )
 
 #if ARCH_X86_64 && !HIGH_BIT_DEPTH
-static void x264_predict_8x8c_dc_left( uint8_t *src )
+static void predict_8x8c_dc_left( uint8_t *src )
 {
     int y;
     uint32_t s0 = 0, s1 = 0;
@@ -327,7 +327,7 @@ void x264_predict_16x16_init_mmx( int cpu, x264_predict_t pf[7] )
     pf[I_PRED_16x16_DC_TOP]  = x264_predict_16x16_dc_top_sse2;
     pf[I_PRED_16x16_DC_LEFT] = x264_predict_16x16_dc_left_sse2;
     pf[I_PRED_16x16_H]       = x264_predict_16x16_h_sse2;
-    pf[I_PRED_16x16_P]       = x264_predict_16x16_p_sse2;
+    pf[I_PRED_16x16_P]       = predict_16x16_p_sse2;
     if( !(cpu&X264_CPU_AVX) )
         return;
     pf[I_PRED_16x16_V]       = x264_predict_16x16_v_avx;
@@ -336,7 +336,7 @@ void x264_predict_16x16_init_mmx( int cpu, x264_predict_t pf[7] )
     pf[I_PRED_16x16_H]       = x264_predict_16x16_h_avx2;
 #else
 #if !ARCH_X86_64
-    pf[I_PRED_16x16_P]       = x264_predict_16x16_p_mmx2;
+    pf[I_PRED_16x16_P]       = predict_16x16_p_mmx2;
 #endif
     if( !(cpu&X264_CPU_SSE) )
         return;
@@ -348,22 +348,22 @@ void x264_predict_16x16_init_mmx( int cpu, x264_predict_t pf[7] )
         return;
     pf[I_PRED_16x16_DC_TOP]  = x264_predict_16x16_dc_top_sse2;
     pf[I_PRED_16x16_DC_LEFT] = x264_predict_16x16_dc_left_sse2;
-    pf[I_PRED_16x16_P]       = x264_predict_16x16_p_sse2;
+    pf[I_PRED_16x16_P]       = predict_16x16_p_sse2;
     if( !(cpu&X264_CPU_SSSE3) )
         return;
     if( !(cpu&X264_CPU_SLOW_PSHUFB) )
         pf[I_PRED_16x16_H]       = x264_predict_16x16_h_ssse3;
 #if HAVE_X86_INLINE_ASM
-    pf[I_PRED_16x16_P]       = x264_predict_16x16_p_ssse3;
+    pf[I_PRED_16x16_P]       = predict_16x16_p_ssse3;
 #endif
     if( !(cpu&X264_CPU_AVX) )
         return;
-    pf[I_PRED_16x16_P]       = x264_predict_16x16_p_avx;
+    pf[I_PRED_16x16_P]       = predict_16x16_p_avx;
 #endif // HIGH_BIT_DEPTH
 
     if( cpu&X264_CPU_AVX2 )
     {
-        pf[I_PRED_16x16_P]       = x264_predict_16x16_p_avx2;
+        pf[I_PRED_16x16_P]       = predict_16x16_p_avx2;
         pf[I_PRED_16x16_DC]      = x264_predict_16x16_dc_avx2;
         pf[I_PRED_16x16_DC_TOP]  = x264_predict_16x16_dc_top_avx2;
         pf[I_PRED_16x16_DC_LEFT] = x264_predict_16x16_dc_left_avx2;
@@ -388,16 +388,16 @@ void x264_predict_8x8c_init_mmx( int cpu, x264_predict_t pf[7] )
     pf[I_PRED_CHROMA_DC]      = x264_predict_8x8c_dc_sse2;
     pf[I_PRED_CHROMA_DC_TOP]  = x264_predict_8x8c_dc_top_sse2;
     pf[I_PRED_CHROMA_H]       = x264_predict_8x8c_h_sse2;
-    pf[I_PRED_CHROMA_P]       = x264_predict_8x8c_p_sse2;
+    pf[I_PRED_CHROMA_P]       = predict_8x8c_p_sse2;
     if( !(cpu&X264_CPU_AVX) )
         return;
-    pf[I_PRED_CHROMA_P]       = x264_predict_8x8c_p_avx;
+    pf[I_PRED_CHROMA_P]       = predict_8x8c_p_avx;
     if( !(cpu&X264_CPU_AVX2) )
         return;
     pf[I_PRED_CHROMA_H]   = x264_predict_8x8c_h_avx2;
 #else
 #if ARCH_X86_64
-    pf[I_PRED_CHROMA_DC_LEFT] = x264_predict_8x8c_dc_left;
+    pf[I_PRED_CHROMA_DC_LEFT] = predict_8x8c_dc_left;
 #endif
     pf[I_PRED_CHROMA_V]       = x264_predict_8x8c_v_mmx;
     if( !(cpu&X264_CPU_MMX2) )
@@ -405,26 +405,26 @@ void x264_predict_8x8c_init_mmx( int cpu, x264_predict_t pf[7] )
     pf[I_PRED_CHROMA_DC_TOP]  = x264_predict_8x8c_dc_top_mmx2;
     pf[I_PRED_CHROMA_H]       = x264_predict_8x8c_h_mmx2;
 #if !ARCH_X86_64
-    pf[I_PRED_CHROMA_P]       = x264_predict_8x8c_p_mmx2;
+    pf[I_PRED_CHROMA_P]       = predict_8x8c_p_mmx2;
 #endif
     pf[I_PRED_CHROMA_DC]      = x264_predict_8x8c_dc_mmx2;
     if( !(cpu&X264_CPU_SSE2) )
         return;
-    pf[I_PRED_CHROMA_P]       = x264_predict_8x8c_p_sse2;
+    pf[I_PRED_CHROMA_P]       = predict_8x8c_p_sse2;
     if( !(cpu&X264_CPU_SSSE3) )
         return;
     pf[I_PRED_CHROMA_H]       = x264_predict_8x8c_h_ssse3;
 #if HAVE_X86_INLINE_ASM
-    pf[I_PRED_CHROMA_P]       = x264_predict_8x8c_p_ssse3;
+    pf[I_PRED_CHROMA_P]       = predict_8x8c_p_ssse3;
 #endif
     if( !(cpu&X264_CPU_AVX) )
         return;
-    pf[I_PRED_CHROMA_P]       = x264_predict_8x8c_p_avx;
+    pf[I_PRED_CHROMA_P]       = predict_8x8c_p_avx;
 #endif // HIGH_BIT_DEPTH
 
     if( cpu&X264_CPU_AVX2 )
     {
-        pf[I_PRED_CHROMA_P]   = x264_predict_8x8c_p_avx2;
+        pf[I_PRED_CHROMA_P]   = predict_8x8c_p_avx2;
     }
 }
 
@@ -445,10 +445,10 @@ void x264_predict_8x16c_init_mmx( int cpu, x264_predict_t pf[7] )
     pf[I_PRED_CHROMA_DC_TOP]  = x264_predict_8x16c_dc_top_sse2;
     pf[I_PRED_CHROMA_DC]      = x264_predict_8x16c_dc_sse2;
     pf[I_PRED_CHROMA_H]       = x264_predict_8x16c_h_sse2;
-    pf[I_PRED_CHROMA_P]       = x264_predict_8x16c_p_sse2;
+    pf[I_PRED_CHROMA_P]       = predict_8x16c_p_sse2;
     if( !(cpu&X264_CPU_AVX) )
         return;
-    pf[I_PRED_CHROMA_P]       = x264_predict_8x16c_p_avx;
+    pf[I_PRED_CHROMA_P]       = predict_8x16c_p_avx;
     if( !(cpu&X264_CPU_AVX2) )
         return;
     pf[I_PRED_CHROMA_H]   = x264_predict_8x16c_h_avx2;
@@ -460,22 +460,22 @@ void x264_predict_8x16c_init_mmx( int cpu, x264_predict_t pf[7] )
     pf[I_PRED_CHROMA_DC]      = x264_predict_8x16c_dc_mmx2;
     pf[I_PRED_CHROMA_H]       = x264_predict_8x16c_h_mmx2;
 #if !ARCH_X86_64
-    pf[I_PRED_CHROMA_P]       = x264_predict_8x16c_p_mmx2;
+    pf[I_PRED_CHROMA_P]       = predict_8x16c_p_mmx2;
 #endif
     if( !(cpu&X264_CPU_SSE2) )
         return;
-    pf[I_PRED_CHROMA_P]       = x264_predict_8x16c_p_sse2;
+    pf[I_PRED_CHROMA_P]       = predict_8x16c_p_sse2;
     if( !(cpu&X264_CPU_SSSE3) )
         return;
     pf[I_PRED_CHROMA_H]       = x264_predict_8x16c_h_ssse3;
     if( !(cpu&X264_CPU_AVX) )
         return;
-    pf[I_PRED_CHROMA_P]       = x264_predict_8x16c_p_avx;
+    pf[I_PRED_CHROMA_P]       = predict_8x16c_p_avx;
 #endif // HIGH_BIT_DEPTH
 
     if( cpu&X264_CPU_AVX2 )
     {
-        pf[I_PRED_CHROMA_P]   = x264_predict_8x16c_p_avx2;
+        pf[I_PRED_CHROMA_P]   = predict_8x16c_p_avx2;
     }
 }
 
index 036d6c15397d7a4dd6f1f1876427d0f4dfc86a96..45c9767e6f1eedcf864aba9dac0987531e40d967 100644 (file)
@@ -256,7 +256,7 @@ static const uint8_t i_sub_mb_p_cost_table[4] =
     5, 3, 3, 1
 };
 
-static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a );
+static void analyse_update_cache( x264_t *h, x264_mb_analysis_t *a );
 
 static uint16_t x264_cost_ref[QP_MAX+1][3][33];
 static UNUSED x264_pthread_mutex_t cost_ref_mutex = X264_PTHREAD_MUTEX_INITIALIZER;
@@ -367,14 +367,14 @@ void x264_analyse_weight_frame( x264_t *h, int end )
 }
 
 /* initialize an array of lambda*nbits for all possible mvs */
-static void x264_mb_analyse_load_costs( x264_t *h, x264_mb_analysis_t *a )
+static void mb_analyse_load_costs( x264_t *h, x264_mb_analysis_t *a )
 {
     a->p_cost_mv = h->cost_mv[a->i_qp];
     a->p_cost_ref[0] = x264_cost_ref[a->i_qp][x264_clip3(h->sh.i_num_ref_idx_l0_active-1,0,2)];
     a->p_cost_ref[1] = x264_cost_ref[a->i_qp][x264_clip3(h->sh.i_num_ref_idx_l1_active-1,0,2)];
 }
 
-static void x264_mb_analyse_init_qp( x264_t *h, x264_mb_analysis_t *a, int qp )
+static void mb_analyse_init_qp( x264_t *h, x264_mb_analysis_t *a, int qp )
 {
     int effective_chroma_qp = h->chroma_qp_table[SPEC_QP(qp)] + X264_MAX( qp - QP_MAX_SPEC, 0 );
     a->i_lambda = x264_lambda_tab[qp];
@@ -413,7 +413,7 @@ static void x264_mb_analyse_init_qp( x264_t *h, x264_mb_analysis_t *a, int qp )
     h->mb.i_chroma_qp = h->chroma_qp_table[qp];
 }
 
-static void x264_mb_analyse_init( x264_t *h, x264_mb_analysis_t *a, int qp )
+static void mb_analyse_init( x264_t *h, x264_mb_analysis_t *a, int qp )
 {
     int subme = h->param.analyse.i_subpel_refine - (h->sh.i_type == SLICE_TYPE_B);
 
@@ -424,7 +424,7 @@ static void x264_mb_analyse_init( x264_t *h, x264_mb_analysis_t *a, int qp )
     h->mb.b_deblock_rdo = h->param.analyse.i_subpel_refine >= 9 && h->sh.i_disable_deblocking_filter_idc != 1;
     a->b_early_terminate = h->param.analyse.i_subpel_refine < 11;
 
-    x264_mb_analyse_init_qp( h, a, qp );
+    mb_analyse_init_qp( h, a, qp );
 
     h->mb.b_transform_8x8 = 0;
 
@@ -682,7 +682,7 @@ static ALWAYS_INLINE const int8_t *predict_4x4_mode_available( int force_intra,
 }
 
 /* For trellis=2, we need to do this for both sizes of DCT, for trellis=1 we only need to use it on the chosen mode. */
-static void inline x264_psy_trellis_init( x264_t *h, int do_both_dct )
+static void inline psy_trellis_init( x264_t *h, int do_both_dct )
 {
     ALIGNED_16( static pixel zero[16*FDEC_STRIDE] ) = {0};
 
@@ -693,10 +693,10 @@ static void inline x264_psy_trellis_init( x264_t *h, int do_both_dct )
 }
 
 /* Reset fenc satd scores cache for psy RD */
-static inline void x264_mb_init_fenc_cache( x264_t *h, int b_satd )
+static inline void mb_init_fenc_cache( x264_t *h, int b_satd )
 {
     if( h->param.analyse.i_trellis == 2 && h->mb.i_psy_trellis )
-        x264_psy_trellis_init( h, h->param.analyse.b_transform_8x8 );
+        psy_trellis_init( h, h->param.analyse.b_transform_8x8 );
     if( !h->mb.i_psy_rd )
         return;
 
@@ -709,7 +709,7 @@ static inline void x264_mb_init_fenc_cache( x264_t *h, int b_satd )
         h->mc.memzero_aligned( h->mb.pic.fenc_satd_cache, sizeof(h->mb.pic.fenc_satd_cache) );
 }
 
-static void x264_mb_analyse_intra_chroma( x264_t *h, x264_mb_analysis_t *a )
+static void mb_analyse_intra_chroma( x264_t *h, x264_mb_analysis_t *a )
 {
     if( a->i_satd_chroma < COST_MAX )
         return;
@@ -791,7 +791,7 @@ static void x264_mb_analyse_intra_chroma( x264_t *h, x264_mb_analysis_t *a )
 }
 
 /* FIXME: should we do any sort of merged chroma analysis with 4:4:4? */
-static void x264_mb_analyse_intra( x264_t *h, x264_mb_analysis_t *a, int i_satd_inter )
+static void mb_analyse_intra( x264_t *h, x264_mb_analysis_t *a, int i_satd_inter )
 {
     const unsigned int flags = h->sh.i_type == SLICE_TYPE_I ? h->param.analyse.intra : h->param.analyse.inter;
     pixel *p_src = h->mb.pic.p_fenc[0];
@@ -1103,7 +1103,7 @@ static void x264_mb_analyse_intra( x264_t *h, x264_mb_analysis_t *a, int i_satd_
     }
 }
 
-static void x264_intra_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_thresh )
+static void intra_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_thresh )
 {
     if( !a->b_early_terminate )
         i_satd_thresh = COST_MAX;
@@ -1111,8 +1111,8 @@ static void x264_intra_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_thresh )
     if( a->i_satd_i16x16 < i_satd_thresh )
     {
         h->mb.i_type = I_16x16;
-        x264_analyse_update_cache( h, a );
-        a->i_satd_i16x16 = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->i_satd_i16x16 = rd_cost_mb( h, a->i_lambda2 );
     }
     else
         a->i_satd_i16x16 = COST_MAX;
@@ -1120,8 +1120,8 @@ static void x264_intra_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_thresh )
     if( a->i_satd_i4x4 < i_satd_thresh )
     {
         h->mb.i_type = I_4x4;
-        x264_analyse_update_cache( h, a );
-        a->i_satd_i4x4 = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->i_satd_i4x4 = rd_cost_mb( h, a->i_lambda2 );
     }
     else
         a->i_satd_i4x4 = COST_MAX;
@@ -1129,15 +1129,15 @@ static void x264_intra_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_thresh )
     if( a->i_satd_i8x8 < i_satd_thresh )
     {
         h->mb.i_type = I_8x8;
-        x264_analyse_update_cache( h, a );
-        a->i_satd_i8x8 = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->i_satd_i8x8 = rd_cost_mb( h, a->i_lambda2 );
         a->i_cbp_i8x8_luma = h->mb.i_cbp_luma;
     }
     else
         a->i_satd_i8x8 = COST_MAX;
 }
 
-static void x264_intra_rd_refine( x264_t *h, x264_mb_analysis_t *a )
+static void intra_rd_refine( x264_t *h, x264_mb_analysis_t *a )
 {
     uint64_t i_satd, i_best;
     int plane_count = CHROMA444 ? 3 : 1;
@@ -1155,7 +1155,7 @@ static void x264_intra_rd_refine( x264_t *h, x264_mb_analysis_t *a )
             if( i_mode == old_pred_mode || a->i_satd_i16x16_dir[i_mode] > i_thresh )
                 continue;
             h->mb.i_intra16x16_pred_mode = i_mode;
-            i_satd = x264_rd_cost_mb( h, a->i_lambda2 );
+            i_satd = rd_cost_mb( h, a->i_lambda2 );
             COPY2_IF_LT( i_best, i_satd, a->i_predict16x16, i_mode );
         }
     }
@@ -1181,10 +1181,10 @@ static void x264_intra_rd_refine( x264_t *h, x264_mb_analysis_t *a )
             {
                 int i_cbp_chroma_best = h->mb.i_cbp_chroma;
                 int i_chroma_lambda = x264_lambda2_tab[h->mb.i_chroma_qp];
-                /* the previous thing encoded was x264_intra_rd(), so the pixels and
+                /* the previous thing encoded was intra_rd(), so the pixels and
                  * coefs for the current chroma mode are still around, so we only
                  * have to recount the bits. */
-                i_best = x264_rd_cost_chroma( h, i_chroma_lambda, a->i_predict8x8chroma, 0 );
+                i_best = rd_cost_chroma( h, i_chroma_lambda, a->i_predict8x8chroma, 0 );
                 for( int i = 0; i < i_max; i++ )
                 {
                     int i_mode = predict_mode_sorted[i];
@@ -1198,7 +1198,7 @@ static void x264_intra_rd_refine( x264_t *h, x264_mb_analysis_t *a )
                     /* if we've already found a mode that needs no residual, then
                      * probably any mode with a residual will be worse.
                      * so avoid dct on the remaining modes to improve speed. */
-                    i_satd = x264_rd_cost_chroma( h, i_chroma_lambda, i_mode, h->mb.i_cbp_chroma != 0x00 );
+                    i_satd = rd_cost_chroma( h, i_chroma_lambda, i_mode, h->mb.i_cbp_chroma != 0x00 );
                     COPY3_IF_LT( i_best, i_satd, a->i_predict8x8chroma, i_mode, i_cbp_chroma_best, h->mb.i_cbp_chroma );
                 }
                 h->mb.i_chroma_pred_mode = a->i_predict8x8chroma;
@@ -1228,7 +1228,7 @@ static void x264_intra_rd_refine( x264_t *h, x264_mb_analysis_t *a )
             for( ; *predict_mode >= 0; predict_mode++ )
             {
                 int i_mode = *predict_mode;
-                i_satd = x264_rd_cost_i4x4( h, a->i_lambda2, idx, i_mode );
+                i_satd = rd_cost_i4x4( h, a->i_lambda2, idx, i_mode );
 
                 if( i_best > i_satd )
                 {
@@ -1287,7 +1287,7 @@ static void x264_intra_rd_refine( x264_t *h, x264_mb_analysis_t *a )
                     continue;
 
                 h->mb.i_cbp_luma = a->i_cbp_i8x8_luma;
-                i_satd = x264_rd_cost_i8x8( h, a->i_lambda2, idx, i_mode, edge );
+                i_satd = rd_cost_i8x8( h, a->i_lambda2, idx, i_mode, edge );
 
                 if( i_best > i_satd )
                 {
@@ -1366,7 +1366,7 @@ static void x264_intra_rd_refine( x264_t *h, x264_mb_analysis_t *a )
 #define REF_COST(list, ref) \
     (a->p_cost_ref[list][ref])
 
-static void x264_mb_analyse_inter_p16x16( x264_t *h, x264_mb_analysis_t *a )
+static void mb_analyse_inter_p16x16( x264_t *h, x264_mb_analysis_t *a )
 {
     x264_me_t m;
     int i_mvc;
@@ -1415,7 +1415,7 @@ static void x264_mb_analyse_inter_p16x16( x264_t *h, x264_mb_analysis_t *a )
             && x264_macroblock_probe_pskip( h ) )
         {
             h->mb.i_type = P_SKIP;
-            x264_analyse_update_cache( h, a );
+            analyse_update_cache( h, a );
             assert( h->mb.cache.pskip_mv[1] <= h->mb.mv_max_spel[1] || h->i_thread_frames == 1 );
             return;
         }
@@ -1433,19 +1433,19 @@ static void x264_mb_analyse_inter_p16x16( x264_t *h, x264_mb_analysis_t *a )
     h->mb.i_type = P_L0;
     if( a->i_mbrd )
     {
-        x264_mb_init_fenc_cache( h, a->i_mbrd >= 2 || h->param.analyse.inter & X264_ANALYSE_PSUB8x8 );
+        mb_init_fenc_cache( h, a->i_mbrd >= 2 || h->param.analyse.inter & X264_ANALYSE_PSUB8x8 );
         if( a->l0.me16x16.i_ref == 0 && M32( a->l0.me16x16.mv ) == M32( h->mb.cache.pskip_mv ) && !a->b_force_intra )
         {
             h->mb.i_partition = D_16x16;
             x264_macroblock_cache_mv_ptr( h, 0, 0, 4, 4, 0, a->l0.me16x16.mv );
-            a->l0.i_rd16x16 = x264_rd_cost_mb( h, a->i_lambda2 );
+            a->l0.i_rd16x16 = rd_cost_mb( h, a->i_lambda2 );
             if( !(h->mb.i_cbp_luma|h->mb.i_cbp_chroma) )
                 h->mb.i_type = P_SKIP;
         }
     }
 }
 
-static void x264_mb_analyse_inter_p8x8_mixed_ref( x264_t *h, x264_mb_analysis_t *a )
+static void mb_analyse_inter_p8x8_mixed_ref( x264_t *h, x264_mb_analysis_t *a )
 {
     x264_me_t m;
     pixel **p_fenc = h->mb.pic.p_fenc;
@@ -1536,7 +1536,7 @@ static void x264_mb_analyse_inter_p8x8_mixed_ref( x264_t *h, x264_mb_analysis_t
     M32( h->mb.i_sub_partition ) = D_L0_8x8 * 0x01010101;
 }
 
-static void x264_mb_analyse_inter_p8x8( x264_t *h, x264_mb_analysis_t *a )
+static void mb_analyse_inter_p8x8( x264_t *h, x264_mb_analysis_t *a )
 {
     /* Duplicate refs are rarely useful in p8x8 due to the high cost of the
      * reference frame flags.  Thus, if we're not doing mixedrefs, just
@@ -1591,7 +1591,7 @@ static void x264_mb_analyse_inter_p8x8( x264_t *h, x264_mb_analysis_t *a )
     M32( h->mb.i_sub_partition ) = D_L0_8x8 * 0x01010101;
 }
 
-static void x264_mb_analyse_inter_p16x8( x264_t *h, x264_mb_analysis_t *a, int i_best_satd )
+static void mb_analyse_inter_p16x8( x264_t *h, x264_mb_analysis_t *a, int i_best_satd )
 {
     x264_me_t m;
     pixel **p_fenc = h->mb.pic.p_fenc;
@@ -1657,7 +1657,7 @@ static void x264_mb_analyse_inter_p16x8( x264_t *h, x264_mb_analysis_t *a, int i
     a->l0.i_cost16x8 = a->l0.me16x8[0].cost + a->l0.me16x8[1].cost;
 }
 
-static void x264_mb_analyse_inter_p8x16( x264_t *h, x264_mb_analysis_t *a, int i_best_satd )
+static void mb_analyse_inter_p8x16( x264_t *h, x264_mb_analysis_t *a, int i_best_satd )
 {
     x264_me_t m;
     pixel **p_fenc = h->mb.pic.p_fenc;
@@ -1722,8 +1722,8 @@ static void x264_mb_analyse_inter_p8x16( x264_t *h, x264_mb_analysis_t *a, int i
     a->l0.i_cost8x16 = a->l0.me8x16[0].cost + a->l0.me8x16[1].cost;
 }
 
-static ALWAYS_INLINE int x264_mb_analyse_inter_p4x4_chroma_internal( x264_t *h, x264_mb_analysis_t *a,
-                                                                     pixel **p_fref, int i8x8, int size, int chroma )
+static ALWAYS_INLINE int mb_analyse_inter_p4x4_chroma_internal( x264_t *h, x264_mb_analysis_t *a,
+                                                                pixel **p_fref, int i8x8, int size, int chroma )
 {
     ALIGNED_ARRAY_32( pixel, pix1,[16*16] );
     pixel *pix2 = pix1+8;
@@ -1786,17 +1786,17 @@ static ALWAYS_INLINE int x264_mb_analyse_inter_p4x4_chroma_internal( x264_t *h,
          + h->pixf.mbcmp[chromapix]( &h->mb.pic.p_fenc[2][oe], FENC_STRIDE, pix2, 16 );
 }
 
-static int x264_mb_analyse_inter_p4x4_chroma( x264_t *h, x264_mb_analysis_t *a, pixel **p_fref, int i8x8, int size )
+static int mb_analyse_inter_p4x4_chroma( x264_t *h, x264_mb_analysis_t *a, pixel **p_fref, int i8x8, int size )
 {
     if( CHROMA_FORMAT == CHROMA_444 )
-        return x264_mb_analyse_inter_p4x4_chroma_internal( h, a, p_fref, i8x8, size, CHROMA_444 );
+        return mb_analyse_inter_p4x4_chroma_internal( h, a, p_fref, i8x8, size, CHROMA_444 );
     else if( CHROMA_FORMAT == CHROMA_422 )
-        return x264_mb_analyse_inter_p4x4_chroma_internal( h, a, p_fref, i8x8, size, CHROMA_422 );
+        return mb_analyse_inter_p4x4_chroma_internal( h, a, p_fref, i8x8, size, CHROMA_422 );
     else
-        return x264_mb_analyse_inter_p4x4_chroma_internal( h, a, p_fref, i8x8, size, CHROMA_420 );
+        return mb_analyse_inter_p4x4_chroma_internal( h, a, p_fref, i8x8, size, CHROMA_420 );
 }
 
-static void x264_mb_analyse_inter_p4x4( x264_t *h, x264_mb_analysis_t *a, int i8x8 )
+static void mb_analyse_inter_p4x4( x264_t *h, x264_mb_analysis_t *a, int i8x8 )
 {
     pixel **p_fref = h->mb.pic.p_fref[0][a->l0.me8x8[i8x8].i_ref];
     pixel **p_fenc = h->mb.pic.p_fenc;
@@ -1832,10 +1832,10 @@ static void x264_mb_analyse_inter_p4x4( x264_t *h, x264_mb_analysis_t *a, int i8
                             REF_COST( 0, i_ref ) +
                             a->i_lambda * i_sub_mb_p_cost_table[D_L0_4x4];
     if( h->mb.b_chroma_me && !CHROMA444 )
-        a->l0.i_cost4x4[i8x8] += x264_mb_analyse_inter_p4x4_chroma( h, a, p_fref, i8x8, PIXEL_4x4 );
+        a->l0.i_cost4x4[i8x8] += mb_analyse_inter_p4x4_chroma( h, a, p_fref, i8x8, PIXEL_4x4 );
 }
 
-static void x264_mb_analyse_inter_p8x4( x264_t *h, x264_mb_analysis_t *a, int i8x8 )
+static void mb_analyse_inter_p8x4( x264_t *h, x264_mb_analysis_t *a, int i8x8 )
 {
     pixel **p_fref = h->mb.pic.p_fref[0][a->l0.me8x8[i8x8].i_ref];
     pixel **p_fenc = h->mb.pic.p_fenc;
@@ -1868,10 +1868,10 @@ static void x264_mb_analyse_inter_p8x4( x264_t *h, x264_mb_analysis_t *a, int i8
                             REF_COST( 0, i_ref ) +
                             a->i_lambda * i_sub_mb_p_cost_table[D_L0_8x4];
     if( h->mb.b_chroma_me && !CHROMA444 )
-        a->l0.i_cost8x4[i8x8] += x264_mb_analyse_inter_p4x4_chroma( h, a, p_fref, i8x8, PIXEL_8x4 );
+        a->l0.i_cost8x4[i8x8] += mb_analyse_inter_p4x4_chroma( h, a, p_fref, i8x8, PIXEL_8x4 );
 }
 
-static void x264_mb_analyse_inter_p4x8( x264_t *h, x264_mb_analysis_t *a, int i8x8 )
+static void mb_analyse_inter_p4x8( x264_t *h, x264_mb_analysis_t *a, int i8x8 )
 {
     pixel **p_fref = h->mb.pic.p_fref[0][a->l0.me8x8[i8x8].i_ref];
     pixel **p_fenc = h->mb.pic.p_fenc;
@@ -1904,10 +1904,10 @@ static void x264_mb_analyse_inter_p4x8( x264_t *h, x264_mb_analysis_t *a, int i8
                             REF_COST( 0, i_ref ) +
                             a->i_lambda * i_sub_mb_p_cost_table[D_L0_4x8];
     if( h->mb.b_chroma_me && !CHROMA444 )
-        a->l0.i_cost4x8[i8x8] += x264_mb_analyse_inter_p4x4_chroma( h, a, p_fref, i8x8, PIXEL_4x8 );
+        a->l0.i_cost4x8[i8x8] += mb_analyse_inter_p4x4_chroma( h, a, p_fref, i8x8, PIXEL_4x8 );
 }
 
-static ALWAYS_INLINE int x264_analyse_bi_chroma( x264_t *h, x264_mb_analysis_t *a, int idx, int i_pixel )
+static ALWAYS_INLINE int analyse_bi_chroma( x264_t *h, x264_mb_analysis_t *a, int idx, int i_pixel )
 {
     ALIGNED_ARRAY_32( pixel, pix, [4],[16*16] );
     ALIGNED_ARRAY_32( pixel,  bi, [2],[16*16] );
@@ -1955,7 +1955,7 @@ static ALWAYS_INLINE int x264_analyse_bi_chroma( x264_t *h, x264_mb_analysis_t *
     return i_chroma_cost;
 }
 
-static void x264_mb_analyse_inter_direct( x264_t *h, x264_mb_analysis_t *a )
+static void mb_analyse_inter_direct( x264_t *h, x264_mb_analysis_t *a )
 {
     /* Assumes that fdec still contains the results of
      * x264_mb_predict_mv_direct16x16 and x264_mb_mc */
@@ -2001,7 +2001,7 @@ static void x264_mb_analyse_inter_direct( x264_t *h, x264_mb_analysis_t *a )
     }
 }
 
-static void x264_mb_analyse_inter_b16x16( x264_t *h, x264_mb_analysis_t *a )
+static void mb_analyse_inter_b16x16( x264_t *h, x264_mb_analysis_t *a )
 {
     ALIGNED_ARRAY_32( pixel, pix0,[16*16] );
     ALIGNED_ARRAY_32( pixel, pix1,[16*16] );
@@ -2073,7 +2073,7 @@ static void x264_mb_analyse_inter_b16x16( x264_t *h, x264_mb_analysis_t *a )
                 {
                     /* We already tested skip */
                     h->mb.i_type = B_SKIP;
-                    x264_analyse_update_cache( h, a );
+                    analyse_update_cache( h, a );
                     return;
                 }
             }
@@ -2105,7 +2105,7 @@ static void x264_mb_analyse_inter_b16x16( x264_t *h, x264_mb_analysis_t *a )
                      + a->l1.bi16x16.cost_mv;
 
     if( h->mb.b_chroma_me )
-        a->i_cost16x16bi += x264_analyse_bi_chroma( h, a, 0, PIXEL_16x16 );
+        a->i_cost16x16bi += analyse_bi_chroma( h, a, 0, PIXEL_16x16 );
 
     /* Always try the 0,0,0,0 vector; helps avoid errant motion vectors in fades */
     if( M32( a->l0.bi16x16.mv ) | M32( a->l1.bi16x16.mv ) )
@@ -2187,7 +2187,7 @@ static void x264_mb_analyse_inter_b16x16( x264_t *h, x264_mb_analysis_t *a )
     a->l1.me16x16.cost += a->i_lambda * i_mb_b_cost_table[B_L1_L1];
 }
 
-static inline void x264_mb_cache_mv_p8x8( x264_t *h, x264_mb_analysis_t *a, int i )
+static inline void mb_cache_mv_p8x8( x264_t *h, x264_mb_analysis_t *a, int i )
 {
     int x = 2*(i&1);
     int y = i&2;
@@ -2217,7 +2217,7 @@ static inline void x264_mb_cache_mv_p8x8( x264_t *h, x264_mb_analysis_t *a, int
     }
 }
 
-static void x264_mb_load_mv_direct8x8( x264_t *h, int idx )
+static void mb_load_mv_direct8x8( x264_t *h, int idx )
 {
     int x = 2*(idx&1);
     int y = idx&2;
@@ -2253,13 +2253,13 @@ static void x264_mb_load_mv_direct8x8( x264_t *h, int idx )
             x264_macroblock_cache_mvd( h, x,y,dx,dy, 1, 0 ); \
     }
 
-static inline void x264_mb_cache_mv_b8x8( x264_t *h, x264_mb_analysis_t *a, int i, int b_mvd )
+static inline void mb_cache_mv_b8x8( x264_t *h, x264_mb_analysis_t *a, int i, int b_mvd )
 {
     int x = 2*(i&1);
     int y = i&2;
     if( h->mb.i_sub_partition[i] == D_DIRECT_8x8 )
     {
-        x264_mb_load_mv_direct8x8( h, i );
+        mb_load_mv_direct8x8( h, i );
         if( b_mvd )
         {
             x264_macroblock_cache_mvd(  h, x, y, 2, 2, 0, 0 );
@@ -2272,17 +2272,17 @@ static inline void x264_mb_cache_mv_b8x8( x264_t *h, x264_mb_analysis_t *a, int
         CACHE_MV_BI( x, y, 2, 2, a->l0.me8x8[i], a->l1.me8x8[i], h->mb.i_sub_partition[i] );
     }
 }
-static inline void x264_mb_cache_mv_b16x8( x264_t *h, x264_mb_analysis_t *a, int i, int b_mvd )
+static inline void mb_cache_mv_b16x8( x264_t *h, x264_mb_analysis_t *a, int i, int b_mvd )
 {
     CACHE_MV_BI( 0, 2*i, 4, 2, a->l0.me16x8[i], a->l1.me16x8[i], a->i_mb_partition16x8[i] );
 }
-static inline void x264_mb_cache_mv_b8x16( x264_t *h, x264_mb_analysis_t *a, int i, int b_mvd )
+static inline void mb_cache_mv_b8x16( x264_t *h, x264_mb_analysis_t *a, int i, int b_mvd )
 {
     CACHE_MV_BI( 2*i, 0, 2, 4, a->l0.me8x16[i], a->l1.me8x16[i], a->i_mb_partition8x16[i] );
 }
 #undef CACHE_MV_BI
 
-static void x264_mb_analyse_inter_b8x8_mixed_ref( x264_t *h, x264_mb_analysis_t *a )
+static void mb_analyse_inter_b8x8_mixed_ref( x264_t *h, x264_mb_analysis_t *a )
 {
     ALIGNED_ARRAY_16( pixel, pix,[2],[8*8] );
     int i_maxref[2] = {h->mb.pic.i_fref[0]-1, h->mb.pic.i_fref[1]-1};
@@ -2371,7 +2371,7 @@ static void x264_mb_analyse_inter_b8x8_mixed_ref( x264_t *h, x264_mb_analysis_t
 
         if( h->mb.b_chroma_me )
         {
-            int i_chroma_cost = x264_analyse_bi_chroma( h, a, i, PIXEL_8x8 );
+            int i_chroma_cost = analyse_bi_chroma( h, a, i, PIXEL_8x8 );
             i_part_cost_bi += i_chroma_cost;
             a->i_satd8x8[2][i] += i_chroma_cost;
         }
@@ -2387,14 +2387,14 @@ static void x264_mb_analyse_inter_b8x8_mixed_ref( x264_t *h, x264_mb_analysis_t
         a->i_cost8x8bi += i_part_cost;
 
         /* XXX Needed for x264_mb_predict_mv */
-        x264_mb_cache_mv_b8x8( h, a, i, 0 );
+        mb_cache_mv_b8x8( h, a, i, 0 );
     }
 
     /* mb type cost */
     a->i_cost8x8bi += a->i_lambda * i_mb_b_cost_table[B_8x8];
 }
 
-static void x264_mb_analyse_inter_b8x8( x264_t *h, x264_mb_analysis_t *a )
+static void mb_analyse_inter_b8x8( x264_t *h, x264_mb_analysis_t *a )
 {
     pixel **p_fref[2] =
         { h->mb.pic.p_fref[0][a->l0.me16x16.i_ref],
@@ -2451,7 +2451,7 @@ static void x264_mb_analyse_inter_b8x8( x264_t *h, x264_mb_analysis_t *a )
 
         if( h->mb.b_chroma_me )
         {
-            int i_chroma_cost = x264_analyse_bi_chroma( h, a, i, PIXEL_8x8 );
+            int i_chroma_cost = analyse_bi_chroma( h, a, i, PIXEL_8x8 );
             i_part_cost_bi += i_chroma_cost;
             a->i_satd8x8[2][i] += i_chroma_cost;
         }
@@ -2464,14 +2464,14 @@ static void x264_mb_analyse_inter_b8x8( x264_t *h, x264_mb_analysis_t *a )
         a->i_cost8x8bi += i_part_cost;
 
         /* XXX Needed for x264_mb_predict_mv */
-        x264_mb_cache_mv_b8x8( h, a, i, 0 );
+        mb_cache_mv_b8x8( h, a, i, 0 );
     }
 
     /* mb type cost */
     a->i_cost8x8bi += a->i_lambda * i_mb_b_cost_table[B_8x8];
 }
 
-static void x264_mb_analyse_inter_b16x8( x264_t *h, x264_mb_analysis_t *a, int i_best_satd )
+static void mb_analyse_inter_b16x8( x264_t *h, x264_mb_analysis_t *a, int i_best_satd )
 {
     ALIGNED_ARRAY_32( pixel, pix,[2],[16*8] );
     ALIGNED_4( int16_t mvc[3][2] );
@@ -2529,7 +2529,7 @@ static void x264_mb_analyse_inter_b16x8( x264_t *h, x264_mb_analysis_t *a, int i
                         + a->l1.me16x8[i].i_ref_cost;
 
         if( h->mb.b_chroma_me )
-            i_part_cost_bi += x264_analyse_bi_chroma( h, a, i, PIXEL_16x8 );
+            i_part_cost_bi += analyse_bi_chroma( h, a, i, PIXEL_16x8 );
 
         i_part_cost = a->l0.me16x8[i].cost;
         a->i_mb_partition16x8[i] = D_L0_8x8; /* not actually 8x8, only the L0 matters */
@@ -2555,7 +2555,7 @@ static void x264_mb_analyse_inter_b16x8( x264_t *h, x264_mb_analysis_t *a, int i
             return;
         }
 
-        x264_mb_cache_mv_b16x8( h, a, i, 0 );
+        mb_cache_mv_b16x8( h, a, i, 0 );
     }
 
     /* mb type cost */
@@ -2565,7 +2565,7 @@ static void x264_mb_analyse_inter_b16x8( x264_t *h, x264_mb_analysis_t *a, int i
     a->i_cost16x8bi += a->i_lambda * i_mb_b16x8_cost_table[a->i_mb_type16x8];
 }
 
-static void x264_mb_analyse_inter_b8x16( x264_t *h, x264_mb_analysis_t *a, int i_best_satd )
+static void mb_analyse_inter_b8x16( x264_t *h, x264_mb_analysis_t *a, int i_best_satd )
 {
     ALIGNED_ARRAY_16( pixel, pix,[2],[8*16] );
     ALIGNED_4( int16_t mvc[3][2] );
@@ -2622,7 +2622,7 @@ static void x264_mb_analyse_inter_b8x16( x264_t *h, x264_mb_analysis_t *a, int i
                         + a->l1.me8x16[i].i_ref_cost;
 
         if( h->mb.b_chroma_me )
-            i_part_cost_bi += x264_analyse_bi_chroma( h, a, i, PIXEL_8x16 );
+            i_part_cost_bi += analyse_bi_chroma( h, a, i, PIXEL_8x16 );
 
         i_part_cost = a->l0.me8x16[i].cost;
         a->i_mb_partition8x16[i] = D_L0_8x8;
@@ -2648,7 +2648,7 @@ static void x264_mb_analyse_inter_b8x16( x264_t *h, x264_mb_analysis_t *a, int i
             return;
         }
 
-        x264_mb_cache_mv_b8x16( h, a, i, 0 );
+        mb_cache_mv_b8x16( h, a, i, 0 );
     }
 
     /* mb type cost */
@@ -2658,7 +2658,7 @@ static void x264_mb_analyse_inter_b8x16( x264_t *h, x264_mb_analysis_t *a, int i
     a->i_cost8x16bi += a->i_lambda * i_mb_b16x8_cost_table[a->i_mb_type8x16];
 }
 
-static void x264_mb_analyse_p_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd )
+static void mb_analyse_p_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd )
 {
     int thresh = a->b_early_terminate ? i_satd * 5/4 + 1 : COST_MAX;
 
@@ -2666,15 +2666,15 @@ static void x264_mb_analyse_p_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd )
     if( a->l0.i_rd16x16 == COST_MAX && (!a->b_early_terminate || a->l0.me16x16.cost <= i_satd * 3/2) )
     {
         h->mb.i_partition = D_16x16;
-        x264_analyse_update_cache( h, a );
-        a->l0.i_rd16x16 = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->l0.i_rd16x16 = rd_cost_mb( h, a->i_lambda2 );
     }
 
     if( a->l0.i_cost16x8 < thresh )
     {
         h->mb.i_partition = D_16x8;
-        x264_analyse_update_cache( h, a );
-        a->l0.i_cost16x8 = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->l0.i_cost16x8 = rd_cost_mb( h, a->i_lambda2 );
     }
     else
         a->l0.i_cost16x8 = COST_MAX;
@@ -2682,8 +2682,8 @@ static void x264_mb_analyse_p_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd )
     if( a->l0.i_cost8x16 < thresh )
     {
         h->mb.i_partition = D_8x16;
-        x264_analyse_update_cache( h, a );
-        a->l0.i_cost8x16 = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->l0.i_cost8x16 = rd_cost_mb( h, a->i_lambda2 );
     }
     else
         a->l0.i_cost8x16 = COST_MAX;
@@ -2712,7 +2712,7 @@ static void x264_mb_analyse_p_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd )
                     if( costs[subtype] > sub8x8_thresh )
                         continue;
                     h->mb.i_sub_partition[i] = subtype;
-                    x264_mb_cache_mv_p8x8( h, a, i );
+                    mb_cache_mv_p8x8( h, a, i );
                     if( subtype == btype )
                         continue;
                     cost = x264_rd_cost_part( h, a->i_lambda2, i<<2, PIXEL_8x8 );
@@ -2721,19 +2721,19 @@ static void x264_mb_analyse_p_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd )
                 if( h->mb.i_sub_partition[i] != btype )
                 {
                     h->mb.i_sub_partition[i] = btype;
-                    x264_mb_cache_mv_p8x8( h, a, i );
+                    mb_cache_mv_p8x8( h, a, i );
                 }
             }
         }
         else
-            x264_analyse_update_cache( h, a );
-        a->l0.i_cost8x8 = x264_rd_cost_mb( h, a->i_lambda2 );
+            analyse_update_cache( h, a );
+        a->l0.i_cost8x8 = rd_cost_mb( h, a->i_lambda2 );
     }
     else
         a->l0.i_cost8x8 = COST_MAX;
 }
 
-static void x264_mb_analyse_b_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_inter )
+static void mb_analyse_b_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_inter )
 {
     int thresh = a->b_early_terminate ? i_satd_inter * (17 + (!!h->mb.i_psy_rd))/16 + 1 : COST_MAX;
 
@@ -2743,8 +2743,8 @@ static void x264_mb_analyse_b_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_i
         /* Assumes direct/skip MC is still in fdec */
         /* Requires b-rdo to be done before intra analysis */
         h->mb.b_skip_mc = 1;
-        x264_analyse_update_cache( h, a );
-        a->i_rd16x16direct = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->i_rd16x16direct = rd_cost_mb( h, a->i_lambda2 );
         h->mb.b_skip_mc = 0;
     }
 
@@ -2754,24 +2754,24 @@ static void x264_mb_analyse_b_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_i
     if( a->l0.me16x16.cost < thresh && a->l0.i_rd16x16 == COST_MAX )
     {
         h->mb.i_type = B_L0_L0;
-        x264_analyse_update_cache( h, a );
-        a->l0.i_rd16x16 = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->l0.i_rd16x16 = rd_cost_mb( h, a->i_lambda2 );
     }
 
     /* L1 */
     if( a->l1.me16x16.cost < thresh && a->l1.i_rd16x16 == COST_MAX )
     {
         h->mb.i_type = B_L1_L1;
-        x264_analyse_update_cache( h, a );
-        a->l1.i_rd16x16 = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->l1.i_rd16x16 = rd_cost_mb( h, a->i_lambda2 );
     }
 
     /* BI */
     if( a->i_cost16x16bi < thresh && a->i_rd16x16bi == COST_MAX )
     {
         h->mb.i_type = B_BI_BI;
-        x264_analyse_update_cache( h, a );
-        a->i_rd16x16bi = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->i_rd16x16bi = rd_cost_mb( h, a->i_lambda2 );
     }
 
     /* 8x8 */
@@ -2779,8 +2779,8 @@ static void x264_mb_analyse_b_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_i
     {
         h->mb.i_type = B_8x8;
         h->mb.i_partition = D_8x8;
-        x264_analyse_update_cache( h, a );
-        a->i_rd8x8bi = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->i_rd8x8bi = rd_cost_mb( h, a->i_lambda2 );
         x264_macroblock_cache_skip( h, 0, 0, 4, 4, 0 );
     }
 
@@ -2789,8 +2789,8 @@ static void x264_mb_analyse_b_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_i
     {
         h->mb.i_type = a->i_mb_type16x8;
         h->mb.i_partition = D_16x8;
-        x264_analyse_update_cache( h, a );
-        a->i_rd16x8bi = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->i_rd16x8bi = rd_cost_mb( h, a->i_lambda2 );
     }
 
     /* 8x16 */
@@ -2798,12 +2798,12 @@ static void x264_mb_analyse_b_rd( x264_t *h, x264_mb_analysis_t *a, int i_satd_i
     {
         h->mb.i_type = a->i_mb_type8x16;
         h->mb.i_partition = D_8x16;
-        x264_analyse_update_cache( h, a );
-        a->i_rd8x16bi = x264_rd_cost_mb( h, a->i_lambda2 );
+        analyse_update_cache( h, a );
+        a->i_rd8x16bi = rd_cost_mb( h, a->i_lambda2 );
     }
 }
 
-static void x264_refine_bidir( x264_t *h, x264_mb_analysis_t *a )
+static void refine_bidir( x264_t *h, x264_mb_analysis_t *a )
 {
     int i_biweight;
 
@@ -2846,7 +2846,7 @@ static void x264_refine_bidir( x264_t *h, x264_mb_analysis_t *a )
     }
 }
 
-static inline void x264_mb_analyse_transform( x264_t *h )
+static inline void mb_analyse_transform( x264_t *h )
 {
     if( x264_mb_transform_8x8_allowed( h ) && h->param.analyse.b_transform_8x8 && !h->mb.b_lossless )
     {
@@ -2884,7 +2884,7 @@ static inline void x264_mb_analyse_transform( x264_t *h )
     }
 }
 
-static inline void x264_mb_analyse_transform_rd( x264_t *h, x264_mb_analysis_t *a, int *i_satd, int *i_rd )
+static inline void mb_analyse_transform_rd( x264_t *h, x264_mb_analysis_t *a, int *i_satd, int *i_rd )
 {
     if( h->param.analyse.b_transform_8x8 && h->pps->b_transform_8x8_mode )
     {
@@ -2895,10 +2895,10 @@ static inline void x264_mb_analyse_transform_rd( x264_t *h, x264_mb_analysis_t *
         else if( !x264_transform_allowed[h->mb.i_type] )
             return;
 
-        x264_analyse_update_cache( h, a );
+        analyse_update_cache( h, a );
         h->mb.b_transform_8x8 ^= 1;
         /* FIXME only luma is needed for 4:2:0, but the score for comparison already includes chroma */
-        int i_rd8 = x264_rd_cost_mb( h, a->i_lambda2 );
+        int i_rd8 = rd_cost_mb( h, a->i_lambda2 );
 
         if( *i_rd >= i_rd8 )
         {
@@ -2921,12 +2921,12 @@ static inline void x264_mb_analyse_transform_rd( x264_t *h, x264_mb_analysis_t *
  * There must be a more efficient way to get that portion of the benefit
  * without doing full QP-RD, but RD-decimation doesn't seem to do the
  * trick. */
-static inline void x264_mb_analyse_qp_rd( x264_t *h, x264_mb_analysis_t *a )
+static inline void mb_analyse_qp_rd( x264_t *h, x264_mb_analysis_t *a )
 {
     int bcost, cost, failures, prevcost, origcost;
     int orig_qp = h->mb.i_qp, bqp = h->mb.i_qp;
     int last_qp_tried = 0;
-    origcost = bcost = x264_rd_cost_mb( h, a->i_lambda2 );
+    origcost = bcost = rd_cost_mb( h, a->i_lambda2 );
     int origcbp = h->mb.cbp[h->mb.i_mb_xy];
 
     /* If CBP is already zero, don't raise the quantizer any higher. */
@@ -2959,7 +2959,7 @@ static inline void x264_mb_analyse_qp_rd( x264_t *h, x264_mb_analysis_t *a )
             {
                 h->mb.i_qp = X264_MAX( h->mb.i_qp - threshold - 1, SPEC_QP( h->param.rc.i_qp_min ) );
                 h->mb.i_chroma_qp = h->chroma_qp_table[h->mb.i_qp];
-                already_checked_cost = x264_rd_cost_mb( h, a->i_lambda2 );
+                already_checked_cost = rd_cost_mb( h, a->i_lambda2 );
                 if( !h->mb.cbp[h->mb.i_mb_xy] )
                 {
                     /* If our empty-CBP block is lower QP than the last QP,
@@ -2983,7 +2983,7 @@ static inline void x264_mb_analyse_qp_rd( x264_t *h, x264_mb_analysis_t *a )
             else
             {
                 h->mb.i_chroma_qp = h->chroma_qp_table[h->mb.i_qp];
-                cost = x264_rd_cost_mb( h, a->i_lambda2 );
+                cost = rd_cost_mb( h, a->i_lambda2 );
                 COPY2_IF_LT( bcost, cost, bqp, h->mb.i_qp );
             }
 
@@ -3008,7 +3008,7 @@ static inline void x264_mb_analyse_qp_rd( x264_t *h, x264_mb_analysis_t *a )
     {
         h->mb.i_qp = h->mb.i_last_qp;
         h->mb.i_chroma_qp = h->chroma_qp_table[h->mb.i_qp];
-        cost = x264_rd_cost_mb( h, a->i_lambda2 );
+        cost = rd_cost_mb( h, a->i_lambda2 );
         COPY2_IF_LT( bcost, cost, bqp, h->mb.i_qp );
     }
 
@@ -3020,7 +3020,7 @@ static inline void x264_mb_analyse_qp_rd( x264_t *h, x264_mb_analysis_t *a )
         x264_mb_transform_8x8_allowed( h ) )
     {
         h->mb.b_transform_8x8 ^= 1;
-        cost = x264_rd_cost_mb( h, a->i_lambda2 );
+        cost = rd_cost_mb( h, a->i_lambda2 );
         if( cost > bcost )
             h->mb.b_transform_8x8 ^= 1;
     }
@@ -3042,17 +3042,17 @@ void x264_macroblock_analyse( x264_t *h )
 
     if( h->param.analyse.b_mb_info )
         h->fdec->effective_qp[h->mb.i_mb_xy] = h->mb.i_qp; /* Store the real analysis QP. */
-    x264_mb_analyse_init( h, &analysis, h->mb.i_qp );
+    mb_analyse_init( h, &analysis, h->mb.i_qp );
 
     /*--------------------------- Do the analysis ---------------------------*/
     if( h->sh.i_type == SLICE_TYPE_I )
     {
 intra_analysis:
         if( analysis.i_mbrd )
-            x264_mb_init_fenc_cache( h, analysis.i_mbrd >= 2 );
-        x264_mb_analyse_intra( h, &analysis, COST_MAX );
+            mb_init_fenc_cache( h, analysis.i_mbrd >= 2 );
+        mb_analyse_intra( h, &analysis, COST_MAX );
         if( analysis.i_mbrd )
-            x264_intra_rd( h, &analysis, COST_MAX );
+            intra_rd( h, &analysis, COST_MAX );
 
         i_cost = analysis.i_satd_i16x16;
         h->mb.i_type = I_16x16;
@@ -3062,7 +3062,7 @@ intra_analysis:
             h->mb.i_type = I_PCM;
 
         else if( analysis.i_mbrd >= 2 )
-            x264_intra_rd_refine( h, &analysis );
+            intra_rd_refine( h, &analysis );
     }
     else if( h->sh.i_type == SLICE_TYPE_P )
     {
@@ -3075,7 +3075,7 @@ intra_analysis:
         {
             if( !h->param.analyse.b_psy )
             {
-                x264_mb_analyse_init_qp( h, &analysis, X264_MAX( h->mb.i_qp - h->mb.ip_offset, h->param.rc.i_qp_min ) );
+                mb_analyse_init_qp( h, &analysis, X264_MAX( h->mb.i_qp - h->mb.ip_offset, h->param.rc.i_qp_min ) );
                 goto intra_analysis;
             }
         }
@@ -3147,9 +3147,9 @@ skip_analysis:
             int i_partition;
             int i_satd_inter, i_satd_intra;
 
-            x264_mb_analyse_load_costs( h, &analysis );
+            mb_analyse_load_costs( h, &analysis );
 
-            x264_mb_analyse_inter_p16x16( h, &analysis );
+            mb_analyse_inter_p16x16( h, &analysis );
 
             if( h->mb.i_type == P_SKIP )
             {
@@ -3161,9 +3161,9 @@ skip_analysis:
             if( flags & X264_ANALYSE_PSUB16x16 )
             {
                 if( h->param.analyse.b_mixed_references )
-                    x264_mb_analyse_inter_p8x8_mixed_ref( h, &analysis );
+                    mb_analyse_inter_p8x8_mixed_ref( h, &analysis );
                 else
-                    x264_mb_analyse_inter_p8x8( h, &analysis );
+                    mb_analyse_inter_p8x8( h, &analysis );
             }
 
             /* Select best inter mode */
@@ -3183,24 +3183,24 @@ skip_analysis:
                 {
                     for( int i = 0; i < 4; i++ )
                     {
-                        x264_mb_analyse_inter_p4x4( h, &analysis, i );
+                        mb_analyse_inter_p4x4( h, &analysis, i );
                         int i_thresh8x4 = analysis.l0.me4x4[i][1].cost_mv + analysis.l0.me4x4[i][2].cost_mv;
                         if( !analysis.b_early_terminate || analysis.l0.i_cost4x4[i] < analysis.l0.me8x8[i].cost + i_thresh8x4 )
                         {
                             int i_cost8x8 = analysis.l0.i_cost4x4[i];
                             h->mb.i_sub_partition[i] = D_L0_4x4;
 
-                            x264_mb_analyse_inter_p8x4( h, &analysis, i );
+                            mb_analyse_inter_p8x4( h, &analysis, i );
                             COPY2_IF_LT( i_cost8x8, analysis.l0.i_cost8x4[i],
                                          h->mb.i_sub_partition[i], D_L0_8x4 );
 
-                            x264_mb_analyse_inter_p4x8( h, &analysis, i );
+                            mb_analyse_inter_p4x8( h, &analysis, i );
                             COPY2_IF_LT( i_cost8x8, analysis.l0.i_cost4x8[i],
                                          h->mb.i_sub_partition[i], D_L0_4x8 );
 
                             i_cost += i_cost8x8 - analysis.l0.me8x8[i].cost;
                         }
-                        x264_mb_cache_mv_p8x8( h, &analysis, i );
+                        mb_cache_mv_p8x8( h, &analysis, i );
                     }
                     analysis.l0.i_cost8x8 = i_cost;
                 }
@@ -3215,14 +3215,14 @@ skip_analysis:
                                       + analysis.l0.me8x8[3].cost_mv + analysis.l0.me8x8[3].i_ref_cost + 1) >> 1;
                 analysis.i_cost_est16x8[1] = analysis.i_satd8x8[0][2] + analysis.i_satd8x8[0][3] + i_avg_mv_ref_cost;
 
-                x264_mb_analyse_inter_p16x8( h, &analysis, i_cost );
+                mb_analyse_inter_p16x8( h, &analysis, i_cost );
                 COPY3_IF_LT( i_cost, analysis.l0.i_cost16x8, i_type, P_L0, i_partition, D_16x8 );
 
                 i_avg_mv_ref_cost = (analysis.l0.me8x8[1].cost_mv + analysis.l0.me8x8[1].i_ref_cost
                                   + analysis.l0.me8x8[3].cost_mv + analysis.l0.me8x8[3].i_ref_cost + 1) >> 1;
                 analysis.i_cost_est8x16[1] = analysis.i_satd8x8[0][1] + analysis.i_satd8x8[0][3] + i_avg_mv_ref_cost;
 
-                x264_mb_analyse_inter_p8x16( h, &analysis, i_cost );
+                mb_analyse_inter_p8x16( h, &analysis, i_cost );
                 COPY3_IF_LT( i_cost, analysis.l0.i_cost8x16, i_type, P_L0, i_partition, D_8x16 );
             }
 
@@ -3296,20 +3296,20 @@ skip_analysis:
             {
                 if( CHROMA444 )
                 {
-                    x264_mb_analyse_intra( h, &analysis, i_cost );
-                    x264_mb_analyse_intra_chroma( h, &analysis );
+                    mb_analyse_intra( h, &analysis, i_cost );
+                    mb_analyse_intra_chroma( h, &analysis );
                 }
                 else
                 {
-                    x264_mb_analyse_intra_chroma( h, &analysis );
-                    x264_mb_analyse_intra( h, &analysis, i_cost - analysis.i_satd_chroma );
+                    mb_analyse_intra_chroma( h, &analysis );
+                    mb_analyse_intra( h, &analysis, i_cost - analysis.i_satd_chroma );
                 }
                 analysis.i_satd_i16x16 += analysis.i_satd_chroma;
                 analysis.i_satd_i8x8   += analysis.i_satd_chroma;
                 analysis.i_satd_i4x4   += analysis.i_satd_chroma;
             }
             else
-                x264_mb_analyse_intra( h, &analysis, i_cost );
+                mb_analyse_intra( h, &analysis, i_cost );
 
             i_satd_inter = i_cost;
             i_satd_intra = X264_MIN3( analysis.i_satd_i16x16,
@@ -3318,7 +3318,7 @@ skip_analysis:
 
             if( analysis.i_mbrd )
             {
-                x264_mb_analyse_p_rd( h, &analysis, X264_MIN(i_satd_inter, i_satd_intra) );
+                mb_analyse_p_rd( h, &analysis, X264_MIN(i_satd_inter, i_satd_intra) );
                 i_type = P_L0;
                 i_partition = D_16x16;
                 i_cost = analysis.l0.i_rd16x16;
@@ -3328,8 +3328,8 @@ skip_analysis:
                 h->mb.i_type = i_type;
                 h->mb.i_partition = i_partition;
                 if( i_cost < COST_MAX )
-                    x264_mb_analyse_transform_rd( h, &analysis, &i_satd_inter, &i_cost );
-                x264_intra_rd( h, &analysis, i_satd_inter * 5/4 + 1 );
+                    mb_analyse_transform_rd( h, &analysis, &i_satd_inter, &i_cost );
+                intra_rd( h, &analysis, i_satd_inter * 5/4 + 1 );
             }
 
             COPY2_IF_LT( i_cost, analysis.i_satd_i16x16, i_type, I_16x16 );
@@ -3343,7 +3343,7 @@ skip_analysis:
             {
                 /* Intra masking: copy fdec to fenc and re-encode the block as intra in order to make it appear as if
                  * it was an inter block. */
-                x264_analyse_update_cache( h, &analysis );
+                analyse_update_cache( h, &analysis );
                 x264_macroblock_encode( h );
                 for( int p = 0; p < (CHROMA444 ? 3 : 1); p++ )
                     h->mc.copy[PIXEL_16x16]( h->mb.pic.p_fenc[p], FENC_STRIDE, h->mb.pic.p_fdec[p], FDEC_STRIDE, 16 );
@@ -3353,7 +3353,7 @@ skip_analysis:
                     h->mc.copy[PIXEL_8x8]  ( h->mb.pic.p_fenc[1], FENC_STRIDE, h->mb.pic.p_fdec[1], FDEC_STRIDE, height );
                     h->mc.copy[PIXEL_8x8]  ( h->mb.pic.p_fenc[2], FENC_STRIDE, h->mb.pic.p_fdec[2], FDEC_STRIDE, height );
                 }
-                x264_mb_analyse_init_qp( h, &analysis, X264_MAX( h->mb.i_qp - h->mb.ip_offset, h->param.rc.i_qp_min ) );
+                mb_analyse_init_qp( h, &analysis, X264_MAX( h->mb.i_qp - h->mb.ip_offset, h->param.rc.i_qp_min ) );
                 goto intra_analysis;
             }
 
@@ -3361,7 +3361,7 @@ skip_analysis:
             {
                 if( IS_INTRA( h->mb.i_type ) )
                 {
-                    x264_intra_rd_refine( h, &analysis );
+                    intra_rd_refine( h, &analysis );
                 }
                 else if( i_partition == D_16x16 )
                 {
@@ -3387,7 +3387,7 @@ skip_analysis:
                 }
                 else if( i_partition == D_8x8 )
                 {
-                    x264_analyse_update_cache( h, &analysis );
+                    analyse_update_cache( h, &analysis );
                     for( int i8x8 = 0; i8x8 < 4; i8x8++ )
                     {
                         if( h->mb.i_sub_partition[i8x8] == D_L0_8x8 )
@@ -3422,7 +3422,7 @@ skip_analysis:
         int b_skip = 0;
 
         if( analysis.i_mbrd )
-            x264_mb_init_fenc_cache( h, analysis.i_mbrd >= 2 );
+            mb_init_fenc_cache( h, analysis.i_mbrd >= 2 );
 
         h->mb.i_type = B_SKIP;
         if( h->mb.b_direct_auto_write )
@@ -3490,14 +3490,14 @@ skip_analysis:
             h->mb.b_skip_mc = 0;
             h->mb.i_type = B_DIRECT;
 
-            x264_mb_analyse_load_costs( h, &analysis );
+            mb_analyse_load_costs( h, &analysis );
 
             /* select best inter mode */
             /* direct must be first */
             if( analysis.b_direct_available )
-                x264_mb_analyse_inter_direct( h, &analysis );
+                mb_analyse_inter_direct( h, &analysis );
 
-            x264_mb_analyse_inter_b16x16( h, &analysis );
+            mb_analyse_inter_b16x16( h, &analysis );
 
             if( h->mb.i_type == B_SKIP )
             {
@@ -3517,14 +3517,14 @@ skip_analysis:
 
             if( analysis.i_mbrd && analysis.b_early_terminate && analysis.i_cost16x16direct <= i_cost * 33/32 )
             {
-                x264_mb_analyse_b_rd( h, &analysis, i_cost );
+                mb_analyse_b_rd( h, &analysis, i_cost );
                 if( i_bskip_cost < analysis.i_rd16x16direct &&
                     i_bskip_cost < analysis.i_rd16x16bi &&
                     i_bskip_cost < analysis.l0.i_rd16x16 &&
                     i_bskip_cost < analysis.l1.i_rd16x16 )
                 {
                     h->mb.i_type = B_SKIP;
-                    x264_analyse_update_cache( h, &analysis );
+                    analyse_update_cache( h, &analysis );
                     return;
                 }
             }
@@ -3532,9 +3532,9 @@ skip_analysis:
             if( flags & X264_ANALYSE_BSUB16x16 )
             {
                 if( h->param.analyse.b_mixed_references )
-                    x264_mb_analyse_inter_b8x8_mixed_ref( h, &analysis );
+                    mb_analyse_inter_b8x8_mixed_ref( h, &analysis );
                 else
-                    x264_mb_analyse_inter_b8x8( h, &analysis );
+                    mb_analyse_inter_b8x8( h, &analysis );
 
                 COPY3_IF_LT( i_cost, analysis.i_cost8x8bi, i_type, B_8x8, i_partition, D_8x8 );
 
@@ -3584,17 +3584,17 @@ skip_analysis:
                 int try_16x8_first = i_cost_est16x8bi_total < i_cost_est8x16bi_total;
                 if( try_16x8_first && (!analysis.b_early_terminate || i_cost_est16x8bi_total < i_cost) )
                 {
-                    x264_mb_analyse_inter_b16x8( h, &analysis, i_cost );
+                    mb_analyse_inter_b16x8( h, &analysis, i_cost );
                     COPY3_IF_LT( i_cost, analysis.i_cost16x8bi, i_type, analysis.i_mb_type16x8, i_partition, D_16x8 );
                 }
                 if( !analysis.b_early_terminate || i_cost_est8x16bi_total < i_cost )
                 {
-                    x264_mb_analyse_inter_b8x16( h, &analysis, i_cost );
+                    mb_analyse_inter_b8x16( h, &analysis, i_cost );
                     COPY3_IF_LT( i_cost, analysis.i_cost8x16bi, i_type, analysis.i_mb_type8x16, i_partition, D_8x16 );
                 }
                 if( !try_16x8_first && (!analysis.b_early_terminate || i_cost_est16x8bi_total < i_cost) )
                 {
-                    x264_mb_analyse_inter_b16x8( h, &analysis, i_cost );
+                    mb_analyse_inter_b16x8( h, &analysis, i_cost );
                     COPY3_IF_LT( i_cost, analysis.i_cost16x8bi, i_type, analysis.i_mb_type16x8, i_partition, D_16x8 );
                 }
             }
@@ -3686,7 +3686,7 @@ skip_analysis:
 
             if( analysis.i_mbrd )
             {
-                x264_mb_analyse_b_rd( h, &analysis, i_satd_inter );
+                mb_analyse_b_rd( h, &analysis, i_satd_inter );
                 i_type = B_SKIP;
                 i_cost = i_bskip_cost;
                 i_partition = D_16x16;
@@ -3706,25 +3706,25 @@ skip_analysis:
             {
                 if( CHROMA444 )
                 {
-                    x264_mb_analyse_intra( h, &analysis, i_satd_inter );
-                    x264_mb_analyse_intra_chroma( h, &analysis );
+                    mb_analyse_intra( h, &analysis, i_satd_inter );
+                    mb_analyse_intra_chroma( h, &analysis );
                 }
                 else
                 {
-                    x264_mb_analyse_intra_chroma( h, &analysis );
-                    x264_mb_analyse_intra( h, &analysis, i_satd_inter - analysis.i_satd_chroma );
+                    mb_analyse_intra_chroma( h, &analysis );
+                    mb_analyse_intra( h, &analysis, i_satd_inter - analysis.i_satd_chroma );
                 }
                 analysis.i_satd_i16x16 += analysis.i_satd_chroma;
                 analysis.i_satd_i8x8   += analysis.i_satd_chroma;
                 analysis.i_satd_i4x4   += analysis.i_satd_chroma;
             }
             else
-                x264_mb_analyse_intra( h, &analysis, i_satd_inter );
+                mb_analyse_intra( h, &analysis, i_satd_inter );
 
             if( analysis.i_mbrd )
             {
-                x264_mb_analyse_transform_rd( h, &analysis, &i_satd_inter, &i_cost );
-                x264_intra_rd( h, &analysis, i_satd_inter * 17/16 + 1 );
+                mb_analyse_transform_rd( h, &analysis, &i_satd_inter, &i_cost );
+                intra_rd( h, &analysis, i_satd_inter * 17/16 + 1 );
             }
 
             COPY2_IF_LT( i_cost, analysis.i_satd_i16x16, i_type, I_16x16 );
@@ -3736,14 +3736,14 @@ skip_analysis:
             h->mb.i_partition = i_partition;
 
             if( analysis.i_mbrd >= 2 && IS_INTRA( i_type ) && i_type != I_PCM )
-                x264_intra_rd_refine( h, &analysis );
+                intra_rd_refine( h, &analysis );
             if( h->mb.i_subpel_refine >= 5 )
-                x264_refine_bidir( h, &analysis );
+                refine_bidir( h, &analysis );
 
             if( analysis.i_mbrd >= 2 && i_type > B_DIRECT && i_type < B_SKIP )
             {
                 int i_biweight;
-                x264_analyse_update_cache( h, &analysis );
+                analyse_update_cache( h, &analysis );
 
                 if( i_partition == D_16x16 )
                 {
@@ -3814,7 +3814,7 @@ skip_analysis:
         }
     }
 
-    x264_analyse_update_cache( h, &analysis );
+    analyse_update_cache( h, &analysis );
 
     /* In rare cases we can end up qpel-RDing our way back to a larger partition size
      * without realizing it.  Check for this and account for it if necessary. */
@@ -3830,22 +3830,22 @@ skip_analysis:
     }
 
     if( !analysis.i_mbrd )
-        x264_mb_analyse_transform( h );
+        mb_analyse_transform( h );
 
     if( analysis.i_mbrd == 3 && !IS_SKIP(h->mb.i_type) )
-        x264_mb_analyse_qp_rd( h, &analysis );
+        mb_analyse_qp_rd( h, &analysis );
 
     h->mb.b_trellis = h->param.analyse.i_trellis;
     h->mb.b_noise_reduction = h->mb.b_noise_reduction || (!!h->param.analyse.i_noise_reduction && !IS_INTRA( h->mb.i_type ));
 
     if( !IS_SKIP(h->mb.i_type) && h->mb.i_psy_trellis && h->param.analyse.i_trellis == 1 )
-        x264_psy_trellis_init( h, 0 );
+        psy_trellis_init( h, 0 );
     if( h->mb.b_trellis == 1 || h->mb.b_noise_reduction )
         h->mb.i_skip_intra = 0;
 }
 
 /*-------------------- Update MB from the analysis ----------------------*/
-static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a  )
+static void analyse_update_cache( x264_t *h, x264_mb_analysis_t *a  )
 {
     switch( h->mb.i_type )
     {
@@ -3853,17 +3853,17 @@ static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a  )
             for( int i = 0; i < 16; i++ )
                 h->mb.cache.intra4x4_pred_mode[x264_scan8[i]] = a->i_predict4x4[i];
 
-            x264_mb_analyse_intra_chroma( h, a );
+            mb_analyse_intra_chroma( h, a );
             break;
         case I_8x8:
             for( int i = 0; i < 4; i++ )
                 x264_macroblock_cache_intra8x8_pred( h, 2*(i&1), 2*(i>>1), a->i_predict8x8[i] );
 
-            x264_mb_analyse_intra_chroma( h, a );
+            mb_analyse_intra_chroma( h, a );
             break;
         case I_16x16:
             h->mb.i_intra16x16_pred_mode = a->i_predict16x16;
-            x264_mb_analyse_intra_chroma( h, a );
+            mb_analyse_intra_chroma( h, a );
             break;
 
         case I_PCM:
@@ -3903,7 +3903,7 @@ static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a  )
             x264_macroblock_cache_ref( h, 0, 2, 2, 2, 0, a->l0.me8x8[2].i_ref );
             x264_macroblock_cache_ref( h, 2, 2, 2, 2, 0, a->l0.me8x8[3].i_ref );
             for( int i = 0; i < 4; i++ )
-                x264_mb_cache_mv_p8x8( h, a, i );
+                mb_cache_mv_p8x8( h, a, i );
             break;
 
         case P_SKIP:
@@ -3917,16 +3917,16 @@ static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a  )
         case B_SKIP:
         case B_DIRECT:
             h->mb.i_partition = h->mb.cache.direct_partition;
-            x264_mb_load_mv_direct8x8( h, 0 );
-            x264_mb_load_mv_direct8x8( h, 1 );
-            x264_mb_load_mv_direct8x8( h, 2 );
-            x264_mb_load_mv_direct8x8( h, 3 );
+            mb_load_mv_direct8x8( h, 0 );
+            mb_load_mv_direct8x8( h, 1 );
+            mb_load_mv_direct8x8( h, 2 );
+            mb_load_mv_direct8x8( h, 3 );
             break;
 
         case B_8x8:
             /* optimize: cache might not need to be rewritten */
             for( int i = 0; i < 4; i++ )
-                x264_mb_cache_mv_b8x8( h, a, i, 1 );
+                mb_cache_mv_b8x8( h, a, i, 1 );
             break;
 
         default: /* the rest of the B types */
@@ -3961,12 +3961,12 @@ static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a  )
                 }
                 break;
             case D_16x8:
-                x264_mb_cache_mv_b16x8( h, a, 0, 1 );
-                x264_mb_cache_mv_b16x8( h, a, 1, 1 );
+                mb_cache_mv_b16x8( h, a, 0, 1 );
+                mb_cache_mv_b16x8( h, a, 1, 1 );
                 break;
             case D_8x16:
-                x264_mb_cache_mv_b8x16( h, a, 0, 1 );
-                x264_mb_cache_mv_b8x16( h, a, 1, 1 );
+                mb_cache_mv_b8x16( h, a, 0, 1 );
+                mb_cache_mv_b8x16( h, a, 1, 1 );
                 break;
             default:
                 x264_log( h, X264_LOG_ERROR, "internal error (invalid MB type)\n" );
@@ -3995,10 +3995,10 @@ static void x264_analyse_update_cache( x264_t *h, x264_mb_analysis_t *a  )
                 x264_log( h, X264_LOG_DEBUG, "mb_xy: %d,%d \n", h->mb.i_mb_x, h->mb.i_mb_y);
                 x264_log( h, X264_LOG_DEBUG, "completed: %d \n", completed );
                 x264_log( h, X264_LOG_WARNING, "recovering by using intra mode\n");
-                x264_mb_analyse_intra( h, a, COST_MAX );
+                mb_analyse_intra( h, a, COST_MAX );
                 h->mb.i_type = I_16x16;
                 h->mb.i_intra16x16_pred_mode = a->i_predict16x16;
-                x264_mb_analyse_intra_chroma( h, a );
+                mb_analyse_intra_chroma( h, a );
             }
         }
     }
index 9debd1eccf4092c80218f705f60b994b29f0a205..2465a5e6ab4b1eeab0726d79fed25630bb9c7916 100644 (file)
@@ -32,7 +32,7 @@
 #define RDO_SKIP_BS 0
 #endif
 
-static inline void x264_cabac_mb_type_intra( x264_t *h, x264_cabac_t *cb, int i_mb_type,
+static inline void cabac_mb_type_intra( x264_t *h, x264_cabac_t *cb, int i_mb_type,
                     int ctx0, int ctx1, int ctx2, int ctx3, int ctx4, int ctx5 )
 {
     if( i_mb_type == I_4x4 || i_mb_type == I_8x8 )
@@ -67,7 +67,7 @@ static inline void x264_cabac_mb_type_intra( x264_t *h, x264_cabac_t *cb, int i_
 }
 
 #if !RDO_SKIP_BS
-static void x264_cabac_field_decoding_flag( x264_t *h, x264_cabac_t *cb )
+static void cabac_field_decoding_flag( x264_t *h, x264_cabac_t *cb )
 {
     int ctx = 0;
     ctx += h->mb.field_decoding_flag & !!h->mb.i_mb_x;
@@ -80,7 +80,7 @@ static void x264_cabac_field_decoding_flag( x264_t *h, x264_cabac_t *cb )
 }
 #endif
 
-static void x264_cabac_intra4x4_pred_mode( x264_cabac_t *cb, int i_pred, int i_mode )
+static void cabac_intra4x4_pred_mode( x264_cabac_t *cb, int i_pred, int i_mode )
 {
     if( i_pred == i_mode )
         x264_cabac_encode_decision( cb, 68, 1 );
@@ -95,7 +95,7 @@ static void x264_cabac_intra4x4_pred_mode( x264_cabac_t *cb, int i_pred, int i_m
     }
 }
 
-static void x264_cabac_intra_chroma_pred_mode( x264_t *h, x264_cabac_t *cb )
+static void cabac_intra_chroma_pred_mode( x264_t *h, x264_cabac_t *cb )
 {
     int i_mode = x264_mb_chroma_pred_mode_fix[h->mb.i_chroma_pred_mode];
     int ctx = 0;
@@ -115,7 +115,7 @@ static void x264_cabac_intra_chroma_pred_mode( x264_t *h, x264_cabac_t *cb )
     }
 }
 
-static void x264_cabac_cbp_luma( x264_t *h, x264_cabac_t *cb )
+static void cabac_cbp_luma( x264_t *h, x264_cabac_t *cb )
 {
     int cbp = h->mb.i_cbp_luma;
     int cbp_l = h->mb.cache.i_cbp_left;
@@ -126,7 +126,7 @@ static void x264_cabac_cbp_luma( x264_t *h, x264_cabac_t *cb )
     x264_cabac_encode_decision_noup( cb, 76 - ((cbp   >> 2) & 1) - ((cbp   >> 0) & 2), (cbp >> 3) & 1 );
 }
 
-static void x264_cabac_cbp_chroma( x264_t *h, x264_cabac_t *cb )
+static void cabac_cbp_chroma( x264_t *h, x264_cabac_t *cb )
 {
     int cbp_a = h->mb.cache.i_cbp_left & 0x30;
     int cbp_b = h->mb.cache.i_cbp_top  & 0x30;
@@ -147,7 +147,7 @@ static void x264_cabac_cbp_chroma( x264_t *h, x264_cabac_t *cb )
     }
 }
 
-static void x264_cabac_qp_delta( x264_t *h, x264_cabac_t *cb )
+static void cabac_qp_delta( x264_t *h, x264_cabac_t *cb )
 {
     int i_dqp = h->mb.i_qp - h->mb.i_last_qp;
     int ctx;
@@ -195,7 +195,7 @@ void x264_cabac_mb_skip( x264_t *h, int b_skip )
 }
 #endif
 
-static inline void x264_cabac_subpartition_p( x264_cabac_t *cb, int i_sub )
+static inline void cabac_subpartition_p( x264_cabac_t *cb, int i_sub )
 {
     if( i_sub == D_L0_8x8 )
     {
@@ -212,7 +212,7 @@ static inline void x264_cabac_subpartition_p( x264_cabac_t *cb, int i_sub )
     }
 }
 
-static ALWAYS_INLINE void x264_cabac_subpartition_b( x264_cabac_t *cb, int i_sub )
+static ALWAYS_INLINE void cabac_subpartition_b( x264_cabac_t *cb, int i_sub )
 {
     if( i_sub == D_DIRECT_8x8 )
     {
@@ -232,13 +232,13 @@ static ALWAYS_INLINE void x264_cabac_subpartition_b( x264_cabac_t *cb, int i_sub
     x264_cabac_encode_decision( cb, 39, i_sub == D_L1_8x8 );
 }
 
-static ALWAYS_INLINE void x264_cabac_transform_size( x264_t *h, x264_cabac_t *cb )
+static ALWAYS_INLINE void cabac_transform_size( x264_t *h, x264_cabac_t *cb )
 {
     int ctx = 399 + h->mb.cache.i_neighbour_transform_size;
     x264_cabac_encode_decision_noup( cb, ctx, h->mb.b_transform_8x8 );
 }
 
-static ALWAYS_INLINE void x264_cabac_ref_internal( x264_t *h, x264_cabac_t *cb, int i_list, int idx, int bframe )
+static ALWAYS_INLINE void cabac_ref_internal( x264_t *h, x264_cabac_t *cb, int i_list, int idx, int bframe )
 {
     const int i8 = x264_scan8[idx];
     const int i_refa = h->mb.cache.ref[i_list][i8 - 1];
@@ -258,16 +258,16 @@ static ALWAYS_INLINE void x264_cabac_ref_internal( x264_t *h, x264_cabac_t *cb,
     x264_cabac_encode_decision( cb, 54 + ctx, 0 );
 }
 
-static NOINLINE void x264_cabac_ref_p( x264_t *h, x264_cabac_t *cb, int idx )
+static NOINLINE void cabac_ref_p( x264_t *h, x264_cabac_t *cb, int idx )
 {
-    x264_cabac_ref_internal( h, cb, 0, idx, 0 );
+    cabac_ref_internal( h, cb, 0, idx, 0 );
 }
-static NOINLINE void x264_cabac_ref_b( x264_t *h, x264_cabac_t *cb, int i_list, int idx )
+static NOINLINE void cabac_ref_b( x264_t *h, x264_cabac_t *cb, int i_list, int idx )
 {
-    x264_cabac_ref_internal( h, cb, i_list, idx, 1 );
+    cabac_ref_internal( h, cb, i_list, idx, 1 );
 }
 
-static ALWAYS_INLINE int x264_cabac_mvd_cpn( x264_t *h, x264_cabac_t *cb, int i_list, int idx, int l, int mvd, int ctx )
+static ALWAYS_INLINE int cabac_mvd_cpn( x264_t *h, x264_cabac_t *cb, int i_list, int idx, int l, int mvd, int ctx )
 {
     int ctxbase = l ? 47 : 40;
 
@@ -326,7 +326,7 @@ static ALWAYS_INLINE int x264_cabac_mvd_cpn( x264_t *h, x264_cabac_t *cb, int i_
     return X264_MIN( i_abs, 66 );
 }
 
-static NOINLINE uint16_t x264_cabac_mvd( x264_t *h, x264_cabac_t *cb, int i_list, int idx, int width )
+static NOINLINE uint16_t cabac_mvd( x264_t *h, x264_cabac_t *cb, int i_list, int idx, int width )
 {
     ALIGNED_4( int16_t mvp[2] );
     int mdx, mdy;
@@ -339,46 +339,46 @@ static NOINLINE uint16_t x264_cabac_mvd( x264_t *h, x264_cabac_t *cb, int i_list
                                        h->mb.cache.mvd[i_list][x264_scan8[idx] - 8]);
 
     /* encode */
-    mdx = x264_cabac_mvd_cpn( h, cb, i_list, idx, 0, mdx, amvd&0xFF );
-    mdy = x264_cabac_mvd_cpn( h, cb, i_list, idx, 1, mdy, amvd>>8 );
+    mdx = cabac_mvd_cpn( h, cb, i_list, idx, 0, mdx, amvd&0xFF );
+    mdy = cabac_mvd_cpn( h, cb, i_list, idx, 1, mdy, amvd>>8 );
 
     return pack8to16(mdx,mdy);
 }
 
-#define x264_cabac_mvd(h,cb,i_list,idx,width,height)\
+#define cabac_mvd(h,cb,i_list,idx,width,height)\
 do\
 {\
-    uint16_t mvd = x264_cabac_mvd(h,cb,i_list,idx,width);\
+    uint16_t mvd = cabac_mvd(h,cb,i_list,idx,width);\
     x264_macroblock_cache_mvd( h, block_idx_x[idx], block_idx_y[idx], width, height, i_list, mvd );\
 } while( 0 )
 
-static inline void x264_cabac_8x8_mvd( x264_t *h, x264_cabac_t *cb, int i )
+static inline void cabac_8x8_mvd( x264_t *h, x264_cabac_t *cb, int i )
 {
     switch( h->mb.i_sub_partition[i] )
     {
         case D_L0_8x8:
-            x264_cabac_mvd( h, cb, 0, 4*i, 2, 2 );
+            cabac_mvd( h, cb, 0, 4*i, 2, 2 );
             break;
         case D_L0_8x4:
-            x264_cabac_mvd( h, cb, 0, 4*i+0, 2, 1 );
-            x264_cabac_mvd( h, cb, 0, 4*i+2, 2, 1 );
+            cabac_mvd( h, cb, 0, 4*i+0, 2, 1 );
+            cabac_mvd( h, cb, 0, 4*i+2, 2, 1 );
             break;
         case D_L0_4x8:
-            x264_cabac_mvd( h, cb, 0, 4*i+0, 1, 2 );
-            x264_cabac_mvd( h, cb, 0, 4*i+1, 1, 2 );
+            cabac_mvd( h, cb, 0, 4*i+0, 1, 2 );
+            cabac_mvd( h, cb, 0, 4*i+1, 1, 2 );
             break;
         case D_L0_4x4:
-            x264_cabac_mvd( h, cb, 0, 4*i+0, 1, 1 );
-            x264_cabac_mvd( h, cb, 0, 4*i+1, 1, 1 );
-            x264_cabac_mvd( h, cb, 0, 4*i+2, 1, 1 );
-            x264_cabac_mvd( h, cb, 0, 4*i+3, 1, 1 );
+            cabac_mvd( h, cb, 0, 4*i+0, 1, 1 );
+            cabac_mvd( h, cb, 0, 4*i+1, 1, 1 );
+            cabac_mvd( h, cb, 0, 4*i+2, 1, 1 );
+            cabac_mvd( h, cb, 0, 4*i+3, 1, 1 );
             break;
         default:
             assert(0);
     }
 }
 
-static ALWAYS_INLINE void x264_cabac_mb_header_i( x264_t *h, x264_cabac_t *cb, int i_mb_type, int slice_type, int chroma )
+static ALWAYS_INLINE void cabac_mb_header_i( x264_t *h, x264_cabac_t *cb, int i_mb_type, int slice_type, int chroma )
 {
     if( slice_type == SLICE_TYPE_I )
     {
@@ -388,7 +388,7 @@ static ALWAYS_INLINE void x264_cabac_mb_header_i( x264_t *h, x264_cabac_t *cb, i
         if( (h->mb.i_neighbour & MB_TOP) && h->mb.i_mb_type_top != I_4x4 )
             ctx++;
 
-        x264_cabac_mb_type_intra( h, cb, i_mb_type, 3+ctx, 3+3, 3+4, 3+5, 3+6, 3+7 );
+        cabac_mb_type_intra( h, cb, i_mb_type, 3+ctx, 3+3, 3+4, 3+5, 3+6, 3+7 );
     }
     else if( slice_type == SLICE_TYPE_P )
     {
@@ -396,7 +396,7 @@ static ALWAYS_INLINE void x264_cabac_mb_header_i( x264_t *h, x264_cabac_t *cb, i
         x264_cabac_encode_decision_noup( cb, 14, 1 );
 
         /* suffix */
-        x264_cabac_mb_type_intra( h, cb, i_mb_type, 17+0, 17+1, 17+2, 17+2, 17+3, 17+3 );
+        cabac_mb_type_intra( h, cb, i_mb_type, 17+0, 17+1, 17+2, 17+2, 17+3, 17+3 );
     }
     else if( slice_type == SLICE_TYPE_B )
     {
@@ -408,7 +408,7 @@ static ALWAYS_INLINE void x264_cabac_mb_header_i( x264_t *h, x264_cabac_t *cb, i
         x264_cabac_encode_decision( cb, 27+5,   1 );
 
         /* suffix */
-        x264_cabac_mb_type_intra( h, cb, i_mb_type, 32+0, 32+1, 32+2, 32+2, 32+3, 32+3 );
+        cabac_mb_type_intra( h, cb, i_mb_type, 32+0, 32+1, 32+2, 32+2, 32+3, 32+3 );
     }
 
     if( i_mb_type == I_PCM )
@@ -417,22 +417,22 @@ static ALWAYS_INLINE void x264_cabac_mb_header_i( x264_t *h, x264_cabac_t *cb, i
     if( i_mb_type != I_16x16 )
     {
         if( h->pps->b_transform_8x8_mode )
-            x264_cabac_transform_size( h, cb );
+            cabac_transform_size( h, cb );
 
         int di = h->mb.b_transform_8x8 ? 4 : 1;
         for( int i = 0; i < 16; i += di )
         {
             const int i_pred = x264_mb_predict_intra4x4_mode( h, i );
             const int i_mode = x264_mb_pred_mode4x4_fix( h->mb.cache.intra4x4_pred_mode[x264_scan8[i]] );
-            x264_cabac_intra4x4_pred_mode( cb, i_pred, i_mode );
+            cabac_intra4x4_pred_mode( cb, i_pred, i_mode );
         }
     }
 
     if( chroma )
-        x264_cabac_intra_chroma_pred_mode( h, cb );
+        cabac_intra_chroma_pred_mode( h, cb );
 }
 
-static ALWAYS_INLINE void x264_cabac_mb_header_p( x264_t *h, x264_cabac_t *cb, int i_mb_type, int chroma )
+static ALWAYS_INLINE void cabac_mb_header_p( x264_t *h, x264_cabac_t *cb, int i_mb_type, int chroma )
 {
     if( i_mb_type == P_L0 )
     {
@@ -442,8 +442,8 @@ static ALWAYS_INLINE void x264_cabac_mb_header_p( x264_t *h, x264_cabac_t *cb, i
             x264_cabac_encode_decision_noup( cb, 15, 0 );
             x264_cabac_encode_decision_noup( cb, 16, 0 );
             if( h->mb.pic.i_fref[0] > 1 )
-                x264_cabac_ref_p( h, cb, 0 );
-            x264_cabac_mvd( h, cb, 0, 0, 4, 4 );
+                cabac_ref_p( h, cb, 0 );
+            cabac_mvd( h, cb, 0, 0, 4, 4 );
         }
         else if( h->mb.i_partition == D_16x8 )
         {
@@ -451,11 +451,11 @@ static ALWAYS_INLINE void x264_cabac_mb_header_p( x264_t *h, x264_cabac_t *cb, i
             x264_cabac_encode_decision_noup( cb, 17, 1 );
             if( h->mb.pic.i_fref[0] > 1 )
             {
-                x264_cabac_ref_p( h, cb, 0 );
-                x264_cabac_ref_p( h, cb, 8 );
+                cabac_ref_p( h, cb, 0 );
+                cabac_ref_p( h, cb, 8 );
             }
-            x264_cabac_mvd( h, cb, 0, 0, 4, 2 );
-            x264_cabac_mvd( h, cb, 0, 8, 4, 2 );
+            cabac_mvd( h, cb, 0, 0, 4, 2 );
+            cabac_mvd( h, cb, 0, 8, 4, 2 );
         }
         else //if( h->mb.i_partition == D_8x16 )
         {
@@ -463,11 +463,11 @@ static ALWAYS_INLINE void x264_cabac_mb_header_p( x264_t *h, x264_cabac_t *cb, i
             x264_cabac_encode_decision_noup( cb, 17, 0 );
             if( h->mb.pic.i_fref[0] > 1 )
             {
-                x264_cabac_ref_p( h, cb, 0 );
-                x264_cabac_ref_p( h, cb, 4 );
+                cabac_ref_p( h, cb, 0 );
+                cabac_ref_p( h, cb, 4 );
             }
-            x264_cabac_mvd( h, cb, 0, 0, 2, 4 );
-            x264_cabac_mvd( h, cb, 0, 4, 2, 4 );
+            cabac_mvd( h, cb, 0, 0, 2, 4 );
+            cabac_mvd( h, cb, 0, 4, 2, 4 );
         }
     }
     else if( i_mb_type == P_8x8 )
@@ -478,25 +478,25 @@ static ALWAYS_INLINE void x264_cabac_mb_header_p( x264_t *h, x264_cabac_t *cb, i
 
         /* sub mb type */
         for( int i = 0; i < 4; i++ )
-            x264_cabac_subpartition_p( cb, h->mb.i_sub_partition[i] );
+            cabac_subpartition_p( cb, h->mb.i_sub_partition[i] );
 
         /* ref 0 */
         if( h->mb.pic.i_fref[0] > 1 )
         {
-            x264_cabac_ref_p( h, cb,  0 );
-            x264_cabac_ref_p( h, cb,  4 );
-            x264_cabac_ref_p( h, cb,  8 );
-            x264_cabac_ref_p( h, cb, 12 );
+            cabac_ref_p( h, cb,  0 );
+            cabac_ref_p( h, cb,  4 );
+            cabac_ref_p( h, cb,  8 );
+            cabac_ref_p( h, cb, 12 );
         }
 
         for( int i = 0; i < 4; i++ )
-            x264_cabac_8x8_mvd( h, cb, i );
+            cabac_8x8_mvd( h, cb, i );
     }
     else /* intra */
-        x264_cabac_mb_header_i( h, cb, i_mb_type, SLICE_TYPE_P, chroma );
+        cabac_mb_header_i( h, cb, i_mb_type, SLICE_TYPE_P, chroma );
 }
 
-static ALWAYS_INLINE void x264_cabac_mb_header_b( x264_t *h, x264_cabac_t *cb, int i_mb_type, int chroma )
+static ALWAYS_INLINE void cabac_mb_header_b( x264_t *h, x264_cabac_t *cb, int i_mb_type, int chroma )
 {
     int ctx = 0;
     if( (h->mb.i_neighbour & MB_LEFT) && h->mb.i_mb_type_left[0] != B_SKIP && h->mb.i_mb_type_left[0] != B_DIRECT )
@@ -521,26 +521,26 @@ static ALWAYS_INLINE void x264_cabac_mb_header_b( x264_t *h, x264_cabac_t *cb, i
 
         /* sub mb type */
         for( int i = 0; i < 4; i++ )
-            x264_cabac_subpartition_b( cb, h->mb.i_sub_partition[i] );
+            cabac_subpartition_b( cb, h->mb.i_sub_partition[i] );
 
         /* ref */
         if( h->mb.pic.i_fref[0] > 1 )
             for( int i = 0; i < 4; i++ )
                 if( x264_mb_partition_listX_table[0][ h->mb.i_sub_partition[i] ] )
-                    x264_cabac_ref_b( h, cb, 0, 4*i );
+                    cabac_ref_b( h, cb, 0, 4*i );
 
         if( h->mb.pic.i_fref[1] > 1 )
             for( int i = 0; i < 4; i++ )
                 if( x264_mb_partition_listX_table[1][ h->mb.i_sub_partition[i] ] )
-                    x264_cabac_ref_b( h, cb, 1, 4*i );
+                    cabac_ref_b( h, cb, 1, 4*i );
 
         for( int i = 0; i < 4; i++ )
             if( x264_mb_partition_listX_table[0][ h->mb.i_sub_partition[i] ] )
-                x264_cabac_mvd( h, cb, 0, 4*i, 2, 2 );
+                cabac_mvd( h, cb, 0, 4*i, 2, 2 );
 
         for( int i = 0; i < 4; i++ )
             if( x264_mb_partition_listX_table[1][ h->mb.i_sub_partition[i] ] )
-                x264_cabac_mvd( h, cb, 1, 4*i, 2, 2 );
+                cabac_mvd( h, cb, 1, 4*i, 2, 2 );
     }
     else if( i_mb_type >= B_L0_L0 && i_mb_type <= B_BI_BI )
     {
@@ -576,40 +576,40 @@ static ALWAYS_INLINE void x264_cabac_mb_header_b( x264_t *h, x264_cabac_t *cb, i
         if( h->mb.pic.i_fref[0] > 1 )
         {
             if( b_list[0][0] )
-                x264_cabac_ref_b( h, cb, 0, 0 );
+                cabac_ref_b( h, cb, 0, 0 );
             if( b_list[0][1] && h->mb.i_partition != D_16x16 )
-                x264_cabac_ref_b( h, cb, 0, 8 >> (h->mb.i_partition == D_8x16) );
+                cabac_ref_b( h, cb, 0, 8 >> (h->mb.i_partition == D_8x16) );
         }
         if( h->mb.pic.i_fref[1] > 1 )
         {
             if( b_list[1][0] )
-                x264_cabac_ref_b( h, cb, 1, 0 );
+                cabac_ref_b( h, cb, 1, 0 );
             if( b_list[1][1] && h->mb.i_partition != D_16x16 )
-                x264_cabac_ref_b( h, cb, 1, 8 >> (h->mb.i_partition == D_8x16) );
+                cabac_ref_b( h, cb, 1, 8 >> (h->mb.i_partition == D_8x16) );
         }
         for( int i_list = 0; i_list < 2; i_list++ )
         {
             if( h->mb.i_partition == D_16x16 )
             {
-                if( b_list[i_list][0] ) x264_cabac_mvd( h, cb, i_list, 0, 4, 4 );
+                if( b_list[i_list][0] ) cabac_mvd( h, cb, i_list, 0, 4, 4 );
             }
             else if( h->mb.i_partition == D_16x8 )
             {
-                if( b_list[i_list][0] ) x264_cabac_mvd( h, cb, i_list, 0, 4, 2 );
-                if( b_list[i_list][1] ) x264_cabac_mvd( h, cb, i_list, 8, 4, 2 );
+                if( b_list[i_list][0] ) cabac_mvd( h, cb, i_list, 0, 4, 2 );
+                if( b_list[i_list][1] ) cabac_mvd( h, cb, i_list, 8, 4, 2 );
             }
             else //if( h->mb.i_partition == D_8x16 )
             {
-                if( b_list[i_list][0] ) x264_cabac_mvd( h, cb, i_list, 0, 2, 4 );
-                if( b_list[i_list][1] ) x264_cabac_mvd( h, cb, i_list, 4, 2, 4 );
+                if( b_list[i_list][0] ) cabac_mvd( h, cb, i_list, 0, 2, 4 );
+                if( b_list[i_list][1] ) cabac_mvd( h, cb, i_list, 4, 2, 4 );
             }
         }
     }
     else /* intra */
-        x264_cabac_mb_header_i( h, cb, i_mb_type, SLICE_TYPE_B, chroma );
+        cabac_mb_header_i( h, cb, i_mb_type, SLICE_TYPE_B, chroma );
 }
 
-static int ALWAYS_INLINE x264_cabac_cbf_ctxidxinc( x264_t *h, int i_cat, int i_idx, int b_intra, int b_dc )
+static int ALWAYS_INLINE cabac_cbf_ctxidxinc( x264_t *h, int i_cat, int i_idx, int b_intra, int b_dc )
 {
     static const uint16_t base_ctx[14] = {85,89,93,97,101,1012,460,464,468,1016,472,476,480,1020};
 
@@ -709,7 +709,7 @@ static const uint8_t coeff_abs_level_transition[2][8] = {
 };
 
 #if !RDO_SKIP_BS
-static ALWAYS_INLINE void x264_cabac_block_residual_internal( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l, int chroma422dc )
+static ALWAYS_INLINE void cabac_block_residual_internal( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l, int chroma422dc )
 {
     int ctx_sig = x264_significant_coeff_flag_offset[MB_INTERLACED][ctx_block_cat];
     int ctx_last = x264_last_coeff_flag_offset[MB_INTERLACED][ctx_block_cat];
@@ -796,10 +796,10 @@ static ALWAYS_INLINE void x264_cabac_block_residual_internal( x264_t *h, x264_ca
 
 void x264_cabac_block_residual_c( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l )
 {
-    x264_cabac_block_residual_internal( h, cb, ctx_block_cat, l, 0 );
+    cabac_block_residual_internal( h, cb, ctx_block_cat, l, 0 );
 }
 
-static void ALWAYS_INLINE x264_cabac_block_residual( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l )
+static void ALWAYS_INLINE cabac_block_residual( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l )
 {
 #if ARCH_X86_64 && HAVE_MMX && !defined( __MACH__ )
     h->bsf.cabac_block_residual_internal( l, MB_INTERLACED, ctx_block_cat, cb );
@@ -807,19 +807,19 @@ static void ALWAYS_INLINE x264_cabac_block_residual( x264_t *h, x264_cabac_t *cb
     x264_cabac_block_residual_c( h, cb, ctx_block_cat, l );
 #endif
 }
-static void x264_cabac_block_residual_422_dc( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l )
+static void cabac_block_residual_422_dc( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l )
 {
     /* Template a version specifically for chroma 4:2:2 DC in order to avoid
      * slowing down everything else due to the added complexity. */
-    x264_cabac_block_residual_internal( h, cb, DCT_CHROMA_DC, l, 1 );
+    cabac_block_residual_internal( h, cb, DCT_CHROMA_DC, l, 1 );
 }
-#define x264_cabac_block_residual_8x8( h, cb, cat, l ) x264_cabac_block_residual( h, cb, cat, l )
+#define cabac_block_residual_8x8( h, cb, cat, l ) cabac_block_residual( h, cb, cat, l )
 #else
 
 /* Faster RDO by merging sigmap and level coding. Note that for 8x8dct and chroma 4:2:2 dc this is
  * slightly incorrect because the sigmap is not reversible (contexts are repeated). However, there
  * is nearly no quality penalty for this (~0.001db) and the speed boost (~30%) is worth it. */
-static void ALWAYS_INLINE x264_cabac_block_residual_internal( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l, int b_8x8, int chroma422dc )
+static void ALWAYS_INLINE cabac_block_residual_internal( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l, int b_8x8, int chroma422dc )
 {
     const uint8_t *sig_offset = x264_significant_coeff_flag_offset_8x8[MB_INTERLACED];
     int ctx_sig = x264_significant_coeff_flag_offset[MB_INTERLACED][ctx_block_cat];
@@ -906,14 +906,14 @@ static void ALWAYS_INLINE x264_cabac_block_residual_internal( x264_t *h, x264_ca
 
 void x264_cabac_block_residual_8x8_rd_c( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l )
 {
-    x264_cabac_block_residual_internal( h, cb, ctx_block_cat, l, 1, 0 );
+    cabac_block_residual_internal( h, cb, ctx_block_cat, l, 1, 0 );
 }
 void x264_cabac_block_residual_rd_c( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l )
 {
-    x264_cabac_block_residual_internal( h, cb, ctx_block_cat, l, 0, 0 );
+    cabac_block_residual_internal( h, cb, ctx_block_cat, l, 0, 0 );
 }
 
-static ALWAYS_INLINE void x264_cabac_block_residual_8x8( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l )
+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__ )
     h->bsf.cabac_block_residual_8x8_rd_internal( l, MB_INTERLACED, ctx_block_cat, cb );
@@ -921,7 +921,7 @@ static ALWAYS_INLINE void x264_cabac_block_residual_8x8( x264_t *h, x264_cabac_t
     x264_cabac_block_residual_8x8_rd_c( h, cb, ctx_block_cat, l );
 #endif
 }
-static ALWAYS_INLINE void x264_cabac_block_residual( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l )
+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__ )
     h->bsf.cabac_block_residual_rd_internal( l, MB_INTERLACED, ctx_block_cat, cb );
@@ -930,38 +930,38 @@ static ALWAYS_INLINE void x264_cabac_block_residual( x264_t *h, x264_cabac_t *cb
 #endif
 }
 
-static void x264_cabac_block_residual_422_dc( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l )
+static void cabac_block_residual_422_dc( x264_t *h, x264_cabac_t *cb, int ctx_block_cat, dctcoef *l )
 {
-    x264_cabac_block_residual_internal( h, cb, DCT_CHROMA_DC, l, 0, 1 );
+    cabac_block_residual_internal( h, cb, DCT_CHROMA_DC, l, 0, 1 );
 }
 #endif
 
-#define x264_cabac_block_residual_cbf_internal( h, cb, ctx_block_cat, i_idx, l, b_intra, b_dc, name )\
+#define cabac_block_residual_cbf_internal( h, cb, ctx_block_cat, i_idx, l, b_intra, b_dc, name )\
 do\
 {\
-    int ctxidxinc = x264_cabac_cbf_ctxidxinc( h, ctx_block_cat, i_idx, b_intra, b_dc );\
+    int ctxidxinc = cabac_cbf_ctxidxinc( h, ctx_block_cat, i_idx, b_intra, b_dc );\
     if( h->mb.cache.non_zero_count[x264_scan8[i_idx]] )\
     {\
         x264_cabac_encode_decision( cb, ctxidxinc, 1 );\
-        x264_cabac_block_residual##name( h, cb, ctx_block_cat, l );\
+        cabac_block_residual##name( h, cb, ctx_block_cat, l );\
     }\
     else\
         x264_cabac_encode_decision( cb, ctxidxinc, 0 );\
 } while( 0 )
 
-#define x264_cabac_block_residual_dc_cbf( h, cb, ctx_block_cat, i_idx, l, b_intra )\
-    x264_cabac_block_residual_cbf_internal( h, cb, ctx_block_cat, i_idx, l, b_intra, 1, )
+#define cabac_block_residual_dc_cbf( h, cb, ctx_block_cat, i_idx, l, b_intra )\
+    cabac_block_residual_cbf_internal( h, cb, ctx_block_cat, i_idx, l, b_intra, 1, )
 
-#define x264_cabac_block_residual_cbf( h, cb, ctx_block_cat, i_idx, l, b_intra )\
-    x264_cabac_block_residual_cbf_internal( h, cb, ctx_block_cat, i_idx, l, b_intra, 0, )
+#define cabac_block_residual_cbf( h, cb, ctx_block_cat, i_idx, l, b_intra )\
+    cabac_block_residual_cbf_internal( h, cb, ctx_block_cat, i_idx, l, b_intra, 0, )
 
-#define x264_cabac_block_residual_8x8_cbf( h, cb, ctx_block_cat, i_idx, l, b_intra )\
-    x264_cabac_block_residual_cbf_internal( h, cb, ctx_block_cat, i_idx, l, b_intra, 0, _8x8 )
+#define cabac_block_residual_8x8_cbf( h, cb, ctx_block_cat, i_idx, l, b_intra )\
+    cabac_block_residual_cbf_internal( h, cb, ctx_block_cat, i_idx, l, b_intra, 0, _8x8 )
 
-#define x264_cabac_block_residual_422_dc_cbf( h, cb, ch, b_intra )\
-    x264_cabac_block_residual_cbf_internal( h, cb, DCT_CHROMA_DC, CHROMA_DC+(ch), h->dct.chroma_dc[ch], b_intra, 1, _422_dc )
+#define cabac_block_residual_422_dc_cbf( h, cb, ch, b_intra )\
+    cabac_block_residual_cbf_internal( h, cb, DCT_CHROMA_DC, CHROMA_DC+(ch), h->dct.chroma_dc[ch], b_intra, 1, _422_dc )
 
-static ALWAYS_INLINE void x264_macroblock_write_cabac_internal( x264_t *h, x264_cabac_t *cb, int plane_count, int chroma )
+static ALWAYS_INLINE void macroblock_write_cabac_internal( x264_t *h, x264_cabac_t *cb, int plane_count, int chroma )
 {
     const int i_mb_type = h->mb.i_type;
 
@@ -972,16 +972,16 @@ static ALWAYS_INLINE void x264_macroblock_write_cabac_internal( x264_t *h, x264_
     if( SLICE_MBAFF &&
         (!(h->mb.i_mb_y & 1) || IS_SKIP(h->mb.type[h->mb.i_mb_xy - h->mb.i_mb_stride])) )
     {
-        x264_cabac_field_decoding_flag( h, cb );
+        cabac_field_decoding_flag( h, cb );
     }
 #endif
 
     if( h->sh.i_type == SLICE_TYPE_P )
-        x264_cabac_mb_header_p( h, cb, i_mb_type, chroma );
+        cabac_mb_header_p( h, cb, i_mb_type, chroma );
     else if( h->sh.i_type == SLICE_TYPE_B )
-        x264_cabac_mb_header_b( h, cb, i_mb_type, chroma );
+        cabac_mb_header_b( h, cb, i_mb_type, chroma );
     else //if( h->sh.i_type == SLICE_TYPE_I )
-        x264_cabac_mb_header_i( h, cb, i_mb_type, SLICE_TYPE_I, chroma );
+        cabac_mb_header_i( h, cb, i_mb_type, SLICE_TYPE_I, chroma );
 
 #if !RDO_SKIP_BS
     i_mb_pos_tex = x264_cabac_pos( cb );
@@ -1012,20 +1012,20 @@ static ALWAYS_INLINE void x264_macroblock_write_cabac_internal( x264_t *h, x264_
 
     if( i_mb_type != I_16x16 )
     {
-        x264_cabac_cbp_luma( h, cb );
+        cabac_cbp_luma( h, cb );
         if( chroma )
-            x264_cabac_cbp_chroma( h, cb );
+            cabac_cbp_chroma( h, cb );
     }
 
     if( x264_mb_transform_8x8_allowed( h ) && h->mb.i_cbp_luma )
     {
-        x264_cabac_transform_size( h, cb );
+        cabac_transform_size( h, cb );
     }
 
     if( h->mb.i_cbp_luma || (chroma && h->mb.i_cbp_chroma) || i_mb_type == I_16x16 )
     {
         const int b_intra = IS_INTRA( i_mb_type );
-        x264_cabac_qp_delta( h, cb );
+        cabac_qp_delta( h, cb );
 
         /* write residual */
         if( i_mb_type == I_16x16 )
@@ -1033,12 +1033,12 @@ static ALWAYS_INLINE void x264_macroblock_write_cabac_internal( x264_t *h, x264_
             /* DC Luma */
             for( int p = 0; p < plane_count; p++ )
             {
-                x264_cabac_block_residual_dc_cbf( h, cb, ctx_cat_plane[DCT_LUMA_DC][p], LUMA_DC+p, h->dct.luma16x16_dc[p], 1 );
+                cabac_block_residual_dc_cbf( h, cb, ctx_cat_plane[DCT_LUMA_DC][p], LUMA_DC+p, h->dct.luma16x16_dc[p], 1 );
 
                 /* AC Luma */
                 if( h->mb.i_cbp_luma )
                     for( int i = p*16; i < p*16+16; i++ )
-                        x264_cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_AC][p], i, h->dct.luma4x4[i]+1, 1 );
+                        cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_AC][p], i, h->dct.luma4x4[i]+1, 1 );
             }
         }
         else if( h->mb.b_transform_8x8 )
@@ -1086,14 +1086,14 @@ if( (h->mb.i_neighbour & MB_TOP) && !h->mb.mb_transform_size[h->mb.i_mb_top_xy]
 
                 for( int p = 0; p < 3; p++ )
                     FOREACH_BIT( i, 0, h->mb.i_cbp_luma )
-                        x264_cabac_block_residual_8x8_cbf( h, cb, ctx_cat_plane[DCT_LUMA_8x8][p], i*4+p*16, h->dct.luma8x8[i+p*4], b_intra );
+                        cabac_block_residual_8x8_cbf( h, cb, ctx_cat_plane[DCT_LUMA_8x8][p], i*4+p*16, h->dct.luma8x8[i+p*4], b_intra );
 
                 MUNGE_8x8_NNZ( RESTORE )
             }
             else
             {
                 FOREACH_BIT( i, 0, h->mb.i_cbp_luma )
-                    x264_cabac_block_residual_8x8( h, cb, DCT_LUMA_8x8, h->dct.luma8x8[i] );
+                    cabac_block_residual_8x8( h, cb, DCT_LUMA_8x8, h->dct.luma8x8[i] );
             }
         }
         else
@@ -1101,20 +1101,20 @@ if( (h->mb.i_neighbour & MB_TOP) && !h->mb.mb_transform_size[h->mb.i_mb_top_xy]
             for( int p = 0; p < plane_count; p++ )
                 FOREACH_BIT( i8x8, 0, h->mb.i_cbp_luma )
                     for( int i = 0; i < 4; i++ )
-                        x264_cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_4x4][p], i+i8x8*4+p*16, h->dct.luma4x4[i+i8x8*4+p*16], b_intra );
+                        cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_4x4][p], i+i8x8*4+p*16, h->dct.luma4x4[i+i8x8*4+p*16], b_intra );
         }
 
         if( chroma && h->mb.i_cbp_chroma ) /* Chroma DC residual present */
         {
             if( CHROMA_FORMAT == CHROMA_422 )
             {
-                x264_cabac_block_residual_422_dc_cbf( h, cb, 0, b_intra );
-                x264_cabac_block_residual_422_dc_cbf( h, cb, 1, b_intra );
+                cabac_block_residual_422_dc_cbf( h, cb, 0, b_intra );
+                cabac_block_residual_422_dc_cbf( h, cb, 1, b_intra );
             }
             else
             {
-                x264_cabac_block_residual_dc_cbf( h, cb, DCT_CHROMA_DC, CHROMA_DC+0, h->dct.chroma_dc[0], b_intra );
-                x264_cabac_block_residual_dc_cbf( h, cb, DCT_CHROMA_DC, CHROMA_DC+1, h->dct.chroma_dc[1], b_intra );
+                cabac_block_residual_dc_cbf( h, cb, DCT_CHROMA_DC, CHROMA_DC+0, h->dct.chroma_dc[0], b_intra );
+                cabac_block_residual_dc_cbf( h, cb, DCT_CHROMA_DC, CHROMA_DC+1, h->dct.chroma_dc[1], b_intra );
             }
 
             if( h->mb.i_cbp_chroma == 2 ) /* Chroma AC residual present */
@@ -1122,7 +1122,7 @@ if( (h->mb.i_neighbour & MB_TOP) && !h->mb.mb_transform_size[h->mb.i_mb_top_xy]
                 int step = 8 << CHROMA_V_SHIFT;
                 for( int i = 16; i < 3*16; i += step )
                     for( int j = i; j < i+4; j++ )
-                        x264_cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, j, h->dct.luma4x4[j]+1, b_intra );
+                        cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, j, h->dct.luma4x4[j]+1, b_intra );
             }
         }
     }
@@ -1135,9 +1135,9 @@ if( (h->mb.i_neighbour & MB_TOP) && !h->mb.mb_transform_size[h->mb.i_mb_top_xy]
 void x264_macroblock_write_cabac( x264_t *h, x264_cabac_t *cb )
 {
     if( CHROMA444 )
-        x264_macroblock_write_cabac_internal( h, cb, 3, 0 );
+        macroblock_write_cabac_internal( h, cb, 3, 0 );
     else
-        x264_macroblock_write_cabac_internal( h, cb, 1, 1 );
+        macroblock_write_cabac_internal( h, cb, 1, 1 );
 }
 
 #if RDO_SKIP_BS
@@ -1148,7 +1148,7 @@ void x264_macroblock_write_cabac( x264_t *h, x264_cabac_t *cb )
  * only writes subpartition for p8x8, needed for sub-8x8 mode decision RDO
  * works on all partition sizes except 16x16
  *****************************************************************************/
-static void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int i_pixel )
+static void partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int i_pixel )
 {
     const int i_mb_type = h->mb.i_type;
     int b_8x16 = h->mb.i_partition == D_8x16;
@@ -1156,22 +1156,22 @@ static void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int
 
     if( i_mb_type == P_8x8 )
     {
-        x264_cabac_8x8_mvd( h, cb, i8 );
-        x264_cabac_subpartition_p( cb, h->mb.i_sub_partition[i8] );
+        cabac_8x8_mvd( h, cb, i8 );
+        cabac_subpartition_p( cb, h->mb.i_sub_partition[i8] );
     }
     else if( i_mb_type == P_L0 )
-        x264_cabac_mvd( h, cb, 0, 4*i8, 4>>b_8x16, 2<<b_8x16 );
+        cabac_mvd( h, cb, 0, 4*i8, 4>>b_8x16, 2<<b_8x16 );
     else if( i_mb_type > B_DIRECT && i_mb_type < B_8x8 )
     {
-        if( x264_mb_type_list_table[ i_mb_type ][0][!!i8] ) x264_cabac_mvd( h, cb, 0, 4*i8, 4>>b_8x16, 2<<b_8x16 );
-        if( x264_mb_type_list_table[ i_mb_type ][1][!!i8] ) x264_cabac_mvd( h, cb, 1, 4*i8, 4>>b_8x16, 2<<b_8x16 );
+        if( x264_mb_type_list_table[ i_mb_type ][0][!!i8] ) cabac_mvd( h, cb, 0, 4*i8, 4>>b_8x16, 2<<b_8x16 );
+        if( x264_mb_type_list_table[ i_mb_type ][1][!!i8] ) cabac_mvd( h, cb, 1, 4*i8, 4>>b_8x16, 2<<b_8x16 );
     }
     else //if( i_mb_type == B_8x8 )
     {
         if( x264_mb_partition_listX_table[0][ h->mb.i_sub_partition[i8] ] )
-            x264_cabac_mvd( h, cb, 0, 4*i8, 2, 2 );
+            cabac_mvd( h, cb, 0, 4*i8, 2, 2 );
         if( x264_mb_partition_listX_table[1][ h->mb.i_sub_partition[i8] ] )
-            x264_cabac_mvd( h, cb, 1, 4*i8, 2, 2 );
+            cabac_mvd( h, cb, 1, 4*i8, 2, 2 );
     }
 
     for( int j = (i_pixel < PIXEL_8x8); j >= 0; j-- )
@@ -1182,14 +1182,14 @@ static void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int
             {
                 if( CHROMA444 )
                     for( int p = 0; p < 3; p++ )
-                        x264_cabac_block_residual_8x8_cbf( h, cb, ctx_cat_plane[DCT_LUMA_8x8][p], i8*4+p*16, h->dct.luma8x8[i8+p*4], 0 );
+                        cabac_block_residual_8x8_cbf( h, cb, ctx_cat_plane[DCT_LUMA_8x8][p], i8*4+p*16, h->dct.luma8x8[i8+p*4], 0 );
                 else
-                    x264_cabac_block_residual_8x8( h, cb, DCT_LUMA_8x8, h->dct.luma8x8[i8] );
+                    cabac_block_residual_8x8( h, cb, DCT_LUMA_8x8, h->dct.luma8x8[i8] );
             }
             else
                 for( int p = 0; p < plane_count; p++ )
                     for( int i4 = 0; i4 < 4; i4++ )
-                        x264_cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_4x4][p], i4+i8*4+p*16, h->dct.luma4x4[i4+i8*4+p*16], 0 );
+                        cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_4x4][p], i4+i8*4+p*16, h->dct.luma4x4[i4+i8*4+p*16], 0 );
         }
 
         if( h->mb.i_cbp_chroma )
@@ -1197,15 +1197,15 @@ static void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int
             if( CHROMA_FORMAT == CHROMA_422 )
             {
                 int offset = (5*i8) & 0x09;
-                x264_cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 16+offset, h->dct.luma4x4[16+offset]+1, 0 );
-                x264_cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 18+offset, h->dct.luma4x4[18+offset]+1, 0 );
-                x264_cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 32+offset, h->dct.luma4x4[32+offset]+1, 0 );
-                x264_cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 34+offset, h->dct.luma4x4[34+offset]+1, 0 );
+                cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 16+offset, h->dct.luma4x4[16+offset]+1, 0 );
+                cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 18+offset, h->dct.luma4x4[18+offset]+1, 0 );
+                cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 32+offset, h->dct.luma4x4[32+offset]+1, 0 );
+                cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 34+offset, h->dct.luma4x4[34+offset]+1, 0 );
             }
             else
             {
-                x264_cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 16+i8, h->dct.luma4x4[16+i8]+1, 0 );
-                x264_cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 32+i8, h->dct.luma4x4[32+i8]+1, 0 );
+                cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 16+i8, h->dct.luma4x4[16+i8]+1, 0 );
+                cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, 32+i8, h->dct.luma4x4[32+i8]+1, 0 );
             }
         }
 
@@ -1213,63 +1213,63 @@ static void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int
     }
 }
 
-static void x264_subpartition_size_cabac( x264_t *h, x264_cabac_t *cb, int i4, int i_pixel )
+static void subpartition_size_cabac( x264_t *h, x264_cabac_t *cb, int i4, int i_pixel )
 {
     int b_8x4 = i_pixel == PIXEL_8x4;
     int plane_count = CHROMA444 ? 3 : 1;
     if( i_pixel == PIXEL_4x4 )
-        x264_cabac_mvd( h, cb, 0, i4, 1, 1 );
+        cabac_mvd( h, cb, 0, i4, 1, 1 );
     else
-        x264_cabac_mvd( h, cb, 0, i4, 1+b_8x4, 2-b_8x4 );
+        cabac_mvd( h, cb, 0, i4, 1+b_8x4, 2-b_8x4 );
     for( int p = 0; p < plane_count; p++ )
     {
-        x264_cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_4x4][p], p*16+i4, h->dct.luma4x4[p*16+i4], 0 );
+        cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_4x4][p], p*16+i4, h->dct.luma4x4[p*16+i4], 0 );
         if( i_pixel != PIXEL_4x4 )
-            x264_cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_4x4][p], p*16+i4+2-b_8x4, h->dct.luma4x4[p*16+i4+2-b_8x4], 0 );
+            cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_4x4][p], p*16+i4+2-b_8x4, h->dct.luma4x4[p*16+i4+2-b_8x4], 0 );
     }
 }
 
-static void x264_partition_i8x8_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int i_mode )
+static void partition_i8x8_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int i_mode )
 {
     const int i_pred = x264_mb_predict_intra4x4_mode( h, 4*i8 );
     i_mode = x264_mb_pred_mode4x4_fix( i_mode );
-    x264_cabac_intra4x4_pred_mode( cb, i_pred, i_mode );
-    x264_cabac_cbp_luma( h, cb );
+    cabac_intra4x4_pred_mode( cb, i_pred, i_mode );
+    cabac_cbp_luma( h, cb );
     if( h->mb.i_cbp_luma & (1 << i8) )
     {
         if( CHROMA444 )
             for( int p = 0; p < 3; p++ )
-                x264_cabac_block_residual_8x8_cbf( h, cb, ctx_cat_plane[DCT_LUMA_8x8][p], i8*4+p*16, h->dct.luma8x8[i8+p*4], 1 );
+                cabac_block_residual_8x8_cbf( h, cb, ctx_cat_plane[DCT_LUMA_8x8][p], i8*4+p*16, h->dct.luma8x8[i8+p*4], 1 );
         else
-            x264_cabac_block_residual_8x8( h, cb, DCT_LUMA_8x8, h->dct.luma8x8[i8] );
+            cabac_block_residual_8x8( h, cb, DCT_LUMA_8x8, h->dct.luma8x8[i8] );
     }
 }
 
-static void x264_partition_i4x4_size_cabac( x264_t *h, x264_cabac_t *cb, int i4, int i_mode )
+static void partition_i4x4_size_cabac( x264_t *h, x264_cabac_t *cb, int i4, int i_mode )
 {
     const int i_pred = x264_mb_predict_intra4x4_mode( h, i4 );
     int plane_count = CHROMA444 ? 3 : 1;
     i_mode = x264_mb_pred_mode4x4_fix( i_mode );
-    x264_cabac_intra4x4_pred_mode( cb, i_pred, i_mode );
+    cabac_intra4x4_pred_mode( cb, i_pred, i_mode );
     for( int p = 0; p < plane_count; p++ )
-        x264_cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_4x4][p], i4+p*16, h->dct.luma4x4[i4+p*16], 1 );
+        cabac_block_residual_cbf( h, cb, ctx_cat_plane[DCT_LUMA_4x4][p], i4+p*16, h->dct.luma4x4[i4+p*16], 1 );
 }
 
-static void x264_chroma_size_cabac( x264_t *h, x264_cabac_t *cb )
+static void chroma_size_cabac( x264_t *h, x264_cabac_t *cb )
 {
-    x264_cabac_intra_chroma_pred_mode( h, cb );
-    x264_cabac_cbp_chroma( h, cb );
+    cabac_intra_chroma_pred_mode( h, cb );
+    cabac_cbp_chroma( h, cb );
     if( h->mb.i_cbp_chroma )
     {
         if( CHROMA_FORMAT == CHROMA_422 )
         {
-            x264_cabac_block_residual_422_dc_cbf( h, cb, 0, 1 );
-            x264_cabac_block_residual_422_dc_cbf( h, cb, 1, 1 );
+            cabac_block_residual_422_dc_cbf( h, cb, 0, 1 );
+            cabac_block_residual_422_dc_cbf( h, cb, 1, 1 );
         }
         else
         {
-            x264_cabac_block_residual_dc_cbf( h, cb, DCT_CHROMA_DC, CHROMA_DC+0, h->dct.chroma_dc[0], 1 );
-            x264_cabac_block_residual_dc_cbf( h, cb, DCT_CHROMA_DC, CHROMA_DC+1, h->dct.chroma_dc[1], 1 );
+            cabac_block_residual_dc_cbf( h, cb, DCT_CHROMA_DC, CHROMA_DC+0, h->dct.chroma_dc[0], 1 );
+            cabac_block_residual_dc_cbf( h, cb, DCT_CHROMA_DC, CHROMA_DC+1, h->dct.chroma_dc[1], 1 );
         }
 
         if( h->mb.i_cbp_chroma == 2 )
@@ -1277,7 +1277,7 @@ static void x264_chroma_size_cabac( x264_t *h, x264_cabac_t *cb )
             int step = 8 << CHROMA_V_SHIFT;
             for( int i = 16; i < 3*16; i += step )
                 for( int j = i; j < i+4; j++ )
-                    x264_cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, j, h->dct.luma4x4[j]+1, 1 );
+                    cabac_block_residual_cbf( h, cb, DCT_CHROMA_AC, j, h->dct.luma4x4[j]+1, 1 );
         }
     }
 }
index 0150b2464864720b622a0ee06f3fb6e8e7194fe9..6d04f6076c516e1bae0656f170c20c6b5a3d4332 100644 (file)
@@ -67,7 +67,7 @@ static const uint8_t subpartition_b_to_golomb[13]=
 /****************************************************************************
  * x264_cavlc_block_residual:
  ****************************************************************************/
-static inline int x264_cavlc_block_residual_escape( x264_t *h, int i_suffix_length, int level )
+static inline int cavlc_block_residual_escape( x264_t *h, int i_suffix_length, int level )
 {
     bs_t *s = &h->out.bs;
     static const uint16_t next_suffix[7] = { 0, 3, 6, 12, 24, 48, 0xffff };
@@ -118,7 +118,7 @@ static inline int x264_cavlc_block_residual_escape( x264_t *h, int i_suffix_leng
     return i_suffix_length;
 }
 
-static int x264_cavlc_block_residual_internal( x264_t *h, int ctx_block_cat, dctcoef *l, int nC )
+static int cavlc_block_residual_internal( x264_t *h, int ctx_block_cat, dctcoef *l, int nC )
 {
     bs_t *s = &h->out.bs;
     static const uint8_t ctz_index[8] = {3,0,1,0,2,0,1,0};
@@ -163,7 +163,7 @@ static int x264_cavlc_block_residual_internal( x264_t *h, int ctx_block_cat, dct
             i_suffix_length = x264_level_token[i_suffix_length][val_original].i_next;
         }
         else
-            i_suffix_length = x264_cavlc_block_residual_escape( h, i_suffix_length, val-LEVEL_TABLE_SIZE/2 );
+            i_suffix_length = cavlc_block_residual_escape( h, i_suffix_length, val-LEVEL_TABLE_SIZE/2 );
         for( int i = i_trailing+1; i < i_total; i++ )
         {
             val = runlevel.level[i] + LEVEL_TABLE_SIZE/2;
@@ -173,7 +173,7 @@ static int x264_cavlc_block_residual_internal( x264_t *h, int ctx_block_cat, dct
                 i_suffix_length = x264_level_token[i_suffix_length][val].i_next;
             }
             else
-                i_suffix_length = x264_cavlc_block_residual_escape( h, i_suffix_length, val-LEVEL_TABLE_SIZE/2 );
+                i_suffix_length = cavlc_block_residual_escape( h, i_suffix_length, val-LEVEL_TABLE_SIZE/2 );
         }
     }
 
@@ -205,10 +205,10 @@ static const uint8_t ct_index[17] = {0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,3};
     if( !*nnz )\
         bs_write_vlc( &h->out.bs, x264_coeff0_token[nC] );\
     else\
-        *nnz = x264_cavlc_block_residual_internal(h,cat,l,nC);\
+        *nnz = cavlc_block_residual_internal(h,cat,l,nC);\
 }
 
-static void x264_cavlc_qp_delta( x264_t *h )
+static void cavlc_qp_delta( x264_t *h )
 {
     bs_t *s = &h->out.bs;
     int i_dqp = h->mb.i_qp - h->mb.i_last_qp;
@@ -238,7 +238,7 @@ static void x264_cavlc_qp_delta( x264_t *h )
     bs_write_se( s, i_dqp );
 }
 
-static void x264_cavlc_mvd( x264_t *h, int i_list, int idx, int width )
+static void cavlc_mvd( x264_t *h, int i_list, int idx, int width )
 {
     bs_t *s = &h->out.bs;
     ALIGNED_4( int16_t mvp[2] );
@@ -247,31 +247,31 @@ static void x264_cavlc_mvd( x264_t *h, int i_list, int idx, int width )
     bs_write_se( s, h->mb.cache.mv[i_list][x264_scan8[idx]][1] - mvp[1] );
 }
 
-static inline void x264_cavlc_8x8_mvd( x264_t *h, int i )
+static inline void cavlc_8x8_mvd( x264_t *h, int i )
 {
     switch( h->mb.i_sub_partition[i] )
     {
         case D_L0_8x8:
-            x264_cavlc_mvd( h, 0, 4*i, 2 );
+            cavlc_mvd( h, 0, 4*i, 2 );
             break;
         case D_L0_8x4:
-            x264_cavlc_mvd( h, 0, 4*i+0, 2 );
-            x264_cavlc_mvd( h, 0, 4*i+2, 2 );
+            cavlc_mvd( h, 0, 4*i+0, 2 );
+            cavlc_mvd( h, 0, 4*i+2, 2 );
             break;
         case D_L0_4x8:
-            x264_cavlc_mvd( h, 0, 4*i+0, 1 );
-            x264_cavlc_mvd( h, 0, 4*i+1, 1 );
+            cavlc_mvd( h, 0, 4*i+0, 1 );
+            cavlc_mvd( h, 0, 4*i+1, 1 );
             break;
         case D_L0_4x4:
-            x264_cavlc_mvd( h, 0, 4*i+0, 1 );
-            x264_cavlc_mvd( h, 0, 4*i+1, 1 );
-            x264_cavlc_mvd( h, 0, 4*i+2, 1 );
-            x264_cavlc_mvd( h, 0, 4*i+3, 1 );
+            cavlc_mvd( h, 0, 4*i+0, 1 );
+            cavlc_mvd( h, 0, 4*i+1, 1 );
+            cavlc_mvd( h, 0, 4*i+2, 1 );
+            cavlc_mvd( h, 0, 4*i+3, 1 );
             break;
     }
 }
 
-static ALWAYS_INLINE void x264_cavlc_macroblock_luma_residual( x264_t *h, int plane_count )
+static ALWAYS_INLINE void cavlc_macroblock_luma_residual( x264_t *h, int plane_count )
 {
     if( h->mb.b_transform_8x8 )
     {
@@ -290,7 +290,7 @@ static ALWAYS_INLINE void x264_cavlc_macroblock_luma_residual( x264_t *h, int pl
 }
 
 #if RDO_SKIP_BS
-static ALWAYS_INLINE void x264_cavlc_partition_luma_residual( x264_t *h, int i8, int p )
+static ALWAYS_INLINE void cavlc_partition_luma_residual( x264_t *h, int i8, int p )
 {
     if( h->mb.b_transform_8x8 && h->mb.cache.non_zero_count[x264_scan8[i8*4]] )
         h->zigzagf.interleave_8x8_cavlc( h->dct.luma4x4[i8*4+p*16], h->dct.luma8x8[i8+p*4],
@@ -302,7 +302,7 @@ static ALWAYS_INLINE void x264_cavlc_partition_luma_residual( x264_t *h, int i8,
 }
 #endif
 
-static void x264_cavlc_mb_header_i( x264_t *h, int i_mb_type, int i_mb_i_offset, int chroma )
+static void cavlc_mb_header_i( x264_t *h, int i_mb_type, int i_mb_i_offset, int chroma )
 {
     bs_t *s = &h->out.bs;
     if( i_mb_type == I_16x16 )
@@ -334,7 +334,7 @@ static void x264_cavlc_mb_header_i( x264_t *h, int i_mb_type, int i_mb_i_offset,
         bs_write_ue( s, x264_mb_chroma_pred_mode_fix[h->mb.i_chroma_pred_mode] );
 }
 
-static ALWAYS_INLINE void x264_cavlc_mb_header_p( x264_t *h, int i_mb_type, int chroma )
+static ALWAYS_INLINE void cavlc_mb_header_p( x264_t *h, int i_mb_type, int chroma )
 {
     bs_t *s = &h->out.bs;
     if( i_mb_type == P_L0 )
@@ -345,7 +345,7 @@ static ALWAYS_INLINE void x264_cavlc_mb_header_p( x264_t *h, int i_mb_type, int
 
             if( h->mb.pic.i_fref[0] > 1 )
                 bs_write_te( s, h->mb.pic.i_fref[0] - 1, h->mb.cache.ref[0][x264_scan8[0]] );
-            x264_cavlc_mvd( h, 0, 0, 4 );
+            cavlc_mvd( h, 0, 0, 4 );
         }
         else if( h->mb.i_partition == D_16x8 )
         {
@@ -355,8 +355,8 @@ static ALWAYS_INLINE void x264_cavlc_mb_header_p( x264_t *h, int i_mb_type, int
                 bs_write_te( s, h->mb.pic.i_fref[0] - 1, h->mb.cache.ref[0][x264_scan8[0]] );
                 bs_write_te( s, h->mb.pic.i_fref[0] - 1, h->mb.cache.ref[0][x264_scan8[8]] );
             }
-            x264_cavlc_mvd( h, 0, 0, 4 );
-            x264_cavlc_mvd( h, 0, 8, 4 );
+            cavlc_mvd( h, 0, 0, 4 );
+            cavlc_mvd( h, 0, 8, 4 );
         }
         else if( h->mb.i_partition == D_8x16 )
         {
@@ -366,8 +366,8 @@ static ALWAYS_INLINE void x264_cavlc_mb_header_p( x264_t *h, int i_mb_type, int
                 bs_write_te( s, h->mb.pic.i_fref[0] - 1, h->mb.cache.ref[0][x264_scan8[0]] );
                 bs_write_te( s, h->mb.pic.i_fref[0] - 1, h->mb.cache.ref[0][x264_scan8[4]] );
             }
-            x264_cavlc_mvd( h, 0, 0, 2 );
-            x264_cavlc_mvd( h, 0, 4, 2 );
+            cavlc_mvd( h, 0, 0, 2 );
+            cavlc_mvd( h, 0, 4, 2 );
         }
     }
     else if( i_mb_type == P_8x8 )
@@ -402,13 +402,13 @@ static ALWAYS_INLINE void x264_cavlc_mb_header_p( x264_t *h, int i_mb_type, int
         }
 
         for( int i = 0; i < 4; i++ )
-            x264_cavlc_8x8_mvd( h, i );
+            cavlc_8x8_mvd( h, i );
     }
     else //if( IS_INTRA( i_mb_type ) )
-        x264_cavlc_mb_header_i( h, i_mb_type, 5, chroma );
+        cavlc_mb_header_i( h, i_mb_type, 5, chroma );
 }
 
-static ALWAYS_INLINE void x264_cavlc_mb_header_b( x264_t *h, int i_mb_type, int chroma )
+static ALWAYS_INLINE void cavlc_mb_header_b( x264_t *h, int i_mb_type, int chroma )
 {
     bs_t *s = &h->out.bs;
     if( i_mb_type == B_8x8 )
@@ -432,10 +432,10 @@ static ALWAYS_INLINE void x264_cavlc_mb_header_b( x264_t *h, int i_mb_type, int
         /* mvd */
         for( int i = 0; i < 4; i++ )
             if( x264_mb_partition_listX_table[0][ h->mb.i_sub_partition[i] ] )
-                x264_cavlc_mvd( h, 0, 4*i, 2 );
+                cavlc_mvd( h, 0, 4*i, 2 );
         for( int i = 0; i < 4; i++ )
             if( x264_mb_partition_listX_table[1][ h->mb.i_sub_partition[i] ] )
-                x264_cavlc_mvd( h, 1, 4*i, 2 );
+                cavlc_mvd( h, 1, 4*i, 2 );
     }
     else if( i_mb_type >= B_L0_L0 && i_mb_type <= B_BI_BI )
     {
@@ -450,8 +450,8 @@ static ALWAYS_INLINE void x264_cavlc_mb_header_b( x264_t *h, int i_mb_type, int
         {
             if( i_ref0_max && b_list[0][0] ) bs_write_te( s, i_ref0_max, h->mb.cache.ref[0][x264_scan8[0]] );
             if( i_ref1_max && b_list[1][0] ) bs_write_te( s, i_ref1_max, h->mb.cache.ref[1][x264_scan8[0]] );
-            if( b_list[0][0] ) x264_cavlc_mvd( h, 0, 0, 4 );
-            if( b_list[1][0] ) x264_cavlc_mvd( h, 1, 0, 4 );
+            if( b_list[0][0] ) cavlc_mvd( h, 0, 0, 4 );
+            if( b_list[1][0] ) cavlc_mvd( h, 1, 0, 4 );
         }
         else
         {
@@ -461,24 +461,24 @@ static ALWAYS_INLINE void x264_cavlc_mb_header_b( x264_t *h, int i_mb_type, int
             if( i_ref1_max && b_list[1][1] ) bs_write_te( s, i_ref1_max, h->mb.cache.ref[1][x264_scan8[12]] );
             if( h->mb.i_partition == D_16x8 )
             {
-                if( b_list[0][0] ) x264_cavlc_mvd( h, 0, 0, 4 );
-                if( b_list[0][1] ) x264_cavlc_mvd( h, 0, 8, 4 );
-                if( b_list[1][0] ) x264_cavlc_mvd( h, 1, 0, 4 );
-                if( b_list[1][1] ) x264_cavlc_mvd( h, 1, 8, 4 );
+                if( b_list[0][0] ) cavlc_mvd( h, 0, 0, 4 );
+                if( b_list[0][1] ) cavlc_mvd( h, 0, 8, 4 );
+                if( b_list[1][0] ) cavlc_mvd( h, 1, 0, 4 );
+                if( b_list[1][1] ) cavlc_mvd( h, 1, 8, 4 );
             }
             else //if( h->mb.i_partition == D_8x16 )
             {
-                if( b_list[0][0] ) x264_cavlc_mvd( h, 0, 0, 2 );
-                if( b_list[0][1] ) x264_cavlc_mvd( h, 0, 4, 2 );
-                if( b_list[1][0] ) x264_cavlc_mvd( h, 1, 0, 2 );
-                if( b_list[1][1] ) x264_cavlc_mvd( h, 1, 4, 2 );
+                if( b_list[0][0] ) cavlc_mvd( h, 0, 0, 2 );
+                if( b_list[0][1] ) cavlc_mvd( h, 0, 4, 2 );
+                if( b_list[1][0] ) cavlc_mvd( h, 1, 0, 2 );
+                if( b_list[1][1] ) cavlc_mvd( h, 1, 4, 2 );
             }
         }
     }
     else if( i_mb_type == B_DIRECT )
         bs_write1( s, 1 );
     else //if( IS_INTRA( i_mb_type ) )
-        x264_cavlc_mb_header_i( h, i_mb_type, 23, chroma );
+        cavlc_mb_header_i( h, i_mb_type, 23, chroma );
 }
 
 /*****************************************************************************
@@ -536,11 +536,11 @@ void x264_macroblock_write_cavlc( x264_t *h )
 #endif
 
     if( h->sh.i_type == SLICE_TYPE_P )
-        x264_cavlc_mb_header_p( h, i_mb_type, chroma );
+        cavlc_mb_header_p( h, i_mb_type, chroma );
     else if( h->sh.i_type == SLICE_TYPE_B )
-        x264_cavlc_mb_header_b( h, i_mb_type, chroma );
+        cavlc_mb_header_b( h, i_mb_type, chroma );
     else //if( h->sh.i_type == SLICE_TYPE_I )
-        x264_cavlc_mb_header_i( h, i_mb_type, 0, chroma );
+        cavlc_mb_header_i( h, i_mb_type, 0, chroma );
 
 #if !RDO_SKIP_BS
     i_mb_pos_tex = bs_pos( s );
@@ -557,7 +557,7 @@ void x264_macroblock_write_cavlc( x264_t *h )
 
     if( i_mb_type == I_16x16 )
     {
-        x264_cavlc_qp_delta( h );
+        cavlc_qp_delta( h );
 
         /* DC Luma */
         for( int p = 0; p < plane_count; p++ )
@@ -572,8 +572,8 @@ void x264_macroblock_write_cavlc( x264_t *h )
     }
     else if( h->mb.i_cbp_luma | h->mb.i_cbp_chroma )
     {
-        x264_cavlc_qp_delta( h );
-        x264_cavlc_macroblock_luma_residual( h, plane_count );
+        cavlc_qp_delta( h );
+        cavlc_macroblock_luma_residual( h, plane_count );
     }
     if( h->mb.i_cbp_chroma )
     {
@@ -602,7 +602,7 @@ void x264_macroblock_write_cavlc( x264_t *h )
  * only writes subpartition for p8x8, needed for sub-8x8 mode decision RDO
  * works on all partition sizes except 16x16
  *****************************************************************************/
-static int x264_partition_size_cavlc( x264_t *h, int i8, int i_pixel )
+static int partition_size_cavlc( x264_t *h, int i8, int i_pixel )
 {
     bs_t *s = &h->out.bs;
     const int i_mb_type = h->mb.i_type;
@@ -614,28 +614,28 @@ static int x264_partition_size_cavlc( x264_t *h, int i8, int i_pixel )
 
     if( i_mb_type == P_8x8 )
     {
-        x264_cavlc_8x8_mvd( h, i8 );
+        cavlc_8x8_mvd( h, i8 );
         bs_write_ue( s, subpartition_p_to_golomb[ h->mb.i_sub_partition[i8] ] );
     }
     else if( i_mb_type == P_L0 )
-        x264_cavlc_mvd( h, 0, 4*i8, 4>>b_8x16 );
+        cavlc_mvd( h, 0, 4*i8, 4>>b_8x16 );
     else if( i_mb_type > B_DIRECT && i_mb_type < B_8x8 )
     {
-        if( x264_mb_type_list_table[ i_mb_type ][0][!!i8] ) x264_cavlc_mvd( h, 0, 4*i8, 4>>b_8x16 );
-        if( x264_mb_type_list_table[ i_mb_type ][1][!!i8] ) x264_cavlc_mvd( h, 1, 4*i8, 4>>b_8x16 );
+        if( x264_mb_type_list_table[ i_mb_type ][0][!!i8] ) cavlc_mvd( h, 0, 4*i8, 4>>b_8x16 );
+        if( x264_mb_type_list_table[ i_mb_type ][1][!!i8] ) cavlc_mvd( h, 1, 4*i8, 4>>b_8x16 );
     }
     else //if( i_mb_type == B_8x8 )
     {
         if( x264_mb_partition_listX_table[0][ h->mb.i_sub_partition[i8] ] )
-            x264_cavlc_mvd( h, 0, 4*i8, 2 );
+            cavlc_mvd( h, 0, 4*i8, 2 );
         if( x264_mb_partition_listX_table[1][ h->mb.i_sub_partition[i8] ] )
-            x264_cavlc_mvd( h, 1, 4*i8, 2 );
+            cavlc_mvd( h, 1, 4*i8, 2 );
     }
 
     for( j = (i_pixel < PIXEL_8x8); j >= 0; j-- )
     {
         for( int p = 0; p < plane_count; p++ )
-            x264_cavlc_partition_luma_residual( h, i8, p );
+            cavlc_partition_luma_residual( h, i8, p );
         if( h->mb.i_cbp_chroma )
         {
             if( CHROMA_FORMAT == CHROMA_422 )
@@ -658,12 +658,12 @@ static int x264_partition_size_cavlc( x264_t *h, int i8, int i_pixel )
     return h->out.bs.i_bits_encoded;
 }
 
-static int x264_subpartition_size_cavlc( x264_t *h, int i4, int i_pixel )
+static int subpartition_size_cavlc( x264_t *h, int i4, int i_pixel )
 {
     int plane_count = CHROMA444 ? 3 : 1;
     int b_8x4 = i_pixel == PIXEL_8x4;
     h->out.bs.i_bits_encoded = 0;
-    x264_cavlc_mvd( h, 0, i4, 1+b_8x4 );
+    cavlc_mvd( h, 0, i4, 1+b_8x4 );
     for( int p = 0; p < plane_count; p++ )
     {
         x264_cavlc_block_residual( h, DCT_LUMA_4x4, p*16+i4, h->dct.luma4x4[p*16+i4] );
@@ -674,7 +674,7 @@ static int x264_subpartition_size_cavlc( x264_t *h, int i4, int i_pixel )
     return h->out.bs.i_bits_encoded;
 }
 
-static int x264_cavlc_intra4x4_pred_size( x264_t *h, int i4, int i_mode )
+static int cavlc_intra4x4_pred_size( x264_t *h, int i4, int i_mode )
 {
     if( x264_mb_predict_intra4x4_mode( h, i4 ) == x264_mb_pred_mode4x4_fix( i_mode ) )
         return 1;
@@ -682,26 +682,26 @@ static int x264_cavlc_intra4x4_pred_size( x264_t *h, int i4, int i_mode )
         return 4;
 }
 
-static int x264_partition_i8x8_size_cavlc( x264_t *h, int i8, int i_mode )
+static int partition_i8x8_size_cavlc( x264_t *h, int i8, int i_mode )
 {
     int plane_count = CHROMA444 ? 3 : 1;
-    h->out.bs.i_bits_encoded = x264_cavlc_intra4x4_pred_size( h, 4*i8, i_mode );
+    h->out.bs.i_bits_encoded = cavlc_intra4x4_pred_size( h, 4*i8, i_mode );
     bs_write_ue( &h->out.bs, cbp_to_golomb[!CHROMA444][1][(h->mb.i_cbp_chroma << 4)|h->mb.i_cbp_luma] );
     for( int p = 0; p < plane_count; p++ )
-        x264_cavlc_partition_luma_residual( h, i8, p );
+        cavlc_partition_luma_residual( h, i8, p );
     return h->out.bs.i_bits_encoded;
 }
 
-static int x264_partition_i4x4_size_cavlc( x264_t *h, int i4, int i_mode )
+static int partition_i4x4_size_cavlc( x264_t *h, int i4, int i_mode )
 {
     int plane_count = CHROMA444 ? 3 : 1;
-    h->out.bs.i_bits_encoded = x264_cavlc_intra4x4_pred_size( h, i4, i_mode );
+    h->out.bs.i_bits_encoded = cavlc_intra4x4_pred_size( h, i4, i_mode );
     for( int p = 0; p < plane_count; p++ )
         x264_cavlc_block_residual( h, DCT_LUMA_4x4, p*16+i4, h->dct.luma4x4[p*16+i4] );
     return h->out.bs.i_bits_encoded;
 }
 
-static int x264_chroma_size_cavlc( x264_t *h )
+static int chroma_size_cavlc( x264_t *h )
 {
     h->out.bs.i_bits_encoded = bs_size_ue( x264_mb_chroma_pred_mode_fix[h->mb.i_chroma_pred_mode] );
     if( h->mb.i_cbp_chroma )
index d183460c00da8330f22318f28bbd3df0cdbe53fd..fef3436eaf0c4e36005bae5cdae29a0f5dd29f2a 100644 (file)
 
 #define bs_write_ue bs_write_ue_big
 
-static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
-                                   x264_nal_t **pp_nal, int *pi_nal,
-                                   x264_picture_t *pic_out );
+static int encoder_frame_end( x264_t *h, x264_t *thread_current,
+                              x264_nal_t **pp_nal, int *pi_nal,
+                              x264_picture_t *pic_out );
 
 /****************************************************************************
  *
  ******************************* x264 libs **********************************
  *
  ****************************************************************************/
-static double x264_psnr( double sqe, double size )
+static double calc_psnr( double sqe, double size )
 {
     double mse = sqe / (PIXEL_MAX*PIXEL_MAX * size);
     if( mse <= 0.0000000001 ) /* Max 100dB */
@@ -58,7 +58,7 @@ static double x264_psnr( double sqe, double size )
     return -10.0 * log10( mse );
 }
 
-static double x264_ssim( double ssim )
+static double calc_ssim_db( double ssim )
 {
     double inv_ssim = 1 - ssim;
     if( inv_ssim <= 0.0000000001 ) /* Max 100dB */
@@ -67,7 +67,7 @@ static double x264_ssim( double ssim )
     return -10.0 * log10( inv_ssim );
 }
 
-static int x264_threadpool_wait_all( x264_t *h )
+static int threadpool_wait_all( x264_t *h )
 {
     for( int i = 0; i < h->param.i_threads; i++ )
         if( h->thread[i]->b_thread_active )
@@ -79,7 +79,7 @@ static int x264_threadpool_wait_all( x264_t *h )
     return 0;
 }
 
-static void x264_frame_dump( x264_t *h )
+static void frame_dump( x264_t *h )
 {
     FILE *f = x264_fopen( h->param.psz_dump_yuv, "r+b" );
     if( !f )
@@ -87,7 +87,7 @@ static void x264_frame_dump( x264_t *h )
 
     /* Wait for the threads to finish deblocking */
     if( h->param.b_sliced_threads )
-        x264_threadpool_wait_all( h );
+        threadpool_wait_all( h );
 
     /* Write the frame in display order */
     int frame_size = FRAME_SIZE( h->param.i_height * h->param.i_width * sizeof(pixel) );
@@ -115,9 +115,9 @@ static void x264_frame_dump( x264_t *h )
 }
 
 /* Fill "default" values */
-static void x264_slice_header_init( x264_t *h, x264_slice_header_t *sh,
-                                    x264_sps_t *sps, x264_pps_t *pps,
-                                    int i_idr_pic_id, int i_frame, int i_qp )
+static void slice_header_init( x264_t *h, x264_slice_header_t *sh,
+                               x264_sps_t *sps, x264_pps_t *pps,
+                               int i_idr_pic_id, int i_frame, int i_qp )
 {
     x264_param_t *param = &h->param;
 
@@ -206,7 +206,7 @@ static void x264_slice_header_init( x264_t *h, x264_slice_header_t *sh,
     sh->i_beta_offset = param->i_deblocking_filter_beta << 1;
 }
 
-static void x264_slice_header_write( bs_t *s, x264_slice_header_t *sh, int i_nal_ref_idc )
+static void slice_header_write( bs_t *s, x264_slice_header_t *sh, int i_nal_ref_idc )
 {
     if( sh->b_mbaff )
     {
@@ -357,7 +357,7 @@ static void x264_slice_header_write( bs_t *s, x264_slice_header_t *sh, int i_nal
 
 /* If we are within a reasonable distance of the end of the memory allocated for the bitstream, */
 /* reallocate, adding an arbitrary amount of space. */
-static int x264_bitstream_check_buffer_internal( x264_t *h, int size, int b_cabac, int i_nal )
+static int bitstream_check_buffer_internal( x264_t *h, int size, int b_cabac, int i_nal )
 {
     if( (b_cabac && (h->cabac.p_end - h->cabac.p < size)) ||
         (h->out.bs.p_end - h->out.bs.p < size) )
@@ -390,20 +390,20 @@ static int x264_bitstream_check_buffer_internal( x264_t *h, int size, int b_caba
     return 0;
 }
 
-static int x264_bitstream_check_buffer( x264_t *h )
+static int bitstream_check_buffer( x264_t *h )
 {
     int max_row_size = (2500 << SLICE_MBAFF) * h->mb.i_mb_width;
-    return x264_bitstream_check_buffer_internal( h, max_row_size, h->param.b_cabac, h->out.i_nal );
+    return bitstream_check_buffer_internal( h, max_row_size, h->param.b_cabac, h->out.i_nal );
 }
 
-static int x264_bitstream_check_buffer_filler( x264_t *h, int filler )
+static int bitstream_check_buffer_filler( x264_t *h, int filler )
 {
     filler += 32; // add padding for safety
-    return x264_bitstream_check_buffer_internal( h, filler, 0, -1 );
+    return bitstream_check_buffer_internal( h, filler, 0, -1 );
 }
 
 #if HAVE_THREAD
-static void x264_encoder_thread_init( x264_t *h )
+static void encoder_thread_init( x264_t *h )
 {
     if( h->param.i_sync_lookahead )
         x264_lower_thread_priority( 10 );
@@ -418,7 +418,7 @@ static void x264_encoder_thread_init( x264_t *h )
  *
  ****************************************************************************/
 
-static int x264_validate_parameters( x264_t *h, int b_open )
+static int validate_parameters( x264_t *h, int b_open )
 {
     if( !h->param.pf_log )
     {
@@ -1368,7 +1368,7 @@ static void chroma_dsp_init( x264_t *h )
     }
 }
 
-static void x264_set_aspect_ratio( x264_t *h, x264_param_t *param, int initial )
+static void set_aspect_ratio( x264_t *h, x264_param_t *param, int initial )
 {
     /* VUI */
     if( param->vui.i_sar_width > 0 && param->vui.i_sar_height > 0 )
@@ -1431,7 +1431,7 @@ x264_t *x264_encoder_open( x264_param_t *param )
         goto fail;
     }
 
-    if( x264_validate_parameters( h, 1 ) < 0 )
+    if( validate_parameters( h, 1 ) < 0 )
         goto fail;
 
     if( h->param.psz_cqm_file )
@@ -1461,7 +1461,7 @@ x264_t *x264_encoder_open( x264_param_t *param )
         goto fail;
     }
 
-    x264_set_aspect_ratio( h, &h->param, 1 );
+    set_aspect_ratio( h, &h->param, 1 );
 
     x264_sps_init( h->sps, h->param.i_sps_id, &h->param );
     x264_pps_init( h->pps, h->param.i_sps_id, &h->param, h->sps );
@@ -1616,7 +1616,7 @@ x264_t *x264_encoder_open( x264_param_t *param )
     CHECKED_MALLOC( h->reconfig_h, sizeof(x264_t) );
 
     if( h->param.i_threads > 1 &&
-        x264_threadpool_init( &h->threadpool, h->param.i_threads, (void*)x264_encoder_thread_init, h ) )
+        x264_threadpool_init( &h->threadpool, h->param.i_threads, (void*)encoder_thread_init, h ) )
         goto fail;
     if( h->param.i_lookahead_threads > 1 &&
         x264_threadpool_init( &h->lookaheadpool, h->param.i_lookahead_threads, NULL, NULL ) )
@@ -1745,10 +1745,10 @@ fail:
 }
 
 /****************************************************************************/
-static int x264_encoder_try_reconfig( x264_t *h, x264_param_t *param, int *rc_reconfig )
+static int encoder_try_reconfig( x264_t *h, x264_param_t *param, int *rc_reconfig )
 {
     *rc_reconfig = 0;
-    x264_set_aspect_ratio( h, param, 0 );
+    set_aspect_ratio( h, param, 0 );
 #define COPY(var) h->param.var = param->var
     COPY( i_frame_reference ); // but never uses more refs than initially specified
     COPY( i_bframe_bias );
@@ -1809,13 +1809,13 @@ static int x264_encoder_try_reconfig( x264_t *h, x264_param_t *param, int *rc_re
     COPY( rc.f_rf_constant_max );
 #undef COPY
 
-    return x264_validate_parameters( h, 0 );
+    return validate_parameters( h, 0 );
 }
 
 int x264_encoder_reconfig_apply( x264_t *h, x264_param_t *param )
 {
     int rc_reconfig;
-    int ret = x264_encoder_try_reconfig( h, param, &rc_reconfig );
+    int ret = encoder_try_reconfig( h, param, &rc_reconfig );
 
     mbcmp_init( h );
     if( !ret )
@@ -1842,7 +1842,7 @@ int x264_encoder_reconfig( x264_t *h, x264_param_t *param )
     h->reconfig_h->param = h->param;
 
     int rc_reconfig;
-    int ret = x264_encoder_try_reconfig( h->reconfig_h, param, &rc_reconfig );
+    int ret = encoder_try_reconfig( h->reconfig_h, param, &rc_reconfig );
     if( !ret )
         h->reconfig = 1;
     else
@@ -1860,7 +1860,7 @@ void x264_encoder_parameters( x264_t *h, x264_param_t *param )
 }
 
 /* internal usage */
-static void x264_nal_start( x264_t *h, int i_type, int i_ref_idc )
+static void nal_start( x264_t *h, int i_type, int i_ref_idc )
 {
     x264_nal_t *nal = &h->out.nal[h->out.i_nal];
 
@@ -1874,7 +1874,7 @@ static void x264_nal_start( x264_t *h, int i_type, int i_ref_idc )
 }
 
 /* if number of allocated nals is not enough, re-allocate a larger one. */
-static int x264_nal_check_buffer( x264_t *h )
+static int nal_check_buffer( x264_t *h )
 {
     if( h->out.i_nal >= h->out.i_nals_allocated )
     {
@@ -1889,7 +1889,7 @@ static int x264_nal_check_buffer( x264_t *h )
     return 0;
 }
 
-static int x264_nal_end( x264_t *h )
+static int nal_end( x264_t *h )
 {
     x264_nal_t *nal = &h->out.nal[h->out.i_nal];
     uint8_t *end = &h->out.p_bitstream[bs_pos( &h->out.bs ) / 8];
@@ -1901,11 +1901,11 @@ static int x264_nal_end( x264_t *h )
         h->param.nalu_process( h, nal, h->fenc->opaque );
     h->out.i_nal++;
 
-    return x264_nal_check_buffer( h );
+    return nal_check_buffer( h );
 }
 
-static int x264_check_encapsulated_buffer( x264_t *h, x264_t *h0, int start,
-                                           int previous_nal_size, int necessary_size )
+static int check_encapsulated_buffer( x264_t *h, x264_t *h0, int start,
+                                      int previous_nal_size, int necessary_size )
 {
     if( h0->nal_buffer_size < necessary_size )
     {
@@ -1928,7 +1928,7 @@ static int x264_check_encapsulated_buffer( x264_t *h, x264_t *h0, int start,
     return 0;
 }
 
-static int x264_encoder_encapsulate_nals( x264_t *h, int start )
+static int encoder_encapsulate_nals( x264_t *h, int start )
 {
     x264_t *h0 = h->thread[0];
     int nal_size = 0, previous_nal_size = 0;
@@ -1950,7 +1950,7 @@ static int x264_encoder_encapsulate_nals( x264_t *h, int start )
     int necessary_size = previous_nal_size + nal_size * 3/2 + h->out.i_nal * 4 + 4 + 64;
     for( int i = start; i < h->out.i_nal; i++ )
         necessary_size += h->out.nal[i].i_padding;
-    if( x264_check_encapsulated_buffer( h, h0, start, previous_nal_size, necessary_size ) )
+    if( check_encapsulated_buffer( h, h0, start, previous_nal_size, necessary_size ) )
         return -1;
 
     uint8_t *nal_buffer = h0->nal_buffer + previous_nal_size;
@@ -1981,25 +1981,25 @@ int x264_encoder_headers( x264_t *h, x264_nal_t **pp_nal, int *pi_nal )
     /* Write SEI, SPS and PPS. */
 
     /* generate sequence parameters */
-    x264_nal_start( h, NAL_SPS, NAL_PRIORITY_HIGHEST );
+    nal_start( h, NAL_SPS, NAL_PRIORITY_HIGHEST );
     x264_sps_write( &h->out.bs, h->sps );
-    if( x264_nal_end( h ) )
+    if( nal_end( h ) )
         return -1;
 
     /* generate picture parameters */
-    x264_nal_start( h, NAL_PPS, NAL_PRIORITY_HIGHEST );
+    nal_start( h, NAL_PPS, NAL_PRIORITY_HIGHEST );
     x264_pps_write( &h->out.bs, h->sps, h->pps );
-    if( x264_nal_end( h ) )
+    if( nal_end( h ) )
         return -1;
 
     /* identify ourselves */
-    x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+    nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
     if( x264_sei_version_write( h, &h->out.bs ) )
         return -1;
-    if( x264_nal_end( h ) )
+    if( nal_end( h ) )
         return -1;
 
-    frame_size = x264_encoder_encapsulate_nals( h, 0 );
+    frame_size = encoder_encapsulate_nals( h, 0 );
     if( frame_size < 0 )
         return -1;
 
@@ -2013,7 +2013,7 @@ int x264_encoder_headers( x264_t *h, x264_nal_t **pp_nal, int *pi_nal )
 
 /* Check to see whether we have chosen a reference list ordering different
  * from the standard's default. */
-static inline void x264_reference_check_reorder( x264_t *h )
+static inline void reference_check_reorder( x264_t *h )
 {
     /* The reorder check doesn't check for missing frames, so just
      * force a reorder if one of the reference list is corrupt. */
@@ -2038,7 +2038,7 @@ static inline void x264_reference_check_reorder( x264_t *h )
 }
 
 /* return -1 on failure, else return the index of the new reference frame */
-static int x264_weighted_reference_duplicate( x264_t *h, int i_ref, const x264_weight_t *w )
+static int weighted_reference_duplicate( x264_t *h, int i_ref, const x264_weight_t *w )
 {
     int i = h->i_ref[0];
     int j = 1;
@@ -2077,7 +2077,7 @@ static int x264_weighted_reference_duplicate( x264_t *h, int i_ref, const x264_w
     return j;
 }
 
-static void x264_weighted_pred_init( x264_t *h )
+static void weighted_pred_init( x264_t *h )
 {
     /* for now no analysis and set all weights to nothing */
     for( int i_ref = 0; i_ref < h->i_ref[0]; i_ref++ )
@@ -2161,7 +2161,7 @@ static void x264_weighted_pred_init( x264_t *h )
     h->sh.weight[0][2].i_denom = h->sh.weight[0][1].i_denom;
 }
 
-static inline int x264_reference_distance( x264_t *h, x264_frame_t *frame )
+static inline int reference_distance( x264_t *h, x264_frame_t *frame )
 {
     if( h->param.i_frame_packing == 5 )
         return abs((h->fenc->i_frame&~1) - (frame->i_frame&~1)) +
@@ -2170,7 +2170,7 @@ static inline int x264_reference_distance( x264_t *h, x264_frame_t *frame )
         return abs(h->fenc->i_frame - frame->i_frame);
 }
 
-static inline void x264_reference_build_list( x264_t *h, int i_poc )
+static inline void reference_build_list( x264_t *h, int i_poc )
 {
     int b_ok;
 
@@ -2227,7 +2227,7 @@ static inline void x264_reference_build_list( x264_t *h, int i_poc )
                 if( list ? h->fref[list][i+1]->i_poc < h->fref_nearest[list]->i_poc
                          : h->fref[list][i+1]->i_poc > h->fref_nearest[list]->i_poc )
                     h->fref_nearest[list] = h->fref[list][i+1];
-                if( x264_reference_distance( h, h->fref[list][i] ) > x264_reference_distance( h, h->fref[list][i+1] ) )
+                if( reference_distance( h, h->fref[list][i] ) > reference_distance( h, h->fref[list][i+1] ) )
                 {
                     XCHG( x264_frame_t*, h->fref[list][i], h->fref[list][i+1] );
                     b_ok = 0;
@@ -2237,7 +2237,7 @@ static inline void x264_reference_build_list( x264_t *h, int i_poc )
         } while( !b_ok );
     }
 
-    x264_reference_check_reorder( h );
+    reference_check_reorder( h );
 
     h->i_ref[1] = X264_MIN( h->i_ref[1], h->frames.i_max_ref1 );
     h->i_ref[0] = X264_MIN( h->i_ref[0], h->frames.i_max_ref0 );
@@ -2262,7 +2262,7 @@ static inline void x264_reference_build_list( x264_t *h, int i_poc )
             {
                 h->fenc->weight[0][0].i_denom = 0;
                 SET_WEIGHT( w[0], 1, 1, 0, -1 );
-                idx = x264_weighted_reference_duplicate( h, 0, w );
+                idx = weighted_reference_duplicate( h, 0, w );
             }
             else
             {
@@ -2270,13 +2270,13 @@ static inline void x264_reference_build_list( x264_t *h, int i_poc )
                 {
                     SET_WEIGHT( h->fenc->weight[0][0], 1, 1, 0, h->fenc->weight[0][0].i_offset );
                 }
-                x264_weighted_reference_duplicate( h, 0, x264_weight_none );
+                weighted_reference_duplicate( h, 0, x264_weight_none );
                 if( h->fenc->weight[0][0].i_offset > -128 )
                 {
                     w[0] = h->fenc->weight[0][0];
                     w[0].i_offset--;
                     h->mc.weight_cache( h, &w[0] );
-                    idx = x264_weighted_reference_duplicate( h, 0, w );
+                    idx = weighted_reference_duplicate( h, 0, w );
                 }
             }
         }
@@ -2288,7 +2288,7 @@ static inline void x264_reference_build_list( x264_t *h, int i_poc )
     h->mb.pic.i_fref[1] = h->i_ref[1];
 }
 
-static void x264_fdec_filter_row( x264_t *h, int mb_y, int pass )
+static void fdec_filter_row( x264_t *h, int mb_y, int pass )
 {
     /* mb_y is the mb to be encoded next, not the mb to be filtered here */
     int b_hpel = h->fdec->b_kept_as_ref;
@@ -2408,7 +2408,7 @@ static void x264_fdec_filter_row( x264_t *h, int mb_y, int pass )
     }
 }
 
-static inline int x264_reference_update( x264_t *h )
+static inline int reference_update( x264_t *h )
 {
     if( !h->fdec->b_kept_as_ref )
     {
@@ -2438,7 +2438,7 @@ static inline int x264_reference_update( x264_t *h )
     return 0;
 }
 
-static inline void x264_reference_reset( x264_t *h )
+static inline void reference_reset( x264_t *h )
 {
     while( h->frames.reference[0] )
         x264_frame_push_unused( h, x264_frame_pop( h->frames.reference ) );
@@ -2446,7 +2446,7 @@ static inline void x264_reference_reset( x264_t *h )
     h->fenc->i_poc = 0;
 }
 
-static inline void x264_reference_hierarchy_reset( x264_t *h )
+static inline void reference_hierarchy_reset( x264_t *h )
 {
     int ref;
     int b_hasdelayframe = 0;
@@ -2483,12 +2483,12 @@ static inline void x264_reference_hierarchy_reset( x264_t *h )
         h->sh.i_mmco_remove_from_end = X264_MAX( ref + 2 - h->frames.i_max_dpb, 0 );
 }
 
-static inline void x264_slice_init( x264_t *h, int i_nal_type, int i_global_qp )
+static inline void slice_init( x264_t *h, int i_nal_type, int i_global_qp )
 {
     /* ------------------------ Create slice header  ----------------------- */
     if( i_nal_type == NAL_SLICE_IDR )
     {
-        x264_slice_header_init( h, &h->sh, h->sps, h->pps, h->i_idr_pic_id, h->i_frame_num, i_global_qp );
+        slice_header_init( h, &h->sh, h->sps, h->pps, h->i_idr_pic_id, h->i_frame_num, i_global_qp );
 
         /* alternate id */
         if( h->param.i_avcintra_class )
@@ -2512,7 +2512,7 @@ static inline void x264_slice_init( x264_t *h, int i_nal_type, int i_global_qp )
     }
     else
     {
-        x264_slice_header_init( h, &h->sh, h->sps, h->pps, -1, h->i_frame_num, i_global_qp );
+        slice_header_init( h, &h->sh, h->sps, h->pps, -1, h->i_frame_num, i_global_qp );
 
         h->sh.i_num_ref_idx_l0_active = h->i_ref[0] <= 0 ? 1 : h->i_ref[0];
         h->sh.i_num_ref_idx_l1_active = h->i_ref[1] <= 0 ? 1 : h->i_ref[1];
@@ -2564,7 +2564,7 @@ typedef struct
     int field_decoding_flag;
 } x264_bs_bak_t;
 
-static ALWAYS_INLINE void x264_bitstream_backup( x264_t *h, x264_bs_bak_t *bak, int i_skip, int full )
+static ALWAYS_INLINE void bitstream_backup( x264_t *h, x264_bs_bak_t *bak, int i_skip, int full )
 {
     if( full )
     {
@@ -2598,7 +2598,7 @@ static ALWAYS_INLINE void x264_bitstream_backup( x264_t *h, x264_bs_bak_t *bak,
     }
 }
 
-static ALWAYS_INLINE void x264_bitstream_restore( x264_t *h, x264_bs_bak_t *bak, int *skip, int full )
+static ALWAYS_INLINE void bitstream_restore( x264_t *h, x264_bs_bak_t *bak, int *skip, int full )
 {
     if( full )
     {
@@ -2627,7 +2627,7 @@ static ALWAYS_INLINE void x264_bitstream_restore( x264_t *h, x264_bs_bak_t *bak,
     }
 }
 
-static intptr_t x264_slice_write( x264_t *h )
+static intptr_t slice_write( x264_t *h )
 {
     int i_skip;
     int mb_xy, i_mb_x, i_mb_y;
@@ -2654,7 +2654,7 @@ static intptr_t x264_slice_write( x264_t *h )
     bs_realign( &h->out.bs );
 
     /* Slice */
-    x264_nal_start( h, h->i_nal_type, h->i_nal_ref_idc );
+    nal_start( h, h->i_nal_type, h->i_nal_ref_idc );
     h->out.nal[h->out.i_nal].i_first_mb = h->sh.i_first_mb;
 
     /* Slice header */
@@ -2666,7 +2666,7 @@ static intptr_t x264_slice_write( x264_t *h )
     h->sh.i_qp = SPEC_QP( h->sh.i_qp );
     h->sh.i_qp_delta = h->sh.i_qp - h->pps->i_pic_init_qp;
 
-    x264_slice_header_write( &h->out.bs, &h->sh, h->i_nal_ref_idc );
+    slice_header_write( &h->out.bs, &h->sh, h->i_nal_ref_idc );
     if( h->param.b_cabac )
     {
         /* alignment needed */
@@ -2694,23 +2694,23 @@ static intptr_t x264_slice_write( x264_t *h )
 
         if( i_mb_x == 0 )
         {
-            if( x264_bitstream_check_buffer( h ) )
+            if( bitstream_check_buffer( h ) )
                 return -1;
             if( !(i_mb_y & SLICE_MBAFF) && h->param.rc.i_vbv_buffer_size )
-                x264_bitstream_backup( h, &bs_bak[BS_BAK_ROW_VBV], i_skip, 1 );
+                bitstream_backup( h, &bs_bak[BS_BAK_ROW_VBV], i_skip, 1 );
             if( !h->mb.b_reencode_mb )
-                x264_fdec_filter_row( h, i_mb_y, 0 );
+                fdec_filter_row( h, i_mb_y, 0 );
         }
 
         if( back_up_bitstream )
         {
             if( back_up_bitstream_cavlc )
-                x264_bitstream_backup( h, &bs_bak[BS_BAK_CAVLC_OVERFLOW], i_skip, 0 );
+                bitstream_backup( h, &bs_bak[BS_BAK_CAVLC_OVERFLOW], i_skip, 0 );
             if( slice_max_size && !(i_mb_y & SLICE_MBAFF) )
             {
-                x264_bitstream_backup( h, &bs_bak[BS_BAK_SLICE_MAX_SIZE], i_skip, 0 );
+                bitstream_backup( h, &bs_bak[BS_BAK_SLICE_MAX_SIZE], i_skip, 0 );
                 if( (thread_last_mb+1-mb_xy) == h->param.i_slice_min_mbs )
-                    x264_bitstream_backup( h, &bs_bak[BS_BAK_SLICE_MIN_MBS], i_skip, 0 );
+                    bitstream_backup( h, &bs_bak[BS_BAK_SLICE_MIN_MBS], i_skip, 0 );
             }
         }
 
@@ -2775,7 +2775,7 @@ reencode:
                     h->mb.i_skip_intra = 0;
                     h->mb.b_skip_mc = 0;
                     h->mb.b_overflow = 0;
-                    x264_bitstream_restore( h, &bs_bak[BS_BAK_CAVLC_OVERFLOW], &i_skip, 0 );
+                    bitstream_restore( h, &bs_bak[BS_BAK_CAVLC_OVERFLOW], &i_skip, 0 );
                     goto reencode;
                 }
             }
@@ -2815,14 +2815,14 @@ reencode:
                             slice_max_size = 0;
                             goto cont;
                         }
-                        x264_bitstream_restore( h, &bs_bak[BS_BAK_SLICE_MIN_MBS], &i_skip, 0 );
+                        bitstream_restore( h, &bs_bak[BS_BAK_SLICE_MIN_MBS], &i_skip, 0 );
                         h->mb.b_reencode_mb = 1;
                         h->sh.i_last_mb = thread_last_mb-h->param.i_slice_min_mbs;
                         break;
                     }
                     if( mb_xy-SLICE_MBAFF*h->mb.i_mb_stride != h->sh.i_first_mb )
                     {
-                        x264_bitstream_restore( h, &bs_bak[BS_BAK_SLICE_MAX_SIZE], &i_skip, 0 );
+                        bitstream_restore( h, &bs_bak[BS_BAK_SLICE_MAX_SIZE], &i_skip, 0 );
                         h->mb.b_reencode_mb = 1;
                         if( SLICE_MBAFF )
                         {
@@ -2851,7 +2851,7 @@ cont:
 
         if( x264_ratecontrol_mb( h, mb_size ) < 0 )
         {
-            x264_bitstream_restore( h, &bs_bak[BS_BAK_ROW_VBV], &i_skip, 1 );
+            bitstream_restore( h, &bs_bak[BS_BAK_ROW_VBV], &i_skip, 1 );
             h->mb.b_reencode_mb = 1;
             i_mb_x = 0;
             i_mb_y = i_mb_y - SLICE_MBAFF;
@@ -2968,7 +2968,7 @@ cont:
         bs_rbsp_trailing( &h->out.bs );
         bs_flush( &h->out.bs );
     }
-    if( x264_nal_end( h ) )
+    if( nal_end( h ) )
         return -1;
 
     if( h->sh.i_last_mb == (h->i_threadslice_end * h->mb.i_mb_width - 1) )
@@ -2977,7 +2977,7 @@ cont:
                                   + (h->out.i_nal*NALU_OVERHEAD * 8)
                                   - h->stat.frame.i_tex_bits
                                   - h->stat.frame.i_mv_bits;
-        x264_fdec_filter_row( h, h->i_threadslice_end, 0 );
+        fdec_filter_row( h, h->i_threadslice_end, 0 );
 
         if( h->param.b_sliced_threads )
         {
@@ -2985,13 +2985,13 @@ cont:
             x264_threadslice_cond_broadcast( h, 1 );
             /* Do hpel now */
             for( int mb_y = h->i_threadslice_start; mb_y <= h->i_threadslice_end; mb_y++ )
-                x264_fdec_filter_row( h, mb_y, 1 );
+                fdec_filter_row( h, mb_y, 1 );
             x264_threadslice_cond_broadcast( h, 2 );
             /* Do the first row of hpel, now that the previous slice is done */
             if( h->i_thread_idx > 0 )
             {
                 x264_threadslice_cond_wait( h->thread[h->i_thread_idx-1], 2 );
-                x264_fdec_filter_row( h, h->i_threadslice_start + (1 << SLICE_MBAFF), 2 );
+                fdec_filter_row( h, h->i_threadslice_start + (1 << SLICE_MBAFF), 2 );
             }
         }
 
@@ -3007,7 +3007,7 @@ cont:
     return 0;
 }
 
-static void x264_thread_sync_context( x264_t *dst, x264_t *src )
+static void thread_sync_context( x264_t *dst, x264_t *src )
 {
     if( dst == src )
         return;
@@ -3028,13 +3028,13 @@ static void x264_thread_sync_context( x264_t *dst, x264_t *src )
     dst->reconfig = src->reconfig;
 }
 
-static void x264_thread_sync_stat( x264_t *dst, x264_t *src )
+static void thread_sync_stat( x264_t *dst, x264_t *src )
 {
     if( dst != src )
         memcpy( &dst->stat, &src->stat, offsetof(x264_t, stat.frame) - offsetof(x264_t, stat) );
 }
 
-static void *x264_slices_write( x264_t *h )
+static void *slices_write( x264_t *h )
 {
     int i_slice_num = 0;
     int last_thread_mb = h->sh.i_last_mb;
@@ -3076,7 +3076,7 @@ static void *x264_slices_write( x264_t *h )
             }
         }
         h->sh.i_last_mb = X264_MIN( h->sh.i_last_mb, last_thread_mb );
-        if( x264_stack_align( x264_slice_write, h ) )
+        if( x264_stack_align( slice_write, h ) )
             goto fail;
         h->sh.i_first_mb = h->sh.i_last_mb + 1;
         // if i_first_mb is not the last mb in a row then go to the next mb in MBAFF order
@@ -3093,7 +3093,7 @@ fail:
     return (void *)-1;
 }
 
-static int x264_threaded_slices_write( x264_t *h )
+static int threaded_slices_write( x264_t *h )
 {
     /* set first/last mb and sync contexts */
     for( int i = 0; i < h->param.i_threads; i++ )
@@ -3124,7 +3124,7 @@ static int x264_threaded_slices_write( x264_t *h )
     }
     /* dispatch */
     for( int i = 0; i < h->param.i_threads; i++ )
-        x264_threadpool_run( h->threadpool, (void*)x264_slices_write, h->thread[i] );
+        x264_threadpool_run( h->threadpool, (void*)slices_write, h->thread[i] );
     /* wait */
     for( int i = 0; i < h->param.i_threads; i++ )
         x264_threadslice_cond_wait( h->thread[i], 1 );
@@ -3138,7 +3138,7 @@ static int x264_threaded_slices_write( x264_t *h )
         {
             h->out.nal[h->out.i_nal] = t->out.nal[j];
             h->out.i_nal++;
-            x264_nal_check_buffer( h );
+            nal_check_buffer( h );
         }
         /* All entries in stat.frame are ints except for ssd/ssim. */
         for( int j = 0; j < (offsetof(x264_t,stat.frame.i_ssd) - offsetof(x264_t,stat.frame.i_mv_bits)) / sizeof(int); j++ )
@@ -3215,7 +3215,7 @@ int     x264_encoder_encode( x264_t *h,
         h->i_thread_phase = (h->i_thread_phase + 1) % h->i_thread_frames;
         thread_current = h->thread[ h->i_thread_phase ];
         thread_oldest  = h->thread[ (h->i_thread_phase + 1) % h->i_thread_frames ];
-        x264_thread_sync_context( thread_current, thread_prev );
+        thread_sync_context( thread_current, thread_prev );
         x264_thread_sync_ratecontrol( thread_current, thread_prev, thread_oldest );
         h = thread_current;
     }
@@ -3322,7 +3322,7 @@ int     x264_encoder_encode( x264_t *h,
         x264_lookahead_get_frames( h );
 
     if( !h->frames.current[0] && x264_lookahead_is_empty( h ) )
-        return x264_encoder_frame_end( thread_oldest, thread_current, pp_nal, pi_nal, pic_out );
+        return encoder_frame_end( thread_oldest, thread_current, pp_nal, pi_nal, pic_out );
 
     /* ------------------- Get frame to be encoded ------------------------- */
     /* 4: get picture to encode */
@@ -3330,7 +3330,7 @@ int     x264_encoder_encode( x264_t *h,
 
     /* If applicable, wait for previous frame reconstruction to finish */
     if( h->param.b_sliced_threads )
-        if( x264_threadpool_wait_all( h ) < 0 )
+        if( threadpool_wait_all( h ) < 0 )
             return -1;
 
     if( h->i_frame == 0 )
@@ -3352,7 +3352,7 @@ int     x264_encoder_encode( x264_t *h,
     x264_ratecontrol_zone_init( h );
 
     // ok to call this before encoding any frames, since the initial values of fdec have b_kept_as_ref=0
-    if( x264_reference_update( h ) )
+    if( reference_update( h ) )
         return -1;
     h->fdec->i_lines_completed = -1;
 
@@ -3394,7 +3394,7 @@ int     x264_encoder_encode( x264_t *h,
         i_nal_type    = NAL_SLICE_IDR;
         i_nal_ref_idc = NAL_PRIORITY_HIGHEST;
         h->sh.i_type = SLICE_TYPE_I;
-        x264_reference_reset( h );
+        reference_reset( h );
         h->frames.i_poc_last_open_gop = -1;
     }
     else if( h->fenc->i_type == X264_TYPE_I )
@@ -3402,7 +3402,7 @@ int     x264_encoder_encode( x264_t *h,
         i_nal_type    = NAL_SLICE;
         i_nal_ref_idc = NAL_PRIORITY_HIGH; /* Not completely true but for now it is (as all I/P are kept as ref)*/
         h->sh.i_type = SLICE_TYPE_I;
-        x264_reference_hierarchy_reset( h );
+        reference_hierarchy_reset( h );
         if( h->param.b_open_gop )
             h->frames.i_poc_last_open_gop = h->fenc->b_keyframe ? h->fenc->i_poc : -1;
     }
@@ -3411,7 +3411,7 @@ int     x264_encoder_encode( x264_t *h,
         i_nal_type    = NAL_SLICE;
         i_nal_ref_idc = NAL_PRIORITY_HIGH; /* Not completely true but for now it is (as all I/P are kept as ref)*/
         h->sh.i_type = SLICE_TYPE_P;
-        x264_reference_hierarchy_reset( h );
+        reference_hierarchy_reset( h );
         h->frames.i_poc_last_open_gop = -1;
     }
     else if( h->fenc->i_type == X264_TYPE_BREF )
@@ -3419,7 +3419,7 @@ int     x264_encoder_encode( x264_t *h,
         i_nal_type    = NAL_SLICE;
         i_nal_ref_idc = h->param.i_bframe_pyramid == X264_B_PYRAMID_STRICT ? NAL_PRIORITY_LOW : NAL_PRIORITY_HIGH;
         h->sh.i_type = SLICE_TYPE_B;
-        x264_reference_hierarchy_reset( h );
+        reference_hierarchy_reset( h );
     }
     else    /* B frame */
     {
@@ -3454,7 +3454,7 @@ int     x264_encoder_encode( x264_t *h,
 
     /* ------------------- Init                ----------------------------- */
     /* build ref list 0/1 */
-    x264_reference_build_list( h, h->fdec->i_poc );
+    reference_build_list( h, h->fdec->i_poc );
 
     /* ---------------------- Write the bitstream -------------------------- */
     /* Init bitstream context */
@@ -3485,10 +3485,10 @@ int     x264_encoder_encode( x264_t *h,
         else
             pic_type = 7;
 
-        x264_nal_start( h, NAL_AUD, NAL_PRIORITY_DISPOSABLE );
+        nal_start( h, NAL_AUD, NAL_PRIORITY_DISPOSABLE );
         bs_write( &h->out.bs, 3, pic_type );
         bs_rbsp_trailing( &h->out.bs );
-        if( x264_nal_end( h ) )
+        if( nal_end( h ) )
             return -1;
         overhead += h->out.nal[h->out.i_nal-1].i_payload + NALU_OVERHEAD;
     }
@@ -3538,9 +3538,9 @@ int     x264_encoder_encode( x264_t *h,
         if( h->param.b_repeat_headers )
         {
             /* generate sequence parameters */
-            x264_nal_start( h, NAL_SPS, NAL_PRIORITY_HIGHEST );
+            nal_start( h, NAL_SPS, NAL_PRIORITY_HIGHEST );
             x264_sps_write( &h->out.bs, h->sps );
-            if( x264_nal_end( h ) )
+            if( nal_end( h ) )
                 return -1;
             /* Pad AUD/SPS to 256 bytes like Panasonic */
             if( h->param.i_avcintra_class )
@@ -3548,22 +3548,22 @@ int     x264_encoder_encode( x264_t *h,
             overhead += h->out.nal[h->out.i_nal-1].i_payload + h->out.nal[h->out.i_nal-1].i_padding + NALU_OVERHEAD;
 
             /* generate picture parameters */
-            x264_nal_start( h, NAL_PPS, NAL_PRIORITY_HIGHEST );
+            nal_start( h, NAL_PPS, NAL_PRIORITY_HIGHEST );
             x264_pps_write( &h->out.bs, h->sps, h->pps );
-            if( x264_nal_end( h ) )
+            if( nal_end( h ) )
                 return -1;
             if( h->param.i_avcintra_class )
                 h->out.nal[h->out.i_nal-1].i_padding = 256 - h->out.nal[h->out.i_nal-1].i_payload - NALU_OVERHEAD;
             overhead += h->out.nal[h->out.i_nal-1].i_payload + h->out.nal[h->out.i_nal-1].i_padding + NALU_OVERHEAD;
         }
 
-        /* when frame threading is used, buffering period sei is written in x264_encoder_frame_end */
+        /* when frame threading is used, buffering period sei is written in encoder_frame_end */
         if( h->i_thread_frames == 1 && h->sps->vui.b_nal_hrd_parameters_present )
         {
             x264_hrd_fullness( h );
-            x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+            nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
             x264_sei_buffering_period_write( h, &h->out.bs );
-            if( x264_nal_end( h ) )
+            if( nal_end( h ) )
                return -1;
             overhead += h->out.nal[h->out.i_nal-1].i_payload + SEI_OVERHEAD;
         }
@@ -3572,10 +3572,10 @@ int     x264_encoder_encode( x264_t *h,
     /* write extra sei */
     for( int i = 0; i < h->fenc->extra_sei.num_payloads; i++ )
     {
-        x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+        nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
         x264_sei_write( &h->out.bs, h->fenc->extra_sei.payloads[i].payload, h->fenc->extra_sei.payloads[i].payload_size,
                         h->fenc->extra_sei.payloads[i].payload_type );
-        if( x264_nal_end( h ) )
+        if( nal_end( h ) )
             return -1;
         overhead += h->out.nal[h->out.i_nal-1].i_payload + SEI_OVERHEAD;
         if( h->fenc->extra_sei.sei_free )
@@ -3598,10 +3598,10 @@ int     x264_encoder_encode( x264_t *h,
         if( h->param.b_repeat_headers && h->fenc->i_frame == 0 && !h->param.i_avcintra_class )
         {
             /* identify ourself */
-            x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+            nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
             if( x264_sei_version_write( h, &h->out.bs ) )
                 return -1;
-            if( x264_nal_end( h ) )
+            if( nal_end( h ) )
                 return -1;
             overhead += h->out.nal[h->out.i_nal-1].i_payload + SEI_OVERHEAD;
         }
@@ -3609,9 +3609,9 @@ int     x264_encoder_encode( x264_t *h,
         if( h->fenc->i_type != X264_TYPE_IDR )
         {
             int time_to_recovery = h->param.b_open_gop ? 0 : X264_MIN( h->mb.i_mb_width - 1, h->param.i_keyint_max ) + h->param.i_bframe - 1;
-            x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+            nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
             x264_sei_recovery_point_write( h, &h->out.bs, time_to_recovery );
-            if( x264_nal_end( h ) )
+            if( nal_end( h ) )
                 return -1;
             overhead += h->out.nal[h->out.i_nal-1].i_payload + SEI_OVERHEAD;
         }
@@ -3619,9 +3619,9 @@ int     x264_encoder_encode( x264_t *h,
 
     if( h->param.i_frame_packing >= 0 && (h->fenc->b_keyframe || h->param.i_frame_packing == 5) )
     {
-        x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+        nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
         x264_sei_frame_packing_write( h, &h->out.bs );
-        if( x264_nal_end( h ) )
+        if( nal_end( h ) )
             return -1;
         overhead += h->out.nal[h->out.i_nal-1].i_payload + SEI_OVERHEAD;
     }
@@ -3629,9 +3629,9 @@ int     x264_encoder_encode( x264_t *h,
     /* generate sei pic timing */
     if( h->sps->vui.b_pic_struct_present || h->sps->vui.b_nal_hrd_parameters_present )
     {
-        x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+        nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
         x264_sei_pic_timing_write( h, &h->out.bs );
-        if( x264_nal_end( h ) )
+        if( nal_end( h ) )
             return -1;
         overhead += h->out.nal[h->out.i_nal-1].i_payload + SEI_OVERHEAD;
     }
@@ -3640,9 +3640,9 @@ int     x264_encoder_encode( x264_t *h,
     if( !IS_X264_TYPE_B( h->fenc->i_type ) && h->b_sh_backup )
     {
         h->b_sh_backup = 0;
-        x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+        nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
         x264_sei_dec_ref_pic_marking_write( h, &h->out.bs );
-        if( x264_nal_end( h ) )
+        if( nal_end( h ) )
             return -1;
         overhead += h->out.nal[h->out.i_nal-1].i_payload + SEI_OVERHEAD;
     }
@@ -3654,18 +3654,18 @@ int     x264_encoder_encode( x264_t *h,
     if( h->param.i_avcintra_class )
     {
         /* Write an empty filler NAL to mimic the AUD in the P2 format*/
-        x264_nal_start( h, NAL_FILLER, NAL_PRIORITY_DISPOSABLE );
+        nal_start( h, NAL_FILLER, NAL_PRIORITY_DISPOSABLE );
         x264_filler_write( h, &h->out.bs, 0 );
-        if( x264_nal_end( h ) )
+        if( nal_end( h ) )
             return -1;
         overhead += h->out.nal[h->out.i_nal-1].i_payload + NALU_OVERHEAD;
 
         /* All lengths are magic lengths that decoders expect to see */
         /* "UMID" SEI */
-        x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+        nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
         if( x264_sei_avcintra_umid_write( h, &h->out.bs ) < 0 )
             return -1;
-        if( x264_nal_end( h ) )
+        if( nal_end( h ) )
             return -1;
         overhead += h->out.nal[h->out.i_nal-1].i_payload + SEI_OVERHEAD;
 
@@ -3682,10 +3682,10 @@ int     x264_encoder_encode( x264_t *h,
             total_len = 9*512;
         }
         /* "VANC" SEI */
-        x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+        nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
         if( x264_sei_avcintra_vanc_write( h, &h->out.bs, unpadded_len ) < 0 )
             return -1;
-        if( x264_nal_end( h ) )
+        if( nal_end( h ) )
             return -1;
 
         h->out.nal[h->out.i_nal-1].i_padding = total_len - h->out.nal[h->out.i_nal-1].i_payload - SEI_OVERHEAD;
@@ -3703,20 +3703,20 @@ int     x264_encoder_encode( x264_t *h,
     if( h->param.rc.b_stat_read && h->sh.i_type != SLICE_TYPE_I )
     {
         x264_reference_build_list_optimal( h );
-        x264_reference_check_reorder( h );
+        reference_check_reorder( h );
     }
 
     if( h->i_ref[0] )
         h->fdec->i_poc_l0ref0 = h->fref[0][0]->i_poc;
 
     /* ------------------------ Create slice header  ----------------------- */
-    x264_slice_init( h, i_nal_type, i_global_qp );
+    slice_init( h, i_nal_type, i_global_qp );
 
     /*------------------------- Weights -------------------------------------*/
     if( h->sh.i_type == SLICE_TYPE_B )
         x264_macroblock_bipred_init( h );
 
-    x264_weighted_pred_init( h );
+    weighted_pred_init( h );
 
     if( i_nal_ref_idc != NAL_PRIORITY_DISPOSABLE )
         h->i_frame_num++;
@@ -3726,24 +3726,24 @@ int     x264_encoder_encode( x264_t *h,
     h->i_threadslice_end = h->mb.i_mb_height;
     if( h->i_thread_frames > 1 )
     {
-        x264_threadpool_run( h->threadpool, (void*)x264_slices_write, h );
+        x264_threadpool_run( h->threadpool, (void*)slices_write, h );
         h->b_thread_active = 1;
     }
     else if( h->param.b_sliced_threads )
     {
-        if( x264_threaded_slices_write( h ) )
+        if( threaded_slices_write( h ) )
             return -1;
     }
     else
-        if( (intptr_t)x264_slices_write( h ) )
+        if( (intptr_t)slices_write( h ) )
             return -1;
 
-    return x264_encoder_frame_end( thread_oldest, thread_current, pp_nal, pi_nal, pic_out );
+    return encoder_frame_end( thread_oldest, thread_current, pp_nal, pi_nal, pic_out );
 }
 
-static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
-                                   x264_nal_t **pp_nal, int *pi_nal,
-                                   x264_picture_t *pic_out )
+static int encoder_frame_end( x264_t *h, x264_t *thread_current,
+                              x264_nal_t **pp_nal, int *pi_nal,
+                              x264_picture_t *pic_out )
 {
     char psz_message[80];
 
@@ -3765,9 +3765,9 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
     if( h->i_thread_frames > 1 && h->fenc->b_keyframe && h->sps->vui.b_nal_hrd_parameters_present )
     {
         x264_hrd_fullness( h );
-        x264_nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
+        nal_start( h, NAL_SEI, NAL_PRIORITY_DISPOSABLE );
         x264_sei_buffering_period_write( h, &h->out.bs );
-        if( x264_nal_end( h ) )
+        if( nal_end( h ) )
            return -1;
         /* buffering period sei must follow AUD, SPS and PPS and precede all other SEIs */
         int idx = 0;
@@ -3780,7 +3780,7 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
         h->out.nal[idx] = nal_tmp;
     }
 
-    int frame_size = x264_encoder_encapsulate_nals( h, 0 );
+    int frame_size = encoder_encapsulate_nals( h, 0 );
     if( frame_size < 0 )
         return -1;
 
@@ -3825,7 +3825,7 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
      * We don't know the size of the last slice until encapsulation so we add filler to the encapsulated NAL */
     if( h->param.i_avcintra_class )
     {
-        if( x264_check_encapsulated_buffer( h, h->thread[0], h->out.i_nal, frame_size, frame_size + filler ) < 0 )
+        if( check_encapsulated_buffer( h, h->thread[0], h->out.i_nal, frame_size, frame_size + filler ) < 0 )
             return -1;
 
         x264_nal_t *nal = &h->out.nal[h->out.i_nal-1];
@@ -3860,13 +3860,13 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
             else
                 f = X264_MAX( 0, filler - overhead );
 
-            if( x264_bitstream_check_buffer_filler( h, f ) )
+            if( bitstream_check_buffer_filler( h, f ) )
                 return -1;
-            x264_nal_start( h, NAL_FILLER, NAL_PRIORITY_DISPOSABLE );
+            nal_start( h, NAL_FILLER, NAL_PRIORITY_DISPOSABLE );
             x264_filler_write( h, &h->out.bs, f );
-            if( x264_nal_end( h ) )
+            if( nal_end( h ) )
                 return -1;
-            int total_size = x264_encoder_encapsulate_nals( h, h->out.i_nal-1 );
+            int total_size = encoder_encapsulate_nals( h, h->out.i_nal-1 );
             if( total_size < 0 )
                 return -1;
             frame_size += total_size;
@@ -3883,7 +3883,7 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
     x264_noise_reduction_update( h );
 
     /* ---------------------- Compute/Print statistics --------------------- */
-    x264_thread_sync_stat( h, h->thread[0] );
+    thread_sync_stat( h, h->thread[0] );
 
     /* Slice stat */
     h->stat.i_frame_count[h->sh.i_type]++;
@@ -3941,10 +3941,10 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
         };
         int luma_size = h->param.i_width * h->param.i_height;
         int chroma_size = CHROMA_SIZE( luma_size );
-        pic_out->prop.f_psnr[0] = x264_psnr( ssd[0], luma_size );
-        pic_out->prop.f_psnr[1] = x264_psnr( ssd[1], chroma_size );
-        pic_out->prop.f_psnr[2] = x264_psnr( ssd[2], chroma_size );
-        pic_out->prop.f_psnr_avg = x264_psnr( ssd[0] + ssd[1] + ssd[2], luma_size + chroma_size*2 );
+        pic_out->prop.f_psnr[0] = calc_psnr( ssd[0], luma_size );
+        pic_out->prop.f_psnr[1] = calc_psnr( ssd[1], chroma_size );
+        pic_out->prop.f_psnr[2] = calc_psnr( ssd[2], chroma_size );
+        pic_out->prop.f_psnr_avg = calc_psnr( ssd[0] + ssd[1] + ssd[2], luma_size + chroma_size*2 );
 
         h->stat.f_ssd_global[h->sh.i_type]   += dur * (ssd[0] + ssd[1] + ssd[2]);
         h->stat.f_psnr_average[h->sh.i_type] += dur * pic_out->prop.f_psnr_avg;
@@ -3980,9 +3980,9 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
               psz_message );
 
     // keep stats all in one place
-    x264_thread_sync_stat( h->thread[0], h );
+    thread_sync_stat( h->thread[0], h );
     // for the use of the next frame
-    x264_thread_sync_stat( thread_current, h );
+    thread_sync_stat( thread_current, h );
 
 #ifdef DEBUG_MB_TYPE
 {
@@ -4011,13 +4011,13 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
         }
 
     if( h->param.psz_dump_yuv )
-        x264_frame_dump( h );
+        frame_dump( h );
     x264_emms();
 
     return frame_size;
 }
 
-static void x264_print_intra( int64_t *i_mb_count, double i_count, int b_print_pcm, char *intra )
+static void print_intra( int64_t *i_mb_count, double i_count, int b_print_pcm, char *intra )
 {
     intra += sprintf( intra, "I16..4%s: %4.1f%% %4.1f%% %4.1f%%",
         b_print_pcm ? "..PCM" : "",
@@ -4048,7 +4048,7 @@ void    x264_encoder_close  ( x264_t *h )
 #endif
 
     if( h->param.b_sliced_threads )
-        x264_threadpool_wait_all( h );
+        threadpool_wait_all( h );
     if( h->param.i_threads > 1 )
         x264_threadpool_delete( h->threadpool );
     if( h->param.i_lookahead_threads > 1 )
@@ -4089,7 +4089,7 @@ void    x264_encoder_close  ( x264_t *h )
                           (double)h->stat.i_frame_size[i_slice] / i_count,
                           h->stat.f_psnr_mean_y[i_slice] / dur, h->stat.f_psnr_mean_u[i_slice] / dur, h->stat.f_psnr_mean_v[i_slice] / dur,
                           h->stat.f_psnr_average[i_slice] / dur,
-                          x264_psnr( h->stat.f_ssd_global[i_slice], dur * i_yuv_size ) );
+                          calc_psnr( h->stat.f_ssd_global[i_slice], dur * i_yuv_size ) );
             }
             else
             {
@@ -4126,7 +4126,7 @@ void    x264_encoder_close  ( x264_t *h )
     {
         int64_t *i_mb_count = h->stat.i_mb_count[SLICE_TYPE_I];
         double i_count = (double)h->stat.i_frame_count[SLICE_TYPE_I] * h->mb.i_mb_count / 100.0;
-        x264_print_intra( i_mb_count, i_count, b_print_pcm, buf );
+        print_intra( i_mb_count, i_count, b_print_pcm, buf );
         x264_log( h, X264_LOG_INFO, "mb I  %s\n", buf );
     }
     if( h->stat.i_frame_count[SLICE_TYPE_P] > 0 )
@@ -4134,7 +4134,7 @@ void    x264_encoder_close  ( x264_t *h )
         int64_t *i_mb_count = h->stat.i_mb_count[SLICE_TYPE_P];
         double i_count = (double)h->stat.i_frame_count[SLICE_TYPE_P] * h->mb.i_mb_count / 100.0;
         int64_t *i_mb_size = i_mb_count_size[SLICE_TYPE_P];
-        x264_print_intra( i_mb_count, i_count, b_print_pcm, buf );
+        print_intra( i_mb_count, i_count, b_print_pcm, buf );
         x264_log( h, X264_LOG_INFO,
                   "mb P  %s  P16..4: %4.1f%% %4.1f%% %4.1f%% %4.1f%% %4.1f%%    skip:%4.1f%%\n",
                   buf,
@@ -4152,7 +4152,7 @@ void    x264_encoder_close  ( x264_t *h )
         double i_mb_list_count;
         int64_t *i_mb_size = i_mb_count_size[SLICE_TYPE_B];
         int64_t list_count[3] = {0}; /* 0 == L0, 1 == L1, 2 == BI */
-        x264_print_intra( i_mb_count, i_count, b_print_pcm, buf );
+        print_intra( i_mb_count, i_count, b_print_pcm, buf );
         for( int i = 0; i < X264_PARTTYPE_MAX; i++ )
             for( int j = 0; j < 2; j++ )
             {
@@ -4315,7 +4315,7 @@ void    x264_encoder_close  ( x264_t *h )
         if( h->param.analyse.b_ssim )
         {
             float ssim = SUM3( h->stat.f_ssim_mean_y ) / duration;
-            x264_log( h, X264_LOG_INFO, "SSIM Mean Y:%.7f (%6.3fdb)\n", ssim, x264_ssim( ssim ) );
+            x264_log( h, X264_LOG_INFO, "SSIM Mean Y:%.7f (%6.3fdb)\n", ssim, calc_ssim_db( ssim ) );
         }
         if( h->param.analyse.b_psnr )
         {
@@ -4325,7 +4325,7 @@ void    x264_encoder_close  ( x264_t *h )
                       SUM3( h->stat.f_psnr_mean_u ) / duration,
                       SUM3( h->stat.f_psnr_mean_v ) / duration,
                       SUM3( h->stat.f_psnr_average ) / duration,
-                      x264_psnr( SUM3( h->stat.f_ssd_global ), duration * i_yuv_size ),
+                      calc_psnr( SUM3( h->stat.f_ssd_global ), duration * i_yuv_size ),
                       f_bitrate );
         }
         else
index 2080c4613c0aaa6787d7bedee6648044cc0ced67..c1c374ec3a11cc17f0fdb133e7a5fdaba9dd022f 100644 (file)
@@ -39,7 +39,7 @@
 #include "common/common.h"
 #include "analyse.h"
 
-static void x264_lookahead_shift( x264_sync_frame_list_t *dst, x264_sync_frame_list_t *src, int count )
+static void lookahead_shift( x264_sync_frame_list_t *dst, x264_sync_frame_list_t *src, int count )
 {
     int i = count;
     while( i-- )
@@ -56,7 +56,7 @@ static void x264_lookahead_shift( x264_sync_frame_list_t *dst, x264_sync_frame_l
     }
 }
 
-static void x264_lookahead_update_last_nonb( x264_t *h, x264_frame_t *new_nonb )
+static void lookahead_update_last_nonb( x264_t *h, x264_frame_t *new_nonb )
 {
     if( h->lookahead->last_nonb )
         x264_frame_push_unused( h, h->lookahead->last_nonb );
@@ -65,11 +65,11 @@ static void x264_lookahead_update_last_nonb( x264_t *h, x264_frame_t *new_nonb )
 }
 
 #if HAVE_THREAD
-static void x264_lookahead_slicetype_decide( x264_t *h )
+static void lookahead_slicetype_decide( x264_t *h )
 {
     x264_stack_align( x264_slicetype_decide, h );
 
-    x264_lookahead_update_last_nonb( h, h->lookahead->next.list[0] );
+    lookahead_update_last_nonb( h, h->lookahead->next.list[0] );
     int shift_frames = h->lookahead->next.list[0]->i_bframes + 1;
 
     x264_pthread_mutex_lock( &h->lookahead->ofbuf.mutex );
@@ -77,7 +77,7 @@ static void x264_lookahead_slicetype_decide( x264_t *h )
         x264_pthread_cond_wait( &h->lookahead->ofbuf.cv_empty, &h->lookahead->ofbuf.mutex );
 
     x264_pthread_mutex_lock( &h->lookahead->next.mutex );
-    x264_lookahead_shift( &h->lookahead->ofbuf, &h->lookahead->next, shift_frames );
+    lookahead_shift( &h->lookahead->ofbuf, &h->lookahead->next, shift_frames );
     x264_pthread_mutex_unlock( &h->lookahead->next.mutex );
 
     /* For MB-tree and VBV lookahead, we have to perform propagation analysis on I-frames too. */
@@ -87,14 +87,14 @@ static void x264_lookahead_slicetype_decide( x264_t *h )
     x264_pthread_mutex_unlock( &h->lookahead->ofbuf.mutex );
 }
 
-static void *x264_lookahead_thread( x264_t *h )
+static void *lookahead_thread( x264_t *h )
 {
     while( !h->lookahead->b_exit_thread )
     {
         x264_pthread_mutex_lock( &h->lookahead->ifbuf.mutex );
         x264_pthread_mutex_lock( &h->lookahead->next.mutex );
         int shift = X264_MIN( h->lookahead->next.i_max_size - h->lookahead->next.i_size, h->lookahead->ifbuf.i_size );
-        x264_lookahead_shift( &h->lookahead->next, &h->lookahead->ifbuf, shift );
+        lookahead_shift( &h->lookahead->next, &h->lookahead->ifbuf, shift );
         x264_pthread_mutex_unlock( &h->lookahead->next.mutex );
         if( h->lookahead->next.i_size <= h->lookahead->i_slicetype_length + h->param.b_vfr_input )
         {
@@ -105,16 +105,16 @@ static void *x264_lookahead_thread( x264_t *h )
         else
         {
             x264_pthread_mutex_unlock( &h->lookahead->ifbuf.mutex );
-            x264_lookahead_slicetype_decide( h );
+            lookahead_slicetype_decide( h );
         }
     }   /* end of input frames */
     x264_pthread_mutex_lock( &h->lookahead->ifbuf.mutex );
     x264_pthread_mutex_lock( &h->lookahead->next.mutex );
-    x264_lookahead_shift( &h->lookahead->next, &h->lookahead->ifbuf, h->lookahead->ifbuf.i_size );
+    lookahead_shift( &h->lookahead->next, &h->lookahead->ifbuf, h->lookahead->ifbuf.i_size );
     x264_pthread_mutex_unlock( &h->lookahead->next.mutex );
     x264_pthread_mutex_unlock( &h->lookahead->ifbuf.mutex );
     while( h->lookahead->next.i_size )
-        x264_lookahead_slicetype_decide( h );
+        lookahead_slicetype_decide( h );
     x264_pthread_mutex_lock( &h->lookahead->ofbuf.mutex );
     h->lookahead->b_thread_active = 0;
     x264_pthread_cond_broadcast( &h->lookahead->ofbuf.cv_fill );
@@ -152,7 +152,7 @@ int x264_lookahead_init( x264_t *h, int i_slicetype_length )
     if( x264_macroblock_thread_allocate( look_h, 1 ) < 0 )
         goto fail;
 
-    if( x264_pthread_create( &look->thread_handle, NULL, (void*)x264_lookahead_thread, look_h ) )
+    if( x264_pthread_create( &look->thread_handle, NULL, (void*)lookahead_thread, look_h ) )
         goto fail;
     look->b_thread_active = 1;
 
@@ -201,7 +201,7 @@ int x264_lookahead_is_empty( x264_t *h )
     return b_empty;
 }
 
-static void x264_lookahead_encoder_shift( x264_t *h )
+static void lookahead_encoder_shift( x264_t *h )
 {
     if( !h->lookahead->ofbuf.i_size )
         return;
@@ -221,7 +221,7 @@ void x264_lookahead_get_frames( x264_t *h )
         x264_pthread_mutex_lock( &h->lookahead->ofbuf.mutex );
         while( !h->lookahead->ofbuf.i_size && h->lookahead->b_thread_active )
             x264_pthread_cond_wait( &h->lookahead->ofbuf.cv_fill, &h->lookahead->ofbuf.mutex );
-        x264_lookahead_encoder_shift( h );
+        lookahead_encoder_shift( h );
         x264_pthread_mutex_unlock( &h->lookahead->ofbuf.mutex );
     }
     else
@@ -231,14 +231,14 @@ void x264_lookahead_get_frames( x264_t *h )
             return;
 
         x264_stack_align( x264_slicetype_decide, h );
-        x264_lookahead_update_last_nonb( h, h->lookahead->next.list[0] );
+        lookahead_update_last_nonb( h, h->lookahead->next.list[0] );
         int shift_frames = h->lookahead->next.list[0]->i_bframes + 1;
-        x264_lookahead_shift( &h->lookahead->ofbuf, &h->lookahead->next, shift_frames );
+        lookahead_shift( &h->lookahead->ofbuf, &h->lookahead->next, shift_frames );
 
         /* For MB-tree and VBV lookahead, we have to perform propagation analysis on I-frames too. */
         if( h->lookahead->b_analyse_keyframe && IS_X264_TYPE_I( h->lookahead->last_nonb->i_type ) )
             x264_stack_align( x264_slicetype_analyse, h, shift_frames );
 
-        x264_lookahead_encoder_shift( h );
+        lookahead_encoder_shift( h );
     }
 }
index 929fcc8e0e9f2cc4a350f92d3e9c2093a8ff4552..e55066cea14f11c447fd752d9c5afd084dca0dfb 100644 (file)
@@ -123,7 +123,7 @@ static ALWAYS_INLINE int array_non_zero( dctcoef *v, int i_count )
 /* This means that decimation can be done merely by adjusting the CBP and NNZ
  * rather than memsetting the coefficients. */
 
-static void x264_mb_encode_i16x16( x264_t *h, int p, int i_qp )
+static void mb_encode_i16x16( x264_t *h, int p, int i_qp )
 {
     pixel *p_src = h->mb.pic.p_fenc[p];
     pixel *p_dst = h->mb.pic.p_fdec[p];
@@ -242,7 +242,7 @@ static void x264_mb_encode_i16x16( x264_t *h, int p, int i_qp )
  * Unlike luma blocks, this can't be done with a lookup table or
  * other shortcut technique because of the interdependencies
  * between the coefficients due to the chroma DC transform. */
-static ALWAYS_INLINE int x264_mb_optimize_chroma_dc( x264_t *h, dctcoef *dct_dc, int dequant_mf[6][16], int i_qp, int chroma422 )
+static ALWAYS_INLINE int mb_optimize_chroma_dc( x264_t *h, dctcoef *dct_dc, int dequant_mf[6][16], int i_qp, int chroma422 )
 {
     int dmf = dequant_mf[i_qp%6][0] << i_qp/6;
 
@@ -256,7 +256,7 @@ static ALWAYS_INLINE int x264_mb_optimize_chroma_dc( x264_t *h, dctcoef *dct_dc,
         return h->quantf.optimize_chroma_2x2_dc( dct_dc, dmf );
 }
 
-static ALWAYS_INLINE void x264_mb_encode_chroma_internal( x264_t *h, int b_inter, int i_qp, int chroma422 )
+static ALWAYS_INLINE void mb_encode_chroma_internal( x264_t *h, int b_inter, int i_qp, int chroma422 )
 {
     int nz, nz_dc;
     int b_decimate = b_inter && h->mb.b_dct_decimate;
@@ -316,7 +316,7 @@ static ALWAYS_INLINE void x264_mb_encode_chroma_internal( x264_t *h, int b_inter
 
                     if( nz_dc )
                     {
-                        if( !x264_mb_optimize_chroma_dc( h, dct_dc, dequant_mf, i_qp+3*chroma422, chroma422 ) )
+                        if( !mb_optimize_chroma_dc( h, dct_dc, dequant_mf, i_qp+3*chroma422, chroma422 ) )
                             continue;
                         h->mb.cache.non_zero_count[x264_scan8[CHROMA_DC+ch]] = 1;
                         if( chroma422 )
@@ -441,7 +441,7 @@ static ALWAYS_INLINE void x264_mb_encode_chroma_internal( x264_t *h, int b_inter
 
             if( !nz_dc ) /* Whole block is empty */
                 continue;
-            if( !x264_mb_optimize_chroma_dc( h, dct_dc, dequant_mf, i_qp+3*chroma422, chroma422 ) )
+            if( !mb_optimize_chroma_dc( h, dct_dc, dequant_mf, i_qp+3*chroma422, chroma422 ) )
             {
                 h->mb.cache.non_zero_count[x264_scan8[CHROMA_DC+ch]] = 0;
                 continue;
@@ -492,12 +492,12 @@ static ALWAYS_INLINE void x264_mb_encode_chroma_internal( x264_t *h, int b_inter
 void x264_mb_encode_chroma( x264_t *h, int b_inter, int i_qp )
 {
     if( CHROMA_FORMAT == CHROMA_420 )
-        x264_mb_encode_chroma_internal( h, b_inter, i_qp, 0 );
+        mb_encode_chroma_internal( h, b_inter, i_qp, 0 );
     else
-        x264_mb_encode_chroma_internal( h, b_inter, i_qp, 1 );
+        mb_encode_chroma_internal( h, b_inter, i_qp, 1 );
 }
 
-static void x264_macroblock_encode_skip( x264_t *h )
+static void macroblock_encode_skip( x264_t *h )
 {
     M32( &h->mb.cache.non_zero_count[x264_scan8[ 0]] ) = 0;
     M32( &h->mb.cache.non_zero_count[x264_scan8[ 2]] ) = 0;
@@ -615,7 +615,7 @@ void x264_predict_lossless_16x16( x264_t *h, int p, int i_mode )
 /*****************************************************************************
  * x264_macroblock_encode:
  *****************************************************************************/
-static ALWAYS_INLINE void x264_macroblock_encode_internal( x264_t *h, int plane_count, int chroma )
+static ALWAYS_INLINE void macroblock_encode_internal( x264_t *h, int plane_count, int chroma )
 {
     int i_qp = h->mb.i_qp;
     int b_decimate = h->mb.b_dct_decimate;
@@ -691,7 +691,7 @@ static ALWAYS_INLINE void x264_macroblock_encode_internal( x264_t *h, int plane_
             }
         }
 
-        x264_macroblock_encode_skip( h );
+        macroblock_encode_skip( h );
         return;
     }
     if( h->mb.i_type == B_SKIP )
@@ -699,7 +699,7 @@ static ALWAYS_INLINE void x264_macroblock_encode_internal( x264_t *h, int plane_
         /* don't do bskip motion compensation if it was already done in macroblock_analyse */
         if( !h->mb.b_skip_mc )
             x264_mb_mc( h );
-        x264_macroblock_encode_skip( h );
+        macroblock_encode_skip( h );
         return;
     }
 
@@ -708,7 +708,7 @@ static ALWAYS_INLINE void x264_macroblock_encode_internal( x264_t *h, int plane_
         h->mb.b_transform_8x8 = 0;
 
         for( int p = 0; p < plane_count; p++, i_qp = h->mb.i_chroma_qp )
-            x264_mb_encode_i16x16( h, p, i_qp );
+            mb_encode_i16x16( h, p, i_qp );
     }
     else if( h->mb.i_type == I_8x8 )
     {
@@ -974,16 +974,16 @@ static ALWAYS_INLINE void x264_macroblock_encode_internal( x264_t *h, int plane_
 void x264_macroblock_encode( x264_t *h )
 {
     if( CHROMA444 )
-        x264_macroblock_encode_internal( h, 3, 0 );
+        macroblock_encode_internal( h, 3, 0 );
     else
-        x264_macroblock_encode_internal( h, 1, 1 );
+        macroblock_encode_internal( h, 1, 1 );
 }
 
 /*****************************************************************************
  * x264_macroblock_probe_skip:
  *  Check if the current MB could be encoded as a [PB]_SKIP
  *****************************************************************************/
-static ALWAYS_INLINE int x264_macroblock_probe_skip_internal( x264_t *h, int b_bidir, int plane_count, int chroma )
+static ALWAYS_INLINE int macroblock_probe_skip_internal( x264_t *h, int b_bidir, int plane_count, int chroma )
 {
     ALIGNED_ARRAY_64( dctcoef, dct4x4,[8],[16] );
     ALIGNED_ARRAY_64( dctcoef, dctscan,[16] );
@@ -1127,11 +1127,11 @@ static ALWAYS_INLINE int x264_macroblock_probe_skip_internal( x264_t *h, int b_b
 int x264_macroblock_probe_skip( x264_t *h, int b_bidir )
 {
     if( CHROMA_FORMAT == CHROMA_444 )
-        return x264_macroblock_probe_skip_internal( h, b_bidir, 3, CHROMA_444 );
+        return macroblock_probe_skip_internal( h, b_bidir, 3, CHROMA_444 );
     else if( CHROMA_FORMAT == CHROMA_422 )
-        return x264_macroblock_probe_skip_internal( h, b_bidir, 1, CHROMA_422 );
+        return macroblock_probe_skip_internal( h, b_bidir, 1, CHROMA_422 );
     else
-        return x264_macroblock_probe_skip_internal( h, b_bidir, 1, CHROMA_420 );
+        return macroblock_probe_skip_internal( h, b_bidir, 1, CHROMA_420 );
 }
 
 /****************************************************************************
@@ -1172,7 +1172,7 @@ void x264_noise_reduction_update( x264_t *h )
  * RD only; 4 calls to this do not make up for one macroblock_encode.
  * doesn't transform chroma dc.
  *****************************************************************************/
-static ALWAYS_INLINE void x264_macroblock_encode_p8x8_internal( x264_t *h, int i8, int plane_count, int chroma )
+static ALWAYS_INLINE void macroblock_encode_p8x8_internal( x264_t *h, int i8, int plane_count, int chroma )
 {
     int b_decimate = h->mb.b_dct_decimate;
     int i_qp = h->mb.i_qp;
@@ -1366,17 +1366,17 @@ static ALWAYS_INLINE void x264_macroblock_encode_p8x8_internal( x264_t *h, int i
 void x264_macroblock_encode_p8x8( x264_t *h, int i8 )
 {
     if( CHROMA444 )
-        x264_macroblock_encode_p8x8_internal( h, i8, 3, CHROMA_444 );
+        macroblock_encode_p8x8_internal( h, i8, 3, CHROMA_444 );
     else if( CHROMA_FORMAT == CHROMA_422 )
-        x264_macroblock_encode_p8x8_internal( h, i8, 1, CHROMA_422 );
+        macroblock_encode_p8x8_internal( h, i8, 1, CHROMA_422 );
     else
-        x264_macroblock_encode_p8x8_internal( h, i8, 1, CHROMA_420 );
+        macroblock_encode_p8x8_internal( h, i8, 1, CHROMA_420 );
 }
 
 /*****************************************************************************
  * RD only, luma only (for 4:2:0)
  *****************************************************************************/
-static ALWAYS_INLINE void x264_macroblock_encode_p4x4_internal( x264_t *h, int i4, int plane_count )
+static ALWAYS_INLINE void macroblock_encode_p4x4_internal( x264_t *h, int i4, int plane_count )
 {
     int i_qp = h->mb.i_qp;
 
@@ -1413,7 +1413,7 @@ static ALWAYS_INLINE void x264_macroblock_encode_p4x4_internal( x264_t *h, int i
 void x264_macroblock_encode_p4x4( x264_t *h, int i8 )
 {
     if( CHROMA444 )
-        x264_macroblock_encode_p4x4_internal( h, i8, 3 );
+        macroblock_encode_p4x4_internal( h, i8, 3 );
     else
-        x264_macroblock_encode_p4x4_internal( h, i8, 1 );
+        macroblock_encode_p4x4_internal( h, i8, 1 );
 }
index 094fc5da87c4bdb5fd977e74bafff74e5f5a1ea2..b082f203fecaa9ad8c523cbaab463ad012e240c3 100644 (file)
@@ -424,7 +424,7 @@ void x264_me_search_ref( x264_t *h, x264_me_t *m, int16_t (*mvc)[2], int i_mvc,
             /* Uneven-cross Multi-Hexagon-grid Search
              * as in JM, except with different early termination */
 
-            static const uint8_t x264_pixel_size_shift[7] = { 0, 1, 1, 2, 3, 3, 4 };
+            static const uint8_t pixel_size_shift[7] = { 0, 1, 1, 2, 3, 3, 4 };
 
             int ucost1, ucost2;
             int cross_start = 1;
@@ -446,7 +446,7 @@ void x264_me_search_ref( x264_t *h, x264_me_t *m, int16_t (*mvc)[2], int i_mvc,
             omx = bmx; omy = bmy;
 
             /* early termination */
-#define SAD_THRESH(v) ( bcost < ( v >> x264_pixel_size_shift[i_pixel] ) )
+#define SAD_THRESH(v) ( bcost < ( v >> pixel_size_shift[i_pixel] ) )
             if( bcost == ucost2 && SAD_THRESH(2000) )
             {
                 COST_MV_X4( 0,-2, -1,-1, 1,-1, -2,0 );
@@ -1024,7 +1024,7 @@ static void refine_subpel( x264_t *h, x264_me_t *m, int hpel_iters, int qpel_ite
  * other than making its iteration count not a compile-time constant. */
 int x264_iter_kludge = 0;
 
-static void ALWAYS_INLINE x264_me_refine_bidir( x264_t *h, x264_me_t *m0, x264_me_t *m1, int i_weight, int i8, int i_lambda2, int rd )
+static void ALWAYS_INLINE me_refine_bidir( x264_t *h, x264_me_t *m0, x264_me_t *m1, int i_weight, int i8, int i_lambda2, int rd )
 {
     int x = i8&1;
     int y = i8>>1;
@@ -1179,7 +1179,7 @@ static void ALWAYS_INLINE x264_me_refine_bidir( x264_t *h, x264_me_t *m0, x264_m
 
 void x264_me_refine_bidir_satd( x264_t *h, x264_me_t *m0, x264_me_t *m1, int i_weight )
 {
-    x264_me_refine_bidir( h, m0, m1, i_weight, 0, 0, 0 );
+    me_refine_bidir( h, m0, m1, i_weight, 0, 0, 0 );
 }
 
 void x264_me_refine_bidir_rd( x264_t *h, x264_me_t *m0, x264_me_t *m1, int i_weight, int i8, int i_lambda2 )
@@ -1187,7 +1187,7 @@ void x264_me_refine_bidir_rd( x264_t *h, x264_me_t *m0, x264_me_t *m1, int i_wei
     /* Motion compensation is done as part of bidir_rd; don't repeat
      * it in encoding. */
     h->mb.b_skip_mc = 1;
-    x264_me_refine_bidir( h, m0, m1, i_weight, i8, i_lambda2, 1 );
+    me_refine_bidir( h, m0, m1, i_weight, i8, i_lambda2, 1 );
     h->mb.b_skip_mc = 0;
 }
 
index 5289316b277ab874709d27273fb64bb9c7441ddf..b09c243458ea9525d59b17e35532dec9163c9de6 100644 (file)
@@ -256,7 +256,7 @@ static ALWAYS_INLINE uint32_t ac_energy_plane( x264_t *h, int mb_x, int mb_y, x2
 }
 
 // Find the total AC energy of the block in all planes.
-static NOINLINE uint32_t x264_ac_energy_mb( x264_t *h, int mb_x, int mb_y, x264_frame_t *frame )
+static NOINLINE uint32_t ac_energy_mb( x264_t *h, int mb_x, int mb_y, x264_frame_t *frame )
 {
     /* This function contains annoying hacks because GCC has a habit of reordering emms
      * and putting it after floating point ops.  As a result, we put the emms at the end of the
@@ -337,7 +337,7 @@ void x264_adaptive_quant_frame( x264_t *h, x264_frame_t *frame, float *quant_off
         {
             for( int mb_y = 0; mb_y < h->mb.i_mb_height; mb_y++ )
                 for( int mb_x = 0; mb_x < h->mb.i_mb_width; mb_x++ )
-                    x264_ac_energy_mb( h, mb_x, mb_y, frame );
+                    ac_energy_mb( h, mb_x, mb_y, frame );
         }
         else
             return;
@@ -358,7 +358,7 @@ void x264_adaptive_quant_frame( x264_t *h, x264_frame_t *frame, float *quant_off
             for( int mb_y = 0; mb_y < h->mb.i_mb_height; mb_y++ )
                 for( int mb_x = 0; mb_x < h->mb.i_mb_width; mb_x++ )
                 {
-                    uint32_t energy = x264_ac_energy_mb( h, mb_x, mb_y, frame );
+                    uint32_t energy = ac_energy_mb( h, mb_x, mb_y, frame );
                     float qp_adj = powf( energy * bit_depth_correction + 1, 0.125f );
                     frame->f_qp_offset[mb_x + mb_y*h->mb.i_mb_stride] = qp_adj;
                     avg_adj += qp_adj;
@@ -390,7 +390,7 @@ void x264_adaptive_quant_frame( x264_t *h, x264_frame_t *frame, float *quant_off
                 }
                 else
                 {
-                    uint32_t energy = x264_ac_energy_mb( h, mb_x, mb_y, frame );
+                    uint32_t energy = ac_energy_mb( h, mb_x, mb_y, frame );
                     qp_adj = strength * (x264_log2( X264_MAX(energy, 1) ) - (14.427f + 2*(BIT_DEPTH-8)));
                 }
                 if( quant_offsets )
@@ -413,7 +413,7 @@ void x264_adaptive_quant_frame( x264_t *h, x264_frame_t *frame, float *quant_off
     }
 }
 
-static int x264_macroblock_tree_rescale_init( x264_t *h, x264_ratecontrol_t *rc )
+static int macroblock_tree_rescale_init( x264_t *h, x264_ratecontrol_t *rc )
 {
     /* Use fractional QP array dimensions to compensate for edge padding */
     float srcdim[2] = {rc->mbtree.srcdim[0] / 16.f, rc->mbtree.srcdim[1] / 16.f};
@@ -486,7 +486,7 @@ fail:
     return -1;
 }
 
-static void x264_macroblock_tree_rescale_destroy( x264_ratecontrol_t *rc )
+static void macroblock_tree_rescale_destroy( x264_ratecontrol_t *rc )
 {
     for( int i = 0; i < 2; i++ )
     {
@@ -505,7 +505,7 @@ static ALWAYS_INLINE float tapfilter( float *src, int pos, int max, int stride,
     return sum;
 }
 
-static void x264_macroblock_tree_rescale( x264_t *h, x264_ratecontrol_t *rc, float *dst )
+static void macroblock_tree_rescale( x264_t *h, x264_ratecontrol_t *rc, float *dst )
 {
     float *input, *output;
     int filtersize, stride, height;
@@ -567,7 +567,7 @@ int x264_macroblock_tree_read( x264_t *h, x264_frame_t *frame, float *quant_offs
         float *dst = rc->mbtree.rescale_enabled ? rc->mbtree.scale_buffer[0] : frame->f_qp_offset;
         h->mc.mbtree_fix8_unpack( dst, rc->mbtree.qp_buffer[rc->mbtree.qpbuf_pos], rc->mbtree.src_mb_count );
         if( rc->mbtree.rescale_enabled )
-            x264_macroblock_tree_rescale( h, rc, frame->f_qp_offset );
+            macroblock_tree_rescale( h, rc, frame->f_qp_offset );
         if( h->frames.b_have_lowres )
             for( int i = 0; i < h->mb.i_mb_count; i++ )
                 frame->i_inv_qscale_factor[i] = x264_exp2fix8( frame->f_qp_offset[i] );
@@ -618,7 +618,7 @@ int x264_reference_build_list_optimal( x264_t *h )
     return 0;
 }
 
-static char *x264_strcat_filename( char *input, char *suffix )
+static char *strcat_filename( char *input, char *suffix )
 {
     char *output = x264_malloc( strlen( input ) + strlen( suffix ) + 1 );
     if( !output )
@@ -878,7 +878,7 @@ int x264_ratecontrol_new( x264_t *h )
         }
         if( h->param.rc.b_mb_tree )
         {
-            char *mbtree_stats_in = x264_strcat_filename( h->param.rc.psz_stat_in, ".mbtree" );
+            char *mbtree_stats_in = strcat_filename( h->param.rc.psz_stat_in, ".mbtree" );
             if( !mbtree_stats_in )
                 return -1;
             rc->p_mbtree_stat_file_in = x264_fopen( mbtree_stats_in, "rb" );
@@ -1154,7 +1154,7 @@ parse_error:
     if( h->param.rc.b_stat_write )
     {
         char *p;
-        rc->psz_stat_file_tmpname = x264_strcat_filename( h->param.rc.psz_stat_out, ".temp" );
+        rc->psz_stat_file_tmpname = strcat_filename( h->param.rc.psz_stat_out, ".temp" );
         if( !rc->psz_stat_file_tmpname )
             return -1;
 
@@ -1171,8 +1171,8 @@ parse_error:
         x264_free( p );
         if( h->param.rc.b_mb_tree && !h->param.rc.b_stat_read )
         {
-            rc->psz_mbtree_stat_file_tmpname = x264_strcat_filename( h->param.rc.psz_stat_out, ".mbtree.temp" );
-            rc->psz_mbtree_stat_file_name = x264_strcat_filename( h->param.rc.psz_stat_out, ".mbtree" );
+            rc->psz_mbtree_stat_file_tmpname = strcat_filename( h->param.rc.psz_stat_out, ".mbtree.temp" );
+            rc->psz_mbtree_stat_file_name = strcat_filename( h->param.rc.psz_stat_out, ".mbtree" );
             if( !rc->psz_mbtree_stat_file_tmpname || !rc->psz_mbtree_stat_file_name )
                 return -1;
 
@@ -1192,7 +1192,7 @@ parse_error:
             rc->mbtree.srcdim[0] = h->param.i_width;
             rc->mbtree.srcdim[1] = h->param.i_height;
         }
-        if( x264_macroblock_tree_rescale_init( h, rc ) < 0 )
+        if( macroblock_tree_rescale_init( h, rc ) < 0 )
             return -1;
     }
 
@@ -1385,7 +1385,7 @@ void x264_ratecontrol_delete( x264_t *h )
     x264_free( rc->pred_b_from_p );
     x264_free( rc->entry );
     x264_free( rc->entry_out );
-    x264_macroblock_tree_rescale_destroy( rc );
+    macroblock_tree_rescale_destroy( rc );
     if( rc->zones )
     {
         x264_free( rc->zones[0].param );
@@ -2632,7 +2632,7 @@ static float rate_estimate_qscale( x264_t *h )
     }
 }
 
-static void x264_threads_normalize_predictors( x264_t *h )
+static void threads_normalize_predictors( x264_t *h )
 {
     double totalsize = 0;
     for( int i = 0; i < h->param.i_threads; i++ )
@@ -2677,7 +2677,7 @@ void x264_threads_distribute_ratecontrol( x264_t *h )
     }
     if( rc->b_vbv && rc->frame_size_planned )
     {
-        x264_threads_normalize_predictors( h );
+        threads_normalize_predictors( h );
 
         if( rc->single_frame_vbv )
         {
@@ -2688,7 +2688,7 @@ void x264_threads_distribute_ratecontrol( x264_t *h )
                 float max_frame_error = x264_clip3f( 1.0 / (t->i_threadslice_end - t->i_threadslice_start), 0.05, 0.25 );
                 t->rc->slice_size_planned += 2 * max_frame_error * rc->frame_size_planned;
             }
-            x264_threads_normalize_predictors( h );
+            threads_normalize_predictors( h );
         }
 
         for( int i = 0; i < h->param.i_threads; i++ )
index a6865bd389f9794ebed4241c60f9695254e19d45..23cfb2bd3a9033d705e7d255e6c06d302b47b049 100644 (file)
@@ -46,7 +46,7 @@ static uint16_t cabac_size_5ones[128];
 #define bs_write_ue(s,v)   ((s)->i_bits_encoded += bs_size_ue(v))
 #define bs_write_se(s,v)   ((s)->i_bits_encoded += bs_size_se(v))
 #define bs_write_te(s,v,l) ((s)->i_bits_encoded += bs_size_te(v,l))
-#define x264_macroblock_write_cavlc  static x264_macroblock_size_cavlc
+#define x264_macroblock_write_cavlc  static macroblock_size_cavlc
 #include "cavlc.c"
 
 /* CABAC: not exactly the same. x264_cabac_size_decision() keeps track of
@@ -60,7 +60,7 @@ static uint16_t cabac_size_5ones[128];
 #define x264_cabac_encode_terminal(c)     ((c)->f8_bits_encoded += 7)
 #define x264_cabac_encode_bypass(c,v)     ((c)->f8_bits_encoded += 256)
 #define x264_cabac_encode_ue_bypass(c,e,v) ((c)->f8_bits_encoded += (bs_size_ue_big(v+(1<<e)-1)-e)<<8)
-#define x264_macroblock_write_cabac  static x264_macroblock_size_cabac
+#define x264_macroblock_write_cabac  static macroblock_size_cabac
 #include "cabac.c"
 
 #define COPY_CABAC h->mc.memcpy_aligned( &cabac_tmp.f8_bits_encoded, &h->cabac.f8_bits_encoded, \
@@ -151,7 +151,7 @@ static inline int ssd_mb( x264_t *h )
     return ssd_plane(h, PIXEL_16x16, 0, 0, 0) + chroma_ssd;
 }
 
-static int x264_rd_cost_mb( x264_t *h, int i_lambda2 )
+static int rd_cost_mb( x264_t *h, int i_lambda2 )
 {
     int b_transform_bak = h->mb.b_transform_8x8;
     int i_ssd;
@@ -173,12 +173,12 @@ static int x264_rd_cost_mb( x264_t *h, int i_lambda2 )
     {
         x264_cabac_t cabac_tmp;
         COPY_CABAC;
-        x264_macroblock_size_cabac( h, &cabac_tmp );
+        macroblock_size_cabac( h, &cabac_tmp );
         i_bits = ( (uint64_t)cabac_tmp.f8_bits_encoded * i_lambda2 + 32768 ) >> 16;
     }
     else
     {
-        x264_macroblock_size_cavlc( h );
+        macroblock_size_cavlc( h );
         i_bits = ( (uint64_t)h->out.bs.i_bits_encoded * i_lambda2 + 128 ) >> 8;
     }
 
@@ -190,7 +190,7 @@ static int x264_rd_cost_mb( x264_t *h, int i_lambda2 )
 
 /* partition RD functions use 8 bits more precision to avoid large rounding errors at low QPs */
 
-static uint64_t x264_rd_cost_subpart( x264_t *h, int i_lambda2, int i4, int i_pixel )
+static uint64_t rd_cost_subpart( x264_t *h, int i_lambda2, int i4, int i_pixel )
 {
     uint64_t i_ssd, i_bits;
 
@@ -213,11 +213,11 @@ static uint64_t x264_rd_cost_subpart( x264_t *h, int i_lambda2, int i4, int i_pi
     {
         x264_cabac_t cabac_tmp;
         COPY_CABAC;
-        x264_subpartition_size_cabac( h, &cabac_tmp, i4, i_pixel );
+        subpartition_size_cabac( h, &cabac_tmp, i4, i_pixel );
         i_bits = ( (uint64_t)cabac_tmp.f8_bits_encoded * i_lambda2 + 128 ) >> 8;
     }
     else
-        i_bits = x264_subpartition_size_cavlc( h, i4, i_pixel );
+        i_bits = subpartition_size_cavlc( h, i4, i_pixel );
 
     return (i_ssd<<8) + i_bits;
 }
@@ -229,12 +229,12 @@ uint64_t x264_rd_cost_part( x264_t *h, int i_lambda2, int i4, int i_pixel )
 
     if( i_pixel == PIXEL_16x16 )
     {
-        int i_cost = x264_rd_cost_mb( h, i_lambda2 );
+        int i_cost = rd_cost_mb( h, i_lambda2 );
         return i_cost;
     }
 
     if( i_pixel > PIXEL_8x8 )
-        return x264_rd_cost_subpart( h, i_lambda2, i4, i_pixel );
+        return rd_cost_subpart( h, i_lambda2, i4, i_pixel );
 
     h->mb.i_cbp_luma = 0;
 
@@ -256,16 +256,16 @@ uint64_t x264_rd_cost_part( x264_t *h, int i_lambda2, int i4, int i_pixel )
     {
         x264_cabac_t cabac_tmp;
         COPY_CABAC;
-        x264_partition_size_cabac( h, &cabac_tmp, i8, i_pixel );
+        partition_size_cabac( h, &cabac_tmp, i8, i_pixel );
         i_bits = ( (uint64_t)cabac_tmp.f8_bits_encoded * i_lambda2 + 128 ) >> 8;
     }
     else
-        i_bits = (uint64_t)x264_partition_size_cavlc( h, i8, i_pixel ) * i_lambda2;
+        i_bits = (uint64_t)partition_size_cavlc( h, i8, i_pixel ) * i_lambda2;
 
     return (i_ssd<<8) + i_bits;
 }
 
-static uint64_t x264_rd_cost_i8x8( x264_t *h, int i_lambda2, int i8, int i_mode, pixel edge[4][32] )
+static uint64_t rd_cost_i8x8( x264_t *h, int i_lambda2, int i8, int i_mode, pixel edge[4][32] )
 {
     uint64_t i_ssd, i_bits;
     int plane_count = CHROMA444 ? 3 : 1;
@@ -292,16 +292,16 @@ static uint64_t x264_rd_cost_i8x8( x264_t *h, int i_lambda2, int i8, int i_mode,
     {
         x264_cabac_t cabac_tmp;
         COPY_CABAC;
-        x264_partition_i8x8_size_cabac( h, &cabac_tmp, i8, i_mode );
+        partition_i8x8_size_cabac( h, &cabac_tmp, i8, i_mode );
         i_bits = ( (uint64_t)cabac_tmp.f8_bits_encoded * i_lambda2 + 128 ) >> 8;
     }
     else
-        i_bits = (uint64_t)x264_partition_i8x8_size_cavlc( h, i8, i_mode ) * i_lambda2;
+        i_bits = (uint64_t)partition_i8x8_size_cavlc( h, i8, i_mode ) * i_lambda2;
 
     return (i_ssd<<8) + i_bits;
 }
 
-static uint64_t x264_rd_cost_i4x4( x264_t *h, int i_lambda2, int i4, int i_mode )
+static uint64_t rd_cost_i4x4( x264_t *h, int i_lambda2, int i4, int i_mode )
 {
     uint64_t i_ssd, i_bits;
     int plane_count = CHROMA444 ? 3 : 1;
@@ -326,16 +326,16 @@ static uint64_t x264_rd_cost_i4x4( x264_t *h, int i_lambda2, int i4, int i_mode
     {
         x264_cabac_t cabac_tmp;
         COPY_CABAC;
-        x264_partition_i4x4_size_cabac( h, &cabac_tmp, i4, i_mode );
+        partition_i4x4_size_cabac( h, &cabac_tmp, i4, i_mode );
         i_bits = ( (uint64_t)cabac_tmp.f8_bits_encoded * i_lambda2 + 128 ) >> 8;
     }
     else
-        i_bits = (uint64_t)x264_partition_i4x4_size_cavlc( h, i4, i_mode ) * i_lambda2;
+        i_bits = (uint64_t)partition_i4x4_size_cavlc( h, i4, i_mode ) * i_lambda2;
 
     return (i_ssd<<8) + i_bits;
 }
 
-static uint64_t x264_rd_cost_chroma( x264_t *h, int i_lambda2, int i_mode, int b_dct )
+static uint64_t rd_cost_chroma( x264_t *h, int i_lambda2, int i_mode, int b_dct )
 {
     uint64_t i_ssd, i_bits;
 
@@ -352,11 +352,11 @@ static uint64_t x264_rd_cost_chroma( x264_t *h, int i_lambda2, int i_mode, int b
     {
         x264_cabac_t cabac_tmp;
         COPY_CABAC;
-        x264_chroma_size_cabac( h, &cabac_tmp );
+        chroma_size_cabac( h, &cabac_tmp );
         i_bits = ( (uint64_t)cabac_tmp.f8_bits_encoded * i_lambda2 + 128 ) >> 8;
     }
     else
-        i_bits = (uint64_t)x264_chroma_size_cavlc( h ) * i_lambda2;
+        i_bits = (uint64_t)chroma_size_cavlc( h ) * i_lambda2;
 
     return (i_ssd<<8) + i_bits;
 }
@@ -997,7 +997,7 @@ int quant_trellis_cavlc( x264_t *h, dctcoef *dct,
     if( !coef_mask )
         bs_write_vlc( &h->out.bs, x264_coeff0_token[nC] );
     else
-        x264_cavlc_block_residual_internal( h, ctx_block_cat, coefs + b_ac, nC );
+        cavlc_block_residual_internal( h, ctx_block_cat, coefs + b_ac, nC );
     score = (int64_t)h->out.bs.i_bits_encoded * lambda2;
 
     /* QNS loop: pick the change that improves RD the most, apply it, repeat.
@@ -1030,7 +1030,7 @@ int quant_trellis_cavlc( x264_t *h, dctcoef *dct,
             if( !cur_mask )
                 bs_write_vlc( &h->out.bs, x264_coeff0_token[nC] );
             else
-                x264_cavlc_block_residual_internal( h, ctx_block_cat, coefs + b_ac, nC );
+                cavlc_block_residual_internal( h, ctx_block_cat, coefs + b_ac, nC );
             cur_score += (int64_t)h->out.bs.i_bits_encoded * lambda2;
 
             coefs[i] = old_coef;
@@ -1089,8 +1089,8 @@ int x264_quant_luma_dc_trellis( x264_t *h, dctcoef *dct, int i_quant_cat, int i_
         DCT_LUMA_DC, h->mb.i_trellis_lambda2[0][b_intra], 0, 0, 1, 16, idx, 0 );
 }
 
-static const uint8_t x264_zigzag_scan2x2[4] = { 0, 1, 2, 3 };
-static const uint8_t x264_zigzag_scan2x4[8] = { 0, 2, 1, 4, 6, 3, 5, 7 };
+static const uint8_t zigzag_scan2x2[4] = { 0, 1, 2, 3 };
+static const uint8_t zigzag_scan2x4[8] = { 0, 2, 1, 4, 6, 3, 5, 7 };
 
 int x264_quant_chroma_dc_trellis( x264_t *h, dctcoef *dct, int i_qp, int b_intra, int idx )
 {
@@ -1100,12 +1100,12 @@ int x264_quant_chroma_dc_trellis( x264_t *h, dctcoef *dct, int i_qp, int b_intra
 
     if( CHROMA_FORMAT == CHROMA_422 )
     {
-        zigzag = x264_zigzag_scan2x4;
+        zigzag = zigzag_scan2x4;
         num_coefs = 8;
     }
     else
     {
-        zigzag = x264_zigzag_scan2x2;
+        zigzag = zigzag_scan2x2;
         num_coefs = 4;
     }
 
index 7768b7cb6737ee1a6dcf7298fbbce168b78ebf7b..80dc6ece17c6eca5ba2f82afd0d2f49b43e3eb4b 100644 (file)
@@ -67,7 +67,7 @@ void x264_opencl_flush( x264_t *h )
     h->opencl.pl_occupancy = 0;
 }
 
-static void *x264_opencl_alloc_locked( x264_t *h, int bytes )
+static void *opencl_alloc_locked( x264_t *h, int bytes )
 {
     if( h->opencl.pl_occupancy + bytes >= PAGE_LOCKED_BUF_SIZE )
         x264_opencl_flush( h );
@@ -161,7 +161,7 @@ int x264_opencl_lowres_init( x264_t *h, x264_frame_t *fenc, int lambda )
 
     /* Copy image to the GPU, downscale to unpadded 8x8, then continue for all scales */
 
-    char *locked = x264_opencl_alloc_locked( h, luma_length );
+    char *locked = opencl_alloc_locked( h, luma_length );
     memcpy( locked, fenc->plane[0], luma_length );
     OCLCHECK( clEnqueueWriteBuffer, h->opencl.queue,  h->opencl.luma_16x16_image[h->opencl.last_buf], CL_FALSE, 0, luma_length, locked, 0, NULL, NULL );
 
@@ -169,7 +169,7 @@ int x264_opencl_lowres_init( x264_t *h, x264_frame_t *fenc, int lambda )
     if( h->param.rc.i_aq_mode && fenc->i_inv_qscale_factor )
     {
         int size = h->mb.i_mb_count * sizeof(int16_t);
-        locked = x264_opencl_alloc_locked( h, size );
+        locked = opencl_alloc_locked( h, size );
         memcpy( locked, fenc->i_inv_qscale_factor, size );
         OCLCHECK( clEnqueueWriteBuffer, h->opencl.queue, fenc->opencl.inv_qscale_factor, CL_FALSE, 0, size, locked, 0, NULL, NULL );
     }
@@ -250,7 +250,7 @@ int x264_opencl_lowres_init( x264_t *h, x264_frame_t *fenc, int lambda )
         x264_opencl_flush( h );
 
     int size = h->mb.i_mb_count * sizeof(int16_t);
-    locked = x264_opencl_alloc_locked( h, size );
+    locked = opencl_alloc_locked( h, size );
     OCLCHECK( clEnqueueReadBuffer, h->opencl.queue, fenc->opencl.intra_cost, CL_FALSE, 0, size, locked, 0, NULL, NULL );
     h->opencl.copies[h->opencl.num_copies].dest = fenc->lowres_costs[0][0];
     h->opencl.copies[h->opencl.num_copies].src = locked;
@@ -258,7 +258,7 @@ int x264_opencl_lowres_init( x264_t *h, x264_frame_t *fenc, int lambda )
     h->opencl.num_copies++;
 
     size = h->mb.i_mb_height * sizeof(int);
-    locked = x264_opencl_alloc_locked( h, size );
+    locked = opencl_alloc_locked( h, size );
     OCLCHECK( clEnqueueReadBuffer, h->opencl.queue, h->opencl.row_satds[h->opencl.last_buf], CL_FALSE, 0, size, locked, 0, NULL, NULL );
     h->opencl.copies[h->opencl.num_copies].dest = fenc->i_row_satds[0][0];
     h->opencl.copies[h->opencl.num_copies].src = locked;
@@ -266,7 +266,7 @@ int x264_opencl_lowres_init( x264_t *h, x264_frame_t *fenc, int lambda )
     h->opencl.num_copies++;
 
     size = sizeof(int) * 4;
-    locked = x264_opencl_alloc_locked( h, size );
+    locked = opencl_alloc_locked( h, size );
     OCLCHECK( clEnqueueReadBuffer, h->opencl.queue, h->opencl.frame_stats[h->opencl.last_buf], CL_FALSE, 0, size, locked, 0, NULL, NULL );
     h->opencl.copies[h->opencl.num_copies].dest = &fenc->i_cost_est[0][0];
     h->opencl.copies[h->opencl.num_copies].src = locked;
@@ -286,7 +286,7 @@ int x264_opencl_lowres_init( x264_t *h, x264_frame_t *fenc, int lambda )
  * applications will have self-tuning code to try many possible variables and
  * measure the runtime.  Here we simply make an educated guess based on what we
  * know GPUs typically prefer.  */
-static void x264_optimal_launch_dims( x264_t *h, size_t *gdims, size_t *ldims, const cl_kernel kernel, const cl_device_id device )
+static void optimal_launch_dims( x264_t *h, size_t *gdims, size_t *ldims, const cl_kernel kernel, const cl_device_id device )
 {
     x264_opencl_function_t *ocl = h->opencl.ocl;
     size_t max_work_group = 256;    /* reasonable defaults for OpenCL 1.0 devices, below APIs may fail */
@@ -425,7 +425,7 @@ int x264_opencl_motionsearch( x264_t *h, x264_frame_t **frames, int b, int ref,
         if( gdims[0] < 2 || gdims[1] < 2 )
             continue;
         gdims[0] <<= 2;
-        x264_optimal_launch_dims( h, gdims, ldims, h->opencl.hme_kernel, h->opencl.device );
+        optimal_launch_dims( h, gdims, ldims, h->opencl.hme_kernel, h->opencl.device );
 
         mb_per_group = (ldims[0] >> 2) * ldims[1];
         cost_local_size = 4 * mb_per_group * sizeof(int16_t);
@@ -513,7 +513,7 @@ int x264_opencl_motionsearch( x264_t *h, x264_frame_t **frames, int b, int ref,
     if( h->opencl.num_copies >= MAX_FINISH_COPIES - 1 )
         x264_opencl_flush( h );
 
-    char *locked = x264_opencl_alloc_locked( h, mvlen );
+    char *locked = opencl_alloc_locked( h, mvlen );
     h->opencl.copies[h->opencl.num_copies].src = locked;
     h->opencl.copies[h->opencl.num_copies].bytes = mvlen;
 
@@ -560,7 +560,7 @@ int x264_opencl_finalize_cost( x264_t *h, int lambda, x264_frame_t **frames, int
         /* For B frames, use 4 threads per MB for BIDIR checks */
         ldims = ldim_bidir;
         gdims[0] <<= 2;
-        x264_optimal_launch_dims( h, gdims, ldims, h->opencl.mode_select_kernel, h->opencl.device );
+        optimal_launch_dims( h, gdims, ldims, h->opencl.mode_select_kernel, h->opencl.device );
         int mb_per_group = (ldims[0] >> 2) * ldims[1];
         cost_local_size = 4 * mb_per_group * sizeof(int16_t);
         satd_local_size = 16 * mb_per_group * sizeof(uint32_t);
@@ -609,7 +609,7 @@ int x264_opencl_finalize_cost( x264_t *h, int lambda, x264_frame_t **frames, int
         x264_opencl_flush( h );
 
     int size =  h->mb.i_mb_count * sizeof(int16_t);
-    char *locked = x264_opencl_alloc_locked( h, size );
+    char *locked = opencl_alloc_locked( h, size );
     h->opencl.copies[h->opencl.num_copies].src = locked;
     h->opencl.copies[h->opencl.num_copies].dest = fenc->lowres_costs[b - p0][p1 - b];
     h->opencl.copies[h->opencl.num_copies].bytes = size;
@@ -617,7 +617,7 @@ int x264_opencl_finalize_cost( x264_t *h, int lambda, x264_frame_t **frames, int
     h->opencl.num_copies++;
 
     size =  h->mb.i_mb_height * sizeof(int);
-    locked = x264_opencl_alloc_locked( h, size );
+    locked = opencl_alloc_locked( h, size );
     h->opencl.copies[h->opencl.num_copies].src = locked;
     h->opencl.copies[h->opencl.num_copies].dest = fenc->i_row_satds[b - p0][p1 - b];
     h->opencl.copies[h->opencl.num_copies].bytes = size;
@@ -625,7 +625,7 @@ int x264_opencl_finalize_cost( x264_t *h, int lambda, x264_frame_t **frames, int
     h->opencl.num_copies++;
 
     size =  4 * sizeof(int);
-    locked = x264_opencl_alloc_locked( h, size );
+    locked = opencl_alloc_locked( h, size );
     OCLCHECK( clEnqueueReadBuffer, h->opencl.queue, h->opencl.frame_stats[h->opencl.last_buf], CL_FALSE, 0, size, locked, 0, NULL, NULL );
     h->opencl.last_buf = !h->opencl.last_buf;
 
index 6c0aaa8cc333147c94e751274af1f267b105b69c..0301f09600556e9e1c5dc278fc233911651b8a39 100644 (file)
@@ -32,7 +32,7 @@
 // Indexed by pic_struct values
 static const uint8_t delta_tfi_divisor[10] = { 0, 2, 1, 1, 2, 2, 3, 3, 4, 6 };
 
-static int x264_slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a,
+static int slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a,
                                       x264_frame_t **frames, int p0, int p1, int b );
 
 void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int b_lookahead );
@@ -47,11 +47,11 @@ void x264_opencl_slicetype_prep( x264_t *h, x264_frame_t **frames, int num_frame
 void x264_opencl_slicetype_end( x264_t *h );
 #endif
 
-static void x264_lowres_context_init( x264_t *h, x264_mb_analysis_t *a )
+static void lowres_context_init( x264_t *h, x264_mb_analysis_t *a )
 {
     a->i_qp = X264_LOOKAHEAD_QP;
     a->i_lambda = x264_lambda_tab[ a->i_qp ];
-    x264_mb_analyse_load_costs( h, a );
+    mb_analyse_load_costs( h, a );
     if( h->param.analyse.i_subpel_refine > 1 )
     {
         h->mb.i_me_method = X264_MIN( X264_ME_HEX, h->param.analyse.i_me_method );
@@ -66,7 +66,7 @@ static void x264_lowres_context_init( x264_t *h, x264_mb_analysis_t *a )
 }
 
 /* makes a non-h264 weight (i.e. fix7), into an h264 weight */
-static void x264_weight_get_h264( int weight_nonh264, int offset, x264_weight_t *w )
+static void weight_get_h264( int weight_nonh264, int offset, x264_weight_t *w )
 {
     w->i_offset = offset;
     w->i_denom = 7;
@@ -79,7 +79,7 @@ static void x264_weight_get_h264( int weight_nonh264, int offset, x264_weight_t
     w->i_scale = X264_MIN( w->i_scale, 127 );
 }
 
-static NOINLINE pixel *x264_weight_cost_init_luma( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, pixel *dest )
+static NOINLINE pixel *weight_cost_init_luma( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, pixel *dest )
 {
     int ref0_distance = fenc->i_frame - ref->i_frame - 1;
     /* Note: this will never run during lookahead as weights_analyse is only called if no
@@ -113,7 +113,7 @@ static NOINLINE pixel *x264_weight_cost_init_luma( x264_t *h, x264_frame_t *fenc
  * fenc = ref + offset
  * v = u + stride * chroma height */
 
-static NOINLINE void x264_weight_cost_init_chroma( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, pixel *dstu, pixel *dstv )
+static NOINLINE void weight_cost_init_chroma( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, pixel *dstu, pixel *dstv )
 {
     int ref0_distance = fenc->i_frame - ref->i_frame - 1;
     int i_stride = fenc->i_stride[1];
@@ -145,7 +145,7 @@ static NOINLINE void x264_weight_cost_init_chroma( x264_t *h, x264_frame_t *fenc
     x264_emms();
 }
 
-static NOINLINE pixel *x264_weight_cost_init_chroma444( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, pixel *dst, int p )
+static NOINLINE pixel *weight_cost_init_chroma444( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, pixel *dst, int p )
 {
     int ref0_distance = fenc->i_frame - ref->i_frame - 1;
     int i_stride = fenc->i_stride[p];
@@ -173,7 +173,7 @@ static NOINLINE pixel *x264_weight_cost_init_chroma444( x264_t *h, x264_frame_t
     return ref->plane[p];
 }
 
-static int x264_weight_slice_header_cost( x264_t *h, x264_weight_t *w, int b_chroma )
+static int weight_slice_header_cost( x264_t *h, x264_weight_t *w, int b_chroma )
 {
     /* Add cost of weights in the slice header. */
     int lambda = x264_lambda_tab[X264_LOOKAHEAD_QP];
@@ -194,7 +194,7 @@ static int x264_weight_slice_header_cost( x264_t *h, x264_weight_t *w, int b_chr
     return lambda * numslices * ( 10 + denom_cost + 2 * (bs_size_se( w[0].i_scale ) + bs_size_se( w[0].i_offset )) );
 }
 
-static NOINLINE unsigned int x264_weight_cost_luma( x264_t *h, x264_frame_t *fenc, pixel *src, x264_weight_t *w )
+static NOINLINE unsigned int weight_cost_luma( x264_t *h, x264_frame_t *fenc, pixel *src, x264_weight_t *w )
 {
     unsigned int cost = 0;
     int i_stride = fenc->i_stride_lowres;
@@ -214,7 +214,7 @@ static NOINLINE unsigned int x264_weight_cost_luma( x264_t *h, x264_frame_t *fen
                 int cmp = h->pixf.mbcmp[PIXEL_8x8]( buf, 8, &fenc_plane[pixoff], i_stride );
                 cost += X264_MIN( cmp, fenc->i_intra_cost[i_mb] );
             }
-        cost += x264_weight_slice_header_cost( h, w, 0 );
+        cost += weight_slice_header_cost( h, w, 0 );
     }
     else
         for( int y = 0; y < i_lines; y += 8, pixoff = y*i_stride )
@@ -227,7 +227,7 @@ static NOINLINE unsigned int x264_weight_cost_luma( x264_t *h, x264_frame_t *fen
     return cost;
 }
 
-static NOINLINE unsigned int x264_weight_cost_chroma( x264_t *h, x264_frame_t *fenc, pixel *ref, x264_weight_t *w )
+static NOINLINE unsigned int weight_cost_chroma( x264_t *h, x264_frame_t *fenc, pixel *ref, x264_weight_t *w )
 {
     unsigned int cost = 0;
     int i_stride = fenc->i_stride[1];
@@ -250,7 +250,7 @@ static NOINLINE unsigned int x264_weight_cost_chroma( x264_t *h, x264_frame_t *f
                  * pixels. */
                 cost += h->pixf.asd8( buf, 8, &src[pixoff], i_stride, height );
             }
-        cost += x264_weight_slice_header_cost( h, w, 1 );
+        cost += weight_slice_header_cost( h, w, 1 );
     }
     else
         for( int y = 0; y < i_lines; y += height, pixoff = y*i_stride )
@@ -260,7 +260,7 @@ static NOINLINE unsigned int x264_weight_cost_chroma( x264_t *h, x264_frame_t *f
     return cost;
 }
 
-static NOINLINE unsigned int x264_weight_cost_chroma444( x264_t *h, x264_frame_t *fenc, pixel *ref, x264_weight_t *w, int p )
+static NOINLINE unsigned int weight_cost_chroma444( x264_t *h, x264_frame_t *fenc, pixel *ref, x264_weight_t *w, int p )
 {
     unsigned int cost = 0;
     int i_stride = fenc->i_stride[p];
@@ -277,7 +277,7 @@ static NOINLINE unsigned int x264_weight_cost_chroma444( x264_t *h, x264_frame_t
                 w->weightfn[16>>2]( buf, 16, &ref[pixoff], i_stride, w, 16 );
                 cost += h->pixf.mbcmp[PIXEL_16x16]( buf, 16, &src[pixoff], i_stride );
             }
-        cost += x264_weight_slice_header_cost( h, w, 1 );
+        cost += weight_slice_header_cost( h, w, 1 );
     }
     else
         for( int y = 0; y < i_lines; y += 16, pixoff = y*i_stride )
@@ -347,7 +347,7 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
             }
         }
         else
-            x264_weight_get_h264( round( guess_scale[plane] * 128 ), 0, &weights[plane] );
+            weight_get_h264( round( guess_scale[plane] * 128 ), 0, &weights[plane] );
 
         found = 0;
         mindenom = weights[plane].i_denom;
@@ -360,27 +360,27 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
             if( !fenc->b_intra_calculated )
             {
                 x264_mb_analysis_t a;
-                x264_lowres_context_init( h, &a );
-                x264_slicetype_frame_cost( h, &a, &fenc, 0, 0, 0 );
+                lowres_context_init( h, &a );
+                slicetype_frame_cost( h, &a, &fenc, 0, 0, 0 );
             }
-            mcbuf = x264_weight_cost_init_luma( h, fenc, ref, h->mb.p_weight_buf[0] );
-            origscore = minscore = x264_weight_cost_luma( h, fenc, mcbuf, NULL );
+            mcbuf = weight_cost_init_luma( h, fenc, ref, h->mb.p_weight_buf[0] );
+            origscore = minscore = weight_cost_luma( h, fenc, mcbuf, NULL );
         }
         else
         {
             if( CHROMA444 )
             {
-                mcbuf = x264_weight_cost_init_chroma444( h, fenc, ref, h->mb.p_weight_buf[0], plane );
-                origscore = minscore = x264_weight_cost_chroma444( h, fenc, mcbuf, NULL, plane );
+                mcbuf = weight_cost_init_chroma444( h, fenc, ref, h->mb.p_weight_buf[0], plane );
+                origscore = minscore = weight_cost_chroma444( h, fenc, mcbuf, NULL, plane );
             }
             else
             {
                 pixel *dstu = h->mb.p_weight_buf[0];
                 pixel *dstv = h->mb.p_weight_buf[0]+fenc->i_stride[1]*fenc->i_lines[1];
                 if( !chroma_initted++ )
-                    x264_weight_cost_init_chroma( h, fenc, ref, dstu, dstv );
+                    weight_cost_init_chroma( h, fenc, ref, dstu, dstv );
                 mcbuf = plane == 1 ? dstu : dstv;
-                origscore = minscore = x264_weight_cost_chroma( h, fenc, mcbuf, NULL );
+                origscore = minscore = weight_cost_chroma( h, fenc, mcbuf, NULL );
             }
         }
 
@@ -421,12 +421,12 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
                 if( plane )
                 {
                     if( CHROMA444 )
-                        s = x264_weight_cost_chroma444( h, fenc, mcbuf, &weights[plane], plane );
+                        s = weight_cost_chroma444( h, fenc, mcbuf, &weights[plane], plane );
                     else
-                        s = x264_weight_cost_chroma( h, fenc, mcbuf, &weights[plane] );
+                        s = weight_cost_chroma( h, fenc, mcbuf, &weights[plane] );
                 }
                 else
-                    s = x264_weight_cost_luma( h, fenc, mcbuf, &weights[plane] );
+                    s = weight_cost_luma( h, fenc, mcbuf, &weights[plane] );
                 COPY4_IF_LT( minscore, s, minscale, cur_scale, minoff, i_off, found, 1 );
 
                 // Don't check any more offsets if the previous one had a lower cost than the current one
@@ -508,10 +508,10 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
 #define NUM_ROWS 3
 #define ROW_SATD (NUM_INTS + (h->mb.i_mb_y - h->i_threadslice_start))
 
-static void x264_slicetype_mb_cost( x264_t *h, x264_mb_analysis_t *a,
-                                    x264_frame_t **frames, int p0, int p1, int b,
-                                    int dist_scale_factor, int do_search[2], const x264_weight_t *w,
-                                    int *output_inter, int *output_intra )
+static void slicetype_mb_cost( x264_t *h, x264_mb_analysis_t *a,
+                               x264_frame_t **frames, int p0, int p1, int b,
+                               int dist_scale_factor, int do_search[2], const x264_weight_t *w,
+                               int *output_inter, int *output_intra )
 {
     x264_frame_t *fref0 = frames[p0];
     x264_frame_t *fref1 = frames[p1];
@@ -808,7 +808,7 @@ typedef struct
     int *output_intra;
 } x264_slicetype_slice_t;
 
-static void x264_slicetype_slice_cost( x264_slicetype_slice_t *s )
+static void slicetype_slice_cost( x264_slicetype_slice_t *s )
 {
     x264_t *h = s->h;
 
@@ -826,12 +826,12 @@ static void x264_slicetype_slice_cost( x264_slicetype_slice_t *s )
 
     for( h->mb.i_mb_y = start_y; h->mb.i_mb_y >= end_y; h->mb.i_mb_y-- )
         for( h->mb.i_mb_x = start_x; h->mb.i_mb_x >= end_x; h->mb.i_mb_x-- )
-            x264_slicetype_mb_cost( h, s->a, s->frames, s->p0, s->p1, s->b, s->dist_scale_factor,
-                                    s->do_search, s->w, s->output_inter, s->output_intra );
+            slicetype_mb_cost( h, s->a, s->frames, s->p0, s->p1, s->b, s->dist_scale_factor,
+                               s->do_search, s->w, s->output_inter, s->output_intra );
 }
 
-static int x264_slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a,
-                                      x264_frame_t **frames, int p0, int p1, int b )
+static int slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a,
+                                 x264_frame_t **frames, int p0, int p1, int b )
 {
     int i_score = 0;
     int do_search[2];
@@ -923,7 +923,7 @@ static int x264_slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a,
                     output_inter[i+1] = output_inter[i] + thread_output_size + PAD_SIZE;
                     output_intra[i+1] = output_intra[i] + thread_output_size + PAD_SIZE;
 
-                    x264_threadpool_run( h->lookaheadpool, (void*)x264_slicetype_slice_cost, &s[i] );
+                    x264_threadpool_run( h->lookaheadpool, (void*)slicetype_slice_cost, &s[i] );
                 }
                 for( int i = 0; i < h->param.i_lookahead_threads; i++ )
                     x264_threadpool_wait( h->lookaheadpool, &s[i] );
@@ -937,7 +937,7 @@ static int x264_slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a,
                 output_inter[0][NUM_ROWS] = output_intra[0][NUM_ROWS] = h->mb.i_mb_height;
                 x264_slicetype_slice_t s = (x264_slicetype_slice_t){ h, a, frames, p0, p1, b, dist_scale_factor, do_search, w,
                     output_inter[0], output_intra[0] };
-                x264_slicetype_slice_cost( &s );
+                slicetype_slice_cost( &s );
             }
 
             /* Sum up accumulators */
@@ -993,7 +993,7 @@ static int x264_slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a,
 
 /* If MB-tree changes the quantizers, we need to recalculate the frame cost without
  * re-running lookahead. */
-static int x264_slicetype_frame_cost_recalculate( x264_t *h, x264_frame_t **frames, int p0, int p1, int b )
+static int slicetype_frame_cost_recalculate( x264_t *h, x264_frame_t **frames, int p0, int p1, int b )
 {
     int i_score = 0;
     int *row_satd = frames[b]->i_row_satds[b-p0][p1-b];
@@ -1023,7 +1023,7 @@ static int x264_slicetype_frame_cost_recalculate( x264_t *h, x264_frame_t **fram
 /* Trade off precision in mbtree for increased range */
 #define MBTREE_PRECISION 0.5f
 
-static void x264_macroblock_tree_finish( x264_t *h, x264_frame_t *frame, float average_duration, int ref0_distance )
+static void macroblock_tree_finish( x264_t *h, x264_frame_t *frame, float average_duration, int ref0_distance )
 {
     int fps_factor = round( CLIP_DURATION(average_duration) / CLIP_DURATION(frame->f_duration) * 256 / MBTREE_PRECISION );
     float weightdelta = 0.0;
@@ -1045,7 +1045,7 @@ static void x264_macroblock_tree_finish( x264_t *h, x264_frame_t *frame, float a
     }
 }
 
-static void x264_macroblock_tree_propagate( x264_t *h, x264_frame_t **frames, float average_duration, int p0, int p1, int b, int referenced )
+static void macroblock_tree_propagate( x264_t *h, x264_frame_t **frames, float average_duration, int p0, int p1, int b, int referenced )
 {
     uint16_t *ref_costs[2] = {frames[p0]->i_propagate_cost,frames[p1]->i_propagate_cost};
     int dist_scale_factor = ( ((b-p0) << 8) + ((p1-p0) >> 1) ) / (p1-p0);
@@ -1082,10 +1082,10 @@ static void x264_macroblock_tree_propagate( x264_t *h, x264_frame_t **frames, fl
     }
 
     if( h->param.rc.i_vbv_buffer_size && h->param.rc.i_lookahead && referenced )
-        x264_macroblock_tree_finish( h, frames[b], average_duration, b == p1 ? b - p0 : 0 );
+        macroblock_tree_finish( h, frames[b], average_duration, b == p1 ? b - p0 : 0 );
 }
 
-static void x264_macroblock_tree( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **frames, int num_frames, int b_intra )
+static void macroblock_tree( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **frames, int num_frames, int b_intra )
 {
     int idx = !b_intra;
     int last_nonb, cur_nonb = 1;
@@ -1100,7 +1100,7 @@ static void x264_macroblock_tree( x264_t *h, x264_mb_analysis_t *a, x264_frame_t
     int i = num_frames;
 
     if( b_intra )
-        x264_slicetype_frame_cost( h, a, frames, 0, 0, 0 );
+        slicetype_frame_cost( h, a, frames, 0, 0, 0 );
 
     while( i > 0 && IS_X264_TYPE_B( frames[i]->i_type ) )
         i--;
@@ -1134,13 +1134,13 @@ static void x264_macroblock_tree( x264_t *h, x264_mb_analysis_t *a, x264_frame_t
             cur_nonb--;
         if( cur_nonb < idx )
             break;
-        x264_slicetype_frame_cost( h, a, frames, cur_nonb, last_nonb, last_nonb );
+        slicetype_frame_cost( h, a, frames, cur_nonb, last_nonb, last_nonb );
         memset( frames[cur_nonb]->i_propagate_cost, 0, h->mb.i_mb_count * sizeof(uint16_t) );
         bframes = last_nonb - cur_nonb - 1;
         if( h->param.i_bframe_pyramid && bframes > 1 )
         {
             int middle = (bframes + 1)/2 + cur_nonb;
-            x264_slicetype_frame_cost( h, a, frames, cur_nonb, last_nonb, middle );
+            slicetype_frame_cost( h, a, frames, cur_nonb, last_nonb, middle );
             memset( frames[middle]->i_propagate_cost, 0, h->mb.i_mb_count * sizeof(uint16_t) );
             while( i > cur_nonb )
             {
@@ -1148,52 +1148,52 @@ static void x264_macroblock_tree( x264_t *h, x264_mb_analysis_t *a, x264_frame_t
                 int p1 = i < middle ? middle : last_nonb;
                 if( i != middle )
                 {
-                    x264_slicetype_frame_cost( h, a, frames, p0, p1, i );
-                    x264_macroblock_tree_propagate( h, frames, average_duration, p0, p1, i, 0 );
+                    slicetype_frame_cost( h, a, frames, p0, p1, i );
+                    macroblock_tree_propagate( h, frames, average_duration, p0, p1, i, 0 );
                 }
                 i--;
             }
-            x264_macroblock_tree_propagate( h, frames, average_duration, cur_nonb, last_nonb, middle, 1 );
+            macroblock_tree_propagate( h, frames, average_duration, cur_nonb, last_nonb, middle, 1 );
         }
         else
         {
             while( i > cur_nonb )
             {
-                x264_slicetype_frame_cost( h, a, frames, cur_nonb, last_nonb, i );
-                x264_macroblock_tree_propagate( h, frames, average_duration, cur_nonb, last_nonb, i, 0 );
+                slicetype_frame_cost( h, a, frames, cur_nonb, last_nonb, i );
+                macroblock_tree_propagate( h, frames, average_duration, cur_nonb, last_nonb, i, 0 );
                 i--;
             }
         }
-        x264_macroblock_tree_propagate( h, frames, average_duration, cur_nonb, last_nonb, last_nonb, 1 );
+        macroblock_tree_propagate( h, frames, average_duration, cur_nonb, last_nonb, last_nonb, 1 );
         last_nonb = cur_nonb;
     }
 
     if( !h->param.rc.i_lookahead )
     {
-        x264_slicetype_frame_cost( h, a, frames, 0, last_nonb, last_nonb );
-        x264_macroblock_tree_propagate( h, frames, average_duration, 0, last_nonb, last_nonb, 1 );
+        slicetype_frame_cost( h, a, frames, 0, last_nonb, last_nonb );
+        macroblock_tree_propagate( h, frames, average_duration, 0, last_nonb, last_nonb, 1 );
         XCHG( uint16_t*, frames[last_nonb]->i_propagate_cost, frames[0]->i_propagate_cost );
     }
 
-    x264_macroblock_tree_finish( h, frames[last_nonb], average_duration, last_nonb );
+    macroblock_tree_finish( h, frames[last_nonb], average_duration, last_nonb );
     if( h->param.i_bframe_pyramid && bframes > 1 && !h->param.rc.i_vbv_buffer_size )
-        x264_macroblock_tree_finish( h, frames[last_nonb+(bframes+1)/2], average_duration, 0 );
+        macroblock_tree_finish( h, frames[last_nonb+(bframes+1)/2], average_duration, 0 );
 }
 
-static int x264_vbv_frame_cost( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **frames, int p0, int p1, int b )
+static int vbv_frame_cost( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **frames, int p0, int p1, int b )
 {
-    int cost = x264_slicetype_frame_cost( h, a, frames, p0, p1, b );
+    int cost = slicetype_frame_cost( h, a, frames, p0, p1, b );
     if( h->param.rc.i_aq_mode )
     {
         if( h->param.rc.b_mb_tree )
-            return x264_slicetype_frame_cost_recalculate( h, frames, p0, p1, b );
+            return slicetype_frame_cost_recalculate( h, frames, p0, p1, b );
         else
             return frames[b]->i_cost_est_aq[b-p0][p1-b];
     }
     return cost;
 }
 
-static void x264_calculate_durations( x264_t *h, x264_frame_t *cur_frame, x264_frame_t *prev_frame, int64_t *i_cpb_delay, int64_t *i_coded_fields )
+static void calculate_durations( x264_t *h, x264_frame_t *cur_frame, x264_frame_t *prev_frame, int64_t *i_cpb_delay, int64_t *i_coded_fields )
 {
     cur_frame->i_cpb_delay = *i_cpb_delay;
     cur_frame->i_dpb_output_delay = cur_frame->i_field_cnt - *i_coded_fields;
@@ -1219,7 +1219,7 @@ static void x264_calculate_durations( x264_t *h, x264_frame_t *cur_frame, x264_f
     cur_frame->i_cpb_duration = cur_frame->i_duration;
 }
 
-static void x264_vbv_lookahead( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **frames, int num_frames, int keyframe )
+static void vbv_lookahead( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **frames, int num_frames, int keyframe )
 {
     int last_nonb = 0, cur_nonb = 1, idx = 0;
     x264_frame_t *prev_frame = NULL;
@@ -1240,11 +1240,11 @@ static void x264_vbv_lookahead( x264_t *h, x264_mb_analysis_t *a, x264_frame_t *
         if( next_nonb != cur_nonb )
         {
             int p0 = IS_X264_TYPE_I( frames[cur_nonb]->i_type ) ? cur_nonb : last_nonb;
-            frames[next_nonb]->i_planned_satd[idx] = x264_vbv_frame_cost( h, a, frames, p0, cur_nonb, cur_nonb );
+            frames[next_nonb]->i_planned_satd[idx] = vbv_frame_cost( h, a, frames, p0, cur_nonb, cur_nonb );
             frames[next_nonb]->i_planned_type[idx] = frames[cur_nonb]->i_type;
             frames[cur_nonb]->i_coded_fields_lookahead = h->i_coded_fields_lookahead;
             frames[cur_nonb]->i_cpb_delay_lookahead = h->i_cpb_delay_lookahead;
-            x264_calculate_durations( h, frames[cur_nonb], prev_frame, &h->i_cpb_delay_lookahead, &h->i_coded_fields_lookahead );
+            calculate_durations( h, frames[cur_nonb], prev_frame, &h->i_cpb_delay_lookahead, &h->i_coded_fields_lookahead );
             if( prev_frame )
             {
                 frames[next_nonb]->f_planned_cpb_duration[prev_frame_idx] = (double)prev_frame->i_cpb_duration *
@@ -1259,11 +1259,11 @@ static void x264_vbv_lookahead( x264_t *h, x264_mb_analysis_t *a, x264_frame_t *
         /* Handle the B-frames: coded order */
         for( int i = last_nonb+1; i < cur_nonb; i++, idx++ )
         {
-            frames[next_nonb]->i_planned_satd[idx] = x264_vbv_frame_cost( h, a, frames, last_nonb, cur_nonb, i );
+            frames[next_nonb]->i_planned_satd[idx] = vbv_frame_cost( h, a, frames, last_nonb, cur_nonb, i );
             frames[next_nonb]->i_planned_type[idx] = X264_TYPE_B;
             frames[i]->i_coded_fields_lookahead = h->i_coded_fields_lookahead;
             frames[i]->i_cpb_delay_lookahead = h->i_cpb_delay_lookahead;
-            x264_calculate_durations( h, frames[i], prev_frame, &h->i_cpb_delay_lookahead, &h->i_coded_fields_lookahead );
+            calculate_durations( h, frames[i], prev_frame, &h->i_cpb_delay_lookahead, &h->i_coded_fields_lookahead );
             if( prev_frame )
             {
                 frames[next_nonb]->f_planned_cpb_duration[prev_frame_idx] = (double)prev_frame->i_cpb_duration *
@@ -1282,7 +1282,7 @@ static void x264_vbv_lookahead( x264_t *h, x264_mb_analysis_t *a, x264_frame_t *
     frames[next_nonb]->i_planned_type[idx] = X264_TYPE_AUTO;
 }
 
-static int x264_slicetype_path_cost( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **frames, char *path, int threshold )
+static int slicetype_path_cost( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **frames, char *path, int threshold )
 {
     int loc = 1;
     int cost = 0;
@@ -1297,9 +1297,9 @@ static int x264_slicetype_path_cost( x264_t *h, x264_mb_analysis_t *a, x264_fram
 
         /* Add the cost of the non-B-frame found above */
         if( path[next_nonb] == 'P' )
-            cost += x264_slicetype_frame_cost( h, a, frames, cur_nonb, next_nonb, next_nonb );
+            cost += slicetype_frame_cost( h, a, frames, cur_nonb, next_nonb, next_nonb );
         else /* I-frame */
-            cost += x264_slicetype_frame_cost( h, a, frames, next_nonb, next_nonb, next_nonb );
+            cost += slicetype_frame_cost( h, a, frames, next_nonb, next_nonb, next_nonb );
         /* Early terminate if the cost we have found is larger than the best path cost so far */
         if( cost > threshold )
             break;
@@ -1307,15 +1307,15 @@ static int x264_slicetype_path_cost( x264_t *h, x264_mb_analysis_t *a, x264_fram
         if( h->param.i_bframe_pyramid && next_nonb - cur_nonb > 2 )
         {
             int middle = cur_nonb + (next_nonb - cur_nonb)/2;
-            cost += x264_slicetype_frame_cost( h, a, frames, cur_nonb, next_nonb, middle );
+            cost += slicetype_frame_cost( h, a, frames, cur_nonb, next_nonb, middle );
             for( int next_b = loc; next_b < middle && cost < threshold; next_b++ )
-                cost += x264_slicetype_frame_cost( h, a, frames, cur_nonb, middle, next_b );
+                cost += slicetype_frame_cost( h, a, frames, cur_nonb, middle, next_b );
             for( int next_b = middle+1; next_b < next_nonb && cost < threshold; next_b++ )
-                cost += x264_slicetype_frame_cost( h, a, frames, middle, next_nonb, next_b );
+                cost += slicetype_frame_cost( h, a, frames, middle, next_nonb, next_b );
         }
         else
             for( int next_b = loc; next_b < next_nonb && cost < threshold; next_b++ )
-                cost += x264_slicetype_frame_cost( h, a, frames, cur_nonb, next_nonb, next_b );
+                cost += slicetype_frame_cost( h, a, frames, cur_nonb, next_nonb, next_b );
 
         loc = next_nonb + 1;
         cur_nonb = next_nonb;
@@ -1327,7 +1327,7 @@ static int x264_slicetype_path_cost( x264_t *h, x264_mb_analysis_t *a, x264_fram
 /* Uses strings due to the fact that the speed of the control functions is
    negligible compared to the cost of running slicetype_frame_cost, and because
    it makes debugging easier. */
-static void x264_slicetype_path( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **frames, int length, char (*best_paths)[X264_LOOKAHEAD_MAX+1] )
+static void slicetype_path( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **frames, int length, char (*best_paths)[X264_LOOKAHEAD_MAX+1] )
 {
     char paths[2][X264_LOOKAHEAD_MAX+1];
     int num_paths = X264_MIN( h->param.i_bframe+1, length );
@@ -1364,7 +1364,7 @@ static void x264_slicetype_path( x264_t *h, x264_mb_analysis_t *a, x264_frame_t
             if( possible && !best_possible )
                 best_cost = COST_MAX;
             /* Calculate the actual cost of the current path */
-            int cost = x264_slicetype_path_cost( h, a, frames, paths[idx], best_cost );
+            int cost = slicetype_path_cost( h, a, frames, paths[idx], best_cost );
             if( cost < best_cost )
             {
                 best_cost = cost;
@@ -1386,7 +1386,7 @@ static int scenecut_internal( x264_t *h, x264_mb_analysis_t *a, x264_frame_t **f
     if( real_scenecut && h->param.i_frame_packing == 5 && (frame->i_frame&1) )
         return 0;
 
-    x264_slicetype_frame_cost( h, a, frames, p0, p1, p1 );
+    slicetype_frame_cost( h, a, frames, p0, p1, p1 );
 
     int icost = frame->i_cost_est[0][0];
     int pcost = frame->i_cost_est[p1-p0][0];
@@ -1473,7 +1473,7 @@ void x264_slicetype_analyse( x264_t *h, int intra_minigop )
     x264_frame_t *frames[X264_LOOKAHEAD_MAX+3] = { NULL, };
     int num_frames, orig_num_frames, keyint_limit, framecnt;
     int i_max_search = X264_MIN( h->lookahead->next.i_size, X264_LOOKAHEAD_MAX );
-    int vbv_lookahead = h->param.rc.i_vbv_buffer_size && h->param.rc.i_lookahead;
+    int b_vbv_lookahead = h->param.rc.i_vbv_buffer_size && h->param.rc.i_lookahead;
     /* For determinism we should limit the search to the number of frames lookahead has for sure
      * in h->lookahead->next.list buffer, except at the end of stream.
      * For normal calls with (intra_minigop == 0) that is h->lookahead->i_slicetype_length + 1 frames.
@@ -1490,12 +1490,12 @@ void x264_slicetype_analyse( x264_t *h, int intra_minigop )
     for( framecnt = 0; framecnt < i_max_search; framecnt++ )
         frames[framecnt+1] = h->lookahead->next.list[framecnt];
 
-    x264_lowres_context_init( h, &a );
+    lowres_context_init( h, &a );
 
     if( !framecnt )
     {
         if( h->param.rc.b_mb_tree )
-            x264_macroblock_tree( h, &a, frames, 0, keyframe );
+            macroblock_tree( h, &a, frames, 0, keyframe );
         return;
     }
 
@@ -1506,7 +1506,7 @@ void x264_slicetype_analyse( x264_t *h, int intra_minigop )
      * there will be significant visual artifacts if the frames just before
      * go down in quality due to being referenced less, despite it being
      * more RD-optimal. */
-    if( (h->param.analyse.b_psy && h->param.rc.b_mb_tree) || vbv_lookahead )
+    if( (h->param.analyse.b_psy && h->param.rc.b_mb_tree) || b_vbv_lookahead )
         num_frames = framecnt;
     else if( h->param.b_open_gop && num_frames < framecnt )
         num_frames++;
@@ -1556,7 +1556,7 @@ void x264_slicetype_analyse( x264_t *h, int intra_minigop )
 
                 /* Perform the frametype analysis. */
                 for( int j = 2; j <= num_frames; j++ )
-                    x264_slicetype_path( h, &a, frames, j, best_paths );
+                    slicetype_path( h, &a, frames, j, best_paths );
 
                 /* Load the results of the analysis into the frame types. */
                 for( int j = 1; j < num_frames; j++ )
@@ -1607,9 +1607,9 @@ void x264_slicetype_analyse( x264_t *h, int intra_minigop )
                 int bframes = j - last_nonb - 1;
                 memset( path, 'B', bframes );
                 strcpy( path+bframes, "PP" );
-                int cost_p = x264_slicetype_path_cost( h, &a, frames+last_nonb, path, COST_MAX );
+                int cost_p = slicetype_path_cost( h, &a, frames+last_nonb, path, COST_MAX );
                 strcpy( path+bframes, "BP" );
-                int cost_b = x264_slicetype_path_cost( h, &a, frames+last_nonb, path, cost_p );
+                int cost_b = slicetype_path_cost( h, &a, frames+last_nonb, path, cost_p );
 
                 if( cost_b < cost_p )
                     frames[j]->i_type = X264_TYPE_B;
@@ -1672,7 +1672,7 @@ void x264_slicetype_analyse( x264_t *h, int intra_minigop )
     /* Perform the actual macroblock tree analysis.
      * Don't go farther than the maximum keyframe interval; this helps in short GOPs. */
     if( h->param.rc.b_mb_tree )
-        x264_macroblock_tree( h, &a, frames, X264_MIN(num_frames, h->param.i_keyint_max), keyframe );
+        macroblock_tree( h, &a, frames, X264_MIN(num_frames, h->param.i_keyint_max), keyframe );
 
     /* Enforce keyframe limit. */
     if( !h->param.b_intra_refresh )
@@ -1727,8 +1727,8 @@ void x264_slicetype_analyse( x264_t *h, int intra_minigop )
         }
     }
 
-    if( vbv_lookahead )
-        x264_vbv_lookahead( h, &a, frames, num_frames, keyframe );
+    if( b_vbv_lookahead )
+        vbv_lookahead( h, &a, frames, num_frames, keyframe );
 
     /* Restore frametypes for all frames that haven't actually been decided yet. */
     for( int j = reset_start; j <= num_frames; j++ )
@@ -1899,7 +1899,7 @@ void x264_slicetype_decide( x264_t *h )
         int p0, p1, b;
         p1 = b = bframes + 1;
 
-        x264_lowres_context_init( h, &a );
+        lowres_context_init( h, &a );
 
         frames[0] = h->lookahead->last_nonb;
         memcpy( &frames[1], h->lookahead->next.list, (bframes+1) * sizeof(x264_frame_t*) );
@@ -1908,12 +1908,12 @@ void x264_slicetype_decide( x264_t *h )
         else // P
             p0 = 0;
 
-        x264_slicetype_frame_cost( h, &a, frames, p0, p1, b );
+        slicetype_frame_cost( h, &a, frames, p0, p1, b );
 
         if( (p0 != p1 || bframes) && h->param.rc.i_vbv_buffer_size )
         {
             /* We need the intra costs for row SATDs. */
-            x264_slicetype_frame_cost( h, &a, frames, b, b, b );
+            slicetype_frame_cost( h, &a, frames, b, b, b );
 
             /* We need B-frame costs for row SATDs. */
             p0 = 0;
@@ -1924,7 +1924,7 @@ void x264_slicetype_decide( x264_t *h )
                         p1++;
                 else
                     p1 = bframes + 1;
-                x264_slicetype_frame_cost( h, &a, frames, p0, p1, b );
+                slicetype_frame_cost( h, &a, frames, p0, p1, b );
                 if( frames[b]->i_type == X264_TYPE_BREF )
                     p0 = b;
             }
@@ -1961,12 +1961,12 @@ void x264_slicetype_decide( x264_t *h )
         h->lookahead->next.list[i]->i_coded = i_coded++;
         if( i )
         {
-            x264_calculate_durations( h, h->lookahead->next.list[i], h->lookahead->next.list[i-1], &h->i_cpb_delay, &h->i_coded_fields );
+            calculate_durations( h, h->lookahead->next.list[i], h->lookahead->next.list[i-1], &h->i_cpb_delay, &h->i_coded_fields );
             h->lookahead->next.list[0]->f_planned_cpb_duration[i-1] = (double)h->lookahead->next.list[i]->i_cpb_duration *
                                                                       h->sps->vui.i_num_units_in_tick / h->sps->vui.i_time_scale;
         }
         else
-            x264_calculate_durations( h, h->lookahead->next.list[i], NULL, &h->i_cpb_delay, &h->i_coded_fields );
+            calculate_durations( h, h->lookahead->next.list[i], NULL, &h->i_cpb_delay, &h->i_coded_fields );
     }
 }
 
@@ -1994,9 +1994,9 @@ int x264_rc_analyse_slice( x264_t *h )
 
     if( h->param.rc.b_mb_tree && !h->param.rc.b_stat_read )
     {
-        cost = x264_slicetype_frame_cost_recalculate( h, frames, p0, p1, b );
+        cost = slicetype_frame_cost_recalculate( h, frames, p0, p1, b );
         if( b && h->param.rc.i_vbv_buffer_size )
-            x264_slicetype_frame_cost_recalculate( h, frames, b, b, b );
+            slicetype_frame_cost_recalculate( h, frames, b, b, b );
     }
     /* In AQ, use the weighted score instead. */
     else if( h->param.rc.i_aq_mode )
index 0d6bd8cd7cfa63a144585e279f6f9c8363e6c264..51e776910f277ad038f3f3d0322428b434723e91 100644 (file)
@@ -362,7 +362,7 @@ static int handle_opts( const char * const *optlist, char **opts, video_info_t *
     return 0;
 }
 
-static int x264_init_sws_context( resizer_hnd_t *h )
+static int init_sws_context( resizer_hnd_t *h )
 {
     if( h->ctx )
         sws_freeContext( h->ctx );
@@ -405,7 +405,7 @@ static int check_resizer( resizer_hnd_t *h, cli_pic_t *in )
             return -1;
         h->buffer_allocated = 1;
     }
-    FAIL_IF_ERROR( x264_init_sws_context( h ), "swscale init failed\n" );
+    FAIL_IF_ERROR( init_sws_context( h ), "swscale init failed\n" );
     return 0;
 }
 
index 8169ca787fb009aafd694ee244ad5b5d2be8c7bc..fb43e4108375f82184300ee8b5f0cae0d8a482e8 100644 (file)
@@ -123,7 +123,7 @@ typedef struct
 } avs_hnd_t;
 
 /* load the library and functions we require from it */
-static int x264_avs_load_library( avs_hnd_t *h )
+static int custom_avs_load_library( avs_hnd_t *h )
 {
     h->library = avs_open();
     if( !h->library )
@@ -259,7 +259,7 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c
     avs_hnd_t *h = calloc( 1, sizeof(avs_hnd_t) );
     if( !h )
         return -1;
-    FAIL_IF_ERROR( x264_avs_load_library( h ), "failed to load avisynth\n" );
+    FAIL_IF_ERROR( custom_avs_load_library( h ), "failed to load avisynth\n" );
     h->env = h->func.avs_create_script_environment( AVS_INTERFACE_25 );
     if( h->func.avs_get_error )
     {
index 335f60115e9462f670d0ca4c50a34a476d340460..546ebd0c0a763ae3f9a9f58ab4ea71daea0e22c0 100644 (file)
@@ -86,7 +86,7 @@ uint64_t x264_cli_pic_size( int csp, int width, int height )
     return size;
 }
 
-static int x264_cli_pic_init_internal( cli_pic_t *pic, int csp, int width, int height, int align, int alloc )
+static int cli_pic_init_internal( cli_pic_t *pic, int csp, int width, int height, int align, int alloc )
 {
     memset( pic, 0, sizeof(cli_pic_t) );
     int csp_mask = csp & X264_CSP_MASK;
@@ -118,17 +118,17 @@ static int x264_cli_pic_init_internal( cli_pic_t *pic, int csp, int width, int h
 
 int x264_cli_pic_alloc( cli_pic_t *pic, int csp, int width, int height )
 {
-    return x264_cli_pic_init_internal( pic, csp, width, height, 1, 1 );
+    return cli_pic_init_internal( pic, csp, width, height, 1, 1 );
 }
 
 int x264_cli_pic_alloc_aligned( cli_pic_t *pic, int csp, int width, int height )
 {
-    return x264_cli_pic_init_internal( pic, csp, width, height, NATIVE_ALIGN, 1 );
+    return cli_pic_init_internal( pic, csp, width, height, NATIVE_ALIGN, 1 );
 }
 
 int x264_cli_pic_init_noalloc( cli_pic_t *pic, int csp, int width, int height )
 {
-    return x264_cli_pic_init_internal( pic, csp, width, height, 1, 0 );
+    return cli_pic_init_internal( pic, csp, width, height, 1, 0 );
 }
 
 void x264_cli_pic_clean( cli_pic_t *pic )
index e25a45cf14c22503904446927c93cb4317472e49..a131b58ca1e9bd790b17890042cb8d72801a66e3 100644 (file)
 #endif
 
 /* buf1, buf2: initialised to random data and shouldn't write into them */
-uint8_t *buf1, *buf2;
+static uint8_t *buf1, *buf2;
 /* buf3, buf4: used to store output */
-uint8_t *buf3, *buf4;
+static uint8_t *buf3, *buf4;
 /* pbuf1, pbuf2: initialised to random pixel data and shouldn't write into them. */
-pixel *pbuf1, *pbuf2;
+static pixel *pbuf1, *pbuf2;
 /* pbuf3, pbuf4: point to buf3, buf4, just for type convenience */
-pixel *pbuf3, *pbuf4;
+static pixel *pbuf3, *pbuf4;
 
-int quiet = 0;
+static int quiet = 0;
 
 #define report( name ) { \
     if( used_asm && !quiet ) \
@@ -75,10 +75,10 @@ typedef struct
     bench_t vers[MAX_CPUS];
 } bench_func_t;
 
-int do_bench = 0;
-int bench_pattern_len = 0;
-const char *bench_pattern = "";
-char func_name[100];
+static int do_bench = 0;
+static int bench_pattern_len = 0;
+static const char *bench_pattern = "";
+static char func_name[100];
 static bench_func_t benchs[MAX_FUNCS];
 
 static const char *pixel_names[12] = { "16x16", "16x8", "8x16", "8x8", "8x4", "4x8", "4x4", "4x16", "4x2", "2x8", "2x4", "2x2" };