Commit df0ac36a authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: GpuQuadJna getCltSize/getNumTiles/setCltData + native tp_proc_set_clt (CLT restore path)

convertCenterClt -> setComboToTD -> setCltData pushes the restored center CLT to GPU; base getCltSize/
getNumTiles deref null gpu_clt_wh. Override to full-frame dims; setCltData -> new tp_proc_set_clt
(HtoD per-cam slice, inverse of tp_proc_get_clt). Fixes the third JNA NPE (getCltSize:1211).
Co-Authored-By: 's avatarClaude Opus 4.8 (1M context) <noreply@anthropic.com>
parent e0ee9e2a
...@@ -66,6 +66,24 @@ public class GpuQuadJna extends GpuQuad { ...@@ -66,6 +66,24 @@ public class GpuQuadJna extends GpuQuad {
// Native re-uploads bayer each convert_direct -> nothing to reset (base clears the null gpuTileProcessor flag). // Native re-uploads bayer each convert_direct -> nothing to reset (base clears the null gpuTileProcessor flag).
@Override public void resetBayer() { /* no-op for the native backend */ } @Override public void resetBayer() { /* no-op for the native backend */ }
// CLT sizing (base derefs null gpu_clt_wh) — full-frame dims; matches TpProc's slice.
@Override public int getCltSize(boolean use_ref) {
int tilesX = img_width / getDttSize(), tilesY = img_height / getDttSize();
return tilesY * tilesX * num_colors * 4 * getDttSize() * getDttSize();
}
@Override public int getNumTiles(boolean use_ref) {
return (img_width / getDttSize()) * (img_height / getDttSize());
}
// Push a per-cam CLT slice to the device (e.g. CLT restore via setComboToTD).
@Override public void setCltData(int ncam, float[] fclt, boolean use_ref) {
int clt_size = getCltSize(use_ref);
if (fclt.length != clt_size) {
System.out.println("GpuQuadJna.setCltData(): wrong size got " + fclt.length + " expected " + clt_size);
return;
}
lib.tp_proc_set_clt(proc, ncam, fclt, use_ref ? 1 : 0);
}
/** Native handles for the override implementations (added incrementally). */ /** Native handles for the override implementations (added incrementally). */
protected TpJna lib() { return lib; } protected TpJna lib() { return lib; }
protected Pointer module() { return module; } protected Pointer module() { return module; }
......
...@@ -78,6 +78,7 @@ public interface TpJna extends Library { ...@@ -78,6 +78,7 @@ public interface TpJna extends Library {
/** convert_direct: ref_scene (0/1 -> clt vs clt_ref), erase_clt (-1/0/1), no_kernels (0/1). */ /** convert_direct: ref_scene (0/1 -> clt vs clt_ref), erase_clt (-1/0/1), no_kernels (0/1). */
int tp_proc_exec_convert_direct(Pointer proc, int refScene, int eraseClt, int noKernels); int tp_proc_exec_convert_direct(Pointer proc, int refScene, int eraseClt, int noKernels);
int tp_proc_get_clt(Pointer proc, int cam, int refScene, float[] out); int tp_proc_get_clt(Pointer proc, int cam, int refScene, float[] out);
int tp_proc_set_clt(Pointer proc, int cam, float[] data, int refScene);
/** Allocate imclt(RBG) + correlation buffers and store corr config. */ /** Allocate imclt(RBG) + correlation buffers and store corr config. */
int tp_proc_setup_rbg_corr(Pointer proc, int numPairs, int s0,int s1,int s2,int s3, int tp_proc_setup_rbg_corr(Pointer proc, int numPairs, int s0,int s1,int s2,int s3,
float cw0,float cw1,float cw2, int corrOutRad); float cw0,float cw1,float cw2, int corrOutRad);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment