You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.0KB

  1. /*
  2. * (I)RDFT transforms
  3. * Copyright (c) 2009 Alex Converse <alex dot converse at gmail dot com>
  4. *
  5. * This file is part of Libav.
  6. *
  7. * Libav is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * Libav is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with Libav; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #ifndef AVCODEC_RDFT_H
  22. #define AVCODEC_RDFT_H
  23. #include "config.h"
  24. #include "fft.h"
  25. #if CONFIG_HARDCODED_TABLES
  26. # define SINTABLE_CONST const
  27. #else
  28. # define SINTABLE_CONST
  29. #endif
  30. #define SINTABLE(size) \
  31. SINTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_sin_##size)[size/2]
  32. extern SINTABLE(16);
  33. extern SINTABLE(32);
  34. extern SINTABLE(64);
  35. extern SINTABLE(128);
  36. extern SINTABLE(256);
  37. extern SINTABLE(512);
  38. extern SINTABLE(1024);
  39. extern SINTABLE(2048);
  40. extern SINTABLE(4096);
  41. extern SINTABLE(8192);
  42. extern SINTABLE(16384);
  43. extern SINTABLE(32768);
  44. extern SINTABLE(65536);
  45. struct RDFTContext {
  46. int nbits;
  47. int inverse;
  48. int sign_convention;
  49. /* pre/post rotation tables */
  50. const FFTSample *tcos;
  51. SINTABLE_CONST FFTSample *tsin;
  52. FFTContext fft;
  53. void (*rdft_calc)(struct RDFTContext *s, FFTSample *z);
  54. };
  55. /**
  56. * Set up a real FFT.
  57. * @param nbits log2 of the length of the input array
  58. * @param trans the type of transform
  59. */
  60. int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans);
  61. void ff_rdft_end(RDFTContext *s);
  62. void ff_rdft_init_arm(RDFTContext *s);
  63. #endif /* AVCODEC_RDFT_H */