[FFmpeg-devel] [PATCH] add top video filter
Stefano Sabatini
stefano.sabatini-lala at poste.it
Tue Mar 29 23:53:44 CEST 2011
On date Tuesday 2011-03-29 22:02:53 +0100, Mark Himsley encoded:
> On 29/03/11 17:50, Stefano Sabatini wrote:
> >On date Monday 2011-03-28 14:47:20 +0100, Mark Himsley encoded:
[...]
> >>+ for (plane = 0; plane< 4&& outpic->data[plane]; plane++) {
> >>+ cpy_dst = outpic->data[plane] + y * outpic->linesize[plane];
> >>+ if (top->dst_tff) {
> >>+ for (i = 0; i< h; i++) {
> >>+ if (1 + y + i< outpic->video->h) {
> >>+ memcpy(cpy_dst, cpy_dst + outpic->linesize[plane], outpic->linesize[plane]);
> >
> >You're copying more than it is required, outpic->linesize[plane] -> line_step[plane] * w;
>
> Am I?
> I want to copy a whole line, from line+1 to line.
> Where does w some from BTW?
Plane buffers are usually padded, so you may have:
linesize[plane] > pixel_step*w
Copying more than it is required is a waste of CPU, also you shouldn't
write beyond the image region.
w is the image width, that you can retrieve in inlink->w or in
outpic->video->w.
[...]
--
FFmpeg = Fancy and Fabulous Miracolous Puristic Elected Gadget
More information about the ffmpeg-devel
mailing list