diff mbox series

[FFmpeg-devel,04/12] vf_codecview: drop qp functionality

Message ID 20200224123739.31154-5-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/12] fifo: uninline av_fifo_peek2() on the next major bump
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Anton Khirnov Feb. 24, 2020, 12:37 p.m. UTC
It depends on API that has been deprecated for five years and is of
highly dubious usefulness.
---
 doc/filters.texi           |  3 ---
 libavfilter/vf_codecview.c | 26 --------------------------
 2 files changed, 29 deletions(-)
diff mbox series

Patch

diff --git a/doc/filters.texi b/doc/filters.texi
index 2a1235183f..43e52f930a 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -7182,9 +7182,6 @@  forward predicted MVs of B-frames
 backward predicted MVs of B-frames
 @end table
 
-@item qp
-Display quantization parameters using the chroma planes.
-
 @item mv_type, mvt
 Set motion vectors type to visualize. Includes MVs from all frames unless specified by @var{frame_type} option.
 
diff --git a/libavfilter/vf_codecview.c b/libavfilter/vf_codecview.c
index 331bfba777..2657660b97 100644
--- a/libavfilter/vf_codecview.c
+++ b/libavfilter/vf_codecview.c
@@ -50,7 +50,6 @@  typedef struct CodecViewContext {
     unsigned frame_type;
     unsigned mv_type;
     int hsub, vsub;
-    int qp;
 } CodecViewContext;
 
 #define OFFSET(x) offsetof(CodecViewContext, x)
@@ -62,7 +61,6 @@  static const AVOption codecview_options[] = {
         CONST("pf", "forward predicted MVs of P-frames",  MV_P_FOR,  "mv"),
         CONST("bf", "forward predicted MVs of B-frames",  MV_B_FOR,  "mv"),
         CONST("bb", "backward predicted MVs of B-frames", MV_B_BACK, "mv"),
-    { "qp", NULL, OFFSET(qp), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, .flags = FLAGS },
     { "mv_type", "set motion vectors type", OFFSET(mv_type), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, INT_MAX, FLAGS, "mv_type" },
     { "mvt",     "set motion vectors type", OFFSET(mv_type), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, INT_MAX, FLAGS, "mv_type" },
         CONST("fp", "forward predicted MVs",  MV_TYPE_FOR,  "mv_type"),
@@ -218,30 +216,6 @@  static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     CodecViewContext *s = ctx->priv;
     AVFilterLink *outlink = ctx->outputs[0];
 
-    if (s->qp) {
-        int qstride, qp_type;
-        int8_t *qp_table = av_frame_get_qp_table(frame, &qstride, &qp_type);
-
-        if (qp_table) {
-            int x, y;
-            const int w = AV_CEIL_RSHIFT(frame->width,  s->hsub);
-            const int h = AV_CEIL_RSHIFT(frame->height, s->vsub);
-            uint8_t *pu = frame->data[1];
-            uint8_t *pv = frame->data[2];
-            const int lzu = frame->linesize[1];
-            const int lzv = frame->linesize[2];
-
-            for (y = 0; y < h; y++) {
-                for (x = 0; x < w; x++) {
-                    const int qp = ff_norm_qscale(qp_table[(y >> 3) * qstride + (x >> 3)], qp_type) * 128/31;
-                    pu[x] = pv[x] = qp;
-                }
-                pu += lzu;
-                pv += lzv;
-            }
-        }
-    }
-
     if (s->mv || s->mv_type) {
         AVFrameSideData *sd = av_frame_get_side_data(frame, AV_FRAME_DATA_MOTION_VECTORS);
         if (sd) {