From patchwork Fri May 14 07:11:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27766 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp206949iof; Fri, 14 May 2021 00:17:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbl4bt7uPdJf5fVpzteTFm6Ke2W0QXwqOD1qUH2tHS7ZYL59x8tdd4W+I+iqXh+FhNwuw5 X-Received: by 2002:a17:906:46d1:: with SMTP id k17mr3468047ejs.77.1620976671669; Fri, 14 May 2021 00:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620976671; cv=none; d=google.com; s=arc-20160816; b=EJ+SJh7DBaH8OwwoiXw/sEdN3o5L3RlfbS4BB9NcOEYUXeKiru9vtw6xO6BvAJNsRs OXt9/U7M+S5QduapumTIa8cMrl289EKa2C4WStW60/2j9jXk7QLLiX0GAw4Wezx6JkTv OYNV9n6mhA4OxjZ5dMKBkT8wRfY+V1kEfh9L2mrN0moXl3FTYX/oqoCA4UqFTnEi6RsP bZYBLZKjvNHICk3gh0xhpyIFT8c7l60lLQrXR+x9bzSt0yjbbvz89rdcJleBP/0/oKWY 4vtSZJMxsDuOof7B0qC2LRi8zpfoOt6Xh5fL25Gv553HavE24Gg0xAC8Dr7JGSxvd+4y ee0Q== 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=c9PIEVRAt6xY6aFidi2dlyAluSX+KsJ0iR62388RLj8=; b=Mr2nL9UTOqfcUDGC/KoEc/eTON1oHN9852QWo8nt+FOWtUNra4M3WLnAPV7Xdigyu3 sBN2OFMfB1LEfC603uQNg/p4vWCBHb2fkkuUZMkPaX0pLLUE2oI0gwovBFQWjsYCuOc+ 7vHV1halxPhPkk4Dc0CxHgAqTqfsHUirac3SapKUnWiXYch+IO/JcOyFxOemNwXu5JPo jzNeHvc6BAfhvAERlEfml4FlxdAA3kDA+Pvb0kHr0itDExzoTPFjOS0nimCKTIR/jYtb ppU4QYbnpzfh7FuF4Pd9i+Gwv6LtlynCHchY93e9lBhm99tq5SqxAtjLb6Kz5q8oL5rY 0k1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=rKCiVNmk; 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 b11si4781681edj.174.2021.05.14.00.17.51; Fri, 14 May 2021 00: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=rKCiVNmk; 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 4E75F688128; Fri, 14 May 2021 10:17:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7DC38687FD9 for ; Fri, 14 May 2021 10:17:47 +0300 (EEST) Received: by mail-pl1-f181.google.com with SMTP id z18so12192643plg.8 for ; Fri, 14 May 2021 00:17:47 -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=Krg+TzG+uYKY5oL9of6D+z6steCAVmxKrDjhwcbvdz0=; b=rKCiVNmkV4io874izf2WbLNbBO8HjrmBBtahuWrIYnLndz25jBllMDiFvYLvDSTo33 Owi0hFVvYf30qzQqQSakrGRBtgjLUr6BREwihrDyT1HAyP/RquD4NXxEd6YHX4vC3Iy9 4TxFc669khMqjNcI6W1/tOTC54P30o7pPYCeXdNIEmHvWB7qsvmPU6TU98gVRAY6sILI HvKNa11d7UHkLkvvFcOAlC6X3G6lG+ZsvkgRaC14iNjPFMRyva8+cHk3LEposaSxk+X9 UjOM/smM+gier/na+l37kbYakLqUL5fGa2oWIWoAV8NcD17If9kYUapDBcbA0i5RiY7i QmpA== 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=Krg+TzG+uYKY5oL9of6D+z6steCAVmxKrDjhwcbvdz0=; b=bZqH+iE3SNBHtWzS0Qn4u7fclVwOiP4k7fUK38mXypvMdcex3+ok97HrtA1+gKkvkY 7KDq4xUE8kqdMkQgN2rQKCDdgzjTa6hROUoNqg3CKmsEO67iEaCtMhn/OSKYzYO700wY Mh2BK271bxjmxWk/TFgW6yDiC+EsHjphL8EW9M7mAZ9amspHZ+xUxxMmxv4FV2VH2yOG JI5ThkKaZ2qelZV+26irkIYp9LiMQZeBIk3Y8sz9ONxafpScKbR6u3A2HbAAeZ7IO6fK vj7ftcJJt/I14EH1jsIN1XHYZUk/bVEyfTwdDYzewYDPYpoHQKdLI7v5r6jkIBL1DIkq rrrQ== X-Gm-Message-State: AOAM5338/dOkET2O1xJHVzYBQ03ExgSLSXDPR88iqrFVyy5TG54Jq+em ahi9ex/g/C1SR/ZinQkl6Pq6PTTudNFHiQ== X-Received: by 2002:a17:902:104:b029:ec:9fa6:c08 with SMTP id 4-20020a1709020104b02900ec9fa60c08mr44740562plb.10.1620976664715; Fri, 14 May 2021 00:17:44 -0700 (PDT) Received: from localhost.localdomain ([117.208.72.147]) by smtp.googlemail.com with ESMTPSA id p14sm4261627pjh.27.2021.05.14.00.17.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 00:17:44 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Fri, 14 May 2021 12:41:08 +0530 Message-Id: <20210514071104.23670-4-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210514071104.23670-1-shubhanshu.e01@gmail.com> References: <20210514071104.23670-1-shubhanshu.e01@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V5 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: T6lF9ITrzEus 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..ed79947896 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 unary math layer with DnnLayerMathUnaryParams + * 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_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 unary math layer 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);