summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/aacdec/SoftAAC2.h
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2014-05-20 18:32:17 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2014-05-29 10:08:35 -0700
commitd4838ed14a169f5981c0adc2edcb24559a913fe6 (patch)
tree8bd85dc0606c9438a7a2f3907509054de143aa3b /media/libstagefright/codecs/aacdec/SoftAAC2.h
parentecc03733bfd3262ffadef3166e6be23b539c505c (diff)
downloadframeworks_av-d4838ed14a169f5981c0adc2edcb24559a913fe6.zip
frameworks_av-d4838ed14a169f5981c0adc2edcb24559a913fe6.tar.gz
frameworks_av-d4838ed14a169f5981c0adc2edcb24559a913fe6.tar.bz2
AAC decoder: compensate limiter delay
Add decoder limiter delay compensation to decoder wrapper Includes a wrapper function for SoftAAC2.cpp which selects DRC-related decoder parameters according to information in the bitstream and desired DRC characteristics for different playback modes. Bug 9428126 Change-Id: I5041b68760e95cf54073c3addf2b6026b9cfe8c5
Diffstat (limited to 'media/libstagefright/codecs/aacdec/SoftAAC2.h')
-rw-r--r--media/libstagefright/codecs/aacdec/SoftAAC2.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC2.h b/media/libstagefright/codecs/aacdec/SoftAAC2.h
index a7ea1e2..5cde03a 100644
--- a/media/libstagefright/codecs/aacdec/SoftAAC2.h
+++ b/media/libstagefright/codecs/aacdec/SoftAAC2.h
@@ -20,6 +20,7 @@
#include "SimpleSoftOMXComponent.h"
#include "aacdecoder_lib.h"
+#include "DrcPresModeWrap.h"
namespace android {
@@ -47,18 +48,19 @@ private:
enum {
kNumInputBuffers = 4,
kNumOutputBuffers = 4,
+ kNumDelayBlocksMax = 8,
};
HANDLE_AACDECODER mAACDecoder;
CStreamInfo *mStreamInfo;
bool mIsADTS;
- bool mDecoderHasData;
+ bool mIsFirst;
size_t mInputBufferCount;
+ size_t mOutputBufferCount;
bool mSignalledError;
- bool mSawInputEos;
- bool mSignalledOutputEos;
- int64_t mAnchorTimeUs;
- int64_t mNumSamplesOutput;
+ int64_t mAnchorTimeUs[kNumDelayBlocksMax];
+
+ CDrcPresModeWrapper mDrcWrap;
enum {
NONE,
@@ -69,9 +71,22 @@ private:
void initPorts();
status_t initDecoder();
bool isConfigured() const;
- void maybeConfigureDownmix() const;
+ void configureDownmix() const;
void drainDecoder();
+// delay compensation
+ bool mEndOfInput;
+ bool mEndOfOutput;
+ int32_t mOutputDelayCompensated;
+ int32_t mOutputDelayRingBufferSize;
+ short *mOutputDelayRingBuffer;
+ int32_t mOutputDelayRingBufferWritePos;
+ int32_t mOutputDelayRingBufferReadPos;
+ bool outputDelayRingBufferPutSamples(INT_PCM *samples, int numSamples);
+ int32_t outputDelayRingBufferGetSamples(INT_PCM *samples, int numSamples);
+ int32_t outputDelayRingBufferSamplesAvailable();
+ int32_t outputDelayRingBufferSamplesLeft();
+
DISALLOW_EVIL_CONSTRUCTORS(SoftAAC2);
};