diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2012-12-20 17:22:06 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-01-14 19:20:47 +0100 |
commit | dab1f543fcac7ad3dcdd427fc1b859667c82aaa2 (patch) | |
tree | b8cadc285736af9a6b327a7b0d1b71aeafc3baef /libavcodec/libvpxenc.c | |
parent | 23a610b9d66a512afed8627d294f4ae7b16153a0 (diff) | |
download | ffmpeg-dab1f543fcac7ad3dcdd427fc1b859667c82aaa2.tar.gz |
libvpx: support vp9
This feature is experimental use at your risk
Diffstat (limited to 'libavcodec/libvpxenc.c')
-rw-r--r-- | libavcodec/libvpxenc.c | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 17b9800f25..7f7cad9e3a 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -214,10 +214,10 @@ static av_cold int vp8_free(AVCodecContext *avctx) return 0; } -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; - const struct vpx_codec_iface *iface = &vpx_codec_vp8_cx_algo; struct vpx_codec_enc_cfg enccfg; int res; @@ -362,6 +362,11 @@ static av_cold int vp8_init(AVCodecContext *avctx) return 0; } +static av_cold int vp8_init(AVCodecContext *avctx) +{ + return vpx_init(avctx, &vpx_codec_vp8_cx_algo); +} + static inline void cx_pktcpy(struct FrameListData *dst, const struct vpx_codec_cx_pkt *src) { @@ -594,3 +599,32 @@ AVCodec ff_libvpx_encoder = { .priv_class = &class, .defaults = defaults, }; + + +static av_cold int vp9_init(AVCodecContext *avctx) +{ + return vpx_init(avctx, &vpx_codec_vp9_cx_algo); +} + +static const AVClass class_vp9 = { + .class_name = "libvpx encoder", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + + +AVCodec ff_libvpx_vp9_encoder = { + .name = "libvpx-vp9", + .type = AVMEDIA_TYPE_VIDEO, + .id = AV_CODEC_ID_VP9, + .priv_data_size = sizeof(VP8Context), + .init = vp9_init, + .encode2 = vp8_encode, + .close = vp8_free, + .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS | CODEC_CAP_EXPERIMENTAL, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, + .long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"), + .priv_class = &class_vp9, + .defaults = defaults, +}; |