John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 1 | /* |
John Koleszar | c2140b8 | 2010-09-09 08:16:39 -0400 | [diff] [blame] | 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 3 | * |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 4 | * Use of this source code is governed by a BSD-style license |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 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 |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 7 | * in the file PATENTS. All contributing project authors may |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 8 | * be found in the AUTHORS file in the root of the source tree. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 12 | /*!\defgroup vp8_decoder WebM VP8 Decoder |
| 13 | * \ingroup vp8 |
| 14 | * |
| 15 | * @{ |
| 16 | */ |
James Zern | f42d52e | 2011-02-16 17:54:49 -0800 | [diff] [blame] | 17 | /*!\file |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 18 | * \brief Provides definitions for using the VP8 algorithm within the vpx Decoder |
| 19 | * interface. |
| 20 | */ |
James Zern | 7386bde | 2013-12-15 18:26:15 -0800 | [diff] [blame] | 21 | #ifndef VPX_VP8DX_H_ |
| 22 | #define VPX_VP8DX_H_ |
Dmitry Kovalev | e288c60 | 2013-09-29 18:00:15 -0700 | [diff] [blame] | 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 27 | |
Johann | e883c74 | 2013-12-16 13:15:26 -0800 | [diff] [blame] | 28 | /* Include controls common to both the encoder and decoder */ |
| 29 | #include "./vp8.h" |
| 30 | |
James Zern | 8e17e82 | 2011-02-24 14:12:57 -0800 | [diff] [blame] | 31 | /*!\name Algorithm interface for VP8 |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 32 | * |
| 33 | * This interface provides the capability to decode raw VP8 streams, as would |
| 34 | * be found in AVI files and other non-Flash uses. |
James Zern | 8e17e82 | 2011-02-24 14:12:57 -0800 | [diff] [blame] | 35 | * @{ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 36 | */ |
John Koleszar | fa7a55b | 2010-09-21 10:35:52 -0400 | [diff] [blame] | 37 | extern vpx_codec_iface_t vpx_codec_vp8_dx_algo; |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 38 | extern vpx_codec_iface_t *vpx_codec_vp8_dx(void); |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 39 | |
| 40 | /* TODO(jkoleszar): These move to VP9 in a later patch set. */ |
| 41 | extern vpx_codec_iface_t vpx_codec_vp9_dx_algo; |
| 42 | extern vpx_codec_iface_t *vpx_codec_vp9_dx(void); |
James Zern | 8e17e82 | 2011-02-24 14:12:57 -0800 | [diff] [blame] | 43 | /*!@} - end algorithm interface member group*/ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 44 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 45 | |
Adrian Grange | f58eca9 | 2013-10-24 15:11:36 -0700 | [diff] [blame] | 46 | /*!\enum vp8_dec_control_id |
| 47 | * \brief VP8 decoder control functions |
Henrik Lundin | 2a87491 | 2010-12-14 14:05:06 +0100 | [diff] [blame] | 48 | * |
James Zern | 8e17e82 | 2011-02-24 14:12:57 -0800 | [diff] [blame] | 49 | * This set of macros define the control functions available for the VP8 |
| 50 | * decoder interface. |
| 51 | * |
| 52 | * \sa #vpx_codec_control |
Henrik Lundin | 2a87491 | 2010-12-14 14:05:06 +0100 | [diff] [blame] | 53 | */ |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 54 | enum vp8_dec_control_id { |
| 55 | /** control function to get info on which reference frames were updated |
| 56 | * by the last decode |
| 57 | */ |
| 58 | VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START, |
John Koleszar | 4a742e5 | 2011-03-04 08:51:39 -0500 | [diff] [blame] | 59 | |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 60 | /** check if the indicated frame is corrupted */ |
| 61 | VP8D_GET_FRAME_CORRUPTED, |
John Koleszar | 4a742e5 | 2011-03-04 08:51:39 -0500 | [diff] [blame] | 62 | |
John Koleszar | 83b1d90 | 2012-11-05 12:37:14 -0800 | [diff] [blame] | 63 | /** control function to get info on which reference frames were used |
| 64 | * by the last decode |
| 65 | */ |
| 66 | VP8D_GET_LAST_REF_USED, |
| 67 | |
Jeff Petkau | 368c723 | 2013-06-13 12:16:58 -0700 | [diff] [blame] | 68 | /** decryption function to decrypt encoded buffer data immediately |
| 69 | * before decoding. Takes a vp8_decrypt_init, which contains |
| 70 | * a callback function and opaque context pointer. |
Dmitry Kovalev | 26cec5c | 2013-03-15 18:21:55 -0700 | [diff] [blame] | 71 | */ |
Jeff Petkau | 368c723 | 2013-06-13 12:16:58 -0700 | [diff] [blame] | 72 | VP8D_SET_DECRYPTOR, |
Dmitry Kovalev | 26cec5c | 2013-03-15 18:21:55 -0700 | [diff] [blame] | 73 | |
Adrian Grange | 2117fe0 | 2013-11-19 14:01:44 -0800 | [diff] [blame] | 74 | /** control function to get the display dimensions for the current frame. */ |
| 75 | VP9D_GET_DISPLAY_SIZE, |
| 76 | |
John Koleszar | 672b75a | 2013-03-27 11:22:20 -0700 | [diff] [blame] | 77 | /** For testing. */ |
| 78 | VP9_INVERT_TILE_DECODE_ORDER, |
| 79 | |
John Koleszar | c6b9039 | 2012-07-13 15:21:29 -0700 | [diff] [blame] | 80 | VP8_DECODER_CTRL_ID_MAX |
| 81 | }; |
Henrik Lundin | 2a87491 | 2010-12-14 14:05:06 +0100 | [diff] [blame] | 82 | |
Adrian Grange | f58eca9 | 2013-10-24 15:11:36 -0700 | [diff] [blame] | 83 | /*!\brief Structure to hold decryption state |
| 84 | * |
| 85 | * Defines a structure to hold the decryption state and access function. |
| 86 | */ |
Jeff Petkau | 368c723 | 2013-06-13 12:16:58 -0700 | [diff] [blame] | 87 | typedef struct vp8_decrypt_init { |
Dmitry Kovalev | ccd9886 | 2013-06-17 13:50:22 -0700 | [diff] [blame] | 88 | /** Decrypt n bytes of data from input -> output, using the decrypt_state |
| 89 | * passed in VP8D_SET_DECRYPTOR. |
| 90 | */ |
| 91 | void (*decrypt_cb)(void *decrypt_state, const unsigned char *input, |
| 92 | unsigned char *output, int count); |
Adrian Grange | f58eca9 | 2013-10-24 15:11:36 -0700 | [diff] [blame] | 93 | /*! Decryption state. */ |
Jeff Petkau | 368c723 | 2013-06-13 12:16:58 -0700 | [diff] [blame] | 94 | void *decrypt_state; |
| 95 | } vp8_decrypt_init; |
| 96 | |
John Koleszar | 4a742e5 | 2011-03-04 08:51:39 -0500 | [diff] [blame] | 97 | /*!\brief VP8 decoder control function parameter type |
Henrik Lundin | 2a87491 | 2010-12-14 14:05:06 +0100 | [diff] [blame] | 98 | * |
John Koleszar | 4a742e5 | 2011-03-04 08:51:39 -0500 | [diff] [blame] | 99 | * Defines the data types that VP8D control functions take. Note that |
Henrik Lundin | 2a87491 | 2010-12-14 14:05:06 +0100 | [diff] [blame] | 100 | * additional common controls are defined in vp8.h |
| 101 | * |
| 102 | */ |
| 103 | |
| 104 | |
| 105 | VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *) |
Henrik Lundin | 67fb3a5 | 2010-12-16 16:46:31 +0100 | [diff] [blame] | 106 | VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *) |
John Koleszar | 83b1d90 | 2012-11-05 12:37:14 -0800 | [diff] [blame] | 107 | VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *) |
Jeff Petkau | 368c723 | 2013-06-13 12:16:58 -0700 | [diff] [blame] | 108 | VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vp8_decrypt_init *) |
Adrian Grange | 2117fe0 | 2013-11-19 14:01:44 -0800 | [diff] [blame] | 109 | VPX_CTRL_USE_TYPE(VP9D_GET_DISPLAY_SIZE, int *) |
John Koleszar | 672b75a | 2013-03-27 11:22:20 -0700 | [diff] [blame] | 110 | VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int) |
Henrik Lundin | 2a87491 | 2010-12-14 14:05:06 +0100 | [diff] [blame] | 111 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 112 | /*! @} - end defgroup vp8_decoder */ |
| 113 | |
Dmitry Kovalev | e288c60 | 2013-09-29 18:00:15 -0700 | [diff] [blame] | 114 | #ifdef __cplusplus |
| 115 | } // extern "C" |
| 116 | #endif |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 117 | |
James Zern | 7386bde | 2013-12-15 18:26:15 -0800 | [diff] [blame] | 118 | #endif // VPX_VP8DX_H_ |