Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / media / base / simd / convert_yuv_to_rgb_x86.cc
index d1d6e16..969890d 100644 (file)
@@ -9,6 +9,7 @@
 #endif
 
 #include "media/base/simd/convert_yuv_to_rgb.h"
+#include "media/base/simd/yuv_to_rgb_table.h"
 #include "media/base/yuv_convert.h"
 
 namespace media {
@@ -23,7 +24,7 @@ void ConvertYUVToRGB32_MMX(const uint8* yplane,
                            int uvstride,
                            int rgbstride,
                            YUVType yuv_type) {
-  unsigned int y_shift = yuv_type;
+  unsigned int y_shift = GetVerticalShift(yuv_type);
   for (int y = 0; y < height; ++y) {
     uint8* rgb_row = rgbframe + y * rgbstride;
     const uint8* y_ptr = yplane + y * ystride;
@@ -34,7 +35,8 @@ void ConvertYUVToRGB32_MMX(const uint8* yplane,
                              u_ptr,
                              v_ptr,
                              rgb_row,
-                             width);
+                             width,
+                             GetLookupTable(yuv_type));
   }
 
   EmptyRegisterState();
@@ -52,7 +54,7 @@ void ConvertYUVAToARGB_MMX(const uint8* yplane,
                            int astride,
                            int rgbstride,
                            YUVType yuv_type) {
-  unsigned int y_shift = yuv_type;
+  unsigned int y_shift = GetVerticalShift(yuv_type);
   for (int y = 0; y < height; ++y) {
     uint8* rgb_row = rgbframe + y * rgbstride;
     const uint8* y_ptr = yplane + y * ystride;
@@ -65,7 +67,8 @@ void ConvertYUVAToARGB_MMX(const uint8* yplane,
                              v_ptr,
                              a_ptr,
                              rgb_row,
-                             width);
+                             width,
+                             GetLookupTable(yuv_type));
   }
 
   EmptyRegisterState();
@@ -81,7 +84,7 @@ void ConvertYUVToRGB32_SSE(const uint8* yplane,
                            int uvstride,
                            int rgbstride,
                            YUVType yuv_type) {
-  unsigned int y_shift = yuv_type;
+  unsigned int y_shift = GetVerticalShift(yuv_type);
   for (int y = 0; y < height; ++y) {
     uint8* rgb_row = rgbframe + y * rgbstride;
     const uint8* y_ptr = yplane + y * ystride;
@@ -92,7 +95,8 @@ void ConvertYUVToRGB32_SSE(const uint8* yplane,
                              u_ptr,
                              v_ptr,
                              rgb_row,
-                             width);
+                             width,
+                             GetLookupTable(yuv_type));
   }
 
   EmptyRegisterState();