From patchwork Wed May 12 18:44:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27725 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp5281580iof; Wed, 12 May 2021 11:45:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNvsao3f9IAIV1dDg5YxfNB5rrTDFhjTfs/6KZyO1DdrW639mfY3z6lukT2Og8EMOVM4IB X-Received: by 2002:aa7:d4d5:: with SMTP id t21mr31794685edr.95.1620845120093; Wed, 12 May 2021 11:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620845120; cv=none; d=google.com; s=arc-20160816; b=FDXyfCU8TDHf2Dm7Of8FsFFCgM4/UTzACTbdegcEacCqgIlmUu6Yz2O8T232u0Llyf JlYPxON523Y7iUBca9EKZCDctes2OnyoNNgXfKoGjmlraricJPzskGezPH2ePX3Kq9fU ymvz0a7OCHfb7CzXdB20AhfNpwmUs+WeHyK1Ax3fByNmftwdBJUT20clatkLLIF3qxQ9 rU7dAQNw0bevqn9fptjACMoAqGO13KC/fGnauRcmw4qmZ+fnB1c4IrGvyB4jnCIIphr5 fQBY1xql1TOCvfeFsrqDV50YoI8LOmy6lytU783SUtrH2yLAKNexgzANMPClxAJHYCq6 K6VA== 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=aRPba5jiaRIKOdw86oTfrlUVs6BPzlimXbTNN9EpEWg=; b=JrdUzvJMNM30XcyZk6jj8WVJ/bWyUISTlTJMYldX9Z3QM71aLy9Ait1qtht2Gg5RJf LMAo9VXZ4wgyskxs8Oxczjuu/taD+wWen5UCOsI+ATiSBhknDrYJYGEpwnhnykIShVKV nqJw+X5kTJ1pccXGlJjkq9Sd88ph3fd7+ZASMngVSm4XsgqvX/zpIDMmwSVuZUHMpzEm vfxe4nVN/2HoCKPooVsDKZEhE/lns1h8LQfDrJHdVpQp7Za9XAQBB4wfmvcubCOZjKcp jslsIVllcawSWuMh5gU6wRKsALCClNF0sv6suDZ2SO1Dc5zd6fnMt8tyZ32IP5Si42Ax meuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=XVua2uEX; 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 q17si754688ejj.672.2021.05.12.11.45.19; Wed, 12 May 2021 11:45: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=XVua2uEX; 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 226FB680A37; Wed, 12 May 2021 21:45:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C4ED26802C0 for ; Wed, 12 May 2021 21:45:09 +0300 (EEST) Received: by mail-pl1-f173.google.com with SMTP id a11so12976479plh.3 for ; Wed, 12 May 2021 11:45:09 -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=m7z4xbKiuTsnBL8Mqd37rEVFpWszK/1dGTyTDuHQhAs=; b=XVua2uEXFux0XQW0EtQBjcFNlfAFXlRgYr74AC6EP9B4CWvRV97LiSPF4bYV3T8TnR 0tlKGeTvMJHiMIkquFvrjBOwLuhwqThNCQfDeRFD3ubMF5/cimRqJpQIgRKIIKHxlQgD pnZrSl95eXRLZm7Qgs1euaGwbseLBDq2EGKKx48RMjgwZPkmhZMLcwWQRgHD5g/gUyKU 8phRWLxuh16pa/gqqs5fqPoXYtdV14ImRteLJ/Fi3IaWnUrM7rv0eDSrLX066G1OgoDV sV8s1vHHPz8sxTC7n3QZjCZopaNzqNnD8MwYtNOSG0kJcMQwUSl0R2TjAF8MOReJTavU Rrdw== 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=m7z4xbKiuTsnBL8Mqd37rEVFpWszK/1dGTyTDuHQhAs=; b=Nn3SJOdAsx3DZH2h6tpv6QTfuw3ZrxyJDx5IFARaifN/hGkck7+V31Rbv+6FToS7wP XLQjopU8UtHf8XpH+T+JdKYxI5Dp6RjI9WELc4Uf5BuOFVQ5OXEgkuX451DJEIY2ft0v 6+FMcQ+F814hDp1xQ1UhfUTu6DhwhUSCr8o19kYFb0E+7/UCKKrO29MkBBfS7A/lNHdD 3aOsHgcvRUHwzOpVTOw+3WhN0GKep++yJPumk+03I+JDowN8LmTUoh4F31tY3yZLwgTo t6xkMcOqKXpJ8ssM1VliUu77d4LGDh8ziYNCJaK91S365Cy7uiV6IRcBfyLtQG/FdP3L O0rA== X-Gm-Message-State: AOAM533refif/4GvmAgi+M7gZ0ynLncVkE6U1TOIlonzh5DMMvA7WzVR KMhYB3lSN7Af2D0MfTNn58dd+qM/cJTWIQ== X-Received: by 2002:a17:902:d482:b029:ef:28db:4405 with SMTP id c2-20020a170902d482b02900ef28db4405mr21917055plg.40.1620845107463; Wed, 12 May 2021 11:45:07 -0700 (PDT) Received: from Pavilion-x360.bbrouter ([103.133.123.78]) by smtp.googlemail.com with ESMTPSA id js6sm4866120pjb.0.2021.05.12.11.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 11:45:06 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 May 2021 00:14:36 +0530 Message-Id: <20210512184439.30591-1-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5 v2] lavfi/dnn_backend_native_layer_avgpool.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: P+Buiy+Yb5C/ Add documentation for Average Pool Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_avgpool.h | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_avgpool.h b/libavfilter/dnn/dnn_backend_native_layer_avgpool.h index 75d9eb187b..ae55940366 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_avgpool.h +++ b/libavfilter/dnn/dnn_backend_native_layer_avgpool.h @@ -33,7 +33,36 @@ typedef struct AvgPoolParams{ DNNPaddingParam padding_method; } AvgPoolParams; +/** + * @brief Load Average Pooling Layer. + * + * It assigns the layer parameters to the hyperparameters + * like strides, padding method, and kernel size 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_avg_pool(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); + +/** + * @brief Execute the Average Pooling Layer. + * Padding in channel dimensions is currently not supported. + * + * @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_avg_pool(DnnOperand *operands, const int32_t *input_operand_indexes, int32_t output_operand_index, const void *parameters, NativeContext *ctx); From patchwork Wed May 12 18:44:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27729 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp5304819iof; Wed, 12 May 2021 12:16:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2kpENI7F8Xyr6r9DPCorqjGka0Fse+g0zzXqsWUygB56pMFYhj20ynYA6glI0dTmMzQYt X-Received: by 2002:a17:906:9892:: with SMTP id zc18mr3984704ejb.354.1620846997447; Wed, 12 May 2021 12:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620846997; cv=none; d=google.com; s=arc-20160816; b=NIBLfzubkUt6IiboXFbEU9obnERHBacOzOjv3Xy18DsLIFpZb3oGvvHzHd15gjlQOW 77yXP+/dLCVBJ4fEZ220SXLVgAZLYJiqVqpy3hsMGUpwGhEb6BJgxRgTZrnIHVRE4KNL SDEE5o8/nVydZLyiZrocO3BIVnZjPh1Jsa/viEV/6jQlzcEoREi+iidsCB/HlN37pRGs EMLUkqgsYQ9JgXvUveP7wWDzbE9yQc1vTZyiR8+BRgmPoZEmB0BYbQd0FOd0Wb0I2wg7 gaogd402ixYmi4CqhTWZCyKOLcTHy0W2HFccXtz6xmHgcsQ5YdkYeNVu8gZgpnsDd/fF RTww== 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=Xh8GKOaOVKzRRlMhv4DTS+H+aiSz6u3EMgNNzVxm9w0=; b=a02S9v9CLg2DfeAJxAlxeb+wT0qhGNiV+IEwqT7VrpnLnBFlMScgXUEW8qDMOggqFv RMzlsD3oTVKLgYG4SsUaHycIYVDX6l4RNNRFEpNDXDIru7DhJATwFF1R0O2YBbpkBx0n vQNnFkhy9wP/I9x+5ItBQSsAgJu3GN1Q6Vjl0IszzPrLVTA+a6tBNVOr30mh0Fkmm43f 8XdAoBqb9gt9aHRzVK6VUnTmi7ny4VsEn1uuynY1rcO4vtNVa6JgzNPPwRBbLIhEPte4 fN+6YMxz7bWurCsQqz3PXvRzZumfxM1f85pHuFrHdEO7JVbl6Cav327HAgh8O6Co0x6D uwOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=pezqs2LO; 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 g20si529160edw.610.2021.05.12.12.16.37; Wed, 12 May 2021 12:16:37 -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=pezqs2LO; 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 70C81680CC5; Wed, 12 May 2021 22:16:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5C66A680515 for ; Wed, 12 May 2021 22:16:28 +0300 (EEST) Received: by mail-oi1-f182.google.com with SMTP id i81so23271909oif.6 for ; Wed, 12 May 2021 12:16:28 -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=8QGW9BdbCTg9beWHk3RdDaTHtPpk36o1vnjZ9WVWPo4=; b=pezqs2LOBRRDw69pRUDWOoI5ecvp22BXhP5n9Yd5/YA2piYOzLkjhLJFYSMZ8sT/0k 1CXv0hHzon9krHarXHmwZViSvZ088D05GzsqdONTH748d1DePOz2Pg9ZUi5sdc4KGb// hcignNTBWYktcpWD9uCL5tUEhBnuhIbvy6HIyGXXKHGSLkbhEoKo8H8MkynqIO6VgAqY +86RavaJlApR8xoB5FuQJDOHvYmwB9ceYof+0crIWnv/2uRtDJxQXrV9OddpEurzZVwn Hgh3qj+fMJ0Yb8OyApcLKG62wEw2kRHDlro2TNuH8GZ3YmOqW6lBPGr4/ueObUnU5ZFX JXbQ== 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=8QGW9BdbCTg9beWHk3RdDaTHtPpk36o1vnjZ9WVWPo4=; b=Kr9XPY0dtZ3Damvr+nXOGLLpBSmn6npFs77lGbZr4OvczqNQ8de4gvHebvADwXTFqj xab+z7U2LGUQ315Q1f73VVqGxPuLF4n6GPzG7ZQpiIDwlzl4e2ncGe3NXD3XGd4Sy/Jv rDP4dn4td/oVEeiTAFE4A0eb53T/rxzWaNXiQ/OLlAs1RxBtR9++Ft/n5mFkT2W9neVB Po5JLcdKhTliYXPC53SG5Ucjt5jizkvf/b55bEKVtMz1CVEkwE2FTihjnHfH2ITrovK+ MJfHTIY6xfg21gCFD7NAVJQ/VfMC9ITMT+Djx7Iu/dN8dcxpo4O0FQNPHqBc5RYu0NMQ Mc5Q== X-Gm-Message-State: AOAM531rD5C0r8WoRXeXJva0OcvIVvT1RLp7w2v8weSkNmKghR/N3klD +W7D3SK75t/wsQY29BCf+LpMQFLpAP5T0Q== X-Received: by 2002:a17:90a:b292:: with SMTP id c18mr12665368pjr.179.1620845142828; Wed, 12 May 2021 11:45:42 -0700 (PDT) Received: from Pavilion-x360.bbrouter ([103.133.123.78]) by smtp.googlemail.com with ESMTPSA id js6sm4866120pjb.0.2021.05.12.11.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 11:45:42 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 May 2021 00:14:38 +0530 Message-Id: <20210512184439.30591-2-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 2/5 v2] 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: /g1fUd3D039J Add documentation for 2D Convolution Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_conv2d.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.h b/libavfilter/dnn/dnn_backend_native_layer_conv2d.h index 03ca795c61..1c2d68b595 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_conv2d.h +++ b/libavfilter/dnn/dnn_backend_native_layer_conv2d.h @@ -34,7 +34,35 @@ typedef struct ConvolutionalParams{ float *biases; } ConvolutionalParams; +/** + * @brief Load the 2D Convolution Layer. + * + * It assigns the layer parameters to the hyperparameters + * like dilation, padding method, activation, bias, and + * kernel size 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 From patchwork Wed May 12 18:44:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27728 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp5305696iof; Wed, 12 May 2021 12:17:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwew/2orJ3M5b2SDs4qwD4xBbutB54FLAPVsGsXQjMvcN0qiduNodg8Dp8EE4uy3LDMW1Zp X-Received: by 2002:a05:6402:2283:: with SMTP id cw3mr45017749edb.122.1620847071805; Wed, 12 May 2021 12:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620847071; cv=none; d=google.com; s=arc-20160816; b=0p77LzXZIQEmrTSFCGuUwPjIkSTMJrLLi2db45ZtH0TBsfAMFruypvj1MAx0xmSImy sW3BUOwSpKr/l9WQrOZ2kgASqNSXAJnWS9kcP316ffBaiYVDBYZVFYXrriLWbK0IslpL u7wXUKE9v4Hqw57L5aqd5NYaDswTwB1ZPx5mFvMll8WY4mlnMl/WSfmbrW38V/fVT0On cu2mL0FtKgR0UgfhUQGMV9co8bSTQNUD7n/XmuRgx/uRElnqb+QFMi6O3BuOWiYmwurd XRJjCfUbgHrYIVNTqmLIjVKPNXSjAvZmrK707Z7mv0c3OpfgjwsPgHwkzYTh4Axo9ioY xa4w== 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=YSij184ceYS5oY/zyFSMbJqJdA0HJaGR4958BDTdF5s=; b=I4pjblSPwcWeZUqsicVBsnTMIUOCtoEH1hDtgBN4lc92nJP6qld/oEgYo52u6Wmgc+ mNGXhnVyLHKMgUBvSt32X6OXTfTtmFgCcyB/diEYaw76OD7Ub02eDg6WoDnCJxJdtef0 pBfa8kBPpSAbM3aXTYgN1PPmfNvm5K3Jta4XTPK+zW4ZO17kLrFfwrSWRJmnERTv5/nB U53vwUz/EEEYXcS5AzLIosP5FkhHr5nzcF3WUXir7HS8+vZifZH8Ubost46m0lUe5Ptr r3VZb6DajpC13GucZzdHeKJX9RARvgqYpnN8NrbmlT3RVqlZRtm+CodPX0TUVZDnKcgv Yz2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Apzf5Zfm; 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 a4si64332ejy.359.2021.05.12.12.17.51; Wed, 12 May 2021 12:17:51 -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=Apzf5Zfm; 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 AA35F68809B; Wed, 12 May 2021 22:17:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A1306687F43 for ; Wed, 12 May 2021 22:17:43 +0300 (EEST) Received: by mail-pg1-f173.google.com with SMTP id q15so14695527pgg.12 for ; Wed, 12 May 2021 12:17:43 -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=C9AUNDNMEYvbu9RP2NXT9ebaqxtJUGm6wz4E+zhwIEQ=; b=Apzf5Zfms7KisqtXp8GRjilE8TO58lsSzTTTD4lGocAvxbJQ4xhwRlcqiOkMxk9KMy UlTF4wWBoHIpHourNz56M8YLibr2StRfDVGCSnWEYSQJg/PMsneREvK6JSVDnrlcgf+J SgpuV5284aFjtPt+kVTrGijJEtDDjzLsbVMq2/Ew/Ann0kWGRNK2DgKvZWsHPQGAHiK+ YQGQE7ycteC2KcoIzKjs/dMfiQnY2ENycoKm4HeI2y+pf8JHoozpnHbe/94Qkz29XpQf nR7EIZpU6jCANUiZCcxdhOI7ZTgJRm9g1ttOjvCeL/ywpfyN5R95MNfOvI4O2j68eIw2 M45g== 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=C9AUNDNMEYvbu9RP2NXT9ebaqxtJUGm6wz4E+zhwIEQ=; b=piYqywFjsJ+ImIX9YOjyoE1V4tgWXCYZG9y/oPWknP8di+lx+q4ut5AHyqAMMnHzjY aJC3d7FOWCs4s+WPnsJRmNlzKH9KK/sZqkdu5WfTFQLK35rAQMIHku5GCRj4d2KGz1x4 c+czeonWXTEO6VdKHJ/d7iv+jQybABgdOLauvMPwuzZKeuSfDJwVFNzr5f8g2e9X7km3 +C6XgIQjdYoaPqUNqCU4W+UnbTp62gk5H7RgP/CFU8RRSf6gbWRmkogsH/prBnyFblwt 7HjztPhoDsYZl63UEaaGnPjaxCp4ltDTCeoi/eWRKV/gD3DINMDgdPn+CzRZGxy/tEpD LHcQ== X-Gm-Message-State: AOAM533EY1p5WskxiNBoJlEDo846mVnYYtiMjualp347cNq4n+LcYdL3 VGxTEAJVFe6NDAjdHfwILyuMblh7HVeyIA== X-Received: by 2002:a17:902:6504:b029:ee:d332:4bd6 with SMTP id b4-20020a1709026504b02900eed3324bd6mr36790718plk.37.1620845157005; Wed, 12 May 2021 11:45:57 -0700 (PDT) Received: from Pavilion-x360.bbrouter ([103.133.123.78]) by smtp.googlemail.com with ESMTPSA id js6sm4866120pjb.0.2021.05.12.11.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 11:45:56 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 May 2021 00:14:40 +0530 Message-Id: <20210512184439.30591-3-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 3/5 v2] 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: tcyA8bKf+DaF Add documentation for Dense Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_dense.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_dense.h b/libavfilter/dnn/dnn_backend_native_layer_dense.h index 86248856ae..83fcb18831 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_dense.h +++ b/libavfilter/dnn/dnn_backend_native_layer_dense.h @@ -31,7 +31,35 @@ typedef struct DenseParams{ float *biases; } DenseParams; +/** + * @brief Load the Densely-Connnected Layer. + * + * It assigns the layer parameters to the hyperparameters + * like activation, bias, and kernel size 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-Connnected 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 From patchwork Wed May 12 18:44:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27726 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp5287890iof; Wed, 12 May 2021 11:54:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7q4oyBZSD9FJrLMbFarGKJcbvRMrUXTdg9fA87L8ph59p6MVSKnQV2wu45dNEq2nNzN8S X-Received: by 2002:a17:907:2cc2:: with SMTP id hg2mr37296956ejc.62.1620845671625; Wed, 12 May 2021 11:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620845671; cv=none; d=google.com; s=arc-20160816; b=GP9fUL+s3r6n5bQmJOkBq3UMeBdPWl93d8FOsIt4f72w+agYmLCNQSnXiCc/yugDHX slBUjqc0LfoPVTrO3VhX4V0inN+jswdPupPdDEnBVr6eOcvXKdv2fnIiCehUE6KQFfZP +W24BjJXkTz7X9yoBN6u+ek94EQcCh/LNrSuhTqODvSaSb51MI+iPaIloQFh2bDp3VV9 pu4iBP2o969+np8tkFMkdfTGKq/3QUgRxFHVfXdY+LBtO281JSfowBgZg8W+L9DCV6ol etba2Yf0biuTQzBapiJ5fh88xd9OfxFdBYvl7cOyMLEUV3OXEoA0JxUgK7Z+4ZHYAyOi GF3w== 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=Jk6TveDbb4XEwblJgeXjkzk19SHJALfRXT4sLZflauw=; b=xikj3RFKUMqlJv7jsT++LRf+KjC+FLJ8SGHb0MnJ3sXJjj2QCZvgmzL4JicopoYuM5 6l+PzCedOC1rtc95JkET5TpJcxa42xJHVI+5eAQE3O1DTEe+Yi801gAvzgtL+R1S2Bl/ qx2bDXW+TMmSIPXS94VYdzJfK/FLq28yxERLZRCEbetQz5LDCol1YUJSB1XT4mwj6J8d V3xZeMB4EpG4maQ7v3AUJ9WqggSa+IzgxaW5U1jWyxs15qJgIdimh+iiApUljkvkYaTR jauJDlbYY2umWQJKLbhglWBfbjsqHHFRgiockLhsU/ulEPuuPkk6jgQSqUxJXRUXAfto RhRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=UyAGCjoV; 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 k18si729270ejq.681.2021.05.12.11.54.31; Wed, 12 May 2021 11:54:31 -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=UyAGCjoV; 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 C6A29680B24; Wed, 12 May 2021 21:54:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1D75F6804B8 for ; Wed, 12 May 2021 21:54:22 +0300 (EEST) Received: by mail-oi1-f182.google.com with SMTP id c3so23134221oic.8 for ; Wed, 12 May 2021 11:54:22 -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=9fiZ8h+rLok1DuBuHx80NvyB2JKtWS51JILb/tz/PRc=; b=UyAGCjoVd7oAeRbMXkx+JCAUQH3NIcZZoXXoX5IObteeytrE033CNdais8H43fu+Dn 3XiqXp6+NBzDrpcZyG+zRKlIoDlHfUYU/euUOAKFA027YIJn6BsnO4B4d2E8sYEK3aUA aWZJr4sTC/iMEhJ0UYvZyZu9uwGIy2eWqy2bMG0LnxPnkmbmcnxnv/Jg+bUhEy2SyMks t6ZBUbnd0E1QdJ/47F9fXmiKsBBw9SilVJ1XoxoSf/GFbEyV/Z16wCGVKoCrmleTU/V5 LcRlJhAWPSkBoUXkyglgxCxsPOcvLBB/KEBKePiWemPnWwmsPV9Zqw8kyNG/XZG2pUO2 RFEQ== 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=9fiZ8h+rLok1DuBuHx80NvyB2JKtWS51JILb/tz/PRc=; b=DHbjVrUnJ+aTq0nizwr7duaeZcC4Y16CCMShL0lxf+TMyWTcVZqxsqaaGzRhQTiA67 iSaGh5eIXvn4zrU7WB7z7hHlcE0t6u0T3jpvw6D+IUXWUhQLTNNCc0KTNZ8oDsXatRu7 feyHOf3gEdHlYYo2fjuX886hPqen/mtO9HFL+Yp8IjnmjbJB+CY3U6DzIv1mdmDpDBLg bJBm0YYpfaPOiA9j3+Ij50ekAqHErROWFVLKyiLPhzxz9n5I0zn+OqsPsSHhpKAyfaL4 GKb3bWL86Id5Czn+8zOa6/Es9FM4Nch6Rp4wc4hKte0787izgCOhYEg5skFeGs/eVdro o65Q== X-Gm-Message-State: AOAM5312v1aE3gawu6eFKqMg5n2KKaZ1S8rTiA9+5XXSobfJ+iG9tvQU To4tfzszHy9deqpzAtNcvO73q6NOL9462Q== X-Received: by 2002:a17:90a:c08c:: with SMTP id o12mr27743595pjs.108.1620845179467; Wed, 12 May 2021 11:46:19 -0700 (PDT) Received: from Pavilion-x360.bbrouter ([103.133.123.78]) by smtp.googlemail.com with ESMTPSA id js6sm4866120pjb.0.2021.05.12.11.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 11:46:19 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 May 2021 00:14:42 +0530 Message-Id: <20210512184439.30591-4-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 4/5 v2] lavfi/dnn_backend_native_layer_depth2space.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: DqDZxOsxdVNk Add documentation for Depth to Space Layer Signed-off-by: Shubhanshu Saxena --- .../dnn_backend_native_layer_depth2space.h | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_depth2space.h b/libavfilter/dnn/dnn_backend_native_layer_depth2space.h index ef59394443..664b386197 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_depth2space.h +++ b/libavfilter/dnn/dnn_backend_native_layer_depth2space.h @@ -34,7 +34,37 @@ typedef struct DepthToSpaceParams{ int block_size; } DepthToSpaceParams; +/** + * @brief Load the Depth to Space Layer. + * + * It assigns the layer parameters to the block size + * 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 an error occurs or out of memory + */ int ff_dnn_load_layer_depth2space(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); + +/** + * @brief Execute the Depth to Space Layer. + * + * It rearranges the input data from depth into spatial + * form by applying Depth to Space transformation. + * + * @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_depth2space(DnnOperand *operands, const int32_t *input_operand_indexes, int32_t output_operand_index, const void *parameters, NativeContext *ctx); 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);