From patchwork Fri Oct 30 15:11:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 23288 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 80AE944BC8F for ; Fri, 30 Oct 2020 17:12:27 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4F9CD689D26; Fri, 30 Oct 2020 17:12:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2383F687F85 for ; Fri, 30 Oct 2020 17:12:21 +0200 (EET) Received: by mail-pg1-f193.google.com with SMTP id i7so3533220pgh.6 for ; Fri, 30 Oct 2020 08:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0s0YMoloccGrtayUiXWzO6Tdt2qBcBxLcNJHdv2ADBQ=; b=Z2XmERxdGmjWjow4hsQcVnmzKvVhxgAi8W6BX3X/6x5tyGl3GShP5mzB2bBwCyTxqK Q3K3hw4h9E4YSQMXRz5YdE7trn7+yE/hXT5+u21gLtuOQac3udfxgJ0hCnogXmbzY8wh oRZbxAB+IyAV2lfklRdJVXQlZo4ePTaqAVj7rltYcN+AOqPvK9ttmYwRnr20HR4pJSX2 0XRDALUj4XPkquGEtBFc+aYJC3sO9H6WkINUtwzG02kDog89V9hZ7wSFZy60og07c84z 6maZtDTm/Zzus6BGZqAoxafN78emMYRqQWN1nAWRinyJF0FHjCBq86oZUleT7XwEuKNT bywg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0s0YMoloccGrtayUiXWzO6Tdt2qBcBxLcNJHdv2ADBQ=; b=ghCdXu5b5gPbfrHssiwWFPNYqR2DNidhDQ6tYRyNxYeYn2bNB+95axup112Mf5ARp8 Qhgbj4hgMvXBsR01xVWfPgAkBJjfj9cApTdunf6zj+j4iCDYnUVtHsyRitQHIVi90O4K Jtl5yMo8g/5ChOYvGdvaJWQUA/6AzlLktUaMGGMP4/eXv2bHbwAqVl1GXSQWoqt5mSCf Ka24+6Paklkde1QtE9oZVD5MlKjgzySiiTX91hpxRbyN62IT0nbxMeXzkvJtwctDdQ4z cbfJCcQVCusV30Oe3aUy5c4UpvYxNT77VAsnWwGNuk9CMCKOAw44YowRiBCK8tanlwT/ ZFtQ== X-Gm-Message-State: AOAM531jWli5v04ANulXmjtd9xXYAF+aacafe84Xi8MK0ne+XkPFvCJ8 a3TDTI5p6DtS+gfd/vTiGkpQQM9oRXU= X-Google-Smtp-Source: ABdhPJw7KsJZssc8aF460K87mqx7uKBL6/IwRx59q0DUnjAC7wYblBjnjab23qdI7FSxP6XS/+4NJQ== X-Received: by 2002:a17:90a:170b:: with SMTP id z11mr3438603pjd.83.1604070738678; Fri, 30 Oct 2020 08:12:18 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id j24sm3955347pjn.9.2020.10.30.08.12.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Oct 2020 08:12:17 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Oct 2020 23:11:32 +0800 Message-Id: <1604070694-21308-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1603967178-3765-1-git-send-email-lance.lmwang@gmail.com> References: <1603967178-3765-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v4 1/3] avfilter/vf_unsharp: add 10bit support 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 Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavfilter/unsharp.h | 3 + libavfilter/vf_unsharp.c | 162 +++++++++++++++++++++++++---------------------- 2 files changed, 90 insertions(+), 75 deletions(-) diff --git a/libavfilter/unsharp.h b/libavfilter/unsharp.h index a60b30f..253e32d 100644 --- a/libavfilter/unsharp.h +++ b/libavfilter/unsharp.h @@ -48,9 +48,12 @@ typedef struct UnsharpContext { UnsharpFilterParam luma; ///< luma parameters (width, height, amount) UnsharpFilterParam chroma; ///< chroma parameters (width, height, amount) int hsub, vsub; + int bitdepth; + int bps; int nb_threads; int opencl; int (* apply_unsharp)(AVFilterContext *ctx, AVFrame *in, AVFrame *out); + int (* unsharp_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); } UnsharpContext; #endif /* AVFILTER_UNSHARP_H */ diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c index 7b430b6..416bf1c 100644 --- a/libavfilter/vf_unsharp.c +++ b/libavfilter/vf_unsharp.c @@ -57,81 +57,90 @@ typedef struct TheadData { int height; } ThreadData; -static int unsharp_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) -{ - ThreadData *td = arg; - UnsharpFilterParam *fp = td->fp; - uint32_t **sc = fp->sc; - uint32_t *sr = fp->sr; - const uint8_t *src2 = NULL; //silence a warning - const int amount = fp->amount; - const int steps_x = fp->steps_x; - const int steps_y = fp->steps_y; - const int scalebits = fp->scalebits; - const int32_t halfscale = fp->halfscale; - - uint8_t *dst = td->dst; - const uint8_t *src = td->src; - const int dst_stride = td->dst_stride; - const int src_stride = td->src_stride; - const int width = td->width; - const int height = td->height; - const int sc_offset = jobnr * 2 * steps_y; - const int sr_offset = jobnr * (MAX_MATRIX_SIZE - 1); - const int slice_start = (height * jobnr) / nb_jobs; - const int slice_end = (height * (jobnr+1)) / nb_jobs; - - int32_t res; - int x, y, z; - uint32_t tmp1, tmp2; - - if (!amount) { - av_image_copy_plane(dst + slice_start * dst_stride, dst_stride, - src + slice_start * src_stride, src_stride, - width, slice_end - slice_start); - return 0; - } - - for (y = 0; y < 2 * steps_y; y++) - memset(sc[sc_offset + y], 0, sizeof(sc[y][0]) * (width + 2 * steps_x)); - - // if this is not the first tile, we start from (slice_start - steps_y), - // so we can get smooth result at slice boundary - if (slice_start > steps_y) { - src += (slice_start - steps_y) * src_stride; - dst += (slice_start - steps_y) * dst_stride; - } - - for (y = -steps_y + slice_start; y < steps_y + slice_end; y++) { - if (y < height) - src2 = src; - - memset(sr + sr_offset, 0, sizeof(sr[0]) * (2 * steps_x - 1)); - for (x = -steps_x; x < width + steps_x; x++) { - tmp1 = x <= 0 ? src2[0] : x >= width ? src2[width-1] : src2[x]; - for (z = 0; z < steps_x * 2; z += 2) { - tmp2 = sr[sr_offset + z + 0] + tmp1; sr[sr_offset + z + 0] = tmp1; - tmp1 = sr[sr_offset + z + 1] + tmp2; sr[sr_offset + z + 1] = tmp2; - } - for (z = 0; z < steps_y * 2; z += 2) { - tmp2 = sc[sc_offset + z + 0][x + steps_x] + tmp1; sc[sc_offset + z + 0][x + steps_x] = tmp1; - tmp1 = sc[sc_offset + z + 1][x + steps_x] + tmp2; sc[sc_offset + z + 1][x + steps_x] = tmp2; - } - if (x >= steps_x && y >= (steps_y + slice_start)) { - const uint8_t *srx = src - steps_y * src_stride + x - steps_x; - uint8_t *dsx = dst - steps_y * dst_stride + x - steps_x; - - res = (int32_t)*srx + ((((int32_t) * srx - (int32_t)((tmp1 + halfscale) >> scalebits)) * amount) >> 16); - *dsx = av_clip_uint8(res); - } - } - if (y >= 0) { - dst += dst_stride; - src += src_stride; - } - } - return 0; +#define DEF_UNSHARP_SLICE_FUNC(name, nbits) \ +static int name##_##nbits(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) \ +{ \ + ThreadData *td = arg; \ + UnsharpFilterParam *fp = td->fp; \ + UnsharpContext *s = ctx->priv; \ + uint32_t **sc = fp->sc; \ + uint32_t *sr = fp->sr; \ + const uint##nbits##_t *src2 = NULL; \ + const int amount = fp->amount; \ + const int steps_x = fp->steps_x; \ + const int steps_y = fp->steps_y; \ + const int scalebits = fp->scalebits; \ + const int32_t halfscale = fp->halfscale; \ + \ + uint##nbits##_t *dst = (uint##nbits##_t*)td->dst; \ + const uint##nbits##_t *src = (const uint##nbits##_t *)td->src; \ + int dst_stride = td->dst_stride; \ + int src_stride = td->src_stride; \ + const int width = td->width; \ + const int height = td->height; \ + const int sc_offset = jobnr * 2 * steps_y; \ + const int sr_offset = jobnr * (MAX_MATRIX_SIZE - 1); \ + const int slice_start = (height * jobnr) / nb_jobs; \ + const int slice_end = (height * (jobnr+1)) / nb_jobs; \ + \ + int32_t res; \ + int x, y, z; \ + uint32_t tmp1, tmp2; \ + \ + if (!amount) { \ + av_image_copy_plane(td->dst + slice_start * dst_stride, dst_stride, \ + td->src + slice_start * src_stride, src_stride, \ + width * s->bps, slice_end - slice_start); \ + return 0; \ + } \ + \ + for (y = 0; y < 2 * steps_y; y++) \ + memset(sc[sc_offset + y], 0, sizeof(sc[y][0]) * (width + 2 * steps_x)); \ + \ + dst_stride = dst_stride / s->bps; \ + src_stride = src_stride / s->bps; \ + /* if this is not the first tile, we start from (slice_start - steps_y) */ \ + /* so we can get smooth result at slice boundary */ \ + if (slice_start > steps_y) { \ + src += (slice_start - steps_y) * src_stride; \ + dst += (slice_start - steps_y) * dst_stride; \ + } \ + \ + for (y = -steps_y + slice_start; y < steps_y + slice_end; y++) { \ + if (y < height) \ + src2 = src; \ + \ + memset(sr + sr_offset, 0, sizeof(sr[0]) * (2 * steps_x - 1)); \ + for (x = -steps_x; x < width + steps_x; x++) { \ + tmp1 = x <= 0 ? src2[0] : x >= width ? src2[width-1] : src2[x]; \ + for (z = 0; z < steps_x * 2; z += 2) { \ + tmp2 = sr[sr_offset + z + 0] + tmp1; sr[sr_offset + z + 0] = tmp1; \ + tmp1 = sr[sr_offset + z + 1] + tmp2; sr[sr_offset + z + 1] = tmp2; \ + } \ + for (z = 0; z < steps_y * 2; z += 2) { \ + tmp2 = sc[sc_offset + z + 0][x + steps_x] + tmp1; \ + sc[sc_offset + z + 0][x + steps_x] = tmp1; \ + tmp1 = sc[sc_offset + z + 1][x + steps_x] + tmp2; \ + sc[sc_offset + z + 1][x + steps_x] = tmp2; \ + } \ + if (x >= steps_x && y >= (steps_y + slice_start)) { \ + const uint##nbits##_t *srx = src - steps_y * src_stride + x - steps_x; \ + uint##nbits##_t *dsx = dst - steps_y * dst_stride + x - steps_x; \ + \ + res = (int32_t)*srx + ((((int32_t) * srx - \ + (int32_t)((tmp1 + halfscale) >> scalebits)) * amount) >> (8+nbits)); \ + *dsx = av_clip_uint##nbits(res); \ + } \ + } \ + if (y >= 0) { \ + dst += dst_stride; \ + src += src_stride; \ + } \ + } \ + return 0; \ } +DEF_UNSHARP_SLICE_FUNC(unsharp_slice, 16); +DEF_UNSHARP_SLICE_FUNC(unsharp_slice, 8); static int apply_unsharp_c(AVFilterContext *ctx, AVFrame *in, AVFrame *out) { @@ -155,7 +164,7 @@ static int apply_unsharp_c(AVFilterContext *ctx, AVFrame *in, AVFrame *out) td.height = plane_h[i]; td.dst_stride = out->linesize[i]; td.src_stride = in->linesize[i]; - ctx->internal->execute(ctx, unsharp_slice, &td, NULL, FFMIN(plane_h[i], s->nb_threads)); + ctx->internal->execute(ctx, s->unsharp_slice, &td, NULL, FFMIN(plane_h[i], s->nb_threads)); } return 0; } @@ -238,6 +247,9 @@ static int config_input(AVFilterLink *inlink) s->hsub = desc->log2_chroma_w; s->vsub = desc->log2_chroma_h; + s->bitdepth = desc->comp[0].depth; + s->bps = s->bitdepth > 8 ? 2 : 1; + s->unsharp_slice = s->bitdepth > 8 ? unsharp_slice_16 : unsharp_slice_8; // ensure (height / nb_threads) > 4 * steps_y, // so that we don't have too much overlap between two threads From patchwork Fri Oct 30 15:11:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 23289 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 0976D44BC8F for ; Fri, 30 Oct 2020 17:12:31 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ED5C168A1D0; Fri, 30 Oct 2020 17:12:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4DA23689D06 for ; Fri, 30 Oct 2020 17:12:22 +0200 (EET) Received: by mail-pg1-f196.google.com with SMTP id x13so5458375pgp.7 for ; Fri, 30 Oct 2020 08:12:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Hph81Dx/k0Y0+RSyWa8e1lM16MsOESy6OGYaHK+XkeE=; b=l3lmo+3D6WRcdeavzaunm1IesgRrrvYb+dF+g3siQUw8y/TbaedbqxZD4to/8S6ATI M1iU17y/UHViKw8fKk4AuH6AClx5vI5XLASdHZ2NL1yodVuu1ADIq3wD95Ec/XvUnmPS 3iu7L7S432D3EaLcE5TXraGCY2sxtYfQs1+Jl9DfuwXRI7hehNieHwEKmWU3FSMONx7a YmpzDzyYsLSkawheQ648GDrfgsVR//ThODLSzIMKJ3/XBNKnmSM6fPKZxMYK4yrtEVKm IMvbfcMQ8AebzGsnW90kCwz2mh72oICLcjpq8S2ZdJmoTky/ei7dZCj+0lDoTZzi1A4L q1hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Hph81Dx/k0Y0+RSyWa8e1lM16MsOESy6OGYaHK+XkeE=; b=ST9lXKYr7bXNlUcqaA0/ZIjndP2mNGAUd1Fkk/CMj/YiobuPcyujLGm9LnzNgyd+3Q +FO1ZKwbS91ZecbAvOE1vTvN7pXLoczz/oR451UJLW/klAPSEQIXAs3FXr+Hn5kkTALT /wqsbyqHdQ5rDMBBRTMA0ynQTgzPig1XuxoQCdgW5u8tp6D4GjLrydyTBQxP+A1bdA0P Ua1yhc2LWmTLUNb2xgJ6+r2ma8+s5MWsj381Vl0rDOXUKVTlAoyOxKSUSKyzbV2J9WH3 P0atoSTGPYB+UMbw2SnDW40ov1BLFjfalBrMZqX+8oBTLNg2qK0xJFMemHoIYUXU0zF0 N4rQ== X-Gm-Message-State: AOAM531WxvxnJiC4S04/Sp/oIZrv4diqJWDaI0o2KWTWXIvvFzZkzClu 2+YRfP3yOBgXuoaabFh5hfYnnjB6ecA= X-Google-Smtp-Source: ABdhPJwTd+evzmup7J4HxM5kJtSUasXfbIKElIfhnfVVhlrgkA1LlacRXb3KQeDcdCqDFvwU6wR4Nw== X-Received: by 2002:a17:90b:3658:: with SMTP id nh24mr3465976pjb.177.1604070740434; Fri, 30 Oct 2020 08:12:20 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id j24sm3955347pjn.9.2020.10.30.08.12.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Oct 2020 08:12:19 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Oct 2020 23:11:33 +0800 Message-Id: <1604070694-21308-2-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1604070694-21308-1-git-send-email-lance.lmwang@gmail.com> References: <1603967178-3765-1-git-send-email-lance.lmwang@gmail.com> <1604070694-21308-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v4 2/3] avfilter/vf_unsharp: add more pixel format support 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 Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavfilter/vf_unsharp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c index 416bf1c..e9b6c90 100644 --- a/libavfilter/vf_unsharp.c +++ b/libavfilter/vf_unsharp.c @@ -201,6 +201,10 @@ static int query_formats(AVFilterContext *ctx) static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9, + AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV440P10, + AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12, + AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE }; From patchwork Fri Oct 30 15:11:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 23290 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 D389744BC8F for ; Fri, 30 Oct 2020 17:12:31 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BCAD968086B; Fri, 30 Oct 2020 17:12:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4CDB868086B for ; Fri, 30 Oct 2020 17:12:24 +0200 (EET) Received: by mail-pg1-f196.google.com with SMTP id o3so5445577pgr.11 for ; Fri, 30 Oct 2020 08:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3xI+uYGtA8Sv3J+/m6CCfLWwoLDxJ5MmcikotB7jYqk=; b=pbh3CFQLrUqLM1kNg6UjFmWFGb7YTurpln68I4oO6zciWgz8FU8YhM1gie0ggUWXeF 0/Oqh41p6CjRsh97EUb70Hqt+DBTPSzZyZXoARO+7vha7Y7lxpVDo2L5tlvElJ3v9n5z zQ9dSCNPo0GgEMgaAOhG+gjo6t3TdWVZ0KZrUzLoUfny/UFiuSJjHKMWAPBQaZMpSqKQ Ux6T9Jb8Z3ZRZwnDTso+1Jy8pid1vNpvqTkSuEoX6XVhwso24NBrYIGpsOnZ+3KHhPnO 9C1xbA4qr/dtqkCBGm54LrO+O+mwr/AHJFynxakk7q41WY14lY7tl2ZBY2at00fSvlzr ZCcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3xI+uYGtA8Sv3J+/m6CCfLWwoLDxJ5MmcikotB7jYqk=; b=eyY7jkZfRIUjgBDwzl1ZIGfik1tvSAO9WlDmYiFm859CNquiuRoFyobSc1iCCZidc5 BIReDMp/g4EIpl+je9gC4ID0ZWXZJ4dMOAkrJDMCI5P/N9E5suT5V/8DSfIMrZOtT7uk uSNy6qWov+Esp8cRcSQ3LCIDOqVOYsRqbOXklpMxXh2XfAtNeENZU4ry0ZtDShi1fwoT 0zlr0TO408tZZZqQrZHVCSGd47mfUYFmFEF1Qt9hbhAl3C4/kyL5i4D3+wsPc0yTx1EF AI2JyCWYsnq27BaJwA76ZgPdvHEfiPPnvMJd3tCB6/IYk9CzM+K6q1uh5E4N+MSVaUIp LFOw== X-Gm-Message-State: AOAM530XFe9Cc4BoxKTk7tpKn9XC1jQMSQ2SOG7MYrGilfJXbHoBycGG RaFUuBKuaJU357Ka6y1V5ZDa2O3LOMw= X-Google-Smtp-Source: ABdhPJzLq2gwn0R0ufvyGDu1B0O394BEIC7oBlGkCcCoNXLoNwKiB42X7ss0eyyEBTjPWeD4Im6maA== X-Received: by 2002:a17:90b:4c43:: with SMTP id np3mr3533574pjb.28.1604070742371; Fri, 30 Oct 2020 08:12:22 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id j24sm3955347pjn.9.2020.10.30.08.12.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Oct 2020 08:12:21 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Oct 2020 23:11:34 +0800 Message-Id: <1604070694-21308-3-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1604070694-21308-1-git-send-email-lance.lmwang@gmail.com> References: <1603967178-3765-1-git-send-email-lance.lmwang@gmail.com> <1604070694-21308-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v4 3/3] fate/filter-video: add 10bit test for unsharp filter 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 Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- tests/fate/filter-video.mak | 3 +++ tests/ref/fate/filter-unsharp-yuv420p10 | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/ref/fate/filter-unsharp-yuv420p10 diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak index 639f957..0adc0c2 100644 --- a/tests/fate/filter-video.mak +++ b/tests/fate/filter-video.mak @@ -410,6 +410,9 @@ fate-filter-untile: CMD = framecrc -lavfi testsrc2=d=1:r=2,untile=2x2 FATE_FILTER_VSYNTH-$(CONFIG_UNSHARP_FILTER) += fate-filter-unsharp fate-filter-unsharp: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf unsharp=11:11:-1.5:11:11:-1.5 +FATE_FILTER_VSYNTH-$(CONFIG_UNSHARP_FILTER) += fate-filter-unsharp-yuv420p10 +fate-filter-unsharp-yuv420p10: CMD = framecrc -lavfi testsrc2=r=2:d=10,format=yuv420p10,unsharp=11:11:-1.5:11:11:-1.5,scale -pix_fmt yuv420p10le -flags +bitexact -sws_flags +accurate_rnd+bitexact + FATE_FILTER_SAMPLES-$(call ALLYES, SMJPEG_DEMUXER MJPEG_DECODER PERMS_FILTER HQDN3D_FILTER) += fate-filter-hqdn3d-sample fate-filter-hqdn3d-sample: tests/data/filtergraphs/hqdn3d fate-filter-hqdn3d-sample: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/smjpeg/scenwin.mjpg -filter_complex_script $(TARGET_PATH)/tests/data/filtergraphs/hqdn3d -an diff --git a/tests/ref/fate/filter-unsharp-yuv420p10 b/tests/ref/fate/filter-unsharp-yuv420p10 new file mode 100644 index 0000000..c1a6f07 --- /dev/null +++ b/tests/ref/fate/filter-unsharp-yuv420p10 @@ -0,0 +1,25 @@ +#tb 0: 1/2 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 320x240 +#sar 0: 1/1 +0, 0, 0, 1, 230400, 0x2b664750 +0, 1, 1, 1, 230400, 0x96b82a4a +0, 2, 2, 1, 230400, 0xdb936c54 +0, 3, 3, 1, 230400, 0xfa210a10 +0, 4, 4, 1, 230400, 0x946497c8 +0, 5, 5, 1, 230400, 0xc9084925 +0, 6, 6, 1, 230400, 0x0f9c4a1d +0, 7, 7, 1, 230400, 0x57901012 +0, 8, 8, 1, 230400, 0xb0404496 +0, 9, 9, 1, 230400, 0xfdb8871b +0, 10, 10, 1, 230400, 0x13e157c4 +0, 11, 11, 1, 230400, 0x077eadd9 +0, 12, 12, 1, 230400, 0x857ec272 +0, 13, 13, 1, 230400, 0x3bec3bea +0, 14, 14, 1, 230400, 0x680723fe +0, 15, 15, 1, 230400, 0xc16660f0 +0, 16, 16, 1, 230400, 0x0a065b14 +0, 17, 17, 1, 230400, 0x297f1441 +0, 18, 18, 1, 230400, 0x44324aec +0, 19, 19, 1, 230400, 0x9f903f58