History

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

Michael Niedermayer committed 14 years ago

Commit c0652552 parents 97dece3 2e626dd104 files · +851 −240Browse files

Unified · Split

104 files
  1. doc/APIchanges +2 −0
  2. libavcodec/4xm.c +0 −1
  3. libavcodec/Makefile +2 −1
  4. libavcodec/aacenc.c +4 −4
  5. libavcodec/aacsbr.c +51 −136
  6. libavcodec/aacsbrdata.h +3 −1
  7. libavcodec/acelp_filters.c +0 −1
  8. libavcodec/allcodecs.c +0 −1
  9. libavcodec/alsdec.c +0 −1
  10. libavcodec/amrnbdata.h +0 −1
  11. libavcodec/arm/Makefile +4 −0
  12. libavcodec/arm/sbrdsp_init_arm.c +70 −0
  13. libavcodec/arm/sbrdsp_neon.S +411 −0
  14. libavcodec/atrac.c +0 −1
  15. libavcodec/aura.c +0 −1
  16. libavcodec/avcodec.h +3 −0
  17. libavcodec/bitstream.c +0 −1
  18. libavcodec/cscd.c +0 −1
  19. libavcodec/dvdata.c +0 −1
  20. libavcodec/dxa.c +0 −1
  21. libavcodec/dxva2.c +0 −1
  22. libavcodec/dxva2_h264.c +0 −1
  23. libavcodec/dxva2_mpeg2.c +0 −1
  24. libavcodec/dxva2_vc1.c +0 −1
  25. libavcodec/escape124.c +0 −1
  26. libavcodec/fft.c +0 −1
  27. libavcodec/flashsvenc.c +0 −1
  28. libavcodec/h261.c +0 −1
  29. libavcodec/h261enc.c +0 −1
  30. libavcodec/h264_cavlc.c +0 −1
  31. libavcodec/h264_mp4toannexb_bsf.c +0 −1
  32. libavcodec/idcinvideo.c +0 −1
  33. libavcodec/imgconvert.c +0 −1
  34. libavcodec/intelh263dec.c +0 −1
  35. libavcodec/kbdwin.c +0 −1
  36. libavcodec/libvo-aacenc.c +0 −1
  37. libavcodec/libvo-amrwbenc.c +0 −1
  38. libavcodec/libxavs.c +0 −1
  39. libavcodec/libxvid_rc.c +0 −1
  40. libavcodec/mace.c +0 −1
  41. libavcodec/mathops.h +0 −1
  42. libavcodec/mdec.c +0 −1
  43. libavcodec/mlp_parser.h +0 −1
  44. libavcodec/mpeg12.c +0 −1
  45. libavcodec/mpeg4video.c +0 −1
  46. libavcodec/msrledec.c +0 −1
  47. libavcodec/msrledec.h +0 −1
  48. libavcodec/nellymoser.c +0 −1
  49. libavcodec/nellymoserdec.c +0 −1
  50. libavcodec/nuv.c +0 −1
  51. libavcodec/pcm_tablegen.c +0 −1
  52. libavcodec/psymodel.c +0 −1
  53. libavcodec/qtrle.c +0 −1
  54. libavcodec/ratecontrol.h +0 −1
  55. libavcodec/rl2.c +0 −1
  56. libavcodec/sbr.h +8 −6
  57. libavcodec/sbrdsp.c +241 −0
  58. libavcodec/sbrdsp.h +48 −0
  59. libavcodec/sgidec.c +0 −1
  60. libavcodec/smacker.c +0 −1
  61. libavcodec/snow.c +0 −1
  62. libavcodec/tscc.c +0 −1
  63. libavcodec/ulti.c +0 −1
  64. libavcodec/utils.c +2 −2
  65. libavcodec/utvideo.c +0 −1
  66. libavcodec/vb.c +0 −1
  67. libavcodec/vmnc.c +0 −1
  68. libavcodec/vorbisdec.c +0 −1
  69. libavcodec/wma.c +0 −1
  70. libavcodec/xxan.c +0 −1
  71. libavcodec/zmbv.c +0 −1
  72. libavdevice/avdevice.h +0 −1
  73. libavfilter/defaults.c +0 −1
  74. libavfilter/formats.c +1 −0
  75. libavfilter/vf_aspect.c +0 −1
  76. libavfilter/vf_format.c +0 −1
  77. libavformat/aea.c +0 −1
  78. libavformat/avio.c +0 −1
  79. libavformat/httpauth.c +0 −1
  80. libavformat/id3v1.h +0 −1
  81. libavformat/iss.c +0 −1
  82. libavformat/lxfdec.c +0 −1
  83. libavformat/metadata.c +0 −1
  84. libavformat/movenchint.c +0 −1
  85. libavformat/network.c +0 −1
  86. libavformat/omadec.c +0 −1
  87. libavformat/rl2.c +0 −1
  88. libavformat/rtpdec_amr.c +0 −1
  89. libavformat/rtpdec_h263.c +0 −1
  90. libavformat/rtpenc_amr.c +0 −1
  91. libavformat/rtpenc_chain.c +0 −1
  92. libavformat/rtpenc_mpv.c +0 −2
  93. libavformat/rtsp.c +0 −1
  94. libavformat/rtspenc.c +0 −1
  95. libavformat/sapdec.c +0 −1
  96. libavformat/sapenc.c +0 −1
  97. libavformat/sdp.c +0 −1
  98. libavformat/seek.c +0 −1
  99. libavutil/crc.h +0 −1
  100. libavutil/intfloat_readwrite.c +0 −1
  101. libavutil/md5.h +0 −1
  102. libavutil/mem.c +1 −0
  103. libswscale/rgb2rgb.c +0 −1
  104. libswscale/utils.c +0 −1
