diff src/aac/libfaad2/pns.c @ 691:e6c5fdae6e88 trunk

[svn] - oh yes, commit mplayer patches as well
author nenolod
date Tue, 20 Feb 2007 06:38:03 -0800
parents 1d8b08df98c3
children f1b6f1b2cdb3
line wrap: on
line diff
--- a/src/aac/libfaad2/pns.c	Tue Feb 20 06:31:29 2007 -0800
+++ b/src/aac/libfaad2/pns.c	Tue Feb 20 06:38:03 2007 -0800
@@ -1,6 +1,6 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
+** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
 **  
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
@@ -19,15 +19,10 @@
 ** Any non-GPL usage of this software or parts of this software is strictly
 ** forbidden.
 **
-** Software using this code must display the following message visibly in or
-** on each copy of the software:
-** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Nero AG, www.nero.com"
-** in, for example, the about-box or help/startup screen.
+** Commercial non-GPL licensing of this software is possible.
+** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
-**
-** $Id: pns.c,v 1.36 2006/05/07 18:09:01 menno Exp $
+** $Id: pns.c,v 1.34 2004/09/04 14:56:28 menno Exp $
 **/
 
 #include "common.h"
@@ -38,8 +33,7 @@
 
 /* static function declarations */
 static void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t size,
-                            uint8_t sub,
-                            /* RNG states */ uint32_t *__r1, uint32_t *__r2);
+                            uint8_t sub);
 
 
 #ifdef FIXED_POINT
@@ -74,7 +68,7 @@
     return root;
 }
 
-static real_t const pow2_table[] =
+static real_t pow2_table[] =
 {
     COEF_CONST(1.0),
     COEF_CONST(1.18920711500272),
@@ -89,8 +83,7 @@
    multiplication/accumulation per random value.
 */
 static INLINE void gen_rand_vector(real_t *spec, int16_t scale_factor, uint16_t size,
-                                   uint8_t sub,
-                                   /* RNG states */ uint32_t *__r1, uint32_t *__r2)
+                                   uint8_t sub)
 {
 #ifndef FIXED_POINT
     uint16_t i;
@@ -100,7 +93,7 @@
 
     for (i = 0; i < size; i++)
     {
-        real_t tmp = scale*(real_t)(int32_t)ne_rng(__r1, __r2);
+        real_t tmp = scale*(real_t)(int32_t)random_int();
         spec[i] = tmp;
         energy += tmp*tmp;
     }
@@ -119,7 +112,7 @@
     for (i = 0; i < size; i++)
     {
         /* this can be replaced by a 16 bit random generator!!!! */
-        real_t tmp = (int32_t)ne_rng(__r1, __r2);
+        real_t tmp = (int32_t)random_int();
         if (tmp < 0)
             tmp = -(tmp & ((1<<(REAL_BITS-1))-1));
         else
@@ -159,8 +152,7 @@
 
 void pns_decode(ic_stream *ics_left, ic_stream *ics_right,
                 real_t *spec_left, real_t *spec_right, uint16_t frame_len,
-                uint8_t channel_pair, uint8_t object_type,
-                /* RNG states */ uint32_t *__r1, uint32_t *__r2)
+                uint8_t channel_pair, uint8_t object_type)
 {
     uint8_t g, sfb, b;
     uint16_t size, offs;
@@ -210,11 +202,11 @@
 #endif
 
                     offs = ics_left->swb_offset[sfb];
-                    size = min(ics_left->swb_offset[sfb+1], ics_left->swb_offset_max) - offs;
+                    size = ics_left->swb_offset[sfb+1] - offs;
 
                     /* Generate random vector */
                     gen_rand_vector(&spec_left[(group*nshort)+offs],
-                        ics_left->scale_factors[g][sfb], size, sub, __r1, __r2);
+                        ics_left->scale_factors[g][sfb], size, sub);
                 }
 
 /* From the spec:
@@ -241,7 +233,7 @@
                             uint16_t c;
 
                             offs = ics_right->swb_offset[sfb];
-                            size = min(ics_right->swb_offset[sfb+1], ics_right->swb_offset_max) - offs;
+                            size = ics_right->swb_offset[sfb+1] - offs;
 
                             for (c = 0; c < size; c++)
                             {
@@ -258,11 +250,11 @@
 #endif
 
                             offs = ics_right->swb_offset[sfb];
-                            size = min(ics_right->swb_offset[sfb+1], ics_right->swb_offset_max) - offs;
+                            size = ics_right->swb_offset[sfb+1] - offs;
 
                             /* Generate random vector */
                             gen_rand_vector(&spec_right[(group*nshort)+offs],
-                                ics_right->scale_factors[g][sfb], size, sub, __r1, __r2);
+                                ics_right->scale_factors[g][sfb], size, sub);
                         }
                     }
                 }