summaryrefslogtreecommitdiff
path: root/libavcodec/aacps.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-01-27 01:24:55 +0000
committerMans Rullgard <mans@mansr.com>2012-05-05 22:04:21 +0100
commit47d18d5354e06d4ef7349449fd049b516d6b0ee2 (patch)
tree4013541c0e433ac0a7c74cf3e09134ec9c491677 /libavcodec/aacps.c
parentbf1945af301aff54c33352e75f17aec6cb5269d7 (diff)
aacps: align some arrays
This is required for SIMD optimisations. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/aacps.c')
-rw-r--r--libavcodec/aacps.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/libavcodec/aacps.c b/libavcodec/aacps.c
index 7578034f82..fa7e9ac7a3 100644
--- a/libavcodec/aacps.c
+++ b/libavcodec/aacps.c
@@ -27,6 +27,7 @@
#include "aacps.h"
#include "aacps_tablegen.h"
#include "aacpsdata.c"
+#include "dsputil.h"
#define PS_BASELINE 0 ///< Operate in Baseline PS mode
///< Baseline implies 10 or 20 stereo bands,
@@ -284,7 +285,7 @@ err:
/** Split one subband into 2 subsubbands with a symmetric real filter.
* The filter must have its non-center even coefficients equal to zero. */
-static void hybrid2_re(float (*in)[2], float (*out)[32][2], const float filter[7], int len, int reverse)
+static void hybrid2_re(float (*in)[2], float (*out)[32][2], const float filter[8], int len, int reverse)
{
int i, j;
for (i = 0; i < len; i++, in++) {
@@ -304,11 +305,11 @@ static void hybrid2_re(float (*in)[2], float (*out)[32][2], const float filter[7
}
/** Split one subband into 6 subsubbands with a complex filter */
-static void hybrid6_cx(PSDSPContext *dsp, float (*in)[2], float (*out)[32][2], const float (*filter)[7][2], int len)
+static void hybrid6_cx(PSDSPContext *dsp, float (*in)[2], float (*out)[32][2], const float (*filter)[8][2], int len)
{
int i;
int N = 8;
- float temp[8][2];
+ LOCAL_ALIGNED_16(float, temp, [8], [2]);
for (i = 0; i < len; i++, in++) {
dsp->hybrid_analysis(temp, in, filter, 1, N);
@@ -327,7 +328,7 @@ static void hybrid6_cx(PSDSPContext *dsp, float (*in)[2], float (*out)[32][2], c
}
}
-static void hybrid4_8_12_cx(PSDSPContext *dsp, float (*in)[2], float (*out)[32][2], const float (*filter)[7][2], int N, int len)
+static void hybrid4_8_12_cx(PSDSPContext *dsp, float (*in)[2], float (*out)[32][2], const float (*filter)[8][2], int N, int len)
{
int i;
@@ -607,8 +608,8 @@ static void map_val_20_to_34(float par[PS_MAX_NR_IIDICC])
static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[32][2], int is34)
{
- float power[34][PS_QMF_TIME_SLOTS] = {{0}};
- float transient_gain[34][PS_QMF_TIME_SLOTS];
+ LOCAL_ALIGNED_16(float, power, [34], [PS_QMF_TIME_SLOTS]);
+ LOCAL_ALIGNED_16(float, transient_gain, [34], [PS_QMF_TIME_SLOTS]);
float *peak_decay_nrg = ps->peak_decay_nrg;
float *power_smooth = ps->power_smooth;
float *peak_decay_diff_smooth = ps->peak_decay_diff_smooth;
@@ -621,6 +622,8 @@ static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[3
int i, k, m, n;
int n0 = 0, nL = 32;
+ memset(power, 0, 34 * sizeof(*power));
+
if (is34 != ps->is34bands_old) {
memset(ps->peak_decay_nrg, 0, sizeof(ps->peak_decay_nrg));
memset(ps->power_smooth, 0, sizeof(ps->power_smooth));
@@ -883,8 +886,8 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float R[2][38][64], int top)
{
- float Lbuf[91][32][2];
- float Rbuf[91][32][2];
+ LOCAL_ALIGNED_16(float, Lbuf, [91], [32][2]);
+ LOCAL_ALIGNED_16(float, Rbuf, [91], [32][2]);
const int len = 32;
int is34 = ps->is34bands;