summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2014-03-03 06:53:35 -0800
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-03-03 06:53:35 -0800
commit5ee16cc075dea7ed8b36e013adbeca7a84125ee3 (patch)
tree540e95a81675946e86a0ca0484d647e65b489767 /vp9/encoder
parent9f17ff452bd4d27d7a080ffae25291383381cc2c (diff)
parent673621c8ba5550e0cb7926af6f98fe1acef2aa21 (diff)
downloadlibvpx-5ee16cc075dea7ed8b36e013adbeca7a84125ee3.tar
libvpx-5ee16cc075dea7ed8b36e013adbeca7a84125ee3.tar.gz
libvpx-5ee16cc075dea7ed8b36e013adbeca7a84125ee3.tar.bz2
libvpx-5ee16cc075dea7ed8b36e013adbeca7a84125ee3.zip
Merge "vp9_firstpass.c: remove unused functions & params"
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_firstpass.c52
-rw-r--r--vp9/encoder/vp9_firstpass.h1
-rw-r--r--vp9/encoder/vp9_onyx_if.c4
3 files changed, 7 insertions, 50 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 4da559986..8e454e694 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -136,9 +136,8 @@ static int input_stats(struct twopass_rc *p, FIRSTPASS_STATS *fps) {
return 1;
}
-static void output_stats(const VP9_COMP *cpi,
- struct vpx_codec_pkt_list *pktlist,
- FIRSTPASS_STATS *stats) {
+static void output_stats(FIRSTPASS_STATS *stats,
+ struct vpx_codec_pkt_list *pktlist) {
struct vpx_codec_cx_pkt pkt;
pkt.kind = VPX_CODEC_STATS_PKT;
pkt.data.twopass_stats.buf = stats;
@@ -357,7 +356,7 @@ void vp9_init_first_pass(VP9_COMP *cpi) {
}
void vp9_end_first_pass(VP9_COMP *cpi) {
- output_stats(cpi, cpi->output_pkt_list, &cpi->twopass.total_stats);
+ output_stats(&cpi->twopass.total_stats, cpi->output_pkt_list);
}
static vp9_variance_fn_t get_block_variance_fn(BLOCK_SIZE bsize) {
@@ -373,7 +372,7 @@ static vp9_variance_fn_t get_block_variance_fn(BLOCK_SIZE bsize) {
}
}
-static unsigned int zz_motion_search(const VP9_COMP *cpi, const MACROBLOCK *x) {
+static unsigned int zz_motion_search(const MACROBLOCK *x) {
const MACROBLOCKD *const xd = &x->e_mbd;
const uint8_t *const src = x->plane[0].src.buf;
const int src_stride = x->plane[0].src.stride;
@@ -595,7 +594,7 @@ void vp9_first_pass(VP9_COMP *cpi) {
int_mv mv, tmp_mv;
xd->plane[0].pre[0].buf = lst_yv12->y_buffer + recon_yoffset;
- motion_error = zz_motion_search(cpi, x);
+ motion_error = zz_motion_search(x);
// Assume 0,0 motion with no mv overhead.
mv.as_int = tmp_mv.as_int = 0;
@@ -631,7 +630,7 @@ void vp9_first_pass(VP9_COMP *cpi) {
int gf_motion_error;
xd->plane[0].pre[0].buf = gld_yv12->y_buffer + recon_yoffset;
- gf_motion_error = zz_motion_search(cpi, x);
+ gf_motion_error = zz_motion_search(x);
first_pass_motion_search(cpi, x, &zero_mv, &tmp_mv.as_mv,
&gf_motion_error);
@@ -791,7 +790,7 @@ void vp9_first_pass(VP9_COMP *cpi) {
// Don't want to do output stats with a stack variable!
twopass->this_frame_stats = fps;
- output_stats(cpi, cpi->output_pkt_list, &twopass->this_frame_stats);
+ output_stats(&twopass->this_frame_stats, cpi->output_pkt_list);
accumulate_stats(&twopass->total_stats, &fps);
}
@@ -842,40 +841,6 @@ static double bitcost(double prob) {
return -(log(prob) / log(2.0));
}
-static int64_t estimate_modemvcost(VP9_COMP *cpi,
- FIRSTPASS_STATS *fpstats) {
-#if 0
- int mv_cost;
- int mode_cost;
-
- double av_pct_inter = fpstats->pcnt_inter / fpstats->count;
- double av_pct_motion = fpstats->pcnt_motion / fpstats->count;
- double av_intra = (1.0 - av_pct_inter);
-
- double zz_cost;
- double motion_cost;
- double intra_cost;
-
- zz_cost = bitcost(av_pct_inter - av_pct_motion);
- motion_cost = bitcost(av_pct_motion);
- intra_cost = bitcost(av_intra);
-
- // Estimate the number of extra bits per mv overhead for mbs. We shift (<< 9)
- // to match the scaling of number of bits by 512.
- mv_cost = ((int)(fpstats->new_mv_count / fpstats->count) * 8) << 9;
-
- // Produce a crude estimate of the overhead cost from modes. We shift (<< 9)
- // to match the scaling of number of bits by 512.
- mode_cost =
- (int)((((av_pct_inter - av_pct_motion) * zz_cost) +
- (av_pct_motion * motion_cost) +
- (av_intra * intra_cost)) * cpi->common.MBs) << 9;
-
- // TODO(paulwilkins): Fix overhead costs for extended Q range.
-#endif
- return 0;
-}
-
static double calc_correction_factor(double err_per_mb,
double err_divisor,
double pt_low,
@@ -1010,9 +975,6 @@ void vp9_init_second_pass(VP9_COMP *cpi) {
}
}
-void vp9_end_second_pass(VP9_COMP *cpi) {
-}
-
// This function gives an estimate of how badly we believe the prediction
// quality is decaying from frame to frame.
static double get_prediction_decay_rate(const VP9_COMMON *cm,
diff --git a/vp9/encoder/vp9_firstpass.h b/vp9/encoder/vp9_firstpass.h
index 83e337b6d..03c0e20bb 100644
--- a/vp9/encoder/vp9_firstpass.h
+++ b/vp9/encoder/vp9_firstpass.h
@@ -89,7 +89,6 @@ void vp9_end_first_pass(struct VP9_COMP *cpi);
void vp9_init_second_pass(struct VP9_COMP *cpi);
void vp9_rc_get_second_pass_params(struct VP9_COMP *cpi);
-void vp9_end_second_pass(struct VP9_COMP *cpi);
int vp9_twopass_worst_quality(struct VP9_COMP *cpi, FIRSTPASS_STATS *fpstats,
int section_target_bandwitdh);
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index 6777ba0df..09effecf4 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -2021,10 +2021,6 @@ void vp9_remove_compressor(VP9_PTR *ptr) {
return;
if (cpi && (cpi->common.current_video_frame > 0)) {
- if (cpi->pass == 2) {
- vp9_end_second_pass(cpi);
- }
-
#if CONFIG_INTERNAL_STATS
vp9_clear_system_state();