mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Flake: fixed minor issue in previous commit
This commit is contained in:
@@ -2257,17 +2257,33 @@ new int[] { // 30
|
||||
_totalSize += fs;
|
||||
|
||||
if (verify != null)
|
||||
{
|
||||
int decoded = verify.DecodeFrame(frame_buffer, 0, fs);
|
||||
if (decoded != fs || verify.Remaining != bs)
|
||||
throw new Exception(Properties.Resources.ExceptionValidationFailed);
|
||||
fixed (int* s = verifyBuffer, r = verify.Samples)
|
||||
try
|
||||
{
|
||||
for (int ch = 0; ch < channels; ch++)
|
||||
if (AudioSamples.MemCmp(s + ch * Flake.MAX_BLOCKSIZE, r + ch * Flake.MAX_BLOCKSIZE, bs))
|
||||
throw new Exception(Properties.Resources.ExceptionValidationFailed);
|
||||
int decoded = verify.DecodeFrame(frame_buffer, 0, fs);
|
||||
if (decoded != fs || verify.Remaining != bs)
|
||||
throw new Exception(Properties.Resources.ExceptionValidationFailed);
|
||||
fixed (int* s = verifyBuffer, r = verify.Samples)
|
||||
{
|
||||
for (int ch = 0; ch < channels; ch++)
|
||||
if (AudioSamples.MemCmp(s + ch * Flake.MAX_BLOCKSIZE, r + ch * Flake.MAX_BLOCKSIZE, bs))
|
||||
throw new Exception(Properties.Resources.ExceptionValidationFailed);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (channels == 2)
|
||||
//{
|
||||
// var sw = new WAVWriter(string.Format("verify_{0}.wav", this.frame_count), new WAVWriterSettings(this.Settings.PCM));
|
||||
// sw.FinalSampleCount = this.frame.blocksize;
|
||||
// var ab = new AudioBuffer(this.Settings.PCM, this.frame.blocksize);
|
||||
// ab.Prepare(this.frame.blocksize);
|
||||
// fixed (int* abs = ab.Samples, s = verifyBuffer)
|
||||
// AudioSamples.Interlace(abs, s, s + Flake.MAX_BLOCKSIZE, this.frame.blocksize);
|
||||
// sw.Write(ab);
|
||||
// sw.Close();
|
||||
//} else
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
if (bs < m_blockSize)
|
||||
{
|
||||
|
||||
@@ -754,7 +754,6 @@ namespace CUETools.Codecs
|
||||
long pred = coefs[2] * (long)*(s++);
|
||||
pred += c1 * (long)*(s++);
|
||||
pred += c0 * (long)*(s++);
|
||||
*(r++) = *s - (int)(pred >> shift);
|
||||
int d = *(r++) = *s - (int)(pred >> shift);
|
||||
sum += (uint)((d << 1) ^ (d >> 31));
|
||||
s -= 2;
|
||||
|
||||
BIN
CUETools/CUETools.TestCodecs/hires1.flac
Normal file
BIN
CUETools/CUETools.TestCodecs/hires1.flac
Normal file
Binary file not shown.
Reference in New Issue
Block a user