TransPCM—use Float16/24 to reduce bit-depth, also promotes compression, 2012-05-29: beta v0.1.1 / formerly HalfPrecision / ref.: IEEE 754-2008 |
TransPCM—use Float16/24 to reduce bit-depth, also promotes compression, 2012-05-29: beta v0.1.1 / formerly HalfPrecision / ref.: IEEE 754-2008 |
Sep 12 2011, 22:03
Post
#1
|
|
![]() lossyWAV Developer Group: Developer Posts: 1722 Joined: 11-April 07 From: Wherever here is Member No.: 42400 |
When I first became aware of the Float16 type I found it interesting in terms of maybe having potential as a possible lossy storage type.
Attached is a processed version of the sample in this thread which has been decoded back to PCM. The processing is as follows (at this stage as there is no player that I am aware of): Input file Sample [PCM] > FLOAT16 > [PCM] > Output File. The conversion from integer to Float16 reduces the number of significant bits of the 24-bit sample to (a maximum of) 11. There is therefore an amount of added noise due to truncation. The added noise has been noise shaped using SG's adaptive noise shaping method as used in lossyWAV. Original Sample If the 24-bit coded sample is encoded with FLAC (wFormatTag left as 0x0001 as FLAC does not handle Floating Point samples and wBitsPerSample is left as 24) there is a saving of in excess of 20% in filesize. I don't see any practical advantage using this storage type for native 16-bit PCM. This post has been edited by Nick.C: May 29 2012, 21:36 -------------------- lossyWAV -q X | FLAC -8 ~= 308kbps
SGS III (Rooted) + 64GB |
|
|
|
![]() |
Dec 23 2011, 08:20
Post
#2
|
|
![]() lossyWAV Developer Group: Developer Posts: 1722 Joined: 11-April 07 From: Wherever here is Member No.: 42400 |
.... a surprise, yes, however as the standard has not become widespread in terms of implementation then I think that Float16 being different is understandable / acceptable in the same way that 8-bit integer is unsigned with a 128 offset compare to 16/24/32 bit signed integers with no offset.
[edit] In terms of headroom, due to the added noise associated mantissa bit reduction, I would expect Float16 to be a final format rather than an interim step for further processing. Use of the full range available in Float16 was a very conscious decision to maximise range (min sample value to max sample value). Also, there is nothing stopping someone reducing the scale of the audio prior to converting to Float16. [/edit] In my testing, Float16 in a 24-bit sample container compressed better than the same number of 24-bit integer samples upon which the Float16 samples were based. Unfortunately, now that HalfPrecision stores the FMT.wFormatTag properly (0x0003 for Float), FLAC will not compress Float16 output.
[edit2] experimental Adaptive Noise Shaping coefficients snuck through.... beta 0.1.0b replaced. [/edit2] This post has been edited by Nick.C: May 29 2012, 21:37 -------------------- lossyWAV -q X | FLAC -8 ~= 308kbps
SGS III (Rooted) + 64GB |
|
|
|
Dec 23 2011, 08:43
Post
#3
|
|
![]() Group: Members Posts: 51 Joined: 11-December 11 From: United Kingdom Member No.: 95728 |
Well, by "huge surprise" I mean "destroy your speakers", and by "any software" I mean that I have to contact my previous employer and have them check to see if I committed that code before one of these files gets into a mobile phone and is played at high volume through a set of earbuds.
QUOTE In terms of headroom, due to the added noise associated mantissa bit reduction, I would expect Float16 to be a final format rather than an interim step for further processing. This raises the question of why you need so much low-level resolution, then. |
|
|
|
Dec 23 2011, 09:01
Post
#4
|
|
![]() lossyWAV Developer Group: Developer Posts: 1722 Joined: 11-April 07 From: Wherever here is Member No.: 42400 |
It would surprise me if, when using any type of float where the expected range is ±1.0 but the available range is massive (i.e. 10^38 or 10^308), no checks were made by the decoding software on the inbound data to ensure that these limits were adhered to.
As this potential audio type is in its infancy, common practice is not yet defined (although it could be *assumed* that the treatment would be the same as for Float32). Why maximise resolution? Simply, because it's there to be used. Why limit the type to a range of ±1.0 to 5.96E-08 (i.e. 2^24:1) instead of using ±65504 to 5.96E-08 (i.e. almost 2^40:1)? One of the complaints commonly made against 16-bit integer is lack of resolution compared to relatively commonly available 24-bit integer. The adoption of ±65504 takes the range of the Float16 type beyond that of 32-bit integer. -------------------- lossyWAV -q X | FLAC -8 ~= 308kbps
SGS III (Rooted) + 64GB |
|
|
|
Dec 23 2011, 22:02
Post
#5
|
|
![]() Group: Members Posts: 51 Joined: 11-December 11 From: United Kingdom Member No.: 95728 |
Well it's not really in its infancy. I included 16 bit float (part of the logical extrapolation on power-of-two bit depths) in a file format proposal in 2005, and a couple of years ago the same thing came about as an inevitable consequence of passing the bit depth (whatever it maybe) to a floating-point conversion routine which supported 16-bit as well as 32 and 64 bit precision.
What checks do you propose to perform, and what is the proper action to take on different results? I don't mean for anything to be changed on my account, anyway. I've already asked for my old code to be reviewed and deleted as appropriate. This post has been edited by Gumboot: Dec 23 2011, 22:31 |
|
|
|
Nick.C TransPCM—use Float16/24 to reduce bit-depth, also promotes compression Sep 12 2011, 22:03
AndyH-ha This differs from simply reducing the bit depth? Sep 12 2011, 22:11
Nick.C Yes - in that values up to c. +/- 2^31 can still b... Sep 12 2011, 22:19
saratoga Isn't this pretty much what ADPCM does? Excep... Sep 12 2011, 22:32
C.R.Helmrich You mean a-Law/µ-Law?
Makes me wonder how many bi... Sep 12 2011, 23:05
bryant QUOTE (Nick.C @ Sep 12 2011, 14:03) Attac... Sep 13 2011, 06:13
Nick.C The plan was to simply set wFormatTag= 0x0003 and ... Sep 15 2011, 21:09
benski QUOTE (Nick.C @ Sep 15 2011, 16:09) The p... Sep 16 2011, 14:03
knutinh float16 could be very efficient on GPU hardware if... Sep 16 2011, 13:49
Nick.C I understand that currently players are rather unl... Sep 16 2011, 19:26
Nick.C Below is Delphi / IA32 & x87 code used to enco... Sep 22 2011, 13:05
Nick.C HalfPrecision beta 0.0.2cd attached. [bugfix] [sup... Oct 20 2011, 12:53
Gumboot QUOTE (Nick.C @ Oct 20 2011, 11:53) NB: t... Dec 22 2011, 23:19
lvqcl foobar2000 1.1.9 beta1: "Implemented experime... Oct 22 2011, 10:54
Nick.C RE: TransPCM—use Float16/24 to reduce bit-depth, also promotes compression Oct 22 2011, 14:24
Nick.C HalfPrecision beta 0.0.2e attached [superseded]. F... Oct 24 2011, 18:23
pdq I once had an idea for how to encode audio data. T... Oct 24 2011, 19:29
Nick.C That would be one way of doing it. However sample ... Oct 24 2011, 21:02
Nick.C HalfPrecision beta 0.0.2f attached superseded .
... Nov 1 2011, 13:53
Nick.C HalfPrecision beta 0.0.2g attached. Superseded.
... Nov 10 2011, 13:41
Didjeridoo Nick.C Thank you for your innovation.
It remains t... Nov 11 2011, 11:36
Nick.C @Didjeridoo: Thanks - I am also looking forward to... Nov 11 2011, 23:05
Nick.C HalfPrecision beta 0.0.2h attached. Superseded
... Nov 14 2011, 21:22
Didjeridoo Nick.C I watch all the moves and develops
Is not... Nov 15 2011, 10:32
lvqcl QUOTE (Didjeridoo @ Nov 15 2011, 13:32) P... Nov 15 2011, 15:53
Ljubo44 Do you have any sample of command line for foobar. Nov 15 2011, 19:13
Nick.C HalfPrecision beta 0.0.2i attached. Superseded. F... Nov 15 2011, 20:05
Ljubo44 on 16/44,1 size is same after compress halfp.wav 1... Nov 15 2011, 21:24
Nick.C QUOTE (Ljubo44 @ Nov 15 2011, 20:24) ....... Nov 15 2011, 22:05
Ljubo44 You are right, I used foobar 1.1.9 to convert to f... Nov 15 2011, 22:37
Nick.C HalfPrecision beta 0.0.2j attached. Superseded.
... Nov 15 2011, 23:02
Nick.C HalfPrecision beta 0.1.0a attached. Superseded.
... Nov 17 2011, 14:20
Didjeridoo I hope the developers do not ignore innovation Nov 18 2011, 19:44
Nick.C foobar2000 1.1.10 beta 1 adds Float24 support - re... Nov 18 2011, 21:24
pompon QUOTE (Nick.C @ Sep 12 2011, 16:03) When ... Dec 5 2011, 06:37
FreaqyFrequency @pompon:
This is different from those coding sche... Dec 5 2011, 08:44
Nick.C Right then people - HalfPrecision needs a new name... Dec 22 2011, 20:34
Nick.C I accept that the Float16 proposal must have been ... Dec 27 2011, 21:34
FreaqyFrequency I fear that I may need a little more clarification... Jan 9 2012, 05:48
Nick.C Hi there,
Using HalfPrecision to convert from 24-... Jan 9 2012, 20:05
FreaqyFrequency Thanks for the reply, Nick.
Looking at the Replay... Jan 10 2012, 03:36
Nick.C TransPCM beta v0.1.1 attached. Superseded
Chang... May 29 2012, 21:51
Nick.C TransPCM beta 0.1.2 attached.
Changelog:Modificat... Jun 2 2012, 13:57
Ljubo44 CODE/d /c C:\bin\TransPCM_beta_0.1.2... Jun 14 2012, 01:29
lvqcl QUOTE (Ljubo44 @ Jun 14 2012, 04:29) What... Jun 14 2012, 15:47
db1989 Why do you have switches before the executable? An... Jun 14 2012, 09:02
Nick.C The use of --stdinname %d is to tell the program w... Jun 14 2012, 17:47
Nick.C Rockbox now has added Float16 compatibility* - tha... Nov 24 2012, 23:15
saratoga No problem. Hope its useful to people. Nov 25 2012, 00:28![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd May 2013 - 13:42 |