[FFmpeg-soc] [soc]: r1794 - in libavfilter: Makefile allfilters.h avfilter.c vf_rotate.c

Vitor Sessak vitor1001 at gmail.com
Mon Jan 7 22:17:22 CET 2008


Hi

Michael Niedermayer wrote:
> On Mon, Jan 07, 2008 at 09:24:51PM +0100, Michael Niedermayer wrote:
>> On Mon, Jan 07, 2008 at 08:13:39PM +0100, vitor wrote:
>>> Author: vitor
>>> Date: Mon Jan  7 20:13:38 2008
>>> New Revision: 1794
>>>
>>> Log:
>>> Rotation filter
>> [...]
>>> +/**
>>> + * @file vf_rotate.c
>>> + * rotation filter
>>> + *
>>> + * @todo Copy code from rotozoom.c to remove use of floating-point
>>> + * @todo Handle packed pixel formats
>>> + * @todo Make backcolor configurable
>>> +*/
>> @todo: fast 90° increment rot filter (unless this code is as fast)

I agree completely. Actually, I want to rename this filter later to 
rotate_slow and create a filter named "rotate" that would be just a 
dummy filter, with a code like

switch(ang%360) {
case 0:
	filter = "dummy";
	break;
case 90:
	//vflip changes only linesize, so it's very fast
	filter = "vflip,transpose"
	break;
case 180:
	filter = "hflip,vflip"
	break;
case 270:
	filter = "transpose,vflip"
	break;
else:
	sprintf(filter,"rotate_slow=%i",ang);
	break;
}

filter_frame(filter);

It avoids duplicating the transpose and hflip code.

I think also it would be particularly nice also to serve as a template 
for other future pseudo-filters like crop_or_pad_to_size. I've tried to 
do that using code from avfiltergraph.c, but it's pretty complex... 
Bobby, do you have an idea about it?

>> @todo: port libmpcodecs/vf_perspective.c, which can trivially
>>        be extended to do just rotations, making this filter redundant
> 
> and you can copy and paste anything from vf_perspective.c under LGPL!

I'll have a look.

> And loose the floats in the inner loop of vf_rotate.c. Unless they are
> significantly faster.

See my first TODO. I want to remove float usage completely.

-Vitor

PS: don't forget to have a look at the ffmpeg.c integration question. 
It's a show-stopper for svn...




More information about the FFmpeg-soc mailing list