Merge remote-tracking branch 'qatar/master'

* qatar/master:
  aacenc: Fix LONG_START windowing.
  aacenc: Fix a bug where deinterleaved samples were stored in the wrong place.
  avplay: use the correct array size for stride.
  lavc: extend doxy for avcodec_alloc_context3().
  APIchanges: mention avcodec_alloc_context()/2/3
  avcodec_align_dimensions2: set only 4 linesizes, not AV_NUM_DATA_POINTERS.
  aacsbr: ARM NEON optimised sbrdsp functions
  aacsbr: align some arrays
  aacsbr: move some simdable loops to function pointers
  cosmetics: Remove extra newlines at EOF

Conflicts:
	libavcodec/utils.c
	libavfilter/formats.c
	libavutil/mem.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-01-29 00:34:59 +01:00
commit c065255bba
104 changed files with 851 additions and 240 deletions

View File

@ -223,6 +223,8 @@ API changes, most recent first:
2011-07-10 - 0b950fe - lavc 53.8.0
Add avcodec_open2(), deprecate avcodec_open().
Add avcodec_alloc_context3. Deprecate avcodec_alloc_context() and
avcodec_alloc_context2().
2011-07-01 - b442ca6 - lavf 53.5.0 - avformat.h
Add function av_get_output_timestamp().

View File

@ -935,4 +935,3 @@ AVCodec ff_fourxm_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
};

View File

@ -56,7 +56,8 @@ OBJS-$(CONFIG_VDPAU) += vdpau.o
OBJS-$(CONFIG_A64MULTI_ENCODER) += a64multienc.o elbg.o
OBJS-$(CONFIG_A64MULTI5_ENCODER) += a64multienc.o elbg.o
OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps.o \
aacadtsdec.o mpeg4audio.o kbdwin.o
aacadtsdec.o mpeg4audio.o kbdwin.o \
sbrdsp.o
OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
aacpsy.o aactab.o \
psymodel.o iirfilter.o \

View File

