Index: third_party/libwebp/dec/webpi.h |
diff --git a/third_party/libwebp/dec/webpi.h b/third_party/libwebp/dec/webpi.h |
index c75a2e4a5bfdda942143bc56f5a5ebf1a6b67db1..991b194c228c61b310c44d6e8e57e76863deb207 100644 |
--- a/third_party/libwebp/dec/webpi.h |
+++ b/third_party/libwebp/dec/webpi.h |
@@ -45,11 +45,20 @@ struct WebPDecParams { |
OutputFunc emit; // output RGB or YUV samples |
OutputAlphaFunc emit_alpha; // output alpha channel |
OutputRowFunc emit_alpha_row; // output one line of rescaled alpha values |
+ |
+ WebPDecBuffer* final_output; // In case the user supplied a slow-memory |
+ // output, we decode image in temporary buffer |
+ // (this::output) and copy it here. |
+ WebPDecBuffer tmp_buffer; // this::output will point to this one in case |
+ // of slow memory. |
}; |
// Should be called first, before any use of the WebPDecParams object. |
void WebPResetDecParams(WebPDecParams* const params); |
+// Delete all memory (after an error occurred, for instance) |
+void WebPFreeDecParams(WebPDecParams* const params); |
+ |
//------------------------------------------------------------------------------ |
// Header parsing helpers |
@@ -107,13 +116,23 @@ VP8StatusCode WebPAllocateDecBuffer(int width, int height, |
VP8StatusCode WebPFlipBuffer(WebPDecBuffer* const buffer); |
// Copy 'src' into 'dst' buffer, making sure 'dst' is not marked as owner of the |
-// memory (still held by 'src'). |
+// memory (still held by 'src'). No pixels are copied. |
void WebPCopyDecBuffer(const WebPDecBuffer* const src, |
WebPDecBuffer* const dst); |
// Copy and transfer ownership from src to dst (beware of parameter order!) |
void WebPGrabDecBuffer(WebPDecBuffer* const src, WebPDecBuffer* const dst); |
+// Copy pixels from 'src' into a *preallocated* 'dst' buffer. Returns |
+// VP8_STATUS_INVALID_PARAM if the 'dst' is not set up correctly for the copy. |
+VP8StatusCode WebPCopyDecBufferPixels(const WebPDecBuffer* const src, |
+ WebPDecBuffer* const dst); |
+ |
+// Returns true if decoding will be slow with the current configuration |
+// and bitstream features. |
+int WebPAvoidSlowMemory(const WebPDecBuffer* const output, |
+ const WebPBitstreamFeatures* const features); |
+ |
//------------------------------------------------------------------------------ |
#ifdef __cplusplus |