summaryrefslogtreecommitdiff
path: root/vpx/src/vpx_decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'vpx/src/vpx_decoder.c')
-rw-r--r--vpx/src/vpx_decoder.c61
1 files changed, 26 insertions, 35 deletions
diff --git a/vpx/src/vpx_decoder.c b/vpx/src/vpx_decoder.c
index 802d8edd8..fc1c2bcca 100644
--- a/vpx/src/vpx_decoder.c
+++ b/vpx/src/vpx_decoder.c
@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
/*!\file
* \brief Provides the high level interface to wrap decoder algorithms.
*
@@ -16,17 +15,16 @@
#include <string.h>
#include "vpx/internal/vpx_codec_internal.h"
-#define SAVE_STATUS(ctx,var) (ctx?(ctx->err = var):var)
+#define SAVE_STATUS(ctx, var) (ctx ? (ctx->err = var) : var)
static vpx_codec_alg_priv_t *get_alg_priv(vpx_codec_ctx_t *ctx) {
return (vpx_codec_alg_priv_t *)ctx->priv;
}
-vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
- vpx_codec_iface_t *iface,
+vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
+ vpx_codec_iface_t *iface,
const vpx_codec_dec_cfg_t *cfg,
- vpx_codec_flags_t flags,
- int ver) {
+ vpx_codec_flags_t flags, int ver) {
vpx_codec_err_t res;
if (ver != VPX_DECODER_ABI_VERSION)
@@ -35,7 +33,8 @@ vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
res = VPX_CODEC_INVALID_PARAM;
else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION)
res = VPX_CODEC_ABI_MISMATCH;
- else if ((flags & VPX_CODEC_USE_POSTPROC) && !(iface->caps & VPX_CODEC_CAP_POSTPROC))
+ else if ((flags & VPX_CODEC_USE_POSTPROC) &&
+ !(iface->caps & VPX_CODEC_CAP_POSTPROC))
res = VPX_CODEC_INCAPABLE;
else if ((flags & VPX_CODEC_USE_ERROR_CONCEALMENT) &&
!(iface->caps & VPX_CODEC_CAP_ERROR_CONCEALMENT))
@@ -63,15 +62,14 @@ vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
return SAVE_STATUS(ctx, res);
}
-
-vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
- const uint8_t *data,
- unsigned int data_sz,
+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) {
vpx_codec_err_t res;
- if (!iface || !data || !data_sz || !si
- || si->sz < sizeof(vpx_codec_stream_info_t))
+ if (!iface || !data || !data_sz || !si ||
+ si->sz < sizeof(vpx_codec_stream_info_t))
res = VPX_CODEC_INVALID_PARAM;
else {
/* Set default/unknown values */
@@ -84,8 +82,7 @@ vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
return res;
}
-
-vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
+vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
vpx_codec_stream_info_t *si) {
vpx_codec_err_t res;
@@ -104,12 +101,9 @@ vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
return SAVE_STATUS(ctx, res);
}
-
-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) {
+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) {
vpx_codec_err_t res;
/* Sanity checks */
@@ -126,8 +120,7 @@ vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
return SAVE_STATUS(ctx, res);
}
-vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter) {
+vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, vpx_codec_iter_t *iter) {
vpx_image_t *img;
if (!ctx || !iter || !ctx->iface || !ctx->priv)
@@ -138,16 +131,15 @@ vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
return img;
}
-
-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) {
+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) {
vpx_codec_err_t res;
if (!ctx || !cb)
res = VPX_CODEC_INVALID_PARAM;
- else if (!ctx->iface || !ctx->priv
- || !(ctx->iface->caps & VPX_CODEC_CAP_PUT_FRAME))
+ else if (!ctx->iface || !ctx->priv ||
+ !(ctx->iface->caps & VPX_CODEC_CAP_PUT_FRAME))
res = VPX_CODEC_ERROR;
else {
ctx->priv->dec.put_frame_cb.u.put_frame = cb;
@@ -158,16 +150,15 @@ vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx
return SAVE_STATUS(ctx, res);
}
-
-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) {
+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) {
vpx_codec_err_t res;
if (!ctx || !cb)
res = VPX_CODEC_INVALID_PARAM;
- else if (!ctx->iface || !ctx->priv
- || !(ctx->iface->caps & VPX_CODEC_CAP_PUT_SLICE))
+ else if (!ctx->iface || !ctx->priv ||
+ !(ctx->iface->caps & VPX_CODEC_CAP_PUT_SLICE))
res = VPX_CODEC_ERROR;
else {
ctx->priv->dec.put_slice_cb.u.put_slice = cb;