[FFmpeg-devel] [PATCH] Support > 8 bit input in yuv2rgb.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Nov 9 16:23:08 CET 2013


On Sat, Nov 09, 2013 at 03:19:03PM +0100, Michael Niedermayer wrote:
> On Sat, Nov 09, 2013 at 03:04:10PM +0100, Reimar Döffinger wrote:
> > On 09.11.2013, at 14:56, Michael Niedermayer <michaelni at gmx.at> wrote:
> > >> I haven't tested. But note that I also added 16-bit support, we are talking about 256 times larger table.
> > >> If keeping the shift for Y that would still be around 48 MB if I calculated right?
> > > 
> > > this sounds a bit bigger than what i would have expected for 16bit
> > > without a shift
> > > 
> > > 
> > >> There could be a "compromise" by making the tables for y, u and v 9 bit and only shifting for > 9 bit, to get better precision. That would only increase their size 4x I believe.
> > > 
> > > 2x
> > 
> > I'll have to check it again, but I though it was a table of tables (i.e. you first do a lookup on v and then one based on y), so you'd not only need double the size but you'd need twice as many tables, thus 4x.
> 
> its a magic table, you can make it 2x bigger in all 3 dimensions yet it
> doesnt need 4 times the floor space in your room

Yes, I forgot about it.
I sent a new patch (to be applied on top of the previous).
I'd welcome feedback if that is what should be done, and also
careful review of the table generation, I caught a bit of a cold
and feel quite unable be sure of anything (I guess I
should be writing a testcase that checks the precision for this
whole thing, but probably won't anytime soon).


More information about the ffmpeg-devel mailing list