46 #define OFFSET(x) offsetof(W3FDIFContext, x)
47 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
48 #define CONST(name, help, val, unit) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, unit }
55 CONST(
"all",
"deinterlace all frames", 0,
"deint"),
56 CONST(
"interlaced",
"only deinterlace frames marked as interlaced", 1,
"deint"),
125 { -1704, 34472, 34472, -1704}};
128 { 2032, -7602, 11140, -7602, 2032}};
132 const int filter,
const int plane)
135 uint8_t *in_line, *in_lines_cur[5], *in_lines_adj[5];
137 int32_t *work_line, *work_pixel;
141 const int linesize = s->
linesize[plane];
143 const int cur_line_stride = cur->
linesize[plane];
144 const int adj_line_stride = adj->
linesize[plane];
145 const int dst_line_stride = out->
linesize[plane];
146 int i, j, y_in, y_out;
151 in_line = cur_data + (y_out * cur_line_stride);
152 out_line = dst_data + (y_out * dst_line_stride);
154 while (y_out < height) {
155 memcpy(out_line, in_line, linesize);
157 in_line += cur_line_stride * 2;
158 out_line += dst_line_stride * 2;
164 out_line = dst_data + (y_out * dst_line_stride);
166 while (y_out < height) {
172 y_in = (y_out + 1) + (j * 2) - n_coef_lf[
filter];
176 while (y_in >= height)
179 in_lines_cur[j] = cur_data + (y_in * cur_line_stride);
183 switch (n_coef_lf[filter]) {
185 for (i = 0; i < linesize; i++) {
187 *work_line++ += *in_lines_cur[1]++ * coef_lf[
filter][1];
191 for (i = 0; i < linesize; i++) {
193 *work_line += *in_lines_cur[1]++ * coef_lf[
filter][1];
194 *work_line += *in_lines_cur[2]++ * coef_lf[
filter][2];
195 *work_line++ += *in_lines_cur[3]++ * coef_lf[
filter][3];
201 y_in = (y_out + 1) + (j * 2) - n_coef_hf[
filter];
205 while (y_in >= height)
208 in_lines_cur[j] = cur_data + (y_in * cur_line_stride);
209 in_lines_adj[j] = adj_data + (y_in * adj_line_stride);
213 switch (n_coef_hf[filter]) {
215 for (i = 0; i < linesize; i++) {
217 *work_line += *in_lines_adj[0]++ * coef_hf[
filter][0];
218 *work_line += *in_lines_cur[1]++ * coef_hf[
filter][1];
219 *work_line += *in_lines_adj[1]++ * coef_hf[
filter][1];
220 *work_line += *in_lines_cur[2]++ * coef_hf[
filter][2];
221 *work_line++ += *in_lines_adj[2]++ * coef_hf[
filter][2];
225 for (i = 0; i < linesize; i++) {
227 *work_line += *in_lines_adj[0]++ * coef_hf[
filter][0];
228 *work_line += *in_lines_cur[1]++ * coef_hf[
filter][1];
229 *work_line += *in_lines_adj[1]++ * coef_hf[
filter][1];
230 *work_line += *in_lines_cur[2]++ * coef_hf[
filter][2];
231 *work_line += *in_lines_adj[2]++ * coef_hf[
filter][2];
232 *work_line += *in_lines_cur[3]++ * coef_hf[
filter][3];
233 *work_line += *in_lines_adj[3]++ * coef_hf[
filter][3];
234 *work_line += *in_lines_cur[4]++ * coef_hf[
filter][4];
235 *work_line++ += *in_lines_adj[4]++ * coef_hf[
filter][4];
241 out_pixel = out_line;
243 for (j = 0; j < linesize; j++, out_pixel++, work_pixel++)
244 *out_pixel = av_clip(*work_pixel, 0, 255 * 256 * 256) >> 16;
248 out_line += dst_line_stride * 2;
269 int64_t cur_pts = s->
cur->
pts;
270 int64_t next_pts = s->
next->
pts;
273 out->
pts = cur_pts + next_pts;
280 for (plane = 0; plane < s->
nb_planes; plane++)
346 }
else if (ret < 0) {
388 .priv_class = &w3fdif_class,