[Ffmpeg-devel] [PATCH] fix error croping

Limin Wang lance.lmwang
Tue Apr 3 13:00:51 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

> >Hi,
> >
> >>>$subj, please review it. If your input yuv is 422 packet format, then
> >>>you'll failed to crop.
> [...]
> >Index: ffmpeg.c
> >===================================================================
> >--- ffmpeg.c	(revision 8565)
> >+++ ffmpeg.c	(working copy)
> >@@ -715,7 +715,7 @@
> >         return;
> > 
> >     if (ost->video_crop) {
> >-        if (av_picture_crop((AVPicture *)&picture_crop_temp, (AVPicture 
> >*)in_picture, dec->pix_fmt, ost->topBand, ost->leftBand) < 0) {
> >+        if (av_picture_crop((AVPicture *)&picture_crop_temp, (AVPicture 
> >*)in_picture, enc->pix_fmt, ost->topBand, ost->leftBand) < 0) {
> I do not think this is ok... At this point, the image is still in the 
> decoder pixel format. Telling av_picture_crop() that it is in a 
> different format might lead to a wrong result.
> 
> I think the correct solution is to implement support for the desired 
> pixel format in av_picture_crop().

So the next picture pading should use enc->pix_fmt instead of dec->pix_fmt?
For padding is OK and I check it uses enc->pix_fmt, based on this I try with
enc->pix_fmt for crop, and the fact is the crop test result is OK. 

So maybe other place has bug, by my understanding after decode, the pix_fmt
should be yuv420 instead of yuv422 packed format still. My input is yuv422
packed format and output is h264.

Thanks,
Limin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBRhIz40ztbf7dKiuoAQLVQgf/VSi3ml1arVU0rii2J1Bco0kBAW3VxySR
c4MyL+Afno4dokpYWvul5S6RZXiNaG+NfcZRA9w15TfGyuuY6hmL5Vqdm/o+vZEC
YLxkvcgpTQummewlUNF0mhAYSWKNWmm6DEbpALzb4Jf/r0gsx4O2YGoLr7dp0eGY
xLtDtF2Mxb9mNsn6r+uVwV4eoO0Xizo7D7P6UUuiQt1wvInwWeMUbgQIIDOtPh4Y
/4Roltbcrg5qCc3CZno0FgPal6f+N7mxgNRhoWr7KpRnHwDNVzb//GNS7glZqLx8
JM+hze/cX0Lt1aeUPa34RCIStgHdbo4fd8NBQVSCI0yr3o65eRGa7A==
=vBFG
-----END PGP SIGNATURE-----




More information about the ffmpeg-devel mailing list