vp8dx.h 3.6 KB

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