Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fa969d16
Commit
fa969d16
authored
Jul 10, 2007
by
Chris Robinson
Committed by
Alexandre Julliard
Jul 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemp3: Remove global mpstr pointer.
parent
cfe289e6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
37 deletions
+31
-37
decode_i386.c
dlls/winemp3.acm/decode_i386.c
+7
-9
interface.c
dlls/winemp3.acm/interface.c
+5
-9
layer1.c
dlls/winemp3.acm/layer1.c
+3
-3
layer2.c
dlls/winemp3.acm/layer2.c
+3
-3
layer3.c
dlls/winemp3.acm/layer3.c
+8
-10
mpg123.h
dlls/winemp3.acm/mpg123.h
+5
-3
No files found.
dlls/winemp3.acm/decode_i386.c
View file @
fa969d16
...
...
@@ -31,22 +31,20 @@
#include "mpg123.h"
#include "mpglib.h"
extern
struct
mpstr
*
gmp
;
/* old WRITE_SAMPLE */
#define WRITE_SAMPLE(samples,sum,clip) \
if( (sum) > 32767.0) { *(samples) = 0x7fff; (clip)++; } \
else if( (sum) < -32768.0) { *(samples) = -0x8000; (clip)++; } \
else { *(samples) = sum; }
int
synth_1to1_mono
(
real
*
bandPtr
,
unsigned
char
*
samples
,
int
*
pnt
)
int
synth_1to1_mono
(
struct
mpstr
*
mp
,
real
*
bandPtr
,
unsigned
char
*
samples
,
int
*
pnt
)
{
short
samples_tmp
[
64
];
short
*
tmp1
=
samples_tmp
;
int
i
,
ret
;
int
pnt1
=
0
;
ret
=
synth_1to1
(
bandPtr
,
0
,(
unsigned
char
*
)
samples_tmp
,
&
pnt1
);
ret
=
synth_1to1
(
mp
,
bandPtr
,
0
,(
unsigned
char
*
)
samples_tmp
,
&
pnt1
);
samples
+=
*
pnt
;
for
(
i
=
0
;
i
<
32
;
i
++
)
{
...
...
@@ -60,7 +58,7 @@ int synth_1to1_mono(real *bandPtr,unsigned char *samples,int *pnt)
}
int
synth_1to1
(
real
*
bandPtr
,
int
channel
,
unsigned
char
*
out
,
int
*
pnt
)
int
synth_1to1
(
struct
mpstr
*
mp
,
real
*
bandPtr
,
int
channel
,
unsigned
char
*
out
,
int
*
pnt
)
{
static
const
int
step
=
2
;
int
bo
;
...
...
@@ -70,16 +68,16 @@ int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt)
int
clip
=
0
;
int
bo1
;
bo
=
g
mp
->
synth_bo
;
bo
=
mp
->
synth_bo
;
if
(
!
channel
)
{
bo
--
;
bo
&=
0xf
;
buf
=
g
mp
->
synth_buffs
[
0
];
buf
=
mp
->
synth_buffs
[
0
];
}
else
{
samples
++
;
buf
=
g
mp
->
synth_buffs
[
1
];
buf
=
mp
->
synth_buffs
[
1
];
}
if
(
bo
&
0x1
)
{
...
...
@@ -93,7 +91,7 @@ int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt)
dct64
(
buf
[
0
]
+
bo
,
buf
[
1
]
+
bo
+
1
,
bandPtr
);
}
g
mp
->
synth_bo
=
bo
;
mp
->
synth_bo
=
bo
;
{
register
int
j
;
...
...
dlls/winemp3.acm/interface.c
View file @
fa969d16
...
...
@@ -22,9 +22,6 @@
#include "mpg123.h"
#include "mpglib.h"
/* Global mp .. it's a hack */
struct
mpstr
*
gmp
;
BOOL
InitMP3
(
struct
mpstr
*
mp
)
{
...
...
@@ -39,6 +36,7 @@ BOOL InitMP3(struct mpstr *mp)
mp
->
fr
.
single
=
-
1
;
mp
->
bsnum
=
0
;
mp
->
synth_bo
=
1
;
mp
->
fr
.
mp
=
mp
;
if
(
!
init
)
{
init
=
1
;
...
...
@@ -152,8 +150,6 @@ int decodeMP3(struct mpstr *mp,const unsigned char *in,int isize,unsigned char *
{
int
len
;
gmp
=
mp
;
if
(
osize
<
4608
)
{
fprintf
(
stderr
,
"To less out space
\n
"
);
return
MP3_ERR
;
...
...
@@ -224,17 +220,17 @@ int decodeMP3(struct mpstr *mp,const unsigned char *in,int isize,unsigned char *
return
MP3_OK
;
}
int
set_pointer
(
long
backstep
)
int
set_pointer
(
struct
mpstr
*
mp
,
long
backstep
)
{
unsigned
char
*
bsbufold
;
if
(
g
mp
->
fsizeold
<
0
&&
backstep
>
0
)
{
if
(
mp
->
fsizeold
<
0
&&
backstep
>
0
)
{
fprintf
(
stderr
,
"Can't step back %ld!
\n
"
,
backstep
);
return
MP3_ERR
;
}
bsbufold
=
gmp
->
bsspace
[
g
mp
->
bsnum
]
+
512
;
bsbufold
=
mp
->
bsspace
[
mp
->
bsnum
]
+
512
;
wordpointer
-=
backstep
;
if
(
backstep
)
memcpy
(
wordpointer
,
bsbufold
+
g
mp
->
fsizeold
-
backstep
,
backstep
);
memcpy
(
wordpointer
,
bsbufold
+
mp
->
fsizeold
-
backstep
,
backstep
);
bitindex
=
0
;
return
MP3_OK
;
}
dlls/winemp3.acm/layer1.c
View file @
fa969d16
...
...
@@ -146,12 +146,12 @@ int do_layer1(struct frame *fr,unsigned char *pcm_sample,int *pcm_point)
I_step_two
(
fraction
,
balloc
,
scale_index
,
fr
);
if
(
single
>=
0
)
{
clip
+=
synth_1to1_mono
(
(
real
*
)
fraction
[
single
],
pcm_sample
,
pcm_point
);
clip
+=
synth_1to1_mono
(
fr
->
mp
,
(
real
*
)
fraction
[
single
],
pcm_sample
,
pcm_point
);
}
else
{
int
p1
=
*
pcm_point
;
clip
+=
synth_1to1
(
(
real
*
)
fraction
[
0
],
0
,
pcm_sample
,
&
p1
);
clip
+=
synth_1to1
(
(
real
*
)
fraction
[
1
],
1
,
pcm_sample
,
pcm_point
);
clip
+=
synth_1to1
(
fr
->
mp
,
(
real
*
)
fraction
[
0
],
0
,
pcm_sample
,
&
p1
);
clip
+=
synth_1to1
(
fr
->
mp
,
(
real
*
)
fraction
[
1
],
1
,
pcm_sample
,
pcm_point
);
}
}
...
...
dlls/winemp3.acm/layer2.c
View file @
fa969d16
...
...
@@ -286,12 +286,12 @@ int do_layer2(struct frame *fr,unsigned char *pcm_sample,int *pcm_point)
II_step_two
(
bit_alloc
,
fraction
,
scale
,
fr
,
i
>>
2
);
for
(
j
=
0
;
j
<
3
;
j
++
)
{
if
(
single
>=
0
)
{
clip
+=
synth_1to1_mono
(
fraction
[
0
][
j
],
pcm_sample
,
pcm_point
);
clip
+=
synth_1to1_mono
(
fr
->
mp
,
fr
action
[
0
][
j
],
pcm_sample
,
pcm_point
);
}
else
{
int
p1
=
*
pcm_point
;
clip
+=
synth_1to1
(
fraction
[
0
][
j
],
0
,
pcm_sample
,
&
p1
);
clip
+=
synth_1to1
(
fraction
[
1
][
j
],
1
,
pcm_sample
,
pcm_point
);
clip
+=
synth_1to1
(
fr
->
mp
,
fr
action
[
0
][
j
],
0
,
pcm_sample
,
&
p1
);
clip
+=
synth_1to1
(
fr
->
mp
,
fr
action
[
1
][
j
],
1
,
pcm_sample
,
pcm_point
);
}
}
...
...
dlls/winemp3.acm/layer3.c
View file @
fa969d16
...
...
@@ -25,8 +25,6 @@
#include "mpglib.h"
#include "huffman.h"
extern
struct
mpstr
*
gmp
;
#define MPEG1
...
...
@@ -1830,11 +1828,11 @@ static void dct12(real *in,real *rawout1,real *rawout2,register real *wi,registe
* III_hybrid
*/
static
void
III_hybrid
(
real
fsIn
[
SBLIMIT
][
SSLIMIT
],
real
tsOut
[
SSLIMIT
][
SBLIMIT
],
int
ch
,
struct
gr_info_s
*
gr_info
)
int
ch
,
struct
gr_info_s
*
gr_info
,
struct
mpstr
*
mp
)
{
real
*
tspnt
=
(
real
*
)
tsOut
;
real
(
*
block
)[
2
][
SBLIMIT
*
SSLIMIT
]
=
g
mp
->
hybrid_block
;
int
*
blc
=
g
mp
->
hybrid_blc
;
real
(
*
block
)[
2
][
SBLIMIT
*
SSLIMIT
]
=
mp
->
hybrid_block
;
int
*
blc
=
mp
->
hybrid_blc
;
real
*
rawout1
,
*
rawout2
;
int
bt
;
int
sb
=
0
;
...
...
@@ -1923,7 +1921,7 @@ int do_layer3(struct frame *fr,unsigned char *pcm_sample,int *pcm_point)
#endif
}
if
(
set_pointer
(
sideinfo
.
main_data_begin
)
==
MP3_ERR
)
if
(
set_pointer
(
fr
->
mp
,
sideinfo
.
main_data_begin
)
==
MP3_ERR
)
return
-
1
;
for
(
gr
=
0
;
gr
<
granules
;
gr
++
)
...
...
@@ -2006,17 +2004,17 @@ int do_layer3(struct frame *fr,unsigned char *pcm_sample,int *pcm_point)
for
(
ch
=
0
;
ch
<
stereo1
;
ch
++
)
{
struct
gr_info_s
*
gr_info
=
&
(
sideinfo
.
ch
[
ch
].
gr
[
gr
]);
III_antialias
(
hybridIn
[
ch
],
gr_info
);
III_hybrid
(
hybridIn
[
ch
],
hybridOut
[
ch
],
ch
,
gr_info
);
III_hybrid
(
hybridIn
[
ch
],
hybridOut
[
ch
],
ch
,
gr_info
,
fr
->
mp
);
}
for
(
ss
=
0
;
ss
<
SSLIMIT
;
ss
++
)
{
if
(
single
>=
0
)
{
clip
+=
synth_1to1_mono
(
hybridOut
[
0
][
ss
],
pcm_sample
,
pcm_point
);
clip
+=
synth_1to1_mono
(
fr
->
mp
,
hybridOut
[
0
][
ss
],
pcm_sample
,
pcm_point
);
}
else
{
int
p1
=
*
pcm_point
;
clip
+=
synth_1to1
(
hybridOut
[
0
][
ss
],
0
,
pcm_sample
,
&
p1
);
clip
+=
synth_1to1
(
hybridOut
[
1
][
ss
],
1
,
pcm_sample
,
pcm_point
);
clip
+=
synth_1to1
(
fr
->
mp
,
hybridOut
[
0
][
ss
],
0
,
pcm_sample
,
&
p1
);
clip
+=
synth_1to1
(
fr
->
mp
,
hybridOut
[
1
][
ss
],
1
,
pcm_sample
,
pcm_point
);
}
}
}
...
...
dlls/winemp3.acm/mpg123.h
View file @
fa969d16
...
...
@@ -105,6 +105,8 @@ struct frame {
/* layer2 stuff */
int
II_sblimit
;
const
struct
al_table
*
alloc
;
struct
mpstr
*
mp
;
};
struct
parameter
{
...
...
@@ -117,7 +119,7 @@ struct parameter {
extern
unsigned
int
get1bit
(
void
);
extern
unsigned
int
getbits
(
int
);
extern
unsigned
int
getbits_fast
(
int
);
extern
int
set_pointer
(
long
);
extern
int
set_pointer
(
struct
mpstr
*
,
long
);
extern
unsigned
char
*
wordpointer
;
extern
int
bitindex
;
...
...
@@ -160,9 +162,9 @@ struct III_sideinfo
}
ch
[
2
];
};
extern
int
synth_1to1
(
real
*
,
int
,
unsigned
char
*
,
int
*
);
extern
int
synth_1to1
(
struct
mpstr
*
,
real
*
,
int
,
unsigned
char
*
,
int
*
);
extern
int
synth_1to1_8bit
(
real
*
,
int
,
unsigned
char
*
,
int
*
);
extern
int
synth_1to1_mono
(
real
*
,
unsigned
char
*
,
int
*
);
extern
int
synth_1to1_mono
(
struct
mpstr
*
,
real
*
,
unsigned
char
*
,
int
*
);
extern
int
synth_1to1_mono2stereo
(
real
*
,
unsigned
char
*
,
int
*
);
extern
int
synth_1to1_8bit_mono
(
real
*
,
unsigned
char
*
,
int
*
);
extern
int
synth_1to1_8bit_mono2stereo
(
real
*
,
unsigned
char
*
,
int
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment