public static string Decompressor(string filename, int pixels, int pixelsPerBlock, int mask) { /** * Temporary Workarround. Needs to change directly on Demuxer */ string outputFile = String.Format("{0}_decomp.lrit", filename); byte[] outputData = new byte[pixels]; for (int i = 0; i < pixels; i++) { outputData[i] = 0x00; } try { byte[] inputData = File.ReadAllBytes(filename); AEC.LritRiceDecompress(ref outputData, inputData, 8, pixelsPerBlock, pixels, mask); // AEC.ALLOW_K13_OPTION_MASK | AEC.MSB_OPTION_MASK | AEC.NN_OPTION_MASK File.Delete(filename); } catch (Exception e) { if (e is AECException) { AECException aece = (AECException)e; UIConsole.Error(string.Format("AEC Decompress Error: {0}", aece.status.ToString())); } else { UIConsole.Error(string.Format("Decompress error: {0}", e.ToString())); } } File.WriteAllBytes(outputFile, outputData); return(outputFile); }
public static byte[] InMemoryDecompress(byte[] compressedData, int pixels, int pixelsPerBlock, int mask) { byte[] outputData = GenerateFillData(pixels); try { AEC.LritRiceDecompress(ref outputData, compressedData, 8, pixelsPerBlock, pixels, mask); } catch (Exception e) { if (e is AECException) { AECException aece = (AECException)e; UIConsole.Error(string.Format("AEC Decompress Error: {0}", aece.status.ToString())); } else { UIConsole.Error(string.Format("Decompress error: {0}", e.ToString())); } } return(outputData); }