summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
authorJean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com>2005-03-10 22:08:42 +0000
committerJean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com>2005-03-10 22:08:42 +0000
commit6c3a875ec7075800d7c48269fedefaecbf5b67a3 (patch)
tree17b6fa79a4c5d62f09ab3e2d5aceeff3116dc680 /apps/codecs
parent5b4a339486077fbce9928cc9e4d27f0add698f1e (diff)
note to self: never commit a fix in a hurry.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6186 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/libmad/layer3.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/apps/codecs/libmad/layer3.c b/apps/codecs/libmad/layer3.c
index 732269f8de..7449be71f2 100644
--- a/apps/codecs/libmad/layer3.c
+++ b/apps/codecs/libmad/layer3.c
@@ -25,9 +25,6 @@
# include "global.h"
-#include "debug.h"
-
-
# include <string.h>
# ifdef HAVE_ASSERT_H
@@ -837,8 +834,8 @@ void III_exponents(struct channel const *channel,
exponents[sfbi] = gain -
(signed int) ((channel->scalefac[sfbi] + (pretab[sfbi] & premask)) <<
scalefac_multiplier);
- unsigned int w = sfbwidth[sfbi++];
- l += 3 * w;
+
+ l += sfbwidth[sfbi++];
}
}
@@ -855,8 +852,8 @@ void III_exponents(struct channel const *channel,
(signed int) (channel->scalefac[sfbi + 1] << scalefac_multiplier);
exponents[sfbi + 2] = gain2 -
(signed int) (channel->scalefac[sfbi + 2] << scalefac_multiplier);
-
- l += sfbwidth[sfbi];
+ unsigned int w = sfbwidth[sfbi];
+ l += 3 * w;
sfbi += 3;
}
}
@@ -2639,15 +2636,12 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
enum mad_error error;
int result = 0;
- DEBUGF("mad_layer_III: 0 Enter");
-
/* allocate Layer III dynamic structures */
if (stream->main_data == 0) {
stream->main_data = malloc(MAD_BUFFER_MDLEN);
if (stream->main_data == 0) {
stream->error = MAD_ERROR_NOMEM;
- DEBUGF("mad_layer_III: Nomem 1");
return -1;
}
}
@@ -2656,7 +2650,6 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
frame->overlap = calloc(2 * 32 * 18, sizeof(mad_fixed_t));
if (frame->overlap == 0) {
stream->error = MAD_ERROR_NOMEM;
- DEBUGF("mad_layer_III: Nomem 2");
return -1;
}
}
@@ -2671,8 +2664,6 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
(signed int) si_len) {
stream->error = MAD_ERROR_BADFRAMELEN;
stream->md_len = 0;
- DEBUGF("mad_layer_III: Insane frame");
-
return -1;
}
@@ -2686,7 +2677,6 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
!(frame->options & MAD_OPTION_IGNORECRC)) {
stream->error = MAD_ERROR_BADCRC;
result = -1;
- DEBUGF("mad_layer_III: CRC incorrect");
}
}
@@ -2697,7 +2687,6 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
if (error && result == 0) {
stream->error = error;
result = -1;
- DEBUGF("mad_layer_III: III_sideinfo error");
}
header->flags |= priv_bitlen;
@@ -2745,9 +2734,6 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
if (result == 0) {
stream->error = MAD_ERROR_BADDATAPTR;
result = -1;
- DEBUGF("mad_layer_III: bad data ptr si.main_data_begin=%x stream->md_len=%x", si.main_data_begin, stream->md_len);
- DEBUGF("frame space = %x", frame_space);
- DEBUGF("next_md_begin = %x", next_md_begin);
}
}
else {
@@ -2774,7 +2760,6 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
error = III_decode(&ptr, frame, &si, nch);
if (error) {
stream->error = error;
- DEBUGF("mad_layer_III: III_decode error");
result = -1;
}