internal HuffmanTable(JpegHuffmanTable table) { if (table != null) { huffval = table.Values; bits = table.Lengths; GenerateSizeTable(); GenerateCodeTable(); GenerateDecoderTables(); } else { // Encode initialization bitsList = new List<short[]>(); bitsList.Add(JpegHuffmanTable.StdDCLuminance.Lengths); bitsList.Add(JpegHuffmanTable.StdACLuminance.Lengths); bitsList.Add(JpegHuffmanTable.StdDCChrominance.Lengths); bitsList.Add(JpegHuffmanTable.StdACChrominance.Lengths); val = new List<short[]>(); val.Add(JpegHuffmanTable.StdDCLuminance.Values); val.Add(JpegHuffmanTable.StdACLuminance.Values); val.Add(JpegHuffmanTable.StdDCChrominance.Values); val.Add(JpegHuffmanTable.StdACChrominance.Values); initHuf(); } }
internal HuffmanTable(JpegHuffmanTable table) { if (table != null) { huffval = table.Values; bits = table.Lengths; GenerateSizeTable(); GenerateCodeTable(); GenerateDecoderTables(); } else { // Encode initialization bitsList = new List <short[]>(); bitsList.Add(JpegHuffmanTable.StdDCLuminance.Lengths); bitsList.Add(JpegHuffmanTable.StdACLuminance.Lengths); bitsList.Add(JpegHuffmanTable.StdDCChrominance.Lengths); bitsList.Add(JpegHuffmanTable.StdACChrominance.Lengths); val = new List <short[]>(); val.Add(JpegHuffmanTable.StdDCLuminance.Values); val.Add(JpegHuffmanTable.StdACLuminance.Values); val.Add(JpegHuffmanTable.StdDCChrominance.Values); val.Add(JpegHuffmanTable.StdACChrominance.Values); initHuf(); } }
internal HuffmanTable(JpegHuffmanTable table) { if (table != null) { this.huffval = table.Values; this.bits = table.Lengths; this.GenerateSizeTable(); this.GenerateCodeTable(); this.GenerateDecoderTables(); } else { this.bitsList = new List<short[]>(); this.bitsList.Add(JpegHuffmanTable.StdDCLuminance.Lengths); this.bitsList.Add(JpegHuffmanTable.StdACLuminance.Lengths); this.bitsList.Add(JpegHuffmanTable.StdDCChrominance.Lengths); this.bitsList.Add(JpegHuffmanTable.StdACChrominance.Lengths); this.val = new List<short[]>(); this.val.Add(JpegHuffmanTable.StdDCLuminance.Values); this.val.Add(JpegHuffmanTable.StdACLuminance.Values); this.val.Add(JpegHuffmanTable.StdDCChrominance.Values); this.val.Add(JpegHuffmanTable.StdACChrominance.Values); this.initHuf(); } }
internal HuffmanTable(JpegHuffmanTable table) { if (table != null) { this.huffval = table.Values; this.bits = table.Lengths; this.GenerateSizeTable(); this.GenerateCodeTable(); this.GenerateDecoderTables(); } else { this.bitsList = new List <short[]>(); this.bitsList.Add(JpegHuffmanTable.StdDCLuminance.Lengths); this.bitsList.Add(JpegHuffmanTable.StdACLuminance.Lengths); this.bitsList.Add(JpegHuffmanTable.StdDCChrominance.Lengths); this.bitsList.Add(JpegHuffmanTable.StdACChrominance.Lengths); this.val = new List <short[]>(); this.val.Add(JpegHuffmanTable.StdDCLuminance.Values); this.val.Add(JpegHuffmanTable.StdACLuminance.Values); this.val.Add(JpegHuffmanTable.StdDCChrominance.Values); this.val.Add(JpegHuffmanTable.StdACChrominance.Values); this.initHuf(); } }
//private int mcus_per_row(JpegComponent c) //{ // return (((((this.Width * c.factorH) + (this.Scan.MaxH - 1)) / this.Scan.MaxH) + 7) / 8); //} public void setHuffmanTables(byte componentID, JpegHuffmanTable ACTable, JpegHuffmanTable DCTable) { JpegComponent componentById = this.Scan.GetComponentById(componentID); if (DCTable != null) { componentById.setDCTable(DCTable); } if (ACTable != null) { componentById.setACTable(ACTable); } }
public void setDCTable(JpegHuffmanTable table) { this.DCTable = new HuffmanTable(table); }