doc/APIchanges+2−0
@@ -223,6 +223,8 @@ API changes, most recent first: · 222 unmodified lines
223223
224224 2011-07-10 - 0b950fe - lavc 53.8.0
225225 Add avcodec_open2(), deprecate avcodec_open().
226+ Add avcodec_alloc_context3. Deprecate avcodec_alloc_context() and
227+ avcodec_alloc_context2().
226228
227229 2011-07-01 - b442ca6 - lavf 53.5.0 - avformat.h
228230 Add function av_get_output_timestamp().
libavcodec/4xm.c+0−1
@@ -935,4 +935,3 @@ AVCodec ff_fourxm_decoder = { · 934 unmodified lines
935935 .capabilities = CODEC_CAP_DR1,
936936 .long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
937937 };
938−
libavcodec/Makefile+2−1
@@ -56,7 +56,8 @@ OBJS-$(CONFIG_VDPAU) += vdpau.o · 55 unmodified lines
5656 OBJS-$(CONFIG_A64MULTI_ENCODER) += a64multienc.o elbg.o
5757 OBJS-$(CONFIG_A64MULTI5_ENCODER) += a64multienc.o elbg.o
5858 OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps.o \
59− aacadtsdec.o mpeg4audio.o kbdwin.o
59+ aacadtsdec.o mpeg4audio.o kbdwin.o \
60+ sbrdsp.o
6061 OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
6162 aacpsy.o aactab.o \
6263 psymodel.o iirfilter.o \
libavcodec/aacenc.c+4−4
@@ -200,8 +200,8 @@ WINDOW_FUNC(long_start) · 199 unmodified lines
200200 float *out = sce->ret;
201201
202202 dsp->vector_fmul(out, audio, lwindow, 1024);
203− memcpy(out + 1024, audio, sizeof(out[0]) * 448);
204− dsp->vector_fmul_reverse(out + 1024 + 448, audio, swindow, 128);
203+ memcpy(out + 1024, audio + 1024, sizeof(out[0]) * 448);
204+ dsp->vector_fmul_reverse(out + 1024 + 448, audio + 1024 + 448, swindow, 128);
205205 memset(out + 1024 + 576, 0, sizeof(out[0]) * 448);
206206 }
207207
@@ -487,10 +487,10 @@ static void deinterleave_input_samples(AACEncContext *s, · 279 unmodified lines
487487 const float *sptr = samples + channel_map[ch];
488488
489489 /* copy last 1024 samples of previous frame to the start of the current frame */
490− memcpy(&s->planar_samples[ch][0], &s->planar_samples[ch][1024], 1024 * sizeof(s->planar_samples[0][0]));
490+ memcpy(&s->planar_samples[ch][1024], &s->planar_samples[ch][2048], 1024 * sizeof(s->planar_samples[0][0]));
491491
492492 /* deinterleave */
493− for (i = 1024; i < 1024 * 2; i++) {
493+ for (i = 2048; i < 3072; i++) {
494494 s->planar_samples[ch][i] = *sptr;
495495 sptr += sinc;
496496 }
libavcodec/aacsbr.c+51−136
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include "aacsbrdata.h"
3333 #include "fft.h"
3434 #include "aacps.h"
35+#include "sbrdsp.h"
3536 #include "libavutil/libm.h"
3637 #include "libavutil/avassert.h"
3738
@@ -144,6 +145,7 @@ av_cold void ff_aac_sbr_ctx_init(AACContext *ac, SpectralBandReplication *sbr) · 106 unmodified lines
144145 ff_mdct_init(&sbr->mdct, 7, 1, 1.0 / (64 * mdct_scale));
145146 ff_mdct_init(&sbr->mdct_ana, 7, 1, -2.0 * mdct_scale);
146147 ff_ps_ctx_init(&sbr->ps);
148+ ff_sbrdsp_init(&sbr->dsp);
147149 }
148150
149151 av_cold void ff_aac_sbr_ctx_close(SpectralBandReplication *sbr)
@@ -1143,33 +1145,21 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac) · 993 unmodified lines
11431145 * @param x pointer to the beginning of the first sample window
11441146 * @param W array of complex-valued samples split into subbands
11451147 */
1146−static void sbr_qmf_analysis(DSPContext *dsp, FFTContext *mdct, const float *in, float *x,
1148+static void sbr_qmf_analysis(DSPContext *dsp, FFTContext *mdct,
1149+ SBRDSPContext *sbrdsp, const float *in, float *x,
11471150 float z[320], float W[2][32][32][2])
11481151 {
1149− int i, k;
1152+ int i;
11501153 memcpy(W[0], W[1], sizeof(W[0]));
11511154 memcpy(x , x+1024, (320-32)*sizeof(x[0]));
11521155 memcpy(x+288, in, 1024*sizeof(x[0]));
11531156 for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames
11541157 // are not supported
11551158 dsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320);
1156− for (k = 0; k < 64; k++) {
1157− float f = z[k] + z[k + 64] + z[k + 128] + z[k + 192] + z[k + 256];
1158− z[k] = f;
1159− }
1160− //Shuffle to IMDCT
1161− z[64] = z[0];
1162− for (k = 1; k < 32; k++) {
1163− z[64+2*k-1] = z[ k];
1164− z[64+2*k ] = -z[64-k];
1165− }
1166− z[64+63] = z[32];
1167−
1159+ sbrdsp->sum64x5(z);
1160+ sbrdsp->qmf_pre_shuffle(z);
11681161 mdct->imdct_half(mdct, z, z+64);
1169− for (k = 0; k < 32; k++) {
1170− W[1][i][k][0] = -z[63-k];
1171− W[1][i][k][1] = z[k];
1172− }
1162+ sbrdsp->qmf_post_shuffle(W[1][i], z);
11731163 x += 32;
11741164 }
11751165 }
@@ -1179,6 +1169,7 @@ static void sbr_qmf_analysis(DSPContext *dsp, FFTContext *mdct, const float *in, · 3 unmodified lines
11791169 * (14496-3 sp04 p206)
11801170 */
11811171 static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct,
1172+ SBRDSPContext *sbrdsp,
11821173 float *out, float X[2][38][64],
11831174 float mdct_buf[2][64],
11841175 float *v0, int *v_off, const unsigned int div)
@@ -1202,20 +1193,12 @@ static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct, · 17 unmodified lines
12021193 X[0][i][32+n] = X[1][i][31-n];
12031194 }
12041195 mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
1205− for (n = 0; n < 32; n++) {
1206− v[ n] = mdct_buf[0][63 - 2*n];
1207− v[63 - n] = -mdct_buf[0][62 - 2*n];
1208− }
1196+ sbrdsp->qmf_deint_neg(v, mdct_buf[0]);
12091197 } else {
1210− for (n = 1; n < 64; n+=2) {
1211− X[1][i][n] = -X[1][i][n];
1212− }
1198+ sbrdsp->neg_odd_64(X[1][i]);
12131199 mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
12141200 mdct->imdct_half(mdct, mdct_buf[1], X[1][i]);
1215− for (n = 0; n < 64; n++) {
1216− v[ n] = -mdct_buf[0][63 - n] + mdct_buf[1][ n ];
1217− v[127 - n] = mdct_buf[0][63 - n] + mdct_buf[1][ n ];
1218− }
1201+ sbrdsp->qmf_deint_bfly(v, mdct_buf[1], mdct_buf[0]);
12191202 }
12201203 dsp->vector_fmul_add(out, v , sbr_qmf_window , zero64, 64 >> div);
12211204 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, · 9 unmodified lines
12311214 }
12321215 }
12331216
1234−static void autocorrelate(const float x[40][2], float phi[3][2][2], int lag)
1235−{
1236− int i;
1237− float real_sum = 0.0f;
1238− float imag_sum = 0.0f;
1239− if (lag) {
1240− for (i = 1; i < 38; i++) {
1241− real_sum += x[i][0] * x[i+lag][0] + x[i][1] * x[i+lag][1];
1242− imag_sum += x[i][0] * x[i+lag][1] - x[i][1] * x[i+lag][0];
1243− }
1244− phi[2-lag][1][0] = real_sum + x[ 0][0] * x[lag][0] + x[ 0][1] * x[lag][1];
1245− phi[2-lag][1][1] = imag_sum + x[ 0][0] * x[lag][1] - x[ 0][1] * x[lag][0];
1246− if (lag == 1) {
1247− phi[0][0][0] = real_sum + x[38][0] * x[39][0] + x[38][1] * x[39][1];
1248− phi[0][0][1] = imag_sum + x[38][0] * x[39][1] - x[38][1] * x[39][0];
1249− }
1250− } else {
1251− for (i = 1; i < 38; i++) {
1252− real_sum += x[i][0] * x[i][0] + x[i][1] * x[i][1];
1253− }
1254− phi[2][1][0] = real_sum + x[ 0][0] * x[ 0][0] + x[ 0][1] * x[ 0][1];
1255− phi[1][0][0] = real_sum + x[38][0] * x[38][0] + x[38][1] * x[38][1];
1256− }
1257−}
1258−
12591217 /** High Frequency Generation (14496-3 sp04 p214+) and Inverse Filtering
12601218 * (14496-3 sp04 p214)
12611219 * Warning: This routine does not seem numerically stable.
12621220 */
1263−static void sbr_hf_inverse_filter(float (*alpha0)[2], float (*alpha1)[2],
1221+static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
1222+ float (*alpha0)[2], float (*alpha1)[2],
12641223 const float X_low[32][40][2], int k0)
12651224 {
12661225 int k;
12671226 for (k = 0; k < k0; k++) {
1268− float phi[3][2][2], dk;
1227+ LOCAL_ALIGNED_16(float, phi, [3], [2][2]);
1228+ float dk;
12691229
1270− autocorrelate(X_low[k], phi, 0);
1271− autocorrelate(X_low[k], phi, 1);
1272− autocorrelate(X_low[k], phi, 2);
1230+ dsp->autocorrelate(X_low[k], phi);
12731231
12741232 dk = phi[2][1][0] * phi[1][0][0] -
12751233 (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, · 89 unmodified lines
13651323 const float bw_array[5], const uint8_t *t_env,
13661324 int bs_num_env)
13671325 {
1368− int i, j, x;
1326+ int j, x;
13691327 int g = 0;
13701328 int k = sbr->kx[1];
13711329 for (j = 0; j < sbr->num_patches; j++) {
13721330 for (x = 0; x < sbr->patch_num_subbands[j]; x++, k++) {
1373− float alpha[4];
13741331 const int p = sbr->patch_start_subband[j] + x;
13751332 while (g <= sbr->n_q && k >= sbr->f_tablenoise[g])
13761333 g++;
@@ -1382,26 +1339,10 @@ static int sbr_hf_gen(AACContext *ac, SpectralBandReplication *sbr, · 5 unmodified lines
13821339 return -1;
13831340 }
13841341
1385− alpha[0] = alpha1[p][0] * bw_array[g] * bw_array[g];
1386− alpha[1] = alpha1[p][1] * bw_array[g] * bw_array[g];
1387− alpha[2] = alpha0[p][0] * bw_array[g];
1388− alpha[3] = alpha0[p][1] * bw_array[g];
1389−
1390− for (i = 2 * t_env[0]; i < 2 * t_env[bs_num_env]; i++) {
1391− const int idx = i + ENVELOPE_ADJUSTMENT_OFFSET;
1392− X_high[k][idx][0] =
1393− X_low[p][idx - 2][0] * alpha[0] -
1394− X_low[p][idx - 2][1] * alpha[1] +
1395− X_low[p][idx - 1][0] * alpha[2] -
1396− X_low[p][idx - 1][1] * alpha[3] +
1397− X_low[p][idx][0];
1398− X_high[k][idx][1] =
1399− X_low[p][idx - 2][1] * alpha[0] +
1400− X_low[p][idx - 2][0] * alpha[1] +
1401− X_low[p][idx - 1][1] * alpha[2] +
1402− X_low[p][idx - 1][0] * alpha[3] +
1403− X_low[p][idx][1];
1404− }
1342+ sbr->dsp.hf_gen(X_high[k] + ENVELOPE_ADJUSTMENT_OFFSET,
1343+ X_low[p] + ENVELOPE_ADJUSTMENT_OFFSET,
1344+ alpha0[p], alpha1[p], bw_array[g],
1345+ 2 * t_env[0], 2 * t_env[bs_num_env]);
14051346 }
14061347 }
14071348 if (k < sbr->m[1] + sbr->kx[1])
@@ -1502,7 +1443,8 @@ static void sbr_mapping(AACContext *ac, SpectralBandReplication *sbr, · 94 unmodified lines
15021443 static void sbr_env_estimate(float (*e_curr)[48], float X_high[64][40][2],
15031444 SpectralBandReplication *sbr, SBRData *ch_data)
15041445 {
1505− int e, i, m;
1446+ int e, m;
1447+ int kx1 = sbr->kx[1];
15061448
15071449 if (sbr->bs_interpol_freq) {
15081450 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], · 2 unmodified lines
15111453 int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
15121454
15131455 for (m = 0; m < sbr->m[1]; m++) {
1514− float sum = 0.0f;
1515−
1516− for (i = ilb; i < iub; i++) {
1517− sum += X_high[m + sbr->kx[1]][i][0] * X_high[m + sbr->kx[1]][i][0] +
1518− X_high[m + sbr->kx[1]][i][1] * X_high[m + sbr->kx[1]][i][1];
1519− }
1456+ float sum = sbr->dsp.sum_square(X_high[m+kx1] + ilb, iub - ilb);
15201457 e_curr[e][m] = sum * recip_env_size;
15211458 }
15221459 }
@@ -1534,14 +1471,11 @@ static void sbr_env_estimate(float (*e_curr)[48], float X_high[64][40][2], · 11 unmodified lines
15341471 const int den = env_size * (table[p + 1] - table[p]);
15351472
15361473 for (k = table[p]; k < table[p + 1]; k++) {
1537− for (i = ilb; i < iub; i++) {
1538− sum += X_high[k][i][0] * X_high[k][i][0] +
1539− X_high[k][i][1] * X_high[k][i][1];
1540− }
1474+ sum += sbr->dsp.sum_square(X_high[k] + ilb, iub - ilb);
15411475 }
15421476 sum /= den;
15431477 for (k = table[p]; k < table[p + 1]; k++) {
1544− e_curr[e][k - sbr->kx[1]] = sum;
1478+ e_curr[e][k - kx1] = sum;
15451479 }
15461480 }
15471481 }
@@ -1652,55 +1586,35 @@ static void sbr_hf_assemble(float Y[2][38][64][2], const float X_high[64][40][2] · 104 unmodified lines
16521586 for (e = 0; e < ch_data->bs_num_env; e++) {
16531587 for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) {
16541588 int phi_sign = (1 - 2*(kx & 1));
1589+ LOCAL_ALIGNED_16(float, g_filt_tab, [48]);
1590+ LOCAL_ALIGNED_16(float, q_filt_tab, [48]);
1591+ float *g_filt, *q_filt;
16551592
16561593 if (h_SL && e != e_a[0] && e != e_a[1]) {
1594+ g_filt = g_filt_tab;
1595+ q_filt = q_filt_tab;
16571596 for (m = 0; m < m_max; m++) {
16581597 const int idx1 = i + h_SL;
1659− float g_filt = 0.0f;
1660− for (j = 0; j <= h_SL; j++)
1661− g_filt += g_temp[idx1 - j][m] * h_smooth[j];
1662− Y[1][i][m + kx][0] =
1663− X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][0] * g_filt;
1664− Y[1][i][m + kx][1] =
1665− X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][1] * g_filt;
1598+ g_filt[m] = 0.0f;
1599+ q_filt[m] = 0.0f;
1600+ for (j = 0; j <= h_SL; j++) {
1601+ g_filt[m] += g_temp[idx1 - j][m] * h_smooth[j];
1602+ q_filt[m] += q_temp[idx1 - j][m] * h_smooth[j];
1603+ }
16661604 }
16671605 } else {
1668− for (m = 0; m < m_max; m++) {
1669− const float g_filt = g_temp[i + h_SL][m];
1670− Y[1][i][m + kx][0] =
1671− X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][0] * g_filt;
1672− Y[1][i][m + kx][1] =
1673− X_high[m + kx][i + ENVELOPE_ADJUSTMENT_OFFSET][1] * g_filt;
1674− }
1606+ g_filt = g_temp[i + h_SL];
1607+ q_filt = q_temp[i];
16751608 }
16761609
1610+ sbr->dsp.hf_g_filt(Y[1][i] + kx, X_high + kx, g_filt, m_max,
1611+ i + ENVELOPE_ADJUSTMENT_OFFSET);
1612+
16771613 if (e != e_a[0] && e != e_a[1]) {
1678− for (m = 0; m < m_max; m++) {
1679− indexnoise = (indexnoise + 1) & 0x1ff;
1680− if (sbr->s_m[e][m]) {
1681− Y[1][i][m + kx][0] +=
1682− sbr->s_m[e][m] * phi[0][indexsine];
1683− Y[1][i][m + kx][1] +=
1684− sbr->s_m[e][m] * (phi[1][indexsine] * phi_sign);
1685− } else {
1686− float q_filt;
1687− if (h_SL) {
1688− const int idx1 = i + h_SL;
1689− q_filt = 0.0f;
1690− for (j = 0; j <= h_SL; j++)
1691− q_filt += q_temp[idx1 - j][m] * h_smooth[j];
1692− } else {
1693− q_filt = q_temp[i][m];
1694− }
1695− Y[1][i][m + kx][0] +=
1696− q_filt * sbr_noise_table[indexnoise][0];
1697− Y[1][i][m + kx][1] +=
1698− q_filt * sbr_noise_table[indexnoise][1];
1699− }
1700− phi_sign = -phi_sign;
1701− }
1614+ sbr->dsp.hf_apply_noise[indexsine](Y[1][i] + kx, sbr->s_m[e],
1615+ q_filt, indexnoise,
1616+ kx, m_max);
17021617 } else {
1703− indexnoise = (indexnoise + m_max) & 0x1ff;
17041618 for (m = 0; m < m_max; m++) {
17051619 Y[1][i][m + kx][0] +=
17061620 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] · 2 unmodified lines
17091623 phi_sign = -phi_sign;
17101624 }
17111625 }
1626+ indexnoise = (indexnoise + m_max) & 0x1ff;
17121627 indexsine = (indexsine + 1) & 3;
17131628 }
17141629 }
@@ -1728,12 +1643,12 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac, · 13 unmodified lines
17281643 }
17291644 for (ch = 0; ch < nch; ch++) {
17301645 /* decode channel */
1731− sbr_qmf_analysis(&ac->dsp, &sbr->mdct_ana, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
1646+ sbr_qmf_analysis(&ac->dsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
17321647 (float*)sbr->qmf_filter_scratch,
17331648 sbr->data[ch].W);
17341649 sbr_lf_gen(ac, sbr, sbr->X_low, sbr->data[ch].W);
17351650 if (sbr->start) {
1736− sbr_hf_inverse_filter(sbr->alpha0, sbr->alpha1, sbr->X_low, sbr->k[0]);
1651+ sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1, sbr->X_low, sbr->k[0]);
17371652 sbr_chirp(sbr, &sbr->data[ch]);
17381653 sbr_hf_gen(ac, sbr, sbr->X_high, sbr->X_low, sbr->alpha0, sbr->alpha1,
17391654 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, · 20 unmodified lines
17601675 nch = 2;
17611676 }
17621677
1763− sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, L, sbr->X[0], sbr->qmf_filter_scratch,
1678+ sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, L, sbr->X[0], sbr->qmf_filter_scratch,
17641679 sbr->data[0].synthesis_filterbank_samples,
17651680 &sbr->data[0].synthesis_filterbank_samples_offset,
17661681 downsampled);
17671682 if (nch == 2)
1768− sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, R, sbr->X[1], sbr->qmf_filter_scratch,
1683+ sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, R, sbr->X[1], sbr->qmf_filter_scratch,
17691684 sbr->data[1].synthesis_filterbank_samples,
17701685 &sbr->data[1].synthesis_filterbank_samples_offset,
17711686 downsampled);
libavcodec/aacsbrdata.h+3−1
@@ -352,7 +352,8 @@ static DECLARE_ALIGNED(16, float, sbr_qmf_window_us)[640] = { · 351 unmodified lines
352352 0.8537385600,
353353 };
354354
355−static const float sbr_noise_table[512][2] = {
355+/* First two entries repeated at end to simplify SIMD implementations. */
356+const DECLARE_ALIGNED(16, float, ff_sbr_noise_table)[][2] = {
356357 {-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
357358 { 0.14130051758487, -0.95090983575689}, {-0.47005496701697, -0.37340549728647},
358359 { 0.80705063769351, 0.29653668284408}, {-0.38981478896926, 0.89572605717087},
@@ -609,6 +610,7 @@ static const float sbr_noise_table[512][2] = { · 250 unmodified lines
609610 {-0.93412041758744, 0.41374052024363}, { 0.96063943315511, 0.93116709541280},
610611 { 0.97534253457837, 0.86150930812689}, { 0.99642466504163, 0.70190043427512},
611612 {-0.94705089665984, -0.29580042814306}, { 0.91599807087376, -0.98147830385781},
613+{-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
612614 };
613615
614616 #endif /* AVCODEC_AACSBRDATA_H */
libavcodec/acelp_filters.c+0−1
@@ -142,4 +142,3 @@ void ff_tilt_compensation(float *mem, float tilt, float *samples, int size) · 141 unmodified lines
142142 samples[0] -= tilt * *mem;
143143 *mem = new_tilt_mem;
144144 }
145−
libavcodec/allcodecs.c+0−1
@@ -465,4 +465,3 @@ void avcodec_register_all(void) · 464 unmodified lines
465465 REGISTER_BSF (REMOVE_EXTRADATA, remove_extradata);
466466 REGISTER_BSF (TEXT2MOVSUB, text2movsub);
467467 }
468−
libavcodec/alsdec.c+0−1
@@ -1755,4 +1755,3 @@ AVCodec ff_als_decoder = { · 1754 unmodified lines
17551755 .capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
17561756 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"),
17571757 };
1758−
libavcodec/amrnbdata.h+0−1
@@ -1669,4 +1669,3 @@ static const float highpass_poles[2] = { -1.933105469, 0.935913085 }; · 1668 unmodified lines
16691669 static const float highpass_gain = 0.939819335;
16701670
16711671 #endif /* AVCODEC_AMRNBDATA_H */
1672−
libavcodec/arm/Makefile+4−0
@@ -1,6 +1,8 @@
11 OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \
22 arm/ac3dsp_arm.o
33
4+OBJS-$(CONFIG_AAC_DECODER) += arm/sbrdsp_init_arm.o
5+
46 OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o \
57
68 ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o
@@ -61,6 +63,8 @@ NEON-OBJS-$(CONFIG_H264PRED) += arm/h264pred_neon.o \ · 54 unmodified lines
6163
6264 NEON-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_neon.o
6365
66+NEON-OBJS-$(CONFIG_AAC_DECODER) += arm/sbrdsp_neon.o
67+
6468 NEON-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_neon.o \
6569 arm/synth_filter_neon.o \
6670
libavcodec/arm/sbrdsp_init_arm.c+70−0
@@ -0,0 +1,70 @@
1+/*
2+ * Copyright (c) 2012 Mans Rullgard
3+ *
4+ * This file is part of Libav.
5+ *
6+ * Libav is free software; you can redistribute it and/or
7+ * modify it under the terms of the GNU Lesser General Public
8+ * License as published by the Free Software Foundation; either
9+ * version 2.1 of the License, or (at your option) any later version.
10+ *
11+ * Libav is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+ * Lesser General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU Lesser General Public
17+ * License along with Libav; if not, write to the Free Software
18+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+ */
20+
21+#include "config.h"
22+#include "libavutil/attributes.h"
23+#include "libavcodec/sbrdsp.h"
24+
25+void ff_sbr_sum64x5_neon(float *z);
26+float ff_sbr_sum_square_neon(float (*x)[2], int n);
27+void ff_sbr_neg_odd_64_neon(float *x);
28+void ff_sbr_qmf_pre_shuffle_neon(float *z);
29+void ff_sbr_qmf_post_shuffle_neon(float W[32][2], const float *z);
30+void ff_sbr_qmf_deint_neg_neon(float *v, const float *src);
31+void ff_sbr_qmf_deint_bfly_neon(float *v, const float *src0, const float *src1);
32+void ff_sbr_hf_g_filt_neon(float (*Y)[2], const float (*X_high)[40][2],
33+ const float *g_filt, int m_max, int ixh);
34+void ff_sbr_hf_gen_neon(float (*X_high)[2], const float (*X_low)[2],
35+ const float alpha0[2], const float alpha1[2],
36+ float bw, int start, int end);
37+void ff_sbr_autocorrelate_neon(const float x[40][2], float phi[3][2][2]);
38+
39+void ff_sbr_hf_apply_noise_0_neon(float Y[64][2], const float *s_m,
40+ const float *q_filt, int noise,
41+ int kx, int m_max);
42+void ff_sbr_hf_apply_noise_1_neon(float Y[64][2], const float *s_m,
43+ const float *q_filt, int noise,
44+ int kx, int m_max);
45+void ff_sbr_hf_apply_noise_2_neon(float Y[64][2], const float *s_m,
46+ const float *q_filt, int noise,
47+ int kx, int m_max);
48+void ff_sbr_hf_apply_noise_3_neon(float Y[64][2], const float *s_m,
49+ const float *q_filt, int noise,
50+ int kx, int m_max);
51+
52+av_cold void ff_sbrdsp_init_arm(SBRDSPContext *s)
53+{
54+ if (HAVE_NEON) {
55+ s->sum64x5 = ff_sbr_sum64x5_neon;
56+ s->sum_square = ff_sbr_sum_square_neon;
57+ s->neg_odd_64 = ff_sbr_neg_odd_64_neon;
58+ s->qmf_pre_shuffle = ff_sbr_qmf_pre_shuffle_neon;
59+ s->qmf_post_shuffle = ff_sbr_qmf_post_shuffle_neon;
60+ s->qmf_deint_neg = ff_sbr_qmf_deint_neg_neon;
61+ s->qmf_deint_bfly = ff_sbr_qmf_deint_bfly_neon;
62+ s->hf_g_filt = ff_sbr_hf_g_filt_neon;
63+ s->hf_gen = ff_sbr_hf_gen_neon;
64+ s->autocorrelate = ff_sbr_autocorrelate_neon;
65+ s->hf_apply_noise[0] = ff_sbr_hf_apply_noise_0_neon;
66+ s->hf_apply_noise[1] = ff_sbr_hf_apply_noise_1_neon;
67+ s->hf_apply_noise[2] = ff_sbr_hf_apply_noise_2_neon;
68+ s->hf_apply_noise[3] = ff_sbr_hf_apply_noise_3_neon;
69+ }
70+}
libavcodec/arm/sbrdsp_neon.S+411−0
@@ -0,0 +1,411 @@
1+/*
2+ * Copyright (c) 2012 Mans Rullgard
3+ *
4+ * This file is part of Libav.
5+ *
6+ * Libav is free software; you can redistribute it and/or
7+ * modify it under the terms of the GNU Lesser General Public
8+ * License as published by the Free Software Foundation; either
9+ * version 2.1 of the License, or (at your option) any later version.
10+ *
11+ * Libav is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+ * Lesser General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU Lesser General Public
17+ * License along with Libav; if not, write to the Free Software
18+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+ */
20+
21+#include "asm.S"
22+
23+function ff_sbr_sum64x5_neon, export=1
24+ push {lr}
25+ add r1, r0, # 64*4
26+ add r2, r0, #128*4
27+ add r3, r0, #192*4
28+ add lr, r0, #256*4
29+ mov r12, #64
30+1:
31+ vld1.32 {q0}, [r0,:128]
32+ vld1.32 {q1}, [r1,:128]!
33+ vadd.f32 q0, q0, q1
34+ vld1.32 {q2}, [r2,:128]!
35+ vadd.f32 q0, q0, q2
36+ vld1.32 {q3}, [r3,:128]!
37+ vadd.f32 q0, q0, q3
38+ vld1.32 {q8}, [lr,:128]!
39+ vadd.f32 q0, q0, q8
40+ vst1.32 {q0}, [r0,:128]!
41+ subs r12, #4
42+ bgt 1b
43+ pop {pc}
44+endfunc
45+
46+function ff_sbr_sum_square_neon, export=1
47+ vmov.f32 q0, #0.0
48+1:
49+ vld1.32 {q1}, [r0,:128]!
50+ vmla.f32 q0, q1, q1
51+ subs r1, r1, #2
52+ bgt 1b
53+ vadd.f32 d0, d0, d1
54+ vpadd.f32 d0, d0, d0
55+NOVFP vmov.32 r0, d0[0]
56+ bx lr
57+endfunc
58+
59+function ff_sbr_neg_odd_64_neon, export=1
60+ mov r1, r0
61+ vmov.i32 q8, #1<<31
62+ vld2.32 {q0,q1}, [r0,:128]!
63+ veor q1, q1, q8
64+ vld2.32 {q2,q3}, [r0,:128]!
65+ .rept 3
66+ vst2.32 {q0,q1}, [r1,:128]!
67+ veor q3, q3, q8
68+ vld2.32 {q0,q1}, [r0,:128]!
69+ vst2.32 {q2,q3}, [r1,:128]!
70+ veor q1, q1, q8
71+ vld2.32 {q2,q3}, [r0,:128]!
72+ .endr
73+ veor q3, q3, q8
74+ vst2.32 {q0,q1}, [r1,:128]!
75+ vst2.32 {q2,q3}, [r1,:128]!
76+ bx lr
77+endfunc
78+
79+function ff_sbr_qmf_pre_shuffle_neon, export=1
80+ add r1, r0, #60*4
81+ add r2, r0, #64*4
82+ vld1.32 {d0}, [r0,:64]!
83+ vst1.32 {d0}, [r2,:64]!
84+ mov r3, #-16
85+ mov r12, #24
86+ vmov.i32 q8, #1<<31
87+ vld1.32 {q0}, [r1,:128], r3
88+ vld1.32 {d2}, [r0,:64]!
89+1:
90+ vld1.32 {d3,d4}, [r0,:128]!
91+ vrev64.32 q0, q0
92+ vld1.32 {q9}, [r1,:128], r3
93+ veor q0, q0, q8
94+ vld1.32 {d5,d6}, [r0,:128]!
95+ vswp d0, d1
96+ vrev64.32 q9, q9
97+ vst2.32 {q0,q1}, [r2,:64]!
98+ vmov q10, q2
99+ veor q9, q9, q8
100+ vmov d2, d6
101+ vswp d18, d19
102+ vld1.32 {q0}, [r1,:128], r3
103+ vst2.32 {q9,q10}, [r2,:64]!
104+ subs r12, r12, #8
105+ bgt 1b
106+ vld1.32 {d3,d4}, [r0,:128]!
107+ vrev64.32 q0, q0
108+ vld1.32 {q9}, [r1,:128], r3
109+ veor q0, q0, q8
110+ vld1.32 {d5}, [r0,:64]!
111+ vswp d0, d1
112+ vrev64.32 q9, q9
113+ vst2.32 {q0,q1}, [r2,:64]!
114+ vswp d4, d5
115+ veor q1, q9, q8
116+ vst2.32 {d3,d5}, [r2,:64]!
117+ vst2.32 {d2[0],d4[0]}, [r2,:64]!
118+ bx lr
119+endfunc
120+
121+function ff_sbr_qmf_post_shuffle_neon, export=1
122+ add r2, r1, #60*4
123+ mov r3, #-16
124+ mov r12, #32
125+ vmov.i32 q8, #1<<31
126+ vld1.32 {q0}, [r2,:128], r3
127+ vld1.32 {q1}, [r1,:128]!
128+1:
129+ pld [r2, #-32]
130+ vrev64.32 q0, q0
131+ vswp d2, d3
132+ veor q0, q0, q8
133+ vld1.32 {q2}, [r2,:128], r3
134+ vld1.32 {q3}, [r1,:128]!
135+ vst2.32 {d1,d3}, [r0,:128]!
136+ vst2.32 {d0,d2}, [r0,:128]!
137+ pld [r2, #-32]
138+ vrev64.32 q2, q2
139+ vswp d6, d7
140+ veor q2, q2, q8
141+ vld1.32 {q0}, [r2,:128], r3
142+ vld1.32 {q1}, [r1,:128]!
143+ vst2.32 {d5,d7}, [r0,:128]!
144+ vst2.32 {d4,d6}, [r0,:128]!
145+ subs r12, r12, #8
146+ bgt 1b
147+ bx lr
148+endfunc
149+
150+function ff_sbr_qmf_deint_neg_neon, export=1
151+ add r1, r1, #60*4
152+ add r2, r0, #62*4
153+ mov r3, #-16
154+ mov r12, #32
155+ vmov.i32 d2, #1<<31
156+1:
157+ vld2.32 {d0,d1}, [r1,:128], r3
158+ veor d0, d0, d2
159+ vrev64.32 d1, d1
160+ vst1.32 {d0}, [r2,:64]
161+ vst1.32 {d1}, [r0,:64]!
162+ sub r2, r2, #8
163+ subs r12, r12, #2
164+ bgt 1b
165+ bx lr
166+endfunc
167+
168+function ff_sbr_qmf_deint_bfly_neon, export=1
169+ push {lr}
170+ add r2, r2, #60*4
171+ add r3, r0, #124*4
172+ mov r12, #64
173+ mov lr, #-16
174+1:
175+ vld1.32 {q0}, [r1,:128]!
176+ vld1.32 {q1}, [r2,:128], lr
177+ vrev64.32 q2, q0
178+ vrev64.32 q3, q1
179+ vadd.f32 d3, d4, d3
180+ vadd.f32 d2, d5, d2
181+ vsub.f32 d0, d0, d7
182+ vsub.f32 d1, d1, d6
183+ vst1.32 {q1}, [r3,:128], lr
184+ vst1.32 {q0}, [r0,:128]!
185+ subs r12, r12, #4
186+ bgt 1b
187+ pop {pc}
188+endfunc
189+
190+function ff_sbr_hf_g_filt_neon, export=1
191+ ldr r12, [sp]
192+ add r1, r1, r12, lsl #3
193+ mov r12, #40*2*4
194+ sub r3, r3, #1
195+ vld2.32 {d2[],d3[]},[r2,:64]!
196+ vld1.32 {d0}, [r1,:64], r12
197+1:
198+ vld1.32 {d1}, [r1,:64], r12
199+ vmul.f32 q3, q0, q1
200+ vld2.32 {d2[],d3[]},[r2,:64]!
201+ vld1.32 {d0}, [r1,:64], r12
202+ vst1.32 {q3}, [r0,:64]!
203+ subs r3, r3, #2
204+ bgt 1b
205+ it lt
206+ bxlt lr
207+ vmul.f32 d0, d0, d2
208+ vst1.32 {d0}, [r0,:64]!
209+ bx lr
210+endfunc
211+
212+function ff_sbr_hf_gen_neon, export=1
213+NOVFP vld1.32 {d1[]}, [sp,:32]
214+VFP vdup.32 d1, d0[0]
215+ vmul.f32 d0, d1, d1
216+ vld1.32 {d3}, [r2,:64]
217+ vld1.32 {d2}, [r3,:64]
218+ vmul.f32 q0, q0, q1
219+ ldrd r2, r3, [sp, #4*!HAVE_VFP_ARGS]
220+ vtrn.32 d0, d1
221+ vneg.f32 d18, d1
222+ vtrn.32 d18, d1
223+ add r0, r0, r2, lsl #3
224+ add r1, r1, r2, lsl #3
225+ sub r1, r1, #2*8
226+ sub r3, r3, r2
227+ vld1.32 {q1}, [r1,:128]!
228+1:
229+ vld1.32 {q3}, [r1,:128]!
230+ vrev64.32 q2, q1
231+ vmov q8, q3
232+ vrev64.32 d20, d3
233+ vrev64.32 d21, d6
234+ vmla.f32 q3, q1, d0[0]
235+ vmla.f32 d6, d4, d18
236+ vmla.f32 d7, d20, d18
237+ vmla.f32 d6, d3, d0[1]
238+ vmla.f32 d7, d16, d0[1]
239+ vmla.f32 d6, d5, d1
240+ vmla.f32 d7, d21, d1
241+ vmov q1, q8
242+ vst1.32 {q3}, [r0,:128]!
243+ subs r3, r3, #2
244+ bgt 1b
245+ bx lr
246+endfunc
247+
248+function ff_sbr_autocorrelate_neon, export=1
249+ vld1.32 {q0}, [r0,:128]!
250+ vmov.f32 q1, #0.0
251+ vmov.f32 q3, #0.0
252+ vmov.f32 d20, #0.0
253+ vmul.f32 d21, d1, d1
254+ vmov q8, q0
255+ vmov q11, q0
256+ mov r12, #36
257+1:
258+ vld1.32 {q2}, [r0,:128]!
259+ vrev64.32 q12, q2
260+ vmla.f32 q10, q2, q2
261+ vmla.f32 d2, d1, d4
262+ vmla.f32 d3, d1, d24
263+ vmla.f32 d6, d0, d4
264+ vmla.f32 d7, d0, d24
265+ vmla.f32 d2, d4, d5
266+ vmla.f32 d3, d4, d25
267+ vmla.f32 d6, d1, d5
268+ vmla.f32 d7, d1, d25
269+ vmov q0, q2
270+ subs r12, r12, #2
271+ bgt 1b
272+ vld1.32 {q2}, [r0,:128]!
273+ vrev64.32 q12, q2
274+ vmla.f32 d2, d1, d4
275+ vmla.f32 d3, d1, d24
276+ vmla.f32 d6, d0, d4
277+ vmla.f32 d7, d0, d24
278+ vadd.f32 d20, d20, d21
279+ vrev64.32 d18, d17
280+ vmla.f32 d6, d1, d5
281+ vmla.f32 d7, d1, d25
282+ vmov q0, q1
283+ vmla.f32 d0, d16, d17
284+ vmla.f32 d1, d16, d18
285+ vmla.f32 d2, d4, d5
286+ vmla.f32 d3, d4, d25
287+ vneg.f32 s15, s15
288+ vmov d21, d20
289+ vpadd.f32 d0, d0, d2
290+ vpadd.f32 d7, d6, d7
291+ vtrn.32 d1, d3
292+ vsub.f32 d6, d1, d3
293+ vmla.f32 d20, d22, d22
294+ vmla.f32 d21, d4, d4
295+ vtrn.32 d0, d6
296+ vpadd.f32 d20, d20, d21
297+ vst1.32 {q3}, [r1,:128]!
298+ vst1.32 {d20[1]}, [r1,:32]
299+ add r1, r1, #2*4
300+ vst1.32 {d0}, [r1,:64]
301+ add r1, r1, #4*4
302+ vst1.32 {d20[0]}, [r1,:32]
303+ bx lr
304+endfunc
305+
306+function ff_sbr_hf_apply_noise_0_neon, export=1
307+ vmov.i32 d3, #0
308+.Lhf_apply_noise_0:
309+ push {r4,lr}
310+ ldr r12, [sp, #12]
311+ movrel r4, X(ff_sbr_noise_table)
312+ add r3, r3, #1
313+ bfc r3, #9, #23
314+ sub r12, r12, #1
315+1:
316+ add lr, r4, r3, lsl #3
317+ vld2.32 {q0}, [r0,:64]
318+ vld2.32 {q3}, [lr,:64]
319+ vld1.32 {d2}, [r1,:64]!
320+ vld1.32 {d18}, [r2,:64]!
321+ vceq.f32 d16, d2, #0
322+ veor d2, d2, d3
323+ vmov q2, q0
324+ vmla.f32 d0, d6, d18
325+ vmla.f32 d1, d7, d18
326+ vadd.f32 d4, d4, d2
327+ add r3, r3, #2
328+ bfc r3, #9, #23
329+ vbif d0, d4, d16
330+ vbif d1, d5, d16
331+ vst2.32 {q0}, [r0,:64]!
332+ subs r12, r12, #2
333+ bgt 1b
334+ blt 2f
335+ add lr, r4, r3, lsl #3
336+ vld1.32 {d0}, [r0,:64]
337+ vld1.32 {d6}, [lr,:64]
338+ vld1.32 {d2[]}, [r1,:32]!
339+ vld1.32 {d3[]}, [r2,:32]!
340+ vceq.f32 d4, d2, #0
341+ veor d2, d2, d3
342+ vmov d1, d0
343+ vmla.f32 d0, d6, d3
344+ vadd.f32 s2, s2, s4
345+ vbif d0, d1, d4
346+ vst1.32 {d0}, [r0,:64]!
347+2:
348+ pop {r4,pc}
349+endfunc
350+
351+function ff_sbr_hf_apply_noise_1_neon, export=1
352+ ldr r12, [sp]
353+ push {r4,lr}
354+ lsl r12, r12, #31
355+ eor lr, r12, #1<<31
356+ vmov d3, r12, lr
357+.Lhf_apply_noise_1:
358+ ldr r12, [sp, #12]
359+ movrel r4, X(ff_sbr_noise_table)
360+ add r3, r3, #1
361+ bfc r3, #9, #23
362+ sub r12, r12, #1
363+1:
364+ add lr, r4, r3, lsl #3
365+ vld2.32 {q0}, [r0,:64]
366+ vld2.32 {q3}, [lr,:64]
367+ vld1.32 {d2}, [r1,:64]!
368+ vld1.32 {d18}, [r2,:64]!
369+ vceq.f32 d16, d2, #0
370+ veor d2, d2, d3
371+ vmov q2, q0
372+ vmla.f32 d0, d6, d18
373+ vmla.f32 d1, d7, d18
374+ vadd.f32 d5, d5, d2
375+ add r3, r3, #2
376+ bfc r3, #9, #23
377+ vbif d0, d4, d16
378+ vbif d1, d5, d16
379+ vst2.32 {q0}, [r0,:64]!
380+ subs r12, r12, #2
381+ bgt 1b
382+ blt 2f
383+ add lr, r4, r3, lsl #3
384+ vld1.32 {d0}, [r0,:64]
385+ vld1.32 {d6}, [lr,:64]
386+ vld1.32 {d2[]}, [r1,:32]!
387+ vld1.32 {d18[]}, [r2,:32]!
388+ vceq.f32 d4, d2, #0
389+ veor d2, d2, d3
390+ vmov d1, d0
391+ vmla.f32 d0, d6, d18
392+ vadd.f32 s3, s3, s5
393+ vbif d0, d1, d4
394+ vst1.32 {d0}, [r0,:64]!
395+2:
396+ pop {r4,pc}
397+endfunc
398+
399+function ff_sbr_hf_apply_noise_2_neon, export=1
400+ vmov.i32 d3, #1<<31
401+ b .Lhf_apply_noise_0
402+endfunc
403+
404+function ff_sbr_hf_apply_noise_3_neon, export=1
405+ ldr r12, [sp]
406+ push {r4,lr}
407+ lsl r12, r12, #31
408+ eor lr, r12, #1<<31
409+ vmov d3, lr, r12
410+ b .Lhf_apply_noise_1
411+endfunc
libavcodec/atrac.c+0−1
@@ -117,4 +117,3 @@ void atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float · 116 unmodified lines
117117 /* Update the delay buffer. */
118118 memcpy(delayBuf, temp + nIn*2, 46*sizeof(float));
119119 }
120−
libavcodec/aura.c+0−1
@@ -134,4 +134,3 @@ AVCodec ff_aura2_decoder = { · 133 unmodified lines
134134 .capabilities = CODEC_CAP_DR1,
135135 .long_name = NULL_IF_CONFIG_SMALL("Auravision Aura 2"),
136136 };
137−
libavcodec/avcodec.h+3−0
@@ -3566,6 +3566,9 @@ AVCodecContext *avcodec_alloc_context2(enum AVMediaType); · 3565 unmodified lines
35663566 * @param codec if non-NULL, allocate private data and initialize defaults
35673567 * for the given codec. It is illegal to then call avcodec_open2()
35683568 * with a different codec.
3569+ * If NULL, then the codec-specific defaults won't be initialized,
3570+ * which may result in suboptimal default settings (this is
3571+ * important mainly for encoders, e.g. libx264).
35693572 *
35703573 * @return An AVCodecContext filled with default values or NULL on failure.
35713574 * @see avcodec_get_context_defaults
libavcodec/bitstream.c+0−1
@@ -322,4 +322,3 @@ void free_vlc(VLC *vlc) · 321 unmodified lines
322322 {
323323 av_freep(&vlc->table);
324324 }
325−
libavcodec/cscd.c+0−1
@@ -266,4 +266,3 @@ AVCodec ff_cscd_decoder = { · 265 unmodified lines
266266 .capabilities = CODEC_CAP_DR1,
267267 .long_name = NULL_IF_CONFIG_SMALL("CamStudio"),
268268 };
269−
libavcodec/dvdata.c+0−1
@@ -294,4 +294,3 @@ const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec) · 293 unmodified lines
294294
295295 return NULL;
296296 }
297−
libavcodec/dxa.c+0−1
@@ -331,4 +331,3 @@ AVCodec ff_dxa_decoder = { · 330 unmodified lines
331331 .capabilities = CODEC_CAP_DR1,
332332 .long_name = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"),
333333 };
334−
libavcodec/dxva2.c+0−1
@@ -151,4 +151,3 @@ end: · 150 unmodified lines
151151 ff_draw_horiz_band(s, 0, s->avctx->height);
152152 return result;
153153 }
154−
libavcodec/dxva2_h264.c+0−1
@@ -448,4 +448,3 @@ AVHWAccel ff_h264_dxva2_hwaccel = { · 447 unmodified lines
448448 .end_frame = end_frame,
449449 .priv_data_size = sizeof(struct dxva2_picture_context),
450450 };
451−
libavcodec/dxva2_mpeg2.c+0−1
@@ -270,4 +270,3 @@ AVHWAccel ff_mpeg2_dxva2_hwaccel = { · 269 unmodified lines
270270 .end_frame = end_frame,
271271 .priv_data_size = sizeof(struct dxva2_picture_context),
272272 };
273−
libavcodec/dxva2_vc1.c+0−1
@@ -286,4 +286,3 @@ AVHWAccel ff_vc1_dxva2_hwaccel = { · 285 unmodified lines
286286 .end_frame = end_frame,
287287 .priv_data_size = sizeof(struct dxva2_picture_context),
288288 };
289−
libavcodec/escape124.c+0−1
@@ -376,4 +376,3 @@ AVCodec ff_escape124_decoder = { · 375 unmodified lines
376376 .capabilities = CODEC_CAP_DR1,
377377 .long_name = NULL_IF_CONFIG_SMALL("Escape 124"),
378378 };
379−
libavcodec/fft.c+0−1
@@ -350,4 +350,3 @@ static void ff_fft_calc_c(FFTContext *s, FFTComplex *z) · 349 unmodified lines
350350 {
351351 fft_dispatch[s->nbits-2](z);
352352 }
353−
libavcodec/flashsvenc.c+0−1
@@ -286,4 +286,3 @@ AVCodec ff_flashsv_encoder = { · 285 unmodified lines
286286 .pix_fmts = (const enum PixelFormat[]){PIX_FMT_BGR24, PIX_FMT_NONE},
287287 .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video"),
288288 };
289−
libavcodec/h261.c+0−1
@@ -51,4 +51,3 @@ void ff_h261_loop_filter(MpegEncContext *s){ · 50 unmodified lines
5151 s->dsp.h261_loop_filter(dest_cb, uvlinesize);
5252 s->dsp.h261_loop_filter(dest_cr, uvlinesize);
5353 }
54−
libavcodec/h261enc.c+0−1
@@ -332,4 +332,3 @@ AVCodec ff_h261_encoder = { · 331 unmodified lines
332332 .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
333333 .long_name= NULL_IF_CONFIG_SMALL("H.261"),
334334 };
335−
libavcodec/h264_cavlc.c+0−1
@@ -1169,4 +1169,3 @@ decode_intra_mb: · 1168 unmodified lines
11691169
11701170 return 0;
11711171 }
1172−
libavcodec/h264_mp4toannexb_bsf.c+0−1
@@ -188,4 +188,3 @@ AVBitStreamFilter ff_h264_mp4toannexb_bsf = { · 187 unmodified lines
188188 sizeof(H264BSFContext),
189189 h264_mp4toannexb_filter,
190190 };
191−
libavcodec/idcinvideo.c+0−1
@@ -265,4 +265,3 @@ AVCodec ff_idcin_decoder = { · 264 unmodified lines
265265 .capabilities = CODEC_CAP_DR1,
266266 .long_name = NULL_IF_CONFIG_SMALL("id Quake II CIN video"),
267267 };
268−
libavcodec/imgconvert.c+0−1
@@ -904,4 +904,3 @@ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, · 903 unmodified lines
904904 emms_c();
905905 return 0;
906906 }
907−
libavcodec/intelh263dec.c+0−1
@@ -136,4 +136,3 @@ AVCodec ff_h263i_decoder = { · 135 unmodified lines
136136 .long_name = NULL_IF_CONFIG_SMALL("Intel H.263"),
137137 .pix_fmts= ff_pixfmt_list_420,
138138 };
139−
libavcodec/kbdwin.c+0−1
@@ -45,4 +45,3 @@ av_cold void ff_kbd_window_init(float *window, float alpha, int n) · 44 unmodified lines
4545 for (i = 0; i < n; i++)
4646 window[i] = sqrt(local_window[i] / sum);
4747 }
48−
libavcodec/libvo-aacenc.c+0−1
@@ -126,4 +126,3 @@ AVCodec ff_libvo_aacenc_encoder = { · 125 unmodified lines
126126 .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
127127 .long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AAC"),
128128 };
129−
libavcodec/libvo-amrwbenc.c+0−1
@@ -130,4 +130,3 @@ AVCodec ff_libvo_amrwbenc_encoder = { · 129 unmodified lines
130130 "(AMR) Wide-Band"),
131131 .priv_class = &class,
132132 };
133−
libavcodec/libxavs.c+0−1
@@ -384,4 +384,3 @@ AVCodec ff_libxavs_encoder = { · 383 unmodified lines
384384 .priv_class = &class,
385385 .defaults = xavs_defaults,
386386 };
387−
libavcodec/libxvid_rc.c+0−1
@@ -146,4 +146,3 @@ void ff_xvid_rate_control_uninit(MpegEncContext *s){ · 145 unmodified lines
146146
147147 xvid_plugin_2pass2(s->rc_context.non_lavc_opaque, XVID_PLG_DESTROY, &xvid_plg_destroy, NULL);
148148 }
149−
libavcodec/mace.c+0−1
@@ -310,4 +310,3 @@ AVCodec ff_mace6_decoder = { · 309 unmodified lines
310310 .capabilities = CODEC_CAP_DR1,
311311 .long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 6:1"),
312312 };
313−
libavcodec/mathops.h+0−1
@@ -179,4 +179,3 @@ if ((y) < (x)) {\ · 178 unmodified lines
179179 #endif
180180
181181 #endif /* AVCODEC_MATHOPS_H */
182−
libavcodec/mdec.c+0−1
@@ -278,4 +278,3 @@ AVCodec ff_mdec_decoder = { · 277 unmodified lines
278278 .long_name= NULL_IF_CONFIG_SMALL("Sony PlayStation MDEC (Motion DECoder)"),
279279 .init_thread_copy= ONLY_IF_THREADS_ENABLED(decode_init_thread_copy)
280280 };
281−
libavcodec/mlp_parser.h+0−1
@@ -59,4 +59,3 @@ uint64_t ff_truehd_layout(int chanmap); · 58 unmodified lines
5959 extern const uint64_t ff_mlp_layout[32];
6060
6161 #endif /* AVCODEC_MLP_PARSER_H */
62−
libavcodec/mpeg12.c+0−1
@@ -2668,4 +2668,3 @@ AVCodec ff_mpeg1_vdpau_decoder = { · 2667 unmodified lines
26682668 .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video (VDPAU acceleration)"),
26692669 };
26702670 #endif
2671−
libavcodec/mpeg4video.c+0−1
@@ -168,4 +168,3 @@ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my){ · 167 unmodified lines
168168 return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_L0L1; //Note see prev line
169169 }
170170 }
171−
libavcodec/msrledec.c+0−1
@@ -260,4 +260,3 @@ int ff_msrle_decode(AVCodecContext *avctx, AVPicture *pic, int depth, · 259 unmodified lines
260260 return -1;
261261 }
262262 }
263−
libavcodec/msrledec.h+0−1
@@ -37,4 +37,3 @@ int ff_msrle_decode(AVCodecContext *avctx, AVPicture *pic, int depth, · 36 unmodified lines
3737 const uint8_t* data, int data_size);
3838
3939 #endif /* AVCODEC_MSRLEDEC_H */
40−
libavcodec/nellymoser.c+0−1
@@ -223,4 +223,3 @@ void ff_nelly_get_sample_bits(const float *buf, int *bits) · 222 unmodified lines
223223 bits[i] = 0;
224224 }
225225 }
226−
libavcodec/nellymoserdec.c+0−1
@@ -232,4 +232,3 @@ AVCodec ff_nellymoser_decoder = { · 231 unmodified lines
232232 AV_SAMPLE_FMT_S16,
233233 AV_SAMPLE_FMT_NONE },
234234 };
235−
libavcodec/nuv.c+0−1
@@ -297,4 +297,3 @@ AVCodec ff_nuv_decoder = { · 296 unmodified lines
297297 .capabilities = CODEC_CAP_DR1,
298298 .long_name = NULL_IF_CONFIG_SMALL("NuppelVideo/RTJPEG"),
299299 };
300−
libavcodec/pcm_tablegen.c+0−1
@@ -37,4 +37,3 @@ int main(void) · 36 unmodified lines
3737
3838 return 0;
3939 }
40−
libavcodec/psymodel.c+0−1
@@ -134,4 +134,3 @@ av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx) · 133 unmodified lines
134134 av_freep(&ctx->fstate);
135135 av_free(ctx);
136136 }
137−
libavcodec/qtrle.c+0−1
@@ -565,4 +565,3 @@ AVCodec ff_qtrle_decoder = { · 564 unmodified lines
565565 .capabilities = CODEC_CAP_DR1,
566566 .long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"),
567567 };
568−
libavcodec/ratecontrol.h+0−1
@@ -102,4 +102,3 @@ void ff_xvid_rate_control_uninit(struct MpegEncContext *s); · 101 unmodified lines
102102 float ff_xvid_rate_estimate_qscale(struct MpegEncContext *s, int dry_run);
103103
104104 #endif /* AVCODEC_RATECONTROL_H */
105−
libavcodec/rl2.c+0−1
@@ -230,4 +230,3 @@ AVCodec ff_rl2_decoder = { · 229 unmodified lines
230230 .capabilities = CODEC_CAP_DR1,
231231 .long_name = NULL_IF_CONFIG_SMALL("RL2 video"),
232232 };
233−
libavcodec/sbr.h+8−6
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <stdint.h>
3333 #include "fft.h"
3434 #include "aacps.h"
35+#include "sbrdsp.h"
3536
3637 /**
3738 * Spectral Band Replication header - spectrum parameters that invoke a reset if they differ from the previous header.
@@ -87,8 +88,8 @@ typedef struct { · 49 unmodified lines
8788 ///QMF values of the original signal
8889 float W[2][32][32][2];
8990 ///QMF output of the HF adjustor
90− float Y[2][38][64][2];
91− float g_temp[42][48];
91+ DECLARE_ALIGNED(16, float, Y)[2][38][64][2];
92+ DECLARE_ALIGNED(16, float, g_temp)[42][48];
9293 float q_temp[42][48];
9394 uint8_t s_indexmapped[8][48];
9495 ///Envelope scalefactors
@@ -155,15 +156,15 @@ typedef struct { · 60 unmodified lines
155156 uint8_t patch_num_subbands[6];
156157 uint8_t patch_start_subband[6];
157158 ///QMF low frequency input to the HF generator
158− float X_low[32][40][2];
159+ DECLARE_ALIGNED(16, float, X_low)[32][40][2];
159160 ///QMF output of the HF generator
160− float X_high[64][40][2];
161+ DECLARE_ALIGNED(16, float, X_high)[64][40][2];
161162 ///QMF values of the reconstructed signal
162163 DECLARE_ALIGNED(16, float, X)[2][2][38][64];
163164 ///Zeroth coefficient used to filter the subband signals
164− float alpha0[64][2];
165+ DECLARE_ALIGNED(16, float, alpha0)[64][2];
165166 ///First coefficient used to filter the subband signals
166− float alpha1[64][2];
167+ DECLARE_ALIGNED(16, float, alpha1)[64][2];
167168 ///Dequantized envelope scalefactors, remapped
168169 float e_origmapped[7][48];
169170 ///Dequantized noise scalefactors, remapped
@@ -180,6 +181,7 @@ typedef struct { · 10 unmodified lines
180181 DECLARE_ALIGNED(16, float, qmf_filter_scratch)[5][64];
181182 FFTContext mdct_ana;
182183 FFTContext mdct;
184+ SBRDSPContext dsp;
183185 } SpectralBandReplication;
184186
185187 #endif /* AVCODEC_SBR_H */
libavcodec/sbrdsp.c+241−0
@@ -0,0 +1,241 @@
1+/*
2+ * AAC Spectral Band Replication decoding functions
3+ * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
4+ * Copyright (c) 2009-2010 Alex Converse <alex.converse@gmail.com>
5+ *
6+ * This file is part of Libav.
7+ *
8+ * Libav is free software; you can redistribute it and/or
9+ * modify it under the terms of the GNU Lesser General Public
10+ * License as published by the Free Software Foundation; either
11+ * version 2.1 of the License, or (at your option) any later version.
12+ *
13+ * Libav is distributed in the hope that it will be useful,
14+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+ * Lesser General Public License for more details.
17+ *
18+ * You should have received a copy of the GNU Lesser General Public
19+ * License along with Libav; if not, write to the Free Software
20+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+ */
22+
23+#include "config.h"
24+#include "libavutil/attributes.h"
25+#include "sbrdsp.h"
26+
27+static void sbr_sum64x5_c(float *z)
28+{
29+ int k;
30+ for (k = 0; k < 64; k++) {
31+ float f = z[k] + z[k + 64] + z[k + 128] + z[k + 192] + z[k + 256];
32+ z[k] = f;
33+ }
34+}
35+
36+static float sbr_sum_square_c(float (*x)[2], int n)
37+{
38+ float sum = 0.0f;
39+ int i;
40+
41+ for (i = 0; i < n; i++)
42+ sum += x[i][0] * x[i][0] + x[i][1] * x[i][1];
43+
44+ return sum;
45+}
46+
47+static void sbr_neg_odd_64_c(float *x)
48+{
49+ int i;
50+ for (i = 1; i < 64; i += 2)
51+ x[i] = -x[i];
52+}
53+
54+static void sbr_qmf_pre_shuffle_c(float *z)
55+{
56+ int k;
57+ z[64] = z[0];
58+ z[65] = z[1];
59+ for (k = 1; k < 32; k++) {
60+ z[64+2*k ] = -z[64 - k];
61+ z[64+2*k+1] = z[ k + 1];
62+ }
63+}
64+
65+static void sbr_qmf_post_shuffle_c(float W[32][2], const float *z)
66+{
67+ int k;
68+ for (k = 0; k < 32; k++) {
69+ W[k][0] = -z[63-k];
70+ W[k][1] = z[k];
71+ }
72+}
73+
74+static void sbr_qmf_deint_neg_c(float *v, const float *src)
75+{
76+ int i;
77+ for (i = 0; i < 32; i++) {
78+ v[ i] = src[63 - 2*i ];
79+ v[63 - i] = -src[63 - 2*i - 1];
80+ }
81+}
82+
83+static void sbr_qmf_deint_bfly_c(float *v, const float *src0, const float *src1)
84+{
85+ int i;
86+ for (i = 0; i < 64; i++) {
87+ v[ i] = src0[i] - src1[63 - i];
88+ v[127 - i] = src0[i] + src1[63 - i];
89+ }
90+}
91+
92+static av_always_inline void autocorrelate(const float x[40][2],
93+ float phi[3][2][2], int lag)
94+{
95+ int i;
96+ float real_sum = 0.0f;
97+ float imag_sum = 0.0f;
98+ if (lag) {
99+ for (i = 1; i < 38; i++) {
100+ real_sum += x[i][0] * x[i+lag][0] + x[i][1] * x[i+lag][1];
101+ imag_sum += x[i][0] * x[i+lag][1] - x[i][1] * x[i+lag][0];
102+ }
103+ phi[2-lag][1][0] = real_sum + x[ 0][0] * x[lag][0] + x[ 0][1] * x[lag][1];
104+ phi[2-lag][1][1] = imag_sum + x[ 0][0] * x[lag][1] - x[ 0][1] * x[lag][0];
105+ if (lag == 1) {
106+ phi[0][0][0] = real_sum + x[38][0] * x[39][0] + x[38][1] * x[39][1];
107+ phi[0][0][1] = imag_sum + x[38][0] * x[39][1] - x[38][1] * x[39][0];
108+ }
109+ } else {
110+ for (i = 1; i < 38; i++) {
111+ real_sum += x[i][0] * x[i][0] + x[i][1] * x[i][1];
112+ }
113+ phi[2][1][0] = real_sum + x[ 0][0] * x[ 0][0] + x[ 0][1] * x[ 0][1];
114+ phi[1][0][0] = real_sum + x[38][0] * x[38][0] + x[38][1] * x[38][1];
115+ }
116+}
117+
118+static void sbr_autocorrelate_c(const float x[40][2], float phi[3][2][2])
119+{
120+ autocorrelate(x, phi, 0);
121+ autocorrelate(x, phi, 1);
122+ autocorrelate(x, phi, 2);
123+}
124+
125+static void sbr_hf_gen_c(float (*X_high)[2], const float (*X_low)[2],
126+ const float alpha0[2], const float alpha1[2],
127+ float bw, int start, int end)
128+{
129+ float alpha[4];
130+ int i;
131+
132+ alpha[0] = alpha1[0] * bw * bw;
133+ alpha[1] = alpha1[1] * bw * bw;
134+ alpha[2] = alpha0[0] * bw;
135+ alpha[3] = alpha0[1] * bw;
136+
137+ for (i = start; i < end; i++) {
138+ X_high[i][0] =
139+ X_low[i - 2][0] * alpha[0] -
140+ X_low[i - 2][1] * alpha[1] +
141+ X_low[i - 1][0] * alpha[2] -
142+ X_low[i - 1][1] * alpha[3] +
143+ X_low[i][0];
144+ X_high[i][1] =
145+ X_low[i - 2][1] * alpha[0] +
146+ X_low[i - 2][0] * alpha[1] +
147+ X_low[i - 1][1] * alpha[2] +
148+ X_low[i - 1][0] * alpha[3] +
149+ X_low[i][1];
150+ }
151+}
152+
153+static void sbr_hf_g_filt_c(float (*Y)[2], const float (*X_high)[40][2],
154+ const float *g_filt, int m_max, int ixh)
155+{
156+ int m;
157+
158+ for (m = 0; m < m_max; m++) {
159+ Y[m][0] = X_high[m][ixh][0] * g_filt[m];
160+ Y[m][1] = X_high[m][ixh][1] * g_filt[m];
161+ }
162+}
163+
164+static av_always_inline void sbr_hf_apply_noise(float (*Y)[2],
165+ const float *s_m,
166+ const float *q_filt,
167+ int noise,
168+ float phi_sign0,
169+ float phi_sign1,
170+ int m_max)
171+{
172+ int m;
173+
174+ for (m = 0; m < m_max; m++) {
175+ float y0 = Y[m][0];
176+ float y1 = Y[m][1];
177+ noise = (noise + 1) & 0x1ff;
178+ if (s_m[m]) {
179+ y0 += s_m[m] * phi_sign0;
180+ y1 += s_m[m] * phi_sign1;
181+ } else {
182+ y0 += q_filt[m] * ff_sbr_noise_table[noise][0];
183+ y1 += q_filt[m] * ff_sbr_noise_table[noise][1];
184+ }
185+ Y[m][0] = y0;
186+ Y[m][1] = y1;
187+ phi_sign1 = -phi_sign1;
188+ }
189+}
190+
191+static void sbr_hf_apply_noise_0(float (*Y)[2], const float *s_m,
192+ const float *q_filt, int noise,
193+ int kx, int m_max)
194+{
195+ sbr_hf_apply_noise(Y, s_m, q_filt, noise, 1.0, 0.0, m_max);
196+}
197+
198+static void sbr_hf_apply_noise_1(float (*Y)[2], const float *s_m,
199+ const float *q_filt, int noise,
200+ int kx, int m_max)
201+{
202+ float phi_sign = 1 - 2 * (kx & 1);
203+ sbr_hf_apply_noise(Y, s_m, q_filt, noise, 0.0, phi_sign, m_max);
204+}
205+
206+static void sbr_hf_apply_noise_2(float (*Y)[2], const float *s_m,
207+ const float *q_filt, int noise,
208+ int kx, int m_max)
209+{
210+ sbr_hf_apply_noise(Y, s_m, q_filt, noise, -1.0, 0.0, m_max);
211+}
212+
213+static void sbr_hf_apply_noise_3(float (*Y)[2], const float *s_m,
214+ const float *q_filt, int noise,
215+ int kx, int m_max)
216+{
217+ float phi_sign = 1 - 2 * (kx & 1);
218+ sbr_hf_apply_noise(Y, s_m, q_filt, noise, 0.0, -phi_sign, m_max);
219+}
220+
221+av_cold void ff_sbrdsp_init(SBRDSPContext *s)
222+{
223+ s->sum64x5 = sbr_sum64x5_c;
224+ s->sum_square = sbr_sum_square_c;
225+ s->neg_odd_64 = sbr_neg_odd_64_c;
226+ s->qmf_pre_shuffle = sbr_qmf_pre_shuffle_c;
227+ s->qmf_post_shuffle = sbr_qmf_post_shuffle_c;
228+ s->qmf_deint_neg = sbr_qmf_deint_neg_c;
229+ s->qmf_deint_bfly = sbr_qmf_deint_bfly_c;
230+ s->autocorrelate = sbr_autocorrelate_c;
231+ s->hf_gen = sbr_hf_gen_c;
232+ s->hf_g_filt = sbr_hf_g_filt_c;
233+
234+ s->hf_apply_noise[0] = sbr_hf_apply_noise_0;
235+ s->hf_apply_noise[1] = sbr_hf_apply_noise_1;
236+ s->hf_apply_noise[2] = sbr_hf_apply_noise_2;
237+ s->hf_apply_noise[3] = sbr_hf_apply_noise_3;
238+
239+ if (ARCH_ARM)
240+ ff_sbrdsp_init_arm(s);
241+}
libavcodec/sbrdsp.h+48−0
@@ -0,0 +1,48 @@
1+/*
2+ * Copyright (c) 2012 Mans Rullgard
3+ *
4+ * This file is part of Libav.
5+ *
6+ * Libav is free software; you can redistribute it and/or
7+ * modify it under the terms of the GNU Lesser General Public
8+ * License as published by the Free Software Foundation; either
9+ * version 2.1 of the License, or (at your option) any later version.
10+ *
11+ * Libav is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+ * Lesser General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU Lesser General Public
17+ * License along with Libav; if not, write to the Free Software
18+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+ */
20+
21+#ifndef LIBAVCODEC_SBRDSP_H
22+#define LIBAVCODEC_SBRDSP_H
23+
24+typedef struct SBRDSPContext {
25+ void (*sum64x5)(float *z);
26+ float (*sum_square)(float (*x)[2], int n);
27+ void (*neg_odd_64)(float *x);
28+ void (*qmf_pre_shuffle)(float *z);
29+ void (*qmf_post_shuffle)(float W[32][2], const float *z);
30+ void (*qmf_deint_neg)(float *v, const float *src);
31+ void (*qmf_deint_bfly)(float *v, const float *src0, const float *src1);
32+ void (*autocorrelate)(const float x[40][2], float phi[3][2][2]);
33+ void (*hf_gen)(float (*X_high)[2], const float (*X_low)[2],
34+ const float alpha0[2], const float alpha1[2],
35+ float bw, int start, int end);
36+ void (*hf_g_filt)(float (*Y)[2], const float (*X_high)[40][2],
37+ const float *g_filt, int m_max, int ixh);
38+ void (*hf_apply_noise[4])(float (*Y)[2], const float *s_m,
39+ const float *q_filt, int noise,
40+ int kx, int m_max);
41+} SBRDSPContext;
42+
43+extern const float ff_sbr_noise_table[][2];
44+
45+void ff_sbrdsp_init(SBRDSPContext *s);
46+void ff_sbrdsp_init_arm(SBRDSPContext *s);
47+
48+#endif
libavcodec/sgidec.c+0−1
@@ -269,4 +269,3 @@ AVCodec ff_sgi_decoder = { · 268 unmodified lines
269269 .decode = decode_frame,
270270 .long_name = NULL_IF_CONFIG_SMALL("SGI image"),
271271 };
272−
libavcodec/smacker.c+0−1
@@ -762,4 +762,3 @@ AVCodec ff_smackaud_decoder = { · 761 unmodified lines
762762 .capabilities = CODEC_CAP_DR1,
763763 .long_name = NULL_IF_CONFIG_SMALL("Smacker audio"),
764764 };
765−
libavcodec/snow.c+0−1
@@ -650,4 +650,3 @@ av_cold void ff_snow_common_end(SnowContext *s) · 649 unmodified lines
650650 if (s->current_picture.data[0])
651651 s->avctx->release_buffer(s->avctx, &s->current_picture);
652652 }
653−
libavcodec/tscc.c+0−1
@@ -210,4 +210,3 @@ AVCodec ff_tscc_decoder = { · 209 unmodified lines
210210 .capabilities = CODEC_CAP_DR1,
211211 .long_name = NULL_IF_CONFIG_SMALL("TechSmith Screen Capture Codec"),
212212 };
213−
libavcodec/ulti.c+0−1
@@ -429,4 +429,3 @@ AVCodec ff_ulti_decoder = { · 428 unmodified lines
429429 .capabilities = CODEC_CAP_DR1,
430430 .long_name = NULL_IF_CONFIG_SMALL("IBM UltiMotion"),
431431 };
432−
libavcodec/utils.c+2−2
@@ -242,7 +242,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, · 241 unmodified lines
242242 *height+=2; // some of the optimized chroma MC reads one line too much
243243 // which is also done in mpeg decoders with lowres > 0
244244
245− for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
245+ for (i = 0; i < 4; i++)
246246 linesize_align[i] = STRIDE_ALIGN;
247247 //STRIDE_ALIGN is 8 for SSE* but this does not work for SVQ1 chroma planes
248248 //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, · 3 unmodified lines
252252 if(s->codec_id == CODEC_ID_SVQ1 || s->codec_id == CODEC_ID_VP5 ||
253253 s->codec_id == CODEC_ID_VP6 || s->codec_id == CODEC_ID_VP6F ||
254254 s->codec_id == CODEC_ID_VP6A || s->codec_id == CODEC_ID_DIRAC) {
255− for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
255+ for (i = 0; i < 4; i++)
256256 linesize_align[i] = 16;
257257 }
258258 #endif
libavcodec/utvideo.c+0−1
@@ -578,4 +578,3 @@ AVCodec ff_utvideo_decoder = { · 577 unmodified lines
578578 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
579579 .long_name = NULL_IF_CONFIG_SMALL("Ut Video"),
580580 };
581−
libavcodec/vb.c+0−1
@@ -281,4 +281,3 @@ AVCodec ff_vb_decoder = { · 280 unmodified lines
281281 .decode = decode_frame,
282282 .long_name = NULL_IF_CONFIG_SMALL("Beam Software VB"),
283283 };
284−
libavcodec/vmnc.c+0−1
@@ -520,4 +520,3 @@ AVCodec ff_vmnc_decoder = { · 519 unmodified lines
520520 .capabilities = CODEC_CAP_DR1,
521521 .long_name = NULL_IF_CONFIG_SMALL("VMware Screen Codec / VMware Video"),
522522 };
523−
libavcodec/vorbisdec.c+0−1
@@ -1725,4 +1725,3 @@ AVCodec ff_vorbis_decoder = { · 1724 unmodified lines
17251725 AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
17261726 },
17271727 };
1728−
libavcodec/wma.c+0−1
@@ -525,4 +525,3 @@ int ff_wma_run_level_decode(AVCodecContext* avctx, GetBitContext* gb, · 524 unmodified lines
525525
526526 return 0;
527527 }
528−
libavcodec/xxan.c+0−1
@@ -432,4 +432,3 @@ AVCodec ff_xan_wc4_decoder = { · 431 unmodified lines
432432 .capabilities = CODEC_CAP_DR1,
433433 .long_name = NULL_IF_CONFIG_SMALL("Wing Commander IV / Xxan"),
434434 };
435−
libavcodec/zmbv.c+0−1
@@ -677,4 +677,3 @@ AVCodec ff_zmbv_decoder = { · 676 unmodified lines
677677 .capabilities = CODEC_CAP_DR1,
678678 .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
679679 };
680−
libavdevice/avdevice.h+0−1
@@ -78,4 +78,3 @@ const char *avdevice_license(void); · 77 unmodified lines
7878 void avdevice_register_all(void);
7979
8080 #endif /* AVDEVICE_AVDEVICE_H */
81−
libavfilter/defaults.c+0−1
@@ -271,4 +271,3 @@ AVFilterBufferRef *avfilter_null_get_audio_buffer(AVFilterLink *link, int perms, · 270 unmodified lines
271271 {
272272 return avfilter_get_audio_buffer(link->dst->outputs[0], perms, nb_samples);
273273 }
274−
libavfilter/formats.c+1−0
@@ -357,3 +357,4 @@ int main(void) · 356 unmodified lines
357357 }
358358
359359 #endif
360+
libavfilter/vf_aspect.c+0−1
@@ -143,4 +143,3 @@ AVFilter avfilter_vf_setsar = { · 142 unmodified lines
143143 { .name = NULL}},
144144 };
145145 #endif /* CONFIG_SETSAR_FILTER */
146−
libavfilter/vf_format.c+0−1
@@ -142,4 +142,3 @@ AVFilter avfilter_vf_noformat = { · 141 unmodified lines
142142 { .name = NULL}},
143143 };
144144 #endif /* CONFIG_NOFORMAT_FILTER */
145−
libavformat/aea.c+0−1
@@ -103,4 +103,3 @@ AVInputFormat ff_aea_demuxer = { · 102 unmodified lines
103103 .flags= AVFMT_GENERIC_INDEX,
104104 .extensions = "aea",
105105 };
106−
libavformat/avio.c+0−1
@@ -383,4 +383,3 @@ int ff_check_interrupt(AVIOInterruptCB *cb) · 382 unmodified lines
383383 return ret;
384384 return 0;
385385 }
386−
libavformat/httpauth.c+0−1
@@ -265,4 +265,3 @@ char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth, · 264 unmodified lines
265265 }
266266 return authstr;
267267 }
268−
libavformat/id3v1.h+0−1
@@ -39,4 +39,3 @@ extern const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1]; · 38 unmodified lines
3939 void ff_id3v1_read(AVFormatContext *s);
4040
4141 #endif /* AVFORMAT_ID3V1_H */
42−
libavformat/iss.c+0−1
@@ -135,4 +135,3 @@ AVInputFormat ff_iss_demuxer = { · 134 unmodified lines
135135 .read_header = iss_read_header,
136136 .read_packet = iss_read_packet,
137137 };
138−
libavformat/lxfdec.c+0−1
@@ -346,4 +346,3 @@ AVInputFormat ff_lxf_demuxer = { · 345 unmodified lines
346346 .read_packet = lxf_read_packet,
347347 .codec_tag = (const AVCodecTag* const []){lxf_tags, 0},
348348 };
349−
libavformat/metadata.c+0−1
@@ -68,4 +68,3 @@ void ff_metadata_conv_ctx(AVFormatContext *ctx, const AVMetadataConv *d_conv, · 67 unmodified lines
6868 for (i=0; i<ctx->nb_programs; i++)
6969 ff_metadata_conv(&ctx->programs[i]->metadata, d_conv, s_conv);
7070 }
71−
libavformat/movenchint.c+0−1
@@ -459,4 +459,3 @@ void ff_mov_close_hinting(MOVTrack *track) { · 458 unmodified lines
459459 }
460460 avformat_free_context(rtp_ctx);
461461 }
462−
libavformat/network.c+0−1
@@ -183,4 +183,3 @@ int ff_is_multicast_address(struct sockaddr *addr) · 182 unmodified lines
183183
184184 return 0;
185185 }
186−
libavformat/omadec.c+0−1
@@ -445,4 +445,3 @@ AVInputFormat ff_oma_demuxer = { · 444 unmodified lines
445445 .extensions = "oma,omg,aa3",
446446 .codec_tag = (const AVCodecTag* const []){ff_oma_codec_tags, 0},
447447 };
448−
libavformat/rl2.c+0−1
@@ -297,4 +297,3 @@ AVInputFormat ff_rl2_demuxer = { · 296 unmodified lines
297297 .read_packet = rl2_read_packet,
298298 .read_seek = rl2_read_seek,
299299 };
300−
libavformat/rtpdec_amr.c+0−1
@@ -205,4 +205,3 @@ RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = { · 204 unmodified lines
205205 .free = amr_free_context,
206206 .parse_packet = amr_handle_packet,
207207 };
208−
libavformat/rtpdec_h263.c+0−1
@@ -105,4 +105,3 @@ RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler = { · 104 unmodified lines
105105 .codec_id = CODEC_ID_H263,
106106 .parse_packet = h263_handle_packet,
107107 };
108−
libavformat/rtpenc_amr.c+0−1
@@ -63,4 +63,3 @@ void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size) · 62 unmodified lines
6363 memcpy(s->buf_ptr, buff, size);
6464 s->buf_ptr += size;
6565 }
66−
libavformat/rtpenc_chain.c+0−1
@@ -84,4 +84,3 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, · 83 unmodified lines
8484
8585 return rtpctx;
8686 }
87−
libavformat/rtpenc_mpv.c+0−2
@@ -115,5 +115,3 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size) · 114 unmodified lines
115115 end_of_slice = 0;
116116 }
117117 }
118−
119−
libavformat/rtsp.c+0−1
@@ -1992,4 +1992,3 @@ AVInputFormat ff_rtp_demuxer = { · 1991 unmodified lines
19921992 .priv_class = &rtp_demuxer_class
19931993 };
19941994 #endif /* CONFIG_RTP_DEMUXER */
1995−
libavformat/rtspenc.c+0−1
@@ -245,4 +245,3 @@ AVOutputFormat ff_rtsp_muxer = { · 244 unmodified lines
245245 .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
246246 .priv_class = &rtsp_muxer_class,
247247 };
248−
libavformat/sapdec.c+0−1
@@ -236,4 +236,3 @@ AVInputFormat ff_sap_demuxer = { · 235 unmodified lines
236236 .read_close = sap_read_close,
237237 .flags = AVFMT_NOFILE,
238238 };
239−
libavformat/sapenc.c+0−1
@@ -261,4 +261,3 @@ AVOutputFormat ff_sap_muxer = { · 260 unmodified lines
261261 .write_trailer = sap_write_close,
262262 .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
263263 };
264−
libavformat/sdp.c+0−1
@@ -642,4 +642,3 @@ void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *des · 641 unmodified lines
642642 {
643643 }
644644 #endif
645−
libavformat/seek.c+0−1
@@ -516,4 +516,3 @@ void ff_free_parser_state(AVFormatContext *s, AVParserState *state) · 515 unmodified lines
516516 av_free(state->stream_states);
517517 av_free(state);
518518 }
519−
libavutil/crc.h+0−1
@@ -41,4 +41,3 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id); · 40 unmodified lines
4141 uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length) av_pure;
4242
4343 #endif /* AVUTIL_CRC_H */
44−
libavutil/intfloat_readwrite.c+0−1
@@ -95,4 +95,3 @@ AVExtFloat av_dbl2ext(double d){ · 94 unmodified lines
9595 ext.exponent[0] |= 0x80;
9696 return ext;
9797 }
98−
libavutil/md5.h+0−1
@@ -43,4 +43,3 @@ void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); · 42 unmodified lines
4343 */
4444
4545 #endif /* AVUTIL_MD5_H */
46−
libavutil/mem.c+1−0
@@ -228,3 +228,4 @@ void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem) · 227 unmodified lines
228228 tab[nb++] = (intptr_t)elem;
229229 *nb_ptr = nb;
230230 }
231+
libswscale/rgb2rgb.c+0−1
@@ -331,4 +331,3 @@ DEFINE_SHUFFLE_BYTES(0, 3, 2, 1) · 330 unmodified lines
331331 DEFINE_SHUFFLE_BYTES(1, 2, 3, 0)
332332 DEFINE_SHUFFLE_BYTES(3, 0, 1, 2)
333333 DEFINE_SHUFFLE_BYTES(3, 2, 1, 0)
334−
libswscale/utils.c+0−1
@@ -1575,4 +1575,3 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context, · 1574 unmodified lines
15751575 }
15761576 return context;
15771577 }
1578−

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t