diff options
Diffstat (limited to 'thirdparties/common/include/libyuv/libyuv')
13 files changed, 281 insertions, 266 deletions
diff --git a/thirdparties/common/include/libyuv/libyuv/compare.h b/thirdparties/common/include/libyuv/libyuv/compare.h index 9dbb0c5..062343b 100755 --- a/thirdparties/common/include/libyuv/libyuv/compare.h +++ b/thirdparties/common/include/libyuv/libyuv/compare.h @@ -14,7 +14,8 @@ #include "libyuv/basic_types.h" #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif diff --git a/thirdparties/common/include/libyuv/libyuv/convert.h b/thirdparties/common/include/libyuv/libyuv/convert.h index 96843f9..0174b79 100755 --- a/thirdparties/common/include/libyuv/libyuv/convert.h +++ b/thirdparties/common/include/libyuv/libyuv/convert.h @@ -18,7 +18,8 @@ #include "libyuv/rotate.h" #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif diff --git a/thirdparties/common/include/libyuv/libyuv/convert_argb.h b/thirdparties/common/include/libyuv/libyuv/convert_argb.h index 47ca947..2edc856 100755 --- a/thirdparties/common/include/libyuv/libyuv/convert_argb.h +++ b/thirdparties/common/include/libyuv/libyuv/convert_argb.h @@ -24,7 +24,8 @@ // TODO(fbarchard): Some of these functions lack parameter setting. #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif diff --git a/thirdparties/common/include/libyuv/libyuv/convert_from.h b/thirdparties/common/include/libyuv/libyuv/convert_from.h index c6eb894..8c72b39 100755 --- a/thirdparties/common/include/libyuv/libyuv/convert_from.h +++ b/thirdparties/common/include/libyuv/libyuv/convert_from.h @@ -15,7 +15,8 @@ #include "libyuv/rotate.h" #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif diff --git a/thirdparties/common/include/libyuv/libyuv/cpu_id.h b/thirdparties/common/include/libyuv/libyuv/cpu_id.h index e964383..99bd197 100755 --- a/thirdparties/common/include/libyuv/libyuv/cpu_id.h +++ b/thirdparties/common/include/libyuv/libyuv/cpu_id.h @@ -12,7 +12,8 @@ #define INCLUDE_LIBYUV_CPU_ID_H_ #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif @@ -36,10 +37,11 @@ static const int kCpuHasAVX = 0x200; // Detect CPU has SSE2 etc. // Test_flag parameter should be one of kCpuHas constants above. // returns non-zero if instruction set is detected -static __inline int TestCpuFlag(int test_flag) { - extern int cpu_info_; - extern int InitCpuFlags(); - return (cpu_info_ ? cpu_info_ : InitCpuFlags()) & test_flag; +static __inline int TestCpuFlag(int test_flag) +{ + extern int cpu_info_; + extern int InitCpuFlags(); + return (cpu_info_ ? cpu_info_ : InitCpuFlags()) & test_flag; } // For testing, allow CPU flags to be disabled. diff --git a/thirdparties/common/include/libyuv/libyuv/format_conversion.h b/thirdparties/common/include/libyuv/libyuv/format_conversion.h index b91cdd7..d37d5c5 100755 --- a/thirdparties/common/include/libyuv/libyuv/format_conversion.h +++ b/thirdparties/common/include/libyuv/libyuv/format_conversion.h @@ -14,7 +14,8 @@ #include "libyuv/basic_types.h" #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif diff --git a/thirdparties/common/include/libyuv/libyuv/mjpeg_decoder.h b/thirdparties/common/include/libyuv/libyuv/mjpeg_decoder.h index c8576e9..a68fad4 100755 --- a/thirdparties/common/include/libyuv/libyuv/mjpeg_decoder.h +++ b/thirdparties/common/include/libyuv/libyuv/mjpeg_decoder.h @@ -17,17 +17,18 @@ struct jpeg_common_struct; struct jpeg_decompress_struct; struct jpeg_source_mgr; -namespace libyuv { +namespace libyuv +{ static const uint32 kUnknownDataSize = 0xFFFFFFFF; enum JpegSubsamplingType { - kJpegYuv420, - kJpegYuv422, - kJpegYuv411, - kJpegYuv444, - kJpegYuv400, - kJpegUnknown + kJpegYuv420, + kJpegYuv422, + kJpegYuv411, + kJpegYuv444, + kJpegYuv400, + kJpegUnknown }; struct SetJmpErrorMgr; @@ -39,146 +40,147 @@ struct SetJmpErrorMgr; // MJPEG frames. // // See http://tools.ietf.org/html/rfc2435 -class MJpegDecoder { - public: - typedef void (*CallbackFunction)(void* opaque, - const uint8* const* data, - const int* strides, - int rows); - - static const int kColorSpaceUnknown; - static const int kColorSpaceGrayscale; - static const int kColorSpaceRgb; - static const int kColorSpaceYCbCr; - static const int kColorSpaceCMYK; - static const int kColorSpaceYCCK; - - MJpegDecoder(); - ~MJpegDecoder(); - - // Loads a new frame, reads its headers, and determines the uncompressed - // image format. Returns true if image looks valid and format is supported. - // If return value is true, then the values for all the following getters - // are populated. - // src_len is the size of the compressed mjpeg frame in bytes. - bool LoadFrame(const uint8* src, size_t src_len); +class MJpegDecoder +{ +public: + typedef void (*CallbackFunction)(void* opaque, + const uint8* const* data, + const int* strides, + int rows); + + static const int kColorSpaceUnknown; + static const int kColorSpaceGrayscale; + static const int kColorSpaceRgb; + static const int kColorSpaceYCbCr; + static const int kColorSpaceCMYK; + static const int kColorSpaceYCCK; + + MJpegDecoder(); + ~MJpegDecoder(); + + // Loads a new frame, reads its headers, and determines the uncompressed + // image format. Returns true if image looks valid and format is supported. + // If return value is true, then the values for all the following getters + // are populated. + // src_len is the size of the compressed mjpeg frame in bytes. + bool LoadFrame(const uint8* src, size_t src_len); - // Returns width of the last loaded frame in pixels. - int GetWidth(); + // Returns width of the last loaded frame in pixels. + int GetWidth(); + + // Returns height of the last loaded frame in pixels. + int GetHeight(); - // Returns height of the last loaded frame in pixels. - int GetHeight(); + // Returns format of the last loaded frame. The return value is one of the + // kColorSpace* constants. + int GetColorSpace(); - // Returns format of the last loaded frame. The return value is one of the - // kColorSpace* constants. - int GetColorSpace(); + // Number of color components in the color space. + int GetNumComponents(); + + // Sample factors of the n-th component. + int GetHorizSampFactor(int component); + + int GetVertSampFactor(int component); + + int GetHorizSubSampFactor(int component); + + int GetVertSubSampFactor(int component); + + // Public for testability + int GetImageScanlinesPerImcuRow(); + + // Public for testability + int GetComponentScanlinesPerImcuRow(int component); + + // Width of a component in bytes. + int GetComponentWidth(int component); + + // Height of a component. + int GetComponentHeight(int component); + + // Width of a component in bytes with padding for DCTSIZE. Public for testing. + int GetComponentStride(int component); + + // Size of a component in bytes. + int GetComponentSize(int component); + + // Call this after LoadFrame() if you decide you don't want to decode it + // after all. + bool UnloadFrame(); + + // Decodes the entire image into a one-buffer-per-color-component format. + // dst_width must match exactly. dst_height must be <= to image height; if + // less, the image is cropped. "planes" must have size equal to at least + // GetNumComponents() and they must point to non-overlapping buffers of size + // at least GetComponentSize(i). The pointers in planes are incremented + // to point to after the end of the written data. + // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded. + bool DecodeToBuffers(uint8** planes, int dst_width, int dst_height); + + // Decodes the entire image and passes the data via repeated calls to a + // callback function. Each call will get the data for a whole number of + // image scanlines. + // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded. + bool DecodeToCallback(CallbackFunction fn, void* opaque, + int dst_width, int dst_height); + + // The helper function which recognizes the jpeg sub-sampling type. + static JpegSubsamplingType JpegSubsamplingTypeHelper( + int* subsample_x, int* subsample_y, int number_of_components); + +private: + struct Buffer { + const uint8* data; + int len; + }; + + struct BufferVector { + Buffer* buffers; + int len; + int pos; + }; + + // Methods that are passed to jpeglib. + static int fill_input_buffer(jpeg_decompress_struct* cinfo); + static void init_source(jpeg_decompress_struct* cinfo); + static void skip_input_data(jpeg_decompress_struct* cinfo, + long num_bytes); // NOLINT + static void term_source(jpeg_decompress_struct* cinfo); - // Number of color components in the color space. - int GetNumComponents(); - - // Sample factors of the n-th component. - int GetHorizSampFactor(int component); - - int GetVertSampFactor(int component); - - int GetHorizSubSampFactor(int component); - - int GetVertSubSampFactor(int component); - - // Public for testability - int GetImageScanlinesPerImcuRow(); - - // Public for testability - int GetComponentScanlinesPerImcuRow(int component); - - // Width of a component in bytes. - int GetComponentWidth(int component); - - // Height of a component. - int GetComponentHeight(int component); - - // Width of a component in bytes with padding for DCTSIZE. Public for testing. - int GetComponentStride(int component); - - // Size of a component in bytes. - int GetComponentSize(int component); - - // Call this after LoadFrame() if you decide you don't want to decode it - // after all. - bool UnloadFrame(); - - // Decodes the entire image into a one-buffer-per-color-component format. - // dst_width must match exactly. dst_height must be <= to image height; if - // less, the image is cropped. "planes" must have size equal to at least - // GetNumComponents() and they must point to non-overlapping buffers of size - // at least GetComponentSize(i). The pointers in planes are incremented - // to point to after the end of the written data. - // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded. - bool DecodeToBuffers(uint8** planes, int dst_width, int dst_height); - - // Decodes the entire image and passes the data via repeated calls to a - // callback function. Each call will get the data for a whole number of - // image scanlines. - // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded. - bool DecodeToCallback(CallbackFunction fn, void* opaque, - int dst_width, int dst_height); - - // The helper function which recognizes the jpeg sub-sampling type. - static JpegSubsamplingType JpegSubsamplingTypeHelper( - int* subsample_x, int* subsample_y, int number_of_components); - - private: - struct Buffer { - const uint8* data; - int len; - }; - - struct BufferVector { - Buffer* buffers; - int len; - int pos; - }; - - // Methods that are passed to jpeglib. - static int fill_input_buffer(jpeg_decompress_struct* cinfo); - static void init_source(jpeg_decompress_struct* cinfo); - static void skip_input_data(jpeg_decompress_struct* cinfo, - long num_bytes); // NOLINT - static void term_source(jpeg_decompress_struct* cinfo); + static void ErrorHandler(jpeg_common_struct* cinfo); + + void AllocOutputBuffers(int num_outbufs); + void DestroyOutputBuffers(); - static void ErrorHandler(jpeg_common_struct* cinfo); - - void AllocOutputBuffers(int num_outbufs); - void DestroyOutputBuffers(); + bool StartDecode(); + bool FinishDecode(); - bool StartDecode(); - bool FinishDecode(); + void SetScanlinePointers(uint8** data); + bool DecodeImcuRow(); - void SetScanlinePointers(uint8** data); - bool DecodeImcuRow(); + int GetComponentScanlinePadding(int component); - int GetComponentScanlinePadding(int component); + // A buffer holding the input data for a frame. + Buffer buf_; + BufferVector buf_vec_; - // A buffer holding the input data for a frame. - Buffer buf_; - BufferVector buf_vec_; + jpeg_decompress_struct* decompress_struct_; + jpeg_source_mgr* source_mgr_; + SetJmpErrorMgr* error_mgr_; - jpeg_decompress_struct* decompress_struct_; - jpeg_source_mgr* source_mgr_; - SetJmpErrorMgr* error_mgr_; + // true iff at least one component has scanline padding. (i.e., + // GetComponentScanlinePadding() != 0.) + bool has_scanline_padding_; - // true iff at least one component has scanline padding. (i.e., - // GetComponentScanlinePadding() != 0.) - bool has_scanline_padding_; - - // Temporaries used to point to scanline outputs. - int num_outbufs_; // Outermost size of all arrays below. - uint8*** scanlines_; - int* scanlines_sizes_; - // Temporary buffer used for decoding when we can't decode directly to the - // output buffers. Large enough for just one iMCU row. - uint8** databuf_; - int* databuf_strides_; + // Temporaries used to point to scanline outputs. + int num_outbufs_; // Outermost size of all arrays below. + uint8*** scanlines_; + int* scanlines_sizes_; + // Temporary buffer used for decoding when we can't decode directly to the + // output buffers. Large enough for just one iMCU row. + uint8** databuf_; + int* databuf_strides_; }; } // namespace libyuv diff --git a/thirdparties/common/include/libyuv/libyuv/planar_functions.h b/thirdparties/common/include/libyuv/libyuv/planar_functions.h index d411966..0cb322b 100755 --- a/thirdparties/common/include/libyuv/libyuv/planar_functions.h +++ b/thirdparties/common/include/libyuv/libyuv/planar_functions.h @@ -18,7 +18,8 @@ #include "libyuv/convert_argb.h" #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif diff --git a/thirdparties/common/include/libyuv/libyuv/rotate.h b/thirdparties/common/include/libyuv/libyuv/rotate.h index 8766ec3..6ec46f6 100755 --- a/thirdparties/common/include/libyuv/libyuv/rotate.h +++ b/thirdparties/common/include/libyuv/libyuv/rotate.h @@ -14,21 +14,22 @@ #include "libyuv/basic_types.h" #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif // Supported rotation. enum RotationMode { - kRotate0 = 0, // No rotation. - kRotate90 = 90, // Rotate 90 degrees clockwise. - kRotate180 = 180, // Rotate 180 degrees. - kRotate270 = 270, // Rotate 270 degrees clockwise. - - // Deprecated. - kRotateNone = 0, - kRotateClockwise = 90, - kRotateCounterClockwise = 270, + kRotate0 = 0, // No rotation. + kRotate90 = 90, // Rotate 90 degrees clockwise. + kRotate180 = 180, // Rotate 180 degrees. + kRotate270 = 270, // Rotate 270 degrees clockwise. + + // Deprecated. + kRotateNone = 0, + kRotateClockwise = 90, + kRotateCounterClockwise = 270, }; // Rotate I420 frame diff --git a/thirdparties/common/include/libyuv/libyuv/rotate_argb.h b/thirdparties/common/include/libyuv/libyuv/rotate_argb.h index 54fbc69..0bbf5db 100755 --- a/thirdparties/common/include/libyuv/libyuv/rotate_argb.h +++ b/thirdparties/common/include/libyuv/libyuv/rotate_argb.h @@ -15,7 +15,8 @@ #include "libyuv/rotate.h" // For RotationMode. #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif diff --git a/thirdparties/common/include/libyuv/libyuv/scale.h b/thirdparties/common/include/libyuv/libyuv/scale.h index e7e7c38..be073ae 100755 --- a/thirdparties/common/include/libyuv/libyuv/scale.h +++ b/thirdparties/common/include/libyuv/libyuv/scale.h @@ -14,15 +14,16 @@ #include "libyuv/basic_types.h" #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif // Supported filtering enum FilterMode { - kFilterNone = 0, // Point sample; Fastest - kFilterBilinear = 1, // Faster than box, but lower quality scaling down. - kFilterBox = 2 // Highest quality + kFilterNone = 0, // Point sample; Fastest + kFilterBilinear = 1, // Faster than box, but lower quality scaling down. + kFilterBox = 2 // Highest quality }; // Scale a YUV plane. diff --git a/thirdparties/common/include/libyuv/libyuv/scale_argb.h b/thirdparties/common/include/libyuv/libyuv/scale_argb.h index cc11c4e..dea237c 100755 --- a/thirdparties/common/include/libyuv/libyuv/scale_argb.h +++ b/thirdparties/common/include/libyuv/libyuv/scale_argb.h @@ -15,7 +15,8 @@ #include "libyuv/scale.h" // For FilterMode #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif diff --git a/thirdparties/common/include/libyuv/libyuv/video_common.h b/thirdparties/common/include/libyuv/libyuv/video_common.h index 49b7532..b64e078 100755 --- a/thirdparties/common/include/libyuv/libyuv/video_common.h +++ b/thirdparties/common/include/libyuv/libyuv/video_common.h @@ -16,7 +16,8 @@ #include "libyuv/basic_types.h" #ifdef __cplusplus -namespace libyuv { +namespace libyuv +{ extern "C" { #endif @@ -38,111 +39,111 @@ extern "C" { // http://msdn.microsoft.com/library/windows/desktop/dd206750.aspx#nv12 enum FourCC { - // Canonical fourcc codes used in our code. - FOURCC_I420 = FOURCC('I', '4', '2', '0'), - FOURCC_I422 = FOURCC('I', '4', '2', '2'), - FOURCC_I444 = FOURCC('I', '4', '4', '4'), - FOURCC_I411 = FOURCC('I', '4', '1', '1'), - FOURCC_I400 = FOURCC('I', '4', '0', '0'), - FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'), - FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'), - FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'), - FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'), - FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'), - FOURCC_M420 = FOURCC('M', '4', '2', '0'), - FOURCC_Q420 = FOURCC('Q', '4', '2', '0'), - FOURCC_V210 = FOURCC('V', '2', '1', '0'), - FOURCC_24BG = FOURCC('2', '4', 'B', 'G'), - FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'), - FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'), - FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'), - FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // bgr565. - FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // abgr1555. - FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444. - FOURCC_RAW = FOURCC('r', 'a', 'w', ' '), - FOURCC_NV21 = FOURCC('N', 'V', '2', '1'), - FOURCC_NV12 = FOURCC('N', 'V', '1', '2'), - FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'), - FOURCC_H264 = FOURCC('H', '2', '6', '4'), - // Next four are Bayer RGB formats. The four characters define the order of - // the colours in each 2x2 pixel grid, going left-to-right and top-to-bottom. - FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'), - FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'), - FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'), - FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'), - - // Aliases for canonical fourcc codes, replaced with their canonical - // equivalents by CanonicalFourCC(). - FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420. - FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Alias for I420. - FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422. - FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444. - FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2. - FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac. - FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY. - FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY. - FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG. - FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac. - FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR. - FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW. - FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG. - - // Match any fourcc. - FOURCC_ANY = 0xFFFFFFFF, + // Canonical fourcc codes used in our code. + FOURCC_I420 = FOURCC('I', '4', '2', '0'), + FOURCC_I422 = FOURCC('I', '4', '2', '2'), + FOURCC_I444 = FOURCC('I', '4', '4', '4'), + FOURCC_I411 = FOURCC('I', '4', '1', '1'), + FOURCC_I400 = FOURCC('I', '4', '0', '0'), + FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'), + FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'), + FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'), + FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'), + FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'), + FOURCC_M420 = FOURCC('M', '4', '2', '0'), + FOURCC_Q420 = FOURCC('Q', '4', '2', '0'), + FOURCC_V210 = FOURCC('V', '2', '1', '0'), + FOURCC_24BG = FOURCC('2', '4', 'B', 'G'), + FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'), + FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'), + FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'), + FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // bgr565. + FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // abgr1555. + FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444. + FOURCC_RAW = FOURCC('r', 'a', 'w', ' '), + FOURCC_NV21 = FOURCC('N', 'V', '2', '1'), + FOURCC_NV12 = FOURCC('N', 'V', '1', '2'), + FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'), + FOURCC_H264 = FOURCC('H', '2', '6', '4'), + // Next four are Bayer RGB formats. The four characters define the order of + // the colours in each 2x2 pixel grid, going left-to-right and top-to-bottom. + FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'), + FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'), + FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'), + FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'), + + // Aliases for canonical fourcc codes, replaced with their canonical + // equivalents by CanonicalFourCC(). + FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420. + FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Alias for I420. + FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422. + FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444. + FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2. + FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac. + FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY. + FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY. + FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG. + FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac. + FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR. + FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW. + FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG. + + // Match any fourcc. + FOURCC_ANY = 0xFFFFFFFF, }; enum FourCCBpp { - // Canonical fourcc codes used in our code. - FOURCC_BPP_I420 = 12, - FOURCC_BPP_I422 = 16, - FOURCC_BPP_I444 = 24, - FOURCC_BPP_I411 = 12, - FOURCC_BPP_I400 = 8, - FOURCC_BPP_YV12 = 12, - FOURCC_BPP_YV16 = 16, - FOURCC_BPP_YV24 = 24, - FOURCC_BPP_YUY2 = 16, - FOURCC_BPP_UYVY = 16, - FOURCC_BPP_M420 = 12, - FOURCC_BPP_Q420 = 12, - FOURCC_BPP_V210 = 22, // 22.5 actually - FOURCC_BPP_24BG = 24, - FOURCC_BPP_ABGR = 32, - FOURCC_BPP_BGRA = 32, - FOURCC_BPP_ARGB = 32, - FOURCC_BPP_RGBP = 16, - FOURCC_BPP_RGBO = 16, - FOURCC_BPP_R444 = 16, - FOURCC_BPP_RAW = 24, - FOURCC_BPP_NV21 = 12, - FOURCC_BPP_NV12 = 12, - FOURCC_BPP_MJPG = 0, // 0 means unknown. - FOURCC_BPP_H264 = 0, - // Next four are Bayer RGB formats. The four characters define the order of - // the colours in each 2x2 pixel grid, going left-to-right and top-to-bottom. - FOURCC_BPP_RGGB = 8, - FOURCC_BPP_BGGR = 8, - FOURCC_BPP_GRBG = 8, - FOURCC_BPP_GBRG = 8, - - // Aliases for canonical fourcc codes, replaced with their canonical - // equivalents by CanonicalFourCC(). - FOURCC_BPP_IYUV = 12, - FOURCC_BPP_YU12 = 12, - FOURCC_BPP_YU16 = 16, - FOURCC_BPP_YU24 = 24, - FOURCC_BPP_YUYV = 16, - FOURCC_BPP_YUVS = 16, - FOURCC_BPP_HDYC = 16, - FOURCC_BPP_2VUY = 16, - FOURCC_BPP_JPEG = 1, - FOURCC_BPP_DMB1 = 1, - FOURCC_BPP_BA81 = 8, - FOURCC_BPP_RGB3 = 24, - FOURCC_BPP_BGR3 = 24, - - // Match any fourcc. - FOURCC_BPP_ANY = 0, // 0 means unknown. + // Canonical fourcc codes used in our code. + FOURCC_BPP_I420 = 12, + FOURCC_BPP_I422 = 16, + FOURCC_BPP_I444 = 24, + FOURCC_BPP_I411 = 12, + FOURCC_BPP_I400 = 8, + FOURCC_BPP_YV12 = 12, + FOURCC_BPP_YV16 = 16, + FOURCC_BPP_YV24 = 24, + FOURCC_BPP_YUY2 = 16, + FOURCC_BPP_UYVY = 16, + FOURCC_BPP_M420 = 12, + FOURCC_BPP_Q420 = 12, + FOURCC_BPP_V210 = 22, // 22.5 actually + FOURCC_BPP_24BG = 24, + FOURCC_BPP_ABGR = 32, + FOURCC_BPP_BGRA = 32, + FOURCC_BPP_ARGB = 32, + FOURCC_BPP_RGBP = 16, + FOURCC_BPP_RGBO = 16, + FOURCC_BPP_R444 = 16, + FOURCC_BPP_RAW = 24, + FOURCC_BPP_NV21 = 12, + FOURCC_BPP_NV12 = 12, + FOURCC_BPP_MJPG = 0, // 0 means unknown. + FOURCC_BPP_H264 = 0, + // Next four are Bayer RGB formats. The four characters define the order of + // the colours in each 2x2 pixel grid, going left-to-right and top-to-bottom. + FOURCC_BPP_RGGB = 8, + FOURCC_BPP_BGGR = 8, + FOURCC_BPP_GRBG = 8, + FOURCC_BPP_GBRG = 8, + + // Aliases for canonical fourcc codes, replaced with their canonical + // equivalents by CanonicalFourCC(). + FOURCC_BPP_IYUV = 12, + FOURCC_BPP_YU12 = 12, + FOURCC_BPP_YU16 = 16, + FOURCC_BPP_YU24 = 24, + FOURCC_BPP_YUYV = 16, + FOURCC_BPP_YUVS = 16, + FOURCC_BPP_HDYC = 16, + FOURCC_BPP_2VUY = 16, + FOURCC_BPP_JPEG = 1, + FOURCC_BPP_DMB1 = 1, + FOURCC_BPP_BA81 = 8, + FOURCC_BPP_RGB3 = 24, + FOURCC_BPP_BGR3 = 24, + + // Match any fourcc. + FOURCC_BPP_ANY = 0, // 0 means unknown. }; // Converts fourcc aliases into canonical ones. |