diff mbox series

[FFmpeg-devel,07/12] vf_pp7: drop the option to use frame-attached QP tables

Message ID 20200224123739.31154-8-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
This API has been deprecated for five years.
---
 doc/filters.texi     |  3 +--
 libavfilter/vf_pp7.c | 34 ++++++++++------------------------
 2 files changed, 11 insertions(+), 26 deletions(-)
diff mbox series

Patch

diff --git a/doc/filters.texi b/doc/filters.texi
index 59571a7022..3b1470ed0f 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -15047,8 +15047,7 @@  The filter accepts the following options:
 @table @option
 @item qp
 Force a constant quantization parameter. It accepts an integer in range
-0 to 63. If not set, the filter will use the QP from the video stream
-(if available).
+0 to 63.
 
 @item mode
 Set thresholding mode. Available modes are:
diff --git a/libavfilter/vf_pp7.c b/libavfilter/vf_pp7.c
index 570a1c90b9..97f5b459cd 100644
--- a/libavfilter/vf_pp7.c
+++ b/libavfilter/vf_pp7.c
@@ -200,7 +200,7 @@  static int softthresh_c(PP7Context *p, int16_t *src, int qp)
 static void filter(PP7Context *p, uint8_t *dst, uint8_t *src,
                    int dst_stride, int src_stride,
                    int width, int height,
-                   uint8_t *qp_store, int qp_stride, int is_luma)
+                   int is_luma)
 {
     int x, y;
     const int stride = is_luma ? p->temp_stride : ((width + 16 + 15) & (~15));
@@ -232,16 +232,11 @@  static void filter(PP7Context *p, uint8_t *dst, uint8_t *src,
             dctA_c(tp + 4 * 8, src, stride);
         }
         for (x = 0; x < width; ) {
-            const int qps = 3 + is_luma;
             int qp;
             int end = FFMIN(x + 8, width);
 
-            if (p->qp)
-                qp = p->qp;
-            else {
-                qp = qp_store[ (FFMIN(x, width - 1) >> qps) + (FFMIN(y, height - 1) >> qps) * qp_stride];
-                qp = ff_norm_qscale(qp, p->qscale_type);
-            }
+            qp = p->qp;
+
             for (; x < end; x++) {
                 const int index = x + y * stride + (8 - 3) * (1 + stride) + 8; //FIXME silly offset
                 uint8_t *src = p_src + index;
@@ -321,12 +316,6 @@  static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     AVFilterLink *outlink = ctx->outputs[0];
     AVFrame *out = in;
 
-    int qp_stride = 0;
-    uint8_t *qp_table = NULL;
-
-    if (!pp7->qp)
-        qp_table = av_frame_get_qp_table(in, &qp_stride, &pp7->qscale_type);
-
     if (!ctx->is_disabled) {
         const int cw = AV_CEIL_RSHIFT(inlink->w, pp7->hsub);
         const int ch = AV_CEIL_RSHIFT(inlink->h, pp7->vsub);
@@ -347,16 +336,13 @@  static int filter_frame(AVFilterLink *inlink, AVFrame *in)
             out->height = in->height;
         }
 
-        if (qp_table || pp7->qp) {
-
-            filter(pp7, out->data[0], in->data[0], out->linesize[0], in->linesize[0],
-                   inlink->w, inlink->h, qp_table, qp_stride, 1);
-            filter(pp7, out->data[1], in->data[1], out->linesize[1], in->linesize[1],
-                   cw,        ch,        qp_table, qp_stride, 0);
-            filter(pp7, out->data[2], in->data[2], out->linesize[2], in->linesize[2],
-                   cw,        ch,        qp_table, qp_stride, 0);
-            emms_c();
-        }
+        filter(pp7, out->data[0], in->data[0], out->linesize[0], in->linesize[0],
+               inlink->w, inlink->h, 1);
+        filter(pp7, out->data[1], in->data[1], out->linesize[1], in->linesize[1],
+               cw,        ch,        0);
+        filter(pp7, out->data[2], in->data[2], out->linesize[2], in->linesize[2],
+               cw,        ch,        0);
+        emms_c();
     }
 
     if (in != out) {