Removing unnecessary casts from quantization code.
authorDmitry Kovalev <dkovalev@google.com>
Fri, 28 Feb 2014 19:59:50 +0000 (11:59 -0800)
committerDmitry Kovalev <dkovalev@google.com>
Fri, 28 Feb 2014 19:59:50 +0000 (11:59 -0800)
Change-Id: I64172710654e95a90ee754d14d7104337d28010f

vp9/encoder/vp9_mbgraph.c
vp9/encoder/vp9_onyx_if.c
vp9/encoder/vp9_segmentation.c
vp9/encoder/vp9_segmentation.h
vp9/encoder/vp9_vaq.c

index 44c1f90..a16b6f3 100644 (file)
@@ -374,10 +374,10 @@ static void separate_arf_mbs(VP9_COMP *cpi) {
       cpi->static_mb_pct = 0;
 
     cpi->seg0_cnt = ncnt[0];
-    vp9_enable_segmentation((VP9_PTR)cpi);
+    vp9_enable_segmentation(&cm->seg);
   } else {
     cpi->static_mb_pct = 0;
-    vp9_disable_segmentation((VP9_PTR)cpi);
+    vp9_disable_segmentation(&cm->seg);
   }
 
   // Free localy allocated storage
index 3921ea8..b4107cf 100644 (file)
@@ -263,7 +263,7 @@ static void setup_in_frame_q_adj(VP9_COMP *cpi) {
     // Clear down the complexity map used for rd
     vpx_memset(cpi->complexity_map, 0, cm->mi_rows * cm->mi_cols);
 
-    vp9_enable_segmentation((VP9_PTR)cpi);
+    vp9_enable_segmentation(seg);
     vp9_clearall_segfeatures(seg);
 
     // Select delta coding method
@@ -297,7 +297,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
     cpi->static_mb_pct = 0;
 
     // Disable segmentation
-    vp9_disable_segmentation((VP9_PTR)cpi);
+    vp9_disable_segmentation(seg);
 
     // Clear down the segment features.
     vp9_clearall_segfeatures(seg);
@@ -310,7 +310,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
     cpi->static_mb_pct = 0;
 
     // Disable segmentation and individual segment features by default
-    vp9_disable_segmentation((VP9_PTR)cpi);
+    vp9_disable_segmentation(seg);
     vp9_clearall_segfeatures(seg);
 
     // Scan frames from current to arf frame.
@@ -363,7 +363,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
         // Disable segmentation and clear down features if alt ref
         // is not active for this group
 
-        vp9_disable_segmentation((VP9_PTR)cpi);
+        vp9_disable_segmentation(seg);
 
         vpx_memset(cpi->segmentation_map, 0, cm->mi_rows * cm->mi_cols);
 
@@ -3885,15 +3885,15 @@ int vp9_set_roimap(VP9_PTR comp, unsigned char *map, unsigned int rows,
     return -1;
 
   if (!map) {
-    vp9_disable_segmentation((VP9_PTR)cpi);
+    vp9_disable_segmentation(seg);
     return 0;
   }
 
   // Set the segmentation Map
-  vp9_set_segmentation_map((VP9_PTR)cpi, map);
+  vp9_set_segmentation_map(cpi, map);
 
   // Activate segmentation.
-  vp9_enable_segmentation((VP9_PTR)cpi);
+  vp9_enable_segmentation(seg);
 
   // Set up the quant, LF and breakout threshold segment data
   for (i = 0; i < MAX_SEGMENTS; i++) {
@@ -3917,7 +3917,7 @@ int vp9_set_roimap(VP9_PTR comp, unsigned char *map, unsigned int rows,
 
   // Initialize the feature data structure
   // SEGMENT_DELTADATA    0, SEGMENT_ABSDATA      1
-  vp9_set_segment_data((VP9_PTR)cpi, &feature_data[0][0], SEGMENT_DELTADATA);
+  vp9_set_segment_data(seg, &feature_data[0][0], SEGMENT_DELTADATA);
 
   return 0;
 }
index 509717e..49fd7bb 100644 (file)
 
 
 #include <limits.h>
+
 #include "vpx_mem/vpx_mem.h"
-#include "vp9/encoder/vp9_segmentation.h"
+
 #include "vp9/common/vp9_pred_common.h"
 #include "vp9/common/vp9_tile_common.h"
 
-void vp9_enable_segmentation(VP9_PTR ptr) {
-  VP9_COMP *cpi = (VP9_COMP *)ptr;
-  struct segmentation *const seg =  &cpi->common.seg;
+#include "vp9/encoder/vp9_segmentation.h"
 
+void vp9_enable_segmentation(struct segmentation *seg) {
   seg->enabled = 1;
   seg->update_map = 1;
   seg->update_data = 1;
 }
 
-void vp9_disable_segmentation(VP9_PTR ptr) {
-  VP9_COMP *cpi = (VP9_COMP *)ptr;
-  struct segmentation *const seg =  &cpi->common.seg;
+void vp9_disable_segmentation(struct segmentation *seg) {
   seg->enabled = 0;
 }
 
-void vp9_set_segmentation_map(VP9_PTR ptr,
-                              unsigned char *segmentation_map) {
-  VP9_COMP *cpi = (VP9_COMP *)ptr;
+void vp9_set_segmentation_map(VP9_COMP *cpi, unsigned char *segmentation_map) {
   struct segmentation *const seg = &cpi->common.seg;
 
   // Copy in the new segmentation map
@@ -44,12 +40,9 @@ void vp9_set_segmentation_map(VP9_PTR ptr,
   seg->update_data = 1;
 }
 
-void vp9_set_segment_data(VP9_PTR ptr,
+void vp9_set_segment_data(struct segmentation *seg,
                           signed char *feature_data,
                           unsigned char abs_delta) {
-  VP9_COMP *cpi = (VP9_COMP *)ptr;
-  struct segmentation *const seg = &cpi->common.seg;
-
   seg->abs_delta = abs_delta;
 
   vpx_memcpy(seg->feature_data, feature_data, sizeof(seg->feature_data));
index 8238892..66c51a2 100644 (file)
@@ -19,8 +19,8 @@
 extern "C" {
 #endif
 
-void vp9_enable_segmentation(VP9_PTR ptr);
-void vp9_disable_segmentation(VP9_PTR ptr);
+void vp9_enable_segmentation(struct segmentation *seg);
+void vp9_disable_segmentation(struct segmentation *seg);
 
 void vp9_disable_segfeature(struct segmentation *seg,
                             int segment_id,
@@ -30,7 +30,7 @@ void vp9_clear_segdata(struct segmentation *seg,
                        SEG_LVL_FEATURES feature_id);
 // Valid values for a segment are 0 to 3
 // Segmentation map is arrange as [Rows][Columns]
-void vp9_set_segmentation_map(VP9_PTR ptr, unsigned char *segmentation_map);
+void vp9_set_segmentation_map(VP9_COMP *cpi, unsigned char *segmentation_map);
 
 // The values given for each segment can be either deltas (from the default
 // value chosen for the frame) or absolute values.
@@ -42,7 +42,7 @@ void vp9_set_segmentation_map(VP9_PTR ptr, unsigned char *segmentation_map);
 //
 // abs_delta = SEGMENT_DELTADATA (deltas) abs_delta = SEGMENT_ABSDATA (use
 // the absolute values given).
-void vp9_set_segment_data(VP9_PTR ptr, signed char *feature_data,
+void vp9_set_segment_data(struct segmentation *seg, signed char *feature_data,
                           unsigned char abs_delta);
 
 void vp9_choose_segmap_coding_method(VP9_COMP *cpi);
index 600029b..c71c171 100644 (file)
@@ -83,7 +83,7 @@ void vp9_vaq_frame_setup(VP9_COMP *cpi) {
   if (cm->frame_type == KEY_FRAME ||
       cpi->refresh_alt_ref_frame ||
       (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
-    vp9_enable_segmentation((VP9_PTR)cpi);
+    vp9_enable_segmentation(seg);
     vp9_clearall_segfeatures(seg);
 
     seg->abs_delta = SEGMENT_DELTADATA;