[FFmpeg-soc] [soc]: r2534 - aac/aac.c

superdump subversion at mplayerhq.hu
Sun Jun 22 12:49:33 CEST 2008


Author: superdump
Date: Sun Jun 22 12:49:30 2008
New Revision: 2534

Log:
Use num_pulse as the number of pulses rather than the number of pulses - 1


Modified:
   aac/aac.c

Modified: aac/aac.c
==============================================================================
--- aac/aac.c	(original)
+++ aac/aac.c	Sun Jun 22 12:49:30 2008
@@ -1107,9 +1107,9 @@ static int decode_scale_factor_data(AACC
 
 static void decode_pulse_data(AACContext * ac, GetBitContext * gb, Pulse * pulse) {
     int i;
-    pulse->num_pulse = get_bits(gb, 2);
+    pulse->num_pulse = get_bits(gb, 2) + 1;
     pulse->start = get_bits(gb, 6);
-    for (i = 0; i <= pulse->num_pulse; i++) {
+    for (i = 0; i < pulse->num_pulse; i++) {
         pulse->offset[i] = get_bits(gb, 5);
         pulse->amp[i] = get_bits(gb, 4);
     }
@@ -1252,7 +1252,7 @@ static int decode_spectral_data(AACConte
 
 static void pulse_tool(AACContext * ac, const IndividualChannelStream * ics, const Pulse * pulse, int * icoef) {
     int i, off = ics->swb_offset[pulse->start];
-    for (i = 0; i <= pulse->num_pulse; i++) {
+    for (i = 0; i < pulse->num_pulse; i++) {
         off += pulse->offset[i];
         if (icoef[off] > 0)
             icoef[off] += pulse->amp[i];



More information about the FFmpeg-soc mailing list