summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/rv10.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libffmpeg/libavcodec/rv10.c')
-rw-r--r--src/libffmpeg/libavcodec/rv10.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/libffmpeg/libavcodec/rv10.c b/src/libffmpeg/libavcodec/rv10.c
index 261c889de..438d0dd38 100644
--- a/src/libffmpeg/libavcodec/rv10.c
+++ b/src/libffmpeg/libavcodec/rv10.c
@@ -22,6 +22,8 @@
//#define DEBUG
+#define DC_VLC_BITS 9
+
static const UINT16 rv_lum_code[256] =
{
0x3e7f, 0x0f00, 0x0f01, 0x0f02, 0x0f03, 0x0f04, 0x0f05, 0x0f06,
@@ -173,7 +175,7 @@ int rv_decode_dc(MpegEncContext *s, int n)
int code;
if (n < 4) {
- code = get_vlc(&s->gb, &rv_dc_lum);
+ code = get_vlc2(&s->gb, rv_dc_lum.table, DC_VLC_BITS, 2);
if (code < 0) {
/* XXX: I don't understand why they use LONGER codes than
necessary. The following code would be completely useless
@@ -196,7 +198,7 @@ int rv_decode_dc(MpegEncContext *s, int n)
code -= 128;
}
} else {
- code = get_vlc(&s->gb, &rv_dc_chrom);
+ code = get_vlc2(&s->gb, rv_dc_chrom.table, DC_VLC_BITS, 2);
/* same remark */
if (code < 0) {
code = get_bits(&s->gb, 9);
@@ -351,10 +353,10 @@ static int rv10_decode_init(AVCodecContext *avctx)
/* init rv vlc */
if (!done) {
- init_vlc(&rv_dc_lum, 9, 256,
+ init_vlc(&rv_dc_lum, DC_VLC_BITS, 256,
rv_lum_bits, 1, 1,
rv_lum_code, 2, 2);
- init_vlc(&rv_dc_chrom, 9, 256,
+ init_vlc(&rv_dc_chrom, DC_VLC_BITS, 256,
rv_chrom_bits, 1, 1,
rv_chrom_code, 2, 2);
done = 1;
@@ -417,7 +419,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
}
if (s->mb_x == 0 && s->mb_y == 0) {
- MPV_frame_start(s);
+ MPV_frame_start(s, avctx);
}
#ifdef DEBUG
@@ -485,8 +487,8 @@ static int rv10_decode_frame(AVCodecContext *avctx,
pict->data[1] = s->current_picture[1];
pict->data[2] = s->current_picture[2];
pict->linesize[0] = s->linesize;
- pict->linesize[1] = s->linesize / 2;
- pict->linesize[2] = s->linesize / 2;
+ pict->linesize[1] = s->uvlinesize;
+ pict->linesize[2] = s->uvlinesize;
avctx->quality = s->qscale;
*data_size = sizeof(AVPicture);