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.

71 lines
2.5KB

  1. /*
  2. * ARMv4L optimized DSP utils
  3. * Copyright (c) 2001 Lionel Ulmer.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #include "../dsputil.h"
  20. extern void j_rev_dct_ARM(DCTELEM *data);
  21. extern void simple_idct_ARM(DCTELEM *data);
  22. /* XXX: local hack */
  23. static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
  24. static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
  25. /* XXX: those functions should be suppressed ASAP when all IDCTs are
  26. converted */
  27. static void j_rev_dct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block)
  28. {
  29. j_rev_dct_ARM (block);
  30. ff_put_pixels_clamped(block, dest, line_size);
  31. }
  32. static void j_rev_dct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block)
  33. {
  34. j_rev_dct_ARM (block);
  35. ff_add_pixels_clamped(block, dest, line_size);
  36. }
  37. static void simple_idct_ARM_put(uint8_t *dest, int line_size, DCTELEM *block)
  38. {
  39. simple_idct_ARM (block);
  40. ff_put_pixels_clamped(block, dest, line_size);
  41. }
  42. static void simple_idct_ARM_add(uint8_t *dest, int line_size, DCTELEM *block)
  43. {
  44. simple_idct_ARM (block);
  45. ff_add_pixels_clamped(block, dest, line_size);
  46. }
  47. void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx)
  48. {
  49. const int idct_algo= avctx->idct_algo;
  50. ff_put_pixels_clamped = c->put_pixels_clamped;
  51. ff_add_pixels_clamped = c->add_pixels_clamped;
  52. if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_ARM){
  53. c->idct_put= j_rev_dct_ARM_put;
  54. c->idct_add= j_rev_dct_ARM_add;
  55. c->idct = j_rev_dct_ARM;
  56. c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;/* FF_NO_IDCT_PERM */
  57. } else if (idct_algo==FF_IDCT_SIMPLEARM){
  58. c->idct_put= simple_idct_ARM_put;
  59. c->idct_add= simple_idct_ARM_add;
  60. c->idct = simple_idct_ARM;
  61. c->idct_permutation_type= FF_NO_IDCT_PERM;
  62. }
  63. }