changeset 2658:d1609cfeb1d0 libavcodec

#defines for strict_std_compliance and split between inofficial extensions and non standarized things
author michael
date Sun, 08 May 2005 20:15:42 +0000
parents 24472383b36f
children 4023235edd2e
files avcodec.h ffv1.c g726.c h263.c huffyuv.c mpeg12.c mpegvideo.c snow.c
diffstat 8 files changed, 19 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Sun May 08 18:48:19 2005 +0000
+++ b/avcodec.h	Sun May 08 20:15:42 2005 +0000
@@ -954,7 +954,12 @@
      * - decoding: unused
      */
     int strict_std_compliance;
-    
+#define FF_COMPLIANCE_VERY_STRICT   2 ///< strictly conform to a older more strict version of the spec or reference software
+#define FF_COMPLIANCE_STRICT        1 ///< strictly conform to all the things in the spec no matter what consequences
+#define FF_COMPLIANCE_NORMAL        0
+#define FF_COMPLIANCE_INOFFICIAL   -1 ///< allow inofficial extensions
+#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< allow non standarized experimental things
+
     /**
      * qscale offset between ip and b frames.
      * if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset)
--- a/ffv1.c	Sun May 08 18:48:19 2005 +0000
+++ b/ffv1.c	Sun May 08 20:15:42 2005 +0000
@@ -550,9 +550,9 @@
     FFV1Context *s = avctx->priv_data;
     int i;
 
-    if(avctx->strict_std_compliance >= 0){
+    if(avctx->strict_std_compliance >FF_COMPLIANCE_EXPERIMENTAL){
         av_log(avctx, AV_LOG_ERROR, "this codec is under development, files encoded with it may not be decodeable with future versions!!!\n"
-               "use vstrict=-1 / -strict -1 to use it anyway\n");
+               "use vstrict=-2 / -strict -2 to use it anyway\n");
         return -1;
     }
         
--- a/g726.c	Sun May 08 18:48:19 2005 +0000
+++ b/g726.c	Sun May 08 20:15:42 2005 +0000
@@ -327,7 +327,7 @@
         av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");
 	return -1;
     }
-    if (avctx->sample_rate != 8000 && avctx->strict_std_compliance>=0) {
+    if (avctx->sample_rate != 8000 && avctx->strict_std_compliance>FF_COMPLIANCE_INOFFICIAL) {
         av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");
 	return -1;
     }
--- a/h263.c	Sun May 08 18:48:19 2005 +0000
+++ b/h263.c	Sun May 08 20:15:42 2005 +0000
@@ -2408,9 +2408,9 @@
     
     if(s->pict_type==I_TYPE){
         if(!(s->flags&CODEC_FLAG_GLOBAL_HEADER)){
-            if(s->strict_std_compliance < 2) //HACK, the reference sw is buggy
+            if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) //HACK, the reference sw is buggy
                 mpeg4_encode_visual_object_header(s);
-            if(s->strict_std_compliance < 2 || picture_number==0) //HACK, the reference sw is buggy
+            if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT || picture_number==0) //HACK, the reference sw is buggy
                 mpeg4_encode_vol_header(s, 0, 0);
         }
         if(!(s->workaround_bugs & FF_BUG_MS))
--- a/huffyuv.c	Sun May 08 18:48:19 2005 +0000
+++ b/huffyuv.c	Sun May 08 20:15:42 2005 +0000
@@ -541,8 +541,8 @@
         }
         if(s->interlaced != ( s->height > 288 ))
             av_log(avctx, AV_LOG_INFO, "using huffyuv 2.2.0 or newer interlacing flag\n");
-    }else if(avctx->strict_std_compliance>=0){
-        av_log(avctx, AV_LOG_ERROR, "This codec is under development; files encoded with it may not be decodable with future versions!!! Set vstrict=-1 / -strict -1 to use it anyway.\n");
+    }else if(avctx->strict_std_compliance>FF_COMPLIANCE_EXPERIMENTAL){
+        av_log(avctx, AV_LOG_ERROR, "This codec is under development; files encoded with it may not be decodable with future versions!!! Set vstrict=-2 / -strict -2 to use it anyway.\n");
         return -1;
     }
     
--- a/mpeg12.c	Sun May 08 18:48:19 2005 +0000
+++ b/mpeg12.c	Sun May 08 20:15:42 2005 +0000
@@ -203,7 +203,7 @@
     for(i=1;i<14;i++) {
         int64_t n0= 1001LL/frame_rate_tab[i].den*frame_rate_tab[i].num*s->avctx->time_base.num;
         int64_t n1= 1001LL*s->avctx->time_base.den;
-        if(s->avctx->strict_std_compliance >= 0 && i>=9) break;
+        if(s->avctx->strict_std_compliance > FF_COMPLIANCE_INOFFICIAL && i>=9) break;
 
         d = ABS(n0 - n1);
         if(d < dmin){
@@ -225,7 +225,7 @@
         return -1;
 
     if(find_frame_rate_index(s) < 0){
-        if(s->strict_std_compliance >=0){
+        if(s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){
             av_log(avctx, AV_LOG_ERROR, "MPEG1/2 does not support %d/%d fps\n", avctx->time_base.den, avctx->time_base.num);
             return -1;
         }else{
--- a/mpegvideo.c	Sun May 08 18:48:19 2005 +0000
+++ b/mpegvideo.c	Sun May 08 20:15:42 2005 +0000
@@ -898,12 +898,12 @@
     }
 
     if(avctx->codec_id == CODEC_ID_MJPEG || avctx->codec_id == CODEC_ID_LJPEG){
-        if(avctx->strict_std_compliance>=0 && avctx->pix_fmt != PIX_FMT_YUVJ420P){
+        if(avctx->strict_std_compliance>FF_COMPLIANCE_INOFFICIAL && avctx->pix_fmt != PIX_FMT_YUVJ420P){
             av_log(avctx, AV_LOG_ERROR, "colorspace not supported in jpeg\n");
             return -1;
         }
     }else{
-        if(avctx->strict_std_compliance>=0 && avctx->pix_fmt != PIX_FMT_YUV420P){
+        if(avctx->strict_std_compliance>FF_COMPLIANCE_INOFFICIAL && avctx->pix_fmt != PIX_FMT_YUV420P){
             av_log(avctx, AV_LOG_ERROR, "colorspace not supported\n");
             return -1;
         }
--- a/snow.c	Sun May 08 18:48:19 2005 +0000
+++ b/snow.c	Sun May 08 20:15:42 2005 +0000
@@ -3340,9 +3340,9 @@
     SnowContext *s = avctx->priv_data;
     int plane_index;
 
-    if(avctx->strict_std_compliance >= 0){
+    if(avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){
         av_log(avctx, AV_LOG_ERROR, "this codec is under development, files encoded with it may not be decodable with future versions!!!\n"
-               "use vstrict=-1 / -strict -1 to use it anyway\n");
+               "use vstrict=-2 / -strict -2 to use it anyway\n");
         return -1;
     }