@ -200,8 +200,8 @@ WINDOW_FUNC(long_start)
float *out = sce->ret;
dsp->vector_fmul(out, audio, lwindow, 1024);
memcpy(out + 1024, audio, sizeof(out[0]) * 448);
dsp->vector_fmul_reverse(out + 1024 + 448, audio, swindow, 128);
memcpy(out + 1024, audio + 1024, sizeof(out[0]) * 448);
dsp->vector_fmul_reverse(out + 1024 + 448, audio + 1024 + 448, swindow, 128);
memset(out + 1024 + 576, 0, sizeof(out[0]) * 448);
}
@ -487,10 +487,10 @@ static void deinterleave_input_samples(AACEncContext *s,
const float *sptr = samples + channel_map[ch];
/* copy last 1024 samples of previous frame to the start of the current frame */
memcpy(&s->planar_samples[ch][0], &s->planar_samples[ch][1024], 1024 * sizeof(s->planar_samples[0][0]));
memcpy(&s->planar_samples[ch][1024], &s->planar_samples[ch][2048], 1024 * sizeof(s->planar_samples[0][0]));
/* deinterleave */
for (i = 1024; i < 1024 * 2; i++) {
for (i = 2048; i < 3072; i++) {
s->planar_samples[ch][i] = *sptr;
sptr += sinc;
}

View File

@ -32,6 +32,7 @@
#include "aacsbrdata.h"
#include "fft.h"
#include "aacps.h"
#include "sbrdsp.h"
#include "libavutil/libm.h"
#include "libavutil/avassert.h"
@ -144,6 +145,7 @@ av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr)
ff_mdct_init(&sbr->mdct, 7, 1, 1.0 / (64 * mdct_scale));
ff_mdct_init(&sbr->mdct_ana, 7, 1, -2.0 * mdct_scale);
ff_ps_ctx_init(&sbr->ps);
ff_sbrdsp_init(&sbr->dsp);
}
av_cold void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr)
@ -1143,33 +1145,21 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
* @param x pointer to the beginning of the first sample window
* @param W array of complex-valued samples split into subbands
*/
static void sbr_qmf_analysis(DSPContext *dsp, FFTContext *mdct, const float *in, float *x,
static void sbr_qmf_analysis(DSPContext *dsp, FFTContext *mdct,
SBRDSPContext *sbrdsp, const float *in, float *x,
float z[320], float W[2][32][32][2])
{
int i, k;
int i;
memcpy(W[0], W[1], sizeof(W[0]));
memcpy(x , x+1024, (320-32)*sizeof(x[0]));
memcpy(x+288, in, 1024*sizeof(x[0]));
for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames
// are not supported
dsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320);
for (k = 0; k < 64; k++) {
float f = z[k] + z[k + 64] + z[k + 128] + z[k + 192] + z[k + 256];
z[k] = f;
}
//Shuffle to IMDCT
z[64] = z[0];
for (k = 1; k < 32; k++) {
z[64+2*k-1] = z[ k];
z[64+2*k ] = -z[64-k];
}
z[64+63] = z[32];
sbrdsp->sum64x5(z);
sbrdsp->qmf_pre_shuffle(z);
mdct->imdct_half(mdct, z, z+64);
for (k = 0; k < 32; k++) {
W[1][i][k][0] = -z[63-k];
W[1][i][k][1] = z[k];
}
sbrdsp->qmf_post_shuffle(W[1][i], z);
x += 32;
}
}
@ -1179,6 +1169,7 @@ static void sbr_qmf_analysis(DSPContext *dsp, FFTContext *mdct, const float *in,
* (14496-3 sp04 p206)
*/
static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct,
SBRDSPContext *sbrdsp,
float *out, float X[2][38][64],
float mdct_buf[2][64],
float *v0, int *v_off, const unsigned int div)
@ -1202,20 +1193,12 @@ static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct,
X[0][i][32+n] = X[1][i][31-n];
}
mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
for (n = 0; n < 32; n++) {
v[ n] = mdct_buf[0][63 - 2*n];
v[63 - n] = -mdct_buf[0][62 - 2*n];
}
sbrdsp->qmf_deint_neg(v, mdct_buf[0]);
} else {
for (n = 1; n < 64; n+=2) {
X[1][i][n] = -X[1][i][n];
}
sbrdsp->neg_odd_64(X[1][i]);
mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
mdct->imdct_half(mdct, mdct_buf[1], X[1][i]);
for (n = 0; n < 64; n++) {
v[ n] = -mdct_buf[0][63 - n] + mdct_buf[1][ n ];
v[127 - n] = mdct_buf[0][63 - n] + mdct_buf[1][ n ];
}
sbrdsp->qmf_deint_bfly(v, mdct_buf[1], mdct_buf[0]);
}
dsp->vector_fmul_add(out, v , sbr_qmf_window , zero64, 64 >> div);
dsp->vector_fmul_add(out, v + ( 192 >> div), sbr_qmf_window + ( 64 >> div), out , 64 >> div);
@ -1231,45 +1214,20 @@ static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct,
}
}
static void autocorrelate(const float x[40][2], float phi[3][2][2], int lag)
{
int i;
float real_sum = 0.0f;
float imag_sum = 0.0f;
if (lag) {
for (i = 1; i < 38; i++) {
real_sum += x[i][0] * x[i+lag][0] + x[i][1] * x[i+lag][1];
imag_sum += x[i][0] * x[i+lag][1] - x[i][1] * x[i+lag][0];
}
phi[2-lag][1][0] = real_sum + x[ 0][0] * x[lag][0] + x[ 0][1] * x[lag][1];
phi[2-lag][1][1] = imag_sum + x[ 0][0] * x[lag][1] - x[ 0][1] * x[lag][0];
if (lag == 1) {
phi[0][0][0] = real_sum + x[38][0] * x[39][0] + x[38][1] * x[39][1];
phi[0][0][1] = imag_sum + x[38][0] * x[39][1] - x[38][1] * x[39][0];
}
} else {
for (i = 1; i < 38; i++) {
real_sum += x[i][0] * x[i][0] + x[i][1] * x[i][1];
}
phi[2][1][0] = real_sum + x[ 0][0] * x[ 0][0] + x[ 0][1] * x[ 0][1];
phi[1][0][0] = real_sum + x[38][0] * x[38][0] + x[38][1] * x[38][1];
}
}
/** High Frequency Generation (14496-3 sp04 p214+) and Inverse Filtering
* (14496-3 sp04 p214)
* Warning: This routine does not seem numerically stable.
*/
static void sbr_hf_inverse_filter(float (*alpha0)[2], float (*alpha1)[2],
static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
float (*alpha0)[2], float (*alpha1)[2],
const float X_low[32][40][2], int k0)
{
int k;
for (k = 0; k < k0; k++) {
float phi[3][2][2], dk;
LOCAL_ALIGNED_16(float, phi, [3], [2][2]);
float dk;
autocorrelate(X_low[k], phi, 0);
autocorrelate(X_low[k], phi, 1);
autocorrelate(X_low[k], phi, 2);
dsp->autocorrelate(X_low[k], phi);
dk = phi[2][1][0] * phi[1][0][0] -
(phi[1][1][0] * phi[1][1][0] + phi[1][1][1] * phi[1][1][1]) / 1.000001f;
@ -1365,12 +1323,11 @@ static int sbr_hf_gen(AACContext *ac, SpectralBandReplication *sbr,
const float bw_array[5], const uint8_t *t_env,
int bs_num_env)
{
int i, j, x;
int j, x;
int g = 0;
int k = sbr->kx[1];
for (j = 0; j < sbr->num_patches; j++) {
for (x = 0; x < sbr->patch_num_subbands[j]; x++, k++) {
float alpha[4];
const int p = sbr->patch_start_subband[j] + x;
while (g <= sbr->n_q && k >= sbr->f_tablenoise[g])
g++;
@ -1382,26 +1339,10 @@ static int sbr_hf_gen(AACContext *ac, SpectralBandReplication *sbr,
return -1;
}
alpha[0] = alpha1[p][0] * bw_array[g] * bw_array[g];
alpha[1] = alpha1[p][1] * bw_array[g] * bw_array[g];
alpha[2] = alpha0[p][0] * bw_array[g];
alpha[3] = alpha0[p][1] * bw_array[g];
for (i = 2 * t_env[0]; i < 2 * t_env[bs_num_env]; i++) {
const int idx = i + ENVELOPE_ADJUSTMENT_OFFSET;
X_high[k][idx][0] =
X_low[p][idx - 2][0] * alpha[0] -
X_low[p][idx - 2][1] * alpha[1] +
X_low[p][idx - 1][0] * alpha[2] -
X_low[p][idx - 1][1] * alpha[3] +
X_low[p][idx][0];
X_high[k][idx][1] =
X_low[p][idx - 2][1] * alpha[0] +
X_low[p][idx - 2][0] * alpha[1] +
X_low[p][idx - 1][1] * alpha[2] +
X_low[p][idx - 1][0] * alpha[3] +
X_low[p][idx][1];
}
sbr->dsp.hf_gen(X_high[k] + ENVELOPE_ADJUSTMENT_OFFSET,
X_low[p] + ENVELOPE_ADJUSTMENT_OFFSET,
alpha0[p], alpha1[p], bw_array[g],
2 * t_env[0], 2 * t_env[bs_num_env]);
}
}
if (k < sbr->m[1] + sbr->kx[1])
@ -1502,7 +1443,8 @@ static void sbr_mapping(AACContext *ac, SpectralBandReplication *sbr,
static void sbr_env_estimate(float (*e_curr)[48], float X_high[64][40][2],
SpectralBandReplication *sbr, SBRData *ch_data)
{
int e, i, m;
int e, m;
int kx1 = sbr->kx[1];
if (sbr->bs_interpol_freq) {
for (e = 0; e < ch_data->bs_num_env; e++) {
@ -1511,12 +1453,7 @@ static void sbr_env_estimate(float (*e_curr)[48], float X_high[64][40][2],
int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
for (m = 0; m < sbr->m[1]; m++) {
float sum = 0.0f;
for (i = ilb; i < iub; i++) {
sum += X_high[m + sbr->kx[1]][i][0] * X_high[m + sbr->kx[1]][i][0] +
X_high[m + sbr->kx[1]][i][1] * X_high[m + sbr->kx[1]][i][1];
}
float sum = sbr->dsp.sum_square(X_high[m+kx1] + ilb, iub - ilb);
e_curr[e][m] = sum * recip_env_size;
}
}
@ -1534,14 +1471,11 @@ static void sbr_env_estimate(float (*e_curr)[48], float X_high[64][40][2],
const int den = env_size * (table[p + 1] - table[p]);
for (k = table[p]; k < table[p + 1]; k++) {
for (i = ilb; i < iub; i++) {
sum += X_high[k][i][0] * X_high[k][i][0] +
X_high[k][i][1] * X_high[k][i][1];
}
sum += sbr->dsp.sum_square(X_high[k] + ilb, iub - ilb);
}
sum /= den;
for (k = table[p]; k < table[p + 1]; k++) {
e_curr[e][k - sbr->kx[1]] = sum;
e_curr[e][k - kx1] = sum;
}
}
}
@ -1652,55 +1586,35 @@ static void sbr_hf_assemble(float Y[2][38][64][2], const float X_high[64][40][2]
for (e = 0; e < ch_data->bs_num_env; e++) {
for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) {
int phi_sign = (1 - 2*(kx & 1));
LOCAL_ALIGNED_16(float, g_filt_tab, [48]);
LOCAL_ALIGNED_16(float, q_filt_tab, [48]);
float *g_filt, *q_filt;
if (h_SL && e != e_a[0] && e != e_a[1]) {
g_filt = g_filt_tab;
q_filt = q_filt_tab;
for (m = 0; m < m_max; m++) {
const int idx1 = i + h_SL;
float g_filt = 0.0f;
for (j = 0; j <= h_SL; j++)
g_filt += g_temp[idx1 - j][m] * h_smooth[j];
Y[1][i][m + kx][0] =
X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][0] * g_filt;
Y[1][i][m + kx][1] =
X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][1] * g_filt;
g_filt[m] = 0.0f;
q_filt[m] = 0.0f;
for (j = 0; j <= h_SL; j++) {
g_filt[m] += g_temp[idx1 - j][m] * h_smooth[j];
q_filt[m] += q_temp[idx1 - j][m] * h_smooth[j];
}
}
} else {
for (m = 0; m < m_max; m++) {
const float g_filt = g_temp[i + h_SL][m];
Y[1][i][m + kx][0] =
X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][0] * g_filt;
Y[1][i][m + kx][1] =
X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][1] * g_filt;
}
g_filt = g_temp[i + h_SL];
q_filt = q_temp[i];
}
sbr->dsp.hf_g_filt(Y[1][i] + kx, X_high + kx, g_filt, m_max,
i + ENVELOPE_ADJUSTMENT_OFFSET);
if (e != e_a[0] && e != e_a[1]) {
for (m = 0; m < m_max; m++) {
indexnoise = (indexnoise + 1) & 0x1ff;
if (sbr->s_m[e][m]) {
Y[1][i][m + kx][0] +=
sbr->s_m[e][m] * phi[0][indexsine];
Y[1][i][m + kx][1] +=
sbr->s_m[e][m] * (phi[1][indexsine] * phi_sign);
} else {
float q_filt;
if (h_SL) {
const int idx1 = i + h_SL;
q_filt = 0.0f;
for (j = 0; j <= h_SL; j++)
q_filt += q_temp[idx1 - j][m] * h_smooth[j];
} else {
q_filt = q_temp[i][m];
}
Y[1][i][m + kx][0] +=
q_filt * sbr_noise_table[indexnoise][0];
Y[1][i][m + kx][1] +=
q_filt * sbr_noise_table[indexnoise][1];
}
phi_sign = -phi_sign;
}
sbr->dsp.hf_apply_noise[indexsine](Y[1][i] + kx, sbr->s_m[e],
q_filt, indexnoise,
kx, m_max);
} else {
indexnoise = (indexnoise + m_max) & 0x1ff;
for (m = 0; m < m_max; m++) {
Y[1][i][m + kx][0] +=
sbr->s_m[e][m] * phi[0][indexsine];
@ -1709,6 +1623,7 @@ static void sbr_hf_assemble(float Y[2][38][64][2], const float X_high[64][40][2]
phi_sign = -phi_sign;
}
}
indexnoise = (indexnoise + m_max) & 0x1ff;
indexsine = (indexsine + 1) & 3;
}
}
@ -1728,12 +1643,12 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
}
for (ch = 0; ch < nch; ch++) {
/* decode channel */
sbr_qmf_analysis(&ac->dsp, &sbr->mdct_ana, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
sbr_qmf_analysis(&ac->dsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
(float*)sbr->qmf_filter_scratch,
sbr->data[ch].W);
sbr_lf_gen(ac, sbr, sbr->X_low, sbr->data[ch].W);
if (sbr->start) {
sbr_hf_inverse_filter(sbr->alpha0, sbr->alpha1, sbr->X_low, sbr->k[0]);
sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1, sbr->X_low, sbr->k[0]);
sbr_chirp(sbr, &sbr->data[ch]);
sbr_hf_gen(ac, sbr, sbr->X_high, sbr->X_low, sbr->alpha0, sbr->alpha1,
sbr->data[ch].bw_array, sbr->data[ch].t_env,
@ -1760,12 +1675,12 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
nch = 2;
}
sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, L, sbr->X[0], sbr->qmf_filter_scratch,
sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, L, sbr->X[0], sbr->qmf_filter_scratch,
sbr->data[0].synthesis_filterbank_samples,
&sbr->data[0].synthesis_filterbank_samples_offset,
downsampled);
if (nch == 2)
sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, R, sbr->X[1], sbr->qmf_filter_scratch,
sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, R, sbr->X[1], sbr->qmf_filter_scratch,
sbr->data[1].synthesis_filterbank_samples,
&sbr->data[1].synthesis_filterbank_samples_offset,
downsampled);

View File

@ -352,7 +352,8 @@ static DECLARE_ALIGNED(16, float, sbr_qmf_window_us)[640] = {
0.8537385600,
};
static const float sbr_noise_table[512][2] = {
/* First two entries repeated at end to simplify SIMD implementations. */
const DECLARE_ALIGNED(16, float, ff_sbr_noise_table)[][2] = {
{-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
{ 0.14130051758487, -0.95090983575689}, {-0.47005496701697, -0.37340549728647},
{ 0.80705063769351, 0.29653668284408}, {-0.38981478896926, 0.89572605717087},
@ -609,6 +610,7 @@ static const float sbr_noise_table[512][2] = {
{-0.93412041758744, 0.41374052024363}, { 0.96063943315511, 0.93116709541280},
{ 0.97534253457837, 0.86150930812689}, { 0.99642466504163, 0.70190043427512},
{-0.94705089665984, -0.29580042814306}, { 0.91599807087376, -0.98147830385781},
{-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
};
#endif /* AVCODEC_AACSBRDATA_H */

View File

@ -142,4 +142,3 @@ void ff_tilt_compensation(float *mem, float tilt, float *samples, int size)
samples[0] -= tilt * *mem;
*mem = new_tilt_mem;
}

View File

@ -465,4 +465,3 @@ void avcodec_register_all(void)
REGISTER_BSF (REMOVE_EXTRADATA, remove_extradata);
REGISTER_BSF (TEXT2MOVSUB, text2movsub);
}

View File

@ -1755,4 +1755,3 @@ AVCodec ff_als_decoder = {
.capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"),
};

View File

@ -1669,4 +1669,3 @@ static const float highpass_poles[2] = { -1.933105469, 0.935913085 };
static const float highpass_gain = 0.939819335;
#endif /* AVCODEC_AMRNBDATA_H */

View File

@ -1,6 +1,8 @@
OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \
arm/ac3dsp_arm.o
OBJS-$(CONFIG_AAC_DECODER) += arm/sbrdsp_init_arm.o
OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o \
ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o
@ -61,6 +63,8 @@ NEON-OBJS-$(CONFIG_H264PRED) += arm/h264pred_neon.o \
NEON-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_neon.o
NEON-OBJS-$(CONFIG_AAC_DECODER) += arm/sbrdsp_neon.o
NEON-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_neon.o \
arm/synth_filter_neon.o \

View File

@ -0,0 +1,70 @@
/*
* Copyright (c) 2012 Mans Rullgard
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "libavutil/attributes.h"
#include "libavcodec/sbrdsp.h"
void ff_sbr_sum64x5_neon(float *z);
float ff_sbr_sum_square_neon(float (*x)[2], int n);
void ff_sbr_neg_odd_64_neon(float *x);
void ff_sbr_qmf_pre_shuffle_neon(float *z);
void ff_sbr_qmf_post_shuffle_neon(float W[32][2], const float *z);
void ff_sbr_qmf_deint_neg_neon(float *v, const float *src);
void ff_sbr_qmf_deint_bfly_neon(float *v, const float *src0, const float *src1);
void ff_sbr_hf_g_filt_neon(float (*Y)[2], const float (*X_high)[40][2],
const float *g_filt, int m_max, int ixh);
void ff_sbr_hf_gen_neon(float (*X_high)[2], const float (*X_low)[2],
const float alpha0[2], const float alpha1[2],
float bw, int start, int end);
void ff_sbr_autocorrelate_neon(const float x[40][2], float phi[3][2][2]);
void ff_sbr_hf_apply_noise_0_neon(float Y[64][2], const float *s_m,
const float *q_filt, int noise,
int kx, int m_max);
void ff_sbr_hf_apply_noise_1_neon(float Y[64][2], const float *s_m,
const float *q_filt, int noise,
int kx, int m_max);
void ff_sbr_hf_apply_noise_2_neon(float Y[64][2], const float *s_m,
const float *q_filt, int noise,
int kx, int m_max);
void ff_sbr_hf_apply_noise_3_neon(float Y[64][2], const float *s_m,
const float *q_filt, int noise,
int kx, int m_max);
av_cold void ff_sbrdsp_init_arm(SBRDSPContext *s)
{
if (HAVE_NEON) {
s->sum64x5 = ff_sbr_sum64x5_neon;
s->sum_square = ff_sbr_sum_square_neon;
s->neg_odd_64 = ff_sbr_neg_odd_64_neon;
s->qmf_pre_shuffle = ff_sbr_qmf_pre_shuffle_neon;
s->qmf_post_shuffle = ff_sbr_qmf_post_shuffle_neon;
s->qmf_deint_neg = ff_sbr_qmf_deint_neg_neon;
s->qmf_deint_bfly = ff_sbr_qmf_deint_bfly_neon;
s->hf_g_filt = ff_sbr_hf_g_filt_neon;
s->hf_gen = ff_sbr_hf_gen_neon;
s->autocorrelate = ff_sbr_autocorrelate_neon;
s->hf_apply_noise[0] = ff_sbr_hf_apply_noise_0_neon;
s->hf_apply_noise[1] = ff_sbr_hf_apply_noise_1_neon;
s->hf_apply_noise[2] = ff_sbr_hf_apply_noise_2_neon;
s->hf_apply_noise[3] = ff_sbr_hf_apply_noise_3_neon;
}
}

View File

@ -0,0 +1,411 @@
/*
* Copyright (c) 2012 Mans Rullgard
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "asm.S"
function ff_sbr_sum64x5_neon, export=1
push {lr}
add r1, r0, # 64*4
add r2, r0, #128*4
add r3, r0, #192*4
add lr, r0, #256*4
mov r12, #64
1:
vld1.32 {q0}, [r0,:128]
vld1.32 {q1}, [r1,:128]!
vadd.f32 q0, q0, q1
vld1.32 {q2}, [r2,:128]!
vadd.f32 q0, q0, q2
vld1.32 {q3}, [r3,:128]!
vadd.f32 q0, q0, q3
vld1.32 {q8}, [lr,:128]!
vadd.f32 q0, q0, q8
vst1.32 {q0}, [r0,:128]!
subs r12, #4
bgt 1b
pop {pc}
endfunc
function ff_sbr_sum_square_neon, export=1
vmov.f32 q0, #0.0
1:
vld1.32 {q1}, [r0,:128]!
vmla.f32 q0, q1, q1
subs r1, r1, #2
bgt 1b
vadd.f32 d0, d0, d1
vpadd.f32 d0, d0, d0
NOVFP vmov.32 r0, d0[0]
bx lr
endfunc
function ff_sbr_neg_odd_64_neon, export=1
mov r1, r0
vmov.i32 q8, #1<<31
vld2.32 {q0,q1}, [r0,:128]!
veor q1, q1, q8
vld2.32 {q2,q3}, [r0,:128]!
.rept 3
vst2.32 {q0,q1}, [r1,:128]!
veor q3, q3, q8
vld2.32 {q0,q1}, [r0,:128]!
vst2.32 {q2,q3}, [r1,:128]!
veor q1, q1, q8
vld2.32 {q2,q3}, [r0,:128]!
.endr
veor q3, q3, q8
vst2.32 {q0,q1}, [r1,:128]!
vst2.32 {q2,q3}, [r1,:128]!
bx lr
endfunc
function ff_sbr_qmf_pre_shuffle_neon, export=1
add r1, r0, #60*4
add r2, r0, #64*4
vld1.32 {d0}, [r0,:64]!
vst1.32 {d0}, [r2,:64]!
mov r3, #-16
mov r12, #24
vmov.i32 q8, #1<<31
vld1.32 {q0}, [r1,:128], r3
vld1.32 {d2}, [r0,:64]!
1:
vld1.32 {d3,d4}, [r0,:128]!
vrev64.32 q0, q0
vld1.32 {q9}, [r1,:128], r3
veor q0, q0, q8
vld1.32 {d5,d6}, [r0,:128]!
vswp d0, d1
vrev64.32 q9, q9
vst2.32 {q0,q1}, [r2,:64]!
vmov q10, q2
veor q9, q9, q8
vmov d2, d6
vswp d18, d19
vld1.32 {q0}, [r1,:128], r3
vst2.32 {q9,q10}, [r2,:64]!
subs r12, r12, #8
bgt 1b
vld1.32 {d3,d4}, [r0,:128]!
vrev64.32 q0, q0
vld1.32 {q9}, [r1,:128], r3
veor q0, q0, q8
vld1.32 {d5}, [r0,:64]!
vswp d0, d1
vrev64.32 q9, q9
vst2.32 {q0,q1}, [r2,:64]!
vswp d4, d5
veor q1, q9, q8
vst2.32 {d3,d5}, [r2,:64]!
vst2.32 {d2[0],d4[0]}, [r2,:64]!
bx lr
endfunc
function ff_sbr_qmf_post_shuffle_neon, export=1
add r2, r1, #60*4
mov r3, #-16
mov r12, #32
vmov.i32 q8, #1<<31
vld1.32 {q0}, [r2,:128], r3
vld1.32 {q1}, [r1,:128]!
1:
pld [r2, #-32]
vrev64.32 q0, q0
vswp d2, d3
veor q0, q0, q8
vld1.32 {q2}, [r2,:128], r3
vld1.32 {q3}, [r1,:128]!
vst2.32 {d1,d3}, [r0,:128]!
vst2.32 {d0,d2}, [r0,:128]!
pld [r2, #-32]
vrev64.32 q2, q2
vswp d6, d7
veor q2, q2, q8
vld1.32 {q0}, [r2,:128], r3
vld1.32 {q1}, [r1,:128]!
vst2.32 {d5,d7}, [r0,:128]!
vst2.32 {d4,d6}, [r0,:128]!
subs r12, r12, #8
bgt 1b
bx lr
endfunc
function ff_sbr_qmf_deint_neg_neon, export=1
add r1, r1, #60*4
add r2, r0, #62*4
mov r3, #-16
mov r12, #32
vmov.i32 d2, #1<<31
1:
vld2.32 {d0,d1}, [r1,:128], r3
veor d0, d0, d2
vrev64.32 d1, d1
vst1.32 {d0}, [r2,:64]
vst1.32 {d1}, [r0,:64]!
sub r2, r2, #8
subs r12, r12, #2
bgt 1b
bx lr
endfunc
function ff_sbr_qmf_deint_bfly_neon, export=1
push {lr}
add r2, r2, #60*4
add r3, r0, #124*4
mov r12, #64
mov lr, #-16
1:
vld1.32 {q0}, [r1,:128]!
vld1.32 {q1}, [r2,:128], lr
vrev64.32 q2, q0
vrev64.32 q3, q1
vadd.f32 d3, d4, d3
vadd.f32 d2, d5, d2
vsub.f32 d0, d0, d7
vsub.f32 d1, d1, d6
vst1.32 {q1}, [r3,:128], lr
vst1.32 {q0}, [r0,:128]!
subs r12, r12, #4
bgt 1b
pop {pc}
endfunc
function ff_sbr_hf_g_filt_neon, export=1
ldr r12, [sp]
add r1, r1, r12, lsl #3
mov r12, #40*2*4
sub r3, r3, #1
vld2.32 {d2[],d3[]},[r2,:64]!
vld1.32 {d0}, [r1,:64], r12
1:
vld1.32 {d1}, [r1,:64], r12
vmul.f32 q3, q0, q1
vld2.32 {d2[],d3[]},[r2,:64]!
vld1.32 {d0}, [r1,:64], r12
vst1.32 {q3}, [r0,:64]!
subs r3, r3, #2
bgt 1b
it lt
bxlt lr
vmul.f32 d0, d0, d2
vst1.32 {d0}, [r0,:64]!
bx lr
endfunc
function ff_sbr_hf_gen_neon, export=1
NOVFP vld1.32 {d1[]}, [sp,:32]
VFP vdup.32 d1, d0[0]
vmul.f32 d0, d1, d1
vld1.32 {d3}, [r2,:64]
vld1.32 {d2}, [r3,:64]
vmul.f32 q0, q0, q1
ldrd r2, r3, [sp, #4*!HAVE_VFP_ARGS]
vtrn.32 d0, d1
vneg.f32 d18, d1
vtrn.32 d18, d1
add r0, r0, r2, lsl #3
add r1, r1, r2, lsl #3
sub r1, r1, #2*8
sub r3, r3, r2
vld1.32 {q1}, [r1,:128]!
1:
vld1.32 {q3}, [r1,:128]!
vrev64.32 q2, q1
vmov q8, q3
vrev64.32 d20, d3
vrev64.32 d21, d6
vmla.f32 q3, q1, d0[0]
vmla.f32 d6, d4, d18
vmla.f32 d7, d20, d18
vmla.f32 d6, d3, d0[1]
vmla.f32 d7, d16, d0[1]
vmla.f32 d6, d5, d1
vmla.f32 d7, d21, d1
vmov q1, q8
vst1.32 {q3}, [r0,:128]!
subs r3, r3, #2
bgt 1b
bx lr
endfunc
function ff_sbr_autocorrelate_neon, export=1
vld1.32 {q0}, [r0,:128]!
vmov.f32 q1, #0.0
vmov.f32 q3, #0.0
vmov.f32 d20, #0.0
vmul.f32 d21, d1, d1
vmov q8, q0
vmov q11, q0
mov r12, #36
1:
vld1.32 {q2}, [r0,:128]!
vrev64.32 q12, q2
vmla.f32 q10, q2, q2
vmla.f32 d2, d1, d4
vmla.f32 d3, d1, d24
vmla.f32 d6, d0, d4
vmla.f32 d7, d0, d24
vmla.f32 d2, d4, d5
vmla.f32 d3, d4, d25
vmla.f32 d6, d1, d5
vmla.f32 d7, d1, d25
vmov q0, q2
subs r12, r12, #2
bgt 1b
vld1.32 {q2}, [r0,:128]!
vrev64.32 q12, q2
vmla.f32 d2, d1, d4
vmla.f32 d3, d1, d24
vmla.f32 d6, d0, d4
vmla.f32 d7, d0, d24
vadd.f32 d20, d20, d21
vrev64.32 d18, d17
vmla.f32 d6, d1, d5
vmla.f32 d7, d1, d25
vmov q0, q1
vmla.f32 d0, d16, d17
vmla.f32 d1, d16, d18
vmla.f32 d2, d4, d5
vmla.f32 d3, d4, d25
vneg.f32 s15, s15
vmov d21, d20
vpadd.f32 d0, d0, d2
vpadd.f32 d7, d6, d7
vtrn.32 d1, d3
vsub.f32 d6, d1, d3
vmla.f32 d20, d22, d22
vmla.f32 d21, d4, d4
vtrn.32 d0, d6
vpadd.f32 d20, d20, d21
vst1.32 {q3}, [r1,:128]!
vst1.32 {d20[1]}, [r1,:32]
add r1, r1, #2*4
vst1.32 {d0}, [r1,:64]
add r1, r1, #4*4
vst1.32 {d20[0]}, [r1,:32]
bx lr
endfunc
function ff_sbr_hf_apply_noise_0_neon, export=1
vmov.i32 d3, #0
.Lhf_apply_noise_0:
push {r4,lr}
ldr r12, [sp, #12]
movrel r4, X(ff_sbr_noise_table)
add r3, r3, #1
bfc r3, #9, #23
sub r12, r12, #1
1:
add lr, r4, r3, lsl #3
vld2.32 {q0}, [r0,:64]
vld2.32 {q3}, [lr,:64]
vld1.32 {d2}, [r1,:64]!
vld1.32 {d18}, [r2,:64]!
vceq.f32 d16, d2, #0
veor d2, d2, d3
vmov q2, q0
vmla.f32 d0, d6, d18
vmla.f32 d1, d7, d18
vadd.f32 d4, d4, d2
add r3, r3, #2
bfc r3, #9, #23
vbif d0, d4, d16
vbif d1, d5, d16
vst2.32 {q0}, [r0,:64]!
subs r12, r12, #2
bgt 1b
blt 2f
add lr, r4, r3, lsl #3
vld1.32 {d0}, [r0,:64]
vld1.32 {d6}, [lr,:64]
vld1.32 {d2[]}, [r1,:32]!
vld1.32 {d3[]}, [r2,:32]!
vceq.f32 d4, d2, #0
veor d2, d2, d3
vmov d1, d0
vmla.f32 d0, d6, d3
vadd.f32 s2, s2, s4
vbif d0, d1, d4
vst1.32 {d0}, [r0,:64]!
2:
pop {r4,pc}
endfunc
function ff_sbr_hf_apply_noise_1_neon, export=1
ldr r12, [sp]
push {r4,lr}
lsl r12, r12, #31
eor lr, r12, #1<<31
vmov d3, r12, lr
.Lhf_apply_noise_1:
ldr r12, [sp, #12]
movrel r4, X(ff_sbr_noise_table)
add r3, r3, #1
bfc r3, #9, #23
sub r12, r12, #1
1:
add lr, r4, r3, lsl #3
vld2.32 {q0}, [r0,:64]
vld2.32 {q3}, [lr,:64]
vld1.32 {d2}, [r1,:64]!
vld1.32 {d18}, [r2,:64]!
vceq.f32 d16, d2, #0
veor d2, d2, d3
vmov q2, q0
vmla.f32 d0, d6, d18
vmla.f32 d1, d7, d18
vadd.f32 d5, d5, d2
add r3, r3, #2
bfc r3, #9, #23
vbif d0, d4, d16
vbif d1, d5, d16
vst2.32 {q0}, [r0,:64]!
subs r12, r12, #2
bgt 1b
blt 2f
add lr, r4, r3, lsl #3
vld1.32 {d0}, [r0,:64]
vld1.32 {d6}, [lr,:64]
vld1.32 {d2[]}, [r1,:32]!
vld1.32 {d18[]}, [r2,:32]!
vceq.f32 d4, d2, #0
veor d2, d2, d3
vmov d1, d0
vmla.f32 d0, d6, d18
vadd.f32 s3, s3, s5
vbif d0, d1, d4
vst1.32 {d0}, [r0,:64]!
2:
pop {r4,pc}
endfunc
function ff_sbr_hf_apply_noise_2_neon, export=1
vmov.i32 d3, #1<<31
b .Lhf_apply_noise_0
endfunc
function ff_sbr_hf_apply_noise_3_neon, export=1
ldr r12, [sp]
push {r4,lr}
lsl r12, r12, #31
eor lr, r12, #1<<31
vmov d3, lr, r12
b .Lhf_apply_noise_1
endfunc

View File

@ -117,4 +117,3 @@ void atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float
/* Update the delay buffer. */
memcpy(delayBuf, temp + nIn*2, 46*sizeof(float));
}

View File

@ -134,4 +134,3 @@ AVCodec ff_aura2_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Auravision Aura 2"),
};

View File

@ -3566,6 +3566,9 @@ AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
* @param codec if non-NULL, allocate private data and initialize defaults
* for the given codec. It is illegal to then call avcodec_open2()
* with a different codec.
* If NULL, then the codec-specific defaults won't be initialized,
* which may result in suboptimal default settings (this is
* important mainly for encoders, e.g. libx264).
*
* @return An AVCodecContext filled with default values or NULL on failure.
* @see avcodec_get_context_defaults

View File

@ -322,4 +322,3 @@ void free_vlc(VLC *vlc)
{
av_freep(&vlc->table);
}

View File

@ -266,4 +266,3 @@ AVCodec ff_cscd_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("CamStudio"),
};

View File

@ -294,4 +294,3 @@ const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec)
return NULL;
}

