[FFmpeg-soc] [soc]: r282 - in jpeg2000: checkout.sh ffmpeg.patch j2k.h j2kenc.c

Michael Niedermayer michaelni at gmx.at
Thu Jul 5 23:34:03 CEST 2007


Hi

On Sat, Jun 30, 2007 at 04:35:10PM +0200, Kamil Nowosad wrote:
> Hi
> 
> On Mon, Jun 25, 2007 at 02:07:04PM +0200, Michael Niedermayer wrote:
> > > +/* bitstream routines */
> > > +
> > > +/* put n times val bit */
> > > +static void put_bits(J2kEncoderContext *s, int val, int n) // TODO: optimize
> > > +{
> > > +    while (n-- > 0){
> > > +        if (s->bit_index == 8)
> > > +        {
> > > +            s->bit_index = *s->buf == 0xff ? 1:0;

the ? 1:0 is unneeded


> > > +            *(++s->buf) = 0;
> > > +        }
> > > +        *s->buf |= val << (7 - s->bit_index++);
> > > +    }
> > > +}
> > > +
> > > +/* put n least significant bits of a number num */
> > > +static void put_num(J2kEncoderContext *s, int num, int n)
> > > +{
> > > +    while(--n >= 0)
> > > +        put_bits(s, (num & (1<<n)) ? 1:0, 1);

(num>>n)&1


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

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20070705/4f3d1dc4/attachment.pgp>


More information about the FFmpeg-soc mailing list