29 #define CONFIG_AC3ENC_FLOAT 1
35 #if CONFIG_AC3_ENCODER
36 #define AC3ENC_TYPE AC3ENC_TYPE_AC3
77 for (i = 0; i < n2; i++)
78 window[n-1-i] = window[i];
89 const float *window,
unsigned int len)
134 coord *= sqrtf(energy_ch / energy_cpl);
139 #if CONFIG_AC3_ENCODER
void(* float_to_fixed24)(int32_t *dst, const float *src, unsigned int len)
Convert an array of float in range [-1.0,1.0] to int32_t with range [-(1<<24),(1<<24)].
struct AC3EncodeContext AC3EncodeContext
AC-3 encoder private context.
av_cold void ff_kbd_window_init(float *window, float alpha, int n)
Generate a Kaiser-Bessel Derived Window.
static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
av_cold int ff_ac3_encode_close(AVCodecContext *avctx)
Finalize encoding and free any memory allocated by the encoder.
av_cold int ff_ac3_float_mdct_init(AC3EncodeContext *s)
Initialize MDCT tables.
AC3DSPContext ac3dsp
AC-3 optimized functions.
static int init(AVCodecParserContext *s)
static int normalize_samples(AC3EncodeContext *s)
const uint64_t ff_ac3_channel_layouts[19]
List of supported channel layouts.
int channels
total number of channels (nchans)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int cpl_on
coupling turned on for this frame
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
int ff_ac3_float_encode_frame(AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)
static void scale_coefficients(AC3EncodeContext *s)
FFTContext mdct
FFT context for MDCT calculation.
const SampleType * mdct_window
MDCT window function array.
static void apply_window(DSPContext *dsp, float *output, const float *input, const float *window, unsigned int len)
void(* vector_clipf)(float *dst, const float *src, float min, float max, int len)
CoefType * mdct_coef_buffer
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Describe the class of an AVClass context structure.
static void clip_coefficients(DSPContext *dsp, float *coef, unsigned int len)
AC-3 encoder private context.
int num_blocks
number of blocks per frame
AC-3 encoder float/fixed template.
void(* vector_fmul)(float *dst, const float *src0, const float *src1, int len)
static const AVClass ac3enc_class
AVSampleFormat
all in native-endian format
AVCodecContext * avctx
parent AVCodecContext
AC-3 encoder & E-AC-3 encoder common header.
av_cold void ff_ac3_float_mdct_end(AC3EncodeContext *s)
Finalize MDCT and free allocated memory.
int32_t * fixed_coef_buffer
av_cold int ff_ac3_encode_init(AVCodecContext *avctx)