Commit 90f674d5 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '87ec849f'

* commit '87ec849f':
  dcadec: remove scaling in lfe_interpolation_fir

Conflicts:
	libavcodec/dcadec.c
	libavcodec/dcadsp.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 810eb285 87ec849f
...@@ -24,15 +24,11 @@ ...@@ -24,15 +24,11 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavcodec/dcadsp.h" #include "libavcodec/dcadsp.h"
void ff_dca_lfe_fir0_neon(float *out, const float *in, const float *coefs, void ff_dca_lfe_fir0_neon(float *out, const float *in, const float *coefs);
float scale); void ff_dca_lfe_fir1_neon(float *out, const float *in, const float *coefs);
void ff_dca_lfe_fir1_neon(float *out, const float *in, const float *coefs,
float scale);
void ff_dca_lfe_fir32_vfp(float *out, const float *in, const float *coefs, void ff_dca_lfe_fir32_vfp(float *out, const float *in, const float *coefs);
float scale); void ff_dca_lfe_fir64_vfp(float *out, const float *in, const float *coefs);
void ff_dca_lfe_fir64_vfp(float *out, const float *in, const float *coefs,
float scale);
void ff_dca_qmf_32_subbands_vfp(float samples_in[32][8], int sb_act, void ff_dca_qmf_32_subbands_vfp(float samples_in[32][8], int sb_act,
SynthFilterContext *synth, FFTContext *imdct, SynthFilterContext *synth, FFTContext *imdct,
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
function ff_dca_lfe_fir0_neon, export=1 function ff_dca_lfe_fir0_neon, export=1
push {r4-r6,lr} push {r4-r6,lr}
NOVFP vmov s0, r3 @ scale
mov r3, #32 @ decifactor mov r3, #32 @ decifactor
mov r6, #256/32 mov r6, #256/32
b dca_lfe_fir b dca_lfe_fir
...@@ -30,7 +29,6 @@ endfunc ...@@ -30,7 +29,6 @@ endfunc
function ff_dca_lfe_fir1_neon, export=1 function ff_dca_lfe_fir1_neon, export=1
push {r4-r6,lr} push {r4-r6,lr}
NOVFP vmov s0, r3 @ scale
mov r3, #64 @ decifactor mov r3, #64 @ decifactor
mov r6, #256/64 mov r6, #256/64
dca_lfe_fir: dca_lfe_fir:
...@@ -57,8 +55,7 @@ dca_lfe_fir: ...@@ -57,8 +55,7 @@ dca_lfe_fir:
subs r3, r3, #1 subs r3, r3, #1
vadd.f32 d4, d4, d5 vadd.f32 d4, d4, d5
vadd.f32 d6, d6, d7 vadd.f32 d6, d6, d7
vpadd.f32 d4, d4, d6 vpadd.f32 d5, d4, d6
vmul.f32 d5, d4, d0[0]
vst1.32 {d5[0]}, [r0,:32]! vst1.32 {d5[0]}, [r0,:32]!
vst1.32 {d5[1]}, [r4,:32]! vst1.32 {d5[1]}, [r4,:32]!
bne 1b bne 1b
......
...@@ -27,8 +27,6 @@ PCOEF .req a3 ...@@ -27,8 +27,6 @@ PCOEF .req a3
OLDFPSCR .req a4 OLDFPSCR .req a4
COUNTER .req ip COUNTER .req ip
SCALE32 .req s28 @ use vector of 4 in place of 9th scalar when decifactor=32 / JMAX=8
SCALE64 .req s0 @ spare register in scalar bank when decifactor=64 / JMAX=4
IN0 .req s4 IN0 .req s4
IN1 .req s5 IN1 .req s5
IN2 .req s6 IN2 .req s6
...@@ -76,9 +74,6 @@ POST3 .req s27 ...@@ -76,9 +74,6 @@ POST3 .req s27
vldr COEF5, [PCOEF, #X + (1*JMAX + 1) * Y] vldr COEF5, [PCOEF, #X + (1*JMAX + 1) * Y]
vldr COEF6, [PCOEF, #X + (2*JMAX + 1) * Y] vldr COEF6, [PCOEF, #X + (2*JMAX + 1) * Y]
.endif .endif
.ifnc "\tail",""
vmul.f POST0, POST0, SCALE\decifactor @ vector operation (SCALE may be scalar)
.endif
.ifnc "\head","" .ifnc "\head",""
vldr COEF7, [PCOEF, #X + (3*JMAX + 1) * Y] vldr COEF7, [PCOEF, #X + (3*JMAX + 1) * Y]
.ifc "\tail","" .ifc "\tail",""
...@@ -129,7 +124,6 @@ POST3 .req s27 ...@@ -129,7 +124,6 @@ POST3 .req s27
.macro dca_lfe_fir decifactor .macro dca_lfe_fir decifactor
function ff_dca_lfe_fir\decifactor\()_vfp, export=1 function ff_dca_lfe_fir\decifactor\()_vfp, export=1
NOVFP vmov s0, r3
fmrx OLDFPSCR, FPSCR fmrx OLDFPSCR, FPSCR
ldr ip, =0x03030000 @ RunFast mode, short vectors of length 4, stride 1 ldr ip, =0x03030000 @ RunFast mode, short vectors of length 4, stride 1
fmxr FPSCR, ip fmxr FPSCR, ip
...@@ -140,7 +134,6 @@ NOVFP vmov s0, r3 ...@@ -140,7 +134,6 @@ NOVFP vmov s0, r3
.if \decifactor == 32 .if \decifactor == 32
.set JMAX, 8 .set JMAX, 8
vpush {s16-s31} vpush {s16-s31}
vmov SCALE32, s0 @ duplicate scalar across vector
vldr IN4, [PIN, #-4*4] vldr IN4, [PIN, #-4*4]
vldr IN5, [PIN, #-5*4] vldr IN5, [PIN, #-5*4]
vldr IN6, [PIN, #-6*4] vldr IN6, [PIN, #-6*4]
...@@ -186,8 +179,6 @@ endfunc ...@@ -186,8 +179,6 @@ endfunc
.unreq OLDFPSCR .unreq OLDFPSCR
.unreq COUNTER .unreq COUNTER
.unreq SCALE32
.unreq SCALE64
.unreq IN0 .unreq IN0
.unreq IN1 .unreq IN1
.unreq IN2 .unreq IN2
......
This diff is collapsed.
...@@ -1108,7 +1108,7 @@ static void qmf_32_subbands(DCAContext *s, int chans, ...@@ -1108,7 +1108,7 @@ static void qmf_32_subbands(DCAContext *s, int chans,
static void lfe_interpolation_fir(DCAContext *s, int decimation_select, static void lfe_interpolation_fir(DCAContext *s, int decimation_select,
int num_deci_sample, float *samples_in, int num_deci_sample, float *samples_in,
float *samples_out, float scale) float *samples_out)
{ {
/* samples_in: An array holding decimated samples. /* samples_in: An array holding decimated samples.
* Samples in current subframe starts from samples_in[0], * Samples in current subframe starts from samples_in[0],
...@@ -1132,7 +1132,7 @@ static void lfe_interpolation_fir(DCAContext *s, int decimation_select, ...@@ -1132,7 +1132,7 @@ static void lfe_interpolation_fir(DCAContext *s, int decimation_select,
} }
/* Interpolation */ /* Interpolation */
for (deciindex = 0; deciindex < num_deci_sample; deciindex++) { for (deciindex = 0; deciindex < num_deci_sample; deciindex++) {
s->dcadsp.lfe_fir[idx](samples_out, samples_in, prCoeff, scale); s->dcadsp.lfe_fir[idx](samples_out, samples_in, prCoeff);
samples_in++; samples_in++;
samples_out += 2 * 32 * (1 + idx); samples_out += 2 * 32 * (1 + idx);
} }
...@@ -1426,8 +1426,7 @@ static int dca_filter_channels(DCAContext *s, int block_index) ...@@ -1426,8 +1426,7 @@ static int dca_filter_channels(DCAContext *s, int block_index)
if (s->lfe) { if (s->lfe) {
lfe_interpolation_fir(s, s->lfe, 2 * s->lfe, lfe_interpolation_fir(s, s->lfe, 2 * s->lfe,
s->lfe_data + 2 * s->lfe * (block_index + 4), s->lfe_data + 2 * s->lfe * (block_index + 4),
s->samples_chanptr[s->lfe_index], s->samples_chanptr[s->lfe_index]);
1.0 / (256.0 * 32768.0));
/* Outputs 20bits pcm samples */ /* Outputs 20bits pcm samples */
} }
......
...@@ -34,7 +34,7 @@ static void int8x8_fmul_int32_c(float *dst, const int8_t *src, int scale) ...@@ -34,7 +34,7 @@ static void int8x8_fmul_int32_c(float *dst, const int8_t *src, int scale)
static inline void static inline void
dca_lfe_fir(float *out, const float *in, const float *coefs, dca_lfe_fir(float *out, const float *in, const float *coefs,
int decifactor, float scale) int decifactor)
{ {
float *out2 = out + 2*decifactor-1; float *out2 = out + 2*decifactor-1;
const float *cf0 = coefs; const float *cf0 = coefs;
...@@ -50,8 +50,8 @@ dca_lfe_fir(float *out, const float *in, const float *coefs, ...@@ -50,8 +50,8 @@ dca_lfe_fir(float *out, const float *in, const float *coefs,
v1 += in[1+j-num_coeffs] * *cf0; v1 += in[1+j-num_coeffs] * *cf0;
} }
*out++ = v0 * scale; *out++ = v0;
*out2-- = v1 * scale; *out2-- = v1;
} }
} }
...@@ -83,16 +83,14 @@ static void dca_qmf_32_subbands(float samples_in[32][8], int sb_act, ...@@ -83,16 +83,14 @@ static void dca_qmf_32_subbands(float samples_in[32][8], int sb_act,
} }
} }
static void dca_lfe_fir0_c(float *out, const float *in, const float *coefs, static void dca_lfe_fir0_c(float *out, const float *in, const float *coefs)
float scale)
{ {
dca_lfe_fir(out, in, coefs, 32, scale); dca_lfe_fir(out, in, coefs, 32);
} }
static void dca_lfe_fir1_c(float *out, const float *in, const float *coefs, static void dca_lfe_fir1_c(float *out, const float *in, const float *coefs)
float scale)
{ {
dca_lfe_fir(out, in, coefs, 64, scale); dca_lfe_fir(out, in, coefs, 64);
} }
av_cold void ff_dcadsp_init(DCADSPContext *s) av_cold void ff_dcadsp_init(DCADSPContext *s)
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
#include "synth_filter.h" #include "synth_filter.h"
typedef struct DCADSPContext { typedef struct DCADSPContext {
void (*lfe_fir[2])(float *out, const float *in, const float *coefs, void (*lfe_fir[2])(float *out, const float *in, const float *coefs);
float scale);
void (*qmf_32_subbands)(float samples_in[32][8], int sb_act, void (*qmf_32_subbands)(float samples_in[32][8], int sb_act,
SynthFilterContext *synth, FFTContext *imdct, SynthFilterContext *synth, FFTContext *imdct,
float synth_buf_ptr[512], float synth_buf_ptr[512],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment