From patchwork Sun May 9 10:06:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27705 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp2079116iof; Sun, 9 May 2021 03:07:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2ZdtZMrkx5iRg6Z9YVFnuMerZQU1YebxNnaowSJ5XaWuA9Z+LpMwoLSDxxdlWjcaP2Aml X-Received: by 2002:a17:906:5495:: with SMTP id r21mr20068451ejo.471.1620554840582; Sun, 09 May 2021 03:07:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620554840; cv=none; d=google.com; s=arc-20160816; b=vCWh0k10aPTqNdRCxkmoHO/3eUsXXJLeKPZ/fnEVPsf0IY391ZeZlrLpT3GIUoPT2E WUh29jgI2YUZI3MZ65w6vwKc5KmquowDN9VdqoTMkzjRXtvF4DHy7tAM1KbmWBbmeNTk 2Y3b74OH5tSs0i7JI7NuUxIuqMOxKoTnIfeP9OZRo8cd7dcRfVoMytHYgQ/xUGErrnC9 zZBEGy0vYaCNqZH9QFEW0/r73osp7LA4K3mUXTvg5/NwBMq1gaNbD6kJjo/U/FIBLIw2 XO+NdHY4whA9ypNCvynvB4I77d2rS8wKN16hJ120luxmVk/KeOIrB+7ARKfr/qxcZHp4 nerg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=cHoCCBDGVP2A9FAkbQzsbrienCYNHkx7VnXrLowcoM4=; b=B6K5n/p5kMK3HAwUO344S+gie4UoiX78DQxPQh6ZQuVLj9FOnp4Uw9DasRaAmVUn1n l3OJr6JGyOFndN/b5sBM3jlncaxCq/wXUKNTfX7tM4MCzjSTsKlypbhdTybzsqTy68c2 3NiR9b7DqDZ3D0IaXHWi5HKaMS7byjIFwZGWrp9FI4JcockUJe8QGs9YEHlKXy/o2la7 c/xMwr7ZgBKteazA2OJc7rD4JfKxLEh2orwL37B8IAy9zY5aUjaJLsLAWBZTo4ZenhW2 FwvTj3+EA5iLuRv92eEx2KpTAquZP59XEdC1/6ntvyWnbbj7V3lYEOepnhjuiFND7sbp Ea2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Qnv3nkma; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g27si4142220ejb.616.2021.05.09.03.07.19; Sun, 09 May 2021 03:07:20 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Qnv3nkma; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 28453680910; Sun, 9 May 2021 13:07:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4E00B6806A2 for ; Sun, 9 May 2021 13:07:10 +0300 (EEST) Received: by mail-pg1-f169.google.com with SMTP id i14so11247836pgk.5 for ; Sun, 09 May 2021 03:07:10 -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:mime-version :content-transfer-encoding; bh=s+IJO7yJnDEPqXpx/2UEEdIx3jOT1cy6m1UjVXIP2Uw=; b=Qnv3nkmaQyd73oZRxc+Q0k7LDwNHx7+P6CYsW8KfiPwrFUWvllslVRHXc9tt4XDOmW PuETTMNz1RXnMiXP4a1Y8DyYvTcXKM3+aRFpxLk17kfT8GCjJ4V+ieJCR5LDnzzFOZgl 5Rq7QOAT4B2e0TPcLq5t26FkGlUG2BeG4eGpIcWhjCky5LPKWbAL6kPA3NbUXRH4CjUe ECdThMiK26zsXZ64AoBI8QTX+MKIl3QCL7CIWxzKew/JHx2tlZ7m9hVn7Wp+YUAcfPnF Vyxr4l1fW4KHQydgCRBfqnTfWLE7S4Q3HMQYSGix8P0O0vzyTiYkPk+eZYLiM7PXTV1Q Tozg== 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:mime-version :content-transfer-encoding; bh=s+IJO7yJnDEPqXpx/2UEEdIx3jOT1cy6m1UjVXIP2Uw=; b=EwTSJvT4pFDCaDYev4ZiAXOpFxgmZg/CRm3AlN7v0grJCWSyIr473ZzuBxqqBbavMl YkS1/9tgAhJcXFYyNoz0H2O7i1YUExOk4l9Hc/mglhPduFAFNSQx33j0rYSwOdaKyGjU 8LZI6rXMbJHNykoH4CNFNyo+Z3Z5doG+T+IS8wfNKFeh0/s0sMk6+3gPTRr6znMsnAZE dwFX6SaNFdWGPwaMTvpV08Bj4pO718FxAhk3+fGHsbHzZQAn2qilz2R0kO4Ruqqa5MeT oCE4OXPYJhmtAfTsXo1APtnDOmnfWZH1Xx/5moAPAIig5wO1BEMY4EDrQUfuBEzXLkit UK5A== X-Gm-Message-State: AOAM530gI/0P1VSV4+/f6wU1L+4ALdSnoeTmMHnLclMd/1TDqBrZLQiA sn/c+JNckdRgvPtP7l8fYFQcqqiU00q7SA== X-Received: by 2002:a65:48c5:: with SMTP id o5mr19756169pgs.101.1620554828297; Sun, 09 May 2021 03:07:08 -0700 (PDT) Received: from Pavilion-x360.bbrouter ([103.133.121.17]) by smtp.googlemail.com with ESMTPSA id s23sm1756869pjg.15.2021.05.09.03.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 May 2021 03:07:07 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Sun, 9 May 2021 15:36:11 +0530 Message-Id: <20210509100610.21205-1-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5 v2] lavfi/dnn_backend_native_layer_mathunary.h: Documentation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Shubhanshu Saxena Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: cwLtKJU7mPbj Add documentation for Unary Math Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_mathunary.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h index 151a73200a..2ab9d0552d 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h +++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h @@ -54,7 +54,35 @@ typedef struct DnnLayerMathUnaryParams{ DNNMathUnaryOperation un_op; } DnnLayerMathUnaryParams; +/** + * @brief Load the Unary Math Layer. + * + * It assigns the layer parameters to the unary operator + * hyperparameter from the model file context. + * + * @param layer pointer to the DNN layer instance + * @param model_file_context pointer to model file context + * @param file_size model file size + * @param operands_num number of operands for the layer + * @return Size of DNN Layer + * @retval 0 if model file context contains invalid hyperparameters. + */ int ff_dnn_load_layer_math_unary(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); + +/** + * @brief Execute the Unary Math Layer. + * + * It applies the unary operator parsed while + * loading to the given input operands. + * + * @param operands input operands + * @param input_operand_indexes input operand indexes + * @param output_operand_index output operand index + * @param parameters layer parameters + * @param ctx pointer to Native model context + * @retval DNN_SUCCESS if the execution succeeds + * @retval DNN_ERROR if the execution fails + */ int ff_dnn_execute_layer_math_unary(DnnOperand *operands, const int32_t *input_operand_indexes, int32_t output_operand_index, const void *parameters, NativeContext *ctx);