packing.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /******************************************************************
  2. iLBC Speech Coder ANSI-C Source Code
  3. packing.h
  4. Copyright (C) The Internet Society (2004).
  5. All Rights Reserved.
  6. ******************************************************************/
  7. #ifndef __PACKING_H
  8. #define __PACKING_H
  9. void packsplit(
  10. int *index, /* (i) the value to split */
  11. int *firstpart, /* (o) the value specified by most
  12. significant bits */
  13. int *rest, /* (o) the value specified by least
  14. significant bits */
  15. int bitno_firstpart, /* (i) number of bits in most
  16. significant part */
  17. int bitno_total /* (i) number of bits in full range
  18. of value */
  19. );
  20. void packcombine(
  21. int *index, /* (i/o) the msb value in the
  22. combined value out */
  23. int rest, /* (i) the lsb value */
  24. int bitno_rest /* (i) the number of bits in the
  25. lsb part */
  26. );
  27. void dopack(
  28. unsigned char **bitstream, /* (i/o) on entrance pointer to
  29. place in bitstream to pack
  30. new data, on exit pointer
  31. to place in bitstream to
  32. pack future data */
  33. int index, /* (i) the value to pack */
  34. int bitno, /* (i) the number of bits that the
  35. value will fit within */
  36. int *pos /* (i/o) write position in the
  37. current byte */
  38. );
  39. void unpack(
  40. unsigned char **bitstream, /* (i/o) on entrance pointer to
  41. place in bitstream to
  42. unpack new data from, on
  43. exit pointer to place in
  44. bitstream to unpack future
  45. data from */
  46. int *index, /* (o) resulting value */
  47. int bitno, /* (i) number of bits used to
  48. represent the value */
  49. int *pos /* (i/o) read position in the
  50. current byte */
  51. );
  52. #endif