vp9_read_bit_buffer.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VP9_DECODER_VP9_READ_BIT_BUFFER_H_
  11. #define VP9_DECODER_VP9_READ_BIT_BUFFER_H_
  12. #include <limits.h>
  13. #include "vpx/vpx_integer.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. typedef void (*vp9_rb_error_handler)(void *data);
  18. struct vp9_read_bit_buffer {
  19. const uint8_t *bit_buffer;
  20. const uint8_t *bit_buffer_end;
  21. size_t bit_offset;
  22. void *error_handler_data;
  23. vp9_rb_error_handler error_handler;
  24. };
  25. size_t vp9_rb_bytes_read(struct vp9_read_bit_buffer *rb);
  26. int vp9_rb_read_bit(struct vp9_read_bit_buffer *rb);
  27. int vp9_rb_read_literal(struct vp9_read_bit_buffer *rb, int bits);
  28. int vp9_rb_read_signed_literal(struct vp9_read_bit_buffer *rb, int bits);
  29. #ifdef __cplusplus
  30. } // extern "C"
  31. #endif
  32. #endif // VP9_DECODER_VP9_READ_BIT_BUFFER_H_