IPB

Welcome Guest ( Log In | Register )

ReplayGain, MP3Gain & clipping, A preferred encoding method?
pigsflynow
post Jul 17 2005, 13:54
Post #1





Group: Members
Posts: 21
Joined: 11-July 05
Member No.: 23268



I plan on encoding a replaygained (tagged) FLAC'ed music collection to LAME APS for listening on a new DAP. The plan is to produce mp3 files that have an average level of 92dB in order to get a bit more volume out of the DAP when required (my DAP has the EU SPL cap applied). I see 2 possible approaches:

1. Set foobar2k's ReplayGain preamp to 92dB during encoding.

2. Encode at an 89dB preamp level, then apply MP3Gain with a 92dB setting.

My hunch is that method 1 would introduce additional clipping by applying the gain prior to encoding, while the 2nd approach would not. In other words, method 2 is reversible back to 89dB, while method 1 is not.

I assume (and accept) that method 2 will still introduce clipping once decoded on the DAP. I just prefer to have a reversible, unclipped process.

Is this logic correct?
Go to the top of the page
+Quote Post
 
Start new topic
Replies (1 - 10)
dreamliner77
post Jul 17 2005, 15:36
Post #2





Group: Members
Posts: 2150
Joined: 29-June 02
From: Boston
Member No.: 2427



You'll get more clipping with #2.

Go with one. Monst albums will still not clip at 92dB, and een the one's that do will probably hardly be noticable on a DAP.


--------------------
"You can fight without ever winning, but never win without a fight." Neil Peart 'Resist'
Go to the top of the page
+Quote Post
pigsflynow
post Jul 17 2005, 15:54
Post #3





Group: Members
Posts: 21
Joined: 11-July 05
Member No.: 23268



QUOTE (dreamliner77 @ Jul 17 2005, 10:36 AM)
You'll get more clipping with #2. 

Go with one.  Monst albums will still not clip at 92dB, and een the one's that do will probably hardly be noticable on a DAP.
*


Thanks for the info. I was under the impression that MP3Gain did not introduce clipping. To clip, doesn't the MP3 need to be decoded (since MP3 can represent values beyond -32768 to 32767)?

I was under the impression that the 2nd method might be the better, reversible process.

Edit: By reversible, I mean MP3Gaining back to 89dB.

This post has been edited by pigsflynow: Jul 17 2005, 15:58
Go to the top of the page
+Quote Post
Lyx
post Jul 17 2005, 15:55
Post #4





Group: Members
Posts: 3353
Joined: 6-July 03
From: Sachsen (DE)
Member No.: 7609



Unless your music is already heavily compressed(in the original recording) you will may get clipping anyways - No matter if you use mp3gain or replaygain.

You could tell mp3gain/replaygain to avoid clipping, but that means that it will just not increase the volume that much.

Or in short, if your music is not squashed, then you cannot increase the volume without introducing clipping - unless you add a compressor to the DSP-chain, which will lower the dynamic range in your music (read, make it more squashed).

In case all this sounds like abra-kadabra to you, then there are 3 possibilities:
- buy a small portable preamp for your portable, and stop worrying.
- inform yourself more about how sound works and what compressors do - then recognize that compressors suck and buy a portable preamp.
- inform yourself more about how sound works and what compressors do - and recognize that you dont care about squashed music if that makes it louder -> you use a compressor-DSP while encoding to MP3.

also see here:
http://www.hydrogenaudio.org/forums/index....showtopic=31148
http://www.hydrogenaudio.org/forums/index....topic=35591&hl= (near end of thread)
- Lyx

This post has been edited by Lyx: Jul 17 2005, 16:04


--------------------
I am arrogant and I can afford it because I deliver.
Go to the top of the page
+Quote Post
pigsflynow
post Jul 17 2005, 16:07
Post #5





Group: Members
Posts: 21
Joined: 11-July 05
Member No.: 23268



QUOTE (Lyx @ Jul 17 2005, 10:55 AM)
Unless your music is already heavily compressed(in the original recording) you will may get clipping anyways - No matter if you use mp3gain or replaygain.

You could tell mp3gain/replaygain to avoid clipping, but that means that it will just not increase the volume that much.

Or in short, if your music is not squashed, then you cannot increase the volume without introducing clipping - unless you add a compressor to the DSP-chain, which will lower the dynamic range in your music (read, make it more squashed).

In case all this sounds like abra-kadabra to you, then there are 3 possibilities:
- buy a small portable preamp for your portable.
- inform yourself more about how sound works and what compressors do - then recognize that compressors suck and buy a portable preamp.
- inform yourself more about how sound works and what compressors do - and recognize that you dont care about squashed music if that makes it louder -> you use a compressor-DSP while encoding to MP3.

- Lyx
*


Thanks. Again, I'm trying to find out which process is more reversible. I'm aware that MP3 will always introduce some clipping under normal conditions when decoding. I am by no means interested in minimizing clipping when decoding via the DAP. I don't really care if the decoded files clip during playback in the DAP

It's solely in the 3dB boost to the MP3 files that I'm trying to avoid additional, permanent, irreversible clipping (the kind that I suspect might be introduced in method 1 because the gain may be applied to the decoded WAV before encoding to MP3 (via Diskwriter)).

