changeset 8612:b20c590170cc libavcodec

remove ff_get_fourcc() and use AV_RL32() instead
author aurel
date Sat, 17 Jan 2009 12:21:01 +0000
parents a637db9f59b1
children e75610c5da69
files 4xm.c asv1.c h263.c h263dec.c libxvidff.c mjpega_dump_header_bsf.c mjpegdec.c mpeg12.c shorten.c tta.c
diffstat 10 files changed, 29 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/4xm.c	Sat Jan 17 11:13:33 2009 +0000
+++ b/4xm.c	Sat Jan 17 12:21:01 2009 +0000
@@ -689,7 +689,7 @@
         av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d\n", buf_size, AV_RL32(buf+4));
     }
 
-    if(frame_4cc == ff_get_fourcc("cfrm")){
+    if(frame_4cc == AV_RL32("cfrm")){
         int free_index=-1;
         const int data_size= buf_size - 20;
         const int id= AV_RL32(buf+12);
@@ -730,7 +730,7 @@
             }
 
             cfrm->size= cfrm->id= 0;
-            frame_4cc= ff_get_fourcc("pfrm");
+            frame_4cc= AV_RL32("pfrm");
         }else
             return buf_size;
     }else{
@@ -756,19 +756,19 @@
         return -1;
     }
 
