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

Unified Diff: media/base/yuv_convert.cc

Issue 263723004: Revert of Add correct support for videos with YUVJ420P color format, in the software conversion path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@yuvnopic
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/yuv_convert.h ('k') | media/base/yuv_convert_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/yuv_convert.cc
diff --git a/media/base/yuv_convert.cc b/media/base/yuv_convert.cc
index 5ad8f3079fbd552765e89ee4e0bfea37b713e2e0..2b27c1da4a9a717160e6640f84ac77c95d8bb2b4 100644
--- a/media/base/yuv_convert.cc
+++ b/media/base/yuv_convert.cc
@@ -25,7 +25,6 @@
#include "media/base/simd/convert_rgb_to_yuv.h"
#include "media/base/simd/convert_yuv_to_rgb.h"
#include "media/base/simd/filter_yuv.h"
-#include "media/base/simd/yuv_to_rgb_table.h"
#if defined(ARCH_CPU_X86_FAMILY)
#if defined(COMPILER_MSVC)
@@ -80,24 +79,21 @@
const uint8*,
const uint8*,
uint8*,
- ptrdiff_t,
- const int16[1024][4]);
+ ptrdiff_t);
typedef void (*ConvertYUVAToARGBRowProc)(const uint8*,
const uint8*,
const uint8*,
const uint8*,
uint8*,
- ptrdiff_t,
- const int16[1024][4]);
+ ptrdiff_t);
typedef void (*ScaleYUVToRGB32RowProc)(const uint8*,
const uint8*,
const uint8*,
uint8*,
ptrdiff_t,
- ptrdiff_t,
- const int16[1024][4]);
+ ptrdiff_t);
static FilterYUVRowsProc g_filter_yuv_rows_proc_ = NULL;
static ConvertYUVToRGB32RowProc g_convert_yuv_to_rgb32_row_proc_ = NULL;
@@ -115,31 +111,6 @@
#endif
typedef void (*EmptyRegisterStateProc)();
static EmptyRegisterStateProc g_empty_register_state_proc_ = NULL;
-
-// Get the appropriate value to bitshift by for vertical indices.
-int GetVerticalShift(YUVType type) {
- switch (type) {
- case YV16:
- return 0;
- case YV12:
- case YV12J:
- return 1;
- }
- NOTREACHED();
- return 0;
-}
-
-const int16 (&GetLookupTable(YUVType type))[1024][4] {
- switch (type) {
- case YV12:
- case YV16:
- return kCoefficientsRgbY;
- case YV12J:
- return kCoefficientsRgbY_JPEG;
- }
- NOTREACHED();
- return kCoefficientsRgbY;
-}
void InitializeCPUSpecificYUVConversions() {
CHECK(!g_filter_yuv_rows_proc_);
@@ -251,7 +222,7 @@
if (source_width > kFilterBufferSize || view_rotate)
filter = FILTER_NONE;
- unsigned int y_shift = GetVerticalShift(yuv_type);
+ unsigned int y_shift = yuv_type;
// Diagram showing origin and direction of source sampling.
// ->0 4<-
// 7 3
@@ -383,25 +354,14 @@
v_ptr = v_buf + (source_y >> y_shift) * uv_pitch;
}
if (source_dx == kFractionMax) { // Not scaled
- g_convert_yuv_to_rgb32_row_proc_(
- y_ptr, u_ptr, v_ptr, dest_pixel, width, kCoefficientsRgbY);
+ g_convert_yuv_to_rgb32_row_proc_(y_ptr, u_ptr, v_ptr, dest_pixel, width);
} else {
if (filter & FILTER_BILINEAR_H) {
- g_linear_scale_yuv_to_rgb32_row_proc_(y_ptr,
- u_ptr,
- v_ptr,
- dest_pixel,
- width,
- source_dx,
- kCoefficientsRgbY);
+ g_linear_scale_yuv_to_rgb32_row_proc_(
+ y_ptr, u_ptr, v_ptr, dest_pixel, width, source_dx);
} else {
- g_scale_yuv_to_rgb32_row_proc_(y_ptr,
- u_ptr,
- v_ptr,
- dest_pixel,
- width,
- source_dx,
- kCoefficientsRgbY);
+ g_scale_yuv_to_rgb32_row_proc_(
+ y_ptr, u_ptr, v_ptr, dest_pixel, width, source_dx);
}
}
}
@@ -545,8 +505,7 @@
rgb_buf,
dest_rect_width,
source_left,
- x_step,
- kCoefficientsRgbY);
+ x_step);
} else {
// If the frame is too large then we linear scale a single row.
LinearScaleYUVToRGB32RowWithRange_C(y0_ptr,
@@ -555,8 +514,7 @@
rgb_buf,
dest_rect_width,
source_left,
- x_step,
- kCoefficientsRgbY);
+ x_step);
}
// Advance vertically in the source and destination image.
« no previous file with comments | « media/base/yuv_convert.h ('k') | media/base/yuv_convert_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698