changeset 1663:4ac3573977e6 libavcodec

alternative inter vlc encoding fix
author michael
date Mon, 08 Dec 2003 02:23:22 +0000
parents 64c370fe6e88
children 1c7ded3c2b25
files h263.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/h263.c	Sun Dec 07 02:10:30 2003 +0000
+++ b/h263.c	Mon Dec 08 02:23:22 2003 +0000
@@ -1979,6 +1979,8 @@
                 if (level) {
                     run = i - last_non_zero - 1;
                     last = (i == last_index);
+                    
+                    if(level<0) level= -level;
                 
                     code = get_rl_index(rl, last, run, level);
                     aic_code = get_rl_index(&rl_intra_aic, last, run, level);
@@ -1986,10 +1988,10 @@
                     aic_vlc_bits   += rl_intra_aic.table_vlc[aic_code][1]+1;
 
                     if (code == rl->n) {
-                        inter_vlc_bits += 1+6+8;
+                        inter_vlc_bits += 1+6+8-1;
                     }                
                     if (aic_code == rl_intra_aic.n) {
-                        aic_vlc_bits += 1+6+8;
+                        aic_vlc_bits += 1+6+8-1;
                         wrong_pos += run + 1;
                     }else
                         wrong_pos += wrong_run[aic_code];