View File

@ -331,4 +331,3 @@ AVCodec ff_dxa_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"),
};

View File

@ -151,4 +151,3 @@ end:
ff_draw_horiz_band(s, 0, s->avctx->height);
return result;
}

View File

@ -448,4 +448,3 @@ AVHWAccel ff_h264_dxva2_hwaccel = {
.end_frame = end_frame,
.priv_data_size = sizeof(struct dxva2_picture_context),
};

View File

@ -270,4 +270,3 @@ AVHWAccel ff_mpeg2_dxva2_hwaccel = {
.end_frame = end_frame,
.priv_data_size = sizeof(struct dxva2_picture_context),
};

View File

@ -286,4 +286,3 @@ AVHWAccel ff_vc1_dxva2_hwaccel = {
.end_frame = end_frame,
.priv_data_size = sizeof(struct dxva2_picture_context),
};

View File

@ -376,4 +376,3 @@ AVCodec ff_escape124_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Escape 124"),
};

View File

@ -350,4 +350,3 @@ static void ff_fft_calc_c(FFTContext *s, FFTComplex *z)
{
fft_dispatch[s->nbits-2](z);
}

View File

@ -286,4 +286,3 @@ AVCodec ff_flashsv_encoder = {
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_BGR24, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video"),
};

View File

