MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / jpeg_decode_OB

Function jpeg_decode_OB

Source/Core/JpegTask.cpp:199–232  ·  view source on GitHub ↗

* JPEG decoding ucode found in Ogre Battle and Bottom of the 9th. **************************************************************************/

Source from the content-addressed store, hash-verified

197 * JPEG decoding ucode found in Ogre Battle and Bottom of the 9th.
198 **************************************************************************/
199void jpeg_decode_OB(OSTask *task)
200{
201 s16 qtable[SUBBLOCK_SIZE] {};
202 u32 mb {};
203
204 s32 y_dc {}, u_dc {}, v_dc {};
205
206 u32 address {(u32)task->t.data_ptr};
207 const u32 macroblock_count {task->t.data_size};
208 const u32 qscale {task->t.yield_data_size};
209
210 if (task->t.yield_data_size != 0 )
211 {
212 if (task->t.yield_data_size > 0)
213 {
214 ScaleSubBlock(qtable, DEFAULT_QTABLE, qscale);
215 }
216 else
217 {
218 RShiftSubBlock(qtable, DEFAULT_QTABLE, -qscale);
219 }
220 }
221
222 for (mb = 0; mb < macroblock_count; ++mb)
223 {
224 s16 macroblock[6*SUBBLOCK_SIZE];
225
226 rdram_read_many_u16((u16*)macroblock, address, 6*SUBBLOCK_SIZE);
227 DecodeMacroblock1(macroblock, &y_dc, &u_dc, &v_dc, (qscale != 0) ? qtable : nullptr);
228 EmitTilesMode2(EmitYUVTileLine, macroblock, address);
229
230 address += (2*6*SUBBLOCK_SIZE);
231 }
232}
233
234static u8 clamp_u8(s16 x)
235{

Callers 1

RSP_HLE_JpegFunction · 0.85

Calls 5

ScaleSubBlockFunction · 0.85
RShiftSubBlockFunction · 0.85
rdram_read_many_u16Function · 0.85
DecodeMacroblock1Function · 0.85
EmitTilesMode2Function · 0.85

Tested by

no test coverage detected