To make a long story short, I want these MP3s to be "archivable".

I hope I'm making sense... smile.gif

Edit: typo

This post has been edited by pigsflynow: Jul 17 2005, 16:10
Go to the top of the page
+Quote Post
Lyx
post Jul 17 2005, 16:13
Post #6





Group: Members
Posts: 3353
Joined: 6-July 03
From: Sachsen (DE)
Member No.: 7609



i'm not 100% sure, but in this case mp3gain may be the only "reversible" solution for a DAP. But that will only work if you do *not* use a compressor and live with your music getting clipped on playback.

This post has been edited by Lyx: Jul 17 2005, 16:15


--------------------
I am arrogant and I can afford it because I deliver.
Go to the top of the page
+Quote Post
pigsflynow
post Jul 17 2005, 16:20
Post #7





Group: Members
Posts: 21
Joined: 11-July 05
Member No.: 23268



QUOTE (Lyx @ Jul 17 2005, 11:13 AM)
i'm not 100% sure, but in this case mp3gain may be the only "reversible" solution for a DAP. But that will only work if you do *not* use a compressor and live with your music getting clipped on playback.
*


I think we're on the same page now. I'm willing to live with whatever clipping the 3dB boost adds to the decoded audio on the DAP. I would, however, like the MP3 files to "reverse-archivable".

I guess the main question is: When transcoding from FLAC to MP3 with a 3dB boost via the ReplayGain preamp, is the 3dB boost applied to the decoded WAV or to the encoded MP3?
Go to the top of the page
+Quote Post
Lyx
post Jul 17 2005, 16:24
Post #8





Group: Members
Posts: 3353
Joined: 6-July 03
From: Sachsen (DE)
Member No.: 7609



to the mp3. Thats why your idea will only work with mp3gain.

Explanation: all DSPs and preamp you set in fb2k's diskwriter are applied to the decoded audiodata itself before encoding (your FLACs will of course stay unchanged - diskwriting means original-format -> decoded audio -> target-format)

Mp3Gain does not really change the audiodata itself. An mp3 consists of "frames"(like sectors on a CD). Every of those frames has a preamp-modifier-variable. This modifier is stored in *addition* to the audiodata in the frame, and it can exceed the max volume. Thus, the modifier can be higher than the max volume and therefore can be reversed - if the undo-data is stored somewhere(mp3gain stores them in tags)

This post has been edited by Lyx: Jul 17 2005, 16:34


--------------------
I am arrogant and I can afford it because I deliver.
Go to the top of the page
+Quote Post
pigsflynow
post Jul 17 2005, 16:35
Post #9





Group: Members
Posts: 21
Joined: 11-July 05
Member No.: 23268



QUOTE (Lyx @ Jul 17 2005, 11:24 AM)
to the mp3. Thats why your idea will only work with mp3gain.
*


If the 3dB gain is applied to the encoded mp3, how does clipping occur? I would expect gain applied after encoding to mp3 to be pretty much identical to how mp3gain works. Is there a different mechanism for applying gain (in diskwriter after encoding?

I was guessing that replaygain preamp gain was applied to the decoded WAV (ie. how a normal preamp usually functions), and that clipping was already present before encoding to mp3...

Edit: I think you meant to say "to the WAV" in your first sentence. Your explanation in your edit makes perfect sense to me.

This post has been edited by pigsflynow: Jul 17 2005, 16:38
Go to the top of the page
+Quote Post
Lyx
post Jul 17 2005, 16:41
Post #10





Group: Members
Posts: 3353
Joined: 6-July 03
From: Sachsen (DE)
Member No.: 7609



QUOTE (pigsflynow @ Jul 17 2005, 05:35 PM)
If the 3dB gain is applied to the encoded mp3, how does clipping occur?
*

Clipping means that the volume of the audiodata exceeds its max value. Since this is not possible, it is cut off(flattened).

The difference between is just if the "clipping" happens before encoding(and is permanent), or is introduced when decoding. Read my addendum in my previous post: when using mp3gain, then it is the modifier-value which introduces clipping while decoding - the audiodata itself does not clip - it only clips when the modifier is applied while decoding.


--------------------
I am arrogant and I can afford it because I deliver.
Go to the top of the page
+Quote Post
pigsflynow
post Jul 17 2005, 16:45
Post #11





Group: Members
Posts: 21
Joined: 11-July 05
Member No.: 23268



QUOTE (Lyx @ Jul 17 2005, 11:41 AM)
QUOTE (pigsflynow @ Jul 17 2005, 05:35 PM)
If the 3dB gain is applied to the encoded mp3, how does clipping occur?
*

Clipping means that the volume of the audiodata exceeds its max value. Since this is not possible, it is cut off(flattened).

The difference between is just if the "clipping" happens before encoding(and is permanent), or is introduced when decoding. Read my addendum in my previous post: when using mp3gain, then it is the modifier-value which introduces clipping while decoding - the audiodata itself does not clip - it only clips when the modifier is applied while decoding.
*



See my previous edit. Your last post threw me off in the first sentence. Everything else makes perfect sense.

To sum it up. The plan is to avoid "permanent" clipping. You've confirmed my fears about using method 1. Thanks!
Go to the top of the page
+Quote Post

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: 25th October 2014 - 14:51