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

Ivan Kalvachev ikalvachev at gmail.com
Wed Feb 28 22:14:15 EET 2018


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.

It should be faster, especially because currently coefficients bellow
2048 are written using lookup table and bypass this function.

If you like it, use it.

Best Regards
   Ivan Kalvachev.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Improve-and-fix-put_vc2_ue_uint-function.patch
Type: text/x-patch
Size: 2400 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180228/221bcc35/attachment.bin>


More information about the ffmpeg-devel mailing list