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 //------------------------------------------------------------------------------
20 void VP8EncInitLayer(VP8Encoder
* const enc
) {
21 enc
->use_layer_
= (enc
->pic_
->u0
!= NULL
);
22 enc
->layer_data_size_
= 0;
23 enc
->layer_data_
= NULL
;
24 if (enc
->use_layer_
) {
25 VP8BitWriterInit(&enc
->layer_bw_
, enc
->mb_w_
* enc
->mb_h_
* 3);
29 void VP8EncCodeLayerBlock(VP8EncIterator
* it
) {
30 (void)it
; // remove a warning
33 int VP8EncFinishLayer(VP8Encoder
* const enc
) {
34 if (enc
->use_layer_
) {
35 enc
->layer_data_
= VP8BitWriterFinish(&enc
->layer_bw_
);
36 enc
->layer_data_size_
= VP8BitWriterSize(&enc
->layer_bw_
);
41 void VP8EncDeleteLayer(VP8Encoder
* enc
) {
42 free(enc
->layer_data_
);