AOMedia Codec SDK
aom_decoder.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, Alliance for Open Media. All rights reserved
3  *
4  * This source code is subject to the terms of the BSD 2 Clause License and
5  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6  * was not distributed with this source code in the LICENSE file, you can
7  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8  * Media Patent License 1.0 was not distributed with this source code in the
9  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10  */
11 #ifndef AOM_AOM_DECODER_H_
12 #define AOM_AOM_DECODER_H_
13 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include "aom/aom_codec.h"
34 #include "aom/aom_frame_buffer.h"
35 
44 #define AOM_DECODER_ABI_VERSION \
45  (3 + AOM_CODEC_ABI_VERSION)
55 #define AOM_CODEC_CAP_PUT_SLICE 0x10000
56 #define AOM_CODEC_CAP_PUT_FRAME 0x20000
57 #define AOM_CODEC_CAP_POSTPROC 0x40000
59 #define AOM_CODEC_CAP_INPUT_FRAGMENTS 0x100000
60 
69 #define AOM_CODEC_CAP_FRAME_THREADING 0x200000
70 
71 #define AOM_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000
72 
73 #define AOM_CODEC_USE_POSTPROC 0x10000
76 #define AOM_CODEC_USE_INPUT_FRAGMENTS 0x40000
77 
83 typedef struct aom_codec_stream_info {
84  unsigned int w;
85  unsigned int h;
86  unsigned int is_kf;
87  unsigned int number_spatial_layers;
88  unsigned int number_temporal_layers;
89  unsigned int is_annexb;
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 
103 typedef struct aom_codec_dec_cfg {
104  unsigned int threads;
105  unsigned int w;
106  unsigned int h;
107  unsigned int allow_lowbitdepth;
134  aom_codec_iface_t *iface,
135  const aom_codec_dec_cfg_t *cfg,
136  aom_codec_flags_t flags, int ver);
137 
142 #define aom_codec_dec_init(ctx, iface, cfg, flags) \
143  aom_codec_dec_init_ver(ctx, iface, cfg, flags, AOM_DECODER_ABI_VERSION)
144 
167  const uint8_t *data, size_t data_sz,
169 
186 
215 aom_codec_err_t aom_codec_decode(aom_codec_ctx_t *ctx, const uint8_t *data,
216  size_t data_sz, void *user_priv);
217 
235 
251 typedef void (*aom_codec_put_frame_cb_fn_t)(void *user_priv,
252  const aom_image_t *img);
253 
271  void *user_priv);
272 
290 typedef void (*aom_codec_put_slice_cb_fn_t)(void *user_priv,
291  const aom_image_t *img,
292  const aom_image_rect_t *valid,
293  const aom_image_rect_t *update);
294 
312  void *user_priv);
313 
356  aom_release_frame_buffer_cb_fn_t cb_release, void *cb_priv);
357 
361 #ifdef __cplusplus
362 }
363 #endif
364 #endif // AOM_AOM_DECODER_H_