[FFmpeg-devel] half vertical chroma resolution from JPEGs..

Andreas Öman andreas
Sat Jul 14 11:36:38 CEST 2007


Hi

Michael Niedermayer wrote:
> Hi
> 
> see the thread about " [PATCH] MJPEG wrongly displayed with vertical YUV422"

Ah, thanks

> also the patch is ok only if it works with swscaler too
> 

It works, but when dealing with large images, swscale seem
to crash (i doubt this is related to yuv440 images only)
If I compile without libswscale, it works fine.

After some valgrinding (see below) i suspected the

c->lumPixBuf[i]= c->lumPixBuf[i+c->vLumBufSize]= av_mallocz(4000);

-line. Just setting it to 8000 makes it work all fine, but i
believe the real solution is to compute this value, but how?
I dont know the swscale internals enough to figure that out.



$ valgrind ./ffmpeg -i mallan.jpg  -f image2 mallan.png
FFmpeg version SVN-r9475, Copyright (c) 2000-2007 Fabrice Bellard, et al.
   configuration: --enable-gpl --enable-swscaler --cpu=pentium-m 
--disable-strip
   libavutil version: 49.4.1
   libavcodec version: 51.40.4
   libavformat version: 51.12.1
   built on Jul 14 2007 11:30:13, gcc: 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
Input #0, image2, from 'mallan.jpg':
   Duration: 00:00:00.0, start: 0.000000, bitrate: N/A
   Stream #0.0: Video: mjpeg, yuvj440p, 2304x3072, 25.00 fps(r)
Output #0, image2, to 'mallan.png':
   Stream #0.0: Video: png, rgb24, 2304x3072, q=2-31, 200 kb/s, 25.00 fps(c)
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
==17610== Invalid write of size 4
==17610==    at 0x83FCC77: swScale_MMX (swscale_template.c:2311)
==17610==  Address 0x42280A0 is 0 bytes after a block of size 4,000 alloc'd
==17610==    at 0x4020820: memalign (vg_replace_malloc.c:332)
==17610==    by 0x83EB026: av_mallocz (mem.c:61)
==17610==
==17610== Invalid read of size 2
==17610==    at 0x83ED7FD: yuv2packedXinC (swscale.c:736)
==17610==  Address 0x42280A0 is 0 bytes after a block of size 4,000 alloc'd
==17610==    at 0x4020820: memalign (vg_replace_malloc.c:332)
==17610==    by 0x83EB026: av_mallocz (mem.c:61)
==17610==
==17610== Invalid read of size 2
==17610==    at 0x83ED80A: yuv2packedXinC (swscale.c:736)
==17610==  Address 0x42280A2 is 2 bytes after a block of size 4,000 alloc'd
==17610==    at 0x4020820: memalign (vg_replace_malloc.c:332)
==17610==    by 0x83EB026: av_mallocz (mem.c:61)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 440.diff
Type: text/x-patch
Size: 3330 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070714/64685d96/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 440_swscale.diff
Type: text/x-patch
Size: 1527 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070714/64685d96/attachment-0001.bin>



More information about the ffmpeg-devel mailing list