title: How are quantized DCT coeffiecients serialised in JPEG?
body: <p>I've read in dozens of articles, scientific papers, and toy implementations that the steps in JPEG compression are roughly as follows</p>
  
  <ol>
  <li>Take 8x8 DCT</li>
  <li>Divide by quantization matrix</li>
  <li>Round to integers</li>
  <li>Run-length &amp; Hufmann</li>
  </ol>
  
  <p>And then the inverse is pretty much the same. What is left out in everything on the topic I've found so far is the magnitude of the data and the corresponding serialization.</p>
  
  <p>It appears implicitly assumed that all the coefficients are stored as unsigned bytes. However, as I understand it, the DC coefficient is in the range 0-255, while the AC coefficients can be negative. Are the AC coefficients in the range ±255, or ±127, or something else?</p>
  
  <p>What is the common way to store these coefficients in a compact way?</p>