libavcodec/x86/dsputilenc_mmx.c File Reference

#include "libavutil/cpu.h"
#include "libavutil/x86_cpu.h"
#include "libavcodec/dsputil.h"
#include "libavcodec/mpegvideo.h"
#include "libavcodec/mathops.h"
#include "dsputil_mmx.h"
#include "dsputil_mmx_qns_template.c"

Go to the source code of this file.

Defines

#define SUM(in0, in1, out0, out1)
#define SUM(in0, in1, out0, out1)
#define SUM(in0, in1, out0, out1)
#define SUM(in0, in1, out0, out1)
#define MMABS_MMX(a, z)
#define MMABS_MMX2(a, z)
#define MMABS_SSSE3(a, z)   "pabsw " #a ", " #a " \n\t"
#define MMABS_SUM(a, z, sum)
#define HSUM_MMX(a, t, dst)
#define HSUM_MMX2(a, t, dst)
#define HSUM_SSE2(a, t, dst)
#define hadamard_func(cpu)
#define DCT_SAD4(m, mm, o)
#define DCT_SAD_MMX
#define DCT_SAD_SSE2
#define DCT_SAD_FUNC(cpu)
#define DCT_SAD   DCT_SAD_MMX
#define HSUM(a, t, dst)   HSUM_MMX(a,t,dst)
#define MMABS(a, z)   MMABS_MMX(a,z)
#define HSUM(a, t, dst)   HSUM_MMX2(a,t,dst)
#define MMABS(a, z)   MMABS_MMX2(a,z)
#define DCT_SAD   DCT_SAD_SSE2
#define HSUM(a, t, dst)   HSUM_SSE2(a,t,dst)
#define PHADDD(a, t)
#define PMULHRW(x, y, s, o)
#define DEF(x)   x ## _mmx
#define SET_RND   MOVQ_WONE
#define SCALE_OFFSET   1
#define DEF(x)   x ## _3dnow
#define SET_RND(x)
#define SCALE_OFFSET   0
#define PMULHRW(x, y, s, o)

Functions

static void get_pixels_mmx (DCTELEM *block, const uint8_t *pixels, int line_size)
static void get_pixels_sse2 (DCTELEM *block, const uint8_t *pixels, int line_size)
static void diff_pixels_mmx (DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride)
static int pix_sum16_mmx (uint8_t *pix, int line_size)
static int pix_norm1_mmx (uint8_t *pix, int line_size)
static int sse8_mmx (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
static int sse16_mmx (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
int ff_sse16_sse2 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
static int hf_noise8_mmx (uint8_t *pix1, int line_size, int h)
static int hf_noise16_mmx (uint8_t *pix1, int line_size, int h)
static int nsse16_mmx (void *p, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
static int nsse8_mmx (void *p, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
static int vsad_intra16_mmx (void *v, uint8_t *pix, uint8_t *dummy, int line_size, int h)
static int vsad_intra16_mmx2 (void *v, uint8_t *pix, uint8_t *dummy, int line_size, int h)
static int vsad16_mmx (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
static int vsad16_mmx2 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
static void diff_bytes_mmx (uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w)
static void sub_hfyu_median_prediction_mmx2 (uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top)
 hadamard_func (mmx)
void ff_dsputilenc_init_mmx (DSPContext *c, AVCodecContext *avctx)


Define Documentation

#define DCT_SAD   DCT_SAD_SSE2

#define DCT_SAD   DCT_SAD_MMX

#define DCT_SAD4 ( m,
mm,
 ) 

Value:

"mov"#m" "#o"+ 0(%1), "#mm"2      \n\t"\
    "mov"#m" "#o"+16(%1), "#mm"3      \n\t"\
    "mov"#m" "#o"+32(%1), "#mm"4      \n\t"\
    "mov"#m" "#o"+48(%1), "#mm"5      \n\t"\
    MMABS_SUM(mm##2, mm##6, mm##0)\
    MMABS_SUM(mm##3, mm##7, mm##1)\
    MMABS_SUM(mm##4, mm##6, mm##0)\
    MMABS_SUM(mm##5, mm##7, mm##1)\

#define DCT_SAD_FUNC ( cpu   ) 

Value:

static int sum_abs_dctelem_##cpu(DCTELEM *block){\
    int sum;\
    __asm__ volatile(\
        DCT_SAD\
        :"=r"(sum)\
        :"r"(block)\
    );\
    return sum&0xFFFF;\
}

Referenced by hadamard_func().

#define DCT_SAD_MMX

Value:

"pxor %%mm0, %%mm0                \n\t"\
    "pxor %%mm1, %%mm1                \n\t"\
    DCT_SAD4(q, %%mm, 0)\
    DCT_SAD4(q, %%mm, 8)\
    DCT_SAD4(q, %%mm, 64)\
    DCT_SAD4(q, %%mm, 72)\
    "paddusw %%mm1, %%mm0             \n\t"\
    HSUM(%%mm0, %%mm1, %0)

#define DCT_SAD_SSE2

Value:

"pxor %%xmm0, %%xmm0              \n\t"\
    "pxor %%xmm1, %%xmm1              \n\t"\
    DCT_SAD4(dqa, %%xmm, 0)\
    DCT_SAD4(dqa, %%xmm, 64)\
    "paddusw %%xmm1, %%xmm0           \n\t"\
    HSUM(%%xmm0, %%xmm1, %0)

#define DEF (  )     x ## _3dnow

Definition at line 1063 of file dsputilenc_mmx.c.

#define DEF (  )     x ## _mmx

Definition at line 1063 of file dsputilenc_mmx.c.

#define hadamard_func ( cpu   ) 

Value:

int ff_hadamard8_diff_##cpu  (void *s, uint8_t *src1, uint8_t *src2, \
                              int stride, int h); \
int ff_hadamard8_diff16_##cpu(void *s, uint8_t *src1, uint8_t *src2, \
                              int stride, int h);

Definition at line 929 of file dsputilenc_mmx.c.

#define HSUM ( a,
t,
dst   )     HSUM_SSE2(a,t,dst)

#define HSUM ( a,
t,
dst   )     HSUM_MMX2(a,t,dst)

#define HSUM ( a,
t,
dst   )     HSUM_MMX(a,t,dst)

#define HSUM_MMX ( a,
t,
dst   ) 

Value:

"movq "#a", "#t"                  \n\t"\
    "psrlq $32, "#a"                  \n\t"\
    "paddusw "#t", "#a"               \n\t"\
    "movq "#a", "#t"                  \n\t"\
    "psrlq $16, "#a"                  \n\t"\
    "paddusw "#t", "#a"               \n\t"\
    "movd "#a", "#dst"                \n\t"\

Definition at line 904 of file dsputilenc_mmx.c.

#define HSUM_MMX2 ( a,
t,
dst   ) 

