| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 n = tailFrames; | 726 n = tailFrames; |
| 727 } | 727 } |
| 728 #endif | 728 #endif |
| 729 | 729 |
| 730 while (n--) { | 730 while (n--) { |
| 731 float sample = *sourceP; | 731 float sample = *sourceP; |
| 732 sum += sample * sample; | 732 sum += sample * sample; |
| 733 sourceP += sourceStride; | 733 sourceP += sourceStride; |
| 734 } | 734 } |
| 735 | 735 |
| 736 ASSERT(sumP); | 736 DCHECK(sumP); |
| 737 *sumP = sum; | 737 *sumP = sum; |
| 738 } | 738 } |
| 739 | 739 |
| 740 void vmaxmgv(const float* sourceP, | 740 void vmaxmgv(const float* sourceP, |
| 741 int sourceStride, | 741 int sourceStride, |
| 742 float* maxP, | 742 float* maxP, |
| 743 size_t framesToProcess) { | 743 size_t framesToProcess) { |
| 744 int n = framesToProcess; | 744 int n = framesToProcess; |
| 745 float max = 0; | 745 float max = 0; |
| 746 | 746 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 max = std::max(max, vMax[2]); | 822 max = std::max(max, vMax[2]); |
| 823 max = std::max(max, vMax[3]); | 823 max = std::max(max, vMax[3]); |
| 824 } | 824 } |
| 825 #endif | 825 #endif |
| 826 | 826 |
| 827 while (n--) { | 827 while (n--) { |
| 828 max = std::max(max, fabsf(*sourceP)); | 828 max = std::max(max, fabsf(*sourceP)); |
| 829 sourceP += sourceStride; | 829 sourceP += sourceStride; |
| 830 } | 830 } |
| 831 | 831 |
| 832 ASSERT(maxP); | 832 DCHECK(maxP); |
| 833 *maxP = max; | 833 *maxP = max; |
| 834 } | 834 } |
| 835 | 835 |
| 836 void vclip(const float* sourceP, | 836 void vclip(const float* sourceP, |
| 837 int sourceStride, | 837 int sourceStride, |
| 838 const float* lowThresholdP, | 838 const float* lowThresholdP, |
| 839 const float* highThresholdP, | 839 const float* highThresholdP, |
| 840 float* destP, | 840 float* destP, |
| 841 int destStride, | 841 int destStride, |
| 842 size_t framesToProcess) { | 842 size_t framesToProcess) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 sourceP += sourceStride; | 888 sourceP += sourceStride; |
| 889 destP += destStride; | 889 destP += destStride; |
| 890 } | 890 } |
| 891 } | 891 } |
| 892 | 892 |
| 893 #endif // OS(MACOSX) | 893 #endif // OS(MACOSX) |
| 894 | 894 |
| 895 } // namespace VectorMath | 895 } // namespace VectorMath |
| 896 | 896 |
| 897 } // namespace blink | 897 } // namespace blink |
| OLD | NEW |