-    if(frame_4cc == ff_get_fourcc("ifr2")){
+    if(frame_4cc == AV_RL32("ifr2")){
         p->pict_type= FF_I_TYPE;
         if(decode_i2_frame(f, buf-4, frame_size) < 0)
             return -1;
-    }else if(frame_4cc == ff_get_fourcc("ifrm")){
+    }else if(frame_4cc == AV_RL32("ifrm")){
         p->pict_type= FF_I_TYPE;
         if(decode_i_frame(f, buf, frame_size) < 0)
             return -1;
-    }else if(frame_4cc == ff_get_fourcc("pfrm") || frame_4cc == ff_get_fourcc("pfr2")){
+    }else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){
         p->pict_type= FF_P_TYPE;
         if(decode_p_frame(f, buf, frame_size) < 0)
             return -1;
-    }else if(frame_4cc == ff_get_fourcc("snd_")){
+    }else if(frame_4cc == AV_RL32("snd_")){
         av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n", buf_size);
     }else{
         av_log(avctx, AV_LOG_ERROR, "ignoring unknown chunk length:%d\n", buf_size);
--- a/asv1.c	Sat Jan 17 11:13:33 2009 +0000
+++ b/asv1.c	Sat Jan 17 12:21:01 2009 +0000
@@ -584,7 +584,7 @@
     avctx->extradata= av_mallocz(8);
     avctx->extradata_size=8;
     ((uint32_t*)avctx->extradata)[0]= le2me_32(a->inv_qscale);
-    ((uint32_t*)avctx->extradata)[1]= le2me_32(ff_get_fourcc("ASUS"));
+    ((uint32_t*)avctx->extradata)[1]= le2me_32(AV_RL32("ASUS"));
 
     for(i=0; i<64; i++){
         int q= 32*scale*ff_mpeg1_default_intra_matrix[i];
--- a/h263.c	Sat Jan 17 11:13:33 2009 +0000
+++ b/h263.c	Sat Jan 17 12:21:01 2009 +0000
@@ -114,7 +114,7 @@
 static uint8_t static_rl_table_store[5][2][2*MAX_RUN + MAX_LEVEL + 3];
 
 #if 0 //3IV1 is quite rare and it slows things down a tiny bit
-#define IS_3IV1 s->codec_tag == ff_get_fourcc("3IV1")
+#define IS_3IV1 s->codec_tag == AV_RL32("3IV1")
 #else
 #define IS_3IV1 0
 #endif
@@ -5223,7 +5223,7 @@
         show_pict_info(s);
      }
 #if 1
-    if (s->pict_type == FF_I_TYPE && s->codec_tag == ff_get_fourcc("ZYGO")){
+    if (s->pict_type == FF_I_TYPE && s->codec_tag == AV_RL32("ZYGO")){
         int i,j;
         for(i=0; i<85; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb));
         av_log(s->avctx, AV_LOG_DEBUG, "\n");
@@ -5548,7 +5548,7 @@
             skip_bits1(gb);   /* marker */
             height = get_bits(gb, 13);
             skip_bits1(gb);   /* marker */
-            if(width && height && !(s->width && s->codec_tag == ff_get_fourcc("MP4S"))){ /* they should be non zero but who knows ... */
+            if(width && height && !(s->width && s->codec_tag == AV_RL32("MP4S"))){ /* they should be non zero but who knows ... */
                 s->width = width;
                 s->height = height;
 //                printf("width/height: %d %d\n", width, height);
@@ -6062,7 +6062,7 @@
     /* search next start code */
     align_get_bits(gb);
 
-    if(s->codec_tag == ff_get_fourcc("WV1F") && show_bits(gb, 24) == 0x575630){
+    if(s->codec_tag == AV_RL32("WV1F") && show_bits(gb, 24) == 0x575630){
         skip_bits(gb, 24);
         if(get_bits(gb, 8) == 0xF0)
             goto end;
--- a/h263dec.c	Sat Jan 17 11:13:33 2009 +0000
+++ b/h263dec.c	Sat Jan 17 12:21:01 2009 +0000
@@ -421,19 +421,19 @@
     avctx->has_b_frames= !s->low_delay;
 
     if(s->xvid_build==0 && s->divx_version==0 && s->lavc_build==0){
-        if(s->stream_codec_tag == ff_get_fourcc("XVID") ||
-           s->codec_tag == ff_get_fourcc("XVID") || s->codec_tag == ff_get_fourcc("XVIX") ||
-           s->codec_tag == ff_get_fourcc("RMP4"))
+        if(s->stream_codec_tag == AV_RL32("XVID") ||
+           s->codec_tag == AV_RL32("XVID") || s->codec_tag == AV_RL32("XVIX") ||
+           s->codec_tag == AV_RL32("RMP4"))
             s->xvid_build= -1;
 #if 0
-        if(s->codec_tag == ff_get_fourcc("DIVX") && s->vo_type==0 && s->vol_control_parameters==1
+        if(s->codec_tag == AV_RL32("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;
 #endif
     }
 
     if(s->xvid_build==0 && s->divx_version==0 && s->lavc_build==0){
-        if(s->codec_tag == ff_get_fourcc("DIVX") && s->vo_type==0 && s->vol_control_parameters==0)
+        if(s->codec_tag == AV_RL32("DIVX") && s->vo_type==0 && s->vol_control_parameters==0)
             s->divx_version= 400; //divx 4
     }
 
@@ -443,10 +443,10 @@
     }
 
     if(s->workaround_bugs&FF_BUG_AUTODETECT){
-        if(s->codec_tag == ff_get_fourcc("XVIX"))
+        if(s->codec_tag == AV_RL32("XVIX"))
             s->workaround_bugs|= FF_BUG_XVID_ILACE;
 
-        if(s->codec_tag == ff_get_fourcc("UMP4")){
+        if(s->codec_tag == AV_RL32("UMP4")){
             s->workaround_bugs|= FF_BUG_UMP4;
         }
 
--- a/libxvidff.c	Sat Jan 17 11:13:33 2009 +0000
+++ b/libxvidff.c	Sat Jan 17 12:21:01 2009 +0000
@@ -335,7 +335,7 @@
         /* We are claiming to be Xvid */
         x->quicktime_format = 0;
         if(!avctx->codec_tag)
-            avctx->codec_tag = ff_get_fourcc("xvid");
+            avctx->codec_tag = AV_RL32("xvid");
     }
 
     /* Bframes */
--- a/mjpega_dump_header_bsf.c	Sat Jan 17 11:13:33 2009 +0000
+++ b/mjpega_dump_header_bsf.c	Sat Jan 17 12:21:01 2009 +0000
@@ -73,7 +73,7 @@
                 *poutbuf_size = poutbufp - *poutbuf;
                 return 1;
             case APP1:
-                if (i + 8 < buf_size && AV_RL32(buf + i + 8) == ff_get_fourcc("mjpg")) {
+                if (i + 8 < buf_size && AV_RL32(buf + i + 8) == AV_RL32("mjpg")) {
                     av_log(avctx, AV_LOG_ERROR, "bitstream already formatted\n");
                     memcpy(*poutbuf, buf, buf_size);
                     *poutbuf_size = buf_size;
--- a/mjpegdec.c	Sat Jan 17 11:13:33 2009 +0000
+++ b/mjpegdec.c	Sat Jan 17 12:21:01 2009 +0000
@@ -1040,7 +1040,7 @@
     /* buggy AVID, it puts EOI only at every 10th frame */
     /* also this fourcc is used by non-avid files too, it holds some
        informations, but it's always present in AVID creates files */
-    if (id == ff_get_fourcc("AVI1"))
+    if (id == AV_RL32("AVI1"))
     {
         /* structure:
             4bytes      AVI1
@@ -1068,7 +1068,7 @@
 
 //    len -= 2;
 
-    if (id == ff_get_fourcc("JFIF"))
+    if (id == AV_RL32("JFIF"))
     {
         int t_w, t_h, v1, v2;
         skip_bits(&s->gb, 8); /* the trailing zero-byte */
@@ -1098,7 +1098,7 @@
         goto out;
     }
 
-    if (id == ff_get_fourcc("Adob") && (get_bits(&s->gb, 8) == 'e'))
+    if (id == AV_RL32("Adob") && (get_bits(&s->gb, 8) == 'e'))
     {
         if (s->avctx->debug & FF_DEBUG_PICT_INFO)
             av_log(s->avctx, AV_LOG_INFO, "mjpeg: Adobe header found\n");
@@ -1110,7 +1110,7 @@
         goto out;
     }
 
-    if (id == ff_get_fourcc("LJIF")){
+    if (id == AV_RL32("LJIF")){
         if (s->avctx->debug & FF_DEBUG_PICT_INFO)
             av_log(s->avctx, AV_LOG_INFO, "Pegasus lossless jpeg header found\n");
         skip_bits(&s->gb, 16); /* version ? */
@@ -1139,7 +1139,7 @@
         id = (get_bits(&s->gb, 16) << 16) | get_bits(&s->gb, 16);
         id = be2me_32(id);
         len -= 4;
-        if (id == ff_get_fourcc("mjpg")) /* Apple MJPEG-A */
+        if (id == AV_RL32("mjpg")) /* Apple MJPEG-A */
         {
 #if 0
             skip_bits(&s->gb, 32); /* field size */
--- a/mpeg12.c	Sat Jan 17 11:13:33 2009 +0000
+++ b/mpeg12.c	Sat Jan 17 12:21:01 2009 +0000
@@ -2278,7 +2278,7 @@
     }
 #endif
 
-    if(s->mpeg_enc_ctx_allocated==0 && avctx->codec_tag == ff_get_fourcc("VCR2"))
+    if(s->mpeg_enc_ctx_allocated==0 && avctx->codec_tag == AV_RL32("VCR2"))
         vcr2_init_sequence(avctx);
 
     s->slice_count= 0;
--- a/shorten.c	Sat Jan 17 11:13:33 2009 +0000
+++ b/shorten.c	Sat Jan 17 12:21:01 2009 +0000
@@ -305,7 +305,7 @@
     {
         int maxnlpc = 0;
         /* shorten signature */
-        if (get_bits_long(&s->gb, 32) != bswap_32(ff_get_fourcc("ajkg"))) {
+        if (get_bits_long(&s->gb, 32) != bswap_32(AV_RL32("ajkg"))) {
             av_log(s->avctx, AV_LOG_ERROR, "missing shorten magic 'ajkg'\n");
             return -1;
         }
--- a/tta.c	Sat Jan 17 11:13:33 2009 +0000
+++ b/tta.c	Sat Jan 17 12:21:01 2009 +0000
@@ -209,11 +209,11 @@
         return -1;
 
     init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size);
-    if (show_bits_long(&s->gb, 32) == ff_get_fourcc("TTA1"))
+    if (show_bits_long(&s->gb, 32) == AV_RL32("TTA1"))
     {
         /* signature */
         skip_bits(&s->gb, 32);
-//        if (get_bits_long(&s->gb, 32) != bswap_32(ff_get_fourcc("TTA1"))) {
+//        if (get_bits_long(&s->gb, 32) != bswap_32(AV_RL32("TTA1"))) {
 //            av_log(s->avctx, AV_LOG_ERROR, "Missing magic\n");
 //            return -1;
 //        }