diff options
author | Mike Melanson <mike@multimedia.cx> | 2003-06-19 00:47:19 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2003-06-19 00:47:19 +0000 |
commit | 6f3b07176ae833429586bf9d27c8477db9efa7a7 (patch) | |
tree | acba2593ed69e5a2aaa96aea9215948459d8ea8f /src/libffmpeg/libavcodec/dv.c | |
parent | c52df867db2f177dcabbbbe2b93517c9bf4f8ae1 (diff) | |
download | xine-lib-6f3b07176ae833429586bf9d27c8477db9efa7a7.tar.gz xine-lib-6f3b07176ae833429586bf9d27c8477db9efa7a7.tar.bz2 |
maintenance ffmpeg sync: import and activate decoders for 4X and
RealAudio codecs; import VP3 decoder but leave de-activated; fixes for
SVQ3 bugs; more conditional compilation for encoders
CVS patchset: 5067
CVS date: 2003/06/19 00:47:19
Diffstat (limited to 'src/libffmpeg/libavcodec/dv.c')
-rw-r--r-- | src/libffmpeg/libavcodec/dv.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/libffmpeg/libavcodec/dv.c b/src/libffmpeg/libavcodec/dv.c index 32d4c3a27..d454e61e6 100644 --- a/src/libffmpeg/libavcodec/dv.c +++ b/src/libffmpeg/libavcodec/dv.c @@ -157,7 +157,7 @@ static const uint16_t block_sizes[6] = { }; #ifndef ALT_BITSTREAM_READER -#error only works with ALT_BITSTREAM_READER +#warning only works with ALT_BITSTREAM_READER #endif /* decode ac coefs */ @@ -171,7 +171,10 @@ static void dv_decode_ac(DVVideoDecodeContext *s, int pos = mb->pos; int level, pos1, sign, run; int partial_bit_count; - +#ifndef ALT_BITSTREAM_READER //FIXME + int re_index=0; + int re1_index=0; +#endif OPEN_READER(re, &s->gb); #ifdef VLC_DEBUG @@ -364,7 +367,7 @@ static inline void dv_decode_video_segment(DVVideoDecodeContext *s, /* write the remaining bits in a new buffer only if the block is finished */ - bits_left = last_index - s->gb.index; + bits_left = last_index - get_bits_count(&s->gb); if (mb->eob_reached) { mb->partial_bit_count = 0; mb_bit_count += bits_left; @@ -389,13 +392,13 @@ static inline void dv_decode_video_segment(DVVideoDecodeContext *s, mb = mb1; init_get_bits(&s->gb, mb_bit_buffer, 80*8); for(j = 0;j < 6; j++) { - if (!mb->eob_reached && s->gb.index < mb_bit_count) { + if (!mb->eob_reached && get_bits_count(&s->gb) < mb_bit_count) { dv_decode_ac(s, mb, block, mb_bit_count); /* if still not finished, no need to parse other blocks */ if (!mb->eob_reached) { /* we could not parse the current AC coefficient, so we add the remaining bytes */ - bits_left = mb_bit_count - s->gb.index; + bits_left = mb_bit_count - get_bits_count(&s->gb); if (bits_left > 0) { mb->partial_bit_count += bits_left; mb->partial_bit_buffer = @@ -410,7 +413,7 @@ static inline void dv_decode_video_segment(DVVideoDecodeContext *s, } /* all blocks are finished, so the extra bytes can be used at the video segment level */ - bits_left = mb_bit_count - s->gb.index; + bits_left = mb_bit_count - get_bits_count(&s->gb); vs_bit_count += bits_left; bit_copy(&vs_pb, &s->gb, bits_left); next_mb: @@ -473,12 +476,12 @@ static inline void dv_decode_video_segment(DVVideoDecodeContext *s, ptr = pixels; for(y = 0;y < 8; y++) { /* convert to 411P */ - c_ptr1 = c_ptr + linesize; - c_ptr1[0] = c_ptr[0] = (ptr[0] + ptr[1]) >> 1; - c_ptr1[1] = c_ptr[1] = (ptr[2] + ptr[3]) >> 1; - c_ptr1[2] = c_ptr[2] = (ptr[4] + ptr[5]) >> 1; - c_ptr1[3] = c_ptr[3] = (ptr[6] + ptr[7]) >> 1; - c_ptr += linesize * 2; + c_ptr1 = c_ptr + 8*linesize; + c_ptr[0]= ptr[0]; c_ptr1[0]= ptr[4]; + c_ptr[1]= ptr[1]; c_ptr1[1]= ptr[5]; + c_ptr[2]= ptr[2]; c_ptr1[2]= ptr[6]; + c_ptr[3]= ptr[3]; c_ptr1[3]= ptr[7]; + c_ptr += linesize; ptr += 8; } } else { |