summaryrefslogtreecommitdiffstats
path: root/apps/codecs/mp3_enc.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-11-30 05:16:56 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-11-30 05:16:56 +0000
commit5323fe996b6a62be2201de2b2a5f6917a6040cb1 (patch)
tree9ae9d6473718ecb686e9eaa5bf1804e276f2a0c2 /apps/codecs/mp3_enc.c
parentb0dd9eb5bcdd0c320444474fbf3a0f09dc71684d (diff)
downloadrockbox-5323fe996b6a62be2201de2b2a5f6917a6040cb1.tar.gz
rockbox-5323fe996b6a62be2201de2b2a5f6917a6040cb1.zip
Move encoder CPU boost control to the core. Allow CPU to sleep a bit when PCM buffer is empty and save some power. Codec API becomes incompatible so full updates! :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15854 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/mp3_enc.c')
-rw-r--r--apps/codecs/mp3_enc.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/apps/codecs/mp3_enc.c b/apps/codecs/mp3_enc.c
index 1ec41ad45e..2dc9bcbb3d 100644
--- a/apps/codecs/mp3_enc.c
+++ b/apps/codecs/mp3_enc.c
@@ -2423,9 +2423,6 @@ static bool enc_init(void)
ci->enc_set_parameters == NULL ||
ci->enc_get_chunk == NULL ||
ci->enc_finish_chunk == NULL ||
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
- ci->enc_pcm_buf_near_empty == NULL ||
-#endif
ci->enc_get_pcm_data == NULL ||
ci->enc_unget_pcm_data == NULL )
return false;
@@ -2461,10 +2458,6 @@ static bool enc_init(void)
enum codec_status codec_main(void)
{
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
- bool cpu_boosted;
-#endif
-
/* Generic codec initialisation */
if (!enc_init())
{
@@ -2475,11 +2468,6 @@ enum codec_status codec_main(void)
/* main application waits for this flag during encoder loading */
ci->enc_codec_loaded = 1;
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
- ci->cpu_boost(true);
- cpu_boosted = true;
-#endif
-
/* main encoding loop */
while (!ci->stop_encoder)
{
@@ -2492,13 +2480,6 @@ enum codec_status codec_main(void)
if (ci->stop_encoder)
break;
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
- if (!cpu_boosted && ci->enc_pcm_buf_near_empty() == 0)
- {
- ci->cpu_boost(true);
- cpu_boosted = true;
- }
-#endif
chunk = ci->enc_get_chunk();
chunk->enc_data = ENC_CHUNK_SKIP_HDR(chunk->enc_data, chunk);
@@ -2515,21 +2496,9 @@ enum codec_status codec_main(void)
ci->yield();
}
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
- if (cpu_boosted && ci->enc_pcm_buf_near_empty())
- {
- ci->cpu_boost(false);
- cpu_boosted = false;
- }
-#endif
ci->yield();
}
-#ifdef HAVE_ADJUSTABLE_CPU_FREQ
- if (cpu_boosted) /* set initial boost state */
- ci->cpu_boost(false);
-#endif
-
/* reset parameters to initial state */
ci->enc_set_parameters(NULL);