Taperssection.com

Gear / Technical Help => Ask The Tapers => Topic started by: justink on June 19, 2010, 11:28:02 PM

Title: 24bit or 16bit -> mp3? Which is better?
Post by: justink on June 19, 2010, 11:28:02 PM
If you took a 24bit version and 16bit version of a tape and converted to mp3, all other variables remaining the same other than source files, would the two final mp3s be identical or would the 24bit source be slightly better somehow? I'm looking for a technical answer/explaination. Thanks.
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: admkrk on June 20, 2010, 01:41:44 AM
mp3s or perceptual coding, tosses out all data it doesn't see as relevant. depending on the codec used it can vary. there is no reason to think starting with a 24 bit source you will get better results. imo, with out testing, you would get identical results using the same algorithm. of course if you're really interested in finding out you could always try it out yourself.

http://www.mp3-tech.org/programmer/docs/audiopaper1.pdf (http://www.mp3-tech.org/programmer/docs/audiopaper1.pdf)
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: echo1434 on July 01, 2010, 05:38:28 AM
Converting a 24-bit lossless file directly to mp3 can be downright dangerous, because you're relying on the mp3 compressor to convert to 16-bits (there is no such thing as a 24-bit mp3).

Depending on what program you use it may not dither, but rather truncate (chop off) the top 8 bits, thus doing very bad things to the sound. Obviously good editing programs can do the job right if given the right instructions, but your average "converting tool" can screw things up big time. Some of these programs are notoriously bad at sample rate conversions too.

I record everything in 48/24, and BEFORE I go to mp3 I convert  to 44/16. Sure, I could do 48/16, but that's just my preferred way of making mp3 (which is usually just for sample purposes).

At the current moment, I do WAV/FLAC editing in Adobe Audition, and do mp3 encoding with either dbPoweramp or Trader's Little Helper.

In the end, it's really not possible to go directly from 24-bit lossless to 16-bit lossy — there must be an intermediate step, which is always going to be 16-bit lossless in some form or another.
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: Todd R on July 01, 2010, 12:28:10 PM
I've heard this stuff before about 24 bit > mp3, and I'd really like to see a link to a scientific/academic reporting on the issue (no offense meant echo, I just don't know where you're getting these facts from).

On the face of it, I have to doubt that not dithering first to 16 bits would create any discernable differences.  There is no such thing as 24bit mp3's, but there is also no such thing as 16bit mp3's either.  From what I understand, mp3's are floating point representations, and wav/flac/pcm are integer representations, so they really are different beasts entirely. 

Regardless, mp3's -- MPEG-1 Audio Layer 3 files -- are governed by a few ISO/IEC standards.  Notably, the first layer 3 standard published in 1993 was the ISO/IEC 11172-3.  This original standard was updated in 1995, published as standard ISO/IEC 13818-3.  You can read these mp3 specifications by searching on the standard name/number in the IEC website at  www.iec.ch. 

Section 0.2.3.2 of the 13818 standard deals with audio inputs:  mp3 encoding meeting the IEC standard can accept PCM audio inputs with sample rates of 32K, 44.1K, and 48k, and can accept quantization up to 24bits per sample.  There isn't any 24>16 bit truncation going on, the mp3 encoder takes the whole 24bit audio sample and converts it to a new, compressed audio representation.  An mp3 encoder meeting the IEC standard will not simply truncate the input audio down to 16bits and then do mp3 encoding.

Think of it another way: dithering is essentially just adding noise to your signal to insure that the 16th bit (LSB) is random once you step down from 24bits, and not left at either 0 or 1 for longer intervals, since that can sound grating.  Saying you need to dither a 24bit file to 16bits in order to not cause the same issues for mp3's would imply that a floating point mp3 decoded back to wav/flac is completely exact out to 16bits as the original 24bit wav/flac file, and thus the problems of truncation come into play.  Since the mp3s will not have that level of faithfullness to the original, there will be inherent noise that will have the same effect as dithering.  If this were not the case, we could take a 24bit file, provide dither noise so it only had 15bits of non-noise information, save the dither-noise added file still at 24bits (so it would essentially be a dithered 16bit file with an additional 8 bits of noise added), and then do mp3 encoding.  If the mp3 encoder worked in such a way that truncation were indeed an issue, we must be getting a result that is faithful out to 16bits (otherwise there wouldn't be a truncation issue) -- thus, after encoding and decoding, we have something that was faithful to 16bits with only the lossy compression affecting the additional 8 bits, and we could then just truncate off the last 8 bits and be left with a perfectly intact 16bit dithered recording faithful to the original (the original 24>16 bit dithered recording that is).  Clearly this is not the case.

