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

Function mpeg2sliceIDEC

pcsx2/IPU/IPU_MultiISA.cpp:960–1253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

958}
959
960__ri static bool mpeg2sliceIDEC()
961{
962 u16 code;
963 static bool ready_to_decode = true;
964 switch (ipu_cmd.pos[0])
965 {
966 case 0:
967 decoder.dc_dct_pred[0] =
968 decoder.dc_dct_pred[1] =
969 decoder.dc_dct_pred[2] = 128 << decoder.intra_dc_precision;
970
971 ipuRegs.top = 0;
972 ipuRegs.ctrl.ECD = 0;
973 [[fallthrough]];
974
975 case 1:
976 ipu_cmd.pos[0] = 1;
977 if (!BitstreamInit())
978 {
979 return false;
980 }
981 [[fallthrough]];
982
983 case 2:
984 ipu_cmd.pos[0] = 2;
985 while (1)
986 {
987 // IPU0 isn't ready for data, so let's wait for it to be
988 if ((!ipu0ch.chcr.STR || ipuRegs.ctrl.OFC || ipu0ch.qwc == 0) && ipu_cmd.pos[1] <= 2)
989 {
990 IPUCoreStatus.WaitingOnIPUFrom = true;
991 return false;
992 }
993 macroblock_8& mb8 = decoder.mb8;
994 macroblock_rgb16& rgb16 = decoder.rgb16;
995 macroblock_rgb32& rgb32 = decoder.rgb32;
996
997 int DCT_offset, DCT_stride;
998 const MBAtab * mba;
999
1000 switch (ipu_cmd.pos[1])
1001 {
1002 case 0:
1003 decoder.macroblock_modes = GetMacroblockModes();
1004
1005 if (decoder.macroblock_modes & MACROBLOCK_QUANT) //only IDEC
1006 {
1007 const int quantizer_scale_code = GETBITS(5);
1008 if (decoder.q_scale_type)
1009 decoder.quantizer_scale = non_linear_quantizer_scale[quantizer_scale_code];
1010 else
1011 decoder.quantizer_scale = quantizer_scale_code << 1;
1012 }
1013
1014 decoder.coded_block_pattern = 0x3F;//all 6 blocks
1015 std::memset(&mb8, 0, sizeof(mb8));
1016 std::memset(&rgb32, 0, sizeof(rgb32));
1017 [[fallthrough]];

Callers 1

IPUWorkerFunction · 0.85

Calls 15

BitstreamInitFunction · 0.85
GetMacroblockModesFunction · 0.85
GETBITSFunction · 0.85
slice_intra_DCTFunction · 0.85
ipu_cscFunction · 0.85
ipu_ditherFunction · 0.85
GETWORDFunction · 0.85
UBITSFunction · 0.85
DUMPBITSFunction · 0.85
finishmpeg2sliceIDECFunction · 0.85
getBits8Function · 0.85
SetOutputToMethod · 0.80

Tested by

no test coverage detected