ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

add yuv420p2rgb type for ncnn::Mat::from_pixels_resize

Open miluof opened this issue 5 years ago • 8 comments

调用函数ncnn::Mat::from_pixels_resize时,增加了类型PIXEL_YUV420P2RGB和PIXEL_YUV420P2BGR,实际过程是调用了已有函数yuv420sp2rgb,增加了yuv420p2yuv420sp,将yuv420p转成yuv420sp。 写了一个测试例子在examples目录下,叫yuv2rgbresize.cpp

miluof avatar Sep 25 '20 04:09 miluof

Codecov Report

Merging #2149 into master will decrease coverage by 0.00%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2149      +/-   ##
==========================================
- Coverage   86.46%   86.45%   -0.01%     
==========================================
  Files         508      508              
  Lines       82955    82961       +6     
==========================================
  Hits        71723    71723              
- Misses      11232    11238       +6     
Impacted Files Coverage Δ
src/mat.h 84.91% <ø> (ø)
src/mat_pixel.cpp 55.87% <0.00%> (-0.27%) :arrow_down:
src/mat_pixel_resize.cpp 98.84% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7b5b829...d89ec0a. Read the comment docs.

codecov-commenter avatar Sep 25 '20 04:09 codecov-commenter

封装resize_bilinear_yuv420p和yuv420p2rgb

miluof avatar Sep 25 '20 08:09 miluof

不要用中文注释,修正代码格式 非关键代码不建议使用移位操作替代乘除法 测试代码写在 tests/test_mat_pixels 里面

nihui avatar Sep 25 '20 08:09 nihui

OK

------------------ 原始邮件 ------------------ 发件人: "nihui"<[email protected]>; 发送时间: 2020年9月25日(星期五) 下午4:15 收件人: "Tencent/ncnn"<[email protected]>; 抄送: "miluo"<[email protected]>; "Author"<[email protected]>; 主题: Re: [Tencent/ncnn] add yuv420p2rgb type for ncnn::Mat::from_pixels_resize (#2149)

不要用中文注释,修正代码格式 非关键代码不建议使用移位操作替代乘除法 测试代码写在 tests/test_mat_pixels 里面

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

miluof avatar Sep 25 '20 08:09 miluof

删掉了中文注释,删掉了例子程序,已在本地验证yuv转rgb。

miluof avatar Sep 25 '20 09:09 miluof

This pull request introduces 2 alerts and fixes 26 when merging a84d8aec0f4236a702487890ac8e670b7c9d6136 into 7b5b829143ac2696a242ebab3eaa9272b310e28b - view on LGTM.com

new alerts:

  • 2 for Multiplication result converted to larger type

fixed alerts:

  • 10 for Missing header guard
  • 10 for Multiplication result converted to larger type
  • 5 for FIXME comment
  • 1 for Comparison result is always the same

lgtm-com[bot] avatar Sep 27 '20 04:09 lgtm-com[bot]

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

tencent-adm avatar Sep 27 '20 04:09 tencent-adm

增加删掉上次增加的没有用的函数,只保留ncnn::Mat::from_pixels_resize使用PIXEL_YUV420SP2RGB和PIXEL_YUV420SP2BRG转换数据,

miluof avatar Sep 27 '20 04:09 miluof