26 #define VPX_CODEC_DISABLE_COMPAT 1
27 #include <vpx/vpx_decoder.h>
28 #include <vpx/vp8dx.h>
40 const struct vpx_codec_iface *iface = &vpx_codec_vp8_dx_algo;
41 struct vpx_codec_dec_cfg deccfg = {
49 if (vpx_codec_dec_init(&ctx->decoder, iface, &deccfg, 0) != VPX_CODEC_OK) {
50 const char *error = vpx_codec_error(&ctx->decoder);
65 const void *iter =
NULL;
66 struct vpx_image *img;
68 if (vpx_codec_decode(&ctx->decoder, avpkt->
data, avpkt->
size,
NULL, 0) !=
70 const char *error = vpx_codec_error(&ctx->decoder);
71 const char *detail = vpx_codec_error_detail(&ctx->decoder);
80 if ((img = vpx_codec_get_frame(&ctx->decoder, &iter))) {
81 if (img->fmt != VPX_IMG_FMT_I420) {
87 if ((
int) img->d_w != avctx->
width || (
int) img->d_h != avctx->
height) {
94 picture->
data[0] = img->planes[0];
95 picture->
data[1] = img->planes[1];
96 picture->
data[2] = img->planes[2];
98 picture->
linesize[0] = img->stride[0];
99 picture->
linesize[1] = img->stride[1];
100 picture->
linesize[2] = img->stride[2];
110 vpx_codec_destroy(&ctx->decoder);