mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Minor bugfixes
This commit is contained in:
@@ -267,7 +267,7 @@ namespace CUETools.Codecs
|
||||
{
|
||||
error += lpc_in[i] * (1 << sh);
|
||||
q = (int)(error + 0.5);
|
||||
if (q <= -qmax) q = -qmax + 1;
|
||||
if (q < -(qmax+1)) q = -(qmax + 1);
|
||||
if (q > qmax) q = qmax;
|
||||
error -= q;
|
||||
lpc_out[i] = q;
|
||||
|
||||
@@ -94,13 +94,14 @@ namespace CUETools.Codecs
|
||||
/// Sorts orders based on Akaike's criteria
|
||||
/// </summary>
|
||||
/// <param name="blocksize">Frame size</param>
|
||||
public void SortOrdersAkaike(int blocksize, int count, int max_order, double alpha, double beta)
|
||||
public void SortOrdersAkaike(int blocksize, int count, int min_order, int max_order, double alpha, double beta)
|
||||
{
|
||||
for (int i = 0; i < max_order; i++)
|
||||
best_orders[i] = i + 1;
|
||||
for (int i = 0; i < max_order && i < count; i++)
|
||||
for (int i = min_order; i <= max_order; i++)
|
||||
best_orders[i - min_order] = i;
|
||||
int lim = max_order - min_order + 1;
|
||||
for (int i = 0; i < lim && i < count; i++)
|
||||
{
|
||||
for (int j = i + 1; j < max_order; j++)
|
||||
for (int j = i + 1; j < lim; j++)
|
||||
{
|
||||
if (Akaike(blocksize, best_orders[j], alpha, beta) < Akaike(blocksize, best_orders[i], alpha, beta))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user