Commit 4e5c7633 authored by michaelni's avatar michaelni

fixing some 64bit bugs


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@867 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 154f4a62
...@@ -2900,7 +2900,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block, ...@@ -2900,7 +2900,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
if (s->h263_rv10 && level == -128) { if (s->h263_rv10 && level == -128) {
/* XXX: should patch encoder too */ /* XXX: should patch encoder too */
level = get_bits(&s->gb, 12); level = get_bits(&s->gb, 12);
level = (level << 20) >> 20; level= (level + ((-1)<<11)) ^ ((-1)<<11); //sign extension
} }
} else { } else {
run = rl->table_run[code]; run = rl->table_run[code];
......
...@@ -1049,7 +1049,7 @@ static int mpeg1_decode_block(MpegEncContext *s, ...@@ -1049,7 +1049,7 @@ static int mpeg1_decode_block(MpegEncContext *s,
/* escape */ /* escape */
run = get_bits(&s->gb, 6); run = get_bits(&s->gb, 6);
level = get_bits(&s->gb, 8); level = get_bits(&s->gb, 8);
level = (level << 24) >> 24; level= (level + ((-1)<<7)) ^ ((-1)<<7); //sign extension
if (level == -128) { if (level == -128) {
level = get_bits(&s->gb, 8) - 256; level = get_bits(&s->gb, 8) - 256;
} else if (level == 0) { } else if (level == 0) {
...@@ -1128,7 +1128,7 @@ static int mpeg2_decode_block_non_intra(MpegEncContext *s, ...@@ -1128,7 +1128,7 @@ static int mpeg2_decode_block_non_intra(MpegEncContext *s,
/* escape */ /* escape */
run = get_bits(&s->gb, 6); run = get_bits(&s->gb, 6);
level = get_bits(&s->gb, 12); level = get_bits(&s->gb, 12);
level = (level << 20) >> 20; level= (level + ((-1)<<11)) ^ ((-1)<<11); //sign extension
} else { } else {
run = rl->table_run[code]; run = rl->table_run[code];
level = rl->table_level[code]; level = rl->table_level[code];
...@@ -1211,7 +1211,7 @@ static int mpeg2_decode_block_intra(MpegEncContext *s, ...@@ -1211,7 +1211,7 @@ static int mpeg2_decode_block_intra(MpegEncContext *s,
/* escape */ /* escape */
run = get_bits(&s->gb, 6); run = get_bits(&s->gb, 6);
level = get_bits(&s->gb, 12); level = get_bits(&s->gb, 12);
level = (level << 20) >> 20; level= (level + ((-1)<<11)) ^ ((-1)<<11); //sign extension
} else { } else {
run = rl->table_run[code]; run = rl->table_run[code];
level = rl->table_level[code]; level = rl->table_level[code];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment