Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: lossyWAV 1.3.0 released (Read 108761 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

lossyWAV 1.3.0 released

Reply #50
FYI. I've started translating the lossyWAV 1.3.0 code to C++, in the hope that it could be better optimized (including 64 bit) and supported on all platforms. All files are roughly translated, but it's still a bit left before they compile. If anyone wants to help out, please say so. (Nick, its a straight port, so you will immediately recognize the code, even if you don't know C/C++ much).

By the way, I found an interesting article from January/April called The faster-than-fast Fourier transform, which may or may not be relevant.

lossyWAV 1.3.0 released

Reply #51
Hi Tycho,

Many thanks for tackling the conversion - I have been thinking of trying to learn C++ to allow me to translate lossyWAV, but you've beaten me to it!

I will have to start learning now so that I can contribute in some way to the translation process....

Not too sure about the new transform - it seems to work for sparse signals.

Nick.

[edit] Also, I suggest that we use this thread for the development. [/edit]
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)



lossyWAV 1.3.0 released

Reply #54
Thanks. The C++ version should have unicode support as well.


Haven't looked at the C++ port yet. Is it "ready for production" yet?

Also: With "should have" you mean it does have Unicode support (for Win32) or adding Unicode support (for Win32) is on the TODO list?

In the latter case, I could add Unicode support to the C++ port, if that is desired...

lossyWAV 1.3.0 released

Reply #55
Thanks. The C++ version should have unicode support as well.


Haven't looked at the C++ port yet. Is it "ready for production" yet?

Also: With "should have" you mean it does have Unicode support (for Win32) or adding Unicode support (for Win32) is on the TODO list?

In the latter case, I could add Unicode support to the C++ port, if that is desired...

No, there's still some delphi I/O calls not translated to their fstream counterparts, and when it finally links it probably won't run at first. You'll find the discussions about this in the another thread and in the uploads section.  When it comes to Unicode, it's not done so thanks for the offer. I thought maybe http://utfcpp.sourceforge.net/ could be used - seems small and nice.

lossyWAV 1.3.0 released

Reply #56
I have hacked a Unicode support into a large number of tools that obviosuly were written for Linux only or the author didn't care about Unicode.

Since I usually don't want to change char to wchar_t everywhere (although that would be the "native" way to support Unicode on Win32), because that requires various other changes and breaks Linux compatibility (yes, you can fix that by using Preprocessor/Macro magic, but it doesn't exacatly make the code nicer), I usually go the UTF-8 route.

As an example, you may look at my UTF-8 patch that got committed into Opus-Tools:
http://git.xiph.org/?p=opus-tools.git;a=co...cf1b7c1b0e0c934

So it basically requires one extra .cpp/.h file containing a few support routines to hide the lack of UTF8 support in the Win32 API. You also need to replace fopen() with fopen_utf8().

lossyWAV 1.3.0 released

