Go to the documentation of this file.
37 float prev[2] = { 0 };
45 beta = 1.0f - (4915.0f/32768.0f);
50 for (j = 0; j <
f->channels; j++) {
55 if (i < f->start_band ||
i >=
f->end_band) {
73 prev[j] += beta *
value;
81 for (
i =
f->start_band; i < f->end_band;
i++) {
86 for (j = 0; j <
f->channels; j++) {
91 offset = (q2 + 0.5f) * (1 << (14 -
f->fine_bits[
i])) / 16384.0
f - 0.5
f;
102 for (priority = 0; priority < 2; priority++) {
103 for (
i =
f->start_band; i < f->end_band && bits_left >=
f->channels;
i++) {
107 for (j = 0; j <
f->channels; j++) {
111 offset = (q2 - 0.5f) * (1 << (14 -
f->fine_bits[
i] - 1)) / 16384.0
f;
121 int i,
diff = 0, tf_select = 0, tf_changed = 0, tf_select_bit;
122 int consumed,
bits =
f->transient ? 2 : 4;
125 tf_select_bit = (
f->size != 0 && consumed+
bits+1 <=
f->framebits);
127 for (
i =
f->start_band; i < f->end_band;
i++) {
128 if (consumed+
bits+tf_select_bit <= f->framebits) {
134 bits =
f->transient ? 4 : 5;
141 for (
i =
f->start_band; i < f->end_band;
i++) {
150 for (
i =
f->start_band; i < f->end_band;
i++) {
162 const int T0 =
block->pf_period_old;
163 const int T1 =
block->pf_period;
168 float x0, x1, x2, x3, x4;
172 if (
block->pf_gains[0] == 0.0 &&
173 block->pf_gains_old[0] == 0.0)
176 g00 =
block->pf_gains_old[0];
177 g01 =
block->pf_gains_old[1];
178 g02 =
block->pf_gains_old[2];
179 g10 =
block->pf_gains[0];
180 g11 =
block->pf_gains[1];
181 g12 =
block->pf_gains[2];
190 x0 =
data[
i - T1 + 2];
193 (1.0 -
w) * g01 * (
data[
i - T0 - 1] +
data[
i - T0 + 1]) +
194 (1.0 -
w) * g02 * (
data[
i - T0 - 2] +
data[
i - T0 + 2]) +
196 w * g11 * (x1 + x3) +
207 int len =
f->blocksize *
f->blocks;
221 if (
block->pf_gains[0] > FLT_EPSILON && filter_len > 0)
237 memset(
f->block[0].pf_gains_new, 0,
sizeof(
f->block[0].pf_gains_new));
238 memset(
f->block[1].pf_gains_new, 0,
sizeof(
f->block[1].pf_gains_new));
240 if (
f->start_band == 0 && consumed + 16 <=
f->framebits) {
242 if (has_postfilter) {
244 int tapset, octave,
period;
252 for (
i = 0;
i < 2;
i++) {
272 for (
i =
f->start_band; i < f->end_band;
i++) {
277 float thresh, sqrt_1;
282 thresh =
exp2f(-1.0 - 0.125
f * depth);
287 prev[0] =
block->prev_energy[0][
i];
288 prev[1] =
block->prev_energy[1][
i];
289 if (
f->channels == 1) {
295 Ediff =
block->energy[
i] -
FFMIN(prev[0], prev[1]);
296 Ediff =
FFMAX(0, Ediff);
304 for (k = 0; k < 1 <<
f->size; k++) {
306 if (!(
block->collapse_masks[
i] & 1 << k)) {
309 xptr[(j <<
f->size) + k] = (
celt_rng(
f) & 0x8000) ?
r : -
r;
322 int start_band,
int end_band)
324 int i, j, downmix = 0;
333 if (start_band < 0 || start_band > end_band || end_band >
CELT_MAX_BANDS) {
335 start_band, end_band);
344 f->start_band = start_band;
345 f->end_band = end_band;
356 if (!
f->output_channels)
359 for (
i = 0;
i <
f->channels;
i++) {
360 memset(
f->block[
i].coeffs, 0,
sizeof(
f->block[
i].coeffs));
361 memset(
f->block[
i].collapse_masks, 0,
sizeof(
f->block[
i].collapse_masks));
367 if (consumed >=
f->framebits)
369 else if (consumed == 1)
374 consumed =
f->framebits;
382 if (
f->size != 0 && consumed+3 <=
f->framebits)
385 f->blocks =
f->transient ? 1 <<
f->size : 1;
388 imdct =
f->imdct[
f->transient ? 0 :
f->size];
392 f->block[0].energy[
i] =
FFMAX(
f->block[0].energy[
i],
f->block[1].energy[
i]);
401 if (
f->anticollapse_needed)
408 for (
i = 0;
i <
f->channels;
i++) {
418 if (
f->output_channels <
f->channels) {
419 f->dsp->vector_fmac_scalar(
f->block[0].coeffs,
f->block[1].coeffs, 1.0,
FFALIGN(
frame_size, 16));
421 }
else if (
f->output_channels >
f->channels)
422 memcpy(
f->block[1].coeffs,
f->block[0].coeffs,
frame_size *
sizeof(
float));
425 for (
i = 0;
i < 2;
i++) {
431 memset(
f->block[0].coeffs, 0,
sizeof(
f->block[0].coeffs));
432 memset(
f->block[1].coeffs, 0,
sizeof(
f->block[1].coeffs));
436 for (
i = 0;
i <
f->output_channels;
i++) {
440 for (j = 0; j <
f->blocks; j++) {
441 float *dst =
block->buf + 1024 + j *
f->blocksize;
462 memcpy(
f->block[1].energy,
f->block[0].energy,
sizeof(
f->block[0].energy));
464 for (
i = 0;
i < 2;
i++ ) {
468 memcpy(
block->prev_energy[1],
block->prev_energy[0],
sizeof(
block->prev_energy[0]));
469 memcpy(
block->prev_energy[0],
block->energy,
sizeof(
block->prev_energy[0]));
475 for (j = 0; j <
f->start_band; j++) {
477 block->energy[j] = 0.0;
481 block->energy[j] = 0.0;
497 for (
i = 0;
i < 2;
i++) {
503 memset(
block->energy, 0,
sizeof(
block->energy));
506 memset(
block->pf_gains, 0,
sizeof(
block->pf_gains));
507 memset(
block->pf_gains_old, 0,
sizeof(
block->pf_gains_old));
508 memset(
block->pf_gains_new, 0,
sizeof(
block->pf_gains_new));
544 if (output_channels != 1 && output_channels != 2) {
const float ff_celt_postfilter_taps[3][3]
static void celt_decode_coarse_energy(CeltFrame *f, OpusRangeCoder *rc)
static void celt_postfilter_apply_transition(CeltBlock *block, float *data)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
const uint8_t ff_celt_freq_bands[]
uint32_t ff_opus_rc_get_raw(OpusRangeCoder *rc, uint32_t count)
CELT: read 1-25 raw bits at the end of the frame, backwards byte-wise.
const float * ff_celt_window
void ff_celt_flush(CeltFrame *f)
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
const uint16_t ff_celt_model_tapset[]
av_cold int ff_mdct15_init(MDCT15Context **ps, int inverse, int N, double scale)
int av_cold ff_celt_pvq_init(CeltPVQ **pvq, int encode)
static av_always_inline uint32_t opus_rc_tell(const OpusRangeCoder *rc)
CELT: estimate bits of entropy that have thus far been consumed for the current CELT frame,...
const uint8_t ff_celt_coarse_energy_dist[4][2][42]
static int parse_postfilter(CeltFrame *f, OpusRangeCoder *rc, int consumed)
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
int flags
AV_CODEC_FLAG_*.
static void celt_postfilter(CeltFrame *f, CeltBlock *block)
int ff_celt_init(AVCodecContext *avctx, CeltFrame **f, int output_channels, int apply_phase_inv)
static av_always_inline void celt_renormalize_vector(float *X, int N, float gain)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint32_t ff_opus_rc_dec_uint(OpusRangeCoder *rc, uint32_t size)
CELT: read a uniform distribution.
#define CELT_SHORT_BLOCKSIZE
#define CELT_MAX_FINE_BITS
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode)
void av_cold ff_celt_pvq_uninit(CeltPVQ **pvq)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without period
static void celt_decode_tf_changes(CeltFrame *f, OpusRangeCoder *rc)
const uint8_t ff_celt_freq_range[]
#define CELT_ENERGY_SILENCE
static void celt_decode_fine_energy(CeltFrame *f, OpusRangeCoder *rc)
void ff_celt_free(CeltFrame **f)
static void celt_denormalize(CeltFrame *f, CeltBlock *block, float *data)
const float ff_celt_window2[120]
static av_always_inline uint32_t celt_rng(CeltFrame *f)
const int8_t ff_celt_tf_select[4][2][2][2]
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
const float ff_celt_beta_coef[]
uint32_t ff_opus_rc_dec_cdf(OpusRangeCoder *rc, const uint16_t *cdf)
int ff_opus_rc_dec_laplace(OpusRangeCoder *rc, uint32_t symbol, int decay)
#define CELT_MAX_LOG_BLOCKS
#define i(width, name, range_min, range_max)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
static void celt_decode_final_energy(CeltFrame *f, OpusRangeCoder *rc)
av_cold void ff_mdct15_uninit(MDCT15Context **ps)
#define CELT_POSTFILTER_MINPERIOD
int ff_celt_decode_frame(CeltFrame *f, OpusRangeCoder *rc, float **output, int channels, int frame_size, int start_band, int end_band)
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
#define FF_ARRAY_ELEMS(a)
void(* imdct_half)(struct MDCT15Context *s, float *dst, const float *src, ptrdiff_t stride)
main external API structure.
const uint16_t ff_celt_model_energy_small[]
av_cold void ff_opus_dsp_init(OpusDSP *ctx)
void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc)
const float ff_celt_alpha_coef[]
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
static void process_anticollapse(CeltFrame *f, CeltBlock *block, float *X)
static av_always_inline int diff(const uint32_t a, const uint32_t b)
static const int16_t alpha[]
av_cold AVFloatDSPContext * avpriv_float_dsp_alloc(int bit_exact)
Allocate a float DSP context.
The exact code depends on how similar the blocks are and how related they are to the block
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
uint32_t ff_opus_rc_dec_log(OpusRangeCoder *rc, uint32_t bits)
const float ff_celt_mean_energy[]
static int16_t block1[64]