]> granicus.if.org Git - libvpx/commitdiff
Adding consts to arguments of vp9_block_error().
authorDmitry Kovalev <dkovalev@google.com>
Fri, 28 Feb 2014 02:17:08 +0000 (18:17 -0800)
committerDmitry Kovalev <dkovalev@google.com>
Fri, 28 Feb 2014 02:17:08 +0000 (18:17 -0800)
Change-Id: Id145da99259866109cfee8b47a1d8f309944b937

vp9/common/vp9_rtcd_defs.sh
vp9/encoder/vp9_rdopt.c

index 4031bda551f0cea66883fae202ecb9a0db1d20de..83ee69b7e8675ee75dfaf5ffffe7193a7f050da9 100644 (file)
@@ -683,7 +683,7 @@ prototype unsigned int vp9_get_mb_ss "const int16_t *"
 specialize vp9_get_mb_ss mmx sse2
 # ENCODEMB INVOKE
 
-prototype int64_t vp9_block_error "int16_t *coeff, int16_t *dqcoeff, intptr_t block_size, int64_t *ssz"
+prototype int64_t vp9_block_error "const int16_t *coeff, const int16_t *dqcoeff, intptr_t block_size, int64_t *ssz"
 specialize vp9_block_error $sse2_x86inc
 
 prototype void vp9_subtract_block "int rows, int cols, int16_t *diff_ptr, ptrdiff_t diff_stride, const uint8_t *src_ptr, ptrdiff_t src_stride, const uint8_t *pred_ptr, ptrdiff_t pred_stride"
index 3a423953ad387c44f908f565e0ce525dd6f76b3e..05a5c876d79e00bb364b357e9fe93935a83bb303 100644 (file)
@@ -525,15 +525,15 @@ static void model_rd_for_sb_y_tx(VP9_COMP *cpi, BLOCK_SIZE bsize,
   *out_dist_sum = dist_sum << 4;
 }
 
-int64_t vp9_block_error_c(int16_t *coeff, int16_t *dqcoeff,
+int64_t vp9_block_error_c(const int16_t *coeff, const int16_t *dqcoeff,
                           intptr_t block_size, int64_t *ssz) {
   int i;
   int64_t error = 0, sqcoeff = 0;
 
   for (i = 0; i < block_size; i++) {
-    int this_diff = coeff[i] - dqcoeff[i];
-    error += (unsigned)this_diff * this_diff;
-    sqcoeff += (unsigned) coeff[i] * coeff[i];
+    const int diff = coeff[i] - dqcoeff[i];
+    error +=  diff * diff;
+    sqcoeff += coeff[i] * coeff[i];
   }
 
   *ssz = sqcoeff;