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

2018-02-28 Thread Michael Niedermayer
On Thu, Mar 01, 2018 at 03:52:10AM +0200, Ivan Kalvachev wrote: > On 3/1/18, Michael Niedermayer wrote: > > 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. > >

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

2018-02-28 Thread Ivan Kalvachev
On 3/1/18, Michael Niedermayer wrote: > 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

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

2018-02-28 Thread Michael Niedermayer
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

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

2018-02-28 Thread Ivan Kalvachev
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 n