2013-05-28 18:07:54 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
*/
|
|
|
|
|
2013-09-29 11:31:58 -07:00
|
|
|
#ifndef VP9_DECODER_VP9_READ_BIT_BUFFER_H_
|
|
|
|
#define VP9_DECODER_VP9_READ_BIT_BUFFER_H_
|
2013-05-28 18:07:54 -07:00
|
|
|
|
2013-06-07 13:41:44 -07:00
|
|
|
#include <limits.h>
|
|
|
|
|
|
|
|
#include "vpx/vpx_integer.h"
|
|
|
|
|
2014-01-18 12:16:11 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-03-01 20:31:47 -08:00
|
|
|
typedef void (*vp9_rb_error_handler)(void *data);
|
2013-05-28 18:07:54 -07:00
|
|
|
|
|
|
|
struct vp9_read_bit_buffer {
|
|
|
|
const uint8_t *bit_buffer;
|
|
|
|
const uint8_t *bit_buffer_end;
|
|
|
|
size_t bit_offset;
|
|
|
|
|
|
|
|
void *error_handler_data;
|
|
|
|
vp9_rb_error_handler error_handler;
|
|
|
|
};
|
|
|
|
|
2014-03-03 15:21:22 -08:00
|
|
|
size_t vp9_rb_bytes_read(struct vp9_read_bit_buffer *rb);
|
2013-05-28 18:07:54 -07:00
|
|
|
|
2014-03-03 15:21:22 -08:00
|
|
|
int vp9_rb_read_bit(struct vp9_read_bit_buffer *rb);
|
2013-05-28 18:07:54 -07:00
|
|
|
|
2014-03-03 15:21:22 -08:00
|
|
|
int vp9_rb_read_literal(struct vp9_read_bit_buffer *rb, int bits);
|
2013-05-28 18:07:54 -07:00
|
|
|
|
2014-03-03 15:21:22 -08:00
|
|
|
int vp9_rb_read_signed_literal(struct vp9_read_bit_buffer *rb, int bits);
|
2013-07-01 02:09:36 -07:00
|
|
|
|
2014-01-18 12:16:11 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
2013-09-29 11:31:58 -07:00
|
|
|
#endif // VP9_DECODER_VP9_READ_BIT_BUFFER_H_
|