shithub: libvpx

Download patch

ref: cedd24ec619849994eebc23d02f3141c6a4acefb
parent: 256ee0009395a38df33e88f07bcbe2ef3b783534
parent: 32042af14b4a106d5c38d14db66a004bcf536628
author: Paul Wilkins <paulwilkins@google.com>
date: Tue Jul 23 04:16:12 EDT 2013

Merge "Renaming of segment constants."

--- a/vp9/common/vp9_loopfilter.c
+++ b/vp9/common/vp9_loopfilter.c
@@ -87,7 +87,7 @@
     lf->last_sharpness_level = lf->sharpness_level;
   }
 
-  for (seg = 0; seg < MAX_MB_SEGMENTS; seg++) {
+  for (seg = 0; seg < MAX_SEGMENTS; seg++) {
     int lvl_seg = default_filt_lvl, ref, mode, intra_lvl;
 
     // Set the baseline filter values for each segment
--- a/vp9/common/vp9_loopfilter.h
+++ b/vp9/common/vp9_loopfilter.h
@@ -31,7 +31,7 @@
                   lim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]);
   DECLARE_ALIGNED(SIMD_WIDTH, uint8_t,
                   hev_thr[4][SIMD_WIDTH]);
-  uint8_t lvl[MAX_MB_SEGMENTS][MAX_REF_FRAMES][MAX_MODE_LF_DELTAS];
+  uint8_t lvl[MAX_SEGMENTS][MAX_REF_FRAMES][MAX_MODE_LF_DELTAS];
   uint8_t mode_lf_lut[MB_MODE_COUNT];
 } loop_filter_info_n;
 
--- a/vp9/common/vp9_onyx.h
+++ b/vp9/common/vp9_onyx.h
@@ -22,7 +22,7 @@
 #include "vpx_scale/yv12config.h"
 #include "vp9/common/vp9_ppflags.h"
 
-#define MAX_MB_SEGMENTS 8
+#define MAX_SEGMENTS 8
 
   typedef int *VP9_PTR;
 
@@ -200,9 +200,9 @@
 
   int vp9_set_roimap(VP9_PTR comp, unsigned char *map,
                      unsigned int rows, unsigned int cols,
-                     int delta_q[MAX_MB_SEGMENTS],
-                     int delta_lf[MAX_MB_SEGMENTS],
-                     unsigned int threshold[MAX_MB_SEGMENTS]);
+                     int delta_q[MAX_SEGMENTS],
+                     int delta_lf[MAX_SEGMENTS],
+                     unsigned int threshold[MAX_SEGMENTS]);
 
   int vp9_set_active_map(VP9_PTR comp, unsigned char *map,
                          unsigned int rows, unsigned int cols);
--- a/vp9/common/vp9_pred_common.c
+++ b/vp9/common/vp9_pred_common.c
@@ -445,6 +445,6 @@
       segment_id = MIN(segment_id,
                        segment_ids[mi_offset + y * cm->mi_cols + x]);
 
-  assert(segment_id >= 0 && segment_id < MAX_MB_SEGMENTS);
+  assert(segment_id >= 0 && segment_id < MAX_SEGMENTS);
   return segment_id;
 }
--- a/vp9/common/vp9_seg_common.h
+++ b/vp9/common/vp9_seg_common.h
@@ -16,8 +16,8 @@
 #define SEGMENT_DELTADATA   0
 #define SEGMENT_ABSDATA     1
 
-#define MAX_MB_SEGMENTS     8
-#define MB_SEG_TREE_PROBS   (MAX_MB_SEGMENTS-1)
+#define MAX_SEGMENTS     8
+#define SEG_TREE_PROBS   (MAX_SEGMENTS-1)
 
 #define PREDICTION_PROBS 3
 
@@ -27,7 +27,7 @@
   SEG_LVL_ALT_LF = 1,              // Use alternate loop filter value...
   SEG_LVL_REF_FRAME = 2,           // Optional Segment reference frame
   SEG_LVL_SKIP = 3,                // Optional Segment (0,0) + skip mode
-  SEG_LVL_MAX = 4                  // Number of MB level features supported
+  SEG_LVL_MAX = 4                  // Number of features supported
 } SEG_LVL_FEATURES;
 
 
@@ -38,11 +38,11 @@
   uint8_t abs_delta;
   uint8_t temporal_update;
 
-  vp9_prob tree_probs[MB_SEG_TREE_PROBS];
+  vp9_prob tree_probs[SEG_TREE_PROBS];
   vp9_prob pred_probs[PREDICTION_PROBS];
 
