Skip to content

feat(video-recording): implement sceVideoRecordingCopyBGRAtoNV12 - #9235

Closed
ashwin280802 wants to merge 1 commit into
boykopovar:mainfrom
ashwin280802:feat/videorecording-copy-bgra-to-nv12
Closed

ashwin280802 wants to merge 1 commit into
boykopovar:mainfrom
ashwin280802:feat/videorecording-copy-bgra-to-nv12

Conversation

@ashwin280802

@ashwin280802 ashwin280802 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Implement sceVideoRecordingCopyBGRAtoNV12 in libSceVideoRecordingP using two-row cache-blocked ITU-R BT.601 integer arithmetic for 4:2:0 NV12 conversion, with argument validation and technical debt tracking. Note: PR #9137 touches adjacent declarations in Export.cpp and docs/dev/debt/libSceVideoRecordingP.md, but leaves sceVideoRecordingCopyBGRAtoNV12 unimplemented; there is no functional overlap.

Tested

Windows 11, MinGW-w64 GCC 15.2.0.
Ran CTest suite:

  • ctest --test-dir build-full -R guest_video_recording -V (Passed, 0.04s)
  • Unit tests in core/libs/tests/GuestVideoRecording.cpp verify:
    • Argument validation: null pointers, zero dimensions, and odd dimensions throw std::invalid_argument.
    • Canary buffer bounds: 32 leading and trailing guard bytes remain untouched (no buffer overruns).
    • Color precision: solid Black, White, Red, Green, and Blue blocks verified against standard BT.601 limited-range matrices.
    • Spatial indexing: 4x4 multi-color quadrant pattern verifying exact luma byte offsets and interleaved chroma stride indexing.
    • Multi-resolution load test: 16x16, 128x128, 720p (1280x720), 1080p (1920x1080), and 4K UHD (3840x2160).
  • Physical visual verification: rendered SMPTE test pattern in BGRA, converted to NV12, and decoded back via FFmpeg.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@ashwin280802

Copy link
Copy Markdown
Contributor Author
visual_verification_nv12

Visual Verification (FFmpeg Decoded NV12 Frame)

Rendered 320x240 SMPTE color bar & gradient test pattern in BGRA, converted via sceVideoRecordingCopyBGRAtoNV12, and decoded directly back to PNG via FFmpeg. Validates exact channel ordering (zero B/R swapping), clean 4:2:0 subsampling, and monotonic gradient luminance.

@ashwin280802

Copy link
Copy Markdown
Contributor Author

Closing PR: Without console binary disassembly or hardware traces to verify the exact color conversion matrix (BT.709 vs BT.601), chroma siting, pitch alignment, and return semantics, implementing this export and removing its technical debt entry is premature under AnyPS5 conventions. The export should continue to throw NotImplemented_nid_no_patch until hardware evidence is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant