vp6decodemode.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*------------------------------------------------------------------------------
  2. -- --
  3. -- This software is confidential and proprietary and may be used --
  4. -- only as expressly authorized by a licensing agreement from --
  5. -- --
  6. -- Hantro Products Oy. --
  7. -- --
  8. -- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY --
  9. -- ALL RIGHTS RESERVED --
  10. -- --
  11. -- The entire notice above must be reproduced --
  12. -- on all copies and should not be removed. --
  13. -- --
  14. --------------------------------------------------------------------------------
  15. -
  16. - Description : ...
  17. -
  18. --------------------------------------------------------------------------------
  19. -
  20. - Version control information, please leave untouched.
  21. -
  22. - $RCSfile: vp6decodemode.h,v $
  23. - $Revision: 1.1 $
  24. - $Date: 2008/04/14 10:13:24 $
  25. -
  26. ------------------------------------------------------------------------------*/
  27. #ifndef __VP6DECODEMODE_H__
  28. #define __VP6DECODEMODE_H__
  29. #include "basetype.h"
  30. #include "vp6dec.h"
  31. /****************************************************************************
  32. * Module statics
  33. ****************************************************************************/
  34. #define MODETYPES 3
  35. #define MODEVECTORS 16
  36. #define PROBVECTORXMIT 174
  37. #define PROBIDEALXMIT 254
  38. /****************************************************************************
  39. * Typedefs
  40. ****************************************************************************/
  41. typedef struct _modeContext
  42. {
  43. u8 left;
  44. u8 above;
  45. u8 last;
  46. } MODE_CONTEXT;
  47. typedef struct _htorp
  48. {
  49. unsigned char selector : 1; // 1 bit selector 0->ptr, 1->token
  50. unsigned char value : 7;
  51. } torp;
  52. typedef struct _hnode
  53. {
  54. torp left;
  55. torp right;
  56. } HNODE;
  57. typedef enum _MODETYPE
  58. {
  59. MACROBLOCK,
  60. NONEAREST_MACROBLOCK,
  61. NONEAR_MACROBLOCK,
  62. BLOCK
  63. } MODETYPE;
  64. typedef struct LineEq
  65. {
  66. i32 M;
  67. i32 C;
  68. } LINE_EQ;
  69. /****************************************************************************
  70. * Exports
  71. ****************************************************************************/
  72. extern const u8 VP6HWModeVq[MODETYPES][MODEVECTORS][MAX_MODES*2];
  73. extern const u8 VP6HWBaselineXmittedProbs[4][2][MAX_MODES];
  74. extern const u8 VP6HWDcUpdateProbs[2][MAX_ENTROPY_TOKENS-1];
  75. extern const u8 VP6HWAcUpdateProbs[PREC_CASES][2][VP6HWAC_BANDS][MAX_ENTROPY_TOKENS-1];
  76. extern const u8 VP6HWPrevTokenIndex[MAX_ENTROPY_TOKENS];
  77. extern const u8 VP6HW_ZrlUpdateProbs[ZRL_BANDS][ZERO_RUN_PROB_CASES];
  78. extern const u8 VP6HW_ZeroRunProbDefaults[ZRL_BANDS][ZERO_RUN_PROB_CASES];
  79. extern const LINE_EQ VP6HWDcNodeEqs[CONTEXT_NODES][DC_TOKEN_CONTEXTS];
  80. typedef enum
  81. {
  82. CODE_INTER_NO_MV = 0x0, // INTER prediction, (0,0) motion vector implied.
  83. CODE_INTRA = 0x1, // INTRA i.e. no prediction.
  84. CODE_INTER_PLUS_MV = 0x2, // INTER prediction, non zero motion vector.
  85. CODE_INTER_NEAREST_MV = 0x3, // Use Last Motion vector
  86. CODE_INTER_NEAR_MV = 0x4, // Prior last motion vector
  87. CODE_USING_GOLDEN = 0x5, // 'Golden frame' prediction (no MV).
  88. CODE_GOLDEN_MV = 0x6, // 'Golden frame' prediction plus MV.
  89. CODE_INTER_FOURMV = 0x7, // Inter prediction 4MV per macro block.
  90. CODE_GOLD_NEAREST_MV = 0x8, // Use Last Motion vector
  91. CODE_GOLD_NEAR_MV = 0x9, // Prior last motion vector
  92. DO_NOT_CODE = 0x10 // Fake Mode
  93. } CODING_MODE;
  94. /****************************************************************************
  95. * Function Prototypes
  96. ****************************************************************************/
  97. void VP6HWDecodeModeProbs(PB_INSTANCE *pbi);
  98. void VP6HWBuildModeTree ( PB_INSTANCE *pbi );
  99. #endif /* __VP6DECODEMODE_H__ */