bitstream.h 1.57 KB
Newer Older
Jingning Han's avatar
Jingning Han committed
1
/*
Yaowu Xu's avatar
Yaowu Xu committed
2
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Jingning Han's avatar
Jingning Han committed
3
 *
Yaowu Xu's avatar
Yaowu Xu committed
4 5 6 7 8 9
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
Jingning Han's avatar
Jingning Han committed
10 11
 */

Yaowu Xu's avatar
Yaowu Xu committed
12 13
#ifndef AV1_ENCODER_BITSTREAM_H_
#define AV1_ENCODER_BITSTREAM_H_
Jingning Han's avatar
Jingning Han committed
14 15 16 17 18

#ifdef __cplusplus
extern "C" {
#endif

19
#include "av1/encoder/encoder.h"
Jingning Han's avatar
Jingning Han committed
20

21 22 23 24
#if CONFIG_REFERENCE_BUFFER
void write_sequence_header(SequenceHeader *seq_params);
#endif

Yaowu Xu's avatar
Yaowu Xu committed
25
void av1_pack_bitstream(AV1_COMP *const cpi, uint8_t *dest, size_t *size);
Jingning Han's avatar
Jingning Han committed
26

Yaowu Xu's avatar
Yaowu Xu committed
27
void av1_encode_token_init(void);
28

Yaowu Xu's avatar
Yaowu Xu committed
29
static INLINE int av1_preserve_existing_gf(AV1_COMP *cpi) {
30
#if CONFIG_EXT_REFS
31
  // Do not swap gf and arf indices for internal overlay frames
Yaowu Xu's avatar
Yaowu Xu committed
32 33
  return !cpi->multi_arf_allowed && cpi->rc.is_src_frame_alt_ref &&
         !cpi->rc.is_src_frame_ext_arf;
34
#else
Jingning Han's avatar
Jingning Han committed
35
  return !cpi->multi_arf_allowed && cpi->refresh_golden_frame &&
Yunqing Wang's avatar
Yunqing Wang committed
36
         cpi->rc.is_src_frame_alt_ref;
37
#endif  // CONFIG_EXT_REFS
Jingning Han's avatar
Jingning Han committed
38 39
}

40 41 42 43 44
void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
#if CONFIG_SUPERTX
                       const int supertx_enabled,
#endif
#if CONFIG_LV_MAP
45
                       int block, int plane,
46 47 48
#endif
                       aom_writer *w);

Jingning Han's avatar
Jingning Han committed
49 50 51 52
#ifdef __cplusplus
}  // extern "C"
#endif

Yaowu Xu's avatar
Yaowu Xu committed
53
#endif  // AV1_ENCODER_BITSTREAM_H_