swscale_loongarch.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * Copyright (C) 2022 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 SWSCALE_LOONGARCH_SWSCALE_LOONGARCH_H
  22. #define SWSCALE_LOONGARCH_SWSCALE_LOONGARCH_H
  23. #include "libswscale/swscale.h"
  24. #include "libswscale/swscale_internal.h"
  25. #include "config.h"
  26. void ff_hscale_8_to_15_lsx(SwsContext *c, int16_t *dst, int dstW,
  27. const uint8_t *src, const int16_t *filter,
  28. const int32_t *filterPos, int filterSize);
  29. void ff_hscale_8_to_19_lsx(SwsContext *c, int16_t *_dst, int dstW,
  30. const uint8_t *src, const int16_t *filter,
  31. const int32_t *filterPos, int filterSize);
  32. void ff_hscale_16_to_15_lsx(SwsContext *c, int16_t *_dst, int dstW,
  33. const uint8_t *_src, const int16_t *filter,
  34. const int32_t *filterPos, int filterSize);
  35. void ff_hscale_16_to_15_sub_lsx(SwsContext *c, int16_t *_dst, int dstW,
  36. const uint8_t *_src, const int16_t *filter,
  37. const int32_t *filterPos, int filterSize, int sh);
  38. void ff_hscale_16_to_19_lsx(SwsContext *c, int16_t *_dst, int dstW,
  39. const uint8_t *_src, const int16_t *filter,
  40. const int32_t *filterPos, int filterSize);
  41. void ff_hscale_16_to_19_sub_lsx(SwsContext *c, int16_t *_dst, int dstW,
  42. const uint8_t *_src, const int16_t *filter,
  43. const int32_t *filterPos, int filterSize, int sh);
  44. void planar_rgb_to_uv_lsx(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4],
  45. int width, int32_t *rgb2yuv, void *opq);
  46. void planar_rgb_to_y_lsx(uint8_t *_dst, const uint8_t *src[4], int width,
  47. int32_t *rgb2yuv, void *opq);
  48. void ff_yuv2planeX_8_lsx(const int16_t *filter, int filterSize,
  49. const int16_t **src, uint8_t *dest, int dstW,
  50. const uint8_t *dither, int offset);
  51. av_cold void ff_sws_init_output_lsx(SwsContext *c);
  52. int yuv420_rgb24_lsx(SwsContext *c, const uint8_t *src[], int srcStride[],
  53. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  54. int yuv420_bgr24_lsx(SwsContext *c, const uint8_t *src[], int srcStride[],
  55. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  56. int yuv420_rgba32_lsx(SwsContext *c, const uint8_t *src[], int srcStride[],
  57. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  58. int yuv420_bgra32_lsx(SwsContext *c, const uint8_t *src[], int srcStride[],
  59. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  60. int yuv420_argb32_lsx(SwsContext *c, const uint8_t *src[], int srcStride[],
  61. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  62. int yuv420_abgr32_lsx(SwsContext *c, const uint8_t *src[], int srcStride[],
  63. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  64. #if HAVE_LASX
  65. void ff_hscale_8_to_15_lasx(SwsContext *c, int16_t *dst, int dstW,
  66. const uint8_t *src, const int16_t *filter,
  67. const int32_t *filterPos, int filterSize);
  68. void ff_hscale_8_to_19_lasx(SwsContext *c, int16_t *_dst, int dstW,
  69. const uint8_t *src, const int16_t *filter,
  70. const int32_t *filterPos, int filterSize);
  71. void ff_hscale_16_to_19_lasx(SwsContext *c, int16_t *_dst, int dstW,
  72. const uint8_t *_src, const int16_t *filter,
  73. const int32_t *filterPos, int filterSize);
  74. void ff_hscale_16_to_15_lasx(SwsContext *c, int16_t *dst, int dstW,
  75. const uint8_t *_src, const int16_t *filter,
  76. const int32_t *filterPos, int filterSize);
  77. void planar_rgb_to_uv_lasx(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4],
  78. int width, int32_t *rgb2yuv, void *opq);
  79. void planar_rgb_to_y_lasx(uint8_t *_dst, const uint8_t *src[4], int width,
  80. int32_t *rgb2yuv, void *opq);
  81. int yuv420_rgb24_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
  82. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  83. int yuv420_bgr24_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
  84. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  85. int yuv420_rgba32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
  86. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  87. int yuv420_bgra32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
  88. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  89. int yuv420_argb32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
  90. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  91. int yuv420_abgr32_lasx(SwsContext *c, const uint8_t *src[], int srcStride[],
  92. int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]);
  93. void ff_interleave_bytes_lasx(const uint8_t *src1, const uint8_t *src2,
  94. uint8_t *dest, int width, int height,
  95. int src1Stride, int src2Stride, int dstStride);
  96. void ff_yuv2planeX_8_lasx(const int16_t *filter, int filterSize,
  97. const int16_t **src, uint8_t *dest, int dstW,
  98. const uint8_t *dither, int offset);
  99. av_cold void ff_sws_init_output_lasx(SwsContext *c);
  100. #endif // #if HAVE_LASX
  101. #endif /* SWSCALE_LOONGARCH_SWSCALE_LOONGARCH_H */