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:
Pascal Massimino
2011-05-02 17:19:00 -07:00
parent 79cc49f5eb
commit 6d0e66c23e
25 changed files with 658 additions and 132 deletions

View File

@ -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);