FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
resample_mmx.h File Reference
#include "libavutil/x86/asm.h"
#include "libavutil/cpu.h"
#include "libswresample/swresample_internal.h"

Go to the source code of this file.

Macros

#define COMMON_CORE_INT16_MMX2
 
#define LINEAR_CORE_INT16_MMX2
 
#define COMMON_CORE_INT16_SSE2
 
#define LINEAR_CORE_INT16_SSE2
 
#define COMMON_CORE_FLT_SSE
 
#define LINEAR_CORE_FLT_SSE
 

Functions

int swri_resample_int16_mmx2 (struct ResampleContext *c, int16_t *dst, const int16_t *src, int *consumed, int src_size, int dst_size, int update_ctx)
 
int swri_resample_int16_sse2 (struct ResampleContext *c, int16_t *dst, const int16_t *src, int *consumed, int src_size, int dst_size, int update_ctx)
 
int swri_resample_float_sse (struct ResampleContext *c, float *dst, const float *src, int *consumed, int src_size, int dst_size, int update_ctx)
 

Variables

const uint64_t ff_resample_int16_rounder [2] = { 0x0000000000004000ULL, 0x0000000000000000ULL}
 

Macro Definition Documentation

#define COMMON_CORE_INT16_MMX2
Value:
x86_reg len= -2*c->filter_length;\
__asm__ volatile(\
"movq "MANGLE(ff_resample_int16_rounder)", %%mm0 \n\t"\
"1: \n\t"\
"movq (%1, %0), %%mm1 \n\t"\
"pmaddwd (%2, %0), %%mm1 \n\t"\
"paddd %%mm1, %%mm0 \n\t"\
"add $8, %0 \n\t"\
" js 1b \n\t"\
"pshufw $0x0E, %%mm0, %%mm1 \n\t"\
"paddd %%mm1, %%mm0 \n\t"\
"psrad $15, %%mm0 \n\t"\
"packssdw %%mm0, %%mm0 \n\t"\
"movd %%mm0, (%3) \n\t"\
: "+r" (len)\
: "r" (((uint8_t*)(src+sample_index))-len),\
"r" (((uint8_t*)filter)-len),\
"r" (dst+dst_index)\
NAMED_CONSTRAINTS_ADD(ff_resample_int16_rounder)\
);

Definition at line 31 of file resample_mmx.h.

#define LINEAR_CORE_INT16_MMX2
Value:
x86_reg len= -2*c->filter_length;\
__asm__ volatile(\
"pxor %%mm0, %%mm0 \n\t"\
"pxor %%mm2, %%mm2 \n\t"\
"1: \n\t"\
"movq (%3, %0), %%mm1 \n\t"\
"movq %%mm1, %%mm3 \n\t"\
"pmaddwd (%4, %0), %%mm1 \n\t"\
"pmaddwd (%5, %0), %%mm3 \n\t"\
"paddd %%mm1, %%mm0 \n\t"\
"paddd %%mm3, %%mm2 \n\t"\
"add $8, %0 \n\t"\
" js 1b \n\t"\
"pshufw $0x0E, %%mm0, %%mm1 \n\t"\
"pshufw $0x0E, %%mm2, %%mm3 \n\t"\
"paddd %%mm1, %%mm0 \n\t"\
"paddd %%mm3, %%mm2 \n\t"\
"movd %%mm0, %1 \n\t"\
"movd %%mm2, %2 \n\t"\
: "+r" (len),\
"=r" (val),\
"=r" (v2)\
: "r" (((uint8_t*)(src+sample_index))-len),\
"r" (((uint8_t*)filter)-len),\
"r" (((uint8_t*)(filter+c->filter_alloc))-len)\
);

Definition at line 53 of file resample_mmx.h.

#define COMMON_CORE_INT16_SSE2
Value:
x86_reg len= -2*c->filter_length;\
__asm__ volatile(\
"movdqa "MANGLE(ff_resample_int16_rounder)", %%xmm0 \n\t"\
"1: \n\t"\
"movdqu (%1, %0), %%xmm1 \n\t"\
"pmaddwd (%2, %0), %%xmm1 \n\t"\
"paddd %%xmm1, %%xmm0 \n\t"\
"add $16, %0 \n\t"\
" js 1b \n\t"\
"pshufd $0x0E, %%xmm0, %%xmm1 \n\t"\
"paddd %%xmm1, %%xmm0 \n\t"\
"pshufd $0x01, %%xmm0, %%xmm1 \n\t"\
"paddd %%xmm1, %%xmm0 \n\t"\
"psrad $15, %%xmm0 \n\t"\
"packssdw %%xmm0, %%xmm0 \n\t"\
"movd %%xmm0, (%3) \n\t"\
: "+r" (len)\
: "r" (((uint8_t*)(src+sample_index))-len),\
"r" (((uint8_t*)filter)-len),\
"r" (dst+dst_index)\
NAMED_CONSTRAINTS_ADD(ff_resample_int16_rounder)\
);

Definition at line 81 of file resample_mmx.h.

#define LINEAR_CORE_INT16_SSE2

Definition at line 105 of file resample_mmx.h.

#define COMMON_CORE_FLT_SSE
Value:
x86_reg len= -4*c->filter_length;\
__asm__ volatile(\
"xorps %%xmm0, %%xmm0 \n\t"\
"1: \n\t"\
"movups (%1, %0), %%xmm1 \n\t"\
"mulps (%2, %0), %%xmm1 \n\t"\
"addps %%xmm1, %%xmm0 \n\t"\
"add $16, %0 \n\t"\
" js 1b \n\t"\
"movhlps %%xmm0, %%xmm1 \n\t"\
"addps %%xmm1, %%xmm0 \n\t"\
"movss %%xmm0, %%xmm1 \n\t"\
"shufps $1, %%xmm0, %%xmm0 \n\t"\
"addps %%xmm1, %%xmm0 \n\t"\
"movss %%xmm0, (%3) \n\t"\
: "+r" (len)\
: "r" (((uint8_t*)(src+sample_index))-len),\
"r" (((uint8_t*)filter)-len),\
"r" (dst+dst_index)\
);

Definition at line 138 of file resample_mmx.h.

#define LINEAR_CORE_FLT_SSE

Definition at line 160 of file resample_mmx.h.

Function Documentation

int swri_resample_int16_mmx2 ( struct ResampleContext c,
int16_t *  dst,
const int16_t *  src,
int *  consumed,
int  src_size,
int  dst_size,
int  update_ctx 
)

Referenced by multiple_resample().

int swri_resample_int16_sse2 ( struct ResampleContext c,
int16_t *  dst,
const int16_t *  src,
int *  consumed,
int  src_size,
int  dst_size,
int  update_ctx 
)

Referenced by multiple_resample().

int swri_resample_float_sse ( struct ResampleContext c,
float *  dst,
const float *  src,
int *  consumed,
int  src_size,
int  dst_size,
int  update_ctx 
)

Referenced by multiple_resample().

Variable Documentation

const uint64_t ff_resample_int16_rounder[2] = { 0x0000000000004000ULL, 0x0000000000000000ULL}

Definition at line 29 of file resample_mmx.h.