Go to the documentation of this file.
39 #define TNS_Q_BITS_IS8 4
42 #define TNS_ENABLE_COEF_COMPRESSION
45 #define TNS_GAIN_THRESHOLD_LOW 1.4f
46 #define TNS_GAIN_THRESHOLD_HIGH 1.16f*TNS_GAIN_THRESHOLD_LOW
51 const int low_idx = c_bits ? 4 : 2;
52 const int shift_val = c_bits ? 8 : 4;
53 const int high_idx = c_bits ? 11 : 5;
54 #ifndef TNS_ENABLE_COEF_COMPRESSION
57 for (
i = 0;
i < order;
i++)
58 if (coef[
i] >= low_idx && coef[
i] <= high_idx)
60 for (
i = 0;
i < order;
i++)
61 coef[
i] -= (coef[
i] > high_idx) ? shift_val : 0;
73 int i,
w,
filt, coef_compress = 0, coef_len;
94 coef_len = c_bits + 3 - coef_compress;
106 int w,
filt, m,
i, top, order, bottom, start,
end,
size, inc;
135 for (m = 0; m <
size; m++, start += inc) {
136 for (
i = 1;
i <=
FFMIN(m, order);
i++) {
152 for (
i = 0;
i < order;
i++) {
154 lpc[
i] = quant_arr[idx[
i]];
169 const int sfb_start = av_clip(
tns_min_sfb[is8][
s->samplerate_index], 0, mmm);
170 const int sfb_end = av_clip(sce->
ics.
num_swb, 0, mmm);
174 const int sfb_len = sfb_end - sfb_start;
177 if (coef_len <= 0 || sfb_len <= 0) {
183 float en[2] = {0.0f, 0.0f};
184 int oc_start = 0, os_start = 0;
188 FFPsyBand *band = &
s->psy.ch[
s->cur_channel].psy_bands[
w*16+
g];
189 if (
g > sfb_start + (sfb_len/2))
197 coef_len, order, coefs);
#define TNS_GAIN_THRESHOLD_HIGH
static av_cold int end(AVCodecContext *avctx)
int coef_idx[8][4][TNS_MAX_ORDER]
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static int AAC_RENAME() compute_lpc_coefs(const LPC_TYPE *autoc, int max_order, LPC_TYPE *lpc, int lpc_stride, int fail, int normalize)
Levinson-Durbin recursion.
static int compress_coeffs(int *coef, int order, int c_bits)
INTFLOAT pcoeffs[1024]
coefficients for IMDCT, pristine
int num_swb
number of scalefactor window bands
IndividualChannelStream ics
INTFLOAT coeffs[1024]
coefficients for IMDCT, maybe processed
Individual Channel Stream.
INTFLOAT coef[8][4][TNS_MAX_ORDER]
const uint16_t * swb_offset
table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular wind...
void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce)
single band psychoacoustic information
void ff_aac_encode_tns_info(AACEncContext *s, SingleChannelElement *sce)
Encode TNS data.
double ff_lpc_calc_ref_coefs_f(LPCContext *s, const float *samples, int len, int order, double *ref)
#define FF_PROFILE_AAC_LOW
static const int8_t filt[NUMTAPS]
static int quant_array_idx(const float val, const float *arr, const int num)
static const uint8_t *const tns_min_sfb[2]
Single Channel Element - used for both SCE and LFE elements.
#define i(width, name, range_min, range_max)
void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
LPCContext lpc
used by TNS
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
enum WindowSequence window_sequence[2]
static void quantize_coefs(double *coef, int *idx, float *lpc, int order, int c_bits)
uint8_t max_sfb
number of scalefactor bands per group
static const INTFLOAT *const tns_tmp2_map[4]