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

Paul B Mahol onemda at gmail.com
Mon Jul 8 14:08:55 CEST 2013


On 7/8/13, Stefano Sabatini <stefasab at gmail.com> wrote:
> 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.

This IS drawutils.

>
> [...]
> --
> FFmpeg = Frightening and Fanciful Mournful Practical Entertaining Gymnast
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list