f



How to compress YUYV with libjpeg?

Hello folks,

this is probably an easy one... given an image in YUYV color space (Y0 U0
Y1 V0 Y2 U2 Y3 V2... ; 8 bit Y stored for every pixel and 8bit U/V stored
for every other pixel), is there a straightforward way to store it using
libjpeg, or do I first have to create full 24bit YUV triplets before
passing the scanlines into libjpeg? I couldn't really understand this from
the libjpeg doc, and my experiments so far have yielded a lot of garbage.

I have successfully dealt with RGB data using libjpeg, but since I
understand that libjpeg uses YUV (or YCbCr) internally, I thought I might
want to skip the redundant color space conversions.

Thanks,
**Daniel


-- 
"With me is nothing wrong! And with you?" (from r.a.m.p)
0
Daniel
5/10/2004 4:26:01 PM
comp.compression 4696 articles. 0 followers. Post Follow

1 Replies
4053 Views

Similar Articles

[PageSpeed] 1

Daniel Haude wrote:
> 
> this is probably an easy one... given an image in YUYV color space (Y0 U0
> Y1 V0 Y2 U2 Y3 V2... ; 8 bit Y stored for every pixel and 8bit U/V stored
> for every other pixel), is there a straightforward way to store it using
> libjpeg, or do I first have to create full 24bit YUV triplets before
> passing the scanlines into libjpeg? I couldn't really understand this from
> the libjpeg doc, and my experiments so far have yielded a lot of garbage.
> 
> I have successfully dealt with RGB data using libjpeg, but since I
> understand that libjpeg uses YUV (or YCbCr) internally, I thought I might
> want to skip the redundant color space conversions.

Read the section "Raw (downsampled) image data" in libjpeg doc.
Problem is you not only want to bypass color conversion, but also
color downsampling, since your input format already has downsampled
color, though in weired component order.  Particularly, your input
format has 2x1 horizontal downsapled color in JPEG notation (4:2:2
in video notation).
In order to pass this format unaltered through JPEG compression,
you have to supply to the JPEG library the image in JSAMPIMAGE/JSAMPARRAY
format.  That is, you have to supply each of the Y, U, and V components
in *separate* sample arrays!  libjpeg doc describes this in the
"Raw (downsampled) image data" section.

Regards
Guido
0
Guido
5/12/2004 12:59:35 PM
Reply:

Similar Artilces:

compressing compressed video
Is it possible to noticeably compress already compressed video (DivX/MPEG) even futher using a loseless compression program? Which programs offer the highest compression radios in this case? copx copx wrote: > Is it possible to noticeably compress already compressed video (DivX/MPEG) > even futher using a loseless compression program? Yes, but not by much if at all. The most lossless compression I have seen of an .AVI occured because the PCM audio was uncompressed. The only .AVIs you'll see major compression occur is when there is so much redundant information in a frame or ...

compress utility != Compress::Zlib::compress() on linux and Windows
For some reason when the compress utility is used to create a .Z file, the result is not recognized by the Compress::Zlib uncompress() function (on either Linux or Windows). And it turns out that Compress::Zlib::compress() produces a _different_ .Z file. Editing the two seems to show that the contents are the same after a certain point and thus the headers differ. DOH! I am running with perl v5.8.6, in which Compress::Zlib v1.33 is bundled. (v1.34 was released in 2005-01; but I doubt if 1.33 is drastically out of date.) Can anyone shed some light on this? If so, you'll be doing better ...

Compressing compressed files?
I have a really crazy idea: Supposing you took a compressed file (any format) and pass it to a bijective decompressor,In principle the data should become less random. After that you can recompress the data with a superior algorithm. My reasoning is as follows: The set of input data for most general purpose compression algorithms tends to overlap. Within a certain margin , the set of compressed files overlaps too. I tried this out on a couple of files with David Scott's BICOM but I didn't get any positive result. My idea was that since PPMII does 40 - 50 % better than ZIP and there ...

