diff options
Diffstat (limited to 'libswscale/swscale_internal.h')
-rw-r--r-- | libswscale/swscale_internal.h | 58 |
1 files changed, 44 insertions, 14 deletions
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 070161900b..eb11166e25 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -33,7 +33,12 @@ #define MAX_FILTER_SIZE 256 -#define VOFW 2048 +#if ARCH_X86 +#define VOFW 5120 +#else +#define VOFW 2048 // faster on PPC and not tested on others +#endif + #define VOF (VOFW*2) #ifdef WORDS_BIGENDIAN @@ -54,8 +59,9 @@ struct SwsContext; -typedef int (*SwsFunc)(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY, - int srcSliceH, uint8_t* dst[], int dstStride[]); +typedef int (*SwsFunc)(struct SwsContext *context, uint8_t* src[], + int srcStride[], int srcSliceY, int srcSliceH, + uint8_t* dst[], int dstStride[]); /* This struct should be aligned on at least a 32-byte boundary. */ typedef struct SwsContext{ @@ -183,7 +189,6 @@ typedef struct SwsContext{ int32_t alpMmxFilter[4*MAX_FILTER_SIZE]; #if HAVE_ALTIVEC - vector signed short CY; vector signed short CRV; vector signed short CBU; @@ -192,10 +197,8 @@ typedef struct SwsContext{ vector signed short OY; vector unsigned short CSHIFT; vector signed short *vYCoeffsBank, *vCCoeffsBank; - #endif - #if ARCH_BFIN uint32_t oy __attribute__((aligned(4))); uint32_t oc __attribute__((aligned(4))); @@ -252,6 +255,8 @@ typedef struct SwsContext{ void (*hyscale_internal)(uint8_t *dst, const uint8_t *src, long width, uint32_t *pal); + void (*hascale_internal)(uint8_t *dst, const uint8_t *src, + long width, uint32_t *pal); void (*hcscale_internal)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *pal); @@ -260,18 +265,23 @@ typedef struct SwsContext{ const uint8_t *src, int srcW, int xInc); void (*hcscale_fast)(struct SwsContext *c, int16_t *dst, int dstWidth, - const uint8_t *src1, const uint8_t *src2, int srcW, int xInc); + const uint8_t *src1, const uint8_t *src2, + int srcW, int xInc); void (*hScale)(int16_t *dst, int dstW, const uint8_t *src, int srcW, - int xInc, const int16_t *filter, const int16_t *filterPos, long filterSize); + int xInc, const int16_t *filter, const int16_t *filterPos, + long filterSize); } SwsContext; //FIXME check init (where 0) SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c); -int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation); +int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], + int fullRange, int brightness, + int contrast, int saturation); -void ff_yuv2rgb_init_tables_altivec(SwsContext *c, const int inv_table[4], int brightness, int contrast, int saturation); +void ff_yuv2rgb_init_tables_altivec(SwsContext *c, const int inv_table[4], + int brightness, int contrast, int saturation); SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c); SwsFunc ff_yuv2rgb_init_vis(SwsContext *c); SwsFunc ff_yuv2rgb_init_mlib(SwsContext *c); @@ -279,14 +289,25 @@ SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c); SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c); void ff_bfin_get_unscaled_swscale(SwsContext *c); void ff_yuv2packedX_altivec(SwsContext *c, - int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, - int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, - uint8_t *dest, int dstW, int dstY); + int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, + int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, + uint8_t *dest, int dstW, int dstY); const char *sws_format_name(int format); //FIXME replace this with something faster -#define isPlanarYUV(x) ( \ +#define is16BPS(x) ( \ + (x)==PIX_FMT_GRAY16BE \ + || (x)==PIX_FMT_GRAY16LE \ + || (x)==PIX_FMT_YUV420PLE \ + || (x)==PIX_FMT_YUV422PLE \ + || (x)==PIX_FMT_YUV444PLE \ + || (x)==PIX_FMT_YUV420PBE \ + || (x)==PIX_FMT_YUV422PBE \ + || (x)==PIX_FMT_YUV444PBE \ + ) +#define isBE(x) ((x)&1) +#define isPlanar8YUV(x) ( \ (x)==PIX_FMT_YUV410P \ || (x)==PIX_FMT_YUV420P \ || (x)==PIX_FMT_YUVA420P \ @@ -297,6 +318,15 @@ const char *sws_format_name(int format); || (x)==PIX_FMT_NV12 \ || (x)==PIX_FMT_NV21 \ ) +#define isPlanarYUV(x) ( \ + isPlanar8YUV(x) \ + || (x)==PIX_FMT_YUV420PLE \ + || (x)==PIX_FMT_YUV422PLE \ + || (x)==PIX_FMT_YUV444PLE \ + || (x)==PIX_FMT_YUV420PBE \ + || (x)==PIX_FMT_YUV422PBE \ + || (x)==PIX_FMT_YUV444PBE \ + ) #define isYUV(x) ( \ (x)==PIX_FMT_UYVY422 \ || (x)==PIX_FMT_YUYV422 \ |