dct.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * (I)DCT Transforms
  3. * Copyright (c) 2009 Peter Ross <pross@xvid.org>
  4. * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
  5. * Copyright (c) 2010 Vitor Sessak
  6. *
  7. * This file is part of Libav.
  8. *
  9. * Libav is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2.1 of the License, or (at your option) any later version.
  13. *
  14. * Libav is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with Libav; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  22. */
  23. #ifndef AVCODEC_DCT_H
  24. #define AVCODEC_DCT_H
  25. #include <stdint.h>
  26. #include "rdft.h"
  27. struct DCTContext {
  28. int nbits;
  29. int inverse;
  30. RDFTContext rdft;
  31. const float *costab;
  32. FFTSample *csc2;
  33. void (*dct_calc)(struct DCTContext *s, FFTSample *data);
  34. void (*dct32)(FFTSample *out, const FFTSample *in);
  35. };
  36. /**
  37. * Set up DCT.
  38. * @param nbits size of the input array:
  39. * (1 << nbits) for DCT-II, DCT-III and DST-I
  40. * (1 << nbits) + 1 for DCT-I
  41. *
  42. * @note the first element of the input of DST-I is ignored
  43. */
  44. int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType type);
  45. void ff_dct_end (DCTContext *s);
  46. void ff_dct_init_x86(DCTContext *s);
  47. void ff_fdct_ifast(int16_t *data);
  48. void ff_fdct_ifast248(int16_t *data);
  49. void ff_jpeg_fdct_islow_8(int16_t *data);
  50. void ff_jpeg_fdct_islow_10(int16_t *data);
  51. void ff_fdct248_islow_8(int16_t *data);
  52. void ff_fdct248_islow_10(int16_t *data);
  53. void ff_j_rev_dct(int16_t *data);
  54. #endif /* AVCODEC_DCT_H */