lh6_decoder.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. Copyright (c) 2011, 2012, Simon Howard
  3. Permission to use, copy, modify, and/or distribute this software
  4. for any purpose with or without fee is hereby granted, provided
  5. that the above copyright notice and this permission notice appear
  6. in all copies.
  7. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  8. WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  9. WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  10. AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
  11. CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  12. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  13. NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. //
  17. // Decoder for the -lh6- algorithm.
  18. //
  19. // -lh6- is an "extended" version of -lh5- introduced in LHA v2.66.
  20. //
  21. // 64 KiB history ring buffer:
  22. #define HISTORY_BITS 16 /* 2^16 = 65536 */
  23. // Number of bits to encode HISTORY_BITS:
  24. #define OFFSET_BITS 5
  25. // Name of the variable for the encoder:
  26. #define DECODER_NAME lha_lh6_decoder
  27. // The actual algorithm code is contained in lh_new_decoder.c, which
  28. // acts as a template for -lh4-, -lh5-, -lh6- and -lh7-.
  29. #include "lh_new_decoder.c"