#include "common/common.h"
#include "common/onyxd.h"
#include "decoder/onyxd_int.h"
+#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_mem/vpx_mem.h"
#if CONFIG_ERROR_CONCEALMENT
#include "decoder/error_concealment.h"
FRAGMENT_DATA fragments;
};
-static void vp8_init_ctx(vpx_codec_ctx_t *ctx)
+static int vp8_init_ctx(vpx_codec_ctx_t *ctx)
{
vpx_codec_alg_priv_t *priv =
(vpx_codec_alg_priv_t *)vpx_calloc(1, sizeof(*priv));
+ if (!priv) return 1;
ctx->priv = (vpx_codec_priv_t *)priv;
ctx->priv->init_flags = ctx->init_flags;
priv->cfg = *ctx->config.dec;
ctx->config.dec = &priv->cfg;
}
+
+ return 0;
}
static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx,
* information becomes known.
*/
if (!ctx->priv) {
- vp8_init_ctx(ctx);
+ if (vp8_init_ctx(ctx)) return VPX_CODEC_MEM_ERROR;
priv = (vpx_codec_alg_priv_t *)ctx->priv;
/* initialize number of fragments to zero */
const uint8_t *clear = data;
if (decrypt_cb)
{
- int n = MIN(sizeof(clear_buffer), data_sz);
+ int n = VPXMIN(sizeof(clear_buffer), data_sz);
decrypt_cb(decrypt_state, data, clear_buffer, n);
clear = clear_buffer;
}
img->fmt = VPX_IMG_FMT_I420;
img->w = yv12->y_stride;
img->h = (yv12->y_height + 2 * VP8BORDERINPIXELS + 15) & ~15;
- img->d_w = yv12->y_width;
- img->d_h = yv12->y_height;
+ img->d_w = img->r_w = yv12->y_width;
+ img->d_h = img->r_h = yv12->y_height;
img->x_chroma_shift = 1;
img->y_chroma_shift = 1;
img->planes[VPX_PLANE_Y] = yv12->y_buffer;