shithub: libvpx

Download patch

ref: 25c127f5f006f9f3ae2df10819ee4499ee763155
parent: b6f02c85926b928f29b428e620b1c1ec70dd9d42
author: Paul Wilkins <paulwilkins@google.com>
date: Tue Feb 28 12:15:31 EST 2012

Experimental branch code clean up.

Removal of some further code relating to partitions
and error resilience.

Spelling correction.

Change-Id: I36067aae67a4a23bec359541dda3400b0bbf26d0

--- a/vp8/common/onyxc_int.h
+++ b/vp8/common/onyxc_int.h
@@ -40,8 +40,6 @@
 
 #define NUM_YV12_BUFFERS 4
 
-#define MAX_PARTITIONS 9
-
 #define DUAL_PRED_CONTEXTS   2
 
 typedef struct frame_contexts
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -155,7 +155,6 @@
                               unsigned int mb_idx)
 {
     int eobtotal = 0;
-    int throw_residual = 0;
     MB_PREDICTION_MODE mode;
     int i;
 
@@ -263,12 +262,6 @@
     {
         vp8_build_inter_predictors_mb(xd);
     }
-    /* When we have independent partitions we can apply residual even
-     * though other partitions within the frame are corrupt.
-     */
-    throw_residual = (!pbi->independent_partitions &&
-                      pbi->frame_corrupt_residual);
-    throw_residual = (throw_residual || vp8dx_bool_error(xd->current_bc));
 
     /* dequantization and idct */
     if (mode == I8X8_PRED)
@@ -835,7 +828,6 @@
     int mb_row;
     int i, j, k, l;
     int corrupt_tokens = 0;
-    int prev_independent_partitions = pbi->independent_partitions;
 
     /* start with no corruption of current frame */
     xd->corrupted = 0;
@@ -1215,8 +1207,6 @@
     }
 
     {
-        pbi->independent_partitions = 1;
-
         if(vp8_read_bit(bc))
         {
         /* read coef probability tree */
@@ -1232,8 +1222,6 @@
                             *p = (vp8_prob)vp8_read_literal(bc, 8);
 
                         }
-                        if (k > 0 && *p != pc->fc.coef_probs[i][j][k-1][l])
-                            pbi->independent_partitions = 0;
                     }
         }
     }
@@ -1289,8 +1277,6 @@
 
     // Resset the macroblock mode info context to the start of the list
     xd->mode_info_context = pc->mi;
-
-    pbi->frame_corrupt_residual = 0;
 
 #if CONFIG_SUPERBLOCKS
     /* Decode a row of super-blocks */
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -161,13 +161,6 @@
 
     pbi->decoded_key_frame = 0;
 
-
-    /* Independent partitions is activated when a frame updates the
-     * token probability table to have equal probabilities over the
-     * PREV_COEF context.
-     */
-    pbi->independent_partitions = 0;
-
     return (VP8D_PTR) pbi;
 }
 
--- a/vp8/decoder/onyxd_int.h
+++ b/vp8/decoder/onyxd_int.h
@@ -82,9 +82,6 @@
 
     const unsigned char *Source;
     unsigned int   source_sz;
-    const unsigned char *partitions[MAX_PARTITIONS];
-    unsigned int   partition_sizes[MAX_PARTITIONS];
-    unsigned int   num_partitions;
 
     vp8_reader *mbc;
     int64_t last_time_stamp;
@@ -101,8 +98,6 @@
     vp8_prob prob_skip_false;
 
     int decoded_key_frame;
-    int independent_partitions;
-    int frame_corrupt_residual;
 
 } VP8D_COMP;
 
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -2468,7 +2468,6 @@
     }
 
     *size = VP8_HEADER_SIZE + extra_bytes_packed + cpi->bc.pos;
-    cpi->partition_sz[0] = *size;
 
     vp8_start_encode(&cpi->bc2, cx_data + bc->pos);
 
@@ -2477,7 +2476,6 @@
     vp8_stop_encode(&cpi->bc2);
 
     *size += cpi->bc2.pos;
-    cpi->partition_sz[1] = cpi->bc2.pos;
 }
 
 #ifdef ENTROPY_STATS
--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -870,13 +870,13 @@
 }
 
 static double calc_correction_factor( double err_per_mb,
-                                      double err_devisor,
+                                      double err_divisor,
                                       double pt_low,
                                       double pt_high,
                                       int Q )
 {
     double power_term;
-    double error_term = err_per_mb / err_devisor;
+    double error_term = err_per_mb / err_divisor;
     double correction_factor;
 
     // Adjustment based on actual quantizer to power term.
@@ -926,7 +926,7 @@
             break;
     }
 }
-#define ERR_DEVISOR   150.0
+#define ERR_DIVISOR   150.0
 static int estimate_max_q(VP8_COMP *cpi,
                           FIRSTPASS_STATS * fpstats,
                           int section_target_bandwitdh,
@@ -1000,7 +1000,7 @@
 
         // Error per MB based correction factor
         err_correction_factor =
-            calc_correction_factor(err_per_mb, ERR_DEVISOR, 0.36, 0.90, Q);
+            calc_correction_factor(err_per_mb, ERR_DIVISOR, 0.36, 0.90, Q);
 
         bits_per_mb_at_this_q =
             vp8_bits_per_mb(INTER_FRAME, Q) + overhead_bits_per_mb;
@@ -1163,7 +1163,7 @@
 
         // Error per MB based correction factor
         err_correction_factor =
-            calc_correction_factor(err_per_mb, ERR_DEVISOR, 0.36, 0.90, Q);
+            calc_correction_factor(err_per_mb, ERR_DIVISOR, 0.36, 0.90, Q);
 
         bits_per_mb_at_this_q =
             (int)( .5 + ( err_correction_factor *
@@ -1237,7 +1237,7 @@
     {
         // Error per MB based correction factor
         err_correction_factor =
-            calc_correction_factor(err_per_mb, ERR_DEVISOR, pow_lowq, pow_highq, Q);
+            calc_correction_factor(err_per_mb, ERR_DIVISOR, pow_lowq, pow_highq, Q);
 
         bits_per_mb_at_this_q =
             (int)(.5 + ( err_correction_factor *
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -525,9 +525,6 @@
     unsigned int active_map_enabled;
 
     TOKENLIST *tplist;
-    unsigned int partition_sz[MAX_PARTITIONS];
-    // end of multithread data
-
 
     fractional_mv_step_fp *find_fractional_mv_step;
     vp8_full_search_fn_t full_search_sad;