Musepack Forums  

Go Back   Musepack Forums > Main > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 27 January 2005, 04:33 pm   #1
polpo
Member
 
Join Date: Jan 2005
Posts: 2
Send a message via ICQ to polpo
Default fixed point - SCF_shift undefined in requant.h

When compiling libmusepack-1.1 in fixed point (done by uncommenting #define MPC_FIXED_POINT in include/musepack/math.h), I get this error during compilation:

Code:
requant.c: In function `mpc_decoder_scale_output':

requant.c:103: error: `SCF_shift' undeclared (first use in this function)
It looks like SCF_shift is in decoder.h. #including it doesn't get rid of the error. Defining SCF_shift in requant.c just results in a decoded file full of noise.
polpo is offline   Reply With Quote
Old 27 January 2005, 04:58 pm   #2
kuniklo
Senior Member
 
kuniklo's Avatar
 
Join Date: Aug 2004
Location: Emeryville, CA
Posts: 52
Default Re: fixed point - SCF_shift undefined in requant.h

Quote:
When compiling libmusepack-1.1 in fixed point (done by uncommenting #define MPC_FIXED_POINT in include/musepack/math.h), I get this error during compilation:

Code:
requant.c: In function `mpc_decoder_scale_output':

requant.c:103: error: `SCF_shift' undeclared (first use in this function)
It looks like SCF_shift is in decoder.h. #including it doesn't get rid of the error. Defining SCF_shift in requant.c just results in a decoded file full of noise.
We haven't taken a look at the fixed point stuff recently. I'll check it out tonight and see if I can figure out what's up. Thanks for the bug report.
kuniklo is offline   Reply With Quote
Old 27 January 2005, 06:19 pm   #3
polpo
Member
 
Join Date: Jan 2005
Posts: 2
Send a message via ICQ to polpo
Default

Changing line 86 in requant.c to
Code:
#define SET_SCF(N,X) d->SCF[N] = MAKE_MPC_SAMPLE_EX(X,d->SCF_shift[N] = (unsigned char)find_shift(X));
seems to do the trick and doesn't break floating point either. Sounds correct to my ears.

Also, sample is a *lot* slower when writing to a wav file (16.66x in benchmark mode vs. 6.85x when writing on my crummy VIA C3). Is WavWriter really that slow?
polpo is offline   Reply With Quote
Old 27 January 2005, 06:26 pm   #4
kuniklo
Senior Member
 
kuniklo's Avatar
 
Join Date: Aug 2004
Location: Emeryville, CA
Posts: 52
Default

Quote:
Changing line 86 in requant.c to
Code:
#define SET_SCF(N,X) d->SCF[N] = MAKE_MPC_SAMPLE_EX(X,d->SCF_shift[N] = (unsigned char)find_shift(X));
seems to do the trick and doesn't break floating point either. Sounds correct to my ears.

Also, sample is a *lot* slower when writing to a wav file (16.66x in benchmark mode vs. 6.85x when writing on my crummy VIA C3). Is WavWriter really that slow?
Thanks for the fix! I'll apply it when I'm home later.

I wouldn't be surprised if the WavWriter slows things down that much, actually.
kuniklo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 05:21 pm.


Powered by vBulletin® Version 3.8.11 Beta 2
Copyright ©2000 - 2017, vBulletin Solutions Inc.