From 5511968f21d79fa529a70dbee314093a3471b375 Mon Sep 17 00:00:00 2001 From: Yaowu Xu <yaowu@google.com> Date: Mon, 17 Mar 2014 14:09:29 -0700 Subject: [PATCH] Removed several unused functions. Change-Id: Ib9e27298c575afc02a98b593bc6ad60762064d9b --- vp9/encoder/vp9_firstpass.c | 15 +-------------- vp9/encoder/vp9_ratectrl.c | 4 ++-- vp9/encoder/vp9_ssim.c | 6 ------ vp9/encoder/vp9_subexp.c | 9 --------- vp9/encoder/vp9_tokenize.c | 7 ------- vp9/encoder/x86/vp9_variance_mmx.c | 1 - vp9/encoder/x86/vp9_variance_sse2.c | 4 ---- 7 files changed, 3 insertions(+), 43 deletions(-) diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 5cd72532d5..cd4e3d6702 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -69,13 +69,6 @@ static int gfboost_qadjust(int qindex) { (1.32 * q) + 79.3); } -static int kfboost_qadjust(int qindex) { - const double q = vp9_convert_qindex_to_q(qindex); - return (int)((0.00000973 * q * q * q) + - (-0.00613 * q * q) + - (1.316 * q) + 121.2); -} - // Resets the first pass file to the given position using a relative seek from // the current position. static void reset_fpf_position(struct twopass_rc *p, @@ -826,12 +819,6 @@ void vp9_first_pass(VP9_COMP *cpi) { ++cm->current_video_frame; } -// Estimate a cost per mb attributable to overheads such as the coding of modes -// and motion vectors. This currently makes simplistic assumptions for testing. -static double bitcost(double prob) { - return -(log(prob) / log(2.0)); -} - static double calc_correction_factor(double err_per_mb, double err_divisor, double pt_low, @@ -2131,7 +2118,7 @@ void vp9_rc_get_first_pass_params(VP9_COMP *cpi) { VP9_COMMON *const cm = &cpi->common; if (!cpi->refresh_alt_ref_frame && (cm->current_video_frame == 0 || - cm->frame_flags & FRAMEFLAGS_KEY)) { + (cm->frame_flags & FRAMEFLAGS_KEY))) { cm->frame_type = KEY_FRAME; } else { cm->frame_type = INTER_FRAME; diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 8430e4b644..f72e1e11a5 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -1272,7 +1272,7 @@ void vp9_rc_get_one_pass_vbr_params(VP9_COMP *cpi) { int target; if (!cpi->refresh_alt_ref_frame && (cm->current_video_frame == 0 || - cm->frame_flags & FRAMEFLAGS_KEY || + (cm->frame_flags & FRAMEFLAGS_KEY) || rc->frames_to_key == 0 || (cpi->oxcf.auto_key && test_for_kf_one_pass(cpi)))) { cm->frame_type = KEY_FRAME; @@ -1378,7 +1378,7 @@ void vp9_rc_get_one_pass_cbr_params(VP9_COMP *cpi) { RATE_CONTROL *const rc = &cpi->rc; int target; if ((cm->current_video_frame == 0 || - cm->frame_flags & FRAMEFLAGS_KEY || + (cm->frame_flags & FRAMEFLAGS_KEY) || rc->frames_to_key == 0 || (cpi->oxcf.auto_key && test_for_kf_one_pass(cpi)))) { cm->frame_type = KEY_FRAME; diff --git a/vp9/encoder/vp9_ssim.c b/vp9/encoder/vp9_ssim.c index a5f18e6313..1435191d02 100644 --- a/vp9/encoder/vp9_ssim.c +++ b/vp9/encoder/vp9_ssim.c @@ -65,12 +65,6 @@ static double similarity(unsigned long sum_s, unsigned long sum_r, return ssim_n * 1.0 / ssim_d; } -static double ssim_16x16(uint8_t *s, int sp, uint8_t *r, int rp) { - unsigned long sum_s = 0, sum_r = 0, sum_sq_s = 0, sum_sq_r = 0, sum_sxr = 0; - vp9_ssim_parms_16x16(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, - &sum_sxr); - return similarity(sum_s, sum_r, sum_sq_s, sum_sq_r, sum_sxr, 256); -} static double ssim_8x8(uint8_t *s, int sp, uint8_t *r, int rp) { unsigned long sum_s = 0, sum_r = 0, sum_sq_s = 0, sum_sq_r = 0, sum_sxr = 0; vp9_ssim_parms_8x8(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, diff --git a/vp9/encoder/vp9_subexp.c b/vp9/encoder/vp9_subexp.c index fd82fa3b2a..9796d64762 100644 --- a/vp9/encoder/vp9_subexp.c +++ b/vp9/encoder/vp9_subexp.c @@ -18,15 +18,6 @@ static int update_bits[255]; -static int split_index(int i, int n, int modulus) { - int max1 = (n - 1 - modulus / 2) / modulus + 1; - if (i % modulus == modulus / 2) - i = i / modulus; - else - i = max1 + i - (i + modulus - modulus / 2) / modulus; - return i; -} - static int recenter_nonneg(int v, int m) { if (v > (m << 1)) return v; diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c index a293dd8812..bb5f1c23bd 100644 --- a/vp9/encoder/vp9_tokenize.c +++ b/vp9/encoder/vp9_tokenize.c @@ -298,13 +298,6 @@ static void is_skippable(int plane, int block, args->skippable[0] &= (!args->x->plane[plane].eobs[block]); } -static int sb_is_skippable(MACROBLOCK *x, BLOCK_SIZE bsize) { - int result = 1; - struct is_skippable_args args = {x, &result}; - vp9_foreach_transformed_block(&x->e_mbd, bsize, is_skippable, &args); - return result; -} - int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { int result = 1; struct is_skippable_args args = {x, &result}; diff --git a/vp9/encoder/x86/vp9_variance_mmx.c b/vp9/encoder/x86/vp9_variance_mmx.c index a3d011401d..c4d17fc0f7 100644 --- a/vp9/encoder/x86/vp9_variance_mmx.c +++ b/vp9/encoder/x86/vp9_variance_mmx.c @@ -13,7 +13,6 @@ #include "vp9/common/vp9_pragmas.h" #include "vpx_ports/mem.h" -extern unsigned int vp9_get_mb_ss_mmx(const int16_t *src_ptr); extern unsigned int vp9_get8x8var_mmx ( const unsigned char *src_ptr, diff --git a/vp9/encoder/x86/vp9_variance_sse2.c b/vp9/encoder/x86/vp9_variance_sse2.c index 79e42c4cd4..9e65694a86 100644 --- a/vp9/encoder/x86/vp9_variance_sse2.c +++ b/vp9/encoder/x86/vp9_variance_sse2.c @@ -24,10 +24,6 @@ extern unsigned int vp9_get4x4var_mmx int *Sum ); -unsigned int vp9_get_mb_ss_sse2 -( - const int16_t *src_ptr -); unsigned int vp9_get16x16var_sse2 ( const unsigned char *src_ptr, -- GitLab