[FFmpeg-cvslog] avconv: remove -same_quant

Anton Khirnov git at videolan.org
Wed Oct 10 13:56:08 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Oct  9 17:40:20 2012 +0200| [fb722a900fc5cc9e003b9fef25b27ed7fc5547a2] | committer: Anton Khirnov

avconv: remove -same_quant

It has not worked for anything other than fringe codecs (asv1/2, mdec,
mjpeg[b]) since about 2003 and nobody ever noticed or complained. This
sufficiently proves that there are no users of this option who have a
clue of what they are doing, so it is completely useless.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fb722a900fc5cc9e003b9fef25b27ed7fc5547a2
---

 Changelog       |    1 +
 avconv.c        |   16 +++-------------
 avconv.h        |    2 --
 avconv_opt.c    |    5 +----
 doc/avconv.texi |    5 -----
 doc/faq.texi    |   19 +++++++++----------
 6 files changed, 14 insertions(+), 34 deletions(-)

diff --git a/Changelog b/Changelog
index cc5eaeb..5948bbe 100644
--- a/Changelog
+++ b/Changelog
@@ -50,6 +50,7 @@ version <next>:
 - Smooth Streaming live segmenter muxer
 - RTP packetization of JPEG
 - Opus decoder and encoder using libopus
+- remove -same_quant, it hasn't worked for years
 
 
 version 0.8:
