IPB

Welcome Guest ( Log In | Register )

Any encoders which will 'accept but crop' too high resolution , ... so that the user will notice that not all formats are equal?
Porcus
post Jan 3 2011, 17:22
Post #1





Group: Members
Posts: 1957
Joined: 30-November 06
Member No.: 38207



Q: Will all (at least all widely used) 'lossless' audio encoders abort with the appropriate error message if the user tries to feed unsupported audio? Or is there any which will discard channels, downsample, crop bits or just produce nonsense?


The reason why I ask, is that this forum fairly often gets the n00b question of whether 'lossless' is indeed lossless -- and get no more than a simple 'Yes' (or 'Yes, thread closed'). The devil in the detail is hardly ever mentioned, and most users will anyway never encounter that mismatch. But if the situation is 'in the few instances where the usual answer is inadequate, the encoder will warn the users rather than eating audio information', it would certainly be A Good Thing.


--------------------
One day in the Year of the Fox came a time remembered well
Go to the top of the page
+Quote Post
 
Start new topic
Replies
bryant
post Jan 5 2011, 21:32
Post #2


WavPack Developer


Group: Developer (Donating)
Posts: 1292
Joined: 3-January 02
From: San Francisco CA
Member No.: 900



I’d like to clarify a couple things about WavPack that were touched upon earlier.

WavPack is 100% lossless with both 32-bit integer and 32-bit floating-point audio files. For floating point this includes handling the special cases of denormals, NaNs, +/- infinities, etc. Basically, in all cases the binary data is preserved regardless of the content. In fact, one of my tests is to change the interpretation of the various data types and make sure everything still works (although, of course, the compression ratio suffers with incorrect interpretation).

As was alluded, floating-point operations (especially divide, I think) are not always guaranteed to produce the same result on all hardware (at least not by default) and this is one reason why WavPack does not use any floating-point math to compress floating-point data. Instead, the float values are converted to the largest 25-bit integers that can be represented without clipping (each block is scanned first) and compressed with the standard integer code, and then a second data stream is created to losslessly store any data that was truncated during the conversion to integers (this second stream goes in the correction file for hybrid lossless).

The -p option mentioned above discards this second stream, making the operation equivalent to 25-bit integers, although since each block is still independently coded with potentially shifted 25-bit “windows” into the floating-point data, it still retains most of the advantage of using floating-point representation. While for all practical purposes this is as good as lossless, it isn’t technically lossless, and is therefore reported as lossy (and is not the default behavior).

Regarding the original question, there actually is a situation in which WavPack will discard information and still claim lossless compression, although it’s a pretty esoteric case. If the wav file header indicates that the audio has fewer significant bits than the container (for example, 20-bit audio in 3 bytes) then only those significant bits are stored, even if the other bits are not zeros. This will show up as a decoding error only if md5 checking is enabled (because that sum is of the raw audio bytes). I don’t believe that this is an issue because all the audio specified in the wav header is losslessly stored, however it was a case that needed special attention for inclusion in WinZip because of the implicit assumptions of a file archiver.
Go to the top of the page
+Quote Post

