summaryrefslogtreecommitdiff
path: root/libavcodec/ac3enc.h
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2001-07-22 14:18:56 +0000
committerFabrice Bellard <fabrice@bellard.org>2001-07-22 14:18:56 +0000
commitde6d9b6404bfd1c589799142da5a95428f146edd (patch)
tree75ae0cbb74bdfafb6f1a40922db111a103db3bcf /libavcodec/ac3enc.h
parent1b58d58ddaf8a8c766a0353885ff504babed0453 (diff)
Initial revision
Originally committed as revision 5 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3enc.h')
-rw-r--r--libavcodec/ac3enc.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/libavcodec/ac3enc.h b/libavcodec/ac3enc.h
new file mode 100644
index 0000000000..40cc53aced
--- /dev/null
+++ b/libavcodec/ac3enc.h
@@ -0,0 +1,32 @@
+
+#define AC3_FRAME_SIZE (6*256)
+#define AC3_MAX_CODED_FRAME_SIZE 3840 /* in bytes */
+#define AC3_MAX_CHANNELS 2 /* we handle at most two channels, although
+ AC3 allows 6 channels */
+
+typedef struct AC3EncodeContext {
+ PutBitContext pb;
+ int nb_channels;
+ int bit_rate;
+ int sample_rate;
+ int bsid;
+ int frame_size_min; /* minimum frame size in case rounding is necessary */
+ int frame_size; /* current frame size in words */
+ int halfratecod;
+ int frmsizecod;
+ int fscod; /* frequency */
+ int acmod;
+ int bsmod;
+ short last_samples[AC3_MAX_CHANNELS][256];
+ int chbwcod[AC3_MAX_CHANNELS];
+ int nb_coefs[AC3_MAX_CHANNELS];
+
+ /* bitrate allocation control */
+ int sgaincod, sdecaycod, fdecaycod, dbkneecod, floorcod;
+ int sgain, sdecay, fdecay, dbknee, floor;
+ int csnroffst;
+ int fgaincod[AC3_MAX_CHANNELS];
+ int fsnroffst[AC3_MAX_CHANNELS];
+ /* mantissa encoding */
+ int mant1_cnt, mant2_cnt, mant4_cnt;
+} AC3EncodeContext;