postp.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /****************************************************************************
  2. *
  3. * Module Title : postp.h
  4. *
  5. * Description : Post processor interface
  6. *
  7. ****************************************************************************/
  8. #ifndef POSTP_H
  9. #define POSTP_H
  10. #include "codec_common.h"
  11. // YUV buffer configuration structure
  12. typedef struct
  13. {
  14. int YWidth;
  15. int YHeight;
  16. int YStride;
  17. int UVWidth;
  18. int UVHeight;
  19. int UVStride;
  20. char * YBuffer;
  21. char * UBuffer;
  22. char * VBuffer;
  23. } YUV_BUFFER_CONFIG;
  24. typedef enum
  25. {
  26. MAINTAIN_ASPECT_RATIO = 0x0,
  27. SCALE_TO_FIT = 0x1,
  28. CENTER = 0x2,
  29. OTHER = 0x3
  30. } SCALE_MODE;
  31. // macro defined so that I can get the information from fraginfo ( I suspect this is going to change !)
  32. // and I wanted to be ready for the change!
  33. #define blockCoded(i) (ppi->FragInfo[(i)*ppi->FragInfoElementSize]&ppi->FragInfoCodedMask)
  34. typedef struct
  35. {
  36. // per frame information passed in
  37. INT32 Vp3VersionNo; // version of frame
  38. INT32 FrameType; // key or non key
  39. INT32 PostProcessingLevel; // level of post processing to perform
  40. INT32 FrameQIndex; // q index value used on passed in frame
  41. UINT8 *LastFrameRecon; // reconstruction buffer : passed in
  42. UINT8 *PostProcessBuffer; // postprocessing buffer : passed in
  43. // per block information passed in
  44. UINT8 *FragInfo; // blocks coded : passed in
  45. UINT32 FragInfoElementSize; // size of each element
  46. UINT32 FragInfoCodedMask; // mask to get at whether fragment is coded
  47. // per block info maintained by postprocessor
  48. INT32 *FragQIndex; // block's q index : allocated and filled
  49. INT32 *FragmentVariances; // block's pseudo variance : allocated and filled
  50. UINT8 *FragDeblockingFlag; // whether to deblock block : allocated and filled
  51. // filter specific vars
  52. INT32 *BoundingValuePtr; // pointer to a filter
  53. INT32 *FiltBoundingValue; // allocated (512 big)
  54. // deblocker specific vars
  55. INT32 *DeblockValuePtr; // pointer to a filter
  56. INT32 *DeblockBoundingValue; // allocated (512 big)
  57. // frame configuration
  58. CONFIG_TYPE Configuration;
  59. UINT32 ReconYDataOffset; // position within buffer of first y fragment
  60. UINT32 ReconUDataOffset; // position within buffer of first u fragment
  61. UINT32 ReconVDataOffset; // position within buffer of first v fragment
  62. UINT32 YPlaneFragments; // number of y fragments
  63. UINT32 UVPlaneFragments; // number of u and v fragments
  64. UINT32 UnitFragments; // number of total fragments y+u+v
  65. UINT32 HFragments; // number of horizontal fragments in y
  66. UINT32 VFragments; // number of vertical fragments in y
  67. INT32 YStride; // pitch of y in bytes
  68. INT32 UVStride; // pitch of uv in bytes
  69. // allocs so we can align our ptrs
  70. INT32 *FiltBoundingValueAlloc;
  71. INT32 *DeblockBoundingValueAlloc;
  72. INT32 *FragQIndexAlloc;
  73. INT32 *FragmentVariancesAlloc;
  74. UINT8 *FragDeblockingFlagAlloc;
  75. UINT32 MVBorder;
  76. UINT8 *IntermediateBufferAlloc;
  77. UINT8 *IntermediateBuffer;
  78. UINT32 DeInterlaceMode;
  79. UINT32 AddNoiseMode;
  80. } POSTPROC_INSTANCE;
  81. #define VAL_RANGE 256
  82. extern UINT8 LimitVal_VP31[VAL_RANGE * 3];
  83. typedef POSTPROC_INSTANCE * xPB_INST ;
  84. extern void (*FilteringVert_12)(UINT32 QValue,UINT8 * Src, INT32 Pitch);
  85. extern void (*FilteringHoriz_12)(UINT32 QValue,UINT8 * Src, INT32 Pitch);
  86. extern void (*FilteringVert_8)(UINT32 QValue,UINT8 * Src, INT32 Pitch);
  87. extern void (*FilteringHoriz_8)(UINT32 QValue,UINT8 * Src, INT32 Pitch);
  88. extern void (*CopyBlock) (unsigned char *src, unsigned char *dest, unsigned int srcstride);
  89. extern void (*VerticalBand_4_5_Scale)(unsigned char * dest,unsigned int destPitch,unsigned int destWidth);
  90. extern void (*LastVerticalBand_4_5_Scale)(unsigned char * dest,unsigned int destPitch,unsigned int destWidth);
  91. extern void (*VerticalBand_3_5_Scale)(unsigned char * dest,unsigned int destPitch,unsigned int destWidth);
  92. extern void (*LastVerticalBand_3_5_Scale)(unsigned char * dest,unsigned int destPitch,unsigned int destWidth);
  93. extern void (*HorizontalLine_1_2_Scale)(const unsigned char * source,unsigned int sourceWidth,unsigned char * dest,unsigned int destWidth);
  94. extern void (*HorizontalLine_3_5_Scale)(const unsigned char * source,unsigned int sourceWidth,unsigned char * dest,unsigned int destWidth);
  95. extern void (*HorizontalLine_4_5_Scale)(const unsigned char * source,unsigned int sourceWidth,unsigned char * dest,unsigned int destWidth);
  96. extern void (*VerticalBand_1_2_Scale)(unsigned char * dest,unsigned int destPitch,unsigned int destWidth);
  97. extern void (*LastVerticalBand_1_2_Scale)(unsigned char * dest,unsigned int destPitch,unsigned int destWidth);
  98. extern void (*FilterHoriz_Simple)(xPB_INST pbi, UINT8 * PixelPtr, INT32 LineLength, INT32*);
  99. extern void (*FilterVert_Simple)(xPB_INST pbi, UINT8 * PixelPtr, INT32 LineLength, INT32*);
  100. extern void (*DeringBlockWeak)(xPB_INST, const UINT8 *, UINT8 *, INT32, UINT32, UINT32 *);
  101. extern void (*DeringBlockStrong)(xPB_INST, const UINT8 *, UINT8 *, INT32, UINT32, UINT32 *);
  102. extern void (*DeblockLoopFilteredBand)(xPB_INST, UINT8 *, UINT8 *, UINT32, UINT32, UINT32, UINT32 *);
  103. extern void (*DeblockNonFilteredBand)(xPB_INST, UINT8 *, UINT8 *, UINT32, UINT32, UINT32, UINT32 *);
  104. extern void (*DeblockNonFilteredBandNewFilter)(xPB_INST, UINT8 *, UINT8 *, UINT32, UINT32, UINT32, UINT32 *);
  105. extern INT32*(*SetupBoundingValueArray)(xPB_INST pbi, INT32 FLimit);
  106. extern INT32*(*SetupDeblockValueArray)(xPB_INST pbi, INT32 FLimit);
  107. extern void (*FilterHoriz)(xPB_INST pbi, UINT8 * PixelPtr, INT32 LineLength, INT32*);
  108. extern void (*FilterVert)(xPB_INST pbi, UINT8 * PixelPtr, INT32 LineLength, INT32*);
  109. extern void (*ClampLevels)( POSTPROC_INSTANCE *pbi,INT32 BlackClamp, INT32 WhiteClamp, UINT8 *Src, UINT8 *Dst);
  110. extern void (*FastDeInterlace)(UINT8 *SrcPtr, UINT8 *DstPtr, INT32 Width, INT32 Height, INT32 Stride);
  111. extern void (*PlaneAddNoise)( UINT8 *Start, UINT32 Width, UINT32 Height, INT32 Pitch, int q);
  112. extern void DMachineSpecificConfig(INT32 MmxEnabled, INT32 XmmEnabled, INT32 WmtEnabled);
  113. #endif