Mercurial > mplayer.hg
annotate libmpcodecs/vf_2xsai.c @ 31585:9ed1627a3707
Fix compilation with --disable-mencoder.
author | cehoyos |
---|---|
date | Fri, 09 Jul 2010 13:08:27 +0000 |
parents | a972c1a4a012 |
children | 7af3e6f901fd |
rev | line source |
---|---|
30421
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
1 /* |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
2 * This file is part of MPlayer. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
3 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
7 * (at your option) any later version. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
8 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
12 * GNU General Public License for more details. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
13 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
17 */ |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
18 |
7919 | 19 #include <stdio.h> |
20 #include <stdlib.h> | |
21 #include <string.h> | |
22 #include <inttypes.h> | |
23 | |
17012 | 24 #include "config.h" |
25 #include "mp_msg.h" | |
7919 | 26 |
27 #include "img_format.h" | |
28 #include "mp_image.h" | |
29 #include "vf.h" | |
30 | |
31 //===========================================================================// | |
32 | |
24785 | 33 /* FIXME: these all belong in the context, not as globals! */ |
34 | |
25003
c79fa5c75d4e
Use proper inttypes.h types instead of broken uint32 etc. defines
reimar
parents:
24863
diff
changeset
|
35 static uint32_t colorMask = 0xF7DEF7DE; |
c79fa5c75d4e
Use proper inttypes.h types instead of broken uint32 etc. defines
reimar
parents:
24863
diff
changeset
|
36 static uint32_t lowPixelMask = 0x08210821; |
c79fa5c75d4e
Use proper inttypes.h types instead of broken uint32 etc. defines
reimar
parents:
24863
diff
changeset
|
37 static uint32_t qcolorMask = 0xE79CE79C; |
c79fa5c75d4e
Use proper inttypes.h types instead of broken uint32 etc. defines
reimar
parents:
24863
diff
changeset
|
38 static uint32_t qlowpixelMask = 0x18631863; |
c79fa5c75d4e
Use proper inttypes.h types instead of broken uint32 etc. defines
reimar
parents:
24863
diff
changeset
|
39 static uint32_t redblueMask = 0xF81F; |
c79fa5c75d4e
Use proper inttypes.h types instead of broken uint32 etc. defines
reimar
parents:
24863
diff
changeset
|
40 static uint32_t greenMask = 0x7E0; |
7919 | 41 static int PixelsPerMask = 2; |
42 | |
43 #define makecol(r,g,b) (r+(g<<8)+(b<<16)) | |
44 #define makecol_depth(d,r,g,b) (r+(g<<8)+(b<<16)) | |
45 | |
30555
ad6740b58b0d
libmpcodecs: Mark functions not used outside of their files as static.
diego
parents:
30421
diff
changeset
|
46 static int Init_2xSaI(int d) |
7919 | 47 { |
48 | |
49 int minr = 0, ming = 0, minb = 0; | |
50 int i; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
51 |
7919 | 52 // if (d != 15 && d != 16 && d != 24 && d != 32) |
53 // return -1; | |
54 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
55 /* Get lowest color bit */ |
7919 | 56 for (i = 0; i < 255; i++) { |
57 if (!minr) | |
58 minr = makecol(i, 0, 0); | |
59 if (!ming) | |
60 ming = makecol(0, i, 0); | |
61 if (!minb) | |
62 minb = makecol(0, 0, i); | |
63 } | |
64 | |
65 colorMask = (makecol_depth(d, 255, 0, 0) - minr) | (makecol_depth(d, 0, 255, 0) - ming) | (makecol_depth(d, 0, 0, 255) - minb); | |
66 lowPixelMask = minr | ming | minb; | |
67 qcolorMask = (makecol_depth(d, 255, 0, 0) - 3 * minr) | (makecol_depth(d, 0, 255, 0) - 3 * ming) | (makecol_depth(d, 0, 0, 255) - 3 * minb); | |
68 qlowpixelMask = (minr * 3) | (ming * 3) | (minb * 3); | |
69 redblueMask = makecol_depth(d, 255, 0, 255); | |
70 greenMask = makecol_depth(d, 0, 255, 0); | |
71 | |
72 PixelsPerMask = (d <= 16) ? 2 : 1; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
73 |
7919 | 74 if (PixelsPerMask == 2) { |
75 colorMask |= (colorMask << 16); | |
76 qcolorMask |= (qcolorMask << 16); | |
77 lowPixelMask |= (lowPixelMask << 16); | |
78 qlowpixelMask |= (qlowpixelMask << 16); | |
79 } | |
80 | |
81 // TRACE("Color Mask: 0x%lX\n", colorMask); | |
82 // TRACE("Low Pixel Mask: 0x%lX\n", lowPixelMask); | |
83 // TRACE("QColor Mask: 0x%lX\n", qcolorMask); | |
84 // TRACE("QLow Pixel Mask: 0x%lX\n", qlowpixelMask); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
85 |
7919 | 86 return 0; |
87 } | |
88 | |
89 | |
90 #define GET_RESULT(A, B, C, D) ((A != C || A != D) - (B != C || B != D)) | |
91 | |
92 #define INTERPOLATE(A, B) (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + (A & B & lowPixelMask)) | |
93 | |
94 #define Q_INTERPOLATE(A, B, C, D) ((A & qcolorMask) >> 2) + ((B & qcolorMask) >> 2) + ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2) \ | |
95 + ((((A & qlowpixelMask) + (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask)) >> 2) & qlowpixelMask) | |
96 | |
97 | |
30555
ad6740b58b0d
libmpcodecs: Mark functions not used outside of their files as static.
diego
parents:
30421
diff
changeset
|
98 static void Super2xSaI_ex(uint8_t *src, uint32_t src_pitch, |
ad6740b58b0d
libmpcodecs: Mark functions not used outside of their files as static.
diego
parents:
30421
diff
changeset
|
99 uint8_t *dst, uint32_t dst_pitch, |
ad6740b58b0d
libmpcodecs: Mark functions not used outside of their files as static.
diego
parents:
30421
diff
changeset
|
100 uint32_t width, uint32_t height, int sbpp) |
ad6740b58b0d
libmpcodecs: Mark functions not used outside of their files as static.
diego
parents:
30421
diff
changeset
|
101 { |
7919 | 102 |
103 unsigned int x, y; | |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
104 uint32_t color[16]; |
25669 | 105 unsigned char *src_line[4]; |
7919 | 106 |
107 /* Point to the first 3 lines. */ | |
108 src_line[0] = src; | |
109 src_line[1] = src; | |
110 src_line[2] = src + src_pitch; | |
111 src_line[3] = src + src_pitch * 2; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
112 |
7919 | 113 x = 0, y = 0; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
114 |
7919 | 115 if (PixelsPerMask == 2) { |
116 unsigned short *sbp; | |
117 sbp = (unsigned short*)src_line[0]; | |
118 color[0] = *sbp; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; | |
119 color[4] = color[0]; color[5] = color[0]; color[6] = *(sbp + 1); color[7] = *(sbp + 2); | |
120 sbp = (unsigned short*)src_line[2]; | |
121 color[8] = *sbp; color[9] = color[8]; color[10] = *(sbp + 1); color[11] = *(sbp + 2); | |
122 sbp = (unsigned short*)src_line[3]; | |
123 color[12] = *sbp; color[13] = color[12]; color[14] = *(sbp + 1); color[15] = *(sbp + 2); | |
124 } | |
125 else { | |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
126 uint32_t *lbp; |
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
127 lbp = (uint32_t*)src_line[0]; |
7919 | 128 color[0] = *lbp; color[1] = color[0]; color[2] = color[0]; color[3] = color[0]; |
129 color[4] = color[0]; color[5] = color[0]; color[6] = *(lbp + 1); color[7] = *(lbp + 2); | |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
130 lbp = (uint32_t*)src_line[2]; |
7919 | 131 color[8] = *lbp; color[9] = color[8]; color[10] = *(lbp + 1); color[11] = *(lbp + 2); |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
132 lbp = (uint32_t*)src_line[3]; |
7919 | 133 color[12] = *lbp; color[13] = color[12]; color[14] = *(lbp + 1); color[15] = *(lbp + 2); |
134 } | |
135 | |
136 for (y = 0; y < height; y++) { | |
25669 | 137 unsigned char *dst_line[2]; |
7919 | 138 |
139 dst_line[0] = dst + dst_pitch*2*y; | |
140 dst_line[1] = dst + dst_pitch*(2*y+1); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
141 |
7919 | 142 /* Todo: x = width - 2, x = width - 1 */ |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
143 |
7919 | 144 for (x = 0; x < width; x++) { |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
145 uint32_t product1a, product1b, product2a, product2b; |
7919 | 146 |
147 //--------------------------------------- B0 B1 B2 B3 0 1 2 3 | |
148 // 4 5* 6 S2 -> 4 5* 6 7 | |
149 // 1 2 3 S1 8 9 10 11 | |
150 // A0 A1 A2 A3 12 13 14 15 | |
151 //-------------------------------------- | |
152 if (color[9] == color[6] && color[5] != color[10]) { | |
153 product2b = color[9]; | |
154 product1b = product2b; | |
155 } | |
156 else if (color[5] == color[10] && color[9] != color[6]) { | |
157 product2b = color[5]; | |
158 product1b = product2b; | |
159 } | |
160 else if (color[5] == color[10] && color[9] == color[6]) { | |
161 int r = 0; | |
162 | |
163 r += GET_RESULT(color[6], color[5], color[8], color[13]); | |
164 r += GET_RESULT(color[6], color[5], color[4], color[1]); | |
165 r += GET_RESULT(color[6], color[5], color[14], color[11]); | |
166 r += GET_RESULT(color[6], color[5], color[2], color[7]); | |
167 | |
168 if (r > 0) | |
169 product1b = color[6]; | |
170 else if (r < 0) | |
171 product1b = color[5]; | |
172 else | |
173 product1b = INTERPOLATE(color[5], color[6]); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
174 |
7919 | 175 product2b = product1b; |
176 | |
177 } | |
178 else { | |
179 if (color[6] == color[10] && color[10] == color[13] && color[9] != color[14] && color[10] != color[12]) | |
180 product2b = Q_INTERPOLATE(color[10], color[10], color[10], color[9]); | |
181 else if (color[5] == color[9] && color[9] == color[14] && color[13] != color[10] && color[9] != color[15]) | |
182 product2b = Q_INTERPOLATE(color[9], color[9], color[9], color[10]); | |
183 else | |
184 product2b = INTERPOLATE(color[9], color[10]); | |
185 | |
186 if (color[6] == color[10] && color[6] == color[1] && color[5] != color[2] && color[6] != color[0]) | |
187 product1b = Q_INTERPOLATE(color[6], color[6], color[6], color[5]); | |
188 else if (color[5] == color[9] && color[5] == color[2] && color[1] != color[6] && color[5] != color[3]) | |
189 product1b = Q_INTERPOLATE(color[6], color[5], color[5], color[5]); | |
190 else | |
191 product1b = INTERPOLATE(color[5], color[6]); | |
192 } | |
193 | |
194 if (color[5] == color[10] && color[9] != color[6] && color[4] == color[5] && color[5] != color[14]) | |
195 product2a = INTERPOLATE(color[9], color[5]); | |
196 else if (color[5] == color[8] && color[6] == color[5] && color[4] != color[9] && color[5] != color[12]) | |
197 product2a = INTERPOLATE(color[9], color[5]); | |
198 else | |
199 product2a = color[9]; | |
200 | |
201 if (color[9] == color[6] && color[5] != color[10] && color[8] == color[9] && color[9] != color[2]) | |
202 product1a = INTERPOLATE(color[9], color[5]); | |
203 else if (color[4] == color[9] && color[10] == color[9] && color[8] != color[5] && color[9] != color[0]) | |
204 product1a = INTERPOLATE(color[9], color[5]); | |
205 else | |
206 product1a = color[5]; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
207 |
7919 | 208 if (PixelsPerMask == 2) { |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
209 *((uint32_t *) (&dst_line[0][x * 4])) = product1a | (product1b << 16); |
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
210 *((uint32_t *) (&dst_line[1][x * 4])) = product2a | (product2b << 16); |
7919 | 211 } |
212 else { | |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
213 *((uint32_t *) (&dst_line[0][x * 8])) = product1a; |
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
214 *((uint32_t *) (&dst_line[0][x * 8 + 4])) = product1b; |
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
215 *((uint32_t *) (&dst_line[1][x * 8])) = product2a; |
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
216 *((uint32_t *) (&dst_line[1][x * 8 + 4])) = product2b; |
7919 | 217 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
218 |
7919 | 219 /* Move color matrix forward */ |
220 color[0] = color[1]; color[4] = color[5]; color[8] = color[9]; color[12] = color[13]; | |
221 color[1] = color[2]; color[5] = color[6]; color[9] = color[10]; color[13] = color[14]; | |
222 color[2] = color[3]; color[6] = color[7]; color[10] = color[11]; color[14] = color[15]; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
223 |
7919 | 224 if (x < width - 3) { |
225 x += 3; | |
226 if (PixelsPerMask == 2) { | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
227 color[3] = *(((unsigned short*)src_line[0]) + x); |
7919 | 228 color[7] = *(((unsigned short*)src_line[1]) + x); |
229 color[11] = *(((unsigned short*)src_line[2]) + x); | |
230 color[15] = *(((unsigned short*)src_line[3]) + x); | |
231 } | |
232 else { | |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
233 color[3] = *(((uint32_t*)src_line[0]) + x); |
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
234 color[7] = *(((uint32_t*)src_line[1]) + x); |
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
235 color[11] = *(((uint32_t*)src_line[2]) + x); |
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
236 color[15] = *(((uint32_t*)src_line[3]) + x); |
7919 | 237 } |
238 x -= 3; | |
239 } | |
240 } | |
241 | |
242 /* We're done with one line, so we shift the source lines up */ | |
243 src_line[0] = src_line[1]; | |
244 src_line[1] = src_line[2]; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
245 src_line[2] = src_line[3]; |
7919 | 246 |
247 /* Read next line */ | |
248 if (y + 3 >= height) | |
249 src_line[3] = src_line[2]; | |
250 else | |
251 src_line[3] = src_line[2] + src_pitch; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
252 |
7919 | 253 /* Then shift the color matrix up */ |
254 if (PixelsPerMask == 2) { | |
255 unsigned short *sbp; | |
256 sbp = (unsigned short*)src_line[0]; | |
257 color[0] = *sbp; color[1] = color[0]; color[2] = *(sbp + 1); color[3] = *(sbp + 2); | |
258 sbp = (unsigned short*)src_line[1]; | |
259 color[4] = *sbp; color[5] = color[4]; color[6] = *(sbp + 1); color[7] = *(sbp + 2); | |
260 sbp = (unsigned short*)src_line[2]; | |
261 color[8] = *sbp; color[9] = color[9]; color[10] = *(sbp + 1); color[11] = *(sbp + 2); | |
262 sbp = (unsigned short*)src_line[3]; | |
263 color[12] = *sbp; color[13] = color[12]; color[14] = *(sbp + 1); color[15] = *(sbp + 2); | |
264 } | |
265 else { | |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
266 uint32_t *lbp; |
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
267 lbp = (uint32_t*)src_line[0]; |
7919 | 268 color[0] = *lbp; color[1] = color[0]; color[2] = *(lbp + 1); color[3] = *(lbp + 2); |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
269 lbp = (uint32_t*)src_line[1]; |
7919 | 270 color[4] = *lbp; color[5] = color[4]; color[6] = *(lbp + 1); color[7] = *(lbp + 2); |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
271 lbp = (uint32_t*)src_line[2]; |
7919 | 272 color[8] = *lbp; color[9] = color[9]; color[10] = *(lbp + 1); color[11] = *(lbp + 2); |
25004
98ca15113cc6
Replace stupid "unsigned long" by the correct uint32_t.
reimar
parents:
25003
diff
changeset
|
273 lbp = (uint32_t*)src_line[3]; |
7919 | 274 color[12] = *lbp; color[13] = color[12]; color[14] = *(lbp + 1); color[15] = *(lbp + 2); |
275 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
276 |
7919 | 277 } // y loop |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
278 |
7919 | 279 } |
280 | |
281 | |
282 //===========================================================================// | |
283 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
284 static int config(struct vf_instance *vf, |
7919 | 285 int width, int height, int d_width, int d_height, |
286 unsigned int flags, unsigned int outfmt){ | |
287 | |
288 Init_2xSaI(outfmt&255); | |
289 | |
290 return vf_next_config(vf,2*width,2*height,2*d_width,2*d_height,flags,outfmt); | |
291 } | |
292 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
293 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ |
7919 | 294 mp_image_t *dmpi; |
295 | |
296 // hope we'll get DR buffer: | |
297 dmpi=vf_get_image(vf->next,mpi->imgfmt, | |
298 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, | |
299 2*mpi->w, 2*mpi->h); | |
300 | |
301 Super2xSaI_ex(mpi->planes[0], mpi->stride[0], | |
302 dmpi->planes[0], dmpi->stride[0], | |
303 mpi->w, mpi->h, mpi->bpp/8); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25670
diff
changeset
|
304 |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17012
diff
changeset
|
305 return vf_next_put_image(vf,dmpi, pts); |
7919 | 306 } |
307 | |
308 //===========================================================================// | |
309 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
310 static int query_format(struct vf_instance *vf, unsigned int fmt){ |
7919 | 311 switch(fmt){ |
312 // case IMGFMT_BGR15: | |
313 // case IMGFMT_BGR16: | |
314 case IMGFMT_BGR32: | |
315 return vf_next_query_format(vf,fmt); | |
316 } | |
317 return 0; | |
318 } | |
319 | |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
30555
diff
changeset
|
320 static int vf_open(vf_instance_t *vf, char *args){ |
7919 | 321 vf->config=config; |
322 vf->put_image=put_image; | |
323 vf->query_format=query_format; | |
324 return 1; | |
325 } | |
326 | |
25221 | 327 const vf_info_t vf_info_2xsai = { |
7919 | 328 "2xSai BGR bitmap 2x scaler", |
329 "2xsai", | |
330 "A'rpi", | |
331 "http://elektron.its.tudelft.nl/~dalikifa/", | |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
30555
diff
changeset
|
332 vf_open, |
9593
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
8123
diff
changeset
|
333 NULL |
7919 | 334 }; |
335 | |
336 //===========================================================================// |