fix(libSceJpegEnc): preserve packed YCbCr samples #23534
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23534"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by iris8721 on 2026-11-19T07:19:16Z.
What
sceJpegEncEncodeconverted packedY8U8Y8V8to RGB before compression, clipping color samples. Pass Y, Cb, and Cr directly to bundled TurboJPEG. 4:2:2 retains source chroma; 4:2:0 averages adjacent rows with libjpeg-turbo's rounding rule. Console rounding and JPEG bytes remain unverified.Tested
Windows x86-64, WinLibs GCC 15.2.0, Ninja, Release,
BUILD_TESTING=ON. Testeda6fe9a1161onbf10f07513.e35c90cfe3, a luma sample of32decoded as56. With the fix, all visible samples in the odd-sized, padded fixture decoded within two levels of expected at quality 100 in both sampling modes.guest_jpeg_enc_odd_width_yuv,guest_jpeg_enc,guest_jpeg_encode_capacity, anddecoder_jpegpassed.No Linux, PS5, or game-title run.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T07:21:03Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
a6fe9a1161:tools/check_conventions.pypassed.guest_jpeg_enc_odd_width_yuv_testsbuilt cleanly.guest_jpeg_enc_odd_width_yuv):core/Decoder/Jpeg/include/Decoder/Jpeg.hpp,core/Decoder/Jpeg/src/Jpeg.cpp,core/libs/prx/libSceJpegEnc/Export.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T07:55:44Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
5d8f64484a:tools/check_conventions.pypassed.guest_jpeg_enc_odd_width_yuv_testsbuilt cleanly.guest_jpeg_enc_odd_width_yuv):core/Decoder/Jpeg/include/Decoder/Jpeg.hpp,core/Decoder/Jpeg/src/Jpeg.cpp,core/libs/prx/libSceJpegEnc/Export.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me