From ebd5e8eb3d028fc7ad9281b37805d6207c4da34f Mon Sep 17 00:00:00 2001 From: k4yt3x Date: Sat, 26 Oct 2024 00:00:00 +0000 Subject: [PATCH] fix(realesrgan): fixed incorrect type for ncnn::Mat elemsize Signed-off-by: k4yt3x --- src/conversions.cpp | 2 +- src/realesrgan_filter.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conversions.cpp b/src/conversions.cpp index 9d6ae3d..63c8d5f 100644 --- a/src/conversions.cpp +++ b/src/conversions.cpp @@ -80,7 +80,7 @@ ncnn::Mat avframe_to_ncnn_mat(AVFrame *frame) { // Allocate a new ncnn::Mat and copy the data int width = converted_frame->width; int height = converted_frame->height; - ncnn::Mat ncnn_image = ncnn::Mat(width, height, 3, 3); // BGR has 3 channels + ncnn::Mat ncnn_image = ncnn::Mat(width, height, static_cast(3), 3); // Manually copy the pixel data from AVFrame to the new ncnn::Mat const uint8_t *src_data = converted_frame->data[0]; diff --git a/src/realesrgan_filter.cpp b/src/realesrgan_filter.cpp index 44eb477..419e571 100644 --- a/src/realesrgan_filter.cpp +++ b/src/realesrgan_filter.cpp @@ -113,7 +113,7 @@ int RealesrganFilter::process_frame(AVFrame *in_frame, AVFrame **out_frame) { // Allocate space for ouptut ncnn::Mat int output_width = in_mat.w * realesrgan->scale; int output_height = in_mat.h * realesrgan->scale; - ncnn::Mat out_mat = ncnn::Mat(output_width, output_height, 3, 3); + ncnn::Mat out_mat = ncnn::Mat(output_width, output_height, static_cast(3), 3); ret = realesrgan->process(in_mat, out_mat); if (ret != 0) {