2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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.
12 /*!\defgroup vp8_decoder WebM VP8/VP9 Decoder
18 * \brief Provides definitions for using VP8 or VP9 within the vpx Decoder
28 /* Include controls common to both the encoder and decoder */
31 /*!\name Algorithm interface for VP8
33 * This interface provides the capability to decode VP8 streams.
36 extern vpx_codec_iface_t vpx_codec_vp8_dx_algo;
37 extern vpx_codec_iface_t *vpx_codec_vp8_dx(void);
38 /*!@} - end algorithm interface member group*/
40 /*!\name Algorithm interface for VP9
42 * This interface provides the capability to decode VP9 streams.
45 extern vpx_codec_iface_t vpx_codec_vp9_dx_algo;
46 extern vpx_codec_iface_t *vpx_codec_vp9_dx(void);
47 /*!@} - end algorithm interface member group*/
50 /*!\enum vp8_dec_control_id
51 * \brief VP8 decoder control functions
53 * This set of macros define the control functions available for the VP8
56 * \sa #vpx_codec_control
58 enum vp8_dec_control_id {
59 /** control function to get info on which reference frames were updated
62 VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START,
64 /** check if the indicated frame is corrupted */
65 VP8D_GET_FRAME_CORRUPTED,
67 /** control function to get info on which reference frames were used
70 VP8D_GET_LAST_REF_USED,
72 /** decryption function to decrypt encoded buffer data immediately
73 * before decoding. Takes a vpx_decrypt_init, which contains
74 * a callback function and opaque context pointer.
77 VP8D_SET_DECRYPTOR = VPXD_SET_DECRYPTOR,
79 /** control function to get the display dimensions for the current frame. */
80 VP9D_GET_DISPLAY_SIZE,
82 /** control function to get the bit depth of the stream. */
85 /** control function to set the byte alignment of the planes in the reference
86 * buffers. Valid values are power of 2, from 32 to 1024. A value of 0 sets
87 * legacy alignment. I.e. Y plane is aligned to 32 bytes, U plane directly
88 * follows Y plane, and V plane directly follows U plane. Default value is 0.
90 VP9_SET_BYTE_ALIGNMENT,
92 /** control function to invert the decoding order to from right to left. The
93 * function is used in a test to confirm the decoding independence of tile
94 * columns. The function may be used in application where this order
95 * of decoding is desired.
97 * TODO(yaowu): Rework the unit test that uses this control, and in a future
98 * release, this test-only control shall be removed.
100 VP9_INVERT_TILE_DECODE_ORDER,
102 VP8_DECODER_CTRL_ID_MAX
105 /** Decrypt n bytes of data from input -> output, using the decrypt_state
106 * passed in VPXD_SET_DECRYPTOR.
108 typedef void (*vpx_decrypt_cb)(void *decrypt_state, const unsigned char *input,
109 unsigned char *output, int count);
111 /*!\brief Structure to hold decryption state
113 * Defines a structure to hold the decryption state and access function.
115 typedef struct vpx_decrypt_init {
116 /*! Decrypt callback. */
117 vpx_decrypt_cb decrypt_cb;
119 /*! Decryption state. */
123 /*!\brief A deprecated alias for vpx_decrypt_init.
125 typedef vpx_decrypt_init vp8_decrypt_init;
128 /*!\brief VP8 decoder control function parameter type
130 * Defines the data types that VP8D control functions take. Note that
131 * additional common controls are defined in vp8.h
136 VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *)
137 VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *)
138 VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *)
139 VPX_CTRL_USE_TYPE(VPXD_SET_DECRYPTOR, vpx_decrypt_init *)
140 VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vpx_decrypt_init *)
141 VPX_CTRL_USE_TYPE(VP9D_GET_DISPLAY_SIZE, int *)
142 VPX_CTRL_USE_TYPE(VP9D_GET_BIT_DEPTH, unsigned int *)
143 VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int)
145 /*! @} - end defgroup vp8_decoder */
151 #endif // VPX_VP8DX_H_