summaryrefslogtreecommitdiff
path: root/vp8/encoder
diff options
context:
space:
mode:
Diffstat (limited to 'vp8/encoder')
-rw-r--r--vp8/encoder/bitstream.c5
-rw-r--r--vp8/encoder/bitstream.h2
-rw-r--r--vp8/encoder/encodeframe.c6
-rw-r--r--vp8/encoder/encodeintra.c2
-rw-r--r--vp8/encoder/encodemb.c1
-rw-r--r--vp8/encoder/firstpass.c14
-rw-r--r--vp8/encoder/modecosts.c3
-rw-r--r--vp8/encoder/onyx_if.c6
-rw-r--r--vp8/encoder/quantize.h1
-rw-r--r--vp8/encoder/ratectrl.c6
-rw-r--r--vp8/encoder/ratectrl.h1
-rw-r--r--vp8/encoder/rdopt.c11
-rw-r--r--vp8/encoder/rdopt.h1
-rw-r--r--vp8/encoder/treewriter.h2
14 files changed, 24 insertions, 37 deletions
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c
index 05734a591..ee805110b 100644
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -22,6 +22,7 @@
#include "vpx/vpx_encoder.h"
#include "vpx_mem/vpx_mem.h"
#include "bitstream.h"
+#include "segmentation.h"
#include "vp8/common/seg_common.h"
#include "vp8/common/pred_common.h"
@@ -1397,7 +1398,9 @@ void build_coeff_contexts(VP8_COMP *cpi)
int k = 0;
do
{
+#ifdef ENTROPY_STATS
int t;
+#endif
#if CONFIG_EXPANDED_COEF_CONTEXT
if (k >=3 && ((i == 0 && j == 1) || (i > 0 && j == 0)))
continue;
@@ -1444,7 +1447,9 @@ void build_coeff_contexts(VP8_COMP *cpi)
/* calc probs and branch cts for this frame only */
//vp8_prob new_p [ENTROPY_NODES];
//unsigned int branch_ct [ENTROPY_NODES] [2];
+#ifdef ENTROPY_STATS
int t = 0; /* token/prob index */
+#endif
#if CONFIG_EXPANDED_COEF_CONTEXT
if (k >=3 && ((i == 0 && j == 1) || (i > 0 && j == 0)))
continue;
diff --git a/vp8/encoder/bitstream.h b/vp8/encoder/bitstream.h
index 39fa642a5..78fb26f66 100644
--- a/vp8/encoder/bitstream.h
+++ b/vp8/encoder/bitstream.h
@@ -23,3 +23,5 @@ void vp8cx_pack_tokens_armv5(vp8_writer *w, const TOKENEXTRA *p, int xcount,
# define pack_tokens(a,b,c) pack_tokens_c(a,b,c)
#endif
#endif
+
+void update_skip_probs(VP8_COMP *cpi);
diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c
index 2dfdd4cbd..a92bdbcda 100644
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -707,7 +707,7 @@ static void encode_sb ( VP8_COMP *cpi,
MACROBLOCKD *xd,
TOKENEXTRA **tp )
{
- int i, j;
+ int i;
int map_index;
int mb_row, mb_col;
int recon_yoffset, recon_uvoffset;
@@ -1301,7 +1301,6 @@ void vp8_encode_frame(VP8_COMP *cpi)
if (cpi->sf.RD)
{
int frame_type, pred_type;
- int redo = 0;
int single_diff, comp_diff, hybrid_diff;
/*
@@ -1608,9 +1607,6 @@ void vp8cx_encode_inter_macroblock
{
VP8_COMMON *cm = &cpi->common;
MACROBLOCKD *const xd = &x->e_mbd;
- int intra_error = 0;
- int rate;
- int distortion;
unsigned char *segment_id = &xd->mode_info_context->mbmi.segment_id;
int seg_ref_active;
unsigned char ref_pred_flag;
diff --git a/vp8/encoder/encodeintra.c b/vp8/encoder/encodeintra.c
index 16c4b35cb..bb7a1aa74 100644
--- a/vp8/encoder/encodeintra.c
+++ b/vp8/encoder/encodeintra.c
@@ -100,8 +100,8 @@ void vp8_encode_intra4x4mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *mb)
{
int i;
- MACROBLOCKD *x = &mb->e_mbd;
#if 0
+ MACROBLOCKD *x = &mb->e_mbd;
// Intra modes requiring top-right MB reconstructed data have been disabled
vp8_intra_prediction_down_copy(x);
#endif
diff --git a/vp8/encoder/encodemb.c b/vp8/encoder/encodemb.c
index 81c69d9f8..345bab007 100644
--- a/vp8/encoder/encodemb.c
+++ b/vp8/encoder/encodemb.c
@@ -1071,7 +1071,6 @@ void vp8_optimize_mby_8x8(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd)
{
int b;
int type;
- int has_2nd_order;
ENTROPY_CONTEXT_PLANES t_above, t_left;
ENTROPY_CONTEXT *ta;
diff --git a/vp8/encoder/firstpass.c b/vp8/encoder/firstpass.c
index dad028757..77076ff5f 100644
--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -65,9 +65,6 @@ extern void vp8_alloc_compressor_data(VP8_COMP *cpi);
#define POW1 (double)cpi->oxcf.two_pass_vbrbias/100.0
#define POW2 (double)cpi->oxcf.two_pass_vbrbias/100.0
-static int vscale_lookup[7] = {0, 1, 1, 2, 2, 3, 3};
-static int hscale_lookup[7] = {0, 0, 1, 1, 2, 2, 3};
-
static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame);
static int select_cq_level( int qindex )
@@ -971,10 +968,7 @@ static int estimate_max_q(VP8_COMP *cpi,
double sr_correction;
double err_per_mb = section_err / num_mbs;
double err_correction_factor;
- double corr_high;
double speed_correction = 1.0;
- double inter_pct = (fpstats->pcnt_inter / fpstats->count);
- double intra_pct = 1.0 - inter_pct;
int overhead_bits_per_mb;
if (section_target_bandwitdh <= 0)
@@ -1106,12 +1100,9 @@ static int estimate_cq( VP8_COMP *cpi,
double err_correction_factor;
double sr_err_diff;
double sr_correction;
- double corr_high;
double speed_correction = 1.0;
double clip_iiratio;
double clip_iifactor;
- double inter_pct = (fpstats->pcnt_inter / fpstats->count);
- double intra_pct = 1.0 - inter_pct;
int overhead_bits_per_mb;
@@ -1288,8 +1279,6 @@ static double get_prediction_decay_rate( VP8_COMP *cpi,
{
double prediction_decay_rate;
double second_ref_decay;
- double motion_decay;
- double motion_pct = next_frame->pcnt_motion;
double mb_sr_err_diff;
// Initial basis is the % mbs inter coded
@@ -1625,7 +1614,6 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
FIRSTPASS_STATS next_frame;
FIRSTPASS_STATS *start_pos;
int i;
- double r;
double boost_score = 0.0;
double old_boost_score = 0.0;
double gf_group_err = 0.0;
@@ -2605,9 +2593,7 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
{
int kf_boost = boost_score;
int allocation_chunks;
- int Counter = cpi->twopass.frames_to_key;
int alt_kf_bits;
- YV12_BUFFER_CONFIG *lst_yv12 = &cpi->common.yv12_fb[cpi->common.lst_fb_idx];
if ( kf_boost < 300 )
{
diff --git a/vp8/encoder/modecosts.c b/vp8/encoder/modecosts.c
index c6198c221..e7d071124 100644
--- a/vp8/encoder/modecosts.c
+++ b/vp8/encoder/modecosts.c
@@ -48,7 +48,6 @@ void vp8_init_mode_costs(VP8_COMP *c)
x->fc.uv_mode_prob[VP8_YMODES-1], vp8_uv_mode_tree);
vp8_cost_tokens(c->mb.intra_uv_mode_cost[0],
x->kf_uv_mode_prob[VP8_YMODES-1], vp8_uv_mode_tree);
- vp8_cost_tokens(c->mb.i8x8_mode_costs,
+ vp8_cost_tokens((int *)c->mb.i8x8_mode_costs,
x->fc.i8x8_mode_prob,vp8_i8x8_mode_tree);
-
}
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 58165bab0..aa46fb073 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -37,6 +37,8 @@
#include "mbgraph.h"
#include "vp8/common/pred_common.h"
#include "vp8/encoder/rdopt.h"
+#include "bitstream.h"
+#include "ratectrl.h"
#if ARCH_ARM
#include "vpx_ports/arm.h"
@@ -2609,7 +2611,6 @@ void write_yuv_frame_to_file(YV12_BUFFER_CONFIG *frame)
// write the frame
int i;
- char filename[255];
FILE *fp = fopen("encode_recon.yuv", "a");
for (i = 0; i < frame->y_height; i++)
@@ -3161,7 +3162,6 @@ static void encode_frame_to_data_rate
if (cm->frame_type != KEY_FRAME)
{
#if CONFIG_ENHANCED_INTERP
- double e = 0; //compute_edge_pixel_proportion(cpi->Source);
/* TODO: Decide this more intelligently */
if (sf->search_best_filter)
{
@@ -4101,8 +4101,6 @@ int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned lon
#endif
VP8_COMP *cpi = (VP8_COMP *) ptr;
VP8_COMMON *cm = &cpi->common;
- struct vpx_usec_timer tsctimer;
- struct vpx_usec_timer ticktimer;
struct vpx_usec_timer cmptimer;
YV12_BUFFER_CONFIG *force_src_buffer = NULL;
diff --git a/vp8/encoder/quantize.h b/vp8/encoder/quantize.h
index 3d11634b5..5cde006bc 100644
--- a/vp8/encoder/quantize.h
+++ b/vp8/encoder/quantize.h
@@ -55,6 +55,7 @@ extern prototype_quantize_block(vp8_quantize_quantb_2x2);
#define vp8_quantize_mb vp8_quantize_mb_c
#endif
extern prototype_quantize_mb(vp8_quantize_mb);
+void vp8_quantize_mb_8x8(MACROBLOCK *x);
#ifndef vp8_quantize_mbuv
#define vp8_quantize_mbuv vp8_quantize_mbuv_c
diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c
index 9243af978..6d510e9d9 100644
--- a/vp8/encoder/ratectrl.c
+++ b/vp8/encoder/ratectrl.c
@@ -22,7 +22,7 @@
#include "vpx_mem/vpx_mem.h"
#include "vp8/common/systemdependent.h"
#include "encodemv.h"
-
+#include "vp8/common/quant_common.h"
#define MIN_BPB_FACTOR 0.005
#define MAX_BPB_FACTOR 50
@@ -96,7 +96,7 @@ static const unsigned int prior_key_frame_weight[KEY_FRAME_CONTEXT] = { 1, 2, 3,
double vp8_convert_qindex_to_q( int qindex )
{
// Convert the index to a real Q value (scaled down to match old Q values)
- return (double)vp8_ac_yquant( qindex, 0 ) / 4.0;
+ return (double)vp8_ac_yquant( qindex ) / 4.0;
}
int vp8_gfboost_qadjust( int qindex )
@@ -328,7 +328,6 @@ static int estimate_bits_at_q(int frame_kind, int Q, int MBs,
static void calc_iframe_target_size(VP8_COMP *cpi)
{
// boost defaults to half second
- int kf_boost;
int target;
// Clear down mmx registers to allow floating point in what follows
@@ -366,7 +365,6 @@ static void calc_gf_params(VP8_COMP *cpi)
static void calc_pframe_target_size(VP8_COMP *cpi)
{
int min_frame_target;
- int Adjustment;
min_frame_target = 0;
diff --git a/vp8/encoder/ratectrl.h b/vp8/encoder/ratectrl.h
index 85d36fd6b..76eff47a0 100644
--- a/vp8/encoder/ratectrl.h
+++ b/vp8/encoder/ratectrl.h
@@ -30,5 +30,6 @@ extern int vp8_pick_frame_size(VP8_COMP *cpi);
extern double vp8_convert_qindex_to_q( int qindex );
extern int vp8_gfboost_qadjust( int qindex );
extern int vp8_bits_per_mb( FRAME_TYPE frame_type, int qindex );
+void vp8_setup_inter_frame(VP8_COMP *cpi);
#endif
diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c
index 0caa4c73d..e8ddd66d5 100644
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -806,7 +806,6 @@ static void macro_block_yrd_8x8( MACROBLOCK *mb,
MACROBLOCKD *const x = &mb->e_mbd;
BLOCK *const mb_y2 = mb->block + 24;
BLOCKD *const x_y2 = x->block + 24;
- short *Y2DCPtr = mb_y2->src_diff;
int d;
ENCODEMB_INVOKE(&rtcd->encodemb, submby)(
@@ -1166,8 +1165,8 @@ static int rd_pick_intra8x8block(
int distortion;
BLOCK *be=x->block + ib;
BLOCKD *b=x->e_mbd.block + ib;
- ENTROPY_CONTEXT ta0, ta1, besta0, besta1;
- ENTROPY_CONTEXT tl0, tl1, bestl0, bestl1;
+ ENTROPY_CONTEXT ta0, ta1, besta0 = 0, besta1 = 0;
+ ENTROPY_CONTEXT tl0, tl1, bestl0 = 0, bestl1 = 0;
/*
@@ -2503,7 +2502,7 @@ void vp8_cal_sad(VP8_COMP *cpi, MACROBLOCKD *xd, MACROBLOCK *x, int recon_yoffse
}
}
-/*static */void rd_update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, int_mv *best_ref_mv)
+void rd_update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, int_mv *best_ref_mv)
{
if (x->e_mbd.mode_info_context->mbmi.mode == SPLITMV)
{
@@ -2792,7 +2791,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
int rate2, distortion2;
int uv_intra_rate, uv_intra_distortion, uv_intra_rate_tokenonly;
int uv_intra_skippable = 0;
- int uv_intra_rate_8x8, uv_intra_distortion_8x8, uv_intra_rate_tokenonly_8x8;
+ int uv_intra_rate_8x8 = 0, uv_intra_distortion_8x8 = 0, uv_intra_rate_tokenonly_8x8 = 0;
int uv_intra_skippable_8x8=0;
int rate_y, UNINITIALIZED_IS_SAFE(rate_uv);
int distortion_uv;
@@ -2804,7 +2803,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
//int intermodecost[MAX_MODES];
MB_PREDICTION_MODE uv_intra_mode;
- MB_PREDICTION_MODE uv_intra_mode_8x8;
+ MB_PREDICTION_MODE uv_intra_mode_8x8 = 0;
int_mv mvp;
int near_sadidx[8] = {0, 1, 2, 3, 4, 5, 6, 7};
diff --git a/vp8/encoder/rdopt.h b/vp8/encoder/rdopt.h
index a7de49824..0a1920a1a 100644
--- a/vp8/encoder/rdopt.h
+++ b/vp8/encoder/rdopt.h
@@ -35,5 +35,6 @@ extern void vp8_mv_pred
extern void vp8_cal_sad(VP8_COMP *cpi, MACROBLOCKD *xd, MACROBLOCK *x, int recon_yoffset, int near_sadidx[]);
extern void vp8_init_me_luts();
extern void vp8_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv);
+void rd_update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, int_mv *best_ref_mv);
#endif
diff --git a/vp8/encoder/treewriter.h b/vp8/encoder/treewriter.h
index 42612a2e5..5fd6138d3 100644
--- a/vp8/encoder/treewriter.h
+++ b/vp8/encoder/treewriter.h
@@ -127,4 +127,6 @@ void vp8_cost_tokens(
int *Costs, const vp8_prob *, vp8_tree
);
+void vp8_cost_tokens_skip(int *c, const vp8_prob *p, vp8_tree t);
+
#endif