From patchwork Thu May 13 07:04:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27735 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp115671iof; Thu, 13 May 2021 00:05:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxH1QUrr32+xPwb9L8d2mDroC+WFbWYFpq1KJDLgH6t3b43QsO39x7V82p9J6b3wIr3X9o9 X-Received: by 2002:a17:906:5495:: with SMTP id r21mr41964345ejo.471.1620889541623; Thu, 13 May 2021 00:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620889541; cv=none; d=google.com; s=arc-20160816; b=ZrkQ1hEvho/zFFhFz9FmWWfAPrN7vPUBuA1SilOQ9b4QBvalqEHgEt42RXTkxR2tHY t81BWrh+5vxcBPdh+35Y/fH0j6m5JT8k9LXk89pupG5OYuOCzBCZkNoO+ApmWbh/r0Tu DBmDPCXNbQQ+w6NEC8tKMa8PcYtaMSvgZJ3mH9nXTHszl890NxTHQd1MPjqApbFJdCZs HjzLmo55LEiEcFRR0FitlZgOQsyJo6z7pV5twORudbk7i04wUV9SAx73+WkiJ+XjixDp mjv7qrFeH9rl6Hx+W2sR5IIQ1TTBrBO6fAIBvjqE3qy6qjja/QF/xaYpFzxum9t01GZm aB0g== 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=kjmIKsaRH2VaJxhRvfxhILTs6NDDPXocOJrAk+o3ecU=; b=wTZhzY6eEdk5K0kvXJk0iSSi2Dr876dfRguo4tEgsMA4T2q0TpalHDha3YilmlPl7R OGYuaY9iz1+NdGQdBo3kDxbgU4Uxh9sfQ5jpTzHjZOyvqnR+yZbnRwpMcupRBNUoBVKm qShC5JZigii/w7AXEPEWKuB+hooxLIDFYzHT2ao4H1u7/RcelaRmadiu0nKJ64nKsU7Z yt0wGeyS1Cfnsj5gEQOtUgnGB7Qex9SaHUkr1MJfcfuhBwQ6PamiveMbkujauGXcOVub QrW7UzjcnXzv2vG+rDDSO6bsbhxTHmPkZnkHo9/TxNV4dgr2QCZboBgWDEIi+2LnSwt0 6cRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=DbCRSrJ0; 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 s24si2155219edc.594.2021.05.13.00.05.40; Thu, 13 May 2021 00:05:41 -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=DbCRSrJ0; 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 A2107680BD2; Thu, 13 May 2021 10:05:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B67468083B for ; Thu, 13 May 2021 10:05:29 +0300 (EEST) Received: by mail-pf1-f170.google.com with SMTP id h16so8109615pfk.0 for ; Thu, 13 May 2021 00:05:29 -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=sMYAjj225SM0w3XywmPdtZBg/+SDppKwQG0q+6pa49Y=; b=DbCRSrJ0QAicMsOOFVIeuq8piw3wTb2Bq4D5h814BXxSQ64epeemV2EsGwXDDzuaGB /hcTmOf6Qc9pfXnR2gl4ubmjvnNIsv8WPiSuo/dDhWC9h16kUKonSpOtYwCHU8CbWjGb afLgUOZqJ4LUKurWnZ+hymfudyhzBkfFQKYWTHkwwQuORE7NyJ6I+9ij15s3IiQwCHrb WYnTKPQVBs7VqefIrKilJmGLa3YzXuMH9CdGnOh+4Zqpk/CS4cGE+aI1EndEAyazxAhv Y9BfEZI67CAuD5kUen5SjvlUsDT902ajMr6T3vnt5QvpuumMcoe/m7BLtAuANYH5SGO/ j9Hg== 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=sMYAjj225SM0w3XywmPdtZBg/+SDppKwQG0q+6pa49Y=; b=k91MJgROvZsh8al3JF4YdQCzgC2bHBj374O9alNxCVCHCf6k9kR27TwwyvN2NiUd3l e6UBTf3Xa8+8km4NmdnovguKTwL6t2+yBik/iPCSd33Z4zar74e9Ft1zWv7/gd/HL38L Q7OqunfMk9QxxBfPfoDeVy7BLUKzeJkz+L2TNlbkSd1H30c+dDOczCJNZacTkLpFce07 34mOLemUJovRuRsWOr69Rs1TJi39Be3D+m0557uQRdgbbGNyNNUZ9xOXKFVnLR5r3KnA sg47aalbkOckhALIq/TjP6CgJzrxyndtoLyzPFeHktQS6ulpx9UEBpn9s5CiRPD8imsC GUsw== X-Gm-Message-State: AOAM53223ooBJNh5UINutvhs70A8D34luuPlpXlw6QhcEY6kelxBWH+8 7W9v9xVk/nK62AOQJ6sZaK5o97twfBNivQ== X-Received: by 2002:a17:90a:eb0f:: with SMTP id j15mr1807355pjz.149.1620889527479; Thu, 13 May 2021 00:05:27 -0700 (PDT) Received: from Pavilion-x360.bbrouter ([103.157.220.58]) by smtp.googlemail.com with ESMTPSA id g84sm1408116pfb.198.2021.05.13.00.05.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 May 2021 00:05:26 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 May 2021 12:34:19 +0530 Message-Id: <20210513070423.14234-1-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V4 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: 9PcHk16BacsY Add documentation for Average Pool Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_avgpool.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_avgpool.h b/libavfilter/dnn/dnn_backend_native_layer_avgpool.h index 75d9eb187b..d8972487de 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_avgpool.h +++ b/libavfilter/dnn/dnn_backend_native_layer_avgpool.h @@ -33,7 +33,35 @@ typedef struct AvgPoolParams{ DNNPaddingParam padding_method; } AvgPoolParams; +/** + * @brief Load Average Pooling Layer. + * + * It assigns the Average Pooling layer with AvgPoolParams + * 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);