# HG changeset patch # User michaelni # Date 1030378241 0 # Node ID df2102629fefacebe4ba188e3d40b53aadc27bb2 # Parent 0fe52ab8042c22390d0e3a0d7b65c1168d4311eb fixing some 64bit bugs diff -r 0fe52ab8042c -r df2102629fef h263.c --- a/h263.c Mon Aug 26 08:14:36 2002 +0000 +++ b/h263.c Mon Aug 26 16:10:41 2002 +0000 @@ -2900,7 +2900,7 @@ if (s->h263_rv10 && level == -128) { /* XXX: should patch encoder too */ level = get_bits(&s->gb, 12); - level = (level << 20) >> 20; + level= (level + ((-1)<<11)) ^ ((-1)<<11); //sign extension } } else { run = rl->table_run[code]; diff -r 0fe52ab8042c -r df2102629fef mpeg12.c --- a/mpeg12.c Mon Aug 26 08:14:36 2002 +0000 +++ b/mpeg12.c Mon Aug 26 16:10:41 2002 +0000 @@ -1049,7 +1049,7 @@ /* escape */ run = get_bits(&s->gb, 6); level = get_bits(&s->gb, 8); - level = (level << 24) >> 24; + level= (level + ((-1)<<7)) ^ ((-1)<<7); //sign extension if (level == -128) { level = get_bits(&s->gb, 8) - 256; } else if (level == 0) { @@ -1128,7 +1128,7 @@ /* escape */ run = get_bits(&s->gb, 6); level = get_bits(&s->gb, 12); - level = (level << 20) >> 20; + level= (level + ((-1)<<11)) ^ ((-1)<<11); //sign extension } else { run = rl->table_run[code]; level = rl->table_level[code]; @@ -1211,7 +1211,7 @@ /* escape */ run = get_bits(&s->gb, 6); level = get_bits(&s->gb, 12); - level = (level << 20) >> 20; + level= (level + ((-1)<<11)) ^ ((-1)<<11); //sign extension } else { run = rl->table_run[code]; level = rl->table_level[code];