[FFmpeg-devel] [PATCH] Add scale filter

Stefano Sabatini stefano.sabatini-lala
Tue Nov 10 15:48:16 CET 2009


On date Tuesday 2009-11-10 06:53:22 +0100, Vitor Sessak encoded:
> Stefano Sabatini wrote:
>> On date Sunday 2009-11-08 19:17:57 +0100, Stefano Sabatini encoded:
>>> On date Sunday 2009-11-08 03:55:15 +0100, Michael Niedermayer encoded:
>>>> On Sun, Nov 08, 2009 at 01:45:10AM +0100, Stefano Sabatini wrote:
>>> [...]
>>>>>  doc/libavfilter.texi     |   25 +++++
>>>>>  libavfilter/Makefile     |    1  libavfilter/allfilters.c |    1 
>>>>>  libavfilter/vf_scale.c   |  203 
>>>>> +++++++++++++++++++++++++++++++++++++++++++++++
>>>>>  4 files changed, 230 insertions(+)
>>>>> 52fe47370a211f1b3e4f17573d8bc5139af5d371  add-scale-filter.patch
>>>> ok if extensively tested and it passes all tests
>>> I'll apply it soon, of course this won't make the codectest pass, as
>>> the scale filter currently doesn't allow to set the swscaler
>>> algorithm.
>>
>> Also there are some problems with PAL formats.
>>
>> I only tried with the samples:
>>
>> V-codecs/CVID/palette/catfight Tag team DT.mov
>> avi/palette_change/toon.avi
>>
>> and both show a palette randomization.
>
> Does the attached patch fixes it? Probably not a lavfi bug  
> (av_picture_copy() using linesize[] in a senseless way)...
>
> -Vitor

> Index: libavcodec/imgconvert.c
> ===================================================================
> --- libavcodec/imgconvert.c	(revision 20294)
> +++ libavcodec/imgconvert.c	(working copy)
> @@ -1179,9 +1179,7 @@
>                         src->data[0], src->linesize[0],
>                         width, height);
>          /* copy the palette */
> -        ff_img_copy_plane(dst->data[1], dst->linesize[1],
> -                       src->data[1], src->linesize[1],
> -                       4, 256);
> +        memcpy(dst->data[1], src->data[1], 4*256);
>          break;
>      }
>  }

We got a bingo!!

src->linesize[1] is set to 0 for pal formats, so that's wrong for
sure.

This fixes the problem, which is issued when the paletted image is
copied in the picref (such a copy doesn't happen in the main repo
ffmpeg).

Thanks Vitor, regards.
-- 
FFmpeg = Fast Fiendish Mastodontic Ponderous Exuberant Ghost



More information about the ffmpeg-devel mailing list