| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 CONVOLVE_ONE_SAMPLE(); // 63 | 457 CONVOLVE_ONE_SAMPLE(); // 63 |
| 458 CONVOLVE_ONE_SAMPLE(); // 64 | 458 CONVOLVE_ONE_SAMPLE(); // 64 |
| 459 } else { | 459 } else { |
| 460 while (n--) { | 460 while (n--) { |
| 461 // Non-optimized using actual while loop. | 461 // Non-optimized using actual while loop. |
| 462 CONVOLVE_ONE_SAMPLE(); | 462 CONVOLVE_ONE_SAMPLE(); |
| 463 } | 463 } |
| 464 } | 464 } |
| 465 #endif | 465 #endif |
| 466 } | 466 } |
| 467 #undef CONVOLVE_ONE_SAMPLE |
| 467 | 468 |
| 468 // Linearly interpolate the two "convolutions". | 469 // Linearly interpolate the two "convolutions". |
| 469 double result = (1.0 - kernel_interpolation_factor) * sum1 + | 470 double result = (1.0 - kernel_interpolation_factor) * sum1 + |
| 470 kernel_interpolation_factor * sum2; | 471 kernel_interpolation_factor * sum2; |
| 471 | 472 |
| 472 *destination++ = result; | 473 *destination++ = result; |
| 473 | 474 |
| 474 // Advance the virtual index. | 475 // Advance the virtual index. |
| 475 virtual_source_index_ += scale_factor_; | 476 virtual_source_index_ += scale_factor_; |
| 476 | 477 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 487 memcpy(r1, r3, sizeof(float) * (kernel_size_ / 2)); | 488 memcpy(r1, r3, sizeof(float) * (kernel_size_ / 2)); |
| 488 memcpy(r2, r4, sizeof(float) * (kernel_size_ / 2)); | 489 memcpy(r2, r4, sizeof(float) * (kernel_size_ / 2)); |
| 489 | 490 |
| 490 // Step (4) | 491 // Step (4) |
| 491 // Refresh the buffer with more input. | 492 // Refresh the buffer with more input. |
| 492 ConsumeSource(r5, block_size_); | 493 ConsumeSource(r5, block_size_); |
| 493 } | 494 } |
| 494 } | 495 } |
| 495 | 496 |
| 496 } // namespace blink | 497 } // namespace blink |
| OLD | NEW |