[FFmpeg-devel] [PATCH] RDFT for Bink and QDM2

Alex Converse alex.converse
Tue Jan 20 01:44:38 CET 2009


On Sun, Jan 18, 2009 at 5:48 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sat, Jan 17, 2009 at 08:18:04PM -0500, Alex Converse wrote:
>> On Sat, Jan 17, 2009 at 7:52 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> > On Sat, Jan 17, 2009 at 01:29:13PM -0500, Alex Converse wrote:
>> >> Attached is my RDFT patch with all the feedback applied. Also attached
>> >> is a patch that makes use of it in QDM2 decoding. I thought I had
>> >> unwrapped the math perfectly but it looks like things changed for the
>> >> better.
>> >>
>> >> Also new is a flag for FFT sign convention. This is because the
>> >> inverse transform is not the same as the forward transform with the
>> >> opposite sign convention, scaled.
>> >>
>> >> The reference files are decoded with the binary coder from the qt63 dlls.
>> >>
>> >> $ tests/tiny_psnr ../qdm2/nadasurf_popular_dl.wav old.wav 2 0 44
>> >> stddev: 1305.89 PSNR: 34.00 bytes: 39632896/ 39632896
>> >> $ tests/tiny_psnr ../qdm2/nadasurf_popular_dl.wav new.wav 2 0 44
>> >> stddev: 1145.39 PSNR: 35.14 bytes: 39632896/ 39632896
>> >> $ tests/tiny_psnr ../qdm2/switzler084d_dl.wav old.wav 2 0 44
>> >> stddev:  377.46 PSNR: 44.78 bytes: 20660224/ 20660224
>> >> $ tests/tiny_psnr ../qdm2/switzler084d_dl.wav new.wav 2 0 44
>> >> stddev:  305.00 PSNR: 46.63 bytes: 20660224/ 20660224
>> > [...]
>> >> +/**
>> >> + * Sets up a real FFT.
>> >> + * @param nbits           Log2 of the length of the input array
>> >> + * @param inverse         If TRUE, perform the inverse of the transform
>> >> + * @param sign_convention The sign of j of the forward FFT.
>> >> + */
>> >> +int ff_rdft_init(RDFTContext *s, int nbits, int inverse, int sign_convention)
>> >> +{
>> >> +    int n = 1 << nbits;
>> >> +    int i;
>> >> +    const double theta = sign_convention*(1-2*inverse)*2*M_PI/n;
>> >> +
>> >> +    s->nbits           = nbits;
>> >> +    s->inverse         = inverse;
>> >> +    s->sign_convention = sign_convention;
>> >> +
>> >> +    if (ff_fft_init(&s->fft, nbits-1, (sign_convention==1) ^ inverse) < 0)
>> >> +        goto fail;
>> >> +
>> >
>> >> +    s->tsin = av_malloc((n>>2) * sizeof(FFTSample));
>> >
>> > i do prefer that no tables are duplicated
>> >
>>
>> Where can I pull these from?
>
> I dont know, its very possible there are no such global tables yet,
> if so, just add new global/static tables ...
>
> [...]

Like this?

Also the addition to the Makefile in rdft-qdm.diff seemed unnecessary
(as it was already covered by a dependency in configure) so I removed
it and am resubmitting that patch as well.

--Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rdft.diff
Type: text/x-diff
Size: 8354 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090119/889827da/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rdft-qdm.diff
Type: text/x-diff
Size: 8518 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090119/889827da/attachment-0001.diff>



More information about the ffmpeg-devel mailing list