mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
JPEG decoder: delay conversion to YUV to WebPEncode() call
We store the raw RGB samples decoded from JPEG, and avoid precision loss. Note that this may increase the encoding time reported by cwebp -v, since RGB->YUV now occur during WebPEncode call (in case of lossy), instead of ReadJPEG(). This also increases the memory use, since we're carying the source ARGB samples around. Change-Id: Ic2180206cfc9f5574f391e91c3b89b9d81695d01
This commit is contained in:
parent
6f3202be98
commit
fbda2f499c
@ -272,6 +272,7 @@ int ReadJPEG(FILE* in_file, WebPPicture* const pic, Metadata* const metadata) {
|
||||
// WebP conversion.
|
||||
pic->width = width;
|
||||
pic->height = height;
|
||||
pic->use_argb = 1; // store raw RGB samples
|
||||
ok = WebPPictureImportRGB(pic, rgb, stride);
|
||||
if (!ok) goto Error;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user