Go to the documentation of this file.
34 #define RESTORE_PRED(sce, sfb) \
35 if (sce->ics.prediction_used[sfb]) {\
36 sce->ics.prediction_used[sfb] = 0;\
37 sce->band_type[sfb] = sce->band_alt[sfb];\
44 tmp.i = (
tmp.i + 0x00008000
U) & 0xFFFF0000U;
52 tmp.i = (
tmp.i + 0x00007FFF
U + (
tmp.i & 0x00010000
U >> 16)) & 0xFFFF0000
U;
67 const float a = 0.953125;
68 const float alpha = 0.90625;
69 const float k1 = ps->
k1;
70 const float r0 = ps->
r0, r1 = ps->
r1;
71 const float cor0 = ps->
cor0, cor1 = ps->
cor1;
72 const float var0 = ps->
var0, var1 = ps->
var1;
73 const float e0 = *coef - ps->
x_est;
74 const float e1 = e0 - k1 * r0;
125 for (sfb = 0; sfb < pmax; sfb++) {
126 for (k = sce->
ics.
swb_offset[sfb]; k < sce->ics.swb_offset[sfb + 1]; k++) {
143 for (
i = 1;
i < 31;
i++) {
153 int start,
w, w2,
g,
i, count = 0;
158 const int pmax =
FFMIN(pmax0, pmax1);
170 float ener0 = 0.0f, ener1 = 0.0f, ener01 = 0.0f;
172 if (sfb < PRED_SFB_START || sfb > pmax || sum != 2) {
180 float coef0 = sce0->
pcoeffs[start+(
w+w2)*128+
i];
181 float coef1 = sce1->
pcoeffs[start+(
w+w2)*128+
i];
182 ener0 += coef0*coef0;
183 ener1 += coef1*coef1;
184 ener01 += (coef0 + coef1)*(coef0 + coef1);
188 ener0, ener1,
ener01, 1, -1);
190 ener0, ener1,
ener01, 1, +1);
209 int i, max_group_id_c, max_frame = 0;
210 float avg_frame = 0.0f;
217 for (
i = 1;
i < 31;
i++) {
235 int sfb,
i, count = 0, cost_coeffs = 0, cost_pred = 0;
237 float *O34 = &
s->scoefs[128*0], *P34 = &
s->scoefs[128*1];
238 float *SENT = &
s->scoefs[128*2], *S34 = &
s->scoefs[128*3];
239 float *QERR = &
s->scoefs[128*4];
250 for (
i = 1;
i < 31;
i++)
258 int cost1, cost2, cb_p;
261 const int cb_min = sce->
zeroes[sfb] ? 0 : 1;
264 const int num_coeffs = sce->
ics.
swb_offset[sfb + 1] - start_coef;
265 const FFPsyBand *band = &
s->psy.ch[
s->cur_channel].psy_bands[sfb];
273 s->abs_pow34(O34, &sce->
coeffs[start_coef], num_coeffs);
275 O34, num_coeffs, sce->
sf_idx[sfb],
277 cost_coeffs += cost1;
280 for (
i = 0;
i < num_coeffs;
i++)
282 s->abs_pow34(S34, SENT, num_coeffs);
292 for (
i = 0;
i < num_coeffs;
i++)
293 sce->
prcoeffs[start_coef +
i] += QERR[
i] != 0.0f ? (sce->
prcoeffs[start_coef +
i] - QERR[
i]) : 0.0f;
294 s->abs_pow34(P34, &sce->
prcoeffs[start_coef], num_coeffs);
300 P34, num_coeffs, sce->
sf_idx[sfb],
302 for (
i = 0;
i < num_coeffs;
i++)
303 dist_spec_err += (O34[
i] - P34[
i])*(O34[
i] - P34[
i]);
305 dist2 += dist_spec_err;
319 if (count && cost_coeffs < cost_pred) {
345 for (sfb = 0; sfb < pmax; sfb++)
static void update_pred_resets(SingleChannelElement *sce)
enum BandType band_alt[128]
alternative band type (used by encoder)
#define FF_PROFILE_AAC_MAIN
uint8_t zeroes[128]
band is not coded (used by encoder)
static void reset_all_predictors(PredictorState *ps)
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
INTFLOAT pcoeffs[1024]
coefficients for IMDCT, pristine
int num_swb
number of scalefactor window bands
static void predict(PredictorState *ps, float *coef, float *rcoef, int set)
uint8_t prediction_used[41]
IndividualChannelStream ics
int predictor_reset_count[31]
used by encoder to count prediction resets
static void set(uint8_t *a[], int ch, int index, int ch_count, enum AVSampleFormat f, double v)
static float flt16_trunc(float pf)
@ NOISE_BT
Spectral data are scaled white noise not coded in the bitstream.
INTFLOAT coeffs[1024]
coefficients for IMDCT, maybe processed
void ff_aac_apply_main_pred(AACEncContext *s, SingleChannelElement *sce)
const uint8_t * swb_sizes
table of scalefactor band sizes for a particular window
@ INTENSITY_BT2
Scalefactor data are intensity stereo positions (out of phase).
Individual Channel Stream.
const uint16_t * swb_offset
table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular wind...
static void reset_predict_state(PredictorState *ps)
single band psychoacoustic information
PredictorState predictor_state[MAX_PREDICTORS]
int sf_idx[128]
scalefactor indices (used by encoder)
const uint8_t ff_aac_pred_sfb_max[]
SingleChannelElement ch[2]
void ff_aac_adjust_common_pred(AACEncContext *s, ChannelElement *cpe)
static int update_counters(IndividualChannelStream *ics, int inc)
int common_window
Set if channels share a common 'IndividualChannelStream' in bitstream.
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
AAC_FLOAT prcoeffs[1024]
Main prediction coefs (used by encoder)
#define quantize_and_encode_band_cost( s, pb, in, quant, scaled, size, scale_idx, cb, lambda, uplim, bits, energy, rtz)
static float flt16_round(float pf)
Single Channel Element - used for both SCE and LFE elements.
#define i(width, name, range_min, range_max)
static int find_min_book(float maxval, int sf)
channel element - generic struct for SCE/CPE/CCE/LFE
static double erf(double z)
erf function Algorithm taken from the Boost project, source: http://www.boost.org/doc/libs/1_46_1/boo...
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
@ RESERVED_BT
Band types following are encoded differently from others.
struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe, int start, int w, int g, float ener0, float ener1, float ener01, int use_pcoeffs, int phase)
enum WindowSequence window_sequence[2]
void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce)
Encoder predictors data.
static float flt16_even(float pf)
static float find_max_val(int group_len, int swb_size, const float *scaled)
static const int16_t alpha[]
void ff_aac_search_for_pred(AACEncContext *s, SingleChannelElement *sce)
static void reset_predictor_group(SingleChannelElement *sce, int group_num)
uint8_t max_sfb
number of scalefactor bands per group
enum BandType band_type[128]
band types
int predictor_reset_group
#define RESTORE_PRED(sce, sfb)
#define PRED_RESET_FRAME_MIN
int predictor_initialized