[FFmpeg-cvslog] avfilter: add loop filters
ffmpeg | branch: master | Paul B Mahol | Thu Feb 11 22:05:54 2016 +0100| [08acab85d3421d4bd4cd278447b9ff578c8a2ac4] | committer: Paul B Mahol avfilter: add loop filters Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=08acab85d3421d4bd4cd278447b9ff578c8a2ac4 --- Changelog|1 + doc/APIchanges |3 + doc/filters.texi | 19 +++ libavfilter/Makefile |2 + libavfilter/allfilters.c |2 + libavfilter/f_loop.c | 381 ++ libavfilter/version.h|2 +- libavutil/audio_fifo.c | 24 +++ libavutil/audio_fifo.h | 17 +++ 9 files changed, 450 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 20dadcf..b59db92 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,7 @@ releases are sorted from youngest to oldest. version : - DXVA2-accelerated HEVC Main10 decoding - fieldhint filter +- loop video filter and aloop audio filter version 3.0: diff --git a/doc/APIchanges b/doc/APIchanges index fe6fff5..1194709 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2015-08-28 API changes, most recent first: +2016-xx-xx - lavu 55.18.100 + xxx audio_fifo.h - Add av_audio_fifo_peek_at(). + 2016-xx-xx - lavu 55.18.0 xxx buffer.h - Add av_buffer_pool_init2(). xxx hwcontext.h - Add a new installed header hwcontext.h with a new API diff --git a/doc/filters.texi b/doc/filters.texi index f30b926..d5ff21c 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -8185,6 +8185,25 @@ The formula that generates the correction is: where @var{r_0} is halve of the image diagonal and @var{r_src} and @var{r_tgt} are the distances from the focal point in the source and target images, respectively. +@section loop, aloop + +Loop video frames or audio samples. + +Those filters accepts the following options: + +@table @option +@item loop +Set the number of loops. + +@item size +Set maximal size in number of frames for @code{loop} filter or maximal number +of samples in case of @code{aloop} filter. + +@item start +Set first frame of loop for @code{loop} filter or first sample of loop in case +of @code{aloop} filter. +@end table + @anchor{lut3d} @section lut3d diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 9120ecc..082ec49 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -38,6 +38,7 @@ OBJS-$(CONFIG_AGATE_FILTER) += af_agate.o OBJS-$(CONFIG_AINTERLEAVE_FILTER)+= f_interleave.o OBJS-$(CONFIG_ALIMITER_FILTER) += af_alimiter.o OBJS-$(CONFIG_ALLPASS_FILTER)+= af_biquads.o +OBJS-$(CONFIG_ALOOP_FILTER) += f_loop.o OBJS-$(CONFIG_AMERGE_FILTER) += af_amerge.o OBJS-$(CONFIG_AMETADATA_FILTER) += f_metadata.o OBJS-$(CONFIG_AMIX_FILTER) += af_amix.o @@ -181,6 +182,7 @@ OBJS-$(CONFIG_INTERLACE_FILTER) += vf_interlace.o OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o +OBJS-$(CONFIG_LOOP_FILTER) += f_loop.o OBJS-$(CONFIG_LUT3D_FILTER) += vf_lut3d.o OBJS-$(CONFIG_LUT_FILTER)+= vf_lut.o OBJS-$(CONFIG_LUTRGB_FILTER) += vf_lut.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 0fe72d6..4bce2af 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -58,6 +58,7 @@ void avfilter_register_all(void) REGISTER_FILTER(AINTERLEAVE,ainterleave,af); REGISTER_FILTER(ALIMITER, alimiter, af); REGISTER_FILTER(ALLPASS,allpass,af); +REGISTER_FILTER(ALOOP, aloop, af); REGISTER_FILTER(AMERGE, amerge, af); REGISTER_FILTER(AMETADATA, ametadata, af); REGISTER_FILTER(AMIX, amix, af); @@ -202,6 +203,7 @@ void avfilter_register_all(void) REGISTER_FILTER(INTERLEAVE, interleave, vf); REGISTER_FILTER(KERNDEINT, kerndeint, vf); REGISTER_FILTER(LENSCORRECTION, lenscorrection, vf); +REGISTER_FILTER(LOOP, loop, vf); REGISTER_FILTER(LUT3D, lut3d, vf); REGISTER_FILTER(LUT,lut,vf); REGISTER_FILTER(LUTRGB, lutrgb, vf); diff --git a/libavfilter/f_loop.c b/libavfilter/f_loop.c new file mode 100644 index 000..d8eb692 --- /dev/null +++ b/libavfilter/f_loop.c @@ -0,0 +1,381 @@ +/* + * 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 y
[FFmpeg-cvslog] avfilter: add BobWeaver deinterlacing filter
ffmpeg | branch: master | Thomas Mundt | Mon Feb 8 01:00:42 2016 +0100| [da94d619f6419aa5feca2cd1eac868a5711d47eb] | committer: Paul B Mahol avfilter: add BobWeaver deinterlacing filter > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da94d619f6419aa5feca2cd1eac868a5711d47eb --- Changelog|1 + doc/filters.texi | 53 libavfilter/Makefile |1 + libavfilter/allfilters.c |1 + libavfilter/version.h|2 +- libavfilter/vf_bwdif.c | 625 ++ 6 files changed, 682 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index b59db92..7d672fb 100644 --- a/Changelog +++ b/Changelog @@ -5,6 +5,7 @@ version : - DXVA2-accelerated HEVC Main10 decoding - fieldhint filter - loop video filter and aloop audio filter +- Bob Weaver deinterlacing filter version 3.0: diff --git a/doc/filters.texi b/doc/filters.texi index d5ff21c..c533ef7 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -4256,6 +4256,59 @@ tblend=all_mode=difference128 @end example @end itemize +@section bwdif + +Deinterlace the input video ("bwdif" stands for "Bob Weaver +Deinterlacing Filter"). + +Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic +interpolation algorithms. +It accepts the following parameters: + +@table @option +@item mode +The interlacing mode to adopt. It accepts one of the following values: + +@table @option +@item 0, send_frame +Output one frame for each frame. +@item 1, send_field +Output one frame for each field. +@end table + +The default value is @code{send_field}. + +@item parity +The picture field parity assumed for the input interlaced video. It accepts one +of the following values: + +@table @option +@item 0, tff +Assume the top field is first. +@item 1, bff +Assume the bottom field is first. +@item -1, auto +Enable automatic detection of field parity. +@end table + +The default value is @code{auto}. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. + +@item deint +Specify which frames to deinterlace. Accept one of the following +values: + +@table @option +@item 0, all +Deinterlace all frames. +@item 1, interlaced +Only deinterlace frames marked as interlaced. +@end table + +The default value is @code{all}. +@end table + @section boxblur Apply a boxblur algorithm to the input video. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 082ec49..10c2e0b 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -119,6 +119,7 @@ OBJS-$(CONFIG_BLACKDETECT_FILTER)+= vf_blackdetect.o OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o OBJS-$(CONFIG_BLEND_FILTER) += vf_blend.o dualinput.o framesync.o OBJS-$(CONFIG_BOXBLUR_FILTER)+= vf_boxblur.o +OBJS-$(CONFIG_BWDIF_FILTER) += vf_bwdif.o OBJS-$(CONFIG_CHROMAKEY_FILTER) += vf_chromakey.o OBJS-$(CONFIG_CODECVIEW_FILTER) += vf_codecview.o OBJS-$(CONFIG_COLORBALANCE_FILTER) += vf_colorbalance.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 4bce2af..ed52649 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -140,6 +140,7 @@ void avfilter_register_all(void) REGISTER_FILTER(BLACKFRAME, blackframe, vf); REGISTER_FILTER(BLEND, blend, vf); REGISTER_FILTER(BOXBLUR,boxblur,vf); +REGISTER_FILTER(BWDIF, bwdif, vf); REGISTER_FILTER(CHROMAKEY, chromakey, vf); REGISTER_FILTER(CODECVIEW, codecview, vf); REGISTER_FILTER(COLORBALANCE, colorbalance, vf); diff --git a/libavfilter/version.h b/libavfilter/version.h index 7dc1033..4a462e7 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -30,7 +30,7 @@ #include "libavutil/version.h" #define LIBAVFILTER_VERSION_MAJOR 6 -#define LIBAVFILTER_VERSION_MINOR 33 +#define LIBAVFILTER_VERSION_MINOR 34 #define LIBAVFILTER_VERSION_MICRO 100 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c new file mode 100644 index 000..7985054 --- /dev/null +++ b/libavfilter/vf_bwdif.c @@ -0,0 +1,625 @@ +/* + * BobWeaver Deinterlacing Filter + * Copyright (C) 2016 Thomas Mundt + * + * Based on YADIF (Yet Another Deinterlacing Filter) + * Copyright (C) 2006-2011 Michael Niedermayer + * 2010 James Darnley + * + * With use of Weston 3 Field Deinterlacing Filter algorithm + * Copyright (C) 2012 British Broadcasting Corporation, All Rights Reserved + * Author of de-interlace algorithm: Jim Easterbrook for BBC R&D + * Based on the process described by Martin Weston for BBC R&D + * + * 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 Genera
[FFmpeg-cvslog] avformat/avienc: Split avi_write_packet_internal() out
ffmpeg | branch: master | Michael Niedermayer | Wed Feb 17 13:37:13 2016 +0100| [07c7e71d20f7601e791ebe331afe5dcb55fcc118] | committer: Michael Niedermayer avformat/avienc: Split avi_write_packet_internal() out Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=07c7e71d20f7601e791ebe331afe5dcb55fcc118 --- libavformat/avienc.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 649961d..2d3d51f 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -79,7 +79,7 @@ typedef struct AVIStream { AVIIndex indexes; } AVIStream; -static int avi_write_packet(AVFormatContext *s, AVPacket *pkt); +static int avi_write_packet_internal(AVFormatContext *s, AVPacket *pkt); static inline AVIIentry *avi_get_ientry(const AVIIndex *idx, int ent_id) { @@ -637,7 +637,7 @@ static int write_skip_frames(AVFormatContext *s, int stream_index, int64_t dts) empty_packet.size = 0; empty_packet.data = NULL; empty_packet.stream_index = stream_index; -avi_write_packet(s, &empty_packet); +avi_write_packet_internal(s, &empty_packet); ff_dlog(s, "dup dts:%s packet_count:%d\n", av_ts2str(dts), avist->packet_count); } @@ -646,13 +646,7 @@ static int write_skip_frames(AVFormatContext *s, int stream_index, int64_t dts) static int avi_write_packet(AVFormatContext *s, AVPacket *pkt) { -unsigned char tag[5]; -unsigned int flags = 0; const int stream_index = pkt->stream_index; -int size = pkt->size; -AVIContext *avi = s->priv_data; -AVIOContext *pb = s->pb; -AVIStream *avist= s->streams[stream_index]->priv_data; AVCodecContext *enc = s->streams[stream_index]->codec; int ret; @@ -665,6 +659,21 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt) if ((ret = write_skip_frames(s, stream_index, pkt->dts)) < 0) return ret; +return avi_write_packet_internal(s, pkt); +} + +static int avi_write_packet_internal(AVFormatContext *s, AVPacket *pkt) +{ +unsigned char tag[5]; +unsigned int flags = 0; +const int stream_index = pkt->stream_index; +int size = pkt->size; +AVIContext *avi = s->priv_data; +AVIOContext *pb = s->pb; +AVIStream *avist= s->streams[stream_index]->priv_data; +AVCodecContext *enc = s->streams[stream_index]->codec; +int ret; + if (pkt->dts != AV_NOPTS_VALUE) avist->last_dts = pkt->dts + pkt->duration; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat: add ff_reshuffle_raw_rgb()
ffmpeg | branch: master | Michael Niedermayer | Wed Feb 17 14:02:19 2016 +0100| [090b673aba211a263802d0bcd78f26129e2cffa4] | committer: Michael Niedermayer avformat: add ff_reshuffle_raw_rgb() Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=090b673aba211a263802d0bcd78f26129e2cffa4 --- libavformat/internal.h |8 ++ libavformat/rawutils.c | 66 2 files changed, 74 insertions(+) diff --git a/libavformat/internal.h b/libavformat/internal.h index fee823d..93be632 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -560,4 +560,12 @@ void ff_format_io_close(AVFormatContext *s, AVIOContext **pb); */ int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds); +/** + * Reshuffles the lines to use the user specified stride. + * + * @param ppkt input and output packet + * @return negative error code or 0 or 1, 1 indicates that ppkt needs to be freed + */ +int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecContext *enc, int expected_stride); + #endif /* AVFORMAT_INTERNAL_H */ diff --git a/libavformat/rawutils.c b/libavformat/rawutils.c new file mode 100644 index 000..1e6148d --- /dev/null +++ b/libavformat/rawutils.c @@ -0,0 +1,66 @@ +/* + * Raw video utils + * Copyright (c) 2016 Michael Niedermayer + * + * 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 "avformat.h" +#include "internal.h" + +int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecContext *enc, int expected_stride) +{ +int ret; +AVPacket *pkt = *ppkt; +int64_t bpc = enc->bits_per_coded_sample != 15 ? enc->bits_per_coded_sample : 16; +int min_stride = (enc->width * bpc + 7) >> 3; +int with_pal_size = min_stride * enc->height + 1024; +int size = bpc == 8 && pkt->size == with_pal_size ? min_stride * enc->height : pkt->size; +int stride = size / enc->height; +int padding = expected_stride - FFMIN(expected_stride, stride); +int y; +AVPacket *new_pkt; + +if (pkt->size == expected_stride * enc->height) +return 0; +if (size != stride * enc->height) +return 0; + +new_pkt = av_packet_alloc(); +if (!new_pkt) +return AVERROR(ENOMEM); + +ret = av_new_packet(new_pkt, expected_stride * enc->height); +if (ret < 0) +goto fail; + +ret = av_packet_copy_props(new_pkt, pkt); +if (ret < 0) +goto fail; + +for (y = 0; yheight; y++) { +memcpy(new_pkt->data + y*expected_stride, pkt->data + y*stride, FFMIN(expected_stride, stride)); +memset(new_pkt->data + y*expected_stride + expected_stride - padding, 0, padding); +} + +*ppkt = new_pkt; +return 1; +fail: +av_packet_free(&new_pkt); + +return ret; +} ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Revert 4 commits to configure which broke dependency handling
ffmpeg | branch: master | Michael Niedermayer | Wed Feb 17 23:34:54 2016 +0100| [8fdee3ee8fb50877c526b79f78a754b70bf7c426] | committer: Michael Niedermayer Revert 4 commits to configure which broke dependency handling Revert "configure: Don't enable examples when --disable-everything is used" reverted as the problematic commit will be reverted too This reverts commit 02dfa64c088c87367c298a3f648454204656734f. Revert "Merge commit 'a2bb771a3cded8a05137c0effb34f61a2bc78e22'" This reverts commit e8ebcb0034c5d4e5df8ff407a5c28d8c53823236, reversing changes made to 3bff005be8ea213c23160ee0ac286634a80a10e1. Revert "Merge commit '21c750f240b9d0c41a258d1adee2d9f75ff378b6'" This reverts commit 470bfab470893d45328f4e6e25d60b89c9af1abe, reversing changes made to f97ee815cf25580cbb9d6bed304d9c22895f7074. Revert "Revert "configure: Revert recent changes to disable-everything"" This reverts commit f97ee815cf25580cbb9d6bed304d9c22895f7074. Reviewed-by: Hendrik Leppkes Immediate commit suggested by BBB > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8fdee3ee8fb50877c526b79f78a754b70bf7c426 --- configure | 80 - 1 file changed, 15 insertions(+), 65 deletions(-) diff --git a/configure b/configure index fb81a19..287896f 100755 --- a/configure +++ b/configure @@ -579,15 +579,8 @@ enable(){ set_all yes $* } -check_requested() { -for var; do -eval test "x\$${var#!}_requested" = "xyes" && die "${var%%_*} cannot be enabled" -done -} - disable(){ set_all no $* -check_requested $* } enable_weak(){ @@ -638,32 +631,6 @@ enable_deep_weak(){ done } -do_enable_deep_force(){ -for var; do -enabled $var && continue -eval sel="\$${var}_deps\ \$${var}_deps_any\ \$${var}_select\ \$${var}_suggest\ \$${var}_select_any" -pushvar var -enable_deep_force $sel -popvar var -done -} - -enable_deep_force(){ -do_enable_deep_force $* -for var; do -is_in $var $ALL_COMPONENTS $COMPONENT_LIST $LIBRARY_LIST && enable $var -done -} - -request(){ -disable $* # force the refresh of the dependencies -for var; do -enable ${var}_requested -done -enable_deep_force $* -enable $* -} - enabled(){ test "${1#!}" = "$1" && op='=' || op=!= eval test "x\$${1#!}" $op "xyes" @@ -723,7 +690,7 @@ do_check_deps(){ append allopts $cfg eval dep_all="\$${cfg}_deps" -eval dep_any="\$${cfg}_deps_any\ \$${cfg}_select_any" +eval dep_any="\$${cfg}_deps_any" eval dep_sel="\$${cfg}_select" eval dep_sgs="\$${cfg}_suggest" eval dep_ifa="\$${cfg}_if" @@ -2860,7 +2827,7 @@ tls_schannel_protocol_deps="schannel" tls_schannel_protocol_select="tcp_protocol" tls_securetransport_protocol_deps="securetransport" tls_securetransport_protocol_select="tcp_protocol" -tls_protocol_select_any="tls_schannel_protocol tls_securetransport_protocol tls_gnutls_protocol tls_openssl_protocol" +tls_protocol_deps_any="tls_schannel_protocol tls_securetransport_protocol tls_gnutls_protocol tls_openssl_protocol" udp_protocol_select="network" udplite_protocol_select="network" unix_protocol_deps="sys_un_h" @@ -3047,7 +3014,10 @@ cpu="generic" intrinsics="none" # configurable options +enable $PROGRAM_LIST enable $DOCUMENT_LIST +enable $EXAMPLE_LIST +enable $(filter_out avresample $LIBRARY_LIST) enable stripping enable asm @@ -3168,6 +3138,12 @@ ALL_COMPONENTS=" $PROTOCOL_LIST " +for n in $COMPONENT_LIST; do +v=$(toupper ${n%s})_LIST +eval enable \$$v +eval ${n}_if_any="\$$v" +done + enable $ARCH_EXT_LIST die_unknown(){ @@ -3234,11 +3210,10 @@ for opt do disable $PROGRAM_LIST ;; --disable-everything) -map 'eval disable \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST -enable_deep_force $(filter_out avresample $LIBRARY_LIST) $PROGRAM_LIST +map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST ;; --disable-all) -map 'eval disable \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST +map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST disable $LIBRARY_LIST $PROGRAM_LIST doc enable avutil ;; @@ -3255,7 +3230,6 @@ for opt do is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt" eval list=\$$(toupper $thing)_LIST name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing} -test $action = enable && action="request" list=$(filter "$name" $list) [ "$list" = "" ] && warn "Option $opt did not match anything" $action $list @@ -3263,10 +3237,9 @@ for opt do --enable-?*|--disable-?*) eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g') if is_in $option $COMPONENT_LIST; then -test $action = enable && acti
[FFmpeg-cvslog] lavf/options_table: mark use_wallclock_as_timestamps as boolean
ffmpeg | branch: master | Moritz Barsnick | Thu Feb 18 14:47:10 2016 +0100| [6eaad752c1c6d854af881f813ae5a414d4d336f1] | committer: Michael Niedermayer lavf/options_table: mark use_wallclock_as_timestamps as boolean It is only used in a boolean context. Also clarify its documentation. Signed-off-by: Moritz Barsnick Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6eaad752c1c6d854af881f813ae5a414d4d336f1 --- doc/formats.texi|2 +- libavformat/options_table.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/formats.texi b/doc/formats.texi index 617cda5..f79ebe2 100644 --- a/doc/formats.texi +++ b/doc/formats.texi @@ -147,7 +147,7 @@ a packet for each stream, regardless of the maximum timestamp difference between the buffered packets. @item use_wallclock_as_timestamps @var{integer} (@emph{input}) -Use wallclock as timestamps. +Use wallclock as timestamps if set to 1. Default is 0. @item avoid_negative_ts @var{integer} (@emph{output}) diff --git a/libavformat/options_table.h b/libavformat/options_table.h index 8926fe5..74923d8 100644 --- a/libavformat/options_table.h +++ b/libavformat/options_table.h @@ -78,7 +78,7 @@ static const AVOption avformat_options[] = { {"careful","consider things that violate the spec, are fast to check and have not been seen in the wild as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_CAREFUL }, INT_MIN, INT_MAX, D, "err_detect"}, {"compliant", "consider all spec non compliancies as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_COMPLIANT }, INT_MIN, INT_MAX, D, "err_detect"}, {"aggressive", "consider things that a sane encoder shouldn't do as an error", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_AGGRESSIVE }, INT_MIN, INT_MAX, D, "err_detect"}, -{"use_wallclock_as_timestamps", "use wallclock as timestamps", OFFSET(use_wallclock_as_timestamps), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, D}, +{"use_wallclock_as_timestamps", "use wallclock as timestamps", OFFSET(use_wallclock_as_timestamps), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, D}, {"skip_initial_bytes", "set number of bytes to skip before reading header and frames", OFFSET(skip_initial_bytes), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX-1, D}, {"correct_ts_overflow", "correct single timestamp overflows", OFFSET(correct_ts_overflow), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, D}, {"flush_packets", "enable flushing of the I/O context after each packet", OFFSET(flush_packets), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, E}, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/avienc: Use avi_write_packet_internal() to store raw rgb in a more spec compliant way
ffmpeg | branch: master | Michael Niedermayer | Wed Feb 17 13:37:41 2016 +0100| [9dd4dcde9cdeba21b4bf40fc664c1277bbe27110] | committer: Michael Niedermayer avformat/avienc: Use avi_write_packet_internal() to store raw rgb in a more spec compliant way Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9dd4dcde9cdeba21b4bf40fc664c1277bbe27110 --- libavformat/Makefile |2 +- libavformat/avienc.c | 14 ++ libavformat/version.h |2 +- tests/ref/vsynth/vsynth3-bpp1 |4 ++-- tests/ref/vsynth/vsynth3-rgb |4 ++-- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index 35a383d..001b3f1 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -98,7 +98,7 @@ OBJS-$(CONFIG_AST_MUXER) += ast.o astenc.o OBJS-$(CONFIG_AU_DEMUXER)+= au.o pcm.o OBJS-$(CONFIG_AU_MUXER) += au.o rawenc.o OBJS-$(CONFIG_AVI_DEMUXER) += avidec.o isom.o -OBJS-$(CONFIG_AVI_MUXER) += avienc.o mpegtsenc.o avlanguage.o +OBJS-$(CONFIG_AVI_MUXER) += avienc.o mpegtsenc.o avlanguage.o rawutils.o OBJS-$(CONFIG_AVISYNTH) += avisynth.o OBJS-$(CONFIG_AVM2_MUXER)+= swfenc.o swf.o OBJS-$(CONFIG_AVR_DEMUXER) += avr.o pcm.o diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 2d3d51f..09ec63b 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -659,6 +659,20 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt) if ((ret = write_skip_frames(s, stream_index, pkt->dts)) < 0) return ret; +if (enc->codec_id == AV_CODEC_ID_RAWVIDEO && enc->codec_tag == 0) { +int64_t bpc = enc->bits_per_coded_sample != 15 ? enc->bits_per_coded_sample : 16; +int expected_stride = ((enc->width * bpc + 31) >> 5)*4; + +ret = ff_reshuffle_raw_rgb(s, &pkt, enc, expected_stride); +if (ret < 0) +return ret; +if (ret) { +ret = avi_write_packet_internal(s, pkt); +av_packet_free(&pkt); +return ret; +} +} + return avi_write_packet_internal(s, pkt); } diff --git a/libavformat/version.h b/libavformat/version.h index 024ab91..62050a2 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,7 +31,7 @@ #define LIBAVFORMAT_VERSION_MAJOR 57 #define LIBAVFORMAT_VERSION_MINOR 25 -#define LIBAVFORMAT_VERSION_MICRO 100 +#define LIBAVFORMAT_VERSION_MICRO 101 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ diff --git a/tests/ref/vsynth/vsynth3-bpp1 b/tests/ref/vsynth/vsynth3-bpp1 index 5a65728..39f27f3 100644 --- a/tests/ref/vsynth/vsynth3-bpp1 +++ b/tests/ref/vsynth/vsynth3-bpp1 @@ -1,4 +1,4 @@ -98852649c5201df7d85d0e9b5a5b9f15 *tests/data/fate/vsynth3-bpp1.avi -15352 tests/data/fate/vsynth3-bpp1.avi +d5689d1f5c2d4c28a345d5964a6161a8 *tests/data/fate/vsynth3-bpp1.avi +20452 tests/data/fate/vsynth3-bpp1.avi 0b1ea21b69d384564dd3a978065443b2 *tests/data/fate/vsynth3-bpp1.out.rawvideo stddev: 97.64 PSNR: 8.34 MAXDIFF: 248 bytes:86700/86700 diff --git a/tests/ref/vsynth/vsynth3-rgb b/tests/ref/vsynth/vsynth3-rgb index c0a8563..f67d285 100644 --- a/tests/ref/vsynth/vsynth3-rgb +++ b/tests/ref/vsynth/vsynth3-rgb @@ -1,4 +1,4 @@ -a2cb86007b8945e2d1399b56585b983a *tests/data/fate/vsynth3-rgb.avi -180252 tests/data/fate/vsynth3-rgb.avi +000bd5f3251bfd6a2a2b590b2d16fe0b *tests/data/fate/vsynth3-rgb.avi +183652 tests/data/fate/vsynth3-rgb.avi 693aff10c094f8bd31693f74cf79d2b2 *tests/data/fate/vsynth3-rgb.out.rawvideo stddev:3.67 PSNR: 36.82 MAXDIFF: 43 bytes:86700/86700 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264: Execute error concealment before marking the frame as done.
ffmpeg | branch: master | Michael Niedermayer | Fri Feb 19 01:31:16 2016 +0100| [98a0053d0f90e3309dc1038b1bae3a48bbd9067c] | committer: Michael Niedermayer avcodec/h264: Execute error concealment before marking the frame as done. Fixes race condition causing artifacts Fixes Ticket4122 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98a0053d0f90e3309dc1038b1bae3a48bbd9067c --- libavcodec/h264.c | 41 + libavcodec/h264_picture.c | 41 - 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index fe8d44e..f1399b8 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1678,6 +1678,47 @@ again: ret = 0; end: + +#if CONFIG_ERROR_RESILIENCE +sl = h->slice_ctx; +/* + * FIXME: Error handling code does not seem to support interlaced + * when slices span multiple rows + * The ff_er_add_slice calls don't work right for bottom + * fields; they cause massive erroneous error concealing + * Error marking covers both fields (top and bottom). + * This causes a mismatched s->error_count + * and a bad error table. Further, the error count goes to + * INT_MAX when called for bottom field, because mb_y is + * past end by one (callers fault) and resync_mb_y != 0 + * causes problems for the first MB line, too. + */ +if (!FIELD_PICTURE(h) && h->current_slice && !h->sps.new && h->enable_er) { +int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0]; + +ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr); + +if (use_last_pic) { +ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec); +sl->ref_list[0][0].parent = &h->last_pic_for_ec; +memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data)); +memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize)); +sl->ref_list[0][0].reference = h->last_pic_for_ec.reference; +} else if (sl->ref_count[0]) { +ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent); +} else +ff_h264_set_erpic(&sl->er.last_pic, NULL); + +if (sl->ref_count[1]) +ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent); + +sl->er.ref_count = sl->ref_count[0]; + +ff_er_frame_end(&sl->er); +if (use_last_pic) +memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0])); +} +#endif /* CONFIG_ERROR_RESILIENCE */ /* clean up */ if (h->cur_pic_ptr && !h->droppable) { ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c index 731d780..c4b17c0 100644 --- a/libavcodec/h264_picture.c +++ b/libavcodec/h264_picture.c @@ -186,47 +186,6 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup) ff_vdpau_h264_picture_complete(h); #endif -#if CONFIG_ERROR_RESILIENCE -av_assert0(sl == h->slice_ctx); -/* - * FIXME: Error handling code does not seem to support interlaced - * when slices span multiple rows - * The ff_er_add_slice calls don't work right for bottom - * fields; they cause massive erroneous error concealing - * Error marking covers both fields (top and bottom). - * This causes a mismatched s->error_count - * and a bad error table. Further, the error count goes to - * INT_MAX when called for bottom field, because mb_y is - * past end by one (callers fault) and resync_mb_y != 0 - * causes problems for the first MB line, too. - */ -if (!FIELD_PICTURE(h) && h->current_slice && !h->sps.new && h->enable_er) { -int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0]; - -ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr); - -if (use_last_pic) { -ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec); -sl->ref_list[0][0].parent = &h->last_pic_for_ec; -memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data)); -memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize)); -sl->ref_list[0][0].reference = h->last_pic_for_ec.reference; -} else if (sl->ref_count[0]) { -ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent); -} else -ff_h264_set_erpic(&sl->er.last_pic, NULL); - -if (sl->ref_count[1]) -ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent); - -sl->er.ref_count = sl->ref_count[0]; - -ff_er_frame_end(&sl->er); -if (use_last_pic) -memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0])); -} -#endif /* CONFIG_ERROR_R