diff -urN -x build -x '*~' -x '*.orig' -x '*.rej' rockbox.1/apps/codecs/lib/codeclib.h rockbox.2/apps/codecs/lib/codeclib.h
--- rockbox.1/apps/codecs/lib/codeclib.h	2006-11-19 01:01:46.000000000 +0100
+++ rockbox.2/apps/codecs/lib/codeclib.h	2006-11-19 01:01:52.000000000 +0100
@@ -22,8 +22,6 @@
 #include "system.h"
 #include <sys/types.h>
 
-#define MALLOC_BUFSIZE (512*1024)
-
 extern struct codec_api *ci;
 extern long mem_ptr;
 extern long bufsize;
diff -urN -x build -x '*~' -x '*.orig' -x '*.rej' rockbox.1/apps/codecs.c rockbox.2/apps/codecs.c
--- rockbox.1/apps/codecs.c	2006-11-19 01:01:46.000000000 +0100
+++ rockbox.2/apps/codecs.c	2006-11-19 01:01:52.000000000 +0100
@@ -64,6 +64,8 @@
 extern unsigned char codecbuf[];
 #endif
 
+unsigned char *codec_end;
+
 extern void* plugin_get_audio_buffer(int *buffer_size);
 
 struct codec_api ci_voice;
@@ -266,6 +268,8 @@
         logf("codec header error");
         return CODEC_ERROR;
     }
+    codec_end = hdr->end_addr;
+
 #else /* SIMULATOR */
     void *pd;
     
@@ -281,6 +285,8 @@
         sim_codec_close(pd);
         return CODEC_ERROR;
     }
+    codec_end = codecbuf;
+
 #endif /* SIMULATOR */
     if (hdr->api_version > CODEC_API_VERSION
         || hdr->api_version < CODEC_MIN_API_VERSION) {
diff -urN -x build -x '*~' -x '*.orig' -x '*.rej' rockbox.1/apps/codecs.h rockbox.2/apps/codecs.h
--- rockbox.1/apps/codecs.h	2006-11-19 01:01:46.000000000 +0100
+++ rockbox.2/apps/codecs.h	2006-11-19 01:01:52.000000000 +0100
@@ -57,6 +57,8 @@
 #include "playlist.h"
 #include "sound.h"
 
+extern unsigned char *codec_end;
+
 #ifdef CODEC
 
 #if defined(DEBUG) || defined(SIMULATOR)
diff -urN -x build -x '*~' -x '*.orig' -x '*.rej' rockbox.1/apps/playback.c rockbox.2/apps/playback.c
--- rockbox.1/apps/playback.c	2006-11-19 01:00:31.000000000 +0100
+++ rockbox.2/apps/playback.c	2006-11-19 01:01:52.000000000 +0100
@@ -159,10 +159,8 @@
 
 /* As defined in plugins/lib/xxx2wav.h */
 #if MEM > 1
-#define MALLOC_BUFSIZE (512*1024)
 #define GUARD_BUFSIZE  (32*1024)
 #else
-#define MALLOC_BUFSIZE (100*1024)
 #define GUARD_BUFSIZE  (8*1024)
 #endif
 
@@ -276,6 +274,8 @@
 
 volatile int current_codec IDATA_ATTR;          /* Current codec (normal/voice) */
 
+extern unsigned char codecbuf[];                /* DRAM codec swap buffer */
+
 /* Voice thread */
 #ifdef PLAYBACK_VOICE
 
@@ -288,8 +288,6 @@
 static const char voice_thread_name[] = "voice codec";
 
 /* Voice codec swapping control */
-extern unsigned char codecbuf[];                /* DRAM codec swap buffer */
-
 #ifdef SIMULATOR
 static unsigned char sim_iram[CODEC_IRAM_SIZE]; /* IRAM codec swap buffer for sim*/
 #undef CODEC_IRAM_ORIGIN
@@ -1363,8 +1361,8 @@
 
 static void* codec_get_memory_callback(size_t *size)
 {
-    *size = MALLOC_BUFSIZE;
-    return &audiobuf[talk_get_bufsize()];
+    *size = codecbuf + CODEC_SIZE - codec_end;
+    return codec_end;
 }
 
 static void codec_pcmbuf_position_callback(size_t size) ICODE_ATTR;
@@ -3343,7 +3341,7 @@
 
 /*
  * Layout audio buffer as follows:
- * [|TALK]|MALLOC|FILE|GUARD|PCM|AUDIOCODEC|[VOICECODEC|]
+ * [|TALK]|FILE|GUARD|PCM|AUDIOCODEC|[VOICECODEC|]
  */
 static void audio_reset_buffer(size_t pcmbufsize)
 {
@@ -3354,7 +3352,7 @@
     logf("  size:%08X", pcmbufsize);
 
     /* Initially set up file buffer as all space available */
-    filebuf    = audiobuf + MALLOC_BUFSIZE + talk_get_bufsize();
+    filebuf    = audiobuf + talk_get_bufsize();
     filebuflen = audiobufend - filebuf;
 
     /* Allow for codec(s) at end of audio buffer */
diff -urN -x build -x '*~' -x '*.orig' -x '*.rej' rockbox.1/firmware/export/config-ifp7xx.h rockbox.2/firmware/export/config-ifp7xx.h
--- rockbox.1/firmware/export/config-ifp7xx.h	2006-11-19 01:00:31.000000000 +0100
+++ rockbox.2/firmware/export/config-ifp7xx.h	2006-11-19 01:01:57.000000000 +0100
@@ -38,7 +38,7 @@
 #define HAVE_SW_POWEROFF
 
 /* The number of bytes reserved for loadable codecs */
-#define CODEC_SIZE 0x20000
+#define CODEC_SIZE 0x38000
 
 /* The number of bytes reserved for loadable plugins */
 #define PLUGIN_BUFFER_SIZE 0x10000
Binary files rockbox.1/tools/bmp2rb and rockbox.2/tools/bmp2rb differ
Binary files rockbox.1/tools/codepages and rockbox.2/tools/codepages differ
Binary files rockbox.1/tools/convbdf and rockbox.2/tools/convbdf differ
Binary files rockbox.1/tools/rdf2binary and rockbox.2/tools/rdf2binary differ
