Commit 8f2437d3 authored by Vittorio Giovara's avatar Vittorio Giovara Committed by Anton Mitrofanov

Drop the x264 prefix from static functions and variables

parent 4e2ed408
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -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 )
{
......
......@@ -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;
......
......@@ -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];
......
......@@ -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;
......
......@@ -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