]> granicus.if.org Git - libvpx/commitdiff
Some fixes to quantization and compiler warnings
authorDeb Mukherjee <debargha@google.com>
Mon, 2 Mar 2015 22:40:13 +0000 (14:40 -0800)
committerDeb Mukherjee <debargha@google.com>
Tue, 3 Mar 2015 22:07:17 +0000 (14:07 -0800)
The bugs affected only the tx64x64 experiment. This patch fixes
them.

Also fixes some compiler warnings

Change-Id: I4cf1e24a4f1fa59831bf29750cf6daa8373e8e8f

vp9/common/vp9_palette.c
vp9/encoder/vp9_denoiser.c
vp9/encoder/vp9_quantize.c
vp9/encoder/vp9_ransac.c

index 9140f755913254d6fd52ad194ba43ee5486c07cf..243aff284a40a5c53b8d95f930c0eedcb6e19e81 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <time.h>
 
 #include "vp9/common/vp9_palette.h"
 
index 36792f46bab2c1f590fce9dc4caf2083d9a2d9ae..8167a1fb08d7a2de4e2907a4d8fe1b1af32a6cca 100644 (file)
@@ -491,7 +491,8 @@ void vp9_denoiser_free(VP9_DENOISER *denoiser) {
       vp9_free_frame_buffer(&denoiser->running_avg_y[i]);
     }
   }
-  if (&denoiser->mc_running_avg_y != NULL) {
+  // NOTE: the check below is commented out to fix jenkins compile warning
+  if (1) {  // &denoiser->mc_running_avg_y != NULL) {
     vp9_free_frame_buffer(&denoiser->mc_running_avg_y);
   }
 }
index 035e5c117b9fb13cbc2b9ad5e90547e629074e98..6353728be478e19d0faeec96db5f2badd5333861 100644 (file)
@@ -81,8 +81,9 @@ static INLINE void quantize_dc_bigtx(const tran_low_t *coeff_ptr,
   int tmp, eob = -1;
 
   if (!skip_block) {
-
-    tmp = clamp(abs_coeff + round_ptr[rc != 0], INT16_MIN, INT16_MAX);
+    tmp = clamp(abs_coeff +
+                ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1 + logsizeby32),
+                INT16_MIN, INT16_MAX);
     tmp = (tmp * quant) >> (15 - logsizeby32);
     qcoeff_ptr[rc]  = (tmp ^ coeff_sign) - coeff_sign;
     dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr / (2 << logsizeby32);
@@ -121,16 +122,17 @@ static INLINE void highbd_quantize_dc_bigtx(const tran_low_t *coeff_ptr,
                                             uint16_t *eob_ptr,
                                             int logsizeby32) {
   int eob = -1;
-
   if (!skip_block) {
     const int rc = 0;
     const int coeff = coeff_ptr[rc];
     const int coeff_sign = (coeff >> 31);
     const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
 
-    const int64_t tmp =
-        (clamp(abs_coeff + round_ptr[rc != 0], INT32_MIN, INT32_MAX) *
-         quant) >> (15 - logsizeby32);
+    int64_t tmp =
+        clamp(abs_coeff +
+              ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1 + logsizeby32),
+              INT32_MIN, INT32_MAX);
+    tmp = (tmp * quant) >> (15 - logsizeby32);
     qcoeff_ptr[rc]  = (tmp ^ coeff_sign) - coeff_sign;
     dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr / (2 << logsizeby32);
     if (tmp)
@@ -288,7 +290,7 @@ static INLINE void quantize_fp_bigtx(const tran_low_t *coeff_ptr,
       int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
 
       if (abs_coeff >= (dequant_ptr[rc != 0] >> (2 + logsizeby32))) {
-        abs_coeff += ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1);
+        abs_coeff += ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1 + logsizeby32);
         abs_coeff = clamp(abs_coeff, INT16_MIN, INT16_MAX);
         tmp = (abs_coeff * quant_ptr[rc != 0]) >> (15 - logsizeby32);
         qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign;
@@ -375,7 +377,8 @@ static INLINE void highbd_quantize_fp_bigtx(const tran_low_t *coeff_ptr,
       const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
 
       if (abs_coeff >= (dequant_ptr[rc != 0] >> (2 + logsizeby32))) {
-        tmp = clamp(abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1),
+        tmp = clamp(abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0],
+                                                   1 + logsizeby32),
                     INT32_MIN, INT32_MAX);
         tmp = (tmp * quant_ptr[rc != 0]) >> (15 - logsizeby32);
         qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign;
@@ -611,8 +614,8 @@ static INLINE void quantize_b_bigtx(const tran_low_t *coeff_ptr,
                                     const int16_t *scan,
                                     const int16_t *iscan,
                                     int logsizeby32) {
-  const int zbins[2] = {ROUND_POWER_OF_TWO(zbin_ptr[0], 1),
-                        ROUND_POWER_OF_TWO(zbin_ptr[1], 1)};
+  const int zbins[2] = {ROUND_POWER_OF_TWO(zbin_ptr[0], 1 + logsizeby32),
+                        ROUND_POWER_OF_TWO(zbin_ptr[1], 1 + logsizeby32)};
   const int nzbins[2] = {zbins[0] * -1, zbins[1] * -1};
 
   int idx = 0;
@@ -714,8 +717,8 @@ static INLINE void highbd_quantize_b_bigtx(const tran_low_t *coeff_ptr,
                                            const int16_t *scan,
                                            const int16_t *iscan,
                                            int logsizeby32) {
-  const int zbins[2] = {ROUND_POWER_OF_TWO(zbin_ptr[0], 1),
-                        ROUND_POWER_OF_TWO(zbin_ptr[1], 1)};
+  const int zbins[2] = {ROUND_POWER_OF_TWO(zbin_ptr[0], 1 + logsizeby32),
+                        ROUND_POWER_OF_TWO(zbin_ptr[1], 1 + logsizeby32)};
   const int nzbins[2] = {zbins[0] * -1, zbins[1] * -1};
 
   int idx = 0;
index f270c2af29dc2b960f2ae2074664843e3a51d699..40282f086c8796a9875c90edb3933f1b1d865193 100644 (file)
@@ -740,7 +740,6 @@ void projectPointsHomography(double *mat, double *points,
 }
 
 int findTranslation(const int np, double *pts1, double *pts2, double *mat) {
-  const int np2 = np * 2;
   int i;
   double sx, sy, dx, dy;
   double sumx, sumy;