[ 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

Reply via email to