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_AOM_DSP_BITWRITER_BUFFER_H_ 13 #define AOM_AOM_DSP_BITWRITER_BUFFER_H_ 14 15 #include "aom/aom_integer.h" 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 struct aom_write_bit_buffer { 22 uint8_t *bit_buffer; 23 uint32_t bit_offset; 24 }; 25 26 int aom_wb_is_byte_aligned(const struct aom_write_bit_buffer *wb); 27 28 uint32_t aom_wb_bytes_written(const struct aom_write_bit_buffer *wb); 29 30 void aom_wb_write_bit(struct aom_write_bit_buffer *wb, int bit); 31 32 void aom_wb_write_literal(struct aom_write_bit_buffer *wb, int data, int bits); 33 34 void aom_wb_write_unsigned_literal(struct aom_write_bit_buffer *wb, 35 uint32_t data, int bits); 36 37 void aom_wb_overwrite_literal(struct aom_write_bit_buffer *wb, int data, 38 int bits); 39 40 void aom_wb_write_inv_signed_literal(struct aom_write_bit_buffer *wb, int data, 41 int bits); 42 43 void aom_wb_write_uvlc(struct aom_write_bit_buffer *wb, uint32_t v); 44 45 void aom_wb_write_signed_primitive_refsubexpfin(struct aom_write_bit_buffer *wb, 46 uint16_t n, uint16_t k, 47 int16_t ref, int16_t v); 48 49 #ifdef __cplusplus 50 } // extern "C" 51 #endif 52 53 #endif // AOM_AOM_DSP_BITWRITER_BUFFER_H_ 54