changeset 2501:236562127b89 libavcodec

seperate bitstream encoding skip from PASS1 flag
author michael
date Sun, 06 Feb 2005 10:36:07 +0000
parents 99b1de0018bb
children f5fe61bd08ac
files avcodec.h huffyuv.c
diffstat 2 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Fri Feb 04 11:53:35 2005 +0000
+++ b/avcodec.h	Sun Feb 06 10:36:07 2005 +0000
@@ -321,6 +321,7 @@
 #define CODEC_FLAG_CLOSED_GOP     0x80000000
 #define CODEC_FLAG2_FAST          0x00000001 ///< allow non spec compliant speedup tricks
 #define CODEC_FLAG2_STRICT_GOP    0x00000002 ///< strictly enforce GOP size
+#define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< skip bitstream encoding
 
 /* Unsupported options :
  * 		Syntax Arithmetic coding (SAC)
--- a/huffyuv.c	Fri Feb 04 11:53:35 2005 +0000
+++ b/huffyuv.c	Sun Feb 06 10:36:07 2005 +0000
@@ -644,7 +644,10 @@
             s->stats[0][ s->temp[0][2*i+1] ]++;
             s->stats[2][ s->temp[2][  i  ] ]++;
         }
-    }else if(s->context){
+    }
+    if(s->avctx->flags2&CODEC_FLAG2_NO_OUTPUT)
+        return 0;
+    if(s->context){
         for(i=0; i<count; i++){
             s->stats[0][ s->temp[0][2*i  ] ]++;
             put_bits(&s->pb, s->len[0][ s->temp[0][2*i  ] ], s->bits[0][ s->temp[0][2*i  ] ]);
@@ -680,7 +683,11 @@
             s->stats[0][ s->temp[0][2*i  ] ]++;
             s->stats[0][ s->temp[0][2*i+1] ]++;
         }
-    }else if(s->context){
+    }
+    if(s->avctx->flags2&CODEC_FLAG2_NO_OUTPUT)
+        return 0;
+    
+    if(s->context){
         for(i=0; i<count; i++){
             s->stats[0][ s->temp[0][2*i  ] ]++;
             put_bits(&s->pb, s->len[0][ s->temp[0][2*i  ] ], s->bits[0][ s->temp[0][2*i  ] ]);
@@ -1176,7 +1183,8 @@
             snprintf(p, end-p, "\n");
             p++;
         }
-    }else{
+    }
+    if(!(s->avctx->flags2 & CODEC_FLAG2_NO_OUTPUT)){
         flush_put_bits(&s->pb);
         s->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, size);
         avctx->stats_out[0] = '\0';