Chromium Code Reviews| 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); |