vc1dsp_loongarch.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Copyright (c) 2021 Loongson Technology Corporation Limited
  3. * Contributed by Hao Chen <chenhao@loongson.cn>
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg 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. * FFmpeg 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 FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #ifndef AVCODEC_LOONGARCH_VC1DSP_LOONGARCH_H
  22. #define AVCODEC_LOONGARCH_VC1DSP_LOONGARCH_H
  23. #include "libavcodec/vc1dsp.h"
  24. #include "libavutil/avassert.h"
  25. void ff_vc1_inv_trans_8x8_lasx(int16_t block[64]);
  26. void ff_vc1_inv_trans_8x8_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  27. void ff_vc1_inv_trans_8x4_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  28. void ff_vc1_inv_trans_8x4_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  29. void ff_vc1_inv_trans_4x8_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  30. void ff_vc1_inv_trans_4x8_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  31. void ff_vc1_inv_trans_4x4_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  32. void ff_vc1_inv_trans_4x4_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
  33. #define FF_PUT_VC1_MSPEL_MC_LASX(hmode, vmode) \
  34. void ff_put_vc1_mspel_mc ## hmode ## vmode ## _lasx(uint8_t *dst, \
  35. const uint8_t *src, \
  36. ptrdiff_t stride, int rnd); \
  37. void ff_put_vc1_mspel_mc ## hmode ## vmode ## _16_lasx(uint8_t *dst, \
  38. const uint8_t *src, \
  39. ptrdiff_t stride, int rnd);
  40. FF_PUT_VC1_MSPEL_MC_LASX(1, 1);
  41. FF_PUT_VC1_MSPEL_MC_LASX(1, 2);
  42. FF_PUT_VC1_MSPEL_MC_LASX(1, 3);
  43. FF_PUT_VC1_MSPEL_MC_LASX(2, 1);
  44. FF_PUT_VC1_MSPEL_MC_LASX(2, 2);
  45. FF_PUT_VC1_MSPEL_MC_LASX(2, 3);
  46. FF_PUT_VC1_MSPEL_MC_LASX(3, 1);
  47. FF_PUT_VC1_MSPEL_MC_LASX(3, 2);
  48. FF_PUT_VC1_MSPEL_MC_LASX(3, 3);
  49. #define FF_PUT_VC1_MSPEL_MC_V_LASX(vmode) \
  50. void ff_put_vc1_mspel_mc0 ## vmode ## _16_lasx(uint8_t *dst, \
  51. const uint8_t *src, \
  52. ptrdiff_t stride, int rnd);
  53. FF_PUT_VC1_MSPEL_MC_V_LASX(1);
  54. FF_PUT_VC1_MSPEL_MC_V_LASX(2);
  55. FF_PUT_VC1_MSPEL_MC_V_LASX(3);
  56. #define FF_PUT_VC1_MSPEL_MC_H_LASX(hmode) \
  57. void ff_put_vc1_mspel_mc ## hmode ## 0_16_lasx(uint8_t *dst, \
  58. const uint8_t *src, \
  59. ptrdiff_t stride, int rnd);
  60. FF_PUT_VC1_MSPEL_MC_H_LASX(1);
  61. FF_PUT_VC1_MSPEL_MC_H_LASX(2);
  62. FF_PUT_VC1_MSPEL_MC_H_LASX(3);
  63. void ff_put_no_rnd_vc1_chroma_mc8_lasx(uint8_t *dst /* align 8 */,
  64. const uint8_t *src /* align 1 */,
  65. ptrdiff_t stride, int h, int x, int y);
  66. #endif /* AVCODEC_LOONGARCH_VC1DSP_LOONGARCH_H */