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

Unified Diff: media/ffmpeg/ffmpeg_common.cc

Issue 289373011: Support for YUV 4:4:4 subsampling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try that again. Created 6 years, 7 months 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 | « media/base/video_frame.cc ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/ffmpeg/ffmpeg_common.cc
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index ab644687e58484639cf0c1ac4291ca42b7cc714d..d87aa820830bf584230c951714fbfb5386fccceb 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -400,9 +400,11 @@ void AVStreamToVideoDecoderConfig(
}
// Pad out |coded_size| for subsampled YUV formats.
- coded_size.set_width((coded_size.width() + 1) / 2 * 2);
- if (format != VideoFrame::YV16)
- coded_size.set_height((coded_size.height() + 1) / 2 * 2);
+ if (format != VideoFrame::YV24) {
+ coded_size.set_width((coded_size.width() + 1) / 2 * 2);
+ if (format != VideoFrame::YV16)
+ coded_size.set_height((coded_size.height() + 1) / 2 * 2);
+ }
bool is_encrypted = false;
AVDictionaryEntry* key = av_dict_get(stream->metadata, "enc_key_id", NULL, 0);
@@ -517,6 +519,8 @@ VideoFrame::Format PixelFormatToVideoFormat(PixelFormat pixel_format) {
switch (pixel_format) {
case PIX_FMT_YUV422P:
return VideoFrame::YV16;
+ case PIX_FMT_YUV444P:
+ return VideoFrame::YV24;
case PIX_FMT_YUV420P:
return VideoFrame::YV12;
case PIX_FMT_YUVJ420P:
@@ -539,6 +543,8 @@ PixelFormat VideoFormatToPixelFormat(VideoFrame::Format video_format) {
return PIX_FMT_YUVJ420P;
case VideoFrame::YV12A:
return PIX_FMT_YUVA420P;
+ case VideoFrame::YV24:
+ return PIX_FMT_YUV444P;
default:
DVLOG(1) << "Unsupported VideoFrame::Format: " << video_format;
}
« no previous file with comments | « media/base/video_frame.cc ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698