decodemode.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /****************************************************************************
  2. *
  3. * Module Title : decodemode.h
  4. *
  5. * Description : functions for decoding modes and motionvectors
  6. *
  7. * AUTHOR : James Bankoski
  8. *
  9. *****************************************************************************
  10. * Revision History
  11. *
  12. * 1.00 JBB 30OCT01 New Configuration baseline.
  13. *
  14. *****************************************************************************
  15. */
  16. /****************************************************************************
  17. * Header Files
  18. *****************************************************************************
  19. */
  20. #ifndef STRICT
  21. #define STRICT /* Strict type checking. */
  22. #endif
  23. /****************************************************************************
  24. * Implicit Imports
  25. *****************************************************************************
  26. */
  27. extern UINT8 Stats[9][4][4][4];
  28. extern UINT8 NNStats[7][4][4][4];
  29. extern UINT8 NN2Stats[7][4][4][4];
  30. extern UINT8 blockStats[3][4][4][4];
  31. #define MODETYPES 3
  32. #define MODEVECTORS 16
  33. #define PROBVECTORXMIT 174
  34. #define PROBIDEALXMIT 254
  35. /****************************************************************************
  36. * Exported data structures.
  37. *****************************************************************************
  38. */
  39. typedef struct _modeContext
  40. {
  41. UINT8 left;
  42. UINT8 above;
  43. UINT8 last;
  44. } MODE_CONTEXT;
  45. typedef struct _htorp
  46. {
  47. unsigned char selector : 1; // 1 bit selector 0->ptr, 1->token
  48. unsigned char value : 7;
  49. } torp;
  50. typedef struct _hnode
  51. {
  52. torp left;
  53. torp right;
  54. } HNODE;
  55. typedef enum _MODETYPE
  56. {
  57. MACROBLOCK,
  58. NONEAREST_MACROBLOCK,
  59. NONEAR_MACROBLOCK,
  60. BLOCK
  61. } MODETYPE;
  62. #ifndef MAPCA
  63. __inline
  64. #endif
  65. int mbClass(int i);
  66. /****************************************************************************
  67. * Imports
  68. *****************************************************************************
  69. */
  70. extern HNODE MBCodingMode[9];
  71. extern HNODE NN2MBCodingMode[8];
  72. extern HNODE NNMBCodingMode[7];
  73. extern HNODE BlockCodingMode[3];
  74. extern UINT8 BaselineXmittedProbs[4][2][MAX_MODES];
  75. /****************************************************************************
  76. * Function Prototypes
  77. *****************************************************************************
  78. */
  79. void DecodeModeProbs(PB_INSTANCE *pbi);
  80. extern void FindNearestandNextNearest(PB_INSTANCE* pbi, UINT32 MBrow, UINT32 MBcol,
  81. MOTION_VECTORA* nearest, MOTION_VECTORA* nextnearest, UINT8 Frame,int *type);
  82. extern void BuildModeTree(PB_INSTANCE *pbi);