gstvp8rangedecoder.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * gstvp8rangedecoder.h - VP8 range decoder interface
  3. *
  4. * Copyright (C) 2014 Intel Corporation
  5. * Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  20. * Boston, MA 02110-1301, USA.
  21. */
  22. #ifndef GST_VP8_RANGE_DECODER_H
  23. #define GST_VP8_RANGE_DECODER_H
  24. #include <glib.h>
  25. #include <gst/gstconfig.h>
  26. typedef struct _GstVp8RangeDecoder GstVp8RangeDecoder;
  27. typedef struct _GstVp8RangeDecoderState GstVp8RangeDecoderState;
  28. /**
  29. * GstVp8RangeDecoder:
  30. * @buf: the original bitstream buffer start
  31. * @buf_size: the original bitstream buffer size
  32. *
  33. * Range decoder.
  34. */
  35. struct _GstVp8RangeDecoder {
  36. const guchar *buf;
  37. guint buf_size;
  38. /*< private >*/
  39. gpointer _gst_reserved[GST_PADDING_LARGE];
  40. };
  41. /**
  42. * GstVp8RangeDecoderState:
  43. * @range: current "Range" value
  44. * @value: current "Value" value
  45. * @count: number of bits left in "Value" for decoding
  46. *
  47. * Range decoder state.
  48. */
  49. struct _GstVp8RangeDecoderState {
  50. guint8 range;
  51. guint8 value;
  52. guint8 count;
  53. };
  54. gboolean
  55. gst_vp8_range_decoder_init (GstVp8RangeDecoder * rd, const guchar * buf,
  56. guint buf_size);
  57. gint
  58. gst_vp8_range_decoder_read (GstVp8RangeDecoder * rd, guint8 prob);
  59. gint
  60. gst_vp8_range_decoder_read_literal (GstVp8RangeDecoder * rd, gint bits);
  61. guint
  62. gst_vp8_range_decoder_get_pos (GstVp8RangeDecoder * rd);
  63. void
  64. gst_vp8_range_decoder_get_state (GstVp8RangeDecoder * rd,
  65. GstVp8RangeDecoderState * state);
  66. #endif /* GST_VP8_RANGE_DECODER_H */