29 #define CONFIG_AC3ENC_FLOAT 1
36 #if CONFIG_AC3_ENCODER
37 #define AC3ENC_TYPE AC3ENC_TYPE_AC3
82 for (i = 0; i < n2; i++)
83 window[n-1-i] = window[i];
94 const float *input,
const float *window,
125 const float *coef0,
const float *coef1,
147 coord *= sqrtf(energy_ch / energy_cpl);
152 #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)].
av_cold void ff_kbd_window_init(float *window, float alpha, int n)
Generate a Kaiser-Bessel Derived Window.
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
void(* sum_square_butterfly_float)(float sum[4], const float *coef0, const float *coef1, int len)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
int ff_ac3_float_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
static void sum_square_butterfly(AC3EncodeContext *s, float sum[4], const float *coef0, const float *coef1, int len)
const char * av_default_item_name(void *ctx)
Return the context name.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
const char * name
Name of the codec implementation.
av_cold int ff_ac3_encode_close(AVCodecContext *avctx)
Finalize encoding and free any memory allocated by the encoder.
AC3DSPContext ac3dsp
AC-3 optimized functions.
static int normalize_samples(AC3EncodeContext *s)
const uint64_t ff_ac3_channel_layouts[19]
List of supported channel layouts.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void(* vector_fmul)(float *dst, const float *src0, const float *src1, int len)
Calculate the product of two vectors of floats and store the result in a vector of floats...
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
static void scale_coefficients(AC3EncodeContext *s)
int ff_ac3_float_mdct_init(AC3EncodeContext *s)
Initialize MDCT tables.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
FFTContext mdct
FFT context for MDCT calculation.
const SampleType * mdct_window
MDCT window function array.
AVSampleFormat
Audio Sample Formats.
void(* vector_clipf)(float *dst, const float *src, float min, float max, int len)
CoefType * mdct_coef_buffer
static void close(AVCodecParserContext *s)
Describe the class of an AVClass context structure.
static void clip_coefficients(DSPContext *dsp, float *coef, unsigned int len)
static const AVCodecDefault ac3_defaults[]
AC-3 encoder private context.
int num_blocks
number of blocks per frame
AC-3 encoder float/fixed template.
common internal api header.
static const AVClass ac3enc_class
static void apply_window(void *dsp, float *output, const float *input, const float *window, unsigned int len)
static const AVOption ac3_options[]
AVCodecContext * avctx
parent AVCodecContext
void ff_ac3_float_mdct_end(AC3EncodeContext *s)
Finalize MDCT and free allocated memory.
AC-3 encoder & E-AC-3 encoder common header.
static enum AVSampleFormat sample_fmts[]
int32_t * fixed_coef_buffer
av_cold int ff_ac3_encode_init(AVCodecContext *avctx)