Line data Source code
1 : /*
2 : * Copyright (c) 2016, Alliance for Open Media. All rights reserved
3 : *
4 : * This source code is subject to the terms of the BSD 2 Clause License and
5 : * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 : * was not distributed with this source code in the LICENSE file, you can
7 : * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 : * Media Patent License 1.0 was not distributed with this source code in the
9 : * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10 : */
11 :
12 : #ifndef AV1_ENCODER_BITSTREAM_H_
13 : #define AV1_ENCODER_BITSTREAM_H_
14 :
15 : #ifdef __cplusplus
16 : extern "C" {
17 : #endif
18 :
19 : #include "av1/encoder/encoder.h"
20 :
21 : #if CONFIG_REFERENCE_BUFFER
22 : void write_sequence_header(SequenceHeader *seq_params);
23 : #endif
24 :
25 : void av1_pack_bitstream(AV1_COMP *const cpi, uint8_t *dest, size_t *size);
26 :
27 : void av1_encode_token_init(void);
28 :
29 0 : 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
32 0 : return !cpi->multi_arf_allowed && cpi->rc.is_src_frame_alt_ref &&
33 0 : !cpi->rc.is_src_frame_ext_arf;
34 : #else
35 : return !cpi->multi_arf_allowed && cpi->refresh_golden_frame &&
36 : cpi->rc.is_src_frame_alt_ref;
37 : #endif // CONFIG_EXT_REFS
38 : }
39 :
40 : void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
41 : #if CONFIG_SUPERTX
42 : const int supertx_enabled,
43 : #endif
44 : #if CONFIG_TXK_SEL
45 : int block, int plane,
46 : #endif
47 : aom_writer *w);
48 :
49 : #ifdef __cplusplus
50 : } // extern "C"
51 : #endif
52 :
53 : #endif // AV1_ENCODER_BITSTREAM_H_
|