summaryrefslogtreecommitdiff
path: root/libavcodec/x86/dsputil_mmx.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-06 13:23:05 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-06 13:45:08 +0200
commit55c49afc42abae64e5ab25e04bc3c09b17c5b6d5 (patch)
tree3e56007e0d3039ee6aa91e0e87b9abc14a49bf94 /libavcodec/x86/dsputil_mmx.c
parent886c3662d308e97316a606732574f0e87b1cbe3a (diff)
parentd3a72becc6371563185a509b94f5daf32ddbb485 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: yuv4mpeg: return proper error codes. Give all anonymously typedeffed structs in headers a name fate: Add parseutils test parseutils-test: Drop random colors from parsing test vf_pad/scale: use double precision for aspect ratios. build: error on variable-length arrays ppc: swscale: rework yuv2planeX_altivec() ppc: fmtconvert: kill VLA in float_to_int16_interleave_altivec() x86: dsputil: kill VLA in gmc_mmx() libspeexenc: Updated commentary to reflect recent changes libspeexenc: Add an option for enabling DTX doc/APIchanges: fill in missing dates and hashes. lavr: bump major to 1 and declare it stable. lavr: change the type of the data buffers to uint8_t**. lavc: deprecate the audio resampling API. Conflicts: cmdutils.h configure doc/APIchanges ffplay.c libavcodec/dwt.h libavcodec/libspeexenc.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavformat/asf.h tests/fate/libavutil.mak tests/ref/fate/parseutils Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86/dsputil_mmx.c')
-rw-r--r--libavcodec/x86/dsputil_mmx.c58
1 files changed, 7 insertions, 51 deletions
diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
index c36a027229..f608f661dd 100644
--- a/libavcodec/x86/dsputil_mmx.c
+++ b/libavcodec/x86/dsputil_mmx.c
@@ -1929,15 +1929,10 @@ static av_noinline void emulated_edge_mc_sse(uint8_t *buf, const uint8_t *src,
#if HAVE_INLINE_ASM
-typedef void emulated_edge_mc_func(uint8_t *dst, const uint8_t *src,
- int linesize, int block_w, int block_h,
- int src_x, int src_y, int w, int h);
-
-static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
- int stride, int h, int ox, int oy,
- int dxx, int dxy, int dyx, int dyy,
- int shift, int r, int width, int height,
- emulated_edge_mc_func *emu_edge_fn)
+static void gmc_mmx(uint8_t *dst, uint8_t *src,
+ int stride, int h, int ox, int oy,
+ int dxx, int dxy, int dyx, int dyy,
+ int shift, int r, int width, int height)
{
const int w = 8;
const int ix = ox >> (16 + shift);
@@ -1952,7 +1947,6 @@ static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
const uint16_t dxy4[4] = { dxys, dxys, dxys, dxys };
const uint16_t dyy4[4] = { dyys, dyys, dyys, dyys };
const uint64_t shift2 = 2 * shift;
- uint8_t edge_buf[(h + 1) * stride];
int x, y;
const int dxw = (dxx - (1 << (16 + shift))) * (w - 1);
@@ -1963,7 +1957,9 @@ static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
((ox ^ (ox + dxw)) | (ox ^ (ox + dxh)) | (ox ^ (ox + dxw + dxh)) |
(oy ^ (oy + dyw)) | (oy ^ (oy + dyh)) | (oy ^ (oy + dyw + dyh))) >> (16 + shift)
// uses more than 16 bits of subpel mv (only at huge resolution)
- || (dxx | dxy | dyx | dyy) & 15) {
+ || (dxx | dxy | dyx | dyy) & 15 ||
+ (unsigned)ix >= width - w ||
+ (unsigned)iy >= height - h) {
// FIXME could still use mmx for some of the rows
ff_gmc_c(dst, src, stride, h, ox, oy, dxx, dxy, dyx, dyy,
shift, r, width, height);
@@ -1971,11 +1967,6 @@ static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
}
src += ix + iy * stride;
- if ((unsigned)ix >= width - w ||
- (unsigned)iy >= height - h) {
- emu_edge_fn(edge_buf, src, stride, w + 1, h + 1, ix, iy, width, height);
- src = edge_buf;
- }
__asm__ volatile (
"movd %0, %%mm6 \n\t"
@@ -2054,36 +2045,6 @@ static av_always_inline void gmc(uint8_t *dst, uint8_t *src,
}
}
-#if HAVE_YASM
-#if ARCH_X86_32
-static void gmc_mmx(uint8_t *dst, uint8_t *src,
- int stride, int h, int ox, int oy,
- int dxx, int dxy, int dyx, int dyy,
- int shift, int r, int width, int height)
-{
- gmc(dst, src, stride, h, ox, oy, dxx, dxy, dyx, dyy, shift, r,
- width, height, &emulated_edge_mc_mmx);
-}
-#endif
-static void gmc_sse(uint8_t *dst, uint8_t *src,
- int stride, int h, int ox, int oy,
- int dxx, int dxy, int dyx, int dyy,
- int shift, int r, int width, int height)
-{
- gmc(dst, src, stride, h, ox, oy, dxx, dxy, dyx, dyy, shift, r,
- width, height, &emulated_edge_mc_sse);
-}
-#else
-static void gmc_mmx(uint8_t *dst, uint8_t *src,
- int stride, int h, int ox, int oy,
- int dxx, int dxy, int dyx, int dyy,
- int shift, int r, int width, int height)
-{
- gmc(dst, src, stride, h, ox, oy, dxx, dxy, dyx, dyy, shift, r,
- width, height, &ff_emulated_edge_mc_8);
-}
-#endif
-
#define PREFETCH(name, op) \
static void name(void *mem, int stride, int h) \
{ \
@@ -2584,9 +2545,7 @@ static void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx, int mm_flags)
SET_HPEL_FUNCS(avg_no_rnd, 1, 8, mmx);
}
-#if ARCH_X86_32 || !HAVE_YASM
c->gmc = gmc_mmx;
-#endif
c->add_bytes = add_bytes_mmx;
@@ -2841,9 +2800,6 @@ static void dsputil_init_sse(DSPContext *c, AVCodecContext *avctx, int mm_flags)
if (!high_bit_depth)
c->emulated_edge_mc = emulated_edge_mc_sse;
-#if HAVE_INLINE_ASM
- c->gmc = gmc_sse;
-#endif
#endif /* HAVE_YASM */
}