dsputil_mmx.h
Go to the documentation of this file.
1 /*
2  * MMX optimized DSP utils
3  * Copyright (c) 2007 Aurelien Jacobs <aurel@gnuage.org>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef AVCODEC_X86_DSPUTIL_MMX_H
23 #define AVCODEC_X86_DSPUTIL_MMX_H
24 
25 #include <stddef.h>
26 #include <stdint.h>
27 
28 #include "libavcodec/dsputil.h"
29 #include "libavutil/x86/asm.h"
30 
31 extern const uint64_t ff_bone;
32 extern const uint64_t ff_wtwo;
33 
34 extern const xmm_reg ff_pw_3;
35 extern const xmm_reg ff_pw_4;
36 extern const xmm_reg ff_pw_5;
37 extern const xmm_reg ff_pw_8;
38 extern const uint64_t ff_pw_15;
39 extern const xmm_reg ff_pw_16;
40 extern const xmm_reg ff_pw_18;
41 extern const uint64_t ff_pw_20;
42 extern const xmm_reg ff_pw_32;
43 extern const uint64_t ff_pw_42;
44 extern const uint64_t ff_pw_53;
45 extern const xmm_reg ff_pw_64;
46 extern const uint64_t ff_pw_96;
47 extern const uint64_t ff_pw_128;
48 extern const uint64_t ff_pw_255;
49 
50 extern const xmm_reg ff_pb_1;
51 extern const xmm_reg ff_pb_3;
52 extern const uint64_t ff_pb_3F;
53 extern const xmm_reg ff_pb_F8;
54 extern const uint64_t ff_pb_FC;
55 
56 extern const double ff_pd_1[2];
57 extern const double ff_pd_2[2];
58 
59 #define SBUTTERFLY(a,b,t,n,m)\
60  "mov" #m " " #a ", " #t " \n\t" /* abcd */\
61  "punpckl" #n " " #b ", " #a " \n\t" /* aebf */\
62  "punpckh" #n " " #b ", " #t " \n\t" /* cgdh */\
63 
64 #define TRANSPOSE4(a,b,c,d,t)\
65  SBUTTERFLY(a,b,t,wd,q) /* a=aebf t=cgdh */\
66  SBUTTERFLY(c,d,b,wd,q) /* c=imjn b=kolp */\
67  SBUTTERFLY(a,c,d,dq,q) /* a=aeim d=bfjn */\
68  SBUTTERFLY(t,b,c,dq,q) /* t=cgko c=dhlp */
69 
70 #define MOVQ_WONE(regd) \
71  __asm__ volatile ( \
72  "pcmpeqd %%" #regd ", %%" #regd " \n\t" \
73  "psrlw $15, %%" #regd ::)
74 
77 
78 void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
79 void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
80 void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
81 
82 void ff_avg_pixels8_mmxext(uint8_t *block, const uint8_t *pixels,
83  ptrdiff_t line_size, int h);
84 void ff_put_pixels8_mmxext(uint8_t *block, const uint8_t *pixels,
85  ptrdiff_t line_size, int h);
86 void ff_avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
87  ptrdiff_t line_size, int h);
88 void ff_put_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
89  ptrdiff_t line_size, int h);
90 
95 
96 void ff_put_vc1_mspel_mc00_mmx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int rnd);
97 
98 void ff_put_rv40_qpel8_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride);
99 void ff_put_rv40_qpel16_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride);
100 void ff_avg_rv40_qpel8_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride);
101 void ff_avg_rv40_qpel16_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride);
102 
103 void ff_mmx_idct(int16_t *block);
104 void ff_mmxext_idct(int16_t *block);
105 
106 
108  const uint8_t *lum_m4, const uint8_t *lum_m3,
109  const uint8_t *lum_m2, const uint8_t *lum_m1,
110  const uint8_t *lum,
111  int size);
112 
113 void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4,
114  const uint8_t *lum_m3,
115  const uint8_t *lum_m2,
116  const uint8_t *lum_m1,
117  const uint8_t *lum, int size);
118 
119 #endif /* AVCODEC_X86_DSPUTIL_MMX_H */
const uint64_t ff_pw_42
void ff_put_pixels8_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
const xmm_reg ff_pb_1
void ff_put_rv40_qpel16_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride)
void ff_avg_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
void ff_put_pixels16_sse2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
void ff_avg_rv40_qpel16_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride)
void ff_mmx_idct(int16_t *block)
int stride
Definition: mace.c:144
const uint64_t ff_pw_255
const xmm_reg ff_pw_64
const uint64_t ff_pw_128
uint8_t
const xmm_reg ff_pw_5
const uint64_t ff_pb_3F
void ff_put_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
void ff_avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
const xmm_reg ff_pw_4
void ff_deinterlace_line_mmx(uint8_t *dst, const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m2, const uint8_t *lum_m1, const uint8_t *lum, int size)
int size
void ff_put_vc1_mspel_mc00_mmx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int rnd)
void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size)
const uint64_t ff_wtwo
void ff_dsputil_init_pix_mmx(DSPContext *c, AVCodecContext *avctx)
const xmm_reg ff_pw_32
void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
const xmm_reg ff_pb_F8
void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size)
const uint64_t ff_pw_96
const uint64_t ff_pw_53
const double ff_pd_2[2]
AVS_Value src
Definition: avisynth_c.h:523
main external API structure.
void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size)
const uint64_t ff_pw_20
const uint64_t ff_pw_15
void ff_put_cavs_qpel16_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
void ff_mmxext_idct(int16_t *block)
static double lum(void *priv, double x, double y)
Definition: vf_geq.c:83
static double c[64]
const xmm_reg ff_pw_3
void ff_put_rv40_qpel8_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride)
DSP utils.
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160
void ff_avg_cavs_qpel16_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
const uint64_t ff_bone
const uint64_t ff_pb_FC
const xmm_reg ff_pw_16
const xmm_reg ff_pw_8
const xmm_reg ff_pb_3
const double ff_pd_1[2]
const xmm_reg ff_pw_18
void ff_avg_pixels8_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
void ff_avg_rv40_qpel8_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride)
DSPContext.
Definition: dsputil.h:127