android
  #1  
Old 05-24-2008, 11:36 AM
Lejnoss Lejnoss is offline
Junior Member
 
Join Date: Apr 2008
Location: Sweden
Posts: 12
Help Does .ogg-files drain more battery power?

My battery has ran out quite fast since i've started use .ogg instead of .mp3.
Is this the reason?

cpchan edit: Sorry I think I either hit "edit" accidentally instead of "reply" or there was a temporary glitch in the software. Sorry for messing up your post (strange that it quoted properly).

Last edited by cpchan; 05-24-2008 at 12:18 PM.
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 05-24-2008, 12:15 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by Lejnoss View Post
My battery has ran out quite fast since i've started use .ogg instead of .mp3.
Is this the reason?
First please don't use the term ogg since ogg is a container format and can contain a number of codecs even video.

To answer your question, yes Vorbis is more cpu intensive then mp3 (it is a more modern and advanced codec). However, since Vorbis can achieve the same quality as your mp3's at a much lower bitrate, you can lower it to save power. I have great battery life using "-q 3" (-q 6 on my desktop computer). Also for lower bitrates (< -q4) you should be using the AoTUV branch (Monty doesn't have time to integrate the new tunings into Vorbis proper right now). Here is a link to get it:

http://www.rarewares.org/ogg-oggenc.php

Just search for AoTUV on the page. For more info about AoTUV follow the link in my sig.

Charles

Last edited by cpchan; 05-24-2008 at 11:12 PM.
Reply With Quote

  #3  
Old 05-24-2008, 12:29 PM
kugel's Avatar
kugel kugel is offline
Rockbox Developer
 
Join Date: Dec 2006
Location: Berlin, Germany
Posts: 1,153
Default

I don't think that lower bitrates lead to higher battery life. I think it's it's the opposite: The more compressed the file is (=lower bitrates) the higher CPU time is needed to decompress/decode.

I just know, that WAV is the most battery friendly codec. No compression, and highest bitrate. FLAC also gives a decent batterly time (higher than MP3) even though it has 500kbit/s or more.

Generally, the higher the compression complexity is, the more CPU time is needed. And AFAIK the compression complexity increases with lower bitrates.

But don't quote me on that. I'm really not sure on that one.
__________________
;;
Reply With Quote

  #4  
Old 05-24-2008, 01:11 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by kugel View Post
I don't think that lower bitrates lead to higher battery life. I think it's it's the opposite: The more compressed the file is (=lower bitrates) the higher CPU time is needed to decompress/decode.
No, not for a lossy codec. Remember how lossy compession works- the lower the bitrate, the more data it throws away dictated by the Psychoacoustics model used. Thus the lower the bitrate, the less data it has to decode. This is the recommendation from Hydrogenaudio and the Xiph mailinglists for years.

Quote:
Originally Posted by kugel View Post
I just know, that WAV is the most battery friendly codec. No compression, and highest bitrate. FLAC also gives a decent batterly time (higher than MP3) even though it has 500kbit/s or more.
First of all wav is not a codec- it is a container format mainly used for PCM and compressed PCM. Also you cannot compare FLAC to Vorbis or MP3- FLAC is lossless.

Charles

Last edited by cpchan; 05-24-2008 at 01:33 PM.
Reply With Quote

  #5  
Old 05-24-2008, 02:37 PM
saratoga saratoga is offline
Rockbox Developer / Moderator
 
Join Date: Apr 2007
Posts: 3,603
Default

Quote:
Originally Posted by cpchan View Post

To answer your question, yes Vorbis is more cpu intensive then mp3 (it is a more modern and advanced codec).
This is what I assumed too, but its actually not true. Tremor (the vorbis codec we use) is extremely efficient on ARM:

http://www.rockbox.org/twiki/bin/vie...anceComparison

Its actually faster then MP3 and my WMA codec. Eventually I want to move some of the Tremor code into the WMA and AAC codecs, in which case WMA will probably become a little faster and AAC suck a lot less, but for now Vorbis is faster then all the lossy codecs except MPC and MP2 I think.

That said, it doesn't have to be this way! I've been hoping someone would take a look at our MP3 codec and look for ways to speed it up. Its already quite efficient, but I'm sure it could be made at least as fast as Vorbis.

Quote:
Originally Posted by kugel
I don't think that lower bitrates lead to higher battery life. I think it's it's the opposite: The more compressed the file is (=lower bitrates) the higher CPU time is needed to decompress/decode.
This is a pretty sensible thought, but it doesn't work quite like this for most codecs. In general, as you lower the bitrate, the codec simply stores values less precisely, so the total work needed to decompress doesn't increase. In fact, it typically gets faster just because theres less data to fetch into memory, and less data to Huffman decode.

