OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 8); | 420 8); |
421 vp8_post_proc_down_and_across_mb_row( | 421 vp8_post_proc_down_and_across_mb_row( |
422 source->v_buffer + 8 * mbr * source->uv_stride, | 422 source->v_buffer + 8 * mbr * source->uv_stride, |
423 source->v_buffer + 8 * mbr * source->uv_stride, | 423 source->v_buffer + 8 * mbr * source->uv_stride, |
424 source->uv_stride, source->uv_stride, source->uv_width, limits, | 424 source->uv_stride, source->uv_stride, source->uv_width, limits, |
425 8); | 425 8); |
426 } | 426 } |
427 } | 427 } |
428 } | 428 } |
429 | 429 |
430 double vp8_gaussian(double sigma, double mu, double x) | 430 static double gaussian(double sigma, double mu, double x) |
431 { | 431 { |
432 return 1 / (sigma * sqrt(2.0 * 3.14159265)) * | 432 return 1 / (sigma * sqrt(2.0 * 3.14159265)) * |
433 (exp(-(x - mu) * (x - mu) / (2 * sigma * sigma))); | 433 (exp(-(x - mu) * (x - mu) / (2 * sigma * sigma))); |
434 } | 434 } |
435 | 435 |
436 static void fillrd(struct postproc_state *state, int q, int a) | 436 static void fillrd(struct postproc_state *state, int q, int a) |
437 { | 437 { |
438 char char_dist[300]; | 438 char char_dist[300]; |
439 | 439 |
440 double sigma; | 440 double sigma; |
441 int i; | 441 int i; |
442 | 442 |
443 vp8_clear_system_state(); | 443 vp8_clear_system_state(); |
444 | 444 |
445 | 445 |
446 sigma = a + .5 + .6 * (63 - q) / 63.0; | 446 sigma = a + .5 + .6 * (63 - q) / 63.0; |
447 | 447 |
448 /* set up a lookup table of 256 entries that matches | 448 /* set up a lookup table of 256 entries that matches |
449 * a gaussian distribution with sigma determined by q. | 449 * a gaussian distribution with sigma determined by q. |
450 */ | 450 */ |
451 { | 451 { |
452 int next, j; | 452 int next, j; |
453 | 453 |
454 next = 0; | 454 next = 0; |
455 | 455 |
456 for (i = -32; i < 32; i++) | 456 for (i = -32; i < 32; i++) |
457 { | 457 { |
458 const int v = (int)(.5 + 256 * vp8_gaussian(sigma, 0, i)); | 458 const int v = (int)(.5 + 256 * gaussian(sigma, 0, i)); |
459 | 459 |
460 if (v) | 460 if (v) |
461 { | 461 { |
462 for (j = 0; j < v; j++) | 462 for (j = 0; j < v; j++) |
463 { | 463 { |
464 char_dist[next+j] = (char) i; | 464 char_dist[next+j] = (char) i; |
465 } | 465 } |
466 | 466 |
467 next = next + j; | 467 next = next + j; |
468 } | 468 } |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 | 1197 |
1198 *dest = oci->post_proc_buffer; | 1198 *dest = oci->post_proc_buffer; |
1199 | 1199 |
1200 /* handle problem with extending borders */ | 1200 /* handle problem with extending borders */ |
1201 dest->y_width = oci->Width; | 1201 dest->y_width = oci->Width; |
1202 dest->y_height = oci->Height; | 1202 dest->y_height = oci->Height; |
1203 dest->uv_height = dest->y_height / 2; | 1203 dest->uv_height = dest->y_height / 2; |
1204 return 0; | 1204 return 0; |
1205 } | 1205 } |
1206 #endif | 1206 #endif |
OLD | NEW |