changeset 617:df2102629fef libavcodec

fixing some 64bit bugs
author michaelni
date Mon, 26 Aug 2002 16:10:41 +0000
parents 0fe52ab8042c
children 4f3d4a07d374
files h263.c mpeg12.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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];
--- 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];