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
1919 unsigned char *dst_ptr,
2020 int src_pixels_per_line,
2121 int dst_pixels_per_line,
22− int rows,
2322 int cols,
24− int flimit);
23+ unsigned char *flimit,
24+ int size);
2525
2626 namespace {
2727
@@ -29,7 +29,7 @@ class Vp8PostProcessingFilterTest · 1 unmodified line
2929 : public ::testing::TestWithParam<post_proc_func_t> {};
3030
3131 // 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.
3333
3434 TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) {
3535 // Size of the underlying data block that will be filtered.
@@ -56,6 +56,8 @@ TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) { · 20 unmodified lines
5656 // Pointers to top-left pixel of block in the input and output images.
5757 uint8_t *const src_image_ptr = src_image + (input_stride << 1);
5858 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);
5961
6062 // Initialize pixels in the input:
6163 // block pixels to value 1,
@@ -73,14 +75,13 @@ TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) { · 11 unmodified lines
7375 (void)vpx_memset(dst_image, 99, output_size);
7476
7577 GetParam()(src_image_ptr, dst_image_ptr, input_stride,
76− output_stride, block_height, block_width,
77− 255);
78+ output_stride, block_width, flimits, 16);
7879
7980 static const uint8_t expected_data[block_height] = {
80− 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3
81+ 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4
8182 };
8283
83− pixel_ptr = dst_image;
84+ pixel_ptr = dst_image_ptr;
8485 for (int i = 0; i < block_height; ++i) {
8586 for (int j = 0; j < block_width; ++j) {
8687 EXPECT_EQ(expected_data[i], pixel_ptr[j])
@@ -91,19 +92,15 @@ TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) { · 4 unmodified lines
9192
9293 vpx_free(src_image);
9394 vpx_free(dst_image);
95+ vpx_free(flimits);
9496 };
9597
9698 INSTANTIATE_TEST_CASE_P(C, Vp8PostProcessingFilterTest,
97− ::testing::Values(vp8_post_proc_down_and_across_c));
98−
99−#if HAVE_MMX
100−INSTANTIATE_TEST_CASE_P(MMX, Vp8PostProcessingFilterTest,
101− ::testing::Values(vp8_post_proc_down_and_across_mmx));
102−#endif
99+ ::testing::Values(vp8_post_proc_down_and_across_mb_row_c));
103100
104101 #if HAVE_SSE2
105102 INSTANTIATE_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));
107104 #endif
108105
109106 } // 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