delta.h 1.8 KB

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