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

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: add enum to mojom Created 5 years, 11 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
« no previous file with comments | « media/base/video_frame.cc ('k') | media/base/yuv_convert.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 10
12 // Visual Studio 2010 does not support MMX intrinsics on x64. 11 // Visual Studio 2010 does not support MMX intrinsics on x64.
13 // Some win64 yuv_convert code paths use SSE+MMX yasm, so without rewriting 12 // 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 13 // them, we use yasm EmptyRegisterState_MMX in place of _mm_empty() or
15 // hide the versions implemented with heavy use of MMX intrinsics. 14 // hide the versions implemented with heavy use of MMX intrinsics.
16 // TODO(wolenetz): Use MMX intrinsics when compiling win64 with Visual 15 // TODO(wolenetz): Use MMX intrinsics when compiling win64 with Visual
17 // Studio 2012? http://crbug.com/173450 16 // Studio 2012? http://crbug.com/173450
18 #if defined(ARCH_CPU_X86_FAMILY) && \ 17 #if defined(ARCH_CPU_X86_FAMILY) && \
19 !(defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC)) 18 !(defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC))
20 #define MEDIA_MMX_INTRINSICS_AVAILABLE 19 #define MEDIA_MMX_INTRINSICS_AVAILABLE
21 #endif 20 #endif
22 21
23 namespace media { 22 namespace media {
24 23
25 // Type of YUV surface. 24 // Type of YUV surface.
26 enum YUVType { 25 enum YUVType {
27 YV16 = 0, // YV16 is half width and full height chroma channels. 26 YV16 = 0, // YV16 is half width and full height chroma channels.
28 YV12 = 1, // YV12 is half width and half height chroma channels. 27 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. 28 YV12J = 2, // YV12J is the same as YV12, but in JPEG color range.
29 YV12HD = 3, // YV12HD is the same as YV12, but in 'HD' Rec709 color space.
30 }; 30 };
31 31
32 // Get the appropriate value to bitshift by for vertical indices. 32 // Get the appropriate value to bitshift by for vertical indices.
33 MEDIA_EXPORT int GetVerticalShift(YUVType type); 33 MEDIA_EXPORT int GetVerticalShift(YUVType type);
34 34
35 // Get the appropriate lookup table for a given YUV format. 35 // Get the appropriate lookup table for a given YUV format.
36 MEDIA_EXPORT const int16 (&GetLookupTable(YUVType type))[1024][4]; 36 MEDIA_EXPORT const int16* GetLookupTable(YUVType type);
37 37
38 // Mirror means flip the image horizontally, as in looking in a mirror. 38 // Mirror means flip the image horizontally, as in looking in a mirror.
39 // Rotate happens after mirroring. 39 // Rotate happens after mirroring.
40 enum Rotate { 40 enum Rotate {
41 ROTATE_0, // Rotation off. 41 ROTATE_0, // Rotation off.
42 ROTATE_90, // Rotate clockwise. 42 ROTATE_90, // Rotate clockwise.
43 ROTATE_180, // Rotate upside down. 43 ROTATE_180, // Rotate upside down.
44 ROTATE_270, // Rotate counter clockwise. 44 ROTATE_270, // Rotate counter clockwise.
45 MIRROR_ROTATE_0, // Mirror horizontally. 45 MIRROR_ROTATE_0, // Mirror horizontally.
46 MIRROR_ROTATE_90, // Mirror then Rotate clockwise. 46 MIRROR_ROTATE_90, // Mirror then Rotate clockwise.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 uint8* vplane, 155 uint8* vplane,
156 int width, 156 int width,
157 int height); 157 int height);
158 158
159 // Empty SIMD register state after calling optimized scaler functions. 159 // Empty SIMD register state after calling optimized scaler functions.
160 MEDIA_EXPORT void EmptyRegisterState(); 160 MEDIA_EXPORT void EmptyRegisterState();
161 161
162 } // namespace media 162 } // namespace media
163 163
164 #endif // MEDIA_BASE_YUV_CONVERT_H_ 164 #endif // MEDIA_BASE_YUV_CONVERT_H_
OLDNEW
« no previous file with comments | « media/base/video_frame.cc ('k') | media/base/yuv_convert.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698