csdk: 与官方手机 App 对齐——工具关闭灰度 CDF pivot(实测同刻分布重合);温度链移植规格入 README(待有 C 编译器时落地)

This commit is contained in:
ZXCLI
2026-10-06 04:06:48 +08:00
parent 3b191e6bca
commit 7e1db78676
3 changed files with 28 additions and 3 deletions
+18 -1
View File
@@ -217,7 +217,7 @@ gray→2x→调色板),FFC 命令通过回调发给调用方(调用方持
```c
mag160c_render_cfg_t cfg = { .width = 160, .height = 120,
.ddt_path = "mag160c_official.ddt", .ffc_period = 1800,
.ffc_drift = 250, .startup_force_ffc = 1, .cdf_pivot_75 = 1,
.ffc_drift = 250, .startup_force_ffc = 1, .cdf_pivot_75 = 0, /* 官方手机 App 的取值 */
.ffc_cb = my_ffc_sender, .ffc_user = NULL };
mag160c_render_init(&r, &cfg);
/* 每帧: */
@@ -285,3 +285,20 @@ build-artifacts\csdk_test_display.exe
| `../交接_完整逆向工程说明_20260811.md` | 项目总交接(目录/环境/历史)|
| `WINDOWS_TESTING.md` | Windows 抓包与硬件测试指南 |
| `legacy/` | 历史工具源码归档(早期探索,功能已被现工具取代)|
## 与官方手机 App 的对齐(2026-10-06,从安卓侧验证后同步)
1. **灰度 CDF 的 75% pivot:工具已改为关闭(`cdf_pivot_75 = 0`)**。
实测(同一静止场景、同刻截图、调色板反解灰度):pivot 开时我们的灰度中位 33 / 均值 60,
官方手机 App 是 61 / 82;关掉后为 50–54 / 80–81(与官方重合)。库保留该开关,
`analysis/render_offline.c` 生成黄金夹具时仍用 1(Kotlin 对齐测试用同一配置)。
证据与数据:`docs/android_app/rendering_diff_phone_20261006.md`。
2. **温度换算待移植**:官方对这台设备走的是"放射学分支"(每波段线性映射 + 环境温度误差修正
+ 发射率/透过率 revise),不是本 SDK 现在用的 T2E 表分支。完整反编译结论、伪代码与
参数来源见 `docs/android_app/temperature_chain_re_20261006.md`(§4d 可直接落地,
已用 15 帧官方同帧数据验证到平均 13.9 mC)。C 侧还需要:
- DDT 尾部辐射标定记录的解析(阈值/gain/offset/shift/±500/eps,偏移表见该文档 §4d);
- BasePara2 的 `ATZeroErrorPoint`/`ATErrorSlope`/`fpaTempFix`(线上偏移同样见该文档);
- 曲线 A 与本 SDK 的 `T2E` 表相同(646 项,已验证逐项一致)。
注:本机当前**没有 C 编译器**(gcc/clang 均缺失),以上 C 改动需在有编译器的环境里
编译 + 跑 csdk 测试后再提交。
+5 -1
View File
@@ -605,7 +605,11 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmd, int show) {
cfg.ffc_drift = 250;
cfg.startup_force_ffc = 1;
cfg.warm_frames = 20;
cfg.cdf_pivot_75 = 1;
/* Official PHONE app runs the gray CDF WITHOUT the 75% pivot: with it on the
rendering is measurably darker than the official app (gray median 33 vs 61,
mean 60 vs 82 in a same-moment on-device comparison); off matches (50-54 vs 61,
80-81 vs 82). See docs/android_app/rendering_diff_phone_20261006.md. */
cfg.cdf_pivot_75 = 0;
cfg.ffc_cb = ffc_cb;
cfg.post_nuc_cb = post_nuc_cb;
cfg.post_gray_cb = post_gray_cb;
+5 -1
View File
@@ -125,7 +125,11 @@ int main(int argc, char **argv) {
cfg.ffc_drift = 250;
cfg.startup_force_ffc = 1;
cfg.warm_frames = 20;
cfg.cdf_pivot_75 = 1;
/* Official PHONE app runs the gray CDF WITHOUT the 75% pivot: with it on the
rendering is measurably darker than the official app (gray median 33 vs 61,
mean 60 vs 82 in a same-moment on-device comparison); off matches (50-54 vs 61,
80-81 vs 82). See docs/android_app/rendering_diff_phone_20261006.md. */
cfg.cdf_pivot_75 = 0;
cfg.ffc_cb = ffc_cb;
mag160c_render_t *render = NULL;
if (mag160c_render_init(&render, &cfg) != MAG160C_OK) {