changeset 1011:3b7fcfb9c551 libavcodec

bugs
author michaelni
date Sat, 18 Jan 2003 01:37:42 +0000
parents 3c110cba4b29
children 7a5038ec769b
files dsputil.c motion_est.c motion_est_template.c mpegvideo.c
diffstat 4 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/dsputil.c	Fri Jan 17 22:40:00 2003 +0000
+++ b/dsputil.c	Sat Jan 18 01:37:42 2003 +0000
@@ -1894,10 +1894,11 @@
                 run++;
         }
         i= scantable[last];
+       
+        level= temp[i] + 64;
+
+        assert(level - 64);
         
-        assert(level);
-        
-        level= temp[i] + 64;
         if((level&(~127)) == 0){
             bits+= last_length[UNI_AC_ENC_INDEX(run, level)];
         }else
--- a/motion_est.c	Fri Jan 17 22:40:00 2003 +0000
+++ b/motion_est.c	Sat Jan 18 01:37:42 2003 +0000
@@ -1,7 +1,7 @@
 /*
  * Motion estimation 
  * Copyright (c) 2000,2001 Fabrice Bellard.
- * Copyright (c) 2002 Michael Niedermayer
+ * Copyright (c) 2002-2003 Michael Niedermayer
  * 
  *
  * This library is free software; you can redistribute it and/or
@@ -313,6 +313,7 @@
     case FF_CMP_DCT:
     case FF_CMP_SATD:
     case FF_CMP_SSE:
+    case FF_CMP_PSNR:
         return s->qscale*8;
     case FF_CMP_BIT:
         return 1;
@@ -1030,7 +1031,7 @@
             }
 #endif
         }else{
-            s->scene_change_score+= 20;
+            s->scene_change_score+= s->qscale;
             mb_type|= MB_TYPE_INTRA;
             mx = 0;
             my = 0;
--- a/motion_est_template.c	Fri Jan 17 22:40:00 2003 +0000
+++ b/motion_est_template.c	Sat Jan 18 01:37:42 2003 +0000
@@ -160,7 +160,7 @@
         
     if(s->avctx->me_cmp != s->avctx->me_sub_cmp){
         CMP_HPEL(dmin, 0, 0, mx, my, size);
-        if(mx || my)
+        if(mx || my || size>0)
             dmin += (mv_penalty[2*mx - pred_x] + mv_penalty[2*my - pred_y])*penalty_factor;
     }
         
@@ -290,7 +290,7 @@
         
     if(s->avctx->me_cmp != s->avctx->me_sub_cmp){
         CMP_QPEL(dmin, 0, 0, mx, my, size);
-        if(mx || my)
+        if(mx || my || size>0)
             dmin += (mv_penalty[4*mx - pred_x] + mv_penalty[4*my - pred_y])*penalty_factor;
     }
         
--- a/mpegvideo.c	Fri Jan 17 22:40:00 2003 +0000
+++ b/mpegvideo.c	Sat Jan 18 01:37:42 2003 +0000
@@ -2592,7 +2592,7 @@
         s->block_last_index[4]=
         s->block_last_index[5]= 0;
         s->block[4][0]=
-        s->block[5][0]= 128;
+        s->block[5][0]= (1024 + s->c_dc_scale/2)/ s->c_dc_scale;
     }
 
 #ifdef CONFIG_ENCODERS