1 /*
2 * Copyright (C) 2010 David Conrad
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
24
29
30 #define HPEL_FILTER(MMSIZE, EXT) \
31 void ff_dirac_hpel_filter_v_ ## EXT(uint8_t *, const uint8_t *, int, int); \
32 void ff_dirac_hpel_filter_h_ ## EXT(uint8_t *, const uint8_t *, int); \
33 \
34 static void dirac_hpel_filter_ ## EXT(uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, \
35 const uint8_t *src, int stride, int width, int height) \
36 { \
37 while( height-- ) \
38 { \
39 ff_dirac_hpel_filter_v_ ## EXT(dstv-MMSIZE, src-MMSIZE, stride, width+MMSIZE+5); \
40 ff_dirac_hpel_filter_h_ ## EXT(dsth, src, width); \
41 ff_dirac_hpel_filter_h_ ## EXT(dstc, dstv, width); \
42 \
43 dsth += stride; \
44 dstv += stride; \
45 dstc += stride; \
46 src += stride; \
47 } \
48 }
49
50 #if !ARCH_X86_64
52 #endif
54
55 #define PIXFUNC(PFX, IDX, EXT) \
56 /*MMXDISABLEDc->PFX ## _dirac_pixels_tab[0][IDX] = ff_ ## PFX ## _dirac_pixels8_ ## EXT;*/ \
57 c->PFX ## _dirac_pixels_tab[1][IDX] = ff_ ## PFX ## _dirac_pixels16_ ## EXT; \
58 c->PFX ## _dirac_pixels_tab[2][IDX] = ff_ ## PFX ## _dirac_pixels32_ ## EXT
59
60 #define DIRAC_PIXOP(OPNAME2, OPNAME, EXT)\
61 void ff_ ## OPNAME2 ## _dirac_pixels8_ ## EXT(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
62 {\
63 if (h&3)\
64 ff_ ## OPNAME2 ## _dirac_pixels8_c(dst, src, stride, h);\
65 else\
66 OPNAME ## _pixels8_ ## EXT(dst, src[0], stride, h);\
67 }\
68 void ff_ ## OPNAME2 ## _dirac_pixels16_ ## EXT(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
69 {\
70 if (h&3)\
71 ff_ ## OPNAME2 ## _dirac_pixels16_c(dst, src, stride, h);\
72 else\
73 OPNAME ## _pixels16_ ## EXT(dst, src[0], stride, h);\
74 }\
75 void ff_ ## OPNAME2 ## _dirac_pixels32_ ## EXT(uint8_t *dst, const uint8_t *src[5], int stride, int h)\
76 {\
77 if (h&3) {\
78 ff_ ## OPNAME2 ## _dirac_pixels32_c(dst, src, stride, h);\
79 } else {\
80 OPNAME ## _pixels16_ ## EXT(dst , src[0] , stride, h);\
81 OPNAME ## _pixels16_ ## EXT(dst+16, src[0]+16, stride, h);\
82 }\
83 }
84
88
90 {
91 if (h&3)
92 ff_put_dirac_pixels16_c(dst, src, stride, h);
93 else
95 }
97 {
98 if (h&3)
99 ff_avg_dirac_pixels16_c(dst, src, stride, h);
100 else
102 }
104 {
105 if (h&3) {
106 ff_put_dirac_pixels32_c(dst, src, stride, h);
107 } else {
110 }
111 }
113 {
114 if (h&3) {
115 ff_avg_dirac_pixels32_c(dst, src, stride, h);
116 } else {
119 }
120 }
121
123 {
125
128 #if !ARCH_X86_64
134 #endif
137 }
138
141 }
142
147
150
155 }
156 }