@ -51,4 +51,3 @@ void ff_h261_loop_filter(MpegEncContext *s){
s->dsp.h261_loop_filter(dest_cb, uvlinesize);
s->dsp.h261_loop_filter(dest_cr, uvlinesize);
}

View File

@ -332,4 +332,3 @@ AVCodec ff_h261_encoder = {
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("H.261"),
};

View File

@ -1169,4 +1169,3 @@ decode_intra_mb:
return 0;
}

View File

@ -188,4 +188,3 @@ AVBitStreamFilter ff_h264_mp4toannexb_bsf = {
sizeof(H264BSFContext),
h264_mp4toannexb_filter,
};

View File

@ -265,4 +265,3 @@ AVCodec ff_idcin_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("id Quake II CIN video"),
};

View File

@ -904,4 +904,3 @@ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
emms_c();
return 0;
}

View File

@ -136,4 +136,3 @@ AVCodec ff_h263i_decoder = {
.long_name = NULL_IF_CONFIG_SMALL("Intel H.263"),
.pix_fmts= ff_pixfmt_list_420,
};

View File

@ -45,4 +45,3 @@ av_cold void ff_kbd_window_init(float *window, float alpha, int n)
for (i = 0; i < n; i++)
window[i] = sqrt(local_window[i] / sum);
}

