shithub: libvpx

Download patch

ref: ea283a6272186022e9948637023775941cee0e5e
parent: 6a457ef794224cf2fa1c1be739f1135e441d1662
author: Alex Converse <[email protected]>
date: Fri Jan 24 09:21:39 EST 2014

Add some consts to vp9_calc_ss_err().

Also change its wrongly named dest parameter to reference.

Change-Id: Ide142dead31c9ccda1f09a48b221284369783fb7

--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -3872,12 +3872,13 @@
   return;
 }
 
-int vp9_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest) {
+int vp9_calc_ss_err(const YV12_BUFFER_CONFIG *source,
+                    const YV12_BUFFER_CONFIG *reference) {
   int i, j;
   int total = 0;
 
-  uint8_t *src = source->y_buffer;
-  uint8_t *dst = dest->y_buffer;
+  const uint8_t *src = source->y_buffer;
+  const uint8_t *ref = reference->y_buffer;
 
   // Loop through the Y plane raw and reconstruction data summing
   // (square differences)
@@ -3884,12 +3885,12 @@
   for (i = 0; i < source->y_height; i += 16) {
     for (j = 0; j < source->y_width; j += 16) {
       unsigned int sse;
-      total += vp9_mse16x16(src + j, source->y_stride, dst + j, dest->y_stride,
-                            &sse);
+      total += vp9_mse16x16(src + j, source->y_stride,
+                            ref + j, reference->y_stride, &sse);
     }
 
     src += 16 * source->y_stride;
-    dst += 16 * dest->y_stride;
+    ref += 16 * reference->y_stride;
   }
 
   return total;
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -811,7 +811,8 @@
 
 void vp9_set_speed_features(VP9_COMP *cpi);
 
-int vp9_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest);
+int vp9_calc_ss_err(const YV12_BUFFER_CONFIG *source,
+                    const YV12_BUFFER_CONFIG *reference);
 
 void vp9_alloc_compressor_data(VP9_COMP *cpi);
 
--- a/vp9/encoder/vp9_picklpf.c
+++ b/vp9/encoder/vp9_picklpf.c
@@ -34,7 +34,7 @@
 void vp9_set_alt_lf_level(VP9_COMP *cpi, int filt_val) {
 }
 
-static void search_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
+static void search_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
                                 int partial) {
   MACROBLOCKD *const xd = &cpi->mb.e_mbd;
   VP9_COMMON *const cm = &cpi->common;
@@ -128,7 +128,8 @@
   lf->filter_level = filt_best;
 }
 
-void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int method) {
+void vp9_pick_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
+                           int method) {
   VP9_COMMON *const cm = &cpi->common;
   struct loopfilter *const lf = &cm->lf;
 
--- a/vp9/encoder/vp9_picklpf.h
+++ b/vp9/encoder/vp9_picklpf.h
@@ -21,7 +21,7 @@
 
 void vp9_set_alt_lf_level(struct VP9_COMP *cpi, int filt_val);
 
-void vp9_pick_filter_level(struct yv12_buffer_config *sd,
+void vp9_pick_filter_level(const struct yv12_buffer_config *sd,
                            struct VP9_COMP *cpi, int method);
 #ifdef __cplusplus
 }  // extern "C"