Lines Matching refs:yadif
26 #include "yadif.h"
141 YADIFContext *yadif = ctx->priv;
144 for (i = 0; i < yadif->csp->nb_components; i++) {
147 int refs = yadif->cur->linesize[i];
148 int df = (yadif->csp->comp[i].depth_minus1 + 8) / 8;
152 w >>= yadif->csp->log2_chroma_w;
153 h >>= yadif->csp->log2_chroma_h;
158 uint8_t *prev = &yadif->prev->data[i][y*refs];
159 uint8_t *cur = &yadif->cur ->data[i][y*refs];
160 uint8_t *next = &yadif->next->data[i][y*refs];
162 int mode = y==1 || y+2==h ? 2 : yadif->mode;
163 yadif->filter_line(dst, prev, cur, next, w, y+1<h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode);
166 &yadif->cur->data[i][y*refs], w*df);
195 YADIFContext *yadif = ctx->priv;
199 if (yadif->parity == -1) {
200 tff = yadif->cur->video->interlaced ?
201 yadif->cur->video->top_field_first : 1;
203 tff = yadif->parity^1;
207 yadif->out = avfilter_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE |
209 avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);
210 yadif->out->video->interlaced = 0;
213 if (!yadif->csp)
214 yadif->csp = &av_pix_fmt_descriptors[link->format];
215 if (yadif->csp->comp[0].depth_minus1 / 8 == 1)
216 yadif->filter_line = filter_line_c_16bit;
218 filter(ctx, yadif->out, tff ^ !is_second, tff);
221 if (yadif->next->pts != AV_NOPTS_VALUE &&
222 yadif->cur->pts != AV_NOPTS_VALUE) {
223 yadif->out->pts =
224 (yadif->next->pts&yadif->cur->pts) +
225 ((yadif->next->pts^yadif->cur->pts)>>1);
227 yadif->out->pts = AV_NOPTS_VALUE;
229 avfilter_start_frame(ctx->outputs[0], yadif->out);
234 yadif->frame_pending = (yadif->mode&1) && !is_second;
240 YADIFContext *yadif = ctx->priv;
242 if (yadif->frame_pending)
245 if (yadif->prev)
246 avfilter_unref_buffer(yadif->prev);
247 yadif->prev = yadif->cur;
248 yadif->cur = yadif->next;
249 yadif->next = picref;
251 if (!yadif->cur)
254 if (yadif->auto_enable && !yadif->cur->video->interlaced) {
255 yadif->out = avfilter_ref_buffer(yadif->cur, AV_PERM_READ);
256 avfilter_unref_buffer(yadif->prev);
257 yadif->prev = NULL;
258 avfilter_start_frame(ctx->outputs[0], yadif->out);
262 if (!yadif->prev)
263 yadif->prev = avfilter_ref_buffer(yadif->cur, AV_PERM_READ);
265 yadif->out = avfilter_get_video_buffer(ctx->outputs[0], AV_PERM_WRITE | AV_PERM_PRESERVE |
268 avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);
269 yadif->out->video->interlaced = 0;
270 avfilter_start_frame(ctx->outputs[0], yadif->out);
276 YADIFContext *yadif = ctx->priv;
278 if (!yadif->out)
281 if (yadif->auto_enable && !yadif->cur->video->interlaced) {
293 YADIFContext *yadif = ctx->priv;
295 if (yadif->frame_pending) {
305 } while (!yadif->cur);
312 YADIFContext *yadif = link->src->priv;
315 if (yadif->frame_pending)
320 if (val==1 && !yadif->next) { //FIXME change API to not requre this red tape
325 assert(yadif->next || !val);
327 if (yadif->auto_enable && yadif->next && !yadif->next->video->interlaced)
330 return val * ((yadif->mode&1)+1);
335 YADIFContext *yadif = ctx->priv;
337 if (yadif->prev) avfilter_unref_buffer(yadif->prev);
338 if (yadif->cur ) avfilter_unref_buffer(yadif->cur );
339 if (yadif->next) avfilter_unref_buffer(yadif->next);
374 YADIFContext *yadif = ctx->priv;
377 yadif->mode = 0;
378 yadif->parity = -1;
379 yadif->auto_enable = 0;
380 yadif->csp = NULL;
382 if (args) sscanf(args, "%d:%d:%d", &yadif->mode, &yadif->parity, &yadif->auto_enable);
384 yadif->filter_line = filter_line_c;
386 yadif->filter_line = ff_yadif_filter_line_ssse3;
388 yadif->filter_line = ff_yadif_filter_line_sse2;
390 yadif->filter_line = ff_yadif_filter_line_mmx;
392 av_log(ctx, AV_LOG_INFO, "mode:%d parity:%d auto_enable:%d\n", yadif->mode, yadif->parity, yadif->auto_enable);
400 .name = "yadif",