View File

@ -126,4 +126,3 @@ AVCodec ff_libvo_aacenc_encoder = {
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AAC"),
};

View File

@ -130,4 +130,3 @@ AVCodec ff_libvo_amrwbenc_encoder = {
"(AMR) Wide-Band"),
.priv_class = &class,
};

View File

@ -384,4 +384,3 @@ AVCodec ff_libxavs_encoder = {
.priv_class = &class,
.defaults = xavs_defaults,
};

View File

@ -146,4 +146,3 @@ void ff_xvid_rate_control_uninit(MpegEncContext *s){
xvid_plugin_2pass2(s->rc_context.non_lavc_opaque, XVID_PLG_DESTROY, &xvid_plg_destroy, NULL);
}

View File

@ -310,4 +310,3 @@ AVCodec ff_mace6_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 6:1"),
};

View File

@ -179,4 +179,3 @@ if ((y) < (x)) {\
#endif
#endif /* AVCODEC_MATHOPS_H */

View File

@ -278,4 +278,3 @@ AVCodec ff_mdec_decoder = {
.long_name= NULL_IF_CONFIG_SMALL("Sony PlayStation MDEC (Motion DECoder)"),
.init_thread_copy= ONLY_IF_THREADS_ENABLED(decode_init_thread_copy)
};

View File

@ -59,4 +59,3 @@ uint64_t ff_truehd_layout(int chanmap);
extern const uint64_t ff_mlp_layout[32];
#endif /* AVCODEC_MLP_PARSER_H */

View File

@ -2668,4 +2668,3 @@ AVCodec ff_mpeg1_vdpau_decoder = {
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video (VDPAU acceleration)"),
};
#endif

View File

@ -168,4 +168,3 @@ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my){
return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_L0L1; //Note see prev line
}
}

