From patchwork Thu May 13 07:04:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27733 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp116302iof; Thu, 13 May 2021 00:06:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPQit6TwJOGjbtPkzZnG8lVWYFJuqXLoxZRE6hlrHNnWtzioOHKKKWercm3Pw3J09VpErc X-Received: by 2002:a17:906:364d:: with SMTP id r13mr43112403ejb.250.1620889595176; Thu, 13 May 2021 00:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620889595; cv=none; d=google.com; s=arc-20160816; b=Q+WgEOcJkOaWQ+aHWSt36sB3xr4SSyDzC0Xb1U0l62wIi5t4e70dwEpmipUwz9znZs CmmXEQuKh/KmemJzSnAZznCM4zZ8Er8Q5yavbtYMaayQdu4VolPX+lxkL/VRgb3MOByo 22ovDeoWf9/FC19AyNymEjeOIRC8DLMPpPC8hCYREN+vdlZdrnP8zBbhP2ZBVdw4cEo6 wnoVW/TCxRdCP6qURTDCuqLmHpalkxlwRamJ6n2kZvx0lutY0nWNQIVl7TalpOMEcwBU Xdo/46EdsNfrLtnlwokws8m240yO8fQBzK2SXVKTIIWr7ZC6cWZGJdahPA4MCXrG8G74 Y9zg== 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=wmtOI2X8xRwReoOkttUQ+R1hB07JH3r1C2EtK2xYVOo=; b=arGV5g7GwqPtLH+sak98OtaMJszaaHbx7iUyV8tH0lqNPxZ+P+LZMtLgyvlkpgIcCF S4wjQfJeDZ1bjoCG9wmyLXpnAZA9Rw8Lx5wolqNohkL4TqRpoQRfObN6SuyCHngNbK+g dkIV3hhxcztzbopGOd0MmYpY0T8LnfTuzkdyFpl9JjeZOhF5Zfq2I1XY/BObJPNXLgcf nyrQKBt3Zbg7CtNUFIRGsxfXc5iv5escJ4H76NSmxoExNZExHgfuWKhDc/jZwxdjXaE1 VazIrRidPMmumhs1Vz83pfv25LfXO1T86nK3wTY5MUYHl2ApLasnIFCIlrdfmChxPDfp 85Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Fk2+yIiF; 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 l20si2131710eja.660.2021.05.13.00.06.34; Thu, 13 May 2021 00:06:35 -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=Fk2+yIiF; 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 D236D680CC5; Thu, 13 May 2021 10:06:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5AA0D680BD2 for ; Thu, 13 May 2021 10:06:30 +0300 (EEST) Received: by mail-pf1-f169.google.com with SMTP id d16so141124pfn.12 for ; Thu, 13 May 2021 00:06:30 -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=bac5SVfA1AwS/xydb8QwRfHsJ4gBkRGmntAF+Dv73CM=; b=Fk2+yIiFbPLATZfeiOjGM7UZ7ar01YtQG9gAiLc3R1gWNnCr02PcSw8nInIgWfFNhj OLdcRJoJPGu7YkMPP9IKKQxxosyA/6EcgUR+EcNyvx9YBxYJ9bT3PwmI8VVjbO/PXwxQ bDYnY8zrTESRxCE5X6M9doUw1JmPNmCaltmKHXglZ2ENsmRKKQJoSC19Uyrw5RLmKCWw WG1+1MtF+HGb7/D/azWgp6tTQypx67R4LFHSF+Vv1Ks8qIuLIBPelv8BmPPx0v4t2OZJ 2hptIfZoiXOhT5oXAbmi6aoaFNIVjFr41eUodQEsenlHwwps1FA80jDseufbxtHINNWJ ssQw== 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=bac5SVfA1AwS/xydb8QwRfHsJ4gBkRGmntAF+Dv73CM=; b=H6jLEgwpDhwcLT3UCSck97CY49/9L91Ie4bjMDg1xsM36ffH3lt0yXYL2AyrHYE05/ wlW/chsHupChWQ5+1BIgC+UMwilMBc7PL3gqaHCVkSZyKAiFWxWO8lQVxI9VFTQs/YLp dpbjBuq8wq7m/TjUv1XbmbROnc+95liYFEnERs3dQXWwjoOA6Pu4I8NCIY3pmuioq5I+ 3Ztrrw5bZo+orGZsrWbJM1Rt6BvMiurwT/020PjiZ3cezrF37AFCJTakbJpPbubmmyZn Ab5dVhyOMqWwZsbHFOewIxVRz9gV4LUACD8neUw+JCj5nPaPVXTUf6N2LxcOJfmppLEK 6XXg== X-Gm-Message-State: AOAM533cLvYlwFcg95G0M/FxYVXhWpkrT9C40Bk5loEgLfi4daAiC7sJ +yTrmgFiinbAAlFF+WGftE+GlzkOAILjig== X-Received: by 2002:a65:4382:: with SMTP id m2mr39936888pgp.354.1620889588677; Thu, 13 May 2021 00:06:28 -0700 (PDT) Received: from Pavilion-x360.bbrouter ([103.157.220.58]) by smtp.googlemail.com with ESMTPSA id g84sm1408116pfb.198.2021.05.13.00.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 May 2021 00:06:28 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 May 2021 12:34:23 +0530 Message-Id: <20210513070423.14234-5-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210513070423.14234-1-shubhanshu.e01@gmail.com> References: <20210513070423.14234-1-shubhanshu.e01@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V4 5/5] 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: TwOb5JyPAV7o 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..87f99d7d67 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 unary math layer with DnnLayerMathUnaryParams + * after parsing 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);