text
stringlengths
0
2.2M
reflectionCoefficients.push_back(higherOrderCoefficients[quantizedReflectionCoefficients[i] + 64]);
}
}
void LinearPredictor::generatelinearPredictionCoefficients()
{
linearPredictionCoefficients.reserve((size_t)(optimalLpcOrder + 1));
double linearPredictionCoefficientMatrix[MAX_LPC_ORDER][MAX_LPC_ORDER];
double lpcTmp[MAX_LPC_ORDER];
const uint64_t correction = (uint64_t)1 << CORRECTION_FACTOR;
// Generate LPC matrix
for (uint8_t i = 0; i < optimalLpcOrder; i++) {
lpcTmp[i] = reflectionCoefficients[i];
int32_t i2 = i >> 1;
int32_t j = 0;
for (j = 0; j < i2; j++) {
double tmp = lpcTmp[j];
lpcTmp[j] += reflectionCoefficients[i] * lpcTmp[i - 1 - j];
lpcTmp[i - 1 - j] += reflectionCoefficients[i] * tmp;
}
if (i % 2 == 1) {
lpcTmp[j] += lpcTmp[j] * reflectionCoefficients[i];
}
for (j = 0; j <= i; j++) {
linearPredictionCoefficientMatrix[i][j] = -lpcTmp[j];
}
}
// Select optimum order row from matrix
linearPredictionCoefficients.push_back(0);
for (int i = 0; i < optimalLpcOrder; i++) {
linearPredictionCoefficients.push_back((int64_t)(correction * linearPredictionCoefficientMatrix[optimalLpcOrder - 1][i]));
}
}
}
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define FOLLY_F14_PERTURB_INSERTION_ORDER 0
#include <folly/IPAddress.h>
#include <folly/Range.h>
#include <folly/SocketAddress.h>
#include <folly/container/F14Map.h>
#include <folly/container/F14Set.h>
#include <folly/dynamic.h>
#include <folly/support/test/GdbUtil.h>
#pragma GCC diagnostic ignored "-Wunused-variable"
int main() {
using namespace folly;
// FBString
fbstring empty = "";
fbstring small = "small";
fbstring maxsmall = "12345678901234567890123";
fbstring minmed = "123456789012345678901234";
fbstring large =
"abcdefghijklmnopqrstuvwxyz123456"
"abcdefghijklmnopqrstuvwxyz123456"
"abcdefghijklmnopqrstuvwxyz123456"
"abcdefghijklmnopqrstuvwxyz123456"
"abcdefghijklmnopqrstuvwxyz123456"
"abcdefghijklmnopqrstuvwxyz123456"
"abcdefghijklmnopqrstuvwxyz123456"
"abcdefghijklmnopqrstuvwxyz123456";
// StringPiece
auto emptypiece = StringPiece("");
auto otherpiece = StringPiece("strings. Strings! STRINGS!!");
// Range
std::array<int, 6> nums = {{1, 2, 3, 4, 5, 6}};
auto num_range = Range<const int*>(nums);
// Dynamic
dynamic dynamic_null = nullptr;
dynamic dynamic_array = dynamic::array("A string", 1, 2, 3, 4, 5);
dynamic dynamic_bool = true;
dynamic dynamic_double = 0.25;
dynamic dynamic_int64 = 8675309;
dynamic dynamic_string = "Hi!";
dynamic dynamic_object = dynamic::object;