[FFmpeg-devel] [PATCH][RFC] Improve and fix put_vc2_ue_uint() function.

Michael Niedermayer michael at niedermayer.cc
Thu Mar 1 00:16:33 EET 2018


On Wed, Feb 28, 2018 at 10:14:15PM +0200, Ivan Kalvachev wrote:
> Replace two bit handling loops and internal conditional branch
> with simple formula using few logical operations.
> 
> The old function would generate wrong output
> if the input does not fit into 15 bits.
> 
> Fix this by using 64 bit math and put_bits64().
> This case should be quite rare, since the bug
> has not asserted itself.
> 
> ---
> It's attempt for speed optimization, but in the
> process it turned out it needs also bugfixing.
> 
> I only tested the old case of the code,
> to confirm i've implemented the correct function.
> 
> Haven't done any benchmarks or run fate.

fate fails:

make fate-vsynth1-vc2-420p 
TEST    vsynth1-vc2-420p
--- ./tests/ref/vsynth/vsynth1-vc2-420p	2018-02-27 23:48:20.527608799 +0100
+++ tests/data/fate/vsynth1-vc2-420p	2018-02-28 23:16:02.250764645 +0100
@@ -1,4 +1,2 @@
-fb8fffcfc17558c87dd11a67ccb0f615 *tests/data/fate/vsynth1-vc2-420p.mov
+f24243a627788000de7147d38880d019 *tests/data/fate/vsynth1-vc2-420p.mov
 1155415 tests/data/fate/vsynth1-vc2-420p.mov
-387696707c79cf1a6c9aeff4024226b9 *tests/data/fate/vsynth1-vc2-420p.out.rawvideo
-stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/   760320
Test vsynth1-vc2-420p failed. Look at tests/data/fate/vsynth1-vc2-420p.err for details.
make: *** [fate-vsynth1-vc2-420p] Error 69


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety -- Benjamin Franklin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180228/8107bc3d/attachment.sig>


More information about the ffmpeg-devel mailing list