Re: [libav-devel] [PATCH 1/3] xbm: remove unused code
On Sat, 15 Mar 2014 03:44:15 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: From: Paul B Mahol one...@gmail.com --- libavcodec/xbmenc.c | 19 --- 1 file changed, 19 deletions(-) diff --git a/libavcodec/xbmenc.c b/libavcodec/xbmenc.c index d6657dc..3650144 100644 --- a/libavcodec/xbmenc.c +++ b/libavcodec/xbmenc.c @@ -24,16 +24,6 @@ #include internal.h #include mathops.h -static av_cold int xbm_encode_init(AVCodecContext *avctx) -{ -avctx-coded_frame = av_frame_alloc(); -if (!avctx-coded_frame) -return AVERROR(ENOMEM); -avctx-coded_frame-pict_type = AV_PICTURE_TYPE_I; - -return 0; -} - static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet) { @@ -67,21 +57,12 @@ static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -static av_cold int xbm_encode_close(AVCodecContext *avctx) -{ -av_freep(avctx-coded_frame); - -return 0; -} - AVCodec ff_xbm_encoder = { .name = xbm, .long_name= NULL_IF_CONFIG_SMALL(XBM (X BitMap) image), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_XBM, -.init = xbm_encode_init, .encode2 = xbm_encode_frame, -.close= xbm_encode_close, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, }; -- 1.8.3.4 (Apple Git-47) unused? This sure does not look unused. Though that av_freep() should be replaced with av_frame_free() -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/3] X-Bitmap decoder
On Sat, 15 Mar 2014 03:44:17 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: From: Paul B Mahol one...@gmail.com --- I don't think having a test for this format is necessary... We should have tests for all formats, especially obscure ones. Otherwise there is a high risk of them getting accidentally broken during maintenance, and nobody noticing for years. No version bump anywhere, right? Minor bump in lavc. Vittorio Changelog | 1 + doc/general.texi | 2 +- libavcodec/Makefile| 1 + libavcodec/allcodecs.c | 2 +- libavcodec/xbmdec.c| 120 + 5 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 libavcodec/xbmdec.c diff --git a/Changelog b/Changelog index 279c0d8..31ad315 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,7 @@ releases are sorted from youngest to oldest. version next: - compand audio filter - shuffleplanes filter +- XBM decoder version 10: diff --git a/doc/general.texi b/doc/general.texi index 8c0cb1b..88588d0 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -465,7 +465,7 @@ following image formats are supported: @tab Targa (.TGA) image format @item WebP @tab E @tab X @tab WebP image format, encoding supported through external library libwebp -@item XBM @tab X @tab +@item XBM @tab X @tab X @tab X BitMap image format @item XWD @tab X @tab X @tab X Window Dump image format diff --git a/libavcodec/Makefile b/libavcodec/Makefile index bd93a6f..2bfee54 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -402,6 +402,7 @@ OBJS-$(CONFIG_WS_SND1_DECODER) += ws-snd1.o OBJS-$(CONFIG_XAN_DPCM_DECODER)+= dpcm.o OBJS-$(CONFIG_XAN_WC3_DECODER) += xan.o OBJS-$(CONFIG_XAN_WC4_DECODER) += xxan.o +OBJS-$(CONFIG_XBM_DECODER) += xbmdec.o OBJS-$(CONFIG_XBM_ENCODER) += xbmenc.o OBJS-$(CONFIG_XL_DECODER) += xl.o OBJS-$(CONFIG_XSUB_DECODER)+= xsubdec.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index ed6d7ff..021dbae 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -268,7 +268,7 @@ void avcodec_register_all(void) REGISTER_DECODER(WNV1, wnv1); REGISTER_DECODER(XAN_WC3, xan_wc3); REGISTER_DECODER(XAN_WC4, xan_wc4); -REGISTER_ENCODER(XBM, xbm); +REGISTER_ENCDEC (XBM, xbm); REGISTER_DECODER(XL,xl); REGISTER_ENCDEC (XWD, xwd); REGISTER_DECODER(YOP, yop); diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c new file mode 100644 index 000..25be8a0 --- /dev/null +++ b/libavcodec/xbmdec.c @@ -0,0 +1,120 @@ +/* + * XBM image format + * + * Copyright (c) 2012 Paul B Mahol + * + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include libavutil/avstring.h + +#include avcodec.h +#include internal.h +#include mathops.h + +static av_cold int xbm_decode_init(AVCodecContext *avctx) +{ +avctx-pix_fmt = AV_PIX_FMT_MONOWHITE; + +return 0; +} + +static int convert(uint8_t x) +{ +if (x = 'a') +x -= 87; +else if (x = 'A') +x -= 55; +else +x -= '0'; +return x; +} + +static int xbm_decode_frame(AVCodecContext *avctx, void *data, +int *got_frame, AVPacket *avpkt) +{ +AVFrame *p = data; +const uint8_t *end, *ptr = avpkt-data; +uint8_t *dst; +int ret, linesize, i, j; + +end = avpkt-data + avpkt-size; +while (!avctx-width || !avctx-height) { +char name[256]; +int number, len; + +ptr += strcspn(ptr, #); +if (sscanf(ptr, #define %255s %u, name, number) != 2) { +av_log(avctx, AV_LOG_ERROR, Unexpected preprocessor directive\n); +return AVERROR_INVALIDDATA; +} + +len = strlen(name); +if ((len 6) !avctx-height !memcmp(name + len - 7, _height, 7)) { +avctx-height = number; +} else if ((len 5) !avctx-width !memcmp(name + len - 6, _width, 6)) {
Re: [libav-devel] [PATCH 2/8] png: Support rgb48 and rgba64 encoding
On Sat, 15 Mar 2014 03:16:27 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: From: Carl Eugen Hoyos ceho...@ag.or.at --- libavcodec/pngenc.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index ccc5f7d..a6015ff 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -245,6 +245,14 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, is_progressive = !!(avctx-flags CODEC_FLAG_INTERLACED_DCT); switch (avctx-pix_fmt) { +case AV_PIX_FMT_RGBA64BE: +bit_depth = 16; +color_type = PNG_COLOR_TYPE_RGB_ALPHA; +break; +case AV_PIX_FMT_RGB48BE: +bit_depth = 16; +color_type = PNG_COLOR_TYPE_RGB; +break; case AV_PIX_FMT_RGB32: bit_depth = 8; color_type = PNG_COLOR_TYPE_RGB_ALPHA; @@ -482,7 +490,7 @@ AVCodec ff_png_encoder = { .encode2= encode_frame, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8, -AV_PIX_FMT_GRAY16BE, +AV_PIX_FMT_RGBA64BE, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE }, }; -- 1.8.3.4 (Apple Git-47) Looks trivial enough to be ok. -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/8] raw: nut: Support rgba64 encoding
On Sat, 15 Mar 2014 03:16:28 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: From: Carl Eugen Hoyos ceho...@ag.or.at Subject: raw: nut: Support rgba64 encoding make it 'raw,nut:', otherwise it looks like it applies to the nut part of the raw decoder Patch itself looks fine -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 5/8] libopenjpeg: Support rgba64 encoding
On Sat, 15 Mar 2014 03:16:30 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: From: Carl Eugen Hoyos ceho...@ag.or.at --- libavcodec/libopenjpegenc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index e78a669..e98d550 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -96,6 +96,7 @@ static opj_image_t *libopenjpeg_create_image(AVCodecContext *avctx, case AV_PIX_FMT_RGB24: case AV_PIX_FMT_RGBA: case AV_PIX_FMT_RGB48: +case AV_PIX_FMT_RGBA64: color_space = CLRSPC_SRGB; break; case AV_PIX_FMT_YUV410P: @@ -305,6 +306,7 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, libopenjpeg_copy_packed8(avctx, frame, image); break; case AV_PIX_FMT_RGB48: +case AV_PIX_FMT_RGBA64: libopenjpeg_copy_packed16(avctx, frame, image); break; case AV_PIX_FMT_GRAY8: @@ -421,6 +423,7 @@ AVCodec ff_libopenjpeg_encoder = { .capabilities = 0, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48, +AV_PIX_FMT_RGBA64, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_Y400A, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P, -- 1.8.3.4 (Apple Git-47) LGTM -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 6/8] libopenjpeg: Support decoding RGBA64
On Sat, 15 Mar 2014 03:16:31 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: --- libavcodec/libopenjpegdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 0643e11..63a2030 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -43,7 +43,7 @@ // pix_fmts with lower bpp have to be listed before // similar pix_fmts with higher bpp. #define RGB_PIXEL_FORMATS AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, \ - AV_PIX_FMT_RGB48 + AV_PIX_FMT_RGB48, AV_PIX_FMT_RGBA64 #define GRAY_PIXEL_FORMATS AV_PIX_FMT_GRAY8, AV_PIX_FMT_Y400A, \ AV_PIX_FMT_GRAY16 -- 1.8.3.4 (Apple Git-47) Looks fine -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 7/8] img2: add j2c file extension
On Sat, 15 Mar 2014 03:16:32 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: From: Jean First jeanfi...@gmail.com Some applications use the j2c extension for jpeg2000 codestream files. --- libavformat/img2.c| 1 + libavformat/img2enc.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/img2.c b/libavformat/img2.c index 493df6d..ed59281 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -63,6 +63,7 @@ static const IdStrMap img_tags[] = { { AV_CODEC_ID_SUNRAST,im8 }, { AV_CODEC_ID_SUNRAST,im24 }, { AV_CODEC_ID_SUNRAST,sunras }, +{ AV_CODEC_ID_JPEG2000, j2c }, { AV_CODEC_ID_JPEG2000, jp2 }, { AV_CODEC_ID_JPEG2000, jpc }, { AV_CODEC_ID_JPEG2000, j2k }, diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c index 4cc5c3f..f4a80aa 100644 --- a/libavformat/img2enc.c +++ b/libavformat/img2enc.c @@ -148,7 +148,7 @@ AVOutputFormat ff_image2_muxer = { .long_name = NULL_IF_CONFIG_SMALL(image2 sequence), .extensions = bmp,dpx,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png, ppm,sgi,tga,tif,tiff,jp2,xwd,sun,ras,rs,im1,im8,im24, - sunras,webp,xbm, + sunras,webp,xbm,j2c, .priv_data_size = sizeof(VideoMuxData), .video_codec= AV_CODEC_ID_MJPEG, .write_header = write_header, -- 1.8.3.4 (Apple Git-47) Ok -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] codec_desc: update dvaudio tag
On Fri, 14 Mar 2014 19:02:58 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: --- libavcodec/codec_desc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 433590e..2ad5326 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1796,7 +1796,7 @@ static const AVCodecDescriptor codec_descriptors[] = { .id= AV_CODEC_ID_DVAUDIO, .type = AVMEDIA_TYPE_AUDIO, .name = dvaudio, -.long_name = NULL_IF_CONFIG_SMALL(DVAUDIO), +.long_name = NULL_IF_CONFIG_SMALL(DV audio), .props = AV_CODEC_PROP_LOSSY, }, { -- 1.8.3.4 (Apple Git-47) Ok -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/5] avformat: Use the mime type information in input probe
On Thu, 13 Mar 2014 22:35:41 +0100, Luca Barbato lu_z...@gentoo.org wrote: It should provide a quicker guess for elementary streams provided by http. --- libavformat/avformat.h | 7 +++ libavformat/format.c | 29 +++-- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index ec9c262..d532ad6 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -389,6 +389,7 @@ typedef struct AVProbeData { const char *filename; unsigned char *buf; /** Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */ int buf_size; /** Size of buf except extra allocated bytes */ +uint8_t *mime_type; /** mime_type, when known. */ This breaks ABI } AVProbeData; #define AVPROBE_SCORE_EXTENSION 50 /// score for file extension @@ -620,6 +621,12 @@ typedef struct AVInputFormat { * Active streams are all streams that have AVStream.discard AVDISCARD_ALL. */ int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); + +/** + * Used to raise the score while probing for unknown format This documentation is very vague, please be more precise. + * @see av_probe_input_format2 + */ +const char *mime_type; Is it supposed to be public? Then it should be higher up. Also, shouldn't this better be a list of strings? } AVInputFormat; /** * @} diff --git a/libavformat/format.c b/libavformat/format.c index 95c06ff..8bc0f8e 100644 --- a/libavformat/format.c +++ b/libavformat/format.c @@ -20,6 +20,7 @@ */ #include libavutil/avstring.h +#include libavutil/opt.h #include avio_internal.h #include avformat.h @@ -212,6 +213,9 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, if (av_match_ext(lpd.filename, fmt1-extensions)) score = AVPROBE_SCORE_EXTENSION; } +if (match_name(lpd.mime_type, fmt1-mime_type)) +score = FFMAX(score, AVPROBE_SCORE_EXTENSION); + if (score *score_max) { *score_max = score; fmt= fmt1; @@ -270,6 +274,9 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, avio_skip(pb, offset); max_probe_size -= offset; +if (pb-av_class) +av_opt_get(pb, mime_type, AV_OPT_SEARCH_CHILDREN, pd.mime_type); + for (probe_size = PROBE_BUF_MIN; probe_size = max_probe_size !*fmt; probe_size = FFMIN(probe_size 1, FFMAX(max_probe_size, probe_size + 1))) { @@ -277,14 +284,13 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, /* Read probe data. */ if ((ret = av_reallocp(buf, probe_size + AVPROBE_PADDING_SIZE)) 0) -return ret; +goto fail; if ((ret = avio_read(pb, buf + pd.buf_size, probe_size - pd.buf_size)) 0) { /* Fail if error was not end of file, otherwise, lower score. */ -if (ret != AVERROR_EOF) { -av_free(buf); -return ret; -} +if (ret != AVERROR_EOF) +goto fail; + score = 0; ret = 0; /* error was end of file, nothing read */ } @@ -307,14 +313,17 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, } } -if (!*fmt) { -av_free(buf); -return AVERROR_INVALIDDATA; -} +if (!*fmt) +ret = AVERROR_INVALIDDATA; /* Rewind. Reuse probe buffer to avoid seeking. */ -if ((ret = ffio_rewind_with_probe_data(pb, buf, pd.buf_size)) 0) +if (ret 0 || +(ret = ffio_rewind_with_probe_data(pb, buf, pd.buf_size)) 0) { +fail: This jumping inside of a block looks evil and likely to break in the future. -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] Use mime types when probing formats
On Fri, 14 Mar 2014 16:07:21 +0100, Luca Barbato lu_z...@gentoo.org wrote: On 13/03/14 22:35, Luca Barbato wrote: This should eventually solve the problem Giovanni reported. ping (this should land in release/10) No it should not. It's an API change (and an incompatible ABI change too) -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 1/2] X-Face image decoder and encoder
On Thu, 13 Mar 2014 23:49:37 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: From: Stefano Sabatini stefa...@gmail.com Based on libcompface code by James Ashton james.ash...@anu.edu.au. Relicensed to LGPL with the author's consent. Signed-off-by: Vittorio Giovara vittorio.giov...@gmail.com --- Changelog | 1 + doc/general.texi| 2 + libavcodec/Makefile | 2 + libavcodec/allcodecs.c | 1 + libavcodec/avcodec.h| 1 + libavcodec/codec_desc.c | 7 + libavcodec/version.h| 4 +- libavcodec/xface.c | 410 libavcodec/xface.h | 106 + libavcodec/xfacedec.c | 195 +++ libavcodec/xfaceenc.c | 244 libavformat/img2.c | 1 + libavformat/img2enc.c | 2 +- 13 files changed, 973 insertions(+), 3 deletions(-) create mode 100644 libavcodec/xface.c create mode 100644 libavcodec/xface.h create mode 100644 libavcodec/xfacedec.c create mode 100644 libavcodec/xfaceenc.c diff --git a/Changelog b/Changelog index 279c0d8..b68d22f 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,7 @@ releases are sorted from youngest to oldest. version next: - compand audio filter - shuffleplanes filter +- X-Face image encoder and decoder version 10: diff --git a/doc/general.texi b/doc/general.texi index 8c0cb1b..79510e1 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -467,6 +467,8 @@ following image formats are supported: @tab WebP image format, encoding supported through external library libwebp @item XBM @tab X @tab @tab X BitMap image format +@item XFace @tab X @tab X +@tab X-Face image format @item XWD @tab X @tab X @tab X Window Dump image format @end multitable diff --git a/libavcodec/Makefile b/libavcodec/Makefile index bd93a6f..e412de9 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -403,6 +403,8 @@ OBJS-$(CONFIG_XAN_DPCM_DECODER)+= dpcm.o OBJS-$(CONFIG_XAN_WC3_DECODER) += xan.o OBJS-$(CONFIG_XAN_WC4_DECODER) += xxan.o OBJS-$(CONFIG_XBM_ENCODER) += xbmenc.o +OBJS-$(CONFIG_XFACE_DECODER) += xfacedec.o xface.o +OBJS-$(CONFIG_XFACE_ENCODER) += xfaceenc.o xface.o OBJS-$(CONFIG_XL_DECODER) += xl.o OBJS-$(CONFIG_XSUB_DECODER)+= xsubdec.o OBJS-$(CONFIG_XSUB_ENCODER)+= xsubenc.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index ed6d7ff..13f83c4 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -269,6 +269,7 @@ void avcodec_register_all(void) REGISTER_DECODER(XAN_WC3, xan_wc3); REGISTER_DECODER(XAN_WC4, xan_wc4); REGISTER_ENCODER(XBM, xbm); +REGISTER_ENCDEC (XFACE, xface); REGISTER_DECODER(XL,xl); REGISTER_ENCDEC (XWD, xwd); REGISTER_DECODER(YOP, yop); diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 7beb277..20e270a 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -284,6 +284,7 @@ enum AVCodecID { AV_CODEC_ID_HNM4_VIDEO, AV_CODEC_ID_HEVC, AV_CODEC_ID_FIC, +AV_CODEC_ID_XFACE, /* various PCM codecs */ AV_CODEC_ID_FIRST_AUDIO = 0x1, /// A dummy id pointing at the start of audio codecs diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 1270323..5b68512 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1259,6 +1259,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL(Mirillis FIC), .props = AV_CODEC_PROP_LOSSY, }, +{ +.id= AV_CODEC_ID_XFACE, +.type = AVMEDIA_TYPE_VIDEO, +.name = xface, +.long_name = NULL_IF_CONFIG_SMALL(X-Face image), +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, +}, /* various PCM codecs */ { diff --git a/libavcodec/version.h b/libavcodec/version.h index 5ab49d5..d2f80ad 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,8 +29,8 @@ #include libavutil/version.h #define LIBAVCODEC_VERSION_MAJOR 55 -#define LIBAVCODEC_VERSION_MINOR 34 -#define LIBAVCODEC_VERSION_MICRO 1 +#define LIBAVCODEC_VERSION_MINOR 35 +#define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/libavcodec/xface.c b/libavcodec/xface.c new file mode 100644 index 000..9038f5f --- /dev/null +++ b/libavcodec/xface.c @@ -0,0 +1,410 @@ +/* + * Copyright (c) 1990 James Ashton - Sydney University + * Copyright (c) 2012 Stefano Sabatini + * + * This file is part of Libav. + * + * Libav is free
Re: [libav-devel] [PATCH 1/8] png: KR formatting cosmetics
On 15/03/14 03:16, Vittorio Giovara wrote: --- libavcodec/png.c| 6 +- libavcodec/pngdec.c | 221 +++- libavcodec/pngdsp.c | 9 ++- libavcodec/pngenc.c | 158 +++-- 4 files changed, 209 insertions(+), 185 deletions(-) Ok. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 2/8] png: Support rgb48 and rgba64 encoding
On 15/03/14 03:16, Vittorio Giovara wrote: From: Carl Eugen Hoyos ceho...@ag.or.at --- libavcodec/pngenc.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) Looks fine? ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/8] raw: nut: Support rgba64 encoding
On 15/03/14 03:16, Vittorio Giovara wrote: From: Carl Eugen Hoyos ceho...@ag.or.at --- libavcodec/raw.c | 4 libavformat/nut.c | 4 2 files changed, 8 insertions(+) Seems fine. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 5/8] libopenjpeg: Support rgba64 encoding
On 15/03/14 03:16, Vittorio Giovara wrote: From: Carl Eugen Hoyos ceho...@ag.or.at --- libavcodec/libopenjpegenc.c | 3 +++ 1 file changed, 3 insertions(+) Ok, I think. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 7/8] img2: add j2c file extension
On 15/03/14 03:16, Vittorio Giovara wrote: From: Jean First jeanfi...@gmail.com Some applications use the j2c extension for jpeg2000 codestream files. --- libavformat/img2.c| 1 + libavformat/img2enc.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) Probably ok. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 061/132] dsputil: Propagate bit depth information to all (sub)init functions
On Fri, 14 Mar 2014 05:42:16 -0700, Diego Biurrun di...@biurrun.de wrote: This avoids recalculating the value over and over again. --- libavcodec/arm/dsputil_arm.h | 9 ++--- libavcodec/arm/dsputil_init_arm.c | 11 ++- libavcodec/arm/dsputil_init_armv5te.c | 5 +++-- libavcodec/arm/dsputil_init_armv6.c | 20 +-- libavcodec/arm/dsputil_init_neon.c| 7 +++ libavcodec/bfin/dsputil_init.c| 12 +--- libavcodec/dsputil.c | 10 ++ libavcodec/dsputil.h | 12 libavcodec/ppc/dsputil_altivec.c | 5 ++--- libavcodec/ppc/dsputil_altivec.h | 3 ++- libavcodec/ppc/dsputil_ppc.c | 19 -- libavcodec/x86/dsputil_init.c | 37 ++- libavcodec/x86/dsputil_x86.h | 3 ++- libavcodec/x86/dsputilenc_mmx.c | 15 +++--- 14 files changed, 83 insertions(+), 85 deletions(-) Looks ok -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 064/132] dsputil: Use correct type in me_cmp_func function pointer
On Fri, 14 Mar 2014 05:42:19 -0700, Diego Biurrun di...@biurrun.de wrote: --- libavcodec/arm/dsputil_init_armv6.c | 11 +++--- libavcodec/bfin/dsputil_init.c | 23 +++-- libavcodec/dsputil.c| 67 + libavcodec/dsputil.h| 3 +- libavcodec/motion_est.c | 4 ++- libavcodec/ppc/dsputil_altivec.c| 21 ++-- libavcodec/x86/dsputilenc.asm | 7 ++-- libavcodec/x86/dsputilenc_mmx.c | 30 - libavcodec/x86/motion_est.c | 20 ++- 9 files changed, 95 insertions(+), 91 deletions(-) That parameter seems unused in the vast majority of cases, I wonder why is it even passed. -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/5] avformat: Use the mime type information in input probe
On 15/03/14 08:51, Anton Khirnov wrote: On Thu, 13 Mar 2014 22:35:41 +0100, Luca Barbato lu_z...@gentoo.org wrote: It should provide a quicker guess for elementary streams provided by http. --- libavformat/avformat.h | 7 +++ libavformat/format.c | 29 +++-- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index ec9c262..d532ad6 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -389,6 +389,7 @@ typedef struct AVProbeData { const char *filename; unsigned char *buf; /** Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */ int buf_size; /** Size of buf except extra allocated bytes */ +uint8_t *mime_type; /** mime_type, when known. */ This breaks ABI You are right =_=. } AVProbeData; #define AVPROBE_SCORE_EXTENSION 50 /// score for file extension @@ -620,6 +621,12 @@ typedef struct AVInputFormat { * Active streams are all streams that have AVStream.discard AVDISCARD_ALL. */ int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); + +/** + * Used to raise the score while probing for unknown format This documentation is very vague, please be more precise. I will. + * @see av_probe_input_format2 + */ +const char *mime_type; Is it supposed to be public? Then it should be higher up. Also, shouldn't this better be a list of strings? It is consistent with the field with the same name in AVOutputFormat. This jumping inside of a block looks evil and likely to break in the future. I can jump immediately outside the block. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 065/132] nuv: Reuse the DSPContext from RTJpegContext
On Fri, 14 Mar 2014 05:42:20 -0700, Diego Biurrun di...@biurrun.de wrote: There is no point in populating NuvContext with another DSPContext. --- libavcodec/nuv.c| 12 libavcodec/rtjpeg.c | 11 --- libavcodec/rtjpeg.h | 5 ++--- 3 files changed, 10 insertions(+), 18 deletions(-) IMO this makes the code more fragile. dsp is now stored in rtjpeg, but relies on external code initializing it. In case someone were to reuse this code, they'd have to remember to initialize it too. -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 066/132] x86: dsputil: Move inline assembly macros to a separate header
On Fri, 14 Mar 2014 05:42:21 -0700, Diego Biurrun di...@biurrun.de wrote: --- libavcodec/x86/dsputil_mmx.c | 1 + libavcodec/x86/dsputil_qns_template.c | 2 + libavcodec/x86/dsputil_x86.h | 76 -- libavcodec/x86/fpel_mmx.c | 1 + libavcodec/x86/hpeldsp_mmx.c | 1 + libavcodec/x86/inline_asm.h | 100 ++ libavcodec/x86/rnd_mmx.c | 1 + libavcodec/x86/rnd_template.c | 2 + 8 files changed, 108 insertions(+), 76 deletions(-) create mode 100644 libavcodec/x86/inline_asm.h diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index d6136f6..c0b3edd 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -27,6 +27,7 @@ #include libavutil/x86/asm.h #include constants.h #include dsputil_x86.h +#include inline_asm.h #if HAVE_INLINE_ASM diff --git a/libavcodec/x86/dsputil_qns_template.c b/libavcodec/x86/dsputil_qns_template.c index 20a40a1..14ab425 100644 --- a/libavcodec/x86/dsputil_qns_template.c +++ b/libavcodec/x86/dsputil_qns_template.c @@ -22,6 +22,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include inline_asm.h + #define MAX_ABS (512 (SCALE_OFFSET0 ? SCALE_OFFSET : 0)) static int DEF(try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale) diff --git a/libavcodec/x86/dsputil_x86.h b/libavcodec/x86/dsputil_x86.h index 8f8ea05..4b61523 100644 --- a/libavcodec/x86/dsputil_x86.h +++ b/libavcodec/x86/dsputil_x86.h @@ -27,82 +27,6 @@ #include libavcodec/avcodec.h #include libavcodec/dsputil.h -#include libavutil/x86/asm.h What happened to this include. Was it unnecessary? -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 067/132] imgconvert: Move ff_deinterlace_line_*_mmx declarations out of dsputil
On Fri, 14 Mar 2014 05:42:22 -0700, Diego Biurrun di...@biurrun.de wrote: --- libavcodec/imgconvert.c | 4 libavcodec/imgconvert.h | 18 ++ libavcodec/x86/dsputil_x86.h | 12 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 3f5d035..3f65c5b 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -40,10 +40,6 @@ #include libavutil/imgutils.h #if HAVE_MMX_EXTERNAL -#include x86/dsputil_x86.h -#endif - -#if HAVE_MMX_EXTERNAL #define deinterlace_line_inplace ff_deinterlace_line_inplace_mmx #define deinterlace_line ff_deinterlace_line_mmx #else diff --git a/libavcodec/imgconvert.h b/libavcodec/imgconvert.h index 91e9f91..56d89b2 100644 --- a/libavcodec/imgconvert.h +++ b/libavcodec/imgconvert.h @@ -21,6 +21,24 @@ #include stdint.h +#include version.h + +#if FF_API_DEINTERLACE + +void ff_deinterlace_line_mmx(uint8_t *dst, + const uint8_t *lum_m4, const uint8_t *lum_m3, + const uint8_t *lum_m2, const uint8_t *lum_m1, + const uint8_t *lum, + int size); + +void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4, + const uint8_t *lum_m3, + const uint8_t *lum_m2, + const uint8_t *lum_m1, + const uint8_t *lum, int size); + +#endif /* FF_API_DEINTERLACE */ eew, arch-specific code outside of arch-specific dirs. Why not x86/imgconvert.h? -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 068/132] dsputil: Move ff_zigzag_direct and ff_crop_tab declarations to mathops.h
On Fri, 14 Mar 2014 05:42:23 -0700, Diego Biurrun di...@biurrun.de wrote: --- libavcodec/bfin/vp3dsp_init.c | 2 +- libavcodec/bit_depth_template.c | 1 + libavcodec/cavsdsp.c| 2 ++ libavcodec/dsputil.h| 7 +-- libavcodec/imgconvert.c | 2 +- libavcodec/indeo4data.h | 3 ++- libavcodec/mathops.h| 4 libavcodec/mathtables.c | 4 +++- libavcodec/mss3.c | 2 +- libavcodec/pgssubdec.c | 2 +- libavcodec/rv30dsp.c| 1 + libavcodec/rv40dsp.c| 1 + libavcodec/vp3.c| 2 +- libavcodec/vp8dsp.c | 2 +- 14 files changed, 21 insertions(+), 14 deletions(-) Why is that a better place? diff --git a/libavcodec/bfin/vp3dsp_init.c b/libavcodec/bfin/vp3dsp_init.c index ae7ce93..be77cc4 100644 --- a/libavcodec/bfin/vp3dsp_init.c +++ b/libavcodec/bfin/vp3dsp_init.c @@ -23,8 +23,8 @@ #include libavutil/attributes.h #include libavcodec/avcodec.h +#include libavcodec/mathops.h #include libavcodec/vp3dsp.h -#include libavcodec/dsputil.h void ff_bfin_vp3_idct(int16_t *block); diff --git a/libavcodec/bit_depth_template.c b/libavcodec/bit_depth_template.c index 79b..27e658b 100644 --- a/libavcodec/bit_depth_template.c +++ b/libavcodec/bit_depth_template.c @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include mathops.h #include rnd_avg.h #ifndef BIT_DEPTH diff --git a/libavcodec/cavsdsp.c b/libavcodec/cavsdsp.c index bc90546..666dc7f 100644 --- a/libavcodec/cavsdsp.c +++ b/libavcodec/cavsdsp.c @@ -23,7 +23,9 @@ */ #include stdio.h + #include dsputil.h +#include mathops.h #include cavsdsp.h #include libavutil/common.h diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 10479f9..b712d49 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -36,16 +36,11 @@ /* encoding scans */ extern const uint8_t ff_alternate_horizontal_scan[64]; extern const uint8_t ff_alternate_vertical_scan[64]; -extern const uint8_t ff_zigzag_direct[64]; extern const uint8_t ff_zigzag248_direct[64]; Why one and not the other? -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 069/132] dsputil: Refactor duplicated CALL_2X_PIXELS / PIXELS16 macros
On Fri, 14 Mar 2014 05:42:24 -0700, Diego Biurrun di...@biurrun.de wrote: --- libavcodec/arm/hpeldsp_init_arm.c | 2 +- libavcodec/dsputil.h | 2 -- libavcodec/dsputil_template.c | 2 ++ libavcodec/hpel_template.c | 2 ++ libavcodec/hpeldsp_template.c | 2 ++ libavcodec/{rnd_avg.h = pixels.h} | 35 --- libavcodec/rnd_avg.h | 8 libavcodec/x86/dsputil_init.c | 5 +++-- libavcodec/x86/dsputil_x86.h | 12 libavcodec/x86/h264_qpel.c | 5 +++-- libavcodec/x86/hpeldsp_init.c | 36 ++-- libavcodec/x86/rnd_mmx.c | 5 +++-- 12 files changed, 46 insertions(+), 70 deletions(-) copy libavcodec/{rnd_avg.h = pixels.h} (56%) diff --git a/libavcodec/arm/hpeldsp_init_arm.c b/libavcodec/arm/hpeldsp_init_arm.c index c675166..6390660 100644 --- a/libavcodec/arm/hpeldsp_init_arm.c +++ b/libavcodec/arm/hpeldsp_init_arm.c @@ -21,7 +21,7 @@ #include libavutil/arm/cpu.h #include libavutil/attributes.h -#include libavcodec/rnd_avg.h +#include libavcodec/pixels.h #include hpeldsp_arm.h void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index b712d49..d596e29 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -31,7 +31,6 @@ #define AVCODEC_DSPUTIL_H #include avcodec.h -#include rnd_avg.h /* encoding scans */ extern const uint8_t ff_alternate_horizontal_scan[64]; @@ -40,7 +39,6 @@ extern const uint8_t ff_zigzag248_direct[64]; extern uint32_t ff_square_tab[512]; -/* pixel operations */ void ff_put_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride); void ff_avg_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride); void ff_put_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride); diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c index f6e03ec..56f41ad 100644 --- a/libavcodec/dsputil_template.c +++ b/libavcodec/dsputil_template.c @@ -27,6 +27,8 @@ * DSP utils */ +#include pixels.h + #include bit_depth_template.c #if BIT_DEPTH == 8 diff --git a/libavcodec/hpel_template.c b/libavcodec/hpel_template.c index 0d90445..1bc18cc 100644 --- a/libavcodec/hpel_template.c +++ b/libavcodec/hpel_template.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include pixels.h + #define DEF_HPEL(OPNAME, OP)\ static inline void FUNCC(OPNAME ## _pixels2)(uint8_t *block,\ const uint8_t *pixels, \ diff --git a/libavcodec/hpeldsp_template.c b/libavcodec/hpeldsp_template.c index 9456490..f190457 100644 --- a/libavcodec/hpeldsp_template.c +++ b/libavcodec/hpeldsp_template.c @@ -28,6 +28,8 @@ * Half-pel DSP functions */ +#include pixels.h + #include bit_depth_template.c #include hpel_template.c diff --git a/libavcodec/rnd_avg.h b/libavcodec/pixels.h similarity index 56% copy from libavcodec/rnd_avg.h copy to libavcodec/pixels.h index 8feac28..d9d2fde 100644 --- a/libavcodec/rnd_avg.h +++ b/libavcodec/pixels.h @@ -16,41 +16,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef AVCODEC_RND_AVG_H -#define AVCODEC_RND_AVG_H +#ifndef AVCODEC_PIXELS_H +#define AVCODEC_PIXELS_H #include stddef.h #include stdint.h -#define CALL_2X_PIXELS(a, b, n) \ -static void a(uint8_t *block, const uint8_t *pixels, \ +/* pixel operations */ +#define CALL_2X_PIXELS_MACRO(STATIC, a, b, n)\ +STATIC void a(uint8_t *block, const uint8_t *pixels, \ ptrdiff_t line_size, int h)\ {\ b(block, pixels, line_size, h); \ b(block + n, pixels + n, line_size, h); \ } -#define BYTE_VEC32(c) ((c) * 0x01010101UL) -#define BYTE_VEC64(c) ((c) * 0x0001000100010001UL) +#define CALL_2X_PIXELS(a, b, n) CALL_2X_PIXELS_MACRO(static, a, b, n) +#define CALL_2X_PIXELS_EXPORT(a, b, n) CALL_2X_PIXELS_MACRO(, a, b, n) -static inline uint32_t rnd_avg32(uint32_t a, uint32_t b) -{ -return (a | b) - (((a ^ b) ~BYTE_VEC32(0x01)) 1); -} - -static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b) -{ -return (a b) + (((a ^ b) ~BYTE_VEC32(0x01)) 1); -} - -static inline uint64_t rnd_avg64(uint64_t a, uint64_t b) -{ -return (a | b) - (((a ^ b) ~BYTE_VEC64(0x01)) 1); -} - -static inline uint64_t no_rnd_avg64(uint64_t a, uint64_t b) -{ -return (a b) + (((a ^ b) ~BYTE_VEC64(0x01)) 1); -} - -#endif /* AVCODEC_RND_AVG_H */ +#endif /* AVCODEC_PIXELS_H */ diff --git a/libavcodec/rnd_avg.h b/libavcodec/rnd_avg.h index
Re: [libav-devel] [PATCH 1/4] lavc: Add private API to manipulate AVPacketList
On Fri, 14 Mar 2014 08:13:39 +0100, Luca Barbato lu_z...@gentoo.org wrote: On 14/03/14 02:37, James Almer wrote: On 13/08/13 11:49 PM, Luca Barbato wrote: --- libavcodec/avcodec.h | 5 + libavcodec/avpacket.c | 56 ++ libavcodec/internal.h | 36 libavformat/avformat.h | 6 -- 4 files changed, 97 insertions(+), 6 deletions(-) What's the status on this? I don't remember it ever being dropped and it certainly wasn't pushed. It is still used for my libmfx support. If you deem it useful can be merged in the tree. The api isn't exactly as nice as it could so it hadn't been merged yet. Anton do you still have opinions? There's not much point in this patch unless the code that uses it also goes in. -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] [RFC] lavu: add deprecation guards to full scale formats
On Wed, 12 Mar 2014 16:13:58 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: --- Minor correction in mjpegenc and swscale. Vittorio I do not think this should be done until the replacement API is fully in place. -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] dirac: always set color_range
On Thu, 13 Mar 2014 22:42:21 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: --- I didn't notice color_range being set before. This version only sets it when it is unspecified. Vittorio libavcodec/dirac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c index f0fb85d..b294734 100644 --- a/libavcodec/dirac.c +++ b/libavcodec/dirac.c @@ -237,6 +237,8 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb, av_log(avctx, AV_LOG_WARNING, Bitdepth greater than 8); avctx-pix_fmt = dirac_pix_fmt[!luma_offset][source-chroma_format]; +if (avctx-color_range == AVCOL_RANGE_UNSPECIFIED) +avctx-color_range = luma_offset ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; /* [DIRAC_STD] 10.3.9 Colour specification. colour_spec(video_params) */ if (get_bits1(gb)) { /* [DIRAC_STD] custom_colour_spec_flag */ -- 1.8.3.4 (Apple Git-47) If you look at the code more closely, then you'll see that luma_offset is only modified in the block that also sets color range. So the ? is unnecessary (and I think the operands are swapped too) -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 8/9] mpegvideoenc: check color_range
On Wed, 12 Mar 2014 15:30:48 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: --- libavcodec/mpegvideo_enc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 091bee3..beb0067 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -243,8 +243,9 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) case AV_CODEC_ID_MJPEG: if (avctx-pix_fmt != AV_PIX_FMT_YUVJ420P avctx-pix_fmt != AV_PIX_FMT_YUVJ422P -((avctx-pix_fmt != AV_PIX_FMT_YUV420P - avctx-pix_fmt != AV_PIX_FMT_YUV422P) || +((avctx-pix_fmt == AV_PIX_FMT_YUV420P || This looks very different from what was there before. -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 4/9] mdec: set color_range
On Wed, 12 Mar 2014 15:30:44 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: --- libavcodec/mdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index b9ffca6..d6c6060 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -219,6 +219,7 @@ static av_cold int decode_init(AVCodecContext *avctx) if (avctx-idct_algo == FF_IDCT_AUTO) avctx-idct_algo = FF_IDCT_SIMPLE; avctx-pix_fmt = AV_PIX_FMT_YUVJ420P; +avctx-color_range = AVCOL_RANGE_JPEG; Ok -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/9] mjpeg: set color_range
On Wed, 12 Mar 2014 15:30:43 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: --- libavcodec/mjpegdec.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 8210fd3..b1192c5 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -338,8 +338,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) case 0x1100: if (s-rgb) s-avctx-pix_fmt = AV_PIX_FMT_BGRA; -else +else { s-avctx-pix_fmt = s-cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P; +s-avctx-color_range = s-cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; +} assert(s-nb_components == 3); break; case 0x1100: @@ -347,12 +349,15 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) break; case 0x1200: s-avctx-pix_fmt = s-cs_itu601 ? AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P; +s-avctx-color_range = s-cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; break; case 0x2100: s-avctx-pix_fmt = s-cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P; +s-avctx-color_range = s-cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; break; case 0x2200: s-avctx-pix_fmt = s-cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P; +s-avctx-color_range = s-cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; break; default: av_log(s-avctx, AV_LOG_ERROR, Unhandled pixel format 0x%x\n, pix_fmt_id); -- 1.8.3.4 (Apple Git-47) Fine with me -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [RFC PATCH 1/2] aacdec: Don't count probed ADTS frames if there are false positives
On 2014-03-11 16:09:20 +0200, Martin Storsjö wrote: If a portion of the probe buffer seem to resemble ADTS frames, but some data at the end is a mismatch, disregard the whole probing attempt. If it actually is ADTS data, there shouldn't be any mismatches within the sequential frame data. --- This goes on top of Luca's KR patch. --- libavformat/aacdec.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c index 56f7f06..3aee82b 100644 --- a/libavformat/aacdec.c +++ b/libavformat/aacdec.c @@ -43,8 +43,16 @@ static int adts_aac_probe(AVProbeData *p) for (frames = 0; buf2 end; frames++) { uint32_t header = AV_RB16(buf2); -if ((header 0xFFF6) != 0xFFF0) +if ((header 0xFFF6) != 0xFFF0) { +if (buf != buf0) { +// Found something that isn't an ADTS header, starting +// from a position other than the start of the buffer. +// Discard the count we've accumulated so far since it +// probably was a false positive. +frames = 0; +} break; +} fsize = (AV_RB32(buf2 + 3) 13) 0x1FFF; if (fsize 7) break; ok Janne ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [RFC PATCH 2/2] aacdec: Lower the number of frames required to detect ADTS
On 2014-03-11 16:09:21 +0200, Martin Storsjö wrote: For live audio streams, requiring 500 frames for a stream to be detected is a bit overkill. This allows live ADTS streams that aren't frame-aligned to start up more quickly, e.g. http://mp3.streampower.be/radio1.aac. --- Since the probe buffer size is increased until a good enough probe result is found, I'm not sure how much the previous patch actually helps though. If a false positive stream e.g. has got 200 matching frames but show mismatches after that, chances are that we will first try with a small buffer finding e.g. 70 matching frames, which isn't enough. Next we double the probe buffer size and find 140 matching frames, which we deem enough - even if we would have realized that it's a mismatch if we would have tried with an ever bigger probe buffer, which we won't since we now regard 100 as enough. I don't think that it will be a problem. What valid file would have 100 or more consectutive adts frames and then something else. I can only think of diskimages containing adts files. --- libavformat/aacdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c index 3aee82b..be213d4 100644 --- a/libavformat/aacdec.c +++ b/libavformat/aacdec.c @@ -65,7 +65,7 @@ static int adts_aac_probe(AVProbeData *p) if (first_frames = 3) return AVPROBE_SCORE_EXTENSION + 1; -else if (max_frames 500) +else if (max_frames 100) 100 still seems very safe, maybe add a comment that it is just a random number. return AVPROBE_SCORE_EXTENSION; else if (max_frames = 3) return AVPROBE_SCORE_EXTENSION / 2; -- ok Janne ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] mpegvideo: move ff_draw_horiz_band() to mpegutils.c
On Wed, 12 Mar 2014 10:21:00 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: Drop the mpegvideo dependency for svq3 in configure. --- Moved to new file as requested. Vittorio Fine with me, assuming you tested building svq3 without mpegcideo -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] mpegvideo: move mpegvideo formats-related defines to mpegutils.h
On Wed, 12 Mar 2014 10:06:02 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: --- This patch replaces 8/12 and 9/12. Vittorio libavcodec/dxva2_h264.c | 1 + libavcodec/dxva2_mpeg2.c | 1 + libavcodec/dxva2_vc1.c| 1 + libavcodec/error_resilience.c | 1 + libavcodec/h261dec.c | 1 + libavcodec/h261enc.c | 1 + libavcodec/h263.c | 1 + libavcodec/h264.c | 1 + libavcodec/h264.h | 1 + libavcodec/h264_cabac.c | 1 + libavcodec/h264_cavlc.c | 1 + libavcodec/h264_direct.c | 1 + libavcodec/h264_loopfilter.c | 1 + libavcodec/h264_mvpred.h | 1 + libavcodec/h264_parser.c | 1 + libavcodec/h264_refs.c| 1 + libavcodec/ituh263dec.c | 1 + libavcodec/ituh263enc.c | 1 + libavcodec/motion_est.c | 1 + libavcodec/mpeg12dec.c| 1 + libavcodec/mpeg4video.c | 1 + libavcodec/mpeg4videodec.c| 1 + libavcodec/mpeg4videoenc.c| 1 + libavcodec/mpegutils.h| 111 ++ libavcodec/mpegvideo.c| 1 + libavcodec/mpegvideo.h| 82 ++- libavcodec/mpegvideo_enc.c| 1 + libavcodec/mpegvideo_motion.c | 1 + libavcodec/mpegvideo_xvmc.c | 1 + libavcodec/msmpeg4dec.c | 1 + libavcodec/ratecontrol.c | 1 + libavcodec/rv30.c | 1 + libavcodec/rv34.c | 1 + libavcodec/rv40.c | 1 + libavcodec/svq1enc.c | 1 + libavcodec/svq3.c | 1 + libavcodec/vaapi_h264.c | 1 + libavcodec/vaapi_mpeg2.c | 1 + libavcodec/vc1dec.c | 1 + libavcodec/vdpau_h264.c | 1 + libavcodec/wmv2dec.c | 1 + 41 files changed, 154 insertions(+), 78 deletions(-) create mode 100644 libavcodec/mpegutils.h diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c index 049f816..663eb7d 100644 --- a/libavcodec/dxva2_h264.c +++ b/libavcodec/dxva2_h264.c @@ -23,6 +23,7 @@ #include dxva2_internal.h #include h264.h #include h264data.h +#include mpegutils.h struct dxva2_picture_context { DXVA_PicParams_H264 pp; diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c index e0b2efa..b6c2361 100644 --- a/libavcodec/dxva2_mpeg2.c +++ b/libavcodec/dxva2_mpeg2.c @@ -22,6 +22,7 @@ #include libavutil/log.h #include dxva2_internal.h +#include mpegutils.h #define MAX_SLICES 1024 struct dxva2_picture_context { diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c index a72d91e..b2614dd 100644 --- a/libavcodec/dxva2_vc1.c +++ b/libavcodec/dxva2_vc1.c @@ -21,6 +21,7 @@ */ #include dxva2_internal.h +#include mpegutils.h #include vc1.h #include vc1data.h diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index 010b39e..0fa3548 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -30,6 +30,7 @@ #include libavutil/internal.h #include avcodec.h #include error_resilience.h +#include mpegutils.h #include mpegvideo.h #include rectangle.h #include thread.h diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 49eaee1..d6e5272 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -26,6 +26,7 @@ */ #include avcodec.h +#include mpegutils.h #include mpegvideo.h #include h263.h #include h261.h diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index 4cff998..5f0baba 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -27,6 +27,7 @@ #include libavutil/attributes.h #include avcodec.h +#include mpegutils.h #include mpegvideo.h #include h263.h #include h261.h diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 2fa6ca3..6d5ffc0 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -34,6 +34,7 @@ #include h263.h #include h263data.h #include mathops.h +#include mpegutils.h #include unary.h #include flv.h #include mpeg4video.h diff --git a/libavcodec/h264.c b/libavcodec/h264.c index a814d93..ed7ec48 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -42,6 +42,7 @@ #include h264_mvpred.h #include golomb.h #include mathops.h +#include mpegutils.h #include rectangle.h #include svq3.h #include thread.h diff --git a/libavcodec/h264.h b/libavcodec/h264.h index a912db7..e3c0ac0 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -38,6 +38,7 @@ #include h264dsp.h #include h264pred.h #include h264qpel.h +#include mpegutils.h #include rectangle.h #define H264_MAX_PICTURE_COUNT 32 diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c index 654eab7..f1ab97a 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -38,6 +38,7 @@ #include h264data.h #include h264_mvpred.h #include golomb.h +#include
Re: [libav-devel] [PATCH 05/12] h264: Replace mpegvideo-specific MAX_PICTURE_COUNT by private define
On Wed, 12 Mar 2014 09:35:02 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: On Wed, Mar 12, 2014 at 8:28 AM, Anton Khirnov an...@khirnov.net wrote: On Fri, 7 Mar 2014 11:56:26 +0100, Vittorio Giovara vittorio.giov...@gmail.com wrote: --- libavcodec/h264.c| 22 +++--- libavcodec/h264.h| 2 ++ libavcodec/h264_ps.c | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 9430aab..90b5b73 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -279,7 +279,7 @@ static void release_unused_pictures(H264Context *h, int remove_current) int i; /* release non reference frames */ -for (i = 0; i MAX_PICTURE_COUNT; i++) { +for (i = 0; i H264_MAX_PICTURE_COUNT; i++) { In most of those cases, FF_ARRAY_ELEMS(h-DPB) would be even more appropriate I suppose so, but I would prefer to have that in another patchset. Ok, if you prefer -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 066/132] x86: dsputil: Move inline assembly macros to a separate header
On Sat, Mar 15, 2014 at 12:05:11PM +0100, Anton Khirnov wrote: On Fri, 14 Mar 2014 05:42:21 -0700, Diego Biurrun di...@biurrun.de wrote: --- a/libavcodec/x86/dsputil_x86.h +++ b/libavcodec/x86/dsputil_x86.h @@ -27,82 +27,6 @@ #include libavcodec/avcodec.h #include libavcodec/dsputil.h -#include libavutil/x86/asm.h What happened to this include. Was it unnecessary? Yes. Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 067/132] imgconvert: Move ff_deinterlace_line_*_mmx declarations out of dsputil
On Sat, Mar 15, 2014 at 12:06:22PM +0100, Anton Khirnov wrote: On Fri, 14 Mar 2014 05:42:22 -0700, Diego Biurrun di...@biurrun.de wrote: --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -40,10 +40,6 @@ #include libavutil/imgutils.h #if HAVE_MMX_EXTERNAL -#include x86/dsputil_x86.h -#endif - -#if HAVE_MMX_EXTERNAL #define deinterlace_line_inplace ff_deinterlace_line_inplace_mmx #define deinterlace_line ff_deinterlace_line_mmx #else --- a/libavcodec/imgconvert.h +++ b/libavcodec/imgconvert.h @@ -21,6 +21,24 @@ #include stdint.h +#include version.h + +#if FF_API_DEINTERLACE + +void ff_deinterlace_line_mmx(uint8_t *dst, + const uint8_t *lum_m4, const uint8_t *lum_m3, + const uint8_t *lum_m2, const uint8_t *lum_m1, + const uint8_t *lum, + int size); + +void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4, + const uint8_t *lum_m3, + const uint8_t *lum_m2, + const uint8_t *lum_m1, + const uint8_t *lum, int size); + +#endif /* FF_API_DEINTERLACE */ eew, arch-specific code outside of arch-specific dirs. Well, imgconvert is one of the ugliest remaining parts in libavcodec... Why not x86/imgconvert.h? I thought about it, but all of this is deprecated and scheduled for removal, so I figured it was not worth the trouble to separate it cleanly. We'd have to remember to remove the header as well at the next version bump. There is no dsp-like function pointer abstraction going on, it's all being set from the non-x86 code anyway. It's a mess anyway and cleaning it up seemed like a pointless distraction... Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] Release process from 10 further
This is the plan for the next 4 releases (spanning more or less from spring till winter), it is the result of all the feedback regarding our release process and requests. Enough people (mostly mpv, vlc and other downstreams tracking us by git commit) would like to have quicker major releases. The API changes introduced are mostly caused by us trying to satisfy their needs after all. A good amount of people (distribution managers/packagers and the people tending to orphaned packages used but not really developed further) have quite a problem keeping up with the changes if the API gets incompatible too often. In order to help them we already opened a dedicated section to our bugzilla[1] and started writing migration guides[2]. Trying to satisfy those two requirements I'd propose to do the following. - Some (every odd should do) major releases should not break the API, happen quickly once enough features are available and just augment API, possibly break ABI. - Major releases removing the API, thus normally source incompatible with downstream not tracking git should happen at most once per season or twice per year. The rule of documenting the API changes in the migration guide when it is committed should mitigate the situation, as long we stick to it. - We do remain committed to backport security-impacting bugfixes through a window of API-breaking releases, thus not leaving in the cold who couldn't or didn't update often enough. I hope ~8 feature improvements and ~4 api cleanups per year would make everybody happy, I'll update the documentation in this regard soon. lu (with Reinhard) ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 068/132] dsputil: Move ff_zigzag_direct and ff_crop_tab declarations to mathops.h
On Sat, Mar 15, 2014 at 12:08:56PM +0100, Anton Khirnov wrote: On Fri, 14 Mar 2014 05:42:23 -0700, Diego Biurrun di...@biurrun.de wrote: --- libavcodec/bfin/vp3dsp_init.c | 2 +- libavcodec/bit_depth_template.c | 1 + libavcodec/cavsdsp.c| 2 ++ libavcodec/dsputil.h| 7 +-- libavcodec/imgconvert.c | 2 +- libavcodec/indeo4data.h | 3 ++- libavcodec/mathops.h| 4 libavcodec/mathtables.c | 4 +++- libavcodec/mss3.c | 2 +- libavcodec/pgssubdec.c | 2 +- libavcodec/rv30dsp.c| 1 + libavcodec/rv40dsp.c| 1 + libavcodec/vp3.c| 2 +- libavcodec/vp8dsp.c | 2 +- 14 files changed, 21 insertions(+), 14 deletions(-) Why is that a better place? Anything is better than dsputil.h ;) The tables are defined in mathtables.c and all other declarations of the tables defined in mathtables.c are in mathops.h. I don't see why these shouldn't live there as well. --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -36,16 +36,11 @@ /* encoding scans */ extern const uint8_t ff_alternate_horizontal_scan[64]; extern const uint8_t ff_alternate_vertical_scan[64]; -extern const uint8_t ff_zigzag_direct[64]; extern const uint8_t ff_zigzag248_direct[64]; Why one and not the other? The 248 table is only used in DV, I'm moving it to dvdata in a later commit. Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 068/132] dsputil: Move ff_zigzag_direct and ff_crop_tab declarations to mathops.h
On Sat, 15 Mar 2014 15:54:05 +0100, Diego Biurrun di...@biurrun.de wrote: On Sat, Mar 15, 2014 at 12:08:56PM +0100, Anton Khirnov wrote: On Fri, 14 Mar 2014 05:42:23 -0700, Diego Biurrun di...@biurrun.de wrote: --- libavcodec/bfin/vp3dsp_init.c | 2 +- libavcodec/bit_depth_template.c | 1 + libavcodec/cavsdsp.c| 2 ++ libavcodec/dsputil.h| 7 +-- libavcodec/imgconvert.c | 2 +- libavcodec/indeo4data.h | 3 ++- libavcodec/mathops.h| 4 libavcodec/mathtables.c | 4 +++- libavcodec/mss3.c | 2 +- libavcodec/pgssubdec.c | 2 +- libavcodec/rv30dsp.c| 1 + libavcodec/rv40dsp.c| 1 + libavcodec/vp3.c| 2 +- libavcodec/vp8dsp.c | 2 +- 14 files changed, 21 insertions(+), 14 deletions(-) Why is that a better place? Anything is better than dsputil.h ;) The tables are defined in mathtables.c and all other declarations of the tables defined in mathtables.c are in mathops.h. I don't see why these shouldn't live there as well. --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -36,16 +36,11 @@ /* encoding scans */ extern const uint8_t ff_alternate_horizontal_scan[64]; extern const uint8_t ff_alternate_vertical_scan[64]; -extern const uint8_t ff_zigzag_direct[64]; extern const uint8_t ff_zigzag248_direct[64]; Why one and not the other? The 248 table is only used in DV, I'm moving it to dvdata in a later commit. Ok then -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 067/132] imgconvert: Move ff_deinterlace_line_*_mmx declarations out of dsputil
On Sat, 15 Mar 2014 15:46:53 +0100, Diego Biurrun di...@biurrun.de wrote: On Sat, Mar 15, 2014 at 12:06:22PM +0100, Anton Khirnov wrote: On Fri, 14 Mar 2014 05:42:22 -0700, Diego Biurrun di...@biurrun.de wrote: --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -40,10 +40,6 @@ #include libavutil/imgutils.h #if HAVE_MMX_EXTERNAL -#include x86/dsputil_x86.h -#endif - -#if HAVE_MMX_EXTERNAL #define deinterlace_line_inplace ff_deinterlace_line_inplace_mmx #define deinterlace_line ff_deinterlace_line_mmx #else --- a/libavcodec/imgconvert.h +++ b/libavcodec/imgconvert.h @@ -21,6 +21,24 @@ #include stdint.h +#include version.h + +#if FF_API_DEINTERLACE + +void ff_deinterlace_line_mmx(uint8_t *dst, + const uint8_t *lum_m4, const uint8_t *lum_m3, + const uint8_t *lum_m2, const uint8_t *lum_m1, + const uint8_t *lum, + int size); + +void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4, + const uint8_t *lum_m3, + const uint8_t *lum_m2, + const uint8_t *lum_m1, + const uint8_t *lum, int size); + +#endif /* FF_API_DEINTERLACE */ eew, arch-specific code outside of arch-specific dirs. Well, imgconvert is one of the ugliest remaining parts in libavcodec... Why not x86/imgconvert.h? I thought about it, but all of this is deprecated and scheduled for removal, so I figured it was not worth the trouble to separate it cleanly. We'd have to remember to remove the header as well at the next version bump. There is no dsp-like function pointer abstraction going on, it's all being set from the non-x86 code anyway. It's a mess anyway and cleaning it up seemed like a pointless distraction... Oh well, I guess i can live with this for now -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 069/132] dsputil: Refactor duplicated CALL_2X_PIXELS / PIXELS16 macros
On 15 Mar 2014, at 12:17, Anton Khirnov an...@khirnov.net wrote: On Fri, 14 Mar 2014 05:42:24 -0700, Diego Biurrun di...@biurrun.de wrote: --- #if HAVE_YASM -#define HPELDSP_AVG_PIXELS16(CPUEXT)\ -PIXELS16(static, put_no_rnd, ff_, _x2, CPUEXT) \ -PIXELS16(static, put,ff_, _y2, CPUEXT) \ -PIXELS16(static, put_no_rnd, ff_, _y2, CPUEXT) \ -PIXELS16(static, avg,ff_, , CPUEXT) \ -PIXELS16(static, avg,ff_, _x2, CPUEXT) \ -PIXELS16(static, avg,ff_, _y2, CPUEXT) \ -PIXELS16(static, avg,ff_, _xy2, CPUEXT) +#define HPELDSP_AVG_PIXELS16(CPUEXT) \ +CALL_2X_PIXELS(put_no_rnd_pixels16_x2 ## CPUEXT, \ + ff_put_no_rnd_pixels8_x2 ## CPUEXT, 8) \ +CALL_2X_PIXELS(put_pixels16_y2 ## CPUEXT, \ + ff_put_pixels8_y2 ## CPUEXT, 8)\ +CALL_2X_PIXELS(put_no_rnd_pixels16_y2 ## CPUEXT, \ + ff_put_no_rnd_pixels8_y2 ## CPUEXT, 8) \ +CALL_2X_PIXELS(avg_pixels16 ## CPUEXT,\ + ff_avg_pixels8 ## CPUEXT, 8) \ +CALL_2X_PIXELS(avg_pixels16_x2 ## CPUEXT, \ + ff_avg_pixels8_x2 ## CPUEXT, 8)\ +CALL_2X_PIXELS(avg_pixels16_y2 ## CPUEXT, \ + ff_avg_pixels8_y2 ## CPUEXT, 8)\ +CALL_2X_PIXELS(avg_pixels16_xy2 ## CPUEXT,\ + ff_avg_pixels8_xy2 ## CPUEXT, 8) This is now much less readable Indeed. Tim ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 1/3] x86/synth_filter: add synth_filter_sse
On 14/03/14 7:56 AM, Christophe Gisquet wrote: Hi, 2014-03-04 3:25 GMT+01:00 James Almer jamr...@gmail.com: -INIT_XMM sse2 +%macro SETZERO 1 +%if cpuflag(sse2) +pxor %1, %1 +%else +xorps %1, %1, %1 +%endif +%endmacro + +%macro SHUF 2 +%if cpuflag(sse2) +pshufd%1, %2, q0123 +%else +mova %1, %2 +shufps%1, %1, q0123 +%endif +%endmacro We already discussed this, and indeed it is worth having SSE2 (integer) instructions instead of pure (float) SSE ones for the SSE2 version as they are actually faster. OK from me then for the asm. Not sure if the C part still applies cleanly, but this should be minor. It doesn't. I'll rebase and send the patchset again with some other changes later. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/3] x86/synth_filter: add synth_filter_fma3
On 14/03/14 8:02 AM, Christophe Gisquet wrote: Hi, 2014-03-04 3:25 GMT+01:00 James Almer jamr...@gmail.com: snip Don't know fma3 but this is straightforward replacement of mul+add by a mac instruction. If the avx code is ok, I don't see how this wouldn't. I just noticed i can replace the mul+sub instructions as well with a single fnmaddps, so I'll send an updated version with that change. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel