Commit 6fe5f770 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'be7c3231'

* commit 'be7c3231':
  Add a libwebp encoder

Conflicts:
	Changelog
	doc/encoders.texi
	doc/general.texi
	libavcodec/version.h
	libavformat/img2enc.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 9b195dd5 be7c3231
...@@ -14,6 +14,7 @@ version <next> ...@@ -14,6 +14,7 @@ version <next>
- Windows resource files for shared libraries - Windows resource files for shared libraries
- aeval filter - aeval filter
- stereoscopic 3d metadata handling - stereoscopic 3d metadata handling
- WebP encoding via libwebp
version 2.1: version 2.1:
......
...@@ -241,6 +241,7 @@ External library support: ...@@ -241,6 +241,7 @@ External library support:
native implementation exists [no] native implementation exists [no]
--enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no] --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
--enable-libwavpack enable wavpack encoding via libwavpack [no] --enable-libwavpack enable wavpack encoding via libwavpack [no]
--enable-libwebp enable WebP encoding via libwebp [no]
--enable-libx264 enable H.264 encoding via x264 [no] --enable-libx264 enable H.264 encoding via x264 [no]
--enable-libxavs enable AVS encoding via xavs [no] --enable-libxavs enable AVS encoding via xavs [no]
--enable-libxvid enable Xvid encoding via xvidcore, --enable-libxvid enable Xvid encoding via xvidcore,
...@@ -1290,6 +1291,7 @@ EXTERNAL_LIBRARY_LIST=" ...@@ -1290,6 +1291,7 @@ EXTERNAL_LIBRARY_LIST="
libvorbis libvorbis
libvpx libvpx
libwavpack libwavpack
libwebp
libx264 libx264
libxavs libxavs
libxvid libxvid
...@@ -2145,6 +2147,7 @@ libvpx_vp8_encoder_deps="libvpx" ...@@ -2145,6 +2147,7 @@ libvpx_vp8_encoder_deps="libvpx"
libvpx_vp9_decoder_deps="libvpx" libvpx_vp9_decoder_deps="libvpx"
libvpx_vp9_encoder_deps="libvpx" libvpx_vp9_encoder_deps="libvpx"
libwavpack_encoder_deps="libwavpack" libwavpack_encoder_deps="libwavpack"
libwebp_encoder_deps="libwebp"
libx264_encoder_deps="libx264" libx264_encoder_deps="libx264"
libx264rgb_encoder_deps="libx264" libx264rgb_encoder_deps="libx264"
libxavs_encoder_deps="libxavs" libxavs_encoder_deps="libxavs"
...@@ -4437,6 +4440,7 @@ enabled libvpx && { ...@@ -4437,6 +4440,7 @@ enabled libvpx && {
enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; } enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_SVC" -lvpx || disable libvpx_vp9_encoder; } } enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_SVC" -lvpx || disable libvpx_vp9_encoder; } }
enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
enabled libwebp && require_pkg_config libwebp webp/encode.h WebPGetEncoderVersion
enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 && enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
{ check_cpp_condition x264.h "X264_BUILD >= 118" || { check_cpp_condition x264.h "X264_BUILD >= 118" ||
die "ERROR: libx264 must be installed and version must be >= 0.118."; } die "ERROR: libx264 must be installed and version must be >= 0.118."; }
......
...@@ -1365,6 +1365,68 @@ g_error_resilient ...@@ -1365,6 +1365,68 @@ g_error_resilient
For more information about libvpx see: For more information about libvpx see:
@url{http://www.webmproject.org/} @url{http://www.webmproject.org/}
@section libwebp
libwebp WebP Image encoder wrapper
libwebp is Google's official encoder for WebP images. It can encode in either
lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
frame. Lossless images are a separate codec developed by Google.
@subsection Pixel Format
Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
to limitations of the format and libwebp. Alpha is supported for either mode.
Because of API limitations, if RGB is passed in when encoding lossy or YUV is
passed in for encoding lossless, the pixel format will automatically be
converted using functions from libwebp. This is not ideal and is done only for
convenience.
@subsection Options
@table @option
@item -lossless @var{boolean}
Enables/Disables use of lossless mode. Default is 0.
@item -compression_level @var{integer}
For lossy, this is a quality/speed tradeoff. Higher values give better quality
for a given size at the cost of increased encoding time. For lossless, this is
a size/speed tradeoff. Higher values give smaller size at the cost of increased
encoding time. More specifically, it controls the number of extra algorithms
and compression tools used, and varies the combination of these tools. This
maps to the @var{method} option in libwebp. The valid range is 0 to 6.
Default is 4.
@item -qscale @var{float}
For lossy encoding, this controls image quality, 0 to 100. For lossless
encoding, this controls the effort and time spent at compressing more. The
default value is 75. Note that for usage via libavcodec, this option is called
@var{global_quality} and must be multiplied by @var{FF_QP2LAMBDA}.
@item -preset @var{type}
Configuration preset. This does some automatic settings based on the general
type of the image.
@table @option
@item none
Do not use a preset.
@item default
Use the encoder default.
@item picture
Digital picture, like portrait, inner shot
@item photo
Outdoor photograph, with natural lighting
@item drawing
Hand or line drawing, with high-contrast details
@item icon
Small-sized colorful images
@item text
Text-like
@end table
@end table
@section libx264 @section libx264
x264 H.264/MPEG-4 AVC encoder wrapper. x264 H.264/MPEG-4 AVC encoder wrapper.
......
...@@ -491,8 +491,8 @@ following image formats are supported: ...@@ -491,8 +491,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 @item WebP @tab E @tab X
@tab WebP image format @tab WebP image format, encoding supported through external library libwebp
@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
......
...@@ -734,6 +734,7 @@ OBJS-$(CONFIG_LIBVPX_VP8_ENCODER) += libvpxenc.o ...@@ -734,6 +734,7 @@ OBJS-$(CONFIG_LIBVPX_VP8_ENCODER) += libvpxenc.o
OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o libvpx.o OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o libvpx.o
OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o libvpx.o OBJS-$(CONFIG_LIBVPX_VP9_ENCODER) += libvpxenc.o libvpx.o
OBJS-$(CONFIG_LIBWAVPACK_ENCODER) += libwavpackenc.o OBJS-$(CONFIG_LIBWAVPACK_ENCODER) += libwavpackenc.o
OBJS-$(CONFIG_LIBWEBP_ENCODER) += libwebpenc.o
OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o
OBJS-$(CONFIG_LIBXAVS_ENCODER) += libxavs.o OBJS-$(CONFIG_LIBXAVS_ENCODER) += libxavs.o
OBJS-$(CONFIG_LIBXVID_ENCODER) += libxvid.o OBJS-$(CONFIG_LIBXVID_ENCODER) += libxvid.o
......
...@@ -509,6 +509,7 @@ void avcodec_register_all(void) ...@@ -509,6 +509,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (LIBVPX_VP8, libvpx_vp8); REGISTER_ENCDEC (LIBVPX_VP8, libvpx_vp8);
REGISTER_ENCDEC (LIBVPX_VP9, libvpx_vp9); REGISTER_ENCDEC (LIBVPX_VP9, libvpx_vp9);
REGISTER_ENCODER(LIBWAVPACK, libwavpack); REGISTER_ENCODER(LIBWAVPACK, libwavpack);
REGISTER_ENCODER(LIBWEBP, libwebp);
REGISTER_ENCODER(LIBX264, libx264); REGISTER_ENCODER(LIBX264, libx264);
REGISTER_ENCODER(LIBX264RGB, libx264rgb); REGISTER_ENCODER(LIBX264RGB, libx264rgb);
REGISTER_ENCODER(LIBXAVS, libxavs); REGISTER_ENCODER(LIBXAVS, libxavs);
......
This diff is collapsed.
...@@ -29,8 +29,8 @@ ...@@ -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 45 #define LIBAVCODEC_VERSION_MINOR 46
#define LIBAVCODEC_VERSION_MICRO 103 #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, \
......
...@@ -194,7 +194,7 @@ AVOutputFormat ff_image2_muxer = { ...@@ -194,7 +194,7 @@ AVOutputFormat ff_image2_muxer = {
.long_name = NULL_IF_CONFIG_SMALL("image2 sequence"), .long_name = NULL_IF_CONFIG_SMALL("image2 sequence"),
.extensions = "bmp,dpx,jls,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png," .extensions = "bmp,dpx,jls,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png,"
"ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,im24," "ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,im24,"
"sunras,xbm,xface", "sunras,webp,xbm,xface",
.priv_data_size = sizeof(VideoMuxData), .priv_data_size = sizeof(VideoMuxData),
.video_codec = AV_CODEC_ID_MJPEG, .video_codec = AV_CODEC_ID_MJPEG,
.write_header = write_header, .write_header = write_header,
......
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