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

Issue 11413005: YUV software decode path stride fixes. (Closed)

Created:
8 years, 1 month ago by sheu
Modified:
8 years, 1 month ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, cc-bugs_chromium.org
Visibility:
Public.

Description

YUV software decode path stride fixes. Fix YUV software-decoded video playback for frame with padded strides. * Use per-plane stride info from VideoFrame for source image rect width, when uploading a CPU-allocated video frame. * Modify cc::TextureUploader to handle non-4-byte-aligned texture uploads. * Add testcase UploadContentsTest to check texture upload paths. * Add RoundDown()/RoundUp() to base::bits and use them in media::VideoFrame and cc::TextureUploader. BUG=chromium:160622, chromium:161023 TEST=local build, run on x86 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=168970

Patch Set 1 #

Total comments: 15

Patch Set 2 : #

Patch Set 3 : <WIP> #

Total comments: 7

Patch Set 4 : Fix without touching VideoFrame #

Patch Set 5 : #

Patch Set 6 : Unittest segfault fix.wq #

Total comments: 3

Patch Set 7 : Added alignment comment. #

Total comments: 2

Patch Set 8 : RoundUp() in base::bits #

Patch Set 9 : With unittests. #

Total comments: 1

Patch Set 10 : Rebse. #

Patch Set 11 : Removed set of GL_UNPACK_ALIGNMENT #

Total comments: 15

Patch Set 12 : WebKit nits. #

Total comments: 1

Patch Set 13 : cc LGTM'ed. #

Total comments: 2

Patch Set 14 : More robust RoundUp #

Patch Set 15 : Without base bits, <grumble> #

Patch Set 16 : Nits. #

Total comments: 1

