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

Side by Side Diff: media/base/yuv_convert.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, 2 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 unified diff | Download patch
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 // This webpage shows layout of YV12 and other YUV formats 5 // This webpage shows layout of YV12 and other YUV formats
6 // http://www.fourcc.org/yuv.php 6 // http://www.fourcc.org/yuv.php
7 // The actual conversion is best described here 7 // The actual conversion is best described here
8 // http://en.wikipedia.org/wiki/YUV 8 // http://en.wikipedia.org/wiki/YUV
9 // An article on optimizing YUV conversion using tables instead of multiplies 9 // An article on optimizing YUV conversion using tables instead of multiplies
10 // http://lestourtereaux.free.fr/papers/data/yuvrgb.pdf 10 // http://lestourtereaux.free.fr/papers/data/yuvrgb.pdf
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 typedef void (*EmptyRegisterStateProc)(); 116 typedef void (*EmptyRegisterStateProc)();
117 static EmptyRegisterStateProc g_empty_register_state_proc_ = NULL; 117 static EmptyRegisterStateProc g_empty_register_state_proc_ = NULL;
118 118
119 // Get the appropriate value to bitshift by for vertical indices. 119 // Get the appropriate value to bitshift by for vertical indices.
120 int GetVerticalShift(YUVType type) { 120 int GetVerticalShift(YUVType type) {
121 switch (type) { 121 switch (type) {
122 case YV16: 122 case YV16:
123 return 0; 123 return 0;
124 case YV12: 124 case YV12:
125 case YV12J: 125 case YV12J:
126 case YV12HD:
126 return 1; 127 return 1;
127 } 128 }
128 NOTREACHED(); 129 NOTREACHED();
129 return 0; 130 return 0;
130 } 131 }
131 132
132 const int16 (&GetLookupTable(YUVType type))[1024][4] { 133 const int16 (&GetLookupTable(YUVType type))[1024][4] {
133 switch (type) { 134 switch (type) {
134 case YV12: 135 case YV12:
135 case YV16: 136 case YV16:
136 return kCoefficientsRgbY; 137 return kCoefficientsRgbY;
137 case YV12J: 138 case YV12J:
138 return kCoefficientsRgbY_JPEG; 139 return kCoefficientsRgbY_JPEG;
140 case YV12HD:
141 return kCoefficientsRgbY_Rec709;
139 } 142 }
140 NOTREACHED(); 143 NOTREACHED();
141 return kCoefficientsRgbY; 144 return kCoefficientsRgbY;
142 } 145 }
143 146
144 void InitializeCPUSpecificYUVConversions() { 147 void InitializeCPUSpecificYUVConversions() {
145 CHECK(!g_filter_yuv_rows_proc_); 148 CHECK(!g_filter_yuv_rows_proc_);
146 CHECK(!g_convert_yuv_to_rgb32_row_proc_); 149 CHECK(!g_convert_yuv_to_rgb32_row_proc_);
147 CHECK(!g_scale_yuv_to_rgb32_row_proc_); 150 CHECK(!g_scale_yuv_to_rgb32_row_proc_);
148 CHECK(!g_linear_scale_yuv_to_rgb32_row_proc_); 151 CHECK(!g_linear_scale_yuv_to_rgb32_row_proc_);
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 width, 685 width,
683 height, 686 height,
684 ystride, 687 ystride,
685 uvstride, 688 uvstride,
686 astride, 689 astride,
687 rgbstride, 690 rgbstride,
688 yuv_type); 691 yuv_type);
689 } 692 }
690 693
691 } // namespace media 694 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698