delta.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /**
  2. * \file lzma/delta.h
  3. * \brief Delta filter
  4. * \note Never include this file directly. Use <lzma.h> instead.
  5. */
  6. /*
  7. * Author: Lasse Collin
  8. *
  9. * This file has been put into the public domain.
  10. * You can do whatever you want with this file.
  11. */
  12. #ifndef LZMA_H_INTERNAL
  13. # error Never include this file directly. Use <lzma.h> instead.
  14. #endif
  15. /**
  16. * \brief Filter ID
  17. *
  18. * Filter ID of the Delta filter. This is used as lzma_filter.id.
  19. */
  20. #define LZMA_FILTER_DELTA LZMA_VLI_C(0x03)
  21. /**
  22. * \brief Type of the delta calculation
  23. *
  24. * Currently only byte-wise delta is supported. Other possible types could
  25. * be, for example, delta of 16/32/64-bit little/big endian integers, but
  26. * these are not currently planned since byte-wise delta is almost as good.
  27. */
  28. typedef enum {
  29. LZMA_DELTA_TYPE_BYTE
  30. } lzma_delta_type;
  31. /**
  32. * \brief Options for the Delta filter
  33. *
  34. * These options are needed by both encoder and decoder.
  35. */
  36. typedef struct {
  37. /** For now, this must always be LZMA_DELTA_TYPE_BYTE. */
  38. lzma_delta_type type;
  39. /**
  40. * \brief Delta distance
  41. *
  42. * With the only currently supported type, LZMA_DELTA_TYPE_BYTE,
  43. * the distance is as bytes.
  44. *
  45. * Examples:
  46. * - 16-bit stereo audio: distance = 4 bytes
  47. * - 24-bit RGB image data: distance = 3 bytes
  48. */
  49. uint32_t dist;
  50. /**
  51. * \brief Minimum value for lzma_options_delta.dist.
  52. */
  53. # define LZMA_DELTA_DIST_MIN 1
  54. /**
  55. * \brief Maximum value for lzma_options_delta.dist.
  56. */
  57. # define LZMA_DELTA_DIST_MAX 256
  58. /*
  59. * Reserved space to allow possible future extensions without
  60. * breaking the ABI. You should not touch these, because the names
  61. * of these variables may change. These are and will never be used
  62. * when type is LZMA_DELTA_TYPE_BYTE, so it is safe to leave these
  63. * uninitialized.
  64. */
  65. /** \private Reserved member. */
  66. uint32_t reserved_int1;
  67. /** \private Reserved member. */
  68. uint32_t reserved_int2;
  69. /** \private Reserved member. */
  70. uint32_t reserved_int3;
  71. /** \private Reserved member. */
  72. uint32_t reserved_int4;
  73. /** \private Reserved member. */
  74. void *reserved_ptr1;
  75. /** \private Reserved member. */
  76. void *reserved_ptr2;
  77. } lzma_options_delta;