Patch Set 17 : More nits. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+175 lines, -29 lines) Patch
M cc/texture_uploader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +23 lines, -10 lines 2 comments Download
M cc/texture_uploader_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +149 lines, -17 lines 0 comments Download
M cc/video_layer_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 51 (0 generated)
sheu
PTAL.
8 years, 1 month ago (2012-11-15 07:28:47 UTC) #1
Ami GONE FROM CHROMIUM
So confused... https://chromiumcodereview.appspot.com/11413005/diff/1/cc/video_layer_impl.cc File cc/video_layer_impl.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/1/cc/video_layer_impl.cc#newcode209 cc/video_layer_impl.cc:209: float texHeightScale = Undo these changes? https://chromiumcodereview.appspot.com/11413005/diff/1/cc/video_layer_impl.cc#newcode219 ...
8 years, 1 month ago (2012-11-15 18:15:35 UTC) #2
sheu
https://chromiumcodereview.appspot.com/11413005/diff/1/cc/video_layer_impl.cc File cc/video_layer_impl.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/1/cc/video_layer_impl.cc#newcode209 cc/video_layer_impl.cc:209: float texHeightScale = On 2012/11/15 18:15:36, Ami Fischman wrote: ...
8 years, 1 month ago (2012-11-15 19:46:37 UTC) #3
Ami GONE FROM CHROMIUM
Happy to VC if that'll help... https://chromiumcodereview.appspot.com/11413005/diff/1/cc/video_layer_impl.cc File cc/video_layer_impl.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/1/cc/video_layer_impl.cc#newcode209 cc/video_layer_impl.cc:209: float texHeightScale = ...
8 years, 1 month ago (2012-11-15 20:39:09 UTC) #4
sheu
https://chromiumcodereview.appspot.com/11413005/diff/1/cc/video_layer_impl.cc File cc/video_layer_impl.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/1/cc/video_layer_impl.cc#newcode209 cc/video_layer_impl.cc:209: float texHeightScale = On 2012/11/15 20:39:09, Ami Fischman wrote: ...
8 years, 1 month ago (2012-11-15 22:20:53 UTC) #5
sheu
Updated.
8 years, 1 month ago (2012-11-15 22:25:47 UTC) #6
Ami GONE FROM CHROMIUM
https://chromiumcodereview.appspot.com/11413005/diff/1/media/base/video_frame.cc File media/base/video_frame.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/1/media/base/video_frame.cc#newcode158 media/base/video_frame.cc:158: size_t uv_stride = y_stride / 2; On 2012/11/15 22:20:53, ...
8 years, 1 month ago (2012-11-15 23:11:15 UTC) #7
sheu
https://chromiumcodereview.appspot.com/11413005/diff/1/media/base/video_frame.cc File media/base/video_frame.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/1/media/base/video_frame.cc#newcode158 media/base/video_frame.cc:158: size_t uv_stride = y_stride / 2; On 2012/11/15 23:11:15, ...
8 years, 1 month ago (2012-11-16 03:00:10 UTC) #8
sheu
https://chromiumcodereview.appspot.com/11413005/diff/9001/media/base/video_frame.cc File media/base/video_frame.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/9001/media/base/video_frame.cc#newcode127 media/base/video_frame.cc:127: coded_size_.set_width(RoundUp(coded_size_.width(), 4)); This is kinda hacky. I'm doing this ...
8 years, 1 month ago (2012-11-16 03:03:45 UTC) #9
sheu
This should be better. PTAL.
8 years, 1 month ago (2012-11-16 22:04:12 UTC) #10
Ami GONE FROM CHROMIUM
https://chromiumcodereview.appspot.com/11413005/diff/9001/cc/video_layer_impl.cc File cc/video_layer_impl.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/9001/cc/video_layer_impl.cc#newcode290 cc/video_layer_impl.cc:290: gfx::Size dimensions = gfx::Size(frame->coded_size()); lolwat? https://chromiumcodereview.appspot.com/11413005/diff/9001/cc/video_layer_impl.cc#newcode375 cc/video_layer_impl.cc:375: gfx::Rect imageRect(0, ...
8 years, 1 month ago (2012-11-16 22:15:43 UTC) #11
sheu
https://chromiumcodereview.appspot.com/11413005/diff/9001/cc/video_layer_impl.cc File cc/video_layer_impl.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/9001/cc/video_layer_impl.cc#newcode290 cc/video_layer_impl.cc:290: gfx::Size dimensions = gfx::Size(frame->coded_size()); On 2012/11/16 22:15:43, Ami Fischman ...
8 years, 1 month ago (2012-11-17 00:35:39 UTC) #12
Ami GONE FROM CHROMIUM
https://chromiumcodereview.appspot.com/11413005/diff/9001/cc/video_layer_impl.cc File cc/video_layer_impl.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/9001/cc/video_layer_impl.cc#newcode375 cc/video_layer_impl.cc:375: gfx::Rect imageRect(0, 0, m_frame->stride(planeIndex), plane.size.height()); On 2012/11/17 00:35:39, sheu ...
8 years, 1 month ago (2012-11-17 00:41:37 UTC) #13
sheu
https://chromiumcodereview.appspot.com/11413005/diff/9001/cc/video_layer_impl.cc File cc/video_layer_impl.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/9001/cc/video_layer_impl.cc#newcode375 cc/video_layer_impl.cc:375: gfx::Rect imageRect(0, 0, m_frame->stride(planeIndex), plane.size.height()); On 2012/11/17 00:41:37, Ami ...
8 years, 1 month ago (2012-11-17 01:50:38 UTC) #14
Ami GONE FROM CHROMIUM
> If I pre-cropped, then visible_rect would be incorrect in the case that there > ...
8 years, 1 month ago (2012-11-17 07:51:56 UTC) #15
danakj
@jamesr should look at video layer. the layer change itself seems fine to me, but ...
8 years, 1 month ago (2012-11-17 19:25:14 UTC) #16
jamesr
I'm not sure why you need to patch the uploader, but if you need some ...
8 years, 1 month ago (2012-11-19 04:14:46 UTC) #17
ddorwin
On 2012/11/19 04:14:46, jamesr wrote: > I'm not sure why you need to patch the ...
8 years, 1 month ago (2012-11-19 22:12:47 UTC) #18
sheu
On 2012/11/17 07:51:56, Ami Fischman wrote: > > If I pre-cropped, then visible_rect would be ...
8 years, 1 month ago (2012-11-19 22:45:10 UTC) #19
sheu
On 2012/11/17 19:25:14, danakj wrote: > @jamesr should look at video layer. the layer change ...
8 years, 1 month ago (2012-11-19 22:49:08 UTC) #20
sheu
On 2012/11/19 04:14:46, jamesr wrote: > I'm not sure why you need to patch the ...
8 years, 1 month ago (2012-11-19 22:53:18 UTC) #21
sheu
On 2012/11/19 22:12:47, ddorwin wrote: > On 2012/11/19 04:14:46, jamesr wrote: > > I'm not ...
8 years, 1 month ago (2012-11-19 22:53:41 UTC) #22
danakj
https://chromiumcodereview.appspot.com/11413005/diff/10007/cc/texture_uploader.cc File cc/texture_uploader.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/10007/cc/texture_uploader.cc#newcode234 cc/texture_uploader.cc:234: (bytes_per_pixel * source_rect.width() + 3) & ~0x3; Oh, I ...
8 years, 1 month ago (2012-11-19 22:57:00 UTC) #23
danakj
https://chromiumcodereview.appspot.com/11413005/diff/10007/cc/texture_uploader.cc File cc/texture_uploader.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/10007/cc/texture_uploader.cc#newcode234 cc/texture_uploader.cc:234: (bytes_per_pixel * source_rect.width() + 3) & ~0x3; On 2012/11/19 ...
8 years, 1 month ago (2012-11-19 22:58:11 UTC) #24
sheu
On 2012/11/19 22:58:11, danakj wrote: > https://chromiumcodereview.appspot.com/11413005/diff/10007/cc/texture_uploader.cc > File cc/texture_uploader.cc (right): > > https://chromiumcodereview.appspot.com/11413005/diff/10007/cc/texture_uploader.cc#newcode234 > ...
8 years, 1 month ago (2012-11-19 23:08:50 UTC) #25
danakj
On 2012/11/19 23:08:50, sheu wrote: > I'd just as soon add this to a header ...
8 years, 1 month ago (2012-11-19 23:10:00 UTC) #26
jamesr
On 2012/11/19 22:53:18, sheu wrote: > > > https://chromiumcodereview.appspot.com/11413005/diff/3002/cc/texture_uploader.cc > > File cc/texture_uploader.cc (right): > ...
8 years, 1 month ago (2012-11-19 23:29:00 UTC) #27
sheu
On 2012/11/19 23:29:00, jamesr wrote: > On 2012/11/19 22:53:18, sheu wrote: > > The point ...
8 years, 1 month ago (2012-11-19 23:46:29 UTC) #28
jamesr
On 2012/11/19 23:46:29, sheu wrote: > The buggy bit is that GL_UNPACK_ALIGNMENT sets OpenGL's row ...
8 years, 1 month ago (2012-11-19 23:52:47 UTC) #29
sheu
On 2012/11/19 23:52:47, jamesr wrote: > On 2012/11/19 23:46:29, sheu wrote: > > The buggy ...
8 years, 1 month ago (2012-11-20 00:04:12 UTC) #30
jamesr
On 2012/11/20 00:04:12, sheu wrote: > On 2012/11/19 23:52:47, jamesr wrote: > > On 2012/11/19 ...
8 years, 1 month ago (2012-11-20 00:06:50 UTC) #31
sheu
Alrighty, added a unittest for y'all unittest fiends.
8 years, 1 month ago (2012-11-20 01:48:10 UTC) #32
danakj
https://chromiumcodereview.appspot.com/11413005/diff/6006/cc/texture_uploader.cc File cc/texture_uploader.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/6006/cc/texture_uploader.cc#newcode236 cc/texture_uploader.cc:236: m_context->pixelStorei(GL_UNPACK_ALIGNMENT, 4); It works the same without this pixelStorei() ...
8 years, 1 month ago (2012-11-20 01:53:07 UTC) #33
sheu
On 2012/11/20 01:53:07, danakj wrote: > https://chromiumcodereview.appspot.com/11413005/diff/6006/cc/texture_uploader.cc > File cc/texture_uploader.cc (right): > > https://chromiumcodereview.appspot.com/11413005/diff/6006/cc/texture_uploader.cc#newcode236 > ...
8 years, 1 month ago (2012-11-20 02:01:04 UTC) #34
sheu
Updated. PTAL.
8 years, 1 month ago (2012-11-20 20:01:37 UTC) #35
danakj
Thanks for the test! The file is in webkit style and we don't have a ...
8 years, 1 month ago (2012-11-20 20:43:38 UTC) #36
sheu
All done.
8 years, 1 month ago (2012-11-20 21:50:03 UTC) #37
danakj
cc LGTM with one last stylenit https://chromiumcodereview.appspot.com/11413005/diff/1015/cc/texture_uploader_unittest.cc File cc/texture_uploader_unittest.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/1015/cc/texture_uploader_unittest.cc#newcode24 cc/texture_uploader_unittest.cc:24: : m_resultAvailable(0), nit: ...
8 years, 1 month ago (2012-11-20 22:29:36 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/11413005/2024
8 years, 1 month ago (2012-11-20 22:36:30 UTC) #39
commit-bot: I haz the power
Presubmit check for 11413005-2024 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 1 month ago (2012-11-20 22:36:35 UTC) #40
ddorwin
media/ LGTM
8 years, 1 month ago (2012-11-20 22:40:57 UTC) #41
jar (doing other things)
a) When folks want stuff in base, the first question is: How many distinct users ...
8 years, 1 month ago (2012-11-20 22:54:35 UTC) #42
sheu
On 2012/11/20 22:54:35, jar wrote: > a) When folks want stuff in base, the first ...
8 years, 1 month ago (2012-11-20 23:13:20 UTC) #43
sheu
On 2012/11/20 22:54:35, jar wrote: > a) When folks want stuff in base, the first ...
8 years, 1 month ago (2012-11-20 23:13:20 UTC) #44
sheu
https://chromiumcodereview.appspot.com/11413005/diff/2024/base/bits.h File base/bits.h (right): https://chromiumcodereview.appspot.com/11413005/diff/2024/base/bits.h#newcode51 base/bits.h:51: return (n + (mul - 1)) / mul * ...
8 years, 1 month ago (2012-11-20 23:13:50 UTC) #45
sheu
On 2012/11/20 23:13:50, sheu wrote: > https://chromiumcodereview.appspot.com/11413005/diff/2024/base/bits.h > File base/bits.h (right): > > https://chromiumcodereview.appspot.com/11413005/diff/2024/base/bits.h#newcode51 > ...
8 years, 1 month ago (2012-11-20 23:26:31 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/11413005/5014
8 years, 1 month ago (2012-11-21 01:19:39 UTC) #47
danakj
https://chromiumcodereview.appspot.com/11413005/diff/2026/cc/texture_uploader.cc File cc/texture_uploader.cc (right): https://chromiumcodereview.appspot.com/11413005/diff/2026/cc/texture_uploader.cc#newcode35 cc/texture_uploader.cc:35: static uint32 RoundUp(uint32 n, uint32 mul) don't use static ...
8 years, 1 month ago (2012-11-21 01:24:26 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sheu@chromium.org/11413005/13021
8 years, 1 month ago (2012-11-21 01:30:02 UTC) #49
commit-bot: I haz the power
Change committed as 168970
8 years, 1 month ago (2012-11-21 04:15:42 UTC) #50
jar (doing other things)
8 years, 1 month ago (2012-11-21 17:17:56 UTC) #51
https://chromiumcodereview.appspot.com/11413005/diff/13021/cc/texture_uploade...
File cc/texture_uploader.cc (right):

https://chromiumcodereview.appspot.com/11413005/diff/13021/cc/texture_uploade...
cc/texture_uploader.cc:37: return (((n - 1) / mul) * mul) + mul;
if n == 0, return 0 first probably.

https://chromiumcodereview.appspot.com/11413005/diff/13021/cc/texture_uploade...
cc/texture_uploader.cc:46: , m_queryId(0)
nit: comma goes at end of previous line, and names are aligned (like you have
here, but without the commas).

Powered by Google App Engine
This is Rietveld 408576698