On Fri, Apr 3, 2009 at 4:43 PM, Marc Mason <[email protected]> wrote:
> [ Edwin, I have moved your reply below my original question in order for the
> text to flow in chronological order. ]
>
> Marc Mason wrote:
>>>
>>> I'm trying to use lavc on an embedded platform to solve what is in fact a
>>> very simple problem. I need lavc to decode a single JPEG image into a
>>> user-supplied buffer.
>>>
>>> The image might be "large" e.g. 4000x3000 (resulting in an uncompressed
>>> size
>>> of 36 MB). The user-supplied buffer is allocated through some
>>> platform-specific code (not malloc).
>>>
>>> Ideally, lavc would provide something like the following
>>>
>>>  int decode_jpeg(char *filename, uint8_t *buf, int bufsiz);
>>>
>>> where decode_jpeg() would open the JPEG file named by filename, decode it
>>> to
>>> an RGB bitmap (3 bytes per pixel) and store the result in buf (up to a
>>> limit
>>> of bufsiz).
>>>
>>> The result would be the number of octets written to buf, or some negative
>>> value in case of error.
>>>
>>> Do you know of some such function in lavc or lavf?
>
> Edwin van der Horst wrote:
>>
>> you'd better use something like libjpeg for that, it's better suited
>> for that goal and has a good interface for your own memory management.
>>
>> http://www.ijg.org/
>
> Edwin,
>
> First of all, thanks for the pointer.
>
> The platform I'm running on has a 266 MHz SH-4 CPU.
> http://en.wikipedia.org/wiki/SuperH#Models
>
> I've compiled libjpeg with gcc -O3
>
> I have a sample "large" picture (3072 x 2304) with little compression
> (quality setting = 100) where the resulting file "weighs" 4.3 MB.
>
> Decoding this picture takes 5.7 seconds. I'm afraid this is too long for the
> typical user.
>
> Is there any chance the lavc implementation would perform better?
>
> --
> Regards.
>
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>

Marc,

In my case the MJPEG encoder of lavc did indeed perform better,
but I think that's because I was able to compile it with the arm5
optimizations (using a pxa270 processor).
Best way to find out is to try it yourself...
Open the file, provide the data in the right format to the codec,
use the MJPEG encoder to encode a single frame (you can ofcourse
provide the buffer where to encode to yourself).
I don't know how well the encoder handles these large files though...
that's why I pointed to the libjpeg.

Edwin
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to