summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.h
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-03-24 21:27:05 +0100
committerJustin Ruggles <justin.ruggles@gmail.com>2011-09-06 12:43:16 -0400
commit459fe331e9068dc916929021579c26021c097b57 (patch)
tree0f0c48c28c8bbbc1703d2b5bfa376282905c8d10 /libavcodec/ac3dec.h
parent6192b6f3e78b382ddf16b58fed2d3ab8745753f6 (diff)
ac3dec: avoid pointless alloc and indirection for input_buffer
Since we now always allocate it, it can simply be made part of the context instead.
Diffstat (limited to 'libavcodec/ac3dec.h')
-rw-r--r--libavcodec/ac3dec.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ac3dec.h b/libavcodec/ac3dec.h
index a7cebafbe9..38262514b6 100644
--- a/libavcodec/ac3dec.h
+++ b/libavcodec/ac3dec.h
@@ -62,11 +62,13 @@
#define SPX_MAX_BANDS 17
+/** Large enough for maximum possible frame size when the specification limit is ignored */
+#define AC3_FRAME_BUFFER_SIZE 32768
+
typedef struct {
AVClass *class; ///< class for AVOptions
AVCodecContext *avctx; ///< parent context
GetBitContext gbc; ///< bitstream reader
- uint8_t *input_buffer; ///< temp buffer to prevent overread
///@name Bit stream information
///@{
@@ -202,6 +204,7 @@ typedef struct {
DECLARE_ALIGNED(32, float, window)[AC3_BLOCK_SIZE]; ///< window coefficients
DECLARE_ALIGNED(32, float, tmp_output)[AC3_BLOCK_SIZE]; ///< temporary storage for output before windowing
DECLARE_ALIGNED(32, float, output)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< output after imdct transform and windowing
+ DECLARE_ALIGNED(32, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread
///@}
} AC3DecodeContext;