[FFmpeg-cvslog] avcodec/wmaprodec: cleanup extradata dumping
ffmpeg | branch: master | Paul B Mahol | Thu Dec 22 09:45:40 2016 +0100| [4cf96c56420b89dc7145f906ac2bc67c880998ea] | committer: Paul B Mahol avcodec/wmaprodec: cleanup extradata dumping Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4cf96c56420b89dc7145f906ac2bc67c880998ea --- libavcodec/wmaprodec.c | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 2cc1b09..d06e3b7 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -317,25 +317,21 @@ static av_cold int decode_init(AVCodecContext *avctx) avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; +/** dump the extradata */ +av_log(avctx, AV_LOG_DEBUG, "extradata:\n"); +for (i = 0; i < avctx->extradata_size; i++) +av_log(avctx, AV_LOG_DEBUG, "[%x] ", avctx->extradata[i]); +av_log(avctx, AV_LOG_DEBUG, "\n"); if (avctx->codec_id == AV_CODEC_ID_XMA2 && avctx->extradata_size >= 34) { s->decode_flags= 0x10d6; channel_mask = AV_RL32(edata_ptr+2); s->bits_per_sample = 16; -/** dump the extradata */ -for (i = 0; i < avctx->extradata_size; i++) -ff_dlog(avctx, "[%x] ", avctx->extradata[i]); -ff_dlog(avctx, "\n"); } else if (avctx->codec_id == AV_CODEC_ID_XMA1 && avctx->extradata_size >= 28) { s->decode_flags= 0x10d6; s->bits_per_sample = 16; channel_mask = 0; -/** dump the extradata */ -for (i = 0; i < avctx->extradata_size; i++) -ff_dlog(avctx, "[%x] ", avctx->extradata[i]); -ff_dlog(avctx, "\n"); - - } else if (avctx->extradata_size >= 18) { + } else if (avctx->codec_id == AV_CODEC_ID_WMAPRO && avctx->extradata_size >= 18) { s->decode_flags= AV_RL16(edata_ptr+14); channel_mask = AV_RL32(edata_ptr+2); s->bits_per_sample = AV_RL16(edata_ptr); @@ -344,12 +340,6 @@ static av_cold int decode_init(AVCodecContext *avctx) avpriv_request_sample(avctx, "bits per sample is %d", s->bits_per_sample); return AVERROR_PATCHWELCOME; } - -/** dump the extradata */ -for (i = 0; i < avctx->extradata_size; i++) -ff_dlog(avctx, "[%x] ", avctx->extradata[i]); -ff_dlog(avctx, "\n"); - } else { avpriv_request_sample(avctx, "Unknown extradata size"); return AVERROR_PATCHWELCOME; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/wavdec: add support for decoding 24.0 and 16.8 floating point pcm formats
ffmpeg | branch: master | Paul B Mahol | Mon Sep 19 23:08:32 2016 +0200| [314269118161ed7735a905332ccf847d1ec696a2] | committer: Paul B Mahol avformat/wavdec: add support for decoding 24.0 and 16.8 floating point pcm formats Fixes #5602 and #5603. Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=314269118161ed7735a905332ccf847d1ec696a2 --- libavformat/wavdec.c | 13 + 1 file changed, 13 insertions(+) diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index ae42a61..987155e 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -556,6 +556,19 @@ break_loop: if (sample_count) st->duration = sample_count; +if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S32LE && +st->codecpar->block_align == st->codecpar->channels * 4 && +st->codecpar->bits_per_coded_sample == 32 && +st->codecpar->extradata_size == 2 && +AV_RL16(st->codecpar->extradata) == 1) { +st->codecpar->codec_id = AV_CODEC_ID_PCM_F16LE; +st->codecpar->bits_per_coded_sample = 16; +} else if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S24LE && + st->codecpar->block_align == st->codecpar->channels * 4 && + st->codecpar->bits_per_coded_sample == 24) { +st->codecpar->codec_id = AV_CODEC_ID_PCM_F24LE; +} + ff_metadata_conv_ctx(s, NULL, wav_metadata_conv); ff_metadata_conv_ctx(s, NULL, ff_riff_info_conv); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec: add pcm_f16le and pcm_f24le decoder
ffmpeg | branch: master | Paul B Mahol | Mon Sep 19 22:26:39 2016 +0200| [95fb9e0205921a9970fb1a418a12e7f01c18cbca] | committer: Paul B Mahol avcodec: add pcm_f16le and pcm_f24le decoder Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=95fb9e0205921a9970fb1a418a12e7f01c18cbca --- Changelog | 2 ++ libavcodec/Makefile | 2 ++ libavcodec/allcodecs.c | 2 ++ libavcodec/avcodec.h| 2 ++ libavcodec/codec_desc.c | 14 ++ libavcodec/pcm.c| 34 ++ libavcodec/utils.c | 2 ++ libavcodec/version.h| 2 +- 8 files changed, 59 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index b36a631..0317dbc 100644 --- a/Changelog +++ b/Changelog @@ -9,6 +9,8 @@ version : - Support for spherical videos - configure now fails if autodetect-libraries are requested but not found - PSD Decoder +- 16.8 floating point pcm decoder +- 24.0 floating point pcm decoder version 3.2: - libopenmpt demuxer diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 23e41dd..095bc55 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -658,6 +658,8 @@ OBJS-$(CONFIG_PCM_ALAW_DECODER) += pcm.o OBJS-$(CONFIG_PCM_ALAW_ENCODER) += pcm.o OBJS-$(CONFIG_PCM_BLURAY_DECODER) += pcm-bluray.o OBJS-$(CONFIG_PCM_DVD_DECODER)+= pcm-dvd.o +OBJS-$(CONFIG_PCM_F16LE_DECODER) += pcm.o +OBJS-$(CONFIG_PCM_F24LE_DECODER) += pcm.o OBJS-$(CONFIG_PCM_F32BE_DECODER) += pcm.o OBJS-$(CONFIG_PCM_F32BE_ENCODER) += pcm.o OBJS-$(CONFIG_PCM_F32LE_DECODER) += pcm.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index bbcecce..6e193fd 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -477,6 +477,8 @@ void avcodec_register_all(void) REGISTER_ENCDEC (PCM_ALAW, pcm_alaw); REGISTER_DECODER(PCM_BLURAY,pcm_bluray); REGISTER_DECODER(PCM_DVD, pcm_dvd); +REGISTER_DECODER(PCM_F16LE, pcm_f16le); +REGISTER_DECODER(PCM_F24LE, pcm_f24le); REGISTER_ENCDEC (PCM_F32BE, pcm_f32be); REGISTER_ENCDEC (PCM_F32LE, pcm_f32le); REGISTER_ENCDEC (PCM_F64BE, pcm_f64be); diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 098debf..71ca658 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -449,6 +449,8 @@ enum AVCodecID { AV_CODEC_ID_PCM_S64LE = 0x10800, AV_CODEC_ID_PCM_S64BE, +AV_CODEC_ID_PCM_F16LE, +AV_CODEC_ID_PCM_F24LE, /* various ADPCM codecs */ AV_CODEC_ID_ADPCM_IMA_QT = 0x11000, diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 29ffcb9..ec06fd7 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1749,6 +1749,20 @@ static const AVCodecDescriptor codec_descriptors[] = { .props = AV_CODEC_PROP_LOSSLESS, }, { +.id= AV_CODEC_ID_PCM_F16LE, +.type = AVMEDIA_TYPE_AUDIO, +.name = "pcm_f16le", +.long_name = NULL_IF_CONFIG_SMALL("PCM 16.8 floating point little-endian"), +.props = AV_CODEC_PROP_LOSSLESS, +}, +{ +.id= AV_CODEC_ID_PCM_F24LE, +.type = AVMEDIA_TYPE_AUDIO, +.name = "pcm_f24le", +.long_name = NULL_IF_CONFIG_SMALL("PCM 24.0 floating point little-endian"), +.props = AV_CODEC_PROP_LOSSLESS, +}, +{ .id= AV_CODEC_ID_PCM_F32BE, .type = AVMEDIA_TYPE_AUDIO, .name = "pcm_f32be", diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index 2e8e8e7..8c326c6 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -25,6 +25,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/float_dsp.h" #include "avcodec.h" #include "bytestream.h" #include "internal.h" @@ -225,6 +226,8 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, typedef struct PCMDecode { short table[256]; +AVFloatDSPContext *fdsp; +float scale; } PCMDecode; static av_cold int pcm_decode_init(AVCodecContext *avctx) @@ -246,6 +249,13 @@ static av_cold int pcm_decode_init(AVCodecContext *avctx) for (i = 0; i < 256; i++) s->table[i] = ulaw2linear(i); break; +case AV_CODEC_ID_PCM_F16LE: +case AV_CODEC_ID_PCM_F24LE: +s->scale = 1. / (1 << (avctx->bits_per_coded_sample - 1)); +s->fdsp = avpriv_float_dsp_alloc(0); +if (!s->fdsp) +return AVERROR(ENOMEM); +break; default: break; } @@ -258,6 +268,15 @@ static av_cold int pcm_decode_init(AVCodecContext *avctx) return 0; } +static av_cold int pcm_decode_close(AVCodecContext *avctx) +{ +PCMDecode *s = avctx->priv_data; + +av_freep(&s->fdsp); + +return 0; +} + /** * Read PCM samples macro * @param size Data size of native machine format @@ -400,6 +419,
[FFmpeg-cvslog] lavfi: take_samples: free frames after taking all samples.
ffmpeg | branch: master | Nicolas George | Thu Dec 22 10:26:03 2016 +0100| [ff8b17c998dca3f0026466638430ed183426bdde] | committer: Nicolas George lavfi: take_samples: free frames after taking all samples. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ff8b17c998dca3f0026466638430ed183426bdde --- libavfilter/avfilter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index c2a8413..0020ee1 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -1288,6 +1288,7 @@ static int take_samples(AVFilterLink *link, unsigned min, unsigned max, av_samples_copy(buf->extended_data, frame->extended_data, p, 0, frame->nb_samples, link->channels, link->format); p += frame->nb_samples; +av_frame_free(&frame); } if (p < nb_samples) { unsigned n = nb_samples - p; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/filters: Fix vsbmc option name.
ffmpeg | branch: master | Carl Eugen Hoyos | Thu Dec 22 11:48:18 2016 +0100| [0098eeaa62899136caf61aa76e3be2c198144ecc] | committer: Carl Eugen Hoyos doc/filters: Fix vsbmc option name. Reported-by: Антон Приходько > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0098eeaa62899136caf61aa76e3be2c198144ecc --- doc/filters.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/filters.texi b/doc/filters.texi index 51db7f9..62e5db6 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -9704,7 +9704,7 @@ Macroblock size. Default @code{16}. @item search_param Motion estimation search parameter. Default @code{32}. -@item vsmbc +@item vsbmc Enable variable-size block motion compensation. Motion estimation is applied with smaller block sizes at object boundaries in order to make the them less blur. Default is @code{0} (disabled). @end table @end table ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/random_seed: Improve get_generic_seed() with higher precission clock()
ffmpeg | branch: master | Michael Niedermayer | Thu Dec 22 03:59:03 2016 +0100| [da73d95bad4736c5e0a6b4b1a811f4dd4525bb4c] | committer: Michael Niedermayer avutil/random_seed: Improve get_generic_seed() with higher precission clock() Tested-by: Thomas Turner Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da73d95bad4736c5e0a6b4b1a811f4dd4525bb4c --- libavutil/random_seed.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index 79bc7af..179fb23 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -67,6 +67,7 @@ static uint32_t get_generic_seed(void) uint64_t tmp[120/8]; struct AVSHA *sha = (void*)tmp; clock_t last_t = 0; +clock_t last_td = 0; static uint64_t i = 0; static uint32_t buffer[512] = { 0 }; unsigned char digest[20]; @@ -86,11 +87,12 @@ static uint32_t get_generic_seed(void) for (;;) { clock_t t = clock(); - -if (last_t == t) { -buffer[i & 511]++; +if (last_t + 2*last_td + 1 >= t) { +last_td = t - last_t; +buffer[i & 511] = 1664525*buffer[i & 511] + 1013904223 + (last_td % 3294638521U); } else { -buffer[++i & 511] += (t - last_t) % 3294638521U; +last_td = t - last_t; +buffer[++i & 511] += last_td % 3294638521U; if (last_i && i - last_i > 4 || i - last_i > 64 || TEST && i - last_i > 8) break; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/general: mention recently added PCM codecs
ffmpeg | branch: master | Paul B Mahol | Thu Dec 22 18:39:02 2016 +0100| [c5168b4b542bad1197934cbea2af5c002012c145] | committer: Paul B Mahol doc/general: mention recently added PCM codecs Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c5168b4b542bad1197934cbea2af5c002012c145 --- doc/general.texi | 4 1 file changed, 4 insertions(+) diff --git a/doc/general.texi b/doc/general.texi index 9ea3ba3..bc1a955 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -450,6 +450,8 @@ library: @item raw PCM signed 24 bit little-endian @tab X @tab X @item raw PCM signed 32 bit big-endian @tab X @tab X @item raw PCM signed 32 bit little-endian @tab X @tab X +@item raw PCM signed 64 bit big-endian @tab X @tab X +@item raw PCM signed 64 bit little-endian @tab X @tab X @item raw PCM unsigned 8 bit@tab X @tab X @item raw PCM unsigned 16 bit big-endian @tab X @tab X @item raw PCM unsigned 16 bit little-endian @tab X @tab X @@ -457,6 +459,8 @@ library: @item raw PCM unsigned 24 bit little-endian @tab X @tab X @item raw PCM unsigned 32 bit big-endian @tab X @tab X @item raw PCM unsigned 32 bit little-endian @tab X @tab X +@item raw PCM 16.8 floating point little-endian @tab @tab X +@item raw PCM 24.0 floating point little-endian @tab @tab X @item raw PCM floating-point 32 bit big-endian @tab X @tab X @item raw PCM floating-point 32 bit little-endian @tab X @tab X @item raw PCM floating-point 64 bit big-endian @tab X @tab X ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] tests/avstring: free the pointer after calls to av_d2str()
ffmpeg | branch: master | James Almer | Thu Dec 22 12:11:13 2016 -0300| [0abcebe3d62df01e7038cc78523e4445089f3b69] | committer: James Almer tests/avstring: free the pointer after calls to av_d2str() Fixes memleaks. Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0abcebe3d62df01e7038cc78523e4445089f3b69 --- libavutil/tests/avstring.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavutil/tests/avstring.c b/libavutil/tests/avstring.c index 290b170..14bc7ff 100644 --- a/libavutil/tests/avstring.c +++ b/libavutil/tests/avstring.c @@ -97,8 +97,10 @@ int main(void) #define TEST_D2STR(value, expected) \ if((ptr = av_d2str(value)) == NULL){ \ printf("error, received null pointer!\n"); \ -} else if(strcmp(ptr, expected) != 0){ \ -printf( "expected: %s, received: %s\n", expected, ptr); \ +} else { \ +if(strcmp(ptr, expected) != 0) \ +printf( "expected: %s, received: %s\n", expected, ptr); \ +av_free(ptr); \ } TEST_D2STR(0 , "0.00"); TEST_D2STR(-1.2333234, "-1.233323"); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffserver_config: Check for failure to allocate FFServerIPAddressACL
ffmpeg | branch: master | Michael Niedermayer | Thu Dec 22 19:04:55 2016 +0100| [f9315ea984efc1a58499664e27b75c37295381db] | committer: Michael Niedermayer ffserver_config: Check for failure to allocate FFServerIPAddressACL Fixes CID1396537 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f9315ea984efc1a58499664e27b75c37295381db --- ffserver_config.c | 5 + 1 file changed, 5 insertions(+) diff --git a/ffserver_config.c b/ffserver_config.c index 05c6622..54135be 100644 --- a/ffserver_config.c +++ b/ffserver_config.c @@ -150,6 +150,11 @@ void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed, } nacl = av_mallocz(sizeof(*nacl)); +if (!nacl) { +fprintf(stderr, "Failed to allocate FFServerIPAddressACL\n"); +goto bail; +} + naclp = 0; acl.next = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] fate: Add test for ticket 6024, truncated decoding mode
ffmpeg | branch: master | Pavel Koshevoy | Sat Dec 17 22:48:50 2016 -0700| [47cd8effea343e71c4010929ed3fb10dd3dca4b1] | committer: Michael Niedermayer fate: Add test for ticket 6024, truncated decoding mode Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=47cd8effea343e71c4010929ed3fb10dd3dca4b1 --- tests/fate/video.mak| 3 +++ tests/ref/fate/mpeg2-ticket6024 | 27 +++ 2 files changed, 30 insertions(+) diff --git a/tests/fate/video.mak b/tests/fate/video.mak index f893688..7636ab2 100644 --- a/tests/fate/video.mak +++ b/tests/fate/video.mak @@ -239,6 +239,9 @@ FATE_VIDEO-$(call DEMDEC, MPEGTS, MPEG2VIDEO) += fate-mpeg2-field-enc fate-mpeg2 fate-mpeg2-field-enc: CMD = framecrc -flags +bitexact -idct simple -i $(TARGET_SAMPLES)/mpeg2/mpeg2_field_encoding.ts -an -vframes 30 fate-mpeg2-ticket186: CMD = framecrc -flags +bitexact -idct simple -i $(TARGET_SAMPLES)/mpeg2/t.mpg -an +FATE_VIDEO-$(call DEMDEC, MPEGPS, MPEG2VIDEO) += fate-mpeg2-ticket6024 +fate-mpeg2-ticket6024: CMD = framecrc -flags +bitexact -idct simple -flags +truncated -i $(TARGET_SAMPLES)/mpeg2/matrixbench_mpeg2.lq1.mpg -an + FATE_VIDEO-$(call DEMDEC, MV, MVC1) += fate-mv-mvc1 fate-mv-mvc1: CMD = framecrc -i $(TARGET_SAMPLES)/mv/posture.mv -an -frames 25 -pix_fmt rgb555le diff --git a/tests/ref/fate/mpeg2-ticket6024 b/tests/ref/fate/mpeg2-ticket6024 new file mode 100644 index 000..bd41624 --- /dev/null +++ b/tests/ref/fate/mpeg2-ticket6024 @@ -0,0 +1,27 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 716x236 +#sar 0: 1/1 +0, 2, 2,1, 253464, 0xc51a46f9 +0, 4, 4,1, 253464, 0xd0661651 +0, 5, 5,1, 253464, 0x38a213b3 +0, 6, 6,1, 253464, 0x038a5118 +0, 7, 7,1, 253464, 0xebd8de64 +0, 8, 8,1, 253464, 0x0b319ee0 +0, 9, 9,1, 253464, 0x37b03a45 +0, 10, 10,1, 253464, 0x5f9c89ae +0, 11, 11,1, 253464, 0x88ad9c08 +0, 12, 12,1, 253464, 0x387198bc +0, 13, 13,1, 253464, 0xf3933eb6 +0, 14, 14,1, 253464, 0x9bd27b98 +0, 15, 15,1, 253464, 0x9442c538 +0, 16, 16,1, 253464, 0x330be2a4 +0, 17, 17,1, 253464, 0xb4b8c1df +0, 18, 18,1, 253464, 0xc97ded34 +0, 19, 19,1, 253464, 0xcad936e0 +0, 20, 20,1, 253464, 0x11a2850d +0, 21, 21,1, 253464, 0x2545ad23 +0, 22, 22,1, 253464, 0xa5e17c47 +0, 23, 23,1, 253464, 0x39452689 +0, 24, 24,1, 253464, 0x1daefd72 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_deband: add planes coupling mode
ffmpeg | branch: master | Paul B Mahol | Thu Dec 22 21:45:24 2016 +0100| [fdcb7a85cf2aed85ba5a315440051f88e08bc6f5] | committer: Paul B Mahol avfilter/vf_deband: add planes coupling mode Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fdcb7a85cf2aed85ba5a315440051f88e08bc6f5 --- doc/filters.texi| 7 ++- libavfilter/vf_deband.c | 162 +++- 2 files changed, 166 insertions(+), 3 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 62e5db6..6ad2db2 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -6203,11 +6203,16 @@ absolute value will be picked. For example direction 0, -PI or -2*PI radians will pick only pixels on same row and -PI/2 will pick only pixels on same column. -@item blur +@item blur, b If enabled, current pixel is compared with average value of all four surrounding pixels. The default is enabled. If disabled current pixel is compared with all four surrounding pixels. The pixel is considered banded if only all four differences with surrounding pixels are less than threshold. + +@item coupling, c +If enabled, current pixel is changed if and only if all pixel components are banded, +e.g. banding detection threshold is triggered for all color components. +The default is disabled. @end table @anchor{decimate} diff --git a/libavfilter/vf_deband.c b/libavfilter/vf_deband.c index fbf27ea..ffec037 100644 --- a/libavfilter/vf_deband.c +++ b/libavfilter/vf_deband.c @@ -30,6 +30,7 @@ typedef struct DebandContext { const AVClass *class; +int coupling; float threshold[4]; int range; int blur; @@ -38,6 +39,7 @@ typedef struct DebandContext { int nb_components; int planewidth[4]; int planeheight[4]; +int shift[2]; int thr[4]; int *x_pos; @@ -59,6 +61,9 @@ static const AVOption deband_options[] = { { "direction", "set direction", OFFSET(direction), AV_OPT_TYPE_FLOAT, {.dbl=2*M_PI},-2*M_PI, 2*M_PI, FLAGS }, { "d", "set direction", OFFSET(direction), AV_OPT_TYPE_FLOAT, {.dbl=2*M_PI},-2*M_PI, 2*M_PI, FLAGS }, { "blur", "set blur",OFFSET(blur), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS }, +{ "b", "set blur",OFFSET(blur), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS }, +{ "coupling", "set plane coupling", OFFSET(coupling), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, +{ "c", "set plane coupling", OFFSET(coupling), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, { NULL } }; @@ -66,6 +71,8 @@ AVFILTER_DEFINE_CLASS(deband); static int query_formats(AVFilterContext *ctx) { +DebandContext *s = ctx->priv; + static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, @@ -86,7 +93,21 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16, AV_PIX_FMT_NONE }; -AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); + +static const enum AVPixelFormat cpix_fmts[] = { +AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, +AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P9, +AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA444P10, +AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14, +AV_PIX_FMT_YUV444P16, AV_PIX_FMT_YUVA444P16, +AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, +AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, +AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, +AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16, +AV_PIX_FMT_NONE +}; + +AVFilterFormats *fmts_list = ff_make_format_list(s->coupling ? cpix_fmts : pix_fmts); if (!fmts_list) return AVERROR(ENOMEM); @@ -158,6 +179,138 @@ static int deband_8_c(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) return 0; } +static int deband_8_coupling_c(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) +{ +DebandContext *s = ctx->priv; +ThreadData *td = arg; +AVFrame *in = td->in; +AVFrame *out = td->out; +const int start = (s->planeheight[0] * jobnr ) / nb_jobs; +const int end = (s->planeheight[0] * (jobnr+1)) / nb_jobs; +int x, y, p; + +for (y = start; y < end; y++) { +const int pos = y * s->planewidth[0]; + +for (x = 0; x < s->planewidth[p]; x++) { +const int x_pos = s->x_pos[pos + x]; +const int y_pos = s->y_pos[pos + x]; +int avg[4], cmp[4] = { 0 }, src[4]; + +for (p = 0; p < s->nb_components; p++) { +const uint8_t *src_ptr = (const uint8_t *)in->data[p]; +const int src_linesize = in->linesize[p]; +const int thr = s->thr[p]; +const int w = s->planewidth[
[FFmpeg-cvslog] avcodec: add Apple Pixlet decoder
ffmpeg | branch: master | Paul B Mahol | Fri Dec 2 20:30:50 2016 +0100| [73651090ca1183f37753ee30a7e206ca4fb9f4f0] | committer: Paul B Mahol avcodec: add Apple Pixlet decoder Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=73651090ca1183f37753ee30a7e206ca4fb9f4f0 --- Changelog | 1 + doc/general.texi| 1 + libavcodec/Makefile | 1 + libavcodec/allcodecs.c | 1 + libavcodec/avcodec.h| 1 + libavcodec/codec_desc.c | 7 + libavcodec/pixlet.c | 672 libavcodec/version.h| 2 +- libavformat/isom.c | 2 + 9 files changed, 687 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 0317dbc..aff9ab0 100644 --- a/Changelog +++ b/Changelog @@ -11,6 +11,7 @@ version : - PSD Decoder - 16.8 floating point pcm decoder - 24.0 floating point pcm decoder +- Apple Pixlet decoder version 3.2: - libopenmpt demuxer diff --git a/doc/general.texi b/doc/general.texi index bc1a955..084c0a1 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -631,6 +631,7 @@ following image formats are supported: @item ANSI/ASCII art @tab @tab X @item Apple Intermediate Codec @tab @tab X @item Apple MJPEG-B @tab @tab X +@item Apple Pixlet @tab @tab X @item Apple ProRes @tab X @tab X @item Apple QuickDraw@tab @tab X @tab fourcc: qdrw diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 095bc55..ec4f7fc 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -452,6 +452,7 @@ OBJS-$(CONFIG_PGMYUV_DECODER) += pnmdec.o pnm.o OBJS-$(CONFIG_PGMYUV_ENCODER) += pnmenc.o OBJS-$(CONFIG_PGSSUB_DECODER) += pgssubdec.o OBJS-$(CONFIG_PICTOR_DECODER) += pictordec.o cga_data.o +OBJS-$(CONFIG_PIXLET_DECODER) += pixlet.o OBJS-$(CONFIG_PJS_DECODER) += textdec.o ass.o OBJS-$(CONFIG_PNG_DECODER) += png.o pngdec.o pngdsp.o OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 6e193fd..678f54a 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -281,6 +281,7 @@ void avcodec_register_all(void) REGISTER_ENCDEC (PGM, pgm); REGISTER_ENCDEC (PGMYUV,pgmyuv); REGISTER_DECODER(PICTOR,pictor); +REGISTER_DECODER(PIXLET,pixlet); REGISTER_ENCDEC (PNG, png); REGISTER_ENCDEC (PPM, ppm); REGISTER_ENCDEC (PRORES,prores); diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 71ca658..ca8b786 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -412,6 +412,7 @@ enum AVCodecID { AV_CODEC_ID_SHEERVIDEO, AV_CODEC_ID_YLC, AV_CODEC_ID_PSD, +AV_CODEC_ID_PIXLET, /* 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 ec06fd7..e7ef368 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1339,6 +1339,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL("YUY2 Lossless Codec"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, }, +{ +.id= AV_CODEC_ID_PIXLET, +.type = AVMEDIA_TYPE_VIDEO, +.name = "pixlet", +.long_name = NULL_IF_CONFIG_SMALL("Apple Pixlet"), +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, +}, /* image codecs */ { diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c new file mode 100644 index 000..c5d37bb --- /dev/null +++ b/libavcodec/pixlet.c @@ -0,0 +1,672 @@ +/* + * Apple Pixlet decoder + * Copyright (c) 2016 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg 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. + * + * FFmpeg 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 FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include "libavutil/imgutils.h" +#include "libavutil/intmath.h" +#include "libavutil/opt.h" + +#include "avcodec.h" +#include "bytestream.h" +#include "get_bits.h" +#include "unary.h" +#include "internal.h" +#include "thread.h" + +#define NB_LEVELS 4 + +#def
[FFmpeg-cvslog] avutil/tests: Improved code coverage for random_seed
ffmpeg | branch: master | Thomas Turner | Thu Dec 22 16:12:36 2016 -0800| [8dcb28cf6dd1c68810e7aa857bb6f2a778bef4de] | committer: Michael Niedermayer avutil/tests: Improved code coverage for random_seed Signed-off-by: Thomas Turner Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8dcb28cf6dd1c68810e7aa857bb6f2a778bef4de --- libavutil/tests/random_seed.c | 34 +- tests/ref/fate/random_seed| 1 + 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/libavutil/tests/random_seed.c b/libavutil/tests/random_seed.c index ebe9b3e..f45e198 100644 --- a/libavutil/tests/random_seed.c +++ b/libavutil/tests/random_seed.c @@ -23,24 +23,32 @@ #undef printf #define N 256 +#define F 2 #include +typedef uint32_t (*random_seed_ptr_t)(void); + int main(void) { -int i, j, retry; +int i, j, rsf, retry; uint32_t seeds[N]; +random_seed_ptr_t random_seed[F] = {av_get_random_seed, get_generic_seed}; -for (retry=0; retry<3; retry++){ -for (i=0; ihttp://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/af_amerge: detect EOF immediately
ffmpeg | branch: master | Nicolas George | Thu Dec 22 12:04:12 2016 +0100| [8156b5ac94368e5d4ddc66675ededf9b5dd507ab] | committer: Marton Balint avfilter/af_amerge: detect EOF immediately Fix an infinite loop in forward_status_change(). Signed-off-by: Nicolas George Signed-off-by: Marton Balint > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8156b5ac94368e5d4ddc66675ededf9b5dd507ab --- libavfilter/af_amerge.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c index 4a8c6d5..40bf7ab 100644 --- a/libavfilter/af_amerge.c +++ b/libavfilter/af_amerge.c @@ -23,6 +23,9 @@ * Audio merging filter */ +#define FF_INTERNAL_FIELDS 1 +#include "framequeue.h" + #include "libavutil/avstring.h" #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" @@ -182,7 +185,9 @@ static int request_frame(AVFilterLink *outlink) int i, ret; for (i = 0; i < s->nb_inputs; i++) -if (!s->in[i].nb_samples) +if (!s->in[i].nb_samples || +/* detect EOF immediately */ +(ctx->inputs[i]->status_in && !ctx->inputs[i]->status_out)) if ((ret = ff_request_frame(ctx->inputs[i])) < 0) return ret; return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog