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); From patchwork Sat May 8 12:10:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27698 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp1357557iof; Sat, 8 May 2021 05:11:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU9wbNaIsez0qJfdzrJh7h+39YSqrBuOkunaC2D9v/vORsfS5YrTvcX7N+ArcDIS5MlLxQ X-Received: by 2002:a05:6402:5158:: with SMTP id n24mr17406083edd.74.1620475882304; Sat, 08 May 2021 05:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620475882; cv=none; d=google.com; s=arc-20160816; b=N85WiC4mGGO/Eduq1M1tZomBxcbYf3Yot/wvWoHgmrTmbK7V1nRcb4AwG27dPcvn5W DYUAllP6qjzRiEPLB/JHYvj4FYRoQodv7M72uAZ0EDnYsq8at/gh9h5e+jFV1T9UkQy0 tOVLqw55WIzgDKUYIIayjWxVTMfnHXCumHJ/cZMuj1Dnhvh8CEf3SZ9kOBeCei2MiXyF UzDsXiCnTzOAALQYNyFuM28y0tB0+CK1pUR09mAbK1do3N4aHgZPlK7DxvsZEK9VPf7r Ls41EL49mzB0K401AOS54f6IhlupmAK4vYzLEaxPAU+dcIXB2E+yTn/U4xNM1ESH61eD l/KA== 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=vD2Os1hbQfpmIgEiaxYM5wNIwOQYkHXbEq5qZ7FMbXc=; b=MAJQApo83xhQbq7v51Ny2wbdGRA6taShKwyVtIBuxZxehipFoA1HNWQ12xUBuCMNUr Ar6AWONM6+OK90uzrsctmSuwNwwOQqrheMw53rvMbiHE0xQrApK7LNAzibjS7EnkjjYo dUiVtq7yDzCujIJ7YpFA3fYYqyOjfv1Rnf9BWFGveqPpkDGVljBiNH1zXflwpckO+J/A eE1+LEBpMzcTlCfa09QrD2PdEgzz1Zsl365bowgd4xHZ7YcyFn9SyH/ICiYdPZfu4fGQ 3JlSQUH1q+n2BmxrUXS+M8tkjPovCQab4ONysCdxC/Gs72Fj4E4e7DK79Rw8rOy6xab2 Da7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=GbMLiHJM; 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 mc9si7956417ejb.389.2021.05.08.05.11.21; Sat, 08 May 2021 05:11:22 -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=GbMLiHJM; 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 1816B6808E8; Sat, 8 May 2021 15:11:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2F725680308 for ; Sat, 8 May 2021 15:11:11 +0300 (EEST) Received: by mail-pl1-f179.google.com with SMTP id 69so1963622plc.5 for ; Sat, 08 May 2021 05:11:11 -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=z9GAt0Wson+uDjKFFQp959gVq82Z+Gh4twviMRv/dFs=; b=GbMLiHJM0SgrCawNYHgCLVzewqNGLFxkRvSdRX7GBbTf9mZC9z50j6eqBYU9it2Yfo x+938JFGQ2k4pV3sB5qack/Hc3DxMtXXMdQKlG3saWi4FwiYryWi38HxB3IuD6i2xElK sI4jJ5+QpBr8ahzX9RwS33ZdvK2Dt1hauNUUvtMJmECW9HOviLHFB/Gwf2lc0IvP2VgJ QEjgBeKJ7j1xra7HtH9SjCPBLGZrdC+DGm/V8+s1J/4eIyf2B7+F8TF0ZPFt7oBFr7ly BNlhBXH7U6KYQtCmqW1iRcv+bNUyMrPxLN8NyQV9p72i4h++O1I9WaRb2Ndd+rM7GBrB MbSg== 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=z9GAt0Wson+uDjKFFQp959gVq82Z+Gh4twviMRv/dFs=; b=Q7H2Rfb9dJ3AaYePe/depOLggEcQBB77BMF0ViM/NDifKJy36nAsrEHsi2w6Hh6eEt m6uqsUny/mCNLeeLACbth5iIKUy1gkbyDqmdG+TQMyPMG/RFYmRA3UTXOtPWHjuB2vhS txKS31XTu6b/q32nkUZ/VdYEoGjEk2klqzPN6L5VxXRJFmMyowruvaarBuZTzv6Y/8NP 2TYNkuUx4m4SCI2uF4LwgcNl3uWc9x5h8YVqdk9uk8n/1b5q0PX62f5ic7JSsFxeOJzU Qhsym9IzGlzQVqqD1mSQaogzdtKNU8826BhL9bXSqVMfbHfkMCIRqHX8lgvKl0WbojaD RmVA== X-Gm-Message-State: AOAM532EiIYcqHuqulqfUI9FpuZ499NT+MZm6c+id3WX1OMvHTFLtuAW 7NiVad9igpN+zg/MHEe4XS5H5/Wnjt6VHg== X-Received: by 2002:a17:90a:304e:: with SMTP id q14mr16131952pjl.55.1620475868908; Sat, 08 May 2021 05:11:08 -0700 (PDT) Received: from localhost.localdomain ([117.212.37.139]) by smtp.googlemail.com with ESMTPSA id j3sm7052216pfr.30.2021.05.08.05.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 05:11:08 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Sat, 8 May 2021 17:40:14 +0530 Message-Id: <20210508121016.12413-2-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210508121016.12413-1-shubhanshu.e01@gmail.com> References: <20210508121016.12413-1-shubhanshu.e01@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 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: cqOlL7XjMB1h Add documentation for 2D Convolution Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_conv2d.h | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.h b/libavfilter/dnn/dnn_backend_native_layer_conv2d.h index 03ca795c61..6dce698dc7 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_conv2d.h +++ b/libavfilter/dnn/dnn_backend_native_layer_conv2d.h @@ -34,7 +34,33 @@ 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 + * @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_conv2d(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); + +/** + * @brief Execute the 2D Convolution Layer. + * + * @param operands input operands + * @param input_operand_indexes input operand indexes + * @param output_operand_index output operand index + * @param parameters convolution parameters + * @param ctx pointer to Native model context + * @retval DNN_SUCCESS 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 Sat May 8 12:10:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27697 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp1362224iof; Sat, 8 May 2021 05:18:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjVepw0IklLxQiIkGUwc9lcZPs1qw8++/zxiTZqaCI5WLNAyHJjnt7uo6XurIhbFIxy7tL X-Received: by 2002:a17:907:372:: with SMTP id rs18mr15471744ejb.431.1620476334027; Sat, 08 May 2021 05:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620476334; cv=none; d=google.com; s=arc-20160816; b=qCIK9asB8KbZWh2iMTXTv6no6lKVnN0nVwFhDF2NCWDO3XCW1rh2C05YVTBUMO3Z8j 12J7L6TajRgZumH47D9ITjVEYoNrM2az4QOQBJqzvoHcHHL5vE3xOmtxU+jGhCF5XyGk XyoMEoWwAJM8dpojVH9jMsL1sYhKYLpES+Vqy2VHVHjhRSu4Q4jy4C84E8UAuAZnGjDz j0/rN8bNm3FObInqeD3UhupNFeQ2O60WvJ0LX/ZvMFj2PRBK9uSfc1dr2fiYSBlkWvgj 2i40cmVtf0v46BXLYwvGfy6fRrEByd3czPSAYQbGwZZQbs8khmD80eCLpTt7htPgLnI+ gm/g== 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=a72cuhDFKZ8+vYpXK9oyElo8khtRBx1idS/by/FOJ78=; b=DWAupwbWjKif6JWhqCJ+d+RiHzwjw2WcptRSuRBrx+KOEG9iRHFD0NJT1WX7IYp6oX Syp1l7r8cEth3izFvGn2iC9qHOp9vUmX4BPExT9LMQjxz4dGF6E42to4IPt+B2mIQgsB ktXEOn09F+ku5ZWmq2Q7RSjWqFEYqG7h2WSCS7EpoPHylWpgDigUkhOp5Il8Er2+UOxL MzQM/87L/Ug03z6Hlm1gCybvIHVXsQUYl1ug8sLQUrphFNP74YHw5uyx8Ruv2cGPhZQ9 e5liLLGzhxci3WrKY+Ts6CbK5nxcPXkMTb3LYNFfXXxVEDG3CGZ9io8E4fHfmRKxkqW2 xXng== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=hiEYSTrJ; 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 h3si7850912edw.187.2021.05.08.05.18.53; Sat, 08 May 2021 05:18:54 -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=hiEYSTrJ; 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 DF2396808A0; Sat, 8 May 2021 15:18:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DC144680524 for ; Sat, 8 May 2021 15:18:44 +0300 (EEST) Received: by mail-pf1-f174.google.com with SMTP id b21so2693050pft.10 for ; Sat, 08 May 2021 05:18:44 -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=jlI3+5tNlZK4l3JflWChKBSFbvtzYg+EHZjNxo4ON5I=; b=hiEYSTrJu/f9sYl65i55MyG9hrcZJJ2qd5J5GB/dFkSow0Ds6K6KeO+sMfR98aRE9v mJJVA34prR47cLHmPG/2Q4A4MBrW2g8+i+vjsYjwg9ifDZfJLmJJ2BaQ0aonrhSl74cj aXqyIU+e3Bw9Szw74xxs26wbCYcgL6tHf8rDwawE4FGLlHnS+wM/c7BiXqqmi8lF1DD1 pyc+qUHJwy1fExOEPz1He+sV2h42Nf43lMBFf05YPO/tgXxoffOt9I0IrHoPff8Hrnau YGoas0LTowGUTnWyABLTtW+lpf305Y6awz2Q2QavlDgaO6y8lqhBQaUpEzanvySBaShB 68rw== 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=jlI3+5tNlZK4l3JflWChKBSFbvtzYg+EHZjNxo4ON5I=; b=oj0uifQAg1Slzi08aga/KpzfDZlzncBSe7CVYIc4FPMvEdB5hhYqQv8LrCNzEyy65C kWG15FUTU+Oj26uJMRAQn4KlBtGQww44ROPmhhBRIKg+1PowtOF6FTihKJEJgg5NJpUN wNGXQ+6uR+62ijH4xsUmPWnY0psRr1/VlKN0FrD2EfUaSwpmNWj/0SXSqeMLwzHjXRmT lkPzPBurtj99Xk6dhjEk4Mm5lWbaVwShqxRudpd2Qn+0tK7/kRs6jGP56vDRgGi72YwN zN4GXCC2T5vvIZjA/alv8uDgq5EUpD2Qr8Nc+pq/6u265dih9OEMht4TnCQGf5IVb0Yz Y0Yw== X-Gm-Message-State: AOAM532PRUQc3bCVjnOIOaoXkvcSLJ7JxF4zojAnZTsjb0DOnJaPBvk4 bTK6HzchQl3TAT7AuCCiZVH3+RH1b4QUbg== X-Received: by 2002:a62:1591:0:b029:2a8:b819:6341 with SMTP id 139-20020a6215910000b02902a8b8196341mr7594118pfv.73.1620475900175; Sat, 08 May 2021 05:11:40 -0700 (PDT) Received: from localhost.localdomain ([117.212.37.139]) by smtp.googlemail.com with ESMTPSA id j3sm7052216pfr.30.2021.05.08.05.11.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 05:11:39 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Sat, 8 May 2021 17:40:15 +0530 Message-Id: <20210508121016.12413-3-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210508121016.12413-1-shubhanshu.e01@gmail.com> References: <20210508121016.12413-1-shubhanshu.e01@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 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: Qznubtv07g0c Add documentation for Dense Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_dense.h | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_dense.h b/libavfilter/dnn/dnn_backend_native_layer_dense.h index 86248856ae..fc971cece2 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_dense.h +++ b/libavfilter/dnn/dnn_backend_native_layer_dense.h @@ -31,7 +31,33 @@ 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 + * @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_dense(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); + +/** + * @brief Execute the Densely-Connnected Layer. + * + * @param operands input operands + * @param input_operand_indexes input operand indexes + * @param output_operand_index output operand index + * @param parameters layer parameters + * @param ctx pointer to Native model context + * @retval DNN_SUCCESS 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 Sat May 8 12:13:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27699 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp1359181iof; Sat, 8 May 2021 05:13:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPoX8gLdF4T2s1F9D13ya4f/v0Hx+rbLffPl58ghZUcto9/Qav+wK14QLSd6YzX76ACqdw X-Received: by 2002:aa7:c6ca:: with SMTP id b10mr3049764eds.221.1620476032472; Sat, 08 May 2021 05:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620476032; cv=none; d=google.com; s=arc-20160816; b=nG2mEVGW6XUpsR5FPlBnpk7mKl8RDEMZWhrc92Jx9NDBQow6fN9UWxhd9/dBx1rzB6 l4rY77RfUfJp0FOPk2c/3cXerVcRvAf1e5w6o7wgL1aDvZvvwd0YBSGyUBCFd5ZB9jp/ RQrOOqfxOnv+EoGGgZg9WS2vnn3U72gKL2pZozAeii+FE2kPkmeMeo6Z+788jul3F/mP TcatrjrYuLsmxB1E6RMMGlSMqxMiH4dlkFGchkpk2sC++sN5GRq9q7mpl54MYvDdZ11p NdR4/gl1zsiLbDwsIl8CJArLMGnKd/h9S3MrMI4AMty29ZgfSUEKkqRXt/rS8/mNnfbi y5Tg== 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=gHL/2aQjPhrT8hqgYNW1DiHAnouKD8tOtrofpaTNoLA=; b=HLXGlQleGAFncRTgTQNiczLQEc9/Oe7lYA3Fl+0U7lyjkVkXdWieRC/lY+wd/hsQw6 QFDuR9P5gEl+lPTmCOOGsDSiqBnlqUO2xRbZWwD0rlSqBCLtma+XevHneGTmYHHHWq/r rci8f1WFhRqtuG30iseaxF4xYkQxRlBAWqiTFKix99cJWyLuoViY4iGgCH9gQyVWSA9V orcCb0ZH5nVJu0jNAuSONSynBf4lK/7iyDRKLia5ONMaX7YIAOjMmvI7ScVf7aETJ/aC fnjk2r9MndDWBAtUGEIIR/YfoiL9VRyQWcPYwgbdOZ8uHukWtdn5xXPI59pegYrTlJoe n3SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=M135w8vW; 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 gn39si7190845ejc.405.2021.05.08.05.13.52; Sat, 08 May 2021 05:13:52 -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=M135w8vW; 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 73DCB6807C5; Sat, 8 May 2021 15:13: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 6400C6802E6 for ; Sat, 8 May 2021 15:13:43 +0300 (EEST) Received: by mail-pg1-f173.google.com with SMTP id c21so9311351pgg.3 for ; Sat, 08 May 2021 05:13: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:mime-version :content-transfer-encoding; bh=zmQq9OaUL1nQ8oRKCFAM6Symm+W49TBvkj8YehOoRwA=; b=M135w8vWQI56EG50pY1MAjtWUiyZ0uGpGCkUqjP5m0keJGyEb+T3FKjpdsU3hOJvlb 8e3/ai0joiFS8e4yoK1TJWMaNNF5/w8zUlWAyLRFKR0SRK2dFBOYdQHdOgcgvAItQBE2 76frmbTwzKfyiAdIHO4r1HNw6f3Qh7XmlTQ4goFE3e2KLe0CfhfwIjlX8hOyp6FB/kGe 166aVz7g9Or7Z/gN6EuJPpgJsmBpAa9M55+mkX1+tPSJU3vDqX73wrr2OkgdJI533RAu e3JxwxlKcv7NqtOuxroMvkiOv2Y0lstWPrqVuiA+ZrCxyvp6onPVf1UY1/mhpNL64EMG WegA== 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=zmQq9OaUL1nQ8oRKCFAM6Symm+W49TBvkj8YehOoRwA=; b=KmgCxH/nvOGYuu1SR0/VKN2MGRw7p2i22JU9A/lUMyH3lyI3zVlDWKGf3Iwg6wCgxw 6BhQoAAss2fl8tNAu9MecrjEAVtaPV9DT9CW56qK0uQawNtKWkaBCeIZIlQGcIRr9sJA zoOJSneEuqZdhsKT3ECGdyttebwMbUcWH6UglJ6Ctvywo/SI1fognwsQdz+j+G4evQtJ w3fAQ0lWWx2TJL6aznyedZJrEqmOsDJZqO1luxa24srMOKOwnTFpHAp8Yt+o7EJ1yga8 aGTFezAtqzFxjLEZhjGiYQXflNq/oo9EvfgauUuXj/xTM9N4pW9tgVAcOqMeSj9sSmZF H94g== X-Gm-Message-State: AOAM531jYf0f1PBbEBAmbjNHDsToeIsvNbvnMV3V76MdUwgce81oD8lQ zHUEuZn9amVhobr8upYkXyZfOQ1mq3y62A== X-Received: by 2002:a63:ba5b:: with SMTP id l27mr15444427pgu.343.1620476021579; Sat, 08 May 2021 05:13:41 -0700 (PDT) Received: from localhost.localdomain ([117.212.37.139]) by smtp.googlemail.com with ESMTPSA id v14sm3132384pgl.86.2021.05.08.05.13.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 05:13:41 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Sat, 8 May 2021 17:43:06 +0530 Message-Id: <20210508121307.13976-4-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/5] 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: lraUknoMkTCD Add documentation for Depth to Space Layer Signed-off-by: Shubhanshu Saxena --- .../dnn_backend_native_layer_depth2space.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_depth2space.h b/libavfilter/dnn/dnn_backend_native_layer_depth2space.h index ef59394443..991f194e49 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_depth2space.h +++ b/libavfilter/dnn/dnn_backend_native_layer_depth2space.h @@ -34,7 +34,35 @@ 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 + * @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_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 input operands + * @param input_operand_indexes input operand indexes + * @param output_operand_index output operand index + * @param parameters layer parameters + * @param ctx pointer to Native model context + * @retval DNN_SUCCESS 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 Sat May 8 12:13:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27700 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp1359298iof; Sat, 8 May 2021 05:14:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUtxlzHa3vvyjvWWXWX8Ig5fyrPb2C/HOtuDMm/EUcqJ7+csiBqt1DbCMDMrP7JfVYAgUx X-Received: by 2002:a17:906:8390:: with SMTP id p16mr14904045ejx.430.1620476042790; Sat, 08 May 2021 05:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620476042; cv=none; d=google.com; s=arc-20160816; b=VjQDHbZqizWXZ+74oU1GpkVI+6ReU+35+UHzdw5UO+Jbj9Soak7ekhmQlmleHonOUN +3xByPpEDafmuGuZJdbxZopUGa5pE6nw1iFknkrDWW8qm4tsNgb4acDDoWGBckTR3W8S a/B/u1yCdZWDEYLxxtqaTmCt1Fna48MYIjLWcUy2WEh4wA3iTE8v21oKABzAR09lcmah yroTOkj2e5qhmpuVUYcThW7774hbZcEUiJPmdBXRslkIBG0H6D4w9Xrk/nA6kZgx0kB9 fchHS7BY0+EvyC/zxyf7N82ct60sXiRqPXzvCtoRNp4WdoUscLaKH3GopQMS+NH/GMiC v5nw== 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=aXZZ1uNv4weRNjYc27Ftg+Nfv6MUoHbvedSwQRZhRik=; b=eI5uFYXtzF14cyE10/dFC0B9E8CJSWgGXpxEMDxKYKj37N44bikL7/bJlLAmjkHNs2 40uQrB7hmSoz79Uy9jpJ+U7klpdsgAd7WGof5BIyEQkPPMlwLv1kNWNqIuDlMVl2NVa9 FviIvNI8zGOeC2G/xj5t4OYrE0hz59ZPMIDZcvzOQNoTlb59Aa2kwmPoKKTkz69pMCfa OAPYF/0Y55M/UmiyKrNcBZytCz3RWI+w1gcOpd9/wZC1J0Jm0ax5GXS10U1S7Muup9s0 MOIe9QQDXHvZJ2ME+Qquf6f+TUVxQjuMNubn44soGYGpqNUf0KDam0pUlW27TKp0oaua FCyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=SQBEJsu0; 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 b22si8149266eju.274.2021.05.08.05.14.02; Sat, 08 May 2021 05:14:02 -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=SQBEJsu0; 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 85FBB68094B; Sat, 8 May 2021 15:13:58 +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 E70C66808F2 for ; Sat, 8 May 2021 15:13:51 +0300 (EEST) Received: by mail-pf1-f178.google.com with SMTP id b21so2687976pft.10 for ; Sat, 08 May 2021 05:13:51 -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=vnsCKCPNQV5zO/Gb5OBVQ2MeXwYEABAUWnSRqj8i+s4=; b=SQBEJsu0/AElfE0M7pRpp2mtvfxbKZnD7iZdVneKVzoM6cbZ6SoWOJBtrcwKoqGgnm ogz4Rro/hRtLsKhhwKlIS4bsvgfOD97rZf1cz0j3qFBbko2I2w3TVeU5YsAMc5r2WFOe pdSKiDeAQrUvgE0fd/P+CCe5QGRjTrkH0DZx6hjTpoE+fA/lDrDSEiDTOIhzm6dg0j1Z ZcS7YdUhaymmX042cJXsIjimJtSRKODXHfvBoehaS0RvtZDeuaXUQobGME3xxADIOWMS HKokxxXWgLz7+wv2ZEhRCGK1fwDiK9kwIrC/1xqGWitXKI770tZEqgifhN2ditGQwVhm jEzw== 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=vnsCKCPNQV5zO/Gb5OBVQ2MeXwYEABAUWnSRqj8i+s4=; b=ZiGHZS3pSWTRimdpRNP/p+813tNddUwQAgCjyI7rH5fT3FKQx/pz6CTdLryYriAVq5 ZJbDPkl/Q7xVF1Bs3snSKhbgxhrjVx5TLnoQ2aU7g7VGt7JTXK5z5udHA4tp1trhj/RL +uoZuEvbkvsXevFRqidQa+FWS1mfH3uVnyaDMmA1I+sbhUQrfNu3T9rNeDrN6SdZLhny 9+WhmWRQ0Zio4yk1ZnT1OvJcrLrDbai08AFNgrjjBjfQyTt2fBJUFgN4uOG8QlxzOfFr tVtBMxTPKAUnXFXFr9emiRPkaTJsGivV7h3Q8Usp/v7eI2xHB/HJo0FycXJG3fGuXu4E nLUg== X-Gm-Message-State: AOAM530tZ/7OrL1ciwyzwXUeH49vson4/8tAtbKKRMnB5mV1WwWPtIJp IEn5ZlYrTq9jJuAYNpXGxyRZKLJkcEBgUg== X-Received: by 2002:a63:f749:: with SMTP id f9mr8988941pgk.369.1620476030151; Sat, 08 May 2021 05:13:50 -0700 (PDT) Received: from localhost.localdomain ([117.212.37.139]) by smtp.googlemail.com with ESMTPSA id v14sm3132384pgl.86.2021.05.08.05.13.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 05:13:49 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Sat, 8 May 2021 17:43:07 +0530 Message-Id: <20210508121307.13976-5-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210508121307.13976-4-shubhanshu.e01@gmail.com> References: <20210508121307.13976-4-shubhanshu.e01@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] 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: GGKSg7HQ7XLn Add documentation for Unary Math Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_mathunary.h | 64 +++++++++++++------ 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h index 151a73200a..869fdc16fd 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h +++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h @@ -30,31 +30,59 @@ #include "dnn_backend_native.h" typedef enum { - DMUO_ABS = 0, - DMUO_SIN = 1, - DMUO_COS = 2, - DMUO_TAN = 3, - DMUO_ASIN = 4, - DMUO_ACOS = 5, - DMUO_ATAN = 6, - DMUO_SINH = 7, - DMUO_COSH = 8, - DMUO_TANH = 9, - DMUO_ASINH = 10, - DMUO_ACOSH = 11, - DMUO_ATANH = 12, - DMUO_CEIL = 13, - DMUO_FLOOR = 14, - DMUO_ROUND = 15, - DMUO_EXP = 16, - DMUO_COUNT + DMUO_ABS = 0, // Absolute Value + DMUO_SIN = 1, // Sine + DMUO_COS = 2, // Cosine + DMUO_TAN = 3, // Tangent + DMUO_ASIN = 4, // Inverse Sine + DMUO_ACOS = 5, // Inverse Cosine + DMUO_ATAN = 6, // Inverse Tangent + DMUO_SINH = 7, // Hyperbolic Sine + DMUO_COSH = 8, // Hyperbolic Cosine + DMUO_TANH = 9, // Hyperbolic Tangent + DMUO_ASINH = 10, // Inverse Hyperbolic Sine + DMUO_ACOSH = 11, // Inverse Hyperbolic Cosine + DMUO_ATANH = 12, // Inverse Hyperbolic Tangent + DMUO_CEIL = 13, // Ceiling + DMUO_FLOOR = 14, // Floor + DMUO_ROUND = 15, // Round off to Nearest Integer + DMUO_EXP = 16, // Exponential + DMUO_COUNT // Total Number of Operators } DNNMathUnaryOperation; 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 + * @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_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 input operands + * @param input_operand_indexes input operand indexes + * @param output_operand_index output operand index + * @param parameters layer parameters + * @param ctx pointer to Native model context + * @retval DNN_SUCCESS 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);