HydrogenAudio

Lossy Audio Compression => Other Lossy Codecs => Topic started by: Nick.C on 2012-08-22 19:27:47

Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-08-22 19:27:47
Tycho started the Delphi to C++ translation of lossyWAV in August 2012. After some time getting to grips with C++ and a bit of debugging, I started to develop lossyWAV 1.4.0.

Changelog:

lossyWAV v1.4.0 02/10/2014[!--sizeo:1--][span style=\"font-size:8pt;line-height:100%\"][!--/sizeo--]lossyWAV beta 1.3.1m 04/08/2014lossyWAV beta 1.3.1k 02/06/2014lossyWAV beta 1.3.1j2 01/04/2014lossyWAV beta 1.3.1j 31/03/2014lossyWAV beta 1.3.1h 31/01/2014lossyWAV beta 1.3.1g 01/12/2013lossyWAV beta 1.3.1f 15/10/2013lossyWAV beta 1.3.1e 07/10/2013lossyWAV beta 1.3.1d 15/09/2013lossyWAV beta 1.3.1c 04/08/2013lossyWAV beta 1.3.1b 20/06/2013lossyWAV beta 1.3.1a 18/06/2013lossyWAV beta 1.3.0o 11/06/2013lossyWAV beta 1.3.0n 30/03/2013lossyWAV beta 1.3.0m 25/03/2013lossyWAV beta 1.3.0k3 08/03/2013lossyWAV beta 1.3.0j 08/02/2013lossyWAV beta 1.3.0i 30/01/2013lossyWAV beta 1.3.0h 23/01/2013lossyWAV beta 1.3.0g 18/01/2013lossyWAV beta 1.3.0f 26/10/2012lossyWAV beta 1.3.0e 24/09/2012lossyWAV beta 1.3.0d 18/09/2012lossyWAV beta 1.3.0c 15/09/2012[/size]
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: [JAZ] on 2012-08-22 19:55:23
Hi Tycho. That sounds nice.

Remember that there are the java and C# ports (although they are from older versions) that could be of help during the conversion:

jLossywav: (based on lossywav 1.1.4) http://www.hydrogenaudio.org/forums/index....st&p=645228 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67697&view=findpost&p=645228)
C# (based on 1.0?) : http://www.hydrogenaudio.org/forums/index....showtopic=67418 (http://www.hydrogenaudio.org/forums/index.php?showtopic=67418)

Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Kohlrabi on 2012-08-22 20:48:42
Is the port done publicly, like on github or similar? This community has some very knowledgeable C++ hackers, so it might speed the process and help with finding and fixing bugs.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: tycho on 2012-08-22 23:11:22
JAZ, Thanks, I was aware of the C# translation of version 1.0, but had missed out your java translation. Nice. There are a lot of changes in 1.3 though, and much of the work is to convert the I/O handling and runtime linking with fftw3-3 library. First step is something that compiles with gnu g++ on windows. Next would be VS2010, and then Linux/Mac g++, but that could easily someone else do.

Kohlrabi, I haven't thought about using github yet.  My initial thought was just to get most of the code to compile, and then upload the code here. Useful help would be that people browsed through it and verified that the .pas and the .h/.cpp files does the same thing, but I wouldn't mind if people worked on it too.

I think that modern optimized C++ compilers (both 32 and 64 bit) are able to improve on speed a fair bit, but portability and accessibility is as important.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-08-25 19:55:46
Hi Tycho,

How are you getting on? Impatient Inquiring minds would like to know....
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: tycho on 2012-08-25 23:36:29
It's progressing quite well.  Many of the files are files are basically compiling now, but there are still some unresolved functions, e.g. the Delphi Write() function must be emulated, or all the calls to it must be rewritten. Also some of the IO routines need some work, as I mentioned.

I can post the code as it is tomorrow evening, so you can have a feel of it. Later I will come back with few questions for you, and tell a few things I've done during translation.

E.g. You have a few small functions in assembly only, like the ArcTan_Complex().  Shouldn't that return a complex number and not a float? On googling it, I found an implementation: (C++11 has it in the standard lib now)

Complex atan(Complex c)
{
  Complex log_v = log( Complex(1.0 - c.imag(), c.real()) / Complex(1.0 + c.imag(), -c.real()) );
  return Complex( log_v.imag() * 0.5, -log_v.real() * 0.5 );
}

The float you are returning is maybe the magnitude of the complex number returned here?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: lvqcl on 2012-08-25 23:46:23
Code: [Select]
function ArcTan_Complex(const X: tDComplex): Extended;
asm
                FLD       X.im
                FLD       X.re
                FPATAN
End;

According to google it is arctg(x.im/x.re) so basically it is C function atan2(x.im, x.re).
...IMHO.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-08-26 21:40:00
Apologies - you've found some of the "dirtier" code in lossyWAV....

The ArcTan_Complex function is, as lvqcl has rightly said, equivalent to a two input atan function.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-08-28 11:55:46
Once we have C++ version can we expect nice speed up after compiling with Intel Compiler with enabled auto vectorization and auto paralyzation? I must admit that delphi's version is rather slooow. It would be awesome if code was multithreaded and SIMD friendly.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: tycho on 2012-08-28 18:22:11
I haven't studied enough how the data is processed, but I believe that the code must be made more reentrant, so that central functions relies exclusively on own stack data, and not global data structures (except readonly) as today. This opens the door for parallel computation if the algorithm allows for it, which I believe it does.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-08-28 19:01:08
A simple parallelism would be to process each channel concurrently as channels are independent (even if linked then that linking of bits_to_remove would occur after all the FFT analyses have been completed for a given codec block).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-08-28 20:35:27
A simple parallelism would be to process each channel concurrently as channels are independent (even if linked then that linking of bits_to_remove would occur after all the FFT analyses have been completed for a given codec block).

that would be a good start. 2x faster proccesing on stereo track and even more for typical 5.1 movie sound track (assuming that user has atleast quad core).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-08-28 20:49:04
Another would be to have the FFT analyses run in parallel - each 512 sample codec block (44.1kHz / 48kHz samplerate) has 1x 1024 sample, 16x 64 sample and 32x 32 sample FFT analyses carried out on it (per channel).

[edit] can't count, apparently.... [/edit]
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-08-29 14:18:06
I have noticed that original LossyWav 1.3 does not support .wavs larger than 4GB. My wav file is 5.2GB  and lossyWAV sees only 1.2 GB. LossyWav also does not support wave64 format either.
(http://i.imgur.com/q09Kw.png)

Due to the same reason pipes do not work either with large flacs

Code: [Select]
flac.exe -d "E:\Avatar.2009.BluRay.REMUX.1080p.AVC.DTS-HD.MA5.1.flac" --stdout --silent | lossywav.exe - --stdout | flac.exe - -b 512 -8 --silent -o "E\lossy.flac"


i think that new version should have something like --readtoeof or --ignorelength switch like other encoders (Aften AC3 , FhGAACEnc or OpusEnc)
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-08-29 17:49:16
A specification compliant WAV file can be no larger than 4GB (minus a few bytes for header and format information).

Maybe looking at RIFF64 or BWF would be a better way forward to cope with very large files.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-08-29 18:40:42
Without --ignorelength switch lossyWav is useless for movie sound tracks. I can't even use pipe for direct processing.

BTW. Do you know maybe why your sources won't compile in delphi 7 pro?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-08-29 22:30:41
You could split the soundtrack into chapters, process with lossyWAV and then recombine using foobar2000.

I don't know about Delphi 7 Pro - I have been using Turbo Delphi Explorer 2006.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-08-30 12:44:56
Tycho,

Are there any specific compiler options that I should be using for compilation of the project?

I have downloaded the Dev-CPP IDE with MinGW 4.6.0.2 - primarily because I wanted a portable mode. Quite liking it and have started "playing" with it to get my head round C++.

On the Write() issue, would fprintf() be better? It would certainly make formatting the output much easier. I have got v0.3 to compile as far as nOutput.cpp.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: tycho on 2012-08-30 23:31:21
Nick,
Good to hear you're progressing with c++. Yes, the old ANSI C printf (stdio.h) is in many ways easier and more compact to use, although less type safe (it normally does not check arguments in the printf statements with the formatting string). Personally I would prefer to use the current standard which is the fstream/iostream interface.

To be blunt, DEV Cpp has been dead for years, and it's Windows only (written i Delphi actually).  There are better alternatives as I have mentioned earlier. For cross platform I would first recommend Qt Creator (available on Win,Linux,OS X). It is meant for Qt apps, but you may easily develop pure C++ projects without Qt and qmake. It supports many compilers, .e.g Visual Studio (Express) and GNU Mingw. You may download Qt libraries 4.8.2 (not the whole Qt SDK) for the qmake and cross platform GUI ++ libs. As a second alternative you can look at CodeLite, which is a one-man project only, then Code::Blocks which is similar.

I am going to configure Qt Creator myself with Mingw to fix the compilation issues there. It behaves different than VC++. I have currently Mingw 4.7.0 on my machine so there may be differences from 4.6.2. Don't worry about the Write() now, I will take care of that one when we get there.

This is probably information overload, so take it easy.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-07 19:05:20
Updated executable later tonight - huge thanks to Tycho for getting me off my butt to delve into C++ with his translation of the Delphi source code.

A few issues found and corrected, not least the in FFT code - there were a few issues in there (int equates to FLOOR; >> is shift-arithmetic-right, not a simple shift right; log is ln, not log10....).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-09-07 20:36:13
what is still missing in current c version vs original?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-07 20:49:06
A bit of accuracy - there's a bug somewhere in the chain after the FFT analyses that still has to be tracked. Adaptive noise shaping is confirmed to be working though.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-07 21:01:41
lossyWAV beta 1.3.0b attached. [edit] Superseded. [/edit]

Changelog:

Internal FFT routines now work.

To do list:

Piped input / output.
Track down accuracy error post FFT analyses.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-09-07 21:29:32
lossyWAV beta 1.3.0b attached.

Changelog:

Internal FFT routines now work.

To do list:

Piped input / output.
Track down accuracy error post FFT analyses.

after adding pipes could you also add --ignorelength switch?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: mudlord on 2012-09-08 01:37:09
Is there any reason for custom FFT? Why not something like KISSFFT or something?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: mezenga on 2012-09-08 04:32:09
Is there any reason for custom FFT? Why not something like KISSFFT or something?

At Delphi´s development time the reason seemed to be the lack of options.
But this C++ port surely is a good opportunity to review if it remains the better choice.

And here is some small lossyWAV FFT implementation history:
lossyWAV alpha v0.3.12 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=56129&view=findpost&p=523475) - Special thanks: Dr. Jean Debord for the use of TPMAT036 uFFT & uTypes units for FFT analysis (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=56129&view=findpost&p=510729)

lossyWAV v0.6.4 RC1 (http://www.hydrogenaudio.org/forums/index.php?showtopic=60379) - Special thanks: Don Cross for the original Pascal source for the FFT algorithm used. (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=56129&view=findpost&p=536204)

lossyWAV 1.1.0b (http://www.hydrogenaudio.org/forums/index.php?showtopic=60379) - Special thanks: Don Cross for the Complex-FFT algorithm used[/url]

Change log 1.1.4b: 14/05/09 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=65499&view=findpost&p=630272): FFT (Delphi and assembler) further optimised. Radix-4 FFT implemented in assembler and Delphi and Radix-8 in Delphi. Significant speedup of Delphi FFT throughput.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-08 13:20:46
I'll have a look at KissFFT - it may be faster.

I also need to try to get to grips with multi-threading to see if there is any way to speed up the processing.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: lvqcl on 2012-09-08 13:23:31
There's also PFFFT library: https://bitbucket.org/jpommier/pffft (https://bitbucket.org/jpommier/pffft) But it is for single-precision floats.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-08 13:28:23
I know that single precision would be faster but after trying it out earlier in the development of 1.3.0, I would much prefer to stick to double-precision.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: lvqcl on 2012-09-08 13:55:37
SoX (http://sox.sourceforge.net/) uses fft4g.c from Ooura 1D FFT (http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html)
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Destroid on 2012-09-09 10:50:07
Being unaware of KissFFT, I did a brief overview and noticed some factors:

- FFTW has benchmarks showing (on x64) having notably higher performance than KissFFT (the former program being version 3.3.x, the latter program's version I did not observe);

-  That KissFFT was not present on all of those benchmarks, possibly having to do with limitations on certain kinds of double-precision inputs;

- That KissFFT is purported to have simpler implementation and/or structure.

I am not an expert in areas of DSP and FFT and wanted to report my impressions and conclusions. I enjoy watching the development process as I also hope to gain knowledge. I congratulate and admire the developers' efforts (and HA, of course).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: mezenga on 2012-09-09 15:59:54
- FFTW has benchmarks showing (on x64) having notably higher performance than KissFFT (the former program being version 3.3.x, the latter program's version I did not observe);

FFTW is optionally supported since lossyWAV 1.1.4c (requires libfftw3-3.dll and --fftw switch) but the main discussion here is about the internal FFT function.
Until now FFTW saved 10-20% processing time: enough to became an option but not enough adding 500Kb in the download package.
Lets wait Nick and Tycho get some benchmarks from this C++ port.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-09 19:06:39
The C++ executable is *much* bigger than the Delphi one (1716kiB vs. 168kiB).

I am in the process of implementing a radix-4 IFFT while optimising the other FFT routines for speed. I think that there is some speed to be had. Also, the minGW compiler allows optimisation for various different processors and instruction sets. These do make an appreciable difference.

Main target is to get piped I/O working and to track down the accuracy bug previously mentioned.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: tycho on 2012-09-09 22:24:44
Even though much of the point of translating to C++ was the possible optimization benefits, I think correctness is still the most important at this point. I believe there are still issues I have mentioned elsewhere that needs to be addressed, or have they been handled? Also, in getParams() an if-statement is missing:
Code: [Select]
size_t found = parameters.wavName.find_last_of("/\\");
if (found != std::string::npos)
{
    parameters.WavInpDir = parameters.wavName.substr(0, found + 1);
    parameters.wavName = parameters.wavName.substr(found + 1);
}

For piped IO, make sure to set input/output stream to binary mode on windows.
Code: [Select]
#ifdef _WIN32
#include <cstdio>
#include <io.h>
#include <fcntl.h>
#endif
...
if (parameter.STDINPUT || parameter.STDOUTPUT) {
    #ifdef _WIN32
    _setmode(_fileno(stdin), _O_BINARY);
    _setmode(_fileno(stdout), _O_BINARY);
    #endif
    ...
}

This will also make std::cin and std::cout binary, i.e. does not translate linefeed char (LF) to CRLF - leaves it as LF. Works both under g++ and VS.

As for executable size, you may try -Os compiler flag and then "strip lossyWAV.exe". With Visual Studio, the executable doesn't  get very large.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-10 21:38:59
Thanks for those Tycho.

I've started on piped I/O - it's taking a bit of reconfiguration but will get there in the end.

I will also go back through to check for other previously mentioned issues.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-12 18:39:32
Piped I/O is now in testing phase - I processed my 10 album test set in foobar2000 without incident.

I've tracked down two problems in the bit-removal chain but am still getting slightly different results than the "reference" Delphi version. More bug-hunting to do there then.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-09-13 18:37:37
have you decided yet what multithreading method will you choose for extra speedup?

do you even consider reading wavs to the end file? ( 4gb+ wavs )
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-13 19:19:50
I have not started on multi-threading yet. I will go through the debugging process until I am content that the output is a close to the output of the reference version as it can be.

I am considering adding "--ignore-chunk-sizes" functionality, but I don't yet know how best to go about it. It will have to wait until I have finished the debugging process.

[edit] English language fail.... [/edit]
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-09-13 20:03:47
i keep asking about ignore chunk size switch because i plan to add lossywav preprocessing in ripbot264.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-13 21:07:14
Ah! Now it makes sense to me. In that case, I will confirm that I will attempt to develop the --ignore-chunk-sizes functionality (when I've finished initial debugging ).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-09-13 21:30:39
great and thank you!
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-15 12:00:08
lossyWAV beta 1.3.0c attached to post #1 in this thread. [edit] Superseded. [/edit]
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-09-15 18:36:34
Speed comparison
Q6600@3Ghz
All read/write done on RAMDISK 2GB

Code: [Select]
flac.exe -d "G:\original.flac" --stdout --silent | G:\lossywav.exe - --stdout | G:\flac.exe - -b 512 -8 --silent -o "G:\lossy.flac"


DELPHI version - 11.48x
C++ version - 14.88x
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-15 18:44:03
That's certainly encouraging !
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-09-15 18:46:12
Ability to process channels independently each in separate thread should give also nice extra speedup. Especially for 6ch movie soundtracks.

I wonder if compiling with Intel Compiler we could get even higher speed than your build.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: [JAZ] on 2012-09-15 19:28:27
I can confirm that higher speed will be possible:

(Core 2 Duo at 1.5GHz)

Delphi : 5.75x
GCC : 7.42x
VC x86 broken : 6.73916x
VC x64 broken : 7.14685x

Delphi FFTW : 7.49x
GCC FFTW : 8.22x
VC x64 FFTW broken : 8.86619x

VC broken means a modified compile of the sources released as v05 by tycho that I've compiled with Visual Studio 2008. x86 compile is with settings: full optimizations and SSE2. (With FFTW, the output is a bit more like GCC, but is still broken.).
Oh, and the size is, between 350KB and 400KB without requiring the msvc runtimes (I've linked it statically. Else it would be around 200KB and require the VS 2008 runtimes).

@Nick:  are you waiting to have a completely working version before releasing the C++ sources? I'm asking so that I don't fix things that you've already fixed. 
Also, I've seen that the GCC version shows correctly the --bitdist, but --blockdist is completely different. Not sure if that shows a problem in the displaying/storage of those values, or if it is the algorithm.  I guess most of the switches you added about statistics should help on debugging this port
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-18 18:56:17
lossyWAV beta 1.3.0d attached to post #1 in this thread. [edit] Superseded. [/edit]
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: mezenga on 2012-09-19 17:32:58
lossyWAV beta 1.3.0d attached to post #1 in this thread.

Tested against lossyWAV 1.3.0 delphi version for bit identical output with internal FFT and FFTW.

- standard quality setting: OK (bit identical).

- portable quality setting: KO (not bit identical).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-19 17:39:49
.... ok. Thanks for the testing - I'll go bug hunting again.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: punkrockdude on 2012-09-19 23:16:55
I really look forward to try this out on Linux one day. I really hope Linux drivers (especially proffessional audio interfaces) will soon be a reality so that I can use only Linux. Since installing an i3 i5 i7 patched kernel I am so impressed with Linux responsiveness. Why do I talk about Linux? Sorry guys
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: bandpass on 2012-09-20 07:37:16
Tested against lossyWAV 1.3.0 delphi version for bit identical output with internal FFT and FFTW.

- standard quality setting: OK (bit identical).

It would be good to split the port into a library, and an app (if this is not being done already). Then other apps can use the library.  Bear in mind that FFTW, being GPL, is not good for libraries; Ooura's fft4g is almost as fast, double-precision, and unrestricted.

I really look forward to try this out on Linux one day.

From the progress reports above, I think that day could be pretty soon!
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-20 19:57:41
- portable quality setting: KO (not bit identical).
Having difficulty replicating this (when the 'fact' chunk is not present, i.e. piped output).

If the 'fact' chunk is present then the file will be two bytes longer than a file processed using the reference Delphi version (the "d" in "lossyWAV 1.3.0d" and a padding byte).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-23 20:11:57
I have received samples that should allow me to determine the cause of the error. I can confirm that I have duplicated the processing that shows up the discrepancies. The debugging can therefore continue....
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-24 20:27:01
lossyWAV beta 1.3.0e attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: mezenga on 2012-09-24 23:14:19
lossyWAV beta 1.3.0e attached to post #1 in this thread.

All quality profiles tested on one single file resulted bit identical (OK).

The only remaining rouding issues that I´m seeing now are some time differences about hundredth of a second.
This difference shows off in both the wave souce´s time lenght and in several time points for "Detailed bits-to-remove data per channel per codec-block" (-d switch).
As the resulting files are identical this is just a minor display issue.

Example of different time lenght reports from my source test file:
lossyWAV 1.3.0 reports 0:32.26, lossyWAV 1.3.0e reports 0:32.27 and foobar2000 reports 0:32.267.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-26 19:57:40
Thanks for the corroborative testing. I have been trying to get the times to match but have not expended too much effort there so far.

I am now at a point where I am content that the output is identical to the output of the Delphi reference version.

As previously indicated, I will be implementing a new parameter to ignore-chunk-sizes (in a manner similar to FLAC et al). This will hopefully allow use with RipBot264 for transcode audio tracks.

I am now using Code::Blocks as my IDE with MinGW 4.7.0. There are some very nice compiler switches available to me using C++ that were completely absent in Turbo Delphi, i.e. CPU targets for the compile. When I compile with -march=pentium4 the optimised executable runs approximately 13% faster than a non-optimised version (on my FX-8150) - and faster than the Delphi / IA-32 / x87 version.

Delphi / IA-32/ x87: 50.7 seconds
C++ Vanilla: 52.9 seconds
C++ Pentium4: 46.8 seconds.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-09-26 20:54:37
why delphi version is faster than c version?

on my Q6600@3GHz c version was noticable faster.

btw. huge thanks for upcoming ignore chunk size switch.

that switch plus basic multithreading and this tool is complete! 

for short stereo track single threading is not a problem but for looong 6ch tracks conversion may take really looong time.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-09-26 21:08:59
The Delphi version (i.e. the Delphi version with significant quantities of IA-32 / x87 hand written assembly language included) is faster because of the assembly language content. A plain Delphi compile is *much* slower.

Delphi Vanilla: 4 minutes 3.2 seconds.

I should explain that my standard test (used here and in the post above) is to process my 55 sample test set (12:43.93) using FLAC | lossyWAV | FLAC with --quality extraportable and default adaptive noise shaping.

On the other hand, it may be that the executable simply performs better in an Intel CPU rather than my AMD.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-09-26 21:28:35
single integer unit in amd fx cpus is really slow in my opinion. i won't be surprised if your fx8150 will not be faster in this task than my old overclocked Q6600

this is another reason why we need some kind of multithreading.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-10-17 20:48:22
any news about current progress?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-10-17 21:07:50
I've been working on speeding up the code mostly.

Recently I have managed to start the multi-threading re-write, although I have not got very far with this.

The --ignore-chunk-sizes is still on my list. I would propose to handle this the same way as handling foobar2000 output. When piping, foobar2000 sends a RIFF chunk size of -1 (0xFFFFFFFF) and a 'data' chunk size of -1 (0xFFFFFFFF). If RipBot264 were to follow this convention I think it would be best all round.

Code is getting cleaner. FFT code is re-written using operators for complex calculations. Overall, my C++ experience (thus far) has been very satisfying.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-10-18 09:35:09
unfortunatelly ripbot264 is just a gui for other tools. something like megui. i hope that new version will work with this chain

ffmpeg -> lossywav -> ffmpeg/flac

i can not use flac.exe for decoding because it can't send large wavs via pipe.

how multithreading code will work? proccesing all channels at once or something else?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-10-18 17:46:26
I'll work on ffmpeg compatibility.

Multi threading will probably be at the fft calculation level as input and output of processed audio is linear due to sample interleaving.

I'll see how it goes.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-10-26 20:25:00
lossyWAV beta 1.3.0f attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-11-17 15:30:50
have you figured out how to accept pipe output from eac3to?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-11-17 18:08:48
I will try it out and see where I get to.

Sorry for the lack of communication - I've been busy making the FFT routines thread safe and I've started on the rest of the processing steps. So far, speed has improved a bit.

I've been a bit distracted by the UK Kickstarter for Elite: Dangerous....
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2012-11-17 20:33:32
great! don't forget also about broken progress indicator with 4gb+ wavs
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Jan7887 on 2012-11-29 04:07:35
Hello everybody,

I am very new at this forum but I'm very interested in lossywav.
I'd like to mention from a general scientific view that audio compression (lossy/lossless) is a very mind expanding subject. Just the fact that people with the right tools, insight and with help of math/calculus can accomplish such things.

I would like to thank the author Nick.c and all other people contributing in this thread for making this possible.
Certainly from my point of view it is a great accomplishment to be able to shrink to smaller audio files while trying to stay as close as possible to the original.
Thank you very much for creating such a piece of software and please, if you have time and resources, keep up the good work.
I understand that Tycho has been a great contributor or fellow author with the C / C++ version.

I'm still using the Delphi 1.3.0 version, but as I understand the C++ version will have some speed improvements ?

I do have another question about the block size of FLAC. Is the block size of 512 the most optimized size ? Is it possible to use a blocksize of 256 with the extraportable setting in Lossywav or would this be too restricting to let flac store the audio in a correct manner ?

Anyway, thanks again and I will follow the development and this thread of course.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Dynamic on 2012-11-29 13:07:33
If you look back at the 1.0 thread (find it via the end of the LossyWAV Wiki entry (http://wiki.hydrogenaudio.org/index.php?title=LossyWAV)) I beileve that's where the tests were done to compare different block sizes using FLAC, I believe, as the reference codec.

At that time, testing indicated that 512 seemed to be the sweet spot, giving the flexibility to reduce bits further in short parts where the noise floor allowed. Some things have changed such as adaptive noise shaping, so it's plausible that the sweet spot might shift to 256 or 1024, though probably not very likely.

FLAC and most lossless codecs default to about 4096 sample blocks to get better compression. That's to do with the predictor working well once the first few samples of the block are encoded, but not being allowed to refer back to the last samples of the previous codec block at the start of the next block for reasons of robustness to corruption. This means the first few samples of a block require more bits to encode than the later ones.

Often quietly mastered music (some classical solo stuff) doesn't benefit much from bit-depth reduction in lossyWAV and can actually end up worse off due to the short block length, so the bitrate is increase slightly by lossyWAV.

I think TAK has a lossyWAV optimised mode that works around some of the limitations.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-11-29 19:38:44
Hi Jan7887,

You've firstly got to thank 2Bdecided for publishing his method here (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=55522&view=findpost&p=498179). Eventually I got started on a Delphi version with lots of help from halb27. Noise shaping was next with a fixed IIR method from SebastianG. Adaptive noise shaping followed with a FIR method from SebastianG.

It's been a great hobby / project and a *huge* thief of time for about five years now - however, I am still enjoying working on the code, albeit in C++ now rather than Delphi / IA32 / x87.

When FFTW is not used, the C++ code is now faster than the assembler optimised Delphi version. When FFTW is used, the Delphi version sneaks ahead. However, with Pentium 4 C++ compiler options selected, the C++ is faster yet again.

I've been working on making the code thread safe to speed up single file processing, but been a bit sidetracked.

I'll publish a new beta soon.

On the block size, you can experiment with the FLAC encoding side of things by changing the blocksize yourself (-b [256/512/1024/etc.]) to see which is optimal for your particular audio.

Nick.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Jan7887 on 2012-11-29 22:56:00
Thank you Dynamic and Nick.C for the fast response.

Also, I shamefully admit, I wasn't fully aware of a wiki page with further tests. Thanks Dynamic for the link with the wiki page.
As you might have noticed I'm rather new here, but good research and googling around can save the day.
Nevertheless I will make sure I have a valid question to ask, I mean, I will do a bit of research on my own before asking questions that I could have searched and find myself.

Thank you 2Bdecided and Halb27 and still Nick.C for making this happen and Tycho for the C++ version, very much appreciated.

Indeed the blocksize is rather a difficult beast to handle. I think that Dynamic was about right that 512 is the sweet spot for block size. I have tried various sizes, but the result is inconclusive to me. sometimes 256 seems to be allright, but anything bigger than 1024 is in my opinion a bit too much, I mean in the resulting flac size.
512 seems to be about the right size for any kind of audio.

Thanks again and cheers and I hope such innovations as Lossywav and also FLOAT16 or PFM as like to call it (Pulse Float Modulation) will continue to exist.

2nd Edit:
(The previous sentence wasn't exactly right. I mean the implementation of Float16 by Nick.C in his other project. Float16 in itself already existed of course. And I called that PFM (Pulse Float Modulation) just for fun. It probably isn't a very correct way naming it thus. Anyway, thanks and I hope I make some sense. English isn't my native language, but I think I manage quite allright.)

Cheers!,
Jan.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: SebastianG on 2012-11-30 13:27:23
Tycho has kindly started the translation of lossyWAV from Delphi to C++.

Wow! Didn't see that coming...

I'll need to learn it to be able to contribute meaningfully....

If you're interested in book recommendations, try "Accelerated C++" and/or check out http://stackoverflow.com/questions/388242 (http://stackoverflow.com/questions/388242)

Kohlrabi, I haven't thought about using github yet.  My initial thought was just to get most of the code to compile, and then upload the code here. Useful help would be that people browsed through it and verified that the .pas and the .h/.cpp files does the same thing, but I wouldn't mind if people worked on it too.

Please put it on github or google code with git or mercurial versioning.
It'll make distributed development so much easier

I have downloaded the Dev-CPP IDE with MinGW 4.6.0.2 - primarily because I wanted a portable mode. Quite liking it and have started "playing" with it to get my head round C++.

If you don't want to use Microsoft tools, try a recent nightly build of the Code::Blocks IDE. But I have to say that debugging via "Visual C++ 2010 Express" is pretty sweet on a windows box.

The C++ executable is *much* bigger than the Delphi one (1716kiB vs. 168kiB).

Yeah. That's what you get for using MinGW on Windows. You might also want to check compiler options (not to include things like "-g" for the release build, for example). Finally, try "strip -s yourbinary.exe".

I guess that's also a good chance to learn something about CMake. With CMake as "build file generator" it does not matter what Toolchain/IDE developers use since they can use CMake to convert the cross-platform description "CMakeLists.txt" to a GNU Makefile or a VS2010 project file, etc etc etc. So, the nice thing about it is that one just has to maintain this cross-platform meta build script. CMake is still on my list of things to get deeper into. Unfortunately, my experience with it is rather limited at the moment.

I am in the process of implementing a radix-4 IFFT while optimising the other FFT routines for speed.

Did you profile the whole process? I would not expect the FFT to be a bottleneck here. The GNU toolchain offers some instrumentation tools you could try -- like "gprof" (GNU profiler). In order to make this work, the code needs to be compiled with the "-pg" switch if I remember correctly.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-11-30 19:47:03
Hi Sebastian,

I was kick-started into learning C++ when Tycho so kindly started the conversion. Eventually, I started to use Code::Blocks - it's really good and I'm now using MinGW 4.7.2.

Some hair tearing and a significant amount of bug-hunting later, we have bit-exact output and some code improvements. I took the opportunity to introduce some of the optimisations that had already been included in TransPCM (same codebase as lossyWAV).

I'm working on making the processing steps thread safe at the moment.

On the FFT front, I've now implemented up to Radix-16 forward and reverse FFT code. The larger radices do make quite a significant difference in improving the processing speed. I have been using the code profiler - so simple from within Code::Blocks.

Once I have finished hacking about the core variable setup to allow threaded operation, I fully intend to use github or Google Code to allow other interested parties to contribute.

I got a bit side-tracked (again) with Float16 audio - saratoga kindly included Float16 compatibility within Rockbox. foobar2000 has been compatible for over a year now. ! I found some code that codes and decodes Float16 to float without any if/then statements - quite quick really.

Nick.



Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Jan7887 on 2012-12-01 00:42:06
@SebastianG

Thank you very much for all your work on Adaptive Noiseshaping as implemented in Lossywav (delphi version). I saw I completely forgot to thank you 

@Nick.C

Good luck with the programming on both Lossywav and the Float16 project, it is very much appreciated.
I sometimes get a comment about why I further shrink the flac files. "Why don't you just use the original flacs?" I usually get.
Well, on a desktop computer it is all fine and dandy but I'd like to listen to flac or other lossless formats on portable devices.
And as cheap as storage is, it is still not very practical to have original flacs on those devices, at least in my opinion.

Besides the subject but I'm also very interested in the Opus codec from xiph. Call me crazy, but on portable devices like phones, the opus files are quite astonishing in sound, considering the low bitrate (usually between 64 and 96 kbps for music).
Anyway, I'm going offtopic here.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-12-01 09:38:21
Opus is very good indeed. If I was looking for very low bitrate audio for my Rockboxed Sansa Fuze I would certainly use that. Even more impressive is that it is now a standard!
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2012-12-16 22:11:42
Got sidetracked again - I'm going to add an option to convert any valid input audio (9-bit to 32-bit signed integer) to Float16, with or without adaptive / fixed noise-shaping. This will require the same messing about with the WAV handling code that I had to do for TransPCM. ETA is sometime early in the new year.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2013-01-03 15:44:46
any progress on lossywav?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-01-03 22:28:15
Still working on it, still distracted by the Elite: Dangerous KickStarter....
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: FreaqyFrequency on 2013-01-07 17:17:36
I've been experimenting with various compression levels in FLAC and -q X, and I've found that for certain tracks, -0 compresses much more efficiently than higher levels, and is practically equivalent with at least one of the tracks I tested at -8.  Extraportable combined with -0 might very well make for the most overall efficient decode combination ever.  Exciting stuff.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-01-18 20:26:07
lossyWAV beta 1.3.0g attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: FreaqyFrequency on 2013-01-20 07:25:16
lossyWAV beta 1.3.0g attached to post #1 in this thread.


Neat!  I'm getting an average of 2 to 3 kbps reduction at level 0 compression for the material I've tested so far.  It also seems to average faster processing than 1.3.0a, which is what I was using previously.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-01-20 17:00:20
I'm getting an average of 2 to 3 kbps reduction at level 0 compression for the material I've tested so far.
I've carried out a FLAC settings comparison test (based on my 55 problem sample test set) and will post the results this evening.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-01-20 21:44:48
I did a bit of testing with my 55 problem sample set (12:43.933 of audio) processed using "-q X" and got the following results:

Code: [Select]
+------------------+---------------------+
|      FLAC      |      Relative      |
|      Encoder    +----------+----------+
|      Setting    |  Size  |  Time  |
+------------------+----------+----------+
| -8 -m -r 8 -p    |  97.66%  |  2187%  |
| -8 -r 8 -p      |  97.66%  |  2089%  |
| -8 -e -r 8 -p    |  97.66%  |  2094%  |
| -8 -e -m -r 8 -p |  97.66%  |  2105%  |
| -8 -e -p        |  97.66%  |  1599%  |
| -8 -p            |  97.66%  |  1615%  |
| -8 -m -p        |  97.66%  |  1616%  |
| -8 -e -m -p      |  97.66%  |  1634%  |
| -6 -e -m -r 8 -p |  98.06%  |  1689%  |
| -7 -e -r 8 -p    |  98.06%  |  1694%  |
| -6 -e -r 8 -p    |  98.06%  |  1695%  |
| -7 -e -m -r 8 -p |  98.06%  |  1697%  |
| -4 -e -m -r 8 -p |  98.06%  |  1701%  |
| -7 -r 8 -p      |  98.06%  |  1705%  |
| -7 -m -r 8 -p    |  98.06%  |  1710%  |
| -5 -e -m -r 8 -p |  98.06%  |  1723%  |
| -5 -e -r 8 -p    |  98.06%  |  1799%  |
| -7 -e -p        |  98.06%  |  1215%  |
| -6 -e -p        |  98.06%  |  1220%  |
| -6 -e -m -p      |  98.06%  |  1222%  |
| -7 -m -p        |  98.06%  |  1222%  |
| -7 -e -m -p      |  98.06%  |  1224%  |
| -7 -p            |  98.06%  |  1225%  |
| -5 -e -p        |  98.10%  |    983%  |
| -5 -e -m -p      |  98.10%  |  1020%  |
| -4 -e -m -p      |  98.18%  |    825%  |
| -8 -r 8          |  98.36%  |    368%  |
| -8 -m -r 8      |  98.36%  |    370%  |
| -8 -e -m -r 8    |  98.36%  |    374%  |
| -8 -e -r 8      |  98.36%  |    379%  |
| -8 -e -m        |  98.36%  |    249%  |
| -8 -m            |  98.36%  |    249%  |
| -8              |  98.36%  |    250%  |
| -8 -e            |  98.36%  |    250%  |
| -3 -e -m -r 8 -p |  98.69%  |  1449%  |
| -6 -e -m -r 8    |  98.80%  |    294%  |
| -7 -e -r 8      |  98.80%  |    295%  |
| -7 -r 8          |  98.80%  |    295%  |
| -5 -e -r 8      |  98.80%  |    296%  |
| -7 -e -m -r 8    |  98.80%  |    296%  |
| -6 -e -r 8      |  98.80%  |    296%  |
| -4 -e -m -r 8    |  98.80%  |    298%  |
| -7 -m -r 8      |  98.80%  |    298%  |
| -5 -e -m -r 8    |  98.80%  |    318%  |
| -6 -e -m        |  98.81%  |    174%  |
| -7 -e -m        |  98.81%  |    175%  |
| -6 -e            |  98.81%  |    176%  |
| -7 -m            |  98.81%  |    177%  |
| -7 -e            |  98.81%  |    183%  |
| -7              |  98.81%  |    189%  |
| -3 -e -m -p      |  98.82%  |    605%  |
| -5 -e            |  98.86%  |    127%  |
| -5 -e -m        |  98.86%  |    138%  |
| -4 -e -m        |  98.95%  |    105%  |
| -3 -e -m -r 8    |  99.40%  |    261%  |
| -6 -m -r 8 -p    |  99.42%  |    201%  |
| -6 -r 8 -p      |  99.42%  |    205%  |
| -5 -r 8 -p      |  99.42%  |    206%  |
| -5 -m -r 8 -p    |  99.42%  |    209%  |
| -4 -m -r 8 -p    |  99.42%  |    215%  |
| -6 -m -p        |  99.42%  |    137%  |
| -6 -p            |  99.42%  |    138%  |
| -5 -m -p        |  99.45%  |    106%  |
| -5 -p            |  99.45%  |    108%  |
| -4 -m -p        |  99.51%  |    87%  |
| -3 -e -m        |  99.55%  |    71%  |
| -3 -m -r 8 -p    |  99.86%  |    209%  |
| -3 -m -p        |  99.95%  |    88%  |
| -6 -m -r 8      |  99.97%  |    28%  |
| -6 -r 8          |  99.97%  |    31%  |
| -5 -m -r 8      |  99.97%  |    32%  |
| -4 -m -r 8      |  99.97%  |    33%  |
| -5 -r 8          |  99.97%  |    33%  |
| -6 -m            |  99.97%  |      6%  |
| -6              |  99.97%  |      7%  |
| -5 -m            | 100.00%  |    -1%  |
+------------------+----------+----------+
| -5              | 100.00%  |      0%  |
+------------------+----------+----------+
| -4 -m            | 100.06%  |    -5%  |
| -3 -m -r 8      | 100.44%  |    27%  |
| -3 -m            | 100.52%  |    -9%  |
| -3 -e -r 8 -p    | 100.54%  |    678%  |
| -3 -e -p        | 100.69%  |    279%  |
| -3 -e -r 8      | 101.28%  |    102%  |
| -3 -e            | 101.45%  |      9%  |
| -3 -r 8 -p      | 101.76%  |    78%  |
| -3 -p            | 101.87%  |    20%  |
| -3 -r 8          | 102.37%  |    -15%  |
| -3              | 102.48%  |    -30%  |
| -4 -e -r 8 -p    | 102.59%  |    846%  |
| -4 -e -p        | 102.74%  |    403%  |
| -4 -e -r 8      | 103.33%  |    130%  |
| -4 -e            | 103.50%  |    28%  |
| -4 -r 8 -p      | 104.08%  |    85%  |
| -4 -p            | 104.19%  |    22%  |
| -4 -r 8          | 104.64%  |    -8%  |
| -4              | 104.76%  |    -28%  |
| -2 -e -m -r 8 -p | 108.34%  |    113%  |
| 0 -e -m -r 8 -p  | 108.34%  |    114%  |
| 0 -e -m -r 8    | 108.34%  |    114%  |
| -2 -e -m -r 8    | 108.34%  |    115%  |
| -1 -e -m -r 8    | 108.34%  |    115%  |
| -1 -e -m -r 8 -p | 108.34%  |    117%  |
| -2 -e -r 8 -p    | 108.34%  |    118%  |
| -2 -e -r 8      | 108.34%  |    119%  |
| -2 -r 8          | 108.50%  |    -4%  |
| 0 -m -r 8 -p    | 108.50%  |    -3%  |
| 0 -m -r 8        | 108.50%  |    -3%  |
| -1 -m -r 8 -p    | 108.50%  |    -2%  |
| -2 -r 8 -p      | 108.50%  |    -1%  |
| -2 -m -r 8      | 108.50%  |    -1%  |
| -1 -m -r 8      | 108.50%  |      0%  |
| -2 -m -r 8 -p    | 108.50%  |      5%  |
| -2 -e -m -p      | 108.65%  |    -2%  |
| -2 -e -m        | 108.65%  |    -1%  |
| -1 -e -m -p      | 108.65%  |    -1%  |
| 0 -e -m -p      | 108.65%  |    -1%  |
| 0 -e -m          | 108.65%  |    -1%  |
| -1 -e -m        | 108.65%  |      2%  |
| -2 -e -p        | 108.65%  |      5%  |
| -2 -e            | 108.65%  |      7%  |
| 0 -m            | 108.71%  |    -28%  |
| 0 -m -p          | 108.71%  |    -28%  |
| -1 -m            | 108.71%  |    -27%  |
| -2 -m -p        | 108.71%  |    -27%  |
| -2              | 108.71%  |    -27%  |
| -2 -m            | 108.71%  |    -25%  |
| -2 -p            | 108.71%  |    -23%  |
| -1 -m -p        | 108.71%  |    -21%  |
| 0 -e -r 8 -p    | 110.94%  |    30%  |
| 0 -e -r 8        | 110.94%  |    35%  |
| 0 -r 8 -p        | 111.12%  |    -31%  |
| 0 -r 8          | 111.12%  |    -28%  |
| 0 -e            | 111.29%  |    -29%  |
| 0 -e -p          | 111.29%  |    -25%  |
| 0 -p            | 111.37%  |    -41%  |
| 0                | 111.37%  |    -34%  |
| -1 -e -r 8 -p    | 113.83%  |    34%  |
| -1 -e -r 8      | 113.83%  |    44%  |
| -1 -r 8 -p      | 114.06%  |    -27%  |
| -1 -r 8          | 114.06%  |    -24%  |
| -1 -e -p        | 114.18%  |    -20%  |
| -1 -e            | 114.18%  |    -19%  |
| -1 -p            | 114.31%  |    -39%  |
| -1              | 114.31%  |    -38%  |
+------------------+----------+----------+
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-01-23 21:19:46
lossyWAV beta 1.3.0h attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-01-30 22:20:14
lossyWAV beta 1.3.0i attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-02-08 21:31:13
lossyWAV beta 1.3.0j attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Cynic on 2013-02-19 22:31:52
What is the penalty (if any) for using the -i switch? Slower encoding, higher risk of artifacts, or both? For someone not that concerned with filsesize, is the new noise shaping routine preferable to the default?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-02-20 21:03:27
Hi Cynic,

The penalty is simply that the noise shaping is a bit more aggressive in trying to conform to the lossless audio spectrum. This saves about 1% of the resultant lossyFLAC size when compressed at --extraportable, less at higher quality levels.

I am currently working on a (very) simplistic psymodel based on masking using the Bark scale. This may be a wrong turn, but it is an option for both the classic method and the --interp-curve method of determining the basis shape of the noise spectrum.

Nick.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Banned on 2013-03-02 20:20:59
Out of curiousity, why does the distribution include a "gpl.txt" file? I thought it is for open source software.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-03-03 16:33:31
When v1.40 is released, the source will be as well in a similar manner to the previous versions.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-03-08 20:27:52
lossyWAV beta 1.3.0k attached to post #1 in this thread.

[edit] updated to beta 1.3.0k2 [/edit]
[edit2] updated to beta 1.3.0k3 [/edit2]
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-03-25 22:04:19
lossyWAV beta 1.3.0m attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-03-30 14:14:14
lossyWAV beta 1.3.0n attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2013-03-30 14:31:24
Thanks for your work. I'm looking forward to 1.3.0 final.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: doccolinni on 2013-05-26 03:04:27
I may be late for the party, but regarding the internal FFT routines...

You might consider using FFTW's genfft (http://www.fftw.org/doc/Generating-your-own-code.html) to generate efficient FFT routine source code. genfft is a set of routines written in OCaml which generate C code for efficient FFT routines. For example, this (http://jdj.mit.edu/~stevenj/mdct_128nr.c) is a C code for 128-sample MDCT generated with genfft. These were used to generate FFTW's FFT routines, and you can use it to generate the code for lossyWAV's internal FFT routines. You can download it from here (https://github.com/FFTW/fftw3/tree/master/genfft). Contact () and I'm sure they'll gladly assist you with using it to generate code for lossyWAV.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: doccolinni on 2013-05-26 05:43:15
By the way, you can read more about genfft and why FFTW is fast here (https://www.cs.drexel.edu/~jjohnson/2009-10/winter/cs650/lectures/pldi99-slides.pdf).

The best solution, however, is to not have a specified internal FFT routine, because ultimately its performance will be hardware-specific (better/worse on some hardware). You are better off completely relying on FFTW since it adapts itself to whatever hardware it's used on.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-06-11 19:34:34
lossyWAV beta 1.3.0o attached to post #1 in this thread.

=============================================================

Hi doccolinni,

The internal FFT / IFFT routines are only used if the appropriate FFTW 32-bit DLL is not available to lossyWAV.

Nick.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2013-06-12 23:13:53
does pipeing work with wave64 format? for example latest flac 1.3 -> lossywav -> latest flac 1.3

btw soon you will run out of alphabet
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-06-13 07:16:57
FLAC 1.3.0 > lossyWAV 1.3.0o > FLAC 1.3.0 works with --force-wave64-format in the first FLAC command.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2013-06-13 12:33:36
Ok works like I charm 
I've encoded using pipes (FLAC -> lossywav -> FLAC) 2h:41m 6 channels avatar soundtrack without any problems.
Lossywav now really needs multithreading optimalization. Using internal algo it took 40 minutes to complete task on my Q6600@3Ghz. With proper multithreading this could be reduced to 12-14 minutes.

Btw What exactly .dll does lossywav need to use FFTW? libfftw3-3.dll , libfftw3f-3.dll or libfftw3l-3.dll ?

One more thing. You forgot to include pthreadGC2.dll in package.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2013-06-13 12:43:00
Lossywav now really needs multithreading optimalization.


For now, you can transcode multiple tracks in parallel.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2013-06-13 12:45:20
I will be using lossywav ONLY for movie soundtracks.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-06-13 12:55:08
Btw What exactly .dll does lossywav need to use FFTW? libfftw3-3.dll , libfftw3f-3.dll or libfftw3l-3.dll ?
libfftw3-3.dll (double precision).

One more thing. You forgot to include pthreadGC2.dll in package.
I will remove the dependency on it (multi-threading on hold at the moment).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2013-06-13 13:05:39
Quote
I will remove the dependency on it (multi-threading on hold at the moment).

So I guess I will have to find a workaround for this . I'm thinking about using --skip and --until options in flac decoder. The idea is to run four tasks at the same time and each task (FLAC -> lossywav -> FLAC) will encode it's own chunk.

example
Code: [Select]
flac.exe -d "E:\Avatar.2009.BluRay.REMUX.1080p.AVC.DTS-HD.MA5.1.flac" --skip 0 --until 1000 --force-wave64-format --stdout --silent | lossywav - --stdout | flac - -b 512 -8 --silent -o "C:\chunk1.flac"


Code: [Select]
flac.exe -d "E:\Avatar.2009.BluRay.REMUX.1080p.AVC.DTS-HD.MA5.1.flac" --skip 1001 --until 2000 --force-wave64-format --stdout --silent | lossywav - --stdout | flac - -b 512 -8 --silent -o "C:\chunk2.flac"


and so on. Do you know maybe how to determine number of samples in flac file and also how to properly combine all chunks in one flac file?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-06-13 13:14:49
Number of samples = Duration * Sample-Rate. Use metaflac --show-sample-rate to output the sample-rate of the file and --show-total-samples for total number of samples.

You can specify an exact sample reference for both --skip and --until. Sample reference should be an exact multiple of the lossyWAV block size corresponding to the sample rate of the audio. If in doubt, use a multiple of 4096;

Please ensure that the value used in conjunction with "-b" (512 in this case) is appropriate for the sample-rate of the audio. 512 for 25.6kHz <= f < 51.2kHz; 1024 for 51.2kHz <= f < 102.4kHz, etc (up to 4096);

There must be a way to join FLAC files together in this manner.... (I believe that shntool can achieve this (although not sure if it is compatible with WAVE64)).

[edits]

[more edits] 8192 should have been 4096.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2013-06-13 13:34:34
Ok thanks for help !
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2013-06-13 15:10:31
There must be a way to join FLAC files together in this manner.... (I believe that shntool can achieve this (although not sure if it is compatible with WAVE64)).


With FLAC, I do something like this:

Code: [Select]
flac -d -c --force-raw-format --endian=little --sign=signed *.flac | flac -s -o 'album.flac' -P 8192 --best --endian=little --sign=signed --channels=2 --bps=16 --sample-rate=44100 -
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Atak_Snajpera on 2013-06-14 00:15:27
so far i could not find tool which could merge flacs without re-encoding process. it really sucks that ogg vorbis can be easly losslessly splited/joined but not lossless flac format.

i still have last crazy idea. muxing flacs into .mka using mkvtoolnix and then demuxing back to .flac
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-06-18 21:14:24
lossyWAV beta 1.3.1a attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-06-20 20:26:58
lossyWAV beta 1.3.1b attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Musique-Rabbit on 2013-08-03 15:42:12
lossyWAV beta 1.3.1b attached to post #1 in this thread.


I just found out that my foobar2000 v1.2.9 stops working for this version. It used to work fine.

Please help, anyone?

The parameters are:
Code: [Select]
C:\Windows\System32\cmd.exe /d /c lossyWAV.exe - --quality standard --silent --stdout|flac.exe - -b 512 -5 -f -o%d --ignore-chunk-sizes

Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-08-03 19:26:07
Many thanks for the bug report. Did beta 1.3.1b function correctly with foobar2000 v1.2.8? (I upgraded to check your report and now cannot downgrade).

I will attempt to determine what has changed and create a fix.

Thanks again,

Nick.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Hex144 on 2013-08-04 08:38:15
Just attempted to run 1.3.1b and got:

Code: [Select]
%lossyWAV Error%: Program has reached expiry date.
Please contact Nick.C for a new version.

What is this?
Doesn't happen with Delphi 1.3.0

PS: Maybe it's the same issue with Musique-Rabbit?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-08-04 22:45:12
What is this?
Doesn't happen with Delphi 1.3.0

PS: Maybe it's the same issue with Musique-Rabbit?

It probably is - my mistake. Thanks for posting the finding.

I have introduced a drop-dead-date for beta versions so that versions with potential errors in the method will expire over time.

lossyWAV beta 1.3.1c attached to post #1 of this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Musique-Rabbit on 2013-08-05 02:24:17
[lossyWAV beta 1.3.1c attached to post #1 of this thread.

Yes, it works again.

Thanks, Nick.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-09-15 11:17:35
lossyWAV beta 1.3.1d attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-10-07 21:44:59
lossyWAV beta 1.3.1e attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2013-10-13 02:06:39
lossyWAV beta 1.3.1e attached to post #1 in this thread.


Hey Nick,

Unfortunately, the latest version of lossyWAV seems to be faulty. It just won't work for some reason. Can you check it out when you have the time.

Thanks. Great job by the way.

Alex
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-10-13 12:52:13
Thanks for the report Alex.

Can you provide a little more detail as to the nature of the error?

Thanks.

Nick.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2013-10-13 15:10:54
Thanks for the report Alex.

Can you provide a little more detail as to the nature of the error?

Thanks.

Nick.



Sure, Nick. The converter status report from Foobar 2000 is below. Please note that 1.3.1.4 works perfectly with the normal parameters (I use --quality high).

Alex


1 out of 1 tracks converted with major problems.

Source: "C:\Users\Alex Akin\Music\Main\Elbow\Asleep In The Back\01 Elbow - Any Day Now.flac"
  An error occurred while writing to file (The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters) : "C:\Users\Alex Akin\Downloads\Portable Music\Elbow\Asleep In The Back\01 Elbow - Any Day Now.lossy.flac"
  Additional information:
  Encoder stream format: 44100Hz / 2ch / 16bps
  Command line: "C:\Windows\System32\cmd.exe" /d /c C:\"Program Files"\bin\lossywav - --quality high --silent --stdout|C:\"Program Files"\bin\flac - -b 512 -5 -f -o"01 Elbow - Any Day Now.lossy.flac" --ignore-chunk-sizes
  Working folder: C:\Users\Alex Akin\Downloads\Portable Music\Elbow\Asleep In The Back\
 
  Conversion failed: The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-10-13 21:41:06
Sure, Nick. The converter status report from Foobar 2000 is below. Please note that 1.3.1.4 works perfectly with the normal parameters (I use --quality high).

Alex

I tried to emulate the error with no success. It could be down any of the following (as well as being a bug in lossyWAV that has before now not deigned to rear its head):

1) No space left on drive C;
2) System date incorrectly set;
3) Either lossyWAV.exe or FLAC.exe missing from directory pointed to in command line.

Another possibility - have you tried any other tracks, and if so have you had any success with them? During the development of adaptive noise shaping, there were three John Lennon tracks from Imagine that caused a divide by zero error in the Levinson algorithm when creating the noise shaping filter and this only showed up during a mass test encode.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2013-10-13 21:57:39
It's baffling. Like I said previously, only version 1.3.1.5 isn't behaving. Version 1.3.1.4 does the job smoothly, without breaking a sweat.

I've tried a range of tracks just to pinpoint the problem - all to no avail. I can confirm that there's abundant space left on drive C; system date is correct; and both lossyWAV.exe and FLAC.exe were present in folder "bin" in Program Files.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-10-13 22:00:38
Thanks again Alex. I'll break out the bug-hunting gear and make a start.

I may be some time....
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-10-15 20:08:12
lossyWAV beta 1.3.1f attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2013-11-08 15:14:17
lossyWAV beta 1.3.1f attached to post #1 in this thread.


Hello Nick,

I still haven't been able to get the latest beta version of LossyWav 1.3.1 to work on any of my systems (Windows 8 and 7 respectively). Same error as the last version.

Can you confirm that the following parameters still apply:

/d /c C:\"Program Files"\bin\lossywav - --quality standard --silent --stdout|C:\"Program Files"\bin\flac - -b 512 -5 -f -o%d --ignore-chunk-sizes

Thanks,

Alex
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: nu774 on 2013-11-08 16:32:54
Try setting like this:
Code: [Select]
/d /c lossywav - -q standard --stdout 2>%d.log | flac - -b 512 -5 -f  -o %d --ignore-chunk-sizes

You will get log file (hopefully with some useful error messages) in the destination directory for each song.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2013-11-08 17:07:31
Try setting like this:
Code: [Select]
/d /c lossywav - -q standard --stdout 2>%d.log | flac - -b 512 -5 -f  -o %d --ignore-chunk-sizes

You will get log file (hopefully with some useful error messages) in the destination directory for each song.


Thanks nu774. The error message I got is as follows:

%lossyWAV Error%: Input file: lossywav  - --quality standard --silent --stdout  does not exist

Can anyone make sense of it?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-11-08 20:13:21
A bit stumped by this one....

Can you please confirm that flac.exe and lossyWAV.exe both exist in the "C:\Program Files\bin" directory?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2013-11-08 20:28:16
I can confirm that both flac.exe and lossyWAV.exe are present in the "C:\Program Files\bin" directory. Interestingly, if I substitute 1.3.1f with the stable version (1.3.0.0), everything works without any problems. No error messages of any sort. For what it's worth, I'm using libFLAC 1.3.0.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-11-08 20:55:54
Ok. Not sure that the libFLAC version is relevant as the foobar2000 command uses the executable rather than the DLL.

Which version is FLAC.exe?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2013-11-08 21:00:19
Ok. Not sure that the libFLAC version is relevant as the foobar2000 command uses the executable rather than the DLL.

Which version is FLAC.exe?


FLAC.exe is the latest build - FLAC 1.3.0 (26 May 2013).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-11-08 21:02:56
Can you please process a WAV file using lossyWAV on the command line?

Also, what CPU is in the PC?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2013-11-08 22:01:08
Can you please process a WAV file using lossyWAV on the command line?

Also, what CPU is in the PC?


Strangely, it works now. I tried switching things around, using the following parameters:

/d /c C:\foobar2000\lossywav.exe - -q H --silent --stdout|C:\foobar2000\flac.exe - -b 512 -5 -f -o%d --ignore-chunk-sizes

Hopefully, this will help anyone out there experiencing the same problem. By the way, thanks a lot Nick for responding so quickly!
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-11-09 13:15:55
Glad that you managed to sort it out.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2013-12-01 16:54:26
Glad that you managed to sort it out.


Hi Nick,

Any chance for a new beta version of LossyWAV with a new drop dead date?

Alex
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-12-01 20:25:07
Hi Alex,

Many apologies - my wife had a significant birthday on Friday and this weekend has been particularly hectic.

Nick.

lossyWAV beta 1.3.1g attached to post #1 in this thread.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2013-12-01 21:00:19
Hi Alex,

Many apologies - my wife had a significant birthday on Friday and this weekend has been particularly hectic.

Nick.

lossyWAV beta 1.3.1g attached to post #1 in this thread.


Thanks for this, Nick. I think having a longer drop dead date like 1.3.1g does is brilliant.

By the way, congrats to you and your wife on the milestone birthday!
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2013-12-02 07:44:20
Thanks for this, Nick. I think having a longer drop dead date like 1.3.1g does is brilliant.


It's only two months… what's with those anyway? I'm afraid I didn't follow too closely.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2013-12-02 18:09:13
The expiry date was introduced to limit the damage that an experimental function in a beta release would have, i.e. it would not be available indefinitely.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: dory on 2014-01-02 09:18:51
Hi
Since version 1.3.1a
I have a problem because of these parameters that I have set my foobar2000 does not work with newer versions higher than that which I have given is not unnecessarily replaced the executable file and you can not go back to the old version . I tried to make a difference in performance but still the same I jump out :

1 out of 1 tracks converted with major problems.

Source: "D:\muzyka\Flac\Radiohead - Discography 1993-2011 [FLAC]\1997 - OK Computer\04 - Exit Music (For a Film).flac"
  An error occurred while writing to file (The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters) : "D:\muzyka\ass\Radiohead\OK Computer (1997)\04. Exit Music (for a Film).flac"
  Additional information:
  Encoder stream format: 48000Hz / 2ch / 16bps
  Command line: "C:\Windows\System32\cmd.exe" /d /c  c:\"Program Files (x86)"\foobar2000\encoders\lossyWAV - --quality extraportable  --silent --stdout|c:\"Program Files (x86)"\foobar2000\encoders\flac --silent -b 512 -8 --ignore-chunk-sizes - -o "04. Exit Music (for a Film).flac"
  Working folder: D:\muzyka\ass\Radiohead\OK Computer (1997)\
 
  Conversion failed: The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters


What could be the problem?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-01-02 10:18:38
Have you downloaded the latest beta version? There is now a "drop dead" date whereby beta versions expire after a certain date. Please download the latest beta and retry.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: dory on 2014-01-02 11:54:09
Now I use the last version 1.3.1g and the problem persists I do not know what it was?
What could be wrong?
Maybe showcase me some examples of that work? Sam I do not know where it can be a problem. Once, as was set for the first time paramatry include it did not work with one - with two persons - and written with names only worked therefore I have in this example, which I handed but here it does not help I have no idea on this.

1 out of 1 tracks converted with major problems.

Source: "D:\muzyka\Flac\Franz Ferdinand Album Discography 2004-2013 [FLAC]\Franz Ferdinand - Tonight [2009] [LIMITED] [FLAC]\CD1\05 - Twilight Omens.flac"
  An error occurred while writing to file (The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters) : "D:\muzyka\ass\05 - Twilight Omens.flac"
  Additional information:
  Encoder stream format: 44100Hz / 2ch / 16bps
  Command line: "C:\Windows\System32\cmd.exe" /d /c  c:\"Program Files (x86)"\foobar2000\encoders\lossyWAV  - -q X --silent --stdout|c:\"Program Files (x86)"\foobar2000\encoders\flac --silent -b 512 -8 --ignore-chunk-sizes - -o "05 - Twilight Omens.flac"
  Working folder: D:\muzyka\ass\
 
  Conversion failed: The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters

Edit:

Look at my parameters:

/d /c  c:\"Program Files (x86)"\foobar2000\encoders\lossyWAV  - -q X --silent --stdout|c:\"Program Files (x86)"\foobar2000\encoders\flac --silent -b 512 -8 --ignore-chunk-sizes - -o %d
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-01-02 12:50:35
The FLAC element of the command line is missing a " - " to tell the encoder to take input from STDIN.


Try moving the " - " to just after FLAC in your command line.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: dory on 2014-01-02 15:23:50
Nothing helps ... encoders copied to the folder foobar2000 I just change my syntax and I still have the same error ... Now the syntax looks like this:

/d /c lossyWAV - -q X --silent --stdout|flac - -b 512 -8 - -o %d --ignore-chunk-sizes

before:

/d /c lossyWAV - -q X --silent --stdout|flac -b 512 -8 --ignore-chunk-sizes -o %d
/d /c lossyWAV - -q X --silent --stdout|flac - -b 512 -8 -o %d --ignore-chunk-sizes
/d /c C:\"Program Files (x86)"\foobar2000\encoders\lossywav - -q P --silent --stdout|C:\"Program Files (x86)"\foobar2000\encoders\flac - -b 512 -5 -f -o%d --ignore-chunk-sizes

Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: robert on 2014-01-02 15:48:48
Nothing helps ... encoders copied to the folder foobar2000 I just change my syntax and I still have the same error ... Now the syntax looks like this:

/d /c lossyWAV - -q X --silent --stdout|flac - -b 512 -8 - -o %d --ignore-chunk-sizes

before:

/d /c lossyWAV - -q X --silent --stdout|flac -b 512 -8 --ignore-chunk-sizes -o %d
/d /c lossyWAV - -q X --silent --stdout|flac - -b 512 -8 -o %d --ignore-chunk-sizes
/d /c C:\"Program Files (x86)"\foobar2000\encoders\lossywav - -q P --silent --stdout|C:\"Program Files (x86)"\foobar2000\encoders\flac - -b 512 -5 -f -o%d --ignore-chunk-sizes


3 dashes, is that really your command line?

/d /c lossyWAV - -q X --silent --stdout|flac - -b 512 -8 - -o %d --ignore-chunk-sizes
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-01-02 17:55:03
/d /c C:\"Program Files (x86)"\foobar2000\encoders\lossywav - -q P --silent --stdout|C:\"Program Files (x86)"\foobar2000\encoders\flac - -b 512 -5 -f -o%d --ignore-chunk-sizes


Should work if both lossyWAV and FLAC are on in "C:\Program Files (x86)\foobar2000\encoders\".

Try opening a CMD window and enter the command:

"C:\Program Files (x86)\foobar2000\encoders\lossywav"

and post a copy of the output, please. (To copy output in a command window, right click in the window, select mark and click and drag to select the area of text you want to copy).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-01-02 17:56:41
3 dashes, is that really your command line?

/d /c lossyWAV - -q X --silent --stdout|flac - -b 512 -8 - -o %d --ignore-chunk-sizes

There should only be one single dash in the FLAC element of the command line, not two. For piped processing in foobar2000 a single dash is required in the lossyWAV element of the command line.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2014-01-02 18:03:52
Nothing helps ... encoders copied to the folder foobar2000 I just change my syntax and I still have the same error ... Now the syntax looks like this:

/d /c lossyWAV - -q X --silent --stdout|flac - -b 512 -8 - -o %d --ignore-chunk-sizes

before:

/d /c lossyWAV - -q X --silent --stdout|flac -b 512 -8 --ignore-chunk-sizes -o %d
/d /c lossyWAV - -q X --silent --stdout|flac - -b 512 -8 -o %d --ignore-chunk-sizes
/d /c C:\"Program Files (x86)"\foobar2000\encoders\lossywav - -q P --silent --stdout|C:\"Program Files (x86)"\foobar2000\encoders\flac - -b 512 -5 -f -o%d --ignore-chunk-sizes


I had similar problems not too long ago. Try using the following parameters:

/d /c C:\foobar2000\lossywav.exe - -q X --silent --stdout|C:\foobar2000\flac.exe - -b 512 -8 -f -o%d --ignore-chunk-sizes
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: dory on 2014-01-02 18:58:32
In the End I managed to issue here was current path access. Although the performance of these commands through the command line with the current path "Program Files (x86)" \ foobar2000 \ encoders \ where I have other encoders. To perform but do not know why there was doing this using foobar2000. Now, I created a folder "foobar2000" on the C drive threw there encoder ect and everything works
Thanks for Your help!!! 
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2014-01-02 19:14:47
In the End I managed to issue here was current path access. Although the performance of these commands through the command line with the current path "Program Files (x86)" \ foobar2000 \ encoders \ where I have other encoders. To perform but do not know why there was doing this using foobar2000. Now, I created a folder "foobar2000" on the C drive threw there encoder ect and everything works
Thanks for Your help!!! 


Great to hear you've sorted this out. Nick: I think the Wiki needs to be updated to reflect the need for a separate foobar2000 folder on the C drive. That's the missing ingredient for making LossyWAV work - via foobar2000 at least.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-01-02 19:34:55
I keep my encoders in a specific directory ("K:\UserData\BIN\") that is unrelated to any programs that may use them.

This directory is added to the path:

(http://s26.postimg.org/xet2goa61/Path_directory_addition.png)

and my foobar2000 converter command includes no paths to the executables, just the executable names themselves:

Code: [Select]
/d /c lossywav - --stdinname %d -F -p -w -W 127 -q X --silent --stdout|flac - --silent -b 512 -8 -o%d --ignore-chunk-sizes


So, there is no requirement for a specific directory, simply care taken when specifying the path to executables (if necessary....).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: weepy on 2014-01-08 10:26:54
Hi there - wonderful project,

I was wondering if it was ever going to be possible to get a LINUX/MAC compilable version of lossyWAV ?

Perhaps this is something to do with the port to C from Delphi ?

Cheers
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-01-08 17:21:51
Hi weepy,

It should be - when version 1.4.0 is released, I will simultaneously release the source code. My plan is to update the Sourceforge project at the same time. Someone with the inclination and time could then modify the windows oriented elements of the code to be linux friendly.

Nick.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: darkbyte on 2014-01-19 12:32:51
Did anyone do comparison between the old extraportable and the new extraportable (with feedback) setting?
I wonder if i should upgrade my LossyWAV to this new version or it's more safe to use the older version with the extraportable setting? Will i get anything in benefit? Faster encoding speed or smaller target file size?
I should say that the older extraportable setting is already very good for me. I've tried to ABX it agasint the original FLAC earlier but it was so hard for me that i eventually gave up
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-01-31 22:34:10
lossyWAV beta 1.3.1h attached to post #1 in this thread.

N.B. beta 1.3.1g will expire today.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-03-31 21:57:45
lossyWAV beta 1.3.1j attached to post #1 in this thread.

N.B. beta 1.3.1h will expire today.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2014-04-01 00:18:35
lossyWAV beta 1.3.1j attached to post #1 in this thread.

N.B. beta 1.3.1h will expire today.

Nick,

I'm getting the following error code with the newest version of lossyWAV:

Code: [Select]
1 out of 2 tracks converted with major problems.

Source: "C:\Users\Alex Akin\Music\Main\Palms\Palms\01 - Future Warrior.flac"
  An error occurred while writing to file (The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters) : "C:\Users\Alex Akin\Portable\Palms\Palms\01 - Future Warrior.lossy.flac"
  Additional information:
  Encoder stream format: 44100Hz / 2ch / 16bps
  Command line: "C:\Windows\System32\cmd.exe" /d /c C:\foobar2000\lossywav.exe - -q 5 --silent --stdout|C:\foobar2000\flac.exe - -b 512 -5 -f -o"01 - Future Warrior.lossy.flac" --ignore-chunk-sizes
  Working folder: C:\Users\Alex Akin\Portable\Palms\Palms\
 
  Conversion failed: The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters
Skipped: "C:\Users\Alex Akin\Music\Main\Palms\Palms\folder.jpg"

Version 1.3.1.8 worked just fine with the same parameters.

Alex
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Musique-Rabbit on 2014-04-01 00:55:50
Problem using with Foorbar2000; was good before this revision.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2014-04-01 06:57:37
Also failing here with Wine:

Code: [Select]
Unhandled exception: illegal instruction in 32-bit code (0x0043b74a).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:0043b74a ESP:00e0fb10 EBP:00000004 EFLAGS:00010202(  R- --  I  - - - )
 EAX:00000001 EBX:00ae2620 ECX:00ae1e10 EDX:00ae1e10
 ESI:00000005 EDI:0000002d
Stack dump:
0x00e0fb10:  00118de0 00a18600 00a18600 4027e3cb
0x00e0fb20:  00000069 00e0fb40 00000015 3fe00000
0x00e0fb30:  00000040 411d5d83 00a7d980 40d58880
0x00e0fb40:  0000002d 40d38800 0000002b 3ff00000
0x00e0fb50:  dacbc001 3fd88b24 00000002 bf62eb8c
0x00e0fb60:  00000000 40458880 0000002a 00000200
000c: sel=0067 base=00000000 limit=00000000 32-bit r-x
Backtrace:
=>0 0x0043b74a in lossywav (+0x3b74a) (0x00000004)
0x0043b74a: lesl %ebx,%esp
Modules:
Module Address Debug info Name (17 modules)
PE   400000-  c04000 Export          lossywav
PE 70680000-70860000 Deferred        libfftw3-3
ELF 7b800000-7ba5d000 Deferred        kernel32<elf>
  \-PE 7b810000-7ba5d000 \              kernel32
ELF 7bc00000-7bce4000 Deferred        ntdll<elf>
  \-PE 7bc10000-7bce4000 \              ntdll
ELF 7bf00000-7bf04000 Deferred        <wine-loader>
ELF 7ed5d000-7ee08000 Deferred        msvcrt<elf>
  \-PE 7ed70000-7ee08000 \              msvcrt
ELF 7ef93000-7efd9000 Deferred        libm.so.6
ELF f7392000-f7397000 Deferred        libdl.so.2
ELF f73b1000-f73be000 Deferred        libnss_files.so.2
ELF f73be000-f756b000 Deferred        libc.so.6
ELF f756b000-f7587000 Deferred        libpthread.so.0
ELF f7587000-f773e000 Dwarf          libwine.so.1
ELF f773f000-f7761000 Deferred        ld-linux.so.2
ELF f7761000-f7762000 Deferred        [vdso].so
Threads:
process  tid      prio (all id:s are in hex)
00000008 (D) C:\windows\lossyWAV.exe
00000009    0 <==
0000000e services.exe
0000001d    0
0000001c    0
00000016    0
00000014    0
00000010    0
0000000f    0
00000012 winedevice.exe
0000001b    0
00000018    0
00000017    0
00000013    0
00000019 plugplay.exe
0000001f    0
0000001e    0
0000001a    0
00000022 explorer.exe
00000023    0
System information:
    Wine build: wine-1.7.15
    Platform: i386
    Host system: Linux
    Host version: 3.13.7-1-ARCH

Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-04-01 07:15:44
Apologies - bug hunting commences.

.... and concluded. Amended version now available from first post in the thread as usual. Again, apologies for the crashes.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Musique-Rabbit on 2014-04-01 07:32:46
Thanks, Nick. All goes well now.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2014-04-01 07:40:44
That was fast! Thanks
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: akin0780 on 2014-04-01 15:04:12
Apologies - bug hunting commences.

.... and concluded. Amended version now available from first post in the thread as usual. Again, apologies for the crashes.


Great job, Nick!
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2014-04-01 18:02:49
Thanks again for your continued efforts. LossyFLAC is the perfect companion to my Rockboxed iPod Classic
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-06-02 07:18:00
lossyWAV beta 1.3.1k attached to post #1 in this thread.

N.B. beta 1.3.1j/j2 expired on the 31st May.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2014-06-02 09:28:45
Was waiting for it, thanks! I had to set the date on my computer 24h in the past in order to encode a new album yesterday. I hope we'll get to see a stable release soon!
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-06-02 11:14:19
Was waiting for it, thanks! I had to set the date on my computer 24h in the past in order to encode a new album yesterday. I hope we'll get to see a stable release soon!


Sorry for the inconvenience    - I will endeavour to release 1.4.0 (and source) on or before the expiry date of beta 1.3.1k.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Musique-Rabbit on 2014-08-02 02:05:36
Nick, time to update the baby. 

Thanks.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Musique-Rabbit on 2014-08-03 02:07:29
Nick,

LossyWAV stops working by the end of July. Any update for new deadline?

Thanks.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-08-04 18:14:55
Apologies - out of town without laptop or source....

lossyWAV beta 1.3.1m attached to post #1 in this thread.

Expiry date now 30th September 2014.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2014-08-04 18:36:17
Would be fun to attach the correction data to the *.lossy.flac file, in a METADATA_BLOCK_APPLICATION maybe? With transcoding software that would both:

Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: doccolinni on 2014-09-05 18:44:49
Would be fun to attach the correction data to the *.lossy.flac file, in a METADATA_BLOCK_APPLICATION maybe?

That would be pointless. The .lossy.flac file together with correction data would not be smaller than the lossless .flac (in fact, it would usually be somewhat bigger). So if a lossless copy/transmission is required, it would be better to just use the lossless .flac.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2014-09-15 12:23:31
I will endeavour to release 1.4.0 (and source) on or before the expiry date of beta 1.3.1k.


Any news about a 1.4.0 "stable" release? And, will it compile on Linux?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-09-15 13:04:14
Hi skamp,

I suspect that the source as it is will not compile on Linux.

As there have been no problem reports with recent beta 1.3.1 releases, I just have to take one last look at the code before releasing version 1.4.0.

Hopefully this will be timed to coincide with the expiry of the latest beta at the end of the month.

Nick.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2014-10-01 18:13:04
Code: [Select]
%lossyWAV Error%: lossyWAV beta version has reached expiry date.


*wink*
*wink*
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-10-01 23:01:32
Code: [Select]
%lossyWAV Error%: lossyWAV beta version has reached expiry date.


*wink*
*wink*


Will double check in the morning with a view to release of version 1.4.0.

Apologies again.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: punkrockdude on 2014-10-02 11:16:51
Are you thinking of releasing the source code so that we can compile it anyway we'd like to or/and are you thinking of supplying Linux binaries? Regards.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-10-02 11:58:44
I will be releasing source.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: punkrockdude on 2014-10-02 14:59:08
I will be releasing source.
That sounds really good. Do have any idea if it will be real soon or maybe you are uncertain of when? Regards
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-10-02 15:52:28
lossyWAV v1.4.0 released, attached to post #1 in this thread along with C++ source.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: punkrockdude on 2014-10-02 18:02:45
lossyWAV v1.4.0 released, attached to post #1 in this thread along with C++ source.
Thank you! I will let people over at Arch Linux know about it and hopefully it ends up in their repository. Regards
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Musique-Rabbit on 2014-10-03 11:36:02
Thanks a lot, Nick.
Can't wait to test (use) it!
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: punkrockdude on 2014-10-03 14:31:53
Apparently it has to be ported before it can be used on Linux according to people developing / compiling for Arch Linux. Maybe I deserve a "duh" but I am no programmer 
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: skamp on 2014-10-03 22:15:23
Apparently it has to be ported before it can be used on Linux according to people developing / compiling for Arch Linux. Maybe I deserve a "duh" but I am no programmer 


…before they will agree to package it. It's usable now, with wine and caudec (http://caudec.net/).
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Preuss on 2014-10-21 11:54:43
I have a question about lossyWAV, and don't know how it works, but I really like it.
But why does it use 512 size block? can you change the block size, so standard flac no change could use it like 4096?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: [JAZ] on 2014-10-21 22:19:58
It's a question of adaptability.  The longer the block size, the fewer the possibilities to reduce the required bits, since the reduction happens at a block level.

In fact, this is one of the reasons why generally it is recommended to use FLAC -5 instead of FLAC -8, because FLAC -8 mostly benefits of using a longer block, but that is counterproductive for lossyWav.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: sundance on 2014-10-22 13:03:37
In fact, this is one of the reasons why generally it is recommended to use FLAC -5 instead of FLAC -8, because FLAC -8 mostly benefits of using a longer block, but that is counterproductive for lossyWav.

Although that sounds logical and reasonable, every file I tested (lossyWAV --quality High) was smaller with FLAC -8 compared to FLAC -5. Not very much (only 0.2% ... 0.3%), and of course, FLAC -5 is faster...

Edit: Above numbers resulted from a chart album. I compared that with a jazz album and the difference was even smaller (0.01% benefit for FLAC -8)
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: [JAZ] on 2014-10-22 21:34:00
Maybe I didn't word it properly.  I mean that it wasn't worth it because, as you saw, the gains were minimum.  (The change of block size is not the only thing that changes from flac -5 to flac -8)
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Preuss on 2014-10-24 18:00:36

Maybe I didn't word it properly.  I mean that it wasn't worth it because, as you saw, the gains were minimum.  (The change of block size is not the only thing that changes from flac -5 to flac -8)


Your are right, Flac -5 is the best, testing with Flac version 1.3. I have made a test using lossyWAV on a wave. And 5 seems to be the best bet, compared to time and compression.

Code: [Select]
Compression    Speed   Time (in s)  Space        Space (in %)
=============================================================
(Wav)          1x      3432,00      816.195 KB   100%
1            434x         7,91      208.203 KB    26%
2            353x         9,72      181.593 KB    22%
3            371x         9,25      185.208 KB    23%
4            342x        10,05      198.323 KB    24%
5            228x        15,09      177.593 KB    22%
6            195x        17,60      177.591 KB    22%
7             63x        54,30      174.865 KB    21%
8             50x        68,13      174.858 KB    21%
9             50x        68,13      100.000 KB    12%

Actually Flac 4 is worse than 3.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Nick.C on 2014-10-25 12:38:39
Is it safe to assume that the result for "9" in your table is incorrect, Preuss?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: Preuss on 2014-10-25 19:01:38
Is it safe to assume that the result for "9" in your table is incorrect, Preuss?

Yes, could not edit, I'm not a developer. But you are Rights, the last line 9 is an error. I had made too many lines in Excel, forgot to delete. Please delete line 9 for me.

So, this tells me, that I don't get much out of 8 than 5.
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: CitizenInsomniac on 2015-01-15 07:36:18
I apologize if this has been asked before:

Does Nick's combination of "lossyWAV -q X -a 4 --feedback 4| FLAC -8" produce better audio quality than LAME MP3 at 320 kbps?
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: punkrockdude on 2015-01-15 08:07:26
I apologize if this has been asked before:

Does Nick's combination of "lossyWAV -q X -a 4 --feedback 4| FLAC -8" produce better audio quality than LAME MP3 at 320 kbps?
You should do an ABX test to determine what is best to you since it is lossy/hybrid. I don't think I have successfully ABXed a LossyWAV -q X using latest version 1.4 but to be sure I use higher quality settings. The files I do have successfully ABXed using earlier versions have far less annoying artifacts than some other codecs, in my opinion, since I like noise better than warbling and modulated sounding artifacts. LossyWAV is really an impressive codec!
Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: CitizenInsomniac on 2015-01-15 08:39:20
You should do an ABX test to determine what is best to you since it is lossy/hybrid. I don't think I have successfully ABXed a LossyWAV -q X using latest version 1.4 but to be sure I use higher quality settings. The files I do have successfully ABXed using earlier versions have far less annoying artifacts than some other codecs, in my opinion, since I like noise better than warbling and modulated sounding artifacts. LossyWAV is really an impressive codec!

Thanks - the noise vs artifacts comparison is an interesting way of looking at it.

In other news... I think I may have found a bug in v1.4.0. When I use version v1.3.0 and feed the resulting lossy wav to WMAEncode, it works fine. When I feed the output of lossyWAV 1.4.0 to WMAEncode, I get the error "Unexpected EOF in reading WAV header."

I tried using the --ignorelength parameter with WMAEncode, it didn't make a difference. The only variable that makes a difference is the lossyWAV version number.

I am not using any custom params with lossyWAV, just -q preset.

Title: lossyWAV 1.3.0 Delphi to C++ Translation Thread
Post by: punkrockdude on 2015-01-15 09:20:37
In other news... I think I may have found a bug in v1.4.0. When I use version v1.3.0 and feed the resulting lossy wav to WMAEncode, it works fine. When I feed the output of lossyWAV 1.4.0 to WMAEncode, I get the error "Unexpected EOF in reading WAV header."

I tried using the --ignorelength parameter with WMAEncode, it didn't make a difference. The only variable that makes a difference is the lossyWAV version number.

I am not using any custom params with lossyWAV, just -q preset.
Please post about this experience in the lossyWAV 1.4.0 Released (http://www.hydrogenaud.io/forums/index.php?showtopic=107081) thread so that Nick.C finds out about it. For now you can use FLAC or some other format and when the WMAEncode situation is solved you can convert them losslessly to WMA, although a little more work than straight to WMA.