| 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]]; |
no test coverage detected