BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

streamed jpeg compression

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Eric SIBERT
Guest





PostPosted: Tue Jun 29, 2004 5:18 pm    Post subject: streamed jpeg compression Reply with quote



Hi,

I'm handling large pictures (arround 16,000x16,000). I want to store it
in a jpeg file. To reduce memory use, I don't store the full picture in
memory using a TBitmap. I'm looking for a way to make the jpeg file
with only a small part of my large view rendered in memory, in order to
minimize memory use. Do you have any (free) idea?

Moreover, the underlaying organization of my large picture can be a full
resolution Y picture and the Cr and Cb pictures with half resolution. It
would be nice to use it for optimizing jpeg compression.

--
Eric SIBERT
http://www.ericsibert.com

Back to top
Joris Van Damme
Guest





PostPosted: Tue Jun 29, 2004 10:59 pm    Post subject: Re: streamed jpeg compression Reply with quote



Quote:
I'm handling large pictures (arround 16,000x16,000). I want to store it
in a jpeg file. To reduce memory use, I don't store the full picture in
memory using a TBitmap. I'm looking for a way to make the jpeg file
with only a small part of my large view rendered in memory, in order to
minimize memory use. Do you have any (free) idea?

IJG's LibJpeg supports feeding the compressor scanline by scanline, and
retrieving scanline by scanline from the decompressor. As long as you don't
use stuff like interlacing, this should be ideal for your purposes (meaning
as low as possible buffering and memory consumption, and as high as possible
serial streamed processing).

Take a look at the docs accompanying LibJpeg (they should be distributed
with Delphi), and Borlands interface to it in TJpegImage, that should both
give you a pretty good idea. Furthermore, you should be able to use the
precompiled LibJpeg units distributed with Delphi for these purposes. As far
as 'free' is concerned, that's about the best you can get.

Quote:
Moreover, the underlaying organization of my large picture can be a full
resolution Y picture and the Cr and Cb pictures with half resolution. It
would be nice to use it for optimizing jpeg compression.

I know for sure you can feed LibJpeg compressor the YCbCr, but I don't
remember how exactly (it had to do with overriding the input and output
color space. Instead of first being RGB and second being YCbCr, you should
set them both to YCbCr). More information on this can surely be found in the
same LibJpeg docs. As to the feeding of downsampled Cr and Cb components,
I'm not sure. Quite possibly there's support for this, LibJpeg is quite
wonderfull and its author is very much concerned with good old optimal
behaviour. If not, don't hesitate to ask Tom Lane, I'm sure you'll get a
very good answer.


Joris Van Damme
[email]info (AT) awaresystems (DOT) be[/email]
http://www.awaresystems.be
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html



Back to top
Lord Crc
Guest





PostPosted: Wed Jun 30, 2004 2:11 am    Post subject: Re: streamed jpeg compression Reply with quote



On Tue, 29 Jun 2004 19:18:35 +0200, Eric SIBERT
<courrier (AT) NOericSPAMsibert (DOT) com> wrote:

Quote:
Moreover, the underlaying organization of my large picture can be a full
resolution Y picture and the Cr and Cb pictures with half resolution. It
would be nice to use it for optimizing jpeg compression.

Regular JPEG can easily be downsampled 2:1 in the Cr/Cb channels, just
so you know Smile (it's usually done in the less than maximum quality
settings).

- Asbjørn

Back to top
Eric SIBERT
Guest





PostPosted: Wed Jun 30, 2004 4:39 pm    Post subject: Re: streamed jpeg compression Reply with quote

Quote:
IJG's LibJpeg supports feeding the compressor scanline by scanline, and
[...]


Quote:
Take a look at the docs accompanying LibJpeg (they should be distributed
with Delphi), and Borlands interface to it in TJpegImage,
[...]


Many thanks. I found some parts. Not the documentation. I will look on
the net for it.

--
Eric SIBERT
http://www.ericsibert.com


Back to top
Eric SIBERT
Guest





PostPosted: Wed Jun 30, 2004 4:43 pm    Post subject: Re: streamed jpeg compression Reply with quote

Quote:
Regular JPEG can easily be downsampled 2:1 in the Cr/Cb channels, just
so you know Smile

Indeed, I want to do à 4:4:1. Because size of Cr/Cb channels is NxN when
Y is 2Nx2N.

--
Eric SIBERT
http://www.ericsibert.com


Back to top
Lord Crc
Guest





PostPosted: Wed Jun 30, 2004 8:07 pm    Post subject: Re: streamed jpeg compression Reply with quote

On Wed, 30 Jun 2004 18:43:13 +0200, Eric SIBERT
<courrier (AT) NOericSPAMsibert (DOT) com> wrote:

Quote:
Indeed, I want to do à 4:4:1. Because size of Cr/Cb channels is NxN when
Y is 2Nx2N.

Ah, in that case i distinctly remember ijl takes a parameter for the
sampling frequency for each channel.

- Asbjørn

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.