diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-02-09 07:13:22 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-02-09 07:13:22 +0000 |
commit | 8700c75544d88f1479d5455b5b2788921d4dd5ee (patch) | |
tree | 7a80e2b00e4e7294c7d7ca1440c4d136ccf12998 /src/libmpeg2/slice.c | |
parent | 2f8fed75fc94e7afe89f7b60586f7cb55737efe1 (diff) | |
download | xine-lib-8700c75544d88f1479d5455b5b2788921d4dd5ee.tar.gz xine-lib-8700c75544d88f1479d5455b5b2788921d4dd5ee.tar.bz2 |
the long-awaited video_out changes, not completely debuged (races)
- pts are 64 bit now
- scr and video_out-loop run all the time
- video_out cleanups
- metronom cleanups
- buffer type BUF_CONTROL_DISCONTINUITY is used internally now,
input plugins should no longer send this one
- support for individual frame durations
- using nano-/usleep instead of itimer (simpler code, maybe this will
help freebsd)
CVS patchset: 1487
CVS date: 2002/02/09 07:13:22
Diffstat (limited to 'src/libmpeg2/slice.c')
-rw-r--r-- | src/libmpeg2/slice.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/libmpeg2/slice.c b/src/libmpeg2/slice.c index 4abdf8a4a..3cd547f24 100644 --- a/src/libmpeg2/slice.c +++ b/src/libmpeg2/slice.c @@ -968,7 +968,7 @@ do { \ NEEDBITS (bit_buf, bits, bit_ptr); \ continue; \ default: /* end of slice, or error */ \ - return; \ + return (mba >= picture->last_mba); \ } \ } \ DUMPBITS (bit_buf, bits, tab->len); \ @@ -1497,15 +1497,15 @@ do { \ dest[2] += 4 * stride; \ } while (0); \ if (! (picture->mpeg1)) \ - return; \ + return (mba >= picture->last_mba); \ picture->v_offset += 16; \ if (picture->v_offset >= picture->coded_picture_height) \ - return; \ + return 1; \ offset = 0; \ } \ } while (0) -void slice_process (picture_t * picture, uint8_t code, uint8_t * buffer) +int slice_process (picture_t * picture, uint8_t code, uint8_t * buffer) { #define bit_buf (picture->bitstream_buf) #define bits (picture->bitstream_bits) @@ -1515,8 +1515,10 @@ void slice_process (picture_t * picture, uint8_t code, uint8_t * buffer) uint8_t * dest[3]; int offset; uint8_t ** forward_ref[2]; + int mba; stride = picture->coded_picture_width; + mba = (code-1) * (stride >> 4); offset = (code - 1) * stride * 4; picture->v_offset = (code - 1) * 16; @@ -1592,6 +1594,7 @@ void slice_process (picture_t * picture, uint8_t code, uint8_t * buffer) NEEDBITS (bit_buf, bits, bit_ptr); GET_MACROBLOCK_ADDRESS_INCREMENT (offset); + mba += offset; offset <<= 4; while (1) { @@ -1744,6 +1747,7 @@ void slice_process (picture_t * picture, uint8_t code, uint8_t * buffer) picture->dc_dct_pred[2] = 1 << (picture->intra_dc_precision+7); } + mba++; offset += 16; CHECK_DISPLAY; @@ -1764,6 +1768,7 @@ void slice_process (picture_t * picture, uint8_t code, uint8_t * buffer) else MOTION (motion_fi_zero, MACROBLOCK_MOTION_FORWARD); + mba++; offset += 16; CHECK_DISPLAY; } while (--mba_inc); @@ -1776,6 +1781,7 @@ void slice_process (picture_t * picture, uint8_t code, uint8_t * buffer) else MOTION (motion_fi_reuse, macroblock_modes); + mba++; offset += 16; CHECK_DISPLAY; } while (--mba_inc); @@ -1785,4 +1791,7 @@ void slice_process (picture_t * picture, uint8_t code, uint8_t * buffer) #undef bit_buf #undef bits #undef bit_ptr + + return (mba >= picture->last_mba); + } |