View Single Post
Old 12 May 2005, 05:43 pm   #4
soiaf
Member
 
Join Date: May 2005
Posts: 2
Default Re: Musepack codec on Roku PhotoBridge

Quote:
Originally Posted by Lefungus
Are you able to say those changes ?
(Edited this as I dug out the changes)
As I mentioned I had to declare MPC_FIXED_POINT in math.h but thats a normal change.

You're able to download all my source code from the link above, but the minor changes were in requant.c

Change 1
The PhotoBridge did not like the way ptr was declared in find_shift
All that was required was to declare ptr a few lines earlier

Modified code
Code:
#ifdef MPC_FIXED_POINT
static mpc_uint32_t find_shift(double fval)
{
        mpc_uint32_t ptr;
        mpc_int64_t val = (mpc_int64_t)fval;
        if (val<0) val = -val;
        ptr = 0;
        while(val) {val>>=1;ptr++;}

        return ptr > 31 ? 0 : 31 - ptr;
}
#endif
Change 2
The PhotoBridge seemed unhappy with the use/declaration of __Cc and __Dc

All that was required was to remove the const keyword from their declaration.

Quote:
Originally Posted by Lefungus
The lib use floating-point mode by default as it's usually the fastest mode on desktop cpus. Maybe the roku photobridge cpu is using floating point mode emulation, that would explain its slowness compared to fixed-point
Yes, it doesn't have a FPU, so it was using emulation. I really only tried the floating-point code to see how much slower it was than fixed-point. Answer (on the PhotoBridge anyway) - a lot slower!
soiaf is offline   Reply With Quote