vp8dx.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. /** control function to get the bit depth of the stream. */
  66. VP9D_GET_BIT_DEPTH,
  67. /** control function to set the byte alignment of the planes in the reference
  68. * buffers. Valid values are power of 2, from 32 to 1024. A value of 0 sets
  69. * legacy alignment. I.e. Y plane is aligned to 32 bytes, U plane directly
  70. * follows Y plane, and V plane directly follows U plane. Default value is 0.
  71. */
  72. VP9_SET_BYTE_ALIGNMENT,
  73. /** control function to invert the decoding order to from right to left. The
  74. * function is used in a test to confirm the decoding independence of tile
  75. * columns. The function may be used in application where this order
  76. * of decoding is desired.
  77. *
  78. * TODO(yaowu): Rework the unit test that uses this control, and in a future
  79. * release, this test-only control shall be removed.
  80. */
  81. VP9_INVERT_TILE_DECODE_ORDER,
  82. VP8_DECODER_CTRL_ID_MAX
  83. };
  84. /** Decrypt n bytes of data from input -> output, using the decrypt_state
  85. * passed in VPXD_SET_DECRYPTOR.
  86. */
  87. typedef void (*vpx_decrypt_cb)(void *decrypt_state, const unsigned char *input,
  88. unsigned char *output, int count);
  89. /*!\brief Structure to hold decryption state
  90. *
  91. * Defines a structure to hold the decryption state and access function.
  92. */
  93. typedef struct vpx_decrypt_init {
  94. /*! Decrypt callback. */
  95. vpx_decrypt_cb decrypt_cb;
  96. /*! Decryption state. */
  97. void *decrypt_state;
  98. } vpx_decrypt_init;
  99. /*!\brief A deprecated alias for vpx_decrypt_init.
  100. */
  101. typedef vpx_decrypt_init vp8_decrypt_init;
  102. /*!\brief VP8 decoder control function parameter type
  103. *
  104. * Defines the data types that VP8D control functions take. Note that
  105. * additional common controls are defined in vp8.h
  106. *
  107. */
  108. VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *)
  109. VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *)
  110. VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *)
  111. VPX_CTRL_USE_TYPE(VPXD_SET_DECRYPTOR, vpx_decrypt_init *)
  112. VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vpx_decrypt_init *)
  113. VPX_CTRL_USE_TYPE(VP9D_GET_DISPLAY_SIZE, int *)
  114. VPX_CTRL_USE_TYPE(VP9D_GET_BIT_DEPTH, unsigned int *)
  115. VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int)
  116. /*! @} - end defgroup vp8_decoder */
  117. #ifdef __cplusplus
  118. } // extern "C"
  119. #endif
  120. #endif // VPX_VP8DX_H_