From patchwork Mon Feb 24 12:37:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 17905 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 8827644A135 for ; Mon, 24 Feb 2020 14:39:28 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7600968B490; Mon, 24 Feb 2020 14:39:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.red.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E1CFE68B3E7 for ; Mon, 24 Feb 2020 14:39:24 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail.red.khirnov.net (Postfix) with ESMTP id 5D7962951AC for ; Mon, 24 Feb 2020 13:39:24 +0100 (CET) Received: from mail.red.khirnov.net ([IPv6:::1]) by localhost (mail.red.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id w5fkNTn5HuZb for ; Mon, 24 Feb 2020 13:39:24 +0100 (CET) Received: from quelana.khirnov.net (unknown [IPv6:2002:b061:f0a:201:5e:e696:5100:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "quelana.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail.red.khirnov.net (Postfix) with ESMTPS id EFDB02951A8 for ; Mon, 24 Feb 2020 13:39:23 +0100 (CET) Received: from localhost (quelana.khirnov.net [IPv6:::1]) by quelana.khirnov.net (Postfix) with ESMTP id AA6282522B for ; Mon, 24 Feb 2020 13:39:23 +0100 (CET) Received: from quelana.khirnov.net ([IPv6:::1]) by localhost (quelana.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id AK4CdeL0F9mJ for ; Mon, 24 Feb 2020 13:39:22 +0100 (CET) Received: from libav.daenerys.khirnov.net (libav.daenerys.khirnov.net [IPv6:2a00:c500:561:201::7]) by quelana.khirnov.net (Postfix) with ESMTP id 732C325230 for ; Mon, 24 Feb 2020 13:39:14 +0100 (CET) Received: by libav.daenerys.khirnov.net (Postfix, from userid 1000) id 5E7FA20E0359; Mon, 24 Feb 2020 13:39:11 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Feb 2020 13:37:34 +0100 Message-Id: <20200224123739.31154-8-anton@khirnov.net> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200224123739.31154-1-anton@khirnov.net> References: <20200224123739.31154-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 07/12] vf_pp7: drop the option to use frame-attached QP tables X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 --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) {