IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Introducing pure C# FLAC encoder based on Flake
Gregory S. Chudo...
post Aug 22 2009, 10:49
Post #1





Group: Developer
Posts: 705
Joined: 2-October 08
From: Ottawa
Member No.: 59035



Greetings.

Just finished porting Justin Ruggles' FLAKE encoder to C#.

I believe this to be the first pure managed FLAC encoder, which should be able to run on any CPU/system with .NET (e.g windows xp/vista/7, and linux with Mono).

You can download it here: Attached File  CUEToolsFlake03.rar ( 37.43K ) Number of downloads: 2041
Previous versions: Attached File  CUEToolsFlake02.rar ( 37.44K ) Number of downloads: 319
Attached File  CUETools.Flake.rar ( 36.25K ) Number of downloads: 395

Source code can be found here: http://cuetoolsnet.svn.sourceforge.net/vie...s.Codecs.FLAKE/

As you can see, it turned out to be very compact.
I also hope that you'll find it pretty fast for a .NET, and i also hope that it has a very competitive compression ratio.
Flake itself provides a very good compression ratio, but my version has quite a few new optimizations.

Please, test it and post here the comparisons for speed/compression ratios with other FLAC encoders. Please note, that compression levels are tuned differently here from libFLAC or Flake. CUETools.Flake -5 should be roughly equivalent to flac -8. So to compare against flac -5 you'll probably want to test CUETools.Flake -3. Levels above 8 produce non-subset files (e.g. not all hardware players will read them).

The default compression level is 7, which produces files noticeably smaller than flac -8 while being fast enough.


This post has been edited by Gregory S. Chudov: Aug 28 2009, 15:58


--------------------
CUETools 2.1.4
Go to the top of the page
+Quote Post
viktor
post Aug 22 2009, 13:21
Post #2





Group: Members
Posts: 298
Joined: 17-November 06
Member No.: 37682



hey, that's cool. wrapping a gui around this would be no time then. the results:

c# encoder:
time: 2:31
size: 566 MB

flake 0.11:
time: 1:09
size: 575 MB

flac 1.2.1:
time: 1:20
size: 573 MB

all done with -5

however, the results can be a bit bogus, coz i'm doing some cvs checkout in the background smile.gif

i would say it's not bad, especially for an initial release. thanks for your work!

what version of .net is this written in anyway?

This post has been edited by viktor: Aug 22 2009, 13:34
Go to the top of the page
+Quote Post
Gregory S. Chudo...
post Aug 22 2009, 13:23
Post #3





Group: Developer
Posts: 705
Joined: 2-October 08
From: Ottawa
Member No.: 59035



2.0, but i'm pretty sure it could be compiled with 1.0 or compact framework.

Please note, that compression levels are tuned differently here from libFLAC or Flake. CUETools.Flake -5 should be roughly equivalent to flac -7 or 8, i guess. So to compare agains flac -5 you'll probably want to test CUETools.Flake -4 or 3

This post has been edited by Gregory S. Chudov: Aug 22 2009, 13:31


--------------------
CUETools 2.1.4
Go to the top of the page
+Quote Post
viktor
post Aug 22 2009, 13:44
Post #4





Group: Members
Posts: 298
Joined: 17-November 06
Member No.: 37682



QUOTE (Gregory S. Chudov @ Aug 22 2009, 13:23) *
Please note, that compression levels are tuned differently here from libFLAC or Flake. CUETools.Flake -5 should be roughly equivalent to flac -7 or 8, i guess. So to compare agains flac -5 you'll probably want to test CUETools.Flake -4 or 3


-4:
time: 2:16
size: 566 MB

-3:
time: 1:36
size: 574 MB

-3 is comparable in compression with flac -5, and is just ~15% slower, so i'd say it's really not bad smile.gif
Go to the top of the page
+Quote Post
sauvage78
post Aug 22 2009, 13:48
Post #5





Group: Members
Posts: 677
Joined: 4-May 08
Member No.: 53282



I like speed over compression & I think that I understand the purpose of flake, but flake needs a serious comparison like KTF's one in order for the average people to understand its use. Judging from flake benchmark, you lose ~1% compression & some decompression speed for a huge bost in compression speed ... the compression speed gain is bigger than the decompession speed loss. So if I would sum up, overall (decompression+compression) flake is slightly faster than flac for a 1% compression loss at the same setting ... but you lose the "safety" of using official flac. Right ?

