From 429dc676b19ff8dbb5864e3c436de1b214e538b0 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Thu, 17 Mar 2011 17:07:59 -0400 Subject: Increase static linkage, remove unused functions A large number of functions were defined with external linkage, even though they were only used from within one file. This patch changes their linkage to static and removes the vp8_ prefix from their names, which should make it more obvious to the reader that the function is contained within the current translation unit. Functions that were not referenced were removed. These symbols were identified by: $ nm -A libvpx.a | sort -k3 | uniq -c -f2 | grep ' [A-Z] ' \ | sort | grep '^ *1 ' Change-Id: I59609f58ab65312012c047036ae1e0634f795779 --- vp8/encoder/onyx_if.c | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) (limited to 'vp8/encoder/onyx_if.c') diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 8965634fe..931c51a66 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -70,7 +70,6 @@ extern void vp8_yv12_copy_src_frame_func_neon(YV12_BUFFER_CONFIG *src_ybc, YV12_ int vp8_estimate_entropy_savings(VP8_COMP *cpi); int vp8_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, const vp8_variance_rtcd_vtable_t *rtcd); -int vp8_calc_low_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, const vp8_variance_rtcd_vtable_t *rtcd); extern void vp8_temporal_filter_prepare_c(VP8_COMP *cpi); @@ -261,7 +260,7 @@ static void setup_features(VP8_COMP *cpi) } -void vp8_dealloc_compressor_data(VP8_COMP *cpi) +static void dealloc_compressor_data(VP8_COMP *cpi) { vpx_free(cpi->tplist); cpi->tplist = NULL; @@ -1453,7 +1452,7 @@ rescale(int val, int num, int denom) } -void vp8_init_config(VP8_PTR ptr, VP8_CONFIG *oxcf) +static void init_config(VP8_PTR ptr, VP8_CONFIG *oxcf) { VP8_COMP *cpi = (VP8_COMP *)(ptr); VP8_COMMON *cm = &cpi->common; @@ -1844,7 +1843,7 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf) vp8_create_common(&cpi->common); vp8_cmachine_specific_config(cpi); - vp8_init_config((VP8_PTR)cpi, oxcf); + init_config((VP8_PTR)cpi, oxcf); memcpy(cpi->base_skip_false_prob, vp8cx_base_skip_false_prob, sizeof(vp8cx_base_skip_false_prob)); cpi->common.current_video_frame = 0; @@ -2345,7 +2344,7 @@ void vp8_remove_compressor(VP8_PTR *ptr) vp8cx_remove_encoder_threads(cpi); #endif - vp8_dealloc_compressor_data(cpi); + dealloc_compressor_data(cpi); vpx_free(cpi->mb.ss); vpx_free(cpi->tok); vpx_free(cpi->cyclic_refresh_map); @@ -4593,18 +4592,8 @@ static void encode_frame_to_data_rate } -int vp8_is_gf_update_needed(VP8_PTR ptr) -{ - VP8_COMP *cpi = (VP8_COMP *) ptr; - int ret_val; - - ret_val = cpi->gf_update_recommended; - cpi->gf_update_recommended = 0; - - return ret_val; -} -void vp8_check_gf_quality(VP8_COMP *cpi) +static void check_gf_quality(VP8_COMP *cpi) { VP8_COMMON *cm = &cpi->common; int gf_active_pct = (100 * cpi->gf_active_count) / (cm->mb_rows * cm->mb_cols); @@ -4853,7 +4842,7 @@ int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned lon if (start_frame < 0) start_frame += cpi->oxcf.lag_in_frames; - besterr = vp8_calc_low_ss_err(&cpi->src_buffer[cpi->last_alt_ref_sei].source_buffer, + besterr = calc_low_ss_err(&cpi->src_buffer[cpi->last_alt_ref_sei].source_buffer, &cpi->src_buffer[start_frame].source_buffer, IF_RTCD(&cpi->rtcd.variance)); for (i = 0; i < 7; i++) @@ -4862,7 +4851,7 @@ int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned lon cpi->oxcf.arnr_strength = i; vp8_temporal_filter_prepare_c(cpi); - thiserr = vp8_calc_low_ss_err(&cpi->alt_ref_buffer.source_buffer, + thiserr = calc_low_ss_err(&cpi->alt_ref_buffer.source_buffer, &cpi->src_buffer[start_frame].source_buffer, IF_RTCD(&cpi->rtcd.variance)); if (10 * thiserr < besterr * 8) @@ -5005,7 +4994,7 @@ int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned lon if (cpi->compressor_speed == 2) { - vp8_check_gf_quality(cpi); + check_gf_quality(cpi); vpx_usec_timer_start(&tsctimer); vpx_usec_timer_start(&ticktimer); } @@ -5384,7 +5373,9 @@ int vp8_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, const return Total; } -int vp8_calc_low_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, const vp8_variance_rtcd_vtable_t *rtcd) + + +static int calc_low_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, const vp8_variance_rtcd_vtable_t *rtcd) { int i, j; int Total = 0; @@ -5412,11 +5403,7 @@ int vp8_calc_low_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, co return Total; } -int vp8_get_speed(VP8_PTR c) -{ - VP8_COMP *cpi = (VP8_COMP *) c; - return cpi->Speed; -} + int vp8_get_quantizer(VP8_PTR c) { VP8_COMP *cpi = (VP8_COMP *) c; -- cgit v1.2.3