Log in

View Full Version : Yet another lossless codec: Arithyuv


lcld
31st July 2005, 02:17
From the readme (http://jm.xdns.eu/Arithyuv/browser/ReadMe.txt):
...

Arithyuv is a lossless video codec designed for capturing video:
It only supports YUY2 colorspace.
Codec settings can be changed during compression.
Speed consideration: Huffyuv (http://www.avisynth.org/HuffYUV) is becoming too fast. I mean that there are many CPU cycles that could be used to improve compression. However, the Lagarith (http://lags.leetcode.net/codec.html) codec is a little too slow for my PC. Arithyuv only uses median prediction (huffyuv implementation) and an assembly-optimized implementation of arithmetic coding.
Compression consideration: Compression is better than Huffyuv, even when adaptive huffman tables are used (it's a ffdshow improvement). For interlaced sources, Arithyuv even give better results than Lagarith since Lagarith lacks the ability to treat the contents as interlaced video. However, Lagarith compression is generally better for progressive frames.
Size consideration: Compression isn't the only factor to reduce the file size. The possibility to change settings during the capture allows you to optimize them without knowing in advance the format of the video. For example, cropping to remove black borders is generally unsafe. Anyway, not all capture applications allows you to crop the video. Also, discarding frames temporarily can be less problematic than stopping and restarting the capture.

...Screenshots:
http://alainmuchembled.free.fr/Arithyuv/Configure.png http://alainmuchembled.free.fr/Arithyuv/Compressing.png

download: Arithyuv 1.1.1 (http://alainmuchembled.free.fr/Arithyuv/Arithyuv.rar)

I must thank Huffyuv's author who has done the main part : optimized implementation of median prediction.
For the arithmetic coding part, I started from this implementation (http://www.arturocampos.com/ac_arithmetic.html) and I found in Lagarith's source code a way not to work on bits. My routines have been optimized for AMD K7 CPU... well, I hope I have understood AMD documentation sufficiently.

I wonder if YV12 and RGB support would be useful.

reepa
1st August 2005, 18:36
Thanks for the codec! I recorded ~500MB/min with it at ~60% processor usage without any dropped frames.

Zyphon
1st August 2005, 19:34
Thank you for this lossless codec it doesn't hurt to have other options where codecs are concerned. :)

Now for some testing. :)

lcld
3rd August 2005, 13:02
Small update:
08/03/2005: Arithyuv 1.0.1
* Fixed installation on Windows 9x/Me.
* Progressive mode forced when frame height (before any cropping) is odd.
* Removed "Warn when assertions fail" option.


And a few tests:

- frame size: 768x576
- source: interlaced (can analog video be progressive ??)
- program: progressive, no black border
- I used VirtualDubMod and patched it so that it discards output. Disk activity would distort the results. The tested frame is looped 10000 times.
- The first number is the size of the compressed frame. The second is the speed of compression in fps.___________|_____A______|_____B______|_____C______|_____D______
Huffyuv | 297132 149 | 311356 147 | 304312 149 | 243584 154
Arithyuv(i)| 278298 73.0| 293087 71.9| 272703 72.5| 206325 77.5
Arithyuv(p)| 268178 74.6| 287260 73.0| 274748 73.5| 213013 77.5
Lagarith | 265155 31.7| 280989 31.4| 260109 34.1| 220989 33.8

Mug Funky
4th August 2005, 09:40
kickass! another codec to play with!

one note: analog video can indeed be progressive - it's just a matter of 2 fields being very similar to each other.

however, VHS and some very interfered-with composite (esp NTSC 3.58) sources are best treated as interlaced, simply because they jitter so much that the lines aren't too likely to match well. also, NTSC has a nasty habit of chroma shifts with opposite phase per-field (ie top field is purple-tinted, bottom field is green-tinted). this also requires interlaced treatment.

lpn1160
5th August 2005, 04:41
I tested this codec with a 4 min capture of a music video. Flawless, no dropped frames, cpu never hit more than 28% and it decompressed pretty quick as well 18-20 fps while encoding to xvid in virtualdub using avisynth with IVTC and two temporal filters.
Very nice, very, very promising!!
Thank you!!

lcld
6th August 2005, 01:33
Serious bug fixed -> Arithyuv 1.0.2
"The arithmetic coding part was crashing on certain kinds of frames, for example solid color ones."

AVIL
7th August 2005, 22:44
Hi,

i've encoded, with arithyuv codec 56.500 frames of interlaced video in 1 hour 52 minutes. Same task with MSU_lossless codec v0.58 (high compression) 78 hours. Size with arithyuv: 21GB (its a noisy video, compression ratio 2,4:1). Size with MSU_lossless: 19,7 GB. Arithyuv decodes 3 times faster than MSU_lossless.

Thanks four your splendid work.

niv
21st August 2005, 00:32
Thanks a banch lcld,
I was off this forum and video , for a while now. good to see the news.
However I tried the encoder with my setup and got lost frames. any idea how to fix it?

what I have: P4/1.8A;i845/400Mhz bus; 512Mb; Seagate ST312002 7200/2Mb; Bt878.
What I run: Win2K SP4, btwincap WDM drivers, iuvcr 4.9.4.366

Thanks,
Niv

johnsonlam
22nd August 2005, 04:05
Hi lcld,

Thank you very much!

Maybe my search for the "working properly" lossless codec will be over, because HuffYUV's author vanished and nobody takes care of it.

ArithYUV conquer my Canopus ADVC1394 with Media Player Classics 6484 without any problem, even MSU lossless codec fail to have good result in this combination!

Glad to see your codec reported by others that "better" than HuffYUV, and for me it's REALLY better, wish it can become more popular :goodpost:

johnsonlam
22nd August 2005, 17:21
I wonder if YV12 and RGB support would be useful.
Sometimes I capture with RGB than YUV, compare with eyes they're almost identical for me ...

Heard that RGB have more data, is that means better quality?

dimzon
22nd August 2005, 17:48
lcld
Any chance for YV12 support?

lcld
23rd August 2005, 04:12
However I tried the encoder with my setup and got lost frames. any idea how to fix it?How many ? What resolution ?
what I have: P4/1.8A;i845/400Mhz bus; 512Mb; Seagate ST312002 7200/2Mb; Bt878.
What I run: Win2K SP4, btwincap WDM drivers, iuvcr 4.9.4.366A P4 ? Like I wrote in the first post Arithyuv has been optimized for AMD K7 CPU. I don't know anything about P4 optimizations so I can't say if Arithyuv runs well on P4.
Even if I underclock my Barton 3000+ (core/bus/ddr : 2166/166/333) at 1300/100/200, I don't have any dropped frames at 768x576.

Heard that RGB have more data, is that means better quality?Yes, provided there is no conversion. If analog video cards only ouput yuy2 data, capturing in RGB is an aberration.

Any chance for YV12 support?Maybe.

Boulder
23rd August 2005, 07:05
How many ? What resolution ?
A P4 ? Like I wrote in the first post Arithyuv has been optimized for AMD K7 CPU. I don't know anything about P4 optimizations so I can't say if Arithyuv runs well on P4.

If the optimizations mean SSE and not 3DNow!, P4 will benefit from that. The first P4 chip performs really bad with floats unless some optimizations have been done (though I'm not sure if his P4 is of that generation).

Yes, provided there is no conversion. If analog video cards only ouput yuy2 data, capturing in RGB is an aberration.

BT878 chip most likely captures natively in YUY2.

lcld
23rd August 2005, 12:21
If the optimizations mean SSE and not 3DNow!, P4 will benefit from that. The first P4 chip performs really bad with floats unless some optimizations have been done (though I'm not sure if his P4 is of that generation).No SIMD (I don't see how) and no float for the main part (arithmetic coding).

niv
24th August 2005, 21:26
How many ? What resolution ?
A P4 ? Like I wrote in the first post Arithyuv has been optimized for AMD K7 CPU. I don't know anything about P4 optimizations so I can't say if Arithyuv runs well on P4.
Even if I underclock my Barton 3000+ (core/bus/ddr : 2166/166/333) at 1300/100/200, I don't have any dropped frames at 768x576.


1800/100/266 768X576X25
lagarith is at 90% cpu load and send 305 Mb/m avrage FPS 17.8
arithyuv is at 85 % cpu load ad send 418 Mb/m avrage fps 19.8

johnsonlam
29th August 2005, 16:23
Hello,

I've capture a clip with ArithYUV, but when I want to edit it in Virtualdub, it fail to run, anyway to solve this problem?

Thanks.

lcld
29th August 2005, 17:21
@niv and johnsonlam: replied by private messages

lcld
1st September 2005, 22:18
Very very small update (1.1.0):
* Added "(Settings) for this application only" option. It'll probably interest noone apart from me. I wish XviD had such one because I use completely different settings for my capture app and VirtualDubMod and must reconfigure XviD each time I switch from one to another.
* Fixed a small resource leak.

(bug at post #17 still unconfirmed)

johnsonlam
2nd September 2005, 02:26
Thanks for checking, waiting for your good news.

lcld
2nd September 2005, 13:30
Thanks for checking, waiting for your good news.Huh ? You may not have received my mail. I haven't been able to reproduce the problem. It would be much more easy for me to reproduce it but both VirtualDubMod 1.5.10.1 (2439) and VirtualDub 1.6.10 (23648) open your clip.
So before investigating further blindly, what version/build/mod of VirtualDub are you using ?

johnsonlam
2nd September 2005, 18:09
Huh ? You may not have received my mail. I haven't been able to reproduce the problem. It would be much more easy for me to reproduce it but both VirtualDubMod 1.5.10.1 (2439) and VirtualDub 1.6.10 (23648) open your clip.
So before investigating further blindly, what version/build/mod of VirtualDub are you using ?

Your mail maybe lost ... damn Internet these days!

I'm using VirtualDub 1.6.10 (23648).

I install the codec by right clicking it (login administrator), but when I use VirtualDub, what I see is the capture I sent you, it refuse to "dub" with Arithyuv, I've to change to Huffyuv to "dub".

whwhwhwh9
5th September 2005, 09:43
When I tried to save as AVI, I got the error message: "Cannot initialize video compression due to codec error: The source image format is not acceptable."

On "Select Video Compression" dialog in VDub1.6.10, when I chose "Arithyuv lossless codec", it shows in Format Restrictions "Couldn't find compatible format. Possible reasons: *codec may only support YUV *Codec might be locked *Codec might be decompression-only"

Could someone give a little hint on this?

I'm using win2ksp4 on an Intel Pentium 1400MHz processor.

johnsonlam
5th September 2005, 13:47
When I tried to save as AVI, I got the error message: "Cannot initialize video compression due to codec error: The source image format is not acceptable."

On "Select Video Compression" dialog in VDub1.6.10, when I chose "Arithyuv lossless codec", it shows in Format Restrictions "Couldn't find compatible format. Possible reasons: *codec may only support YUV *Codec might be locked *Codec might be decompression-only"

Could someone give a little hint on this?

I'm using win2ksp4 on an Intel Pentium 1400MHz processor.

Exactly same as me (except Win2K, I'm WinXP/AthlonXP 2800+), that is my problem :(

lcld
5th September 2005, 14:24
@johnsonlam, whwhwhwh9
Oh, I thought you couldn't open your clip in VirtualDub.
You can't compress with Arithyuv in VirtualDub ? VirtualDub gives you a hint : "codec may only support YUV". Arithyuv only accepts YUY2 for the moment. Several solutions :
1. Select "fast recompress" and use Avisynth instead of VirtualDub for image processing. This is the best solution if VirtualDub's filters only work in RGB colorspace.
2. With a recent version of VirtualDub, play with "Video/Color depth" command menu : either "YUY2/same as decompression format" or "autoselect/YUY2".

mean
5th September 2005, 21:24
Hello,
any chance you switch to nasm/yasm so that it can be easily ported to non windows operating system ?

(gcc and VC++ syntax for inlined asm are quite different)

johnsonlam
6th September 2005, 02:33
@johnsonlam, whwhwhwh9
Oh, I thought you couldn't open your clip in VirtualDub.
You can't compress with Arithyuv in VirtualDub ? VirtualDub gives you a hint : "codec may only support YUV". Arithyuv only accepts YUY2 for the moment. Several solutions :
1. Select "fast recompress" and use Avisynth instead of VirtualDub for image processing. This is the best solution if VirtualDub's filters only work in RGB colorspace.
2. With a recent version of VirtualDub, play with "Video/Color depth" command menu : either "YUY2/same as decompression format" or "autoselect/YUY2".

Thanks for your tips.

After test:

It works, but bypass everything.
Did Virtualdub only support RGB codec?

I like ArithYUV, any way to make it work (not using fast recompress)?

lcld
8th September 2005, 22:48
Hello,
any chance you switch to nasm/yasm so that it can be easily ported to non windows operating system ?

(gcc and VC++ syntax for inlined asm are quite different)You're right. Unfortunately, NASM won't understand the declaration of the Arith class :(
huffyuv.asm also needs to be converted.

Added a TODO list in the readme.

Did Virtualdub only support RGB codec?You mean... do Virtualdub's filters only work in RGB colorspace? I think so. As long as Arithyuv only supports YUY2, I can't tell you more than what I wrote in my previous post: either give up VirtualDub filters for Avisynth, or do 2 conversions (YUY2->RGB and RGB->YUY2).

RGB<->YUY2 conversions alter the video so I suggested to avoid them, but when many filters are applied, that may not be a bad idea since RGB have a higher precision. If someone can enlighten me on that subject...

WildCelt
9th September 2005, 13:56
I've done a few test caps with this codec as well, and so far I'm liking what I'm seeing! I have had one problem, however. Windows Explorer crashes every time I select an Arityuv avi. I am using XP. Has anyone else experienced this?

lcld
10th September 2005, 15:01
I've done a few test caps with this codec as well, and so far I'm liking what I'm seeing! I have had one problem, however. Windows Explorer crashes every time I select an Arityuv avi. I am using XP. Has anyone else experienced this?Confirmed and fixed.
I didn't noticed it because I've disabled one or several things in the explorer. The explorer easily crashes/freezes when a video file is corrupted.

09/10/2005: Arithyuv 1.1.1
* (bug) Fixed RGB output (decompression).

WildCelt
12th September 2005, 14:34
Excellent! Thanks