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

Issue 912293005: Mac Video Capture AVFoundation: Calculate compressed frame size for MJPEG. (Closed)

Created:
5 years, 10 months ago by magjed_chromium
Modified:
5 years, 8 months ago
CC:
oja_google.com, fbarchard, chromium-reviews, posciak+watch_chromium.org, feature-media-reviews_chromium.org, wjia+watch_chromium.org, mcasas+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac Video Capture AVFoundation: Calculate compressed frame size for MJPEG. The frame size we receive from AVFoundation is sometimes excessive, e.g. the size of the uncompressed frame. For example, for a JPEG YUV422, the reported size might be 1280*720*2 = 1.8MB, while the actual compressed data is only 260kB. In these cases, libyuv::MJPGToI420 spends a lot of time in libyuv::ValidateJpeg, as much as 25%. The reason for this is that ValidateJpeg starts at the end of the buffer and loops backwards looking for the End Of Image (EOI) marker. This CL tries to optimize these cases by finding the EOI by looping forwards instead of backwards, and reporting the actual frame size to libyuv::MJPGToI420. BUG=346634, 460497 Committed: https://crrev.com/dc556d2b54354adc95ee5474600f469f7ae65692 Cr-Commit-Position: refs/heads/master@{#317333}

Patch Set 1 #

Total comments: 3

Patch Set 2 : todo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -0 lines) Patch
M media/video/capture/mac/video_capture_device_avfoundation_mac.mm View 1 3 chunks +27 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (5 generated)
magjed_chromium
Please take a look. I couldn't manage to get the correct frame size from AVFoundation. ...
5 years, 10 months ago (2015-02-11 15:21:40 UTC) #2
tommi (sloooow) - chröme
https://codereview.chromium.org/912293005/diff/1/media/video/capture/mac/video_capture_device_avfoundation_mac.mm File media/video/capture/mac/video_capture_device_avfoundation_mac.mm (right): https://codereview.chromium.org/912293005/diff/1/media/video/capture/mac/video_capture_device_avfoundation_mac.mm#newcode328 media/video/capture/mac/video_capture_device_avfoundation_mac.mm:328: // jpeg decoding in the browser. what about adding ...
5 years, 10 months ago (2015-02-11 15:57:44 UTC) #3
mcasas
|frame_size| is passed as an indication to VideoCaptureDeviceMac::ReceiveFrame() [1]; this one forwards it verbatim to ...
5 years, 10 months ago (2015-02-11 17:47:16 UTC) #4
torbjorng
LGTM. The logic looks absolutely correct; this type of code is prone to fencepost errors ...
5 years, 10 months ago (2015-02-12 14:32:57 UTC) #6
magjed_chromium
I agree with Miguel that this is not the right place to put MJPEG stuff, ...
5 years, 10 months ago (2015-02-12 15:35:28 UTC) #7
chromium-reviews
My measurement compared Mac OS libc's memchr to a well-tweaked sentinel based byte-for-byte loop. That ...
5 years, 10 months ago (2015-02-12 16:13:04 UTC) #8
mcasas
On 2015/02/12 15:35:28, magjed wrote: > I agree with Miguel that this is not the ...
5 years, 10 months ago (2015-02-12 16:33:00 UTC) #9
chromium-reviews
I don't think ​rawmemchr is portable. I love sentinel techniques for this sort of problems. ...
5 years, 10 months ago (2015-02-12 16:45:12 UTC) #10
magjed_chromium
This is fixed in latest libyuv already, but the last roll failed. I'm committing this ...
5 years, 10 months ago (2015-02-20 15:51:17 UTC) #12
tommi (sloooow) - chröme
On 2015/02/20 15:51:17, magjed wrote: > This is fixed in latest libyuv already, but the ...
5 years, 10 months ago (2015-02-20 15:53:21 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/912293005/20001
5 years, 10 months ago (2015-02-20 15:54:43 UTC) #15
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 10 months ago (2015-02-20 16:29:29 UTC) #16
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/dc556d2b54354adc95ee5474600f469f7ae65692 Cr-Commit-Position: refs/heads/master@{#317333}
5 years, 10 months ago (2015-02-20 16:30:16 UTC) #17
mcasas
On 2015/02/20 16:30:16, I haz the power (commit-bot) wrote: > Patchset 2 (id:??) landed as ...
5 years, 10 months ago (2015-02-20 16:36:41 UTC) #18
tommi (sloooow) - chröme
On 2015/02/20 16:36:41, mcasas wrote: > On 2015/02/20 16:30:16, I haz the power (commit-bot) wrote: ...
5 years, 10 months ago (2015-02-20 16:56:13 UTC) #19
magjed_chromium
On 2015/02/20 16:36:41, mcasas wrote: > On 2015/02/20 16:30:16, I haz the power (commit-bot) wrote: ...
5 years, 10 months ago (2015-02-20 16:56:15 UTC) #20
tommi (sloooow) - chröme
On 2015/02/20 16:56:13, tommi wrote: > On 2015/02/20 16:36:41, mcasas wrote: > > On 2015/02/20 ...
5 years, 10 months ago (2015-02-20 16:58:22 UTC) #21
tommi (sloooow) - chröme
On 2015/02/20 16:58:22, tommi wrote: > On 2015/02/20 16:56:13, tommi wrote: > > On 2015/02/20 ...
5 years, 10 months ago (2015-02-20 17:00:09 UTC) #22
magjed_chromium
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/1089173003/ by magjed@chromium.org. ...
5 years, 8 months ago (2015-04-15 08:30:17 UTC) #23
fbarchard
5 years, 8 months ago (2015-04-15 21:18:25 UTC) #25
Message was sent while issue was closed.
lgtm
would still be good to find a way to determine the correct size of the frame.  A
todo perhaps.

Powered by Google App Engine
This is Rietveld 408576698