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

Issue 418653002: Allowing YUV data to be retrieved from the JPEG Decoder. (Closed)

Created:
6 years, 5 months ago by sugoi1
Modified:
6 years, 2 months ago
CC:
blink-reviews, jamesr, krit, jbroman, danakj, Rik, Stephen Chennney, pdr., rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Allowing YUV data to be retrieved from the JPEG Decoder. Adding the code to extract the raw YUV channels from the JPEGImageDedcoder and the plumbing to go from the skia derived classes all the way down to the decoder. BUG= Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178963

Patch Set 1 #

Patch Set 2 : Removed useless added parameter #

Total comments: 57

Patch Set 3 : Fixed style nits #

Patch Set 4 : Changed unsigned char to appropriate JSAMP... types #

Total comments: 4

Patch Set 5 : Removed changes to ImageFrameGenerator for now #

Total comments: 52

Patch Set 6 : Simplification and clean up #

Patch Set 7 : Fixed comments #

Total comments: 3

Patch Set 8 : Removed unnecessary default arguments #

Patch Set 9 : Adding revert to RGB when we have color profiles #

Total comments: 1

Patch Set 10 : Added a unit test #

Total comments: 1

Patch Set 11 : Added a constant #

Patch Set 12 : Added missing PLATFORM_EXPORT #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+304 lines, -23 lines) Patch
M Source/platform/image-decoders/ImageDecoder.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +22 lines, -0 lines 0 comments Download
M Source/platform/image-decoders/ImageDecoder.cpp View 1 2 3 4 5 6 1 chunk +28 lines, -0 lines 2 comments Download
M Source/platform/image-decoders/jpeg/JPEGImageDecoder.h View 1 2 3 4 5 6 7 2 chunks +5 lines, -0 lines 1 comment Download
M Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp View 1 2 3 4 5 6 7 8 10 chunks +206 lines, -22 lines 10 comments Download
M Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp View 1 2 3 4 5 6 7 8 9 10 3 chunks +43 lines, -1 line 0 comments Download

Messages

