|
|
@ -35,10 +35,10 @@ typedef struct VP8DecoderContext { |
|
|
|
struct vpx_codec_ctx decoder; |
|
|
|
struct vpx_codec_ctx decoder; |
|
|
|
} VP8Context; |
|
|
|
} VP8Context; |
|
|
|
|
|
|
|
|
|
|
|
static av_cold int vp8_init(AVCodecContext *avctx) |
|
|
|
static av_cold int vpx_init(AVCodecContext *avctx, |
|
|
|
|
|
|
|
const struct vpx_codec_iface *iface) |
|
|
|
{ |
|
|
|
{ |
|
|
|
VP8Context *ctx = avctx->priv_data; |
|
|
|
VP8Context *ctx = avctx->priv_data; |
|
|
|
const struct vpx_codec_iface *iface = &vpx_codec_vp8_dx_algo; |
|
|
|
|
|
|
|
struct vpx_codec_dec_cfg deccfg = { |
|
|
|
struct vpx_codec_dec_cfg deccfg = { |
|
|
|
/* token partitions+1 would be a decent choice */ |
|
|
|
/* token partitions+1 would be a decent choice */ |
|
|
|
.threads = FFMIN(avctx->thread_count, 16) |
|
|
|
.threads = FFMIN(avctx->thread_count, 16) |
|
|
@ -58,6 +58,11 @@ static av_cold int vp8_init(AVCodecContext *avctx) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static av_cold int vp8_init(AVCodecContext *avctx) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return vpx_init(avctx, &vpx_codec_vp8_dx_algo); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int vp8_decode(AVCodecContext *avctx, |
|
|
|
static int vp8_decode(AVCodecContext *avctx, |
|
|
|
void *data, int *got_frame, AVPacket *avpkt) |
|
|
|
void *data, int *got_frame, AVPacket *avpkt) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -123,3 +128,20 @@ AVCodec ff_libvpx_decoder = { |
|
|
|
.capabilities = CODEC_CAP_AUTO_THREADS, |
|
|
|
.capabilities = CODEC_CAP_AUTO_THREADS, |
|
|
|
.long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), |
|
|
|
.long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static av_cold int vp9_init(AVCodecContext *avctx) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return vpx_init(avctx, &vpx_codec_vp9_dx_algo); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AVCodec ff_libvpx_vp9_decoder = { |
|
|
|
|
|
|
|
.name = "libvpx-vp9", |
|
|
|
|
|
|
|
.type = AVMEDIA_TYPE_VIDEO, |
|
|
|
|
|
|
|
.id = AV_CODEC_ID_VP9, |
|
|
|
|
|
|
|
.priv_data_size = sizeof(VP8Context), |
|
|
|
|
|
|
|
.init = vp9_init, |
|
|
|
|
|
|
|
.close = vp8_free, |
|
|
|
|
|
|
|
.decode = vp8_decode, |
|
|
|
|
|
|
|
.capabilities = CODEC_CAP_AUTO_THREADS | CODEC_CAP_EXPERIMENTAL, |
|
|
|
|
|
|
|
.long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"), |
|
|
|
|
|
|
|
}; |
|
|
|