Musepack Forums

Musepack Forums (https://forum.musepack.net/index.php)
-   Development (https://forum.musepack.net/forumdisplay.php?f=11)
-   -   fixed point - SCF_shift undefined in requant.h (https://forum.musepack.net/showthread.php?t=132)

polpo 27 January 2005 04:33 pm

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.

kuniklo 27 January 2005 04:58 pm

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.

polpo 27 January 2005 06:19 pm

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?

kuniklo 27 January 2005 06:26 pm

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.


All times are GMT. The time now is 01:07 pm.

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