jsimd.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * jsimd.h
  3. *
  4. * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
  5. * Copyright (C) 2011, 2014, D. R. Commander.
  6. * Copyright (C) 2015-2016, 2018, Matthieu Darbois.
  7. * Copyright (C) 2020, Arm Limited.
  8. *
  9. * Based on the x86 SIMD extension for IJG JPEG library,
  10. * Copyright (C) 1999-2006, MIYASAKA Masaru.
  11. * For conditions of distribution and use, see copyright notice in jsimdext.inc
  12. *
  13. */
  14. #include "jchuff.h" /* Declarations shared with jcphuff.c */
  15. EXTERN(int) jsimd_can_rgb_ycc(void);
  16. EXTERN(int) jsimd_can_rgb_gray(void);
  17. EXTERN(int) jsimd_can_ycc_rgb(void);
  18. EXTERN(int) jsimd_can_ycc_rgb565(void);
  19. EXTERN(int) jsimd_c_can_null_convert(void);
  20. EXTERN(void) jsimd_rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
  21. JSAMPIMAGE output_buf,
  22. JDIMENSION output_row, int num_rows);
  23. EXTERN(void) jsimd_rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
  24. JSAMPIMAGE output_buf,
  25. JDIMENSION output_row, int num_rows);
  26. EXTERN(void) jsimd_ycc_rgb_convert(j_decompress_ptr cinfo,
  27. JSAMPIMAGE input_buf, JDIMENSION input_row,
  28. JSAMPARRAY output_buf, int num_rows);
  29. EXTERN(void) jsimd_ycc_rgb565_convert(j_decompress_ptr cinfo,
  30. JSAMPIMAGE input_buf,
  31. JDIMENSION input_row,
  32. JSAMPARRAY output_buf, int num_rows);
  33. EXTERN(void) jsimd_c_null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
  34. JSAMPIMAGE output_buf, JDIMENSION output_row,
  35. int num_rows);
  36. EXTERN(int) jsimd_can_h2v2_downsample(void);
  37. EXTERN(int) jsimd_can_h2v1_downsample(void);
  38. EXTERN(void) jsimd_h2v2_downsample(j_compress_ptr cinfo,
  39. jpeg_component_info *compptr,
  40. JSAMPARRAY input_data,
  41. JSAMPARRAY output_data);
  42. EXTERN(int) jsimd_can_h2v2_smooth_downsample(void);
  43. EXTERN(void) jsimd_h2v2_smooth_downsample(j_compress_ptr cinfo,
  44. jpeg_component_info *compptr,
  45. JSAMPARRAY input_data,
  46. JSAMPARRAY output_data);
  47. EXTERN(void) jsimd_h2v1_downsample(j_compress_ptr cinfo,
  48. jpeg_component_info *compptr,
  49. JSAMPARRAY input_data,
  50. JSAMPARRAY output_data);
  51. EXTERN(int) jsimd_can_h2v2_upsample(void);
  52. EXTERN(int) jsimd_can_h2v1_upsample(void);
  53. EXTERN(int) jsimd_can_int_upsample(void);
  54. EXTERN(void) jsimd_h2v2_upsample(j_decompress_ptr cinfo,
  55. jpeg_component_info *compptr,
  56. JSAMPARRAY input_data,
  57. JSAMPARRAY *output_data_ptr);
  58. EXTERN(void) jsimd_h2v1_upsample(j_decompress_ptr cinfo,
  59. jpeg_component_info *compptr,
  60. JSAMPARRAY input_data,
  61. JSAMPARRAY *output_data_ptr);
  62. EXTERN(void) jsimd_int_upsample(j_decompress_ptr cinfo,
  63. jpeg_component_info *compptr,
  64. JSAMPARRAY input_data,
  65. JSAMPARRAY *output_data_ptr);
  66. EXTERN(int) jsimd_can_h2v2_fancy_upsample(void);
  67. EXTERN(int) jsimd_can_h2v1_fancy_upsample(void);
  68. EXTERN(int) jsimd_can_h1v2_fancy_upsample(void);
  69. EXTERN(void) jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo,
  70. jpeg_component_info *compptr,
  71. JSAMPARRAY input_data,
  72. JSAMPARRAY *output_data_ptr);
  73. EXTERN(void) jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo,
  74. jpeg_component_info *compptr,
  75. JSAMPARRAY input_data,
  76. JSAMPARRAY *output_data_ptr);
  77. EXTERN(void) jsimd_h1v2_fancy_upsample(j_decompress_ptr cinfo,
  78. jpeg_component_info *compptr,
  79. JSAMPARRAY input_data,
  80. JSAMPARRAY *output_data_ptr);
  81. EXTERN(int) jsimd_can_h2v2_merged_upsample(void);
  82. EXTERN(int) jsimd_can_h2v1_merged_upsample(void);
  83. EXTERN(void) jsimd_h2v2_merged_upsample(j_decompress_ptr cinfo,
  84. JSAMPIMAGE input_buf,
  85. JDIMENSION in_row_group_ctr,
  86. JSAMPARRAY output_buf);
  87. EXTERN(void) jsimd_h2v1_merged_upsample(j_decompress_ptr cinfo,
  88. JSAMPIMAGE input_buf,
  89. JDIMENSION in_row_group_ctr,
  90. JSAMPARRAY output_buf);
  91. EXTERN(int) jsimd_can_huff_encode_one_block(void);
  92. EXTERN(JOCTET *) jsimd_huff_encode_one_block(void *state, JOCTET *buffer,
  93. JCOEFPTR block, int last_dc_val,
  94. c_derived_tbl *dctbl,
  95. c_derived_tbl *actbl);
  96. EXTERN(int) jsimd_can_encode_mcu_AC_first_prepare(void);
  97. EXTERN(void) jsimd_encode_mcu_AC_first_prepare
  98. (const JCOEF *block, const int *jpeg_natural_order_start, int Sl, int Al,
  99. JCOEF *values, size_t *zerobits);
  100. EXTERN(int) jsimd_can_encode_mcu_AC_refine_prepare(void);
  101. EXTERN(int) jsimd_encode_mcu_AC_refine_prepare
  102. (const JCOEF *block, const int *jpeg_natural_order_start, int Sl, int Al,
  103. JCOEF *absvalues, size_t *bits);