jsimd.h 5.7 KB

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