[FFmpeg-devel] [PATCH] libavfilter image transformations

Georg Martius georg.martius
Thu Apr 22 20:28:00 CEST 2010


I am the guy who wrote the stabilizer/deshaker plugin for transcode. Daniel an 
my are going to port it to ffmpeg, hopefully ;-) First of all, thank you guys 
for the helpful comments so far.

>> [...]
>> This is useful for any filter that might want to transform video frames in
>> any way in the future. I have at least one filter that will use this but
>> is waiting on motion estimation stuff (deshake/stabilize video).
>First, are these transforms separable? I'm not familiar with affine
> rotations to know how to split them into 1D.
What do you mean be 1D? 
The transforms are separable into translation, rotation and scaling, but it is 
better to combine them since interpolation is required.
Just to make sure here is how these transformations are represented, see 

p'=M p where p=(x,y,1) is the source pixel coordinate in homogeneous  
coordinates. And M is the transformation matrix:
M = [sx*cos(a), sx*sin(a), tx], [-sy*sin(a), sy*cos(a), ty],[0, 0, 1]
where sx,sy are the scaling factors (usually identical), a is the rotation 
angle and tx,ty are the translations.

>Second, can they be done in fixed-point?
Well, if 16.16 this is certainly enough.
>This won't work for downscaling because it won't sample any more than 4
> source pixels.
Yeah that's true. We have to sample more pixels in this case. For our original 
purposes such zoom-values are not probable, but of course we need to fix it 

So far!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100422/1975a19f/attachment.pgp>

More information about the ffmpeg-devel mailing list