[Ffmpeg-devel] [PATCH/RFC] 1-7 and 9-15 bits per pixel PGM files
Ivo
ivop
Sun Apr 8 00:33:54 CEST 2007
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,
like input_depth or file_depth or maxval_depth or one of the previous with
s/depth/bpp/ ?
--Ivo
More information about the ffmpeg-devel
mailing list