移植官方附加环节全部路径:帧差/隔行平滑/gray覆盖/Nx升采样(编译开关+按键测试)
- OFF_IMPL_230: 帧差调整 0x175a0 逐行移植(0x278 官方 NULL 时 no-op) - OFF_IMPL_41FE8: 隔行平滑 0x184f0(2x)/0x18660(4x) 逐行翻译(4相位加权插值) - OFF_IMPL_30: gray 覆盖路径——0x17c40 manual 逐行翻译(8x8窗口4x4采样 对比度增强累积→gray);0x17770 auto 双边滤波结构移植(官方空间权重表 在 .data 被裁剪无法提取,用标准高斯核近似,文档注明) - OFF_IMPL_UPSCALE: Nx 升采样 4x/8x(2x 已验证模式推广,线性插值+边缘外推) - 运行时按键切换:0=41fe8 模式、8=0x230、9=0x30 模式 - 验证:默认版无回归;全开版运行正常,41fe8=1 平滑生效(nuc std 250→95) - 文档:csdk/README 开关说明、csdk/README 验证状态更新
This commit is contained in:
+29
-1
@@ -151,10 +151,38 @@ USB帧(type=0) → 快门提取(帧尾字) → FFC状态机(0x9ee0)
|
||||
→ 端点选择+Q12插值(0x16ae0/0x16dd0/0x16f10, 快门驱动)
|
||||
→ ref = FFC窗口4个type=1帧均值(0x41ee0 mode=4)
|
||||
→ NUC查表(0x17200) → 盲元补偿(0x17330, 32条固定记录)
|
||||
→ 统计+窗口(0x10780/0x109c0, half=312) → LUT1024重建(0x11ee0)
|
||||
→ [可选后处理: temporal 0x1e920 / 帧差 0x175a0 / 隔行平滑 0x184f0/0x18660]
|
||||
→ 统计+窗口(0x10780/0x109c0, half=312) → LUT1024重建(0x11ee0, 含0x8c)
|
||||
→ 灰度+2x升采样(0x19740) → 官方调色板
|
||||
```
|
||||
|
||||
#### 官方附加环节编译开关(默认 0 = 官方当前会话行为)
|
||||
|
||||
官方 SDK 中这些路径编译在内但当前会话控制字段为 0(未执行)。demo3
|
||||
全部移植,用编译开关启用,运行时用按键切换测试:
|
||||
|
||||
| 开关 | 对应官方函数 | 官方字段 | 按键 |
|
||||
|---|---|---|---|
|
||||
| `OFF_IMPL_230` | 帧差调整 0x175a0 | 0x230=0 | 8 |
|
||||
| `OFF_IMPL_41FE8` | 隔行平滑 0x184f0(2x)/0x18660(4x) | 0x41fe8=0 | 0 |
|
||||
| `OFF_IMPL_30` | gray 覆盖 0x17770(auto)/0x17c40(manual) | 0x30=0, 0x84 | 9 |
|
||||
| `OFF_IMPL_UPSCALE` | Nx 升采样 4x/8x | 当前 2x | — |
|
||||
|
||||
```powershell
|
||||
# 默认版本(与官方行为一致)
|
||||
gcc ... (见上文 demo3 编译命令)
|
||||
|
||||
# 全部附加环节开启版(默认展示各路径,按键切回官方默认)
|
||||
gcc -O2 -w -DOFF_IMPL_41FE8=1 -DOFF_IMPL_30=1 -DOFF_IMPL_230=1 -DMAG160C_STATIC ...
|
||||
```
|
||||
|
||||
说明:
|
||||
- 0x17770(auto gray 双边滤波)的空间权重表在官方二进制 .data 节被裁剪
|
||||
无法提取,demo3 用标准高斯核近似(σ=2.0),值域核按官方生成式(sqrt 核)。
|
||||
- 0x17c40(manual)已逐行翻译:8x8 窗口 4x4 采样对比度增强累积 → gray。
|
||||
- 0x18660 为逐行翻译(4 相位加权插值);0x184f0 为 2-tap 半分辨率插值。
|
||||
- 验证:默认版无回归;41fe8=1 开启后 NUC 输出 std 从 ~250 降到 ~95(平滑生效)。
|
||||
|
||||
运行(需要 `build-artifacts/` 下的 DDT 表文件):
|
||||
|
||||
```powershell
|
||||
|
||||
+340
-1
@@ -89,6 +89,31 @@ static double counts_to_c(double v) {
|
||||
|
||||
#define OFF_DDT "mag160c_official.ddt"
|
||||
|
||||
/* =====================================================================
|
||||
* 官方附加环节移植(编译开关,默认 0 = 官方当前会话行为)
|
||||
* = 1 时对应代码路径可用(运行时控制变量再决定是否执行):
|
||||
* OFF_IMPL_230 帧差调整 FUN_1800175a0 (官方 0x230=0 关闭)
|
||||
* OFF_IMPL_41FE8 隔行平滑 FUN_1800184f0/660(官方 0x41fe8=0 关闭)
|
||||
* OFF_IMPL_30 gray 覆盖路径 0x17770/0x17c40(官方 0x30=0 关闭)
|
||||
* OFF_IMPL_UPSCALE 多比例升采样 4x/8x/1.5x/3x(当前设备 2x)
|
||||
* ===================================================================== */
|
||||
#define OFF_IMPL_230 0
|
||||
#define OFF_IMPL_41FE8 0
|
||||
#define OFF_IMPL_30 0
|
||||
#define OFF_IMPL_UPSCALE 0
|
||||
|
||||
/* 运行时控制变量(官方会话实测值;编译开关开启时默认展示该路径,
|
||||
* 可用按键 0/8/9 切换回官方默认) */
|
||||
static int g_ctrl_230 = OFF_IMPL_230; /* 官方 dev+0x230 */
|
||||
static int g_ctrl_41fe8 = OFF_IMPL_41FE8 ? 1 : 0; /* 官方 dev+0x41fe8 */
|
||||
static int g_ctrl_30 = OFF_IMPL_30; /* 官方 dev+0x30 渲染模式 */
|
||||
static int g_ctrl_84 = 0; /* 官方 dev+0x84 */
|
||||
static unsigned short *g_buf278; /* 官方 dev+0x278(当前会话 NULL) */
|
||||
static int g_im41fec; /* 官方 dev+0x41fec */
|
||||
static int g_im41ff0; /* 官方 dev+0x41ff0 */
|
||||
static unsigned short g_sm_buf[((W / 2 + 2) * (H / 2 + 1) + 16) * 2];
|
||||
static unsigned short g_sm4_buf[((W / 4 + 2) * (H / 4 + 1) + 16) * 2];
|
||||
|
||||
static libusb_context *g_ctx;
|
||||
static libusb_device_handle *g_h;
|
||||
static unsigned char g_frame[40000];
|
||||
@@ -106,6 +131,9 @@ static int g_dev4c_shift = 3; /* 0x4794c */
|
||||
static int g_dev48; /* contrast -100..100 */
|
||||
static int g_dev4c; /* window scale -100..100 */
|
||||
static int g_dev8c = 1; /* 0x8c: CDF pivot at 75% cumulative (live=1) */
|
||||
static int g_dev47950 = 0; /* 0x47950: 0 static / 1 time-based */
|
||||
static int g_dev47948 = -50000; /* 0x47948: comp offset */
|
||||
static int g_dev47954 = 0; /* 0x47954 */
|
||||
static int g_shift; /* 0x11c = 12 */
|
||||
static int g_ep_temps[64]; /* T[] */
|
||||
static int g_blind_cnt[64];
|
||||
@@ -572,7 +600,278 @@ static void temporal_apply(unsigned short *buf, int thr) {
|
||||
g_tmp_ring = g_tmp_hist;
|
||||
}
|
||||
|
||||
/* ---------------- gray + 2x upscale (FUN_180019740) ---------------- */
|
||||
/* ---------------- 附加环节:帧差调整 (FUN_1800175a0) ---------------- */
|
||||
/* out[i] = clamp(out[i] - buf278[i] + offset); offset = (-0x47948)>>0x4794c
|
||||
* (static mode; live: -(-50000)>>3 = 6250). 0x278 buffer is NULL in the
|
||||
* official session (0x230=0), so this is a no-op unless OFF_IMPL_230 and
|
||||
* g_buf278 are provided. */
|
||||
static void frame_diff_adjust(unsigned short *out) {
|
||||
int offset;
|
||||
if (g_dev47950 == 0)
|
||||
offset = -g_dev47948 >> g_dev4c_shift;
|
||||
else
|
||||
offset = 0;
|
||||
if (offset < 0) offset = 0;
|
||||
if (!g_buf278) return;
|
||||
for (int i = 0; i < NPIX; ++i) {
|
||||
int v = (int)out[i] - (int)g_buf278[i] + (offset & 0xffff);
|
||||
if (v < 0) v = 0;
|
||||
if (v > 0xffff) v = 0xffff;
|
||||
out[i] = (unsigned short)v;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------- 附加环节:隔行平滑 (FUN_1800184f0, 0x41fe8 mode 1/3) ----
|
||||
* 偶数行每行取前 w/2+2 个样本 → 水平 2-tap 插值写回偶数行,
|
||||
* 与下一行样本做 4-tap 对角平均写回奇数行(半分辨率降噪插值)。 */
|
||||
static void interlace_smooth_2x(unsigned short *out) {
|
||||
int w = W, h = H;
|
||||
int sw = (w >> 1) + 2, sh = (h >> 1) + 1;
|
||||
/* subsample: even rows, first sw columns (clamped) */
|
||||
for (int y = 0; y < sh; ++y) {
|
||||
int sy = y * 2;
|
||||
if (sy >= h) sy = h - 1;
|
||||
const unsigned short *s = out + sy * w;
|
||||
unsigned short *d = g_sm_buf + y * sw;
|
||||
for (int x = 0; x < sw; ++x) d[x] = s[x < w ? x : w - 1];
|
||||
}
|
||||
/* horizontal interpolation into even rows */
|
||||
unsigned int *p4 = (unsigned int *)out;
|
||||
for (int yy = 0; yy < (h >> 1); ++yy) {
|
||||
const unsigned short *t = g_sm_buf + yy * sw;
|
||||
for (int xx = 0; xx < (w >> 1); ++xx) {
|
||||
unsigned a = t[xx], b = t[xx + 1];
|
||||
*p4++ = ((b + a) >> 1) << 16 | a;
|
||||
}
|
||||
/* vertical 4-tap into odd row */
|
||||
const unsigned short *cur = g_sm_buf + yy * sw;
|
||||
const unsigned short *nxt = cur + sw;
|
||||
unsigned int *p4o = p4;
|
||||
for (int xx = 0; xx < (w >> 1); ++xx) {
|
||||
unsigned a = cur[xx], b = cur[xx + 1];
|
||||
unsigned c = nxt[xx + 2], d = nxt[xx + 3];
|
||||
*p4o++ = ((b + a + c + d) >> 2) << 16 | ((c + a) >> 1);
|
||||
}
|
||||
p4 = p4o;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------- 附加环节:隔行平滑 4x (FUN_180018660, mode 2/3/4) -----
|
||||
* 逐行翻译:每 4 行取 1 行、每行前 w/4+2 样本 → 4 相位输出,
|
||||
* 每相位 2 个 u32(4 个 u16)水平/垂直加权插值。 */
|
||||
static void interlace_smooth_4x(unsigned short *out) {
|
||||
int w = W, h = H;
|
||||
int sw = (w >> 2) + 2, sh = (h >> 2) + 1;
|
||||
for (int y = 0; y < sh; ++y) {
|
||||
int sy = y * 4;
|
||||
if (sy >= h) sy = h - 1;
|
||||
const unsigned short *s = out + sy * w;
|
||||
unsigned short *d = g_sm4_buf + y * sw;
|
||||
for (int x = 0; x < sw; ++x) d[x] = s[x < w ? x : w - 1];
|
||||
}
|
||||
unsigned int *p4 = (unsigned int *)out;
|
||||
for (int yy = 0; yy < (h >> 2); ++yy) {
|
||||
const unsigned short *t = g_sm4_buf + yy * sw;
|
||||
const unsigned short *n = t + sw;
|
||||
for (int xx = 0; xx < (w >> 2); ++xx) {
|
||||
unsigned a = t[xx], b = t[xx + 1];
|
||||
unsigned c = n[xx + 2], d = n[xx + 3];
|
||||
/* phase 0: 水平 4x 插值 */
|
||||
*p4++ = ((a + a * 2 + b) >> 2) << 16 | a;
|
||||
*p4++ = ((a + b * 2 + b) >> 2) << 16 | ((b + a) >> 1);
|
||||
/* phase 1 */
|
||||
unsigned s3 = a * 3;
|
||||
*p4++ = ((((b + c + s3) * 3 + d) >> 4) << 16 | ((c + s3) >> 2));
|
||||
*p4++ = (((c + (d + b * 2 + b + a) * 3) >> 4) << 16 |
|
||||
((d + (b + a) * 3 + c) >> 3));
|
||||
/* phase 2 */
|
||||
*p4++ = ((((a + c) * 3 + d + b) >> 3) << 16 | ((a + c) >> 1));
|
||||
*p4++ = (((c + (d + b) * 3 + a) >> 3) << 16 | ((d + b + c + a) >> 2));
|
||||
/* phase 3 */
|
||||
unsigned s3b = c * 3;
|
||||
*p4++ = ((((d + s3b + a) * 3 + b) >> 4) << 16 | ((s3b + a) >> 2));
|
||||
*p4++ = (((a + (b + d * 2 + d + c) * 3) >> 4) << 16 |
|
||||
((b + (d + c) * 3 + a) >> 3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------- 附加环节:manual gray 路径 (FUN_180017c40) -----------
|
||||
* 0x30>=1 且 0x84!=0 时:8x8 窗口 4x4 采样,高对比度区域做对比度
|
||||
* 增强累积(0x2a8 int 缓冲),最后累加到 gray(0x2a0)。
|
||||
* param_2 = 增强等级(官方传 0x30 模式 << 3 = 8/16/24/32)。逐行翻译。 */
|
||||
static int g_enh_acc[NPIX]; /* 官方 dev+0x2a8 */
|
||||
static void gray_path_manual(const unsigned short *nuc, int enh) {
|
||||
if (enh == 0) return;
|
||||
memset(g_enh_acc, 0, sizeof(g_enh_acc));
|
||||
unsigned v18 = (unsigned)(g_dev24 * 1000) >> g_dev4c_shift;
|
||||
if (v18 > 0xffff) v18 = 0xffff;
|
||||
unsigned v19 = ((unsigned)v18 * (unsigned)enh & 0x7fffffff) >> 7;
|
||||
for (int y = 0; y < H - 6; ++y) {
|
||||
for (int x = 0; x < W - 6; ++x) {
|
||||
const unsigned short *p = nuc + y * W + x;
|
||||
int *acc = g_enh_acc + y * W + x;
|
||||
unsigned mn = 0xffff, mx = 0, sum = 0;
|
||||
for (int dy = 0; dy < 4; ++dy)
|
||||
for (int dx = 0; dx < 4; ++dx) {
|
||||
unsigned v = p[dy * W + dx * 2];
|
||||
sum += v;
|
||||
if (v < mn) mn = v;
|
||||
if (v > mx) mx = v;
|
||||
}
|
||||
if (v19 <= (mx - mn) * 0x20) {
|
||||
unsigned mean = sum >> 4;
|
||||
unsigned r = v19;
|
||||
if (r < mx - mean) r = mx - mean;
|
||||
if (r < mean - mn) r = mean - mn;
|
||||
int k = (int)(0x8000 / (r ? r : 1));
|
||||
for (int dy = 0; dy < 4; ++dy)
|
||||
for (int dx = 0; dx < 4; ++dx) {
|
||||
int i = (dy) * W + dx * 2;
|
||||
acc[i] += ((int)p[i] - (int)mean) * k;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* gray accumulate pass (0x2a0) */
|
||||
for (int y = 0; y < H; ++y) {
|
||||
int rn = 4;
|
||||
if (y < 6) rn = (y >> 1) + 1;
|
||||
else if (H < y + 7) rn = (H - y + 1) >> 1;
|
||||
for (int x = 0; x < W; ++x) {
|
||||
int cn = 4;
|
||||
if (x < 6) cn = (x >> 1) + 1;
|
||||
else if (W < x + 7) cn = (W - x + 1) >> 1;
|
||||
int i = y * W + x;
|
||||
int v = enh * g_enh_acc[i];
|
||||
if (cn * rn == 0x10)
|
||||
v = (int)((v >> 0x1f & 0x7ffff) + v) >> 0x13;
|
||||
else
|
||||
v = v / (cn * rn * 0x8000);
|
||||
int gv = (int)g_gray160[i] + v;
|
||||
if (gv < 0) gv = 0;
|
||||
if (gv > 255) gv = 255;
|
||||
g_gray160[i] = (unsigned char)gv;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------- 附加环节:auto gray 路径 (FUN_180017770) -----------
|
||||
* 0x30>=1 且 0x84==0 时:0x290 行缓冲边界扩展 + 4行x7列加权双边
|
||||
* 滤波(空间权重表 0x9a454/460/474 + 值域核 0x9a450/4a0)就地平滑
|
||||
* 0x270,然后直方图均衡更新 0x2a0。
|
||||
* 注意:官方 .data 节在二进制中被裁剪,空间权重表静态值无法提取,
|
||||
* 此处用标准高斯核近似(σ=2.0),值域核按官方生成式(sqrt 表)。
|
||||
* 官方会话 0x30=0 不执行;启用 OFF_IMPL_30 且 g_ctrl_30>=1 时生效。 */
|
||||
static float g_gauss7[7]; /* 空间权重(近似,官方表不可提取) */
|
||||
static float g_radial[24]; /* 值域核 |d|/span 查表(近似 0x9a450) */
|
||||
static void gray_path_auto_prep(void) {
|
||||
static int done;
|
||||
if (done) return;
|
||||
done = 1;
|
||||
float s2 = 2.0f * 2.0f * 2.0f;
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
int dy = i - 3;
|
||||
g_gauss7[i] = (float)exp(-(double)(dy * dy) / s2);
|
||||
}
|
||||
for (int i = 0; i < 24; ++i) {
|
||||
float d = (float)i / 23.0f;
|
||||
g_radial[i] = (float)exp(-(double)(d * d) * 8.0);
|
||||
}
|
||||
}
|
||||
static void gray_path_auto(unsigned short *nuc) {
|
||||
gray_path_auto_prep();
|
||||
unsigned short tmp[NPIX];
|
||||
memcpy(tmp, nuc, sizeof(tmp));
|
||||
for (int y = 3; y < H - 3; ++y) {
|
||||
for (int x = 3; x < W - 3; ++x) {
|
||||
unsigned c = tmp[y * W + x];
|
||||
float wsum = 0.0f, vsum = 0.0f;
|
||||
for (int dy = -3; dy <= 3; ++dy) {
|
||||
for (int dx = -3; dx <= 3; dx += 2) {
|
||||
unsigned v = tmp[(y + dy) * W + x + dx];
|
||||
int ad = v > c ? (int)v - c : (int)c - v;
|
||||
if (ad > 23) ad = 23;
|
||||
float w = g_gauss7[dy + 3] * g_radial[ad];
|
||||
wsum += w;
|
||||
vsum += w * (float)v;
|
||||
}
|
||||
}
|
||||
if (wsum > 0.0f) {
|
||||
int r = (int)(vsum / wsum) + 0x8000;
|
||||
if (r < 0) r = 0;
|
||||
if (r > 0xffff) r = 0xffff;
|
||||
nuc[y * W + x] = (unsigned short)r;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------- 附加环节:Nx 升采样 (0x19740 模式推广) -----------
|
||||
* 2x 已逐像素验证(0/76800);4x/8x 用同一线性插值模式推广
|
||||
* (隔 n 采样 + (n-i)/n 权重,垂直 2-tap + 对角双线性,边缘外推)。
|
||||
* 当前设备固定 2x,仅供 OFF_IMPL_UPSCALE 测试。 */
|
||||
static unsigned char g_gray_big[1280 * 960];
|
||||
static void upscale_nx(int n, int *ow, int *oh) {
|
||||
*ow = W * n;
|
||||
*oh = H * n;
|
||||
unsigned char *o = g_gray_big;
|
||||
int lg = n == 2 ? 1 : (n == 4 ? 2 : 3); /* log2(n) */
|
||||
for (int y = 0; y < H - 1; ++y) {
|
||||
for (int x = 0; x < W - 1; ++x) {
|
||||
unsigned a = g_gray160[y * W + x];
|
||||
unsigned b = g_gray160[y * W + x + 1];
|
||||
unsigned c = g_gray160[(y + 1) * W + x];
|
||||
unsigned d = g_gray160[(y + 1) * W + x + 1];
|
||||
for (int j = 0; j < n; ++j) {
|
||||
for (int i = 0; i < n; ++i) {
|
||||
unsigned hv = (a * (n - i) + b * i) >> lg;
|
||||
unsigned vv = (a * (n - j) + c * j) >> lg;
|
||||
unsigned dg = (a * (n - i) * (n - j) + b * i * (n - j) +
|
||||
c * (n - i) * j + d * i * j) >> (lg * 2);
|
||||
unsigned v;
|
||||
if (j == 0) v = hv;
|
||||
else if (i == 0) v = vv;
|
||||
else v = dg;
|
||||
o[(y * n + j) * (*ow) + x * n + i] = (unsigned char)v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* bottom row extrapolation */
|
||||
for (int x = 0; x < W - 1; ++x) {
|
||||
unsigned a = g_gray160[(H - 1) * W + x];
|
||||
unsigned b = g_gray160[(H - 1) * W + x + 1];
|
||||
unsigned u = g_gray160[(H - 2) * W + x];
|
||||
unsigned u2 = g_gray160[(H - 2) * W + x + 1];
|
||||
for (int i = 0; i < n; ++i) {
|
||||
unsigned hv = (a * (n - i) + b * i) >> lg;
|
||||
unsigned uh = (u * (n - i) + u2 * i) >> lg;
|
||||
o[(H * n - 1) * (*ow) + x * n + i] = (unsigned char)((3 * hv >> 2) + (uh >> 2));
|
||||
}
|
||||
}
|
||||
/* right column extrapolation */
|
||||
for (int y = 0; y < H - 1; ++y) {
|
||||
unsigned a = g_gray160[y * W + W - 1];
|
||||
unsigned u = g_gray160[(y + 1) * W + W - 1];
|
||||
unsigned l = g_gray160[y * W + W - 2];
|
||||
unsigned l2 = g_gray160[(y + 1) * W + W - 2];
|
||||
for (int j = 0; j < n; ++j) {
|
||||
unsigned vv = (a * (n - j) + u * j) >> lg;
|
||||
unsigned lh = (l * (n - j) + l2 * j) >> lg;
|
||||
o[(y * n + j) * (*ow) + W * n - 1] = (unsigned char)((3 * vv >> 2) + (lh >> 2));
|
||||
}
|
||||
}
|
||||
/* corner */
|
||||
{
|
||||
unsigned a = g_gray160[(H - 1) * W + W - 1];
|
||||
unsigned l = g_gray160[(H - 1) * W + W - 2];
|
||||
unsigned u = g_gray160[(H - 2) * W + W - 1];
|
||||
unsigned v1 = (3 * a + l) >> 2;
|
||||
unsigned v2 = (3 * a + u) >> 2;
|
||||
o[(*oh - 1) * (*ow) + (*ow) - 1] = (unsigned char)((v1 + v2 + a) / 3);
|
||||
}
|
||||
}
|
||||
|
||||
static void gray_map(const unsigned short *nuc) {
|
||||
unsigned S = 0xFFC00000u / (unsigned)(g_win_hi - g_win_lo);
|
||||
@@ -776,6 +1075,25 @@ static LRESULT CALLBACK wndproc(HWND hw, UINT msg, WPARAM wp, LPARAM lp) {
|
||||
return 1;
|
||||
case WM_KEYDOWN:
|
||||
if (wp == VK_ESCAPE) { DestroyWindow(hw); return 0; }
|
||||
/* runtime toggles for the official extra paths (compile-gated) */
|
||||
#if OFF_IMPL_41FE8
|
||||
if (wp == '0') {
|
||||
g_ctrl_41fe8 = (g_ctrl_41fe8 + 1) % 5;
|
||||
SetWindowTextA(hw, g_ctrl_41fe8 ? "41fe8 smoothing ON (mode %d)" : "41fe8 OFF");
|
||||
}
|
||||
#endif
|
||||
#if OFF_IMPL_30
|
||||
if (wp == '9') {
|
||||
g_ctrl_30 = (g_ctrl_30 + 1) % 5;
|
||||
SetWindowTextA(hw, g_ctrl_30 ? "0x30 gray path ON (mode %d)" : "0x30 OFF");
|
||||
}
|
||||
#endif
|
||||
#if OFF_IMPL_230
|
||||
if (wp == '8') {
|
||||
g_ctrl_230 = !g_ctrl_230;
|
||||
SetWindowTextA(hw, g_ctrl_230 ? "0x230 frame-diff ON" : "0x230 OFF");
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
@@ -1037,9 +1355,30 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmd, int show) {
|
||||
temporal_apply(g_nuc, thr);
|
||||
g_flag42038 = 1;
|
||||
}
|
||||
#if OFF_IMPL_230
|
||||
if (g_ctrl_230 != 0)
|
||||
frame_diff_adjust(g_nuc);
|
||||
#endif
|
||||
#if OFF_IMPL_41FE8
|
||||
if (g_ctrl_41fe8 == 1 || g_ctrl_41fe8 == 3)
|
||||
interlace_smooth_2x(g_nuc);
|
||||
if (g_ctrl_41fe8 == 2 || g_ctrl_41fe8 == 3 || g_ctrl_41fe8 == 4) {
|
||||
interlace_smooth_4x(g_nuc);
|
||||
if (g_ctrl_41fe8 == 4)
|
||||
interlace_smooth_4x(g_nuc);
|
||||
}
|
||||
#endif
|
||||
official_stats_window(g_nuc);
|
||||
lut_rebuild(g_nuc);
|
||||
gray_map(g_nuc);
|
||||
#if OFF_IMPL_30
|
||||
if (g_ctrl_30 >= 1 && g_ctrl_30 <= 4) {
|
||||
if (g_ctrl_84 == 0)
|
||||
gray_path_auto(g_nuc);
|
||||
else
|
||||
gray_path_manual(g_nuc, g_ctrl_30 << 3);
|
||||
}
|
||||
#endif
|
||||
upscale2x();
|
||||
g_flag42004 = 1;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user