From patchwork Sat May 8 12:10:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27701 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp1362352iof; Sat, 8 May 2021 05:19:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4LfVqNyH8jblQychLDl1m4IRx3+oCdHTV7HfV93bMNY+puAnk6Y2kOX4nApyjmJf/MAQe X-Received: by 2002:a17:906:3458:: with SMTP id d24mr15869060ejb.54.1620476345631; Sat, 08 May 2021 05:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620476345; cv=none; d=google.com; s=arc-20160816; b=CjY2+NcpAaQXRh/XsJj2UdhH36FDF0L/y1Gm9muKVNOosRCxqdOPnu44JT3atKwZ0g VCEu8C87KNv4RCj+sCtTuzoIcaKIqxm9hb0pb6DhpxWnqZMBgN/kiE69yX5lDI5xKpCh +X9K2fHsnLgLz8X5etwYJWrlRExePqPUrSySYLpyNPUApIDqnURNqhREQ3Gg77eyLSiJ WTdGlkaerTc0VU3LtcJl6NU2NVvMviq0gMT3MB6BLEzcu5W/klFcTbPZ00gaHdve7PqQ KAobnNZchY9oJogUPtwWttSxy3+rMWgUG/MtbrfMczPXRGBc0kUdio7mi5pDKGKSQ61F NZXQ== 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=YGcAC65Ykk+CNf6hDWD51Q051r5IRQ0Qvgr6PF0D3fM=; b=q/huQM6SAIda002qi+tPDVoEZLUZ0USA2ViogRXSm8TWvf+B5mjwPUya8D0QINFBYd oQ0gTpLLdUsjJX8WgYtpyDm9a2OZKucpNHLNjqG7kPiH0K9r22Ap6SaVkTvGDwv9/zBT ydD2+KmvbvsC+qlP+vNpAR6p500YXn6Ee49IvgSUOsswW2PBK+GdJvGbh4m5yTJQzXgw b/HCwx+oYp35ozOVLRDxJOnVgBm/i1XZCf5TvKpvvg2eeQe0v2dAgAokqmm16xbtQYax X/PxUKOYvWjlxEBaG9lzEXfh0KskF83dQtI4GquNP/zndr/kVrrtBkaSgjRupw/kRec8 N7DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=BlhTkFnR; 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 h15si8163280eji.286.2021.05.08.05.19.05; Sat, 08 May 2021 05:19:05 -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=BlhTkFnR; 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 EA6F668094B; Sat, 8 May 2021 15:19:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 61E26680910 for ; Sat, 8 May 2021 15:18:55 +0300 (EEST) Received: by mail-vs1-f47.google.com with SMTP id o192so6049275vsd.7 for ; Sat, 08 May 2021 05:18:55 -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=jSxMKWh3+jz7RcdjlRG6R8lzA+iC0minGFGoOTlEgTA=; b=BlhTkFnRyCxr9+P0ti9XpYgA05oJiTmYjNLY4sIEfY4yQporTNrhJunXpCvmz9x2Sf jI+Gd9jkhixKFhmghJWzEY+xDxuAopXNbWI0QUf69AmL3sN13npql6oXx92U+TcadYvF e5yRaH71aFFn85vq0ta93AGdxfpDIHpp0H31uZeC103xNbqlBh1gw/Gn0JVABpR/m/gT Eh6QERisj6zWxxJsyLhPz7GtksKFB8d8+ZYBoW+EaMkDy0dL7tiGBMTUuVEBExBB5xrJ X9x6zmxp9oZNpFEK4hfbEQYDW+d15fTg2l9BHAM6u4/p3VXFRADA7lbBpk8KpdLPqY0o ZEvQ== 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=jSxMKWh3+jz7RcdjlRG6R8lzA+iC0minGFGoOTlEgTA=; b=eZTL29ZdCF3FYQcLyrMx1oxz6Amtmj/oyPGgqCup33E+GGJn/s5Blc6JDNu9MQRAxJ BhxoWIemPe7ifw69WjJvKnIWgA2/uOSHb0+N1mG9i8DcQQlGah2vM/K1XLkc2faKlRCO IAVfH3Ukjn4pif4vBc60vsOfIBxvjMxmffeem5FtFRxI4clraVOxUz3H91hxH6CwHwnN O8/MI7RhJOHgAFy8MV9i7RtiNhxl7wPk4/V1r/3rqp8Pj8WUUw6HEY9gb07qhCqGuxny C/jyRO7UWYtQUCEicj93VkNLlt+fpr6wJpJ5aE7O8lXQmlZAu10/G6zVSU2lYoOHiq9F 56Yg== X-Gm-Message-State: AOAM533v9gdO3peizkhCxrvGTJczaT1h0bJ12M6T/Mss+iYyfLQF8QiI 5ZQoduujdh8M/fZNW76DS2Un5NylVTH2fA== X-Received: by 2002:a05:6a00:a95:b029:25c:eb77:723a with SMTP id b21-20020a056a000a95b029025ceb77723amr15307195pfl.23.1620475854441; Sat, 08 May 2021 05:10:54 -0700 (PDT) Received: from localhost.localdomain ([117.212.37.139]) by smtp.googlemail.com with ESMTPSA id j3sm7052216pfr.30.2021.05.08.05.10.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 05:10:54 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Sat, 8 May 2021 17:40:13 +0530 Message-Id: <20210508121016.12413-1-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] 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: BZDueLNbrFZ6 Add documentation for Average Pool Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_avgpool.h | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_avgpool.h b/libavfilter/dnn/dnn_backend_native_layer_avgpool.h index 75d9eb187b..0f629b9165 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_avgpool.h +++ b/libavfilter/dnn/dnn_backend_native_layer_avgpool.h @@ -33,7 +33,34 @@ 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 + * @param operands_num number of operands for the layer + * @return Size of DNN Layer + * @retval 0 if model file context contains invalid hyperparameters. + */ 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 input operands + * @param input_operand_indexes input operand indexes + * @param output_operand_index output operand index + * @param parameters average pooling parameters + * @param ctx pointer to Native model context + * @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);