1 /*
2 * Copyright (c) 2013 Paul B Mahol
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
29
36
47
51
52 #define OFFSET(x) offsetof(MergePlanesContext, x)
53 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
58 };
59
61
63 {
66 }
67
69 {
73
77 av_log(ctx,
AV_LOG_ERROR,
"Only planar formats with more than one component are supported.\n");
79 }
81
83 s->
map[i][0] = m & 0xf;
84 m >>= 4;
85 s->
map[i][1] = m & 0xf;
86 m >>= 4;
87
88 if (s->
map[i][0] > 3 || s->
map[i][1] > 3) {
91 }
92
94 }
95
97
100
106
110 }
111 }
112
113 return 0;
114 }
115
117 {
120 int i;
121
128 }
129
132
136
137 return 0;
138 }
139
141 {
148
152 }
153
155 if (!out)
158
160 const int input = s->
map[i][1];
161 const int plane = s->
map[i][0];
162
166 }
167
169 }
170
172 {
177 int i;
178
183
189
198
203 int j;
204
208 "does not match output link %s SAR %d:%d\n",
216 }
217
227
230
235 }
236
238 const int input = s->
map[i][1];
239 const int plane = s->
map[i][0];
241
244 input, plane);
245 goto fail;
246 }
249 "match input %d plane %d depth %d\n",
251 input, plane, inputp->
depth[plane]);
252 goto fail;
253 }
256 "match input %d plane %d width %d\n",
259 goto fail;
260 }
263 "match input %d plane %d height %d\n",
266 goto fail;
267 }
268 }
269
271 fail:
273 }
274
276 {
279 }
280
282 {
284 int i;
285
287
290 }
291
293 {
298 },
300 };
301
303 .
name =
"mergeplanes",
306 .priv_class = &mergeplanes_class,
311 .
outputs = mergeplanes_outputs,
313 };