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

Side by Side Diff: media/base/yuv_convert.h

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 #ifndef MEDIA_BASE_YUV_CONVERT_H_ 5 #ifndef MEDIA_BASE_YUV_CONVERT_H_
6 #define MEDIA_BASE_YUV_CONVERT_H_ 6 #define MEDIA_BASE_YUV_CONVERT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "media/base/media_export.h" 9 #include "media/base/media_export.h"
10 #include "media/base/simd/yuv_to_rgb_table.h" 10 #include "media/base/simd/yuv_to_rgb_table.h"
11 11
12 // Visual Studio 2010 does not support MMX intrinsics on x64. 12 // Visual Studio 2010 does not support MMX intrinsics on x64.
13 // Some win64 yuv_convert code paths use SSE+MMX yasm, so without rewriting 13 // Some win64 yuv_convert code paths use SSE+MMX yasm, so without rewriting
14 // them, we use yasm EmptyRegisterState_MMX in place of _mm_empty() or 14 // them, we use yasm EmptyRegisterState_MMX in place of _mm_empty() or
15 // hide the versions implemented with heavy use of MMX intrinsics. 15 // hide the versions implemented with heavy use of MMX intrinsics.
16 // TODO(wolenetz): Use MMX intrinsics when compiling win64 with Visual 16 // TODO(wolenetz): Use MMX intrinsics when compiling win64 with Visual
17 // Studio 2012? http://crbug.com/173450 17 // Studio 2012? http://crbug.com/173450
18 #if defined(ARCH_CPU_X86_FAMILY) && \ 18 #if defined(ARCH_CPU_X86_FAMILY) && \
19 !(defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC)) 19 !(defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC))
20 #define MEDIA_MMX_INTRINSICS_AVAILABLE 20 #define MEDIA_MMX_INTRINSICS_AVAILABLE
21 #endif 21 #endif
22 22
23 namespace media { 23 namespace media {
24 24
25 // Type of YUV surface. 25 // Type of YUV surface.
26 enum YUVType { 26 enum YUVType {
27 YV16 = 0, // YV16 is half width and full height chroma channels. 27 YV16 = 0, // YV16 is half width and full height chroma channels.
28 YV12 = 1, // YV12 is half width and half height chroma channels. 28 YV12 = 1, // YV12 is half width and half height chroma channels.
29 YV12J = 2, // YV12J is the same as YV12, but in JPEG color range. 29 YV12J = 2, // YV12J is the same as YV12, but in JPEG color range.
30 YV12HD = 3, // YV12HD is the same as YV12, but in 'HD' Rec709 color space.
30 }; 31 };
31 32
32 // Get the appropriate value to bitshift by for vertical indices. 33 // Get the appropriate value to bitshift by for vertical indices.
33 MEDIA_EXPORT int GetVerticalShift(YUVType type); 34 MEDIA_EXPORT int GetVerticalShift(YUVType type);
34 35
35 // Get the appropriate lookup table for a given YUV format. 36 // Get the appropriate lookup table for a given YUV format.
36 MEDIA_EXPORT const int16 (&GetLookupTable(YUVType type))[1024][4]; 37 MEDIA_EXPORT const int16 (&GetLookupTable(YUVType type))[1024][4];
37 38
38 // Mirror means flip the image horizontally, as in looking in a mirror. 39 // Mirror means flip the image horizontally, as in looking in a mirror.
39 // Rotate happens after mirroring. 40 // Rotate happens after mirroring.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 uint8* vplane, 156 uint8* vplane,
156 int width, 157 int width,
157 int height); 158 int height);
158 159
159 // Empty SIMD register state after calling optimized scaler functions. 160 // Empty SIMD register state after calling optimized scaler functions.
160 MEDIA_EXPORT void EmptyRegisterState(); 161 MEDIA_EXPORT void EmptyRegisterState();
161 162
162 } // namespace media 163 } // namespace media
163 164
164 #endif // MEDIA_BASE_YUV_CONVERT_H_ 165 #endif // MEDIA_BASE_YUV_CONVERT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698