app+csdk+docs: 按反汇编定案修复——官方安卓路径无 160→320 插值级(ImageViewer 无 FILTER_BITMAP 最近邻放大),我们的双线性 2× 自造交错细纹;实测冷区细条纹比 1.16/1.29→1.00/0.93,csdk 同加 upscale_nearest,119 单测全绿
This commit is contained in:
@@ -59,7 +59,7 @@ struct mag160c_render_t {
|
||||
mag160c_render_post_gray_cb_t post_gray_cb;
|
||||
void *post_gray_user;
|
||||
int ffc_period, ffc_drift, warm_frames, cdf_pivot_75, force75;
|
||||
int android_lut, fpa_temp_fix, lut_brightness;
|
||||
int android_lut, fpa_temp_fix, lut_brightness, upscale_nearest;
|
||||
};
|
||||
|
||||
static int counts_to_temp_mc(int counts) {
|
||||
@@ -524,6 +524,19 @@ static void upscale2x(mag160c_render_t *r) {
|
||||
const unsigned char *s = r->gray160;
|
||||
unsigned char *o = r->gray320;
|
||||
int W = r->w, H = r->h, W2 = W * 2;
|
||||
if (r->upscale_nearest) {
|
||||
/* Android parity: no interpolation stage (see mag160c_render.h) */
|
||||
for (int y = 0; y < H; ++y) {
|
||||
const unsigned char *row = s + y * W;
|
||||
unsigned char *o0 = o + y * W2 * 2, *o1 = o0 + W2;
|
||||
for (int x = 0; x < W; ++x) {
|
||||
unsigned char v = row[x];
|
||||
o0[x * 2] = v; o0[x * 2 + 1] = v;
|
||||
o1[x * 2] = v; o1[x * 2 + 1] = v;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (int y = 0; y < H - 1; ++y) {
|
||||
const unsigned char *r0 = s + y * W, *r1 = r0 + W;
|
||||
unsigned char *o0 = o + y * W2 * 2, *o1 = o0 + W2;
|
||||
@@ -667,6 +680,7 @@ mag160c_error_t mag160c_render_init(mag160c_render_t **out,
|
||||
r->android_lut = cfg->android_lut;
|
||||
r->fpa_temp_fix = cfg->fpa_temp_fix;
|
||||
r->lut_brightness = cfg->lut_brightness;
|
||||
r->upscale_nearest = cfg->upscale_nearest;
|
||||
r->force75 = cfg->startup_force_ffc;
|
||||
r->dev24 = 5;
|
||||
r->dev4c_shift = 3;
|
||||
|
||||
Reference in New Issue
Block a user