The decoded coefficients are still quantized and still in zig-zag order. Today you multiply them by their quantization table and scatter them into an 8-by-8 grid, undoing both at once.
Multiply each zig-zag coefficient by its quantization value and place the result into an 8-by-8 grid in natural order.
The entropy decoder handed you coefficients that are both quantized (divided down by the encoder) and in zig-zag order. Undoing quantization is a plain elementwise multiply: coefficient k times quant-table entry k, both indexed in the same zig-zag sequence. The result is the reconstructed frequency coefficient - approximately, since quantization threw away the remainder, which is exactly where JPEG’s loss lives.
Because the quantization table is stored in zig-zag order too, you multiply in zig-zag space and then use the same ZigZag map from the tables chapter to scatter each product into its natural grid position. So zig-zag entry 0 (the DC, 3 * 16 = 48) lands at grid index 0, and zig-zag entry 1 (3 * 11 = 33) lands at grid index 1. Doing both steps in one pass keeps the code tight and leaves you with a natural-order 8-by-8 grid of frequency coefficients - exactly what the inverse DCT expects as input.
// both arrays are in zig-zag order; multiply elementwise, then scatter:// grid[ZigZag[k]] = coef[k] * quant[k]func dequantize(coef [64]int, quant QuantTable) (grid [64]int) { }