gfx/ycbcr/yuv_row.h
author Chris Double <chris.double@double.co.nz>
Tue, 06 Apr 2010 12:57:56 +1200
changeset 40463 67f4c546d40329f52d64b4290779008c670fbdfa
parent 40462 f9a11b9b2b9fd4d081708217fac56e29ec23e8db
child 40475 56850227b2946ec32197a7cca78d2ea54156ee0b
child 42211 eb83008784f18904e6e7b32f30b5bc487cfbd3eb
permissions -rw-r--r--
Bug 551378 - Implement 4:4:4 colorspace conversion in YCbCr layers code - r=roc

// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// yuv_row internal functions to handle YUV conversion and scaling to RGB.
// These functions are used from both yuv_convert.cc and yuv_scale.cc.

// TODO(fbarchard): Write function that can handle rotation and scaling.

#ifndef MEDIA_BASE_YUV_ROW_H_
#define MEDIA_BASE_YUV_ROW_H_

#include "chromium_types.h"

extern "C" {
// Can only do 1x.
// This is the second fastest of the scalers.
void FastConvertYUVToRGB32Row(const uint8* y_buf,
                              const uint8* u_buf,
                              const uint8* v_buf,
                              uint8* rgb_buf,
                              int width);

void FastConvertYUVToRGB32Row_C(const uint8* y_buf,
                                const uint8* u_buf,
                                const uint8* v_buf,
                                uint8* rgb_buf,
                                int width,
                                unsigned int x_shift);


}  // extern "C"

// x64 uses MMX2 (SSE) so emms is not required.
#if !defined(ARCH_CPU_X86_64) && !defined(ARCH_CPU_PPC)
#if defined(_MSC_VER)
#define EMMS() __asm emms
#else
#define EMMS() asm("emms")
#endif
#else
#define EMMS()
#endif

#endif  // MEDIA_BASE_YUV_ROW_H_