mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
swscale: fix function declaration keywords in x86/swscale_template.c.
Remove inline keyword for functions that are only called through their function pointers (and thus cannot be inlined); add av_cold keyword to init function, and use av_always_inline instead of inline for functions that must be inlined for performance reasons.
This commit is contained in:
parent
a71bcd1a7f
commit
a27db4c349
@ -70,7 +70,7 @@
|
|||||||
: "%"REG_d, "%"REG_S\
|
: "%"REG_d, "%"REG_S\
|
||||||
);
|
);
|
||||||
|
|
||||||
static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter,
|
static void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -151,7 +151,7 @@ static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter,
|
|||||||
: "%"REG_a, "%"REG_d, "%"REG_S\
|
: "%"REG_a, "%"REG_d, "%"REG_S\
|
||||||
);
|
);
|
||||||
|
|
||||||
static inline void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter,
|
static void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -171,7 +171,7 @@ static inline void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter,
|
|||||||
YSCALEYUV2YV12X_ACCURATE(LUM_MMX_FILTER_OFFSET, dest, dstW, 0)
|
YSCALEYUV2YV12X_ACCURATE(LUM_MMX_FILTER_OFFSET, dest, dstW, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc,
|
static void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc,
|
||||||
const int16_t *chrUSrc, const int16_t *chrVSrc,
|
const int16_t *chrUSrc, const int16_t *chrVSrc,
|
||||||
const int16_t *alpSrc,
|
const int16_t *alpSrc,
|
||||||
uint8_t *dest, uint8_t *uDest, uint8_t *vDest,
|
uint8_t *dest, uint8_t *uDest, uint8_t *vDest,
|
||||||
@ -204,7 +204,7 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(yuv2yuv1_ar)(SwsContext *c, const int16_t *lumSrc,
|
static void RENAME(yuv2yuv1_ar)(SwsContext *c, const int16_t *lumSrc,
|
||||||
const int16_t *chrUSrc, const int16_t *chrVSrc,
|
const int16_t *chrUSrc, const int16_t *chrVSrc,
|
||||||
const int16_t *alpSrc,
|
const int16_t *alpSrc,
|
||||||
uint8_t *dest, uint8_t *uDest, uint8_t *vDest,
|
uint8_t *dest, uint8_t *uDest, uint8_t *vDest,
|
||||||
@ -458,7 +458,7 @@ static inline void RENAME(yuv2yuv1_ar)(SwsContext *c, const int16_t *lumSrc,
|
|||||||
" jb 1b \n\t"
|
" 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)
|
#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,
|
static void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -491,7 +491,7 @@ 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,
|
static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -548,7 +548,7 @@ static inline void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
|
|||||||
" jb 1b \n\t"
|
" jb 1b \n\t"
|
||||||
#define WRITERGB16(dst, dstw, index) REAL_WRITERGB16(dst, dstw, index)
|
#define WRITERGB16(dst, dstw, index) REAL_WRITERGB16(dst, dstw, index)
|
||||||
|
|
||||||
static inline void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
static void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -572,7 +572,7 @@ static inline void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilt
|
|||||||
YSCALEYUV2PACKEDX_END
|
YSCALEYUV2PACKEDX_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
|
static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -625,7 +625,7 @@ static inline void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
|
|||||||
" jb 1b \n\t"
|
" jb 1b \n\t"
|
||||||
#define WRITERGB15(dst, dstw, index) REAL_WRITERGB15(dst, dstw, index)
|
#define WRITERGB15(dst, dstw, index) REAL_WRITERGB15(dst, dstw, index)
|
||||||
|
|
||||||
static inline void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
static void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -649,7 +649,7 @@ static inline void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilt
|
|||||||
YSCALEYUV2PACKEDX_END
|
YSCALEYUV2PACKEDX_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -782,7 +782,7 @@ static inline void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
|||||||
#define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX(dst, dstw, index)
|
#define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX(dst, dstw, index)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
static void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -806,7 +806,7 @@ 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,
|
static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -847,7 +847,7 @@ static inline void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
|
|||||||
" jb 1b \n\t"
|
" jb 1b \n\t"
|
||||||
#define WRITEYUY2(dst, dstw, index) REAL_WRITEYUY2(dst, dstw, index)
|
#define WRITEYUY2(dst, dstw, index) REAL_WRITEYUY2(dst, dstw, index)
|
||||||
|
|
||||||
static inline void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
static void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -868,7 +868,7 @@ static inline void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFil
|
|||||||
YSCALEYUV2PACKEDX_END
|
YSCALEYUV2PACKEDX_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter,
|
static void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter,
|
||||||
const int16_t **lumSrc, int lumFilterSize,
|
const int16_t **lumSrc, int lumFilterSize,
|
||||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||||
const int16_t **chrVSrc,
|
const int16_t **chrVSrc,
|
||||||
@ -969,7 +969,7 @@ static inline void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter
|
|||||||
/**
|
/**
|
||||||
* vertical bilinear scale YV12 to RGB
|
* vertical bilinear scale YV12 to RGB
|
||||||
*/
|
*/
|
||||||
static inline void RENAME(yuv2rgb32_2)(SwsContext *c, const uint16_t *buf0,
|
static void RENAME(yuv2rgb32_2)(SwsContext *c, const uint16_t *buf0,
|
||||||
const uint16_t *buf1, const uint16_t *ubuf0,
|
const uint16_t *buf1, const uint16_t *ubuf0,
|
||||||
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
||||||
const uint16_t *vbuf1, const uint16_t *abuf0,
|
const uint16_t *vbuf1, const uint16_t *abuf0,
|
||||||
@ -1031,7 +1031,7 @@ static inline void RENAME(yuv2rgb32_2)(SwsContext *c, const uint16_t *buf0,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0,
|
static void RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0,
|
||||||
const uint16_t *buf1, const uint16_t *ubuf0,
|
const uint16_t *buf1, const uint16_t *ubuf0,
|
||||||
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
||||||
const uint16_t *vbuf1, const uint16_t *abuf0,
|
const uint16_t *vbuf1, const uint16_t *abuf0,
|
||||||
@ -1053,7 +1053,7 @@ static inline void RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(yuv2rgb555_2)(SwsContext *c, const uint16_t *buf0,
|
static void RENAME(yuv2rgb555_2)(SwsContext *c, const uint16_t *buf0,
|
||||||
const uint16_t *buf1, const uint16_t *ubuf0,
|
const uint16_t *buf1, const uint16_t *ubuf0,
|
||||||
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
||||||
const uint16_t *vbuf1, const uint16_t *abuf0,
|
const uint16_t *vbuf1, const uint16_t *abuf0,
|
||||||
@ -1081,7 +1081,7 @@ static inline void RENAME(yuv2rgb555_2)(SwsContext *c, const uint16_t *buf0,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0,
|
static void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0,
|
||||||
const uint16_t *buf1, const uint16_t *ubuf0,
|
const uint16_t *buf1, const uint16_t *ubuf0,
|
||||||
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
||||||
const uint16_t *vbuf1, const uint16_t *abuf0,
|
const uint16_t *vbuf1, const uint16_t *abuf0,
|
||||||
@ -1149,7 +1149,7 @@ static inline void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0,
|
|||||||
|
|
||||||
#define YSCALEYUV2PACKED(index, c) REAL_YSCALEYUV2PACKED(index, c)
|
#define YSCALEYUV2PACKED(index, c) REAL_YSCALEYUV2PACKED(index, c)
|
||||||
|
|
||||||
static inline void RENAME(yuv2yuyv422_2)(SwsContext *c, const uint16_t *buf0,
|
static void RENAME(yuv2yuyv422_2)(SwsContext *c, const uint16_t *buf0,
|
||||||
const uint16_t *buf1, const uint16_t *ubuf0,
|
const uint16_t *buf1, const uint16_t *ubuf0,
|
||||||
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
||||||
const uint16_t *vbuf1, const uint16_t *abuf0,
|
const uint16_t *vbuf1, const uint16_t *abuf0,
|
||||||
@ -1288,7 +1288,7 @@ static inline void RENAME(yuv2yuyv422_2)(SwsContext *c, const uint16_t *buf0,
|
|||||||
/**
|
/**
|
||||||
* YV12 to RGB without scaling or interpolating
|
* YV12 to RGB without scaling or interpolating
|
||||||
*/
|
*/
|
||||||
static inline void RENAME(yuv2rgb32_1)(SwsContext *c, const uint16_t *buf0,
|
static void RENAME(yuv2rgb32_1)(SwsContext *c, const uint16_t *buf0,
|
||||||
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
||||||
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
||||||
const uint16_t *abuf0, uint8_t *dest,
|
const uint16_t *abuf0, uint8_t *dest,
|
||||||
@ -1356,7 +1356,7 @@ static inline void RENAME(yuv2rgb32_1)(SwsContext *c, const uint16_t *buf0,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0,
|
static void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0,
|
||||||
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
||||||
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
||||||
const uint16_t *abuf0, uint8_t *dest,
|
const uint16_t *abuf0, uint8_t *dest,
|
||||||
@ -1394,7 +1394,7 @@ static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(yuv2rgb555_1)(SwsContext *c, const uint16_t *buf0,
|
static void RENAME(yuv2rgb555_1)(SwsContext *c, const uint16_t *buf0,
|
||||||
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
||||||
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
||||||
const uint16_t *abuf0, uint8_t *dest,
|
const uint16_t *abuf0, uint8_t *dest,
|
||||||
@ -1444,7 +1444,7 @@ static inline void RENAME(yuv2rgb555_1)(SwsContext *c, const uint16_t *buf0,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(yuv2rgb565_1)(SwsContext *c, const uint16_t *buf0,
|
static void RENAME(yuv2rgb565_1)(SwsContext *c, const uint16_t *buf0,
|
||||||
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
||||||
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
||||||
const uint16_t *abuf0, uint8_t *dest,
|
const uint16_t *abuf0, uint8_t *dest,
|
||||||
@ -1531,7 +1531,7 @@ static inline void RENAME(yuv2rgb565_1)(SwsContext *c, const uint16_t *buf0,
|
|||||||
"psraw $7, %%mm7 \n\t"
|
"psraw $7, %%mm7 \n\t"
|
||||||
#define YSCALEYUV2PACKED1b(index, c) REAL_YSCALEYUV2PACKED1b(index, c)
|
#define YSCALEYUV2PACKED1b(index, c) REAL_YSCALEYUV2PACKED1b(index, c)
|
||||||
|
|
||||||
static inline void RENAME(yuv2yuyv422_1)(SwsContext *c, const uint16_t *buf0,
|
static void RENAME(yuv2yuyv422_1)(SwsContext *c, const uint16_t *buf0,
|
||||||
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
||||||
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
||||||
const uint16_t *abuf0, uint8_t *dest,
|
const uint16_t *abuf0, uint8_t *dest,
|
||||||
@ -1570,7 +1570,8 @@ static inline void RENAME(yuv2yuyv422_1)(SwsContext *c, const uint16_t *buf0,
|
|||||||
#if !COMPILE_TEMPLATE_MMX2
|
#if !COMPILE_TEMPLATE_MMX2
|
||||||
//FIXME yuy2* can read up to 7 samples too much
|
//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(
|
__asm__ volatile(
|
||||||
"movq "MANGLE(bm01010101)", %%mm2 \n\t"
|
"movq "MANGLE(bm01010101)", %%mm2 \n\t"
|
||||||
@ -1589,7 +1590,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(
|
__asm__ volatile(
|
||||||
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
|
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
|
||||||
@ -1615,7 +1618,9 @@ static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t
|
|||||||
assert(src1 == src2);
|
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(
|
__asm__ volatile(
|
||||||
"mov %0, %%"REG_a" \n\t"
|
"mov %0, %%"REG_a" \n\t"
|
||||||
@ -1641,7 +1646,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
|
/* This is almost identical to the previous, end exists only because
|
||||||
* yuy2ToY/UV)(dst, src+1, ...) would have 100% unaligned accesses. */
|
* 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(
|
__asm__ volatile(
|
||||||
"mov %0, %%"REG_a" \n\t"
|
"mov %0, %%"REG_a" \n\t"
|
||||||
@ -1659,7 +1665,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(
|
__asm__ volatile(
|
||||||
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
|
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
|
||||||
@ -1685,7 +1693,9 @@ static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t
|
|||||||
assert(src1 == src2);
|
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(
|
__asm__ volatile(
|
||||||
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
|
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
|
||||||
@ -1710,7 +1720,7 @@ 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,
|
static av_always_inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2,
|
||||||
const uint8_t *src, int width)
|
const uint8_t *src, int width)
|
||||||
{
|
{
|
||||||
__asm__ volatile(
|
__asm__ volatile(
|
||||||
@ -1736,14 +1746,14 @@ static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV,
|
static void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||||
const uint8_t *src1, const uint8_t *src2,
|
const uint8_t *src1, const uint8_t *src2,
|
||||||
int width, uint32_t *unused)
|
int width, uint32_t *unused)
|
||||||
{
|
{
|
||||||
RENAME(nvXXtoUV)(dstU, dstV, src1, width);
|
RENAME(nvXXtoUV)(dstU, dstV, src1, width);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(nv21ToUV)(uint8_t *dstU, uint8_t *dstV,
|
static void RENAME(nv21ToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||||
const uint8_t *src1, const uint8_t *src2,
|
const uint8_t *src1, const uint8_t *src2,
|
||||||
int width, uint32_t *unused)
|
int width, uint32_t *unused)
|
||||||
{
|
{
|
||||||
@ -1751,7 +1761,8 @@ static inline void RENAME(nv21ToUV)(uint8_t *dstU, uint8_t *dstV,
|
|||||||
}
|
}
|
||||||
#endif /* !COMPILE_TEMPLATE_MMX2 */
|
#endif /* !COMPILE_TEMPLATE_MMX2 */
|
||||||
|
|
||||||
static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, const uint8_t *src, int width, enum PixelFormat srcFormat)
|
static av_always_inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, const uint8_t *src,
|
||||||
|
int width, enum PixelFormat srcFormat)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(srcFormat == PIX_FMT_BGR24) {
|
if(srcFormat == PIX_FMT_BGR24) {
|
||||||
@ -1804,7 +1815,21 @@ static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, const uint8_t *src, int wi
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, int width, enum PixelFormat srcFormat)
|
static void RENAME(bgr24ToY)(uint8_t *dst, const uint8_t *src,
|
||||||
|
int width, uint32_t *unused)
|
||||||
|
{
|
||||||
|
RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_BGR24);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void RENAME(rgb24ToY)(uint8_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)(uint8_t *dstU, uint8_t *dstV,
|
||||||
|
const uint8_t *src, int width,
|
||||||
|
enum PixelFormat srcFormat)
|
||||||
{
|
{
|
||||||
__asm__ volatile(
|
__asm__ volatile(
|
||||||
"movq 24(%4), %%mm6 \n\t"
|
"movq 24(%4), %%mm6 \n\t"
|
||||||
@ -1862,23 +1887,17 @@ static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, const uin
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(bgr24ToY)(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused)
|
static void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||||
{
|
const uint8_t *src1, const uint8_t *src2,
|
||||||
RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_BGR24);
|
int width, uint32_t *unused)
|
||||||
}
|
|
||||||
|
|
||||||
static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_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);
|
RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_BGR24);
|
||||||
assert(src1 == src2);
|
assert(src1 == src2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(rgb24ToY)(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused)
|
static void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||||
{
|
const uint8_t *src1, const uint8_t *src2,
|
||||||
RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24);
|
int width, uint32_t *unused)
|
||||||
}
|
|
||||||
|
|
||||||
static inline void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused)
|
|
||||||
{
|
{
|
||||||
assert(src1==src2);
|
assert(src1==src2);
|
||||||
RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_RGB24);
|
RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_RGB24);
|
||||||
@ -1886,8 +1905,10 @@ static inline void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t
|
|||||||
|
|
||||||
#if !COMPILE_TEMPLATE_MMX2
|
#if !COMPILE_TEMPLATE_MMX2
|
||||||
// bilinear / bicubic scaling
|
// bilinear / bicubic scaling
|
||||||
static inline void RENAME(hScale)(int16_t *dst, int dstW, const uint8_t *src, int srcW, int xInc,
|
static void RENAME(hScale)(int16_t *dst, int dstW,
|
||||||
const int16_t *filter, const int16_t *filterPos, int filterSize)
|
const uint8_t *src, int srcW,
|
||||||
|
int xInc, const int16_t *filter,
|
||||||
|
const int16_t *filterPos, int filterSize)
|
||||||
{
|
{
|
||||||
assert(filterSize % 4 == 0 && filterSize>0);
|
assert(filterSize % 4 == 0 && filterSize>0);
|
||||||
if (filterSize==4) { // Always true for upscaling, sometimes for down, too.
|
if (filterSize==4) { // Always true for upscaling, sometimes for down, too.
|
||||||
@ -2042,9 +2063,9 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, const uint8_t *src, in
|
|||||||
#endif /* !COMPILE_TEMPLATE_MMX2 */
|
#endif /* !COMPILE_TEMPLATE_MMX2 */
|
||||||
|
|
||||||
#if COMPILE_TEMPLATE_MMX2
|
#if COMPILE_TEMPLATE_MMX2
|
||||||
static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
|
static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
|
||||||
int dstWidth, const uint8_t *src, int srcW,
|
int dstWidth, const uint8_t *src,
|
||||||
int xInc)
|
int srcW, int xInc)
|
||||||
{
|
{
|
||||||
int16_t *filterPos = c->hLumFilterPos;
|
int16_t *filterPos = c->hLumFilterPos;
|
||||||
int16_t *filter = c->hLumFilter;
|
int16_t *filter = c->hLumFilter;
|
||||||
@ -2114,7 +2135,7 @@ static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
|
|||||||
dst[i] = src[srcW-1]*128;
|
dst[i] = src[srcW-1]*128;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
|
static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
|
||||||
int dstWidth, const uint8_t *src1,
|
int dstWidth, const uint8_t *src1,
|
||||||
const uint8_t *src2, int srcW, int xInc)
|
const uint8_t *src2, int srcW, int xInc)
|
||||||
{
|
{
|
||||||
@ -2177,7 +2198,7 @@ static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *d
|
|||||||
}
|
}
|
||||||
#endif /* COMPILE_TEMPLATE_MMX2 */
|
#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,
|
enum PixelFormat srcFormat = c->srcFormat,
|
||||||
dstFormat = c->dstFormat;
|
dstFormat = c->dstFormat;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user