This commit is contained in:
huxi
2025-12-03 11:12:34 +08:00
parent c23ae4f24c
commit bc195654bf
8163 changed files with 3799544 additions and 92 deletions
+61
View File
@@ -0,0 +1,61 @@
#include "asm/includes.h"
#include "media/includes.h"
#include "overlay_code.h"
struct code_type {
u32 type;
u32 dst;
u32 src;
u32 size;
};
extern int aec_addr, aec_begin, aec_size;
extern int aac_addr, aac_begin, aac_size;
const struct code_type ctype[] = {
//没有使用动态加载时使用overlay
#ifndef CONFIG_CODE_MOVABLE_ENABLE
{OVERLAY_AEC, (u32) &aec_addr, (u32) &aec_begin, (u32) &aec_size},
{OVERLAY_M4A, (u32) &aac_addr, (u32) &aac_begin, (u32) &aac_size },
#endif
};
struct audio_overlay_type {
u32 atype;
u32 otype;
};
const struct audio_overlay_type aotype[] = {
{AUDIO_CODING_MSBC, OVERLAY_AEC },
{AUDIO_CODING_CVSD, OVERLAY_AEC },
/* {AUDIO_CODING_M4A, OVERLAY_M4A }, */
/* {AUDIO_CODING_ALAC, OVERLAY_M4A }, */
{AUDIO_CODING_AAC, OVERLAY_M4A },
};
void overlay_load_code(u32 type)
{
int i = 0;
for (i = 0; i < ARRAY_SIZE(ctype); i++) {
if (type == ctype[i].type) {
if (ctype[i].dst != 0) {
memcpy((void *)ctype[i].dst, (void *)ctype[i].src, (int)ctype[i].size);
}
break;
}
}
}
void audio_overlay_load_code(u32 type)
{
int i = 0;
for (i = 0; i < ARRAY_SIZE(aotype); i++) {
if (type == aotype[i].atype) {
overlay_load_code(aotype[i].otype);
}
}
}