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

Unified Diff: media/base/video_frame.cc

Issue 2481343002: VideoFrame::AllocationSize test against odd values. (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/video_frame_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 41273b8fa2f497e4762c464d954f07df964a1722..8fed7200788d6cef40ebbc43605487c6c7b4299e 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -515,12 +515,21 @@ gfx::Size VideoFrame::PlaneSize(VideoPixelFormat format,
int width = coded_size.width();
int height = coded_size.height();
- if (format != PIXEL_FORMAT_ARGB) {
- // Align to multiple-of-two size overall. This ensures that non-subsampled
- // planes can be addressed by pixel with the same scaling as the subsampled
- // planes.
- width = RoundUp(width, 2);
- height = RoundUp(height, 2);
+ switch (format) {
+ case PIXEL_FORMAT_ARGB:
+ case PIXEL_FORMAT_XRGB:
+ case PIXEL_FORMAT_RGB24:
+ case PIXEL_FORMAT_RGB32:
+ case PIXEL_FORMAT_Y8:
+ case PIXEL_FORMAT_Y16:
+ break;
+ default:
DaleCurtis 2016/11/07 21:53:06 Should this just list all the other formats to avo
aleksandar.stojiljkovic 2016/11/07 22:27:25 Done.
+ // Align to multiple-of-two size overall. This ensures that non-subsampled
+ // planes can be addressed by pixel with the same scaling as the
+ // subsampled planes.
+ width = RoundUp(width, 2);
+ height = RoundUp(height, 2);
+ break;
}
const gfx::Size subsample = SampleSize(format, plane);
« no previous file with comments | « no previous file | media/base/video_frame_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698