[Ffmpeg-devel] Re: Cropping / Padding patches

Baptiste COUDURIER baptiste.coudurier
Tue Mar 14 00:35:59 CET 2006


Hi

Luca Abeni wrote:
> [...]
> 
> The behaviour of ffmpeg after applying these three patches should not
> change... I did some tests, and everything is ok. If someone is
> currently using cropping, padding and rescaling can he/she test the
> patches and check that they not introduce any regressions?

I think it changes.

> [...]
> -    if (ost->video_resample) {
> +    if (ost->video_pad) {
>          final_picture = &ost->pict_tmp;
> [...]
> +	/* FIXME: PIX_FMT_... */
> +        if (img_crop((AVPicture *)&picture_pad_temp, (AVPicture *)final_picture, PIX_FMT_YUV420P, ost->padtop, ost->padleft) < 0) {
>              av_log(NULL, AV_LOG_ERROR, "error cropping picture\n");
>              goto the_end;
>          }

Is cropping needed ?

> @@ -851,28 +851,28 @@
>          final_picture = formatted_picture;
>      }
>  
> -        if (enc->pix_fmt != PIX_FMT_YUV420P) {
> -            int size;
> +    if (enc->pix_fmt != PIX_FMT_YUV420P) {
> +        int size;
>
> [...]
>
>          }
> +    }
>      /* duplicates frame if needed */
>      for(i=0;i<nb_frames;i++) {
>          AVPacket pkt;

Isnt that top level ? Doing that always convert to yuv420p.

> [...]

My suggestion is to first fix picture processing to operate on all yuv
planar formats. Cropping already does, padding should be converted as
well, I suggest moving fill_pad_region to img_pad in imgconvert.c

I'll try to submit a patch soon, or do you want to do it Luca ?

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312





More information about the ffmpeg-devel mailing list