aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-29 00:34:59 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-29 00:34:59 +0100
commitc065255bba62ebef145f80cd8d805ef1a9eca133 (patch)
tree675d1241b8488fef70b14a566e59a9070682f08c
parent97dece333df07befa4052ed6f5a823ec3103a67d (diff)
parent2e626dd5136f4daa244b37284e22483cdc7df1ac (diff)
downloadffmpeg-c065255bba62ebef145f80cd8d805ef1a9eca133.tar.gz
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>
-rw-r--r--doc/APIchanges2
-rw-r--r--libavcodec/4xm.c1
-rw-r--r--libavcodec/Makefile3
-rw-r--r--libavcodec/aacenc.c8
-rw-r--r--libavcodec/aacsbr.c187
-rw-r--r--libavcodec/aacsbrdata.h4
-rw-r--r--libavcodec/acelp_filters.c1
-rw-r--r--libavcodec/allcodecs.c1
-rw-r--r--libavcodec/alsdec.c1
-rw-r--r--libavcodec/amrnbdata.h1
-rw-r--r--libavcodec/arm/Makefile4
-rw-r--r--libavcodec/arm/sbrdsp_init_arm.c70
-rw-r--r--libavcodec/arm/sbrdsp_neon.S411
-rw-r--r--libavcodec/atrac.c1
-rw-r--r--libavcodec/aura.c1
-rw-r--r--libavcodec/avcodec.h3
-rw-r--r--libavcodec/bitstream.c1
-rw-r--r--libavcodec/cscd.c1
-rw-r--r--libavcodec/dvdata.c1
-rw-r--r--libavcodec/dxa.c1
-rw-r--r--libavcodec/dxva2.c1
-rw-r--r--libavcodec/dxva2_h264.c1
-rw-r--r--libavcodec/dxva2_mpeg2.c1
-rw-r--r--libavcodec/dxva2_vc1.c1
-rw-r--r--libavcodec/escape124.c1
-rw-r--r--libavcodec/fft.c1
-rw-r--r--libavcodec/flashsvenc.c1
-rw-r--r--libavcodec/h261.c1
-rw-r--r--libavcodec/h261enc.c1
-rw-r--r--libavcodec/h264_cavlc.c1
-rw-r--r--libavcodec/h264_mp4toannexb_bsf.c1
-rw-r--r--libavcodec/idcinvideo.c1
-rw-r--r--libavcodec/imgconvert.c1
-rw-r--r--libavcodec/intelh263dec.c1
-rw-r--r--libavcodec/kbdwin.c1
-rw-r--r--libavcodec/libvo-aacenc.c1
-rw-r--r--libavcodec/libvo-amrwbenc.c1
-rw-r--r--libavcodec/libxavs.c1
-rw-r--r--libavcodec/libxvid_rc.c1
-rw-r--r--libavcodec/mace.c1
-rw-r--r--libavcodec/mathops.h1
-rw-r--r--libavcodec/mdec.c1
-rw-r--r--libavcodec/mlp_parser.h1
-rw-r--r--libavcodec/mpeg12.c1
-rw-r--r--libavcodec/mpeg4video.c1
-rw-r--r--libavcodec/msrledec.c1
-rw-r--r--libavcodec/msrledec.h1
-rw-r--r--libavcodec/nellymoser.c1
-rw-r--r--libavcodec/nellymoserdec.c1
-rw-r--r--libavcodec/nuv.c1
-rw-r--r--libavcodec/pcm_tablegen.c1
-rw-r--r--libavcodec/psymodel.c1
-rw-r--r--libavcodec/qtrle.c1
-rw-r--r--libavcodec/ratecontrol.h1
-rw-r--r--libavcodec/rl2.c1
-rw-r--r--libavcodec/sbr.h14
-rw-r--r--libavcodec/sbrdsp.c241
-rw-r--r--libavcodec/sbrdsp.h48
-rw-r--r--libavcodec/sgidec.c1
-rw-r--r--libavcodec/smacker.c1
-rw-r--r--libavcodec/snow.c1
-rw-r--r--libavcodec/tscc.c1
-rw-r--r--libavcodec/ulti.c1
-rw-r--r--libavcodec/utils.c4
-rw-r--r--libavcodec/utvideo.c1
-rw-r--r--libavcodec/vb.c1
-rw-r--r--libavcodec/vmnc.c1
-rw-r--r--libavcodec/vorbisdec.c1
-rw-r--r--libavcodec/wma.c1
-rw-r--r--libavcodec/xxan.c1
-rw-r--r--libavcodec/zmbv.c1
-rw-r--r--libavdevice/avdevice.h1
-rw-r--r--libavfilter/defaults.c1
-rw-r--r--libavfilter/formats.c1
-rw-r--r--libavfilter/vf_aspect.c1
-rw-r--r--libavfilter/vf_format.c1
-rw-r--r--libavformat/aea.c1
-rw-r--r--libavformat/avio.c1
-rw-r--r--libavformat/httpauth.c1
-rw-r--r--libavformat/id3v1.h1
-rw-r--r--libavformat/iss.c1
-rw-r--r--libavformat/lxfdec.c1
-rw-r--r--libavformat/metadata.c1
-rw-r--r--libavformat/movenchint.c1
-rw-r--r--libavformat/network.c1
-rw-r--r--libavformat/omadec.c1
-rw-r--r--libavformat/rl2.c1
-rw-r--r--libavformat/rtpdec_amr.c1
-rw-r--r--libavformat/rtpdec_h263.c1
-rw-r--r--libavformat/rtpenc_amr.c1
-rw-r--r--libavformat/rtpenc_chain.c1
-rw-r--r--libavformat/rtpenc_mpv.c2
-rw-r--r--libavformat/rtsp.c1
-rw-r--r--libavformat/rtspenc.c1
-rw-r--r--libavformat/sapdec.c1
-rw-r--r--libavformat/sapenc.c1
-rw-r--r--libavformat/sdp.c1
-rw-r--r--libavformat/seek.c1
-rw-r--r--libavutil/crc.h1
-rw-r--r--libavutil/intfloat_readwrite.c1
-rw-r--r--libavutil/md5.h1
-rw-r--r--libavutil/mem.c1
-rw-r--r--libswscale/rgb2rgb.c1
-rw-r--r--libswscale/utils.c1
104 files changed, 851 insertions, 240 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index 813caa8643..62dc796e41 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -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().
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index d665436844..9581f94344 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -935,4 +935,3 @@ AVCodec ff_fourxm_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
};
-
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 089b8668b3..8fd057d95a 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -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 \
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 55f028687c..2ff6f9cc04 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -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;
}
diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c
index 2f457b61cc..71bd2ceda5 100644
--- a/libavcodec/aacsbr.c
+++ b/libavcodec/aacsbr.c
@@ -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);
diff --git a/libavcodec/aacsbrdata.h b/libavcodec/aacsbrdata.h
index 5d33a60888..a796e9deb7 100644
--- a/libavcodec/aacsbrdata.h
+++ b/libavcodec/aacsbrdata.h
@@ -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 */
diff --git a/libavcodec/acelp_filters.c b/libavcodec/acelp_filters.c
index 31f0e86f5b..1ce5eed5e2 100644
--- a/libavcodec/acelp_filters.c
+++ b/libavcodec/acelp_filters.c
@@ -142,4 +142,3 @@ void ff_tilt_compensation(float *mem, float tilt, float *samples, int size)
samples[0] -= tilt * *mem;
*mem = new_tilt_mem;
}
-
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 32f3f52942..f6fc15388a 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -465,4 +465,3 @@ void avcodec_register_all(void)
REGISTER_BSF (REMOVE_EXTRADATA, remove_extradata);
REGISTER_BSF (TEXT2MOVSUB, text2movsub);
}
-
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 9d371de0c8..6ce48de7de 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -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)"),
};
-
diff --git a/libavcodec/amrnbdata.h b/libavcodec/amrnbdata.h
index fab9f759ad..2745d33ffb 100644
--- a/libavcodec/amrnbdata.h
+++ b/libavcodec/amrnbdata.h
@@ -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 */
-
diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile
index 52709b6ae9..0e45bc0a52 100644
--- a/libavcodec/arm/Makefile
+++ b/libavcodec/arm/Makefile
@@ -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 \
diff --git a/libavcodec/arm/sbrdsp_init_arm.c b/libavcodec/arm/sbrdsp_init_arm.c
new file mode 100644
index 0000000000..2ab0df829d
--- /dev/null
+++ b/libavcodec/arm/sbrdsp_init_arm.c
@@ -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;
+ }
+}
diff --git a/libavcodec/arm/sbrdsp_neon.S b/libavcodec/arm/sbrdsp_neon.S
new file mode 100644
index 0000000000..835c32caee
--- /dev/null
+++ b/libavcodec/arm/sbrdsp_neon.S
@@ -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
diff --git a/libavcodec/atrac.c b/libavcodec/atrac.c
index 6c1b1f19ce..1049df6281 100644
--- a/libavcodec/atrac.c
+++ b/libavcodec/atrac.c
@@ -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));
}
-
diff --git a/libavcodec/aura.c b/libavcodec/aura.c
index e2c90b45f7..49694d55bf 100644
--- a/libavcodec/aura.c
+++ b/libavcodec/aura.c
@@ -134,4 +134,3 @@ AVCodec ff_aura2_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Auravision Aura 2"),
};
-
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index ca062eda91..4c5800b432 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -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
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 30aaf75fea..e1336438a0 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -322,4 +322,3 @@ void free_vlc(VLC *vlc)
{
av_freep(&vlc->table);
}
-
diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c
index 1e157edcbc..4f9b70c88b 100644
--- a/libavcodec/cscd.c
+++ b/libavcodec/cscd.c
@@ -266,4 +266,3 @@ AVCodec ff_cscd_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("CamStudio"),
};
-
diff --git a/libavcodec/dvdata.c b/libavcodec/dvdata.c
index f292d4bf19..65cbff4b1c 100644
--- a/libavcodec/dvdata.c
+++ b/libavcodec/dvdata.c
@@ -294,4 +294,3 @@ const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec)
return NULL;
}
-
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index f32fdd33e5..28c6af9031 100644
--- a/libavcodec/dxa.c
+++ b/libavcodec/dxa.c
@@ -331,4 +331,3 @@ AVCodec ff_dxa_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"),
};
-
diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
index b6f8aea429..9b94b58fbc 100644
--- a/libavcodec/dxva2.c
+++ b/libavcodec/dxva2.c
@@ -151,4 +151,3 @@ end:
ff_draw_horiz_band(s, 0, s->avctx->height);
return result;
}
-
diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c
index af91e02188..3bda097cc4 100644
--- a/libavcodec/dxva2_h264.c
+++ b/libavcodec/dxva2_h264.c
@@ -448,4 +448,3 @@ AVHWAccel ff_h264_dxva2_hwaccel = {
.end_frame = end_frame,
.priv_data_size = sizeof(struct dxva2_picture_context),
};
-
diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c
index 951305d00f..e54eff09fb 100644
--- a/libavcodec/dxva2_mpeg2.c
+++ b/libavcodec/dxva2_mpeg2.c
@@ -270,4 +270,3 @@ AVHWAccel ff_mpeg2_dxva2_hwaccel = {
.end_frame = end_frame,
.priv_data_size = sizeof(struct dxva2_picture_context),
};
-
diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c
index 0ae9685208..50da518d86 100644
--- a/libavcodec/dxva2_vc1.c
+++ b/libavcodec/dxva2_vc1.c
@@ -286,4 +286,3 @@ AVHWAccel ff_vc1_dxva2_hwaccel = {
.end_frame = end_frame,
.priv_data_size = sizeof(struct dxva2_picture_context),
};
-
diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c
index c9025fddde..fd76e59fb2 100644
--- a/libavcodec/escape124.c
+++ b/libavcodec/escape124.c
@@ -376,4 +376,3 @@ AVCodec ff_escape124_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Escape 124"),
};
-
diff --git a/libavcodec/fft.c b/libavcodec/fft.c
index 4eb46f14c8..6b93a5cdf3 100644
--- a/libavcodec/fft.c
+++ b/libavcodec/fft.c
@@ -350,4 +350,3 @@ static void ff_fft_calc_c(FFTContext *s, FFTComplex *z)
{
fft_dispatch[s->nbits-2](z);
}
-
diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c
index 7e21e7d534..77290e866f 100644
--- a/libavcodec/flashsvenc.c
+++ b/libavcodec/flashsvenc.c
@@ -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"),
};
-
diff --git a/libavcodec/h261.c b/libavcodec/h261.c
index 562a151e90..951997d65e 100644
--- a/libavcodec/h261.c
+++ b/libavcodec/h261.c
@@ -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);
}
-
diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c
index 0110addf73..4385aee11b 100644
--- a/libavcodec/h261enc.c
+++ b/libavcodec/h261enc.c
@@ -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"),
};
-
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index f9daeb29d9..a782f14698 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -1169,4 +1169,3 @@ decode_intra_mb:
return 0;
}
-
diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c
index 5085ecbdfd..48e085e7c3 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -188,4 +188,3 @@ AVBitStreamFilter ff_h264_mp4toannexb_bsf = {
sizeof(H264BSFContext),
h264_mp4toannexb_filter,
};
-
diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c
index 0b22043365..7a7f76a8a0 100644
--- a/libavcodec/idcinvideo.c
+++ b/libavcodec/idcinvideo.c
@@ -265,4 +265,3 @@ AVCodec ff_idcin_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("id Quake II CIN video"),
};
-
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index fac5f52107..9fcd94c7a8 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -904,4 +904,3 @@ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
emms_c();
return 0;
}
-
diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c
index 836e98ee88..c97c1d7a1f 100644
--- a/libavcodec/intelh263dec.c
+++ b/libavcodec/intelh263dec.c
@@ -136,4 +136,3 @@ AVCodec ff_h263i_decoder = {
.long_name = NULL_IF_CONFIG_SMALL("Intel H.263"),
.pix_fmts= ff_pixfmt_list_420,
};
-
diff --git a/libavcodec/kbdwin.c b/libavcodec/kbdwin.c
index 8b33861f71..aa4b9726f5 100644
--- a/libavcodec/kbdwin.c
+++ b/libavcodec/kbdwin.c
@@ -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);
}
-
diff --git a/libavcodec/libvo-aacenc.c b/libavcodec/libvo-aacenc.c
index dcec664347..25e8a317f7 100644
--- a/libavcodec/libvo-aacenc.c
+++ b/libavcodec/libvo-aacenc.c
@@ -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"),
};
-
diff --git a/libavcodec/libvo-amrwbenc.c b/libavcodec/libvo-amrwbenc.c
index b32fe4e1df..22c71b75f1 100644
--- a/libavcodec/libvo-amrwbenc.c
+++ b/libavcodec/libvo-amrwbenc.c
@@ -130,4 +130,3 @@ AVCodec ff_libvo_amrwbenc_encoder = {
"(AMR) Wide-Band"),
.priv_class = &class,
};
-
diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c
index acc674dc1a..d7027d1092 100644
--- a/libavcodec/libxavs.c
+++ b/libavcodec/libxavs.c
@@ -384,4 +384,3 @@ AVCodec ff_libxavs_encoder = {
.priv_class = &class,
.defaults = xavs_defaults,
};
-
diff --git a/libavcodec/libxvid_rc.c b/libavcodec/libxvid_rc.c
index 8a2b487122..10a7c1cb3e 100644
--- a/libavcodec/libxvid_rc.c
+++ b/libavcodec/libxvid_rc.c
@@ -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);
}
-
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index ffa11ad80d..594ef6c795 100644
--- a/libavcodec/mace.c
+++ b/libavcodec/mace.c
@@ -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"),
};
-
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index 1126ba6043..3ef7f8b660 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -179,4 +179,3 @@ if ((y) < (x)) {\
#endif
#endif /* AVCODEC_MATHOPS_H */
-
diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index cf606935a6..2828417bcd 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -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)
};
-
diff --git a/libavcodec/mlp_parser.h b/libavcodec/mlp_parser.h
index 3b81763d57..6aafed5086 100644
--- a/libavcodec/mlp_parser.h
+++ b/libavcodec/mlp_parser.h
@@ -59,4 +59,3 @@ uint64_t ff_truehd_layout(int chanmap);
extern const uint64_t ff_mlp_layout[32];
#endif /* AVCODEC_MLP_PARSER_H */
-
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index d34b54d76c..71c9a5893b 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2668,4 +2668,3 @@ AVCodec ff_mpeg1_vdpau_decoder = {
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video (VDPAU acceleration)"),
};
#endif
-
diff --git a/libavcodec/mpeg4video.c b/libavcodec/mpeg4video.c
index 9a093511d5..7444f26a9d 100644
--- a/libavcodec/mpeg4video.c
+++ b/libavcodec/mpeg4video.c
@@ -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
}
}
-
diff --git a/libavcodec/msrledec.c b/libavcodec/msrledec.c
index 129f0e0bc0..c0e7682689 100644
--- a/libavcodec/msrledec.c
+++ b/libavcodec/msrledec.c
@@ -260,4 +260,3 @@ int ff_msrle_decode(AVCodecContext *avctx, AVPicture *pic, int depth,
return -1;
}
}
-
diff --git a/libavcodec/msrledec.h b/libavcodec/msrledec.h
index 2230162691..b45ea48bc1 100644
--- a/libavcodec/msrledec.h
+++ b/libavcodec/msrledec.h
@@ -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 */
-
diff --git a/libavcodec/nellymoser.c b/libavcodec/nellymoser.c
index cbcc4f941b..195e2e80ae 100644
--- a/libavcodec/nellymoser.c
+++ b/libavcodec/nellymoser.c
@@ -223,4 +223,3 @@ void ff_nelly_get_sample_bits(const float *buf, int *bits)
bits[i] = 0;
}
}
-
diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c
index 2a1ec5b4cd..de26dc6a41 100644
--- a/libavcodec/nellymoserdec.c
+++ b/libavcodec/nellymoserdec.c
@@ -232,4 +232,3 @@ AVCodec ff_nellymoser_decoder = {
AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
};
-
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index 7f8dc7501b..c82034a96b 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -297,4 +297,3 @@ AVCodec ff_nuv_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("NuppelVideo/RTJPEG"),
};
-
diff --git a/libavcodec/pcm_tablegen.c b/libavcodec/pcm_tablegen.c
index b0fde936c7..bf8e7fb707 100644
--- a/libavcodec/pcm_tablegen.c
+++ b/libavcodec/pcm_tablegen.c
@@ -37,4 +37,3 @@ int main(void)
return 0;
}
-
diff --git a/libavcodec/psymodel.c b/libavcodec/psymodel.c
index b3cfb0e75f..a17aecc422 100644
--- a/libavcodec/psymodel.c
+++ b/libavcodec/psymodel.c
@@ -134,4 +134,3 @@ av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx)
av_freep(&ctx->fstate);
av_free(ctx);
}
-
diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 4ef529d5b2..606a2ea95d 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -565,4 +565,3 @@ AVCodec ff_qtrle_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"),
};
-
diff --git a/libavcodec/ratecontrol.h b/libavcodec/ratecontrol.h
index 32efe01d24..b4132bfcb6 100644
--- a/libavcodec/ratecontrol.h
+++ b/libavcodec/ratecontrol.h
@@ -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 */
-
diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c
index 07c6109c64..7eebddff6f 100644
--- a/libavcodec/rl2.c
+++ b/libavcodec/rl2.c
@@ -230,4 +230,3 @@ AVCodec ff_rl2_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("RL2 video"),
};
-
diff --git a/libavcodec/sbr.h b/libavcodec/sbr.h
index 69c847ac15..1fe47fcebe 100644
--- a/libavcodec/sbr.h
+++ b/libavcodec/sbr.h
@@ -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 */
diff --git a/libavcodec/sbrdsp.c b/libavcodec/sbrdsp.c
new file mode 100644
index 0000000000..2711e71338
--- /dev/null
+++ b/libavcodec/sbrdsp.c
@@ -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);
+}
diff --git a/libavcodec/sbrdsp.h b/libavcodec/sbrdsp.h
new file mode 100644
index 0000000000..88285b07ec
--- /dev/null
+++ b/libavcodec/sbrdsp.h
@@ -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
diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c
index 6a98718131..56495c1d31 100644
--- a/libavcodec/sgidec.c
+++ b/libavcodec/sgidec.c
@@ -269,4 +269,3 @@ AVCodec ff_sgi_decoder = {
.decode = decode_frame,
.long_name = NULL_IF_CONFIG_SMALL("SGI image"),
};
-
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index a60a2b051b..593d409cb1 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -762,4 +762,3 @@ AVCodec ff_smackaud_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Smacker audio"),
};
-
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index a289ecfbce..88620dd28c 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -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);
}
-
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
index c07f3a87f7..e6c9492edc 100644
--- a/libavcodec/tscc.c
+++ b/libavcodec/tscc.c
@@ -210,4 +210,3 @@ AVCodec ff_tscc_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("TechSmith Screen Capture Codec"),
};
-
diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c
index 6e7ba35f9d..cd6f2d24ab 100644
--- a/libavcodec/ulti.c
+++ b/libavcodec/ulti.c
@@ -429,4 +429,3 @@ AVCodec ff_ulti_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("IBM UltiMotion"),
};
-
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index dec9003e1d..a41c8a5596 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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
diff --git a/libavcodec/utvideo.c b/libavcodec/utvideo.c
index a45f13fa54..ed11776a36 100644
--- a/libavcodec/utvideo.c
+++ b/libavcodec/utvideo.c
@@ -578,4 +578,3 @@ AVCodec ff_utvideo_decoder = {
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
.long_name = NULL_IF_CONFIG_SMALL("Ut Video"),
};
-
diff --git a/libavcodec/vb.c b/libavcodec/vb.c
index 50e5d0b1a4..bcb26452b0 100644
--- a/libavcodec/vb.c
+++ b/libavcodec/vb.c
@@ -281,4 +281,3 @@ AVCodec ff_vb_decoder = {
.decode = decode_frame,
.long_name = NULL_IF_CONFIG_SMALL("Beam Software VB"),
};
-
diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c
index 7655103b6a..21141fa052 100644
--- a/libavcodec/vmnc.c
+++ b/libavcodec/vmnc.c
@@ -520,4 +520,3 @@ AVCodec ff_vmnc_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("VMware Screen Codec / VMware Video"),
};
-
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 03e3d757cb..f1d9a79297 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -1725,4 +1725,3 @@ AVCodec ff_vorbis_decoder = {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
},
};
-
diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index feb121b591..562abf3812 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -525,4 +525,3 @@ int ff_wma_run_level_decode(AVCodecContext* avctx, GetBitContext* gb,
return 0;
}
-
diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c
index 0bfebc8789..de55d082ae 100644
--- a/libavcodec/xxan.c
+++ b/libavcodec/xxan.c
@@ -432,4 +432,3 @@ AVCodec ff_xan_wc4_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Wing Commander IV / Xxan"),
};
-
diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index a68e42d789..22a3272dee 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -677,4 +677,3 @@ AVCodec ff_zmbv_decoder = {
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
};
-
diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h
index 5abf9f523f..d7f5d8ac0a 100644
--- a/libavdevice/avdevice.h
+++ b/libavdevice/avdevice.h
@@ -78,4 +78,3 @@ const char *avdevice_license(void);
void avdevice_register_all(void);
#endif /* AVDEVICE_AVDEVICE_H */
-
diff --git a/libavfilter/defaults.c b/libavfilter/defaults.c
index c083195b4f..e71041ecb4 100644
--- a/libavfilter/defaults.c
+++ b/libavfilter/defaults.c
@@ -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);
}
-
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index fa2c1be4bb..d01ea42f8b 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -357,3 +357,4 @@ int main(void)
}
#endif
+
diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c
index e3f9299aea..f92ed1f231 100644
--- a/libavfilter/vf_aspect.c
+++ b/libavfilter/vf_aspect.c
@@ -143,4 +143,3 @@ AVFilter avfilter_vf_setsar = {
{ .name = NULL}},
};
#endif /* CONFIG_SETSAR_FILTER */
-
diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c
index fd2084320a..cbcc24bfba 100644
--- a/libavfilter/vf_format.c
+++ b/libavfilter/vf_format.c
@@ -142,4 +142,3 @@ AVFilter avfilter_vf_noformat = {
{ .name = NULL}},
};
#endif /* CONFIG_NOFORMAT_FILTER */
-
diff --git a/libavformat/aea.c b/libavformat/aea.c
index 4e255241d1..d849ade6f2 100644
--- a/libavformat/aea.c
+++ b/libavformat/aea.c
@@ -103,4 +103,3 @@ AVInputFormat ff_aea_demuxer = {
.flags= AVFMT_GENERIC_INDEX,
.extensions = "aea",
};
-
diff --git a/libavformat/avio.c b/libavformat/avio.c
index 0f6ce31097..8305443ada 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -383,4 +383,3 @@ int ff_check_interrupt(AVIOInterruptCB *cb)
return ret;
return 0;
}
-
diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c
index 2ce5432993..ba31c1a9aa 100644
--- a/libavformat/httpauth.c
+++ b/libavformat/httpauth.c
@@ -265,4 +265,3 @@ char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth,
}
return authstr;
}
-
diff --git a/libavformat/id3v1.h b/libavformat/id3v1.h
index 8eb58be2d1..d5dca35873 100644
--- a/libavformat/id3v1.h
+++ b/libavformat/id3v1.h
@@ -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 */
-
diff --git a/libavformat/iss.c b/libavformat/iss.c
index a60dc1f4a0..af2fc6e4ac 100644
--- a/libavformat/iss.c
+++ b/libavformat/iss.c
@@ -135,4 +135,3 @@ AVInputFormat ff_iss_demuxer = {
.read_header = iss_read_header,
.read_packet = iss_read_packet,
};
-
diff --git a/libavformat/lxfdec.c b/libavformat/lxfdec.c
index 6969b144ab..f82d4f41cb 100644
--- a/libavformat/lxfdec.c
+++ b/libavformat/lxfdec.c
@@ -346,4 +346,3 @@ AVInputFormat ff_lxf_demuxer = {
.read_packet = lxf_read_packet,
.codec_tag = (const AVCodecTag* const []){lxf_tags, 0},
};
-
diff --git a/libavformat/metadata.c b/libavformat/metadata.c
index 1660a604f1..fc3a9d7d55 100644
--- a/libavformat/metadata.c
+++ b/libavformat/metadata.c
@@ -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);
}
-
diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c
index bb55f73053..1b8b2c10ea 100644
--- a/libavformat/movenchint.c
+++ b/libavformat/movenchint.c
@@ -459,4 +459,3 @@ void ff_mov_close_hinting(MOVTrack *track) {
}
avformat_free_context(rtp_ctx);
}
-
diff --git a/libavformat/network.c b/libavformat/network.c
index 9beaaaf350..727ca5024f 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -183,4 +183,3 @@ int ff_is_multicast_address(struct sockaddr *addr)
return 0;
}
-
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 5a1660b89f..2f100b8f56 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -445,4 +445,3 @@ AVInputFormat ff_oma_demuxer = {
.extensions = "oma,omg,aa3",
.codec_tag = (const AVCodecTag* const []){ff_oma_codec_tags, 0},
};
-
diff --git a/libavformat/rl2.c b/libavformat/rl2.c
index b160098150..8692e22afa 100644
--- a/libavformat/rl2.c
+++ b/libavformat/rl2.c
@@ -297,4 +297,3 @@ AVInputFormat ff_rl2_demuxer = {
.read_packet = rl2_read_packet,
.read_seek = rl2_read_seek,
};
-
diff --git a/libavformat/rtpdec_amr.c b/libavformat/rtpdec_amr.c
index fbf4321698..de824904aa 100644
--- a/libavformat/rtpdec_amr.c
+++ b/libavformat/rtpdec_amr.c
@@ -205,4 +205,3 @@ RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = {
.free = amr_free_context,
.parse_packet = amr_handle_packet,
};
-
diff --git a/libavformat/rtpdec_h263.c b/libavformat/rtpdec_h263.c
index ea42fff320..27173f013b 100644
--- a/libavformat/rtpdec_h263.c
+++ b/libavformat/rtpdec_h263.c
@@ -105,4 +105,3 @@ RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler = {
.codec_id = CODEC_ID_H263,
.parse_packet = h263_handle_packet,
};
-
diff --git a/libavformat/rtpenc_amr.c b/libavformat/rtpenc_amr.c
index 367789fccd..bd1c197101 100644
--- a/libavformat/rtpenc_amr.c
+++ b/libavformat/rtpenc_amr.c
@@ -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;
}
-
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c
index 8a5adf54ed..e4edfc28e1 100644
--- a/libavformat/rtpenc_chain.c
+++ b/libavformat/rtpenc_chain.c
@@ -84,4 +84,3 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
return rtpctx;
}
-
diff --git a/libavformat/rtpenc_mpv.c b/libavformat/rtpenc_mpv.c
index 0c617337b2..2708dd183c 100644
--- a/libavformat/rtpenc_mpv.c
+++ b/libavformat/rtpenc_mpv.c
@@ -115,5 +115,3 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
end_of_slice = 0;
}
}
-
-
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 4a0e8bffee..e4f5c05e0b 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1992,4 +1992,3 @@ AVInputFormat ff_rtp_demuxer = {
.priv_class = &rtp_demuxer_class
};
#endif /* CONFIG_RTP_DEMUXER */
-
diff --git a/libavformat/rtspenc.c b/libavformat/rtspenc.c
index b54ae28eb8..7bdacc29f7 100644
--- a/libavformat/rtspenc.c
+++ b/libavformat/rtspenc.c
@@ -245,4 +245,3 @@ AVOutputFormat ff_rtsp_muxer = {
.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
.priv_class = &rtsp_muxer_class,
};
-
diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c
index 0f96a1ecc0..d806400eb1 100644
--- a/libavformat/sapdec.c
+++ b/libavformat/sapdec.c
@@ -236,4 +236,3 @@ AVInputFormat ff_sap_demuxer = {
.read_close = sap_read_close,
.flags = AVFMT_NOFILE,
};
-
diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c
index 0f2b4b51f0..8a2a193b8e 100644
--- a/libavformat/sapenc.c
+++ b/libavformat/sapenc.c
@@ -261,4 +261,3 @@ AVOutputFormat ff_sap_muxer = {
.write_trailer = sap_write_close,
.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
};
-
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 2417663885..20cf58809e 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -642,4 +642,3 @@ void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *des
{
}
#endif
-
diff --git a/libavformat/seek.c b/libavformat/seek.c
index 65211bfacf..3ffcde4664 100644
--- a/libavformat/seek.c
+++ b/libavformat/seek.c
@@ -516,4 +516,3 @@ void ff_free_parser_state(AVFormatContext *s, AVParserState *state)
av_free(state->stream_states);
av_free(state);
}
-
diff --git a/libavutil/crc.h b/libavutil/crc.h
index 6c0baab5ac..12650542ba 100644
--- a/libavutil/crc.h
+++ b/libavutil/crc.h
@@ -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 */
-
diff --git a/libavutil/intfloat_readwrite.c b/libavutil/intfloat_readwrite.c
index 991aa7886c..2998229e49 100644
--- a/libavutil/intfloat_readwrite.c
+++ b/libavutil/intfloat_readwrite.c
@@ -95,4 +95,3 @@ AVExtFloat av_dbl2ext(double d){
ext.exponent[0] |= 0x80;
return ext;
}
-
diff --git a/libavutil/md5.h b/libavutil/md5.h
index 1333ab2ddf..a3534edad0 100644
--- a/libavutil/md5.h
+++ b/libavutil/md5.h
@@ -43,4 +43,3 @@ void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
*/
#endif /* AVUTIL_MD5_H */
-
diff --git a/libavutil/mem.c b/libavutil/mem.c
index f965339ce9..d711350fda 100644
--- a/libavutil/mem.c
+++ b/libavutil/mem.c
@@ -228,3 +228,4 @@ void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem)
tab[nb++] = (intptr_t)elem;
*nb_ptr = nb;
}
+
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index 96559202b9..3ef0925f04 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -331,4 +331,3 @@ DEFINE_SHUFFLE_BYTES(0, 3, 2, 1)
DEFINE_SHUFFLE_BYTES(1, 2, 3, 0)
DEFINE_SHUFFLE_BYTES(3, 0, 1, 2)
DEFINE_SHUFFLE_BYTES(3, 2, 1, 0)
-
diff --git a/libswscale/utils.c b/libswscale/utils.c
index b483d07406..d6d90b0461 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1575,4 +1575,3 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context,
}
return context;
}
-