[FFmpeg-devel] PixFmtInfo cleanup
Thu Mar 5 00:01:31 CET 2009
On date Wednesday 2009-03-04 22:45:28 +0100, Stefano Sabatini encoded:
> On date Tuesday 2009-02-24 02:13:08 +0100, Michael Niedermayer encoded:
> > in svn
> Nice, just one maybe silly question, why all these minus1/plus1?
I just figured out i myslef, I suppose is to spare bits.
Next one is: why then offset_plus1?
> And simple patch attached.
> FFmpeg = Fast and Frightening Meaningless Powerful Embarassing God
> Index: libavcodec/pixdesc.h
> --- libavcodec/pixdesc.h (revision 17811)
> +++ libavcodec/pixdesc.h (working copy)
> @@ -27,7 +27,7 @@
> uint16_t plane :2; ///< which of the 4 planes contains the component
> uint16_t step_minus1 :3; ///< number of bytes between 2 horizontally consecutive pixels minus 1
> uint16_t offset_plus1 :3; ///< number of bytes before the component of the first pixel plus 1
> - uint16_t shift :3; ///< number of lsb that must be shifted away to get the value
> + uint16_t shift :3; ///< number of least significant bits that must be shifted away to get the value
> uint16_t depth_minus1 :4; ///< number of bits in the component minus 1
What if we need to shift away instead some of the *most* significant
bits (PIX_FMT_BGR555 is the only format I can use as an example)?
Maybe just another shift_msb field?
And BTW, I volunteer for this cleanup (but I have not so much time
lately, sorry), this looks required by lavfi anyway.
FFmpeg = Fostering and Faithless Magical Prodigious Esoteric Geek
More information about the ffmpeg-devel