123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- #ifndef _CCLIB_H
- #define _CCLIB_H
- #include "cpuidlib.h"
- #ifdef __cplusplus
- extern "C"
- {
- #else
- #if !defined(bool)
- typedef int bool;
- #endif
- #endif
- int InitCCLib( PROCTYPE CpuType );
- void DeInitCCLib( void );
- extern void (*RGB32toYV12)( unsigned char *RGBABuffer, int ImageWidth, int ImageHeight,
- unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
- extern void (*RGB24toYV12)( unsigned char *RGBBuffer, int ImageWidth, int ImageHeight,
- unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
- extern void (*UYVYtoYV12)( unsigned char *UYVYBuffer, int ImageWidth, int ImageHeight,
- unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
- extern void (*YUY2toYV12)( unsigned char *UYVYBuffer, int ImageWidth, int ImageHeight,
- unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
- extern void (*YVYUtoYV12)( unsigned char *YVYUBuffer, int ImageWidth, int ImageHeight,
- unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
- extern void RGB24toYV12F
- (
- unsigned char *RGBBuffer,
- int ImageWidth,
- int ImageHeight,
- unsigned char *YBuffer,
- unsigned char *UBuffer,
- unsigned char *VBuffer,
- int SrcPitch,
- int DstPitch
- );
- extern void RGB32toYV12F
- (
- unsigned char *RGBBuffer,
- int ImageWidth,
- int ImageHeight,
- unsigned char *YBuffer,
- unsigned char *UBuffer,
- unsigned char *VBuffer,
- int SrcPitch,
- int DstPitch
- );
- extern void UYVYtoYV12F
- (
- unsigned char *UYVYBuffer,
- int ImageWidth,
- int ImageHeight,
- unsigned char *YBuffer,
- unsigned char *UBuffer,
- unsigned char *VBuffer,
- int SrcPitch,
- int DstPitch
- );
- extern void YUY2toYV12F
- (
- unsigned char *YUY2Buffer,
- int ImageWidth,
- int ImageHeight,
- unsigned char *YBuffer,
- unsigned char *UBuffer,
- unsigned char *VBuffer,
- int SrcPitch,
- int DstPitch
- );
- extern void YVYUtoYV12F
- (
- unsigned char *YVYUBuffer,
- int ImageWidth,
- int ImageHeight,
- unsigned char *YBuffer,
- unsigned char *UBuffer,
- unsigned char *VBuffer,
- int SrcPitch,
- int DstPitch
- );
- /*
- * Macros to make it easier to call the needed functions
- */
- #define CC_RGB32toYV12( _RGBABuffer, _ImageWidth, _ImageHeight, _YBuffer, _UBuffer, _VBuffer ) \
- (*RGB32toYV12)( _RGBABuffer, _ImageWidth, _ImageHeight, _YBuffer, _UBuffer, _VBuffer, _ImageWidth*4, _ImageWidth )
- #define CC_RGB24toYV12( _RGBBuffer, _ImageWidth, _ImageHeight, _YBuffer, _UBuffer, _VBuffer ) \
- (*RGB24toYV12)( _RGBBuffer, _ImageWidth, _ImageHeight, _YBuffer, _UBuffer, _VBuffer, _ImageWidth*3, _ImageWidth )
- #define CC_UYVYtoYV12( _UYVYBuffer, _ImageWidth, _ImageHeight, _YBuffer, _UBuffer, _VBuffer ) \
- (*UYVYtoYV12)( _UYVYBuffer, _ImageWidth, _ImageHeight, _YBuffer, _UBuffer, _VBuffer, _ImageWidth*2, _ImageWidth )
- #define CC_YUY2toYV12( _YUY2Buffer, _ImageWidth, _ImageHeight, _YBuffer, _UBuffer, _VBuffer ) \
- (*YUY2toYV12)( _YUY2Buffer, _ImageWidth, _ImageHeight, _YBuffer, _UBuffer, _VBuffer, _ImageWidth*2, _ImageWidth )
- #define CC_YVYUtoYV12( _YVYUBuffer, _ImageWidth, _ImageHeight, _YBuffer, _UBuffer, _VBuffer ) \
- (*YVYUtoYV12)( _YVYUBuffer, _ImageWidth, _ImageHeight, _YBuffer, _UBuffer, _VBuffer, _ImageWidth*2, _ImageWidth )
- // super generic rgb to yuv color conversion can handle any rgb to yuv conversion
- // provided r,g,b components are 1 byte apiece, and that the resulting y is 1 byte
- extern void ConvertRGBtoYUV(
- const unsigned char* const pucSourceR, const unsigned char* const pucSourceG, const unsigned char* const pucSourceB,
- int width, int height, int rgb_step, int rgb_pitch,
- unsigned char* const pucDestY, unsigned char* const pucDestU, unsigned char* const pucDestV,
- int uv_width_shift, int uv_height_shift,
- int y_step, int y_pitch,int uv_step,int uv_pitch);
- extern void ConvertRGBtoYUVI(
- const unsigned char* const pucSourceR, const unsigned char* const pucSourceG, const unsigned char* const pucSourceB,
- int iWidth, int iHeight, int iStepRGB, int iStrideRGB,
- unsigned char* const pucDestY, unsigned char* const pucDestU, unsigned char* const pucDestV,
- int uv_width_shift, int uv_height_shift,
- int iStepY, int iStrideY, int iStepUV, int iStrideUV);
- // This assumes 3 byte RGB data with the same component ordering in the source and destination
- extern void ConvertRGBtoRGB(const unsigned char* const pucSource, long lWidth, long lHeight, long lStepIn, long lStrideIn,
- unsigned char* const pucDest, long lStepOut, long lStrideOut);
- extern void ConvertYUVtoRGB(
- const unsigned char* const pucYPlane, const unsigned char* const pucUPlane, const unsigned char* const pucVPlane,
- long lWidth, long lHeight,
- long uv_width_shift, long uv_height_shift, // not used, should both be set to 1
- long lStepY, long lStrideY,long lStepUV, long lStrideUV,
- unsigned char* const pucRPlane, unsigned char* const pucGPlane, unsigned char* const pucBPlane,
- long lStepRGB, long lStrideRGB);
- extern void ConvertYUVItoRGB(
- const unsigned char* const pucYPlane, const unsigned char* const pucUPlane, const unsigned char* const pucVPlane,
- long lWidth, long lHeight,
- long uv_width_shift, long uv_height_shift, // not used, should both be set to 1
- long lStepY, long lStrideY,long lStepUV, long lStrideUV,
- unsigned char* const pucRPlane, unsigned char* const pucGPlane, unsigned char* const pucBPlane,
- long lStepRGB, long lStrideRGB);
- extern void ConvertYUVtoRGB2(
- const unsigned char* const pucYPlane, const unsigned char* const pucUPlane, const unsigned char* const pucVPlane,
- long lWidth, long lHeight,
- long uv_width_shift, long uv_height_shift, // not used, should both be set to 1
- long lStepY, long lStrideY,long lStepUV, long lStrideUV,
- unsigned char* const pucRPlane, unsigned char* const pucGPlane, unsigned char* const pucBPlane,
- long lStepRGB, long lStrideRGB,
- bool bSupersampleHoriz, bool bSupersampleVert);
- extern void ConvertYUVItoRGB2(
- const unsigned char* const pucYPlane, const unsigned char* const pucUPlane, const unsigned char* const pucVPlane,
- long lWidth, long lHeight,
- long uv_width_shift, long uv_height_shift, // not used, should both be set to 1
- long lStepY, long lStrideY,long lStepUV, long lStrideUV,
- unsigned char* const pucRPlane, unsigned char* const pucGPlane, unsigned char* const pucBPlane,
- long lStepRGB, long lStrideRGB,
- bool bSupersampleHoriz, bool bSupersampleVert);
- // This assumes packed planar data
- extern void ConvertYUVtoYUV(const unsigned char* const pucYIn, const unsigned char* const pucUV1In, const unsigned char* const pucUV2In,
- long m_lWidth, long m_lHeight,
- unsigned char* const pucYOut, unsigned char* const pucUV1Out, unsigned char* const pucUV2Out);
- // This assumes packed planar data
- extern void ConvertYUVtoYUVI(const unsigned char* const pucYIn, const unsigned char* const pucUV1In, const unsigned char* const pucUV2In,
- long m_lWidth, long m_lHeight,
- unsigned char* const pucYOut, unsigned char* const pucUV1Out, unsigned char* const pucUV2Out);
- // This assumes packed planar data
- extern void ConvertYUVItoYUV(const unsigned char* const pucYIn, const unsigned char* const pucUV1In, const unsigned char* const pucUV2In,
- long m_lWidth, long m_lHeight,
- unsigned char* const pucYOut, unsigned char* const pucUV1Out, unsigned char* const pucUV2Out);
- #ifdef __cplusplus
- }
- #endif
- #endif /* _CCLIB_H */
|