mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 02:15:42 +01:00 
			
		
		
		
	clean-up MakeInputImageCopy()
use pointer increments. Change-Id: I269412d41a58ab9ffd7fc0f3d479fe73a3d07b9e
This commit is contained in:
		| @@ -1248,14 +1248,20 @@ static WebPEncodingError MakeInputImageCopy(VP8LEncoder* const enc) { | |||||||
|   const WebPPicture* const picture = enc->pic_; |   const WebPPicture* const picture = enc->pic_; | ||||||
|   const int width = picture->width; |   const int width = picture->width; | ||||||
|   const int height = picture->height; |   const int height = picture->height; | ||||||
|   int y; |  | ||||||
|   err = AllocateTransformBuffer(enc, width, height); |   err = AllocateTransformBuffer(enc, width, height); | ||||||
|   if (err != VP8_ENC_OK) return err; |   if (err != VP8_ENC_OK) return err; | ||||||
|   if (enc->argb_content_ == kEncoderARGB) return VP8_ENC_OK; |   if (enc->argb_content_ == kEncoderARGB) return VP8_ENC_OK; | ||||||
|  |  | ||||||
|  |   { | ||||||
|  |     uint32_t* dst = enc->argb_; | ||||||
|  |     const uint32_t* src = picture->argb; | ||||||
|  |     int y; | ||||||
|     for (y = 0; y < height; ++y) { |     for (y = 0; y < height; ++y) { | ||||||
|     memcpy(enc->argb_ + y * width, |       memcpy(dst, src, width * sizeof(*dst)); | ||||||
|            picture->argb + y * picture->argb_stride, |       dst += width; | ||||||
|            width * sizeof(*enc->argb_)); |       src += picture->argb_stride; | ||||||
|  |     } | ||||||
|   } |   } | ||||||
|   enc->argb_content_ = kEncoderARGB; |   enc->argb_content_ = kEncoderARGB; | ||||||
|   assert(enc->current_width_ == width); |   assert(enc->current_width_ == width); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user