To Compress or Not To Compress -- That is the Question !
Hi: I'm running a website (I have three sites on my older Dell -- Pentium 4 with 2GB of Memory and a 350Gig Harddrive) with an xHarbour .exe as the CGI 'script'. If I have many simultaneous clients, is there a significant benefit or penalty to compressing the .exe ? Currently, one of the compressed executables is 486,400 bytes. Uncompressed, it is 1,076,224 bytes. I welcome your opinions. Thanks. -Mel Smith -- Mel Smith Mel, In case of your setup IMHO the compressed .exe has no advantages, the decompressing operation ( aka UnZip ) - eats the serv...

Further compress a already compressed file
Dear all, My question is, can a compressed file be further compressed by the same compression algorithm or other compresssion algorithm? Why or Why not? My experimental result is. Yes, it can be further compressed by a considerably amount. (sometimes 50%) Is that theoratically possible? This is against the impression I used to have. Can some one kindly answer my question or give me some reference. Thanks, - detailed description ------------------------------------- compression library : LZO my data set : binary data. I have a program that uses lzo library to com...

compressing an already compressed archive
Hi all, why it is said that compressing an already compressed archive will not have much benefit , independent of the algorithm being used ? annalissa <aarklon@gmail.com> wrote: > why it is said that compressing an already compressed archive will > not have much benefit , independent of the algorithm being used ? Well, it isn't true in general, but is usually for reasonable compression algorithms. Some time ago I was working on a program to generate PDFs of scanned images. First I did the run-length compression, as that was pretty easy. Then I added LZW, but didn't...

Compress an already compressed Jpeg
We are trialing some software that very basically allows your average Joe with the correct client software installed send an image file via the internet to a server running the server side of this software. While this is already very easy to do with a bit of HTML code and asp/php e.t.c to receive and manipulate the file. This software claims to compress the image before it is sent and then decompress the server end with no loss using file compression rather than further image compression. What's more it claims it compresses them up to 80% compression before transfer! While I can believe t...

Compression Qs from a Compression Newbie
When compressing something, what are all the factors used to evaluate how helpful / good the compression method is, in general, and in a specific use? I am interested in finding ways to compress combinations of data that include time / date information about the functioning of an operating system, video data collected under the same o.s., and parts of the o.s. software itself. Does anyone have any experience with anything like this and would anyone have any helpful pointers? I am hoping that patterns or redundancies in the data can be used to compress it. Any helfup input appreciated, Matt ...

How compress a string into a compressed string?
Hi! I use VC++.NET 2003. I want to compress following text string. I store following text in std::string. std::string a="2B3A2BF0BCD8773D23BEE5550A56E86AF6CF64911214862625027CE7032451282E33F0BFB09D69091D39B1A1788E1A707E50A1948038500CF2044163F379912AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2379E2E7AD8B59848C7670C94B29B54D2...

compress
Hi, list, did somebody experienced that behaviour? (there are no concurrent sessions) mmm@APPL> select count(*) from t_noc; COUNT(*) ---------- 4506664 mmm@APPL> alter table t_noc move compress; Tabelle wurde ge�ndert. mmm@APPL> select count(*) from t_noc; COUNT(*) ---------- 4506722 I could reproduce this on 9.2.0.6 as well 9.2.0.4 on linux, i'd searched Metalink on this issue, but found nothing similar. I'll open an iTAR tomorrow, but, maybe, its a known bug, so any expirience will be appreciated. The only thing i can suspict at the moment - there are 2 colu...

AAC compression chips? Other compression chips?
Dear All, I'm looking for inexpensive hardware solution (chips) to encode groups of 6 channel 44/48k signals into streams of preferably AAC. Or WMA or MP3 or AC-3 if it is simpler. The idea is that signal is input as regular 48k/24bit pcm, than the user can select compression DR (eg 64kbps for 12 channels or 128kpbs for 6 channels) and the circuit will spit out serial encoded data in a RS422 like format to be tranmitted through a radio link. At the receiving end a decoder would reverse the above, I can see quite a few decoder chips. Is there an audio encoder chip out there? (other t...

