#pragma once // Return Codes enum { CELL_GIFDEC_ERROR_OPEN_FILE = 0x80611300, CELL_GIFDEC_ERROR_STREAM_FORMAT = 0x80611301, CELL_GIFDEC_ERROR_SEQ = 0x80611302, CELL_GIFDEC_ERROR_ARG = 0x80611303, CELL_GIFDEC_ERROR_FATAL = 0x80611304, CELL_GIFDEC_ERROR_SPU_UNSUPPORT = 0x80611305, CELL_GIFDEC_ERROR_SPU_ERROR = 0x80611306, CELL_GIFDEC_ERROR_CB_PARAM = 0x80611307, }; enum CellGifDecStreamSrcSel : s32 { CELL_GIFDEC_FILE = 0, // Input from a file CELL_GIFDEC_BUFFER = 1, // Input from a buffer }; enum CellGifDecSpuThreadEna : s32 { CELL_GIFDEC_SPU_THREAD_DISABLE = 0, // Do not use SPU threads CELL_GIFDEC_SPU_THREAD_ENABLE = 1, // Use SPU threads }; enum CellGifDecRecordType : s32 { CELL_GIFDEC_RECORD_TYPE_IMAGE_DESC = 1, // Image data block CELL_GIFDEC_RECORD_TYPE_EXTENSION = 2, // Extension block CELL_GIFDEC_RECORD_TYPE_TERMINATE = 3, // Trailer block }; enum CellGifDecColorSpace : s32 { CELL_GIFDEC_RGBA = 10, // RGBA CELL_GIFDEC_ARGB = 20, // ARGB }; enum CellGifDecCommand : s32 { CELL_GIFDEC_CONTINUE = 0, // Continue decoding CELL_GIFDEC_STOP = 1, // Force decoding to stop }; enum CellGifDecDecodeStatus : s32 { CELL_GIFDEC_DEC_STATUS_FINISH = 0, // Decoding finished CELL_GIFDEC_DEC_STATUS_STOP = 1, // Decoding was stopped }; // Callbacks for memory management using CellGifDecCbControlMalloc = vm::ptr(u32 size, vm::ptr cbCtrlMallocArg); using CellGifDecCbControlFree = s32(vm::ptr ptr, vm::ptr cbCtrlFreeArg); // Structs struct CellGifDecThreadInParam { be_t spuThreadEnable; // CellGifDecSpuThreadEna be_t ppuThreadPriority; be_t spuThreadPriority; vm::bptr cbCtrlMallocFunc; vm::bptr cbCtrlMallocArg; vm::bptr cbCtrlFreeFunc; vm::bptr cbCtrlFreeArg; }; struct CellGifDecThreadOutParam { be_t gifCodecVersion; }; struct CellGifDecExtThreadInParam { vm::bptr spurs; u8 priority[8]; be_t maxContention; }; struct CellGifDecExtThreadOutParam { be_t reserved; }; struct CellGifDecSrc { be_t srcSelect; // CellGifDecStreamSrcSel vm::bcptr fileName; be_t fileOffset; be_t fileSize; vm::bptr streamPtr; be_t streamSize; be_t spuThreadEnable; // CellGifDecSpuThreadEna }; struct CellGifDecOpnInfo { be_t initSpaceAllocated; }; struct CellGifDecInfo { be_t SWidth; be_t SHeight; be_t SGlobalColorTableFlag; be_t SColorResolution; be_t SSortFlag; be_t SSizeOfGlobalColorTable; be_t SBackGroundColor; be_t SPixelAspectRatio; }; struct CellGifDecInParam { vm::bptr commandPtr; // CellGifDecCommand be_t colorSpace; // CellGifDecColorSpace u8 outputColorAlpha1; u8 outputColorAlpha2; u8 reserved[2]; }; struct CellGifDecOutParam { be_t outputWidthByte; be_t outputWidth; be_t outputHeight; be_t outputComponents; be_t outputBitDepth; be_t outputColorSpace; // CellGifDecColorSpace be_t useMemorySpace; }; struct CellGifDecExtension { u8 label; vm::ptr data; }; struct CellGifDecDataOutInfo { be_t recordType; // CellGifDecRecordType CellGifDecExtension outExtension; be_t status; // CellGifDecDecodeStatus }; struct CellGifDecDataCtrlParam { be_t outputBytesPerLine; }; // Custom structs struct GifDecoder { }; struct GifStream { u32 fd; u64 fileSize; CellGifDecInfo info; CellGifDecOutParam outParam; CellGifDecSrc src; };