Home | History | Annotate | Download | only in enc
      1 // Copyright 2011 Google Inc.
      2 //
      3 // This code is licensed under the same terms as WebM:
      4 //  Software License Agreement:  http://www.webmproject.org/license/software/
      5 //  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/
      6 // -----------------------------------------------------------------------------
      7 //
      8 // Enhancement layer (for YUV444/422)
      9 //
     10 // Author: Skal (pascal.massimino (at) gmail.com)
     11 
     12 #include <assert.h>
     13 #include <stdlib.h>
     14 #include "vp8enci.h"
     15 
     16 #if defined(__cplusplus) || defined(c_plusplus)
     17 extern "C" {
     18 #endif
     19 
     20 #ifdef WEBP_EXPERIMENTAL_FEATURES
     21 
     22 #endif    /* WEBP_EXPERIMENTAL_FEATURES */
     23 
     24 //-----------------------------------------------------------------------------
     25 
     26 void VP8EncInitLayer(VP8Encoder* const enc) {
     27   enc->use_layer_ = (enc->pic_->u0 != NULL);
     28   enc->layer_data_size_ = 0;
     29   enc->layer_data_ = NULL;
     30   if (enc->use_layer_) {
     31     VP8BitWriterInit(&enc->layer_bw_, enc->mb_w_ * enc->mb_h_ * 3);
     32   }
     33 }
     34 
     35 void VP8EncCodeLayerBlock(VP8EncIterator* it) {
     36   (void)it;   // remove a warning
     37 #ifdef WEBP_EXPERIMENTAL_FEATURES
     38 #endif    /* WEBP_EXPERIMENTAL_FEATURES */
     39 }
     40 
     41 int VP8EncFinishLayer(VP8Encoder* const enc) {
     42   if (enc->use_layer_) {
     43     enc->layer_data_ = VP8BitWriterFinish(&enc->layer_bw_);
     44     enc->layer_data_size_ = VP8BitWriterSize(&enc->layer_bw_);
     45   }
     46   return 1;
     47 }
     48 
     49 void VP8EncDeleteLayer(VP8Encoder* enc) {
     50   free(enc->layer_data_);
     51 }
     52 
     53 #if defined(__cplusplus) || defined(c_plusplus)
     54 }    // extern "C"
     55 #endif
     56