Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.
C++
Verify NR protection feather and partial tiled boundaries
Veyra Goal Agent3d73860662e3
diff --git a/docs/REVIEW_NR_PROTECTION_2026-09-08.md b/docs/REVIEW_NR_PROTECTION_2026-09-08.mdindex 63cb53d8..cc163048 100644--- a/docs/REVIEW_NR_PROTECTION_2026-09-08.md+++ b/docs/REVIEW_NR_PROTECTION_2026-09-08.md@@ -9,3 +9,15 @@ Final independent preflight PASS; phase7 logs/delivery/a178db7f0e0e4a4a8555d0b66Initial reviewer setup failures (wrong input path, hidden root) are retained in ignored logs; correct visible launch passed. Final tracked fingerprint9af8dfb05978f33ef832e1c557e0a76e2d9e77a4 unchanged. Untracked overlay initially independently reviewed hash390809D9DEF189952B86B8235C6D7005283AF77BC535DAAD3ED4211C3A321713. GPU/preset code did not change in UI correction and was not redundantly rerun.Scope: manual NR change suppression only. No visual-design screenshot acceptance; feathered/partial-tile/natural/moving quality, SR/FG protection and privateUI resources still unproved. Q6/Q7 and physical capture remain open. This is not full Q5 or Goal approval.++## Cycle 66 - protection boundary diagnostics (2026-09-08)++Scoped test-only change in tests/integration/ImageDimensionTests.cpp: feather 2/32 pixels, disjoint regions, and partial 2561x2561 mask spanning central horizontal/vertical tile seams. No product code, export integrity or runtime changed.++Commands: scripts/build.ps1 -Root "$PWD" -Preset x64-release; scripts/loop-gate.ps1 -Gate preflight; logs/optimization-goal-20260908/run-image-tests.ps1 (275s watchdog); scripts/loop-gate.ps1 -Gate phase7. Build log build-protection-boundaries-final.log. Initial runs image-eeba5f9f5a934480ab91d3307fbdc74a (17.620s) and image-97deff3da67c4a3e94c731e561377964 (17.654s) failed a new test assertion: unsigned 192-x subtraction misclassified exterior pixels. Diagnostic per-mode evidence isolated the assertion; changed to 192.f-x, no product adjustment.++Maker image-262e170a7cef4014b6287f6c4c022f22 passed 21.828s. Independent review_protection_boundaries PASS with no introduced P0/P1/P2: preflight71; phase7 logs/delivery/d8846bbfe5d54b41b7b14327e8897975/result.json 41.695s/75checks; image-e8c7b9377cd94f68bd50fb189bd8b49c 21.916s. Actual Feature18 Create0x1 non-null SEH0; seven protection evaluations with original/baseline error0. Feather2/32 has 1581/15725 mixed channels, envelope error0. Partial nine-tile/nine-NR interior/exterior error0, envelope error1. Baseline comes from same run, dimensions verified.++Image-test SHA256 052F7DE99BB622DDF05F977D5431C8257F26330119CF7760072126C3DC655481. App remains 0654C61F11D9FC50436B964F385E4028E6458C4B9D186B6DCD5B0796C383B4F5. Reviewer tracked fingerprint f80219622037f7671d65046e14313267f9bb85ce unchanged.++Limits: these assertions prove endpoints and bounded nontrivial blending, not exact smoothstep or perceptual smoothness. Central seams covered, not every seam with a protected region. Moving HUD/temporal behavior, natural quality, SR/FG protection and private resource effectiveness remain unverified. Phase7 and full Goal remain in_progress. Next atomic task: moving-background/static-HUD protection matrix, then isolated optional NR resource contract; Q6 motion confidence/FG and Q7 candidate ROI remain pending.diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 866669d1..7b17e0cb 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -1171,3 +1171,15 @@ Cycle63 independent scoped PASS: docs/REVIEW_SR_CONTRACT_2026-09-08.md. phase7 1Protection reviewer initial FAILP2: dirty numeric draft / unchanged revision master-off prevented checkbox/count populate. Fixed syncProtection independent of numericpopulate, calledtimerandsettingsEnabled. FinalactualUIprotection-indicators-cd408855c24d4741aa481db9a2329ba9 exit0 (9secondsmoke25watchdog): dirty0.42 draft retained throughrectangle/clear/Esc; master-offsame-revision regionon/off indicators correct, draftretained; masterrestored. Build-protection-indicators exit0; app0654C61F11D9FC50436B964F385E4028E6458C4B9D186B6DCD5B0796C383B4F5. Independent recheck pending; GPU code unchanged.Final protection review scopedPASS afterP2fix: docs/REVIEW_NR_PROTECTION_2026-09-08.md. Independent finalphase7a178db7f41.477s/UIa20440899s PASS. CurrentmanualNR protection delivered locally; fullQ5/Goalnotcomplete. Next: feathered/partialtile/moving validation, private UIAlpha/Backbuffer/ControlMask isolated fixedruntime experiment; SR/FG referencepolicy; sourceNVOFcurrent->previous confirmed(NvOfSession inputB=current/referenceA=previous, densify negate0), Q6 bounds/photometricconfidence and Q7ROI thereafter.++## Cycle 66 - protection boundary diagnostics (2026-09-08)++Scoped test-only change in tests/integration/ImageDimensionTests.cpp: feather 2/32 pixels, disjoint regions, and partial 2561x2561 mask spanning central horizontal/vertical tile seams. No product code, export integrity or runtime changed.++Commands: scripts/build.ps1 -Root "$PWD" -Preset x64-release; scripts/loop-gate.ps1 -Gate preflight; logs/optimization-goal-20260908/run-image-tests.ps1 (275s watchdog); scripts/loop-gate.ps1 -Gate phase7. Build log build-protection-boundaries-final.log. Initial runs image-eeba5f9f5a934480ab91d3307fbdc74a (17.620s) and image-97deff3da67c4a3e94c731e561377964 (17.654s) failed a new test assertion: unsigned 192-x subtraction misclassified exterior pixels. Diagnostic per-mode evidence isolated the assertion; changed to 192.f-x, no product adjustment.++Maker image-262e170a7cef4014b6287f6c4c022f22 passed 21.828s. Independent review_protection_boundaries PASS with no introduced P0/P1/P2: preflight71; phase7 logs/delivery/d8846bbfe5d54b41b7b14327e8897975/result.json 41.695s/75checks; image-e8c7b9377cd94f68bd50fb189bd8b49c 21.916s. Actual Feature18 Create0x1 non-null SEH0; seven protection evaluations with original/baseline error0. Feather2/32 has 1581/15725 mixed channels, envelope error0. Partial nine-tile/nine-NR interior/exterior error0, envelope error1. Baseline comes from same run, dimensions verified.++Image-test SHA256 052F7DE99BB622DDF05F977D5431C8257F26330119CF7760072126C3DC655481. App remains 0654C61F11D9FC50436B964F385E4028E6458C4B9D186B6DCD5B0796C383B4F5. Reviewer tracked fingerprint f80219622037f7671d65046e14313267f9bb85ce unchanged.++Limits: these assertions prove endpoints and bounded nontrivial blending, not exact smoothstep or perceptual smoothness. Central seams covered, not every seam with a protected region. Moving HUD/temporal behavior, natural quality, SR/FG protection and private resource effectiveness remain unverified. Phase7 and full Goal remain in_progress. Next atomic task: moving-background/static-HUD protection matrix, then isolated optional NR resource contract; Q6 motion confidence/FG and Q7 candidate ROI remain pending.diff --git a/loop/EVIDENCE.md b/loop/EVIDENCE.mdindex 6ac414ab..f915e4a9 100644--- a/loop/EVIDENCE.md+++ b/loop/EVIDENCE.md@@ -474,3 +474,15 @@ Cycles64-65 protection GPU imagea812c02d19.450s PASS, presets migration PASS, phProtection P2 fixed; actualUIcd4088559s PASS dirty draft+master-off same revision indicators. App0654C61F... independent recheckpending.Protection final independent scopedPASS: docs/REVIEW_NR_PROTECTION_2026-09-08.md; app0654C61F... phase7a178db7f41.477s. P2closed withdirty/master-off regressions; Q5b/Q6/Q7 stillopen.++## Cycle 66 - protection boundary diagnostics (2026-09-08)++Scoped test-only change in tests/integration/ImageDimensionTests.cpp: feather 2/32 pixels, disjoint regions, and partial 2561x2561 mask spanning central horizontal/vertical tile seams. No product code, export integrity or runtime changed.++Commands: scripts/build.ps1 -Root "$PWD" -Preset x64-release; scripts/loop-gate.ps1 -Gate preflight; logs/optimization-goal-20260908/run-image-tests.ps1 (275s watchdog); scripts/loop-gate.ps1 -Gate phase7. Build log build-protection-boundaries-final.log. Initial runs image-eeba5f9f5a934480ab91d3307fbdc74a (17.620s) and image-97deff3da67c4a3e94c731e561377964 (17.654s) failed a new test assertion: unsigned 192-x subtraction misclassified exterior pixels. Diagnostic per-mode evidence isolated the assertion; changed to 192.f-x, no product adjustment.++Maker image-262e170a7cef4014b6287f6c4c022f22 passed 21.828s. Independent review_protection_boundaries PASS with no introduced P0/P1/P2: preflight71; phase7 logs/delivery/d8846bbfe5d54b41b7b14327e8897975/result.json 41.695s/75checks; image-e8c7b9377cd94f68bd50fb189bd8b49c 21.916s. Actual Feature18 Create0x1 non-null SEH0; seven protection evaluations with original/baseline error0. Feather2/32 has 1581/15725 mixed channels, envelope error0. Partial nine-tile/nine-NR interior/exterior error0, envelope error1. Baseline comes from same run, dimensions verified.++Image-test SHA256 052F7DE99BB622DDF05F977D5431C8257F26330119CF7760072126C3DC655481. App remains 0654C61F11D9FC50436B964F385E4028E6458C4B9D186B6DCD5B0796C383B4F5. Reviewer tracked fingerprint f80219622037f7671d65046e14313267f9bb85ce unchanged.++Limits: these assertions prove endpoints and bounded nontrivial blending, not exact smoothstep or perceptual smoothness. Central seams covered, not every seam with a protected region. Moving HUD/temporal behavior, natural quality, SR/FG protection and private resource effectiveness remain unverified. Phase7 and full Goal remain in_progress. Next atomic task: moving-background/static-HUD protection matrix, then isolated optional NR resource contract; Q6 motion confidence/FG and Q7 candidate ROI remain pending.diff --git a/loop/JOURNAL.md b/loop/JOURNAL.mdindex 0da84223..d0957672 100644--- a/loop/JOURNAL.md+++ b/loop/JOURNAL.md@@ -1460,3 +1460,18 @@ Cycles64-65 reviewer FAILP2 protection indicators stale under dirty drafts / uncP2 dedicated indicator synchronization and regression passed locally. Freeze again for reviewerrecheck; no further GPU/codechanges.Cycles64-65 finalreviewPASS fingerprintunchanged; localcheckpoint before next protection/quality evidence. No push/release/physicalcaptureclaim.++## Cycle 66 - protection boundary evidence+Before change: HEAD 674c726 clean; preflight 71/71. Extend GPU diagnostics for feather 2/32 px, disjoint rectangles and partial mask crossing 3x3 tile seams. Product path and export integrity unchanged. Each invocation bounded <=300 seconds. Natural motion quality remains separate.++## Cycle 66 - protection boundary diagnostics (2026-09-08)++Scoped test-only change in tests/integration/ImageDimensionTests.cpp: feather 2/32 pixels, disjoint regions, and partial 2561x2561 mask spanning central horizontal/vertical tile seams. No product code, export integrity or runtime changed.++Commands: scripts/build.ps1 -Root "$PWD" -Preset x64-release; scripts/loop-gate.ps1 -Gate preflight; logs/optimization-goal-20260908/run-image-tests.ps1 (275s watchdog); scripts/loop-gate.ps1 -Gate phase7. Build log build-protection-boundaries-final.log. Initial runs image-eeba5f9f5a934480ab91d3307fbdc74a (17.620s) and image-97deff3da67c4a3e94c731e561377964 (17.654s) failed a new test assertion: unsigned 192-x subtraction misclassified exterior pixels. Diagnostic per-mode evidence isolated the assertion; changed to 192.f-x, no product adjustment.++Maker image-262e170a7cef4014b6287f6c4c022f22 passed 21.828s. Independent review_protection_boundaries PASS with no introduced P0/P1/P2: preflight71; phase7 logs/delivery/d8846bbfe5d54b41b7b14327e8897975/result.json 41.695s/75checks; image-e8c7b9377cd94f68bd50fb189bd8b49c 21.916s. Actual Feature18 Create0x1 non-null SEH0; seven protection evaluations with original/baseline error0. Feather2/32 has 1581/15725 mixed channels, envelope error0. Partial nine-tile/nine-NR interior/exterior error0, envelope error1. Baseline comes from same run, dimensions verified.++Image-test SHA256 052F7DE99BB622DDF05F977D5431C8257F26330119CF7760072126C3DC655481. App remains 0654C61F11D9FC50436B964F385E4028E6458C4B9D186B6DCD5B0796C383B4F5. Reviewer tracked fingerprint f80219622037f7671d65046e14313267f9bb85ce unchanged.++Limits: these assertions prove endpoints and bounded nontrivial blending, not exact smoothstep or perceptual smoothness. Central seams covered, not every seam with a protected region. Moving HUD/temporal behavior, natural quality, SR/FG protection and private resource effectiveness remain unverified. Phase7 and full Goal remain in_progress. Next atomic task: moving-background/static-HUD protection matrix, then isolated optional NR resource contract; Q6 motion confidence/FG and Q7 candidate ROI remain pending.diff --git a/loop/STATE.json b/loop/STATE.jsonindex 2cff7ef1..94ebcc86 100644--- a/loop/STATE.json+++ b/loop/STATE.json@@ -76,19 +76,19 @@}],"cycle": {- "completed": 65,+ "completed": 66,"maximum": 120,"sameFailureAttempts": 0,"maximumSameFailureAttempts": 3,"noProgressCycles": 0,"maximumNoProgressCycles": 5},- "currentTask": "Manual NR protection GPU/UI/preset path independently reviewed PASS; full quality goal ongoing",+ "currentTask": "Manual NR protection boundary diagnostics independently reviewed PASS; full quality goal ongoing","lastGate": {"name": "phase7","status": "passed","exitCode": 0,- "evidence": "logs/delivery/a178db7f0e0e4a4a8555d0b66e764f0a/result.json41.477s app0654C61F..."+ "evidence": "logs/delivery/d8846bbfe5d54b41b7b14327e8897975/result.json 41.695s;75checks"},"lastFailureFingerprint": "","failureLedger": [@@ -107,8 +107,8 @@"Current USB2 1080p50 physical throughput passed; user perceived latency/audio/actual FG display cadence still need confirmation.","Public proprietary runtime distribution rights unresolved; local delivery only."],- "nextAction": "Validate feathered/partial-tile/moving protection; isolated private NR resources and SR/FG reference policy; then Q6 motion confidence/FG and Q7 candidate ROI/natural reconstruction comparisons",- "updatedAt": "2026-09-08T10:20:30.0786887Z",+ "nextAction": "Moving-background/static-HUD protection matrix, then isolated optional NR resources; Q6 motion confidence/FG and Q7 candidate ROI/natural reconstruction comparisons",+ "updatedAt": "2026-09-08T10:31:00.662715+00:00","deliveryPlan": "docs/ACTIVE_DELIVERY_PLAN.md","captureAcceptance": "throughput_short_test_passed_user_latency_audio_pending","testInvocationLimitSeconds": 300,@@ -126,7 +126,8 @@"docs/REVIEW_COLOR_TIMING_2026-09-08.md: scoped independent PASS; phase7 31051b6d 41.143s, image GPU matrix and timing14 passed","docs/REVIEW_CAPTURE_RGB_2026-09-08.md: independent phase7afe022a9 41.407s and image9ac2822f11.487s PASS; synthetic RGB only","docs/REVIEW_SR_CONTRACT_2026-09-08.md: independent scopedPASS; SR60a70819e6 actual motion andGBV0, image route/color golden passed",- "docs/REVIEW_NR_PROTECTION_2026-09-08.md: scopedPASS afterP2syncfix; GPU/presets andactualUI dirty/master-off independently verified"+ "docs/REVIEW_NR_PROTECTION_2026-09-08.md: scopedPASS afterP2syncfix; GPU/presets andactualUI dirty/master-off independently verified",+ "Cycle66 independent scoped PASS: image-e8c7b9377cd94f68bd50fb189bd8b49c 21.916s; feather2/32, disjoint, central tile seams. No product changes."],"reviewBaseCommit": "6f0ebaa687e3966d989bf138c86b6882380f20fb","localDelivery": "capture_fix_candidate_needs_review",diff --git a/tests/integration/ImageDimensionTests.cpp b/tests/integration/ImageDimensionTests.cppindex f0a8472a..588a3df0 100644--- a/tests/integration/ImageDimensionTests.cpp+++ b/tests/integration/ImageDimensionTests.cpp@@ -43,7 +43,7 @@ bool run(unsigned width,unsigned height,bool nr,const std::filesystem::path& dirstd::cout<<"IMAGE_DIMENSION "<<width<<'x'<<height<<" nr="<<nr<<" maxError8="<<maxError<<" nrEvaluations="<<graph.metrics().nrEvaluateCount<<" pass="<<ok<<std::endl;out={};ring.drainQueue();graph.shutdown();av_frame_free(&f);ring.shutdown();ctx.shutdown();return ok;}-bool tiled(unsigned width,unsigned height,bool nr,const std::filesystem::path& directory,bool protect=false){+bool tiled(unsigned width,unsigned height,bool nr,const std::filesystem::path& directory,int protect=0){gfx::D3D12DeviceContext ctx;gfx::CommandSlotRing ring;Status st;gfx::DeviceContextDesc device;if(!ctx.initialize(device,st)||!ring.initialize(ctx.device(),ctx.directQueue(),ctx.fence(),ctx.fenceEvent(),4,st))return false;sink::RgbaImage source;source.width=width;source.height=height;source.pixels.resize(size_t(width)*height*4);@@ -52,14 +52,30 @@ bool tiled(unsigned width,unsigned height,bool nr,const std::filesystem::path& d// sRGB 188 over black; fully transparent color contributes nothing.if(!nr){source.pixels[0]=source.pixels[1]=source.pixels[2]=255;source.pixels[3]=128;source.pixels[7]=0;}pipeline::EnhanceGraphDesc gd;gd.enableNr=nr;gd.noFeatures=!nr;gd.runtimeAbsPath=(std::filesystem::path(VEYRA_PROJECT_ROOT)/"runtime_local/nvidia").wstring();- if(protect){gd.protection.enabled=true;gd.protection.featherPixels=0;gd.protection.regions[0]={0,0,1,1};}+ if(protect){gd.protection.enabled=true;gd.protection.featherPixels=0;gd.protection.regions[0]={0,0,1,1};if(protect==2){gd.protection.featherPixels=32;gd.protection.regions[0]={.25f,.25f,.75f,.75f};}}std::atomic<bool> cancel=false;engine::TiledImageProcessor::Stats stats;sink::RgbaImage result;bool ok=engine::TiledImageProcessor::process(ctx,ring,source,result,gd,cancel,stats);int maxError=0;uint64_t brightness=0;if(ok){ok=result.width==width&&result.height==height&&result.pixels.size()==source.pixels.size();for(size_t i=0;i<result.pixels.size();++i){int expected=source.pixels[i];if(!nr&&i<8)expected=i%4==3?255:(i<4?188:0);maxError=std::max(maxError,std::abs(int(result.pixels[i])-expected));if(i%4!=3)brightness+=result.pixels[i];}- ok=ok&&brightness>0&&(nr?stats.nrEvaluations==stats.tiles&&(!protect||maxError<=1):maxError<=1);- sink::RgbaImage decoded;auto path=directory/(std::to_string(width)+"x"+std::to_string(height)+(protect?"-tiled-protected.png":nr?"-tiled-nr.png":"-tiled-off.png"));+ ok=ok&&brightness>0&&(nr?stats.nrEvaluations==stats.tiles&&(protect!=1||maxError<=1):maxError<=1);+ if(protect==2){+ sink::RgbaImage baseline;ok=ok&&sink::loadImage((directory/(std::to_string(width)+"x"+std::to_string(height)+"-tiled-nr.png")).wstring(),baseline);+ ok=ok&&baseline.width==width&&baseline.height==height&&baseline.pixels.size()==result.pixels.size();+ int inside=0,outside=0,envelope=0;uint64_t interiorCount=0,exteriorCount=0;+ if(ok)for(unsigned y=0;y<height;++y)for(unsigned x=0;x<width;++x){+ float edge=std::min(std::min(x+.5f-width*.25f,width*.75f-x-.5f),std::min(y+.5f-height*.25f,height*.75f-y-.5f));+ interiorCount+=edge>=32;exteriorCount+=edge<=0;+ for(unsigned c=0;c<3;++c){size_t i=(size_t(y)*width+x)*4+c;int v=result.pixels[i],a=source.pixels[i],b=baseline.pixels[i];+ if(edge>=32)inside=std::max(inside,std::abs(v-a));+ if(edge<=0)outside=std::max(outside,std::abs(v-b));+ envelope=std::max(envelope,std::max(std::min(a,b)-v,v-std::max(a,b)));+ }+ }+ ok=ok&&inside<=1&&outside<=1&&envelope<=2&&interiorCount>100000&&exteriorCount>100000;+ std::cout<<"PROTECTION_PARTIAL_TILE feather=32 insideError8="<<inside<<" outsideError8="<<outside<<" envelopeError8="<<envelope<<" pass="<<ok<<std::endl;+ }+ sink::RgbaImage decoded;auto path=directory/(std::to_string(width)+"x"+std::to_string(height)+(protect==2?"-tiled-partial.png":protect?"-tiled-protected.png":nr?"-tiled-nr.png":"-tiled-off.png"));ok=ok&&sink::saveImage(path.wstring(),result)&&sink::loadImage(path.wstring(),decoded)&&decoded.pixels==result.pixels&&decoded.width==width&&decoded.height==height;}std::cout<<"IMAGE_TILED "<<width<<'x'<<height<<" nr="<<nr<<" protect="<<protect<<" tiles="<<stats.tiles<<" evaluations="<<stats.nrEvaluations<<" maxError8="<<maxError<<" pass="<<ok<<std::endl;@@ -163,23 +179,35 @@ bool protectionPixels(){if(av_frame_get_buffer(f,32)<0){av_frame_free(&f);return false;}for(unsigned y=0;y<256;++y)for(unsigned x=0;x<256;++x){auto* p=f->data[0]+size_t(y)*f->linesize[0]+x*4;p[0]=(x*7+y*3)%256;p[1]=(x*3+y*11)%256;p[2]=(x*5+y*17)%256;p[3]=255;}sink::RgbaImage baseline;bool ok=true;int protectedError=0,outsideError=0;uint64_t changed=0;- for(unsigned mode=0;mode<4&&ok;++mode){+ for(unsigned mode=0;mode<7&&ok;++mode){engine::EnhancementSettings settings;settings.protection.enabled=mode>0;settings.protection.featherPixels=0;if(mode==2)settings.protection.regions[0]={0,0,1,1};- if(mode==3)settings.protection.regions[0]={.25f,.25f,.75f,.75f};+ if(mode>=3)settings.protection.regions[0]={.25f,.25f,.75f,.75f};+ if(mode==4||mode==5)settings.protection.featherPixels=mode==4?2.f:32.f;+ if(mode==6){settings.protection.regions[0]={.125f,.125f,.375f,.375f};settings.protection.regions[1]={.625f,.625f,.875f,.875f};}pipeline::EnhanceGraph::FrameOutputs out;sink::RgbaImage result;ok=graph.applySettings(settings)&&graph.process(f,0,true,out,mode+1)&&sink::readRgba8(ctx,ring,graph.videoFrameResource(out.videoSlot),result);+ int envelope=0;uint64_t mixed=0;if(ok){if(!mode)baseline=result;for(unsigned y=0;y<256;++y)for(unsigned x=0;x<256;++x)for(unsigned c=0;c<3;++c){auto i=(size_t(y)*256+x)*4+c;auto original=f->data[0][size_t(y)*f->linesize[0]+x*4+c];if(!mode){changed+=result.pixels[i]!=original;continue;}- bool protectedPixel=mode==2||(mode==3&&x>=64&&x<192&&y>=64&&y<192);+ float edge=std::min(std::min(x+.5f-64,192.f-x-.5f),std::min(y+.5f-64,192.f-y-.5f));+ if(mode==4||mode==5){+ int v=result.pixels[i],a=original,b=baseline.pixels[i];+ envelope=std::max(envelope,std::max(std::min(a,b)-v,v-std::max(a,b)));+ if(edge>0&&edge<settings.protection.featherPixels){mixed+=std::abs(v-a)>1&&std::abs(v-b)>1;continue;}+ }+ bool protectedPixel=mode==2||(mode>=3&&mode<=5&&edge>=settings.protection.featherPixels)||(mode==6&&((x>=32&&x<96&&y>=32&&y<96)||(x>=160&&x<224&&y>=160&&y<224)));if(protectedPixel)protectedError=std::max(protectedError,std::abs(int(result.pixels[i])-int(original)));else outsideError=std::max(outsideError,std::abs(int(result.pixels[i])-int(baseline.pixels[i])));}- }out={};+ }+ if(mode==4||mode==5){ok=ok&&envelope<=1&&mixed>100;std::cout<<"PROTECTION_FEATHER pixels="<<settings.protection.featherPixels<<" mixedChannels="<<mixed<<" envelopeError8="<<envelope<<" pass="<<ok<<std::endl;}+ std::cout<<"PROTECTION_MODE mode="<<mode<<" protectedError8="<<protectedError<<" outsideError8="<<outsideError<<std::endl;+ out={};}- ok=ok&&changed>100&&protectedError<=1&&outsideError==0&&graph.metrics().nrEvaluateCount==4;- std::cout<<"PROTECTION_PIXELS empty/full/rectangle changed="<<changed<<" protectedError8="<<protectedError<<" outsideError8="<<outsideError<<" nr="<<graph.metrics().nrEvaluateCount<<" pass="<<ok<<std::endl;+ ok=ok&&changed>100&&protectedError<=1&&outsideError==0&&graph.metrics().nrEvaluateCount==7;+ std::cout<<"PROTECTION_PIXELS empty/full/rectangle/feather/disjoint changed="<<changed<<" protectedError8="<<protectedError<<" outsideError8="<<outsideError<<" nr="<<graph.metrics().nrEvaluateCount<<" pass="<<ok<<std::endl;ring.drainQueue();graph.shutdown();av_frame_free(&f);ring.shutdown();ctx.shutdown();return ok;}int wmain(int argc,wchar_t** argv){@@ -199,6 +227,7 @@ int wmain(int argc,wchar_t** argv){if(ok)ok=srPixels(256,256,256,256,directory);if(ok)ok=captureRgb(false)&&captureRgb(true);if(ok)ok=protectionPixels();- if(ok)ok=tiled(2561,2561,true,directory,true);+ if(ok)ok=tiled(2561,2561,true,directory,1);+ if(ok)ok=tiled(2561,2561,true,directory,2);CoUninitialize();return ok?0:1;}