From 6b77137ab539bd22c8fb001b1c41a9b81f0a5920 Mon Sep 17 00:00:00 2001 From: Reg <69511985+RegularRabbit05@users.noreply.github.com> Date: Fri, 4 Jul 2025 13:30:55 +0200 Subject: [PATCH] Add sceJpegDecodeMJpegYCbCr and sceJpegCsc to pspjpeg.h --- src/mpeg/pspjpeg.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/mpeg/pspjpeg.h b/src/mpeg/pspjpeg.h index 614add4d..cfa23334 100644 --- a/src/mpeg/pspjpeg.h +++ b/src/mpeg/pspjpeg.h @@ -55,11 +55,36 @@ int sceJpegDeleteMJpeg(void); * @param size - size of the buffer pointed by jpegbuf * @param rgba - buffer where the decoded data in RGBA format will be stored. * It should have a size of (width * height * 4). - * @param unk - Unknown, pass 0 + * @param dhtMode - Unknown, pass 0 * * @return (width * 65536) + height on success, < 0 on error */ -int sceJpegDecodeMJpeg(u8 *jpegbuf, SceSize size, void *rgba, u32 unk); +int sceJpegDecodeMJpeg(u8 *jpegbuf, SceSize size, void *rgba, u32 dhtMode); + +/** + * Decodes a mjpeg frame with YCbCr encoding. + * + * @param jpegbuf - the buffer with the mjpeg frame + * @param size - size of the buffer pointed by jpegbuf + * @param rgba - buffer where the decoded data in YCbCr format will be stored. + * @param dhtMode - Unknown, pass 0 + * + * @return (width * 65536) + height on success, < 0 on error +*/ +int sceJpegDecodeMJpegYCbCr(u8 *jpegbuf, SceSize size, void *yCbCr, u32 dhtMode); + +/** + * Converts a frame from YCbCr to ABGR + * + * @param imageAddr - buffer where the decoded data in abgr format will be stored. + * @param yCbCrAddr - the buffer with the YCbCr data + * @param widthHeight - width and height of the frame (width << 16) | height + * @param bufferWidth - number of pixels per row of the buffer + * @param colourInfo - chroma subsampling mode + * + * @return 0 on success, < 0 on error +*/ +int sceJpegCsc(u8 *imageAddr, u8 *yCbCrAddr, int widthHeight, int bufferWidth, int colourInfo); #ifdef __cplusplus }