diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-06-10 03:54:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-06-10 04:47:23 +0200 |
commit | 2ec77aae6791582b2f8e2502b48fd6d562aa81ce (patch) | |
tree | 8e8dfb93cd03ee5b3259c7e068454f7d2b04fb6f /libswscale/x86/swscale_template.c | |
parent | 6a137dde3ed6d88dc8bfa9de6f29a23e2b384a77 (diff) | |
parent | 996bbdbf1f5a031d38e8af3eac432bf8e2c72458 (diff) | |
download | ffmpeg-2ec77aae6791582b2f8e2502b48fd6d562aa81ce.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
lavf: make compute_pkt_fields2() return meaningful error values
matroskadec: set timestamps for RealAudio packets.
intelh263dec: aspect ratio processing fix.
intelh263dec: fix "Strict H.263 compliance" file playback
oss,sndio: simplify by using FFMIN.
swscale: extract monowhite/black output from yuv2packed[12X]_c().
swscale: de-macro'ify RGB15/16/32 input functions.
swscale: rearrange code.
movdec: Add support for the 'wfex' atom.
ffmpeg.c: Add a necessary const qualifier
riff: Fix potential memleak.
swscale: change 48bit RGB input macros to inline functions.
swscale: change 9/10bit YUV input macros to inline functions.
swscale: extract gray16 output functions from yuv2packed[12X]().
swscale: use standard clipping functions.
swscale: merge macros that are used only once.
swscale: fix function declarations in swscale.c.
swscale: fix function declaration keywords in x86/swscale_template.c.
Conflicts:
ffmpeg.c
libavcodec/intelh263dec.c
libswscale/swscale.c
libswscale/x86/swscale_template.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/x86/swscale_template.c')
-rw-r--r-- | libswscale/x86/swscale_template.c | 391 |
1 files changed, 206 insertions, 185 deletions
diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c index eaad94599f..25399fadef 100644 --- a/libswscale/x86/swscale_template.c +++ b/libswscale/x86/swscale_template.c @@ -70,14 +70,14 @@ : "%"REG_d, "%"REG_S\ ); -static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, uint8_t *uDest, uint8_t *vDest, - uint8_t *aDest, int dstW, int chrDstW, - const uint8_t *lumDither, const uint8_t *chrDither) +static void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, uint8_t *uDest, uint8_t *vDest, + uint8_t *aDest, int dstW, int chrDstW, + const uint8_t *lumDither, const uint8_t *chrDither) { int i; if (uDest) { @@ -155,14 +155,14 @@ static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter, : "%"REG_a, "%"REG_d, "%"REG_S\ ); -static inline void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, uint8_t *uDest, uint8_t *vDest, - uint8_t *aDest, int dstW, int chrDstW, - const uint8_t *lumDither, const uint8_t *chrDither) +static void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, uint8_t *uDest, uint8_t *vDest, + uint8_t *aDest, int dstW, int chrDstW, + const uint8_t *lumDither, const uint8_t *chrDither) { int i; if (uDest) { @@ -180,12 +180,12 @@ static inline void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter, YSCALEYUV2YV12X_ACCURATE(LUM_MMX_FILTER_OFFSET, dest, dstW, 0) } -static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc, - const int16_t *chrUSrc, const int16_t *chrVSrc, - const int16_t *alpSrc, - uint8_t *dest, uint8_t *uDest, uint8_t *vDest, - uint8_t *aDest, int dstW, int chrDstW, - const uint8_t *lumDither, const uint8_t *chrDither) +static void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc, + const int16_t *chrUSrc, const int16_t *chrVSrc, + const int16_t *alpSrc, + uint8_t *dest, uint8_t *uDest, uint8_t *vDest, + uint8_t *aDest, int dstW, int chrDstW, + const uint8_t *lumDither, const uint8_t *chrDither) { int p= 4; const int16_t *src[4]= { alpSrc + dstW, lumSrc + dstW, chrUSrc + chrDstW, chrVSrc + chrDstW }; @@ -214,12 +214,12 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc, } } -static inline void RENAME(yuv2yuv1_ar)(SwsContext *c, const int16_t *lumSrc, - const int16_t *chrUSrc, const int16_t *chrVSrc, - const int16_t *alpSrc, - uint8_t *dest, uint8_t *uDest, uint8_t *vDest, - uint8_t *aDest, int dstW, int chrDstW, - const uint8_t *lumDither, const uint8_t *chrDither) +static void RENAME(yuv2yuv1_ar)(SwsContext *c, const int16_t *lumSrc, + const int16_t *chrUSrc, const int16_t *chrVSrc, + const int16_t *alpSrc, + uint8_t *dest, uint8_t *uDest, uint8_t *vDest, + uint8_t *aDest, int dstW, int chrDstW, + const uint8_t *lumDither, const uint8_t *chrDither) { int p= 4; const int16_t *src[4]= { alpSrc + dstW, lumSrc + dstW, chrUSrc + chrDstW, chrVSrc + chrDstW }; @@ -470,12 +470,12 @@ static inline void RENAME(yuv2yuv1_ar)(SwsContext *c, const int16_t *lumSrc, " jb 1b \n\t" #define WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) -static inline void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, int dstW, int dstY) +static void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, int dstW, int dstY) { x86_reg dummy=0; x86_reg dstW_reg = dstW; @@ -503,12 +503,12 @@ static inline void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilte } } -static inline void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, int dstW, int dstY) +static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, int dstW, int dstY) { x86_reg dummy=0; x86_reg dstW_reg = dstW; @@ -560,12 +560,12 @@ static inline void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter, " jb 1b \n\t" #define WRITERGB16(dst, dstw, index) REAL_WRITERGB16(dst, dstw, index) -static inline void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, int dstW, int dstY) +static void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, int dstW, int dstY) { x86_reg dummy=0; x86_reg dstW_reg = dstW; @@ -584,12 +584,12 @@ static inline void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilt YSCALEYUV2PACKEDX_END } -static inline void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, int dstW, int dstY) +static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, int dstW, int dstY) { x86_reg dummy=0; x86_reg dstW_reg = dstW; @@ -637,12 +637,12 @@ static inline void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter, " jb 1b \n\t" #define WRITERGB15(dst, dstw, index) REAL_WRITERGB15(dst, dstw, index) -static inline void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, int dstW, int dstY) +static void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, int dstW, int dstY) { x86_reg dummy=0; x86_reg dstW_reg = dstW; @@ -661,12 +661,12 @@ static inline void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilt YSCALEYUV2PACKEDX_END } -static inline void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, int dstW, int dstY) +static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, int dstW, int dstY) { x86_reg dummy=0; x86_reg dstW_reg = dstW; @@ -794,12 +794,12 @@ static inline void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter, #define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX(dst, dstw, index) #endif -static inline void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, int dstW, int dstY) +static void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, int dstW, int dstY) { x86_reg dummy=0; x86_reg dstW_reg = dstW; @@ -818,12 +818,12 @@ static inline void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilte ); } -static inline void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, int dstW, int dstY) +static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, int dstW, int dstY) { x86_reg dummy=0; x86_reg dstW_reg = dstW; @@ -859,12 +859,12 @@ static inline void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter, " jb 1b \n\t" #define WRITEYUY2(dst, dstw, index) REAL_WRITEYUY2(dst, dstw, index) -static inline void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, int dstW, int dstY) +static void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, int dstW, int dstY) { x86_reg dummy=0; x86_reg dstW_reg = dstW; @@ -880,12 +880,12 @@ static inline void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFil YSCALEYUV2PACKEDX_END } -static inline void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter, - const int16_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int16_t **chrUSrc, - const int16_t **chrVSrc, - int chrFilterSize, const int16_t **alpSrc, - uint8_t *dest, int dstW, int dstY) +static void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, const int16_t **chrUSrc, + const int16_t **chrVSrc, + int chrFilterSize, const int16_t **alpSrc, + uint8_t *dest, int dstW, int dstY) { x86_reg dummy=0; x86_reg dstW_reg = dstW; @@ -981,12 +981,12 @@ static inline void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter /** * vertical bilinear scale YV12 to RGB */ -static inline void RENAME(yuv2rgb32_2)(SwsContext *c, const uint16_t *buf0, - const uint16_t *buf1, const uint16_t *ubuf0, - const uint16_t *ubuf1, const uint16_t *vbuf0, - const uint16_t *vbuf1, const uint16_t *abuf0, - const uint16_t *abuf1, uint8_t *dest, - int dstW, int yalpha, int uvalpha, int y) +static void RENAME(yuv2rgb32_2)(SwsContext *c, const uint16_t *buf0, + const uint16_t *buf1, const uint16_t *ubuf0, + const uint16_t *ubuf1, const uint16_t *vbuf0, + const uint16_t *vbuf1, const uint16_t *abuf0, + const uint16_t *abuf1, uint8_t *dest, + int dstW, int yalpha, int uvalpha, int y) { if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) { #if ARCH_X86_64 @@ -1043,12 +1043,12 @@ static inline void RENAME(yuv2rgb32_2)(SwsContext *c, const uint16_t *buf0, } } -static inline void RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0, - const uint16_t *buf1, const uint16_t *ubuf0, - const uint16_t *ubuf1, const uint16_t *vbuf0, - const uint16_t *vbuf1, const uint16_t *abuf0, - const uint16_t *abuf1, uint8_t *dest, - int dstW, int yalpha, int uvalpha, int y) +static void RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0, + const uint16_t *buf1, const uint16_t *ubuf0, + const uint16_t *ubuf1, const uint16_t *vbuf0, + const uint16_t *vbuf1, const uint16_t *abuf0, + const uint16_t *abuf1, uint8_t *dest, + int dstW, int yalpha, int uvalpha, int y) { //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :( __asm__ volatile( @@ -1065,12 +1065,12 @@ static inline void RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0, ); } -static inline void RENAME(yuv2rgb555_2)(SwsContext *c, const uint16_t *buf0, - const uint16_t *buf1, const uint16_t *ubuf0, - const uint16_t *ubuf1, const uint16_t *vbuf0, - const uint16_t *vbuf1, const uint16_t *abuf0, - const uint16_t *abuf1, uint8_t *dest, - int dstW, int yalpha, int uvalpha, int y) +static void RENAME(yuv2rgb555_2)(SwsContext *c, const uint16_t *buf0, + const uint16_t *buf1, const uint16_t *ubuf0, + const uint16_t *ubuf1, const uint16_t *vbuf0, + const uint16_t *vbuf1, const uint16_t *abuf0, + const uint16_t *abuf1, uint8_t *dest, + int dstW, int yalpha, int uvalpha, int y) { //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :( __asm__ volatile( @@ -1093,12 +1093,12 @@ static inline void RENAME(yuv2rgb555_2)(SwsContext *c, const uint16_t *buf0, ); } -static inline void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0, - const uint16_t *buf1, const uint16_t *ubuf0, - const uint16_t *ubuf1, const uint16_t *vbuf0, - const uint16_t *vbuf1, const uint16_t *abuf0, - const uint16_t *abuf1, uint8_t *dest, - int dstW, int yalpha, int uvalpha, int y) +static void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0, + const uint16_t *buf1, const uint16_t *ubuf0, + const uint16_t *ubuf1, const uint16_t *vbuf0, + const uint16_t *vbuf1, const uint16_t *abuf0, + const uint16_t *abuf1, uint8_t *dest, + int dstW, int yalpha, int uvalpha, int y) { //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :( __asm__ volatile( @@ -1161,12 +1161,12 @@ static inline void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0, #define YSCALEYUV2PACKED(index, c) REAL_YSCALEYUV2PACKED(index, c) -static inline void RENAME(yuv2yuyv422_2)(SwsContext *c, const uint16_t *buf0, - const uint16_t *buf1, const uint16_t *ubuf0, - const uint16_t *ubuf1, const uint16_t *vbuf0, - const uint16_t *vbuf1, const uint16_t *abuf0, - const uint16_t *abuf1, uint8_t *dest, - int dstW, int yalpha, int uvalpha, int y) +static void RENAME(yuv2yuyv422_2)(SwsContext *c, const uint16_t *buf0, + const uint16_t *buf1, const uint16_t *ubuf0, + const uint16_t *ubuf1, const uint16_t *vbuf0, + const uint16_t *vbuf1, const uint16_t *abuf0, + const uint16_t *abuf1, uint8_t *dest, + int dstW, int yalpha, int uvalpha, int y) { //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :( __asm__ volatile( @@ -1300,12 +1300,12 @@ static inline void RENAME(yuv2yuyv422_2)(SwsContext *c, const uint16_t *buf0, /** * YV12 to RGB without scaling or interpolating */ -static inline void RENAME(yuv2rgb32_1)(SwsContext *c, const uint16_t *buf0, - const uint16_t *ubuf0, const uint16_t *ubuf1, - const uint16_t *vbuf0, const uint16_t *vbuf1, - const uint16_t *abuf0, uint8_t *dest, - int dstW, int uvalpha, enum PixelFormat dstFormat, - int flags, int y) +static void RENAME(yuv2rgb32_1)(SwsContext *c, const uint16_t *buf0, + const uint16_t *ubuf0, const uint16_t *ubuf1, + const uint16_t *vbuf0, const uint16_t *vbuf1, + const uint16_t *abuf0, uint8_t *dest, + int dstW, int uvalpha, enum PixelFormat dstFormat, + int flags, int y) { const uint16_t *buf1= buf0; //FIXME needed for RGB1/BGR1 @@ -1368,12 +1368,12 @@ static inline void RENAME(yuv2rgb32_1)(SwsContext *c, const uint16_t *buf0, } } -static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0, - const uint16_t *ubuf0, const uint16_t *ubuf1, - const uint16_t *vbuf0, const uint16_t *vbuf1, - const uint16_t *abuf0, uint8_t *dest, - int dstW, int uvalpha, enum PixelFormat dstFormat, - int flags, int y) +static void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0, + const uint16_t *ubuf0, const uint16_t *ubuf1, + const uint16_t *vbuf0, const uint16_t *vbuf1, + const uint16_t *abuf0, uint8_t *dest, + int dstW, int uvalpha, enum PixelFormat dstFormat, + int flags, int y) { const uint16_t *buf1= buf0; //FIXME needed for RGB1/BGR1 @@ -1406,12 +1406,12 @@ static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0, } } -static inline void RENAME(yuv2rgb555_1)(SwsContext *c, const uint16_t *buf0, - const uint16_t *ubuf0, const uint16_t *ubuf1, - const uint16_t *vbuf0, const uint16_t *vbuf1, - const uint16_t *abuf0, uint8_t *dest, - int dstW, int uvalpha, enum PixelFormat dstFormat, - int flags, int y) +static void RENAME(yuv2rgb555_1)(SwsContext *c, const uint16_t *buf0, + const uint16_t *ubuf0, const uint16_t *ubuf1, + const uint16_t *vbuf0, const uint16_t *vbuf1, + const uint16_t *abuf0, uint8_t *dest, + int dstW, int uvalpha, enum PixelFormat dstFormat, + int flags, int y) { const uint16_t *buf1= buf0; //FIXME needed for RGB1/BGR1 @@ -1456,12 +1456,12 @@ static inline void RENAME(yuv2rgb555_1)(SwsContext *c, const uint16_t *buf0, } } -static inline void RENAME(yuv2rgb565_1)(SwsContext *c, const uint16_t *buf0, - const uint16_t *ubuf0, const uint16_t *ubuf1, - const uint16_t *vbuf0, const uint16_t *vbuf1, - const uint16_t *abuf0, uint8_t *dest, - int dstW, int uvalpha, enum PixelFormat dstFormat, - int flags, int y) +static void RENAME(yuv2rgb565_1)(SwsContext *c, const uint16_t *buf0, + const uint16_t *ubuf0, const uint16_t *ubuf1, + const uint16_t *vbuf0, const uint16_t *vbuf1, + const uint16_t *abuf0, uint8_t *dest, + int dstW, int uvalpha, enum PixelFormat dstFormat, + int flags, int y) { const uint16_t *buf1= buf0; //FIXME needed for RGB1/BGR1 @@ -1543,12 +1543,12 @@ static inline void RENAME(yuv2rgb565_1)(SwsContext *c, const uint16_t *buf0, "psraw $7, %%mm7 \n\t" #define YSCALEYUV2PACKED1b(index, c) REAL_YSCALEYUV2PACKED1b(index, c) -static inline void RENAME(yuv2yuyv422_1)(SwsContext *c, const uint16_t *buf0, - const uint16_t *ubuf0, const uint16_t *ubuf1, - const uint16_t *vbuf0, const uint16_t *vbuf1, - const uint16_t *abuf0, uint8_t *dest, - int dstW, int uvalpha, enum PixelFormat dstFormat, - int flags, int y) +static void RENAME(yuv2yuyv422_1)(SwsContext *c, const uint16_t *buf0, + const uint16_t *ubuf0, const uint16_t *ubuf1, + const uint16_t *vbuf0, const uint16_t *vbuf1, + const uint16_t *abuf0, uint8_t *dest, + int dstW, int uvalpha, enum PixelFormat dstFormat, + int flags, int y) { const uint16_t *buf1= buf0; //FIXME needed for RGB1/BGR1 @@ -1582,7 +1582,8 @@ static inline void RENAME(yuv2yuyv422_1)(SwsContext *c, const uint16_t *buf0, #if !COMPILE_TEMPLATE_MMX2 //FIXME yuy2* can read up to 7 samples too much -static inline void RENAME(yuy2ToY)(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused) +static void RENAME(yuy2ToY)(uint8_t *dst, const uint8_t *src, + int width, uint32_t *unused) { __asm__ volatile( "movq "MANGLE(bm01010101)", %%mm2 \n\t" @@ -1601,7 +1602,9 @@ static inline void RENAME(yuy2ToY)(uint8_t *dst, const uint8_t *src, int width, ); } -static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) +static void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, + const uint8_t *src1, const uint8_t *src2, + int width, uint32_t *unused) { __asm__ volatile( "movq "MANGLE(bm01010101)", %%mm4 \n\t" @@ -1627,7 +1630,9 @@ static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t assert(src1 == src2); } -static inline void RENAME(LEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) +static void RENAME(LEToUV)(uint8_t *dstU, uint8_t *dstV, + const uint8_t *src1, const uint8_t *src2, + int width, uint32_t *unused) { __asm__ volatile( "mov %0, %%"REG_a" \n\t" @@ -1653,7 +1658,8 @@ static inline void RENAME(LEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *s /* This is almost identical to the previous, end exists only because * yuy2ToY/UV)(dst, src+1, ...) would have 100% unaligned accesses. */ -static inline void RENAME(uyvyToY)(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused) +static void RENAME(uyvyToY)(uint8_t *dst, const uint8_t *src, + int width, uint32_t *unused) { __asm__ volatile( "mov %0, %%"REG_a" \n\t" @@ -1671,7 +1677,9 @@ static inline void RENAME(uyvyToY)(uint8_t *dst, const uint8_t *src, int width, ); } -static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) +static void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, + const uint8_t *src1, const uint8_t *src2, + int width, uint32_t *unused) { __asm__ volatile( "movq "MANGLE(bm01010101)", %%mm4 \n\t" @@ -1697,7 +1705,9 @@ static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t assert(src1 == src2); } -static inline void RENAME(BEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) +static void RENAME(BEToUV)(uint8_t *dstU, uint8_t *dstV, + const uint8_t *src1, const uint8_t *src2, + int width, uint32_t *unused) { __asm__ volatile( "movq "MANGLE(bm01010101)", %%mm4 \n\t" @@ -1722,8 +1732,8 @@ static inline void RENAME(BEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *s ); } -static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2, - const uint8_t *src, int width) +static av_always_inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2, + const uint8_t *src, int width) { __asm__ volatile( "movq "MANGLE(bm01010101)", %%mm4 \n\t" @@ -1748,22 +1758,23 @@ static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2, ); } -static inline void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV, - const uint8_t *src1, const uint8_t *src2, - int width, uint32_t *unused) +static void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV, + const uint8_t *src1, const uint8_t *src2, + int width, uint32_t *unused) { RENAME(nvXXtoUV)(dstU, dstV, src1, width); } -static inline void RENAME(nv21ToUV)(uint8_t *dstU, uint8_t *dstV, - const uint8_t *src1, const uint8_t *src2, - int width, uint32_t *unused) +static void RENAME(nv21ToUV)(uint8_t *dstU, uint8_t *dstV, + const uint8_t *src1, const uint8_t *src2, + int width, uint32_t *unused) { RENAME(nvXXtoUV)(dstV, dstU, src1, width); } #endif /* !COMPILE_TEMPLATE_MMX2 */ -static inline void RENAME(bgr24ToY_mmx)(int16_t *dst, const uint8_t *src, int width, enum PixelFormat srcFormat) +static av_always_inline void RENAME(bgr24ToY_mmx)(int16_t *dst, const uint8_t *src, + int width, enum PixelFormat srcFormat) { if(srcFormat == PIX_FMT_BGR24) { @@ -1815,7 +1826,21 @@ static inline void RENAME(bgr24ToY_mmx)(int16_t *dst, const uint8_t *src, int wi ); } -static inline void RENAME(bgr24ToUV_mmx)(int16_t *dstU, int16_t *dstV, const uint8_t *src, int width, enum PixelFormat srcFormat) +static void RENAME(bgr24ToY)(int16_t *dst, const uint8_t *src, + int width, uint32_t *unused) +{ + RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_BGR24); +} + +static void RENAME(rgb24ToY)(int16_t *dst, const uint8_t *src, + int width, uint32_t *unused) +{ + RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24); +} + +static av_always_inline void RENAME(bgr24ToUV_mmx)(int16_t *dstU, int16_t *dstV, + const uint8_t *src, int width, + enum PixelFormat srcFormat) { __asm__ volatile( "movq 24(%4), %%mm6 \n\t" @@ -1871,23 +1896,17 @@ static inline void RENAME(bgr24ToUV_mmx)(int16_t *dstU, int16_t *dstV, const uin ); } -static inline void RENAME(bgr24ToY)(int16_t *dst, const uint8_t *src, int width, uint32_t *unused) -{ - RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_BGR24); -} - -static inline void RENAME(bgr24ToUV)(int16_t *dstU, int16_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) +static void RENAME(bgr24ToUV)(int16_t *dstU, int16_t *dstV, + const uint8_t *src1, const uint8_t *src2, + int width, uint32_t *unused) { RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_BGR24); assert(src1 == src2); } -static inline void RENAME(rgb24ToY)(int16_t *dst, const uint8_t *src, int width, uint32_t *unused) -{ - RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24); -} - -static inline void RENAME(rgb24ToUV)(int16_t *dstU, int16_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) +static void RENAME(rgb24ToUV)(int16_t *dstU, int16_t *dstV, + const uint8_t *src1, const uint8_t *src2, + int width, uint32_t *unused) { assert(src1==src2); RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_RGB24); @@ -1895,8 +1914,10 @@ static inline void RENAME(rgb24ToUV)(int16_t *dstU, int16_t *dstV, const uint8_t #if !COMPILE_TEMPLATE_MMX2 // bilinear / bicubic scaling -static inline void RENAME(hScale)(int16_t *dst, int dstW, const uint8_t *src, int srcW, int xInc, - const int16_t *filter, const int16_t *filterPos, int filterSize) +static void RENAME(hScale)(int16_t *dst, int dstW, + const uint8_t *src, int srcW, + int xInc, const int16_t *filter, + const int16_t *filterPos, int filterSize) { assert(filterSize % 4 == 0 && filterSize>0); if (filterSize==4) { // Always true for upscaling, sometimes for down, too. @@ -2208,9 +2229,9 @@ static inline void RENAME(hScale16)(int16_t *dst, int dstW, const uint16_t *src, #if COMPILE_TEMPLATE_MMX2 -static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, - int dstWidth, const uint8_t *src, int srcW, - int xInc) +static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, + int dstWidth, const uint8_t *src, + int srcW, int xInc) { int16_t *filterPos = c->hLumFilterPos; int16_t *filter = c->hLumFilter; @@ -2280,9 +2301,9 @@ static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, dst[i] = src[srcW-1]*128; } -static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, - int dstWidth, const uint8_t *src1, - const uint8_t *src2, int srcW, int xInc) +static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, + int dstWidth, const uint8_t *src1, + const uint8_t *src2, int srcW, int xInc) { int16_t *filterPos = c->hChrFilterPos; int16_t *filter = c->hChrFilter; @@ -2343,7 +2364,7 @@ static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *d } #endif /* COMPILE_TEMPLATE_MMX2 */ -static void RENAME(sws_init_swScale)(SwsContext *c) +static av_cold void RENAME(sws_init_swScale)(SwsContext *c) { enum PixelFormat srcFormat = c->srcFormat, dstFormat = c->dstFormat; |