remove absolute_delta_ field and syntax code

we'll always encode using absolute value, not relative ones.
    Both methods use the same number of bits, so we'll go for the
    simpler and most robust one.
    + add some extra checks about pic->u/v being NULL.

Change-Id: I98ea01a1a6b133ab3c816c0fbc50e18269bd2098
This commit is contained in:
Pascal Massimino
2011-02-27 10:22:54 -08:00
parent 0744e8420e
commit b65a3e101e
3 changed files with 7 additions and 20 deletions

View File

@ -55,7 +55,6 @@ static void ResetSegmentHeader(VP8Encoder* const enc) {
VP8SegmentHeader* const hdr = &enc->segment_hdr_;
hdr->num_segments_ = enc->config_->segments;
hdr->update_map_ = (hdr->num_segments_ > 1);
hdr->absolute_delta_ = 1;
hdr->size_ = 0;
}
@ -285,7 +284,9 @@ int WebPEncode(const WebPConfig* const config, WebPPicture* const pic) {
return 0; // bad params
if (!WebPValidateConfig(config))
return 0; // invalid config.
if (pic->width <= 0 || pic->height <= 0 || pic->y == NULL)
if (pic->width <= 0 || pic->height <= 0)
return 0; // invalid parameters
if (pic->y == NULL || pic->u == NULL || pic->v == NULL)
return 0; // invalid parameters
if (pic->width >= MAX_DIMENSION || pic->height >= MAX_DIMENSION)
return 0; // image is too big