Answers.Body: <p>This is a complex topic, so best to link and excerpt</p>
  
  <p>From <a href="https://sonnati.wordpress.com/2010/10/19/h-264-for-image-compression/" rel="nofollow noreferrer">https://sonnati.wordpress.com/2010/10/19/h-264-for-image-compression/</a></p>
  
  <blockquote>
    <p>H.264 contains a number of new features that allow it to compress
    images much more efficiently than JPG.</p>
    
    <p>New transform design</p>
    
    <p>Differently from JPG, an exact-match integer 4×4 spatial block
    transform is used instead of the well known 8×8 DCT. It is
    conceptually similar to DCT but with less ringing artifacts.  There is
    also a 8×8 spatial block transform for less detailed areas and chroma.</p>
    
    <p>A secondary Hadamard Transform (2×2 on chroma and 4×4 on luma) can be
    usually performed on “DC” coefficients to obtain even more compression
    in smooth regions.</p>
    
    <p>There is also an optimized quantization and two possible zig-zag
    pattern for Run Length Encoding of transformed coefficients.</p>
    
    <p>Intra-frame compression</p>
    
    <p>H.264 introduces complex spatial prediction for intra-frame
    compression. Rather than the “DC”-only prediction found in MPEG2 and
    the transform coefficient prediction found in H.263+, H.264 defines 6
    prediction directions (modes) to predict spatial information from
    neighbouring blocks when encoded using 4×4 transform. The encoder
    tries to predict the block interpolating the color value of adiacent
    blocks. Only the delta signal is therefore transmitted.</p>
    
    <p>There are also 4 prediction modes for smooth color zones (16×16
    blocks). Residual data are coded with 4×4 trasforms and a further 4×4
    Hadamard trasform is used for DC coefficients.</p>
    
    <p>Improved quantization</p>
    
    <p>A new logarithmic quantization step is used (compound rate 12%). It’s
    also possible to use Frequency-customized quantization scaling
    matrices selected by the encoder for perceptual-based quantization
    optimization.</p>
    
    <p>Inloop deblocking filter</p>
    
    <p>An adaptive deblocking filter is applied to reduce eventual blocking
    artifacts at high compression ratio.</p>
    
    <p>Advanced Entropy Coding</p>
    
    <p>H.264 can use the state of the art in entropy coding: Context Adaptive
    Binary Arithmetic Coding (CABAC) which is much more efficient than the
    standard Huffman coding used in JPG.</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-25T14:05:12.910Z
Answers.LastActivityDate: 2017-11-25T14:05:12.910Z
Answers.UserDisplayName: Gyan
Body: <p>I was looking at how JPEG compression works, and to me it seems to be really similar to what H.264 (and other video codecs) does with its intraframe prediction step.</p>
  
  <p>In both algorithms the image frame is "chroma-downsampled", divided into small blocks, and then DCT and quantization are applied. Finally the frame/picture is encoded into a bitstream using Huffman coding.</p>
  
  <p>Is this correct? Are there important differences between JPEG and H.264 intraframe compressions that I'm missing?</p>
  
Tags: <compression><h.264>
Title: Are JPEG compression and H.264 intraframe compression the same process?
UserDisplayName: mcont
ThreadText: # Are JPEG compression and H.264 intraframe compression the same process?
  
  (Asked by: username_0 on 2017-11-24)
  
  I was looking at how JPEG compression works, and to me it seems to be really similar to what H.264 (and other video codecs) does with its intraframe prediction step.
  
  In both algorithms the image frame is "chroma-downsampled", divided into small blocks, and then DCT and quantization are applied. Finally the frame/picture is encoded into a bitstream using Huffman coding.
  
  Is this correct? Are there important differences between JPEG and H.264 intraframe compressions that I'm missing?
  
  **Tags:** compression, h.264
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-11-25. Score: 3 | Accepted answer
  
  This is a complex topic, so best to link and excerpt
  
  From <https://sonnati.wordpress.com/2010/10/19/h-264-for-image-compression/>
  
  > H.264 contains a number of new features that allow it to compress
  > images much more efficiently than JPG.
  >
  > New transform design
  >
  > Differently from JPG, an exact-match integer 4×4 spatial block
  > transform is used instead of the well known 8×8 DCT. It is
  > conceptually similar to DCT but with less ringing artifacts. There is
  > also a 8×8 spatial block transform for less detailed areas and chroma.
  >
  > A secondary Hadamard Transform (2×2 on chroma and 4×4 on luma) can be
  > usually performed on “DC” coefficients to obtain even more compression
  > in smooth regions.
  >
  > There is also an optimized quantization and two possible zig-zag
  > pattern for Run Length Encoding of transformed coefficients.
  >
  > Intra-frame compression
  >
  > H.264 introduces complex spatial prediction for intra-frame
  > compression. Rather than the “DC”-only prediction found in MPEG2 and
  > the transform coefficient prediction found in H.263+, H.264 defines 6
  > prediction directions (modes) to predict spatial information from
  > neighbouring blocks when encoded using 4×4 transform. The encoder
  > tries to predict the block interpolating the color value of adiacent
  > blocks. Only the delta signal is therefore transmitted.
  >
  > There are also 4 prediction modes for smooth color zones (16×16
  > blocks). Residual data are coded with 4×4 trasforms and a further 4×4
  > Hadamard trasform is used for DC coefficients.
  >
  > Improved quantization
  >
  > A new logarithmic quantization step is used (compound rate 12%). It’s
  > also possible to use Frequency-customized quantization scaling
  > matrices selected by the encoder for perceptual-based quantization
  > optimization.
  >
  > Inloop deblocking filter
  >
  > An adaptive deblocking filter is applied to reduce eventual blocking
  > artifacts at high compression ratio.
  >
  > Advanced Entropy Coding
  >
  > H.264 can use the state of the art in entropy coding: Context Adaptive
  > Binary Arithmetic Coding (CABAC) which is much more efficient than the
  > standard Huffman coding used in JPG.
  
  
  ---
  
  