Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: VBR vs. CBR and power consumption (Read 9271 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

VBR vs. CBR and power consumption

I think MP3 (Lame) is VBR.  Am I wrong?

I f I want to use CBR, which should I use? :
MP4 (Nero) ?
FLAC ?
Ogg Vorbis ?
Muse pack ?


THank you

VBR vs. CBR and power consumption

Reply #1
MP3 can use constant bitrate as well. LAME only recommends VBR for various reasons.

For converting to CBR MP3 in foobar2000, you have to create a custom Converter preset. The predefined one for MP3 has a slider for variable bitrates only.
Refer to LAME documentation for the right set of parameters for the command line encoder to generate CBR files as you want.
Full-quoting makes you scroll past the same junk over and over.

VBR vs. CBR and power consumption

Reply #2
Do you have a specific reason for having to use CBR?

Cheers, Slipstreem. 

VBR vs. CBR and power consumption

Reply #3
Do you have a specific reason for having to use CBR?

Cheers, Slipstreem. 


Yes,  using mp3 CBR files, instead of VBR, is supposed to make the battery of mp3 player to discharge slower and have a better lifetime...  Here's what I have been told :
"Using lower bitrates and CBR rather than VBR also gives longer runtime"

Using CBR with foobar2000 seems to be complex.  I think I'll try to find an another encoder for CBR files...

Have a nice day...

VBR vs. CBR and power consumption

Reply #4
I think it's unlikely to extend battery life if the player is being forced to use a higher bitrate than necessary the vast majority of the time. CBR will have a tendency to do this versus VBR that dynamically only uses whatever bitrate is deemed necessary to maintain a given level of quality decided by the end-user.

I'd take the information on extended battery life with a pinch of salt without verification personally.

Cheers, Slipstreem. 

VBR vs. CBR and power consumption

Reply #5
I think it's unlikely to extend battery life if the player is being forced to use a higher bitrate than necessary the vast majority of the time. CBR will have a tendency to do this versus VBR that dynamically only uses whatever bitrate is deemed necessary to maintain a given level of quality decided by the end-user.

I'd take the information on extended battery life with a pinch of salt without verification personally.

Cheers, Slipstreem. 

Thank for this explanation !  At the opposite, can you explain me what could make a VBR file to take less battery juice than a VBR file (why did he told me that?).

VBR vs. CBR and power consumption

Reply #6
I'm not saying that VBR will necessarily take less battery power. I simply don't have the data to confirm or deny it, but CBR will always run at the bitrate you choose regardless of whether it needs to or not. VBR will only use whatever bitrate is required to get the job done at any instant in time. It's just inherently more efficient than CBR.

If power consumption were related to bitrate (which it may or may not be) then it makes sense to assume that a lower average bitrate would equate to less power consumption. The bitrate of CBR is fixed, therefore, its bitrate at any instant in time is the average bitrate. VBR chooses a bitrate on-the-fly between 32Kbps and 320Kbps (or possibly lower with high -V values) to suit the encoded content.

CBR = constant bitrate and variable quality.

VBR = variable bitrate and constant quality.

In my own personal experience, and supposing that you were aiming for a bitrate of around 128Kbps, VBR at -V5 would use approximately the same average bitrate as a fixed CBR128 encoding but return better quality. The efficiency of VBR in terms of quality versus bitrate/file size is generally higher than CBR, so I'd expect it to return better audio quality for a given workload.

The only way to be sure is to try it for yourself though.

Cheers, Slipstreem. 

VBR vs. CBR and power consumption

Reply #7
If power consumption were related to bitrate (which it may or may not be) then it makes sense to assume that a lower average bitrate would equate to less power consumption.
Well, I've also heard this the other way, regarding lower limit of 96 kbps for Vorbis on iRiver DAPs a few years back. Lower bitrate files supposedly needed more power, because the decoder had to generate (add) more data.

Anyway, let's do a simple test. I took ~84 minutes long mix, converted it to MP3s with various settings and ran it in fb2k's benchmark.

First, is there a decoding speed difference between low and high bitrate files? How big?
Code: [Select]
File: cbr-32kbps.mp3
  Speed (x realtime): 790.820 min, 804.221 max, 798.964 average
File: cbr-320.mp3
  Speed (x realtime): 224.727 min, 225.882 max, 225.190 average
Yes, the low-bitrate file really decodes approximately 3.5x faster than the one at maximum bitrate.

Next, is there a decoding speed difference between CBR and VBR at similar bitrate?
Code: [Select]
File: cbr-128.mp3
  Speed (x realtime): 268.777 min, 269.622 max, 269.084 average
File: vbr-v5.mp3
  Speed (x realtime): 266.027 min, 267.631 max, 266.823 average
Considering that the V5 file had real average bitrate 138.7 kbps, which would explain the little difference, I don't think so.
Full-quoting makes you scroll past the same junk over and over.

VBR vs. CBR and power consumption

Reply #8
So, if we make the following assumptions based upon the decoding speed of CBR128 versus -V5...

1/ Decoding speed equates to power consumed during the decoding process (this may or may not be true, although I suspect that it is.),

2/ The OP would be happy to consider using either CBR128 or -V5,

...the choice would come down to whichever provided the highest level of transparency to the OP. It looks to me as though it's time for the OP to start carrying out some ABX testing.

Thanks for the info, Yirkha. Very interesting!

Cheers, Slipstreem. 

VBR vs. CBR and power consumption

Reply #9
Hmm, I think I should have written more in my previous post.

First, the decoder in the player can have different characterics than the one in foobar2000. But if it's similar, I guess it still depends on more variables, like whether the player's chip really goes into some kind of optimized low-power state when "idle". The real difference in power consumption will be definitely much smaller than shown in the above test, because the decoding is only a part of the processing – reading the file, any DSPs, handling audio output and other player logic, all have to be taken care of in both cases.

I wouldn't personally bother with such a small thing at all.

Moderation: Topic shift, moved to MP3 forum.
Full-quoting makes you scroll past the same junk over and over.

VBR vs. CBR and power consumption

Reply #10
Wow!  Thank you very much for your reflexion both of you!  Very interesting!   

There should not be a big difference on the battery between CBR and VBR.

So it'll be VBR since it should gives a better audio quality.

Thanks again! 

VBR vs. CBR and power consumption

Reply #11
I ran a whole bunch of battery tests when I purchased my 5G 60GB iPod.  It was the first 40GB+ audio player that I owned and I wanted to experiment with possible encoding scenarios including playing back WAV files, Apple lossless files, CBR Lame mp3 files (at 128kbps, 160kbps, 192kbps, and 320kbps), VBR Lame mp3 files (-V 4, -V 2, and -V 0 were tested), and Nero AAC at various VBR and CBR settings.

The test took me about a month to conduct but once I was done, I determined that CBR and VBR really didn't matter so much as the overall bitrate.  A playlist consisting of only -V 2 files would play for the same amount of time (on a single charge) as 128kbps CBR, 160kbps CBR, -V 4, and 192kbps CBR files.  The battery playback time would really only decrease when I upped the bitrate/setting to 320klbps CBR or -V 0.

So, with my iPod from my tests, I found that 192kbps CBR mp3 files drained the iPod just as fast (or slow) as -V 2 mp3 files.

I believe that there once was a time when VBR would drain batteries quicker due to the greater processor load when playing the audio files.  That really isn't the case anymore as modern hardware is efficient.  I still have a really old Rio 600 player with 32MB of internal storage and a 64MB backpack for 96MB of total store.  It was able to last for about 15 hours on a single charge.  That was back when I used 64kbps CBR for my audio needs and I went with the Xing mp3 encoder.  Anyway, I could get about 20 hours of playback on a single charge due to using such a low bitrate.  My friend used MusicMatch to rip their CDs and they used a VBR setting of around 96kbps.  I then decided to re-rip my CDs to 96kbps CBR.  The battery life of my Rio went down to 18 hours.  I then tried 96kbps VBR and the battery life was decreased to 12 hours.

So there was a time when VBR mattered, now it doesn't.  VBR is recommended even more so due to its efficiency and higher quality over CBR (at the same setting for a given bitrate range).

VBR vs. CBR and power consumption

Reply #12
... I determined that CBR and VBR really didn't matter so much as the overall bitrate.  A playlist consisting of only -V 2 files would play for the same amount of time (on a single charge) as 128kbps CBR, 160kbps CBR, -V 4, and 192kbps CBR files.  The battery playback time would really only decrease when I upped the bitrate/setting to 320klbps CBR or -V 0.

It's cool you did those tests - but I want to point out one caveat:  What differences you saw in runtime were likely exacerbated by the fact you were testing on a HDD based player.  If Apple achieved half the MP3 decoding efficiency on those iPods that Rockbox has then hard drive power consumption becomes a large part of the equation, likely larger than CPU power consumption.  Larger bitrates = more time spent refilling the RAM buffer.  I would expect to see the runtime differences shrink (but not disappear) on a flash based player.
Creature of habit.

VBR vs. CBR and power consumption

Reply #13
Yes, it was a hard drive based player.  I started conducting battery tests on my 1G 16GB iPod touch but quickly found out that playing Apple lossless, 320kbps mp3/AAC, -V 0/256kbps VBRj mp3/AAC, and so on really didn't result in battery playback differences.  My iPod touch would always last about 22 hours (sometimes it would go up to 22.5 hours with 128kbps content and other times it would go down to just nearly 22 hours with higher bitrate content).

I figured that such small differences didn't warrant running a large test as I did on my 5G 60GB iPod.  You are right about hard drive based players though in that the hard drive spinning up consumes more power, with larger files, than CPU consumption.

VBR vs. CBR and power consumption

Reply #14
In theory I might think a CBR file could use a tiny bit less CPU than an equivalent bit rate VBR file, on some content. I'll try to explain my reasoning based on what is happening inside an MP3 decoder.

The later stages of an MP3 decoder are not typically affected by bit rate. A fairly constant set of transforms from the "unpacked" bits are performed, and should always use about the same CPU, for a given sample rate and number of channels (which some encoders may change on you for ultra low bit rates).

The first stages of an MP3 decoder are affected by bit rate. Various operations parse all those bits and decode them into the intermediate format that the second stages of the decoder can transform on. The more bits, the more work generally required here.

A CBR file of equivalent bit rate could in theory be a bit cheaper to decode because CBR encoding can produce encoded frames that include wasted padding bits. E.g. in a 417 byte frame maybe only 100 bytes include data. The decoder does not have to really decode those other 317 bytes, it just skips past them. A VBR file is not really going to have wasted bits in it. This means every bit in that file means something and is going to take some CPU to decode. In effect a CBR file of a given bit rate may actually contain less real bits in it than says it has, so in effect the bit rate is lower than you think it is, from the decoders perspective. For typical music on lower CBR rates, you aren't going to find many wasted bits, so it will not really make a difference. When you go to higher CBR bit rates or encode simple audio (silence, etc.), you will see wasted bits and therefore the CBR file may be a fair bit cheaper to decode than an equivalent bit rate VBR file. Again, this is all very content related.

In the case of the earlier post where the user saw 32 kbps files decode 3.5x faster than 320 kbps files, I seriously doubt that is just because of the first stages of the MP3 decoder. At 32 kbps the encoder is likely resampling the source audio to half the original rate, and maybe rechanneling it to mono. For the second half of an MP3 decoder, halfing the sample rate essentially halves the CPU required to decode, likewise going to mono cuts another half of the CPU out. So in typical scenarios, I might guess typically more like a 10-30% CPU difference between a 96 kbit and 320 kbit MP3 file of equivalent sample rate and channels (this will all be directly related to how fast the implementation of the first part of the decoder (huffman decoding, etc.) vs. the second (iMDCT, Polyphase), which could vary a fair bit depending on CPU as these stages use very different instructions).

Sorry that's a lot of blabbering but in short I would always VBR because any CPU savings you get in power consumption is because you have hobbled the quality of the file by wasting bits using CBR.