I like the idea, but honestly, I may be paranoid, but I would never use it unless other people also start to use it. I think others think like me, so no-one except audio enthousiast will use it. It's sad but I think Flake being a "fork" it's caught in the vicious circle of FUD & like lossywav vs pure lossy, flake will have hard time struggling with flac as the average user will not understand the benefit. IMHO, there is more important features/fixes to code for cuetools than flake. I was thinking that you were on vacation in Canada, & you were coding for flake, what a disapointment wink.gif

As an example I was using flac -6 before using cuetools, after starting using cuetools I searched for a setting with faster decoding speed & that's why I started using -4. I never even a second imagined that I could seriously use flake, but I thought of sacrificing 3% compression & using -1 if -4 is still not fast enough. It's only an example but it shows what flake is in the mind of people, an experimental codec for a niche market, despite all its quality. Let's hope it will change, but I doubt it.

This post has been edited by sauvage78: Aug 22 2009, 13:59


--------------------
CDImage+CUE
Secure [Low/C2/AR(2)]
Flac -4
Go to the top of the page
+Quote Post
Justin Ruggles
post Aug 22 2009, 18:21
Post #6





Group: Developer
Posts: 165
Joined: 3-June 06
From: Raleigh, NC
Member No.: 31393



QUOTE (sauvage78 @ Aug 22 2009, 08:48) *
...
I like the idea, but honestly, I may be paranoid, but I would never use it unless other people also start to use it. I think others think like me, so no-one except audio enthousiast will use it. It's sad but I think Flake being a "fork" it's caught in the vicious circle of FUD & like lossywav vs pure lossy, flake will have hard time struggling with flac as the average user will not understand the benefit.
...
It's only an example but it shows what flake is in the mind of people, an experimental codec for a niche market, despite all its quality. Let's hope it will change, but I doubt it.

I agree that Flake is an experimental codec. Whatever market it has is not very important to me. My reason for creating it in the first place was to better understand FLAC, and lossless audio in general. I'm glad to see that others have taken the code and used it in ways that they find helpful. Since only a little of my time is dedicated to improving Flake, the fact that Gregory has improved it in his C# port is wonderful.
Go to the top of the page
+Quote Post
jcoalson
post Aug 25 2009, 00:42
Post #7


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



this is cool, I would just suggest running it through the flac test suite before each release, to make sure the port is ok. encoders have to be held to a higher standard than decoders because people usually delete the original afterwards.

the quickest way is to build flac with visual studio or gcc and substitute flac.exe with a command-line wrapper for your encoder.
Go to the top of the page
+Quote Post
Gregory S. Chudo...
post Aug 25 2009, 06:08
Post #8





Group: Developer
Posts: 705
Joined: 2-October 08
From: Ottawa
Member No.: 59035



Thanks, will do that. This encoder also has a verify mode, like libFLAC, when it decompresses each compressed frame and compares with original. This mode will be recommended for initial releases. It is activated by --verify switch.

This post has been edited by Gregory S. Chudov: Aug 26 2009, 18:34


--------------------
CUETools 2.1.4
Go to the top of the page
+Quote Post
Chinch
post Aug 27 2009, 21:12
Post #9





Group: Members
Posts: 98
Joined: 22-July 09
Member No.: 71664



hah yeah i was checking out your code on sourceforge or wherever you have it and i noticed an awful lot of the recent revisions had been all related to FLAKE.. i figured something was up wink.gif

kind of made me want to get back into programming looking at it, to be honest. used to be a hobby of mine, but i lost it over the years.. and I was kind of getting away from it when .NET framework started coming out... I remember a couple of the System namespaces, etc provide a lot of the base functions for the programs, but by no means was I a pro at it, just experimental. I had always been a C/C++ fan, so the idea of C# and .NET framework seemed interesting to me.

Ah yes... I remember.. I was an ASM programmer for 2-3 years there, and the last thing I wanted to do was go home and code. What is a good resource for getting a good overall idea of the .NET framework? I suppose MSDN would be a good start to just look up the different namespaces and what all functionality each provided. I know and understand the code part of it (as far as like the part that is based on C/C++ coding).. but I need to find something to help tie that in with .NET.


Couple of questions.. sorry to really get off the 'main' topic, but I have a couple of questions...

What are the differences between the different major versions of .NET framework... 1, 2, 3, 3.5, etc. I'm assuming added functionality, but were there any major changes or additions, etc that changed the way the framework was used, or what it could do?

