[FFmpeg-devel] [PATCH] lavfi/rotate: support few more pixel formats

Stefano Sabatini stefasab at gmail.com
Mon Jul 8 13:45:54 CEST 2013


On date Friday 2013-07-05 20:13:07 +0000, Paul B Mahol encoded:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavfilter/drawutils.c              | 15 ++++++++++++++-
>  libavfilter/vf_rotate.c              |  4 ++++
>  tests/ref/fate/filter-pixfmts-rotate |  7 +++++++
>  3 files changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
> index b230761..2aff682 100644
> --- a/libavfilter/drawutils.c
> +++ b/libavfilter/drawutils.c
> @@ -70,7 +70,20 @@ int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t
>  
>      *is_packed_rgba = ff_fill_rgba_map(rgba_map, pix_fmt) >= 0;
>  
> -    if (*is_packed_rgba) {
> +    if (pix_fmt == AV_PIX_FMT_GBRP || pix_fmt == AV_PIX_FMT_GBRAP) {
> +        int plane;
> +
> +        for (i = 0; i < 4; i++)
> +            dst_color[rgba_map[i]] = rgba_color[i];
> +
> +        for (plane = 0; plane < 4; plane++) {
> +            pixel_step[plane] = 1;
> +            line[plane] = av_malloc(w);
> +            memset(line[plane], dst_color[plane], w);
> +        }
> +        if (rgba_map_ptr)
> +            memcpy(rgba_map_ptr, rgba_map, sizeof(rgba_map[0]) * 4);
> +    } else if (*is_packed_rgba) {

Maybe since rotate is the only user, we should get rid of it and use
the new drawutils interface instead.

[...]
-- 
FFmpeg = Frightening and Fanciful Mournful Practical Entertaining Gymnast


More information about the ffmpeg-devel mailing list