shithub: libvpx

Download patch

ref: 3ddff4503ac59c5280e393545145fad4b5da58e3
parent: ce634bbf4d4e995067f47494f57056727751df15
author: James Zern <[email protected]>
date: Wed Aug 24 17:46:26 EDT 2016

add_noise,vpx_setup_noise: correct 'char_dist' type

fixes SSE2/AddNoiseTest.CheckCvsAssembly/0 with -funsigned-char.
visibly broken since:
0dc69c7 postproc : fix function parameters for noise functions.
where the types diverged (char vs. int8)
but likely the return changed in:
2ca24b0 postproc - move filling of noise buffer to vpx_dsp.
when multiple implementations were merged.

Change-Id: I176ca1f170217f05ba7872b0c4de63e41949e999

--- a/vpx_dsp/add_noise.c
+++ b/vpx_dsp/add_noise.c
@@ -43,7 +43,7 @@
 }
 
 int vpx_setup_noise(double sigma, int8_t *noise, int size) {
-  char char_dist[256];
+  int8_t char_dist[256];
   int next = 0, i, j;
 
   // set up a 256 entry lookup that matches gaussian distribution
@@ -51,7 +51,7 @@
     const int a_i = (int)(0.5 + 256 * gaussian(sigma, 0, i));
     if (a_i) {
       for (j = 0; j < a_i; ++j) {
-        char_dist[next + j] = (char)i;
+        char_dist[next + j] = (int8_t)i;
       }
       next = next + j;
     }