[FFmpeg-devel] avcodec/proresenc_aw : improve speed by replacing PutBitContext for codeword encoding

Martin Vignali martin.vignali at gmail.com
Tue Feb 26 17:54:38 EET 2019


Patch in attach, change codeword bits writing
by replacing PutBitContext, and use instead uint64_t bit_buf
Also remove byte buffer length check

encode_codeword func have two version now
- one for dc coeff and run coeff (same as previous encode_codeword func)
- one for level coeff who also integrate the "IS_NEGATIVE(val)" bit writing

encode_codeword func code is reorganize
in the first part, calculate codeword value and number of bits for this
at the end, write the codeword in bit_buf, and if bit_buf is full, write it
in dst buf.

Pass fate test for me (X86_64 os X)
also tested, on real samples. Md5 hash of the target file doesn't change
for me

Speed improvment on X86_64 :
test file 1 : 140 -> 154 fps
test file 2 : 55 -> 62 fps

Not tested on big endian and X86_32.

Fate test cmd :
make fate-vsynth3-prores;make fate-vsynth2-prores;make
fate-vsynth1-prores;make fate-vsynth_lena-prores SAMPLES=fate-suite/

Comments welcome

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avcodec-proresenc_aw-replace-putbitsContext-by-uint6.patch
Type: application/octet-stream
Size: 8829 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190226/3281a074/attachment.obj>

More information about the ffmpeg-devel mailing list