changeset 1457:460e5ead6722 libavcodec

detect old xvid with fourcc=DIVX remove "this file was encoded with ..." stuff (use debug=4096 if u want to know that)
author michaelni
date Wed, 10 Sep 2003 11:28:18 +0000
parents 670fca257a69
children 40b69d238beb
files avcodec.h h263.c h263dec.c
diffstat 3 files changed, 12 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Wed Sep 10 08:20:14 2003 +0000
+++ b/avcodec.h	Wed Sep 10 11:28:18 2003 +0000
@@ -979,6 +979,7 @@
 #define FF_DEBUG_PTS       0x00000200
 #define FF_DEBUG_ER        0x00000400
 #define FF_DEBUG_MMCO      0x00000800
+#define FF_DEBUG_BUGS      0x00001000
     
     /**
      * error.
--- a/h263.c	Wed Sep 10 08:20:14 2003 +0000
+++ b/h263.c	Wed Sep 10 11:28:18 2003 +0000
@@ -4781,13 +4781,6 @@
         s->divx_version= ver;
         s->divx_build= build;
         s->divx_packed= e==3 && last=='p';
-        if(s->picture_number==0){
-            printf("This file was encoded with DivX%d Build%d", ver, build);
-            if(s->divx_packed)
-                printf("p\n");
-            else
-                printf("\n");
-        }
     }
     
     /* ffmpeg detection */
@@ -4803,16 +4796,12 @@
     if(e==4){
         s->ffmpeg_version= ver*256*256 + ver2*256 + ver3;
         s->lavc_build= build;
-        if(s->picture_number==0)
-            printf("This file was encoded with libavcodec build %d\n", build);
     }
     
     /* xvid detection */
     e=sscanf(buf, "XviD%d", &build);
     if(e==1){
         s->xvid_build= build;
-        if(s->picture_number==0)
-            printf("This file was encoded with XviD build %d\n", build);
     }
 
 //printf("User Data: %s\n", buf);
@@ -4982,12 +4971,12 @@
              s->b_code=1;
 
          if(s->avctx->debug&FF_DEBUG_PICT_INFO){
-             printf("qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d\n", 
+             printf("qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d vot:%d%s\n", 
                  s->qscale, s->f_code, s->b_code, 
                  s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")), 
                  gb->size_in_bits,s->progressive_sequence, s->alternate_scan, s->top_field_first, 
                  s->quarter_sample ? "q" : "h", s->data_partitioning, s->resync_marker, s->num_sprite_warping_points,
-                 s->sprite_warping_accuracy, 1-s->no_rounding); 
+                 s->sprite_warping_accuracy, 1-s->no_rounding, s->vo_type, s->vol_control_parameters ? " VOLC" : " "); 
          }
 
          if(!s->scalability){
--- a/h263dec.c	Wed Sep 10 08:20:14 2003 +0000
+++ b/h263dec.c	Wed Sep 10 11:28:18 2003 +0000
@@ -484,6 +484,10 @@
     if(s->xvid_build==0 && s->divx_version==0 && s->lavc_build==0){
         if(s->avctx->codec_tag == ff_get_fourcc("XVID") || s->avctx->codec_tag == ff_get_fourcc("XVIX"))
             s->xvid_build= -1;
+        
+        if(s->avctx->codec_tag == ff_get_fourcc("DIVX") && s->vo_type==0 && s->vol_control_parameters==1
+           && s->padding_bug_score > 0 && s->low_delay) // XVID with modified fourcc 
+            s->xvid_build= -1;
 
         if(s->avctx->codec_tag == ff_get_fourcc("DIVX") && s->vo_type==0 && s->vol_control_parameters==0)
             s->divx_version= 400; //divx 4
@@ -577,6 +581,11 @@
         SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_old_c)
     }
 
+    if(avctx->debug & FF_DEBUG_BUGS)
+        printf("bugs: %X lavc_build:%d xvid_build:%d divx_version:%d divx_build:%d %s\n", 
+               s->workaround_bugs, s->lavc_build, s->xvid_build, s->divx_version, s->divx_build,
+               s->divx_packed ? "p" : "");
+    
 #if 0 // dump bits per frame / qp / complexity
 {
     static FILE *f=NULL;