[Ffmpeg-devel] [PATCH/RFC] 1-7 and 9-15 bits per pixel PGM files

Michael Niedermayer michaelni
Sun Apr 8 00:39:26 CEST 2007


Hi

On Sun, Apr 08, 2007 at 12:33:54AM +0200, Ivo wrote:
> Hi,
> 
> On Saturday 07 April 2007 23:45, Michael Niedermayer wrote:
> > On Sat, Apr 07, 2007 at 11:17:43PM +0200, Ivo wrote:
> > > Do you disagree here and should I support all non-power-of-two maxvals
> > > exactly, despite the rounding errors they will introduce, or are you ok
> > > with treating non-power-of-two maxvals like they had a maxval of the
> > > nearest power of two above that? (which is what the current patch does)
> >
> > i dunno :)
> 
> Ok :)
> 
> > > +    /* upgrade values to full range of PIX_FMT */
> > > +    if (avctx->pix_fmt == PIX_FMT_GRAY8 && s->bpp < 8) {
> > > +        unsigned int j;
> > > +        for(ptr = p->data[0], i = 0; i < avctx->height; i++, ptr +=
> > > linesize) { +            for(j = 0; j < avctx->width; j++)
> > > +                ptr[j] = ptr[j]<<(8-s->bpp) | ptr[j]>>s->bpp;
> >
> > ptr[j]>>s->bpp == 0
> 
> No, if the condition for which the code is run is true, s->bpp is always 
> smaller than eight. Perhaps I should use a less confusing variable name, 

ptr[j] will contain s->bpp bits and you shift them away -> its 0
or iam stupid (which is possible too)

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- 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-devel/attachments/20070408/b55b5da0/attachment.pgp>



More information about the ffmpeg-devel mailing list