Unify all error return as DNN_ERROR, in order to cease model executing when return error in ff_dnn_execute_model_native layer_func.pf_exec
Signed-off-by: Ting Fu <ting...@intel.com> --- libavfilter/dnn/dnn_backend_native_layer_avgpool.c | 2 +- libavfilter/dnn/dnn_backend_native_layer_conv2d.c | 4 ++-- libavfilter/dnn/dnn_backend_native_layer_depth2space.c | 4 ++-- libavfilter/dnn/dnn_backend_native_layer_mathbinary.c | 2 +- libavfilter/dnn/dnn_backend_native_layer_mathunary.c | 2 +- libavfilter/dnn/dnn_backend_native_layer_pad.c | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libavfilter/dnn/dnn_backend_native_layer_avgpool.c b/libavfilter/dnn/dnn_backend_native_layer_avgpool.c index d745c35b4a..e21a635c82 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_avgpool.c +++ b/libavfilter/dnn/dnn_backend_native_layer_avgpool.c @@ -109,7 +109,7 @@ int dnn_execute_layer_avg_pool(DnnOperand *operands, const int32_t *input_operan output_operand->length = calculate_operand_data_length(output_operand); output_operand->data = av_realloc(output_operand->data, output_operand->length); if (!output_operand->data) - return -1; + return DNN_ERROR; output = output_operand->data; for (int y = 0; y < height_end; y += kernel_strides) { diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c index a2202e4073..25356901c2 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c +++ b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c @@ -114,10 +114,10 @@ int dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_ output_operand->data_type = operands[input_operand_index].data_type; output_operand->length = calculate_operand_data_length(output_operand); if (output_operand->length <= 0) - return -1; + return DNN_ERROR; output_operand->data = av_realloc(output_operand->data, output_operand->length); if (!output_operand->data) - return -1; + return DNN_ERROR; output = output_operand->data; av_assert0(channel == conv_params->input_num); diff --git a/libavfilter/dnn/dnn_backend_native_layer_depth2space.c b/libavfilter/dnn/dnn_backend_native_layer_depth2space.c index 2c8bddf23d..5a61025f7a 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_depth2space.c +++ b/libavfilter/dnn/dnn_backend_native_layer_depth2space.c @@ -76,10 +76,10 @@ int dnn_execute_layer_depth2space(DnnOperand *operands, const int32_t *input_ope output_operand->data_type = operands[input_operand_index].data_type; output_operand->length = calculate_operand_data_length(output_operand); if (output_operand->length <= 0) - return -1; + return DNN_ERROR; output_operand->data = av_realloc(output_operand->data, output_operand->length); if (!output_operand->data) - return -1; + return DNN_ERROR; output = output_operand->data; for (y = 0; y < height; ++y){ diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c b/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c index dd42c329a9..bffa41cdda 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c +++ b/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c @@ -176,6 +176,6 @@ int dnn_execute_layer_math_binary(DnnOperand *operands, const int32_t *input_ope } return 0; default: - return -1; + return DNN_ERROR; } } diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c index 58ee0e9d3d..57bbd9d3e8 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c +++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c @@ -143,6 +143,6 @@ int dnn_execute_layer_math_unary(DnnOperand *operands, const int32_t *input_oper dst[i] = round(src[i]); return 0; default: - return -1; + return DNN_ERROR; } } diff --git a/libavfilter/dnn/dnn_backend_native_layer_pad.c b/libavfilter/dnn/dnn_backend_native_layer_pad.c index feaab001e8..5452d22878 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_pad.c +++ b/libavfilter/dnn/dnn_backend_native_layer_pad.c @@ -112,10 +112,10 @@ int dnn_execute_layer_pad(DnnOperand *operands, const int32_t *input_operand_ind output_operand->data_type = operands[input_operand_index].data_type; output_operand->length = calculate_operand_data_length(output_operand); if (output_operand->length <= 0) - return -1; + return DNN_ERROR; output_operand->data = av_realloc(output_operand->data, output_operand->length); if (!output_operand->data) - return -1; + return DNN_ERROR; output = output_operand->data; // copy the original data -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".