| 1253 | } |
| 1254 | |
| 1255 | __fi static bool mpeg2_slice() |
| 1256 | { |
| 1257 | int DCT_offset, DCT_stride; |
| 1258 | static bool ready_to_decode = true; |
| 1259 | |
| 1260 | macroblock_8& mb8 = decoder.mb8; |
| 1261 | macroblock_16& mb16 = decoder.mb16; |
| 1262 | |
| 1263 | switch (ipu_cmd.pos[0]) |
| 1264 | { |
| 1265 | case 0: |
| 1266 | if (decoder.dcr) |
| 1267 | { |
| 1268 | decoder.dc_dct_pred[0] = |
| 1269 | decoder.dc_dct_pred[1] = |
| 1270 | decoder.dc_dct_pred[2] = 128 << decoder.intra_dc_precision; |
| 1271 | } |
| 1272 | |
| 1273 | ipuRegs.ctrl.ECD = 0; |
| 1274 | ipuRegs.top = 0; |
| 1275 | std::memset(&mb8, 0, sizeof(mb8)); |
| 1276 | std::memset(&mb16, 0, sizeof(mb16)); |
| 1277 | [[fallthrough]]; |
| 1278 | |
| 1279 | case 1: |
| 1280 | if (!BitstreamInit()) |
| 1281 | { |
| 1282 | ipu_cmd.pos[0] = 1; |
| 1283 | return false; |
| 1284 | } |
| 1285 | [[fallthrough]]; |
| 1286 | |
| 1287 | case 2: |
| 1288 | ipu_cmd.pos[0] = 2; |
| 1289 | |
| 1290 | // IPU0 isn't ready for data, so let's wait for it to be |
| 1291 | if ((!ipu0ch.chcr.STR || ipuRegs.ctrl.OFC || ipu0ch.qwc == 0) && ipu_cmd.pos[0] <= 3) |
| 1292 | { |
| 1293 | IPUCoreStatus.WaitingOnIPUFrom = true; |
| 1294 | return false; |
| 1295 | } |
| 1296 | |
| 1297 | if (decoder.macroblock_modes & DCT_TYPE_INTERLACED) |
| 1298 | { |
| 1299 | DCT_offset = decoder_stride; |
| 1300 | DCT_stride = decoder_stride * 2; |
| 1301 | } |
| 1302 | else |
| 1303 | { |
| 1304 | DCT_offset = decoder_stride * 8; |
| 1305 | DCT_stride = decoder_stride; |
| 1306 | } |
| 1307 | |
| 1308 | if (decoder.macroblock_modes & MACROBLOCK_INTRA) |
| 1309 | { |
| 1310 | switch(ipu_cmd.pos[1]) |
| 1311 | { |
| 1312 | case 0: |
no test coverage detected