summaryrefslogtreecommitdiff
path: root/libswscale/x86/swscale_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-06-09 04:47:19 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-06-09 04:47:19 +0200
commitf9ecb849ef39bc337d9439b829fe08da5c95cc3d (patch)
tree761e860a10084d8de4f07815911f697fe11610b9 /libswscale/x86/swscale_template.c
parent7b8ed831eb8432d202dad16dedc1758b018bb1fa (diff)
parenta71bcd1a7f66e210971c44452dc4cdae7bdbd98a (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: crypto: Use av_freep instead of av_free lavf: don't try to free private options if priv_data is NULL. swscale: fix types of assembly arguments. swscale: move two macros that are only used once into caller. swscale: remove unused function. options: Add missing braces around struct initializer. mov: Remove leftover crufty debug statement with references to a local file. dvbsubdec: Fix compilation of debug code. Remove all uses of now deprecated metadata functions. Move metadata API from lavf to lavu. Conflicts: doc/APIchanges libavformat/aiffdec.c libavformat/asfdec.c libavformat/avformat.h libavformat/avidec.c libavformat/cafdec.c libavformat/matroskaenc.c libavformat/mov.c libavformat/mp3enc.c libavformat/wtv.c libavutil/avutil.h libavutil/internal.h 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.c68
1 files changed, 31 insertions, 37 deletions
diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c
index 27cb41c4c4..eaad94599f 100644
--- a/libswscale/x86/swscale_template.c
+++ b/libswscale/x86/swscale_template.c
@@ -180,19 +180,6 @@ static inline void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter,
YSCALEYUV2YV12X_ACCURATE(LUM_MMX_FILTER_OFFSET, dest, dstW, 0)
}
-#define YSCALEYUV2YV121 \
- "mov %2, %%"REG_a" \n\t"\
- ".p2align 4 \n\t" /* FIXME Unroll? */\
- "1: \n\t"\
- "movq (%0, %%"REG_a", 2), %%mm0 \n\t"\
- "movq 8(%0, %%"REG_a", 2), %%mm1 \n\t"\
- "psraw $7, %%mm0 \n\t"\
- "psraw $7, %%mm1 \n\t"\
- "packuswb %%mm1, %%mm0 \n\t"\
- MOVNTQ(%%mm0, (%1, %%REGa))\
- "add $8, %%"REG_a" \n\t"\
- "jnc 1b \n\t"
-
static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc,
const int16_t *chrUSrc, const int16_t *chrVSrc,
const int16_t *alpSrc,
@@ -208,32 +195,25 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc,
while (p--) {
if (dst[p]) {
__asm__ volatile(
- YSCALEYUV2YV121
- :: "r" (src[p]), "r" (dst[p] + counter[p]),
- "g" (-counter[p])
- : "%"REG_a
+ "mov %2, %%"REG_a" \n\t"
+ ".p2align 4 \n\t" /* FIXME Unroll? */
+ "1: \n\t"
+ "movq (%0, %%"REG_a", 2), %%mm0 \n\t"
+ "movq 8(%0, %%"REG_a", 2), %%mm1 \n\t"
+ "psraw $7, %%mm0 \n\t"
+ "psraw $7, %%mm1 \n\t"
+ "packuswb %%mm1, %%mm0 \n\t"
+ MOVNTQ(%%mm0, (%1, %%REGa))
+ "add $8, %%"REG_a" \n\t"
+ "jnc 1b \n\t"
+ :: "r" (src[p]), "r" (dst[p] + counter[p]),
+ "g" (-counter[p])
+ : "%"REG_a
);
}
}
}
-#define YSCALEYUV2YV121_ACCURATE \
- "mov %2, %%"REG_a" \n\t"\
- "movq 0(%3), %%mm6 \n\t"\
- "movq 8(%3), %%mm7 \n\t"\
- ".p2align 4 \n\t" /* FIXME Unroll? */\
- "1: \n\t"\
- "movq (%0, %%"REG_a", 2), %%mm0 \n\t"\
- "movq 8(%0, %%"REG_a", 2), %%mm1 \n\t"\
- "paddsw %%mm6, %%mm0 \n\t"\
- "paddsw %%mm7, %%mm1 \n\t"\
- "psraw $7, %%mm0 \n\t"\
- "psraw $7, %%mm1 \n\t"\
- "packuswb %%mm1, %%mm0 \n\t"\
- MOVNTQ(%%mm0, (%1, %%REGa))\
- "add $8, %%"REG_a" \n\t"\
- "jnc 1b \n\t"
-
static inline void RENAME(yuv2yuv1_ar)(SwsContext *c, const int16_t *lumSrc,
const int16_t *chrUSrc, const int16_t *chrVSrc,
const int16_t *alpSrc,
@@ -251,7 +231,21 @@ static inline void RENAME(yuv2yuv1_ar)(SwsContext *c, const int16_t *lumSrc,
int i;
for(i=0; i<8; i++) c->dither16[i] = i<2 ? lumDither[i] : chrDither[i];
__asm__ volatile(
- YSCALEYUV2YV121_ACCURATE
+ "mov %2, %%"REG_a" \n\t"
+ "movq 0(%3), %%mm6 \n\t"
+ "movq 8(%3), %%mm7 \n\t"
+ ".p2align 4 \n\t" /* FIXME Unroll? */
+ "1: \n\t"
+ "movq (%0, %%"REG_a", 2), %%mm0 \n\t"
+ "movq 8(%0, %%"REG_a", 2), %%mm1 \n\t"
+ "paddsw %%mm6, %%mm0 \n\t"
+ "paddsw %%mm7, %%mm1 \n\t"
+ "psraw $7, %%mm0 \n\t"
+ "psraw $7, %%mm1 \n\t"
+ "packuswb %%mm1, %%mm0 \n\t"
+ MOVNTQ(%%mm0, (%1, %%REGa))
+ "add $8, %%"REG_a" \n\t"
+ "jnc 1b \n\t"
:: "r" (src[p]), "r" (dst[p] + counter[p]),
"g" (-counter[p]), "r"(c->dither16)
: "%"REG_a
@@ -2218,7 +2212,7 @@ static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
int dstWidth, const uint8_t *src, int srcW,
int xInc)
{
- int32_t *filterPos = c->hLumFilterPos;
+ int16_t *filterPos = c->hLumFilterPos;
int16_t *filter = c->hLumFilter;
void *mmx2FilterCode= c->lumMmx2FilterCode;
int i;
@@ -2290,7 +2284,7 @@ static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *d
int dstWidth, const uint8_t *src1,
const uint8_t *src2, int srcW, int xInc)
{
- int32_t *filterPos = c->hChrFilterPos;
+ int16_t *filterPos = c->hChrFilterPos;
int16_t *filter = c->hChrFilter;
void *mmx2FilterCode= c->chrMmx2FilterCode;
int i;