/* cavlc + 8x8 transform stores nnz per 16 coeffs for the purpose of
* entropy coding, but per 64 coeffs for the purpose of deblocking */
-void munge_cavlc_nnz_row( x264_t *h, int mb_y, uint8_t (*buf)[16] )
+static void munge_cavlc_nnz_row( x264_t *h, int mb_y, uint8_t (*buf)[16] )
{
uint32_t (*src)[6] = (uint32_t(*)[6])h->mb.non_zero_count + mb_y * h->sps->i_mb_width;
int8_t *transform = h->mb.mb_transform_size + mb_y * h->sps->i_mb_width;
void x264_deblock_h_luma_intra_mmxext( uint8_t *pix, int stride, int alpha, int beta );
void x264_deblock_v8_luma_intra_mmxext( uint8_t *pix, int stride, int alpha, int beta );
-void x264_deblock_v_luma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
+static void x264_deblock_v_luma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
{
x264_deblock_v8_luma_mmxext( pix, stride, alpha, beta, tc0 );
x264_deblock_v8_luma_mmxext( pix+8, stride, alpha, beta, tc0+2 );
}
-void x264_deblock_v_luma_intra_mmxext( uint8_t *pix, int stride, int alpha, int beta )
+static void x264_deblock_v_luma_intra_mmxext( uint8_t *pix, int stride, int alpha, int beta )
{
x264_deblock_v8_luma_intra_mmxext( pix, stride, alpha, beta );
x264_deblock_v8_luma_intra_mmxext( pix+8, stride, alpha, beta );
#endif
#include <time.h>
+#include "common.h"
#include "osdep.h"
int64_t x264_mdate( void )
}
}
-void x264_denoise_dct( int16_t *dct, uint32_t *sum, uint16_t *offset, int size )
+static void x264_denoise_dct( int16_t *dct, uint32_t *sum, uint16_t *offset, int size )
{
int i;
for( i=1; i<size; i++ )
}
}
-int x264_cqm_parse_jmlist( x264_t *h, const char *buf, const char *name,
+static int x264_cqm_parse_jmlist( x264_t *h, const char *buf, const char *name,
uint8_t *cqm, const uint8_t *jvt, int length )
{
char *p;
#include <string.h>
#include "common/common.h"
+#include "mc.h"
/* NASM functions */
extern void x264_pixel_avg_16x16_sse2( uint8_t *, int, uint8_t *, int );
PIXEL_AVG_WALL(sse2)
#define AVG_WEIGHT(W,H,name) \
-void x264_pixel_avg_weight_ ## W ## x ## H ## _##name( uint8_t *dst, int i_dst, uint8_t *src, int i_src, int i_weight_dst ) \
+static void x264_pixel_avg_weight_ ## W ## x ## H ## _##name( uint8_t *dst, int i_dst, uint8_t *src, int i_src, int i_weight_dst ) \
{ \
x264_pixel_avg_weight_w ## W ## _##name( dst, i_dst, src, i_src, i_weight_dst, H ); \
}
static const int hpel_ref1[16] = {0,0,0,0,2,2,3,2,2,2,3,2,2,2,3,2};
#define MC_LUMA(name,instr1,instr2)\
-void mc_luma_##name( uint8_t *dst, int i_dst_stride,\
+static void mc_luma_##name( uint8_t *dst, int i_dst_stride,\
uint8_t *src[4], int i_src_stride,\
int mvx, int mvy,\
int i_width, int i_height )\
MC_LUMA(cache64_sse2,cache64_sse2,sse2)
#define GET_REF(name)\
-uint8_t *get_ref_##name( uint8_t *dst, int *i_dst_stride,\
+static uint8_t *get_ref_##name( uint8_t *dst, int *i_dst_stride,\
uint8_t *src[4], int i_src_stride,\
int mvx, int mvy,\
int i_width, int i_height )\
void x264_hpel_filter_c_##cpuc( uint8_t *dst, int16_t *buf, int width );\
void x264_hpel_filter_h_##cpuh( uint8_t *dst, uint8_t *src, int width );\
void x264_sfence( void );\
-void x264_hpel_filter_##cpu( uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, uint8_t *src,\
+static void x264_hpel_filter_##cpu( uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, uint8_t *src,\
int stride, int width, int height )\
{\
int16_t *buf;\
void x264_mc_init_mmx( int cpu, x264_mc_functions_t *pf );
-void x264_mc_chroma_mmxext( uint8_t *src, int i_src_stride,
- uint8_t *dst, int i_dst_stride,
- int dx, int dy, int i_width, int i_height );
#endif
* works on all partition sizes except 16x16
* for sub8x8, call once per 8x8 block
*****************************************************************************/
-void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int i_pixel )
+static void x264_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 j;
* works on all partition sizes except 16x16
* for sub8x8, call once per 8x8 block
*****************************************************************************/
-int x264_partition_size_cavlc( x264_t *h, int i8, int i_pixel )
+static int x264_partition_size_cavlc( x264_t *h, int i8, int i_pixel )
{
bs_t s;
const int i_mb_type = h->mb.i_type;
* x264_macroblock_encode_pskip:
* Encode an already marked skip block
*****************************************************************************/
-void x264_macroblock_encode_pskip( x264_t *h )
+static void x264_macroblock_encode_pskip( x264_t *h )
{
const int mvx = x264_clip3( h->mb.cache.mv[0][x264_scan8[0]][0],
h->mb.mv_min[0], h->mb.mv_max[0] );
extern const int x264_lambda2_tab[52];
extern const int x264_lambda_tab[52];
-void x264_rdo_init( );
+void x264_rdo_init( void );
int x264_macroblock_probe_skip( x264_t *h, int b_bidir );
static void update_vbv_plan( x264_t *h );
static double predict_size( predictor_t *p, double q, double var );
static void update_predictor( predictor_t *p, double q, double var, double bits );
-int x264_rc_analyse_slice( x264_t *h );
/* Terminology:
* qp = h.264's quantizer
return var;
}
-void x264_autosense_aq( x264_t *h )
+static void x264_autosense_aq( x264_t *h )
{
double total = 0;
double n = 0;
return 0;
}
-x264_zone_t *get_zone( x264_t *h, int frame_num )
+static x264_zone_t *get_zone( x264_t *h, int frame_num )
{
int i;
for( i = h->rc->i_zones-1; i >= 0; i-- )
x264_autosense_aq(h);
}
-double predict_row_size( x264_t *h, int y, int qp )
+static double predict_row_size( x264_t *h, int y, int qp )
{
/* average between two predictors:
* absolute SATD, and scaled bit cost of the colocated row in the previous frame */
return (pred_s + pred_t) / 2;
}
-double row_bits_so_far( x264_t *h, int y )
+static double row_bits_so_far( x264_t *h, int y )
{
int i;
double bits = 0;
return bits;
}
-double predict_row_size_sum( x264_t *h, int y, int qp )
+static double predict_row_size_sum( x264_t *h, int y, int qp )
{
int i;
double bits = row_bits_so_far(h, y);
void x264_adaptive_quant( x264_t * );
void x264_ratecontrol_set_estimated_size( x264_t *, int bits );
int x264_ratecontrol_get_estimated_size( x264_t const *);
+int x264_rc_analyse_slice( x264_t *h );
#endif
#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 x264_macroblock_size_cavlc
+#define x264_macroblock_write_cavlc static x264_macroblock_size_cavlc
#include "cavlc.c"
/* CABAC: not exactly the same. x264_cabac_size_decision() keeps track of
#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_cabac_encode_flush(h,c)
-#define x264_macroblock_write_cabac x264_macroblock_size_cabac
+#define x264_macroblock_write_cabac static x264_macroblock_size_cabac
#include "cabac.c"
#define COPY_CABAC h->mc.memcpy_aligned( &cabac_tmp.f8_bits_encoded, &h->cabac.f8_bits_encoded, \
return (i_ssd<<8) + i_bits;
}
-uint64_t x264_rd_cost_i8x8( x264_t *h, int i_lambda2, int i8, int i_mode )
+static uint64_t x264_rd_cost_i8x8( x264_t *h, int i_lambda2, int i8, int i_mode )
{
uint64_t i_ssd, i_bits;
return (i_ssd<<8) + i_bits;
}
-uint64_t x264_rd_cost_i4x4( x264_t *h, int i_lambda2, int i4, int i_mode )
+static uint64_t x264_rd_cost_i4x4( x264_t *h, int i_lambda2, int i4, int i_mode )
{
uint64_t i_ssd, i_bits;
return (i_ssd<<8) + i_bits;
}
-uint64_t x264_rd_cost_i8x8_chroma( x264_t *h, int i_lambda2, int i_mode, int b_dct )
+static uint64_t x264_rd_cost_i8x8_chroma( x264_t *h, int i_lambda2, int i_mode, int b_dct )
{
uint64_t i_ssd, i_bits;
#define LAMBDA_BITS 4
/* precalculate the cost of coding abs_level_m1 */
-void x264_rdo_init( )
+void x264_rdo_init( void )
{
int i_prefix;
int i_ctx;
#ifndef _MSC_VER
#include "config.h"
#endif
+#include "set.h"
#define bs_write_ue bs_write_ue_big
h->mb.b_chroma_me = 0;
}
-int x264_slicetype_mb_cost( x264_t *h, x264_mb_analysis_t *a,
+static int 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 )
{
#undef TRY_BIDIR
#undef SAVE_MVS
-int x264_slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a,
+static int x264_slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a,
x264_frame_t **frames, int p0, int p1, int b,
int b_intra_penalty )
{
return res;
}
-void x264_slicetype_analyse( x264_t *h )
+static void x264_slicetype_analyse( x264_t *h )
{
x264_mb_analysis_t a;
x264_frame_t *frames[X264_BFRAME_MAX+3] = { NULL, };
return 0;
}
-int mk_flushFrame(mk_Writer *w) {
+static int mk_flushFrame(mk_Writer *w) {
int64_t delta, ref = 0;
unsigned fsize, bgsize;
unsigned char c_delta_flags[3];
return h->frame_total;
}
-void read_frame_thread_int( thread_input_arg_t *i )
+static void read_frame_thread_int( thread_input_arg_t *i )
{
i->status = i->h->p_read_frame( i->pic, i->h->p_handle, i->i_frame );
}
} mp4_t;
-void recompute_bitrate_mp4(GF_ISOFile *p_file, int i_track)
+static void recompute_bitrate_mp4(GF_ISOFile *p_file, int i_track)
{
u32 i, count, di, timescale, time_wnd, rate;
u64 offset;
char b_writing_frame;
} mkv_t;
-int write_header_mkv( mkv_t *p_mkv )
+static int write_header_mkv( mkv_t *p_mkv )
{
int ret;
uint8_t *avcC;
return &benchs[i].vers[j];
}
-int cmp_nop( const void *a, const void *b )
+static int cmp_nop( const void *a, const void *b )
{
return *(uint16_t*)a - *(uint16_t*)b;
}
-int cmp_bench( const void *a, const void *b )
+static int cmp_bench( const void *a, const void *b )
{
// asciibetical sort except preserving numbers
const char *sa = ((bench_func_t*)a)->name;
return ret;
}
-int check_all_funcs( int cpu_ref, int cpu_new )
+static int check_all_funcs( int cpu_ref, int cpu_new )
{
return check_pixel( cpu_ref, cpu_new )
+ check_dct( cpu_ref, cpu_new )
+ check_cabac( cpu_ref, cpu_new );
}
-int add_flags( int *cpu_ref, int *cpu_new, int flags, const char *name )
+static int add_flags( int *cpu_ref, int *cpu_new, int flags, const char *name )
{
*cpu_ref = *cpu_new;
*cpu_new |= flags;
return check_all_funcs( *cpu_ref, *cpu_new );
}
-int check_all_flags( void )
+static int check_all_flags( void )
{
int ret = 0;
int cpu0 = 0, cpu1 = 0;