[FFmpeg-devel] [PATCH 5/5] libavcodec/ffv1: Support storing LSB raw

Michael Niedermayer michael at niedermayer.cc
Wed Oct 16 22:51:53 EEST 2024


Hi Jerome

On Wed, Oct 16, 2024 at 06:27:09PM +0200, Jerome Martinez wrote:
> Le 16/10/2024 à 15:54, Michael Niedermayer a écrit :
> > 3rd implemantation :)
> > you might ask why i implement this 4?! times
> > Heres why: (tests done with 4 rawlsb bits, 16bit per sample input)
> 
> I tested on my side also including the speed as the goal is to avoid the
> speed cost of the LSB, with 6K content from scanner (analog input, last bits
> are more or less random).
> Speed     Compr
> 0,037x    0,471    No patch
> 0,051x    0,491    bitfield
> 0,046x    0,489    rangecoder
> 
> the 25% gain in the speed is clearly visible (actually it 27%  in my tests)
> with the bitfield version of storing LSB, but it is a lot less visible with
> the rangecoder version (the one from today):
> There is a small 0.5% gain in size at the cost of 9% of speed, it is not
> worth it IMO.
>
> I prefer by far your first version (really storing LSB as raw), it is fast
> as expected (25% less time) and adding the range coder creates something not
> really interesting (20% less time "only" for so little gain in size compared
> to 25%)

did you try qtable 1 ? strangely it performed better for the file i used compression wise

also i cleaned the code up a bit and reposted, some of the code was
not exactly optimized

here the old "bitfield"
real	0m5.545s
real	0m5.655s
real	0m5.643s

vs. just now posted:
real	0m5.407s
real	0m5.393s
real	0m5.404s

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241016/c2ae13d8/attachment.sig>


More information about the ffmpeg-devel mailing list