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

Side by Side Diff: media/base/video_util.cc

Issue 88403004: Add plumbing for video pixel formats with JPEG color range. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add YV12J to a DCHECK Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/video_frame.cc ('k') | media/ffmpeg/ffmpeg_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/video_util.h" 5 #include "media/base/video_util.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "media/base/video_frame.h" 10 #include "media/base/video_frame.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 ptr += stride; 137 ptr += stride;
138 } 138 }
139 } 139 }
140 140
141 void LetterboxYUV(VideoFrame* frame, const gfx::Rect& view_area) { 141 void LetterboxYUV(VideoFrame* frame, const gfx::Rect& view_area) {
142 DCHECK(!(view_area.x() & 1)); 142 DCHECK(!(view_area.x() & 1));
143 DCHECK(!(view_area.y() & 1)); 143 DCHECK(!(view_area.y() & 1));
144 DCHECK(!(view_area.width() & 1)); 144 DCHECK(!(view_area.width() & 1));
145 DCHECK(!(view_area.height() & 1)); 145 DCHECK(!(view_area.height() & 1));
146 DCHECK(frame->format() == VideoFrame::YV12 || 146 DCHECK(frame->format() == VideoFrame::YV12 ||
147 frame->format() == VideoFrame::YV12J ||
147 frame->format() == VideoFrame::I420); 148 frame->format() == VideoFrame::I420);
148 LetterboxPlane(frame, VideoFrame::kYPlane, view_area, 0x00); 149 LetterboxPlane(frame, VideoFrame::kYPlane, view_area, 0x00);
149 gfx::Rect half_view_area(view_area.x() / 2, 150 gfx::Rect half_view_area(view_area.x() / 2,
150 view_area.y() / 2, 151 view_area.y() / 2,
151 view_area.width() / 2, 152 view_area.width() / 2,
152 view_area.height() / 2); 153 view_area.height() / 2);
153 LetterboxPlane(frame, VideoFrame::kUPlane, half_view_area, 0x80); 154 LetterboxPlane(frame, VideoFrame::kUPlane, half_view_area, 0x80);
154 LetterboxPlane(frame, VideoFrame::kVPlane, half_view_area, 0x80); 155 LetterboxPlane(frame, VideoFrame::kVPlane, half_view_area, 0x80);
155 } 156 }
156 157
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 frame->data(kU) + uv_offset, 300 frame->data(kU) + uv_offset,
300 frame->data(kV) + uv_offset, 301 frame->data(kV) + uv_offset,
301 region_in_frame.width(), 302 region_in_frame.width(),
302 region_in_frame.height(), 303 region_in_frame.height(),
303 stride, 304 stride,
304 frame->stride(kY), 305 frame->stride(kY),
305 uv_stride); 306 uv_stride);
306 } 307 }
307 308
308 } // namespace media 309 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame.cc ('k') | media/ffmpeg/ffmpeg_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698