View File

@ -260,4 +260,3 @@ int ff_msrle_decode(AVCodecContext *avctx, AVPicture *pic, int depth,
return -1;
}
}

View File

@ -37,4 +37,3 @@ int ff_msrle_decode(AVCodecContext *avctx, AVPicture *pic, int depth,
const uint8_t* data, int data_size);
#endif /* AVCODEC_MSRLEDEC_H */

View File

@ -223,4 +223,3 @@ void ff_nelly_get_sample_bits(const float *buf, int *bits)
bits[i] = 0;
}
}

View File

@ -232,4 +232,3 @@ AVCodec ff_nellymoser_decoder = {
AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
};

View File

@ -297,4 +297,3 @@ AVCodec ff_nuv_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("NuppelVideo/RTJPEG"),
};

View File

@ -37,4 +37,3 @@ int main(void)
return 0;
}

View File

@ -134,4 +134,3 @@ av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx)
av_freep(&ctx->fstate);
av_free(ctx);
}

View File

@ -565,4 +565,3 @@ AVCodec ff_qtrle_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"),
};

View File

@ -102,4 +102,3 @@ void ff_xvid_rate_control_uninit(struct MpegEncContext *s);
float ff_xvid_rate_estimate_qscale(struct MpegEncContext *s, int dry_run);
#endif /* AVCODEC_RATECONTROL_H */

View File

@ -230,4 +230,3 @@ AVCodec ff_rl2_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("RL2 video"),
};

View File

@ -32,6 +32,7 @@
#include <stdint.h>
#include "fft.h"
#include "aacps.h"
#include "sbrdsp.h"
/**
* Spectral Band Replication header - spectrum parameters that invoke a reset if they differ from the previous header.
@ -87,8 +88,8 @@ typedef struct {
///QMF values of the original signal
float W[2][32][32][2];
///QMF output of the HF adjustor
float Y[2][38][64][2];
float g_temp[42][48];
DECLARE_ALIGNED(16, float, Y)[2][38][64][2];
DECLARE_ALIGNED(16, float, g_temp)[42][48];
float q_temp[42][48];
uint8_t s_indexmapped[8][48];
///Envelope scalefactors
@ -155,15 +156,15 @@ typedef struct {
uint8_t patch_num_subbands[6];
uint8_t patch_start_subband[6];
///QMF low frequency input to the HF generator
float X_low[32][40][2];
DECLARE_ALIGNED(16, float, X_low)[32][40][2];
///QMF output of the HF generator
float X_high[64][40][2];
DECLARE_ALIGNED(16, float, X_high)[64][40][2];
///QMF values of the reconstructed signal
DECLARE_ALIGNED(16, float, X)[2][2][38][64];
///Zeroth coefficient used to filter the subband signals
float alpha0[64][2];
DECLARE_ALIGNED(16, float, alpha0)[64][2];
///First coefficient used to filter the subband signals
float alpha1[64][2];
DECLARE_ALIGNED(16, float, alpha1)[64][2];
///Dequantized envelope scalefactors, remapped
float e_origmapped[7][48];
///Dequantized noise scalefactors, remapped
@ -180,6 +181,7 @@ typedef struct {
DECLARE_ALIGNED(16, float, qmf_filter_scratch)[5][64];
FFTContext mdct_ana;
FFTContext mdct;
SBRDSPContext dsp;
} SpectralBandReplication;
#endif /* AVCODEC_SBR_H */

241
libavcodec/sbrdsp.c Normal file
View File