Total messages: 46 (0 generated)
sugoi1
Here's a first draft of the YUV extraction code in blink in order to get ...
6 years, 5 months ago (2014-07-23 21:04:18 UTC) #1
Stephen White
Looks ok (modulo nits), but I'd like one of {hclam, noel, pkasting} to take a ...
6 years, 5 months ago (2014-07-23 21:45:54 UTC) #2
Peter Kasting
One of the others should review for functionality; I don't really know enough about how ...
6 years, 5 months ago (2014-07-23 22:17:38 UTC) #3
sugoi1
https://codereview.chromium.org/418653002/diff/20001/Source/platform/graphics/ImageFrameGenerator.cpp File Source/platform/graphics/ImageFrameGenerator.cpp (right): https://codereview.chromium.org/418653002/diff/20001/Source/platform/graphics/ImageFrameGenerator.cpp#newcode203 Source/platform/graphics/ImageFrameGenerator.cpp:203: return m_hardwareDecoding; On 2014/07/23 21:45:53, Stephen White wrote: > ...
6 years, 5 months ago (2014-07-24 15:48:31 UTC) #4
Stephen White
Looks good, but as discussed, needs tests.
6 years, 5 months ago (2014-07-24 17:19:49 UTC) #5
Alpha Left Google
YUV decoding is long needed. But this change crosses some hairy bits in ImageFrameGenerator and ...
6 years, 5 months ago (2014-07-24 17:58:38 UTC) #6
Peter Kasting
LGTM with comments for style -- again, I'm not doing a functional review. https://codereview.chromium.org/418653002/diff/20001/Source/platform/graphics/ImageFrameGenerator.cpp File ...
6 years, 5 months ago (2014-07-24 18:08:14 UTC) #7
sugoi1
On 2014/07/24 18:08:14, Peter Kasting wrote: > https://codereview.chromium.org/418653002/diff/60001/Source/platform/image-decoders/ImageDecoder.h#newcode57 > Source/platform/image-decoders/ImageDecoder.h:57: void set(void* planes[3], > size_t ...
6 years, 5 months ago (2014-07-24 20:28:56 UTC) #8
Peter Kasting
On 2014/07/24 20:28:56, sugoi1 wrote: > On 2014/07/24 18:08:14, Peter Kasting wrote: > > > ...
6 years, 5 months ago (2014-07-24 20:30:21 UTC) #9
sugoi1
On 2014/07/24 20:30:21, Peter Kasting wrote: > On 2014/07/24 20:28:56, sugoi1 wrote: > > On ...
6 years, 5 months ago (2014-07-24 20:32:44 UTC) #10
Alpha Left Google
https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/ImageDecoder.h File Source/platform/image-decoders/ImageDecoder.h (right): https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/ImageDecoder.h#newcode53 Source/platform/image-decoders/ImageDecoder.h:53: class DecodingBuffers { This should be called ImagePlanes to ...
6 years, 5 months ago (2014-07-24 22:07:27 UTC) #11
sugoi1
https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/ImageDecoder.h File Source/platform/image-decoders/ImageDecoder.h (right): https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/ImageDecoder.h#newcode53 Source/platform/image-decoders/ImageDecoder.h:53: class DecodingBuffers { On 2014/07/24 22:07:27, Alpha wrote: > ...
6 years, 5 months ago (2014-07-24 23:16:38 UTC) #12
Alpha Left Google
On 2014/07/24 23:16:38, sugoi1 wrote: > https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/ImageDecoder.h > File Source/platform/image-decoders/ImageDecoder.h (right): > > https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/ImageDecoder.h#newcode53 > ...
6 years, 5 months ago (2014-07-24 23:30:40 UTC) #13
Alpha Left Google
https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/ImageDecoder.h File Source/platform/image-decoders/ImageDecoder.h (right): https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/ImageDecoder.h#newcode268 Source/platform/image-decoders/ImageDecoder.h:268: On 2014/07/24 23:16:35, sugoi1 wrote: > On 2014/07/24 22:07:26, ...
6 years, 5 months ago (2014-07-24 23:30:57 UTC) #14
sugoi1
https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/ImageDecoder.h File Source/platform/image-decoders/ImageDecoder.h (right): https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/ImageDecoder.h#newcode268 Source/platform/image-decoders/ImageDecoder.h:268: On 2014/07/24 23:30:56, Alpha wrote: > On 2014/07/24 23:16:35, ...
6 years, 5 months ago (2014-07-25 02:55:13 UTC) #15
Alpha Left Google
> https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp#newcode361 > Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp:361: if > (m_decoder->acceleratedYUVDecoding() > On 2014/07/24 23:30:56, Alpha wrote: > > ...
6 years, 5 months ago (2014-07-25 06:50:21 UTC) #16
sugoi1
On 2014/07/25 06:50:21, Alpha wrote: > My point is to make "case JPEG_HEADER" and "case ...
6 years, 4 months ago (2014-07-25 15:16:18 UTC) #17
Noel Gordon
https://codereview.chromium.org/418653002/diff/80001/Source/platform/graphics/ImageFrameGenerator.cpp File Source/platform/graphics/ImageFrameGenerator.cpp (right): https://codereview.chromium.org/418653002/diff/80001/Source/platform/graphics/ImageFrameGenerator.cpp#newcode136 Source/platform/graphics/ImageFrameGenerator.cpp:136: return false; This change seems unrelated to yuv decoding. ...
6 years, 4 months ago (2014-07-25 15:55:02 UTC) #18
sugoi1
https://codereview.chromium.org/418653002/diff/80001/Source/platform/graphics/ImageFrameGenerator.cpp File Source/platform/graphics/ImageFrameGenerator.cpp (right): https://codereview.chromium.org/418653002/diff/80001/Source/platform/graphics/ImageFrameGenerator.cpp#newcode136 Source/platform/graphics/ImageFrameGenerator.cpp:136: return false; On 2014/07/25 15:55:01, Noel Gordon wrote: > ...
6 years, 4 months ago (2014-07-25 16:56:48 UTC) #19
Stephen White
https://codereview.chromium.org/418653002/diff/120001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h File Source/platform/image-decoders/jpeg/JPEGImageDecoder.h (right): https://codereview.chromium.org/418653002/diff/120001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h#newcode51 Source/platform/image-decoders/jpeg/JPEGImageDecoder.h:51: virtual IntSize decodedYUVSize(int component = 0) const OVERRIDE; Nit: ...
6 years, 4 months ago (2014-07-25 17:03:44 UTC) #20
sugoi1
https://codereview.chromium.org/418653002/diff/120001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h File Source/platform/image-decoders/jpeg/JPEGImageDecoder.h (right): https://codereview.chromium.org/418653002/diff/120001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h#newcode51 Source/platform/image-decoders/jpeg/JPEGImageDecoder.h:51: virtual IntSize decodedYUVSize(int component = 0) const OVERRIDE; On ...
6 years, 4 months ago (2014-07-25 17:08:38 UTC) #21
Stephen White
https://codereview.chromium.org/418653002/diff/120001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp File Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp (right): https://codereview.chromium.org/418653002/diff/120001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp#newcode259 Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp:259: return IntSize((info->output_width + h - 1) / h, (info->output_height ...
6 years, 4 months ago (2014-07-25 17:10:55 UTC) #22
sugoi1
https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp File Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp (right): https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp#newcode423 Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp:423: if (!m_decoder->ignoresGammaAndColorProfile()) { On 2014/07/25 15:55:01, Noel Gordon wrote: ...
6 years, 4 months ago (2014-07-25 17:20:26 UTC) #23
Alpha Left Google
On 2014/07/25 17:20:26, sugoi1 wrote: > https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp > File Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp (right): > > https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp#newcode423 > ...
6 years, 4 months ago (2014-07-25 17:26:44 UTC) #24
sugoi1
The CQ bit was checked by sugoi@chromium.org
6 years, 4 months ago (2014-07-25 17:34:11 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sugoi@chromium.org/418653002/160001
6 years, 4 months ago (2014-07-25 17:34:39 UTC) #26
sugoi1
The CQ bit was unchecked by sugoi@chromium.org
6 years, 4 months ago (2014-07-25 17:35:23 UTC) #27
Stephen White
https://codereview.chromium.org/418653002/diff/180001/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp File Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp (right): https://codereview.chromium.org/418653002/diff/180001/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp#newcode220 Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp:220: readYUV(1000 * 1000, &outputYWidth, &outputYHeight, &outputUVWidth, &outputUVHeight, jpegFile); Let's ...
6 years, 4 months ago (2014-07-25 18:25:10 UTC) #28
Stephen White
LGTM w/test nit fixed
6 years, 4 months ago (2014-07-25 18:27:01 UTC) #29
sugoi1
The CQ bit was checked by sugoi@chromium.org
6 years, 4 months ago (2014-07-25 18:29:27 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sugoi@chromium.org/418653002/200001
6 years, 4 months ago (2014-07-25 18:30:04 UTC) #31
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_blink_dbg on tryserver.blink ...
6 years, 4 months ago (2014-07-25 19:33:32 UTC) #32
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-07-25 19:39:38 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_compile_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/mac_blink_compile_dbg/builds/13851)
6 years, 4 months ago (2014-07-25 19:39:39 UTC) #34
sugoi1
The CQ bit was checked by sugoi@chromium.org
6 years, 4 months ago (2014-07-25 20:36:55 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sugoi@chromium.org/418653002/220001
6 years, 4 months ago (2014-07-25 20:37:14 UTC) #36
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: mac_gpu_retina_triggered_tests on tryserver.chromium.gpu ...
6 years, 4 months ago (2014-07-25 21:31:48 UTC) #37
commit-bot: I haz the power
Change committed as 178963
6 years, 4 months ago (2014-07-25 21:56:57 UTC) #38
Noel Gordon
On 2014/07/25 16:56:48, sugoi1 wrote: > https://codereview.chromium.org/418653002/diff/80001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp#newcode741 > Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp:741: template <> void > setPixel<JCS_RGB>(ImageFrame& buffer, ...
6 years, 4 months ago (2014-07-28 06:38:38 UTC) #39
Noel Gordon
On 2014/07/25 17:20:26, sugoi1 wrote: > On 2014/07/25 15:55:01, Noel Gordon wrote: > > Most ...
6 years, 4 months ago (2014-07-28 06:43:44 UTC) #40
Noel Gordon
https://codereview.chromium.org/418653002/diff/220001/Source/platform/image-decoders/ImageDecoder.cpp File Source/platform/image-decoders/ImageDecoder.cpp (right): https://codereview.chromium.org/418653002/diff/220001/Source/platform/image-decoders/ImageDecoder.cpp#newcode215 Source/platform/image-decoders/ImageDecoder.cpp:215: void ImagePlanes::set(void* planes[3], size_t rowBytes[3]) setPlanes https://codereview.chromium.org/418653002/diff/220001/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp File Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp ...
6 years, 4 months ago (2014-07-28 07:29:07 UTC) #41
Mike Lawther (Google)
It looks like there are still outstanding issues from Noel's review. @sugoi - can you ...
6 years, 4 months ago (2014-07-29 05:35:08 UTC) #42
sugoi1
On 2014/07/29 05:35:08, Mike Lawther (Google) wrote: > It looks like there are still outstanding ...
6 years, 4 months ago (2014-08-18 13:59:21 UTC) #43
sugoi1
Hi Noel, I'll proceed with the follow up soon, but I had some questions about ...
6 years, 4 months ago (2014-08-18 18:47:39 UTC) #44
sugoi1
The fixes are available here: https://codereview.chromium.org/480093003/ https://codereview.chromium.org/418653002/diff/220001/Source/platform/image-decoders/ImageDecoder.cpp File Source/platform/image-decoders/ImageDecoder.cpp (right): https://codereview.chromium.org/418653002/diff/220001/Source/platform/image-decoders/ImageDecoder.cpp#newcode215 Source/platform/image-decoders/ImageDecoder.cpp:215: void ImagePlanes::set(void* planes[3], ...
6 years, 4 months ago (2014-08-19 20:28:47 UTC) #45
Noel Gordon
6 years, 2 months ago (2014-10-04 21:17:29 UTC) #46
Message was sent while issue was closed.
message: On 2014/08/18 18:47:39, sugoi1 wrote:
> Hi Noel,

> On 2014/07/28 06:38:38, Noel Gordon wrote:
> > Your finding run completely
> > counter to the results of https://bugs.webkit.org/show_bug.cgi?id=88424 and
> > http://trac.webkit.org/changeset/136189
>
> I'm sorry, but I don't understand how it counters the results of your cls. 

The webkit CL's were Viatcheslav's, not mine, we just had to review them :)

> I simply changed a generic template function and used template specialization
to
> split it into specialized functions by removing branching from the generic
> template function.

The generic template function used a switch / case statement.  The question of
using template specializations, as you have done, came up In review

https://bugs.webkit.org/attachment.cgi?id=176379&action=review

Brent: Could this switch be handled as template specializations to avoid
branching? Would it even make a difference in performance?

Good questions.  On the other hand, maybe the compiler does the "right thing"
with the generic switch / case template, generating specific code for each case
label.

> You must be seeing something in my change that I don't see,
> because I don't understand how template specialization breaks your webkit
> change. If template specialization results in any kind of loss in performance
or
> hinders compiler optimizations in any way, this is news to me. It should be
same
> or better and if it isn't, please explain, because I'm really interested in
> finding out why.

The review response https://bugs.webkit.org/show_bug.cgi?id=88424#c60 said the
compiler did the "right thing", so the code was submitted with the generic
switch / case template, instead of template specializations.

So your findings made me curious: template specialization was better, the
generic was generating "unnecessary code".

Perhaps Viatcheslav's advice https://bugs.webkit.org/show_bug.cgi?id=88424#c60
was wrong?

I currently believe you are both right :)

Powered by Google App Engine
This is Rietveld 408576698