#define AVCODEC_AC3ENC_H
#include <stdint.h>
+
+#include "libavutil/float_dsp.h"
#include "ac3.h"
#include "ac3dsp.h"
#include "avcodec.h"
#define MAC_COEF(d,a,b) ((d)+=(a)*(b))
#define COEF_MIN (-16777215.0/16777216.0)
#define COEF_MAX ( 16777215.0/16777216.0)
+#define NEW_CPL_COORD_THRESHOLD 0.03
typedef float SampleType;
typedef float CoefType;
typedef float CoefSumType;
#define MAC_COEF(d,a,b) MAC64(d,a,b)
#define COEF_MIN -16777215
#define COEF_MAX 16777215
+#define NEW_CPL_COORD_THRESHOLD 503317
typedef int16_t SampleType;
typedef int32_t CoefType;
typedef int64_t CoefSumType;
#endif
+/* common option values */
+#define AC3ENC_OPT_NONE -1
+#define AC3ENC_OPT_AUTO -1
+#define AC3ENC_OPT_OFF 0
+#define AC3ENC_OPT_ON 1
+#define AC3ENC_OPT_NOT_INDICATED 0
+#define AC3ENC_OPT_MODE_ON 2
+#define AC3ENC_OPT_MODE_OFF 1
+
+/* specific option values */
+#define AC3ENC_OPT_LARGE_ROOM 1
+#define AC3ENC_OPT_SMALL_ROOM 2
+#define AC3ENC_OPT_DOWNMIX_LTRT 1
+#define AC3ENC_OPT_DOWNMIX_LORO 2
+#define AC3ENC_OPT_ADCONV_STANDARD 0
+#define AC3ENC_OPT_ADCONV_HDCD 1
+
/**
* Encoding Options used by AVOption.
AVCodecContext *avctx; ///< parent AVCodecContext
PutBitContext pb; ///< bitstream writer context
DSPContext dsp;
+ AVFloatDSPContext fdsp;
AC3DSPContext ac3dsp; ///< AC-3 optimized functions
FFTContext mdct; ///< FFT context for MDCT calculation
const SampleType *mdct_window; ///< MDCT window function array
} AC3EncodeContext;
-extern const int64_t ff_ac3_channel_layouts[19];
+extern const uint64_t ff_ac3_channel_layouts[19];
int ff_ac3_encode_init(AVCodecContext *avctx);
int ff_ac3_fixed_allocate_sample_buffers(AC3EncodeContext *s);
int ff_ac3_float_allocate_sample_buffers(AC3EncodeContext *s);
-int ff_ac3_fixed_encode_frame(AVCodecContext *avctx, unsigned char *frame,
- int buf_size, void *data);
-int ff_ac3_float_encode_frame(AVCodecContext *avctx, unsigned char *frame,
- int buf_size, void *data);
+int ff_ac3_fixed_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+ const AVFrame *frame, int *got_packet_ptr);
+int ff_ac3_float_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
+ const AVFrame *frame, int *got_packet_ptr);
#endif /* AVCODEC_AC3ENC_H */