The same IEC standard also notes that mp3's support output up to a 24bit PCM quantization. So if you took mp3's made from a 24bit source, and then converted those mp3's back to 16bit pcm wave files (for instance, converting the mp3's back to 16bit wav to burn onto a CDR), you might have an issue with truncation and degraded sound quality.  (Supposedly mp3's can support up to 24bit pcm output, with an effective dynamic range of 20 bits.)  But if you listen back to the mp3's on an mp3 player directly, truncation is not an issue.

As to the original question, according to the IEC standard, mp3's can input/output at 24bits, and have 20bits of effective dynamic range.  Based on this, it seems that you would get better sound from converting 24bit pcm files directly to mp3, rather than dithering to 16bits first and then encoding.  Given the lossy nature of mp3, I doubt most people would hear a difference either way you did the encoding, but if you weren't planning on dithering down your 24bit PCM files to 16bit files anyway, encoding directly would save you some time.
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: Todd R on July 01, 2010, 12:37:27 PM

In the end, it's really not possible to go directly from 24-bit lossless to 16-bit lossy — there must be an intermediate step, which is always going to be 16-bit lossless in some form or another.

Not to belabor things, but I'm particularly interested in where you're getting this from.  This statement is totally at odds with the relevant IEC standards for mp3 compression.  It's hard for me to believe that all actual mp3 encoders are acting as you state, in contradiction to the requirements of the standard.  (And again, it isn't going to 16bit lossy, it is going to a floating point representation, that according to the standard has 20 bits of dynamic range, not 16.)

I've investigated this a fair deal since I do 24bit pcm > mp3 encoding.  Everything reliable that I have been able to dig up says that it is ok, and probably better, to go 24bit > mp3 directly. If you or anyone has good information from reliable sources saying otherwise, I'd like to see it, since I'd like to make sure I'm making the best mp3's possible. 
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: stevetoney on July 01, 2010, 01:15:22 PM
I don't have anything technical to add.  However, I do have some related practical experience. 

I put a good number of my live shows onto my ipod for listening.  I always record and master in 24bit and then create a 16bit version.  I then upload both 24bit and 16bit versions.  I'll use the 16bit version as the source for creating my compressed AAC files for my ipod.  Now and then I've accidentally used my 24bit files as the input files.  When the AAC file is created from the 24bit files, I don't hear any sound differences than if the files had been created from the 16bit source files.

I'm sure there could be some further technical wisdom that people can add, but I've always been of the opinion that, all things being equal, if I can't hear a difference then there really isn't much of a difference.
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: Scooter123 on July 01, 2010, 05:30:12 PM
I think this reminds me of my brother who asked me if his Yugo would run better on Premium Gas. 

Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: FiKe on July 01, 2010, 05:55:34 PM
I think this reminds me of my brother who asked me if his Yugo would run better on Premium Gas.


Well will it run better ?

FiKe
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: it-goes-to-eleven on July 01, 2010, 07:13:44 PM
I think this reminds me of my brother who asked me if his Yugo would run better on Premium Gas.

Well will it run better ?

It will improve the only true metric for such a car, the CPG (Clowns Per Gallon).

As far as mp3, the only real metric there is how it sounds.  mp3 encoders are all different. An encoder that sounds great going from 16 bits may not perform well for 24 because it is an uncommon case.   So generalizations don't really apply and you need to be specific about the particular software.  Fortunately, this is very easy to compare, but maybe not so easy to choose.

It is possible 24  > mp3 could sound better because it doesn't already have the added sound energy for the dither to 16 bits.  I've never tested it.
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: echo1434 on July 02, 2010, 05:10:44 AM

In the end, it's really not possible to go directly from 24-bit lossless to 16-bit lossy — there must be an intermediate step, which is always going to be 16-bit lossless in some form or another.

Not to belabor things, but I'm particularly interested in where you're getting this from.  This statement is totally at odds with the relevant IEC standards for mp3 compression.  It's hard for me to believe that all actual mp3 encoders are acting as you state, in contradiction to the requirements of the standard.  (And again, it isn't going to 16bit lossy, it is going to a floating point representation, that according to the standard has 20 bits of dynamic range, not 16.)

