FFmpeg
|
ra144enc.c
Go to the documentation of this file.
void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs, const float *in, int buffer_length, int filter_length)
LP synthesis filter.
Definition: celp_filters.c:84
Definition: put_bits.h:41
must be printed separately If there s no standard function for printing the type you the WRITE_1D_FUNC_ARGV macro is a very quick way to create one See libavcodec dv_tablegen c for an example The h file This file should the initialization functions should not do and instead of the variable declarations the generated *_tables h file should be included Since that will be generated in the build the path must be i e not Makefile changes To make the automatic table creation work
Definition: tablegen.txt:45
static int adaptive_cb_search(const int16_t *adapt_cb, float *work, const float *coefs, float *data)
Search the adaptive codebook for the best entry and gain and remove its contribution from input data...
Definition: ra144enc.c:197
int ff_lpc_calc_coefs(LPCContext *s, const int32_t *samples, int blocksize, int min_order, int max_order, int precision, int32_t coefs[][MAX_LPC_ORDER], int *shift, enum FFLPCType lpc_type, int lpc_passes, int omethod, int max_shift, int zero_shift)
Calculate LPC coefficients for multiple orders.
Definition: lpc.c:170
static int quantize(int value, const int16_t *table, unsigned int size)
Quantize a value by searching a sorted table for the element with the nearest value.
Definition: ra144enc.c:88
static av_cold int ra144_encode_close(AVCodecContext *avctx)
Definition: ra144enc.c:38
int16_t adapt_cb[146+2]
Adaptive codebook, its size is two units bigger to avoid a buffer overflow.
Definition: ra144.h:59
static void orthogonalize(float *v, const float *u)
Orthogonalize a vector to another vector.
Definition: ra144enc.c:113
static void get_match_score(float *work, const float *coefs, float *vect, const float *ortho1, const float *ortho2, const float *data, float *score, float *gain)
Calculate match score and gain of an LPC-filtered vector with respect to input data, possibly othogonalizing it to up to 2 other vectors.
Definition: ra144enc.c:141
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
static int ra144_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: ra144enc.c:430
Definition: samplefmt.h:50
Definition: libavcodec/avcodec.h:371
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: libavcodec/avcodec.h:1073
Definition: ra144.h:36
void ff_subblock_synthesis(RA144Context *ractx, const int16_t *lpc_coefs, int cba_idx, int cb1_idx, int cb2_idx, int gval, int gain)
Definition: ra144.c:1697
unsigned int * lpc_coef[2]
LPC coefficients: lpc_coef[0] is the coefficients of the current frame and lpc_coef[1] of the previou...
Definition: ra144.h:48
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: libavcodec/avcodec.h:770
#define CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
Definition: libavcodec/avcodec.h:775
static const struct endianess table[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: libavutil/internal.h:123
Definition: avutil.h:144
static void put_bits(J2kEncoderContext *s, int val, int n)
put n times val bit
Definition: j2kenc.c:160
int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
Add a frame to the queue.
Definition: audio_frame_queue.c:43
external API header
static void fixed_cb_search(float *work, const float *coefs, float *data, int cba_idx, int *cb1_idx, int *cb2_idx)
Search the two fixed codebooks for the best entry and gain.
Definition: ra144enc.c:280
int ff_interp(RA144Context *ractx, int16_t *out, int a, int copyold, int energy)
Definition: ra144.c:1657
void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset)
Copy the last offset values of *source to *target.
Definition: ra144.c:1530
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
Definition: libavcodec/utils.c:1377
int frame_size
Number of samples per channel in an audio frame.
Definition: libavcodec/avcodec.h:1881
void ff_eval_coefs(int *coefs, const int *refl)
Evaluate the LPC filter coefficients from the reflection coefficients.
Definition: ra144.c:1593
static av_cold int ra144_encode_init(AVCodecContext *avctx)
Definition: ra144enc.c:47
struct RA144Context RA144Context
int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx)
Evaluate the reflection coefficients from the filter coefficients.
Definition: ra144.c:1545
unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy)
Definition: ra144.c:1678
av_cold int ff_lpc_init(LPCContext *s, int blocksize, int max_order, enum FFLPCType lpc_type)
Initialize LPCContext.
Definition: lpc.c:258
static void find_best_vect(float *work, const float *coefs, const int8_t cb[][BLOCKSIZE], const float *ortho1, const float *ortho2, float *data, int *idx, float *gain)
Find the best vector of a fixed codebook by applying an LPC filter to codebook entries, possibly othogonalizing them to up to 2 other vectors and matching the results with input data.
Definition: ra144enc.c:245
common internal api header.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
Definition: put_bits.h:81
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
Definition: put_bits.h:54
int16_t curr_sblock[50]
The current subblock padded by the last 10 values of the previous one.
Definition: ra144.h:55
void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
Initialize AudioFrameQueue.
Definition: audio_frame_queue.c:27
void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, int *duration)
Remove frame(s) from the queue.
Definition: audio_frame_queue.c:74
void ff_af_queue_close(AudioFrameQueue *afq)
Close AudioFrameQueue.
Definition: audio_frame_queue.c:35
Filter the word “frame” indicates either a video frame or a group of audio samples
Definition: filter_design.txt:2
static void create_adapt_vect(float *vect, const int16_t *cb, int lag)
Create a vector from the adaptive codebook at a given lag value.
Definition: ra144enc.c:174
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: libavcodec/avcodec.h:1044
static void ra144_encode_subblock(RA144Context *ractx, const int16_t *sblock_data, const int16_t *lpc_coefs, unsigned int rms, PutBitContext *pb)
Encode a subblock of the current frame.
Definition: ra144enc.c:329
bitstream writer API
Generated on Fri Dec 20 2024 06:56:05 for FFmpeg by 1.8.11