Posts in this topic
- Porcus   Any encoders which will 'accept but crop' too high resolution   Jan 3 2011, 17:22
- - googlebot   QUOTE (Porcus @ Jan 3 2011, 17:22) The de...   Jan 3 2011, 18:41
|- - MichaelW   QUOTE (googlebot @ Jan 4 2011, 06:41) der...   Jan 3 2011, 23:15
- - googlebot   I agree that stuff like this is happening in the f...   Jan 3 2011, 23:51
- - Robertina   With foobar2000 1.1.1 and flac encoder 1.2.1b:Sour...   Jan 4 2011, 01:19
|- - saratoga   QUOTE (Robertina @ Jan 3 2011, 19:19) Wit...   Jan 4 2011, 01:49
|- - Robertina   QUOTE (saratoga @ Jan 3 2011, 13:49) Sinc...   Jan 4 2011, 01:55
|- - Robertina   QUOTE (saratoga @ Jan 3 2011, 13:49) Sinc...   Jan 4 2011, 03:37
||- - saratoga   QUOTE (Robertina @ Jan 3 2011, 21:37) Doe...   Jan 4 2011, 05:06
||- - 2Bdecided   QUOTE (saratoga @ Jan 4 2011, 04:06) Floa...   Jan 4 2011, 13:02
||- - saratoga   QUOTE (2Bdecided @ Jan 4 2011, 07:02) QUO...   Jan 4 2011, 19:55
||- - lvqcl   QUOTE (saratoga @ Jan 4 2011, 21:55) I th...   Jan 4 2011, 20:22
|||- - saratoga   QUOTE (lvqcl @ Jan 4 2011, 14:22) QUOTE (...   Jan 4 2011, 20:39
|||- - googlebot   QUOTE (saratoga @ Jan 4 2011, 20:39) I th...   Jan 5 2011, 02:00
||- - 2Bdecided   QUOTE (saratoga @ Jan 4 2011, 18:55) The ...   Jan 5 2011, 11:59
|- - Porcus   QUOTE (saratoga @ Jan 4 2011, 01:49) Sinc...   Jan 4 2011, 09:51
|- - Porcus   QUOTE (Porcus @ Jan 4 2011, 09:51) encode...   Jan 4 2011, 09:53
- - Axon   FWIW, AFAIK, neither flac.exe nor foobar2000 warns...   Jan 4 2011, 01:21
- - Robertina   Thank you for your clarification, saratoga. -----...   Jan 4 2011, 08:26
- - googlebot   I stand corrected by practice, it seems. I still ...   Jan 4 2011, 10:41
|- - Robertina   QUOTE (googlebot @ Jan 3 2011, 22:41) I s...   Jan 4 2011, 11:50
|- - lvqcl   QUOTE (Robertina @ Jan 4 2011, 13:50) I t...   Jan 4 2011, 12:27
|- - googlebot   QUOTE (Robertina @ Jan 4 2011, 11:50) I t...   Jan 4 2011, 12:27
- - Robertina   Thank you for your full answer , googlebot. QUOTE...   Jan 4 2011, 15:32
- - lvqcl   f32.wav: 32-bit floating point. CODEf32.wav: E...   Jan 4 2011, 15:48
- - lvqcl   By the way, WavPack accepts 32-bit integer files, ...   Jan 4 2011, 16:14
|- - Robertina   QUOTE (lvqcl @ Jan 4 2011, 04:14) By the ...   Jan 4 2011, 17:02
- - lvqcl   That's probably because foobar2000 converts ev...   Jan 4 2011, 17:10
- - Robertina   I am not really happy with what I have learned in ...   Jan 4 2011, 17:37
- - googlebot   32 bit float values can safely store 24 bit int sa...   Jan 4 2011, 17:50
- - googlebot   AFAIK the meaning is well defined. Just the precis...   Jan 4 2011, 20:04
- - lvqcl   Both compressing and decompressing can be performe...   Jan 4 2011, 21:11
- - Axon   Certainly doing anything meaningful with floating ...   Jan 4 2011, 21:49
- - indybrett   I recall years ago reading (on this board) about n...   Jan 4 2011, 22:22
- - lvqcl   FLAC has --keep-foreign-metadata switch: QUOTE If ...   Jan 4 2011, 22:28
|- - indybrett   QUOTE (lvqcl @ Jan 4 2011, 16:28) FLAC ha...   Jan 4 2011, 22:31
|- - greynol   QUOTE (indybrett @ Jan 4 2011, 13:31) or ...   Jan 4 2011, 22:50
- - greynol   That's not really on-topic but... It was with...   Jan 4 2011, 22:31
- - Porcus   Even though I originally asked about encoders, I d...   Jan 5 2011, 00:54
- - Axon   For that matter, IIRC, since IEEE 754 demands norm...   Jan 5 2011, 02:37
- - bryant   I’d like to clarify a couple things about WavPack ...   Jan 5 2011, 21:32


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

 



RSS Lo-Fi Version Time is now: 23rd November 2014 - 21:09