fix: align tracker preprocessing and shared object lifecycle with native evidence
这个提交包含在:
1 父节点
9ba6eeb00a
当前提交
a0a97dfd88
14 个文件已更改
+312
-47
没有与搜索条件相匹配的文件
@@ -50,11 +50,11 @@ kernel void dyTrackFlow(device const float*prev[[buffer(0)]],device const float*
|
||||
if(lane==0)results[idx]=float4(q,error,ok?1.f:0.f);
|
||||
}
|
||||
|
||||
// Full host frame -> top-first display luma. Low-pass the source footprint
|
||||
// before decimation so 4K fabric detail cannot alias into inconsistent motion.
|
||||
// This analysis-only image never changes the full-resolution color render.
|
||||
kernel void dyToolEncodeGamma22(texture2d<float,access::read> source [[texture(0)]],texture2d<float,access::write> output [[texture(1)]],uint2 pos [[thread_position_in_grid]]){
|
||||
if(pos.x>=output.get_width()||pos.y>=output.get_height())return;float4 pixel=source.read(pos);float alpha=max(pixel.a,0.f);float3 straight=alpha>0?pixel.rgb/alpha:float3(0);output.write(float4(pow(max(straight,float3(0)),float3(1.f/2.2f))*alpha,alpha),pos);
|
||||
}
|
||||
// Lanczos RGBA8 -> top-first OpenCV Gray8. Analysis never changes color output.
|
||||
kernel void dyToolCapture(texture2d<float> source [[texture(0)]],device float* pixels [[buffer(0)]],constant uint3& info [[buffer(1)]],uint2 pos [[thread_position_in_grid]]){
|
||||
if(pos.x>=info.x||pos.y>=info.y)return;constexpr sampler f(coord::normalized,address::clamp_to_edge,filter::linear);uint2 taps=clamp(uint2(ceil(float2(source.get_width(),source.get_height())/float2(info.xy))),uint2(1),uint2(8));float sum=0;
|
||||
for(uint y=0;y<taps.y;y++)for(uint x=0;x<taps.x;x++){float2 uv=(float2(pos)+(float2(x,y)+.5f)/float2(taps))/float2(info.xy);if(info.z)uv.y=1-uv.y;float4 sample=source.sample(f,uv);float3 linear=sample.a>0?sample.rgb/sample.a:float3(0);float3 encoded=select(1.055f*pow(max(linear,float3(0)),float3(1.f/2.4f))-.055f,linear*12.92f,linear<=.0031308f);sum+=dot(clamp(encoded,0.f,1.f),float3(.299f,.587f,.114f));}
|
||||
pixels[pos.y*info.x+pos.x]=sum/float(taps.x*taps.y);
|
||||
if(pos.x>=info.x||pos.y>=info.y)return;uint2 point=uint2(pos.x,info.z?info.y-1-pos.y:pos.y);uint3 rgb=uint3(rint(source.read(point).rgb*255.f));
|
||||
pixels[pos.y*info.x+pos.x]=float((rgb.r*9798u+rgb.g*19235u+rgb.b*3735u+16384u)>>15)/255.f;
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户