MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / GetMacroblockModes

Function GetMacroblockModes

pcsx2/IPU/IPU_MultiISA.cpp:392–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392static int GetMacroblockModes()
393{
394 int macroblock_modes;
395 const MBtab * tab;
396
397 switch (decoder.coding_type)
398 {
399 case I_TYPE:
400 macroblock_modes = UBITS(2);
401
402 if (macroblock_modes == 0) return 0; // error
403
404 tab = MB_I + (macroblock_modes >> 1);
405 DUMPBITS(tab->len);
406 macroblock_modes = tab->modes;
407
408 if ((!(decoder.frame_pred_frame_dct)) &&
409 (decoder.picture_structure == FRAME_PICTURE))
410 {
411 macroblock_modes |= GETBITS(1) * DCT_TYPE_INTERLACED;
412 }
413 return macroblock_modes;
414
415 case P_TYPE:
416 macroblock_modes = UBITS(6);
417
418 if (macroblock_modes == 0) return 0; // error
419
420 tab = MB_P + (macroblock_modes >> 1);
421 DUMPBITS(tab->len);
422 macroblock_modes = tab->modes;
423
424 if (decoder.picture_structure != FRAME_PICTURE)
425 {
426 if (macroblock_modes & MACROBLOCK_MOTION_FORWARD)
427 {
428 macroblock_modes |= GETBITS(2) * MOTION_TYPE_BASE;
429 }
430
431 return macroblock_modes;
432 }
433 else if (decoder.frame_pred_frame_dct)
434 {
435 if (macroblock_modes & MACROBLOCK_MOTION_FORWARD)
436 macroblock_modes |= MC_FRAME;
437
438 return macroblock_modes;
439 }
440 else
441 {
442 if (macroblock_modes & MACROBLOCK_MOTION_FORWARD)
443 {
444 macroblock_modes |= GETBITS(2) * MOTION_TYPE_BASE;
445 }
446
447 if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN))
448 {
449 macroblock_modes |= GETBITS(1) * DCT_TYPE_INTERLACED;

Callers 2

mpeg2sliceIDECFunction · 0.85
ipuVDECFunction · 0.85

Calls 4

UBITSFunction · 0.85
DUMPBITSFunction · 0.85
GETBITSFunction · 0.85
WarningMethod · 0.45

Tested by

no test coverage detected