mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-19 23:39:58 +02:00
add incremental decoding
The object WebPIDecoder is available to store the decoding state. The flow is typically: WebPIDecoder* const idec = WebPINew(mode); while (has_more_data) { // ... (get additional data) status = WebPIAppend(idec, new_data, new_data_size); if (status != VP8_STATUS_SUSPENDED || break; } // The above call decodes the current available buffer. // Part of the image can now be refreshed by calling to // WebPIDecGetRGB()/WebPIDecGetYUV() etc. } WebPIDelete(idec); Doing so, one can try and decode new macroblocks everytime fresh bytes are available. There's two operating modes: either appending fresh bytes, or updating the whole buffer with additional data in the end. The latter requires less memcpy()'s main patch by Somnath Banerjee (somnath at google.com) Change-Id: Ie81cbd0b50f175743af06b1f964de838b9a10a4a
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
#ifndef WEBP_WEBP_DECODE_VP8_H_
|
||||
#define WEBP_WEBP_DECODE_VP8_H_
|
||||
|
||||
#include "decode.h"
|
||||
#include "webp/decode.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
extern "C" {
|
||||
@ -105,18 +105,6 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io);
|
||||
// Returns false in case of error.
|
||||
int VP8Decode(VP8Decoder* const dec, VP8Io* const io);
|
||||
|
||||
// Enumeration of the codes returned by VP8Status()
|
||||
typedef enum {
|
||||
VP8_STATUS_OK = 0,
|
||||
VP8_STATUS_OUT_OF_MEMORY,
|
||||
VP8_STATUS_INVALID_PARAM,
|
||||
VP8_STATUS_BITSTREAM_ERROR,
|
||||
VP8_STATUS_UNSUPPORTED_FEATURE,
|
||||
VP8_STATUS_SUSPENDED,
|
||||
VP8_STATUS_USER_ABORT,
|
||||
VP8_STATUS_NOT_ENOUGH_DATA,
|
||||
} VP8StatusCode;
|
||||
|
||||
// Return current status of the decoder:
|
||||
VP8StatusCode VP8Status(VP8Decoder* const dec);
|
||||
|
||||
|
Reference in New Issue
Block a user