changeset 1116:86a5d0ce86bf libavcodec

merging fourcc with codec_tag
author michaelni
date Sat, 08 Mar 2003 01:40:52 +0000
parents 74a46d77e061
children 4046cbf85762
files avcodec.h h263dec.c mpegvideo.c
diffstat 3 files changed, 22 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Fri Mar 07 13:49:10 2003 +0000
+++ b/avcodec.h	Sat Mar 08 01:40:52 2003 +0000
@@ -15,8 +15,8 @@
 
 #define LIBAVCODEC_VERSION_INT 0x000406
 #define LIBAVCODEC_VERSION     "0.4.6"
-#define LIBAVCODEC_BUILD       4660
-#define LIBAVCODEC_BUILD_STR   "4660"
+#define LIBAVCODEC_BUILD       4661
+#define LIBAVCODEC_BUILD_STR   "4661"
 
 enum CodecID {
     CODEC_ID_NONE, 
@@ -535,10 +535,10 @@
     /**
      * number of bits used for the previously encoded frame.
      * - encoding: set by lavc
-     * - decoding: - for audio - bits_per_sample
+     * - decoding: unused
      */
     int frame_bits;
-                 
+
     /**
      * private data of the user, can be used to carry app specific stuff.
      * - encoding: set by user
@@ -549,7 +549,14 @@
     char codec_name[32];
     enum CodecType codec_type; /* see CODEC_TYPE_xxx */
     enum CodecID codec_id; /* see CODEC_ID_xxx */
-    unsigned int codec_tag;  ///< codec tag, only used if unknown codec
+    
+    /**
+     * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
+     * this is used to workaround some encoder bugs
+     * - encoding: unused
+     * - decoding: set by user, will be converted to upper case by lavc during init
+     */
+    unsigned int codec_tag;
     
     /**
      * workaround bugs in encoders which sometimes cannot be detected automatically.
@@ -783,14 +790,6 @@
     float dark_masking;
     
     /**
-     * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
-     * this is used to workaround some encoder bugs
-     * - encoding: unused
-     * - decoding: set by user, will be converted to upper case by lavc during init
-     */
-    int fourcc;
-
-    /**
      * idct algorithm, see FF_IDCT_* below.
      * - encoding: set by user
      * - decoding: set by user
--- a/h263dec.c	Fri Mar 07 13:49:10 2003 +0000
+++ b/h263dec.c	Sat Mar 08 01:40:52 2003 +0000
@@ -488,16 +488,16 @@
         else
             s->workaround_bugs &= ~FF_BUG_NO_PADDING;
 
-        if(s->avctx->fourcc == ff_get_fourcc("XVIX")) 
+        if(s->avctx->codec_tag == ff_get_fourcc("XVIX")) 
             s->workaround_bugs|= FF_BUG_XVID_ILACE;
 #if 0
-        if(s->avctx->fourcc == ff_get_fourcc("MP4S")) 
+        if(s->avctx->codec_tag == ff_get_fourcc("MP4S")) 
             s->workaround_bugs|= FF_BUG_AC_VLC;
         
-        if(s->avctx->fourcc == ff_get_fourcc("M4S2")) 
+        if(s->avctx->codec_tag == ff_get_fourcc("M4S2")) 
             s->workaround_bugs|= FF_BUG_AC_VLC;
 #endif
-        if(s->avctx->fourcc == ff_get_fourcc("UMP4")){
+        if(s->avctx->codec_tag == ff_get_fourcc("UMP4")){
             s->workaround_bugs|= FF_BUG_UMP4;
             s->workaround_bugs|= FF_BUG_AC_VLC;
         }
@@ -510,10 +510,10 @@
             s->workaround_bugs|= FF_BUG_QPEL_CHROMA2;
         }
 
-        if(s->avctx->fourcc == ff_get_fourcc("XVID") && s->xvid_build==0)
+        if(s->avctx->codec_tag == ff_get_fourcc("XVID") && s->xvid_build==0)
             s->workaround_bugs|= FF_BUG_QPEL_CHROMA;
         
-        if(s->avctx->fourcc == ff_get_fourcc("XVID") && s->xvid_build==0)
+        if(s->avctx->codec_tag == ff_get_fourcc("XVID") && s->xvid_build==0)
             s->padding_bug_score= 256*256*256*64;
         
         if(s->xvid_build && s->xvid_build<=3)
--- a/mpegvideo.c	Fri Mar 07 13:49:10 2003 +0000
+++ b/mpegvideo.c	Sat Mar 08 01:40:52 2003 +0000
@@ -339,10 +339,10 @@
     yc_size = y_size + 2 * c_size;
 
     /* convert fourcc to upper case */
-    s->avctx->fourcc=   toupper( s->avctx->fourcc     &0xFF)          
-                     + (toupper((s->avctx->fourcc>>8 )&0xFF)<<8 )
-                     + (toupper((s->avctx->fourcc>>16)&0xFF)<<16) 
-                     + (toupper((s->avctx->fourcc>>24)&0xFF)<<24);
+    s->avctx->codec_tag=   toupper( s->avctx->codec_tag     &0xFF)          
+                        + (toupper((s->avctx->codec_tag>>8 )&0xFF)<<8 )
+                        + (toupper((s->avctx->codec_tag>>16)&0xFF)<<16) 
+                        + (toupper((s->avctx->codec_tag>>24)&0xFF)<<24);
 
     CHECKED_ALLOCZ(s->allocated_edge_emu_buffer, (s->width+64)*2*17*2); //(width + edge + align)*interlaced*MBsize*tolerance
     s->edge_emu_buffer= s->allocated_edge_emu_buffer + (s->width+64)*2*17;