@ -0,0 +1,241 @@
/*
* AAC Spectral Band Replication decoding functions
* Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
* Copyright (c) 2009-2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "libavutil/attributes.h"
#include "sbrdsp.h"
static void sbr_sum64x5_c(float *z)
{
int k;
for (k = 0; k < 64; k++) {
float f = z[k] + z[k + 64] + z[k + 128] + z[k + 192] + z[k + 256];
z[k] = f;
}
}
static float sbr_sum_square_c(float (*x)[2], int n)
{
float sum = 0.0f;
int i;
for (i = 0; i < n; i++)
sum += x[i][0] * x[i][0] + x[i][1] * x[i][1];
return sum;
}
static void sbr_neg_odd_64_c(float *x)
{
int i;
for (i = 1; i < 64; i += 2)
x[i] = -x[i];
}
static void sbr_qmf_pre_shuffle_c(float *z)
{
int k;
z[64] = z[0];
z[65] = z[1];
for (k = 1; k < 32; k++) {
z[64+2*k ] = -z[64 - k];
z[64+2*k+1] = z[ k + 1];
}
}
static void sbr_qmf_post_shuffle_c(float W[32][2], const float *z)
{
int k;
for (k = 0; k < 32; k++) {
W[k][0] = -z[63-k];
W[k][1] = z[k];
}
}
static void sbr_qmf_deint_neg_c(float *v, const float *src)
{
int i;
for (i = 0; i < 32; i++) {
v[ i] = src[63 - 2*i ];
v[63 - i] = -src[63 - 2*i - 1];
}
}
static void sbr_qmf_deint_bfly_c(float *v, const float *src0, const float *src1)
{
int i;
for (i = 0; i < 64; i++) {
v[ i] = src0[i] - src1[63 - i];
v[127 - i] = src0[i] + src1[63 - i];
}
}
static av_always_inline void autocorrelate(const float x[40][2],
float phi[3][2][2], int lag)
{
int i;
float real_sum = 0.0f;
float imag_sum = 0.0f;
if (lag) {
for (i = 1; i < 38; i++) {
real_sum += x[i][0] * x[i+lag][0] + x[i][1] * x[i+lag][1];
imag_sum += x[i][0] * x[i+lag][1] - x[i][1] * x[i+lag][0];
}
phi[2-lag][1][0] = real_sum + x[ 0][0] * x[lag][0] + x[ 0][1] * x[lag][1];
phi[2-lag][1][1] = imag_sum + x[ 0][0] * x[lag][1] - x[ 0][1] * x[lag][0];
if (lag == 1) {
phi[0][0][0] = real_sum + x[38][0] * x[39][0] + x[38][1] * x[39][1];
phi[0][0][1] = imag_sum + x[38][0] * x[39][1] - x[38][1] * x[39][0];
}
} else {
for (i = 1; i < 38; i++) {
real_sum += x[i][0] * x[i][0] + x[i][1] * x[i][1];
}
phi[2][1][0] = real_sum + x[ 0][0] * x[ 0][0] + x[ 0][1] * x[ 0][1];
phi[1][0][0] = real_sum + x[38][0] * x[38][0] + x[38][1] * x[38][1];
}
}
static void sbr_autocorrelate_c(const float x[40][2], float phi[3][2][2])
{
autocorrelate(x, phi, 0);
autocorrelate(x, phi, 1);
autocorrelate(x, phi, 2);
}
static void sbr_hf_gen_c(float (*X_high)[2], const float (*X_low)[2],
const float alpha0[2], const float alpha1[2],
float bw, int start, int end)
{
float alpha[4];
int i;
alpha[0] = alpha1[0] * bw * bw;
alpha[1] = alpha1[1] * bw * bw;
alpha[2] = alpha0[0] * bw;
alpha[3] = alpha0[1] * bw;
for (i = start; i < end; i++) {
X_high[i][0] =
X_low[i - 2][0] * alpha[0] -
X_low[i - 2][1] * alpha[1] +
X_low[i - 1][0] * alpha[2] -
X_low[i - 1][1] * alpha[3] +
X_low[i][0];
X_high[i][1] =
X_low[i - 2][1] * alpha[0] +
X_low[i - 2][0] * alpha[1] +
X_low[i - 1][1] * alpha[2] +
X_low[i - 1][0] * alpha[3] +
X_low[i][1];
}
}
static void sbr_hf_g_filt_c(float (*Y)[2], const float (*X_high)[40][2],
const float *g_filt, int m_max, int ixh)
{
int m;
for (m = 0; m < m_max; m++) {
Y[m][0] = X_high[m][ixh][0] * g_filt[m];
Y[m][1] = X_high[m][ixh][1] * g_filt[m];
}
}
static av_always_inline void sbr_hf_apply_noise(float (*Y)[2],
const float *s_m,
const float *q_filt,
int noise,
float phi_sign0,
float phi_sign1,
int m_max)
{
int m;
for (m = 0; m < m_max; m++) {
float y0 = Y[m][0];
float y1 = Y[m][1];
noise = (noise + 1) & 0x1ff;
if (s_m[m]) {
y0 += s_m[m] * phi_sign0;
y1 += s_m[m] * phi_sign1;
} else {
y0 += q_filt[m] * ff_sbr_noise_table[noise][0];
y1 += q_filt[m] * ff_sbr_noise_table[noise][1];
}
Y[m][0] = y0;
Y[m][1] = y1;
phi_sign1 = -phi_sign1;
}
}
static void sbr_hf_apply_noise_0(float (*Y)[2], const float *s_m,
const float *q_filt, int noise,
int kx, int m_max)
{
sbr_hf_apply_noise(Y, s_m, q_filt, noise, 1.0, 0.0, m_max);
}
static void sbr_hf_apply_noise_1(float (*Y)[2], const float *s_m,
const float *q_filt, int noise,
int kx, int m_max)
{
float phi_sign = 1 - 2 * (kx & 1);
sbr_hf_apply_noise(Y, s_m, q_filt, noise, 0.0, phi_sign, m_max);
}
static void sbr_hf_apply_noise_2(float (*Y)[2], const float *s_m,
const float *q_filt, int noise,
int kx, int m_max)
{
sbr_hf_apply_noise(Y, s_m, q_filt, noise, -1.0, 0.0, m_max);
}
static void sbr_hf_apply_noise_3(float (*Y)[2], const float *s_m,
const float *q_filt, int noise,
int kx, int m_max)
{
float phi_sign = 1 - 2 * (kx & 1);
sbr_hf_apply_noise(Y, s_m, q_filt, noise, 0.0, -phi_sign, m_max);
}
av_cold void ff_sbrdsp_init(SBRDSPContext *s)
{
s->sum64x5 = sbr_sum64x5_c;
s->sum_square = sbr_sum_square_c;
s->neg_odd_64 = sbr_neg_odd_64_c;
s->qmf_pre_shuffle = sbr_qmf_pre_shuffle_c;
s->qmf_post_shuffle = sbr_qmf_post_shuffle_c;
s->qmf_deint_neg = sbr_qmf_deint_neg_c;
s->qmf_deint_bfly = sbr_qmf_deint_bfly_c;
s->autocorrelate = sbr_autocorrelate_c;
s->hf_gen = sbr_hf_gen_c;
s->hf_g_filt = sbr_hf_g_filt_c;
s->hf_apply_noise[0] = sbr_hf_apply_noise_0;
s->hf_apply_noise[1] = sbr_hf_apply_noise_1;
s->hf_apply_noise[2] = sbr_hf_apply_noise_2;
s->hf_apply_noise[3] = sbr_hf_apply_noise_3;
if (ARCH_ARM)
ff_sbrdsp_init_arm(s);
}

48
libavcodec/sbrdsp.h Normal file
View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2012 Mans Rullgard
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef LIBAVCODEC_SBRDSP_H
#define LIBAVCODEC_SBRDSP_H
typedef struct SBRDSPContext {
void (*sum64x5)(float *z);
float (*sum_square)(float (*x)[2], int n);
void (*neg_odd_64)(float *x);
void (*qmf_pre_shuffle)(float *z);
void (*qmf_post_shuffle)(float W[32][2], const float *z);
void (*qmf_deint_neg)(float *v, const float *src);
void (*qmf_deint_bfly)(float *v, const float *src0, const float *src1);
void (*autocorrelate)(const float x[40][2], float phi[3][2][2]);
void (*hf_gen)(float (*X_high)[2], const float (*X_low)[2],
const float alpha0[2], const float alpha1[2],
float bw, int start, int end);
void (*hf_g_filt)(float (*Y)[2], const float (*X_high)[40][2],
const float *g_filt, int m_max, int ixh);
void (*hf_apply_noise[4])(float (*Y)[2], const float *s_m,
const float *q_filt, int noise,
int kx, int m_max);
} SBRDSPContext;
extern const float ff_sbr_noise_table[][2];
void ff_sbrdsp_init(SBRDSPContext *s);
void ff_sbrdsp_init_arm(SBRDSPContext *s);
#endif

View File

@ -269,4 +269,3 @@ AVCodec ff_sgi_decoder = {
.decode = decode_frame,
.long_name = NULL_IF_CONFIG_SMALL("SGI image"),
};

View File

@ -762,4 +762,3 @@ AVCodec ff_smackaud_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Smacker audio"),
};

View File

@ -650,4 +650,3 @@ av_cold void ff_snow_common_end(SnowContext *s)
if (s->current_picture.data[0])
s->avctx->release_buffer(s->avctx, &s->current_picture);
}

View File

@ -210,4 +210,3 @@ AVCodec ff_tscc_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("TechSmith Screen Capture Codec"),
};

View File

@ -429,4 +429,3 @@ AVCodec ff_ulti_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("IBM UltiMotion"),
};

View File

@ -242,7 +242,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
*height+=2; // some of the optimized chroma MC reads one line too much
// which is also done in mpeg decoders with lowres > 0
for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
for (i = 0; i < 4; i++)
linesize_align[i] = STRIDE_ALIGN;
//STRIDE_ALIGN is 8 for SSE* but this does not work for SVQ1 chroma planes
//we could change STRIDE_ALIGN to 16 for x86/sse but it would increase the
@ -252,7 +252,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
if(s->codec_id == CODEC_ID_SVQ1 || s->codec_id == CODEC_ID_VP5 ||
s->codec_id == CODEC_ID_VP6 || s->codec_id == CODEC_ID_VP6F ||
s->codec_id == CODEC_ID_VP6A || s->codec_id == CODEC_ID_DIRAC) {
for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
for (i = 0; i < 4; i++)
linesize_align[i] = 16;
}
#endif

View File

@ -578,4 +578,3 @@ AVCodec ff_utvideo_decoder = {
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
.long_name = NULL_IF_CONFIG_SMALL("Ut Video"),
};

View File

@ -281,4 +281,3 @@ AVCodec ff_vb_decoder = {
.decode = decode_frame,
.long_name = NULL_IF_CONFIG_SMALL("Beam Software VB"),
};

View File

@ -520,4 +520,3 @@ AVCodec ff_vmnc_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("VMware Screen Codec / VMware Video"),
};

View File

@ -1725,4 +1725,3 @@ AVCodec ff_vorbis_decoder = {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
},
};

View File

@ -525,4 +525,3 @@ int ff_wma_run_level_decode(AVCodecContext* avctx, GetBitContext* gb,
return 0;
}

View File

@ -432,4 +432,3 @@ AVCodec ff_xan_wc4_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Wing Commander IV / Xxan"),
};

View File

@ -677,4 +677,3 @@ AVCodec ff_zmbv_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
};

View File

@ -78,4 +78,3 @@ const char *avdevice_license(void);
void avdevice_register_all(void);
#endif /* AVDEVICE_AVDEVICE_H */

