bitwriter_buffer.h 1.34 KB
Newer Older
1
/*
Yaowu Xu's avatar
Yaowu Xu committed
2
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
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.
10 11
 */

Yaowu Xu's avatar
Yaowu Xu committed
12 13
#ifndef AOM_DSP_BITWRITER_BUFFER_H_
#define AOM_DSP_BITWRITER_BUFFER_H_
14

Yaowu Xu's avatar
Yaowu Xu committed
15
#include "aom/aom_integer.h"
16

17 18 19 20
#ifdef __cplusplus
extern "C" {
#endif

Yaowu Xu's avatar
Yaowu Xu committed
21
struct aom_write_bit_buffer {
22
  uint8_t *bit_buffer;
23
  uint32_t bit_offset;
24 25
};

26
uint32_t aom_wb_bytes_written(const struct aom_write_bit_buffer *wb);
27

Yaowu Xu's avatar
Yaowu Xu committed
28
void aom_wb_write_bit(struct aom_write_bit_buffer *wb, int bit);
29

30 31
void aom_wb_overwrite_bit(struct aom_write_bit_buffer *wb, int bit);

Yaowu Xu's avatar
Yaowu Xu committed
32
void aom_wb_write_literal(struct aom_write_bit_buffer *wb, int data, int bits);
33

34 35 36
void aom_wb_overwrite_literal(struct aom_write_bit_buffer *wb, int data,
                              int bits);

Yaowu Xu's avatar
Yaowu Xu committed
37
void aom_wb_write_inv_signed_literal(struct aom_write_bit_buffer *wb, int data,
38
                                     int bits);
39

40 41 42 43
#ifdef __cplusplus
}  // extern "C"
#endif

Yaowu Xu's avatar
Yaowu Xu committed
44
#endif  // AOM_DSP_BITWRITER_BUFFER_H_