codec_common.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /****************************************************************************
  2. *
  3. * Module Title : Codec_common.h
  4. *
  5. * Description : Common codec definitions header file.
  6. *
  7. ****************************************************************************/
  8. #ifndef __INC_COMCODEC_H
  9. #define __INC_COMCODEC_H
  10. /****************************************************************************
  11. * Include Files
  12. ****************************************************************************/
  13. #include <string.h>
  14. #include "type_aliases.h"
  15. /****************************************************************************
  16. * Macros
  17. ****************************************************************************/
  18. // Platform Specific Inlines
  19. #ifdef _MSC_VER
  20. #ifndef INLINE
  21. #define INLINE __inline
  22. #endif
  23. #ifndef FORCEINLINE
  24. #define FORCEINLINE __forceinline
  25. #endif
  26. #else
  27. #ifndef INLINE
  28. #define INLINE inline
  29. #endif
  30. #ifndef FORCEINLINE
  31. #define FORCEINLINE inline
  32. #endif
  33. #endif
  34. // Platform specific math function defines
  35. #define LIMIT(x) ( (x)<0 ? 0: (x)>255 ? 255: (x) )
  36. /****************************************************************************
  37. * Module constants.
  38. ****************************************************************************/
  39. #define BASE_FRAME 0
  40. #define NORMAL_FRAME 1
  41. #define Q_TABLE_SIZE 64
  42. #define BLOCK_HEIGHT_WIDTH 8
  43. #define BLOCK_SIZE (BLOCK_HEIGHT_WIDTH * BLOCK_HEIGHT_WIDTH)
  44. /****************************************************************************
  45. * Types
  46. ****************************************************************************/
  47. /* Type defining YUV data elements. */
  48. typedef UINT8 YUV_BUFFER_ENTRY;
  49. typedef UINT8 *YUV_BUFFER_ENTRY_PTR;
  50. typedef struct CONFIG_TYPE
  51. {
  52. // The size of the surface we want to draw to
  53. UINT32 VideoFrameWidth;
  54. UINT32 VideoFrameHeight;
  55. INT32 YStride;
  56. INT32 UVStride;
  57. // The number of horizontal and vertical blocks encoded
  58. UINT32 HFragPixels;
  59. UINT32 VFragPixels;
  60. // The Intended Horizontal Scale
  61. UINT32 HScale;
  62. UINT32 HRatio;
  63. // The Intended Vertical Scale
  64. UINT32 VScale;
  65. UINT32 VRatio;
  66. // The way in which we intended
  67. UINT32 ScalingMode;
  68. // Interlaced (0) means no (1) means Yes
  69. UINT32 Interlaced;
  70. UINT32 ExpandedFrameWidth;
  71. UINT32 ExpandedFrameHeight;
  72. } CONFIG_TYPE;
  73. typedef struct
  74. {
  75. INT16 x;
  76. INT16 y;
  77. } MOTION_VECTOR;
  78. typedef MOTION_VECTOR COORDINATE;
  79. typedef INT16 Q_LIST_ENTRY;
  80. typedef Q_LIST_ENTRY Q_LIST[64];
  81. #endif