Reply #57
No surprise here. It's known that there are some kind of signals which FLAC itself compresses very efficiently (i.e. solo piano music). Those signals can actually have a worse compression ratio when preprocessed with lossyWAV, because it forces FLAC to use a very small block size of 512 samples, thus decreasing it's efficiency (while lossyWAV can't always make up for the loss in those cases, see the small correction file).


I found this from a search after a piano track got bigger with lossywav (standard level for lossywav, and 5 for flac).  Maybe there's some place to mention this caveat in the wiki article? 

A similar piece on harpsichord (I guess due to more harmonics and less initial compression by flac) did shrink from 824 to 538 kb/s

lossyWAV 1.3.0 released

Reply #58
Maybe there's some place to mention this caveat in the wiki article?

Sounds like a plan - it did come up in one of the development threads, but it bears repeating in the significantly more concise wiki article.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.3.0 released

Reply #59
A question more related to the foobar2000 converter.

Is there a way to also have the lossyWAV correction files written during the conversion to FLAC?

Simply adding --correction to the command line produces an error:

Encoder: C:\Windows\System32\cmd.exe
Extension : lossy.flac
Parameters: /d /c C:\"Program Files"\bin\lossywav - --correction --quality standard --silent --stdout|
            C:\"Program Files"\bin\flac - -b 512 -5 -f -o%d --ignore-chunk-sizes


lossyWAV 1.3.0 released

Reply #60
When creating correction files, --stdout cannot be used.

So, remove the
Code: [Select]
--stdout|C:\"Program Files"\bin\flac - -b 512 -5 -f -o%d --ignore-chunk-sizes
portion and replace it with
Code: [Select]
-C --stdinname "%d"
This will create WAV files rather than FLAC files. To compress to FLAC, import to foobar2000 and create a custom FLAC converter with "--keep-foreign-metadata" in the command line. If "--keep-foreign-metadata" is omitted then the files will not be able to be reinstated back to lossless as the 'FACT' chunks will be lost.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.3.0 released

Reply #61
I've been trying to add lossyWAV support to TAudioConverter. I noticed something odd about how lossyWAV handles command line parameters. First I tried to use this simple command line parameters:
Code: [Select]
"input.wav" -q H


However I got an error "No input file specified". Then I remembered that some of the command line tools I wrote with Delphi had some strange behavior like this when I tried to use them within TAC. It looked as though lossyWAV ignored first parameter so I used this which works fine:
Code: [Select]
" " "input.wav" -q H


I wonder if this has something to do with Delphi or am I doing something wrong? I use a custom class derived from JVCL TJvCreateProcess class to run backends.

lossyWAV 1.3.0 released

Reply #62
Hi ozok,

I'm not sure. From memory, the Delphi version does not use paramstr(0) [usually points to the executable]. Depending how you call lossyWAV, the program may not be interpreting the parameters passed to it absolutely correctly. I'm glad that you found a fix though.

If you're working with correction files, please avoid lossyWAV beta 1.3.1a until I confirm that the correction file / merge system is working again.

Nick.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.3.0 released

Reply #63
Thanks for the quick reply Nick.C.

I don't use correction files, I just use lossyWAV's output to feed to encoders. Everything else works fine at the moment (with 1.3.0), I'll try latest version now.

Regards.

lossyWAV 1.3.0 released

Reply #64
What's wrong with this?

(Foobar2000 v1.2.9)

Quote
1 out of 1 tracks converted with major problems.

Source: "E:\Zenek\Metal\Epica - Discography\Albums\2003 - The Phantom Agony\05. Illusive Consensus.flac"
  An error occurred while writing to file (The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters) : "C:\Users\Bull\Desktop\05. Illusive Consensus.lossy.flac"
  Additional information:
  Encoder stream format: 44100Hz / 2ch / 16bps
  Command line: "C:\Windows\System32\cmd.exe" /d /c  F:\Dropbox\fb2k\lossyWAV\lossywav - -q X --silent --stdout|F:\Dropbox\fb2k\Flac\flac - -b 512 -5 -f -o"05. Illusive Consensus.lossy.flac" --ignore-chunk-sizes
  Working folder: C:\Users\Bull\Desktop\
 
  Conversion failed: The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters
Wavpack -hh or TAK -pMax
OggVorbis aoTuVb6.03 -q 4

lossyWAV 1.3.0 released

Reply #65
Just the first thing I saw, but try adding the missing space between “-o” and the output filename.

lossyWAV 1.3.0 released

Reply #66
Just the first thing I saw, but try adding the missing space between “-o” and the output filename.

It doesn't worked.
But in the second post the code is same.
Wavpack -hh or TAK -pMax
OggVorbis aoTuVb6.03 -q 4

lossyWAV 1.3.0 released

Reply #67
Hi Mardel,

Could Drive C: be full? foobar2000 sometimes (especially when tagging a lot of data) creates temporary files which effectively double the disk space required to create the output file.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.3.0 released

Reply #68
Hi Mardel,

Could Drive C: be full? foobar2000 sometimes (especially when tagging a lot of data) creates temporary files which effectively double the disk space required to create the output file.


Hi Nick!

27 GB Free on C.
Wavpack -hh or TAK -pMax
OggVorbis aoTuVb6.03 -q 4

lossyWAV 1.3.0 released

Reply #69
If you are using a beta version, please download the latest beta as I introduced an expiry date (to avoid potentially bad experimental parameters hanging around....).

The current beta expiry is the end of September. I will be releasing another beta in the next few days with another experimental parameter (bit-removal noise feedback checking in addition to clipping detection).
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.3.0 released

Reply #70
I used this 1.3.0 stable version.
Wavpack -hh or TAK -pMax
OggVorbis aoTuVb6.03 -q 4

lossyWAV 1.3.0 released

Reply #71
Hmmm.... Could you please try removing the FLAC portion of the command so that a ".lossy.wav" file is produced?

If that fails, could you please add "--adaptive off" to the lossyWAV command?
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.3.0 released

Reply #72
Hmmm.... Could you please try removing the FLAC portion of the command so that a ".lossy.wav" file is produced?

If that fails, could you please add "--adaptive off" to the lossyWAV command?

Thx!
But I'v got another problem (WASAPI component doesn't worked after install).
I reinstalled foobar and now works both (WASAPI, Lossywav encode).
Wavpack -hh or TAK -pMax
OggVorbis aoTuVb6.03 -q 4

lossyWAV 1.3.0 released

Reply #73
Thanks Mardel, glad to hear that you have solved the problem.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.3.0 released

Reply #74
I wonder if anyone thought about doing an ~320kbps listening test with LossyWAV extraportable involved. I have currently encoded my whole organized lossless music collection into lossyFLAC with LossyWAV 1.3.0 Extraportable (all source files which were not 44.1kHz 16 bit files were converted by foobar before passing them to LossyWAV. I have very few high resolution tracks though) and i have to say that i'm surprised to not notice artifacts or at least they are well hidden from me and the average bitrate is just 314kbps. I haven't done side-by-side comparison on tracks just saying this based on the fact that i have many tracks that i've listened to many times in both format so i should have notice if they differ. Although i like to do a correct ABX test (or should i use ABC/HR testing tool for this? i've never done something like this but i guess this will be my jump on the testing bandwagon, so i have to read a correct test setup tutorial first).

Is there any killer samples for LossyWAV to test? I've noticed that bitrate during playback for some spots may reach even the original one. Also there are some tracks which doesn't yield so much bitrate saving (like Break 'N Sweat from Skrillex which is over 564kbps even with extraportable setting, or some game music with lower than 16kHz lowpassing) but they still high quality so i don't mind the higher bitrate if it's really required.