diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2006-11-29 17:52:30 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2006-11-29 17:52:30 +0000 |
commit | 6ae46065b40691d5571252aeeb2ec5475e2f5e4c (patch) | |
tree | 6b53c5593a1b364fe078bfb1f82e2f54ff9b6a96 /apps/codecs/aiff_enc.c | |
parent | b57f23139bbcd3b631d4921e971095694f4a0d56 (diff) | |
download | rockbox-6ae46065b40691d5571252aeeb2ec5475e2f5e4c.tar.gz rockbox-6ae46065b40691d5571252aeeb2ec5475e2f5e4c.zip |
Add support for compiling encoders without adjustable CPU frequency and/or IRAM.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11625 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/aiff_enc.c')
-rw-r--r-- | apps/codecs/aiff_enc.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/codecs/aiff_enc.c b/apps/codecs/aiff_enc.c index ba7e36e99e..c1c2a9ec48 100644 --- a/apps/codecs/aiff_enc.c +++ b/apps/codecs/aiff_enc.c | |||
@@ -298,7 +298,9 @@ static bool init_encoder(void) | |||
298 | ci->enc_set_parameters == NULL || | 298 | ci->enc_set_parameters == NULL || |
299 | ci->enc_get_chunk == NULL || | 299 | ci->enc_get_chunk == NULL || |
300 | ci->enc_finish_chunk == NULL || | 300 | ci->enc_finish_chunk == NULL || |
301 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | ||
301 | ci->enc_pcm_buf_near_empty == NULL || | 302 | ci->enc_pcm_buf_near_empty == NULL || |
303 | #endif | ||
302 | ci->enc_get_pcm_data == NULL ) | 304 | ci->enc_get_pcm_data == NULL ) |
303 | return false; | 305 | return false; |
304 | 306 | ||
@@ -325,7 +327,9 @@ static bool init_encoder(void) | |||
325 | /* main codec entry point */ | 327 | /* main codec entry point */ |
326 | enum codec_status codec_main(void) | 328 | enum codec_status codec_main(void) |
327 | { | 329 | { |
330 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | ||
328 | bool cpu_boosted; | 331 | bool cpu_boosted; |
332 | #endif | ||
329 | 333 | ||
330 | if (!init_encoder()) | 334 | if (!init_encoder()) |
331 | { | 335 | { |
@@ -336,8 +340,10 @@ enum codec_status codec_main(void) | |||
336 | /* main application waits for this flag during encoder loading */ | 340 | /* main application waits for this flag during encoder loading */ |
337 | ci->enc_codec_loaded = 1; | 341 | ci->enc_codec_loaded = 1; |
338 | 342 | ||
343 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | ||
339 | ci->cpu_boost(true); | 344 | ci->cpu_boost(true); |
340 | cpu_boosted = true; | 345 | cpu_boosted = true; |
346 | #endif | ||
341 | 347 | ||
342 | /* main encoding loop */ | 348 | /* main encoding loop */ |
343 | while(!ci->stop_codec) | 349 | while(!ci->stop_codec) |
@@ -351,12 +357,13 @@ enum codec_status codec_main(void) | |||
351 | if (ci->stop_codec) | 357 | if (ci->stop_codec) |
352 | break; | 358 | break; |
353 | 359 | ||
360 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | ||
354 | if (!cpu_boosted && ci->enc_pcm_buf_near_empty() == 0) | 361 | if (!cpu_boosted && ci->enc_pcm_buf_near_empty() == 0) |
355 | { | 362 | { |
356 | ci->cpu_boost(true); | 363 | ci->cpu_boost(true); |
357 | cpu_boosted = true; | 364 | cpu_boosted = true; |
358 | } | 365 | } |
359 | 366 | #endif | |
360 | chunk = ci->enc_get_chunk(); | 367 | chunk = ci->enc_get_chunk(); |
361 | chunk->enc_size = enc_size; | 368 | chunk->enc_size = enc_size; |
362 | chunk->num_pcm = PCM_SAMP_PER_CHUNK; | 369 | chunk->num_pcm = PCM_SAMP_PER_CHUNK; |
@@ -368,17 +375,20 @@ enum codec_status codec_main(void) | |||
368 | ci->yield(); | 375 | ci->yield(); |
369 | } | 376 | } |
370 | 377 | ||
378 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | ||
371 | if (cpu_boosted && ci->enc_pcm_buf_near_empty() != 0) | 379 | if (cpu_boosted && ci->enc_pcm_buf_near_empty() != 0) |
372 | { | 380 | { |
373 | ci->cpu_boost(false); | 381 | ci->cpu_boost(false); |
374 | cpu_boosted = false; | 382 | cpu_boosted = false; |
375 | } | 383 | } |
376 | 384 | #endif | |
377 | ci->yield(); | 385 | ci->yield(); |
378 | } | 386 | } |
379 | 387 | ||
388 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | ||
380 | if (cpu_boosted) /* set initial boost state */ | 389 | if (cpu_boosted) /* set initial boost state */ |
381 | ci->cpu_boost(false); | 390 | ci->cpu_boost(false); |
391 | #endif | ||
382 | 392 | ||
383 | /* reset parameters to initial state */ | 393 | /* reset parameters to initial state */ |
384 | ci->enc_set_parameters(NULL); | 394 | ci->enc_set_parameters(NULL); |