From patchwork Wed Aug 1 22:31:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruiling Song X-Patchwork-Id: 9865 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp1485639jad; Wed, 1 Aug 2018 18:32:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqm+kXRyN2Nl0Wo6PEt72uf36ZNUbV233VaOapu8BkrU2JoSBA3Ud4/GVW7J64rm/l3xbx X-Received: by 2002:adf:9aeb:: with SMTP id a98-v6mr411908wrc.110.1533173536416; Wed, 01 Aug 2018 18:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533173536; cv=none; d=google.com; s=arc-20160816; b=pcB7XR6LPzbhvwUC2Mq9+6Oclvhs+SYYuHubwQfyYuKBdlYIPwmIjXtklSc0uu+ArV /WDETz73kTytqT78r5kPVyx5mwMfIhNK4jVO+V7PmQQGQAhjJWvNBFOUocRzD8GqXAK4 cywXox4jlbBXwABlqq6D/4xd7WJovWqb6pH2Sb4BhryYBe4hrlxgBfeDGF8t/ceLzWIq q/VhDbAfo3PFL9WZKZL4idCLHJApTR1HpLEimrP+KmQNQ2nYgjwBdtX/+xDYfE8WjYEk ha0rlhrqi5W2vi9kwdAdNZ4a+uev3bD4D4K23ouHTKxpsjfxXJL4OmRjsxZsMFCvDEql XydA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=cd4Zb7rfhIJ3v9yYiM+ULAcGbG+1JMPrTIDgPdk4NjU=; b=G+mCaTT9g4FxdEnHnBKJNfXa27RD0j1Mm7k2zLjQg0Sl59aatHQNxpR+MPdn1noNdl jwj/S4HOE1kjtpYCEsfim+fJYQoQmINKg8mITF8qQo0prWJbL1r+4cZsncNyDsHUkRQn gdrUtxcDu02SdRFbJragOOgwxTtsKlpWQ01aZzcQcVlaSQLaUYAMSx2/sz0xm1Teci3o S5xdZz1D5543LBWZ9rUBHYJuqJjSIvTNP/K7cNhYosbl4Lel2FosunDmUtr+AuTpD04G MfGhkP48h6MMIJ8rrJ3b6FQKv0ChY5lX0Rj70SWceNe6yu2dTu73DMXSTXuXia3dJe0C HZFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y67-v6si286284wme.107.2018.08.01.18.32.16; Wed, 01 Aug 2018 18:32:16 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3A14268A54C; Thu, 2 Aug 2018 04:31:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4D35368A426 for ; Thu, 2 Aug 2018 04:31:54 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2018 18:32:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,434,1526367600"; d="scan'208";a="61692133" Received: from ruiling-kabylake.jf.intel.com ([10.7.199.51]) by orsmga008.jf.intel.com with ESMTP; 01 Aug 2018 18:32:10 -0700 From: Ruiling Song To: ffmpeg-devel@ffmpeg.org Date: Wed, 1 Aug 2018 15:31:43 -0700 Message-Id: <20180801223143.20356-1-ruiling.song@intel.com> X-Mailer: git-send-email 2.17.0 Subject: [FFmpeg-devel] [PATCH] doc/filters: add tonemap_opencl document. 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: Ruiling Song MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Ruiling Song --- doc/filters.texi | 158 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index 6695999c84..f622d03226 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -17776,6 +17776,164 @@ Apply sobel operator with scale set to 2 and delta set to 10 @end example @end itemize +@section tonemap_opencl + +Perform HDR(PQ/HLG) to SDR conversion with tone-mapping. + +It accepts the following parameters: + +@table @option +@item tonemap +Specify the tone-mapping operator to be used. + +Possible values are: +@table @var +@item none +Do not apply any tone mapping, only desaturate overbright pixels. + +@item clip +Hard-clip any out-of-range values. Use it for perfect color accuracy for +in-range values, while distorting out-of-range values. + +@item linear +Stretch the entire reference gamut to a linear multiple of the display. + +@item gamma +Fit a logarithmic transfer between the tone curves. + +@item reinhard +Preserve overall image brightness with a simple curve, using nonlinear +contrast, which results in flattening details and degrading color accuracy. + +@item hable +Preserve both dark and bright details better than @var{reinhard}, at the cost +of slightly darkening everything. Use it when detail preservation is more +important than color and brightness accuracy. + +@item mobius +Smoothly map out-of-range values, while retaining contrast and colors for +in-range material as much as possible. Use it when color accuracy is more +important than detail preservation. +@end table + +@item param +Tune the tone mapping algorithm. + +This affects the following algorithms: +@table @var +@item none +Ignored. + +@item linear +Specifies the scale factor to use while stretching. +Default to 1.0. + +@item gamma +Specifies the exponent of the function. +Default to 1.8. + +@item clip +Specify an extra linear coefficient to multiply into the signal before clipping. +Default to 1.0. + +@item reinhard +Specify the local contrast coefficient at the display peak. +Default to 0.5, which means that in-gamut values will be about half as bright +as when clipping. + +@item hable +Ignored. + +@item mobius +Specify the transition point from linear to mobius transform. Every value +below this point is guaranteed to be mapped 1:1. The higher the value, the +more accurate the result will be, at the cost of losing bright details. +Default to 0.3, which due to the steep initial slope still preserves in-range +colors fairly accurately. +@end table + +@item desat +Apply desaturation for highlights that exceed this level of brightness. The +higher the parameter, the more color information will be preserved. This +setting helps prevent unnaturally blown-out colors for super-highlights, by +(smoothly) turning into white instead. This makes images feel more natural, +at the cost of reducing information about out-of-range colors. + +The default value is 0.5, and the algorithm here is a little different from +the cpu version tonemap currently. A setting of 0.0 disables this option. + +@item threshold +The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold +is used to detect whether the scene has changed or not. If the distance beween +the current frame average brightness and the current running average exceeds +a threshold value, we would re-calculate scene average and peak brightness. +The default value is 0.2. + +@item format +Specify the output pixel format. + +Currently supported formats are: +@table @var +@item p010 +@item nv12 +@end table + +@item range, r +Set the output color range. + +Possible values are: +@table @var +@item tv/mpeg +@item pc/jpeg +@end table + +Default is same as input. + +@item primaries, p +Set the output color primaries. + +Possible values are: +@table @var +@item bt709 +@item bt2020 +@end table + +Default is same as input. + +@item transfer, t +Set the output transfer characteristics. + +Possible values are: +@table @var +@item bt709 +@item bt2020 +@end table + +Default is bt709. + +@item matrix, m +Set the output colorspace matrix. + +Possible value are: +@table @var +@item bt709 +@item bt2020 +@end table + +Default is same as input. + +@end table + +@subsection Example + +@itemize +@item +Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator. +@example +-i INPUT -vf "hwupload, format=p010,tonemap_opencl=t=bt2020:tonemap=linear:format=p010, hwdownload" OUTPUT +@end example +@end itemize + @section unsharp_opencl Sharpen or blur the input video.