Repository navigation
gk7206v100: SC465SL image tuning and its AI noise reduction network - #2905
Conversation
On a GK7206V11 + SC465SL every ISP block ran on the ISP library's generic defaults -- the SDK publishes no tuning for this sensor -- and the picture was far noisier and bluer than the stock Xiongmai firmware's on the same camera. Two files close that: - /etc/sensors/iq/sc465sl.bin (goke-osdrv-gk7206v100): an SDK PQ bin, the ISP, AE and AWB parameter blocks xmedia_isp_import() loads, carrying the tuning the vendor firmware applies to this sensor (Xiongmai IPC_GK7206V11_K8, V1.10.T02.20261103): its per-ISO noise reduction, sharpening, demosaic, defect-pixel, gamma, DRC, dehaze, LCE and colour tables, AWB calibration and AE compensation curve, over the SDK's defaults. majestic reads /etc/sensors/iq/<sensor>.bin by default (isp.iqProfile). - /usr/share/aiisp/sc465sl/ainr_2560x1440.xmm (hisilicon-opensdk, bumped to 560559da, which adds the SDK's networks beside the sensor drivers): the AINR network the ISP runs on the NPU, byte-identical to the one the vendor firmware ships. Only SC465SL is installed, the sensor measured on a camera. Tested on an XM IVG-K8 (GK7206V11 + SC465SL) beside a stock one, dark storeroom: with both files at these paths, from a cold start, the same picture as the stock camera (125 ms / 8 fps, ISO ~19500 vs ~21000, AINR active). gk7206v100_lite builds: squashfs 4600K, firmware.bin 6656/7616K.
PR Summary by QodoAdd SC465SL image tuning and AI noise reduction for GK7206V100
AI Description
Merge Risk
|
Code Review by Qodo
1. Ships a vendor-extracted tuning binary
|
…P state The first export took the noise-reduction and sharpening tables from an emulation of the vendor application's init path, which misses what it rewrites at run time. Running the whole stock firmware in the gk7206v11a QEMU twin and exporting there gives tables that, at a stock camera's ISO, reproduce what that camera reports live (TNR thresholds, chroma strength, sharpen texture and overshoot); the old ones did not. On an IVG-K8 at ISO ~20000: visibly less grain, the stock look.
|
Updated |
…rk; sc465sl.bin provenance The [isp_ainr] model path pointed at /usr/lib/sensors, where nothing installs a network; hisilicon-opensdk installs it under /usr/share/aiisp/sc465sl. The comment on sc465sl.bin now names the tool that regenerates it and records that it is interim, to be replaced by a text profile built from source.
|
Review follow-up (1ead5b4):
|
… PQ bin (#344) * tools: xm-isp-tuning -- a Xiongmai camera's ISP tuning out of a dump, as an SDK PQ bin Xiongmai's firmware for GK7206V1 cameras tunes the ISP from per-sensor tables compiled into its App; the XMedia SDK publishes no tuning for most sensors, so firmware running the SDK alone gets the ISP library's generic defaults -- on an IVG-K8 (GK7206V11 + SC465SL) a far noisier, bluer picture than the stock firmware's on the same board. xm-isp-capture.py runs the stock App's ISP monitor thread under Unicorn (libc stubbed, the statically linked SDK returning 0, the SDK's attribute setters and getters caught) and records what the App puts in force, block by block, as the SDK's own structures. xm-isp-finish drops what the App sets at run time instead of from tables; on the camera attrtool applies the set, ae-ainr the AE curve and AINR switch points, and pqexport writes the PQ bin xmedia_isp_import() loads. The addresses for one App build (V1.10.T02.20261103) are a JSON profile. Measured: applied to an OpenIPC IVG-K8 beside a stock one in low light (ISO ~20000, 125 ms), the same picture; re-running the capture reproduces the set behind the SC465SL profile in OpenIPC/firmware#2905 byte for byte; the camera tools run on the board as built. * tools/xm-isp-tuning: export the live ISP state from the stock firmware in the twin Booting the stock GK7206V11 firmware in gk7206v11a and dumping the ISP there gives the App's runtime tables, which the Unicorn capture misses for STNR, BNR temporal, sharpen and LCE. Checked against a stock camera's /proc/umap/isp at two ISOs. * tools/xm-isp-tuning: review fixes - attrtool: creates the dump directory, writes no block for a failed getter, checks its writes, exits non-zero on any failed get, set or missing file, and logs line by line (a crashing getter -- smart_info under the stock App -- no longer swallows the log). - ae-ainr: reports the AE and AINR results separately and fails if either did; no uninitialised AINR fields on a failed read. - xm-isp-finish: creates its output directory. - build.sh: a failed compile fails the build instead of keeping an old binary; with SDK_STATIC it also builds the static tools the twin route types in (camera/sdkshim_static.c, the uClibc gaps of the SDK's static objects). - xm-twin-export.py: writes <block>.bin as xm-isp-finish reads them; checks each command's exit status; verifies every file against hexout's length and checksum, re-requesting damaged ones (the App's log can cut a hex line); requires the PQ export and the NR/sharpen blocks; lists the dump with a shell loop (this busybox colours ls); sets xmuart=0 in a copy of the flash itself, keeping every other saved variable. Two full twin runs give byte-identical ISP blocks, and the README's route (export, AWB from the capture, finish) reproduces the shipped sc465sl set exactly. * tools/xm-isp-tuning: attrtool apply refuses a block name it does not know
On a GK7206V11 + SC465SL every ISP block ran on the ISP library's generic
defaults -- the SDK publishes no tuning for this sensor -- and the picture
was far noisier and bluer than the stock Xiongmai firmware's on the same
camera. Two files close that:
ISP, AE and AWB parameter blocks xmedia_isp_import() loads, carrying the
tuning the vendor firmware applies to this sensor (Xiongmai
IPC_GK7206V11_K8, V1.10.T02.20261103): its per-ISO noise reduction,
sharpening, demosaic, defect-pixel, gamma, DRC, dehaze, LCE and colour
tables, AWB calibration and AE compensation curve, over the SDK's
defaults. majestic reads /etc/sensors/iq/.bin by default
(isp.iqProfile).
560559da, which adds the SDK's networks beside the sensor drivers): the
AINR network the ISP runs on the NPU, byte-identical to the one the
vendor firmware ships. Only SC465SL is installed, the sensor measured on
a camera.
Tested on an XM IVG-K8 (GK7206V11 + SC465SL) beside a stock one, dark
storeroom: with both files at these paths, from a cold start, the same
picture as the stock camera (125 ms / 8 fps, ISO ~19500 vs ~21000, AINR
active). gk7206v100_lite builds: squashfs 4600K, firmware.bin 6656/7616K.