opusenc: implement a psychoacoustic system

Multimedia / FFmpeg - Rostislav Pehlivanov [gmail.com] - 23 September 2017 03:27 EDT

This commit implements a psychoacoustic system for the native Opus encoder. Its unlike any other psychoacoustic system known since its capable of using a lookahead to make better choices on how to treat the current frame and how many bits to allocate for it (and future frames).

Also, whilst the main bulk of the analysis function has to run in a single thread, the per-frame anaylsis functions does not modify the main psychoacoustic context, so in the future it will be fairly trivial to run those as slice threads.

2ad1768 opusenc: implement a psychoacoustic system
libavcodec/Makefile | 3 +-
libavcodec/opus_celt.h | 6 +
libavcodec/opusenc.c | 270 ++++++++++++----------
libavcodec/opusenc.h | 56 +++++
libavcodec/opusenc_psy.c | 556 +++++++++++++++++++++++++++++++++++++++++++++
libavcodec/opusenc_psy.h | 104 +++++++++
libavcodec/opusenc_utils.h | 82 +++++++
7 files changed, 951 insertions(+), 126 deletions(-)

  • Share