Index compression vs. table compression
Hello I run Oracle 9.2.0.5 on a RedHat AS 2.1 box with 8 Xeon CPUs. There is a clear mismatch between the overwhelming computer power and the poor disks attached. I am contemplating to setup a tablespace with compression and a blocksize of 16K (queries are of Data Warehouse type), and the corresponding 16k db cache (there is enough RAM), in order to take better advantage of this situation (the standard blocksize is 8K). That is quite simple to do. A simple "alter table xxx move compress tablespace DWH_16C" should do it. But with indexes, there is a difference I don't quite unde...

Determine compression method from compressed data
Hi; Maybe one of you recognizes some characteristic bits in the stream described below. My goal is to find a way to compress a different stream so that the same given decoder will be able to decompress it, but I haven't yet been able to determine the compression method nor its parameters. There is no header (no gzip,arj,...). Data is stored in contiguous chunks; each prefixed with one big-endian 16-bit word specifying the expected length (in bytes) of the chunk when uncompressed, and a second word specifying the number of bytes following in the compressed chunk. The uncompressed length...

vmzcore.NN not in compressed format but compressed?
I'm looking for a 60-ft bungee cord and a 40-ft bridge.... I'm trying to analyze a crash dump. Here is the current issue: # pwd /usr/adm/crash # # ls *.28 crash-data.28 vmunix.28 vmzcore.28 # # file *.28 crash-data.28: ascii text vmunix.28: COFF format alpha executable or object module not stripped - version 3.13-14 vmzcore.28: compressed memory image(dump) file # # # ln -s vmzcore.28 vmzcore.28.Z # # zcat vmzcore.28.Z | dd of=/tmp/vmcore.28 conv=sparse vmzcore.28.Z: not in compressed format 0+0 records in 0+0 records out # # So the file ...

Web resources about - How to compress YUYV with libjpeg? - comp.compression

compress - Wikipedia, the free encyclopedia
Compress is a Unix shell compression program based on the LZC compression method, which is an LZW implementation using variable size pointers ...

Data Compress: Saves you money on the App Store
Read reviews, compare customer ratings, see screenshots, and learn more about Data Compress: Saves you money. Download Data Compress: Saves you ...

Time to compress our thinking about the NBN
Are we really the smart country? Or are we just dumb jerks lucky enough to occupy a hunk of rock whose geographic isolation makes us astonishingly ...

FileOptimizer can compress 33 different formats
Recently we took a look at PNGGauntlet , an excellent tool which could compress PNG files by up to 50 percent without any apparent loss of quality. ...

Compress data more densely with Zopfli
By Lode Vandevenne, Software Engineer, Compression Team Cross-posted with the Google Open Source Blog The Zopfli Compression Algorithm is a ...

Compress A Bunch Of Files Into One Zip Archive For Easier Sharing
I remember back in the olden, pre-OS X days, when you’d need to use a utility like Stuffit to compress a bunch of files together into one archive, ...

All the ghostly sounds that are lost when you compress to mp3
A song made with only the sounds that were left out when compressing Suzanne Vega's "Tom's Diner" to mp3.

Google Chrome for Android, iOS Now Compress Data for Users
Data compression, which will reduce data usage and save money for mobile users, is one of several new features in the latest Chrome browser updates ...

NKE Sales, Multiple to Compress, Analyst Says
Citing an inventory build and other factors, consumer analyst Camilo Lyon believes a sales slowdown may occur at Nike (NKE)

Opera is teasing Max app to compress all your mobile pics and videos
Opera is getting ready to release its mobile data compression app Max to a wider audience: The browser maker opened up preregistration for a ...

Resources last updated: 2/13/2016 12:23:49 AM