add VP8LEncodeStream() to compress lossless image stream

* RIFF header is omitted
* rename NewVP8LEncoder and DeleteVP8Encoder
* change the signature to take a "const WebPPicture*"
  (it was non-const just because we were setting some error potentially)
* made the pic_ field const in VP8LEncoder too.
* trap the bitwriter::error_ too
* simplify some signatures to take WebPPicture* instead
  of unneeded VP8LEncoder*

VP8LEncodeStream() will be called directly to compress alpha channel
header-less.

Change-Id: Ibceef63d2b3fbc412f0dffc38dc05c2dee6b6bbf
This commit is contained in:
Pascal Massimino
2012-05-22 03:15:58 -07:00
parent fa8bc3dbca
commit 489ec335a1
2 changed files with 70 additions and 53 deletions

View File

@ -35,7 +35,7 @@ extern "C" {
typedef struct {
const WebPConfig* config_; // user configuration and parameters
WebPPicture* pic_; // input picture.
const WebPPicture* pic_; // input picture.
uint32_t* argb_; // Transformed argb image data.
uint32_t* argb_scratch_; // Scratch memory for argb rows
@ -59,13 +59,16 @@ typedef struct {
//------------------------------------------------------------------------------
// internal functions. Not public.
// in vp8l.c
// Encodes the picture.
// Returns 0 if config or picture is NULL or picture doesn't have valid argb
// input.
int VP8LEncodeImage(const WebPConfig* const config,
WebPPicture* const picture);
const WebPPicture* const picture);
// Encodes the main image stream using the supplied bit writer.
WebPEncodingError VP8LEncodeStream(const WebPConfig* const config,
const WebPPicture* const picture,
VP8LBitWriter* const bw);
//------------------------------------------------------------------------------