Home | History | Annotate | Download | only in encoder
      1 /*
      2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 
     11 #ifndef VPX_VP9_ENCODER_VP9_BITSTREAM_H_
     12 #define VPX_VP9_ENCODER_VP9_BITSTREAM_H_
     13 
     14 #ifdef __cplusplus
     15 extern "C" {
     16 #endif
     17 
     18 #include "vp9/encoder/vp9_encoder.h"
     19 
     20 typedef struct VP9BitstreamWorkerData {
     21   uint8_t *dest;
     22   int dest_size;
     23   vpx_writer bit_writer;
     24   int tile_idx;
     25   unsigned int max_mv_magnitude;
     26   // The size of interp_filter_selected in VP9_COMP is actually
     27   // MAX_REFERENCE_FRAMES x SWITCHABLE. But when encoding tiles, all we ever do
     28   // is increment the very first index (index 0) for the first dimension. Hence
     29   // this is sufficient.
     30   int interp_filter_selected[1][SWITCHABLE];
     31   DECLARE_ALIGNED(16, MACROBLOCKD, xd);
     32 } VP9BitstreamWorkerData;
     33 
     34 int vp9_get_refresh_mask(VP9_COMP *cpi);
     35 
     36 void vp9_bitstream_encode_tiles_buffer_dealloc(VP9_COMP *const cpi);
     37 
     38 void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, size_t *size);
     39 
     40 static INLINE int vp9_preserve_existing_gf(VP9_COMP *cpi) {
     41   return cpi->refresh_golden_frame && cpi->rc.is_src_frame_alt_ref &&
     42          !cpi->use_svc;
     43 }
     44 
     45 #ifdef __cplusplus
     46 }  // extern "C"
     47 #endif
     48 
     49 #endif  // VPX_VP9_ENCODER_VP9_BITSTREAM_H_
     50