WebM VP8 Codec SDK

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

vpx_decoder.h
Go to the documentation of this file.
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 #ifndef VPX_DECODER_H
11 #define VPX_DECODER_H
12
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #include "vpx_codec.h"
33
42 #define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION)
52 #define VPX_CODEC_CAP_PUT_SLICE 0x10000
53 #define VPX_CODEC_CAP_PUT_FRAME 0x20000
54 #define VPX_CODEC_CAP_POSTPROC 0x40000
55 #define VPX_CODEC_CAP_ERROR_CONCEALMENT 0x80000
57 #define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000
67 #define VPX_CODEC_CAP_FRAME_THREADING 0x200000
70 #define VPX_CODEC_USE_POSTPROC 0x10000
71 #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000
73 #define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000
76 #define VPX_CODEC_USE_FRAME_THREADING 0x80000
85 typedef struct vpx_codec_stream_info {
86 unsigned int sz;
87 unsigned int w;
88 unsigned int h;
89 unsigned int is_kf;
90 } vpx_codec_stream_info_t;
91
92 /* REQUIRED FUNCTIONS
93 *
94 * The following functions are required to be implemented for all decoders.
95 * They represent the base case functionality expected of all decoders.
96 */
97
98
104 typedef struct vpx_codec_dec_cfg {
105 unsigned int threads;
106 unsigned int w;
107 unsigned int h;
108 } vpx_codec_dec_cfg_t;
137 vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
138 vpx_codec_iface_t *iface,
139 vpx_codec_dec_cfg_t *cfg,
140 vpx_codec_flags_t flags,
141 int ver);
142
147 #define vpx_codec_dec_init(ctx, iface, cfg, flags) \
148 vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION)
149
150
168 vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
169 const uint8_t *data,
170 unsigned int data_sz,
171 vpx_codec_stream_info_t *si);
172
173
187 vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
188 vpx_codec_stream_info_t *si);
189
190
221 vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
222 const uint8_t *data,
223 unsigned int data_sz,
224 void *user_priv,
225 long deadline);
226
227
243 vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
244 vpx_codec_iter_t *iter);
245
246
261 typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
262 const vpx_image_t *img);
263
264
280 vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
281 vpx_codec_put_frame_cb_fn_t cb,
282 void *user_priv);
283
284
301 typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
302 const vpx_image_t *img,
303 const vpx_image_rect_t *valid,
304 const vpx_image_rect_t *update);
305
306
322 vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
323 vpx_codec_put_slice_cb_fn_t cb,
324 void *user_priv);
325
326
330 #ifdef __cplusplus
331 }
332 #endif
333 #endif
334
vpx_codec_iface_t
struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition: vpx_codec.h:175
vpx_codec_mmap::sz
unsigned long sz
Definition: vpx_codec.h:509
vpx_image
Image Descriptor.
Definition: vpx_image.h:99
vpx_codec_dec_cfg::threads
unsigned int threads
Definition: vpx_decoder.h:112
vpx_codec_stream_info
Stream properties.
Definition: vpx_decoder.h:92
vpx_codec_dec_cfg::w
unsigned int w
Definition: vpx_decoder.h:113
vpx_codec_register_put_frame_cb
vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx, vpx_codec_put_frame_cb_fn_t cb, void *user_priv)
Register for notification of frame completion.
vpx_codec_peek_stream_info
vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, const uint8_t *data, unsigned int data_sz, vpx_codec_stream_info_t *si)
Parse stream info from a buffer.
vpx_codec_register_put_slice_cb
vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx, vpx_codec_put_slice_cb_fn_t cb, void *user_priv)
Register for notification of slice completion.
vpx_codec_dec_init_ver
vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, vpx_codec_iface_t *iface, vpx_codec_dec_cfg_t *cfg, vpx_codec_flags_t flags, int ver)
Initialize a decoder instance.
vpx_image_rect
Representation of a rectangle on a surface.
Definition: vpx_image.h:145
vpx_codec_dec_cfg::h
unsigned int h
Definition: vpx_decoder.h:114
vpx_codec_decode
vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, const uint8_t *data, unsigned int data_sz, void *user_priv, long deadline)
Decode data.
vpx_codec_flags_t
long vpx_codec_flags_t
Initialization-time Feature Enabling.
Definition: vpx_codec.h:166
vpx_codec_put_frame_cb_fn_t
void(* vpx_codec_put_frame_cb_fn_t)(void *user_priv, const vpx_image_t *img)
put frame callback prototype
Definition: vpx_decoder.h:268
vpx_codec_err_t
vpx_codec_err_t
Algorithm return codes.
Definition: vpx_codec.h:89
vpx_codec_stream_info_t
struct vpx_codec_stream_info vpx_codec_stream_info_t
Stream properties.
vpx_codec_get_stream_info
vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx, vpx_codec_stream_info_t *si)
Return information about the current stream.
vpx_codec_put_slice_cb_fn_t
void(* vpx_codec_put_slice_cb_fn_t)(void *user_priv, const vpx_image_t *img, const vpx_image_rect_t *valid, const vpx_image_rect_t *update)
put slice callback prototype
Definition: vpx_decoder.h:308
vpx_codec.h
Describes the codec algorithm interface to applications.
vpx_codec_dec_cfg
Initialization Configurations.
Definition: vpx_decoder.h:111
vpx_codec_iter_t
const void * vpx_codec_iter_t
Iterator.
Definition: vpx_codec.h:190
vpx_codec_get_frame
vpx_image_t * vpx_codec_get_frame(vpx_codec_ctx_t *ctx, vpx_codec_iter_t *iter)
Decoded frames iterator.
vpx_codec_dec_cfg_t
struct vpx_codec_dec_cfg vpx_codec_dec_cfg_t
Initialization Configurations.
vpx_codec_ctx
Codec context structure.
Definition: vpx_codec.h:201