[FFmpeg-devel] [PATCH] Adding Cinepak encoder (attached)

Michael Niedermayer michaelni at gmx.at
Wed Jan 15 04:39:54 CET 2014


On Tue, Jan 14, 2014 at 08:45:31PM +0000, Rl wrote:
> On Tue, Jan 14, 2014 at 05:39:56AM +0100, Michael Niedermayer wrote:
[...]
> > > +                    rr = 0.2857*rr + 0.5714*gg + 0.1429*bb;
> > > +                    if(      rr <   0) rr =   0;
> > > +                    else if (rr > 255) rr = 255;
> > > +                    scratch_pict.data[0][i1 + i2*scratch_pict.linesize[0]] = rr;
> > > +                }
> > > +                r /= 4; g /= 4; b /= 4;
> > > +// "U"
> > > +                rr = -0.1429*r - 0.2857*g + 0.4286*b;
> > > +                if(      rr < -128) rr = -128;
> > > +                else if (rr >  127) rr =  127;
> > > +                scratch_pict.data[1][0] = rr + 128; // quantize needs unsigned
> > > +// "V"
> > > +                rr = 0.3571*r - 0.2857*g - 0.0714*b;
> > 
> > with float operations there may be slight differences in the output
> > which would break a fate test
> 
> Would you suggest how these expressions should be formulated instead,
> to be more robust? Using 32- or 64-bit integer arithmetics?

yes 32bit integer arthemtics should work fine

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

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140115/867d3c60/attachment.asc>


More information about the ffmpeg-devel mailing list