Value:

"pshufw $0x0E, "#a", "#t"         \n\t"\
    "paddusw "#t", "#a"               \n\t"\
    "pshufw $0x01, "#a", "#t"         \n\t"\
    "paddusw "#t", "#a"               \n\t"\
    "movd "#a", "#dst"                \n\t"\

Definition at line 913 of file dsputilenc_mmx.c.

#define HSUM_SSE2 ( a,
t,
dst   ) 

Value:

"movhlps "#a", "#t"               \n\t"\
    "paddusw "#t", "#a"               \n\t"\
    "pshuflw $0x0E, "#a", "#t"        \n\t"\
    "paddusw "#t", "#a"               \n\t"\
    "pshuflw $0x01, "#a", "#t"        \n\t"\
    "paddusw "#t", "#a"               \n\t"\
    "movd "#a", "#dst"                \n\t"\

Definition at line 920 of file dsputilenc_mmx.c.

#define MMABS ( a,
 )     MMABS_MMX2(a,z)

#define MMABS ( a,
 )     MMABS_MMX(a,z)

#define MMABS_MMX ( a,
 ) 

Value:

"pxor " #z ", " #z "              \n\t"\
    "pcmpgtw " #a ", " #z "           \n\t"\
    "pxor " #z ", " #a "              \n\t"\
    "psubw " #z ", " #a "             \n\t"

Definition at line 883 of file dsputilenc_mmx.c.

#define MMABS_MMX2 ( a,
 ) 

Value:

"pxor " #z ", " #z "              \n\t"\
    "psubw " #a ", " #z "             \n\t"\
    "pmaxsw " #z ", " #a "            \n\t"

Definition at line 889 of file dsputilenc_mmx.c.

#define MMABS_SSSE3 ( a,
 )     "pabsw " #a ", " #a " \n\t"

Definition at line 894 of file dsputilenc_mmx.c.

#define MMABS_SUM ( a,
z,
sum   ) 

Value:

MMABS(a,z)\
    "paddusw " #a ", " #sum "         \n\t"

Definition at line 897 of file dsputilenc_mmx.c.

#define PHADDD ( a,
t   ) 

Value:

"movq "#a", "#t"                  \n\t"\
    "psrlq $32, "#a"                  \n\t"\
    "paddd "#t", "#a"                 \n\t"

