37#define SCALE_OFFSET -1
41static int try_8x8basis_ssse3(
const int16_t rem[64],
const int16_t
weight[64],
const int16_t
basis[64],
int scale)
49 "pxor %%xmm2, %%xmm2 \n\t"
50 "movd %4, %%xmm3 \n\t"
51 "punpcklwd %%xmm3, %%xmm3 \n\t"
52 "pshufd $0, %%xmm3, %%xmm3 \n\t"
55 "movdqa (%1, %0), %%xmm0 \n\t"
56 "movdqa 16(%1, %0), %%xmm1 \n\t"
57 "pmulhrsw %%xmm3, %%xmm0 \n\t"
58 "pmulhrsw %%xmm3, %%xmm1 \n\t"
59 "paddw (%2, %0), %%xmm0 \n\t"
60 "paddw 16(%2, %0), %%xmm1 \n\t"
61 "psraw $6, %%xmm0 \n\t"
62 "psraw $6, %%xmm1 \n\t"
63 "pmullw (%3, %0), %%xmm0 \n\t"
64 "pmullw 16(%3, %0), %%xmm1 \n\t"
65 "pmaddwd %%xmm0, %%xmm0 \n\t"
66 "pmaddwd %%xmm1, %%xmm1 \n\t"
67 "paddd %%xmm1, %%xmm0 \n\t"
68 "psrld $4, %%xmm0 \n\t"
69 "paddd %%xmm0, %%xmm2 \n\t"
73 "pshufd $0x0E, %%xmm2, %%xmm0 \n\t"
74 "paddd %%xmm0, %%xmm2 \n\t"
75 "pshufd $0x01, %%xmm2, %%xmm0 \n\t"
76 "paddd %%xmm0, %%xmm2 \n\t"
77 "psrld $2, %%xmm2 \n\t"
78 "movd %%xmm2, %0 \n\t"
87static void draw_edges_ssse3(uint8_t *buf, ptrdiff_t
wrap,
int width,
int height,
88 int w,
int h,
int sides)
90 uint8_t *ptr = buf, *last_line;
97 "pcmpeqw %%xmm3, %%xmm3 \n\t"
98 "pxor %%xmm2, %%xmm2 \n\t"
99 "psrlw $14, %%xmm3 \n\t"
100 "pshufb %%xmm2, %%xmm3 \n\t"
105 "movd (%0), %%xmm0 \n\t"
106 "movd -4(%0, %2), %%xmm1 \n\t"
107 "pshufb %%xmm2, %%xmm0 \n\t"
108 "pshufb %%xmm3, %%xmm1 \n\t"
109 "movq %%xmm0, -8(%0) \n\t"
110 "movq %%xmm1, (%0, %2) \n\t"
116 "movd (%0), %%xmm0 \n\t"
117 "movd -4(%0, %2), %%xmm1 \n\t"
118 "pshufb %%xmm2, %%xmm0 \n\t"
119 "pshufb %%xmm3, %%xmm1 \n\t"
120 "movd %%xmm0, -4(%0) \n\t"
121 "movd %%xmm1, (%0, %2) \n\t"
127 "movd (%0), %%xmm0 \n\t"
128 "movd -4(%0, %2), %%xmm1 \n\t"
129 "pshufb %%xmm2, %%xmm0 \n\t"
130 "pshufb %%xmm3, %%xmm1 \n\t"
131 "movdqu %%xmm0, -16(%0) \n\t"
132 "movdqu %%xmm1, (%0, %2) \n\t"
146 for (
i = 0;
i <
h;
i++)
150 for (
i = 0;
i <
h;
i++)
152 memcpy(last_line + (
i + 1) *
wrap, last_line,
width +
w +
w);
174 c->try_8x8basis = try_8x8basis_ssse3;
177 c->draw_edges = draw_edges_ssse3;
180#if HAVE_SSSE3_EXTERNAL
#define XMM_CLOBBERS_ONLY(...)
__asm__(".macro parse_r var r\n\t" "\\var = -1\n\t" _IFC_REG(0) _IFC_REG(1) _IFC_REG(2) _IFC_REG(3) _IFC_REG(4) _IFC_REG(5) _IFC_REG(6) _IFC_REG(7) _IFC_REG(8) _IFC_REG(9) _IFC_REG(10) _IFC_REG(11) _IFC_REG(12) _IFC_REG(13) _IFC_REG(14) _IFC_REG(15) _IFC_REG(16) _IFC_REG(17) _IFC_REG(18) _IFC_REG(19) _IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23) _IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27) _IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31) ".iflt \\var\n\t" ".error \"Unable to parse register name \\r\"\n\t" ".endif\n\t" ".endm")
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
Libavcodec external API header.
#define i(width, name, range_min, range_max)
common internal and external API header
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
static void scale(int *out, const int *in, const int w, const int h, const int shift)
Macro definitions for various function/variable attributes.
static atomic_int cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
#define EXTERNAL_XOP(flags)
#define EXTERNAL_SSE2(flags)
static int16_t basis[64][64]
const h264_weight_func weight
main external API structure.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
int flags
AV_CODEC_FLAG_*.
EXTERN void ff_mpv_denoise_dct_sse2(int16_t block[64], int dct_error_sum[64], const uint16_t dct_offset[64])
av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
int ff_pix_norm1_sse2(const uint8_t *pix, ptrdiff_t line_size)
int ff_pix_sum16_xop(const uint8_t *pix, ptrdiff_t line_size)
int ff_pix_sum16_sse2(const uint8_t *pix, ptrdiff_t line_size)
void ff_add_8x8basis_ssse3(int16_t rem[64], const int16_t basis[64], int scale)