ref: 6c85fee8f0ffb7c6687f82596288f72d5bd33ef2
parent: 297680298fbf90e08122af8f1c55a09354aef030
author: menno <menno>
date: Wed Sep 4 06:22:18 EDT 2002
PNS fixed :-))
--- a/libfaad/pns.c
+++ b/libfaad/pns.c
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: pns.c,v 1.13 2002/08/30 18:06:26 menno Exp $
+** $Id: pns.c,v 1.14 2002/09/04 10:22:18 menno Exp $
**/
#include "common.h"
@@ -55,7 +55,7 @@
value. A suitable random number generator can be realized using one
multiplication/accumulation per random value.
*/
-static INLINE void gen_rand_vector(real_t *spec, uint16_t scale_factor, uint16_t size)
+static INLINE void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t size)
{
uint16_t i;
real_t energy = 0;
@@ -68,7 +68,7 @@
energy += MUL(spec[i],spec[i]);
}
- scale = 1 / (float32_t)sqrt(energy);
+ scale = 1.0/(float32_t)sqrt(energy);
scale *= (float32_t)pow(2.0, 0.25 * scale_factor);
for (i = 0; i < size; i++)
{
--- a/libfaad/pns.h
+++ b/libfaad/pns.h
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: pns.h,v 1.7 2002/08/30 18:06:26 menno Exp $
+** $Id: pns.h,v 1.8 2002/09/04 10:22:18 menno Exp $
**/
#ifndef __PNS_H__
@@ -38,7 +38,7 @@
uint8_t channel_pair);
static INLINE int32_t random2();
-static void gen_rand_vector(real_t *spec, uint16_t scale_factor, uint16_t size);
+static void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t size);
static INLINE uint8_t is_noise(ic_stream *ics, uint8_t group, uint8_t sfb)
{
--- a/libfaad/syntax.h
+++ b/libfaad/syntax.h
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: syntax.h,v 1.18 2002/08/30 18:14:26 menno Exp $
+** $Id: syntax.h,v 1.19 2002/09/04 10:22:18 menno Exp $
**/
#ifndef __SYNTAX_H__
@@ -233,7 +233,7 @@
uint8_t num_sec[8]; /* number of sections in a group */
uint8_t global_gain;
- uint16_t scale_factors[8][51];
+ int16_t scale_factors[8][51];
uint8_t ms_mask_present;
uint8_t ms_used[MAX_WINDOW_GROUPS][MAX_SFB];