mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-19 09:02:26 +02:00
Merge commit 'c4bfa098072ba338d83555d6e2199f7e1e64ffff'
* commit 'c4bfa098072ba338d83555d6e2199f7e1e64ffff': 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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
b26ccf218d
@ -26,6 +26,7 @@ version <next>
|
|||||||
- adelay filter
|
- adelay filter
|
||||||
- pullup filter ported from libmpcodecs
|
- pullup filter ported from libmpcodecs
|
||||||
- ffprobe -read_intervals option
|
- ffprobe -read_intervals option
|
||||||
|
- Lossless and alpha support for WebP decoder
|
||||||
|
|
||||||
|
|
||||||
version 2.0:
|
version 2.0:
|
||||||
|
@ -488,6 +488,8 @@ following image formats are supported:
|
|||||||
@tab YUV, JPEG and some extension is not supported yet.
|
@tab YUV, JPEG and some extension is not supported yet.
|
||||||
@item Truevision Targa @tab X @tab X
|
@item Truevision Targa @tab X @tab X
|
||||||
@tab Targa (.TGA) image format
|
@tab Targa (.TGA) image format
|
||||||
|
@item WebP @tab @tab X
|
||||||
|
@tab WebP image format
|
||||||
@item XBM @tab X @tab X
|
@item XBM @tab X @tab X
|
||||||
@tab X BitMap image format
|
@tab X BitMap image format
|
||||||
@item XFace @tab X @tab X
|
@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_DECODER) += wavpack.o
|
||||||
OBJS-$(CONFIG_WAVPACK_ENCODER) += wavpackenc.o
|
OBJS-$(CONFIG_WAVPACK_ENCODER) += wavpackenc.o
|
||||||
OBJS-$(CONFIG_WEBP_DECODER) += vp8.o vp8dsp.o vp56rac.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_WEBVTT_DECODER) += webvttdec.o
|
||||||
OBJS-$(CONFIG_WMALOSSLESS_DECODER) += wmalosslessdec.o wma_common.o
|
OBJS-$(CONFIG_WMALOSSLESS_DECODER) += wmalosslessdec.o wma_common.o
|
||||||
OBJS-$(CONFIG_WMAPRO_DECODER) += wmaprodec.o wma.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_AIC,
|
||||||
AV_CODEC_ID_ESCAPE130_DEPRECATED,
|
AV_CODEC_ID_ESCAPE130_DEPRECATED,
|
||||||
AV_CODEC_ID_G2M_DEPRECATED,
|
AV_CODEC_ID_G2M_DEPRECATED,
|
||||||
|
AV_CODEC_ID_WEBP_DEPRECATED,
|
||||||
|
|
||||||
AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'),
|
AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'),
|
||||||
AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
|
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"),
|
.long_name = NULL_IF_CONFIG_SMALL("Google VP9"),
|
||||||
.props = AV_CODEC_PROP_LOSSY,
|
.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,
|
.id = AV_CODEC_ID_PICTOR,
|
||||||
.type = AVMEDIA_TYPE_VIDEO,
|
.type = AVMEDIA_TYPE_VIDEO,
|
||||||
@ -1393,6 +1386,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
|
|||||||
.long_name = NULL_IF_CONFIG_SMALL("Go2Meeting"),
|
.long_name = NULL_IF_CONFIG_SMALL("Go2Meeting"),
|
||||||
.props = AV_CODEC_PROP_LOSSY,
|
.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" */
|
/* 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_TAK_DEPRECATED : return AV_CODEC_ID_TAK;
|
||||||
case AV_CODEC_ID_ESCAPE130_DEPRECATED : return AV_CODEC_ID_ESCAPE130;
|
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_G2M_DEPRECATED : return AV_CODEC_ID_G2M;
|
||||||
|
case AV_CODEC_ID_WEBP_DEPRECATED: return AV_CODEC_ID_WEBP;
|
||||||
default : return id;
|
default : return id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
#include "libavutil/avutil.h"
|
#include "libavutil/avutil.h"
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 55
|
#define LIBAVCODEC_VERSION_MAJOR 55
|
||||||
#define LIBAVCODEC_VERSION_MINOR 31
|
#define LIBAVCODEC_VERSION_MINOR 32
|
||||||
#define LIBAVCODEC_VERSION_MICRO 101
|
#define LIBAVCODEC_VERSION_MICRO 100
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
LIBAVCODEC_VERSION_MINOR, \
|
LIBAVCODEC_VERSION_MINOR, \
|
||||||
|
@ -1854,7 +1854,7 @@ static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||||
AVPacket *avpkt)
|
AVPacket *avpkt)
|
||||||
{
|
{
|
||||||
VP8Context *s = avctx->priv_data;
|
VP8Context *s = avctx->priv_data;
|
||||||
@ -2009,7 +2009,7 @@ err:
|
|||||||
return ret;
|
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;
|
VP8Context *s = avctx->priv_data;
|
||||||
int i;
|
int i;
|
||||||
@ -2032,7 +2032,7 @@ static av_cold int vp8_init_frames(VP8Context *s)
|
|||||||
return 0;
|
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;
|
VP8Context *s = avctx->priv_data;
|
||||||
int ret;
|
int ret;
|
||||||
@ -2046,7 +2046,7 @@ static av_cold int vp8_decode_init(AVCodecContext *avctx)
|
|||||||
ff_vp8dsp_init(&s->vp8dsp);
|
ff_vp8dsp_init(&s->vp8dsp);
|
||||||
|
|
||||||
if ((ret = vp8_init_frames(s)) < 0) {
|
if ((ret = vp8_init_frames(s)) < 0) {
|
||||||
vp8_decode_free(avctx);
|
ff_vp8_decode_free(avctx);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2061,7 +2061,7 @@ static av_cold int vp8_decode_init_thread_copy(AVCodecContext *avctx)
|
|||||||
s->avctx = avctx;
|
s->avctx = avctx;
|
||||||
|
|
||||||
if ((ret = vp8_init_frames(s)) < 0) {
|
if ((ret = vp8_init_frames(s)) < 0) {
|
||||||
vp8_decode_free(avctx);
|
ff_vp8_decode_free(avctx);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2147,7 +2147,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
|||||||
pkt.data = buf;
|
pkt.data = buf;
|
||||||
pkt.size = buf_size;
|
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 = {
|
AVCodec ff_vp8_decoder = {
|
||||||
@ -2155,9 +2155,9 @@ AVCodec ff_vp8_decoder = {
|
|||||||
.type = AVMEDIA_TYPE_VIDEO,
|
.type = AVMEDIA_TYPE_VIDEO,
|
||||||
.id = AV_CODEC_ID_VP8,
|
.id = AV_CODEC_ID_VP8,
|
||||||
.priv_data_size = sizeof(VP8Context),
|
.priv_data_size = sizeof(VP8Context),
|
||||||
.init = vp8_decode_init,
|
.init = ff_vp8_decode_init,
|
||||||
.close = vp8_decode_free,
|
.close = ff_vp8_decode_free,
|
||||||
.decode = vp8_decode_frame,
|
.decode = ff_vp8_decode_frame,
|
||||||
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
|
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
|
||||||
.flush = vp8_decode_flush,
|
.flush = vp8_decode_flush,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("On2 VP8"),
|
.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),
|
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
|
||||||
};
|
};
|
||||||
|
|
||||||
AVCodec ff_webp_decoder = {
|
// AVCodec ff_webp_decoder = {
|
||||||
.name = "webp",
|
// .name = "webp",
|
||||||
.type = AVMEDIA_TYPE_VIDEO,
|
// .type = AVMEDIA_TYPE_VIDEO,
|
||||||
.id = AV_CODEC_ID_WEBP,
|
// .id = AV_CODEC_ID_WEBP,
|
||||||
.priv_data_size = sizeof(VP8Context),
|
// .priv_data_size = sizeof(VP8Context),
|
||||||
.init = vp8_decode_init,
|
// .init = vp8_decode_init,
|
||||||
.close = vp8_decode_free,
|
// .close = vp8_decode_free,
|
||||||
.decode = webp_decode_frame,
|
// .decode = webp_decode_frame,
|
||||||
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
|
// .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
|
||||||
.flush = vp8_decode_flush,
|
// .flush = vp8_decode_flush,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("WebP"),
|
// .long_name = NULL_IF_CONFIG_SMALL("WebP"),
|
||||||
.init_thread_copy = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy),
|
// .init_thread_copy = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy),
|
||||||
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
|
// .update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
|
||||||
};
|
// };
|
||||||
|
@ -271,4 +271,11 @@ typedef struct VP8Context {
|
|||||||
int mb_layout;
|
int mb_layout;
|
||||||
} VP8Context;
|
} 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 */
|
#endif /* AVCODEC_VP8_H */
|
||||||
|
1455
libavcodec/webp.c
Normal file
1455
libavcodec/webp.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user