mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 18:35:41 +01:00 
			
		
		
		
	lossless: rle mode not to accept lengths smaller than 4.
Gives a compression gain of 0.22 % Change-Id: I0f3b8dad6b4c1bfb16eab095a467f34466b9e3b7
This commit is contained in:
		
				
					committed by
					
						 James Zern
						James Zern
					
				
			
			
				
	
			
			
			
						parent
						
							84326e4ab0
						
					
				
				
					commit
					5e75642efd
				
			| @@ -368,7 +368,15 @@ static int BackwardReferencesRle(int xsize, int ysize, | |||||||
|     if (argb[i] == argb[i - 1]) { |     if (argb[i] == argb[i - 1]) { | ||||||
|       ++match_len; |       ++match_len; | ||||||
|     } else { |     } else { | ||||||
|  |       const int kMinLength = 4; | ||||||
|  |       if (match_len >= kMinLength) { | ||||||
|         PushBackCopy(refs, match_len); |         PushBackCopy(refs, match_len); | ||||||
|  |       } else { | ||||||
|  |         int k; | ||||||
|  |         for(k = match_len; k >= 1; --k) { | ||||||
|  |           AddSingleLiteral(argb[i - k], use_color_cache, &hashers, refs); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|       match_len = 0; |       match_len = 0; | ||||||
|       AddSingleLiteral(argb[i], use_color_cache, &hashers, refs); |       AddSingleLiteral(argb[i], use_color_cache, &hashers, refs); | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user