JyotsnaT / xuggle

Automatically exported from code.google.com/p/xuggle
0 stars 0 forks source link

Doing resize and changing color space from YUV to either BGR24 or ARGB AT THE SAME TIME produces erroneous black pixels #92

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
when resampling between color spaces AND changing image size AND the target
image width is NOT a exact multiple of 16 pixels, some pixels will be
blacked out.

to reproduce the bug:

1. create an IVideoResampler which takes as input a YUV420P IVideoPicture
and produces as output an ARGB or BGR24 IVideoPicture at a size different
from the original and with (width % 16 != 0).

2. create an IVideoResampler which performs the reverse operations of the
resampler created in step 1.

3. obtain an YUV420P IVideoPicture which is ideally all white, or at least
not black.

4. resample an IVideoPicture using the first resampler, and feed the result
of that into the second resampler.  if all is configured properly the
resulting image should be a an IVideoPicture of the same size and pixel
type as the original.

NOTES: 

- if the target size is very small a blurry image is produced.  the
blackened pixels are also blurry around the edges and large (scaled up),
which suggests that the error is happening during the first resample.

- if the intermediate pixel type is ARGB, the black pixels appear as column
on the right hand edge of the image.

- if the intermediate pixel type is BGR24, a black pixel appears in the
lower right hand corner of the image.

- find attached the original image and examples of the ARGB and the BGR24
cases.  generally blurriness of the images is NOT at issue.

Original issue reported on code.google.com by tre...@gmail.com on 31 Mar 2009 at 10:12

Attachments:

GoogleCodeExporter commented 9 years ago
Robert included a test (marked with @Ignore) in the
com.xuggle.xuggler.video.ConverterFactoryTest class that reproduces this error.

It is either a bug in VideoResampler.cpp or (more likely) in the current ffmpeg
rewrite (ongoing of swscale).

If this ends up being a high priority for the community we may try to fix in 
ffmpeg,
but for now a work around appears to be always do a color-space conversion 
SEPARATELY
from a image resize.

Original comment by art.cla...@gmail.com on 1 Apr 2009 at 1:01

GoogleCodeExporter commented 9 years ago

Original comment by art.cla...@gmail.com on 2 Apr 2009 at 2:02

GoogleCodeExporter commented 9 years ago

Original comment by art.cla...@gmail.com on 12 May 2009 at 6:23

GoogleCodeExporter commented 9 years ago
any progress on this? its hitting me as well on random movies.

Original comment by sal.sco...@gmail.com on 1 Jul 2009 at 4:23

GoogleCodeExporter commented 9 years ago
No; it's an FFmpeg issue and they haven't fixed it.  Does the workaround not 
work for
you?

Original comment by art.cla...@gmail.com on 1 Jul 2009 at 4:24