[Ffmpeg-devel] [PATCH] cook compatible decoder

Sascha Sommer saschasommer
Fri Nov 4 11:52:01 CET 2005


On Friday 04 November 2005 11:29, Benjamin Larsson wrote:
> Sascha Sommer wrote:
> >On Friday 04 November 2005 07:26, Benjamin Larsson wrote:
> >>Hi,
> >>
> >>Diego Biurrun wrote:
> >>>On Thu, Nov 03, 2005 at 08:08:09PM +0100, Benjamin Larsson wrote:
> >>>>http://tranquillity.campus.luth.se/~banan/cook/
> >>>>
> >>>>I think the decoder wont work on BE systems.
> >>>
> >>>I can confirm this.  On my PPC it just outputs noise.
> >>>
> >>>Diego
> >>
> >>Can you try to change the byteswap in decode_bytes ?
> >>That should fix the decoder.
> >
> >Attached patch should make the sound at least recognisable.
> >I also noticed that there are some memory corruptions that should get
> > fixed before the code enters cvs.
> >
> >Regards
> >
> >Sascha
>
> I think a swap is needed, I just don't know the order.
>
>         obuf[i] = le2me_32(0x37c511f2^buf[i]);
> or
>         obuf[i] = le2me_32(le2me_32(0x37c511f2)^buf[i]);
>
> should work.
>

I created a file with ffmpeg -i firstrun.rm out.wav with my patch on a ppc64 
machine and played it on my x86 box. The sound was definitly recognisable, 
but I noticed that it will crash when I remove my debug printfs (see below). 
I think there is something wrong with the framereordering.

    for(i=0 ; i<bytes/4 ; i++){
#ifdef WORDS_BIGENDIAN
        obuf[i] = 0x37c511f2^buf[i];
#else
        obuf[i] = 0xf211c537^buf[i];
#endif
    }
    for(i=0;i<bytes;i++)
            printf("%i ",out[i]);
    printf("\n");
 

Sascha





More information about the ffmpeg-devel mailing list