Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2015 18:33
Show Gist options
  • Save anonymous/2f82a4bb09d5125357c0 to your computer and use it in GitHub Desktop.
Save anonymous/2f82a4bb09d5125357c0 to your computer and use it in GitHub Desktop.
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 245332e..0434ef1 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -580,6 +580,8 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (LIBVORBIS, libvorbis);
REGISTER_ENCDEC (LIBVPX_VP8, libvpx_vp8);
REGISTER_ENCDEC (LIBVPX_VP9, libvpx_vp9);
+#define CONFIG_LIBVPX_VP10_DECODER 1
+ REGISTER_DECODER(LIBVPX_VP10, libvpx_vp10);
REGISTER_ENCODER(LIBWAVPACK, libwavpack);
REGISTER_ENCODER(LIBWEBP_ANIM, libwebp_anim); /* preferred over libwebp */
REGISTER_ENCODER(LIBWEBP, libwebp);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 35965d7..fcd59db 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -298,6 +298,7 @@ enum AVCodecID {
AV_CODEC_ID_DXV,
AV_CODEC_ID_SCREENPRESSO,
AV_CODEC_ID_RSCC,
+ AV_CODEC_ID_VP10,
AV_CODEC_ID_Y41P = 0x8000,
AV_CODEC_ID_AVRP,
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 9cad3e6..44abef0 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -912,6 +912,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
+ .id = AV_CODEC_ID_VP10,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "vp10",
+ .long_name = NULL_IF_CONFIG_SMALL("Google VP10"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
+ {
.id = AV_CODEC_ID_PICTOR,
.type = AVMEDIA_TYPE_VIDEO,
.name = "pictor",
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 7267590..512f538 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -264,3 +264,20 @@ AVCodec ff_libvpx_vp9_decoder = {
.profiles = NULL_IF_CONFIG_SMALL(profiles),
};
#endif /* CONFIG_LIBVPX_VP9_DECODER */
+
+static av_cold int vp10_init(AVCodecContext *avctx)
+{
+ return vpx_init(avctx, &vpx_codec_vp10_dx_algo);
+}
+
+AVCodec ff_libvpx_vp10_decoder = {
+ .name = "libvpx-vp10",
+ .long_name = NULL_IF_CONFIG_SMALL("libvpx VP10"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_VP10,
+ .priv_data_size = sizeof(VP8Context),
+ .init = vp10_init,
+ .close = vp8_free,
+ .decode = vp8_decode,
+ .capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1,
+};
diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index faa662d..3a0655d 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -95,6 +95,7 @@ const CodecTags ff_mkv_codec_tags[]={
{"V_UNCOMPRESSED" , AV_CODEC_ID_RAWVIDEO},
{"V_VP8" , AV_CODEC_ID_VP8},
{"V_VP9" , AV_CODEC_ID_VP9},
+ {"V_VP10" , AV_CODEC_ID_VP10},
{"" , AV_CODEC_ID_NONE}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment