[FFmpeg-devel] [PATCH] [RFC] Second try at pixdesc.h:write_line()
Stefano Sabatini
stefano.sabatini-lala
Sun Apr 19 17:20:57 CEST 2009
On date Sunday 2009-04-19 15:56:10 +0200, Michael Niedermayer encoded:
> On Sun, Apr 19, 2009 at 12:35:44PM +0200, Stefano Sabatini wrote:
> > Mmh what about this?
> >
> > while (w--) {
> > *p |= *src++ << (8 - depth + shift);
> > shift -= step;
> > p -= shift >> 3;
> > shift &= 7;
> > }
> >
> > I'm not still sure it is what you meant. Also AFAIU this can only
> > work for a pixel depth of 1, while pixel/source can contain pixels
> > with a depth up to 16 bits (uint16_t).
> >
> > Note that I cannot shift for a negative value (result is undefined).
>
> i meant what i wrote
> *p |= *src++ << shift;
>
> and
> shift &= 7; done priorly in all cases makes sure this is not negative
> so i am no sure what you meant
> did i miss something ?
>
> and yes it of course wont work with >8bit per sample or where a sample
> crosses a byte boundary but i dont think there are any pixel formats that
> would use the bitstream case and require these that we want to support.
> If you know of a specific example pixel format that would fail and that
> actually exists iam interrested ...
OK, thanks, it was exactly this which was puzzling me, maybe we should
add a notice to the docs saying something like:
"read_line() will not work with bitstream formats with a depth per
sample greater than 8, or where a sample crosses a byte boundary."
I'm attaching the updated hflip filter patch, which I'm using to test
it (togheter with the pixdesc definition already posted).
Regards.
--
FFmpeg = Foolish Fostering Multimedia Portable Ecumenical Game
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pixdesc-write-line.patch
Type: text/x-diff
Size: 2149 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090419/c1ae7f42/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hflip-use-pixdesc.patch
Type: text/x-diff
Size: 4957 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090419/c1ae7f42/attachment-0001.patch>
More information about the ffmpeg-devel
mailing list