Hi, On Fri, Apr 8, 2011 at 5:02 AM, Benjamin Larsson <ba...@ludd.ltu.se> wrote: > On 04/08/2011 03:58 AM, Ronald S. Bultje wrote: >> 2011/4/7 Benjamin Larsson <ba...@ludd.ltu.se>: >>> +static void qmf_decompose(DCAContext *c, int32_t in[32], int32_t out[32], >>> int channel) >>> +{ >>> + int band, i, j, k; >>> + int32_t resp; >>> + int32_t accum[DCA_SUBBANDS_32]; >>> + >>> + add_new_samples(c, in, DCA_SUBBANDS_32, channel); >>> + >>> + /* Calculate the dot product of the signal with the (possibly inverted) >>> + reference decoder's response to this vector: >>> + (0.0, 0.0, ..., 0.0, -1.0, 1.0, 0.0, ..., 0.0) >>> + so that -1.0 cancels 1.0 from the previous step */ >>> + >>> + memset(accum,0,sizeof(accum)); >>> + >>> + for (k = 48, j = 0, i = c->start[channel]; i < 512; k++, j++, i++) >>> + accum[(k & 32) ? (31 - (k & 31)) : (k & 31)] += >>> mul32(c->history[channel][i], UnQMF[j]); >>> + for (i = 0; i < c->start[channel]; k++, j++, i++) >>> + accum[(k & 32) ? (31 - (k & 31)) : (k & 31)] += >>> mul32(c->history[channel][i], UnQMF[j]); >>> + >>> + resp = 0; >>> + /* TODO: implement FFT instead of this naive calculation */ >>> + for (band = 0; band < DCA_SUBBANDS_32; band++) { >>> + for (j = 0; j < 32; j++) >>> + resp += mul32(accum[j], band_delta_factor(band, j)); >>> + >>> + out[band] = (band & 2) ? (-resp) : resp; >>> + } >>> +} >> >> I'll probably sound very naive, but what does this piece of the code do? > > Decomposes the signal into bands. Time domain -> frequency domain.
Ah, that's what the fixme is for I guess. Sounds ok to me then. (Didn't Mans just implement fixed-point FFT or something like that? Or was that "just" MDCT?) Ronald _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel