mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 02:15:42 +01:00 
			
		
		
		
	utils.[hc]: s/MAX_COLOR_COUNT/MAX_PALETTE_SIZE/
MAX_COLOR_COUNT was just a synonym and its use in the header was a bit strange given the visibility of that define. Change-Id: I536964ddc14a0c48263191b6afb80695b5a038e6
This commit is contained in:
		| @@ -239,8 +239,7 @@ void WebPCopyPixels(const WebPPicture* const src, WebPPicture* const dst) { | |||||||
|  |  | ||||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||||
|  |  | ||||||
| #define MAX_COLOR_COUNT         MAX_PALETTE_SIZE | #define COLOR_HASH_SIZE         (MAX_PALETTE_SIZE * 4) | ||||||
| #define COLOR_HASH_SIZE         (MAX_COLOR_COUNT * 4) |  | ||||||
| #define COLOR_HASH_RIGHT_SHIFT  22  // 32 - log2(COLOR_HASH_SIZE). | #define COLOR_HASH_RIGHT_SHIFT  22  // 32 - log2(COLOR_HASH_SIZE). | ||||||
|  |  | ||||||
| int WebPGetColorPalette(const WebPPicture* const pic, uint32_t* const palette) { | int WebPGetColorPalette(const WebPPicture* const pic, uint32_t* const palette) { | ||||||
| @@ -270,8 +269,8 @@ int WebPGetColorPalette(const WebPPicture* const pic, uint32_t* const palette) { | |||||||
|           colors[key] = last_pix; |           colors[key] = last_pix; | ||||||
|           in_use[key] = 1; |           in_use[key] = 1; | ||||||
|           ++num_colors; |           ++num_colors; | ||||||
|           if (num_colors > MAX_COLOR_COUNT) { |           if (num_colors > MAX_PALETTE_SIZE) { | ||||||
|             return MAX_COLOR_COUNT + 1;  // Exact count not needed. |             return MAX_PALETTE_SIZE + 1;  // Exact count not needed. | ||||||
|           } |           } | ||||||
|           break; |           break; | ||||||
|         } else if (colors[key] == last_pix) { |         } else if (colors[key] == last_pix) { | ||||||
| @@ -298,7 +297,6 @@ int WebPGetColorPalette(const WebPPicture* const pic, uint32_t* const palette) { | |||||||
|   return num_colors; |   return num_colors; | ||||||
| } | } | ||||||
|  |  | ||||||
| #undef MAX_COLOR_COUNT |  | ||||||
| #undef COLOR_HASH_SIZE | #undef COLOR_HASH_SIZE | ||||||
| #undef COLOR_HASH_RIGHT_SHIFT | #undef COLOR_HASH_RIGHT_SHIFT | ||||||
|  |  | ||||||
|   | |||||||
| @@ -164,12 +164,12 @@ WEBP_EXTERN(void) WebPCopyPixels(const struct WebPPicture* const src, | |||||||
| // Unique colors. | // Unique colors. | ||||||
|  |  | ||||||
| // Returns count of unique colors in 'pic', assuming pic->use_argb is true. | // Returns count of unique colors in 'pic', assuming pic->use_argb is true. | ||||||
| // If the unique color count is more than MAX_COLOR_COUNT, returns | // If the unique color count is more than MAX_PALETTE_SIZE, returns | ||||||
| // MAX_COLOR_COUNT+1. | // MAX_PALETTE_SIZE+1. | ||||||
| // If 'palette' is not NULL and number of unique colors is less than or equal to | // If 'palette' is not NULL and number of unique colors is less than or equal to | ||||||
| // MAX_COLOR_COUNT, also outputs the actual unique colors into 'palette'. | // MAX_PALETTE_SIZE, also outputs the actual unique colors into 'palette'. | ||||||
| // Note: 'palette' is assumed to be an array already allocated with at least | // Note: 'palette' is assumed to be an array already allocated with at least | ||||||
| // MAX_COLOR_COUNT elements. | // MAX_PALETTE_SIZE elements. | ||||||
| WEBP_EXTERN(int) WebPGetColorPalette(const struct WebPPicture* const pic, | WEBP_EXTERN(int) WebPGetColorPalette(const struct WebPPicture* const pic, | ||||||
|                                      uint32_t* const palette); |                                      uint32_t* const palette); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user