diff options
author | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-18 22:17:38 +0000 |
---|---|---|
committer | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-18 22:17:38 +0000 |
commit | be5a116b8a3465308174ccc4ab63351413d6dfe7 (patch) | |
tree | 2ba1202e427db0fda4d70037a5afda93e7f576fe /media/base/yuv_row.h | |
parent | 3090eeb5afd49e828739b492eb400d8fcf734784 (diff) | |
download | chromium_src-be5a116b8a3465308174ccc4ab63351413d6dfe7.zip chromium_src-be5a116b8a3465308174ccc4ab63351413d6dfe7.tar.gz chromium_src-be5a116b8a3465308174ccc4ab63351413d6dfe7.tar.bz2 |
YUV with clipping.
All functions do 2 pixels at a time.
90 and 270 rotations implemented.
YV16 refactored. YV12 code accepts a YuvType that allows the same code to support YV16 as well.
Special case for half size removed.
Special case for doubling added. 3.62 ms versus 8.62 for general purpose code.
Review URL: http://codereview.chromium.org/113407
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16334 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/yuv_row.h')
-rw-r--r-- | media/base/yuv_row.h | 62 |
1 files changed, 42 insertions, 20 deletions
diff --git a/media/base/yuv_row.h b/media/base/yuv_row.h index 11fc71f..b8651f5 100644 --- a/media/base/yuv_row.h +++ b/media/base/yuv_row.h @@ -12,33 +12,55 @@ namespace media { -void ConvertYV12ToRGB32Row(const uint8* y_buf, - const uint8* u_buf, - const uint8* v_buf, - uint8* rgb_buf, - int width); +// 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 HalfYV12ToRGB32Row(const uint8* y_buf, - const uint8* u_buf, - const uint8* v_buf, - uint8* rgb_buf, - int width); +// Can do 1x, half size or any scale down by an integer amount. +// Step can be negative (mirroring, rotate 180). +// This is the third fastest of the scalers. +void ConvertYUVToRGB32Row(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + uint8* rgb_buf, + int width, + int step); + +// Rotate is like Convert, but applies different step to Y versus U and V. +// This allows rotation by 90 or 270, by stepping by stride. +// This is the forth fastest of the scalers. +void RotateConvertYUVToRGB32Row(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + uint8* rgb_buf, + int width, + int ystep, + int uvstep); -void ScaleYV12ToRGB32Row(const uint8* y_buf, +// Doubler does 4 pixels at a time. Each pixel is replicated. +// This is the fastest of the scalers. +void DoubleYUVToRGB32Row(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, uint8* rgb_buf, - int width, - int scaled_dx); + int width); -void Half2Row(const uint8* in_row0, - const uint8* in_row1, - uint8* out_row, - int out_width); - -// MMX for Windows -// C++ code provided as a fall back. +// Handles arbitrary scaling up or down. +// Mirroring is supported, but not 90 or 270 degree rotation. +// Chroma is under sampled every 2 pixels for performance. +// This is the slowest of the scalers. +void ScaleYUVToRGB32Row(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + uint8* rgb_buf, + int width, + int scaled_dx); +// MMX for Windows; C++ for other platforms. #ifndef USE_MMX #if defined(_MSC_VER) #define USE_MMX 1 |