Log in

View Full Version : Wavelet Codec


bergi
10th April 2003, 15:10
If someone is intersted in my new codec, here is a very early version of my wavelet based codec.

Features:
- vfw codec
- keyframes only (now)
- lossless compression
- works in yuv12 format (now only rgb24 input and output, but internal it's yuv12)
- image size must be a multiple of 2
- no configuration ;-)
- many bugs ;-)
- very fast ;-)


now it's only a alternative of huffyuv, but i want to add a lossy mode, delta frames, ... (if i have time)

DaveEL
10th April 2003, 18:21
Storage as YV12 is not lossless unless your source is yv12. and the conversion from yv12 -> rgb -> yv12 is not lossless.

DaveEL

ChristianHJW
11th April 2003, 02:53
Interesting. If you want to go opensource one day and want me to help as organizer ( but not the next 6 months ) gimme a shout ...

bergi
11th April 2003, 06:13
Storage as YV12 is not lossless unless your source is yv12. and the conversion from yv12 -> rgb -> yv12 is not lossless.

I will add yuv12 innput soon, but with rgb input you can do better tests. The codec is designed for avisynth 2.5 input and most of time it's yuv12 -> lossless. Some time ago i have read something about modify huffyuv for yuv12, so i think many people want something like this. Yesterday i hadn't enough time to do more tests, but i think my wavelet codec can do better compression than huff.

Guest
14th April 2003, 20:23
If the output is RGB, then you must be upsampling YV12 to RGB. There are two ways to do that depending on whether the source is interlaced or progressive. Do you support both modes of upsampling via a configurable option?

bergi
15th April 2003, 11:00
i thought interlaced is dead ;-). Only resize the 1x1 uv pixels to 2x2 rgb pixels. But, remeber it's a early alpha version. I've already made some changes:
- split the vfw codec and libbw
- libbw supports already yv12 input and output

todo in the next days:
- add yv12 to vfw codec
- add config dialog to the vfw interface (libbw already supports lossy compression)

Guest
15th April 2003, 13:00
Originally posted by bergi
i thought interlaced is dead ;-). Like your codec will be if you don't support it.

Blight
16th April 2003, 01:08
To paraphrase neuron2,
Most lossless video codecs are used for video-capture. And alas, video-capture is mostly interlaced.

bergi
16th April 2003, 10:52
This was just a joke. As i said before, it's an early alpha version. I only know about progressive upsampling. Do you have some pdf's or know some web pages about interlaced upsampling? Then i'm going to add this feature to my codec.
There is a also a new version of my codec, you can download it at my homepage (http://www.bergos.org). My homepage is in german only, but i'm sure you will find it (lock at "Programme").

Guest
17th April 2003, 15:28
This should tell you everything you need to know:

sh0dan
28th April 2003, 08:49
Sorry, neuron, but you are slightly off:

In YV12, chroma is placed half a line BELOW the luma line, so you need to reinterpolate, when you upsample from YV12 to YUY2.

Attached drawing in this thread (http://forum.doom9.org/showthread.php?s=&threadid=50363)

Guest
28th April 2003, 13:21
At least only "slightly". :)

I do stand firm on the averaging point brought up in your referenced thread. I will respond to that later today.

TheRealMoh
29th April 2003, 04:45
I tried this codec. The generated file loads in Virtualdub, but not in an avisynth script. Try a real simple script:

video=avisource("C:\temp\test.avi")
video

I think you're setting the color space wrong, but responding to candecompress incorrectly.

TheRealMoh
29th April 2003, 05:01
I did a quick test to see if this codec is lossless. It doesn't seem to be :-(

To test, I started with a Huffyuv clip, then converted it to BergWave and then converted back to Huffyuv. using this script:

clip1=avisource("C:\temp\blahtest3.avi")
clip2=avisource("C:\temp\blahtest.avi")
Subtract(clip1, clip2).Levels(127, 1, 129, 0, 255)

I see big differences between the two.

The reason I had to convert back to huff is because of the bug mentioned in the previous post.

sh0dan
29th April 2003, 14:40
YV12 <-> YUY2 conversions are never lossless. You are not seeing differences because of the codec, but because of colorspace conversions.