summaryrefslogtreecommitdiff
path: root/drivers/webpold/enc/layer.c
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-12-04 10:18:28 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-12-04 10:18:28 -0300
commitda113fe40d0a9410859912473d53e43903dc6c8e (patch)
tree23c6019a28a11d67241789721d1feecdd19410e6 /drivers/webpold/enc/layer.c
parent064fd762fae75371658e773a3acf39616e813b08 (diff)
-Upgraded webp to a MUCH newer version. Hoping it fixes some bugs in the process. Keeping old version just in case for now.
-Added ability to convert xml and tscn scenes to binary on export, makes loading of larger scenes faster
Diffstat (limited to 'drivers/webpold/enc/layer.c')
-rw-r--r--drivers/webpold/enc/layer.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/webpold/enc/layer.c b/drivers/webpold/enc/layer.c
new file mode 100644
index 0000000000..423127df63
--- /dev/null
+++ b/drivers/webpold/enc/layer.c
@@ -0,0 +1,49 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+//
+// This code is licensed under the same terms as WebM:
+// Software License Agreement: http://www.webmproject.org/license/software/
+// Additional IP Rights Grant: http://www.webmproject.org/license/additional/
+// -----------------------------------------------------------------------------
+//
+// Enhancement layer (for YUV444/422)
+//
+// Author: Skal (pascal.massimino@gmail.com)
+
+#include <stdlib.h>
+
+#include "./vp8enci.h"
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+//------------------------------------------------------------------------------
+
+void VP8EncInitLayer(VP8Encoder* const enc) {
+ enc->use_layer_ = (enc->pic_->u0 != NULL);
+ enc->layer_data_size_ = 0;
+ enc->layer_data_ = NULL;
+ if (enc->use_layer_) {
+ VP8BitWriterInit(&enc->layer_bw_, enc->mb_w_ * enc->mb_h_ * 3);
+ }
+}
+
+void VP8EncCodeLayerBlock(VP8EncIterator* it) {
+ (void)it; // remove a warning
+}
+
+int VP8EncFinishLayer(VP8Encoder* const enc) {
+ if (enc->use_layer_) {
+ enc->layer_data_ = VP8BitWriterFinish(&enc->layer_bw_);
+ enc->layer_data_size_ = VP8BitWriterSize(&enc->layer_bw_);
+ }
+ return 1;
+}
+
+void VP8EncDeleteLayer(VP8Encoder* enc) {
+ free(enc->layer_data_);
+}
+
+#if defined(__cplusplus) || defined(c_plusplus)
+} // extern "C"
+#endif