]> git.sesse.net Git - ffmpeg/commitdiff
seperate bitstream encoding skip from PASS1 flag
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Feb 2005 10:36:07 +0000 (10:36 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Feb 2005 10:36:07 +0000 (10:36 +0000)
Originally committed as revision 3938 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffmpeg.c
libavcodec/avcodec.h
libavcodec/huffyuv.c

index f8ba68901e55d67d2808f1048dd2f9fe973d22c6..7f962fcd7edc1660d9771a80c85ccc4376c1d755 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -170,6 +170,7 @@ static int do_normalize_aqp = 0;
 static int qns = 0;
 static int closed_gop = 0;
 static int strict_gop = 0;
+static int no_output = 0;
 static int do_deinterlace = 0;
 static int do_interlace_dct = 0;
 static int do_interlace_me = 0;
@@ -3220,6 +3221,9 @@ static void opt_output_file(const char *filename)
                 if (do_interlace_me) {
                     video_enc->flags |= CODEC_FLAG_INTERLACED_ME;
                 }
+                if (no_output) {
+                    video_enc->flags2 |= CODEC_FLAG2_NO_OUTPUT;
+                }
                 video_enc->qmin = video_qmin;
                 video_enc->qmax = video_qmax;
                 video_enc->lmin = video_lmin;
@@ -4025,6 +4029,7 @@ const OptionDef options[] = {
     { "naq", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_normalize_aqp}, "normalize adaptive quantization" },
     { "cgop", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&closed_gop}, "closed gop" },
     { "sgop", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&strict_gop}, "strict gop" },
+    { "noout", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&no_output}, "skip bitstream encoding" },
     { "scan_offset", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&use_scan_offset}, "enable SVCD Scan Offset placeholder" },
     { "qpel", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&use_qpel}, "enable 1/4-pel" },
     { "intra_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_intra_matrix}, "specify intra matrix coeffs", "matrix" },
index 826b227df52a6fee9c5c926b53723e9c86d76d81..9a32df77077d747fd7eac46b1f30fa25cd7f4d13 100644 (file)
@@ -321,6 +321,7 @@ extern int motion_estimation_method;
 #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)
index ac1a8b2c85504d82c741baf23ebcaed5c7ca4921..723a7fad6b61fccd80ed4fbe231192eeb60b2553 100644 (file)
@@ -644,7 +644,10 @@ static int encode_422_bitstream(HYuvContext *s, int count){
             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 @@ static int encode_gray_bitstream(HYuvContext *s, int count){
             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 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
             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';