n2d_to.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* n2d_to.c -- implementation of the NRV2D test overlap algorithm
  2. This file is part of the UCL data compression library.
  3. Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
  4. All Rights Reserved.
  5. The UCL library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of
  8. the License, or (at your option) any later version.
  9. The UCL library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with the UCL library; see the file COPYING.
  15. If not, write to the Free Software Foundation, Inc.,
  16. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. Markus F.X.J. Oberhumer
  18. <markus@oberhumer.com>
  19. http://www.oberhumer.com/opensource/ucl/
  20. */
  21. /***********************************************************************
  22. // entries for the different bit-buffer sizes
  23. ************************************************************************/
  24. #include "ucl.h"
  25. #include "ucl_conf.h"
  26. #include "getbit.h"
  27. #define SAFE
  28. #define TEST_OVERLAP
  29. UCL_PUBLIC(int)
  30. ucl_nrv2d_test_overlap_8 ( const ucl_bytep src, ucl_uint src_off,
  31. ucl_uint src_len, ucl_uintp dst_len,
  32. ucl_voidp wrkmem )
  33. {
  34. #define getbit(bb) getbit_8(bb,src,ilen)
  35. #include "n2d_d.c"
  36. #undef getbit
  37. }
  38. UCL_PUBLIC(int)
  39. ucl_nrv2d_test_overlap_le16 ( const ucl_bytep src, ucl_uint src_off,
  40. ucl_uint src_len, ucl_uintp dst_len,
  41. ucl_voidp wrkmem )
  42. {
  43. #define getbit(bb) getbit_le16(bb,src,ilen)
  44. #include "n2d_d.c"
  45. #undef getbit
  46. }
  47. UCL_PUBLIC(int)
  48. ucl_nrv2d_test_overlap_le32 ( const ucl_bytep src, ucl_uint src_off,
  49. ucl_uint src_len, ucl_uintp dst_len,
  50. ucl_voidp wrkmem )
  51. {
  52. unsigned bc = 0;
  53. #define getbit(bb) getbit_le32(bb,bc,src,ilen)
  54. #include "n2d_d.c"
  55. #undef getbit
  56. }
  57. /*
  58. vi:ts=4:et
  59. */