shuffle.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*********************************************************************
  2. Blosc - Blocked Shuffling and Compression Library
  3. Author: Francesc Alted <francesc@blosc.org>
  4. See LICENSES/BLOSC.txt for details about copyright and rights to use.
  5. **********************************************************************/
  6. /* Shuffle/unshuffle routines which dynamically dispatch to hardware-
  7. accelerated routines based on the processor's architecture.
  8. Consumers should almost always prefer to call these routines instead
  9. of directly calling one of the hardware-accelerated routines, since
  10. these are cross-platform and future-proof. */
  11. #ifndef SHUFFLE_H
  12. #define SHUFFLE_H
  13. #include "shuffle-common.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /**
  18. Primary shuffle and bitshuffle routines.
  19. This function dynamically dispatches to the appropriate hardware-accelerated
  20. routine based on the host processor's architecture. If the host processor is
  21. not supported by any of the hardware-accelerated routines, the generic
  22. (non-accelerated) implementation is used instead.
  23. Consumers should almost always prefer to call this routine instead of directly
  24. calling the hardware-accelerated routines because this method is both cross-
  25. platform and future-proof.
  26. */
  27. BLOSC_NO_EXPORT void
  28. shuffle(const size_t bytesoftype, const size_t blocksize,
  29. const uint8_t* _src, const uint8_t* _dest);
  30. BLOSC_NO_EXPORT int
  31. bitshuffle(const size_t bytesoftype, const size_t blocksize,
  32. const uint8_t* const _src, const uint8_t* _dest,
  33. const uint8_t* _tmp);
  34. /**
  35. Primary unshuffle and bitunshuffle routine.
  36. This function dynamically dispatches to the appropriate hardware-accelerated
  37. routine based on the host processor's architecture. If the host processor is
  38. not supported by any of the hardware-accelerated routines, the generic
  39. (non-accelerated) implementation is used instead.
  40. Consumers should almost always prefer to call this routine instead of directly
  41. calling the hardware-accelerated routines because this method is both cross-
  42. platform and future-proof.
  43. */
  44. BLOSC_NO_EXPORT void
  45. unshuffle(const size_t bytesoftype, const size_t blocksize,
  46. const uint8_t* _src, const uint8_t* _dest);
  47. BLOSC_NO_EXPORT int
  48. bitunshuffle(const size_t bytesoftype, const size_t blocksize,
  49. const uint8_t* const _src, const uint8_t* _dest,
  50. const uint8_t* _tmp);
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif /* SHUFFLE_H */