static void PerformCompression(RomFile rom, VirtualFile entry) { var slice = rom.Slice(entry); var decoded = Yaz.Decode(slice); var encoded = Yaz.EncodeWithHeader(decoded, slice); // Yaz.EncodeAndCopy(decoded); var aligned = Yaz.AlignTo16(encoded); // Currently only compares compressed lengths, as compressed output is likely slightly different due to optimization. Assert.AreEqual(slice.Length, aligned); }
public int EncodeNew() { int result = 0; foreach (var sample in Samples) { var slice = Rom.Slice(sample); var decoded = Yaz.Decode(slice); result = Yaz.EncodeWithHeader(decoded, slice); // Fill remaining bytes with 0. slice.Slice(result).Fill(0); } return(result); }