2011-10-24 11:50:45 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CUETools.Codecs.FLAKE
|
|
|
|
|
|
{
|
|
|
|
|
|
unsafe public class FlacSubframeInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
public FlacSubframeInfo()
|
|
|
|
|
|
{
|
|
|
|
|
|
best = new FlacSubframe();
|
2014-08-26 23:48:16 -04:00
|
|
|
|
sf = new LpcSubframeInfo();
|
2014-12-08 22:18:34 -05:00
|
|
|
|
best_fixed = new ulong[5];
|
2011-10-24 11:50:45 +00:00
|
|
|
|
lpc_ctx = new LpcContext[lpc.MAX_LPC_WINDOWS];
|
|
|
|
|
|
for (int i = 0; i < lpc.MAX_LPC_WINDOWS; i++)
|
|
|
|
|
|
lpc_ctx[i] = new LpcContext();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Init(int* s, int* r, int bps, int w)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (w > bps)
|
|
|
|
|
|
throw new Exception("internal error");
|
|
|
|
|
|
samples = s;
|
|
|
|
|
|
obits = bps - w;
|
|
|
|
|
|
wbits = w;
|
2014-12-08 22:18:34 -05:00
|
|
|
|
for (int o = 0; o <= 4; o++)
|
|
|
|
|
|
best_fixed[o] = 0;
|
2011-10-24 11:50:45 +00:00
|
|
|
|
best.residual = r;
|
|
|
|
|
|
best.type = SubframeType.Verbatim;
|
|
|
|
|
|
best.size = AudioSamples.UINT32_MAX;
|
2014-08-26 23:48:16 -04:00
|
|
|
|
sf.Reset();
|
2011-10-24 11:50:45 +00:00
|
|
|
|
for (int iWindow = 0; iWindow < lpc.MAX_LPC_WINDOWS; iWindow++)
|
|
|
|
|
|
lpc_ctx[iWindow].Reset();
|
2014-08-26 23:48:16 -04:00
|
|
|
|
//sf.obits = obits;
|
2011-10-24 11:50:45 +00:00
|
|
|
|
done_fixed = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public FlacSubframe best;
|
|
|
|
|
|
public int obits;
|
|
|
|
|
|
public int wbits;
|
|
|
|
|
|
public int* samples;
|
|
|
|
|
|
public uint done_fixed;
|
2014-12-08 22:18:34 -05:00
|
|
|
|
public ulong[] best_fixed;
|
2011-10-24 11:50:45 +00:00
|
|
|
|
public LpcContext[] lpc_ctx;
|
2014-08-26 23:48:16 -04:00
|
|
|
|
public LpcSubframeInfo sf;
|
2011-10-24 11:50:45 +00:00
|
|
|
|
};
|
|
|
|
|
|
}
|