215: meow_font.c 流式分块解码(gbk峰值40→23.5MB, 逐字节校验一致) + 多字体槽5→4+16MB驻留预算; 量化: gbk稳态驻留17.3MB vs common 4.2MB(OOM主因); meow_font.a→67113c03 meow_ui.a→223d5401 216: bootmenu让位(sysui在则start launcher让位, 不在则exec兜底) + S70预置launcher.conf enabled=1(+旧设备升级迁移); launcher崩溃可自动拉起; bootmenu 4441822d / S70 e435affc / S90 e0ace111 216注: S70早启动与选单共存为真机重点观察项
33 lines
1.5 KiB
C
33 lines
1.5 KiB
C
/*
|
||
* test_plane_dump.c — 宿主解码正确性校验:把 meow_font 解码出的打包像素面 dump 成二进制,
|
||
* 供 Python 参考解码(zlib IDAT + 反滤波)逐字节比对,验证流式解码与参考解码完全一致。
|
||
* 需以 -DMEOW_FONT_ENABLE_DEBUG 编译 meow_font.c 暴露 meow_font_debug_plane。
|
||
*/
|
||
#include "meow_font.h"
|
||
#include <stdio.h>
|
||
#include <string.h>
|
||
|
||
/* 宿主调试钩子:定义于 meow_font.c(MEOW_FONT_ENABLE_DEBUG 下才编译);此测试自带声明。 */
|
||
extern const unsigned char *meow_font_debug_plane(int slot, unsigned *w, unsigned *h,
|
||
unsigned *depth, size_t *rowbytes);
|
||
|
||
int main(int argc, char **argv) {
|
||
if (argc < 4) { fprintf(stderr, "usage: %s <font.png> <font.idx> <out.raw>\n", argv[0]); return 2; }
|
||
int r = meow_font_load(argv[1], argv[2]);
|
||
if (r != 0) { fprintf(stderr, "load failed %d\n", r); return 1; }
|
||
unsigned w, h, depth; size_t rb;
|
||
const unsigned char *p = meow_font_debug_plane(0, &w, &h, &depth, &rb);
|
||
if (!p) { fprintf(stderr, "no plane\n"); return 1; }
|
||
size_t total = (size_t)rb * h;
|
||
FILE *f = fopen(argv[3], "wb");
|
||
if (!f) { return 1; }
|
||
/* 先写出几何头(小端),再写平面字节 */
|
||
unsigned hdr[5] = { w, h, depth, (unsigned)rb, (unsigned)total };
|
||
fwrite(hdr, sizeof(unsigned), 5, f);
|
||
fwrite(p, 1, total, f);
|
||
fclose(f);
|
||
printf("dumped w=%u h=%u depth=%u rowbytes=%zu bytes=%zu\n", w, h, depth, rb, total);
|
||
meow_font_unload();
|
||
return 0;
|
||
}
|