Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Issue 2020593002: Refactor scaling. (Closed)

Created:
4 years, 6 months ago by nisse-webrtc
Modified:
4 years, 6 months ago
CC:
webrtc-reviews_webrtc.org, video-team_agora.io, zhengzhonghou_agora.io, stefan-webrtc, tterriberry_mozilla.com, the sun, mflodman
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Refactor scaling. Introduce a new method I420Buffer::CropAndScale, and a static convenience helper I420Buffer::CenterCropAndScale. Use them for almost all scaling needs. Delete the Scaler class and the cricket::VideoFrame::Stretch* methods. BUG=webrtc:5682 R=pbos@webrtc.org, perkj@webrtc.org, stefan@webrtc.org Committed: https://chromium.googlesource.com/external/webrtc/+/718a763d5924d5a9948a4e5ecbf0fde1da11129f

Patch Set 1 #

Patch Set 2 : Add missing include of stddef.h. #

Patch Set 3 : Update H264VideoToolbox encoder. #

Patch Set 4 : Attempt to fix ios compile errors. #

Patch Set 5 : Include <algorithm>, needed for std::min. #

Total comments: 6

Patch Set 6 : Delete ShallowCenterCrop. #

Total comments: 22

Patch Set 7 : Use buffer pool in VPMSpatialResampler. Address some nits. #

Total comments: 5

Patch Set 8 : Rename GetScaledFrame --> GetScaledBuffer. Use RTC_DCHECK_G*. #

Total comments: 6

Patch Set 9 : Clarify some comments. #

Total comments: 13

Patch Set 10 : Address Per's comments. Add I420Buffer::Scale helper method. #

Total comments: 10

Patch Set 11 : Address pbos' comments. More consistent init of refptr. #

Total comments: 4

Patch Set 12 : Fix include order. #

Patch Set 13 : Rebase. #

Patch Set 14 : Drop scaler_unitttest.cc from GN test build. #

Patch Set 15 : Trivial rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+397 lines, -1031 lines) Patch
M webrtc/api/java/jni/androidmediaencoder_jni.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -2 lines 0 comments Download
M webrtc/api/java/jni/androidvideocapturer_jni.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +5 lines, -20 lines 0 comments Download
M webrtc/common_video/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +0 lines, -3 lines 0 comments Download
M webrtc/common_video/common_video.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -2 lines 0 comments Download
M webrtc/common_video/common_video_unittests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M webrtc/common_video/i420_video_frame_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +130 lines, -1 line 0 comments Download
M webrtc/common_video/include/video_frame_buffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +15 lines, -7 lines 0 comments Download
D webrtc/common_video/libyuv/include/scaler.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -71 lines 0 comments Download
M webrtc/common_video/libyuv/include/webrtc_libyuv.h View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -1 line 0 comments Download
D webrtc/common_video/libyuv/scaler.cc View 1 chunk +0 lines, -116 lines 0 comments Download
D webrtc/common_video/libyuv/scaler_unittest.cc View 1 chunk +0 lines, -399 lines 0 comments Download
M webrtc/common_video/libyuv/webrtc_libyuv.cc View 1 2 3 4 5 6 7 8 2 chunks +16 lines, -12 lines 0 comments Download
M webrtc/common_video/video_frame.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M webrtc/common_video/video_frame_buffer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +57 lines, -31 lines 0 comments Download
M webrtc/media/base/videoframe.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +0 lines, -33 lines 0 comments Download
M webrtc/media/base/videoframe.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +0 lines, -105 lines 0 comments Download
M webrtc/media/base/videoframe_unittest.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -27 lines 0 comments Download
M webrtc/media/base/videoframefactory.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -6 lines 0 comments Download
M webrtc/media/engine/webrtcvideoframe_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +22 lines, -22 lines 0 comments Download
M webrtc/modules/video_coding/codecs/test/videoprocessor.h View 2 chunks +0 lines, -2 lines 0 comments Download
M webrtc/modules/video_coding/codecs/test/videoprocessor.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +10 lines, -18 lines 0 comments Download
M webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/vp8_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc View 1 2 3 4 5 6 7 4 chunks +31 lines, -30 lines 0 comments Download
M webrtc/modules/video_coding/utility/moving_average.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/modules/video_coding/utility/quality_scaler.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +5 lines, -5 lines 0 comments Download
M webrtc/modules/video_coding/utility/quality_scaler.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +17 lines, -23 lines 0 comments Download
M webrtc/modules/video_coding/utility/quality_scaler_unittest.cc View 1 2 3 4 5 6 7 20 chunks +60 lines, -61 lines 0 comments Download
M webrtc/modules/video_processing/spatial_resampler.h View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M webrtc/modules/video_processing/spatial_resampler.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -18 lines 0 comments Download
M webrtc/modules/video_processing/video_denoiser.cc View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 54 (22 generated)
nisse-webrtc
This cl consolidates the scaling code abit. Get rid of the Stretch* methods (one of ...
4 years, 6 months ago (2016-05-27 08:34:55 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2020593002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2020593002/1
4 years, 6 months ago (2016-05-27 08:35:33 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_arm64_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/ios_arm64_dbg/builds/10150) ios_dbg on ...
4 years, 6 months ago (2016-05-27 08:40:04 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2020593002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2020593002/80001
4 years, 6 months ago (2016-05-27 11:33:58 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-05-27 12:32:06 UTC) #10
magjed_webrtc
https://codereview.webrtc.org/2020593002/diff/80001/webrtc/api/java/jni/androidvideocapturer_jni.cc File webrtc/api/java/jni/androidvideocapturer_jni.cc (right): https://codereview.webrtc.org/2020593002/diff/80001/webrtc/api/java/jni/androidvideocapturer_jni.cc#newcode221 webrtc/api/java/jni/androidvideocapturer_jni.cc:221: scaled->CropAndScale(buffer, 0, 0, rotated_width, rotated_height); You should use crop_x/crop_y ...
4 years, 6 months ago (2016-05-30 11:58:27 UTC) #11
nisse-webrtc
https://codereview.webrtc.org/2020593002/diff/80001/webrtc/api/java/jni/androidvideocapturer_jni.cc File webrtc/api/java/jni/androidvideocapturer_jni.cc (right): https://codereview.webrtc.org/2020593002/diff/80001/webrtc/api/java/jni/androidvideocapturer_jni.cc#newcode221 webrtc/api/java/jni/androidvideocapturer_jni.cc:221: scaled->CropAndScale(buffer, 0, 0, rotated_width, rotated_height); On 2016/05/30 11:58:26, magjed_webrtc ...
4 years, 6 months ago (2016-05-30 12:58:22 UTC) #12
pbos-webrtc
https://codereview.webrtc.org/2020593002/diff/100001/webrtc/api/java/jni/androidmediaencoder_jni.cc File webrtc/api/java/jni/androidmediaencoder_jni.cc (right): https://codereview.webrtc.org/2020593002/diff/100001/webrtc/api/java/jni/androidmediaencoder_jni.cc#newcode692 webrtc/api/java/jni/androidmediaencoder_jni.cc:692: quality_scaler_.GetScaledFrame(frame.video_frame_buffer())); GetScaledVideoFrameBuffer? https://codereview.webrtc.org/2020593002/diff/100001/webrtc/common_video/include/video_frame_buffer.h File webrtc/common_video/include/video_frame_buffer.h (right): https://codereview.webrtc.org/2020593002/diff/100001/webrtc/common_video/include/video_frame_buffer.h#newcode117 webrtc/common_video/include/video_frame_buffer.h:117: void ...
4 years, 6 months ago (2016-05-31 14:14:02 UTC) #13
nisse-webrtc
https://codereview.webrtc.org/2020593002/diff/100001/webrtc/api/java/jni/androidmediaencoder_jni.cc File webrtc/api/java/jni/androidmediaencoder_jni.cc (right): https://codereview.webrtc.org/2020593002/diff/100001/webrtc/api/java/jni/androidmediaencoder_jni.cc#newcode692 webrtc/api/java/jni/androidmediaencoder_jni.cc:692: quality_scaler_.GetScaledFrame(frame.video_frame_buffer())); On 2016/05/31 14:14:01, pbos-webrtc wrote: > GetScaledVideoFrameBuffer? If ...
4 years, 6 months ago (2016-06-01 09:15:18 UTC) #14
pbos-webrtc
https://codereview.webrtc.org/2020593002/diff/100001/webrtc/api/java/jni/androidmediaencoder_jni.cc File webrtc/api/java/jni/androidmediaencoder_jni.cc (right): https://codereview.webrtc.org/2020593002/diff/100001/webrtc/api/java/jni/androidmediaencoder_jni.cc#newcode692 webrtc/api/java/jni/androidmediaencoder_jni.cc:692: quality_scaler_.GetScaledFrame(frame.video_frame_buffer())); On 2016/06/01 09:15:17, nisse-webrtc wrote: > On 2016/05/31 ...
4 years, 6 months ago (2016-06-01 15:55:41 UTC) #15
nisse-webrtc
Renamed GetScaledFrame --> GetScaledBuffer, and changed RTC_DCHECK --> RTC_DCHECK_G* as suggested. https://codereview.webrtc.org/2020593002/diff/100001/webrtc/api/java/jni/androidmediaencoder_jni.cc File webrtc/api/java/jni/androidmediaencoder_jni.cc (right): ...
4 years, 6 months ago (2016-06-02 09:00:06 UTC) #18
perkj_webrtc
https://codereview.webrtc.org/2020593002/diff/140001/webrtc/common_video/i420_video_frame_unittest.cc File webrtc/common_video/i420_video_frame_unittest.cc (right): https://codereview.webrtc.org/2020593002/diff/140001/webrtc/common_video/i420_video_frame_unittest.cc#newcode56 webrtc/common_video/i420_video_frame_unittest.cc:56: double rel_width, what is rel_width hight? https://codereview.webrtc.org/2020593002/diff/140001/webrtc/common_video/include/video_frame_buffer.h File webrtc/common_video/include/video_frame_buffer.h ...
4 years, 6 months ago (2016-06-02 09:25:36 UTC) #19
nisse-webrtc
(No new patchset now, only comments). https://codereview.webrtc.org/2020593002/diff/140001/webrtc/common_video/i420_video_frame_unittest.cc File webrtc/common_video/i420_video_frame_unittest.cc (right): https://codereview.webrtc.org/2020593002/diff/140001/webrtc/common_video/i420_video_frame_unittest.cc#newcode56 webrtc/common_video/i420_video_frame_unittest.cc:56: double rel_width, On ...
4 years, 6 months ago (2016-06-02 12:17:50 UTC) #20
perkj_webrtc
https://codereview.webrtc.org/2020593002/diff/160001/webrtc/api/java/jni/androidvideocapturer_jni.cc File webrtc/api/java/jni/androidvideocapturer_jni.cc (right): https://codereview.webrtc.org/2020593002/diff/160001/webrtc/api/java/jni/androidvideocapturer_jni.cc#newcode220 webrtc/api/java/jni/androidvideocapturer_jni.cc:220: scaled->CropAndScale(buffer, 0, 0, rotated_width, rotated_height); please use buffer->width() and ...
4 years, 6 months ago (2016-06-02 13:43:08 UTC) #21
nisse-webrtc
I've addressed Per's comments. I've also added another convenience method, I420Buffer::Scale, used at the call ...
4 years, 6 months ago (2016-06-03 13:55:02 UTC) #22
pbos-webrtc
https://codereview.webrtc.org/2020593002/diff/180001/webrtc/common_video/i420_video_frame_unittest.cc File webrtc/common_video/i420_video_frame_unittest.cc (right): https://codereview.webrtc.org/2020593002/diff/180001/webrtc/common_video/i420_video_frame_unittest.cc#newcode55 webrtc/common_video/i420_video_frame_unittest.cc:55: // the original (gradient) frame, in relative coordinates where ...
4 years, 6 months ago (2016-06-03 14:53:23 UTC) #23
nisse-webrtc
Not sure what to do about the DCHECKs, it would make some sense with a ...
4 years, 6 months ago (2016-06-09 08:10:06 UTC) #24
perkj_webrtc
There is an EXPECT_NEAR macro you can consider. Nice cleanup. lgtm https://codereview.webrtc.org/2020593002/diff/200001/webrtc/modules/video_coding/utility/moving_average.h File webrtc/modules/video_coding/utility/moving_average.h (right): ...
4 years, 6 months ago (2016-06-10 09:01:24 UTC) #25
nisse-webrtc
There's no _NEAR macro in the DCHECK family, as far as I can find. pbos, ...
4 years, 6 months ago (2016-06-10 11:36:57 UTC) #26
pbos-webrtc
On 2016/06/10 11:36:57, nisse-webrtc wrote: > There's no _NEAR macro in the DCHECK family, as ...
4 years, 6 months ago (2016-06-10 11:55:11 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2020593002/220001
4 years, 6 months ago (2016-06-10 12:01:26 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: android_compile_x86_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_compile_x86_dbg/builds/4575) ios64_gn_dbg on tryserver.webrtc (JOB_FAILED, ...
4 years, 6 months ago (2016-06-10 12:02:36 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2020593002/240001
4 years, 6 months ago (2016-06-10 13:00:23 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: linux_gn_rel on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/linux_gn_rel/builds/11600) mac_gn_dbg on tryserver.webrtc (JOB_FAILED, ...
4 years, 6 months ago (2016-06-10 13:02:36 UTC) #37
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2020593002/260001
4 years, 6 months ago (2016-06-13 06:59:11 UTC) #39
nisse-webrtc
Stefan, can you have a look? In particular, I need your approval for the changes ...
4 years, 6 months ago (2016-06-13 07:01:24 UTC) #41
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_dbg/builds/14117)
4 years, 6 months ago (2016-06-13 07:13:52 UTC) #43
stefan-webrtc
lgtm for video_processing
4 years, 6 months ago (2016-06-13 08:51:49 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2020593002/260001
4 years, 6 months ago (2016-06-13 08:58:34 UTC) #48
commit-bot: I haz the power
Try jobs failed on following builders: android_rel on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_rel/builds/14112)
4 years, 6 months ago (2016-06-13 09:03:26 UTC) #50
commit-bot: I haz the power
Patchset 15 (id:??) landed as https://crrev.com/718a763d5924d5a9948a4e5ecbf0fde1da11129f Cr-Commit-Position: refs/heads/master@{#13110}
4 years, 6 months ago (2016-06-13 11:06:20 UTC) #52
nisse-webrtc
4 years, 6 months ago (2016-06-13 11:06:22 UTC) #54
Message was sent while issue was closed.
Committed patchset #15 (id:280001) manually as
718a763d5924d5a9948a4e5ecbf0fde1da11129f (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698