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

Unified Diff: media/base/video_frame.cc

Issue 591313008: Add support for Rec709 color space videos in software YUV convert path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 5f0d7282c6e01aedfe0861ee90e55e2cb319b7c1..e7bdf3b59254f0517522b0c38c14145cff54f910 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -36,6 +36,7 @@ static gfx::Size AdjustCodedSize(VideoFrame::Format format,
case VideoFrame::YV12A:
case VideoFrame::I420:
case VideoFrame::YV12J:
+ case VideoFrame::YV12HD:
new_coded_size.set_height(RoundUp(new_coded_size.height(), 2));
// Fallthrough.
case VideoFrame::YV16:
@@ -104,6 +105,8 @@ std::string VideoFrame::FormatToString(VideoFrame::Format format) {
return "NV12";
case VideoFrame::YV24:
return "YV24";
+ case VideoFrame::YV12HD:
+ return "YV12HD";
}
NOTREACHED() << "Invalid videoframe format provided: " << format;
return "";
@@ -138,6 +141,7 @@ bool VideoFrame::IsValidConfig(VideoFrame::Format format,
case VideoFrame::I420:
case VideoFrame::YV12A:
case VideoFrame::NV12:
+ case VideoFrame::YV12HD:
// Subsampled YUV formats have width/height requirements.
if (static_cast<size_t>(coded_size.height()) <
RoundUp(visible_rect.bottom(), 2))
@@ -473,6 +477,7 @@ size_t VideoFrame::NumPlanes(Format format) {
case VideoFrame::YV16:
case VideoFrame::I420:
case VideoFrame::YV12J:
+ case VideoFrame::YV12HD:
case VideoFrame::YV24:
return 3;
case VideoFrame::YV12A:
@@ -515,6 +520,7 @@ gfx::Size VideoFrame::PlaneSize(Format format,
break;
case VideoFrame::YV12:
case VideoFrame::YV12J:
+ case VideoFrame::YV12HD:
case VideoFrame::I420:
switch (plane) {
case VideoFrame::kYPlane:
@@ -595,6 +601,7 @@ int VideoFrame::PlaneHorizontalBitsPerPixel(Format format, size_t plane) {
case VideoFrame::YV16:
case VideoFrame::I420:
case VideoFrame::YV12J:
+ case VideoFrame::YV12HD:
switch (plane) {
case kYPlane:
return 8;
@@ -648,7 +655,8 @@ static void ReleaseData(uint8* data) {
void VideoFrame::AllocateYUV() {
DCHECK(format_ == VideoFrame::YV12 || format_ == VideoFrame::YV16 ||
format_ == VideoFrame::YV12A || format_ == VideoFrame::I420 ||
- format_ == VideoFrame::YV12J || format_ == VideoFrame::YV24);
+ format_ == VideoFrame::YV12J || format_ == VideoFrame::YV24 ||
+ format_ == VideoFrame::YV12HD);
// Align Y rows at least at 16 byte boundaries. The stride for both
// YV12 and YV16 is 1/2 of the stride of Y. For YV12, every row of bytes for
// U and V applies to two rows of Y (one byte of UV for 4 bytes of Y), so in
@@ -768,6 +776,7 @@ size_t VideoFrame::RowBytes(size_t plane, VideoFrame::Format format,
case VideoFrame::YV16:
case VideoFrame::I420:
case VideoFrame::YV12J:
+ case VideoFrame::YV12HD:
switch (plane) {
case kYPlane:
return width;
@@ -832,6 +841,7 @@ size_t VideoFrame::Rows(size_t plane, VideoFrame::Format format, int height) {
break;
case VideoFrame::YV12:
case VideoFrame::YV12J:
+ case VideoFrame::YV12HD:
case VideoFrame::I420:
switch (plane) {
case kYPlane:

Powered by Google App Engine
This is Rietveld 408576698