WebM VP8 Codec SDK
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 
11 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #ifndef VPX_DECODER_H
32 #define VPX_DECODER_H
33 #include "vpx_codec.h"
34 
43 #define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION)
53 #define VPX_CODEC_CAP_PUT_SLICE 0x10000
54 #define VPX_CODEC_CAP_PUT_FRAME 0x20000
55 #define VPX_CODEC_CAP_POSTPROC 0x40000
56 #define VPX_CODEC_CAP_ERROR_CONCEALMENT 0x80000
58 #define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000
68 #define VPX_CODEC_USE_POSTPROC 0x10000
69 #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000
71 #define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000
81  typedef struct vpx_codec_stream_info
82  {
83  unsigned int sz;
84  unsigned int w;
85  unsigned int h;
86  unsigned int is_kf;
88 
89  /* REQUIRED FUNCTIONS
90  *
91  * The following functions are required to be implemented for all decoders.
92  * They represent the base case functionality expected of all decoders.
93  */
94 
95 
101  typedef struct vpx_codec_dec_cfg
102  {
103  unsigned int threads;
104  unsigned int w;
105  unsigned int h;
132  vpx_codec_iface_t *iface,
133  vpx_codec_dec_cfg_t *cfg,
134  vpx_codec_flags_t flags,
135  int ver);
136 
141 #define vpx_codec_dec_init(ctx, iface, cfg, flags) \
142  vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION)
143 
144 
163  const uint8_t *data,
164  unsigned int data_sz,
166 
167 
183 
184 
216  const uint8_t *data,
217  unsigned int data_sz,
218  void *user_priv,
219  long deadline);
220 
221 
238  vpx_codec_iter_t *iter);
239 
240 
255  typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
256  const vpx_image_t *img);
257 
258 
276  void *user_priv);
277 
278 
295  typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
296  const vpx_image_t *img,
297  const vpx_image_rect_t *valid,
298  const vpx_image_rect_t *update);
299 
318  void *user_priv);
319 
320 
325 #endif
326 
327 #ifdef __cplusplus
328 }
329 #endif
330 
331 #if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT
332 #include "vpx_decoder_compat.h"
333 #endif
struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition: vpx_codec.h:167
unsigned long sz
Definition: vpx_codec.h:504
Image Descriptor.
Definition: vpx_image.h:97
unsigned int threads
Definition: vpx_decoder.h:108
Stream properties.
Definition: vpx_decoder.h:86
unsigned int w
Definition: vpx_decoder.h:109
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_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_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_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.
Representation of a rectangle on a surface.
Definition: vpx_image.h:144
unsigned int h
Definition: vpx_decoder.h:110
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.
long vpx_codec_flags_t
Initialization-time Feature Enabling.
Definition: vpx_codec.h:158
void(* vpx_codec_put_frame_cb_fn_t)(void *user_priv, const vpx_image_t *img)
put frame callback prototype
Definition: vpx_decoder.h:260
vpx_codec_err_t
Algorithm return codes.
Definition: vpx_codec.h:81
struct vpx_codec_stream_info vpx_codec_stream_info_t
Stream properties.
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.
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:300
Describes the codec algorithm interface to applications.
Initialization Configurations.
Definition: vpx_decoder.h:106
const void * vpx_codec_iter_t
Iterator.
Definition: vpx_codec.h:182
vpx_image_t * vpx_codec_get_frame(vpx_codec_ctx_t *ctx, vpx_codec_iter_t *iter)
Decoded frames iterator.
struct vpx_codec_dec_cfg vpx_codec_dec_cfg_t
Initialization Configurations.
Codec context structure.
Definition: vpx_codec.h:193