I just need to get to google and look it up.. but I just wanted to say that I did look at certain parts of your code for CUETools, and it gave me a little bit of motivation/interest to maybe get back into it as a hobby --- so thanks for that!

Btw, I heard that the compiler for .NET apps basically converts all the languages into some intermediary code, then compiles that... essentially suggesting that no one coding language was necessarily 'better' in terms of the end compile's speed/memory footprint/functionality.. meaning that regardless if you create the same program in visual basic/c#/c++, they should all result in the same optimized code in the end, since a lot of it is all sharing the same codebase via .NET. is this true? (i do understand that it is up to the programmer to make their code efficient, optimized, etc and that can definitely have a huge impact on performance).. but essentially, if the same coder wrote the same program the same way in each of the languages, the end compile is going to be about the same? i know that ASM programmers used to brag how compact, efficient, and powerful their code was and laugh at visual basic programmers, "drawing" their programs, writing simplistic code with all of these DLL/OCX dependencies and it basically being "kiddie coding".... but it seems technology like .NET has kind of leveled the playing field out a bit, considering each of these languages are relying on the same set of "dependencies", etc. I mean, to me... I have no bias really, because I have written programs in visual basic before, and i coded ASM programs for a living too... so really, i don't see something like visual basic or visual c# to be "coding for beginners". it's code that is easier to understand, write, and manage.. is that a sin? depends who you ask i guess... wink.gif

IMO, i feel that visual C++ can sometimes get a little more complicated with stuff like dereferencing of pointers and this type of thing, and of course visual basic is at times a little too... basic, as it is a bit copy and paste this, drag this here... then do something like whatever.Color = blue, it's almost like programming in english -- it seems to me that C# is a nice compromise between the two languages... the power of c++ with the simplicity of visual basic -- and i believe that was probably the intended result.

anyways, enough of the ramble.. got to get back to work.
Go to the top of the page
+Quote Post
Sebastian Mares
post Aug 27 2009, 22:53
Post #10





Group: Members
Posts: 3633
Joined: 14-May 03
From: Bad Herrenalb
Member No.: 6613



QUOTE (Chinch @ Aug 27 2009, 22:12) *
What are the differences between the different major versions of .NET framework... 1, 2, 3, 3.5, etc. I'm assuming added functionality, but were there any major changes or additions, etc that changed the way the framework was used, or what it could do?


Wikipedia has a nice article where the changes are described. smile.gif http://en.wikipedia.org/wiki/.NET_Framework

QUOTE (Chinch @ Aug 27 2009, 22:12) *
Btw, I heard that the compiler for .NET apps basically converts all the languages into some intermediary code, then compiles that... essentially suggesting that no one coding language was necessarily 'better' in terms of the end compile's speed/memory footprint/functionality.. meaning that regardless if you create the same program in visual basic/c#/c++, they should all result in the same optimized code in the end, since a lot of it is all sharing the same codebase via .NET. is this true?


Yes, that's the theory (never tested it myself if the CIL, that's the name of the semi-compiled stuff, genereated by C# is identical to the one made by VB .NET given the fact that there are things you can do with one language but not with the other, though).

QUOTE (Chinch @ Aug 27 2009, 22:12) *
then do something like whatever.Color = blue, it's almost like programming in english


You mean vbBlue in VB6 and earlier or System.Drawing.Color.Blue in .NET. biggrin.gif


--------------------
http://listening-tests.hydrogenaudio.org/sebastian/
Go to the top of the page
+Quote Post
sdesapriya
post Jul 27 2010, 13:01
Post #11





Group: Members
Posts: 1
Joined: 27-July 10
Member No.: 82564



Hi,

This is not working for mono (has only one channel) files..How can i modify this is to work with mono files.
please help

Thushara

This post has been edited by sdesapriya: Jul 27 2010, 13:02
Go to the top of the page
+Quote Post
Steve Forte Rio
post Dec 26 2010, 23:01
Post #12





Group: Members
Posts: 469
Joined: 4-October 08
From: Ukraine
Member No.: 59301



How to obtain maximum compression? What settings should I use?
Go to the top of the page
+Quote Post
Wombat
post Dec 27 2010, 20:19
Post #13





Group: Members
Posts: 1090
Joined: 7-October 01
Member No.: 235



Just looked over the cuetoolsnet Repository and saw changes to flacCL and flake that are just 2 weeks old. Unfortunately it seems no one can compile a new Cuetools out of it.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 27th November 2014 - 09:21