From patchwork Thu May 13 07:04:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27734 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp116181iof; Thu, 13 May 2021 00:06:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjSSq2Kzht6y0+giPbGw+IRI8WEkXtMdWfhMQi/VJnMR+NZX4dQAc/HmwJJQFbvJHlS82b X-Received: by 2002:a05:6402:1c07:: with SMTP id ck7mr48818804edb.149.1620889585111; Thu, 13 May 2021 00:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620889585; cv=none; d=google.com; s=arc-20160816; b=ORSE/0O6ZHMOjfaP2SoBsjZyc7NcYyDIINIO9HZRs1TmlBAt8UWaYJ4HB7VgukO0kq iWH4G2SkkpoCxqtitBLzkMN6p+JulYshhgJO2ewpMm8pRZ3rouGNW5gvXAJOisfm7bp+ QuW8is8W2pMbXhIMitPNy0mzVt7wrGum2aqzIlcco765OjDF3tdGjkZEAIq7hi3d8dUC 1anFwAqF39sv+4jSeUtpA0QQ73B98MG4v5zwxnLrXOPA9tfGc27ioBFvzYoKxOt9GjlT /dswyaOiMJhGngsRcs5qWCa+243iGIeN8muBVuV5ClM6BfiXP7riue6tq7CUs2rcubjf V7XQ== 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=KqP8AalpGh/fXwKl1QvIF+BasZsGNZtY4mNd2w/qWJk=; b=e8m90aBRomaPIaSltzPapZR+fEaxptbdNt3VuxWbxJ6O48lYiNHziwOA7r9NtJpawK Vc3SqjAbpj4ncpW6dVayrytbxVYMInXrFPJ0vvMNtHyh8/eZJojfwhUX9yf/kH9Mut7Q PWNlfl2xDPeqB/ls8FaUBUj/xcczXnWuylMaXW8+0P8zhSpfzUZGH/i4W0DA66yJy9lu AhjdgQTLKhLXZJ2ssauEkr0ZVFafo0PINehl8kLRe/iwM+iGW23YOpgs7flPQDmkNZpR RlZhsS4rHOZXV5mXqxAbHRyi2eZ9X6omw+OjiYxHXzh9dvXheO88GhxwXIDvmyh1nlVc 0OLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=D95jVgUo; 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 f7si2170216edj.448.2021.05.13.00.06.24; Thu, 13 May 2021 00:06:25 -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=D95jVgUo; 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 CEB0E680C21; Thu, 13 May 2021 10:06:22 +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 ABC02680515 for ; Thu, 13 May 2021 10:06:20 +0300 (EEST) Received: by mail-pf1-f169.google.com with SMTP id c17so20886757pfn.6 for ; Thu, 13 May 2021 00:06:20 -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=FsoqQ2RapJDDDK3cxlkBhNQWI3cbm2iXrD5+wwxUFSE=; b=D95jVgUoLc0LKlNjDoBC3/Kav312KuJl1PnyJrJK3E6xcs+0BL6n+/PThZVtq7qa2h qElvJk7jwhiO0lAzARqO1Uo5hlTnmTT1scRFvdGyAmx+rmZT8gqOyMrLSklX8rgAfNop arQZUQ1n4mIspy18fGxVfjgth106QtBTL0dQRtSMmJQq2JFvB3c7nmgTHmK3rzSoAzg7 kSk3LyreFLRHifi4HCRuM8EllpRYBL7qxqOuSOJ8UET29tCa80lA5rN18D7KiezFM6kg qFAqWhPWAYTcz/Top6Bm+m1q4O345yn2JHOgF0rHf261bG8KHMF/wqFgOelJq3QZKtx/ tOXw== 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=FsoqQ2RapJDDDK3cxlkBhNQWI3cbm2iXrD5+wwxUFSE=; b=J6wZpvkJzfbTAvuQfsG3He5obs3i1fLivZ35kcu9m7DysjJg7v6XLX6PqVyFcxf2p9 y8zSy9lKiuQwLHHMhHk88iS2slP4eW6IFqNObjPT8PDYkBjLa+VP5/6FW7aiY6fnMydE LIltW1wXH/sPyLZIOTNPpC5pewjdw8gKSUse7wvvBoT+rWrVgu7qL3EoMcu6UNV6tW9J tApF9uAxDi4FLHy3m0oktZxd0RuCqXb2d30lKVHyXgWrLOVeuswDpPhrSQDG0XhEIU/u HmcwDzQUqc7u35wxLNLfelkLb8ud7+lDf3hMbcx0k9UcLZ82ETe9vcPNhZ2MQjGmkp7i BOFQ== X-Gm-Message-State: AOAM533J8V/dzzBgFf4SzAIhSc7pkAz4LCNFvM6dXnrhUeflHbqcHL3Z zvJlxFuGAzvnuRlott16D8BTdchje7vWMQ== X-Received: by 2002:aa7:9252:0:b029:2ae:bde3:621f with SMTP id 18-20020aa792520000b02902aebde3621fmr28936333pfp.18.1620889578609; Thu, 13 May 2021 00:06:18 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 May 2021 00:06:18 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 May 2021 12:34:20 +0530 Message-Id: <20210513070423.14234-2-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 2/5] lavfi/dnn_backend_native_layer_conv2d.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: 2WHkFBCQQG0y Add documentation for 2D Convolution Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_conv2d.h | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.h b/libavfilter/dnn/dnn_backend_native_layer_conv2d.h index 03ca795c61..f951f8d80e 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_conv2d.h +++ b/libavfilter/dnn/dnn_backend_native_layer_conv2d.h @@ -34,7 +34,34 @@ typedef struct ConvolutionalParams{ float *biases; } ConvolutionalParams; +/** + * @brief Load the 2D Convolution Layer. + * + * It assigns the 2D convolution layer with ConvolutionalParams + * 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 an error occurs or out of memory + */ int ff_dnn_load_layer_conv2d(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); + +/** + * @brief Execute the 2D Convolution 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_conv2d(DnnOperand *operands, const int32_t *input_operand_indexes, int32_t output_operand_index, const void *parameters, NativeContext *ctx); #endif