Lines Matching defs:outpicref
276 static int does_clip(PadContext *pad, AVFilterBufferRef *outpicref, int plane, int hsub, int vsub, int x, int y)
280 x_in_buf = outpicref->data[plane] - outpicref->buf->data[plane]
282 + (y >> vsub) * outpicref->linesize [plane];
288 av_assert0(outpicref->buf->linesize[plane]>0); //while reference can use negative linesize the main buffer should not
290 y_in_buf = x_in_buf / outpicref->buf->linesize[plane];
291 x_in_buf %= outpicref->buf->linesize[plane];
293 if( y_in_buf<<vsub >= outpicref->buf->h
294 || x_in_buf<<hsub >= outpicref->buf->w)
302 AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
306 for (plane = 0; plane < 4 && outpicref->data[plane]; plane++) {
310 av_assert0(outpicref->buf->w>0 && outpicref->buf->h>0);
312 if(outpicref->format != outpicref->buf->format) //unsupported currently
315 outpicref->data[plane] -= (pad->x >> hsub) * pad ->line_step[plane]
316 + (pad->y >> vsub) * outpicref->linesize [plane];
318 if( does_clip(pad, outpicref, plane, hsub, vsub, 0, 0)
319 || does_clip(pad, outpicref, plane, hsub, vsub, 0, pad->h-1)
320 || does_clip(pad, outpicref, plane, hsub, vsub, pad->w-1, 0)
321 || does_clip(pad, outpicref, plane, hsub, vsub, pad->w-1, pad->h-1)
325 pad->needs_copy= plane < 4 && outpicref->data[plane];
328 avfilter_unref_buffer(outpicref);
329 outpicref = avfilter_get_video_buffer(inlink->dst->outputs[0], AV_PERM_WRITE | AV_PERM_NEG_LINESIZES,
332 avfilter_copy_buffer_ref_props(outpicref, inpicref);
335 inlink->dst->outputs[0]->out_buf = outpicref;
337 outpicref->video->w = pad->w;
338 outpicref->video->h = pad->h;
340 for_next_filter = avfilter_ref_buffer(outpicref, ~0);