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 AOM_AV1_ENCODER_BITSTREAM_H_ 13 #define AOM_AV1_ENCODER_BITSTREAM_H_ 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 #include "av1/encoder/encoder.h" 20 21 struct aom_write_bit_buffer; 22 23 // Writes only the OBU Sequence Header payload, and returns the size of the 24 // payload written to 'dst'. This function does not write the OBU header, the 25 // optional extension, or the OBU size to 'dst'. 26 uint32_t write_sequence_header_obu(AV1_COMP *cpi, uint8_t *const dst); 27 28 // Writes the OBU header byte, and the OBU header extension byte when 29 // 'obu_extension' is non-zero. Returns number of bytes written to 'dst'. 30 uint32_t av1_write_obu_header(AV1_COMP *const cpi, OBU_TYPE obu_type, 31 int obu_extension, uint8_t *const dst); 32 33 int write_uleb_obu_size(uint32_t obu_header_size, uint32_t obu_payload_size, 34 uint8_t *dest); 35 36 int av1_pack_bitstream(AV1_COMP *const cpi, uint8_t *dst, size_t *size, 37 int *const largest_tile_id); 38 39 void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd, 40 int blk_row, int blk_col, int plane, TX_SIZE tx_size, 41 aom_writer *w); 42 43 #ifdef __cplusplus 44 } // extern "C" 45 #endif 46 47 #endif // AOM_AV1_ENCODER_BITSTREAM_H_ 48