From patchwork Thu May 13 07:04:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27732 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp116392iof; Thu, 13 May 2021 00:06:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdYvZY2Ew1lSSAtUkq1JPtVyGtloNtZ6msSv9k5CSF303QkcS+4rwsMsoM7q8KxAY3uwTQ X-Received: by 2002:aa7:cd0c:: with SMTP id b12mr48110807edw.236.1620889604496; Thu, 13 May 2021 00:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620889604; cv=none; d=google.com; s=arc-20160816; b=Fh2nkCjXTqht59RL5l4pNRLEdWlCeO7kfay5FZOQCOwapGnIsFM3JEJEi2vC3Pxi/K 8nrU6x6SISqGStIc43e6L7SqWsPIaW/zjAVUzLBUp2JogzWG6JKaW0zi6dNTly6ufKsU +iv7segHrItAngn0HYMTNALkcDrKbQx6HqCS5KxNdfuY62pcy2gvQaE/odllSz3WBW3C Rj8elOVZMq5zl8K77/hF6LFZ8WWv/YhKNkf2DMtTvzbeWxxeXekn9pukWNgKNFVUp1py Iwab/xRNXwSm0/0x3KwMNq5CJsNjxtvLEMIgm0TNOtJU4XkdrRF7aR8yFopt9sjyG7bA r8vg== 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=AFTBHYb5wR5vDfsZjAz6c2Zm8fsAuTZrzHUzt6CwOvg=; b=K2TPYq6UM4PtXIxibWh2uM6s2axWv+GmhTH8Cz6wdadfTMmPAxbqYaXDqk0e0reOG4 dpYPfBCmjQiYmiCckXAr/gOrKDMdDiNbglEpy6E+6tQgc/j8DVSdBkNrHJCfobOdaKh2 cV+dkLJq9MGZEGo8JW3BnqQsuM2xreSqHme+VHvlKp9jGs3eSs8EsacRaF4jGrAZNGJs 36JPJYEyiNTyo17CNzOpriZsu6vMQ/5N+Bj/3BHg44garDpU1DWzlMtOJG8lybj/U4Np CEobuhieGqzjUGtesEqsTyToPzBUC+Tt81/t1iyVr7vKlvRgm1wREdMkESc47PhsZ4RS x9uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=unzCavCv; 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 w18si2285501ejv.279.2021.05.13.00.06.44; Thu, 13 May 2021 00:06:44 -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=unzCavCv; 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 324B1680C6C; Thu, 13 May 2021 10:06:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 19585680B18 for ; Thu, 13 May 2021 10:06:26 +0300 (EEST) Received: by mail-pf1-f178.google.com with SMTP id d16so140967pfn.12 for ; Thu, 13 May 2021 00:06:26 -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=X/cHgge4TLaSed89nAv3OSrHL9jq1d2BUauGXRI4wt0=; b=unzCavCvEAEKEWB39h5fK/DvU+EYlSxo0FtMpxSGiyX/JQh2/PWKl94MER1LZU3TLv /yHDfu7hyWD8utX5paaICb/F1XW3YMLzEpvczJCKs31bK4AFtk6T8Z+KNvQD6fBJnEPv Vbk17KWrDR0pkgBpl2mMylwGT8Ic+j73pBDBIs6pNPVrjiMHTqLSnUClDHxZr4mZzDjB 7G7n3LJTF4nmHLEpSLXO/OqLAo26Byx4PgVyhlPJ42SJHQzULAYYMrO93njQES9t2cuZ fyxrqLND6Ak01SzXvTLtbofEv9uAxkNTSbG/uSB4k6O4N+/PJl7gu/k6Jb3RPtliPN7S UQZg== 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=X/cHgge4TLaSed89nAv3OSrHL9jq1d2BUauGXRI4wt0=; b=BI60J5dsrWN1ZXCzzYC19WkmW+UuwAHW1YSCKjpnH0kAk1RMowmaHubvTtrmXSBSHa kAXjp337IVQ5TQ3nd53E48nklND94/t/tcdSzzXKgxcvKa70tiIvfv+T0+pu+VOs/YBE vG/4IxSRt5stZW9Mou66KXcVxS4RcT43CU/R9kjDyXu4poIbqdxebLwhvyzxk0TmIotR WoY8Y2Up14h+FHHvdoIxKFkk9U6/E0P/WCYsEshtkJ3ohvgdlvNkwmuuY+mxqJGN22D/ FPinW0JVEqRXLqnwaI7qOfOGlfoV8unwL0AZ0GHJNbeW6P4GdLVwgaJhyxniqdHsBmHG sSXg== X-Gm-Message-State: AOAM533XwMjjakJDNLtVVkpDakQjoYeZ4DF5niOw741gRBBsnXHR//eB prbMQpKBFZDSpjTSBKIMhvLX5IwoD30lRA== X-Received: by 2002:a17:90a:2903:: with SMTP id g3mr3167156pjd.221.1620889584414; Thu, 13 May 2021 00:06:24 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 May 2021 00:06:24 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 May 2021 12:34:21 +0530 Message-Id: <20210513070423.14234-3-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 3/5] lavfi/dnn_backend_native_layer_dense.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: UXgx/kX/S2gn Add documentation for Dense Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_dense.h | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_dense.h b/libavfilter/dnn/dnn_backend_native_layer_dense.h index 86248856ae..e590863e95 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_dense.h +++ b/libavfilter/dnn/dnn_backend_native_layer_dense.h @@ -31,7 +31,34 @@ typedef struct DenseParams{ float *biases; } DenseParams; +/** + * @brief Load the Densely-Connected Layer. + * + * It assigns the densely connected layer with DenseParams + * 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_dense(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); + +/** + * @brief Execute the Densely-Connected Layer. + * + * @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_dense(DnnOperand *operands, const int32_t *input_operand_indexes, int32_t output_operand_index, const void *parameters, NativeContext *ctx); #endif