2
0

bitreader_buffer.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 VPX_VPX_DSP_BITREADER_BUFFER_H_
  11. #define VPX_VPX_DSP_BITREADER_BUFFER_H_
  12. #include <limits.h>
  13. #include "vpx/vpx_integer.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. typedef void (*vpx_rb_error_handler)(void *data);
  18. struct vpx_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. vpx_rb_error_handler error_handler;
  24. };
  25. size_t vpx_rb_bytes_read(struct vpx_read_bit_buffer *rb);
  26. int vpx_rb_read_bit(struct vpx_read_bit_buffer *rb);
  27. int vpx_rb_read_literal(struct vpx_read_bit_buffer *rb, int bits);
  28. int vpx_rb_read_signed_literal(struct vpx_read_bit_buffer *rb, int bits);
  29. int vpx_rb_read_inv_signed_literal(struct vpx_read_bit_buffer *rb, int bits);
  30. #ifdef __cplusplus
  31. } // extern "C"
  32. #endif
  33. #endif // VPX_VPX_DSP_BITREADER_BUFFER_H_