huffman.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
  4. * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
  5. * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  6. * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  7. * *
  8. * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 *
  9. * by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
  10. * *
  11. ********************************************************************
  12. function:
  13. last mod: $Id$
  14. ********************************************************************/
  15. #if !defined(_huffman_H)
  16. # define _huffman_H (1)
  17. # include "theora/codec.h"
  18. # include "ocintrin.h"
  19. /*The range of valid quantized DCT coefficient values.
  20. VP3 used 511 in the encoder, but the bitstream is capable of 580.*/
  21. #define OC_DCT_VAL_RANGE (580)
  22. #define OC_NDCT_TOKEN_BITS (5)
  23. #define OC_DCT_EOB1_TOKEN (0)
  24. #define OC_DCT_EOB2_TOKEN (1)
  25. #define OC_DCT_EOB3_TOKEN (2)
  26. #define OC_DCT_REPEAT_RUN0_TOKEN (3)
  27. #define OC_DCT_REPEAT_RUN1_TOKEN (4)
  28. #define OC_DCT_REPEAT_RUN2_TOKEN (5)
  29. #define OC_DCT_REPEAT_RUN3_TOKEN (6)
  30. #define OC_DCT_SHORT_ZRL_TOKEN (7)
  31. #define OC_DCT_ZRL_TOKEN (8)
  32. #define OC_ONE_TOKEN (9)
  33. #define OC_MINUS_ONE_TOKEN (10)
  34. #define OC_TWO_TOKEN (11)
  35. #define OC_MINUS_TWO_TOKEN (12)
  36. #define OC_DCT_VAL_CAT2 (13)
  37. #define OC_DCT_VAL_CAT3 (17)
  38. #define OC_DCT_VAL_CAT4 (18)
  39. #define OC_DCT_VAL_CAT5 (19)
  40. #define OC_DCT_VAL_CAT6 (20)
  41. #define OC_DCT_VAL_CAT7 (21)
  42. #define OC_DCT_VAL_CAT8 (22)
  43. #define OC_DCT_RUN_CAT1A (23)
  44. #define OC_DCT_RUN_CAT1B (28)
  45. #define OC_DCT_RUN_CAT1C (29)
  46. #define OC_DCT_RUN_CAT2A (30)
  47. #define OC_DCT_RUN_CAT2B (31)
  48. #define OC_NDCT_EOB_TOKEN_MAX (7)
  49. #define OC_NDCT_ZRL_TOKEN_MAX (9)
  50. #define OC_NDCT_VAL_MAX (23)
  51. #define OC_NDCT_VAL_CAT1_MAX (13)
  52. #define OC_NDCT_VAL_CAT2_MAX (17)
  53. #define OC_NDCT_VAL_CAT2_SIZE (OC_NDCT_VAL_CAT2_MAX-OC_DCT_VAL_CAT2)
  54. #define OC_NDCT_RUN_MAX (32)
  55. #define OC_NDCT_RUN_CAT1A_MAX (28)
  56. extern const unsigned char OC_DCT_TOKEN_EXTRA_BITS[TH_NDCT_TOKENS];
  57. #endif