Definition at line 1036 of file dsputilenc_mmx.c.

Referenced by try_8x8basis_TMPL().

#define PMULHRW ( x,
y,
s,
 ) 

Value:

"pmulhrw " #s ", "#x "           \n\t"\
    "pmulhrw " #s ", "#y "           \n\t"

Definition at line 1066 of file dsputilenc_mmx.c.

#define PMULHRW ( x,
y,
s,
 ) 

Value:

"pmulhw " #s ", "#x "            \n\t"\
    "pmulhw " #s ", "#y "            \n\t"\
    "paddw " #o ", "#x "             \n\t"\
    "paddw " #o ", "#y "             \n\t"\
    "psraw $1, "#x "                 \n\t"\
    "psraw $1, "#y "                 \n\t"

Definition at line 1066 of file dsputilenc_mmx.c.

Referenced by add_8x8basis_TMPL(), and try_8x8basis_TMPL().

#define SCALE_OFFSET   0

Definition at line 1065 of file dsputilenc_mmx.c.

#define SCALE_OFFSET   1

Definition at line 1065 of file dsputilenc_mmx.c.

Referenced by add_8x8basis_TMPL(), and try_8x8basis_TMPL().

#define SET_RND (  ) 

Definition at line 1064 of file dsputilenc_mmx.c.

#define SET_RND   MOVQ_WONE

Definition at line 1064 of file dsputilenc_mmx.c.

#define SUM ( in0,
in1,
out0,
out1   ) 

Value:

"movq (%0)," #out0 "\n"\
      "movq (%1),%%mm2\n"\
      "movq 8(%0)," #out1 "\n"\
      "movq 8(%1),%%mm3\n"\
      "add %3,%0\n"\
      "add %3,%1\n"\
      "psubb %%mm2, " #out0 "\n"\
      "psubb %%mm3, " #out1 "\n"\
      "pxor %%mm7, " #out0 "\n"\
      "pxor %%mm7, " #out1 "\n"\
      "psadbw " #out0 ", " #in0 "\n"\
      "psadbw " #out1 ", " #in1 "\n"\
      "paddw " #in1 ", " #in0 "\n"\
      "paddw " #in0 ", %%mm6\n"

#define SUM ( in0,
in1,
out0,
out1   ) 

Value:

"movq (%0),%%mm2\n"\
      "movq (%1)," #out0 "\n"\
      "movq 8(%0),%%mm3\n"\
      "movq 8(%1)," #out1 "\n"\
      "add %3,%0\n"\
      "add %3,%1\n"\
      "psubb " #out0 ", %%mm2\n"\
      "psubb " #out1 ", %%mm3\n"\
      "pxor %%mm7, %%mm2\n"\
      "pxor %%mm7, %%mm3\n"\
      "movq %%mm2, " #out0 "\n"\
      "movq %%mm3, " #out1 "\n"\
      "psubusb " #in0 ", %%mm2\n"\
      "psubusb " #in1 ", %%mm3\n"\
      "psubusb " #out0 ", " #in0 "\n"\
      "psubusb " #out1 ", " #in1 "\n"\
      "por %%mm2, " #in0 "\n"\
      "por %%mm3, " #in1 "\n"\
      "movq " #in0 ", %%mm2\n"\
      "movq " #in1 ", %%mm3\n"\
      "punpcklbw %%mm7, " #in0 "\n"\
      "punpcklbw %%mm7, " #in1 "\n"\
      "punpckhbw %%mm7, %%mm2\n"\
      "punpckhbw %%mm7, %%mm3\n"\
      "paddw " #in1 ", " #in0 "\n"\
      "paddw %%mm3, %%mm2\n"\
      "paddw %%mm2, " #in0 "\n"\
      "paddw " #in0 ", %%mm6\n"

#define SUM ( in0,
in1,
out0,
out1   ) 

Value:

"movq (%0), " #out0 "\n"\
      "movq 8(%0), " #out1 "\n"\
      "add %2,%0\n"\
      "psadbw " #out0 ", " #in0 "\n"\
      "psadbw " #out1 ", " #in1 "\n"\
      "paddw " #in1 ", " #in0 "\n"\
      "paddw " #in0 ", %%mm6\n"

#define SUM ( in0,
in1,
out0,
out1   ) 

Value:

