diff options
author | Mingyu Yin <mingyu.yin@intel.com> | 2020-08-23 23:12:13 +0800 |
---|---|---|
committer | Guo, Yejun <yejun.guo@intel.com> | 2020-08-24 09:09:11 +0800 |
commit | 3477feb6431c1d437acac7b845bb3427ef165d45 (patch) | |
tree | bb632a58d0b1026e853654eaab4590a62794e54e /libavfilter/dnn | |
parent | 37ef1acedb27e037e394600272317fdafa448743 (diff) |
dnn_backend_native_layer_mathbinary: add floormod support
Signed-off-by: Mingyu Yin <mingyu.yin@intel.com>
Diffstat (limited to 'libavfilter/dnn')
-rw-r--r-- | libavfilter/dnn/dnn_backend_native_layer_mathbinary.c | 7 | ||||
-rw-r--r-- | libavfilter/dnn/dnn_backend_native_layer_mathbinary.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c b/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c index 38742db7a6..7d81694288 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c +++ b/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c @@ -50,6 +50,10 @@ static float minimum(float src0, float src1) { return FFMIN(src0, src1); } +static float floormod(float src0, float src1) +{ + return (float)((int)(src0) % (int)(src1)); +} static void math_binary_commutative(FunType pfun, const DnnLayerMathBinaryParams *params, const DnnOperand *input, DnnOperand *output, DnnOperand *operands, const int32_t *input_operand_indexes) { @@ -178,6 +182,9 @@ int dnn_execute_layer_math_binary(DnnOperand *operands, const int32_t *input_ope case DMBO_MINIMUM: math_binary_commutative(minimum, params, input, output, operands, input_operand_indexes); return 0; + case DMBO_FLOORMOD: + math_binary_not_commutative(floormod, params, input, output, operands, input_operand_indexes); + return 0; default: return -1; } diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathbinary.h b/libavfilter/dnn/dnn_backend_native_layer_mathbinary.h index 0acf3b0ea0..9525685afa 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_mathbinary.h +++ b/libavfilter/dnn/dnn_backend_native_layer_mathbinary.h @@ -36,6 +36,7 @@ typedef enum { DMBO_MUL = 2, DMBO_REALDIV = 3, DMBO_MINIMUM = 4, + DMBO_FLOORMOD = 5, DMBO_COUNT } DNNMathBinaryOperation; |