-  int16_t feature_data[MAX_MB_SEGMENTS][SEG_LVL_MAX];
-  unsigned int feature_mask[MAX_MB_SEGMENTS];
+  int16_t feature_data[MAX_SEGMENTS][SEG_LVL_MAX];
+  unsigned int feature_mask[MAX_SEGMENTS];
 };
 
 int vp9_segfeature_active(const struct segmentation *seg,
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -86,7 +86,7 @@
   const int ymis = MIN(cm->mi_rows - mi_row, bh);
   int x, y;
 
-  assert(segment_id >= 0 && segment_id < MAX_MB_SEGMENTS);
+  assert(segment_id >= 0 && segment_id < MAX_SEGMENTS);
 
   for (y = 0; y < ymis; y++)
     for (x = 0; x < xmis; x++)
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -400,7 +400,7 @@
   // Segmentation map update
   seg->update_map = vp9_rb_read_bit(rb);
   if (seg->update_map) {
-    for (i = 0; i < MB_SEG_TREE_PROBS; i++)
+    for (i = 0; i < SEG_TREE_PROBS; i++)
       seg->tree_probs[i] = vp9_rb_read_bit(rb) ? vp9_rb_read_literal(rb, 8)
                                                : MAX_PROB;
 
@@ -422,7 +422,7 @@
 
     vp9_clearall_segfeatures(seg);
 
-    for (i = 0; i < MAX_MB_SEGMENTS; i++) {
+    for (i = 0; i < MAX_SEGMENTS; i++) {
       for (j = 0; j < SEG_LVL_MAX; j++) {
         int data = 0;
         const int feature_enabled = vp9_rb_read_bit(rb);
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -997,7 +997,7 @@
     // Select the coding strategy (temporal or spatial)
     vp9_choose_segmap_coding_method(cpi);
     // Write out probabilities used to decode unpredicted  macro-block segments
-    for (i = 0; i < MB_SEG_TREE_PROBS; i++) {
+    for (i = 0; i < SEG_TREE_PROBS; i++) {
       const int prob = seg->tree_probs[i];
       const int update = prob != MAX_PROB;
       vp9_wb_write_bit(wb, update);
@@ -1023,7 +1023,7 @@
   if (seg->update_data) {
     vp9_wb_write_bit(wb, seg->abs_delta);
 
-    for (i = 0; i < MAX_MB_SEGMENTS; i++) {
+    for (i = 0; i < MAX_SEGMENTS; i++) {
       for (j = 0; j < SEG_LVL_MAX; j++) {
         const int active = vp9_segfeature_active(seg, i, j);
         vp9_wb_write_bit(wb, active);
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -1219,7 +1219,7 @@
   {
     int i;
 
-    for (i = 0; i < MAX_MB_SEGMENTS; i++)
+    for (i = 0; i < MAX_SEGMENTS; i++)
       cpi->segment_encode_breakout[i] = cpi->oxcf.encode_breakout;
   }
 
@@ -3987,11 +3987,11 @@
 }
 
 int vp9_set_roimap(VP9_PTR comp, unsigned char *map, unsigned int rows,
-                   unsigned int cols, int delta_q[MAX_MB_SEGMENTS],
-                   int delta_lf[MAX_MB_SEGMENTS],
-                   unsigned int threshold[MAX_MB_SEGMENTS]) {
+                   unsigned int cols, int delta_q[MAX_SEGMENTS],
+                   int delta_lf[MAX_SEGMENTS],
+                   unsigned int threshold[MAX_SEGMENTS]) {
   VP9_COMP *cpi = (VP9_COMP *) comp;
-  signed char feature_data[SEG_LVL_MAX][MAX_MB_SEGMENTS];
+  signed char feature_data[SEG_LVL_MAX][MAX_SEGMENTS];
   MACROBLOCKD *xd = &cpi->mb.e_mbd;
   int i;
 
@@ -4010,7 +4010,7 @@
   vp9_enable_segmentation((VP9_PTR)cpi);
 
   // Set up the quan, LF and breakout threshold segment data
-  for (i = 0; i < MAX_MB_SEGMENTS; i++) {
+  for (i = 0; i < MAX_SEGMENTS; i++) {
     feature_data[SEG_LVL_ALT_Q][i] = delta_q[i];
     feature_data[SEG_LVL_ALT_LF][i] = delta_lf[i];
     cpi->segment_encode_breakout[i] = threshold[i];
@@ -4017,7 +4017,7 @@
   }
 
   // Enable the loop and quant changes in the feature mask
-  for (i = 0; i < MAX_MB_SEGMENTS; i++) {
+  for (i = 0; i < MAX_SEGMENTS; i++) {
     if (delta_q[i])
       vp9_enable_segfeature(&xd->seg, i, SEG_LVL_ALT_Q);
     else
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -514,7 +514,7 @@
   unsigned char *segmentation_map;
 
   // segment threashold for encode breakout
-  int  segment_encode_breakout[MAX_MB_SEGMENTS];
+  int  segment_encode_breakout[MAX_SEGMENTS];
 
   unsigned char *active_map;
   unsigned int active_map_enabled;
--- a/vp9/encoder/vp9_segmentation.c
+++ b/vp9/encoder/vp9_segmentation.c
@@ -219,11 +219,11 @@
   int i, tile_col, mi_row, mi_col;
 
   int temporal_predictor_count[PREDICTION_PROBS][2];
-  int no_pred_segcounts[MAX_MB_SEGMENTS];
-  int t_unpred_seg_counts[MAX_MB_SEGMENTS];
+  int no_pred_segcounts[MAX_SEGMENTS];
+  int t_unpred_seg_counts[MAX_SEGMENTS];
 
-  vp9_prob no_pred_tree[MB_SEG_TREE_PROBS];
-  vp9_prob t_pred_tree[MB_SEG_TREE_PROBS];
+  vp9_prob no_pred_tree[SEG_TREE_PROBS];
+  vp9_prob t_pred_tree[SEG_TREE_PROBS];
   vp9_prob t_nopred_prob[PREDICTION_PROBS];
 
   const int mis = cm->mode_info_stride;