mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 14:34:33 +02:00
prepare experimentation with yuv444 / 422
+ add a simple rescaling function: WebPPictureRescale() for encoding + clean-up the memory managment around the alpha plane + fix some includes path by using "../webp/xxx.h" instead of "webp/xxx.h" New flags for 'cwebp': -resize <width> <height> -444 (no effect) -422 (no effect) -400 Change-Id: I25a95f901493f939c2dd789e658493b83bd1abfa
This commit is contained in:
@ -242,12 +242,20 @@ static VP8Encoder* InitEncoder(const WebPConfig* const config,
|
||||
ResetFilterHeader(enc);
|
||||
ResetBoundaryPredictions(enc);
|
||||
|
||||
#ifdef WEBP_EXPERIMENTAL_FEATURES
|
||||
VP8EncInitAlpha(enc);
|
||||
VP8EncInitLayer(enc);
|
||||
#endif
|
||||
|
||||
return enc;
|
||||
}
|
||||
|
||||
static void DeleteEncoder(VP8Encoder* enc) {
|
||||
if (enc) {
|
||||
#ifdef WEBP_EXPERIMENTAL_FEATURES
|
||||
VP8EncDeleteAlpha(enc);
|
||||
VP8EncDeleteLayer(enc);
|
||||
#endif
|
||||
free(enc);
|
||||
}
|
||||
}
|
||||
@ -309,7 +317,10 @@ int WebPEncode(const WebPConfig* const config, WebPPicture* const pic) {
|
||||
ok = VP8EncAnalyze(enc)
|
||||
&& VP8StatLoop(enc)
|
||||
&& VP8EncLoop(enc)
|
||||
&& VP8EncProcessAlpha(enc)
|
||||
#ifdef WEBP_EXPERIMENTAL_FEATURES
|
||||
&& VP8EncFinishAlpha(enc)
|
||||
&& VP8EncFinishLayer(enc)
|
||||
#endif
|
||||
&& VP8EncWrite(enc);
|
||||
StoreStats(enc);
|
||||
DeleteEncoder(enc);
|
||||
|
Reference in New Issue
Block a user