Skip to content
Snippets Groups Projects
  1. Nov 01, 2015
    • Scott Vokes's avatar
      Update inaccurate assertion. (Only active when logging.) · 060f120a
      Scott Vokes authored
      The bound can include (1 << window size), since the offset is shifted by
      1. There is no point in encoding a 0-byte window, and increasing the
      size for possible backreferences improves the correction ratio.
      
      Reported by @timothyzillon, @sw17ch, @jibsen.
      060f120a
  2. Jun 07, 2015
    • Vadim Vygonets's avatar
      Process tag bit sooner in decoder · 86699925
      Vadim Vygonets authored
      Fix the bug where last 7 bits are not processed.
      
      Test case:
      $ echo -n aaaa | ./heatshrink -w4 -l2 | ./heatshrink -dw4 -l2 | hexdump -C
      
      expected output:
      00000000  61 61 61 61                                       |aaaa|
      00000004
      
      bug:
      00000000  61                                                |a|
      00000001
      
      Conflicts:
      	heatshrink_decoder.c
      86699925
  3. May 31, 2015
  4. May 11, 2015
  5. May 08, 2015
  6. Jun 25, 2014
    • Scott Vokes's avatar
      Fix possible state yielding MORE from finish(), but 0 bytes from poll(). · 06d4094c
      Scott Vokes authored
      If the decompression stream was terminated with a 1 bit at exactly the
      byte boundary (perhaps due to decompressing from flash memory and
      sinking erased 0xFF bytes until the end of a flash page), it could end
      up in a state where heatshrink_decoder_finish() would return
      HSDR_FINISH_MORE, but calling heatshrink_decoder_poll would always yield
      0 bytes of output. If _both_ results were not checked, this could lead to
      the code driving them uselessly calling them in a loop.
      
      Added regression test case:
      decoder_should_not_get_stuck_with_finish_yielding_MORE_but_0_bytes_output_from_poll
      
      Resolved by explicitly checking remaining input length in
      heatshrink_decoder_finish in the HSDS_YIELD_LITERAL state, since it is
      not safe to assume that the decompression stream input will be padded
      with 0 bits.
      06d4094c
  7. Dec 28, 2013
    • Scott Vokes's avatar
      Improve throughput of encoder. Also, decrease HEATSHRINK_MAX_WINDOW_BITS to 15. · 429d41e4
      Scott Vokes authored
      Eliminate some unnecessary comparisons by making the position in the
      index signed, and treating any negative value as not found, not just
      ((uint16_t)-1). Also, decrease HEATSHRINK_MAX_WINDOW_BITS to 15, so
      index values with the highest bit set can be used as working space
      for index optimization on the fly (some day).
      
      Use 'if length >= 3' instead of 'length > 2' for the break even point,
      sinec it makes the intent clearer, and pull the comparison outside of
      the inner loop.
      
      Increase HEATSHRINK_MIN_LOOKAHEAD_BITS to 2, since -l 1 won't compress.
      Also, eliminate the corresponding MAX #define, since it has to be <= the
      window size anyway.
      
      Use a separate *pt == *pt2 instead of pt[0] == pt2[0] for comparison of the
      leading byte, which should allow for better branch prediction.
      
      Eliminate 'needle_index' in the inner loop -- it's only aliasing 'end'.
      
      Also, add comments about the indexing strategy.
      429d41e4
  8. Dec 21, 2013
  9. Dec 19, 2013
  10. Aug 30, 2013
  11. May 13, 2013
  12. May 12, 2013
  13. Mar 13, 2013
Loading