title: Does Gzip/Deflate recognize patterns
body: <p>I am studying the inner-workings of Gzip, and I understand that it uses a combination of <a href="https://en.wikipedia.org/wiki/Huffman_coding" rel="nofollow noreferrer">Huffman Coding</a> and <a href="https://en.wikipedia.org/wiki/LZ77_and_LZ78" rel="nofollow noreferrer">LZ77</a>. </p>
  
  <p>I also realize that a Gzip file is divided into blocks, and each block has a dictionary built for it. Then frequent occurrences of similar data are replaced by pointers pointing at locations in the dictionary.</p>
  
  <p>So the phrase "horses race other horses" would have the word <strong>horses</strong> replaced by a pointer. </p>
  
  <p>However what if I have an array of 32 bit integers, but it only stores numbers up to 24 bits? For arguments sake lets say these 24 bit numbers are very random and hard to compress and hard to find repetition in. </p>
  
  <p>This would make the first 8 bits of every integer an easy to compress string of 0's, but each string would need a pointer and each pointer still takes up some amount of data. Even a 1 bit pointer (which I know is smaller than what's realistically possible) would still take up 12.5% of the original space. </p>
  
  <p>That would seem somewhat redundant when the array could easily be reduced to a "24 bit" array, with basic pattern recognition.</p>
  
  <p><strong>So my question is:</strong></p>
  
  <p>Does Gzip contain any mechanisms to better compress a file than dictionary pointers? </p>
  
  <p>How well can Gzip compress small amounts of repetitive data, followed by small amounts of hard to compress data?</p>