shithub: libvpx

Download patch

ref: e0a338c428f8d35cddf21d7e5498143f5af6fb2a
parent: 31fd84d80ba058e8c5d400e8f10c6f7420900ab6
author: Christian Duvivier <cduvivier@google.com>
date: Thu Jun 14 14:14:43 EDT 2012

Fix a bunch of warnings.

Change-Id: I883b4f63559c1cf66a25016e946b1b1ae98a20da

--- a/vp8/common/alloccommon.c
+++ b/vp8/common/alloccommon.c
@@ -37,9 +37,6 @@
 }
 static void update_mode_info_in_image( VP8_COMMON *cpi, MODE_INFO *mi )
 {
-    int stride = cpi->mode_info_stride;
-    int rows = cpi->mb_rows;
-    int cols = cpi->mb_cols;
     int i, j;
 
     // For each in image mode_info element set the in image flag to 1
--- a/vp8/common/entropy.c
+++ b/vp8/common/entropy.c
@@ -179,7 +179,6 @@
 
 void vp8_default_coef_probs(VP8_COMMON *pc)
 {
-    int h;
     vpx_memcpy(pc->fc.coef_probs, default_coef_probs,
                    sizeof(default_coef_probs));
 
--- a/vp8/common/idctllm.c
+++ b/vp8/common/idctllm.c
@@ -389,7 +389,7 @@
 
 void vp8_short_ihaar2x2_c(short *input, short *output, int pitch)
 {
-   int i, x;
+   int i;
    short *ip = input; //0,1, 4, 8
    short *op = output;
    for (i = 0; i < 16; i++)
--- a/vp8/common/implicit_segmentation.c
+++ b/vp8/common/implicit_segmentation.c
@@ -11,7 +11,9 @@
 #include "vp8/common/onyxc_int.h"
 
 #define MAX_REGIONS 24000
+#ifndef NULL
 #define NULL 0
+#endif
 
 #define min_mbs_in_region 3
 
--- a/vp8/common/pred_common.c
+++ b/vp8/common/pred_common.c
@@ -9,6 +9,7 @@
  */
 
 #include "vp8/common/pred_common.h"
+#include "vp8/common/seg_common.h"
 
 // TBD prediction functions for various bitstream signals
 
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -1004,10 +1004,10 @@
     MACROBLOCKD *const xd  = & pbi->mb;
     const unsigned char *data = (const unsigned char *)pbi->Source;
     const unsigned char *data_end = data + pbi->source_sz;
-    ptrdiff_t first_partition_length_in_bytes;
+    ptrdiff_t first_partition_length_in_bytes = 0;
 
     int mb_row;
-    int i, j, k, l;
+    int i, j;
     int corrupt_tokens = 0;
 
     /* start with no corruption of current frame */
--- 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 @@
             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 @@
                     /* 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;
--- a/vp8/encoder/bitstream.h
+++ b/vp8/encoder/bitstream.h
@@ -23,3 +23,5 @@
 # define pack_tokens(a,b,c)                  pack_tokens_c(a,b,c)
 #endif
 #endif
+
+void update_skip_probs(VP8_COMP *cpi);
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -707,7 +707,7 @@
                         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 @@
     if (cpi->sf.RD)
     {
         int frame_type, pred_type;
-        int redo = 0;
         int single_diff, comp_diff, hybrid_diff;
 
         /*
@@ -1608,9 +1607,6 @@
 {
     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;
--- a/vp8/encoder/encodeintra.c
+++ b/vp8/encoder/encodeintra.c
@@ -100,8 +100,8 @@
 {
     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
--- a/vp8/encoder/encodemb.c
+++ b/vp8/encoder/encodemb.c
@@ -1071,7 +1071,6 @@
 {
     int b;
     int type;
-    int has_2nd_order;
 
     ENTROPY_CONTEXT_PLANES t_above, t_left;
     ENTROPY_CONTEXT *ta;
--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -65,9 +65,6 @@
 #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 @@
     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 @@
     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 @@
 {
     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 @@
     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 @@
     {
         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 )
         {
--- a/vp8/encoder/modecosts.c
+++ b/vp8/encoder/modecosts.c
@@ -48,7 +48,6 @@
                     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);
-
 }
--- 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 @@
 
     // 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 @@
     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 @@
 #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;
 
--- a/vp8/encoder/quantize.h
+++ b/vp8/encoder/quantize.h
@@ -55,6 +55,7 @@
 #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
--- a/vp8/encoder/ratectrl.c
+++ b/vp8/encoder/ratectrl.c
@@ -22,8 +22,8 @@
 #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 @@
 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 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_pframe_target_size(VP8_COMP *cpi)
 {
     int min_frame_target;
-    int Adjustment;
 
     min_frame_target = 0;
 
--- a/vp8/encoder/ratectrl.h
+++ b/vp8/encoder/ratectrl.h
@@ -30,5 +30,6 @@
 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
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -806,7 +806,6 @@
     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 @@
     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 @@
     }
 }
 
-/*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 @@
     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 @@
     //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};
--- a/vp8/encoder/rdopt.h
+++ b/vp8/encoder/rdopt.h
@@ -35,5 +35,6 @@
 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
--- a/vp8/encoder/treewriter.h
+++ b/vp8/encoder/treewriter.h
@@ -127,4 +127,6 @@
     int *Costs, const vp8_prob *, vp8_tree
 );
 
+void vp8_cost_tokens_skip(int *c, const vp8_prob *p, vp8_tree t);
+
 #endif