Though for codecs that actually do compress more at lower bitrates like WMA, very low bitrates can use a surprising amount of CPU power. For WMA, this starts at 32kbps and keeps rising as the decoder needs to do more and more work to recover the audio.
Reply With Quote

  #6  
Old 05-24-2008, 02:58 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by saratoga View Post
Its actually faster then MP3 and my WMA codec.
That said, it doesn't have to be this way! I've been hoping someone would take a look at our MP3 codec and look for ways to speed it up. Its already quite efficient, but I'm sure it could be made at least as fast as Vorbis.
Interesting. Do you know how much Tremor have changed and optimized in Rockbox as compared to the original code from Xiph?

Quote:
Though for codecs that actually do compress more at lower bitrates like WMA, very low bitrates can use a surprising amount of CPU power. For WMA, this starts at 32kbps and keeps rising as the decoder needs to do more and more work to recover the audio.
I presume this only applies to WMA Pro and not standard.

Charles
Reply With Quote

  #7  
Old 05-24-2008, 03:09 PM
kugel's Avatar
kugel kugel is offline
Rockbox Developer
 
Join Date: Dec 2006
Location: Berlin, Germany
Posts: 1,153
Default

Quote:
Originally Posted by saratoga View Post
Its actually faster then MP3 and my WMA codec. Eventually I want to move some of the Tremor code into the WMA and AAC codecs, in which case WMA will probably become a little faster and AAC suck a lot less, but for now Vorbis is faster then all the lossy codecs except MPC and MP2 I think.
The table you linked shows me that MP3 is faster than ogg, even on ARM(=PP?) targets (slightly).

€dit: Well, I took a close look now. On iPod and e200 the Vorbis is slightly faster, except for the _96 files.
__________________
;;
Reply With Quote

  #8  
Old 05-24-2008, 03:19 PM
saratoga saratoga is offline
Rockbox Developer / Moderator
 
Join Date: Apr 2007
Posts: 3,603
Default

Quote:
Originally Posted by cpchan View Post
Interesting. Do you know how much Tremor have changed and optimized in Rockbox as compared to the original code from Xiph?
A lot of both Tremor and MAD (the Mp3 codec) have been rewritten in assembly for speed, so the code is quite different but the algorithm has changed little or not at all.


Quote:
Originally Posted by cpchan View Post
I presume this only applies to WMA Pro and not standard.
Just standard as far as I know. No one knows how Pro works, so I can't comment on what it does.

Quote:
€dit: Well, I took a close look now. On iPod and e200 the Vorbis is slightly faster, except for the _96 files.
I'm mostly thinking of the 192k results, where Vorbis is 17% faster. That works out to about 7MHz fewer needed for Vorbis, a savings of about 2.4 mA when decoding.
Reply With Quote

  #9  
Old 05-24-2008, 03:35 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by saratoga View Post
A lot of both Tremor and MAD (the Mp3 codec) have been rewritten in assembly for speed, so the code is quite different but the algorithm has changed little or not at all.
Ah, that explains it.

Quote:
Just standard as far as I know. No one knows how Pro works, so I can't comment on what it does.
Thanks for the info. I didn't know that WMA (which I don't use) is more CPU intensive at low bitrates.

Charles
Reply With Quote

  #10  
Old 05-30-2008, 06:10 PM
Lejnoss Lejnoss is offline
Junior Member
 
Join Date: Apr 2008
Location: Sweden
Posts: 12
Default

Omg, that was a lot of answers!

Ya, so it's Vorbis henceforth!
I use -q6 and I think I use AoTUV branch,
so then I seem to have chosen right at least!
By the way, with "faster" do you mean more battery
efficient?

Thanks for taking you time!
Reply With Quote

  #11  
Old 05-30-2008, 06:52 PM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Quote:
Originally Posted by Lejnoss View Post
By the way, with "faster" do you mean more battery
efficient?
Yes.

Charles
Reply With Quote

  #12  
Old 06-01-2008, 11:16 AM
saratoga saratoga is offline
Rockbox Developer / Moderator
 
Join Date: Apr 2007
Posts: 3,603
Default

I sent out an email to the developers list explaining the state of codec optimization in rockbox:

http://www.rockbox.org/mail/archive/...-06/0003.shtml
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 02:30 PM.