mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 02:15:42 +01:00 
			
		
		
		
	remove unused 'has_alpha' from VP8GetInfo() signature
alpha information is not to be found at RIFF chunks level, not in the VP8 bitstream (that was a tmp hack) Change-Id: Idd1629c696b03c26f6f30650d7216f627f1761df
This commit is contained in:
		| @@ -281,7 +281,7 @@ static VP8StatusCode DecodeVP8FrameHeader(WebPIDecoder* const idec) { | ||||
|     // Not enough data bytes to extract VP8 Frame Header. | ||||
|     return VP8_STATUS_SUSPENDED; | ||||
|   } | ||||
|   if (!VP8GetInfo(data, curr_size, idec->vp8_size_, NULL, NULL, NULL)) { | ||||
|   if (!VP8GetInfo(data, curr_size, idec->vp8_size_, NULL, NULL)) { | ||||
|     return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR); | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -80,14 +80,7 @@ int VP8SetError(VP8Decoder* const dec, | ||||
| //------------------------------------------------------------------------------ | ||||
|  | ||||
| int VP8GetInfo(const uint8_t* data, uint32_t data_size, uint32_t chunk_size, | ||||
|                int* width, int* height, int* has_alpha) { | ||||
|   // Alpha-data is stored outside VP8 data and is inferred from VP8X chunk. | ||||
|   // So, this function always returns *has_alpha = 0. This value should NOT | ||||
|   // be used. | ||||
|   if (has_alpha != NULL) { | ||||
|     *has_alpha = 0; | ||||
|   } | ||||
|  | ||||
|                int* width, int* height) { | ||||
|   if (data_size < 10) { | ||||
|     return 0;         // not enough data | ||||
|   } | ||||
|   | ||||
| @@ -289,12 +289,12 @@ int VP8SetError(VP8Decoder* const dec, | ||||
|                 VP8StatusCode error, const char * const msg); | ||||
|  | ||||
| // Validates the VP8 data-header and retrieve basic header information viz width | ||||
| // and height. Returns 0 in case of formatting error. *width/*height/*has_alpha | ||||
| // and height. Returns 0 in case of formatting error. *width/*height | ||||
| // can be passed NULL. | ||||
| int VP8GetInfo(const uint8_t* data, | ||||
|                uint32_t data_size,    // data available so far | ||||
|                uint32_t chunk_size,   // total data size expect in the chunk | ||||
|                int *width, int *height, int *has_alpha); | ||||
|                int *width, int *height); | ||||
|  | ||||
| // in tree.c | ||||
| void VP8ResetProba(VP8Proba* const proba); | ||||
|   | ||||
| @@ -523,7 +523,7 @@ static VP8StatusCode GetFeatures(const uint8_t* data, uint32_t data_size, | ||||
|  | ||||
|   // Validates raw VP8 data. | ||||
|   if (!VP8GetInfo(data, data_size, vp8_chunk_size, | ||||
|                   &features->width, &features->height, NULL)) { | ||||
|                   &features->width, &features->height)) { | ||||
|     return VP8_STATUS_BITSTREAM_ERROR; | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -166,7 +166,7 @@ static WebPImageInfo* CreateImageInfo(uint32_t x_offset, uint32_t y_offset, | ||||
|   int height; | ||||
|   WebPImageInfo* image_info = NULL; | ||||
|  | ||||
|   if (!VP8GetInfo(data, size, size, &width, &height, NULL)) { | ||||
|   if (!VP8GetInfo(data, size, size, &width, &height)) { | ||||
|     return NULL; | ||||
|   } | ||||
|  | ||||
| @@ -1298,7 +1298,7 @@ static WebPMuxError GetImageCanvasHeightWidth(const WebPMux* const mux, | ||||
|     const WebPChunk* const image_chunk = wpi->vp8_; | ||||
|     assert(image_chunk != NULL); | ||||
|     if (VP8GetInfo(image_chunk->data_, image_chunk->payload_size_, | ||||
|                    image_chunk->payload_size_, &w, &h, NULL)) { | ||||
|                    image_chunk->payload_size_, &w, &h)) { | ||||
|       *width = w; | ||||
|       *height = h; | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user