[FFmpeg-cvslog] avfilter/avf_ahistogram: fix off by one in slide mode
ffmpeg | branch: master | Paul B Mahol | Sat Mar 19 10:50:56 2022 +0100| [7ae2ded0d12bb36a82ee928c3a543a00aee4b466] | committer: Paul B Mahol avfilter/avf_ahistogram: fix off by one in slide mode > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ae2ded0d12bb36a82ee928c3a543a00aee4b466 --- libavfilter/avf_ahistogram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/avf_ahistogram.c b/libavfilter/avf_ahistogram.c index 71b0cdf04c..ebd4949b3d 100644 --- a/libavfilter/avf_ahistogram.c +++ b/libavfilter/avf_ahistogram.c @@ -400,7 +400,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) if (s->slide == SCROLL) { for (p = 0; p < 4; p++) { -for (y = s->h; y >= H + 1; y--) { +for (y = s->h - 1; y >= H + 1; y--) { memmove(s->out->data[p] + (y ) * s->out->linesize[p], s->out->data[p] + (y-1) * s->out->linesize[p], w); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/af_afftdn: remove unused or set only variables
ffmpeg | branch: master | Paul B Mahol | Fri Mar 18 11:29:12 2022 +0100| [f8dc89b34d2ccdb59747178475ea6910a11515c4] | committer: Paul B Mahol avfilter/af_afftdn: remove unused or set only variables > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8dc89b34d2ccdb59747178475ea6910a11515c4 --- libavfilter/af_afftdn.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c index c66545ac2e..253526e532 100644 --- a/libavfilter/af_afftdn.c +++ b/libavfilter/af_afftdn.c @@ -117,12 +117,6 @@ typedef struct AudioFFTDeNoiseContext { float band_multiplier; float floor_offset; -float last_residual_floor; -float last_noise_floor; -float last_noise_reduction; -float last_noise_balance; -int64_t block_count; - int channels; int sample_noise; int sample_noise_blocks; @@ -1068,7 +1062,6 @@ static int output_frame(AVFilterLink *inlink, AVFrame *in) s->sample_noise_mode = SAMPLE_NONE; } -s->block_count++; ff_filter_execute(ctx, filter_channel, s->winframe, NULL, FFMIN(outlink->ch_layout.nb_channels, ff_filter_get_nb_threads(ctx))); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/imf: add support for input seeking
ffmpeg | branch: master | Pierre-Anthony Lemieux | Fri Mar 11 09:16:48 2022 -0800| [32b9f5ac2f5df1cac364e31ac746cacb1a771ab5] | committer: Zane van Iperen avformat/imf: add support for input seeking The IMF demuxer did not implement AVInputFormat::read_seek2(), resulting in inefficient input seeking. Addresses https://trac.ffmpeg.org/ticket/9648 Byte- and frame-seeking are not supported. Signed-off-by: Zane van Iperen > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=32b9f5ac2f5df1cac364e31ac746cacb1a771ab5 --- libavformat/imfdec.c | 129 --- 1 file changed, 102 insertions(+), 27 deletions(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index e2a699dde7..b151d1a12d 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -359,13 +359,15 @@ static IMFAssetLocator *find_asset_map_locator(IMFAssetLocatorMap *asset_map, FF } static int open_track_resource_context(AVFormatContext *s, - IMFVirtualTrackResourcePlaybackCtx *track_resource) + IMFVirtualTrackPlaybackCtx *track, + int32_t resource_index) { IMFContext *c = s->priv_data; int ret = 0; -int64_t entry_point; +int64_t seek_offset = 0; AVDictionary *opts = NULL; AVStream *st; +IMFVirtualTrackResourcePlaybackCtx *track_resource = track->resources + resource_index; if (track_resource->ctx) { av_log(s, @@ -416,32 +418,27 @@ static int open_track_resource_context(AVFormatContext *s, st = track_resource->ctx->streams[0]; -/* Warn if the resource time base does not match the file time base */ -if (av_cmp_q(st->time_base, av_inv_q(track_resource->resource->base.edit_rate))) -av_log(s, - AV_LOG_WARNING, - "Incoherent source stream timebase " AVRATIONAL_FORMAT - "regarding resource edit rate: " AVRATIONAL_FORMAT, - st->time_base.num, - st->time_base.den, - track_resource->resource->base.edit_rate.den, - track_resource->resource->base.edit_rate.num); - -entry_point = av_rescale_q(track_resource->resource->base.entry_point, st->time_base, - av_inv_q(track_resource->resource->base.edit_rate)); - -if (entry_point) { -av_log(s, - AV_LOG_DEBUG, - "Seek at resource %s entry point: %" PRIu32 "\n", - track_resource->locator->absolute_uri, - track_resource->resource->base.entry_point); -ret = avformat_seek_file(track_resource->ctx, 0, entry_point, entry_point, entry_point, 0); +/* Determine the seek offset into the Track File, taking into account: + * - the current timestamp within the virtual track + * - the entry point of the resource + */ +if (imf_time_to_ts(&seek_offset, + av_sub_q(track->current_timestamp, track_resource->ts_offset), + st->time_base)) +av_log(s, AV_LOG_WARNING, "Incoherent stream timebase " AVRATIONAL_FORMAT + "and composition timeline position: " AVRATIONAL_FORMAT "\n", + st->time_base.num, st->time_base.den, + track->current_timestamp.den, track->current_timestamp.num); + +if (seek_offset) { +av_log(s, AV_LOG_DEBUG, "Seek at resource %s entry point: %" PRIi64 "\n", + track_resource->locator->absolute_uri, seek_offset); +ret = avformat_seek_file(track_resource->ctx, 0, seek_offset, seek_offset, seek_offset, 0); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Could not seek at %" PRId64 "on %s: %s\n", - entry_point, + seek_offset, track_resource->locator->absolute_uri, av_err2str(ret)); avformat_close_input(&track_resource->ctx); @@ -584,7 +581,7 @@ static int set_context_streams_from_tracks(AVFormatContext *s) AVStream *first_resource_stream; /* Open the first resource of the track to get stream information */ -ret = open_track_resource_context(s, &c->tracks[i]->resources[0]); +ret = open_track_resource_context(s, c->tracks[i], 0); if (ret) return ret; first_resource_stream = c->tracks[i]->resources[0].ctx->streams[0]; @@ -774,7 +771,7 @@ static int get_resource_context_for_timestamp(AVFormatContext *s, IMFVirtualTrac "Switch resource on track %d: re-open context\n", track->index); -ret = open_track_resource_context(s, track->resources + i); +ret = open_track_resource_context(s, track, i); if (ret != 0) return ret; if (track->current_resource_index > 0) @@ -942,6 +939,83 @@
[FFmpeg-cvslog] avformat/imf: relocate static function imf_time_to_ts()
ffmpeg | branch: master | Pierre-Anthony Lemieux | Fri Mar 11 09:16:47 2022 -0800| [9ca4d80d6b85ed1e8922c6977ff1f26ce7f19ea1] | committer: Zane van Iperen avformat/imf: relocate static function imf_time_to_ts() Signed-off-by: Zane van Iperen > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9ca4d80d6b85ed1e8922c6977ff1f26ce7f19ea1 --- libavformat/imfdec.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 9ec52efbc8..e2a699dde7 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -154,6 +154,25 @@ static int imf_uri_is_dos_abs_path(const char *string) return 0; } +static int imf_time_to_ts(int64_t *ts, AVRational t, AVRational time_base) +{ +int dst_num; +int dst_den; +AVRational r; + +r = av_div_q(t, time_base); + +if ((av_reduce(&dst_num, &dst_den, r.num, r.den, INT64_MAX) != 1)) +return 1; + +if (dst_den != 1) +return 1; + +*ts = dst_num; + +return 0; +} + /** * Parse a ASSETMAP XML file to extract the UUID-URI mapping of assets. * @param s the current format context, if any (can be NULL). @@ -772,25 +791,6 @@ static int get_resource_context_for_timestamp(AVFormatContext *s, IMFVirtualTrac return AVERROR_STREAM_NOT_FOUND; } -static int imf_time_to_ts(int64_t *ts, AVRational t, AVRational time_base) -{ -int dst_num; -int dst_den; -AVRational r; - -r = av_div_q(t, time_base); - -if ((av_reduce(&dst_num, &dst_den, r.num, r.den, INT64_MAX) != 1)) -return 1; - -if (dst_den != 1) -return 1; - -*ts = dst_num; - -return 0; -} - static int imf_read_packet(AVFormatContext *s, AVPacket *pkt) { IMFVirtualTrackResourcePlaybackCtx *resource = NULL; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/seek: add ff_rescale_interval() function
ffmpeg | branch: master | Pierre-Anthony Lemieux | Fri Mar 11 09:16:50 2022 -0800| [b172c0f8c59c1d2921d6d1348ea2a5ae45b2288b] | committer: Zane van Iperen avformat/seek: add ff_rescale_interval() function Refactors a function used by avformat/concat and avformat/imf. Signed-off-by: Zane van Iperen > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b172c0f8c59c1d2921d6d1348ea2a5ae45b2288b --- libavformat/internal.h | 20 libavformat/seek.c | 10 ++ 2 files changed, 30 insertions(+) diff --git a/libavformat/internal.h b/libavformat/internal.h index f24c68703f..342e6f7327 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -1023,4 +1023,24 @@ void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputForm */ int ff_format_shift_data(AVFormatContext *s, int64_t read_start, int shift_size); +/** + * Rescales a timestamp and the endpoints of an interval to which the temstamp + * belongs, from a timebase `tb_in` to a timebase `tb_out`. + * + * The upper (lower) bound of the output interval is rounded up (down) such that + * the output interval always falls within the intput interval. The timestamp is + * rounded to the nearest integer and halfway cases away from zero, and can + * therefore fall outside of the output interval. + * + * Useful to simplify the rescaling of the arguments of AVInputFormat::read_seek2() + * + * @param[in] tb_in Timebase of the input `min_ts`, `ts` and `max_ts` + * @param[in] tb_out Timebase of the ouput `min_ts`, `ts` and `max_ts` + * @param[in,out] min_ts Lower bound of the interval + * @param[in,out] ts Timestamp + * @param[in,out] max_ts Upper bound of the interval + */ +void ff_rescale_interval(AVRational tb_in, AVRational tb_out, + int64_t *min_ts, int64_t *ts, int64_t *max_ts); + #endif /* AVFORMAT_INTERNAL_H */ diff --git a/libavformat/seek.c b/libavformat/seek.c index 405ca316b3..890aea7f8a 100644 --- a/libavformat/seek.c +++ b/libavformat/seek.c @@ -751,3 +751,13 @@ int avformat_flush(AVFormatContext *s) ff_read_frame_flush(s); return 0; } + +void ff_rescale_interval(AVRational tb_in, AVRational tb_out, + int64_t *min_ts, int64_t *ts, int64_t *max_ts) +{ +*ts = av_rescale_q(*ts, tb_in, tb_out); +*min_ts = av_rescale_q_rnd(*min_ts, tb_in, tb_out, + AV_ROUND_UP | AV_ROUND_PASS_MINMAX); +*max_ts = av_rescale_q_rnd(*max_ts, tb_in, tb_out, + AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX); +} ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/imf: clean-up and reduce logging
ffmpeg | branch: master | Pierre-Anthony Lemieux | Fri Mar 11 09:16:49 2022 -0800| [22e1175e391dd70a2b954475a96b53e6687c332f] | committer: Zane van Iperen avformat/imf: clean-up and reduce logging Signed-off-by: Zane van Iperen > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=22e1175e391dd70a2b954475a96b53e6687c332f --- libavformat/imfdec.c | 93 1 file changed, 29 insertions(+), 64 deletions(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index b151d1a12d..7e1007e89d 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -203,11 +203,8 @@ static int parse_imf_asset_map_from_xml_dom(AVFormatContext *s, } if (asset_map_element->type != XML_ELEMENT_NODE || av_strcasecmp(asset_map_element->name, "AssetMap")) { -av_log(s, - AV_LOG_ERROR, - "Unable to parse asset map XML - wrong root node name[%s] type[%d]\n", - asset_map_element->name, - (int)asset_map_element->type); +av_log(s, AV_LOG_ERROR, "Unable to parse asset map XML - wrong root node name[%s] type[%d]\n", + asset_map_element->name, (int)asset_map_element->type); return AVERROR_INVALIDDATA; } @@ -333,11 +330,8 @@ static int parse_assetmap(AVFormatContext *s, const char *url) ret = parse_imf_asset_map_from_xml_dom(s, doc, &c->asset_locator_map, base_url); if (!ret) -av_log(s, - AV_LOG_DEBUG, - "Found %d assets from %s\n", - c->asset_locator_map.asset_count, - url); +av_log(s, AV_LOG_DEBUG, "Found %d assets from %s\n", + c->asset_locator_map.asset_count, url); xmlFreeDoc(doc); @@ -370,9 +364,7 @@ static int open_track_resource_context(AVFormatContext *s, IMFVirtualTrackResourcePlaybackCtx *track_resource = track->resources + resource_index; if (track_resource->ctx) { -av_log(s, - AV_LOG_DEBUG, - "Input context already opened for %s.\n", +av_log(s, AV_LOG_DEBUG, "Input context already opened for %s.\n", track_resource->locator->absolute_uri); return 0; } @@ -400,11 +392,8 @@ static int open_track_resource_context(AVFormatContext *s, NULL, &opts); if (ret < 0) { -av_log(s, - AV_LOG_ERROR, - "Could not open %s input context: %s\n", - track_resource->locator->absolute_uri, - av_err2str(ret)); +av_log(s, AV_LOG_ERROR, "Could not open %s input context: %s\n", + track_resource->locator->absolute_uri, av_err2str(ret)); goto cleanup; } av_dict_free(&opts); @@ -427,8 +416,7 @@ static int open_track_resource_context(AVFormatContext *s, st->time_base)) av_log(s, AV_LOG_WARNING, "Incoherent stream timebase " AVRATIONAL_FORMAT "and composition timeline position: " AVRATIONAL_FORMAT "\n", - st->time_base.num, st->time_base.den, - track->current_timestamp.den, track->current_timestamp.num); + AVRATIONAL_ARG(st->time_base), AVRATIONAL_ARG(track->current_timestamp)); if (seek_offset) { av_log(s, AV_LOG_DEBUG, "Seek at resource %s entry point: %" PRIi64 "\n", @@ -465,9 +453,7 @@ static int open_track_file_resource(AVFormatContext *s, asset_locator = find_asset_map_locator(&c->asset_locator_map, track_file_resource->track_file_uuid); if (!asset_locator) { -av_log(s, - AV_LOG_ERROR, - "Could not find asset locator for UUID: " FF_IMF_UUID_FORMAT "\n", +av_log(s, AV_LOG_ERROR, "Could not find asset locator for UUID: " FF_IMF_UUID_FORMAT "\n", UID_ARG(track_file_resource->track_file_uuid)); return AVERROR_INVALIDDATA; } @@ -618,9 +604,7 @@ static int open_cpl_tracks(AVFormatContext *s) if (c->cpl->main_image_2d_track) { if ((ret = open_virtual_track(s, c->cpl->main_image_2d_track, track_index++)) != 0) { -av_log(s, - AV_LOG_ERROR, - "Could not open image track " FF_IMF_UUID_FORMAT "\n", +av_log(s, AV_LOG_ERROR, "Could not open image track " FF_IMF_UUID_FORMAT "\n", UID_ARG(c->cpl->main_image_2d_track->base.id_uuid)); return ret; } @@ -628,9 +612,7 @@ static int open_cpl_tracks(AVFormatContext *s) for (uint32_t i = 0; i < c->cpl->main_audio_track_count; i++) { if ((ret = open_virtual_track(s, &c->cpl->main_audio_tracks[i], track_index++)) != 0) { -av_log(s, - AV_LOG_ERROR, - "Could not open audio track " FF_IMF_UUID_FORMAT "\n", +av_log(s, AV_LOG_ERROR, "Could not open audio track " FF_IMF_UUID_FORMAT "\n",
[FFmpeg-cvslog] avformat/tests: add test for ff_rescale_interval()
ffmpeg | branch: master | Pierre-Anthony Lemieux | Fri Mar 11 09:16:51 2022 -0800| [8744b103da916622b28da5a8d1962188937db3fe] | committer: Zane van Iperen avformat/tests: add test for ff_rescale_interval() Signed-off-by: Zane van Iperen > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8744b103da916622b28da5a8d1962188937db3fe --- libavformat/Makefile | 1 + libavformat/tests/.gitignore | 1 + libavformat/tests/seek_utils.c | 57 ++ tests/fate/libavformat.mak | 5 4 files changed, 64 insertions(+) diff --git a/libavformat/Makefile b/libavformat/Makefile index 27d553c20e..d7182d6bd8 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -711,6 +711,7 @@ SKIPHEADERS-$(CONFIG_NETWORK)+= network.h rtsp.h TESTPROGS = seek\ url \ +seek_utils # async \ FIFO-MUXER-TESTPROGS-$(CONFIG_NETWORK) += fifo_muxer diff --git a/libavformat/tests/.gitignore b/libavformat/tests/.gitignore index aabf76345e..cdd0cce061 100644 --- a/libavformat/tests/.gitignore +++ b/libavformat/tests/.gitignore @@ -6,3 +6,4 @@ /seek /srtp /url +/seek_utils diff --git a/libavformat/tests/seek_utils.c b/libavformat/tests/seek_utils.c new file mode 100644 index 00..cc679dca05 --- /dev/null +++ b/libavformat/tests/seek_utils.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 Pierre-Anthony Lemieux + * + * 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 "libavformat/internal.h" + +int main(void) +{ + int64_t ts_min; + int64_t ts; + int64_t ts_max; + + ts_min = 10; + ts = 20; + ts_max = 30; + + ff_rescale_interval(av_make_q(1, 1), av_make_q(10, 1), &ts_min, &ts, &ts_max); + + if (ts_min != 1 || ts != 2 || ts_max != 3) +return 1; + + ts_min = 10; + ts = 32; + ts_max = 32; + + ff_rescale_interval(av_make_q(1, 1), av_make_q(3, 1), &ts_min, &ts, &ts_max); + + if (ts_min != 4 || ts != 11 || ts_max != 10) +return 1; + + ts_min = 10; + ts = 10; + ts_max = 32; + + ff_rescale_interval(av_make_q(1, 1), av_make_q(3, 1), &ts_min, &ts, &ts_max); + + if (ts_min != 4 || ts != 3 || ts_max != 10) +return 1; + + return 0; +} diff --git a/tests/fate/libavformat.mak b/tests/fate/libavformat.mak index 59ff0ebc8d..d2acb4c9e0 100644 --- a/tests/fate/libavformat.mak +++ b/tests/fate/libavformat.mak @@ -26,6 +26,11 @@ FATE_LIBAVFORMAT-$(CONFIG_IMF_DEMUXER) += fate-imf fate-imf: libavformat/tests/imf$(EXESUF) fate-imf: CMD = run libavformat/tests/imf$(EXESUF) +FATE_LIBAVFORMAT += fate-seek_utils +fate-seek_utils: libavformat/tests/seek_utils$(EXESUF) +fate-seek_utils: CMD = run libavformat/tests/seek_utils$(EXESUF) +fate-seek_utils: CMP = null + FATE_LIBAVFORMAT += $(FATE_LIBAVFORMAT-yes) FATE-$(CONFIG_AVFORMAT) += $(FATE_LIBAVFORMAT) fate-libavformat: $(FATE_LIBAVFORMAT) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/imf: refactor to use ff_rescale_interval()
ffmpeg | branch: master | Pierre-Anthony Lemieux | Fri Mar 11 09:16:52 2022 -0800| [f409c785172fc359e4f00a8afb140873fa4dfb0e] | committer: Zane van Iperen avformat/imf: refactor to use ff_rescale_interval() Signed-off-by: Zane van Iperen > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f409c785172fc359e4f00a8afb140873fa4dfb0e --- libavformat/imfdec.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 7e1007e89d..2fe79dfbad 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -904,14 +904,6 @@ static int imf_probe(const AVProbeData *p) return AVPROBE_SCORE_MAX; } -static void rescale_interval(AVRational tb_in, AVRational tb_out, - int64_t *min_ts, int64_t *ts, int64_t *max_ts) -{ -*ts = av_rescale_q(*ts, tb_in, tb_out); -*min_ts = av_rescale_q_rnd(*min_ts, tb_in, tb_out, AV_ROUND_UP | AV_ROUND_PASS_MINMAX); -*max_ts = av_rescale_q_rnd(*max_ts, tb_in, tb_out, AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX); -} - static int coherent_ts(int64_t ts, AVRational in_tb, AVRational out_tb) { int dst_num; @@ -937,13 +929,13 @@ static int imf_seek(AVFormatContext *s, int stream_index, int64_t min_ts, /* rescale timestamps to Composition edit units */ if (stream_index < 0) -rescale_interval(AV_TIME_BASE_Q, - av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), - &min_ts, &ts, &max_ts); +ff_rescale_interval(AV_TIME_BASE_Q, +av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), +&min_ts, &ts, &max_ts); else -rescale_interval(s->streams[stream_index]->time_base, - av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), - &min_ts, &ts, &max_ts); +ff_rescale_interval(s->streams[stream_index]->time_base, +av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), +&min_ts, &ts, &max_ts); /* requested timestamp bounds are too close */ if (max_ts < min_ts) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/concat: refactor to use ff_rescale_interval()
ffmpeg | branch: master | Pierre-Anthony Lemieux | Fri Mar 11 09:16:53 2022 -0800| [2a1eae2179273b6949aeb787df8c7ae69596ef2a] | committer: Zane van Iperen avformat/concat: refactor to use ff_rescale_interval() Signed-off-by: Zane van Iperen > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a1eae2179273b6949aeb787df8c7ae69596ef2a --- libavformat/concatdec.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index 0603c6e254..cfe1329105 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -816,16 +816,6 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt) return 0; } -static void rescale_interval(AVRational tb_in, AVRational tb_out, - int64_t *min_ts, int64_t *ts, int64_t *max_ts) -{ -*ts = av_rescale_q(*ts, tb_in, tb_out); -*min_ts = av_rescale_q_rnd(*min_ts, tb_in, tb_out, - AV_ROUND_UP | AV_ROUND_PASS_MINMAX); -*max_ts = av_rescale_q_rnd(*max_ts, tb_in, tb_out, - AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX); -} - static int try_seek(AVFormatContext *avf, int stream, int64_t min_ts, int64_t ts, int64_t max_ts, int flags) { @@ -838,8 +828,8 @@ static int try_seek(AVFormatContext *avf, int stream, if (stream >= 0) { if (stream >= cat->avf->nb_streams) return AVERROR(EIO); -rescale_interval(AV_TIME_BASE_Q, cat->avf->streams[stream]->time_base, - &min_ts, &ts, &max_ts); +ff_rescale_interval(AV_TIME_BASE_Q, cat->avf->streams[stream]->time_base, +&min_ts, &ts, &max_ts); } return avformat_seek_file(cat->avf, stream, min_ts, ts, max_ts, flags); } @@ -853,8 +843,8 @@ static int real_seek(AVFormatContext *avf, int stream, if (stream >= 0) { if (stream >= avf->nb_streams) return AVERROR(EINVAL); -rescale_interval(avf->streams[stream]->time_base, AV_TIME_BASE_Q, - &min_ts, &ts, &max_ts); +ff_rescale_interval(avf->streams[stream]->time_base, AV_TIME_BASE_Q, +&min_ts, &ts, &max_ts); } left = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] doc/APIchanges: update for the new channel layout API
ffmpeg | branch: master | Anton Khirnov | Tue Mar 15 15:54:16 2022 +0100| [6ccc3989d15ed1ea8f25f3bef062183c5036eb43] | committer: Anton Khirnov doc/APIchanges: update for the new channel layout API > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6ccc3989d15ed1ea8f25f3bef062183c5036eb43 --- doc/APIchanges | 37 + 1 file changed, 37 insertions(+) diff --git a/doc/APIchanges b/doc/APIchanges index 41662da84f..1a9f0a303e 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -19,6 +19,43 @@ API changes, most recent first: contain the major version number (and corresponding API deprecation defines). +2022-03-15 - cdba98bb80 - swr 4.5.100 - swresample.h + Add swr_alloc_set_opts2() and swr_build_matrix2(). + Deprecate swr_alloc_set_opts() and swr_build_matrix(). + +2022-03-15 - cdba98bb80 - lavfi 8.28.100 - avfilter.h buffersink.h buffersrc.h + Update AVFilterLink for the new channel layout API: add ch_layout, + deprecate channel_layout. + + Update the buffersink filter sink for the new channel layout API: + add av_buffersink_get_ch_layout() and the ch_layouts option, + deprecate av_buffersink_get_channel_layout() and the channel_layouts option. + + Update AVBufferSrcParameters for the new channel layout API: + add ch_layout, deprecate channel_layout. + +2022-03-15 - cdba98bb80 - lavf 59.19.100 - avformat.h + Add AV_DISPOSITION_NON_DIEGETIC. + +2022-03-15 - cdba98bb80 - lavc 59.24.100 - avcodec.h codec_par.h + Update AVCodecParameters for the new channel layout API: add ch_layout, + deprecate channels/channel_layout. + + Update AVCodecContext for the new channel layout API: add ch_layout, + deprecate channels/channel_layout. + + Update AVCodec for the new channel layout API: add ch_layouts, + deprecate channel_layouts. + +2022-03-15 - cdba98bb80 - lavu 57.24.100 - channel_layout.h frame.h opt.h + Add new channel layout API based on the AVChannelLayout struct. + Add support for Ambisonic audio. + Deprecate previous channel layout API based on uint64 bitmasks. + + Add AV_OPT_TYPE_CHLAYOUT option type, deprecate AV_OPT_TYPE_CHANNEL_LAYOUT. + Update AVFrame for the new channel layout API: add ch_layout, deprecate + channels/channel_layout. + 2022-03-10 - xx - lavu 57.23.100 - cpu.h Add AV_CPU_FLAG_AVX512ICL. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc/bsf: improve doxy
ffmpeg | branch: master | Anton Khirnov | Tue Feb 22 07:20:51 2022 +0100| [a24e6ca8bf3f9b6c8ecf17eacc0ead17d7b5795b] | committer: Anton Khirnov lavc/bsf: improve doxy > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a24e6ca8bf3f9b6c8ecf17eacc0ead17d7b5795b --- libavcodec/bsf.h | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/libavcodec/bsf.h b/libavcodec/bsf.h index ba8b48f222..611beab885 100644 --- a/libavcodec/bsf.h +++ b/libavcodec/bsf.h @@ -167,9 +167,9 @@ const AVBitStreamFilter *av_bsf_iterate(void **opaque); * av_bsf_init() before sending any data to the filter. * * @param filter the filter for which to allocate an instance. - * @param ctx a pointer into which the pointer to the newly-allocated context - *will be written. It must be freed with av_bsf_free() after the - *filtering is done. + * @param[out] ctx a pointer into which the pointer to the newly-allocated context + * will be written. It must be freed with av_bsf_free() after the + * filtering is done. * * @return 0 on success, a negative AVERROR code on failure */ @@ -195,9 +195,11 @@ int av_bsf_init(AVBSFContext *ctx); * sending more empty packets does nothing) and will cause the filter to output * any packets it may have buffered internally. * - * @return 0 on success. AVERROR(EAGAIN) if packets need to be retrieved from the - * filter (using av_bsf_receive_packet()) before new input can be consumed. Another - * negative AVERROR value if an error occurs. + * @return + * - 0 on success. + * - AVERROR(EAGAIN) if packets need to be retrieved from the filter (using + *av_bsf_receive_packet()) before new input can be consumed. + * - Another negative AVERROR value if an error occurs. */ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt); @@ -214,10 +216,12 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt); * overwritten by the returned data. On failure, pkt is not * touched. * - * @return 0 on success. AVERROR(EAGAIN) if more packets need to be sent to the - * filter (using av_bsf_send_packet()) to get more output. AVERROR_EOF if there - * will be no further output from the filter. Another negative AVERROR value if - * an error occurs. + * @return + * - 0 on success. + * - AVERROR(EAGAIN) if more packets need to be sent to the filter (using + *av_bsf_send_packet()) to get more output. + * - AVERROR_EOF if there will be no further output from the filter. + * - Another negative AVERROR value if an error occurs. * * @note one input packet may result in several output packets, so after sending * a packet with av_bsf_send_packet(), this function needs to be called ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc/bsf: add general documentation
ffmpeg | branch: master | Anton Khirnov | Mon Feb 21 21:44:38 2022 +0100| [5e7643eff795609bd3878c99277859a56e884135] | committer: Anton Khirnov lavc/bsf: add general documentation Also, place the BSF api docs in their own doxygen group. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5e7643eff795609bd3878c99277859a56e884135 --- libavcodec/bsf.h | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/libavcodec/bsf.h b/libavcodec/bsf.h index 8c5355d186..ba8b48f222 100644 --- a/libavcodec/bsf.h +++ b/libavcodec/bsf.h @@ -30,7 +30,28 @@ #include "packet.h" /** - * @addtogroup lavc_core + * @defgroup lavc_bsf Bitstream filters + * @ingroup libavc + * + * Bitstream filters transform encoded media data without decoding it. This + * allows e.g. manipulating various header values. Bitstream filters operate on + * @ref AVPacket "AVPackets". + * + * The bitstream filtering API is centered around two structures: + * AVBitStreamFilter and AVBSFContext. The former represents a bitstream filter + * in abstract, the latter a specific filtering process. Obtain an + * AVBitStreamFilter using av_bsf_get_by_name() or av_bsf_iterate(), then pass + * it to av_bsf_alloc() to create an AVBSFContext. Fill in the user-settable + * AVBSFContext fields, as described in its documentation, then call + * av_bsf_init() to prepare the filter context for use. + * + * Submit packets for filtering using av_bsf_send_packet(), obtain filtered + * results with av_bsf_receive_packet(). When no more input packets will be + * sent, submit a NULL AVPacket to signal the end of the stream to the filter. + * av_bsf_receive_packet() will then return trailing packets, if any are + * produced by the filter. + * + * Finally, free the filter context with av_bsf_free(). * @{ */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".