I've investigated this a fair deal since I do 24bit pcm > mp3 encoding.  Everything reliable that I have been able to dig up says that it is ok, and probably better, to go 24bit > mp3 directly. If you or anyone has good information from reliable sources saying otherwise, I'd like to see it, since I'd like to make sure I'm making the best mp3's possible.

To put it simply, there are some things one just assumes after using something for so many years. And I had assumed wrong, that mp3 was a 16-bit format.

There are all kinds of little things that imply this, like when opening an mp3 in an editing program. In every instance I've seen, it will say "16-bit" — and if you were to re-save it to another format, chances are it would automatically default to 16 bits. So after seeing these kinds of things for nearly 15 years, it just got ingrained in my head.

I could also swear that Winamp always said an mp3 was 16 bits when looking at the ID tag, but apparently I was imagining that all these years!

In conclusion, I'm wrong and I should have read the IEC standards a long time ago...

However, I still stand by my statement that most format "conversion tools" do a lousy job of sample rate conversion, if one needs to do that as well.

I'll have to do some listening tests myself, but given the facts I suppose going directly from the 24-bit  master file would be better (even if it's not perceptible) as it's one less unnecessary step in the chain.

Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: echo1434 on July 02, 2010, 05:20:08 AM
One afterthought:  If encoding a 24-bit file to mp3, you may consider upping the target bitrate a bit, as most everyone's judgments of an ideal mp3 bitrate were probably done with 16-bit sources.

But since there would be more info to process when starting with 24 bits, it could help to make room for that. After all, lossless 24-bit files contain 50% more data than 16-bit ones.

How this would all play out in reality is something I'll need to check for myself.
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: Todd R on July 02, 2010, 11:18:26 AM
Thanks echo, I appreciate the feedback.  When I started to want to make mp3's directly from my 24bit files, I looked into what people had to say on ts.com.  Almost all the feedback was that it shouldn't be done, but it was starting to seem like an urban legend -- just no real support for it.  After digging around myself for awhile on the interweb, everything I was finding was saying the opposite.

On a related note, I was digging around yesterday to find a free or cheap dither plugin that I could add to Amadeus Pro, since I use that for everything when mastering my recordings, except I go to Audacity for dithering 24bit down to 16bit.

I found an mda plugin for dither.  In their technical note on it (http://mda.smartelectronix.com/vst/help/dither.htm) they say:

Quote
If you are producing an absolutely final master at 16 bits or less, use noise shaped dither. In all other situations use a non-noise-shaped dither such as high-pass-triangular. When mastering for MP3 or other compressed formats be aware that noise shaping may take some of the encoder's 'attention' away from the real signal at high frequencies.

The basic dither routine is a triangular dither function, beyond that most dither routines (UV22, MBIT+, whatever) use noise shaping to add the necessary dither noise only to the higher frequencies where they are less likely to be heard/noticed. 

Seems like the folks at mda software think that this higher amount of high frequency dither noise can cause problems when encoding mp3's from 24>16 bit dithered material.

Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: Todd R on July 02, 2010, 11:23:29 AM
More thoughts:

On the encoding level, I had been using VBR 0 (highest level variable), but have lately been using 320 kb/s constant encoding using LAME.  I posted this in another thread, but these folks are conducting interesting tests on mp3 encoded files, doing controlled A-B testing of various encoding routines and reporting back their findings.  They conduct the tests using "subjects" volunteering from the internet.  I still need to remember to do it myself to add to their sample size -- folks here should do it too!  I'd also like to do more of my own A-B testing of mp3 encoders/encoded material, since I really haven't done that for like a dozen years, and encoding has gotten much better.

http://soundexpert.org/ratings

On the yugo comment, this controlled testing doesn't seem to bear this out, at least for higher bit-rate mp3's.  If you look at the ratings for high bit-rate encoded files, the vast majority of people in controlled tests cannot hear any difference.  Even in the "tails" of the distribution, the best golden ears can only barely reliably tell a difference between the encoded mp3 and the master lossless file, and even then they don't consider the mp3 artifacts to be unpleasant, just somewhat noticeable. 

I'm not necessarily advocating mp3's, and certainly not for critical listening, but they seem to have gotten much better.  People love to hate on them here, and it makes sense as we are immersed in trying to make the best recordings we can, but real testing and listening really is needed to make judgments as freelunch notes.

As a side note, I really don't understand why people hate on mp3's, but don't hate on 24>16 bit dithered recordings. Sorry, but if the master recording is at 24bit, a 16bit copy is lossy, not lossless -- you've thrown away 33% of the information of the recording.  A good dither routine can help make that 16bit copy sound good, just as a good mp3 encoder can make mp3's sound good, but those 16bit copies are still lossy copies in my book.
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: Gutbucket on July 02, 2010, 01:07:37 PM
As to the original question, according to the IEC standard, mp3's can input/output at 24bits, and have 20bits of effective dynamic range.  Based on this, it seems that you would get better sound from converting 24bit pcm files directly to mp3, rather than dithering to 16bits first and then encoding.  Given the lossy nature of mp3, I doubt most people would hear a difference either way you did the encoding, but if you weren't planning on dithering down your 24bit PCM files to 16bit files anyway, encoding directly would save you some time.

Makes sense that an encoder which tosses out data below a perceptual threshold could work best when fed with the highest quality source.  I've wondered what the effective dynamic range of higher rate mp3 encoding was, but never bothered to look deeply.  The 20 bit figure was stuck in my head from somewhere.  Of course for the way most people use mp3 in the 'real world' (cars, out and about ipod ear-bud listening, miniature systems with limited dynamics), a reduced dynamic range that would fit easily into less than 16 bits is actually beneficial.  But making that reduction would be best made before encoding and is not an intended feature of any encoder AFAIK.

Quote
As a side note, I really don't understand why people hate on mp3's, but don't hate on 24>16 bit dithered recordings. Sorry, but if the master recording is at 24bit, a 16bit copy is lossy, not lossless -- you've thrown away 33% of the information of the recording.  A good dither routine can help make that 16bit copy sound good, just as a good mp3 encoder can make mp3's sound good, but those 16bit copies are still lossy copies in my book.

Technically you are correct, in that 33% of the information raw data is discarded but stating it that way is somewhat misleading. Obviously not all the data recorded in the 24bit file is of equal value.  What does it mean to throw away 33% of the total data when a greater percentage than that is simply noise at the bottom, totally outside the range of anything musical (the actual information)?  Dithering to a lower bit rate discards information outside the target bit-range, but the information retained is complete (non-lossy), quite unlike MP3.  Perceptual coding also also discards those easy picking non-musical bits that are the low hanging psychoacoustic fruit at the very top and bottom of the dynamic range, but is fundamentally different in that it is also discarding data throughout the entire dynamic range, the real information range, hopefully making wise choices in what to discard. So even if it imperceptible to me today, can I trust that it will still be tomorrow, or next week if I upgrade my dac and headphone rig?  I'm more comfortable dithering 24bit music recordings which I know will fit comfortably in 16 bits than I am in trusting the psychoacoustics of an MP3 encoder.  For me that’s really what differentiates the difference between the information reduction due to dithering vs lossy encoding.

The encoders, especially at high rates, seem to have gotten much better.  I also should re-listen to the newer encoding schemes as it's been 8 years or so since I did a critical listening comparison. 
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: Todd R on July 02, 2010, 01:53:10 PM
Generally, I agree with you, particularly on the differentiation about raw data vs information.  I really just threw that out there since it is the same language I hear all the time in regards to mp3's, and I just wanted to toss back the same argument used on mp3's vs 16 bit.  It has always bugged me, this idea that since mp3 files are a fifth the size of 16bit files (or whatever), that you're only listening to one-fifth of the music or something.

But on that same note, I really don't know what you mean about once the 16bit dither is done, that remaining information is complete and not lossy like mp3.  You take data, you remove data, the data you're left with is the data you retain by definition, and that new dataset compared to itself is not lossy, it is a complete representation of an incomplete original dataset.  Yes, you're taking out different data with mp3 than with 16bit dither, but I don't really understand that the new 16bit dataset is somehow complete and not lossy and the mp3 dataset is lossy.  In both cases, you've lost data from the original.

So conceptually to me it is the same, though I quite agree with you that the type of data you're losing by going to 16bit isn't as bad as the type of data (throughout the complete dynamic range) that you lose with mp3.  Still then, the only way to answer which is worse in reality vs in theory is to try it out.  As to future proof, again I don't really see the distinction.  MP3's that sound good today on your system today might sound worse if you get a better DAC or whatever.  Same thing could be said about the dithered 24 > 16 bit material -- get a new playback system and what once sounded good no longer does, but you can't go back and choose a different dither routine, the 24 bit data is lost and you now only have the reduced data/information 16 bit file.

I think it does go back to trust, and people don't trust mp3's and their philosophy built on "psycho-acoustics" -- but that isn't getting at the sound (which would need to be objectively tested through listening), it is built on perception.  For that matter, it probably is worth noting that the "advanced" noise-shaped dither routines are also built on psycho-acoustic principles.  So both mp3 encoding and advanced 24 > 16 bit dithering use psycho-acoustic principles to develop better sounding reduced-data representations of sound

Bottom line, I don't trust either dither routines or mp3 encoding, so I prefer to listen at 24bits.  But if I've got to listen to stuff built on these routines, I find much more benefit to mp3's given the tradeoffs than I do 16bit.
Title: Re: 24bit or 16bit -> mp3? Which is better?
Post by: Gutbucket on July 02, 2010, 07:19:05 PM
Like you say, the difference is essentially one of trust.  I 'trust' 16bit uncompressed audio more because I know exactly what I'm discarding when I dither and truncate the 24bit file (usually done in the one step), so I can reasonably assure myself that nothing is missing from the range of data that contains the 'musical information'.  I know that the only thing I'm discarding is the bottom 8-bits, the part that is nothing but noise.

If I know the dynamic range of the musical information in my 24bit recording, I can make sure that it will fit into the range of my 16bit target file with all of the musical information intact.* Often I needn't do anything to make sure that information fits because most recordings have a program dynamic range that is considerably less than 16bits.  For some extremely dynamic things I've recorded, using the 24bit recording format to best advantage with lowish levels that left plenty of extra headroom to accommodate unexpected peaks, I might need to raise the program level and its associated noise floor somewhat prior to the dither&truncate step to make sure all the musical information fits comfortably in the 90+ dB range of the 16bit target file without the quietest events, buried deep in the recorded noise floor, dropping below the dither/truncate level.  In doing that I'm just shifting the 'musical information range' upwards a few bits, trading some completely unused bits at the top of the range for a few extra at the bottom, which I know are probably nothing but noise anyway.  I'm just insuring that the musical information range of the data is completely unchanged by the 24bit > 16 bit file format change.

With perceptual encoding, I'm always left wondering just what was discarded.  Even if I don't hear a difference, I can't completely trust that something barely perceptible in the 'musical information' range of data wasn't thrown out.  Actually I know for a fact that data was discarded from that range.  But I have to trust that the codec made wise enough choices that I won't notice that missing information.



*I love 24bit as a recording format because it lets me capture a dynamic range considerably larger than that of what I'm recording.  It means I don't have to be as much of a soothsayer in determining perfect level settings.  But I'm totally fine with 16bits as a completely sufficient target format.   That's because I have total control over the levels at that point and I know that all the musical information is retained intact.

I still listen to and play 24bit files primarily, but that's mainly about convenience- that's the raw file I have and it takes more effort to make a quality 16bit file from it.  Yet I don't think 24bit files are an inherently better delivery format for any musical recording who's dynamics fit comfortably within 16bits, which is most everything musical and anything that can be played on a home system (exception for rocket liftoffs and cannon shot recordings with crickets in the background perhaps).  I'm not saying that no differences can ever be heard between playback of otherwise musically identical 16 and 24 bit files, but I think those differences, if detectable, are likely due to DAC technology, not inherent in the file format itself, and will likely continue to become less and less significant as DAC quality continues to improve.

For similar reasons I use simple triangular dither, simply because I know exactly what it is doing and I’ve found its known contribution to be inaudible.  I’ve done the dither listening tests and I can only hear a difference if I increase the levels to a completely un-natural and unusable volume which for normal music would rip your head off and which no system could ever play.  This is especially the case for most everything I’ve recorded, even symphonic music and eclectic threshold of hearing stuff never has a super low-level, studio quiet noise floor. I’m comfortable that the audible difference between triangular and noise shaped dithers is less than I’ll ever hear at any normal level.  By extension, I’m comfortable that I’m not loosing any potentially audible information with a 16bit target delivery file format.  I can’t say the same for perceptual coding like mp3.  Noise shaped dither (also perceptually based) shifts the added noise around to less audible regions which might affect other things I do with the file even if I can’t hear that noise.  In that way those dither schemes are similar to the mp3 unknowns.

The perceptual technologies are fascinating, but they are essentially human hearing tricks. Of course I use and enjoy mp3 as a lightweight, portable and disposable medium just like I use and enjoy plastic beer cups. But I have much greater trust in16 bit uncompressed audio because I know what is in there and what is not.