View File

@ -271,4 +271,3 @@ AVFilterBufferRef *avfilter_null_get_audio_buffer(AVFilterLink *link, int perms,
{
return avfilter_get_audio_buffer(link->dst->outputs[0], perms, nb_samples);
}

View File

@ -357,3 +357,4 @@ int main(void)
}
#endif

View File

@ -143,4 +143,3 @@ AVFilter avfilter_vf_setsar = {
{ .name = NULL}},
};
#endif /* CONFIG_SETSAR_FILTER */

View File

@ -142,4 +142,3 @@ AVFilter avfilter_vf_noformat = {
{ .name = NULL}},
};
#endif /* CONFIG_NOFORMAT_FILTER */

View File

@ -103,4 +103,3 @@ AVInputFormat ff_aea_demuxer = {
.flags= AVFMT_GENERIC_INDEX,
.extensions = "aea",
};

View File

@ -383,4 +383,3 @@ int ff_check_interrupt(AVIOInterruptCB *cb)
return ret;
return 0;
}

View File

@ -265,4 +265,3 @@ char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth,
}
return authstr;
}

View File

@ -39,4 +39,3 @@ extern const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1];
void ff_id3v1_read(AVFormatContext *s);
#endif /* AVFORMAT_ID3V1_H */

View File

@ -135,4 +135,3 @@ AVInputFormat ff_iss_demuxer = {
.read_header = iss_read_header,
.read_packet = iss_read_packet,
};

View File

@ -346,4 +346,3 @@ AVInputFormat ff_lxf_demuxer = {
.read_packet = lxf_read_packet,
.codec_tag = (const AVCodecTag* const []){lxf_tags, 0},
};

View File

@ -68,4 +68,3 @@ void ff_metadata_conv_ctx(AVFormatContext *ctx, const AVMetadataConv *d_conv,
for (i=0; i<ctx->nb_programs; i++)
ff_metadata_conv(&ctx->programs[i]->metadata, d_conv, s_conv);
}

View File

@ -459,4 +459,3 @@ void ff_mov_close_hinting(MOVTrack *track) {
}
avformat_free_context(rtp_ctx);
}

View File

@ -183,4 +183,3 @@ int ff_is_multicast_address(struct sockaddr *addr)
return 0;
}

View File

@ -445,4 +445,3 @@ AVInputFormat ff_oma_demuxer = {
.extensions = "oma,omg,aa3",
.codec_tag = (const AVCodecTag* const []){ff_oma_codec_tags, 0},
};

View File

@ -297,4 +297,3 @@ AVInputFormat ff_rl2_demuxer = {
.read_packet = rl2_read_packet,
.read_seek = rl2_read_seek,
};

View File

@ -205,4 +205,3 @@ RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = {
.free = amr_free_context,
.parse_packet = amr_handle_packet,
};

View File

@ -105,4 +105,3 @@ RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler = {
.codec_id = CODEC_ID_H263,
.parse_packet = h263_handle_packet,
};

View File

@ -63,4 +63,3 @@ void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size)
memcpy(s->buf_ptr, buff, size);
s->buf_ptr += size;
}

View File

@ -84,4 +84,3 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
return rtpctx;
}

View File

@ -115,5 +115,3 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
end_of_slice = 0;
}
}

View File

@ -1992,4 +1992,3 @@ AVInputFormat ff_rtp_demuxer = {
.priv_class = &rtp_demuxer_class
};
#endif /* CONFIG_RTP_DEMUXER */

View File

@ -245,4 +245,3 @@ AVOutputFormat ff_rtsp_muxer = {
.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
.priv_class = &rtsp_muxer_class,
};

View File

@ -236,4 +236,3 @@ AVInputFormat ff_sap_demuxer = {
.read_close = sap_read_close,
.flags = AVFMT_NOFILE,
};

View File

@ -261,4 +261,3 @@ AVOutputFormat ff_sap_muxer = {
.write_trailer = sap_write_close,
.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
};

View File

@ -642,4 +642,3 @@ void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *des
{
}
#endif

View File

@ -516,4 +516,3 @@ void ff_free_parser_state(AVFormatContext *s, AVParserState *state)
av_free(state->stream_states);
av_free(state);
}

View File

@ -41,4 +41,3 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id);
uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length) av_pure;
#endif /* AVUTIL_CRC_H */

View File

@ -95,4 +95,3 @@ AVExtFloat av_dbl2ext(double d){
ext.exponent[0] |= 0x80;
return ext;
}

Some files were not shown because too many files have changed in this diff Show More