diracdec: rewrite golomb reader

Multimedia / FFmpeg - Lynne [lynne.ee] - 12 March 2020 20:26 EDT

This version is able to output multiple coefficients at a time and is able to altogether remove actual golomb code parsing. Its also able to partially recover the last coefficient in case the packet is incomplete.

Total decoder performance gain for 8bit 420 1080p lossless: 40%. Total decoder performance gain for 10bit 420 1080p lossless: 40%.

clang was able to vectorize the loop much better than my handwritten assembly, but gcc was very naive and didn't.

Lookup table is a rewritten version of vc2hqdecode.

675bb1f4f9 diracdec: rewrite golomb reader
libavcodec/dirac_vlc.c | 1309 ++++++++++++++++++++++++++++++++++++++++--------
libavcodec/dirac_vlc.h | 30 +-
libavcodec/diracdec.c | 12 +-
3 files changed, 1102 insertions(+), 249 deletions(-)

  • Share