[Ffmpeg-devel] img_convert() ???

Michael Niedermayer michaelni
Wed Mar 22 13:49:12 CET 2006


Hi

On Wed, Mar 22, 2006 at 01:20:31PM +0100, Luca Abeni wrote:
> Hi all,
> 
> I am feeling very stupid, but...
> When trying to modify ffmpeg.c to directly use swscaler interface, I
> found something that looks strange around line 629 of ffmpeg.c:
> 
>       if (do_deinterlace){
>             if(avpicture_deinterlace(picture2, picture,
>                                      dec->pix_fmt, dec->width, dec->height) < 0) {
>                 /* if error, do not deinterlace */
>                 av_free(buf);
>                 buf = NULL;
>                 picture2 = picture; 
>             }
>         } else {
>             if (img_convert(picture2, dec->pix_fmt, picture,
>                             dec->pix_fmt, dec->width, dec->height) < 0) {
>                 /* if error, do not copy */
>                 av_free(buf);
>                 buf = NULL;
>                 picture2 = picture;
>             }
>         }
> 
> Now, what's the purpose of this img_convert? It seems that it's just
> copying picture in picture2, No? So, why not using img_copy? Also, why
> is a copy needed at all? I think I am really missing something here...

i think that the
if (do_deinterlace || using_vhook) {
before this explans half of it

either we need deinterlacing or we do some filtering with vhook which
will modify the image IIRC and lavc exports its internal buffers which dont
like being modified

[...]
-- 
Michael





More information about the ffmpeg-devel mailing list