|
|
Created:
4 years, 7 months ago by nisse-webrtc Modified:
4 years, 6 months ago CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, zhengzhonghou_agora.io, video-team_agora.io Base URL:
https://chromium.googlesource.com/external/webrtc.git@master Target Ref:
refs/pending/heads/master Project:
webrtc Visibility:
Public. |
DescriptionRefactor VideoDenoiser to work with I420Buffer, not VideoFrame.
BUG=webrtc:5921
R=jackychen@webrtc.org, marpan@webrtc.org
Committed: https://crrev.com/6af2e86b46a638f8a9309dffc3181053bd32974e
Cr-Commit-Position: refs/heads/master@{#13179}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Renamed local vars for clarity. #Patch Set 3 : Shorter names, for even better clarity. #Patch Set 4 : Rebased. #Patch Set 5 : Trivial rebase. #
Total comments: 2
Messages
Total messages: 38 (13 generated)
nisse@webrtc.org changed reviewers: + holmer@chromium.org, jackychen@webrtc.org
Hi, I'm attempting to convert code mutating pixel data to use I420Buffer rather than VideoFrame, following the grand plan to make VideoFrame and the VideoFrameBuffer base class always keep immutable pixels. This cl converts the VideoDenoiser class in a simple-minded way, I haven't tried to understand how it works in any detail. I'm considering one additional change: To drop the denoised_frame and denoised_frame_prev arguments to VideoDenoiser::DenoiseFrame. Instead keep I420Buffers as member variables, and return the relevant one. That way, the double-buffering logic can also be moved inside this class, so callers don't need to bother. Which unit tests are relevant at this level? I had to update VideoProcessingTest.Denoiser, but that only checks agreement between the underlying C and asm denoising filters, and is unlikely to trigger if this cl breaks things.
The CQ bit was checked by nisse@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2005733003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2005733003/1
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_arm64_rel on tryserver.webrtc (JOB_TIMED_OUT, no build URL) android_dbg on tryserver.webrtc (JOB_TIMED_OUT, no build URL)
Ping?
Jacky, can you take a look at this?
Have you verified that this cl works without any behavior change for denoiser? It looks ok for me, as it doesn't change the logic inside the denoiser. https://codereview.webrtc.org/2005733003/diff/1/webrtc/common_video/video_fra... File webrtc/common_video/video_frame_buffer.cc (right): https://codereview.webrtc.org/2005733003/diff/1/webrtc/common_video/video_fra... webrtc/common_video/video_frame_buffer.cc:227: return copy; Could you use a better name instead of copy? At least, we should know it is a buffer copy.
On 2016/06/09 19:08:36, jackychen wrote: > Have you verified that this cl works without any behavior change for denoiser? > It looks ok for me, as it doesn't change the logic inside the denoiser. How do you suggest I verify it, besides just running the test suite? I'm not familiar with this code and I'm not sure where it is enabled (e.g., the android AppRTCDemo).
https://codereview.webrtc.org/2005733003/diff/1/webrtc/common_video/video_fra... File webrtc/common_video/video_frame_buffer.cc (right): https://codereview.webrtc.org/2005733003/diff/1/webrtc/common_video/video_fra... webrtc/common_video/video_frame_buffer.cc:227: return copy; On 2016/06/09 19:08:36, jackychen wrote: > Could you use a better name instead of copy? At least, we should know it is a > buffer copy. To me, "copy" seems quite clear from the context, but I can try to improve the naming. Would it be clearer if I rename buffer --> src (the input argument) and copy --> buffer (the returned value)?
On 2016/06/10 11:09:20, nisse-webrtc wrote: > https://codereview.webrtc.org/2005733003/diff/1/webrtc/common_video/video_fra... > File webrtc/common_video/video_frame_buffer.cc (right): > > https://codereview.webrtc.org/2005733003/diff/1/webrtc/common_video/video_fra... > webrtc/common_video/video_frame_buffer.cc:227: return copy; > On 2016/06/09 19:08:36, jackychen wrote: > > Could you use a better name instead of copy? At least, we should know it is a > > buffer copy. > > To me, "copy" seems quite clear from the context, but I can try to improve the > naming. Would it be clearer if I rename buffer --> src (the input argument) and > copy --> buffer (the returned value)? What about "buffer" -> "buf_src", copy -> "buf_copy"?
On 2016/06/10 16:56:05, jackychen wrote: > On 2016/06/10 11:09:20, nisse-webrtc wrote: > > > https://codereview.webrtc.org/2005733003/diff/1/webrtc/common_video/video_fra... > > File webrtc/common_video/video_frame_buffer.cc (right): > > > > > https://codereview.webrtc.org/2005733003/diff/1/webrtc/common_video/video_fra... > > webrtc/common_video/video_frame_buffer.cc:227: return copy; > > On 2016/06/09 19:08:36, jackychen wrote: > > > Could you use a better name instead of copy? At least, we should know it is > a > > > buffer copy. > > > > To me, "copy" seems quite clear from the context, but I can try to improve the > > naming. Would it be clearer if I rename buffer --> src (the input argument) > and > > copy --> buffer (the returned value)? > > What about "buffer" -> "buf_src", copy -> "buf_copy"? buffer_source or buffer_copy in that case
On 2016/06/10 11:07:18, nisse-webrtc wrote: > On 2016/06/09 19:08:36, jackychen wrote: > > Have you verified that this cl works without any behavior change for denoiser? > > It looks ok for me, as it doesn't change the logic inside the denoiser. > > How do you suggest I verify it, besides just running the test suite? > I'm not familiar with this code and I'm not sure where it is enabled (e.g., the > android AppRTCDemo). You can enable denoiser https://cs.chromium.org/chromium/src/third_party/webrtc/modules/video_process..., just change "false" to "true". You don't need to enable it for the testing. In the unit test, you can output the result of the denoiser w/wo your cl and compare them which is pretty easy to do.
On 2016/06/10 17:07:04, jackychen wrote: > On 2016/06/10 11:07:18, nisse-webrtc wrote: > > On 2016/06/09 19:08:36, jackychen wrote: > > > Have you verified that this cl works without any behavior change for > denoiser? > > > It looks ok for me, as it doesn't change the logic inside the denoiser. > > > > How do you suggest I verify it, besides just running the test suite? > > I'm not familiar with this code and I'm not sure where it is enabled (e.g., > the > > android AppRTCDemo). > > You can enable denoiser > https://cs.chromium.org/chromium/src/third_party/webrtc/modules/video_process..., > just change "false" to "true". > > You don't need to enable it for the testing. In the unit test, you can output > the result of the denoiser w/wo your cl and compare them which is pretty easy to > do. I added code (locally) to VideoProcessingTest.Denoiser, to write out the denoised frames to a file (webrtc::test::OutputPath() + "denoiser_test_out.yuv"), and I get identical results on the master branch and with this cl. So that seems fine. Would it make sense to check the gen_files command line flag, similarly to WriteProcessedFrameForVisualInspection? See https://cs.chromium.org/chromium/src/third_party/webrtc/modules/video_process... ?
On 2016/06/15 09:04:21, nisse-webrtc wrote: > On 2016/06/10 17:07:04, jackychen wrote: > > On 2016/06/10 11:07:18, nisse-webrtc wrote: > > > On 2016/06/09 19:08:36, jackychen wrote: > > > > Have you verified that this cl works without any behavior change for > > denoiser? > > > > It looks ok for me, as it doesn't change the logic inside the denoiser. > > > > > > How do you suggest I verify it, besides just running the test suite? > > > I'm not familiar with this code and I'm not sure where it is enabled (e.g., > > the > > > android AppRTCDemo). > > > > You can enable denoiser > > > https://cs.chromium.org/chromium/src/third_party/webrtc/modules/video_process..., > > just change "false" to "true". > > > > You don't need to enable it for the testing. In the unit test, you can output > > the result of the denoiser w/wo your cl and compare them which is pretty easy > to > > do. > > I added code (locally) to VideoProcessingTest.Denoiser, to write out the > denoised frames to a file (webrtc::test::OutputPath() + > "denoiser_test_out.yuv"), and I get identical results on the master branch and > with this cl. So that seems fine. > > Would it make sense to check the gen_files command line flag, similarly to > WriteProcessedFrameForVisualInspection? See > > https://cs.chromium.org/chromium/src/third_party/webrtc/modules/video_process... > ? LGTM. Stefan, do you have more comments?
On 2016/06/10 16:57:17, pbos-webrtc wrote: > On 2016/06/10 16:56:05, jackychen wrote: > > On 2016/06/10 11:09:20, nisse-webrtc wrote: > > > > > > https://codereview.webrtc.org/2005733003/diff/1/webrtc/common_video/video_fra... > > > File webrtc/common_video/video_frame_buffer.cc (right): > > > > > > > > > https://codereview.webrtc.org/2005733003/diff/1/webrtc/common_video/video_fra... > > > webrtc/common_video/video_frame_buffer.cc:227: return copy; > > > On 2016/06/09 19:08:36, jackychen wrote: > > > > Could you use a better name instead of copy? At least, we should know it > is > > a > > > > buffer copy. > > > > > > To me, "copy" seems quite clear from the context, but I can try to improve > the > > > naming. Would it be clearer if I rename buffer --> src (the input argument) > > and > > > copy --> buffer (the returned value)? > > > > What about "buffer" -> "buf_src", copy -> "buf_copy"? > > buffer_source or buffer_copy in that case Ok, I've changed to those names, both in the new method and the Copy method just above. But to my eyes, the "buffer_" prefix on names everywhere in these functions makes the code *considerably* less readable. In particular, since everything is the same type anyway, that really doesn't make anything clearer. Unless you have a strong objection to that, I'll change back to some shorter names (is |source| and |target| better than the original |buffer|, |copy|?) without any typing prefix or suffix.
nisse@webrtc.org changed reviewers: + pbos@webrtc.org
+pbos, who expressed opinions on naming.
nisse@webrtc.org changed reviewers: + marpan@webrtc.org
Marco, can you have an owner's look? Stefan is on vacation.
On 2016/06/16 08:12:41, nisse-webrtc wrote: > +pbos, who expressed opinions on naming. Just had an opinion on bfr vs buffer
lgtm
The CQ bit was checked by nisse@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from jackychen@webrtc.org Link to the patchset: https://codereview.webrtc.org/2005733003/#ps40001 (title: "Shorter names, for even better clarity.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2005733003/40001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_dbg/builds/14256) android_rel on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_rel/builds/14229) linux_baremetal on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/linux_baremetal/builds/...)
The CQ bit was checked by nisse@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from jackychen@webrtc.org, marpan@webrtc.org Link to the patchset: https://codereview.webrtc.org/2005733003/#ps60001 (title: "Rebased.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2005733003/60001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_dbg/builds/14258)
Description was changed from ========== Refactor VideoDenoiser to work with I420Buffer, not VideoFrame. BUG=webrtc:5921 ========== to ========== Refactor VideoDenoiser to work with I420Buffer, not VideoFrame. BUG=webrtc:5921 R=jackychen@webrtc.org, marpan@webrtc.org Committed: https://chromium.googlesource.com/external/webrtc/+/6af2e86b46a638f8a9309dffc... ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as 6af2e86b46a638f8a9309dffc3181053bd32974e (presubmit successful).
Message was sent while issue was closed.
Description was changed from ========== Refactor VideoDenoiser to work with I420Buffer, not VideoFrame. BUG=webrtc:5921 R=jackychen@webrtc.org, marpan@webrtc.org Committed: https://chromium.googlesource.com/external/webrtc/+/6af2e86b46a638f8a9309dffc... ========== to ========== Refactor VideoDenoiser to work with I420Buffer, not VideoFrame. BUG=webrtc:5921 R=jackychen@webrtc.org, marpan@webrtc.org Committed: https://crrev.com/6af2e86b46a638f8a9309dffc3181053bd32974e Cr-Commit-Position: refs/heads/master@{#13179} ==========
Message was sent while issue was closed.
Landed now. Thanks for the review. I have one remaining question, see below. https://codereview.webrtc.org/2005733003/diff/80001/webrtc/modules/video_proc... File webrtc/modules/video_processing/video_denoiser.h (right): https://codereview.webrtc.org/2005733003/diff/80001/webrtc/modules/video_proc... webrtc/modules/video_processing/video_denoiser.h:29: // from the caller. BTW, what do you think about this idea? It would simplify things for the caller quite a lot.
Message was sent while issue was closed.
https://codereview.webrtc.org/2005733003/diff/80001/webrtc/modules/video_proc... File webrtc/modules/video_processing/video_denoiser.h (right): https://codereview.webrtc.org/2005733003/diff/80001/webrtc/modules/video_proc... webrtc/modules/video_processing/video_denoiser.h:29: // from the caller. On 2016/06/17 07:34:47, nisse-webrtc wrote: > BTW, what do you think about this idea? It would simplify things for the caller > quite a lot. SG for me. You can surely make this change. |