History

post-proc: deblock filter optimization

1. Algorithm modification: Instead of having same filter threshold for a whole frame, now we allow the thresholds to be adjusted for each macroblock. In current implementation, to avoid excessive blur on background as reported in issue480(http://code.google.com/p/webm/issues/detail?id=480), we reduce the thresholds for skipped macroblocks. 2. SSE2 optimization: As started in issue479(http://code.google.com/p/webm/issues/detail?id=479), the filter calculation was adjusted for better performance. The c code was also modified accordingly. This made the deblock filter 2x faster, and the decoder was 1.2x faster overall. Next, the demacroblock filter will be modified similarly.

Yunqing Wang committed 14 years ago

Commit 4c53bac1 parent 9704cde8 files · +293 −564Browse files

Showing the changes to test (1 of 8 files). Show all

Unified · Split

test/pp_filter_test.cc+11−14
@@ -19,9 +19,9 @@ typedef void (*post_proc_func_t)(unsigned char *src_ptr, · 18 unmodified lines
19 unsigned char *dst_ptr,19 unsigned char *dst_ptr,
20 int src_pixels_per_line,20 int src_pixels_per_line,
21 int dst_pixels_per_line,21 int dst_pixels_per_line,
22 int rows,
23 int cols,22 int cols,
24 int flimit);23 unsigned char *flimit,
24 int size);
25 25
26namespace {26namespace {
27 27
@@ -29,7 +29,7 @@ class Vp8PostProcessingFilterTest · 1 unmodified line
29 : public ::testing::TestWithParam<post_proc_func_t> {};29 : public ::testing::TestWithParam<post_proc_func_t> {};
30 30
31// Test routine for the VP8 post-processing function31// Test routine for the VP8 post-processing function
32// vp8_post_proc_down_and_across_c.32// vp8_post_proc_down_and_across_mb_row_c.
33 33
34TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) {34TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) {
35 // Size of the underlying data block that will be filtered.35 // Size of the underlying data block that will be filtered.
@@ -56,6 +56,8 @@ TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) { · 20 unmodified lines
56 // Pointers to top-left pixel of block in the input and output images.56 // Pointers to top-left pixel of block in the input and output images.
57 uint8_t *const src_image_ptr = src_image + (input_stride << 1);57 uint8_t *const src_image_ptr = src_image + (input_stride << 1);
58 uint8_t *const dst_image_ptr = dst_image + 8;58 uint8_t *const dst_image_ptr = dst_image + 8;
59 uint8_t *const flimits = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_width));
60 (void)vpx_memset(flimits, 255, block_width);
59 61
60 // Initialize pixels in the input:62 // Initialize pixels in the input:
61 // block pixels to value 1,63 // block pixels to value 1,
@@ -73,14 +75,13 @@ TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) { · 11 unmodified lines
73 (void)vpx_memset(dst_image, 99, output_size);75 (void)vpx_memset(dst_image, 99, output_size);
74 76
75 GetParam()(src_image_ptr, dst_image_ptr, input_stride,77 GetParam()(src_image_ptr, dst_image_ptr, input_stride,
76 output_stride, block_height, block_width,78 output_stride, block_width, flimits, 16);
77 255);
78 79
79 static const uint8_t expected_data[block_height] = {80 static const uint8_t expected_data[block_height] = {
80 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 381 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4
81 };82 };
82 83
83 pixel_ptr = dst_image;84 pixel_ptr = dst_image_ptr;
84 for (int i = 0; i < block_height; ++i) {85 for (int i = 0; i < block_height; ++i) {
85 for (int j = 0; j < block_width; ++j) {86 for (int j = 0; j < block_width; ++j) {
86 EXPECT_EQ(expected_data[i], pixel_ptr[j])87 EXPECT_EQ(expected_data[i], pixel_ptr[j])
@@ -91,19 +92,15 @@ TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) { · 4 unmodified lines
91 92
92 vpx_free(src_image);93 vpx_free(src_image);
93 vpx_free(dst_image);94 vpx_free(dst_image);
95 vpx_free(flimits);
94};96};
95 97
96INSTANTIATE_TEST_CASE_P(C, Vp8PostProcessingFilterTest,98INSTANTIATE_TEST_CASE_P(C, Vp8PostProcessingFilterTest,
97 ::testing::Values(vp8_post_proc_down_and_across_c));99 ::testing::Values(vp8_post_proc_down_and_across_mb_row_c));
98
99#if HAVE_MMX
100INSTANTIATE_TEST_CASE_P(MMX, Vp8PostProcessingFilterTest,
101 ::testing::Values(vp8_post_proc_down_and_across_mmx));
102#endif
103 100
104#if HAVE_SSE2101#if HAVE_SSE2
105INSTANTIATE_TEST_CASE_P(SSE2, Vp8PostProcessingFilterTest,102INSTANTIATE_TEST_CASE_P(SSE2, Vp8PostProcessingFilterTest,
106 ::testing::Values(vp8_post_proc_down_and_across_xmm));103 ::testing::Values(vp8_post_proc_down_and_across_mb_row_sse2));
107#endif104#endif
108 105
109} // namespace106} // namespace

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t