[FFmpeg-devel] [PATCH 5/5] lavfi/dnn_backend_native_layer_mathunary.h: Documentation
Shubhanshu Saxena
shubhanshu.e01 at gmail.com
Sat May 8 15:13:07 EEST 2021
Add documentation for Unary Math Layer
Signed-off-by: Shubhanshu Saxena <shubhanshu.e01 at gmail.com>
---
.../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);
--
2.27.0
More information about the ffmpeg-devel
mailing list