Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
#1 | Link |
|
Registered User
Join Date: Feb 2002
Posts: 19
|
Intercoding in lossless video compression?
I'm a bit new to the concepts of data compression, but something occured to me after looking at Huffyuv. It sounds to me like Huffyuv basically operates as a lossless MJPEG compressor would; it uses predictive coding followed by a modified-huffman entropy encoder. In other words, there is no temporal compression whatsoever. Now, it seems to me that for a given pixel in a frame of video, there is a higher correlation between it and the corresponding frame in the previous picture than the pixel or few pixels around it in its frame.
So, my question is basically this: Would it make sense, or would it even be possible, to make a lossless video codec that used some form of intercoding to produce relatively good compression ratios compared to current lossless compressors like Huffyuv or lossless MJPEG? I'm doing some work that requires a lossless intermediate format, so if this is possible, then I would be very interested. |
|
|
|
|
|
#2 | Link |
|
Registered User
Join Date: Oct 2001
Posts: 1,459
|
Once I made such, but since it wasn't as effective as huffyuv I only released the LZW version (http://vobsub.edensrising.com/codecs/codecs.html). The intra frames were about 20-30% smaller.
|
|
|
|
|
|
#3 | Link |
|
Kilted Yaksman
Join Date: Oct 2001
Location: South Carolina
Posts: 1,303
|
Cool, I was actually planning on forking XviD into a lossless codec (maybe even using PNG as the lossless step), and was interested in the kind of savings a motion estimation step would give us in a lossless codec.
Time is against me though ![]() -h |
|
|
|
|
|
#4 | Link |
|
Registered User
Join Date: Feb 2002
Posts: 19
|
small update
I've been looking into how this kind of compression could work out, and I realized something. It seems low motion parts of videos work better with intercoding, while high motion parts work better with intracoding. So, maybe the best system would involve using some kind of macroblock system like MPEG does, except instead of using the the blocks with motion vectors and stuff, use them for determining which compression method would be better for that particular part of the frame being encoded. I'm going to try to post a comparison between intracoding and intercoding soon...
|
|
|
|
|
|
#5 | Link |
|
Kilted Yaksman
Join Date: Oct 2001
Location: South Carolina
Posts: 1,303
|
Re: small update
I've been looking into how this kind of compression could work out, and I realized something. It seems low motion parts of videos work better with intercoding, while high motion parts work better with intracoding. So, maybe the best system would involve using some kind of macroblock system like MPEG does, except instead of using the the blocks with motion vectors and stuff, use them for determining which compression method would be better for that particular part of the frame being encoded. I'm going to try to post a comparison between intracoding and intercoding soon...
I think the most crucial part of lossless image coding is getting the residual as small as possible - I can imagine having not only 16x16 and 8x8 vectors as per MPEG-4, but 8x4 or even 4x4 as well in an attempt to get the error information as close to 0 as possible. Motion vectors can require comparitively quite a few bits in MPEG-4 due to the residual being quantized, however in a lossless situation the reverse would be true - you'd want to spend as much on the vectors as possible to get the residual smaller. It all depends on what kind of cases you tweak your entropy coder for I suppose. -h |
|
|
|
|
|
#6 | Link |
|
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, Gardelegen
Posts: 1,464
|
There are already a few standard codecs available which use lossless coding combined with delta frames; AFAIR, there are e.g. MS-RLE8 AVI codec at 8 bit, or the Apple QuickTime Video codec (lower quality settings might work lossy by introducing longer runs of identical colors as replacement for very similar colors, if I detected that well).
The usual approach here is to introduce a special code for a "transparent" (as representation for "unchanged") run of pixels. Then it works similar to animated GIFs with partly transparent overlay images, which encode only the changes to the previous, still underlying image. I rather doubt that such codecs will work remarkably more efficient on natural image sources; especially randomly noisy material will kill the delta frame technology; "grain" (temporally blended noise) instead might not hurt so much, therefore preprocessing with a "temporal smoother" like filter shall be very recommendable... |
|
|
|
|
|
#7 | Link |
|
Registered User
Join Date: Oct 2001
Location: DE
Posts: 122
|
Waveet Compression
-h: (codec -> png)
have a look at http://www.maven.de -> code -> wavelet image compression. certainly beats png on natural images, source included.
__________________
[maven] - Wavelet Image Compression Library |
|
|
|
|
|
#8 | Link |
|
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, Gardelegen
Posts: 1,464
|
The fact that wavelets can beat JPEG in still image compression (perceptual quality versus data size) is proven at least since LuRaWave; unfortunately, LuRaTech is broke, therefore we might probably never get a motion video codec out of this house.
PicVideo's wavelet codec couldn't convince me, it requires a much bigger bandwidth than MPEG4 to achieve a comparable quality. And it is absolutely not lossless, even with its highest quality setting! {Dear maven: Can your codec on one hand encode losslessly at a comparable compression factor, and on the other hand is it useful for lossy motion compression (e.g. is it easy to get better compression with interframes)?} And something more about PNG compression for a lossless codec: a "Multi-image PNG" file format (MNG) already exists, it is used e.g. by AnimationShop 3 (part of PaintShop Pro 7), and I remember having found an implementation as Delphi unit at www.delphi32.com once. Last edited by LigH; 13th April 2002 at 14:44. |
|
|
|
|
|
#10 | Link |
|
Registered User
Join Date: Oct 2001
Location: DE
Posts: 122
|
patents / lossless - lossy
LigH:
it compresses lossless and lossy very well, but i have to admit that i haven't thrown motion fields at it (yet). bullitB: no patents AFAIK, but as i did not try to consciously avoid them, it's entirely possible that i violated some. but i would not know what you could patent in there, it's all very straightforward...
__________________
[maven] - Wavelet Image Compression Library |
|
|
|
|
|
#11 | Link |
|
Kilted Yaksman
Join Date: Oct 2001
Location: South Carolina
Posts: 1,303
|
Re: patents / lossless - lossy
it compresses lossless and lossy very well, but i have to admit that i haven't thrown motion fields at it (yet).
You are awesome. I had my doubts regarding its ability to deal with block-copy-style blocking artifacts, but it all looks good. A little creative re-ordering of motion-compensated blocks would have it performing a bit better I dare say. -h |
|
|
|
|
|
#12 | Link |
|
Xe-Rotaredom
Join Date: Oct 2001
Location: Croatia
Posts: 1,029
|
Did anyone tried this?
LCL (Loss-Less Codec Library) by Oshima-san
"LCL is Loss-Less Codec for Video For Windows. Since LCL is a lossless codec, it does not have degradation of quality. LCL is suitable for digital animation or the animation of 3DCGs. LCL contains two kinds of codecs. AVIzlib: Is the high compression codec which uses zlib. AVImszh: It is a codec for digital animation." http://www.geocities.co.jp/Playtown-Denei/2837/
__________________
"Only those who attempt the absurd achieve the impossible." |
|
|
|
|
|
#13 | Link |
|
VDubMod Devel
Join Date: Oct 2001
Location: Germany
Posts: 826
|
Heh, I had thought about someting similar a few weeks ago, but never actually came around to follow it.
So here are my 5 euro cents on that, tough I havent looked into it: - mplayer actually seems to support MNG in avis, so we just would need some windoze codec for it. Albeit, I havent checked what it actually produces. - Theres a MNG Library at source forge, tough it seems mainly to do something like animated gifs in png. @gabest: I remember using your codec a long time ago, it gave me better compression on that source (cant remember what itr was, thoug) than HuffYuv. My system was just too slow to use it for capturing (Hm, gotta retry that with my current one). Regards Belgabor Last edited by Belgabor; 14th April 2002 at 18:58. |
|
|
|
|
|
#14 | Link | |
|
Registered User
Join Date: Jan 2002
Location: Between a clown and a mime, holding an uzi to each head.
Posts: 79
|
Re: Re: small update
Quote:
Last edited by Sarreq Teryx; 14th April 2002 at 19:43. |
|
|
|
|
|
|
#15 | Link | |
|
VDubMod Devel
Join Date: Oct 2001
Location: Germany
Posts: 826
|
Re: Did anyone tried this?
Quote:
- None of the codecs was able to compress during capturing on my system (1.4 GHz Athlon), and from the Framedrops, I suspect it wont work on any public available system currently in existance (well, perhaps on a dual P4 2 GHz )- On natural video HuffYuv gave the best results (= samllest size). - On anime, HuffYuv was third after AVIzlib (max. compression, smallest size) and AVIzlib (max. speed) If someones interested, I can post exact results. Regards Belgabor P.S: AVIzlib has a also a 'normal' mode, which didnt give any compression at all (imho). Last edited by Belgabor; 15th April 2002 at 11:13. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|