Skip to content

Commit

Permalink
fix(realesrgan): fixed incorrect type for ncnn::Mat elemsize
Browse files Browse the repository at this point in the history
Signed-off-by: k4yt3x <[email protected]>
  • Loading branch information
k4yt3x committed Oct 26, 2024
1 parent 50d5cb1 commit ebd5e8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t>(3), 3);

// Manually copy the pixel data from AVFrame to the new ncnn::Mat
const uint8_t *src_data = converted_frame->data[0];
Expand Down
2 changes: 1 addition & 1 deletion src/realesrgan_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t>(3), 3);

ret = realesrgan->process(in_mat, out_mat);
if (ret != 0) {
Expand Down

0 comments on commit ebd5e8e

Please sign in to comment.