[Ffmpeg-devel] [PATCH] cook compatible decoder

Ivan Kalvachev ikalvachev
Fri Nov 4 16:08:11 CET 2005


2005/11/4, Michael Niedermayer <michaelni at gmx.at>:
> Hi
>
> On Fri, Nov 04, 2005 at 11:29:25AM +0100, 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]);
>
> another issue here is that at least buf might not be 32bit aligned (if
> sub_packet_size %4 != 0 if i understand it correctly)
> i guess a simple if(sub_packet_size %4) return -1 would be the correct
> solution? or does such a size make sense?

There is something else that troubles my mind then I look at decode_bytes(),
it not only uses int, but also copies only multiple of 4 bytes (or 8
if ever done in 64 bit int).

This way we may loose up to 3 bytes.





More information about the ffmpeg-devel mailing list