[FFmpeg-devel] [WIP] rotate filter(s)

Alexander Strange astrange
Sun Oct 3 21:15:21 CEST 2010


On Oct 3, 2010, at 1:35 PM, Stefano Sabatini wrote:

> Hi,
> 
> in attachment a first stub at the rotate filter. I don't know if it is
> a good idea to keep the float variant, while the rotate_ss may be
> useful (and the rotation angle could be made parametric).

The float version doesn't look much better. Is it?

I'd rather see the 90/180/270 cases special cased into flips, since those are the most common.
And besides those, this filter doesn't seem to have any better interpolation than that general affine transformation patch. It doesn't need it immediately, but texture mapping has been around for 4 decades now, you know. Read http://www.cs.cmu.edu/~ph/texfund/texfund.pdf if you want.

> +    switch (pix_fmt) {
> +    case PIX_FMT_ARGB:  rgba_map[ALPHA] = 0; rgba_map[RED  ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
> +    case PIX_FMT_ABGR:  rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED  ] = 3; break;
> +    case PIX_FMT_RGBA:
> +    case PIX_FMT_RGB24: rgba_map[RED  ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
> +    case PIX_FMT_BGRA:
> +    case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED  ] = 2; rgba_map[ALPHA] = 3; break;
> +    default:

Strange indentation and long lines.

> +    if (*is_packed_rgba) {
> +        line_step[0] = (av_get_bits_per_pixel(pix_desc))>>3;

Unneeded parens.

> +        for (plane = 0; plane < 4; plane++) {
> +            int line_size;
> +            int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;


This and?

> +    for (plane = 0; plane < 4 && outpic->data[plane]; plane++) {
> +        int hsub1 = plane == 1 || plane == 2 ? hsub : 0;
> +        int vsub1 = plane == 1 || plane == 2 ? vsub : 0;


?this disagree.

> +    int ang;

angle

> +/**
> + * Compute the power of a p of a using integer values.
> + * Input and output values are scaled by FIXP.
> + */

"Compute the power a^p"?





More information about the ffmpeg-devel mailing list