Support and General Use > Audio Playback, Database and Playlists
ReplayGain query
Lear:
--- Quote from: saratoga on August 04, 2007, 08:18:48 PM ---Because replaygain is a digital adjustment, and must be done prior to loading samples onto the DAC. RG actually takes each sample and multiplies it by a constant. You can't do that with a DAC.
--- End quote ---
Multiplying a stream of samples with a constant is the same as adjusting the volume. Might not be a part of the DAC proper, but...
--- Quote ---I don't think replaygain is CPU intensive enough to have a noticeable impact on CPU performance. Its just 44,100 16 bit multiplies per second. Thats not very much CPU time.
--- End quote ---
For the typical stereo track, there are 88,200 32-bit multiplies. Still not that much CPU needed, compared to decompressing the audio.
DefineByte:
--- Quote from: Lear on August 05, 2007, 02:07:43 AM ---For the Pevent Clipping" option to work, the volume adjustment has to be done before the samples are scaled/clipped to the final output (which happens before the samples are sent to the DAC).
--- End quote ---
Couldn't you simply fall back to the current way of doing things if the file is found to clip? Most files don't clip do they?
Maybe 'significant' was a bit of a stretch but it would save some. If it was enough to prevent a boost of the CPU (in the right conditions) I would imagine it would be noticeable.
Thanks for all your responses. It's been bugging me for a while. x)
markun:
--- Quote from: DefineByte on August 05, 2007, 05:29:56 AM ---Maybe 'significant' was a bit of a stretch but it would save some. If it was enough to prevent a boost of the CPU (in the right conditions) I would imagine it would be noticeable.
--- End quote ---
You can find out by playing a song with replaygain on and off and checking the difference in boost percentage.
btw, here's an old patch by me to help you a bit if you still want to take this route:
http://130.89.160.166/rockbox/replaygain3.patch
might not apply and/or be the best way of doing it
DefineByte:
The problem I have with that suggestion is that my eyesight is quite poor and the debug menu reverts to the default tiny font.
Seems I should invest in a decent magnifying glass. xD
saratoga:
--- Quote from: Lear on August 05, 2007, 02:17:36 AM ---Multiplying a stream of samples with a constant is the same as adjusting the volume.
--- End quote ---
Provided you have infinate word length sure. However, for a 16 bit word, this is not the case, which is why replaygain is so useful to reduce clipping.
--- Quote from: Lear on August 05, 2007, 02:17:36 AM ---For the typical stereo track, there are 88,200 32-bit multiplies. Still not that much CPU needed, compared to decompressing the audio.
--- End quote ---
Forgot about stereo. However, I believe its just a 16 bit multiply. At least I know my decoder only puts out a 16 bit sample, unless the playback engine is converting back to 32 bit?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version