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