From: Michel L. <wa...@us...> - 2001-09-03 10:46:54
|
Update of /cvsroot/libmpeg2/mpeg2dec/libmpeg2 In directory usw-pr-cvs1:/tmp/cvs-serv22478/libmpeg2 Modified Files: slice.c Log Message: added support for an unusual construct at the start of some slices. With this new code libmpeg2's behaviour should be equivalent to that of decoders that have the notion of macroblock addresses. The speed impact should not be measurable as this is outside of the macroblock loop. Also checking that the macroblock position is within the bounds of the image probably helps with robustness. Index: slice.c =================================================================== RCS file: /cvsroot/libmpeg2/mpeg2dec/libmpeg2/slice.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- slice.c 2001/07/19 08:21:13 1.1.1.1 +++ slice.c 2001/09/03 10:46:51 1.2 @@ -1590,6 +1590,19 @@ GET_MACROBLOCK_ADDRESS_INCREMENT (offset); offset <<= 4; + while (offset - picture->coded_picture_width >= 0) { + offset -= picture->coded_picture_width; + if ((picture->current_frame->copy == NULL) || + (picture->picture_coding_type != B_TYPE)) { + dest[0] += 16 * stride; + dest[1] += 4 * stride; + dest[2] += 4 * stride; + } + picture->v_offset += 16; + } + if (picture->v_offset >= picture->coded_picture_height) + return; + while (1) { int mba_inc; |