diff --git a/avconv.c b/avconv.c
index 9aaa4a8..219e9e2 100644
--- a/avconv.c
+++ b/avconv.c
@@ -514,7 +514,7 @@ static void do_subtitle_out(AVFormatContext *s,
 static void do_video_out(AVFormatContext *s,
                          OutputStream *ost,
                          AVFrame *in_picture,
-                         int *frame_size, float quality)
+                         int *frame_size)
 {
     int ret, format_video_sync;
     AVPacket pkt;
@@ -579,9 +579,7 @@ static void do_video_out(AVFormatContext *s,
                 big_picture.top_field_first = !!ost->top_field_first;
         }
 
-        /* handles same_quant here. This is not correct because it may
-           not be a global option */
-        big_picture.quality = quality;
+        big_picture.quality = ost->st->codec->global_quality;
         if (!enc->me_threshold)
             big_picture.pict_type = 0;
         if (ost->forced_kf_index < ost->forced_kf_count &&
@@ -708,9 +706,7 @@ static int poll_filter(OutputStream *ost)
         if (!ost->frame_aspect_ratio)
             ost->st->codec->sample_aspect_ratio = picref->video->pixel_aspect;
 
-        do_video_out(of->ctx, ost, filtered_frame, &frame_size,
-                     same_quant ? ost->last_quality :
-                                  ost->st->codec->global_quality);
+        do_video_out(of->ctx, ost, filtered_frame, &frame_size);
         if (vstats_filename && frame_size)
             do_video_stats(of->ctx, ost, frame_size);
         break;
@@ -1223,7 +1219,6 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
     AVFrame *decoded_frame;
     void *buffer_to_free = NULL;
     int i, ret = 0, resample_changed;
-    float quality;
 
     if (!ist->decoded_frame && !(ist->decoded_frame = avcodec_alloc_frame()))
         return AVERROR(ENOMEM);
@@ -1241,7 +1236,6 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
         return ret;
     }
 
-    quality = same_quant ? decoded_frame->quality : 0;
     decoded_frame->pts = guess_correct_pts(&ist->pts_ctx, decoded_frame->pkt_pts,
                                            decoded_frame->pkt_dts);
     pkt->size = 0;
@@ -1279,10 +1273,6 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
     }
 
     for (i = 0; i < ist->nb_filters; i++) {
-        // XXX what an ugly hack
-        if (ist->filters[i]->graph->nb_outputs == 1)
-            ist->filters[i]->graph->outputs[0]->ost->last_quality = quality;
-
         if (ist->st->codec->codec->capabilities & CODEC_CAP_DR1) {
             FrameBuffer      *buf = decoded_frame->opaque;
             AVFilterBufferRef *fb = avfilter_get_video_buffer_ref_from_arrays(
diff --git a/avconv.h b/avconv.h
index 1cfcc40..d546594 100644
--- a/avconv.h
+++ b/avconv.h
@@ -278,7 +278,6 @@ typedef struct OutputStream {
     int top_field_first;
 
     float frame_aspect_ratio;
-    float last_quality;
 
     /* forced key frames */
     int64_t *forced_kf_pts;
@@ -343,7 +342,6 @@ extern int copy_tb;
 extern int exit_on_error;
 extern int print_stats;
 extern int qp_hist;
-extern int same_quant;
 
 extern const AVIOInterruptCB int_cb;
 
diff --git a/avconv_opt.c b/avconv_opt.c
index f8a76c0..9f30134 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -71,7 +71,6 @@ int copy_tb           = 1;
 int exit_on_error     = 0;
 int print_stats       = 1;
 int qp_hist           = 0;
-int same_quant        = 0;
 
 static int file_overwrite     = 0;
 static int video_discard      = 0;
@@ -836,7 +835,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
     }
 
     MATCH_PER_STREAM_OPT(qscale, dbl, qscale, oc, st);
-    if (qscale >= 0 || same_quant) {
+    if (qscale >= 0) {
         st->codec->flags |= CODEC_FLAG_QSCALE;
         st->codec->global_quality = FF_QP2LAMBDA * qscale;
     }
@@ -1969,8 +1968,6 @@ const OptionDef options[] = {
         "rate control override for specific intervals", "override" },
     { "vcodec",       OPT_VIDEO | HAS_ARG  | OPT_PERFILE,                        { .func_arg = opt_video_codec },
         "force video codec ('copy' to copy stream)", "codec" },
-    { "same_quant",   OPT_VIDEO | OPT_BOOL | OPT_EXPERT,                         { &same_quant },
-        "use same quantizer as source (implies VBR)" },
     { "pass",         OPT_VIDEO | HAS_ARG | OPT_SPEC | OPT_INT,                  { .off = OFFSET(pass) },
         "select the pass number (1 or 2)", "n" },
     { "passlogfile",  OPT_VIDEO | HAS_ARG | OPT_STRING | OPT_EXPERT | OPT_SPEC,  { .off = OFFSET(passlogfiles) },
diff --git a/doc/avconv.texi b/doc/avconv.texi
index ecf7192..7341d2f 100644
--- a/doc/avconv.texi
+++ b/doc/avconv.texi
@@ -473,11 +473,6 @@ Disable video recording.
 
 @item -vcodec @var{codec} (@emph{output})
 Set the video codec. This is an alias for @code{-codec:v}.
- at item -same_quant
-Use same quantizer as source (implies VBR).
-
-Note that this is NOT SAME QUALITY. Do not use this option unless you know you
-need it.
 
 @item -pass[:@var{stream_specifier}] @var{n} (@emph{output,per-stream})
 Select the pass number (1 or 2). It is used to do two-pass
diff --git a/doc/faq.texi b/doc/faq.texi
index 79ef3b5..ac06ebf 100644
--- a/doc/faq.texi
+++ b/doc/faq.texi
@@ -216,15 +216,14 @@ equally humble @code{copy} under Windows), and finally transcoding back to your
 format of choice.
 
 @example
-avconv -i input1.avi -same_quant intermediate1.mpg
-avconv -i input2.avi -same_quant intermediate2.mpg
+avconv -i input1.avi intermediate1.mpg
+avconv -i input2.avi intermediate2.mpg
 cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
-avconv -i intermediate_all.mpg -same_quant output.avi
+avconv -i intermediate_all.mpg output.avi
 @end example
 
-Notice that you should either use @code{-same_quant} or set a reasonably high
-bitrate for your intermediate and output files, if you want to preserve
-video quality.
+Notice that you should set a reasonably high bitrate for your intermediate and
+output files, if you want to preserve video quality.
 
 Also notice that you may avoid the huge intermediate files by taking advantage
 of named pipes, should your platform support it:
@@ -232,10 +231,10 @@ of named pipes, should your platform support it:
 @example
 mkfifo intermediate1.mpg
 mkfifo intermediate2.mpg
-avconv -i input1.avi -same_quant -y intermediate1.mpg < /dev/null &
-avconv -i input2.avi -same_quant -y intermediate2.mpg < /dev/null &
+avconv -i input1.avi -y intermediate1.mpg < /dev/null &
+avconv -i input2.avi -y intermediate2.mpg < /dev/null &
 cat intermediate1.mpg intermediate2.mpg |\
-avconv -f mpeg -i - -same_quant -c:v mpeg4 -acodec libmp3lame output.avi
+avconv -f mpeg -i - -c:v mpeg4 -acodec libmp3lame output.avi
 @end example
 
 Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
@@ -262,7 +261,7 @@ cat temp1.a temp2.a > all.a &
 cat temp1.v temp2.v > all.v &
 avconv -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
        -f yuv4mpegpipe -i all.v \
-       -same_quant -y output.flv
+       -y output.flv
 rm temp[12].[av] all.[av]
 @end example
 



More information about the ffmpeg-cvslog mailing list