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.
Unified · Split
| @@ -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 | ||
| 26 | namespace { | 26 | namespace { |
| 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 function | 31 | // 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 | ||
| 34 | TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) { | 34 | TEST_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, 3 | 81 | 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 | ||
| 96 | INSTANTIATE_TEST_CASE_P(C, Vp8PostProcessingFilterTest, | 98 | INSTANTIATE_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 | ||
| 100 | INSTANTIATE_TEST_CASE_P(MMX, Vp8PostProcessingFilterTest, | ||
| 101 | ::testing::Values(vp8_post_proc_down_and_across_mmx)); | ||
| 102 | #endif | ||
| 103 | 100 | ||
| 104 | #if HAVE_SSE2 | 101 | #if HAVE_SSE2 |
| 105 | INSTANTIATE_TEST_CASE_P(SSE2, Vp8PostProcessingFilterTest, | 102 | 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)); |
| 107 | #endif | 104 | #endif |
| 108 | 105 | ||
| 109 | } // namespace | 106 | } // namespace |
| @@ -127,25 +127,24 @@ extern void vp8_blit_text(const char *msg, unsigned char *address, const int pit · 126 unmodified lines | |||
| 127 | extern void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch); | 127 | extern void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch); |
| 128 | /*********************************************************************************************************** | 128 | /*********************************************************************************************************** |
| 129 | */ | 129 | */ |
| 130 | void vp8_post_proc_down_and_across_c | 130 | void vp8_post_proc_down_and_across_mb_row_c |
| 131 | ( | 131 | ( |
| 132 | unsigned char *src_ptr, | 132 | unsigned char *src_ptr, |
| 133 | unsigned char *dst_ptr, | 133 | unsigned char *dst_ptr, |
| 134 | int src_pixels_per_line, | 134 | int src_pixels_per_line, |
| 135 | int dst_pixels_per_line, | 135 | int dst_pixels_per_line, |
| 136 | int rows, | ||
| 137 | int cols, | 136 | int cols, |
| 138 | int flimit | 137 | unsigned char *f, |
| 138 | int size | ||
| 139 | ) | 139 | ) |
| 140 | { | 140 | { |
| 141 | unsigned char *p_src, *p_dst; | 141 | unsigned char *p_src, *p_dst; |
| 142 | int row; | 142 | int row; |
| 143 | int col; | 143 | int col; |
| 144 | int i; | 144 | unsigned char v; |
| 145 | int v; | 145 | unsigned char d[4]; |
| 146 | unsigned char d[8]; | ||
| 147 | 146 | ||
| 148 | for (row = 0; row < rows; row++) | 147 | for (row = 0; row < size; row++) |
| 149 | { | 148 | { |
| 150 | /* post_proc_down for one row */ | 149 | /* post_proc_down for one row */ |
| 151 | p_src = src_ptr; | 150 | p_src = src_ptr; |
| @@ -153,20 +152,23 @@ void vp8_post_proc_down_and_across_c · 1 unmodified line | |||
| 153 | 152 | ||
| 154 | for (col = 0; col < cols; col++) | 153 | for (col = 0; col < cols; col++) |
| 155 | { | 154 | { |
| 155 | unsigned char p_above2 = p_src[col - 2 * src_pixels_per_line]; | ||
| 156 | unsigned char p_above1 = p_src[col - src_pixels_per_line]; | ||
| 157 | unsigned char p_below1 = p_src[col + src_pixels_per_line]; | ||
| 158 | unsigned char p_below2 = p_src[col + 2 * src_pixels_per_line]; | ||
| 156 | 159 | ||
| 157 | int kernel = 4; | 160 | v = p_src[col]; |
| 158 | int v = p_src[col]; | ||
| 159 | 161 | ||
| 160 | for (i = -2; i <= 2; i++) | 162 | if ((abs(v - p_above2) < f[col]) && (abs(v - p_above1) < f[col]) |
| 163 | && (abs(v - p_below1) < f[col]) && (abs(v - p_below2) < f[col])) | ||
| 161 | { | 164 | { |
| 162 | if (abs(v - p_src[col+i*src_pixels_per_line]) > flimit) | 165 | unsigned char k1, k2, k3; |
| 163 | goto down_skip_convolve; | 166 | k1 = (p_above2 + p_above1 + 1) >> 1; |
| 164 | 167 | k2 = (p_below2 + p_below1 + 1) >> 1; | |
| 165 | kernel += kernel5[2+i] * p_src[col+i*src_pixels_per_line]; | 168 | k3 = (k1 + k2 + 1) >> 1; |
| 169 | v = (k3 + v + 1) >> 1; | ||
| 166 | } | 170 | } |
| 167 | 171 | ||
| 168 | v = (kernel >> 3); | ||
| 169 | down_skip_convolve: | ||
| 170 | p_dst[col] = v; | 172 | p_dst[col] = v; |
| 171 | } | 173 | } |
| 172 | 174 | ||
| @@ -174,40 +176,34 @@ void vp8_post_proc_down_and_across_c · 1 unmodified line | |||
| 174 | p_src = dst_ptr; | 176 | p_src = dst_ptr; |
| 175 | p_dst = dst_ptr; | 177 | p_dst = dst_ptr; |
| 176 | 178 | ||
| 177 | for (i = -8; i<0; i++) | 179 | p_src[-2] = p_src[-1] = p_src[0]; |
| 178 | p_src[i]=p_src[0]; | 180 | p_src[cols] = p_src[cols + 1] = p_src[cols - 1]; |
| 179 | |||
| 180 | for (i = cols; i<cols+8; i++) | ||
| 181 | p_src[i]=p_src[cols-1]; | ||
| 182 | |||
| 183 | for (i = 0; i < 8; i++) | ||
| 184 | d[i] = p_src[i]; | ||
| 185 | 181 | ||
| 186 | for (col = 0; col < cols; col++) | 182 | for (col = 0; col < cols; col++) |
| 187 | { | 183 | { |
| 188 | int kernel = 4; | ||
| 189 | v = p_src[col]; | 184 | v = p_src[col]; |
| 190 | 185 | ||
| 191 | d[col&7] = v; | 186 | if ((abs(v - p_src[col - 2]) < f[col]) |
| 192 | 187 | && (abs(v - p_src[col - 1]) < f[col]) | |
| 193 | for (i = -2; i <= 2; i++) | 188 | && (abs(v - p_src[col + 1]) < f[col]) |
| 189 | && (abs(v - p_src[col + 2]) < f[col])) | ||
| 194 | { | 190 | { |
| 195 | if (abs(v - p_src[col+i]) > flimit) | 191 | unsigned char k1, k2, k3; |
| 196 | goto across_skip_convolve; | 192 | k1 = (p_src[col - 2] + p_src[col - 1] + 1) >> 1; |
| 197 | 193 | k2 = (p_src[col + 2] + p_src[col + 1] + 1) >> 1; | |
| 198 | kernel += kernel5[2+i] * p_src[col+i]; | 194 | k3 = (k1 + k2 + 1) >> 1; |
| 195 | v = (k3 + v + 1) >> 1; | ||
| 199 | } | 196 | } |
| 200 | 197 | ||
| 201 | d[col&7] = (kernel >> 3); | 198 | d[col & 3] = v; |
| 202 | across_skip_convolve: | ||
| 203 | 199 | ||
| 204 | if (col >= 2) | 200 | if (col >= 2) |
| 205 | p_dst[col-2] = d[(col-2)&7]; | 201 | p_dst[col - 2] = d[(col - 2) & 3]; |
| 206 | } | 202 | } |
| 207 | 203 | ||
| 208 | /* handle the last two pixels */ | 204 | /* handle the last two pixels */ |
| 209 | p_dst[col-2] = d[(col-2)&7]; | 205 | p_dst[col - 2] = d[(col - 2) & 3]; |
| 210 | p_dst[col-1] = d[(col-1)&7]; | 206 | p_dst[col - 1] = d[(col - 1) & 3]; |
| 211 | 207 | ||
| 212 | /* next row */ | 208 | /* next row */ |
| 213 | src_ptr += src_pixels_per_line; | 209 | src_ptr += src_pixels_per_line; |
| @@ -318,28 +314,17 @@ void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, i · 104 unmodified lines | |||
| 318 | } | 314 | } |
| 319 | } | 315 | } |
| 320 | 316 | ||
| 321 | 317 | static void vp8_de_mblock(YV12_BUFFER_CONFIG *post, | |
| 322 | static void vp8_deblock_and_de_macro_block(YV12_BUFFER_CONFIG *source, | 318 | int q) |
| 323 | YV12_BUFFER_CONFIG *post, | ||
| 324 | int q, | ||
| 325 | int low_var_thresh, | ||
| 326 | int flag) | ||
| 327 | { | 319 | { |
| 328 | double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; | 320 | vp8_mbpost_proc_across_ip(post->y_buffer, post->y_stride, post->y_height, |
| 329 | int ppl = (int)(level + .5); | 321 | post->y_width, q2mbl(q)); |
| 330 | (void) low_var_thresh; | 322 | vp8_mbpost_proc_down(post->y_buffer, post->y_stride, post->y_height, |
| 331 | (void) flag; | 323 | post->y_width, q2mbl(q)); |
| 332 | |||
| 333 | vp8_post_proc_down_and_across(source->y_buffer, post->y_buffer, source->y_stride, post->y_stride, source->y_height, source->y_width, ppl); | ||
| 334 | vp8_mbpost_proc_across_ip(post->y_buffer, post->y_stride, post->y_height, post->y_width, q2mbl(q)); | ||
| 335 | vp8_mbpost_proc_down(post->y_buffer, post->y_stride, post->y_height, post->y_width, q2mbl(q)); | ||
| 336 | |||
| 337 | vp8_post_proc_down_and_across(source->u_buffer, post->u_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); | ||
| 338 | vp8_post_proc_down_and_across(source->v_buffer, post->v_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); | ||
| 339 | |||
| 340 | } | 324 | } |
| 341 | 325 | ||
| 342 | void vp8_deblock(YV12_BUFFER_CONFIG *source, | 326 | void vp8_deblock(VP8_COMMON *cm, |
| 327 | YV12_BUFFER_CONFIG *source, | ||
| 343 | YV12_BUFFER_CONFIG *post, | 328 | YV12_BUFFER_CONFIG *post, |
| 344 | int q, | 329 | int q, |
| 345 | int low_var_thresh, | 330 | int low_var_thresh, |
| @@ -347,12 +332,58 @@ void vp8_deblock(YV12_BUFFER_CONFIG *source, · 1 unmodified line | |||
| 347 | { | 332 | { |
| 348 | double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; | 333 | double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; |
| 349 | int ppl = (int)(level + .5); | 334 | int ppl = (int)(level + .5); |
| 335 | |||
| 336 | const MODE_INFO *mode_info_context = cm->mi; | ||
| 337 | int mbr, mbc; | ||
| 338 | |||
| 339 | /* The pixel thresholds are adjusted according to if or not the macroblock | ||
| 340 | * is a skipped block. */ | ||
| 341 | unsigned char *ylimits = (unsigned char *)vpx_memalign(16, 16 * cm->mb_cols); | ||
| 342 | unsigned char *uvlimits = (unsigned char *)vpx_memalign(16, 8 * cm->mb_cols); | ||
| 350 | (void) low_var_thresh; | 343 | (void) low_var_thresh; |
| 351 | (void) flag; | 344 | (void) flag; |
| 352 | 345 | ||
| 353 | vp8_post_proc_down_and_across(source->y_buffer, post->y_buffer, source->y_stride, post->y_stride, source->y_height, source->y_width, ppl); | 346 | if (ppl > 0) |
| 354 | vp8_post_proc_down_and_across(source->u_buffer, post->u_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); | 347 | { |
| 355 | vp8_post_proc_down_and_across(source->v_buffer, post->v_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); | 348 | for (mbr = 0; mbr < cm->mb_rows; mbr++) |
| 349 | { | ||
| 350 | unsigned char *ylptr = ylimits; | ||
| 351 | unsigned char *uvlptr = uvlimits; | ||
| 352 | for (mbc = 0; mbc < cm->mb_cols; mbc++) | ||
| 353 | { | ||
| 354 | unsigned char mb_ppl; | ||
| 355 | |||
| 356 | if (mode_info_context->mbmi.mb_skip_coeff) | ||
| 357 | mb_ppl = (unsigned char)ppl >> 1; | ||
| 358 | else | ||
| 359 | mb_ppl = (unsigned char)ppl; | ||
| 360 | |||
| 361 | vpx_memset(ylptr, mb_ppl, 16); | ||
| 362 | vpx_memset(uvlptr, mb_ppl, 8); | ||
| 363 | |||
| 364 | ylptr += 16; | ||
| 365 | uvlptr += 8; | ||
| 366 | mode_info_context++; | ||
| 367 | } | ||
| 368 | mode_info_context++; | ||
| 369 | |||
| 370 | vp8_post_proc_down_and_across_mb_row( | ||
| 371 | source->y_buffer + 16 * mbr * source->y_stride, | ||
| 372 | post->y_buffer + 16 * mbr * post->y_stride, source->y_stride, | ||
| 373 | post->y_stride, source->y_width, ylimits, 16); | ||
| 374 | |||
| 375 | vp8_post_proc_down_and_across_mb_row( | ||
| 376 | source->u_buffer + 8 * mbr * source->uv_stride, | ||
| 377 | post->u_buffer + 8 * mbr * post->uv_stride, source->uv_stride, | ||
| 378 | post->uv_stride, source->uv_width, uvlimits, 8); | ||
| 379 | vp8_post_proc_down_and_across_mb_row( | ||
| 380 | source->v_buffer + 8 * mbr * source->uv_stride, | ||
| 381 | post->v_buffer + 8 * mbr * post->uv_stride, source->uv_stride, | ||
| 382 | post->uv_stride, source->uv_width, uvlimits, 8); | ||
| 383 | } | ||
| 384 | } | ||
| 385 | vpx_free(ylimits); | ||
| 386 | vpx_free(uvlimits); | ||
| 356 | } | 387 | } |
| 357 | 388 | ||
| 358 | #if !(CONFIG_TEMPORAL_DENOISING) | 389 | #if !(CONFIG_TEMPORAL_DENOISING) |
| @@ -364,33 +395,35 @@ void vp8_de_noise(YV12_BUFFER_CONFIG *source, · 5 unmodified lines | |||
| 364 | { | 395 | { |
| 365 | double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; | 396 | double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; |
| 366 | int ppl = (int)(level + .5); | 397 | int ppl = (int)(level + .5); |
| 398 | int mb_rows = source->y_width >> 4; | ||
| 399 | int mb_cols = source->y_height >> 4; | ||
| 400 | unsigned char *limits = (unsigned char *)vpx_memalign(16, 16 * mb_cols); | ||
| 401 | int mbr, mbc; | ||
| 367 | (void) post; | 402 | (void) post; |
| 368 | (void) low_var_thresh; | 403 | (void) low_var_thresh; |
| 369 | (void) flag; | 404 | (void) flag; |
| 370 | 405 | ||
| 371 | vp8_post_proc_down_and_across( | 406 | /* TODO: The original code don't filter the 2 outer rows and columns. */ |
| 372 | source->y_buffer + 2 * source->y_stride + 2, | 407 | vpx_memset(limits, (unsigned char)ppl, 16 * mb_cols); |
| 373 | source->y_buffer + 2 * source->y_stride + 2, | ||
| 374 | source->y_stride, | ||
| 375 | source->y_stride, | ||
| 376 | source->y_height - 4, | ||
| 377 | source->y_width - 4, | ||
| 378 | ppl); | ||
| 379 | vp8_post_proc_down_and_across( | ||
| 380 | source->u_buffer + 2 * source->uv_stride + 2, | ||
| 381 | source->u_buffer + 2 * source->uv_stride + 2, | ||
| 382 | source->uv_stride, | ||
| 383 | source->uv_stride, | ||
| 384 | source->uv_height - 4, | ||
| 385 | source->uv_width - 4, ppl); | ||
| 386 | vp8_post_proc_down_and_across( | ||
| 387 | source->v_buffer + 2 * source->uv_stride + 2, | ||
| 388 | source->v_buffer + 2 * source->uv_stride + 2, | ||
| 389 | source->uv_stride, | ||
| 390 | source->uv_stride, | ||
| 391 | source->uv_height - 4, | ||
| 392 | source->uv_width - 4, ppl); | ||
| 393 | 408 | ||
| 409 | for (mbr = 0; mbr < mb_rows; mbr++) | ||
| 410 | { | ||
| 411 | vp8_post_proc_down_and_across_mb_row( | ||
| 412 | source->y_buffer + 16 * mbr * source->y_stride, | ||
| 413 | source->y_buffer + 16 * mbr * source->y_stride, | ||
| 414 | source->y_stride, source->y_stride, source->y_width, limits, 16); | ||
| 415 | |||
| 416 | vp8_post_proc_down_and_across_mb_row( | ||
| 417 | source->u_buffer + 8 * mbr * source->uv_stride, | ||
| 418 | source->u_buffer + 8 * mbr * source->uv_stride, | ||
| 419 | source->uv_stride, source->uv_stride, source->uv_width, limits, 8); | ||
| 420 | vp8_post_proc_down_and_across_mb_row( | ||
| 421 | source->v_buffer + 8 * mbr * source->uv_stride, | ||
| 422 | source->v_buffer + 8 * mbr * source->uv_stride, | ||
| 423 | source->uv_stride, source->uv_stride, source->uv_width, limits, 8); | ||
| 424 | } | ||
| 425 | |||
| 426 | vpx_free(limits); | ||
| 394 | } | 427 | } |
| 395 | #endif | 428 | #endif |
| 396 | 429 | ||
| @@ -752,12 +785,14 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t · 355 unmodified lines | |||
| 752 | vp8_yv12_copy_frame(&oci->post_proc_buffer, &oci->post_proc_buffer_int); | 785 | vp8_yv12_copy_frame(&oci->post_proc_buffer, &oci->post_proc_buffer_int); |
| 753 | if (flags & VP8D_DEMACROBLOCK) | 786 | if (flags & VP8D_DEMACROBLOCK) |
| 754 | { | 787 | { |
| 755 | vp8_deblock_and_de_macro_block(&oci->post_proc_buffer_int, &oci->post_proc_buffer, | 788 | vp8_deblock(oci, &oci->post_proc_buffer_int, &oci->post_proc_buffer, |
| 756 | q + (deblock_level - 5) * 10, 1, 0); | 789 | q + (deblock_level - 5) * 10, 1, 0); |
| 790 | vp8_de_mblock(&oci->post_proc_buffer, | ||
| 791 | q + (deblock_level - 5) * 10); | ||
| 757 | } | 792 | } |
| 758 | else if (flags & VP8D_DEBLOCK) | 793 | else if (flags & VP8D_DEBLOCK) |
| 759 | { | 794 | { |
| 760 | vp8_deblock(&oci->post_proc_buffer_int, &oci->post_proc_buffer, | 795 | vp8_deblock(oci, &oci->post_proc_buffer_int, &oci->post_proc_buffer, |
| 761 | q, 1, 0); | 796 | q, 1, 0); |
| 762 | } | 797 | } |
| 763 | } | 798 | } |
| @@ -766,13 +801,15 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t · 2 unmodified lines | |||
| 766 | } | 801 | } |
| 767 | else if (flags & VP8D_DEMACROBLOCK) | 802 | else if (flags & VP8D_DEMACROBLOCK) |
| 768 | { | 803 | { |
| 769 | vp8_deblock_and_de_macro_block(oci->frame_to_show, &oci->post_proc_buffer, | 804 | vp8_deblock(oci, oci->frame_to_show, &oci->post_proc_buffer, |
| 770 | q + (deblock_level - 5) * 10, 1, 0); | 805 | q + (deblock_level - 5) * 10, 1, 0); |
| 806 | vp8_de_mblock(&oci->post_proc_buffer, q + (deblock_level - 5) * 10); | ||
| 807 | |||
| 771 | oci->postproc_state.last_base_qindex = oci->base_qindex; | 808 | oci->postproc_state.last_base_qindex = oci->base_qindex; |
| 772 | } | 809 | } |
| 773 | else if (flags & VP8D_DEBLOCK) | 810 | else if (flags & VP8D_DEBLOCK) |
| 774 | { | 811 | { |
| 775 | vp8_deblock(oci->frame_to_show, &oci->post_proc_buffer, | 812 | vp8_deblock(oci, oci->frame_to_show, &oci->post_proc_buffer, |
| 776 | q, 1, 0); | 813 | q, 1, 0); |
| 777 | oci->postproc_state.last_base_qindex = oci->base_qindex; | 814 | oci->postproc_state.last_base_qindex = oci->base_qindex; |
| 778 | } | 815 | } |
| @@ -36,7 +36,8 @@ void vp8_de_noise(YV12_BUFFER_CONFIG *source, · 35 unmodified lines | |||
| 36 | int low_var_thresh, | 36 | int low_var_thresh, |
| 37 | int flag); | 37 | int flag); |
| 38 | 38 | ||
| 39 | void vp8_deblock(YV12_BUFFER_CONFIG *source, | 39 | void vp8_deblock(struct VP8Common *oci, |
| 40 | YV12_BUFFER_CONFIG *source, | ||
| 40 | YV12_BUFFER_CONFIG *post, | 41 | YV12_BUFFER_CONFIG *post, |
| 41 | int q, | 42 | int q, |
| 42 | int low_var_thresh, | 43 | int low_var_thresh, |
| @@ -19,14 +19,14 @@ void (*vp8_short_idct4x4)(short *input, short *output, int pitch); · 18 unmodified lines | |||
| 19 | void (*vp8_short_idct4x4_1)(short *input, short *output, int pitch); | 19 | void (*vp8_short_idct4x4_1)(short *input, short *output, int pitch); |
| 20 | void (*vp8_dc_only_idct)(short input_dc, short *output, int pitch); | 20 | void (*vp8_dc_only_idct)(short input_dc, short *output, int pitch); |
| 21 | 21 | ||
| 22 | extern void (*vp8_post_proc_down_and_across)( | 22 | extern void (*vp8_post_proc_down_and_across_mb_row)( |
| 23 | unsigned char *src_ptr, | 23 | unsigned char *src_ptr, |
| 24 | unsigned char *dst_ptr, | 24 | unsigned char *dst_ptr, |
| 25 | int src_pixels_per_line, | 25 | int src_pixels_per_line, |
| 26 | int dst_pixels_per_line, | 26 | int dst_pixels_per_line, |
| 27 | int rows, | ||
| 28 | int cols, | 27 | int cols, |
| 29 | int flimit | 28 | unsigned char *f, |
| 29 | int size | ||
| 30 | ); | 30 | ); |
| 31 | 31 | ||
| 32 | extern void (*vp8_mbpost_proc_down)(unsigned char *dst, int pitch, int rows, int cols, int flimit); | 32 | extern void (*vp8_mbpost_proc_down)(unsigned char *dst, int pitch, int rows, int cols, int flimit); |
| @@ -34,15 +34,15 @@ extern void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int · 1 unmodified line | |||
| 34 | extern void (*vp8_mbpost_proc_across_ip)(unsigned char *src, int pitch, int rows, int cols, int flimit); | 34 | extern void (*vp8_mbpost_proc_across_ip)(unsigned char *src, int pitch, int rows, int cols, int flimit); |
| 35 | extern void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int cols, int flimit); | 35 | extern void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int cols, int flimit); |
| 36 | 36 | ||
| 37 | extern void vp8_post_proc_down_and_across_c | 37 | extern void vp8_post_proc_down_and_across_mb_row_c |
| 38 | ( | 38 | ( |
| 39 | unsigned char *src_ptr, | 39 | unsigned char *src_ptr, |
| 40 | unsigned char *dst_ptr, | 40 | unsigned char *dst_ptr, |
| 41 | int src_pixels_per_line, | 41 | int src_pixels_per_line, |
| 42 | int dst_pixels_per_line, | 42 | int dst_pixels_per_line, |
| 43 | int rows, | ||
| 44 | int cols, | 43 | int cols, |
| 45 | int flimit | 44 | unsigned char *f, |
| 45 | int size | ||
| 46 | ); | 46 | ); |
| 47 | void vp8_plane_add_noise_c(unsigned char *Start, unsigned int Width, unsigned int Height, int Pitch, int q, int a); | 47 | void vp8_plane_add_noise_c(unsigned char *Start, unsigned int Width, unsigned int Height, int Pitch, int q, int a); |
| 48 | 48 | ||
| @@ -158,7 +158,7 @@ void vp8_machine_specific_config(void) · 109 unmodified lines | |||
| 158 | vp8_lf_mbhsimple = loop_filter_mbhs_ppc; | 158 | vp8_lf_mbhsimple = loop_filter_mbhs_ppc; |
| 159 | vp8_lf_bhsimple = loop_filter_bhs_ppc; | 159 | vp8_lf_bhsimple = loop_filter_bhs_ppc; |
| 160 | 160 | ||
| 161 | vp8_post_proc_down_and_across = vp8_post_proc_down_and_across_c; | 161 | vp8_post_proc_down_and_across_mb_row = vp8_post_proc_down_and_across_mb_row_c; |
| 162 | vp8_mbpost_proc_down = vp8_mbpost_proc_down_c; | 162 | vp8_mbpost_proc_down = vp8_mbpost_proc_down_c; |
| 163 | vp8_mbpost_proc_across_ip = vp8_mbpost_proc_across_ip_c; | 163 | vp8_mbpost_proc_across_ip = vp8_mbpost_proc_across_ip_c; |
| 164 | vp8_plane_add_noise = vp8_plane_add_noise_c; | 164 | vp8_plane_add_noise = vp8_plane_add_noise_c; |
| @@ -162,9 +162,8 @@ if [ "$CONFIG_POSTPROC" = "yes" ]; then · 161 unmodified lines | |||
| 162 | specialize vp8_mbpost_proc_across_ip sse2 | 162 | specialize vp8_mbpost_proc_across_ip sse2 |
| 163 | vp8_mbpost_proc_across_ip_sse2=vp8_mbpost_proc_across_ip_xmm | 163 | vp8_mbpost_proc_across_ip_sse2=vp8_mbpost_proc_across_ip_xmm |
| 164 | 164 | ||
| 165 | prototype void vp8_post_proc_down_and_across "unsigned char *src, unsigned char *dst, int src_pitch, int dst_pitch, int rows, int cols, int flimit" | 165 | prototype void vp8_post_proc_down_and_across_mb_row "unsigned char *src, unsigned char *dst, int src_pitch, int dst_pitch, int cols, unsigned char *flimits, int size" |
| 166 | specialize vp8_post_proc_down_and_across mmx sse2 | 166 | specialize vp8_post_proc_down_and_across_mb_row sse2 |
| 167 | vp8_post_proc_down_and_across_sse2=vp8_post_proc_down_and_across_xmm | ||
| 168 | 167 | ||
| 169 | prototype void vp8_plane_add_noise "unsigned char *s, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int w, unsigned int h, int pitch" | 168 | prototype void vp8_plane_add_noise "unsigned char *s, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int w, unsigned int h, int pitch" |
| 170 | specialize vp8_plane_add_noise mmx sse2 | 169 | specialize vp8_plane_add_noise mmx sse2 |
| @@ -14,271 +14,6 @@ · 13 unmodified lines | |||
| 14 | %define VP8_FILTER_WEIGHT 128 | 14 | %define VP8_FILTER_WEIGHT 128 |
| 15 | %define VP8_FILTER_SHIFT 7 | 15 | %define VP8_FILTER_SHIFT 7 |
| 16 | 16 | ||
| 17 | ;void vp8_post_proc_down_and_across_mmx | ||
| 18 | ;( | ||
| 19 | ; unsigned char *src_ptr, | ||
| 20 | ; unsigned char *dst_ptr, | ||
| 21 | ; int src_pixels_per_line, | ||
| 22 | ; int dst_pixels_per_line, | ||
| 23 | ; int rows, | ||
| 24 | ; int cols, | ||
| 25 | ; int flimit | ||
| 26 | ;) | ||
| 27 | global sym(vp8_post_proc_down_and_across_mmx) PRIVATE | ||
| 28 | sym(vp8_post_proc_down_and_across_mmx): | ||
| 29 | push rbp | ||
| 30 | mov rbp, rsp | ||
| 31 | SHADOW_ARGS_TO_STACK 7 | ||
| 32 | GET_GOT rbx | ||
| 33 | push rsi | ||
| 34 | push rdi | ||
| 35 | ; end prolog | ||
| 36 | |||
| 37 | %if ABI_IS_32BIT=1 && CONFIG_PIC=1 | ||
| 38 | ; move the global rd onto the stack, since we don't have enough registers | ||
| 39 | ; to do PIC addressing | ||
| 40 | movq mm0, [GLOBAL(rd)] | ||
| 41 | sub rsp, 8 | ||
| 42 | movq [rsp], mm0 | ||
| 43 | %define RD [rsp] | ||
| 44 | %else | ||
| 45 | %define RD [GLOBAL(rd)] | ||
| 46 | %endif | ||
| 47 | |||
| 48 | push rbx | ||
| 49 | lea rbx, [GLOBAL(Blur)] | ||
| 50 | movd mm2, dword ptr arg(6) ;flimit | ||
| 51 | punpcklwd mm2, mm2 | ||
| 52 | punpckldq mm2, mm2 | ||
| 53 | |||
| 54 | mov rsi, arg(0) ;src_ptr | ||
| 55 | mov rdi, arg(1) ;dst_ptr | ||
| 56 | |||
| 57 | movsxd rcx, DWORD PTR arg(4) ;rows | ||
| 58 | movsxd rax, DWORD PTR arg(2) ;src_pixels_per_line ; destination pitch? | ||
| 59 | pxor mm0, mm0 ; mm0 = 00000000 | ||
| 60 | |||
| 61 | .nextrow: | ||
| 62 | |||
| 63 | xor rdx, rdx ; clear out rdx for use as loop counter | ||
| 64 | .nextcol: | ||
| 65 | |||
| 66 | pxor mm7, mm7 ; mm7 = 00000000 | ||
| 67 | movq mm6, [rbx + 32 ] ; mm6 = kernel 2 taps | ||
| 68 | movq mm3, [rsi] ; mm4 = r0 p0..p7 | ||
| 69 | punpcklbw mm3, mm0 ; mm3 = p0..p3 | ||
| 70 | movq mm1, mm3 ; mm1 = p0..p3 | ||
| 71 | pmullw mm3, mm6 ; mm3 *= kernel 2 modifiers | ||
| 72 | |||
| 73 | movq mm6, [rbx + 48] ; mm6 = kernel 3 taps | ||
| 74 | movq mm5, [rsi + rax] ; mm4 = r1 p0..p7 | ||
| 75 | punpcklbw mm5, mm0 ; mm5 = r1 p0..p3 | ||
| 76 | pmullw mm6, mm5 ; mm6 *= p0..p3 * kernel 3 modifiers | ||
| 77 | paddusw mm3, mm6 ; mm3 += mm6 | ||
| 78 | |||
| 79 | ; thresholding | ||
| 80 | movq mm7, mm1 ; mm7 = r0 p0..p3 | ||
| 81 | psubusw mm7, mm5 ; mm7 = r0 p0..p3 - r1 p0..p3 | ||
| 82 | psubusw mm5, mm1 ; mm5 = r1 p0..p3 - r0 p0..p3 | ||
| 83 | paddusw mm7, mm5 ; mm7 = abs(r0 p0..p3 - r1 p0..p3) | ||
| 84 | pcmpgtw mm7, mm2 | ||
| 85 | |||
| 86 | movq mm6, [rbx + 64 ] ; mm6 = kernel 4 modifiers | ||
| 87 | movq mm5, [rsi + 2*rax] ; mm4 = r2 p0..p7 | ||
| 88 | punpcklbw mm5, mm0 ; mm5 = r2 p0..p3 | ||
| 89 | pmullw mm6, mm5 ; mm5 *= kernel 4 modifiers | ||
| 90 | paddusw mm3, mm6 ; mm3 += mm5 | ||
| 91 | |||
| 92 | ; thresholding | ||
| 93 | movq mm6, mm1 ; mm6 = r0 p0..p3 | ||
| 94 | psubusw mm6, mm5 ; mm6 = r0 p0..p3 - r2 p0..p3 | ||
| 95 | psubusw mm5, mm1 ; mm5 = r2 p0..p3 - r2 p0..p3 | ||
| 96 | paddusw mm6, mm5 ; mm6 = abs(r0 p0..p3 - r2 p0..p3) | ||
| 97 | pcmpgtw mm6, mm2 | ||
| 98 | por mm7, mm6 ; accumulate thresholds | ||
| 99 | |||
| 100 | |||
| 101 | neg rax | ||
| 102 | movq mm6, [rbx ] ; kernel 0 taps | ||
| 103 | movq mm5, [rsi+2*rax] ; mm4 = r-2 p0..p7 | ||
| 104 | punpcklbw mm5, mm0 ; mm5 = r-2 p0..p3 | ||
| 105 | pmullw mm6, mm5 ; mm5 *= kernel 0 modifiers | ||
| 106 | paddusw mm3, mm6 ; mm3 += mm5 | ||
| 107 | |||
| 108 | ; thresholding | ||
| 109 | movq mm6, mm1 ; mm6 = r0 p0..p3 | ||
| 110 | psubusw mm6, mm5 ; mm6 = p0..p3 - r-2 p0..p3 | ||
| 111 | psubusw mm5, mm1 ; mm5 = r-2 p0..p3 - p0..p3 | ||
| 112 | paddusw mm6, mm5 ; mm6 = abs(r0 p0..p3 - r-2 p0..p3) | ||
| 113 | pcmpgtw mm6, mm2 | ||
| 114 | por mm7, mm6 ; accumulate thresholds | ||
| 115 | |||
| 116 | movq mm6, [rbx + 16] ; kernel 1 taps | ||
| 117 | movq mm4, [rsi+rax] ; mm4 = r-1 p0..p7 | ||
| 118 | punpcklbw mm4, mm0 ; mm4 = r-1 p0..p3 | ||
| 119 | pmullw mm6, mm4 ; mm4 *= kernel 1 modifiers. | ||
| 120 | paddusw mm3, mm6 ; mm3 += mm5 | ||
| 121 | |||
| 122 | ; thresholding | ||
| 123 | movq mm6, mm1 ; mm6 = r0 p0..p3 | ||
| 124 | psubusw mm6, mm4 ; mm6 = p0..p3 - r-2 p0..p3 | ||
| 125 | psubusw mm4, mm1 ; mm5 = r-1 p0..p3 - p0..p3 | ||
| 126 | paddusw mm6, mm4 ; mm6 = abs(r0 p0..p3 - r-1 p0..p3) | ||
| 127 | pcmpgtw mm6, mm2 | ||
| 128 | por mm7, mm6 ; accumulate thresholds | ||
| 129 | |||
| 130 | |||
| 131 | paddusw mm3, RD ; mm3 += round value | ||
| 132 | psraw mm3, VP8_FILTER_SHIFT ; mm3 /= 128 | ||
| 133 | |||
| 134 | pand mm1, mm7 ; mm1 select vals > thresh from source | ||
| 135 | pandn mm7, mm3 ; mm7 select vals < thresh from blurred result | ||
| 136 | paddusw mm1, mm7 ; combination | ||
| 137 | |||
| 138 | packuswb mm1, mm0 ; pack to bytes | ||
| 139 | |||
| 140 | movd [rdi], mm1 ; | ||
| 141 | neg rax ; pitch is positive | ||
| 142 | |||
| 143 | |||
| 144 | add rsi, 4 | ||
| 145 | add rdi, 4 | ||
| 146 | add rdx, 4 | ||
| 147 | |||
| 148 | cmp edx, dword ptr arg(5) ;cols | ||
| 149 | jl .nextcol | ||
| 150 | ; done with the all cols, start the across filtering in place | ||
| 151 | sub rsi, rdx | ||
| 152 | sub rdi, rdx | ||
| 153 | |||
| 154 | ; dup the first byte into the left border 8 times | ||
| 155 | movq mm1, [rdi] | ||
| 156 | punpcklbw mm1, mm1 | ||
| 157 | punpcklwd mm1, mm1 | ||
| 158 | punpckldq mm1, mm1 | ||
| 159 | |||
| 160 | mov rdx, -8 | ||
| 161 | movq [rdi+rdx], mm1 | ||
| 162 | |||
| 163 | ; dup the last byte into the right border | ||
| 164 | movsxd rdx, dword arg(5) | ||
| 165 | movq mm1, [rdi + rdx + -1] | ||
| 166 | punpcklbw mm1, mm1 | ||
| 167 | punpcklwd mm1, mm1 | ||
| 168 | punpckldq mm1, mm1 | ||
| 169 | movq [rdi+rdx], mm1 | ||
| 170 | |||
| 171 | |||
| 172 | push rax | ||
| 173 | xor rdx, rdx | ||
| 174 | mov rax, [rdi-4]; | ||
| 175 | |||
| 176 | .acrossnextcol: | ||
| 177 | pxor mm7, mm7 ; mm7 = 00000000 | ||
| 178 | movq mm6, [rbx + 32 ] ; | ||
| 179 | movq mm4, [rdi+rdx] ; mm4 = p0..p7 | ||
| 180 | movq mm3, mm4 ; mm3 = p0..p7 | ||
| 181 | punpcklbw mm3, mm0 ; mm3 = p0..p3 | ||
| 182 | movq mm1, mm3 ; mm1 = p0..p3 | ||
| 183 | pmullw mm3, mm6 ; mm3 *= kernel 2 modifiers | ||
| 184 | |||
| 185 | movq mm6, [rbx + 48] | ||
| 186 | psrlq mm4, 8 ; mm4 = p1..p7 | ||
| 187 | movq mm5, mm4 ; mm5 = p1..p7 | ||
| 188 | punpcklbw mm5, mm0 ; mm5 = p1..p4 | ||
| 189 | pmullw mm6, mm5 ; mm6 *= p1..p4 * kernel 3 modifiers | ||
| 190 | paddusw mm3, mm6 ; mm3 += mm6 | ||
| 191 | |||
| 192 | ; thresholding | ||
| 193 | movq mm7, mm1 ; mm7 = p0..p3 | ||
| 194 | psubusw mm7, mm5 ; mm7 = p0..p3 - p1..p4 | ||
| 195 | psubusw mm5, mm1 ; mm5 = p1..p4 - p0..p3 | ||
| 196 | paddusw mm7, mm5 ; mm7 = abs(p0..p3 - p1..p4) | ||
| 197 | pcmpgtw mm7, mm2 | ||
| 198 | |||
| 199 | movq mm6, [rbx + 64 ] | ||
| 200 | psrlq mm4, 8 ; mm4 = p2..p7 | ||
| 201 | movq mm5, mm4 ; mm5 = p2..p7 | ||
| 202 | punpcklbw mm5, mm0 ; mm5 = p2..p5 | ||
| 203 | pmullw mm6, mm5 ; mm5 *= kernel 4 modifiers | ||
| 204 | paddusw mm3, mm6 ; mm3 += mm5 | ||
| 205 | |||
| 206 | ; thresholding | ||
| 207 | movq mm6, mm1 ; mm6 = p0..p3 | ||
| 208 | psubusw mm6, mm5 ; mm6 = p0..p3 - p1..p4 | ||
| 209 | psubusw mm5, mm1 ; mm5 = p1..p4 - p0..p3 | ||
| 210 | paddusw mm6, mm5 ; mm6 = abs(p0..p3 - p1..p4) | ||
| 211 | pcmpgtw mm6, mm2 | ||
| 212 | por mm7, mm6 ; accumulate thresholds | ||
| 213 | |||
| 214 | |||
| 215 | movq mm6, [rbx ] | ||
| 216 | movq mm4, [rdi+rdx-2] ; mm4 = p-2..p5 | ||
| 217 | movq mm5, mm4 ; mm5 = p-2..p5 | ||
| 218 | punpcklbw mm5, mm0 ; mm5 = p-2..p1 | ||
| 219 | pmullw mm6, mm5 ; mm5 *= kernel 0 modifiers | ||
| 220 | paddusw mm3, mm6 ; mm3 += mm5 | ||
| 221 | |||
| 222 | ; thresholding | ||
| 223 | movq mm6, mm1 ; mm6 = p0..p3 | ||
| 224 | psubusw mm6, mm5 ; mm6 = p0..p3 - p1..p4 | ||
| 225 | psubusw mm5, mm1 ; mm5 = p1..p4 - p0..p3 | ||
| 226 | paddusw mm6, mm5 ; mm6 = abs(p0..p3 - p1..p4) | ||
| 227 | pcmpgtw mm6, mm2 | ||
| 228 | por mm7, mm6 ; accumulate thresholds | ||
| 229 | |||
| 230 | movq mm6, [rbx + 16] | ||
| 231 | psrlq mm4, 8 ; mm4 = p-1..p5 | ||
| 232 | punpcklbw mm4, mm0 ; mm4 = p-1..p2 | ||
| 233 | pmullw mm6, mm4 ; mm4 *= kernel 1 modifiers. | ||
| 234 | paddusw mm3, mm6 ; mm3 += mm5 | ||
| 235 | |||
| 236 | ; thresholding | ||
| 237 | movq mm6, mm1 ; mm6 = p0..p3 | ||
| 238 | psubusw mm6, mm4 ; mm6 = p0..p3 - p1..p4 | ||
| 239 | psubusw mm4, mm1 ; mm5 = p1..p4 - p0..p3 | ||
| 240 | paddusw mm6, mm4 ; mm6 = abs(p0..p3 - p1..p4) | ||
| 241 | pcmpgtw mm6, mm2 | ||
| 242 | por mm7, mm6 ; accumulate thresholds | ||
| 243 | |||
| 244 | paddusw mm3, RD ; mm3 += round value | ||
| 245 | psraw mm3, VP8_FILTER_SHIFT ; mm3 /= 128 | ||
| 246 | |||
| 247 | pand mm1, mm7 ; mm1 select vals > thresh from source | ||
| 248 | pandn mm7, mm3 ; mm7 select vals < thresh from blurred result | ||
| 249 | paddusw mm1, mm7 ; combination | ||
| 250 | |||
| 251 | packuswb mm1, mm0 ; pack to bytes | ||
| 252 | mov DWORD PTR [rdi+rdx-4], eax ; store previous four bytes | ||
| 253 | movd eax, mm1 | ||
| 254 | |||
| 255 | add rdx, 4 | ||
| 256 | cmp edx, dword ptr arg(5) ;cols | ||
| 257 | jl .acrossnextcol; | ||
| 258 | |||
| 259 | mov DWORD PTR [rdi+rdx-4], eax | ||
| 260 | pop rax | ||
| 261 | |||
| 262 | ; done with this rwo | ||
| 263 | add rsi,rax ; next line | ||
| 264 | movsxd rax, dword ptr arg(3) ;dst_pixels_per_line ; destination pitch? | ||
| 265 | add rdi,rax ; next destination | ||
| 266 | movsxd rax, dword ptr arg(2) ;src_pixels_per_line ; destination pitch? | ||
| 267 | |||
| 268 | dec rcx ; decrement count | ||
| 269 | jnz .nextrow ; next row | ||
| 270 | pop rbx | ||
| 271 | |||
| 272 | ; begin epilog | ||
| 273 | pop rdi | ||
| 274 | pop rsi | ||
| 275 | RESTORE_GOT | ||
| 276 | UNSHADOW_ARGS | ||
| 277 | pop rbp | ||
| 278 | ret | ||
| 279 | %undef RD | ||
| 280 | |||
| 281 | |||
| 282 | ;void vp8_mbpost_proc_down_mmx(unsigned char *dst, | 17 | ;void vp8_mbpost_proc_down_mmx(unsigned char *dst, |
| 283 | ; int pitch, int rows, int cols,int flimit) | 18 | ; int pitch, int rows, int cols,int flimit) |
| 284 | extern sym(vp8_rv) | 19 | extern sym(vp8_rv) |
| @@ -11,146 +11,158 @@ · 10 unmodified lines | |||
| 11 | 11 | ||
| 12 | %include "vpx_ports/x86_abi_support.asm" | 12 | %include "vpx_ports/x86_abi_support.asm" |
| 13 | 13 | ||
| 14 | ;void vp8_post_proc_down_and_across_xmm | 14 | ;macro in deblock functions |
| 15 | %macro FIRST_2_ROWS 0 | ||
| 16 | movdqa xmm4, xmm0 | ||
| 17 | movdqa xmm6, xmm0 | ||
| 18 | movdqa xmm5, xmm1 | ||
| 19 | pavgb xmm5, xmm3 | ||
| 20 | |||
| 21 | ;calculate absolute value | ||
| 22 | psubusb xmm4, xmm1 | ||
| 23 | psubusb xmm1, xmm0 | ||
| 24 | psubusb xmm6, xmm3 | ||
| 25 | psubusb xmm3, xmm0 | ||
| 26 | paddusb xmm4, xmm1 | ||
| 27 | paddusb xmm6, xmm3 | ||
| 28 | |||
| 29 | ;get threshold | ||
| 30 | movdqa xmm2, flimit | ||
| 31 | pxor xmm1, xmm1 | ||
| 32 | movdqa xmm7, xmm2 | ||
| 33 | |||
| 34 | ;get mask | ||
| 35 | psubusb xmm2, xmm4 | ||
| 36 | psubusb xmm7, xmm6 | ||
| 37 | pcmpeqb xmm2, xmm1 | ||
| 38 | pcmpeqb xmm7, xmm1 | ||
| 39 | por xmm7, xmm2 | ||
| 40 | %endmacro | ||
| 41 | |||
| 42 | %macro SECOND_2_ROWS 0 | ||
| 43 | movdqa xmm6, xmm0 | ||
| 44 | movdqa xmm4, xmm0 | ||
| 45 | movdqa xmm2, xmm1 | ||
| 46 | pavgb xmm1, xmm3 | ||
| 47 | |||
| 48 | ;calculate absolute value | ||
| 49 | psubusb xmm6, xmm2 | ||
| 50 | psubusb xmm2, xmm0 | ||
| 51 | psubusb xmm4, xmm3 | ||
| 52 | psubusb xmm3, xmm0 | ||
| 53 | paddusb xmm6, xmm2 | ||
| 54 | paddusb xmm4, xmm3 | ||
| 55 | |||
| 56 | pavgb xmm5, xmm1 | ||
| 57 | |||
| 58 | ;get threshold | ||
| 59 | movdqa xmm2, flimit | ||
| 60 | pxor xmm1, xmm1 | ||
| 61 | movdqa xmm3, xmm2 | ||
| 62 | |||
| 63 | ;get mask | ||
| 64 | psubusb xmm2, xmm6 | ||
| 65 | psubusb xmm3, xmm4 | ||
| 66 | pcmpeqb xmm2, xmm1 | ||
| 67 | pcmpeqb xmm3, xmm1 | ||
| 68 | |||
| 69 | por xmm7, xmm2 | ||
| 70 | por xmm7, xmm3 | ||
| 71 | |||
| 72 | pavgb xmm5, xmm0 | ||
| 73 | |||
| 74 | ;decide if or not to use filtered value | ||
| 75 | pand xmm0, xmm7 | ||
| 76 | pandn xmm7, xmm5 | ||
| 77 | paddusb xmm0, xmm7 | ||
| 78 | %endmacro | ||
| 79 | |||
| 80 | %macro UPDATE_FLIMIT 0 | ||
| 81 | movdqa xmm2, XMMWORD PTR [rbx] | ||
| 82 | movdqa [rsp], xmm2 | ||
| 83 | add rbx, 16 | ||
| 84 | %endmacro | ||
| 85 | |||
| 86 | ;void vp8_post_proc_down_and_across_mb_row_sse2 | ||
| 15 | ;( | 87 | ;( |
| 16 | ; unsigned char *src_ptr, | 88 | ; unsigned char *src_ptr, |
| 17 | ; unsigned char *dst_ptr, | 89 | ; unsigned char *dst_ptr, |
| 18 | ; int src_pixels_per_line, | 90 | ; int src_pixels_per_line, |
| 19 | ; int dst_pixels_per_line, | 91 | ; int dst_pixels_per_line, |
| 20 | ; int rows, | ||
| 21 | ; int cols, | 92 | ; int cols, |
| 22 | ; int flimit | 93 | ; int *flimits, |
| 94 | ; int size | ||
| 23 | ;) | 95 | ;) |
| 24 | global sym(vp8_post_proc_down_and_across_xmm) PRIVATE | 96 | global sym(vp8_post_proc_down_and_across_mb_row_sse2) PRIVATE |
| 25 | sym(vp8_post_proc_down_and_across_xmm): | 97 | sym(vp8_post_proc_down_and_across_mb_row_sse2): |
| 26 | push rbp | 98 | push rbp |
| 27 | mov rbp, rsp | 99 | mov rbp, rsp |
| 28 | SHADOW_ARGS_TO_STACK 7 | 100 | SHADOW_ARGS_TO_STACK 7 |
| 29 | SAVE_XMM 7 | 101 | SAVE_XMM 7 |
| 30 | GET_GOT rbx | 102 | push rbx |
| 31 | push rsi | 103 | push rsi |
| 32 | push rdi | 104 | push rdi |
| 33 | ; end prolog | 105 | ; end prolog |
| 34 | |||
| 35 | %if ABI_IS_32BIT=1 && CONFIG_PIC=1 | ||
| 36 | ALIGN_STACK 16, rax | 106 | ALIGN_STACK 16, rax |
| 37 | ; move the global rd onto the stack, since we don't have enough registers | ||
| 38 | ; to do PIC addressing | ||
| 39 | movdqa xmm0, [GLOBAL(rd42)] | ||
| 40 | sub rsp, 16 | 107 | sub rsp, 16 |
| 41 | movdqa [rsp], xmm0 | ||
| 42 | %define RD42 [rsp] | ||
| 43 | %else | ||
| 44 | %define RD42 [GLOBAL(rd42)] | ||
| 45 | %endif | ||
| 46 | |||
| 47 | 108 | ||
| 48 | movd xmm2, dword ptr arg(6) ;flimit | 109 | ; put flimit on stack |
| 49 | punpcklwd xmm2, xmm2 | 110 | mov rbx, arg(5) ;flimits ptr |
| 50 | punpckldq xmm2, xmm2 | 111 | UPDATE_FLIMIT |
| 51 | punpcklqdq xmm2, xmm2 | ||
| 52 | 112 | ||
| 53 | mov rsi, arg(0) ;src_ptr | 113 | %define flimit [rsp] |
| 54 | mov rdi, arg(1) ;dst_ptr | ||
| 55 | 114 | ||
| 56 | movsxd rcx, DWORD PTR arg(4) ;rows | 115 | mov rsi, arg(0) ;src_ptr |
| 57 | movsxd rax, DWORD PTR arg(2) ;src_pixels_per_line ; destination pitch? | 116 | mov rdi, arg(1) ;dst_ptr |
| 58 | pxor xmm0, xmm0 ; mm0 = 00000000 | ||
| 59 | 117 | ||
| 118 | movsxd rax, DWORD PTR arg(2) ;src_pixels_per_line | ||
| 119 | movsxd rcx, DWORD PTR arg(6) ;rows in a macroblock | ||
| 60 | .nextrow: | 120 | .nextrow: |
| 61 | 121 | xor rdx, rdx ;col | |
| 62 | xor rdx, rdx ; clear out rdx for use as loop counter | ||
| 63 | .nextcol: | 122 | .nextcol: |
| 64 | movq xmm3, QWORD PTR [rsi] ; mm4 = r0 p0..p7 | 123 | ;load current and next 2 rows |
| 65 | punpcklbw xmm3, xmm0 ; mm3 = p0..p3 | 124 | movdqu xmm0, XMMWORD PTR [rsi] |
| 66 | movdqa xmm1, xmm3 ; mm1 = p0..p3 | 125 | movdqu xmm1, XMMWORD PTR [rsi + rax] |
| 67 | psllw xmm3, 2 ; | 126 | movdqu xmm3, XMMWORD PTR [rsi + 2*rax] |
| 68 | |||
| 69 | movq xmm5, QWORD PTR [rsi + rax] ; mm4 = r1 p0..p7 | ||
| 70 | punpcklbw xmm5, xmm0 ; mm5 = r1 p0..p3 | ||
| 71 | paddusw xmm3, xmm5 ; mm3 += mm6 | ||
| 72 | |||
| 73 | ; thresholding | ||
| 74 | movdqa xmm7, xmm1 ; mm7 = r0 p0..p3 | ||
| 75 | psubusw xmm7, xmm5 ; mm7 = r0 p0..p3 - r1 p0..p3 | ||
| 76 | psubusw xmm5, xmm1 ; mm5 = r1 p0..p3 - r0 p0..p3 | ||
| 77 | paddusw xmm7, xmm5 ; mm7 = abs(r0 p0..p3 - r1 p0..p3) | ||
| 78 | pcmpgtw xmm7, xmm2 | ||
| 79 | |||
| 80 | movq xmm5, QWORD PTR [rsi + 2*rax] ; mm4 = r2 p0..p7 | ||
| 81 | punpcklbw xmm5, xmm0 ; mm5 = r2 p0..p3 | ||
| 82 | paddusw xmm3, xmm5 ; mm3 += mm5 | ||
| 83 | |||
| 84 | ; thresholding | ||
| 85 | movdqa xmm6, xmm1 ; mm6 = r0 p0..p3 | ||
| 86 | psubusw xmm6, xmm5 ; mm6 = r0 p0..p3 - r2 p0..p3 | ||
| 87 | psubusw xmm5, xmm1 ; mm5 = r2 p0..p3 - r2 p0..p3 | ||
| 88 | paddusw xmm6, xmm5 ; mm6 = abs(r0 p0..p3 - r2 p0..p3) | ||
| 89 | pcmpgtw xmm6, xmm2 | ||
| 90 | por xmm7, xmm6 ; accumulate thresholds | ||
| 91 | 127 | ||
| 128 | FIRST_2_ROWS | ||
| 92 | 129 | ||
| 130 | ;load above 2 rows | ||
| 93 | neg rax | 131 | neg rax |
| 94 | movq xmm5, QWORD PTR [rsi+2*rax] ; mm4 = r-2 p0..p7 | 132 | movdqu xmm1, XMMWORD PTR [rsi + 2*rax] |
| 95 | punpcklbw xmm5, xmm0 ; mm5 = r-2 p0..p3 | 133 | movdqu xmm3, XMMWORD PTR [rsi + rax] |
| 96 | paddusw xmm3, xmm5 ; mm3 += mm5 | ||
| 97 | |||
| 98 | ; thresholding | ||
| 99 | movdqa xmm6, xmm1 ; mm6 = r0 p0..p3 | ||
| 100 | psubusw xmm6, xmm5 ; mm6 = p0..p3 - r-2 p0..p3 | ||
| 101 | psubusw xmm5, xmm1 ; mm5 = r-2 p0..p3 - p0..p3 | ||
| 102 | paddusw xmm6, xmm5 ; mm6 = abs(r0 p0..p3 - r-2 p0..p3) | ||
| 103 | pcmpgtw xmm6, xmm2 | ||
| 104 | por xmm7, xmm6 ; accumulate thresholds | ||
| 105 | |||
| 106 | movq xmm4, QWORD PTR [rsi+rax] ; mm4 = r-1 p0..p7 | ||
| 107 | punpcklbw xmm4, xmm0 ; mm4 = r-1 p0..p3 | ||
| 108 | paddusw xmm3, xmm4 ; mm3 += mm5 | ||
| 109 | |||
| 110 | ; thresholding | ||
| 111 | movdqa xmm6, xmm1 ; mm6 = r0 p0..p3 | ||
| 112 | psubusw xmm6, xmm4 ; mm6 = p0..p3 - r-2 p0..p3 | ||
| 113 | psubusw xmm4, xmm1 ; mm5 = r-1 p0..p3 - p0..p3 | ||
| 114 | paddusw xmm6, xmm4 ; mm6 = abs(r0 p0..p3 - r-1 p0..p3) | ||
| 115 | pcmpgtw xmm6, xmm2 | ||
| 116 | por xmm7, xmm6 ; accumulate thresholds | ||
| 117 | |||
| 118 | |||
| 119 | paddusw xmm3, RD42 ; mm3 += round value | ||
| 120 | psraw xmm3, 3 ; mm3 /= 8 | ||
| 121 | 134 | ||
| 122 | pand xmm1, xmm7 ; mm1 select vals > thresh from source | 135 | SECOND_2_ROWS |
| 123 | pandn xmm7, xmm3 ; mm7 select vals < thresh from blurred result | ||
| 124 | paddusw xmm1, xmm7 ; combination | ||
| 125 | 136 | ||
| 126 | packuswb xmm1, xmm0 ; pack to bytes | 137 | movdqu XMMWORD PTR [rdi], xmm0 |
| 127 | movq QWORD PTR [rdi], xmm1 ; | ||
| 128 | 138 | ||
| 129 | neg rax ; pitch is positive | 139 | neg rax ; positive stride |
| 130 | add rsi, 8 | 140 | add rsi, 16 |
| 131 | add rdi, 8 | 141 | add rdi, 16 |
| 132 | 142 | ||
| 133 | add rdx, 8 | 143 | UPDATE_FLIMIT |
| 134 | cmp edx, dword arg(5) ;cols | ||
| 135 | 144 | ||
| 145 | add rdx, 16 | ||
| 146 | cmp edx, dword arg(4) ;cols | ||
| 136 | jl .nextcol | 147 | jl .nextcol |
| 137 | 148 | ||
| 138 | ; done with the all cols, start the across filtering in place | 149 | ; done with the all cols, start the across filtering in place |
| 139 | sub rsi, rdx | 150 | sub rsi, rdx |
| 140 | sub rdi, rdx | 151 | sub rdi, rdx |
| 141 | 152 | ||
| 153 | mov rbx, arg(5) ; flimits | ||
| 154 | UPDATE_FLIMIT | ||
| 142 | 155 | ||
| 143 | ; dup the first byte into the left border 8 times | 156 | ; dup the first byte into the left border 8 times |
| 144 | movq mm1, [rdi] | 157 | movq mm1, [rdi] |
| 145 | punpcklbw mm1, mm1 | 158 | punpcklbw mm1, mm1 |
| 146 | punpcklwd mm1, mm1 | 159 | punpcklwd mm1, mm1 |
| 147 | punpckldq mm1, mm1 | 160 | punpckldq mm1, mm1 |
| 148 | |||
| 149 | mov rdx, -8 | 161 | mov rdx, -8 |
| 150 | movq [rdi+rdx], mm1 | 162 | movq [rdi+rdx], mm1 |
| 151 | 163 | ||
| 152 | ; dup the last byte into the right border | 164 | ; dup the last byte into the right border |
| 153 | movsxd rdx, dword arg(5) | 165 | movsxd rdx, dword arg(4) |
| 154 | movq mm1, [rdi + rdx + -1] | 166 | movq mm1, [rdi + rdx + -1] |
| 155 | punpcklbw mm1, mm1 | 167 | punpcklbw mm1, mm1 |
| 156 | punpcklwd mm1, mm1 | 168 | punpcklwd mm1, mm1 |
| @@ -158,113 +170,63 @@ sym(vp8_post_proc_down_and_across_xmm): · 1 unmodified line | |||
| 158 | movq [rdi+rdx], mm1 | 170 | movq [rdi+rdx], mm1 |
| 159 | 171 | ||
| 160 | xor rdx, rdx | 172 | xor rdx, rdx |
| 161 | movq mm0, QWORD PTR [rdi-8]; | 173 | movq mm0, QWORD PTR [rdi-16]; |
| 174 | movq mm1, QWORD PTR [rdi-8]; | ||
| 162 | 175 | ||
| 163 | .acrossnextcol: | 176 | .acrossnextcol: |
| 164 | movq xmm7, QWORD PTR [rdi +rdx -2] | 177 | movdqu xmm0, XMMWORD PTR [rdi + rdx] |
| 165 | movd xmm4, DWORD PTR [rdi +rdx +6] | 178 | movdqu xmm1, XMMWORD PTR [rdi + rdx -2] |
| 166 | 179 | movdqu xmm3, XMMWORD PTR [rdi + rdx -1] | |
| 167 | pslldq xmm4, 8 | 180 | |
| 168 | por xmm4, xmm7 | 181 | FIRST_2_ROWS |
| 169 | 182 | ||
| 170 | movdqa xmm3, xmm4 | 183 | movdqu xmm1, XMMWORD PTR [rdi + rdx +1] |
| 171 | psrldq xmm3, 2 | 184 | movdqu xmm3, XMMWORD PTR [rdi + rdx +2] |
| 172 | punpcklbw xmm3, xmm0 ; mm3 = p0..p3 | 185 | |
| 173 | movdqa xmm1, xmm3 ; mm1 = p0..p3 | 186 | SECOND_2_ROWS |
| 174 | psllw xmm3, 2 | 187 | |
| 175 | 188 | movq QWORD PTR [rdi+rdx-16], mm0 ; store previous 8 bytes | |
| 176 | 189 | movq QWORD PTR [rdi+rdx-8], mm1 ; store previous 8 bytes | |
| 177 | movdqa xmm5, xmm4 | 190 | movdq2q mm0, xmm0 |
| 178 | psrldq xmm5, 3 | 191 | psrldq xmm0, 8 |
| 179 | punpcklbw xmm5, xmm0 ; mm5 = p1..p4 | 192 | movdq2q mm1, xmm0 |
| 180 | paddusw xmm3, xmm5 ; mm3 += mm6 | 193 | |
| 181 | 194 | UPDATE_FLIMIT | |
| 182 | ; thresholding | 195 | |
| 183 | movdqa xmm7, xmm1 ; mm7 = p0..p3 | 196 | add rdx, 16 |
| 184 | psubusw xmm7, xmm5 ; mm7 = p0..p3 - p1..p4 | 197 | cmp edx, dword arg(4) ;cols |
| 185 | psubusw xmm5, xmm1 ; mm5 = p1..p4 - p0..p3 | ||
| 186 | paddusw xmm7, xmm5 ; mm7 = abs(p0..p3 - p1..p4) | ||
| 187 | pcmpgtw xmm7, xmm2 | ||
| 188 | |||
| 189 | movdqa xmm5, xmm4 | ||
| 190 | psrldq xmm5, 4 | ||
| 191 | punpcklbw xmm5, xmm0 ; mm5 = p2..p5 | ||
| 192 | paddusw xmm3, xmm5 ; mm3 += mm5 | ||
| 193 | |||
| 194 | ; thresholding | ||
| 195 | movdqa xmm6, xmm1 ; mm6 = p0..p3 | ||
| 196 | psubusw xmm6, xmm5 ; mm6 = p0..p3 - p1..p4 | ||
| 197 | psubusw xmm5, xmm1 ; mm5 = p1..p4 - p0..p3 | ||
| 198 | paddusw xmm6, xmm5 ; mm6 = abs(p0..p3 - p1..p4) | ||
| 199 | pcmpgtw xmm6, xmm2 | ||
| 200 | por xmm7, xmm6 ; accumulate thresholds | ||
| 201 | |||
| 202 | |||
| 203 | movdqa xmm5, xmm4 ; mm5 = p-2..p5 | ||
| 204 | punpcklbw xmm5, xmm0 ; mm5 = p-2..p1 | ||
| 205 | paddusw xmm3, xmm5 ; mm3 += mm5 | ||
| 206 | |||
| 207 | ; thresholding | ||
| 208 | movdqa xmm6, xmm1 ; mm6 = p0..p3 | ||
| 209 | psubusw xmm6, xmm5 ; mm6 = p0..p3 - p1..p4 | ||
| 210 | psubusw xmm5, xmm1 ; mm5 = p1..p4 - p0..p3 | ||
| 211 | paddusw xmm6, xmm5 ; mm6 = abs(p0..p3 - p1..p4) | ||
| 212 | pcmpgtw xmm6, xmm2 | ||
| 213 | por xmm7, xmm6 ; accumulate thresholds | ||
| 214 | |||
| 215 | psrldq xmm4, 1 ; mm4 = p-1..p5 | ||
| 216 | punpcklbw xmm4, xmm0 ; mm4 = p-1..p2 | ||
| 217 | paddusw xmm3, xmm4 ; mm3 += mm5 | ||
| 218 | |||
| 219 | ; thresholding | ||
| 220 | movdqa xmm6, xmm1 ; mm6 = p0..p3 | ||
| 221 | psubusw xmm6, xmm4 ; mm6 = p0..p3 - p1..p4 | ||
| 222 | psubusw xmm4, xmm1 ; mm5 = p1..p4 - p0..p3 | ||
| 223 | paddusw xmm6, xmm4 ; mm6 = abs(p0..p3 - p1..p4) | ||
| 224 | pcmpgtw xmm6, xmm2 | ||
| 225 | por xmm7, xmm6 ; accumulate thresholds | ||
| 226 | |||
| 227 | paddusw xmm3, RD42 ; mm3 += round value | ||
| 228 | psraw xmm3, 3 ; mm3 /= 8 | ||
| 229 | |||
| 230 | pand xmm1, xmm7 ; mm1 select vals > thresh from source | ||
| 231 | pandn xmm7, xmm3 ; mm7 select vals < thresh from blurred result | ||
| 232 | paddusw xmm1, xmm7 ; combination | ||
| 233 | |||
| 234 | packuswb xmm1, xmm0 ; pack to bytes | ||
| 235 | movq QWORD PTR [rdi+rdx-8], mm0 ; store previous four bytes | ||
| 236 | movdq2q mm0, xmm1 | ||
| 237 | |||
| 238 | add rdx, 8 | ||
| 239 | cmp edx, dword arg(5) ;cols | ||
| 240 | jl .acrossnextcol; | 198 | jl .acrossnextcol; |
| 241 | 199 | ||
| 242 | ; last 8 pixels | 200 | ; last 16 pixels |
| 243 | movq QWORD PTR [rdi+rdx-8], mm0 | 201 | movq QWORD PTR [rdi+rdx-16], mm0 |
| 244 | 202 | ||
| 203 | cmp edx, dword arg(4) | ||
| 204 | jne .throw_last_8 | ||
| 205 | movq QWORD PTR [rdi+rdx-8], mm1 | ||
| 206 | .throw_last_8: | ||
| 245 | ; done with this rwo | 207 | ; done with this rwo |
| 246 | add rsi,rax ; next line | 208 | add rsi,rax ;next src line |
| 247 | mov eax, dword arg(3) ;dst_pixels_per_line ; destination pitch? | 209 | mov eax, dword arg(3) ;dst_pixels_per_line |
| 248 | add rdi,rax ; next destination | 210 | add rdi,rax ;next destination |
| 249 | mov eax, dword arg(2) ;src_pixels_per_line ; destination pitch? | 211 | mov eax, dword arg(2) ;src_pixels_per_line |
| 250 | 212 | ||
| 251 | dec rcx ; decrement count | 213 | mov rbx, arg(5) ;flimits |
| 252 | jnz .nextrow ; next row | 214 | UPDATE_FLIMIT |
| 253 | 215 | ||
| 254 | %if ABI_IS_32BIT=1 && CONFIG_PIC=1 | 216 | dec rcx ;decrement count |
| 255 | add rsp,16 | 217 | jnz .nextrow ;next row |
| 218 | |||
| 219 | add rsp, 16 | ||
| 256 | pop rsp | 220 | pop rsp |
| 257 | %endif | ||
| 258 | ; begin epilog | 221 | ; begin epilog |
| 259 | pop rdi | 222 | pop rdi |
| 260 | pop rsi | 223 | pop rsi |
| 261 | RESTORE_GOT | 224 | pop rbx |
| 262 | RESTORE_XMM | 225 | RESTORE_XMM |
| 263 | UNSHADOW_ARGS | 226 | UNSHADOW_ARGS |
| 264 | pop rbp | 227 | pop rbp |
| 265 | ret | 228 | ret |
| 266 | %undef RD42 | 229 | %undef flimit |
| 267 | |||
| 268 | 230 | ||
| 269 | ;void vp8_mbpost_proc_down_xmm(unsigned char *dst, | 231 | ;void vp8_mbpost_proc_down_xmm(unsigned char *dst, |
| 270 | ; int pitch, int rows, int cols,int flimit) | 232 | ; int pitch, int rows, int cols,int flimit) |
| @@ -753,7 +715,5 @@ sym(vp8_plane_add_noise_wmt): · 482 unmodified lines | |||
| 753 | 715 | ||
| 754 | SECTION_RODATA | 716 | SECTION_RODATA |
| 755 | align 16 | 717 | align 16 |
| 756 | rd42: | ||
| 757 | times 8 dw 0x04 | ||
| 758 | four8s: | 718 | four8s: |
| 759 | times 4 dd 8 | 719 | times 4 dd 8 |
| @@ -5301,7 +5301,7 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l · 5300 unmodified lines | |||
| 5301 | double frame_psnr2, frame_ssim2 = 0; | 5301 | double frame_psnr2, frame_ssim2 = 0; |
| 5302 | double weight = 0; | 5302 | double weight = 0; |
| 5303 | 5303 | ||
| 5304 | vp8_deblock(cm->frame_to_show, &cm->post_proc_buffer, cm->filter_level * 10 / 6, 1, 0); | 5304 | vp8_deblock(cm, cm->frame_to_show, &cm->post_proc_buffer, cm->filter_level * 10 / 6, 1, 0); |
| 5305 | vp8_clear_system_state(); | 5305 | vp8_clear_system_state(); |
| 5306 | 5306 | ||
| 5307 | ye = calc_plane_error(orig->y_buffer, orig->y_stride, | 5307 | ye = calc_plane_error(orig->y_buffer, orig->y_stride, |