1 // Copyright 2011 Google Inc. All Rights Reserved.
3 // Use of this source code is governed by a BSD-style license
4 // that can be found in the COPYING file in the root of the source
5 // tree. An additional intellectual property rights grant can be found
6 // in the file PATENTS. All contributing project authors may
7 // be found in the AUTHORS file in the root of the source tree.
8 // -----------------------------------------------------------------------------
10 // Enhancement layer (for YUV444/422)
12 // Author: Skal (pascal.massimino@gmail.com)
16 #include "./vp8enci.h"
18 #if defined(__cplusplus) || defined(c_plusplus)
22 //------------------------------------------------------------------------------
24 void VP8EncInitLayer(VP8Encoder* const enc) {
25 enc->use_layer_ = (enc->pic_->u0 != NULL);
26 enc->layer_data_size_ = 0;
27 enc->layer_data_ = NULL;
28 if (enc->use_layer_) {
29 VP8BitWriterInit(&enc->layer_bw_, enc->mb_w_ * enc->mb_h_ * 3);
33 void VP8EncCodeLayerBlock(VP8EncIterator* it) {
34 (void)it; // remove a warning
37 int VP8EncFinishLayer(VP8Encoder* const enc) {
38 if (enc->use_layer_) {
39 enc->layer_data_ = VP8BitWriterFinish(&enc->layer_bw_);
40 enc->layer_data_size_ = VP8BitWriterSize(&enc->layer_bw_);
45 void VP8EncDeleteLayer(VP8Encoder* enc) {
46 free(enc->layer_data_);
49 #if defined(__cplusplus) || defined(c_plusplus)