blob: bde77c24d87b506cd74bd5b6e663d3a256db392b [file] [log] [blame]
John Koleszar0ea50ce2010-05-18 11:58:33 -04001/*
John Koleszarc2140b82010-09-09 08:16:39 -04002 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar0ea50ce2010-05-18 11:58:33 -04003 *
John Koleszar94c52e42010-06-18 12:39:21 -04004 * Use of this source code is governed by a BSD-style license
John Koleszar09202d82010-06-04 16:19:40 -04005 * 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 Koleszar94c52e42010-06-18 12:39:21 -04007 * in the file PATENTS. All contributing project authors may
John Koleszar09202d82010-06-04 16:19:40 -04008 * be found in the AUTHORS file in the root of the source tree.
John Koleszar0ea50ce2010-05-18 11:58:33 -04009 */
10
11
John Koleszar0ea50ce2010-05-18 11:58:33 -040012/*!\defgroup vp8_decoder WebM VP8 Decoder
13 * \ingroup vp8
14 *
15 * @{
16 */
James Zernf42d52e2011-02-16 17:54:49 -080017/*!\file
John Koleszar0ea50ce2010-05-18 11:58:33 -040018 * \brief Provides definitions for using the VP8 algorithm within the vpx Decoder
19 * interface.
20 */
James Zern7386bde2013-12-15 18:26:15 -080021#ifndef VPX_VP8DX_H_
22#define VPX_VP8DX_H_
Dmitry Kovaleve288c602013-09-29 18:00:15 -070023
24#ifdef __cplusplus
25extern "C" {
26#endif
John Koleszar0ea50ce2010-05-18 11:58:33 -040027
Johanne883c742013-12-16 13:15:26 -080028/* Include controls common to both the encoder and decoder */
29#include "./vp8.h"
30
James Zern8e17e822011-02-24 14:12:57 -080031/*!\name Algorithm interface for VP8
John Koleszar0ea50ce2010-05-18 11:58:33 -040032 *
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 Zern8e17e822011-02-24 14:12:57 -080035 * @{
John Koleszar0ea50ce2010-05-18 11:58:33 -040036 */
John Koleszarfa7a55b2010-09-21 10:35:52 -040037extern vpx_codec_iface_t vpx_codec_vp8_dx_algo;
John Koleszarc6b90392012-07-13 15:21:29 -070038extern vpx_codec_iface_t *vpx_codec_vp8_dx(void);
John Koleszara9c75972012-11-08 17:09:30 -080039
40/* TODO(jkoleszar): These move to VP9 in a later patch set. */
41extern vpx_codec_iface_t vpx_codec_vp9_dx_algo;
42extern vpx_codec_iface_t *vpx_codec_vp9_dx(void);
James Zern8e17e822011-02-24 14:12:57 -080043/*!@} - end algorithm interface member group*/
John Koleszar0ea50ce2010-05-18 11:58:33 -040044
John Koleszar0ea50ce2010-05-18 11:58:33 -040045
Adrian Grangef58eca92013-10-24 15:11:36 -070046/*!\enum vp8_dec_control_id
47 * \brief VP8 decoder control functions
Henrik Lundin2a874912010-12-14 14:05:06 +010048 *
James Zern8e17e822011-02-24 14:12:57 -080049 * This set of macros define the control functions available for the VP8
50 * decoder interface.
51 *
52 * \sa #vpx_codec_control
Henrik Lundin2a874912010-12-14 14:05:06 +010053 */
John Koleszarc6b90392012-07-13 15:21:29 -070054enum 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 Koleszar4a742e52011-03-04 08:51:39 -050059
John Koleszarc6b90392012-07-13 15:21:29 -070060 /** check if the indicated frame is corrupted */
61 VP8D_GET_FRAME_CORRUPTED,
John Koleszar4a742e52011-03-04 08:51:39 -050062
John Koleszar83b1d902012-11-05 12:37:14 -080063 /** 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 Petkau368c7232013-06-13 12:16:58 -070068 /** 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 Kovalev26cec5c2013-03-15 18:21:55 -070071 */
Jeff Petkau368c7232013-06-13 12:16:58 -070072 VP8D_SET_DECRYPTOR,
Dmitry Kovalev26cec5c2013-03-15 18:21:55 -070073
Adrian Grange2117fe02013-11-19 14:01:44 -080074 /** control function to get the display dimensions for the current frame. */
75 VP9D_GET_DISPLAY_SIZE,
76
John Koleszar672b75a2013-03-27 11:22:20 -070077 /** For testing. */
78 VP9_INVERT_TILE_DECODE_ORDER,
79
John Koleszarc6b90392012-07-13 15:21:29 -070080 VP8_DECODER_CTRL_ID_MAX
81};
Henrik Lundin2a874912010-12-14 14:05:06 +010082
Adrian Grangef58eca92013-10-24 15:11:36 -070083/*!\brief Structure to hold decryption state
84 *
85 * Defines a structure to hold the decryption state and access function.
86 */
Jeff Petkau368c7232013-06-13 12:16:58 -070087typedef struct vp8_decrypt_init {
Dmitry Kovalevccd98862013-06-17 13:50:22 -070088 /** 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 Grangef58eca92013-10-24 15:11:36 -070093 /*! Decryption state. */
Jeff Petkau368c7232013-06-13 12:16:58 -070094 void *decrypt_state;
95} vp8_decrypt_init;
96
John Koleszar4a742e52011-03-04 08:51:39 -050097/*!\brief VP8 decoder control function parameter type
Henrik Lundin2a874912010-12-14 14:05:06 +010098 *
John Koleszar4a742e52011-03-04 08:51:39 -050099 * Defines the data types that VP8D control functions take. Note that
Henrik Lundin2a874912010-12-14 14:05:06 +0100100 * additional common controls are defined in vp8.h
101 *
102 */
103
104
105VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *)
Henrik Lundin67fb3a52010-12-16 16:46:31 +0100106VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *)
John Koleszar83b1d902012-11-05 12:37:14 -0800107VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *)
Jeff Petkau368c7232013-06-13 12:16:58 -0700108VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vp8_decrypt_init *)
Adrian Grange2117fe02013-11-19 14:01:44 -0800109VPX_CTRL_USE_TYPE(VP9D_GET_DISPLAY_SIZE, int *)
John Koleszar672b75a2013-03-27 11:22:20 -0700110VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int)
Henrik Lundin2a874912010-12-14 14:05:06 +0100111
John Koleszar0ea50ce2010-05-18 11:58:33 -0400112/*! @} - end defgroup vp8_decoder */
113
Dmitry Kovaleve288c602013-09-29 18:00:15 -0700114#ifdef __cplusplus
115} // extern "C"
116#endif
John Koleszar0ea50ce2010-05-18 11:58:33 -0400117
James Zern7386bde2013-12-15 18:26:15 -0800118#endif // VPX_VP8DX_H_