[FFmpeg-devel] [PATCH] Issue 636 : ALAC encoding sometimes fails

Michael Niedermayer michaelni
Wed Dec 10 13:02:16 CET 2008


On Wed, Dec 10, 2008 at 11:26:28AM -0000, M?ns Rullg?rd wrote:
> 
> Michael Niedermayer wrote:
> > On Wed, Dec 10, 2008 at 10:49:10AM +0530, Jai Menon wrote:
> >> Hi,
> >>
> >> -------- Original-Nachricht --------
> >> > Datum: Fri, 5 Dec 2008 13:16:59 +0100
> >> > Von: Michael Niedermayer
> >> <michaelni at gmx.at<http://service.gmx.net/de/cgi/g.fcgi/mail/new?CUSTOMERNO=12720674&t=uk602561993.1228886151.33ee9c8f&to=michaelni%40gmx.at>
> >> >
> >> > An: FFmpeg development discussions and patches
> >> <ffmpeg-devel at mplayerhq.hu<http://service.gmx.net/de/cgi/g.fcgi/mail/new?CUSTOMERNO=12720674&t=uk602561993.1228886151.33ee9c8f&to=ffmpeg-devel%40mplayerhq.hu>
> >> >
> >> > Betreff: Re: [FFmpeg-devel] [PATCH] Issue 636 : ALAC encoding
> >> sometimes    fails
> >>
> >> > On Fri, Dec 05, 2008 at 10:09:16AM +0530, Jai Menon wrote:
> >> > > Hi,
> >> > >
> >> > > Attached patch fixes issue 636 and a few other fringe cases where the
> >> > > alac encoder produces
> >> > > lossy output. I'm behind a NAT and svn doesn't work, so could someone
> >> > > please apply. Thanks.
> >> > >
> >> > > Regards,
> >> > >
> >> > > Jai
> >> >
> >> > > Index: libavcodec/alacenc.c
> >> > > ===================================================================
> >> > > --- libavcodec/alacenc.c    (revision 15797)
> >> > > +++ libavcodec/alacenc.c    (working copy)
> >> > > @@<http://service.gmx.net/de/cgi/g.fcgi/mail/new?CUSTOMERNO=12720674&t=uk602561993.1228886151.33ee9c8f&to=>-253,7
> >> +253,8
> >> @@<http://service.gmx.net/de/cgi/g.fcgi/mail/new?CUSTOMERNO=12720674&t=uk602561993.1228886151.33ee9c8f&to=>
> >> > >
> >> > >              sum >>= lpc.lpc_quant;
> >> > >              sum += samples[0];
> >> > > -            residual[i] = samples[lpc.lpc_order+1] - sum;
> >> > > +            residual[i] = (samples[lpc.lpc_order+1] - sum) << (32 -
> >> > s->write_sample_size) >>
> >> > > +                          (32 - s->write_sample_size);
> >> > >              res_val = residual[i];
> >> >
> >> > you are missing a int32_t cast in there, without it this wont work on
> >> > systems where int is not exactly 32bit
> >> >
> >>
> >> Oversight on my part. 16 bit systems are a nightmare from which I'm trying
> >> to awake.
> >
> > int could be 64bit, it cannot be 16bit on a POSIX system as its required
> > by POSIX to be >= 32
> 
> 36-bit words used to be commonplace once upon a time...

i doubt though ffmpeg will compile on them, my gut feeling says that they
will lack int32_t
besides this, i doubt our bitstream reader or "SIMD in C" based MC code will
work on them

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I hate to see young programmers poisoned by the kind of thinking
Ulrich Drepper puts forward since it is simply too narrow -- Roman Shaposhnik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081210/bee1626b/attachment.pgp>



More information about the ffmpeg-devel mailing list