"movq (%0), %%mm2\n"\
      "movq 8(%0), %%mm3\n"\
      "add %2,%0\n"\
      "movq %%mm2, " #out0 "\n"\
      "movq %%mm3, " #out1 "\n"\
      "psubusb " #in0 ", %%mm2\n"\
      "psubusb " #in1 ", %%mm3\n"\
      "psubusb " #out0 ", " #in0 "\n"\
      "psubusb " #out1 ", " #in1 "\n"\
      "por %%mm2, " #in0 "\n"\
      "por %%mm3, " #in1 "\n"\
      "movq " #in0 ", %%mm2\n"\
      "movq " #in1 ", %%mm3\n"\
      "punpcklbw %%mm7, " #in0 "\n"\
      "punpcklbw %%mm7, " #in1 "\n"\
      "punpckhbw %%mm7, %%mm2\n"\
      "punpckhbw %%mm7, %%mm3\n"\
      "paddw " #in1 ", " #in0 "\n"\
      "paddw %%mm3, %%mm2\n"\
      "paddw %%mm2, " #in0 "\n"\
      "paddw " #in0 ", %%mm6\n"

Referenced by vsad16_mmx(), vsad16_mmx2(), vsad_intra16_mmx(), and vsad_intra16_mmx2().


Function Documentation

static void diff_bytes_mmx ( uint8_t dst,
const uint8_t src1,
const uint8_t src2,
int  w 
) [static]

Definition at line 824 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

static void diff_pixels_mmx ( DCTELEM block,
const uint8_t s1,
const uint8_t s2,
int  stride 
) [inline, static]

Definition at line 95 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

void ff_dsputilenc_init_mmx ( DSPContext c,
AVCodecContext avctx 
)

Definition at line 1099 of file dsputilenc_mmx.c.

Referenced by ff_dsputil_init_mmx().

int ff_sse16_sse2 ( void *  v,
uint8_t pix1,
uint8_t pix2,
int  line_size,
int  h 
)

Referenced by ff_dsputilenc_init_mmx().

static void get_pixels_mmx ( DCTELEM block,
const uint8_t pixels,
int  line_size 
) [static]

Definition at line 33 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

static void get_pixels_sse2 ( DCTELEM block,
const uint8_t pixels,
int  line_size 
) [static]

Definition at line 61 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

hadamard_func ( mmx   ) 

Definition at line 935 of file dsputilenc_mmx.c.

static int hf_noise16_mmx ( uint8_t pix1,
int  line_size,
int  h 
) [static]

Definition at line 453 of file dsputilenc_mmx.c.

Referenced by nsse16_mmx().

static int hf_noise8_mmx ( uint8_t pix1,
int  line_size,
int  h 
) [static]

Definition at line 328 of file dsputilenc_mmx.c.

Referenced by hf_noise16_mmx(), and nsse8_mmx().

static int nsse16_mmx ( void *  p,
uint8_t pix1,
uint8_t pix2,
int  line_size,
int  h 
) [static]

Definition at line 567 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

static int nsse8_mmx ( void *  p,
uint8_t pix1,
uint8_t pix2,
int  line_size,
int  h 
) [static]

Definition at line 579 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

static int pix_norm1_mmx ( uint8_t pix,
int  line_size 
) [static]

Definition at line 162 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

static int pix_sum16_mmx ( uint8_t pix,
int  line_size 
) [static]

Definition at line 124 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

static int sse16_mmx ( void *  v,
uint8_t pix1,
uint8_t pix2,
int  line_size,
int  h 
) [static]

Definition at line 266 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx(), and nsse16_mmx().

static int sse8_mmx ( void *  v,
uint8_t pix1,
uint8_t pix2,
int  line_size,
int  h 
) [static]

Definition at line 205 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx(), and nsse8_mmx().

static void sub_hfyu_median_prediction_mmx2 ( uint8_t dst,
const uint8_t src1,
const uint8_t src2,
int  w,
int *  left,
int *  left_top 
) [static]

Definition at line 847 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

static int vsad16_mmx ( void *  v,
uint8_t pix1,
uint8_t pix2,
int  line_size,
int  h 
) [static]

Definition at line 689 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

static int vsad16_mmx2 ( void *  v,
uint8_t pix1,
uint8_t pix2,
int  line_size,
int  h 
) [static]

Definition at line 767 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

static int vsad_intra16_mmx ( void *  v,
uint8_t pix,
uint8_t dummy,
int  line_size,
int  h 
) [static]

Definition at line 588 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().

static int vsad_intra16_mmx2 ( void *  v,
uint8_t pix,
uint8_t dummy,
int  line_size,
int  h 
) [static]

Definition at line 649 of file dsputilenc_mmx.c.

Referenced by ff_dsputilenc_init_mmx().


Generated on Fri Oct 26 02:47:59 2012 for FFmpeg by  doxygen 1.5.8