1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
$NetBSD: patch-ac,v 1.5 2002/08/05 17:39:18 wiz Exp $
--- mpegsound/mpeglayer3.cc.orig Fri Mar 6 18:43:55 1998
+++ mpegsound/mpeglayer3.cc
@@ -21,6 +21,7 @@
#include "mpegsound.h"
#include "mpegsound_locals.h"
+
inline void Mpegbitwindow::wrap(void)
{
int p=bitindex>>3;
@@ -45,18 +46,9 @@
inline int Mpegbitwindow::getbits9(int bits)
{
register unsigned short a;
+ int offset=bitindex>>3;
-#ifndef WORDS_BIGENDIAN
- {
- // int offset=(bitindex>>3)&(WINDOWSIZE-1);
- int offset=bitindex>>3;
-
- a=(((unsigned char)buffer[offset])<<8) | ((unsigned char)buffer[offset+1]);
- }
-#else
- // a=((unsigned short *)(buffer+((bixindex>>3)&(WINDOWSIZE-1))));
- a=((unsigned short *)(buffer+((bixindex>>3))));
-#endif
+ a=(((unsigned char)buffer[offset])<<8) | ((unsigned char)buffer[offset+1]);
a<<=(bitindex&7);
bitindex+=bits;
@@ -769,7 +761,7 @@
for(i=0;i<e;)
{
const HUFFMANCODETABLE *h;
- register end;
+ register int end;
if (i<region1Start)
{
@@ -971,7 +963,15 @@
}
}
{
- int t_index=(index-cb_begin)/cb_width;
+ int t_index = 0;
+ if (cb_width)
+ {
+ t_index=(index-cb_begin)/cb_width;
+ if (t_index > 2)
+ t_index = 0;
+ }
+ else
+ fprintf(stderr, "Very bad mp3 data\n");
out[0][index]*=layer3twopow2_1(gi->subblock_gain[t_index],
gi->scalefac_scale,
scalefactors[ch].s[t_index][cb]);
@@ -1392,7 +1392,7 @@
{
if(gi->mixed_block_flag)
{
- fprintf(stderr,"Notchecked!");
+ fprintf(stderr, "Mpegtoraw::layer3reorderandantialias:Not checked!");
layer3reorder_1 (version,frequency,in,out); // Not checked...
layer3antialias_1(out);
}
|