vp8dx.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * Copyright (c) 2010 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. #include "vp8.h"
  11. /*!\defgroup vp8_decoder WebM VP8 Decoder
  12. * \ingroup vp8
  13. *
  14. * @{
  15. */
  16. /*!\file
  17. * \brief Provides definitions for using the VP8 algorithm within the vpx Decoder
  18. * interface.
  19. */
  20. #ifndef VP8DX_H
  21. #define VP8DX_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /*!\name Algorithm interface for VP8
  26. *
  27. * This interface provides the capability to decode raw VP8 streams, as would
  28. * be found in AVI files and other non-Flash uses.
  29. * @{
  30. */
  31. extern vpx_codec_iface_t vpx_codec_vp8_dx_algo;
  32. extern vpx_codec_iface_t *vpx_codec_vp8_dx(void);
  33. /* TODO(jkoleszar): These move to VP9 in a later patch set. */
  34. extern vpx_codec_iface_t vpx_codec_vp9_dx_algo;
  35. extern vpx_codec_iface_t *vpx_codec_vp9_dx(void);
  36. /*!@} - end algorithm interface member group*/
  37. /* Include controls common to both the encoder and decoder */
  38. #include "vp8.h"
  39. /*!\enum vp8_dec_control_id
  40. * \brief VP8 decoder control functions
  41. *
  42. * This set of macros define the control functions available for the VP8
  43. * decoder interface.
  44. *
  45. * \sa #vpx_codec_control
  46. */
  47. enum vp8_dec_control_id {
  48. /** control function to get info on which reference frames were updated
  49. * by the last decode
  50. */
  51. VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START,
  52. /** check if the indicated frame is corrupted */
  53. VP8D_GET_FRAME_CORRUPTED,
  54. /** control function to get info on which reference frames were used
  55. * by the last decode
  56. */
  57. VP8D_GET_LAST_REF_USED,
  58. /** decryption function to decrypt encoded buffer data immediately
  59. * before decoding. Takes a vp8_decrypt_init, which contains
  60. * a callback function and opaque context pointer.
  61. */
  62. VP8D_SET_DECRYPTOR,
  63. /** For testing. */
  64. VP9_INVERT_TILE_DECODE_ORDER,
  65. VP8_DECODER_CTRL_ID_MAX
  66. };
  67. /*!\brief Structure to hold decryption state
  68. *
  69. * Defines a structure to hold the decryption state and access function.
  70. */
  71. typedef struct vp8_decrypt_init {
  72. /** Decrypt n bytes of data from input -> output, using the decrypt_state
  73. * passed in VP8D_SET_DECRYPTOR.
  74. */
  75. void (*decrypt_cb)(void *decrypt_state, const unsigned char *input,
  76. unsigned char *output, int count);
  77. /*! Decryption state. */
  78. void *decrypt_state;
  79. } vp8_decrypt_init;
  80. /*!\brief VP8 decoder control function parameter type
  81. *
  82. * Defines the data types that VP8D control functions take. Note that
  83. * additional common controls are defined in vp8.h
  84. *
  85. */
  86. VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *)
  87. VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *)
  88. VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *)
  89. VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vp8_decrypt_init *)
  90. VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int)
  91. /*! @} - end defgroup vp8_decoder */
  92. #ifdef __cplusplus
  93. } // extern "C"
  94. #endif
  95. #endif