AAC encoder: tweak rate-distortion logic

Multimedia / FFmpeg - Claudio Freire [gmail.com] - 23 September 2015 00:33 UTC

This patch modifies the encode frame function to retry encoding the frame when the resulting bit count is too far off target, but only adjusting lambda in small, incremental step. It also makes the logic more conservative - otherwise it will contend with bit reservoir-related variations in bit allocation, and result in artifacts when frame have to be truncated (usually at high bit rates transitioning from low complexity to high complexity).

7ec74ae AAC encoder: tweak rate-distortion logic
libavcodec/aacenc.c | 87 ++++++++++++++++++++++++++++++++++++-------------
libavcodec/aacenc.h | 4 ++-
libavcodec/aacpsy.c | 3 ++
libavcodec/psymodel.h | 1 +
tests/fate/aac.mak | 10 +++---
5 files changed, 77 insertions(+), 28 deletions(-)

  • Share