Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Freire <klaussfreire@gmail.com>2015-09-23 08:13:56 +0300
committerClaudio Freire <klaussfreire@gmail.com>2015-09-23 08:33:44 +0300
commit7ec74ae4aaf50507c5da3dfbb7336e15f848b99b (patch)
tree2ff0ca4d23f852a61fc47c006b3cf2419eb48ba7 /libavcodec/aacenc.h
parentb01f3ddad31aba45254dfd553447c7952f86fd31 (diff)
AAC encoder: tweak rate-distortion logic
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).
Diffstat (limited to 'libavcodec/aacenc.h')
-rw-r--r--libavcodec/aacenc.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/aacenc.h b/libavcodec/aacenc.h
index 54951f9f70..7e7609b1a8 100644
--- a/libavcodec/aacenc.h
+++ b/libavcodec/aacenc.h
@@ -96,10 +96,12 @@ typedef struct AACEncContext {
FFPsyContext psy;
struct FFPsyPreprocessContext* psypp;
AACCoefficientsEncoder *coder;
- int cur_channel;
+ int cur_channel; ///< current channel for coder context
int last_frame;
int random_state;
float lambda;
+ enum RawDataBlockType cur_type; ///< channel group type cur_channel belongs to
+
AudioFrameQueue afq;
DECLARE_ALIGNED(16, int, qcoefs)[96]; ///< quantized coefficients
DECLARE_ALIGNED(32, float, scoefs)[1024]; ///< scaled coefficients