From patchwork Wed May 12 18:44:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27724 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp5283319iof; Wed, 12 May 2021 11:47:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwows3wrRaVuiT5tjhRDxJ5Cg+NK0AqJyzWau2bP3JdERj2TX04cFpSiPJraTKNvX7/s4k2 X-Received: by 2002:a05:6402:280d:: with SMTP id h13mr45789344ede.105.1620845265332; Wed, 12 May 2021 11:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620845265; cv=none; d=google.com; s=arc-20160816; b=jOTRrRMD2uvj5RcJb+zk+3lTGbjTgjlCs8Lb9vxCX9HZFAFo7dQc7R/B6JQR61CaTb 9OmZEHaSPk3prk+TNjSUair8GW3iekUvjTCnPwX0lmNyCc8dBAuJ+Mxy9UTkzm/fHrJV GXu2Kdn6pGhoKVhVDaPoD45XuD3Q3Z0kN3HJM+Al7fnKPIJADX589TyItrfFR/4b5lca TqOxecNW6TvD/FlEwBSvPfkWEpwS9yYy7dYPukDFNIEn9tK4jzT5aZZovaqD1mG2JYFd +8z6jhgmbf/9+VfGEkA/D3w5LT8add+F7P4kSbACDesgDQ4wn9rV4ocv5o8y1oDd7kLh E0eA== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=FRuLCyk56Rfam09EVoeAu9Pq1DOzwJMq1cMXXBOIyh0=; b=XhpiROcf5kPDxXkGgdGq6W8/jn5M8cZOoPL59TAlS4qH/Qvk4t5WqXp+FiZIbhQaQq lThv4kO5Bby5JZ7EOSUg697nSUakkOM7bgk6sVVUAVwcb7yPl2Jc1nXUR2LJV2fF27c5 bbSDo1wY9owgdoZgljpK8YHj2xTu5CKJ08nYmTR/kCtysWwaMrK90WLrIATTpxYYrqyS jFOln8LdgtxJGlXJ+Ura4CIw10+ITKR1r2GR23V6jvc+FpN8W0fxgHff1SCAbT7uYYKD QRnuDIYwEAoPguhanXUuDvixUd4abzQsOuy6UaYahT+UX7Vg6AfE/4I8U+VQyeWcaJXJ Qp+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=gbd3pr4T; 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 j16si630460edj.401.2021.05.12.11.47.45; Wed, 12 May 2021 11:47:45 -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=gbd3pr4T; 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 57BF3680A7A; Wed, 12 May 2021 21:47:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E5B8D68067D for ; Wed, 12 May 2021 21:47:35 +0300 (EEST) Received: by mail-pl1-f171.google.com with SMTP id z18so9393784plg.8 for ; Wed, 12 May 2021 11:47:35 -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 :mime-version:content-transfer-encoding; bh=dwGwtBOLkYtRH1rLgnLHEqDmiVHiapeIyyZ+9T9NWkM=; b=gbd3pr4TUToojoGad8x/EQ/RLBUgH4FaGY9aBUio/GSiN3viAzXySq7n6m8SUaE3Y9 K93x/YBvHcdZFEMC9VwzvMYQmniGGjGYHPjPh8bXF7DKTE8iieViqOcz9Yo/bjGytkR0 hfBJ44S+uCIK6IYpUQjlocJtgRkEs2cwTBauhrUMj4+kbPI65D0VuLSWnM9quCz1sBRL ntgLRIak0HV1Ix8/1HmSC1lbxMUtHOY4dRFokByfie/u+z26YZyf67MtXO8PZKxNKgRQ Akqvv4lYRQlzSqkT2R3yqfKn+mxtM0ae/5f2LHGZd86q9fYPuLH2RcjhPHw2e00EWrtk h4SQ== 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:mime-version:content-transfer-encoding; bh=dwGwtBOLkYtRH1rLgnLHEqDmiVHiapeIyyZ+9T9NWkM=; b=IogucBPSQKWQD3asphSf7T7LnrB9MAujhmaLUJfb5Wb54pkAl3XCtZJNV3ruGxHU5+ rBwGWH0MjPtBgLizJIu9ZKXnabl/cuh4ruz6lcr5KLTCO1t1lGR4MWEw1QqvqdPgn0Uw G/2HvF6yLjPdO8Pp5hqa1V9Hmutso4HCyYbt2shVq9/8e349nkR/6UThbzMgVbL9Rhyy SPrma/SYD3/TW1XVAZPO1I7EWkeOhhqA0YzRuLsnTh2gMwWNBKL5y3GyjkKuysmeR38t jqedLyk3nSJMA5Vn/M5ONzohlZKKUysH7bAoapXOZKScQxZ+qzC6suif0kX629aTi/Kc bDsA== X-Gm-Message-State: AOAM532fShVdZQ5GFqlTX9JO72xEL99ZMMm/y7qz66VFJUZtAk4YLmDq ICkS/ARyUOZl8bdR3OuG8bs+QDD+4RZiZQ== X-Received: by 2002:a17:902:fe94:b029:ee:ba90:a27a with SMTP id x20-20020a170902fe94b02900eeba90a27amr36295268plm.53.1620845254093; Wed, 12 May 2021 11:47:34 -0700 (PDT) Received: from Pavilion-x360.bbrouter ([103.133.123.78]) by smtp.googlemail.com with ESMTPSA id js6sm4866120pjb.0.2021.05.12.11.47.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 11:47:33 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 May 2021 00:14:44 +0530 Message-Id: <20210512184439.30591-5-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210512184439.30591-1-shubhanshu.e01@gmail.com> References: <20210512184439.30591-1-shubhanshu.e01@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5 v3] 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: czF61s3pJlta Add documentation for Unary Math Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_mathunary.h | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h index 151a73200a..72b6953d40 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h +++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h @@ -54,7 +54,37 @@ 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 to check if data is read + * correctly from the model file + * @param operands_num operand count of the whole model to + * check if data is read correctly from the model file + * @return number of bytes read from the model file + * @retval 0 if out of memory or an error occurs + */ 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 all operands for the model + * @param input_operand_indexes input operand indexes for this layer + * @param output_operand_index output operand index for this layer + * @param parameters average pooling parameters + * @param ctx pointer to Native model context for logging + * @retval 0 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);