Commit b26ccf21 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'c4bfa098'

* commit 'c4bfa098':
  Add a WebP decoder

Conflicts:
	Changelog
	doc/general.texi
	libavcodec/Makefile
	libavcodec/avcodec.h
	libavcodec/version.h
	libavformat/img2.c

The previously existing webp decoder is disabled as the new
one supports lossless mode and alpha while the previous does not.
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents ac2fc63a c4bfa098
......@@ -26,6 +26,7 @@ version <next>
- adelay filter
- pullup filter ported from libmpcodecs
- ffprobe -read_intervals option
- Lossless and alpha support for WebP decoder
version 2.0:
......
......@@ -488,6 +488,8 @@ following image formats are supported:
@tab YUV, JPEG and some extension is not supported yet.
@item Truevision Targa @tab X @tab X
@tab Targa (.TGA) image format
@item WebP @tab @tab X
@tab WebP image format
@item XBM @tab X @tab X
@tab X BitMap image format
@item XFace @tab X @tab X
......
......@@ -476,6 +476,7 @@ OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
OBJS-$(CONFIG_WAVPACK_ENCODER) += wavpackenc.o
OBJS-$(CONFIG_WEBP_DECODER) += vp8.o vp8dsp.o vp56rac.o
OBJS-$(CONFIG_WEBP_DECODER) += webp.o
OBJS-$(CONFIG_WEBVTT_DECODER) += webvttdec.o
OBJS-$(CONFIG_WMALOSSLESS_DECODER) += wmalosslessdec.o wma_common.o
OBJS-$(CONFIG_WMAPRO_DECODER) += wmaprodec.o wma.o wma_common.o
......
......@@ -275,6 +275,7 @@ enum AVCodecID {
AV_CODEC_ID_AIC,
AV_CODEC_ID_ESCAPE130_DEPRECATED,
AV_CODEC_ID_G2M_DEPRECATED,
AV_CODEC_ID_WEBP_DEPRECATED,
AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'),
AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
......
......@@ -1044,13 +1044,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("Google VP9"),
.props = AV_CODEC_PROP_LOSSY,
},
{
.id = AV_CODEC_ID_WEBP,
.type = AVMEDIA_TYPE_VIDEO,
.name = "webp",
.long_name = NULL_IF_CONFIG_SMALL("WebP"),
.props = AV_CODEC_PROP_LOSSY,
},
{
.id = AV_CODEC_ID_PICTOR,
.type = AVMEDIA_TYPE_VIDEO,
......@@ -1393,6 +1386,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("Go2Meeting"),
.props = AV_CODEC_PROP_LOSSY,
},
{
.id = AV_CODEC_ID_WEBP,
.type = AVMEDIA_TYPE_VIDEO,
.name = "webp",
.long_name = NULL_IF_CONFIG_SMALL("WebP"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
AV_CODEC_PROP_LOSSLESS,
},
/* various PCM "codecs" */
{
......
......@@ -2487,6 +2487,7 @@ static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
case AV_CODEC_ID_TAK_DEPRECATED : return AV_CODEC_ID_TAK;
case AV_CODEC_ID_ESCAPE130_DEPRECATED : return AV_CODEC_ID_ESCAPE130;
case AV_CODEC_ID_G2M_DEPRECATED : return AV_CODEC_ID_G2M;
case AV_CODEC_ID_WEBP_DEPRECATED: return AV_CODEC_ID_WEBP;
default : return id;
}
}
......
......@@ -29,8 +29,8 @@
#include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 55
#define LIBAVCODEC_VERSION_MINOR 31
#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_MINOR 32
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
......
......@@ -1854,8 +1854,8 @@ static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
return 0;
}
static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
VP8Context *s = avctx->priv_data;
int ret, i, referenced, num_jobs;
......@@ -2009,7 +2009,7 @@ err:
return ret;
}
static av_cold int vp8_decode_free(AVCodecContext *avctx)
av_cold int ff_vp8_decode_free(AVCodecContext *avctx)
{
VP8Context *s = avctx->priv_data;
int i;
......@@ -2032,7 +2032,7 @@ static av_cold int vp8_init_frames(VP8Context *s)
return 0;
}
static av_cold int vp8_decode_init(AVCodecContext *avctx)
av_cold int ff_vp8_decode_init(AVCodecContext *avctx)
{
VP8Context *s = avctx->priv_data;
int ret;
......@@ -2046,7 +2046,7 @@ static av_cold int vp8_decode_init(AVCodecContext *avctx)
ff_vp8dsp_init(&s->vp8dsp);
if ((ret = vp8_init_frames(s)) < 0) {
vp8_decode_free(avctx);
ff_vp8_decode_free(avctx);
return ret;
}
......@@ -2061,7 +2061,7 @@ static av_cold int vp8_decode_init_thread_copy(AVCodecContext *avctx)
s->avctx = avctx;
if ((ret = vp8_init_frames(s)) < 0) {
vp8_decode_free(avctx);
ff_vp8_decode_free(avctx);
return ret;
}
......@@ -2147,7 +2147,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
pkt.data = buf;
pkt.size = buf_size;
return vp8_decode_frame(avctx, data, data_size, &pkt);
return ff_vp8_decode_frame(avctx, data, data_size, &pkt);
}
AVCodec ff_vp8_decoder = {
......@@ -2155,9 +2155,9 @@ AVCodec ff_vp8_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VP8,
.priv_data_size = sizeof(VP8Context),
.init = vp8_decode_init,
.close = vp8_decode_free,
.decode = vp8_decode_frame,
.init = ff_vp8_decode_init,
.close = ff_vp8_decode_free,
.decode = ff_vp8_decode_frame,
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
.flush = vp8_decode_flush,
.long_name = NULL_IF_CONFIG_SMALL("On2 VP8"),
......@@ -2165,17 +2165,17 @@ AVCodec ff_vp8_decoder = {
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
};
AVCodec ff_webp_decoder = {
.name = "webp",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_WEBP,
.priv_data_size = sizeof(VP8Context),
.init = vp8_decode_init,
.close = vp8_decode_free,
.decode = webp_decode_frame,
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
.flush = vp8_decode_flush,
.long_name = NULL_IF_CONFIG_SMALL("WebP"),
.init_thread_copy = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
};
// AVCodec ff_webp_decoder = {
// .name = "webp",
// .type = AVMEDIA_TYPE_VIDEO,
// .id = AV_CODEC_ID_WEBP,
// .priv_data_size = sizeof(VP8Context),
// .init = vp8_decode_init,
// .close = vp8_decode_free,
// .decode = webp_decode_frame,
// .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
// .flush = vp8_decode_flush,
// .long_name = NULL_IF_CONFIG_SMALL("WebP"),
// .init_thread_copy = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy),
// .update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
// };
......@@ -271,4 +271,11 @@ typedef struct VP8Context {
int mb_layout;
} VP8Context;
int ff_vp8_decode_init(AVCodecContext *avctx);
int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt);
int ff_vp8_decode_free(AVCodecContext *avctx);
#endif /* AVCODEC_VP8_H */
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment