Re: [FFmpeg-devel] [RFC] 7.1 Release
Hello, On Sat, 7 Sep 2024, at 22:46, Michael Niedermayer wrote: > I intend to branch 7.1 in the next 24h Could you wait a tiny bit more, please? I know Lynne and James have important work in progress, maybe they could chim in on Monday to merge them or not. jbk -- Jean-Baptiste Kempf - President +33 672 704 734 https://jbkempf.com/ ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] configure: enable warnings for shadowed variables
Timo Rothenpieler: > These can easily lead to incredibly confusing errors, and should > practically never happen. > I'd have loved to make this a -Werror even, but sadly there is way too > many instances in the codebase right now that first needs to be weeded > out. IMO these instances would need to be weeded out before this is enabled even as a warning. > --- > configure | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/configure b/configure > index a8e67d230c..547b67565d 100755 > --- a/configure > +++ b/configure > @@ -7406,6 +7406,7 @@ check_cflags -Wundef > check_cflags -Wmissing-prototypes > check_cflags -Wstrict-prototypes > check_cflags -Wempty-body > +check_cflags -Wshadow > > if enabled extra_warnings; then > check_cflags -Wcast-qual ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] libavcodec: implementation of DNxUncompressed decoder
Martin Schitter: > This is a second attempt to contribute the corrected code of an > AVID DNxUncompressed / SMTPE RDD 50 decoder. > > Thanks > Martin > > --- > Changelog | 1 + > doc/general_contents.texi | 1 + > libavcodec/Makefile | 1 + > libavcodec/allcodecs.c| 1 + > libavcodec/codec_desc.c | 7 + > libavcodec/codec_id.h | 1 + > libavcodec/dnxucdec.c | 495 ++ > libavcodec/parsers.c | 1 + > libavcodec/version.c | 2 +- > libavcodec/version.h | 2 +- > libavformat/mxf.c | 1 + > libavformat/mxfdec.c | 21 ++ > 12 files changed, 532 insertions(+), 2 deletions(-) > create mode 100644 libavcodec/dnxucdec.c > > diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h > index 0ab1e34..27b229b 100644 > --- a/libavcodec/codec_id.h > +++ b/libavcodec/codec_id.h > @@ -321,6 +321,7 @@ enum AVCodecID { > AV_CODEC_ID_EVC, > AV_CODEC_ID_RTV1, > AV_CODEC_ID_VMIX, > +AV_CODEC_ID_DNXUC, > AV_CODEC_ID_LEAD, > > /* various PCM "codecs" */ > diff --git a/libavcodec/dnxucdec.c b/libavcodec/dnxucdec.c > new file mode 100644 > index 000..502e736 > --- /dev/null > +++ b/libavcodec/dnxucdec.c > + > +const AVCodecParser ff_dnxuc_parser = { > +.codec_ids = { AV_CODEC_ID_DNXUC }, > +.priv_data_size = sizeof(DNxUcParseContext), > +.parser_parse = dnxuc_parse, > +}; > + > +const FFCodec ff_dnxuc_decoder = { > +.p.name = "dnxuc", > +CODEC_LONG_NAME()"DNxUncompressed (SMPTE RDD 50)", This shouldn't even compile. > +.p.type = AVMEDIA_TYPE_VIDEO, > +.p.id = AV_CODEC_ID_DNXUC, > +.init = dnxuc_decode_init, > +FF_CODEC_DECODE_CB(dnxuc_decode_frame), > +.p.capabilities = AV_CODEC_CAP_FRAME_THREADS, > +}; > \ No newline at end of file This should be fixed. > diff --git a/libavcodec/version.c b/libavcodec/version.c > index 27f9432..c3b576a 100644 > --- a/libavcodec/version.c > +++ b/libavcodec/version.c > @@ -31,7 +31,7 @@ const char av_codec_ffversion[] = "FFmpeg version " > FFMPEG_VERSION; > > unsigned avcodec_version(void) > { > -static_assert(AV_CODEC_ID_LEAD == 269 && > +static_assert(AV_CODEC_ID_LEAD == 270 && >AV_CODEC_ID_PCM_SGA == 65572 && >AV_CODEC_ID_ADPCM_XMD== 69683 && >AV_CODEC_ID_CBD2_DPCM== 81928 && This is by definition the wrong fix. Instead you should do as the assert message tells you: Don't insert your new ID in the middle of the list. Didn't look closely at the rest (but it already seems like there are many issues). - Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2] avcodec/riscv: add h264 qpel
Le keskiviikkona 4. syyskuuta 2024, 16.32.21 EEST J. Dekker a écrit : > From: Niklas Haas > > checkasm: bench runs 131072 (1 << 17) Err, the code contains two separate set of optimisations, and only one set of benchmarks? Also landing pads seem to be missing. -- レミ・デニ-クールモン http://www.remlab.net/ ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] configure: enable warnings for shadowed variables
On 08.09.2024 10:15, Andreas Rheinhardt wrote: Timo Rothenpieler: These can easily lead to incredibly confusing errors, and should practically never happen. I'd have loved to make this a -Werror even, but sadly there is way too many instances in the codebase right now that first needs to be weeded out. IMO these instances would need to be weeded out before this is enabled even as a warning. There is almost 1000 of them without enabling much of any dependencies. So I think that's next to impossible. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2] avfilter: fix YUV colorspace negotiation for YUVJ
From: Niklas Haas Ironically, despite being introduced to make YUVJ unnecessary, the new YUV negotiation logic failed to actually negotiate YUVJ formats themselves correctly, leading to errors when passing YUVJ frames into a filter graph. (They were effectively treated like RGB or Grayscale formats, rather than as forced-full-range YUV, and hence did not have their colorspace matrix correctly negotiated) Fix this by splitting off the YUVJ check from ff_fmt_is_regular_yuv(). Obviously, we can trivially undo this change again once YUVJ is actually deleted from the codebase. --- libavfilter/avfiltergraph.c | 31 +++ libavfilter/buffersrc.c | 15 ++- libavfilter/video.h | 5 + 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index c84dd3cf25..806e2a93f4 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -654,19 +654,22 @@ int ff_fmt_is_regular_yuv(enum AVPixelFormat fmt) if (desc->nb_components < 3) return 0; /* Grayscale is explicitly full-range in swscale */ av_assert1(!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)); -if (desc->flags & (AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PAL | - AV_PIX_FMT_FLAG_XYZ | AV_PIX_FMT_FLAG_FLOAT)) -return 0; +return !(desc->flags & (AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PAL | +AV_PIX_FMT_FLAG_XYZ | AV_PIX_FMT_FLAG_FLOAT)); +} + +int ff_fmt_is_forced_full_range(enum AVPixelFormat fmt) +{ switch (fmt) { case AV_PIX_FMT_YUVJ420P: case AV_PIX_FMT_YUVJ422P: case AV_PIX_FMT_YUVJ444P: case AV_PIX_FMT_YUVJ440P: case AV_PIX_FMT_YUVJ411P: -return 0; -default: return 1; +default: +return 0; } } @@ -742,14 +745,18 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) link->incfg.color_spaces->nb_formats = 1; link->colorspace = link->incfg.color_spaces->formats[0]; -if (!link->incfg.color_ranges->nb_formats) { -av_log(link->src, AV_LOG_ERROR, "Cannot select color range for" - " the link between filters %s and %s.\n", link->src->name, - link->dst->name); -return AVERROR(EINVAL); +if (ff_fmt_is_forced_full_range(swfmt)) { +link->color_range = AVCOL_RANGE_JPEG; +} else { +if (!link->incfg.color_ranges->nb_formats) { +av_log(link->src, AV_LOG_ERROR, "Cannot select color range for" + " the link between filters %s and %s.\n", link->src->name, + link->dst->name); +return AVERROR(EINVAL); +} +link->incfg.color_ranges->nb_formats = 1; +link->color_range = link->incfg.color_ranges->formats[0]; } -link->incfg.color_ranges->nb_formats = 1; -link->color_range = link->incfg.color_ranges->formats[0]; } } else if (link->type == AVMEDIA_TYPE_AUDIO) { int ret; diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index a3113f5c13..b5682006f0 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -461,12 +461,17 @@ static int query_formats(AVFilterContext *ctx) if ((ret = ff_add_format(&color_spaces, c->color_space)) < 0 || (ret = ff_set_common_color_spaces(ctx, color_spaces)) < 0) return ret; -if ((ret = ff_add_format(&color_ranges, c->color_range)) < 0) -return ret; -if (c->color_range == AVCOL_RANGE_UNSPECIFIED) { -/* allow implicitly promoting unspecified to mpeg */ -if ((ret = ff_add_format(&color_ranges, AVCOL_RANGE_MPEG)) < 0) +if (ff_fmt_is_forced_full_range(swfmt)) { +if ((ret = ff_add_format(&color_ranges, AVCOL_RANGE_JPEG)) < 0) +return ret; +} else { +if ((ret = ff_add_format(&color_ranges, c->color_range)) < 0) return ret; +if (c->color_range == AVCOL_RANGE_UNSPECIFIED) { +/* allow implicitly promoting unspecified to mpeg */ +if ((ret = ff_add_format(&color_ranges, AVCOL_RANGE_MPEG)) < 0) +return ret; +} } if ((ret = ff_set_common_color_ranges(ctx, color_ranges)) < 0) return ret; diff --git a/libavfilter/video.h b/libavfilter/video.h index 77f27fdf7c..f44d3445dc 100644 --- a/libavfilter/video.h +++ b/libavfilter/video.h @@ -51,4 +51,9 @@ AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h); */ int ff_fmt_is_regular_yuv(enum AVPixelFormat fmt); +/** + * Returns true if a YUV pixel format is forced full range (i.e. YUVJ). +
Re: [FFmpeg-devel] [PATCH v2] avfilter: fix YUV colorspace negotiation for YUVJ
On Sun, 08 Sep 2024 15:04:29 +0200 Niklas Haas wrote: > From: Niklas Haas > > Ironically, despite being introduced to make YUVJ unnecessary, the new > YUV negotiation logic failed to actually negotiate YUVJ formats > themselves correctly, leading to errors when passing YUVJ frames into > a filter graph. (They were effectively treated like RGB or Grayscale > formats, rather than as forced-full-range YUV, and hence did not have > their colorspace matrix correctly negotiated) > > Fix this by splitting off the YUVJ check from ff_fmt_is_regular_yuv(). > Obviously, we can trivially undo this change again once YUVJ is actually > deleted from the codebase. Need to fix FATE regression before merging this. > --- > libavfilter/avfiltergraph.c | 31 +++ > libavfilter/buffersrc.c | 15 ++- > libavfilter/video.h | 5 + > 3 files changed, 34 insertions(+), 17 deletions(-) > > diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c > index c84dd3cf25..806e2a93f4 100644 > --- a/libavfilter/avfiltergraph.c > +++ b/libavfilter/avfiltergraph.c > @@ -654,19 +654,22 @@ int ff_fmt_is_regular_yuv(enum AVPixelFormat fmt) > if (desc->nb_components < 3) > return 0; /* Grayscale is explicitly full-range in swscale */ > av_assert1(!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)); > -if (desc->flags & (AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PAL | > - AV_PIX_FMT_FLAG_XYZ | AV_PIX_FMT_FLAG_FLOAT)) > -return 0; > +return !(desc->flags & (AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PAL | > +AV_PIX_FMT_FLAG_XYZ | AV_PIX_FMT_FLAG_FLOAT)); > +} > > + > +int ff_fmt_is_forced_full_range(enum AVPixelFormat fmt) > +{ > switch (fmt) { > case AV_PIX_FMT_YUVJ420P: > case AV_PIX_FMT_YUVJ422P: > case AV_PIX_FMT_YUVJ444P: > case AV_PIX_FMT_YUVJ440P: > case AV_PIX_FMT_YUVJ411P: > -return 0; > -default: > return 1; > +default: > +return 0; > } > } > > @@ -742,14 +745,18 @@ static int pick_format(AVFilterLink *link, AVFilterLink > *ref) > link->incfg.color_spaces->nb_formats = 1; > link->colorspace = link->incfg.color_spaces->formats[0]; > > -if (!link->incfg.color_ranges->nb_formats) { > -av_log(link->src, AV_LOG_ERROR, "Cannot select color range > for" > - " the link between filters %s and %s.\n", > link->src->name, > - link->dst->name); > -return AVERROR(EINVAL); > +if (ff_fmt_is_forced_full_range(swfmt)) { > +link->color_range = AVCOL_RANGE_JPEG; > +} else { > +if (!link->incfg.color_ranges->nb_formats) { > +av_log(link->src, AV_LOG_ERROR, "Cannot select color > range for" > + " the link between filters %s and %s.\n", > link->src->name, > + link->dst->name); > +return AVERROR(EINVAL); > +} > +link->incfg.color_ranges->nb_formats = 1; > +link->color_range = link->incfg.color_ranges->formats[0]; > } > -link->incfg.color_ranges->nb_formats = 1; > -link->color_range = link->incfg.color_ranges->formats[0]; > } > } else if (link->type == AVMEDIA_TYPE_AUDIO) { > int ret; > diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c > index a3113f5c13..b5682006f0 100644 > --- a/libavfilter/buffersrc.c > +++ b/libavfilter/buffersrc.c > @@ -461,12 +461,17 @@ static int query_formats(AVFilterContext *ctx) > if ((ret = ff_add_format(&color_spaces, c->color_space)) < 0 || > (ret = ff_set_common_color_spaces(ctx, color_spaces)) < 0) > return ret; > -if ((ret = ff_add_format(&color_ranges, c->color_range)) < 0) > -return ret; > -if (c->color_range == AVCOL_RANGE_UNSPECIFIED) { > -/* allow implicitly promoting unspecified to mpeg */ > -if ((ret = ff_add_format(&color_ranges, AVCOL_RANGE_MPEG)) < > 0) > +if (ff_fmt_is_forced_full_range(swfmt)) { > +if ((ret = ff_add_format(&color_ranges, AVCOL_RANGE_JPEG)) < > 0) > +return ret; > +} else { > +if ((ret = ff_add_format(&color_ranges, c->color_range)) < 0) > return ret; > +if (c->color_range == AVCOL_RANGE_UNSPECIFIED) { > +/* allow implicitly promoting unspecified to mpeg */ > +if ((ret = ff_add_format(&color_ranges, > AVCOL_RANGE_MPEG)) < 0) > +return ret; > +} > } > if ((ret = ff_set_common_color_ranges(ctx, color_ranges)) < 0) > return ret; > diff --git a/libavfilter/video.h b/libav
Re: [FFmpeg-devel] [PATCH 09/13] avformat: add an LCEVC stream group
On 9/6/2024 8:44 AM, Anton Khirnov wrote: Quoting James Almer (2024-08-31 18:31:10) +typedef struct AVStreamGroupLCEVC { +const AVClass *av_class; + +/** + * Width of the final stream for presentation. + */ +int width; +/** + * Height of the final image for presentation. + */ +int height; What's the point of exporting these separately when they are the same as the enhancement AVStream's dimensions? The enhancement stream is of data type, so width/height are undefined in it. Hence including these here. +} AVStreamGroupLCEVC; + enum AVStreamGroupParamsType { AV_STREAM_GROUP_PARAMS_NONE, AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT, AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION, AV_STREAM_GROUP_PARAMS_TILE_GRID, +AV_STREAM_GROUP_PARAMS_LCEVC, This seems like it could use some documentation. Yes, will add something. OpenPGP_signature.asc Description: OpenPGP digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] MAINTAINERS: remove Aurelien and David from matroska*
On Sun, Sep 01, 2024 at 04:27:22PM +0200, Michael Niedermayer wrote: > Aurelien last activity in git is from 2017, last activity on the ML is from > 2018 > David last activity in git is from 2011, and ML from 2013 > > matroska* is actively maintained > > CC: Aurelien Jacobs > CC: David Conrad > Signed-off-by: Michael Niedermayer > --- > MAINTAINERS | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) will apply patchset [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Avoid a single point of failure, be that a person or equipment. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/5] MAINTAINERS: Mark parts from Robert as unmaintained
On Sat, Aug 31, 2024 at 11:44:45PM +0200, Michael Niedermayer wrote: > Last mail and commit from Robert seems from 2011, thats 13 years ago > > CC: Rob > Signed-off-by: Michael Niedermayer > --- > MAINTAINERS | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) will apply patchset [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Never trust a computer, one day, it may think you are the virus. -- Compn signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [RFC] 7.1 Release
On Sun, Sep 08, 2024 at 09:34:39AM +0200, Jean-Baptiste Kempf wrote: > Hello, > > On Sat, 7 Sep 2024, at 22:46, Michael Niedermayer wrote: > > I intend to branch 7.1 in the next 24h > > Could you wait a tiny bit more, please? I could if someone opens corresponding issues on trac to track these otherwise, its just a pain to keep track we have a list for release blocking issues: https://trac.ffmpeg.org/report/16 (also as note, ATM i consider the aspect issue #4161 to be non blocking as its there since last release and seems to have little activity) > I know Lynne and James have important work in progress, maybe they could chim > in on Monday to merge them or not. Without issues on trac its easy that there are misunderstandings what somneone intends to do before release and what not. Please open blocking issues if you intend to do something before branching / release. And close them once your work is finished. thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Rewriting code that is poorly written but fully understood is good. Rewriting code that one doesnt understand is a sign that one is less smart than the original author, trying to rewrite it will not make it better. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] web/index: Add news entry about coverity
Hi (also adding tara as i think he is interrested about the news entry) On Fri, Aug 16, 2024 at 09:20:06AM +0200, Anton Khirnov wrote: > Quoting Michael Niedermayer (2024-08-15 23:50:18) > > Based on suggestion of Jonatas > > > > CC: "Jonatas L. Nogueira" > > --- > > src/index | 8 > > 1 file changed, 8 insertions(+) > > > > diff --git a/src/index b/src/index > > index 73e9a4c..b44f384 100644 > > --- a/src/index > > +++ b/src/index > > @@ -35,6 +35,14 @@ > > News > > > > > > + August 15th, 2024, Coverity > > + > > + The number of issues FFmpeg has in coverity is now lower than it has > > been since 2016. > ^ > capital C > Maybe add "(a static analyzer)" and/or a link, as the reader may not > know what Coverity is. > > > + Our defect density is less than one 30th of the average in OSS with over > > a million code > > + lines. All this was possible thanks to a Grant from the Sovereign Tech > > Fund. > ^ > small g > > Also maybe link to https://www.sovereigntechfund.de/ will apply with these changes, and updated date to match today thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Democracy is the form of government in which you can choose your dictator signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] configure: enable warnings for shadowed variables
> On Sep 8, 2024, at 20:39, Timo Rothenpieler wrote: > > On 08.09.2024 10:15, Andreas Rheinhardt wrote: >> Timo Rothenpieler: >>> These can easily lead to incredibly confusing errors, and should >>> practically never happen. >>> I'd have loved to make this a -Werror even, but sadly there is way too >>> many instances in the codebase right now that first needs to be weeded >>> out. >> IMO these instances would need to be weeded out before this is enabled >> even as a warning. > > There is almost 1000 of them without enabling much of any dependencies. > So I think that's next to impossible. Then this patch will make it harder to see new warnings within thousands of warnings, isn’t it? It’s annoying to enable this warning before fix those code first. > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] configure: enable warnings for shadowed variables
On 08.09.2024 18:44, Zhao Zhili wrote: On Sep 8, 2024, at 20:39, Timo Rothenpieler wrote: On 08.09.2024 10:15, Andreas Rheinhardt wrote: Timo Rothenpieler: These can easily lead to incredibly confusing errors, and should practically never happen. I'd have loved to make this a -Werror even, but sadly there is way too many instances in the codebase right now that first needs to be weeded out. IMO these instances would need to be weeded out before this is enabled even as a warning. There is almost 1000 of them without enabling much of any dependencies. So I think that's next to impossible. Then this patch will make it harder to see new warnings within thousands of warnings, isn’t it? It’s annoying to enable this warning before fix those code first. Well, the reality is, that without printing all these warnings, nobody will ever fix them. Unless someone sits down and spends potentially multiple days if not weeks of work to fix all the current ones. If we print all the warnings instead, it can get fixed gradually. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] libavcodec: implementation of DNxUncompressed decoder
Dear Andreas! Thanks for taking a look. I'm not familiar with ffmpeg development and it's really hard to figure out the more complex demands and hidden secrets of all the projects tooling and workflow requirements. On 08.09.24 10:47, Andreas Rheinhardt wrote: [...] +++ b/libavcodec/dnxucdec.c + +const AVCodecParser ff_dnxuc_parser = { +.codec_ids = { AV_CODEC_ID_DNXUC }, +.priv_data_size = sizeof(DNxUcParseContext), +.parser_parse = dnxuc_parse, +}; + +const FFCodec ff_dnxuc_decoder = { +.p.name = "dnxuc", +CODEC_LONG_NAME()"DNxUncompressed (SMPTE RDD 50)", This shouldn't even compile. I already fixed this obvious little glitch in a quick reply to michaels review yesterday. btw: could you please give me an advice, how this kind of trivial corrections should be handled on this list? Should I just post the individual correction as patch in a followup message or always post the numerated full patch set again or even a squashed variant of the changes for better readability in context? +.p.type = AVMEDIA_TYPE_VIDEO, +.p.id = AV_CODEC_ID_DNXUC, +.init = dnxuc_decode_init, +FF_CODEC_DECODE_CB(dnxuc_decode_frame), +.p.capabilities = AV_CODEC_CAP_FRAME_THREADS, +}; \ No newline at end of file This should be fixed. O.k. that's easy to solve... btw: what particular linter or make argument should I use to get this more picky warnings and errors myself without access to fancy CI/CD test reports? diff --git a/libavcodec/version.c b/libavcodec/version.c index 27f9432..c3b576a 100644 --- a/libavcodec/version.c +++ b/libavcodec/version.c @@ -31,7 +31,7 @@ const char av_codec_ffversion[] = "FFmpeg version " FFMPEG_VERSION; unsigned avcodec_version(void) { -static_assert(AV_CODEC_ID_LEAD == 269 && +static_assert(AV_CODEC_ID_LEAD == 270 && AV_CODEC_ID_PCM_SGA == 65572 && AV_CODEC_ID_ADPCM_XMD== 69683 && AV_CODEC_ID_CBD2_DPCM== 81928 && This is by definition the wrong fix. Instead you should do as the assert message tells you: Don't insert your new ID in the middle of the list. well -- that's indeed a real issue! I needed few attempts to figure out how this somehow works at all, because I'm perhaps to stupid to understand/follow the relevant section in the documentation (https://ffmpeg.org/developer.html#New-codecs-or-formats-checklist): If I add a new ID somewhere in the relevant section of codec_id.h the LEAD-element position will be shifted in any case. Isn't this the reason, why the minor version number in libavcodec/version.h must be bumped too? Wherever possible I added changes for DNxUncompressed close to other DNx* entries in alphabetic order, but in codec_id.h and codec_desc.c I placed it at the end of the relevant section immediately before the LEAD-entry to minimize incompatibility. Please simply show me how this particular issue can be solved in a more desired manner. Didn't look closely at the rest (but it already seems like there are many issues). Please just help me figure out all relevant issues! I'm really willing to improve my contribution. thanks! martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/3] libavcodec: implementation of DNxUncompressed decoder
--- Changelog | 1 + doc/general_contents.texi | 1 + libavcodec/Makefile | 1 + libavcodec/allcodecs.c| 1 + libavcodec/codec_desc.c | 7 + libavcodec/codec_id.h | 1 + libavcodec/dnxucdec.c | 495 ++ libavcodec/parsers.c | 1 + libavcodec/version.c | 2 +- libavcodec/version.h | 2 +- libavformat/mxf.c | 1 + libavformat/mxfdec.c | 21 ++ 12 files changed, 532 insertions(+), 2 deletions(-) create mode 100644 libavcodec/dnxucdec.c diff --git a/Changelog b/Changelog index 583de26..fbda69e 100644 --- a/Changelog +++ b/Changelog @@ -19,6 +19,7 @@ version : - Cropping metadata parsing and writing in Matroska and MP4/MOV de/muxers - Intel QSV-accelerated VVC decoding - MediaCodec AAC/AMR-NB/AMR-WB/MP3 decoding +- DNxUncompressed (SMPTE RDD 50) decoder version 7.0: diff --git a/doc/general_contents.texi b/doc/general_contents.texi index e7cf4f8..1593124 100644 --- a/doc/general_contents.texi +++ b/doc/general_contents.texi @@ -619,6 +619,7 @@ library: @item raw DFPWM @tab X @tab X @item raw Dirac @tab X @tab X @item raw DNxHD @tab X @tab X +@itme raw DNxUncompressed @tab @tab X @item raw DTS @tab X @tab X @item raw DTS-HD@tab @tab X @item raw E-AC-3@tab X @tab X diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 75ae377..cfa8fba 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -325,6 +325,7 @@ OBJS-$(CONFIG_DFPWM_DECODER) += dfpwmdec.o OBJS-$(CONFIG_DFPWM_ENCODER) += dfpwmenc.o OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o +OBJS-$(CONFIG_DNXUC_DECODER) += dnxucdec.o OBJS-$(CONFIG_DOLBY_E_DECODER) += dolby_e.o dolby_e_parse.o kbdwin.o OBJS-$(CONFIG_DPX_DECODER) += dpx.o OBJS-$(CONFIG_DPX_ENCODER) += dpxenc.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 563afde..ea8f2a4 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -93,6 +93,7 @@ extern const FFCodec ff_dfa_decoder; extern const FFCodec ff_dirac_decoder; extern const FFCodec ff_dnxhd_encoder; extern const FFCodec ff_dnxhd_decoder; +extern const FFCodec ff_dnxuc_decoder; extern const FFCodec ff_dpx_encoder; extern const FFCodec ff_dpx_decoder; extern const FFCodec ff_dsicinvideo_decoder; diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index a28ef68..2b83ea2 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1952,6 +1952,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL("vMix Video"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, }, +{ +.id= AV_CODEC_ID_DNXUC, +.type = AVMEDIA_TYPE_VIDEO, +.name = "dnxuc", +.long_name = NULL_IF_CONFIG_SMALL("DNxUncompressed / SMPTE RDD 50"), +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, +}, { .id= AV_CODEC_ID_LEAD, .type = AVMEDIA_TYPE_VIDEO, diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h index 0ab1e34..27b229b 100644 --- a/libavcodec/codec_id.h +++ b/libavcodec/codec_id.h @@ -321,6 +321,7 @@ enum AVCodecID { AV_CODEC_ID_EVC, AV_CODEC_ID_RTV1, AV_CODEC_ID_VMIX, +AV_CODEC_ID_DNXUC, AV_CODEC_ID_LEAD, /* various PCM "codecs" */ diff --git a/libavcodec/dnxucdec.c b/libavcodec/dnxucdec.c new file mode 100644 index 000..502e736 --- /dev/null +++ b/libavcodec/dnxucdec.c @@ -0,0 +1,495 @@ +/* + * Avid DNxUncomressed / SMPTE RDD 50 demuxer + * Copyright (c) 2024 Martin Schitter + * + * 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 + */ + +/* + This partial implementation of a decoder for DNxUncompressed video data + is based on reverse engineering of output generated by DaVinci Resolve 19 + because the SMPTE RDD 50 specification is unfortunately not freely accessible. + + It's therefor limited by the present export capabilities of Resolve (YUV444 + variants, YUV422 16bit, and alpha support i
[FFmpeg-devel] [PATCH 2/3] libavcodec/dnxucdec.c: fix displaced bracket
--- libavcodec/dnxucdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dnxucdec.c b/libavcodec/dnxucdec.c index 502e736..e9a2157 100644 --- a/libavcodec/dnxucdec.c +++ b/libavcodec/dnxucdec.c @@ -486,7 +486,7 @@ const AVCodecParser ff_dnxuc_parser = { const FFCodec ff_dnxuc_decoder = { .p.name = "dnxuc", -CODEC_LONG_NAME()"DNxUncompressed (SMPTE RDD 50)", +CODEC_LONG_NAME("DNxUncompressed (SMPTE RDD 50)"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DNXUC, .init = dnxuc_decode_init, -- 2.45.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 3/3] libavcodec/dnxucdec.c: fix missing newline at EOF
--- libavcodec/dnxucdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dnxucdec.c b/libavcodec/dnxucdec.c index e9a2157..455c374 100644 --- a/libavcodec/dnxucdec.c +++ b/libavcodec/dnxucdec.c @@ -492,4 +492,4 @@ const FFCodec ff_dnxuc_decoder = { .init = dnxuc_decode_init, FF_CODEC_DECODE_CB(dnxuc_decode_frame), .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, -}; \ No newline at end of file +}; -- 2.45.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/3] libavcodec/dnxucdec.c: fix displaced bracket
> On Sep 9, 2024, at 01:27, Martin Schitter wrote: > > --- > libavcodec/dnxucdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/dnxucdec.c b/libavcodec/dnxucdec.c > index 502e736..e9a2157 100644 > --- a/libavcodec/dnxucdec.c > +++ b/libavcodec/dnxucdec.c > @@ -486,7 +486,7 @@ const AVCodecParser ff_dnxuc_parser = { > > const FFCodec ff_dnxuc_decoder = { > .p.name = "dnxuc", > -CODEC_LONG_NAME()"DNxUncompressed (SMPTE RDD 50)", > +CODEC_LONG_NAME("DNxUncompressed (SMPTE RDD 50)"), > .p.type = AVMEDIA_TYPE_VIDEO, > .p.id = AV_CODEC_ID_DNXUC, > .init = dnxuc_decode_init, > -- > 2.45.2 If there are defects in a patch, fix the patch instead of add a new commit. For example, use git commit —amend. If it’s a patch in a patchset, use git rebase —interactive. We don’t merge a patch if there is know issue, then fix it with another patch. > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/3] libavcodec/dnxucdec.c: fix displaced bracket
On 08.09.24 19:52, Zhao Zhili wrote: If there are defects in a patch, fix the patch instead of add a new commit. For example, use git commit —amend. If it’s a patch in a patchset, use git rebase —interactive. We don’t merge a patch if there is know issue, then fix it with another patch. Thanks, that's really helpful advice! martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v3] libavcodec: implementation of DNxUncompressed decoder
As suggested by Zhao Zhili, here is a squash rebased 3rd attempt. I'm still unsure about my solution of adding the codec_id entries and increasing the lead-position value, as criticized by Andreas Rheinhard, but I don't see any other way to make it better. martin --- Changelog | 1 + doc/general_contents.texi | 1 + libavcodec/Makefile | 1 + libavcodec/allcodecs.c| 1 + libavcodec/codec_desc.c | 7 + libavcodec/codec_id.h | 1 + libavcodec/dnxucdec.c | 495 ++ libavcodec/parsers.c | 1 + libavcodec/version.c | 2 +- libavcodec/version.h | 2 +- libavformat/mxf.c | 1 + libavformat/mxfdec.c | 21 ++ 12 files changed, 532 insertions(+), 2 deletions(-) create mode 100644 libavcodec/dnxucdec.c diff --git a/Changelog b/Changelog index 583de26..fbda69e 100644 --- a/Changelog +++ b/Changelog @@ -19,6 +19,7 @@ version : - Cropping metadata parsing and writing in Matroska and MP4/MOV de/muxers - Intel QSV-accelerated VVC decoding - MediaCodec AAC/AMR-NB/AMR-WB/MP3 decoding +- DNxUncompressed (SMPTE RDD 50) decoder version 7.0: diff --git a/doc/general_contents.texi b/doc/general_contents.texi index e7cf4f8..1593124 100644 --- a/doc/general_contents.texi +++ b/doc/general_contents.texi @@ -619,6 +619,7 @@ library: @item raw DFPWM @tab X @tab X @item raw Dirac @tab X @tab X @item raw DNxHD @tab X @tab X +@itme raw DNxUncompressed @tab @tab X @item raw DTS @tab X @tab X @item raw DTS-HD@tab @tab X @item raw E-AC-3@tab X @tab X diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 75ae377..cfa8fba 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -325,6 +325,7 @@ OBJS-$(CONFIG_DFPWM_DECODER) += dfpwmdec.o OBJS-$(CONFIG_DFPWM_ENCODER) += dfpwmenc.o OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o OBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o dnxhddata.o +OBJS-$(CONFIG_DNXUC_DECODER) += dnxucdec.o OBJS-$(CONFIG_DOLBY_E_DECODER) += dolby_e.o dolby_e_parse.o kbdwin.o OBJS-$(CONFIG_DPX_DECODER) += dpx.o OBJS-$(CONFIG_DPX_ENCODER) += dpxenc.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 563afde..ea8f2a4 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -93,6 +93,7 @@ extern const FFCodec ff_dfa_decoder; extern const FFCodec ff_dirac_decoder; extern const FFCodec ff_dnxhd_encoder; extern const FFCodec ff_dnxhd_decoder; +extern const FFCodec ff_dnxuc_decoder; extern const FFCodec ff_dpx_encoder; extern const FFCodec ff_dpx_decoder; extern const FFCodec ff_dsicinvideo_decoder; diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index a28ef68..2b83ea2 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1952,6 +1952,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL("vMix Video"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, }, +{ +.id= AV_CODEC_ID_DNXUC, +.type = AVMEDIA_TYPE_VIDEO, +.name = "dnxuc", +.long_name = NULL_IF_CONFIG_SMALL("DNxUncompressed / SMPTE RDD 50"), +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, +}, { .id= AV_CODEC_ID_LEAD, .type = AVMEDIA_TYPE_VIDEO, diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h index 0ab1e34..27b229b 100644 --- a/libavcodec/codec_id.h +++ b/libavcodec/codec_id.h @@ -321,6 +321,7 @@ enum AVCodecID { AV_CODEC_ID_EVC, AV_CODEC_ID_RTV1, AV_CODEC_ID_VMIX, +AV_CODEC_ID_DNXUC, AV_CODEC_ID_LEAD, /* various PCM "codecs" */ diff --git a/libavcodec/dnxucdec.c b/libavcodec/dnxucdec.c new file mode 100644 index 000..455c374 --- /dev/null +++ b/libavcodec/dnxucdec.c @@ -0,0 +1,495 @@ +/* + * Avid DNxUncomressed / SMPTE RDD 50 demuxer + * Copyright (c) 2024 Martin Schitter + * + * 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 + */ + +/* + This partial implementation of a decoder for DNxUncompressed video data + is based on r
[FFmpeg-devel] [PATCH] avcodec/avcodec: remove usage of __typeof__()
It's non-standard C. Signed-off-by: James Almer --- libavcodec/avcodec.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index cb89236549..78153d12f1 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -708,9 +708,9 @@ int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *fr return ff_encode_receive_frame(avctx, frame); } -#define WRAP_CONFIG(allowed_type, field, terminator)\ +#define WRAP_CONFIG(allowed_type, field, field_type, terminator)\ do {\ -static const __typeof__(*(field)) end = terminator; \ +static const field_type end = terminator; \ if (codec->type != (allowed_type)) \ return AVERROR(EINVAL); \ *out_configs = (field); \ @@ -753,15 +753,15 @@ int ff_default_get_supported_config(const AVCodecContext *avctx, switch (config) { FF_DISABLE_DEPRECATION_WARNINGS case AV_CODEC_CONFIG_PIX_FORMAT: -WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->pix_fmts, AV_PIX_FMT_NONE); +WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->pix_fmts, enum AVPixelFormat, AV_PIX_FMT_NONE); case AV_CODEC_CONFIG_FRAME_RATE: -WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->supported_framerates, (AVRational){0}); +WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->supported_framerates, AVRational, (AVRational){0}); case AV_CODEC_CONFIG_SAMPLE_RATE: -WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->supported_samplerates, 0); +WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->supported_samplerates, int, 0); case AV_CODEC_CONFIG_SAMPLE_FORMAT: -WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->sample_fmts, AV_SAMPLE_FMT_NONE); +WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->sample_fmts, enum AVSampleFormat, AV_SAMPLE_FMT_NONE); case AV_CODEC_CONFIG_CHANNEL_LAYOUT: -WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->ch_layouts, (AVChannelLayout){0}); +WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->ch_layouts, AVChannelLayout, (AVChannelLayout){0}); FF_ENABLE_DEPRECATION_WARNINGS case AV_CODEC_CONFIG_COLOR_RANGE: -- 2.46.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/avcodec: remove usage of __typeof__()
On Sun, 8 Sep 2024, James Almer wrote: It's non-standard C. Signed-off-by: James Almer --- libavcodec/avcodec.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) LGTM // Martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/avcodec: remove usage of __typeof__()
On Sun, 8 Sep 2024, James Almer wrote: It's non-standard C. Signed-off-by: James Almer --- libavcodec/avcodec.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index cb89236549..78153d12f1 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -708,9 +708,9 @@ int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *fr return ff_encode_receive_frame(avctx, frame); } -#define WRAP_CONFIG(allowed_type, field, terminator)\ +#define WRAP_CONFIG(allowed_type, field, field_type, terminator)\ do {\ -static const __typeof__(*(field)) end = terminator; \ +static const field_type end = terminator; \ if (codec->type != (allowed_type)) \ return AVERROR(EINVAL); \ *out_configs = (field); \ @@ -753,15 +753,15 @@ int ff_default_get_supported_config(const AVCodecContext *avctx, switch (config) { FF_DISABLE_DEPRECATION_WARNINGS case AV_CODEC_CONFIG_PIX_FORMAT: -WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->pix_fmts, AV_PIX_FMT_NONE); +WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->pix_fmts, enum AVPixelFormat, AV_PIX_FMT_NONE); case AV_CODEC_CONFIG_FRAME_RATE: -WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->supported_framerates, (AVRational){0}); +WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->supported_framerates, AVRational, (AVRational){0}); case AV_CODEC_CONFIG_SAMPLE_RATE: -WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->supported_samplerates, 0); +WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->supported_samplerates, int, 0); case AV_CODEC_CONFIG_SAMPLE_FORMAT: -WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->sample_fmts, AV_SAMPLE_FMT_NONE); +WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->sample_fmts, enum AVSampleFormat, AV_SAMPLE_FMT_NONE); case AV_CODEC_CONFIG_CHANNEL_LAYOUT: -WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->ch_layouts, (AVChannelLayout){0}); +WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->ch_layouts, AVChannelLayout, (AVChannelLayout){0}); FF_ENABLE_DEPRECATION_WARNINGS case AV_CODEC_CONFIG_COLOR_RANGE: -- 2.46.0 Actually, this isn't quite enough to fix compilation with all compilers: src/libavcodec/avcodec.c: In function 'ff_default_get_supported_config': src/libavcodec/avcodec.c:758:9: error: initializer element is not constant WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->supported_framerates, AVRational, (AVRational){0}); ^ src/libavcodec/avcodec.c:764:9: error: initializer element is not constant WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->ch_layouts, AVChannelLayout, (AVChannelLayout){0}); ^ Since we're not using typeof here, we can drop the casts here and just use plain {0}: diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index 78153d12f1..8d1a280323 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -755,13 +755,13 @@ FF_DISABLE_DEPRECATION_WARNINGS case AV_CODEC_CONFIG_PIX_FORMAT: WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->pix_fmts, enum AVPixelFormat, AV_PIX_FMT_NONE); case AV_CODEC_CONFIG_FRAME_RATE: -WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->supported_framerates, AVRational, (AVRational){0}); +WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->supported_framerates, AVRational, {0}); case AV_CODEC_CONFIG_SAMPLE_RATE: WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->supported_samplerates, int, 0); case AV_CODEC_CONFIG_SAMPLE_FORMAT: WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->sample_fmts, enum AVSampleFormat, AV_SAMPLE_FMT_NONE); case AV_CODEC_CONFIG_CHANNEL_LAYOUT: -WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->ch_layouts, AVChannelLayout, (AVChannelLayout){0}); +WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->ch_layouts, AVChannelLayout, {0}); FF_ENABLE_DEPRECATION_WARNINGS // Martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avcodec/amfenc: Fix HEVC/AV1 colorspace assumptions
Fixes incorrect colors in AMF encoding of 10-bit SDR content in HEVC and AV1. Signed-off-by: Cameron Gutman --- libavcodec/amfenc_av1.c | 13 - libavcodec/amfenc_hevc.c | 13 - 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/libavcodec/amfenc_av1.c b/libavcodec/amfenc_av1.c index b40d54f70c..59b097edef 100644 --- a/libavcodec/amfenc_av1.c +++ b/libavcodec/amfenc_av1.c @@ -252,15 +252,10 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_COLOR_BIT_DEPTH, color_depth); AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PROFILE, color_profile); -if (color_depth == AMF_COLOR_BIT_DEPTH_8) { -/// Color Transfer Characteristics (AMF matches ISO/IEC) -AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_TRANSFER_CHARACTERISTIC, AMF_COLOR_TRANSFER_CHARACTERISTIC_BT709); -/// Color Primaries (AMF matches ISO/IEC) -AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PRIMARIES, AMF_COLOR_PRIMARIES_BT709); -} else { -AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_TRANSFER_CHARACTERISTIC, AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE2084); -AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PRIMARIES, AMF_COLOR_PRIMARIES_BT2020); -} +/// Color Transfer Characteristics (AMF matches ISO/IEC) +AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_TRANSFER_CHARACTERISTIC, (amf_int64)avctx->color_trc); +/// Color Primaries (AMF matches ISO/IEC) +AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PRIMARIES, (amf_int64)avctx->color_primaries); profile_level = avctx->level; if (profile_level == AV_LEVEL_UNKNOWN) { diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c index fc25dcec1a..bdd2f273a9 100644 --- a/libavcodec/amfenc_hevc.c +++ b/libavcodec/amfenc_hevc.c @@ -254,15 +254,10 @@ FF_ENABLE_DEPRECATION_WARNINGS color_depth = AMF_COLOR_BIT_DEPTH_10; } AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_COLOR_BIT_DEPTH, color_depth); -if (color_depth == AMF_COLOR_BIT_DEPTH_8) { -/// Color Transfer Characteristics (AMF matches ISO/IEC) -AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_TRANSFER_CHARACTERISTIC, AMF_COLOR_TRANSFER_CHARACTERISTIC_BT709); -/// Color Primaries (AMF matches ISO/IEC) -AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PRIMARIES, AMF_COLOR_PRIMARIES_BT709); -} else { -AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_TRANSFER_CHARACTERISTIC, AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE2084); -AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PRIMARIES, AMF_COLOR_PRIMARIES_BT2020); -} +/// Color Transfer Characteristics (AMF matches ISO/IEC) +AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_TRANSFER_CHARACTERISTIC, (amf_int64)avctx->color_trc); +/// Color Primaries (AMF matches ISO/IEC) +AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PRIMARIES, (amf_int64)avctx->color_primaries); // Picture control properties AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_NUM_GOPS_PER_IDR, ctx->gops_per_idr); -- 2.43.0.windows.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2] avcodec/amfenc: Add support for on-demand key frames
v2: Use forced_idr option instead of AV_FRAME_FLAG_KEY Signed-off-by: Cameron Gutman --- In response to the feedback from Anton on the previous patch, I opted to switch to a new codec option plus pict_type rather than triggering IDR frames on AV_FRAME_FLAG_KEY. However, I chose to use 'forced_idr' as the name rather than 'forced-idr' to match the rest of the AMF options which all use '_' instead of '-'. --- libavcodec/amfenc.c | 41 +++- libavcodec/amfenc.h | 1 + libavcodec/amfenc_av1.c | 1 + libavcodec/amfenc_h264.c | 1 + libavcodec/amfenc_hevc.c | 1 + 5 files changed, 44 insertions(+), 1 deletion(-) diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c index 41eaef9758..9d16345b30 100644 --- a/libavcodec/amfenc.c +++ b/libavcodec/amfenc.c @@ -766,11 +766,50 @@ int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt) switch (avctx->codec->id) { case AV_CODEC_ID_H264: AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_INSERT_AUD, !!ctx->aud); +switch (frame->pict_type) { +case AV_PICTURE_TYPE_I: +if (ctx->forced_idr) { +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_INSERT_SPS, 1); +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_INSERT_PPS, 1); +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_IDR); +} else { +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_I); +} +break; +case AV_PICTURE_TYPE_P: +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_P); +break; +case AV_PICTURE_TYPE_B: +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_B); +break; +} break; case AV_CODEC_ID_HEVC: AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_INSERT_AUD, !!ctx->aud); +switch (frame->pict_type) { +case AV_PICTURE_TYPE_I: +if (ctx->forced_idr) { +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_INSERT_HEADER, 1); +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_IDR); +} else { +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_I); +} +break; +case AV_PICTURE_TYPE_P: +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_P); +break; +} +break; +case AV_CODEC_ID_AV1: +if (frame->pict_type == AV_PICTURE_TYPE_I) { +if (ctx->forced_idr) { +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_AV1_FORCE_INSERT_SEQUENCE_HEADER, 1); +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE, AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_KEY); +} else { +AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE, AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_INTRA_ONLY); +} +} break; -//case AV_CODEC_ID_AV1 not supported default: break; } diff --git a/libavcodec/amfenc.h b/libavcodec/amfenc.h index d985d01bb1..0f2abcbd82 100644 --- a/libavcodec/amfenc.h +++ b/libavcodec/amfenc.h @@ -114,6 +114,7 @@ typedef struct AmfContext { int max_b_frames; int qvbr_quality_level; int hw_high_motion_quality_boost; +int forced_idr; // HEVC - specific options diff --git a/libavcodec/amfenc_av1.c b/libavcodec/amfenc_av1.c index 2a7a782063..b40d54f70c 100644 --- a/libavcodec/amfenc_av1.c +++ b/libavcodec/amfenc_av1.c @@ -116,6 +116,7 @@ static const AVOption options[] = { { "none", "no adaptive quantization", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_AQ_MODE_NONE }, 0, 0, VE, .unit = "adaptive_quantisation_mode" }, { "caq","context adaptive quantization",0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_AQ_MODE_CAQ }, 0, 0, VE, .unit = "adaptive_quantisation_mode" }, +{ "forced_idr", "Force I frames to be IDR frames", OFFSET(forced_idr), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "align", "alignment m
[FFmpeg-devel] [PATCH 01/60] fftools/ffmpeg_opt: fix variable shadowing
--- fftools/ffmpeg_opt.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 3cbf0795ac..1aa187f706 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -87,8 +87,6 @@ int recast_media = 0; static void uninit_options(OptionsContext *o) { -int i; - /* all OPT_SPEC and OPT_TYPE_STRING can be freed in generic way */ for (const OptionDef *po = options; po->name; po++) { void *dst; @@ -112,11 +110,11 @@ static void uninit_options(OptionsContext *o) av_freep(dst); } -for (i = 0; i < o->nb_stream_maps; i++) +for (int i = 0; i < o->nb_stream_maps; i++) av_freep(&o->stream_maps[i].linklabel); av_freep(&o->stream_maps); -for (i = 0; i < o->nb_attachments; i++) +for (int i = 0; i < o->nb_attachments; i++) av_freep(&o->attachments[i]); av_freep(&o->attachments); base-commit: 7e35aeda03e7feb0ec32b7da63f5091047a9cefe -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 02/60] fftools/opt_common: fix variable shadowing
--- fftools/opt_common.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fftools/opt_common.c b/fftools/opt_common.c index 9d2d5184a0..059f7a53d2 100644 --- a/fftools/opt_common.c +++ b/fftools/opt_common.c @@ -553,15 +553,15 @@ static void show_help_filter(const char *name) } #endif -static void show_help_bsf(const char *name) +static void show_help_bsf(const char *bsf_name) { -const AVBitStreamFilter *bsf = av_bsf_get_by_name(name); +const AVBitStreamFilter *bsf = av_bsf_get_by_name(bsf_name); -if (!name) { +if (!bsf_name) { av_log(NULL, AV_LOG_ERROR, "No bitstream filter name specified.\n"); return; } else if (!bsf) { -av_log(NULL, AV_LOG_ERROR, "Unknown bit stream filter '%s'.\n", name); +av_log(NULL, AV_LOG_ERROR, "Unknown bit stream filter '%s'.\n", bsf_name); return; } @@ -1205,10 +1205,10 @@ int init_report(const char *env, FILE **file) report_file = fopen(filename.str, "w"); if (!report_file) { -int ret = AVERROR(errno); +int err = AVERROR(errno); av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n", filename.str, strerror(errno)); -return ret; +return err; } av_log_set_callback(log_callback_report); av_log(NULL, AV_LOG_INFO, -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 03/60] fftools/opt_common: use av_err2str instead of strerror
The strerror function must not be used here, as the error is a AVERROR errno, which depending on the platform no longer corresponds to the actual errno that can be handled by strerror. --- fftools/opt_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/opt_common.c b/fftools/opt_common.c index 059f7a53d2..dc5fc7b96d 100644 --- a/fftools/opt_common.c +++ b/fftools/opt_common.c @@ -1207,7 +1207,7 @@ int init_report(const char *env, FILE **file) if (!report_file) { int err = AVERROR(errno); av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n", - filename.str, strerror(errno)); + filename.str, av_err2str(errno)); return err; } av_log_set_callback(log_callback_report); -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 04/60] lavfi/vf_ssim360: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed to av_log, so av_err2str can be used. --- libavfilter/vf_ssim360.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavfilter/vf_ssim360.c b/libavfilter/vf_ssim360.c index 57da2f3938..68bd7b4d78 100644 --- a/libavfilter/vf_ssim360.c +++ b/libavfilter/vf_ssim360.c @@ -1320,12 +1320,9 @@ static av_cold int init(AVFilterContext *ctx) } else { s->stats_file = avpriv_fopen_utf8(s->stats_file_str, "w"); if (!s->stats_file) { -char buf[128]; - err = AVERROR(errno); -av_strerror(err, buf, sizeof(buf)); av_log(ctx, AV_LOG_ERROR, "Could not open stats file %s: %s\n", - s->stats_file_str, buf); + s->stats_file_str, av_err2str(err)); return err; } } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 05/60] lavfi/vf_ssim360: fix variable shadowing
--- libavfilter/vf_ssim360.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libavfilter/vf_ssim360.c b/libavfilter/vf_ssim360.c index 68bd7b4d78..42632bcd85 100644 --- a/libavfilter/vf_ssim360.c +++ b/libavfilter/vf_ssim360.c @@ -1132,7 +1132,7 @@ static int do_ssim360(FFFrameSync *fs) AVFrame *master, *ref; AVDictionary **metadata; double c[4], ssim360v = 0.0, ssim360p50 = 0.0; -int i, ret; +int ret; int need_frame_skip = s->nb_net_frames % (s->frame_skip_ratio + 1); HeatmapList* h_ptr = NULL; @@ -1153,7 +1153,7 @@ static int do_ssim360(FFFrameSync *fs) return ret; } -for (i = 0; i < s->nb_components; i++) { +for (int i = 0; i < s->nb_components; i++) { if (s->use_tape) { c[i] = ssim360_tape(master->data[i], s->main_tape_map[i][0], ref->data[i],s->ref_tape_map [i][0], @@ -1191,16 +1191,16 @@ static int do_ssim360(FFFrameSync *fs) // Record percentiles from histogram and attach metadata when using tape if (s->use_tape) { -int i, p, hist_indices[4]; +int hist_indices[4]; double hist_weight[4]; -for (i = 0; i < s->nb_components; i++) { +for (int i = 0; i < s->nb_components; i++) { hist_indices[i] = SSIM360_HIST_SIZE - 1; hist_weight[i] = 0; } -for (p = 0; PERCENTILE_LIST[p] >= 0.0; p ++) { -for (i = 0; i < s->nb_components; i++) { +for (int p = 0; PERCENTILE_LIST[p] >= 0.0; p ++) { +for (int i = 0; i < s->nb_components; i++) { double target_weight, ssim360p; // Target weight = total number of samples above the specified percentile @@ -1218,12 +1218,12 @@ static int do_ssim360(FFFrameSync *fs) } } -for (i = 0; i < s->nb_components; i++) { +for (int i = 0; i < s->nb_components; i++) { memset(s->ssim360_hist[i], 0, SSIM360_HIST_SIZE * sizeof(double)); s->ssim360_hist_net[i] = 0; } -for (i = 0; i < s->nb_components; i++) { +for (int i = 0; i < s->nb_components; i++) { int cidx = s->is_rgb ? s->rgba_map[i] : i; set_meta(metadata, "lavfi.ssim360.", s->comps[i], c[cidx]); } @@ -1235,7 +1235,7 @@ static int do_ssim360(FFFrameSync *fs) if (s->stats_file) { fprintf(s->stats_file, "n:%"PRId64" ", s->nb_ssim_frames); -for (i = 0; i < s->nb_components; i++) { +for (int i = 0; i < s->nb_components; i++) { int cidx = s->is_rgb ? s->rgba_map[i] : i; fprintf(s->stats_file, "%c:%f ", s->comps[i], c[cidx]); } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 11/60] lavfi/vf_ssim: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed to av_log, so av_err2str can be used. --- libavfilter/vf_ssim.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c index 97bffcf70c..54e28d43bd 100644 --- a/libavfilter/vf_ssim.c +++ b/libavfilter/vf_ssim.c @@ -414,10 +414,8 @@ static av_cold int init(AVFilterContext *ctx) s->stats_file = avpriv_fopen_utf8(s->stats_file_str, "w"); if (!s->stats_file) { int err = AVERROR(errno); -char buf[128]; -av_strerror(err, buf, sizeof(buf)); av_log(ctx, AV_LOG_ERROR, "Could not open stats file %s: %s\n", - s->stats_file_str, buf); + s->stats_file_str, av_err2str(err)); return err; } } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 06/60] fftools/cmdutils: fix variable shadowing
--- fftools/cmdutils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index f725c31c12..a9a7ff4194 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -802,7 +802,7 @@ int split_commandline(OptionParseContext *octx, int argc, char *argv[], while (optindex < argc) { const char *opt = argv[optindex++], *arg; const OptionDef *po; -int ret, group_idx; +int group_idx; av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt); @@ -1366,7 +1366,7 @@ int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id, } int setup_find_stream_info_opts(AVFormatContext *s, -AVDictionary *codec_opts, +AVDictionary *local_codec_opts, AVDictionary ***dst) { int ret; @@ -1382,7 +1382,7 @@ int setup_find_stream_info_opts(AVFormatContext *s, return AVERROR(ENOMEM); for (int i = 0; i < s->nb_streams; i++) { -ret = filter_codec_opts(codec_opts, s->streams[i]->codecpar->codec_id, +ret = filter_codec_opts(local_codec_opts, s->streams[i]->codecpar->codec_id, s, s->streams[i], NULL, &opts[i], NULL); if (ret < 0) goto fail; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 12/60] lavfi/vf_ssim: narrow variable scopes
--- libavfilter/vf_ssim.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c index 54e28d43bd..52b22a6870 100644 --- a/libavfilter/vf_ssim.c +++ b/libavfilter/vf_ssim.c @@ -194,9 +194,8 @@ static float ssim_end1(int s1, int s2, int ss, int s12) static float ssim_endn_16bit(const int64_t (*sum0)[4], const int64_t (*sum1)[4], int width, int max) { float ssim = 0.0; -int i; -for (i = 0; i < width; i++) +for (int i = 0; i < width; i++) ssim += ssim_end1x(sum0[i][0] + sum0[i + 1][0] + sum1[i][0] + sum1[i + 1][0], sum0[i][1] + sum0[i + 1][1] + sum1[i][1] + sum1[i + 1][1], sum0[i][2] + sum0[i + 1][2] + sum1[i][2] + sum1[i + 1][2], @@ -208,9 +207,8 @@ static float ssim_endn_16bit(const int64_t (*sum0)[4], const int64_t (*sum1)[4], static double ssim_endn_8bit(const int (*sum0)[4], const int (*sum1)[4], int width) { double ssim = 0.0; -int i; -for (i = 0; i < width; i++) +for (int i = 0; i < width; i++) ssim += ssim_end1(sum0[i][0] + sum0[i + 1][0] + sum1[i][0] + sum1[i + 1][0], sum0[i][1] + sum0[i + 1][1] + sum1[i][1] + sum1[i + 1][1], sum0[i][2] + sum0[i + 1][2] + sum1[i][2] + sum1[i + 1][2], @@ -443,7 +441,7 @@ static int config_input_ref(AVFilterLink *inlink) const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); AVFilterContext *ctx = inlink->dst; SSIMContext *s = ctx->priv; -int sum = 0, i; +int sum = 0; s->nb_threads = ff_filter_get_nb_threads(ctx); s->nb_components = desc->nb_components; @@ -464,9 +462,9 @@ static int config_input_ref(AVFilterLink *inlink) s->planeheight[0] = s->planeheight[3] = inlink->h; s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w); s->planewidth[0] = s->planewidth[3] = inlink->w; -for (i = 0; i < s->nb_components; i++) +for (int i = 0; i < s->nb_components; i++) sum += s->planeheight[i] * s->planewidth[i]; -for (i = 0; i < s->nb_components; i++) +for (int i = 0; i < s->nb_components; i++) s->coefs[i] = (double) s->planeheight[i] * s->planewidth[i] / sum; s->temp = av_calloc(s->nb_threads, sizeof(*s->temp)); @@ -544,9 +542,8 @@ static av_cold void uninit(AVFilterContext *ctx) if (s->nb_frames > 0) { char buf[256]; -int i; buf[0] = 0; -for (i = 0; i < s->nb_components; i++) { +for (int i = 0; i < s->nb_components; i++) { int c = s->is_rgb ? s->rgba_map[i] : i; av_strlcatf(buf, sizeof(buf), " %c:%f (%f)", s->comps[i], s->ssim[c] / s->nb_frames, ssim_db(s->ssim[c], s->nb_frames)); -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 07/60] lavfi/vf_psnr: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed to av_log, so av_err2str can be used. --- libavfilter/vf_psnr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c index 1f02811806..4a5db5df23 100644 --- a/libavfilter/vf_psnr.c +++ b/libavfilter/vf_psnr.c @@ -290,10 +290,8 @@ static av_cold int init(AVFilterContext *ctx) s->stats_file = avpriv_fopen_utf8(s->stats_file_str, "w"); if (!s->stats_file) { int err = AVERROR(errno); -char buf[128]; -av_strerror(err, buf, sizeof(buf)); av_log(ctx, AV_LOG_ERROR, "Could not open stats file %s: %s\n", - s->stats_file_str, buf); + s->stats_file_str, av_err2str(err)); return err; } } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 13/60] lavfi/f_metadata: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed to av_log, so av_err2str can be used. --- libavfilter/f_metadata.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c index 1a72284790..abdfb1802b 100644 --- a/libavfilter/f_metadata.c +++ b/libavfilter/f_metadata.c @@ -276,10 +276,8 @@ static av_cold int init(AVFilterContext *ctx) } if (ret < 0) { -char buf[128]; -av_strerror(ret, buf, sizeof(buf)); av_log(ctx, AV_LOG_ERROR, "Could not open %s: %s\n", - s->file_str, buf); + s->file_str, av_err2str(ret)); return ret; } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 08/60] lavfi/vf_vmafmotion: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed to av_log, so av_err2str can be used. --- libavfilter/vf_vmafmotion.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c index 7bc73416e8..f9315e56b6 100644 --- a/libavfilter/vf_vmafmotion.c +++ b/libavfilter/vf_vmafmotion.c @@ -318,10 +318,8 @@ static av_cold int init(AVFilterContext *ctx) s->stats_file = avpriv_fopen_utf8(s->stats_file_str, "w"); if (!s->stats_file) { int err = AVERROR(errno); -char buf[128]; -av_strerror(err, buf, sizeof(buf)); av_log(ctx, AV_LOG_ERROR, "Could not open stats file %s: %s\n", - s->stats_file_str, buf); + s->stats_file_str, av_err2str(err)); return err; } } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 09/60] lavfi/vf_vmafmotion: fix variable shadowing
--- libavfilter/vf_vmafmotion.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c index f9315e56b6..a8adc67019 100644 --- a/libavfilter/vf_vmafmotion.c +++ b/libavfilter/vf_vmafmotion.c @@ -90,11 +90,10 @@ static void convolution_x(const uint16_t *filter, int filt_w, const uint16_t *sr int borders_left = radius; int borders_right = w - (filt_w - radius); int i, j, k; -int sum = 0; for (i = 0; i < h; i++) { for (j = 0; j < borders_left; j++) { -sum = 0; +int sum = 0; for (k = 0; k < filt_w; k++) { int j_tap = FFABS(j - radius + k); if (j_tap >= w) { @@ -114,7 +113,7 @@ static void convolution_x(const uint16_t *filter, int filt_w, const uint16_t *sr } for (j = borders_right; j < w; j++) { -sum = 0; +int sum = 0; for (k = 0; k < filt_w; k++) { int j_tap = FFABS(j - radius + k); if (j_tap >= w) { -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 14/60] lavfi/vf_signature: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed to av_log, so av_err2str can be used. --- libavfilter/vf_signature.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c index f205f6919f..f419522ac6 100644 --- a/libavfilter/vf_signature.c +++ b/libavfilter/vf_signature.c @@ -386,9 +386,7 @@ static int xml_export(AVFilterContext *ctx, StreamContext *sc, const char* filen f = avpriv_fopen_utf8(filename, "w"); if (!f) { int err = AVERROR(EINVAL); -char buf[128]; -av_strerror(err, buf, sizeof(buf)); -av_log(ctx, AV_LOG_ERROR, "cannot open xml file %s: %s\n", filename, buf); +av_log(ctx, AV_LOG_ERROR, "cannot open xml file %s: %s\n", filename, av_err2str(err)); return err; } @@ -500,9 +498,7 @@ static int binary_export(AVFilterContext *ctx, StreamContext *sc, const char* fi f = avpriv_fopen_utf8(filename, "wb"); if (!f) { int err = AVERROR(EINVAL); -char buf[128]; -av_strerror(err, buf, sizeof(buf)); -av_log(ctx, AV_LOG_ERROR, "cannot open file %s: %s\n", filename, buf); +av_log(ctx, AV_LOG_ERROR, "cannot open file %s: %s\n", filename, av_err2str(err)); av_freep(&buffer); return err; } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 10/60] lavfi/vf_vmafmotion: narrow variable scopes
--- libavfilter/vf_vmafmotion.c | 53 + 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c index a8adc67019..3f1bd1a6e2 100644 --- a/libavfilter/vf_vmafmotion.c +++ b/libavfilter/vf_vmafmotion.c @@ -67,10 +67,9 @@ static uint64_t image_sad(const uint16_t *img1, const uint16_t *img2, int w, ptrdiff_t img1_stride = _img1_stride / sizeof(*img1); ptrdiff_t img2_stride = _img2_stride / sizeof(*img2); uint64_t sum = 0; -int i, j; -for (i = 0; i < h; i++) { -for (j = 0; j < w; j++) { +for (int i = 0; i < h; i++) { +for (int j = 0; j < w; j++) { sum += abs(img1[j] - img2[j]); } img1 += img1_stride; @@ -89,12 +88,11 @@ static void convolution_x(const uint16_t *filter, int filt_w, const uint16_t *sr int radius = filt_w / 2; int borders_left = radius; int borders_right = w - (filt_w - radius); -int i, j, k; -for (i = 0; i < h; i++) { -for (j = 0; j < borders_left; j++) { +for (int i = 0; i < h; i++) { +for (int j = 0; j < borders_left; j++) { int sum = 0; -for (k = 0; k < filt_w; k++) { +for (int k = 0; k < filt_w; k++) { int j_tap = FFABS(j - radius + k); if (j_tap >= w) { j_tap = w - (j_tap - w + 1); @@ -104,17 +102,17 @@ static void convolution_x(const uint16_t *filter, int filt_w, const uint16_t *sr dst[i * dst_stride + j] = sum >> BIT_SHIFT; } -for (j = borders_left; j < borders_right; j++) { +for (int j = borders_left; j < borders_right; j++) { int sum = 0; -for (k = 0; k < filt_w; k++) { +for (int k = 0; k < filt_w; k++) { sum += filter[k] * src[i * src_stride + j - radius + k]; } dst[i * dst_stride + j] = sum >> BIT_SHIFT; } -for (j = borders_right; j < w; j++) { +for (int j = borders_right; j < w; j++) { int sum = 0; -for (k = 0; k < filt_w; k++) { +for (int k = 0; k < filt_w; k++) { int j_tap = FFABS(j - radius + k); if (j_tap >= w) { j_tap = w - (j_tap - w + 1); @@ -138,13 +136,11 @@ static void convolution_y_##bits##bit(const uint16_t *filter, int filt_w, \ int radius = filt_w / 2; \ int borders_top = radius; \ int borders_bottom = h - (filt_w - radius); \ -int i, j, k; \ -int sum = 0; \ \ -for (i = 0; i < borders_top; i++) { \ -for (j = 0; j < w; j++) { \ -sum = 0; \ -for (k = 0; k < filt_w; k++) { \ +for (int i = 0; i < borders_top; i++) { \ +for (int j = 0; j < w; j++) { \ +int sum = 0; \ +for (int k = 0; k < filt_w; k++) { \ int i_tap = FFABS(i - radius + k); \ if (i_tap >= h) { \ i_tap = h - (i_tap - h + 1); \ @@ -154,19 +150,19 @@ static void convolution_y_##bits##bit(const uint16_t *filter, int filt_w, \ dst[i * dst_stride + j] = sum >> bits; \ } \ } \ -for (i = borders_top; i < borders_bottom; i++) { \ -for (j = 0; j < w; j++) { \ -sum = 0; \ -for (k = 0; k < filt_w; k++) { \ +for (int i = borders_top; i < borders_bottom; i++) { \ +for (int j = 0; j < w; j++) { \ +int sum = 0; \ +for (int k = 0; k < filt_w; k++) { \ sum += filter[k] * src[(i - radius + k) * src_stride + j]; \ } \ dst[i * dst_stride + j] = sum >> bits; \ } \ } \ -for (i = borders_bottom; i < h; i++) { \ -for (j = 0; j < w; j++) { \ -sum = 0; \ -for (k = 0; k < filt_w; k++) { \ +for (int i = borders_bottom; i < h; i++) { \ +for (int j = 0; j < w; j++) { \ +int sum = 0; \ +for (int k = 0; k < filt_w; k++) { \ int i_tap = FFABS(i - radius + k); \ if (i_tap >= h) { \ i_tap = h - (i_tap - h + 1); \ @@ -237,7 +233,6 @@ int ff_vmafmotion_init(VMAFMotionData *s, int w, int h, enum AVPixelFormat fmt) { size_t data_sz; -int i; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt); if (w < 3 || h < 3) @@ -254,7 +249,7 @@ int ff_vmafmotion_init(VMAFMotionData *s, return AVERROR(ENOMEM); } -for (i = 0; i < 5; i++) { +for (int i = 0; i < 5; i++) { s->filter[i] = lrint(FILTER_5[i] * (1 << BIT_SHIFT)); } @@ -266,9 +261,9 @@ int ff_vmafmotion_init(VMAFMotionData *s, static int query_formats(AVFilterContext *ctx) { AVFilterFormats *fmts_list = NULL; -int format, ret; +int ret; -for (format = 0; av_pix_fmt_desc_get(format); format++) { +for (int format =
[FFmpeg-devel] [PATCH 15/60] avformat/network: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed to av_log, so av_err2str can be used. --- libavformat/network.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/libavformat/network.c b/libavformat/network.c index 6db82b6d26..2eabd0c167 100644 --- a/libavformat/network.c +++ b/libavformat/network.c @@ -287,16 +287,14 @@ int ff_listen_connect(int fd, const struct sockaddr *addr, if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen)) ret = AVUNERROR(ff_neterrno()); if (ret != 0) { -char errbuf[100]; ret = AVERROR(ret); -av_strerror(ret, errbuf, sizeof(errbuf)); if (will_try_next) av_log(h, AV_LOG_WARNING, "Connection to %s failed (%s), trying next address\n", - h->filename, errbuf); + h->filename, av_err2str(ret)); else av_log(h, AV_LOG_ERROR, "Connection to %s failed: %s\n", - h->filename, errbuf); + h->filename, av_err2str(ret)); } default: return ret; @@ -421,7 +419,7 @@ int ff_connect_parallel(struct addrinfo *addrs, int timeout_ms_per_address, int64_t next_attempt_us = av_gettime_relative(), next_deadline_us; int last_err = AVERROR(EIO); socklen_t optlen; -char errbuf[100], hostbuf[100], portbuf[20]; +char hostbuf[100], portbuf[20]; if (parallel > FF_ARRAY_ELEMS(attempts)) parallel = FF_ARRAY_ELEMS(attempts); @@ -445,9 +443,8 @@ int ff_connect_parallel(struct addrinfo *addrs, int timeout_ms_per_address, timeout_ms_per_address, h, customize_fd, customize_ctx); if (last_err < 0) { -av_strerror(last_err, errbuf, sizeof(errbuf)); av_log(h, AV_LOG_VERBOSE, "Connected attempt failed: %s\n", - errbuf); + av_err2str(last_err)); continue; } if (last_err > 0) { @@ -511,9 +508,8 @@ int ff_connect_parallel(struct addrinfo *addrs, int timeout_ms_per_address, getnameinfo(attempts[i].addr->ai_addr, attempts[i].addr->ai_addrlen, hostbuf, sizeof(hostbuf), portbuf, sizeof(portbuf), NI_NUMERICHOST | NI_NUMERICSERV); -av_strerror(last_err, errbuf, sizeof(errbuf)); av_log(h, AV_LOG_VERBOSE, "Connection attempt to %s port %s " - "failed: %s\n", hostbuf, portbuf, errbuf); + "failed: %s\n", hostbuf, portbuf, av_err2str(last_err)); closesocket(attempts[i].fd); memmove(&attempts[i], &attempts[i + 1], (nb_attempts - i - 1) * sizeof(*attempts)); @@ -528,9 +524,8 @@ int ff_connect_parallel(struct addrinfo *addrs, int timeout_ms_per_address, if (last_err >= 0) last_err = AVERROR(ECONNREFUSED); if (last_err != AVERROR_EXIT) { -av_strerror(last_err, errbuf, sizeof(errbuf)); av_log(h, AV_LOG_ERROR, "Connection to %s failed: %s\n", - h->filename, errbuf); + h->filename, av_err2str(last_err)); } return last_err; } @@ -591,7 +586,5 @@ int ff_http_match_no_proxy(const char *no_proxy, const char *hostname) void ff_log_net_error(void *ctx, int level, const char* prefix) { -char errbuf[100]; -av_strerror(ff_neterrno(), errbuf, sizeof(errbuf)); -av_log(ctx, level, "%s: %s\n", prefix, errbuf); +av_log(ctx, level, "%s: %s\n", prefix, av_err2str(ff_neterrno())); } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 16/60] avformat/dashdec: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed to av_log, so av_err2str can be used. --- libavformat/dashenc.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index d4a6fe0304..df9d0c9d50 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -277,10 +277,8 @@ static const char *get_extension_str(SegmentType type, int single_file) static int handle_io_open_error(AVFormatContext *s, int err, char *url) { DASHContext *c = s->priv_data; -char errbuf[AV_ERROR_MAX_STRING_SIZE]; -av_strerror(err, errbuf, sizeof(errbuf)); av_log(s, c->ignore_io_errors ? AV_LOG_WARNING : AV_LOG_ERROR, - "Unable to open %s for writing: %s\n", url, errbuf); + "Unable to open %s for writing: %s\n", url, av_err2str(err)); return c->ignore_io_errors ? 0 : err; } @@ -1054,7 +1052,7 @@ static int parse_adaptation_sets(AVFormatContext *s) } else if ((state != new_set) && av_strstart(p, "streams=", &p)) { //descriptor and durations are optional state = parsing_streams; } else if (state == parsing_streams) { -AdaptationSet *as = &c->as[c->nb_as - 1]; +AdaptationSet *tmp_as = &c->as[c->nb_as - 1]; char idx_str[8], *end_str; n = strcspn(p, " ,"); @@ -1062,7 +1060,7 @@ static int parse_adaptation_sets(AVFormatContext *s) p += n; // if value is "a" or "v", map all streams of that type -if (as->media_type == AVMEDIA_TYPE_UNKNOWN && (idx_str[0] == 'v' || idx_str[0] == 'a')) { +if (tmp_as->media_type == AVMEDIA_TYPE_UNKNOWN && (idx_str[0] == 'v' || idx_str[0] == 'a')) { enum AVMediaType type = (idx_str[0] == 'v') ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO; av_log(s, AV_LOG_DEBUG, "Map all streams of type %s\n", idx_str); @@ -1070,7 +1068,7 @@ static int parse_adaptation_sets(AVFormatContext *s) if (s->streams[i]->codecpar->codec_type != type) continue; -as->media_type = s->streams[i]->codecpar->codec_type; +tmp_as->media_type = s->streams[i]->codecpar->codec_type; if ((ret = adaptation_set_add_stream(s, c->nb_as, i)) < 0) return ret; @@ -1083,8 +1081,8 @@ static int parse_adaptation_sets(AVFormatContext *s) } av_log(s, AV_LOG_DEBUG, "Map stream %d\n", i); -if (as->media_type == AVMEDIA_TYPE_UNKNOWN) { -as->media_type = s->streams[i]->codecpar->codec_type; +if (tmp_as->media_type == AVMEDIA_TYPE_UNKNOWN) { +tmp_as->media_type = s->streams[i]->codecpar->codec_type; } if ((ret = adaptation_set_add_stream(s, c->nb_as, i)) < 0) @@ -1865,9 +1863,8 @@ static void dashenc_delete_file(AVFormatContext *s, char *filename) { } else { int res = ffurl_delete(filename); if (res < 0) { -char errbuf[AV_ERROR_MAX_STRING_SIZE]; -av_strerror(res, errbuf, sizeof(errbuf)); -av_log(s, (res == AVERROR(ENOENT) ? AV_LOG_WARNING : AV_LOG_ERROR), "failed to delete %s: %s\n", filename, errbuf); +av_log(s, (res == AVERROR(ENOENT) ? AV_LOG_WARNING : AV_LOG_ERROR), "failed to delete %s: %s\n", +filename, av_err2str(res)); } } } @@ -2120,7 +2117,7 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt) if (!os->availability_time_offset && ((os->frag_type == FRAG_TYPE_DURATION && os->seg_duration != os->frag_duration) || (os->frag_type == FRAG_TYPE_EVERY_FRAME && pkt->duration))) { -AdaptationSet *as = &c->as[os->as_idx - 1]; +AdaptationSet *tmp_as = &c->as[os->as_idx - 1]; int64_t frame_duration = 0; switch (os->frag_type) { @@ -2134,7 +2131,7 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt) os->availability_time_offset = ((double) os->seg_duration - frame_duration) / AV_TIME_BASE; -as->max_frag_duration = FFMAX(frame_duration, as->max_frag_duration); +tmp_as->max_frag_duration = FFMAX(frame_duration, tmp_as->max_frag_duration); } if (c->use_template && !c->use_timeline) { -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 17/60] avformat/crypto: fix variable shadowing
--- libavformat/crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/crypto.c b/libavformat/crypto.c index cd462e7b9d..868f6ddc25 100644 --- a/libavformat/crypto.c +++ b/libavformat/crypto.c @@ -62,7 +62,7 @@ typedef struct CryptoContext { #define OFFSET(x) offsetof(CryptoContext, x) #define D AV_OPT_FLAG_DECODING_PARAM #define E AV_OPT_FLAG_ENCODING_PARAM -static const AVOption options[] = { +static const AVOption crypto_options[] = { {"key", "AES encryption/decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, .flags = D|E }, {"iv", "AES encryption/decryption initialization vector", OFFSET(iv), AV_OPT_TYPE_BINARY, .flags = D|E }, {"decryption_key", "AES decryption key", OFFSET(decrypt_key), AV_OPT_TYPE_BINARY, .flags = D }, @@ -75,7 +75,7 @@ static const AVOption options[] = { static const AVClass crypto_class = { .class_name = "crypto", .item_name = av_default_item_name, -.option = options, +.option = crypto_options, .version= LIBAVUTIL_VERSION_INT, }; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 18/60] avutil/file: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed to av_log, so av_err2str can be used. --- libavutil/file.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libavutil/file.c b/libavutil/file.c index 2d1063b6a2..db8507286b 100644 --- a/libavutil/file.c +++ b/libavutil/file.c @@ -60,21 +60,18 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, struct stat st; av_unused void *ptr; off_t off_size; -char errbuf[128]; *bufptr = NULL; *size = 0; if (fd < 0) { err = AVERROR(errno); -av_strerror(err, errbuf, sizeof(errbuf)); -av_log(&file_log_ctx, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename, errbuf); +av_log(&file_log_ctx, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename, av_err2str(err)); return err; } if (fstat(fd, &st) < 0) { err = AVERROR(errno); -av_strerror(err, errbuf, sizeof(errbuf)); -av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in fstat(): %s\n", errbuf); +av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in fstat(): %s\n", av_err2str(err)); close(fd); return err; } @@ -97,8 +94,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, ptr = mmap(NULL, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); if (ptr == MAP_FAILED) { err = AVERROR(errno); -av_strerror(err, errbuf, sizeof(errbuf)); -av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in mmap(): %s\n", errbuf); +av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in mmap(): %s\n", av_err2str(err)); close(fd); *size = 0; return err; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 19/60] avdevice/jack: use av_err2str to simplify code
No need to explicitly specify the buffer here as it is only ever passed to av_log, so av_err2str can be used. --- libavdevice/jack.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavdevice/jack.c b/libavdevice/jack.c index d52bb06822..bb06971fe6 100644 --- a/libavdevice/jack.c +++ b/libavdevice/jack.c @@ -291,11 +291,9 @@ static int audio_read_packet(AVFormatContext *context, AVPacket *pkt) av_log(context, AV_LOG_ERROR, "Input error: timed out when waiting for JACK process callback output\n"); } else { -char errbuf[128]; int ret = AVERROR(errno); -av_strerror(ret, errbuf, sizeof(errbuf)); av_log(context, AV_LOG_ERROR, "Error while waiting for audio packet: %s\n", - errbuf); + av_err2str(ret)); } if (!self->client) av_log(context, AV_LOG_ERROR, "Input error: JACK server is gone\n"); -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 20/60] fftools/ffmpeg_mux_init: remove unused variable
This dict is declared and freed but nothing is ever written to it. --- fftools/ffmpeg_mux_init.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 37d626add6..8d475f5b45 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -915,7 +915,6 @@ static int streamcopy_init(const Muxer *mux, OutputStream *ost, AVDictionary **e uint32_t codec_tag = par->codec_tag; AVCodecContext *codec_ctx = NULL; -AVDictionary*codec_opts = NULL; AVRational fr = ost->frame_rate; @@ -1019,7 +1018,6 @@ static int streamcopy_init(const Muxer *mux, OutputStream *ost, AVDictionary **e fail: avcodec_free_context(&codec_ctx); -av_dict_free(&codec_opts); return ret; } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 21/60] fftools/ffmpeg_mux_init: fix variable shadowing
--- fftools/ffmpeg_mux_init.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 8d475f5b45..c2867192ee 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -661,11 +661,9 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, } opt_match_per_stream_str(ost, &o->chroma_intra_matrices, oc, st, &chroma_intra_matrix); if (chroma_intra_matrix) { -uint16_t *p = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64); -if (!p) +if (!(video_enc->chroma_intra_matrix = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64))) return AVERROR(ENOMEM); -video_enc->chroma_intra_matrix = p; -ret = parse_matrix_coeffs(ost, p, chroma_intra_matrix); +ret = parse_matrix_coeffs(ost, video_enc->chroma_intra_matrix, chroma_intra_matrix); if (ret < 0) return ret; } @@ -728,8 +726,8 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, FILE *f; /* compute this stream's global index */ -for (int i = 0; i <= ost->file->index; i++) -ost_idx += output_files[i]->nb_streams; +for (int idx = 0; idx <= ost->file->index; idx++) +ost_idx += output_files[idx]->nb_streams; snprintf(logfilename, sizeof(logfilename), "%s-%d.log", ost->logfile_prefix ? ost->logfile_prefix : @@ -1145,21 +1143,20 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, return AVERROR(ENOMEM); if (ost->enc_ctx) { -AVCodecContext *enc = ost->enc_ctx; AVIOContext *s = NULL; char *buf = NULL, *arg = NULL; const char *enc_stats_pre = NULL, *enc_stats_post = NULL, *mux_stats = NULL; const char *enc_time_base = NULL, *preset = NULL; -ret = filter_codec_opts(o->g->codec_opts, enc->codec_id, -oc, st, enc->codec, &encoder_opts, +ret = filter_codec_opts(o->g->codec_opts, ost->enc_ctx->codec_id, +oc, st, ost->enc_ctx->codec, &encoder_opts, &mux->enc_opts_used); if (ret < 0) goto fail; opt_match_per_stream_str(ost, &o->presets, oc, st, &preset); opt_match_per_stream_int(ost, &o->autoscale, oc, st, &autoscale); -if (preset && (!(ret = get_preset_file_2(preset, enc->codec->name, &s { +if (preset && (!(ret = get_preset_file_2(preset, ost->enc_ctx->codec->name, &s { AVBPrint bprint; av_bprint_init(&bprint, 0, AV_BPRINT_SIZE_UNLIMITED); do { -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 22/60] fftools/ffmpeg_demux: fix variable shadowing
--- fftools/ffmpeg_demux.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 039ee0c785..18938f1f12 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -1597,7 +1597,7 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch) InputFile *f; AVFormatContext *ic; const AVInputFormat *file_iformat = NULL; -int err, i, ret = 0; +int err, ret = 0; int64_t timestamp; AVDictionary *opts_used = NULL; const char*video_codec_name = NULL; @@ -1752,7 +1752,7 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch) return ret; /* apply forced codec ids */ -for (i = 0; i < ic->nb_streams; i++) { +for (int i = 0; i < ic->nb_streams; i++) { const AVCodec *dummy; ret = choose_decoder(o, f, ic, ic->streams[i], HWACCEL_NONE, AV_HWDEVICE_TYPE_NONE, &dummy); @@ -1772,7 +1772,7 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch) first frames to get it. (used in mpeg case for example) */ ret = avformat_find_stream_info(ic, opts); -for (i = 0; i < orig_nb_streams; i++) +for (int i = 0; i < orig_nb_streams; i++) av_dict_free(&opts[i]); av_freep(&opts); @@ -1813,7 +1813,7 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch) if (!(ic->iformat->flags & AVFMT_SEEK_TO_PTS)) { int dts_heuristic = 0; -for (i=0; inb_streams; i++) { +for (int i = 0; i < ic->nb_streams; i++) { const AVCodecParameters *par = ic->streams[i]->codecpar; if (par->video_delay) { dts_heuristic = 1; @@ -1887,7 +1887,7 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch) if (ret < 0) return ret; -for (i = 0; i < o->dump_attachment.nb_opt; i++) { +for (int i = 0; i < o->dump_attachment.nb_opt; i++) { int j; for (j = 0; j < f->nb_streams; j++) { -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 23/60] fftools/ffmpeg_demux: narrow variable scope
--- fftools/ffmpeg_demux.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 18938f1f12..0b639f2b60 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -1888,9 +1888,7 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch) return ret; for (int i = 0; i < o->dump_attachment.nb_opt; i++) { -int j; - -for (j = 0; j < f->nb_streams; j++) { +for (int j = 0; j < f->nb_streams; j++) { InputStream *ist = f->streams[j]; if (check_stream_specifier(ic, ist->st, o->dump_attachment.opt[i].specifier) == 1) { -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 24/60] avcodec/libx264: fix variable shadowing
--- libavcodec/libx264.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index d07a65a103..fc0f182bf4 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -564,12 +564,12 @@ static int setup_frame(AVCodecContext *ctx, const AVFrame *frame, mbinfo_sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIDEO_HINT); if (mbinfo_sd) { -int ret = setup_mb_info(ctx, pic, frame, (const AVVideoHint *)mbinfo_sd->data); -if (ret < 0) { +int err = setup_mb_info(ctx, pic, frame, (const AVVideoHint *)mbinfo_sd->data); +if (err < 0) { /* No need to fail here, this is not fatal. We just proceed with no * mb_info and log a message */ -av_log(ctx, AV_LOG_WARNING, "setup_mb_info failed with error: %s\n", av_err2str(ret)); +av_log(ctx, AV_LOG_WARNING, "setup_mb_info failed with error: %s\n", av_err2str(err)); } } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 25/60] avcodec/mjpegdec: fix variable shadowing
--- libavcodec/mjpegdec.c| 15 +++ libavcodec/mjpegenc_common.c | 13 ++--- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 7daec649bc..86ec58713c 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2377,7 +2377,7 @@ int ff_mjpeg_decode_frame_from_buf(AVCodecContext *avctx, AVFrame *frame, int hshift, vshift; int unescaped_buf_size; int start_code; -int i, index; +int index; int ret = 0; int is16bit; AVDictionaryEntry *e = NULL; @@ -2657,7 +2657,7 @@ the_end: if (s->upscale_v[p] == 1) h = (h+1)>>1; av_assert0(w > 0); -for (i = 0; i < h; i++) { +for (int i = 0; i < h; i++) { if (s->upscale_h[p] == 1) { if (is16bit) ((uint16_t*)line)[w - 1] = ((uint16_t*)line)[(w - 1) / 2]; else line[w - 1] = line[(w - 1) / 2]; @@ -2735,7 +2735,7 @@ the_end: h = AV_CEIL_RSHIFT(h, vshift); } dst = &((uint8_t *)s->picture_ptr->data[p])[(h - 1) * s->linesize[p]]; -for (i = h - 1; i; i--) { +for (int i = h - 1; i; i--) { uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[p])[i * s->upscale_v[p] / (s->upscale_v[p] + 1) * s->linesize[p]]; uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[p])[(i + 1) * s->upscale_v[p] / (s->upscale_v[p] + 1) * s->linesize[p]]; if (s->upscale_v[p] != 2 && (src1 == src2 || i == h - 1)) { @@ -2777,7 +2777,7 @@ the_end: int w = s->picture_ptr->width; int h = s->picture_ptr->height; av_assert0(s->nb_components == 4); -for (i=0; ipicture_ptr->width; int h = s->picture_ptr->height; av_assert0(s->nb_components == 4); -for (i=0; iiccnum; i++) +for (int i = 0; i < s->iccnum; i++) total_size += s->iccentries[i].length; ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_ICC_PROFILE, total_size, &sd); @@ -2847,7 +2846,7 @@ the_end: if (sd) { /* Reassemble the parts, which are now in-order. */ -for (i = 0; i < s->iccnum; i++) { +for (int i = 0; i < s->iccnum; i++) { memcpy(sd->data + offset, s->iccentries[i].data, s->iccentries[i].length); offset += s->iccentries[i].length; } diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c index 049ae3d929..751e43fd3b 100644 --- a/libavcodec/mjpegenc_common.c +++ b/libavcodec/mjpegenc_common.c @@ -39,18 +39,17 @@ static int put_huffman_table(PutBitContext *p, int table_class, int table_id, const uint8_t *bits_table, const uint8_t *value_table) { -int n, i; +int n = 0; put_bits(p, 4, table_class); put_bits(p, 4, table_id); -n = 0; -for(i=1;i<=16;i++) { +for (int i = 1; i <= 16; i++) { n += bits_table[i]; put_bits(p, 8, bits_table[i]); } -for(i=0;i 1) { put_bits(p, 4, 0); /* 8 bit precision */ put_bits(p, 4, 1); /* table 1 */ -for(i=0;i<64;i++) { -j = intra_matrix_permutation[i]; +for (int i = 0; i < 64; i++) { +uint8_t j = intra_matrix_permutation[i]; put_bits(p, 8, chroma_intra_matrix[j]); } } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 26/60] avcodec/g2meet: fix variable shadowing
--- libavcodec/g2meet.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 7ae987ec40..f952a06f12 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -1052,7 +1052,6 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y, { int width, height; int hdr, zsize, npal, tidx = -1, ret; -int i, j; const uint8_t *src_end = src + src_size; uint8_t pal[768], transp[3]; uLongf dlen = (c->tile_width + 1) * c->tile_height; @@ -1071,11 +1070,10 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y, hdr = *src++; sub_type = hdr >> 5; if (sub_type == 0) { -int j; memcpy(transp, src, 3); src += 3; -for (j = 0; j < height; j++, dst += c->framebuf_stride) -for (i = 0; i < width; i++) +for (int j = 0; j < height; j++, dst += c->framebuf_stride) +for (int i = 0; i < width; i++) memcpy(dst + i * 3, transp, 3); return 0; } else if (sub_type == 1) { @@ -1093,7 +1091,7 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y, memcpy(pal, src, npal * 3); src += npal * 3; if (sub_type != 2) { -for (i = 0; i < npal; i++) { +for (int i = 0; i < npal; i++) { if (!memcmp(pal + i * 3, transp, 3)) { tidx = i; break; @@ -1125,8 +1123,8 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y, bstride = FFALIGN(width, 16) >> 3; // blocks are coded LSB and we need normal bitreader for JPEG data bits = 0; -for (i = 0; i < (FFALIGN(height, 16) >> 4); i++) { -for (j = 0; j < (FFALIGN(width, 16) >> 4); j++) { +for (int i = 0; i < (FFALIGN(height, 16) >> 4); i++) { +for (int j = 0; j < (FFALIGN(width, 16) >> 4); j++) { if (!bits) { if (src >= src_end) return AVERROR_INVALIDDATA; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 27/60] avcodec/flacenc: fix variable shadowing and narrow scopes
--- libavcodec/flacenc.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 3a9578f5cd..83b3f5e324 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -952,7 +952,7 @@ static int lpc_encode_choose_datapath(FlacEncodeContext *s, int32_t bps, static int encode_residual_ch(FlacEncodeContext *s, int ch) { -int i, n; +int n; int min_order, max_order, opt_order, omethod; FlacFrame *frame; FlacSubframe *sub; @@ -970,6 +970,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch) /* CONSTANT */ if (sub->obits > 32) { +int i; for (i = 1; i < n; i++) if(smp_33bps[i] != smp_33bps[0]) break; @@ -978,6 +979,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch) return subframe_count_exact(s, sub, 0); } } else { +int i; for (i = 1; i < n; i++) if(smp[i] != smp[0]) break; @@ -1001,6 +1003,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch) sub->type = FLAC_SUBFRAME_FIXED; if (s->options.lpc_type == FF_LPC_TYPE_NONE || s->options.lpc_type == FF_LPC_TYPE_FIXED || n <= max_order) { +int i; uint64_t bits[MAX_FIXED_ORDER+1]; if (max_order > MAX_FIXED_ORDER) max_order = MAX_FIXED_ORDER; @@ -1045,7 +1048,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch) * probably isn't predictable anyway, throw away LSB for analysis * so it fits 32 bit int and existing function can be used * unmodified */ -for (i = 0; i < n; i++) +for (int i = 0; i < n; i++) smp[i] = smp_33bps[i] >> 1; opt_order = ff_lpc_calc_coefs(&s->lpc_ctx, smp, n, min_order, max_order, @@ -1062,7 +1065,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch) int opt_index = levels-1; opt_order = max_order-1; bits[opt_index] = UINT32_MAX; -for (i = levels-1; i >= 0; i--) { +for (int i = levels-1; i >= 0; i--) { int last_order = order; order = min_order + (((max_order-min_order+1) * (i+1)) / levels)-1; order = av_clip(order, min_order - 1, max_order - 1); @@ -1082,7 +1085,7 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch) uint64_t bits[MAX_LPC_ORDER]; opt_order = 0; bits[0] = UINT32_MAX; -for (i = min_order-1; i < max_order; i++) { +for (int i = min_order-1; i < max_order; i++) { if(lpc_encode_choose_datapath(s, sub->obits, res, smp, smp_33bps, n, i+1, coefs[i], shift[i])) continue; bits[i] = find_subframe_rice_params(s, sub, i+1); @@ -1092,14 +1095,13 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch) opt_order++; } else if (omethod == ORDER_METHOD_LOG) { uint64_t bits[MAX_LPC_ORDER]; -int step; opt_order = min_order - 1 + (max_order-min_order)/3; memset(bits, -1, sizeof(bits)); -for (step = 16; step; step >>= 1) { +for (int step = 16; step; step >>= 1) { int last = opt_order; -for (i = last-step; i <= last+step; i += step) { +for (int i = last-step; i <= last+step; i += step) { if (i < min_order-1 || i >= max_order || bits[i] < UINT32_MAX) continue; if(lpc_encode_choose_datapath(s, sub->obits, res, smp, smp_33bps, n, i+1, coefs[i], shift[i])) @@ -1114,24 +1116,24 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch) if (s->options.multi_dim_quant) { int allsteps = 1; -int i, step, improved; +int improved; int64_t best_score = INT64_MAX; int32_t qmax; qmax = (1 << (s->options.lpc_coeff_precision - 1)) - 1; -for (i=0; iorder = opt_order; sub->type_code = sub->type | (sub->order-1); sub->shift = shift[sub->order-1]; -for (i = 0; i < sub->order; i++) +for (int i = 0; i < sub->order; i++) sub->coefs[i] = coefs[sub->order-1][i]; if(lpc_encode_choose_datapath(s, sub->obits, res, smp, smp_33bps, n, sub->order, sub->coefs, sub->shift)) { -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 28/60] avcodec/fix: fix variable shadowing
--- libavcodec/fic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/fic.c b/libavcodec/fic.c index ec26e3154d..4763fab689 100644 --- a/libavcodec/fic.c +++ b/libavcodec/fic.c @@ -191,8 +191,6 @@ static int fic_decode_slice(AVCodecContext *avctx, void *tdata) for (y = 0; y < (slice_h >> !!p); y += 8) { for (x = 0; x < (ctx->aligned_width >> !!p); x += 8) { -int ret; - if ((ret = fic_decode_block(ctx, &gb, dst + x, stride, tctx->block, &tctx->p_frame)) != 0) return ret; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 29/60] avcodec/fix: narrow variable scopes
--- libavcodec/fic.c | 44 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/libavcodec/fic.c b/libavcodec/fic.c index 4763fab689..8f4277b4e1 100644 --- a/libavcodec/fic.c +++ b/libavcodec/fic.c @@ -113,25 +113,24 @@ static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd static void fic_idct_put(uint8_t *dst, int stride, int16_t *block) { -int i, j; int16_t *ptr; ptr = block; fic_idct(ptr++, 8, 13, (1 << 12) + (1 << 17)); -for (i = 1; i < 8; i++) { +for (int i = 1; i < 8; i++) { fic_idct(ptr, 8, 13, 1 << 12); ptr++; } ptr = block; -for (i = 0; i < 8; i++) { +for (int i = 0; i < 8; i++) { fic_idct(ptr, 1, 20, 0); ptr += 8; } ptr = block; -for (j = 0; j < 8; j++) { -for (i = 0; i < 8; i++) +for (int j = 0; j < 8; j++) { +for (int i = 0; i < 8; i++) dst[i] = av_clip_uint8(ptr[i]); dst += stride; ptr += 8; @@ -140,7 +139,7 @@ static void fic_idct_put(uint8_t *dst, int stride, int16_t *block) static int fic_decode_block(FICContext *ctx, GetBitContext *gb, uint8_t *dst, int stride, int16_t *block, int *is_p) { -int i, num_coeff; +int num_coeff; if (get_bits_left(gb) < 8) return AVERROR_INVALIDDATA; @@ -157,7 +156,7 @@ static int fic_decode_block(FICContext *ctx, GetBitContext *gb, if (num_coeff > 64) return AVERROR_INVALIDDATA; -for (i = 0; i < num_coeff; i++) { +for (int i = 0; i < num_coeff; i++) { int v = get_se_golomb(gb); if (v < -2048 || v > 2048) return AVERROR_INVALIDDATA; @@ -179,18 +178,18 @@ static int fic_decode_slice(AVCodecContext *avctx, void *tdata) int slice_h = tctx->slice_h; int src_size = tctx->src_size; int y_off= tctx->y_off; -int x, y, p, ret; +int ret; ret = init_get_bits8(&gb, src, src_size); if (ret < 0) return ret; -for (p = 0; p < 3; p++) { +for (int p = 0; p < 3; p++) { int stride = ctx->frame->linesize[p]; uint8_t* dst = ctx->frame->data[p] + (y_off >> !!p) * stride; -for (y = 0; y < (slice_h >> !!p); y += 8) { -for (x = 0; x < (ctx->aligned_width >> !!p); x += 8) { +for (int y = 0; y < (slice_h >> !!p); y += 8) { +for (int x = 0; x < (ctx->aligned_width >> !!p); x += 8) { if ((ret = fic_decode_block(ctx, &gb, dst + x, stride, tctx->block, &tctx->p_frame)) != 0) return ret; @@ -206,9 +205,7 @@ static int fic_decode_slice(AVCodecContext *avctx, void *tdata) static av_always_inline void fic_alpha_blend(uint8_t *dst, uint8_t *src, int size, uint8_t *alpha) { -int i; - -for (i = 0; i < size; i++) +for (int i = 0; i < size; i++) dst[i] += ((src[i] - dst[i]) * alpha[i]) >> 8; } @@ -219,10 +216,9 @@ static void fic_draw_cursor(AVCodecContext *avctx, int cur_x, int cur_y) uint8_t *dstptr[3]; uint8_t planes[4][1024]; uint8_t chroma[3][256]; -int i, j, p; /* Convert to YUVA444. */ -for (i = 0; i < 1024; i++) { +for (int i = 0; i < 1024; i++) { planes[0][i] = (( 25 * ptr[0] + 129 * ptr[1] + 66 * ptr[2]) / 255) + 16; planes[1][i] = ((-38 * ptr[0] + 112 * ptr[1] + -74 * ptr[2]) / 255) + 128; planes[2][i] = ((-18 * ptr[0] + 112 * ptr[1] + -94 * ptr[2]) / 255) + 128; @@ -232,22 +228,22 @@ static void fic_draw_cursor(AVCodecContext *avctx, int cur_x, int cur_y) } /* Subsample chroma. */ -for (i = 0; i < 32; i += 2) -for (j = 0; j < 32; j += 2) -for (p = 0; p < 3; p++) +for (int i = 0; i < 32; i += 2) +for (int j = 0; j < 32; j += 2) +for (int p = 0; p < 3; p++) chroma[p][16 * (i / 2) + j / 2] = (planes[p + 1][32 * i + j] + planes[p + 1][32 * i + j + 1] + planes[p + 1][32 * (i + 1) + j] + planes[p + 1][32 * (i + 1) + j + 1]) / 4; /* Seek to x/y pos of cursor. */ -for (i = 0; i < 3; i++) +for (int i = 0; i < 3; i++) dstptr[i] = ctx->final_frame->data[i]+ (ctx->final_frame->linesize[i] * (cur_y >> !!i)) + (cur_x >> !!i) + !!i; /* Copy. */ -for (i = 0; i < FFMIN(32, avctx->height - cur_y) - 1; i += 2) { +for (int i = 0; i < FFMIN(32, avctx->height - cur_y) - 1; i += 2) { int lsize = FFMIN(32, avctx->width - cur_x); int csize = lsize / 2; @@ -272,7 +268,7 @@ static int fic_decode_frame(AVCodecContext *avctx, AVFrame *rframe, FICContex
[FFmpeg-devel] [PATCH 30/60] avcodec/ffv1enc: fix shadowing and narrow variable scopes
--- libavcodec/ffv1enc.c | 113 +- libavcodec/ffv1enc_template.c | 19 +++--- 2 files changed, 63 insertions(+), 69 deletions(-) diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index 23d757e5c6..f054ef0974 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -517,7 +517,7 @@ static av_cold int encode_init(AVCodecContext *avctx) { FFV1Context *s = avctx->priv_data; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); -int i, j, k, m, ret; +int ret; if ((ret = ff_ffv1_common_init(avctx)) < 0) return ret; @@ -704,16 +704,16 @@ static av_cold int encode_init(AVCodecContext *avctx) } if (s->ac == AC_RANGE_CUSTOM_TAB) { -for (i = 1; i < 256; i++) +for (int i = 1; i < 256; i++) s->state_transition[i] = ver2_state[i]; } else { RangeCoder c; ff_build_rac_states(&c, 0.05 * (1LL << 32), 256 - 8); -for (i = 1; i < 256; i++) +for (int i = 1; i < 256; i++) s->state_transition[i] = c.one_state[i]; } -for (i = 0; i < 256; i++) { +for (int i = 0; i < 256; i++) { s->quant_table_count = 2; if (s->bits_per_raw_sample <= 8) { s->quant_tables[0][0][i]= quant11[i]; @@ -753,7 +753,7 @@ static av_cold int encode_init(AVCodecContext *avctx) s->picture_number = 0; if (avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) { -for (i = 0; i < s->quant_table_count; i++) { +for (int i = 0; i < s->quant_table_count; i++) { s->rc_stat2[i] = av_mallocz(s->context_count[i] * sizeof(*s->rc_stat2[i])); if (!s->rc_stat2[i]) @@ -761,7 +761,7 @@ static av_cold int encode_init(AVCodecContext *avctx) } } if (avctx->stats_in) { -char *p = avctx->stats_in; +char *stats = avctx->stats_in; uint8_t (*best_state)[256] = av_malloc_array(256, 256); int gob_count = 0; char *next; @@ -771,42 +771,42 @@ static av_cold int encode_init(AVCodecContext *avctx) av_assert0(s->version >= 2); for (;;) { -for (j = 0; j < 256; j++) -for (i = 0; i < 2; i++) { -s->rc_stat[j][i] = strtol(p, &next, 0); -if (next == p) { +for (int j = 0; j < 256; j++) +for (int i = 0; i < 2; i++) { +s->rc_stat[j][i] = strtol(stats, &next, 0); +if (next == stats) { av_log(avctx, AV_LOG_ERROR, - "2Pass file invalid at %d %d [%s]\n", j, i, p); + "2Pass file invalid at %d %d [%s]\n", j, i, stats); av_freep(&best_state); return AVERROR_INVALIDDATA; } -p = next; +stats = next; } -for (i = 0; i < s->quant_table_count; i++) -for (j = 0; j < s->context_count[i]; j++) { -for (k = 0; k < 32; k++) -for (m = 0; m < 2; m++) { -s->rc_stat2[i][j][k][m] = strtol(p, &next, 0); -if (next == p) { +for (int i = 0; i < s->quant_table_count; i++) +for (int j = 0; j < s->context_count[i]; j++) { +for (int k = 0; k < 32; k++) +for (int m = 0; m < 2; m++) { +s->rc_stat2[i][j][k][m] = strtol(stats, &next, 0); +if (next == stats) { av_log(avctx, AV_LOG_ERROR, "2Pass file invalid at %d %d %d %d [%s]\n", - i, j, k, m, p); + i, j, k, m, stats); av_freep(&best_state); return AVERROR_INVALIDDATA; } -p = next; +stats = next; } } -gob_count = strtol(p, &next, 0); -if (next == p || gob_count <= 0) { +gob_count = strtol(stats, &next, 0); +if (next == stats || gob_count <= 0) { av_log(avctx, AV_LOG_ERROR, "2Pass file invalid\n"); av_freep(&best_state); return AVERROR_INVALIDDATA; } -p = next; -while (*p == '\n' || *p == ' ') -p++; -if (p[0] == 0) +stats = next; +while (*stats == '\n' || *stats == ' ') +stats++; +if (stats[0] == 0) break; } if (s->ac == AC_RANGE_CUSTOM_TAB) @@ -814,11 +814,11 @@ static av_cold in
[FFmpeg-devel] [PATCH 31/60] avcodec/exr: narrow variable scope and fix shadowing
--- libavcodec/exr.c | 103 --- 1 file changed, 53 insertions(+), 50 deletions(-) diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 4bac0be89b..0f7c7b8546 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -989,7 +989,7 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse int64_t ac_count, dc_count, ac_compression; const int dc_w = td->xsize >> 3; const int dc_h = td->ysize >> 3; -GetByteContext gb, agb; +GetByteContext gb; int skip, ret; if (compressed_size <= 88) @@ -1103,51 +1103,54 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse bytestream2_skip(&gb, rle_csize); } -bytestream2_init(&agb, td->ac_data, ac_count * 2); +{ +GetByteContext agb; +bytestream2_init(&agb, td->ac_data, ac_count * 2); -for (int y = 0; y < td->ysize; y += 8) { -for (int x = 0; x < td->xsize; x += 8) { -memset(td->block, 0, sizeof(td->block)); +for (int y = 0; y < td->ysize; y += 8) { +for (int x = 0; x < td->xsize; x += 8) { +memset(td->block, 0, sizeof(td->block)); -for (int j = 0; j < 3; j++) { -float *block = td->block[j]; -const int idx = (x >> 3) + (y >> 3) * dc_w + dc_w * dc_h * j; -uint16_t *dc = (uint16_t *)td->dc_data; -union av_intfloat32 dc_val; +for (int j = 0; j < 3; j++) { +float *block = td->block[j]; +const int idx = (x >> 3) + (y >> 3) * dc_w + dc_w * dc_h * j; +uint16_t *dc = (uint16_t *)td->dc_data; +union av_intfloat32 dc_val; -dc_val.i = half2float(dc[idx], &s->h2f_tables); +dc_val.i = half2float(dc[idx], &s->h2f_tables); -block[0] = dc_val.f; -ac_uncompress(s, &agb, block); -dct_inverse(block); -} +block[0] = dc_val.f; +ac_uncompress(s, &agb, block); +dct_inverse(block); +} -{ -const int o = s->nb_channels == 4; -float *bo = ((float *)td->uncompressed_data) + -y * td->xsize * s->nb_channels + td->xsize * (o + 0) + x; -float *go = ((float *)td->uncompressed_data) + -y * td->xsize * s->nb_channels + td->xsize * (o + 1) + x; -float *ro = ((float *)td->uncompressed_data) + -y * td->xsize * s->nb_channels + td->xsize * (o + 2) + x; -float *yb = td->block[0]; -float *ub = td->block[1]; -float *vb = td->block[2]; - -for (int yy = 0; yy < 8; yy++) { -for (int xx = 0; xx < 8; xx++) { -const int idx = xx + yy * 8; - -convert(yb[idx], ub[idx], vb[idx], &bo[xx], &go[xx], &ro[xx]); - -bo[xx] = to_linear(bo[xx], 1.f); -go[xx] = to_linear(go[xx], 1.f); -ro[xx] = to_linear(ro[xx], 1.f); -} +{ +const int o = s->nb_channels == 4; +float *bo = ((float *)td->uncompressed_data) + +y * td->xsize * s->nb_channels + td->xsize * (o + 0) + x; +float *go = ((float *)td->uncompressed_data) + +y * td->xsize * s->nb_channels + td->xsize * (o + 1) + x; +float *ro = ((float *)td->uncompressed_data) + +y * td->xsize * s->nb_channels + td->xsize * (o + 2) + x; +float *yb = td->block[0]; +float *ub = td->block[1]; +float *vb = td->block[2]; + +for (int yy = 0; yy < 8; yy++) { +for (int xx = 0; xx < 8; xx++) { +const int idx = xx + yy * 8; + +convert(yb[idx], ub[idx], vb[idx], &bo[xx], &go[xx], &ro[xx]); + +bo[xx] = to_linear(bo[xx], 1.f); +go[xx] = to_linear(go[xx], 1.f); +ro[xx] = to_linear(ro[xx], 1.f); +} -bo += td->xsize * s->nb_channels; -go += td->xsize * s->nb_channels; -ro += td->xsize * s->nb_channels; +bo += td->xsize * s->nb_channels; +go += td->xsize * s->nb_channels; +ro += td->xsize * s->nb_channels; +} } } } @@ -1378,10 +1381,10 @@ static int decode_block(AVCodecContext *avctx, void *tdata, ptr = p->data[plane] + window_ymin * p->linesize
[FFmpeg-devel] [PATCH 32/60] avcodec/dvdec: fix variable shadowing
--- libavcodec/dvdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 8297b6d2f3..7ca891e93a 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -155,10 +155,10 @@ static av_cold void dv_init_static(void) VLC dv_vlc = { .table = vlc_buf, .table_allocated = FF_ARRAY_ELEMS(vlc_buf) }; const unsigned offset = FF_ARRAY_ELEMS(dv_rl_vlc) - (2 * NB_DV_VLC - NB_DV_ZERO_LEVEL_ENTRIES); RL_VLC_ELEM *tmp = dv_rl_vlc + offset; -int i, j; +int j = 0; /* it's faster to include sign bit in a generic VLC parsing scheme */ -for (i = 0, j = 0; i < NB_DV_VLC; i++, j++) { +for (int i = 0; i < NB_DV_VLC; i++, j++) { tmp[j].len = ff_dv_vlc_len[i]; tmp[j].run = ff_dv_vlc_run[i]; tmp[j].level = ff_dv_vlc_level[i]; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 33/60] avcodec/dv_tablegen: fix variable shadowing
--- libavcodec/dv_tablegen.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/dv_tablegen.h b/libavcodec/dv_tablegen.h index 7f0ab53fa7..6d3e200a01 100644 --- a/libavcodec/dv_tablegen.h +++ b/libavcodec/dv_tablegen.h @@ -51,7 +51,7 @@ static struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE]; static av_cold void dv_vlc_map_tableinit(void) { uint32_t code = 0; -int i, j; +int j; for (int i = 0; i < NB_DV_VLC; i++) { uint32_t cur_code = code >> (32 - ff_dv_vlc_len[i]); code += 1U << (32 - ff_dv_vlc_len[i]); @@ -70,7 +70,7 @@ static av_cold void dv_vlc_map_tableinit(void) dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].size = ff_dv_vlc_len[i] + (!!ff_dv_vlc_level[i]); } -for (i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) { +for (int i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) { #if CONFIG_SMALL for (j = 1; j < DV_VLC_MAP_LEV_SIZE; j++) { if (dv_vlc_map[i][j].size == 0) { -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 34/60] avcodec/dv_tablegen: narrow variable scope
--- libavcodec/dv_tablegen.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/dv_tablegen.h b/libavcodec/dv_tablegen.h index 6d3e200a01..ee604b1cfe 100644 --- a/libavcodec/dv_tablegen.h +++ b/libavcodec/dv_tablegen.h @@ -51,7 +51,6 @@ static struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE]; static av_cold void dv_vlc_map_tableinit(void) { uint32_t code = 0; -int j; for (int i = 0; i < NB_DV_VLC; i++) { uint32_t cur_code = code >> (32 - ff_dv_vlc_len[i]); code += 1U << (32 - ff_dv_vlc_len[i]); @@ -72,7 +71,7 @@ static av_cold void dv_vlc_map_tableinit(void) } for (int i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) { #if CONFIG_SMALL -for (j = 1; j < DV_VLC_MAP_LEV_SIZE; j++) { +for (int j = 1; j < DV_VLC_MAP_LEV_SIZE; j++) { if (dv_vlc_map[i][j].size == 0) { dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc | (dv_vlc_map[i - 1][0].vlc << @@ -82,7 +81,7 @@ static av_cold void dv_vlc_map_tableinit(void) } } #else -for (j = 1; j < DV_VLC_MAP_LEV_SIZE / 2; j++) { +for (int j = 1; j < DV_VLC_MAP_LEV_SIZE / 2; j++) { if (dv_vlc_map[i][j].size == 0) { dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc | (dv_vlc_map[i - 1][0].vlc << -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 35/60] avcodec/eatgq: fix variable shadowing
--- libavcodec/eatgq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index d326c05390..b760f29243 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -154,19 +154,19 @@ static void tgq_idct_put_mb_dconly(TgqContext *s, AVFrame *frame, static int tgq_decode_mb(TgqContext *s, GetByteContext *gbyte, AVFrame *frame, int mb_y, int mb_x) { -int mode; +int ret, mode; int i; int8_t dc[6]; mode = bytestream2_get_byte(gbyte); if (mode > 12) { GetBitContext gb; -int ret = init_get_bits8(&gb, gbyte->buffer, FFMIN(bytestream2_get_bytes_left(gbyte), mode)); +ret = init_get_bits8(&gb, gbyte->buffer, FFMIN(bytestream2_get_bytes_left(gbyte), mode)); if (ret < 0) return ret; for (i = 0; i < 6; i++) { -int ret = tgq_decode_block(s, s->block[i], &gb); +ret = tgq_decode_block(s, s->block[i], &gb); if (ret < 0) return ret; } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 36/60] avcodec/eatgq: narrow variable scopes
--- libavcodec/eatgq.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index b760f29243..f17802f5e8 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -59,9 +59,9 @@ static av_cold int tgq_decode_init(AVCodecContext *avctx) static int tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb) { const uint8_t *scantable = ff_zigzag_direct; -int i, j, value; +int value; block[0] = get_sbits(gb, 8) * s->qtable[0]; -for (i = 1; i < 64;) { +for (int i = 1; i < 64;) { switch (show_bits(gb, 3)) { case 4: if (i >= 63) @@ -77,7 +77,7 @@ static int tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb) value = get_bits(gb, 6); if (value > 64 - i) return AVERROR_INVALIDDATA; -for (j = 0; j < value; j++) +for (int j = 0; j < value; j++) block[scantable[i++]] = 0; break; case 6: @@ -129,8 +129,7 @@ static inline void tgq_dconly(TgqContext *s, unsigned char *dst, ptrdiff_t dst_stride, int dc) { int level = av_clip_uint8((dc*s->qtable[0] + 2056) >> 4); -int j; -for (j = 0; j < 8; j++) +for (int j = 0; j < 8; j++) memset(dst + j * dst_stride, level, 8); } @@ -155,7 +154,6 @@ static int tgq_decode_mb(TgqContext *s, GetByteContext *gbyte, AVFrame *frame, int mb_y, int mb_x) { int ret, mode; -int i; int8_t dc[6]; mode = bytestream2_get_byte(gbyte); @@ -165,7 +163,7 @@ static int tgq_decode_mb(TgqContext *s, GetByteContext *gbyte, if (ret < 0) return ret; -for (i = 0; i < 6; i++) { +for (int i = 0; i < 6; i++) { ret = tgq_decode_block(s, s->block[i], &gb); if (ret < 0) return ret; @@ -180,7 +178,7 @@ static int tgq_decode_mb(TgqContext *s, GetByteContext *gbyte, } else if (mode == 6) { bytestream2_get_buffer(gbyte, dc, 6); } else if (mode == 12) { -for (i = 0; i < 6; i++) { +for (int i = 0; i < 6; i++) { dc[i] = bytestream2_get_byte(gbyte); bytestream2_skip(gbyte, 1); } @@ -195,11 +193,10 @@ static int tgq_decode_mb(TgqContext *s, GetByteContext *gbyte, static void tgq_calculate_qtable(TgqContext *s, int quant) { -int i, j; const int a = (14 * (100 - quant)) / 100 + 1; const int b = (11 * (100 - quant)) / 100 + 4; -for (j = 0; j < 8; j++) -for (i = 0; i < 8; i++) +for (int j = 0; j < 8; j++) +for (int i = 0; i < 8; i++) s->qtable[j * 8 + i] = ((a * (j + i) / (7 + 7) + b) * ff_inv_aanscales[j * 8 + i]) >> (14 - 4); } @@ -211,7 +208,7 @@ static int tgq_decode_frame(AVCodecContext *avctx, AVFrame *frame, int buf_size = avpkt->size; TgqContext *s = avctx->priv_data; GetByteContext gbyte; -int x, y, ret; +int ret; int big_endian; if (buf_size < 16) { @@ -238,8 +235,8 @@ static int tgq_decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; -for (y = 0; y < FFALIGN(avctx->height, 16) >> 4; y++) -for (x = 0; x < FFALIGN(avctx->width, 16) >> 4; x++) +for (int y = 0; y < FFALIGN(avctx->height, 16) >> 4; y++) +for (int x = 0; x < FFALIGN(avctx->width, 16) >> 4; x++) if (tgq_decode_mb(s, &gbyte, frame, y, x) < 0) return AVERROR_INVALIDDATA; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 37/60] avcodec/elbg: fix variable shadowing
--- libavcodec/elbg.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/elbg.c b/libavcodec/elbg.c index 84043af4fd..22219f9a6f 100644 --- a/libavcodec/elbg.c +++ b/libavcodec/elbg.c @@ -158,7 +158,7 @@ static int simple_lbg(ELBGContext *elbg, int *points, cell *cells) { -int i, idx; +int i; int numpoints[2] = {0,0}; int *newcentroid[2] = { elbg->scratchbuf + 3*dim, @@ -172,7 +172,7 @@ static int simple_lbg(ELBGContext *elbg, newutility[1] = 0; for (tempcell = cells; tempcell; tempcell=tempcell->next) { -idx = distance_limited(centroid[0], points + tempcell->index*dim, dim, INT_MAX)>= +int idx = distance_limited(centroid[0], points + tempcell->index*dim, dim, INT_MAX)>= distance_limited(centroid[1], points + tempcell->index*dim, dim, INT_MAX); numpoints[idx]++; for (i=0; isize_part; -int i, j, steps = 0; +int j, steps = 0; int best_idx = 0; int last_error; @@ -384,7 +384,7 @@ static void do_elbg(ELBGContext *restrict elbg, int *points, int numpoints, /* This loop evaluate the actual Voronoi partition. It is the most costly part of the algorithm. */ -for (i=0; i < numpoints; i++) { +for (int i = 0; i < numpoints; i++) { int best_dist = distance_limited(elbg->points + i * elbg->dim, elbg->codebook + best_idx * elbg->dim, elbg->dim, INT_MAX); @@ -413,7 +413,7 @@ static void do_elbg(ELBGContext *restrict elbg, int *points, int numpoints, memset(elbg->codebook, 0, elbg->num_cb * elbg->dim * sizeof(*elbg->codebook)); -for (i=0; i < numpoints; i++) { +for (int i = 0; i < numpoints; i++) { size_part[elbg->nearest_cb[i]]++; for (j=0; j < elbg->dim; j++) elbg->codebook[elbg->nearest_cb[i]*elbg->dim + j] += -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 38/60] avcodec/elbg: narrow variable scopes
--- libavcodec/elbg.c | 31 ++- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/libavcodec/elbg.c b/libavcodec/elbg.c index 22219f9a6f..c1b8d16cd2 100644 --- a/libavcodec/elbg.c +++ b/libavcodec/elbg.c @@ -74,8 +74,8 @@ typedef struct ELBGContext { static inline int distance_limited(int *a, int *b, int dim, int limit) { -int i, dist=0; -for (i=0; i 1) -for (i=0; iscratchbuf + 3*dim, @@ -175,7 +173,7 @@ static int simple_lbg(ELBGContext *elbg, int idx = distance_limited(centroid[0], points + tempcell->index*dim, dim, INT_MAX)>= distance_limited(centroid[1], points + tempcell->index*dim, dim, INT_MAX); numpoints[idx]++; -for (i=0; iindex*dim + i]; } @@ -201,20 +199,19 @@ static void get_new_centroids(ELBGContext *elbg, int huc, int *newcentroid_i, cell *tempcell; int *min = newcentroid_i; int *max = newcentroid_p; -int i; -for (i=0; i< elbg->dim; i++) { +for (int i = 0; i < elbg->dim; i++) { min[i]=INT_MAX; max[i]=0; } for (tempcell = elbg->cells[huc]; tempcell; tempcell = tempcell->next) -for(i=0; idim; i++) { +for(int i = 0; i < elbg->dim; i++) { min[i]=FFMIN(min[i], elbg->points[tempcell->index*elbg->dim + i]); max[i]=FFMAX(max[i], elbg->points[tempcell->index*elbg->dim + i]); } -for (i=0; idim; i++) { +for (int i = 0; i < elbg->dim; i++) { int ni = min[i] + (max[i] - min[i])/3; int np = min[i] + (2*(max[i] - min[i]))/3; newcentroid_i[i] = ni; @@ -289,7 +286,7 @@ static void update_utility_and_n_cb(ELBGContext *elbg, int idx, int newutility) */ static void try_shift_candidate(ELBGContext *elbg, int idx[3]) { -int j, k, cont=0, tmp; +int cont=0, tmp; int64_t olderror=0, newerror; int newutility[3]; int *newcentroid[3] = { @@ -299,15 +296,15 @@ static void try_shift_candidate(ELBGContext *elbg, int idx[3]) }; cell *tempcell; -for (j=0; j<3; j++) +for (int j = 0; j < 3; j++) olderror += elbg->utility[idx[j]]; memset(newcentroid[2], 0, elbg->dim*sizeof(int)); -for (k=0; k<2; k++) +for (int k = 0; k < 2; k++) for (tempcell=elbg->cells[idx[2*k]]; tempcell; tempcell=tempcell->next) { cont++; -for (j=0; jdim; j++) +for (int j = 0; j < elbg->dim; j++) newcentroid[2][j] += elbg->points[tempcell->index*elbg->dim + j]; } @@ -333,7 +330,7 @@ static void try_shift_candidate(ELBGContext *elbg, int idx[3]) elbg->error += newerror - olderror; -for (j=0; j<3; j++) +for (int j = 0; j < 3; j++) update_utility_and_n_cb(elbg, idx[j], newutility[j]); evaluate_utility_inc(elbg); @@ -366,7 +363,7 @@ static void do_elbg(ELBGContext *restrict elbg, int *points, int numpoints, int max_steps) { int *const size_part = elbg->size_part; -int j, steps = 0; +int steps = 0; int best_idx = 0; int last_error; @@ -415,7 +412,7 @@ static void do_elbg(ELBGContext *restrict elbg, int *points, int numpoints, for (int i = 0; i < numpoints; i++) { size_part[elbg->nearest_cb[i]]++; -for (j=0; j < elbg->dim; j++) +for (int j = 0; j < elbg->dim; j++) elbg->codebook[elbg->nearest_cb[i]*elbg->dim + j] += elbg->points[i*elbg->dim + j]; } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 39/60] avcodec/atrac3plus: fix variable shadowing
--- libavcodec/atrac3plus.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c index f17ed0cbb5..8ca6989c07 100644 --- a/libavcodec/atrac3plus.c +++ b/libavcodec/atrac3plus.c @@ -75,7 +75,7 @@ static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t **xlat av_cold void ff_atrac3p_init_vlcs(void) { -int i, tab_offset = 0; +int tab_offset = 0; const uint8_t *xlats; xlats = atrac3p_wl_ct_xlats; @@ -93,7 +93,7 @@ av_cold void ff_atrac3p_init_vlcs(void) /* build huffman tables for spectrum decoding */ xlats = atrac3p_spectra_xlats; -for (i = 0; i < 112; i++) { +for (int i = 0; i < 112; i++) { if (atrac3p_spectra_cbs[i][0] >= 0) build_canonical_huff(atrac3p_spectra_cbs[i], &xlats, &tab_offset, &spec_vlc_tabs[i]); @@ -103,13 +103,13 @@ av_cold void ff_atrac3p_init_vlcs(void) /* build huffman tables for gain data decoding */ xlats = atrac3p_gain_xlats; -for (i = 0; i < 11; i++) +for (int i = 0; i < 11; i++) build_canonical_huff(atrac3p_gain_cbs[i], &xlats, &tab_offset, &gain_vlc_tabs[i]); /* build huffman tables for tone decoding */ xlats = atrac3p_tone_xlats; -for (i = 0; i < 7; i++) +for (int i = 0; i < 7; i++) build_canonical_huff(atrac3p_tone_cbs[i], &xlats, &tab_offset, &tone_vlc_tabs[i]); } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 40/60] avcodec/alac: fix variable shadowing
--- libavcodec/alac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/alac.c b/libavcodec/alac.c index f91288e97c..7916a006c2 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -331,7 +331,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, } } for (ch = 0; ch < channels; ch++) { -int ret = rice_decompress(alac, alac->predict_error_buffer[ch], +ret = rice_decompress(alac, alac->predict_error_buffer[ch], alac->nb_samples, bps, rice_history_mult[ch] * alac->rice_history_mult / 4); if (ret < 0) -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 41/60] avcodec/ac3dec: fix variable shadowing
--- libavcodec/ac3dec.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 0a4d3375ee..5cc47a6b1d 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1492,7 +1492,7 @@ static int ac3_decode_frame(AVCodecContext *avctx, AVFrame *frame, int buf_size, full_buf_size = avpkt->size; AC3DecodeContext *s = avctx->priv_data; int blk, ch, err, offset, ret; -int i; +int sync_offset; int skip = 0, got_independent_frame = 0; const uint8_t *channel_map; uint8_t extended_channel_map[EAC3_MAX_CHANNELS]; @@ -1504,11 +1504,11 @@ static int ac3_decode_frame(AVCodecContext *avctx, AVFrame *frame, s->superframe_size = 0; buf_size = full_buf_size; -i = ff_ac3_find_syncword(buf, buf_size); -if (i < 0 || i > 10) -return i; -buf += i; -buf_size -= i; +sync_offset = ff_ac3_find_syncword(buf, buf_size); +if (sync_offset < 0 || sync_offset > 10) +return sync_offset; +buf += sync_offset; +buf_size -= sync_offset; /* copy input buffer to decoder context to avoid reading past the end of the buffer, which can be caused by a damaged input stream. */ @@ -1670,7 +1670,6 @@ dependent_frame: /* check if there is dependent frame */ if (buf_size > s->frame_size) { AC3HeaderInfo hdr; -int err; if (buf_size - s->frame_size <= 16) { skip = buf_size - s->frame_size; @@ -1680,8 +1679,7 @@ dependent_frame: if ((ret = init_get_bits8(&s->gbc, buf + s->frame_size, buf_size - s->frame_size)) < 0) return ret; -err = ff_ac3_parse_header(&s->gbc, &hdr); -if (err) +if ((err = ff_ac3_parse_header(&s->gbc, &hdr))) return err; if (hdr.frame_type == EAC3_FRAME_TYPE_DEPENDENT) { @@ -1752,9 +1750,7 @@ skip: extended_channel_map[index] = offset + channel_map[extend++]; } else { -int i; - -for (i = 0; i < 64; i++) { +for (int i = 0; i < 64; i++) { if ((1ULL << i) & ff_eac3_custom_channel_map_locations[ch][1]) { int index = av_channel_layout_index_from_channel(&avctx->ch_layout, i); if (index < 0) -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 42/60] avformat/webpenc: fix variable shadowing
--- libavformat/webpenc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c index ce0d046aa9..5d0eed5a8e 100644 --- a/libavformat/webpenc.c +++ b/libavformat/webpenc.c @@ -163,7 +163,6 @@ static int webp_write_packet(AVFormatContext *s, AVPacket *pkt) avio_write(s->pb, pkt->data, pkt->size); w->wrote_webp_header = 1; // for good measure } else { -int ret; if ((ret = flush(s, 0, pkt->pts)) < 0) return ret; av_packet_ref(w->last_pkt, pkt); -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 43/60] avformat/webmdashenc: fix variable shadowing
--- libavformat/webmdashenc.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c index 3d9badc0d3..a4940dd1c5 100644 --- a/libavformat/webmdashenc.c +++ b/libavformat/webmdashenc.c @@ -382,11 +382,11 @@ static int write_adaptation_set(AVFormatContext *s, int as_index) for (i = 0; i < as->nb_streams; i++) { char buf[25], *representation_id = buf, *underscore_pos, *period_pos; -AVStream *st = s->streams[as->streams[i]]; +AVStream *tmp_st = s->streams[as->streams[i]]; int ret; if (w->is_live) { AVDictionaryEntry *filename = -av_dict_get(st->metadata, FILENAME, NULL, 0); +av_dict_get(tmp_st->metadata, FILENAME, NULL, 0); if (!filename) return AVERROR(EINVAL); ret = split_filename(filename->value, &underscore_pos, &period_pos); @@ -397,7 +397,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index) } else { snprintf(buf, sizeof(buf), "%d", w->representation_id++); } -ret = write_representation(s, st, representation_id, !width_in_as, +ret = write_representation(s, tmp_st, representation_id, !width_in_as, !height_in_as, !sample_rate_in_as); if (ret) return ret; if (w->is_live) @@ -477,7 +477,6 @@ static int parse_adaptation_sets(AVFormatContext *s) static int webm_dash_manifest_write_header(AVFormatContext *s) { -int i; double start = 0.0; int ret; WebMDashMuxContext *w = s->priv_data; @@ -505,7 +504,7 @@ static int webm_dash_manifest_write_header(AVFormatContext *s) } avio_printf(s->pb, " >\n"); -for (i = 0; i < w->nb_as; i++) { +for (int i = 0; i < w->nb_as; i++) { ret = write_adaptation_set(s, i); if (ret < 0) { goto fail; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 44/60] avformat/vorbiscomment: fix variable shadowing
--- libavformat/vorbiscomment.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/vorbiscomment.c b/libavformat/vorbiscomment.c index abe12fd586..af51c237e6 100644 --- a/libavformat/vorbiscomment.c +++ b/libavformat/vorbiscomment.c @@ -62,7 +62,7 @@ int64_t ff_vorbiscomment_length(const AVDictionary *m, const char *vendor_string return len; } -int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *m, +int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *meta, const char *vendor_string, AVChapter **chapters, unsigned int nb_chapters) { @@ -75,11 +75,11 @@ int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *m, cm_count += av_dict_count(chapters[i]->metadata) + 1; } } -if (m) { -int count = av_dict_count(m) + cm_count; +if (meta) { +int count = av_dict_count(meta) + cm_count; const AVDictionaryEntry *tag = NULL; avio_wl32(pb, count); -while ((tag = av_dict_iterate(m, tag))) { +while ((tag = av_dict_iterate(meta, tag))) { int64_t len1 = strlen(tag->key); int64_t len2 = strlen(tag->value); if (len1+1+len2 > UINT32_MAX) -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 45/60] avformat/vividas: fix variable shadowing
--- libavformat/vividas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/vividas.c b/libavformat/vividas.c index 130b81ebbe..4cad6c6456 100644 --- a/libavformat/vividas.c +++ b/libavformat/vividas.c @@ -417,7 +417,7 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, } for (j = 0; j < num_data; j++) { -int ret = avio_read(pb, &p[offset], data_len[j]); +ret = avio_read(pb, &p[offset], data_len[j]); if (ret < data_len[j]) { st->codecpar->extradata_size = 0; av_freep(&st->codecpar->extradata); -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 46/60] avformat/vividas: narrow variable scopes
--- libavformat/vividas.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/libavformat/vividas.c b/libavformat/vividas.c index 4cad6c6456..e984dd0b21 100644 --- a/libavformat/vividas.c +++ b/libavformat/vividas.c @@ -282,7 +282,7 @@ static uint8_t *read_sb_block(AVIOContext *src, unsigned *size, static int track_header(VividasDemuxContext *viv, AVFormatContext *s, const uint8_t *buf, int size) { -int i, j, ret; +int ret; int64_t off; int val_1; int num_video; @@ -296,11 +296,11 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, val_1 = ffio_read_varlen(pb); -for (i=0;inum_audio != 1) av_log(s, AV_LOG_WARNING, "number of audio tracks %d is not 1\n", viv->num_audio); -for(i=0;inum_audio;i++) { +for (int i = 0; i < viv->num_audio; i++) { int q; AVStream *st = avformat_new_stream(s, NULL); if (!st) @@ -394,7 +394,7 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, avio_r8(pb); // '19' ffio_read_varlen(pb); // len_3 num_data = avio_r8(pb); -for (j = 0; j < num_data; j++) { +for (int j = 0; j < num_data; j++) { int64_t len = ffio_read_varlen(pb); if (len < 0 || len > INT_MAX/2 - xd_size) { return AVERROR_INVALIDDATA; @@ -410,13 +410,13 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, p = st->codecpar->extradata; p[0] = 2; -for (j = 0; j < num_data - 1; j++) { +for (int j = 0; j < num_data - 1; j++) { unsigned delta = av_xiphlacing(&p[offset], data_len[j]); av_assert0(delta <= xd_size - offset); offset += delta; } -for (j = 0; j < num_data; j++) { +for (int j = 0; j < num_data; j++) { ret = avio_read(pb, &p[offset], data_len[j]); if (ret < data_len[j]) { st->codecpar->extradata_size = 0; @@ -443,7 +443,6 @@ static int track_index(VividasDemuxContext *viv, AVFormatContext *s, int maxnp=0; FFIOContext pb0; AVIOContext *const pb = &pb0.pub; -int i; int64_t filesize = avio_size(s->pb); uint64_t n_sb_blocks_tmp; @@ -463,7 +462,7 @@ static int track_index(VividasDemuxContext *viv, AVFormatContext *s, off = 0; poff = 0; -for (i = 0; i < viv->n_sb_blocks; i++) { +for (int i = 0; i < viv->n_sb_blocks; i++) { uint64_t size_tmp = ffio_read_varlen(pb); uint64_t n_packets_tmp = ffio_read_varlen(pb); @@ -496,7 +495,6 @@ static int track_index(VividasDemuxContext *viv, AVFormatContext *s, static void load_sb_block(AVFormatContext *s, VividasDemuxContext *viv, unsigned expected_size) { uint32_t size = 0; -int i; AVIOContext *pb = 0; if (viv->sb_pb) { @@ -526,7 +524,7 @@ static void load_sb_block(AVFormatContext *s, VividasDemuxContext *viv, unsigned viv->n_sb_entries = viv->sb_blocks[viv->current_sb].n_packets; -for (i = 0; i < viv->n_sb_entries; i++) { +for (int i = 0; i < viv->n_sb_entries; i++) { viv->sb_entries[i].size = ffio_read_varlen(pb); viv->sb_entries[i].flag = avio_r8(pb); } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 47/60] avformat/yuv4mpegdec: fix variable shadowing
--- libavformat/yuv4mpegdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/yuv4mpegdec.c b/libavformat/yuv4mpegdec.c index 2b66a1e596..61b5a9e17b 100644 --- a/libavformat/yuv4mpegdec.c +++ b/libavformat/yuv4mpegdec.c @@ -36,7 +36,7 @@ static int yuv4_read_header(AVFormatContext *s) char header[MAX_YUV4_HEADER + 10]; // Include headroom for // the longest option char *tokstart, *tokend, *header_end; -int i; +size_t i; AVIOContext *pb = s->pb; int width = -1, height = -1, raten = 0, rated = 0, aspectn = 0, aspectd = 0; @@ -197,7 +197,7 @@ static int yuv4_read_header(AVFormatContext *s) }; // Older nonstandard pixel format representation tokstart += 6; -for (size_t i = 0; i < FF_ARRAY_ELEMS(pix_fmt_array); i++) +for (i = 0; i < FF_ARRAY_ELEMS(pix_fmt_array); i++) if (av_strstart(tokstart, pix_fmt_array[i].name, NULL)) { alt_pix_fmt = pix_fmt_array[i].pix_fmt; break; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 49/60] avformat/srtpproto: fix variable shadowing
--- libavformat/srtpproto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/srtpproto.c b/libavformat/srtpproto.c index 02cf156327..cf6064625c 100644 --- a/libavformat/srtpproto.c +++ b/libavformat/srtpproto.c @@ -37,7 +37,7 @@ typedef struct SRTPProtoContext { #define D AV_OPT_FLAG_DECODING_PARAM #define E AV_OPT_FLAG_ENCODING_PARAM -static const AVOption options[] = { +static const AVOption srtp_options[] = { { "srtp_out_suite", "", offsetof(SRTPProtoContext, out_suite), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, { "srtp_out_params", "", offsetof(SRTPProtoContext, out_params), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, { "srtp_in_suite", "", offsetof(SRTPProtoContext, in_suite), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D }, @@ -48,7 +48,7 @@ static const AVOption options[] = { static const AVClass srtp_context_class = { .class_name = "srtp", .item_name = av_default_item_name, -.option = options, +.option = srtp_options, .version= LIBAVUTIL_VERSION_INT, }; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 48/60] avformat/tee: fix variable shadowing
--- libavformat/tee.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/tee.c b/libavformat/tee.c index 1a2a8ead82..7ec9ab4800 100644 --- a/libavformat/tee.c +++ b/libavformat/tee.c @@ -65,7 +65,7 @@ static const char *const slave_bsfs_spec_sep = "/"; static const char *const slave_select_sep = ","; #define OFFSET(x) offsetof(TeeContext, x) -static const AVOption options[] = { +static const AVOption tee_options[] = { {"use_fifo", "Use fifo pseudo-muxer to separate actual muxers from encoder", OFFSET(use_fifo), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, {"fifo_options", "fifo pseudo-muxer options", OFFSET(fifo_options), @@ -76,7 +76,7 @@ static const AVOption options[] = { static const AVClass tee_muxer_class = { .class_name = "Tee muxer", .item_name = av_default_item_name, -.option = options, +.option = tee_options, .version= LIBAVUTIL_VERSION_INT, }; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 50/60] avformat/rawdec: fix variable shadowing
--- libavformat/rawdec.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index d0c829dc42..c7c18f9aac 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -161,12 +161,11 @@ const FFInputFormat ff_data_demuxer = { #if CONFIG_MJPEG_DEMUXER static int mjpeg_probe(const AVProbeData *p) { -int i; int state = -1; int nb_invalid = 0; int nb_frames = 0; -for (i = 0; i < p->buf_size - 1; i++) { +for (int i = 0; i < p->buf_size - 1; i++) { int c; if (p->buf[i] != 0xFF) continue; @@ -211,9 +210,8 @@ static int mjpeg_probe(const AVProbeData *p) if (nb_invalid*4 + 1 < nb_frames) { static const char ct_jpeg[] = "\r\nContent-Type: image/jpeg\r\n"; -int i; -for (i=0; ibuf_size - (int)sizeof(ct_jpeg), 100); i++) +for (int i = 0; i < FFMIN(p->buf_size - (int)sizeof(ct_jpeg), 100); i++) if (!memcmp(p->buf + i, ct_jpeg, sizeof(ct_jpeg) - 1)) return AVPROBE_SCORE_EXTENSION; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 51/60] avformat/mxfdec: fix variable shadowing
--- libavformat/mxfdec.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index ac63c0d5ad..eb7d301444 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -871,16 +871,16 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size * 2011_DCPTEST_24FPS.V.mxf - two ECs, OP1a * abcdefghiv016f56415e.mxf - zero ECs, OPAtom, output by Avid AirSpeed */ if (nb_essence_containers != 1) { -MXFOP op = nb_essence_containers ? OP1a : OPAtom; +MXFOP mxfop = nb_essence_containers ? OP1a : OPAtom; /* only nag once */ if (!mxf->op) av_log(mxf->fc, AV_LOG_WARNING, "\"OPAtom\" with %"PRIu32" ECs - assuming %s\n", nb_essence_containers, - op == OP1a ? "OP1a" : "OPAtom"); + mxfop == OP1a ? "OP1a" : "OPAtom"); -mxf->op = op; +mxf->op = mxfop; } else mxf->op = OPAtom; } else { @@ -2574,7 +2574,7 @@ static int parse_mca_labels(MXFContext *mxf, MXFTrack *source_track, MXFDescript } if (language && !ambigous_language) { - int ret = set_language(mxf->fc, language, &st->metadata); + ret = set_language(mxf->fc, language, &st->metadata); if (ret < 0) return ret; } @@ -2601,10 +2601,10 @@ static int parse_mca_labels(MXFContext *mxf, MXFTrack *source_track, MXFDescript static int mxf_parse_structural_metadata(MXFContext *mxf) { MXFPackage *material_package = NULL; -int i, j, k, ret; +int k, ret; /* TODO: handle multiple material packages (OP3x) */ -for (i = 0; i < mxf->packages_count; i++) { +for (int i = 0; i < mxf->packages_count; i++) { material_package = mxf_resolve_strong_ref(mxf, &mxf->packages_refs[i], MaterialPackage); if (material_package) break; } @@ -2618,7 +2618,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) av_dict_set(&mxf->fc->metadata, "material_package_name", material_package->name, 0); mxf_parse_package_comments(mxf, &mxf->fc->metadata, material_package); -for (i = 0; i < material_package->tracks_count; i++) { +for (int i = 0; i < material_package->tracks_count; i++) { MXFPackage *source_package = NULL; MXFTrack *material_track = NULL; MXFTrack *source_track = NULL; @@ -2653,7 +2653,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) continue; } -for (j = 0; j < material_track->sequence->structural_components_count; j++) { +for (int j = 0; j < material_track->sequence->structural_components_count; j++) { component = mxf_resolve_strong_ref(mxf, &material_track->sequence->structural_components_refs[j], TimecodeComponent); if (!component) continue; @@ -2671,7 +2671,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) av_log(mxf->fc, AV_LOG_WARNING, "material track %d: has %d components\n", material_track->track_id, material_track->sequence->structural_components_count); -for (j = 0; j < material_track->sequence->structural_components_count; j++) { +for (int j = 0; j < material_track->sequence->structural_components_count; j++) { component = mxf_resolve_sourceclip(mxf, &material_track->sequence->structural_components_refs[j]); if (!component) continue; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 52/60] avformat/mxfdec: narrow variable scopes
--- libavformat/mxfdec.c | 35 --- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index eb7d301444..8a83bdfa04 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -482,9 +482,7 @@ static int klv_read_packet(MXFContext *mxf, KLVPacket *klv, AVIOContext *pb) static int mxf_get_stream_index(AVFormatContext *s, KLVPacket *klv, int body_sid) { -int i; - -for (i = 0; i < s->nb_streams; i++) { +for (int i = 0; i < s->nb_streams; i++) { MXFTrack *track = s->streams[i]->priv_data; /* SMPTE 379M 7.3 */ if (track && (!body_sid || !track->body_sid || track->body_sid == body_sid) && !memcmp(klv->key + sizeof(mxf_essence_element_key), track->track_number, sizeof(track->track_number))) @@ -523,12 +521,12 @@ static int mxf_get_eia608_packet(AVFormatContext *s, AVStream *st, AVPacket *pkt int cdp_identifier, cdp_length, cdp_footer_id, ccdata_id, cc_count; int line_num, sample_coding, sample_count; int did, sdid, data_length; -int i, ret; +int ret; if (count > 1) av_log(s, AV_LOG_WARNING, "unsupported multiple ANC packets (%d) per KLV packet\n", count); -for (i = 0; i < count; i++) { +for (int i = 0; i < count; i++) { if (length < 6) { av_log(s, AV_LOG_ERROR, "error reading s436m packet %"PRId64"\n", length); return AVERROR_INVALIDDATA; @@ -597,7 +595,6 @@ static int mxf_get_d10_aes3_packet(AVIOContext *pb, AVStream *st, AVPacket *pkt, { const uint8_t *buf_ptr, *end_ptr; uint8_t *data_ptr; -int i; if (length > 61444) /* worst case PAL 1920 samples 8 channels */ return AVERROR_INVALIDDATA; @@ -612,7 +609,7 @@ static int mxf_get_d10_aes3_packet(AVIOContext *pb, AVStream *st, AVPacket *pkt, return AVERROR_INVALIDDATA; for (; end_ptr - buf_ptr >= st->codecpar->ch_layout.nb_channels * 4; ) { -for (i = 0; i < st->codecpar->ch_layout.nb_channels; i++) { +for (int i = 0; i < st->codecpar->ch_layout.nb_channels; i++) { uint32_t sample = bytestream_get_le32(&buf_ptr); if (st->codecpar->bits_per_coded_sample == 24) bytestream_put_le24(&data_ptr, (sample >> 4) & 0xff); @@ -2068,7 +2065,7 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta */ static int mxf_compute_index_tables(MXFContext *mxf) { -int i, j, k, ret, nb_sorted_segments; +int ret, nb_sorted_segments; MXFIndexTableSegment **sorted_segments = NULL; if ((ret = mxf_get_sorted_table_segments(mxf, &nb_sorted_segments, &sorted_segments)) || @@ -2078,7 +2075,7 @@ static int mxf_compute_index_tables(MXFContext *mxf) } /* sanity check and count unique BodySIDs/IndexSIDs */ -for (i = 0; i < nb_sorted_segments; i++) { +for (int i = 0; i < nb_sorted_segments; i++) { if (i == 0 || sorted_segments[i-1]->index_sid != sorted_segments[i]->index_sid) mxf->nb_index_tables++; else if (sorted_segments[i-1]->body_sid != sorted_segments[i]->body_sid) { @@ -2097,7 +2094,7 @@ static int mxf_compute_index_tables(MXFContext *mxf) } /* distribute sorted segments to index tables */ -for (i = j = 0; i < nb_sorted_segments; i++) { +for (int i = 0, j = 0; i < nb_sorted_segments; i++) { if (i != 0 && sorted_segments[i-1]->index_sid != sorted_segments[i]->index_sid) { /* next IndexSID */ j++; @@ -2106,7 +2103,7 @@ static int mxf_compute_index_tables(MXFContext *mxf) mxf->index_tables[j].nb_segments++; } -for (i = j = 0; j < mxf->nb_index_tables; i += mxf->index_tables[j++].nb_segments) { +for (int i = 0, j = 0; j < mxf->nb_index_tables; i += mxf->index_tables[j++].nb_segments) { MXFIndexTable *t = &mxf->index_tables[j]; MXFTrack *mxf_track = NULL; @@ -2129,7 +2126,7 @@ static int mxf_compute_index_tables(MXFContext *mxf) if ((ret = mxf_compute_ptses_fake_index(mxf, t)) < 0) goto finish_decoding_index; -for (k = 0; k < mxf->fc->nb_streams; k++) { +for (int k = 0; k < mxf->fc->nb_streams; k++) { MXFTrack *track = mxf->fc->streams[k]->priv_data; if (track && track->index_sid == t->index_sid) { mxf_track = track; @@ -2138,7 +2135,7 @@ static int mxf_compute_index_tables(MXFContext *mxf) } /* fix zero IndexDurations */ -for (k = 0; k < t->nb_segments; k++) { +for (int k = 0; k < t->nb_segments; k++) { if (!t->segments[k]->index_edit_rate.num || !t->segments[k]->index_edit_rate.den) { av_log(mxf->fc, AV_LOG_WARNING, "IndexSID %i segment %i has invalid IndexEditRate\n", t->index_sid, k); @@ -4087,17 +4084,16 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt) static int mxf
[FFmpeg-devel] [PATCH 53/60] avformat/nsvdec: fix variable shadowing
--- libavformat/nsvdec.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c index dd01765d7d..a55da05226 100644 --- a/libavformat/nsvdec.c +++ b/libavformat/nsvdec.c @@ -380,7 +380,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s) uint32_t vtag, atag; uint16_t vwidth, vheight; AVRational framerate; -int i; +int nsv_rate; AVStream *st; NSVStream *nst; @@ -388,25 +388,25 @@ static int nsv_parse_NSVs_header(AVFormatContext *s) atag = avio_rl32(pb); vwidth = avio_rl16(pb); vheight = avio_rl16(pb); -i = avio_r8(pb); +nsv_rate = avio_r8(pb); -av_log(s, AV_LOG_TRACE, "NSV NSVs framerate code %2x\n", i); -if(i&0x80) { /* odd way of giving native framerates from docs */ -int t=(i & 0x7F)>>2; -if(t<16) framerate = (AVRational){1, t+1}; -else framerate = (AVRational){t-15, 1}; +av_log(s, AV_LOG_TRACE, "NSV NSVs framerate code %2x\n", nsv_rate); +if (nsv_rate & 0x80) { /* odd way of giving native framerates from docs */ +int t = (nsv_rate & 0x7F)>>2; +if (t<16) framerate = (AVRational){1, t+1}; +else framerate = (AVRational){t-15, 1}; -if(i&1){ +if (nsv_rate & 1) { framerate.num *= 1000; framerate.den *= 1001; } -if((i&3)==3) framerate.num *= 24; -else if((i&3)==2) framerate.num *= 25; -else framerate.num *= 30; +if ((nsv_rate & 3) == 3) framerate.num *= 24; +else if ((nsv_rate & 3) == 2) framerate.num *= 25; +else framerate.num *= 30; } else -framerate= (AVRational){i, 1}; +framerate= (AVRational){nsv_rate, 1}; nsv->avsync = avio_rl16(pb); nsv->framerate = framerate; @@ -420,7 +420,6 @@ static int nsv_parse_NSVs_header(AVFormatContext *s) nsv->vwidth = vwidth; nsv->vheight = vwidth; if (vtag != T_NONE) { -int i; st = avformat_new_stream(s, NULL); if (!st) goto fail; @@ -441,7 +440,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s) st->start_time = 0; st->duration = av_rescale(nsv->duration, framerate.num, 1000*framerate.den); -for(i=0;iindex_entries;i++) { +for(int i = 0; i < nsv->index_entries; i++) { if(nsv->nsvs_timestamps) { av_add_index_entry(st, nsv->nsvs_file_offset[i], nsv->nsvs_timestamps[i], 0, 0, AVINDEX_KEYFRAME); -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 54/60] avformat/matroskadec: fix variable shadowing
--- libavformat/matroskadec.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index c8741ff2af..60b20e9658 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1281,8 +1281,8 @@ static int ebml_parse(MatroskaDemuxContext *matroska, MatroskaLevel *level = matroska->num_levels ? &matroska->levels[matroska->num_levels - 1] : NULL; if (!matroska->current_id) { -uint64_t id; -res = ebml_read_num(matroska, pb, 4, &id, 0); +uint64_t tmp_id; +res = ebml_read_num(matroska, pb, 4, &tmp_id, 0); if (res < 0) { if (pb->eof_reached && res == AVERROR_EOF) { if (matroska->is_live) @@ -1301,7 +1301,7 @@ static int ebml_parse(MatroskaDemuxContext *matroska, } return res; } -matroska->current_id = id | 1 << 7 * res; +matroska->current_id = tmp_id | 1 << 7 * res; pos_alt = pos + res; } else { pos_alt = pos; @@ -3039,7 +3039,7 @@ static int mkv_parse_video(MatroskaTrack *track, AVStream *st, if (track->video.stereo_mode < MATROSKA_VIDEO_STEREOMODE_TYPE_NB && track->video.stereo_mode != MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_CYAN_RED && track->video.stereo_mode != MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_GREEN_MAG) { -int ret = mkv_stereo3d_conv(st, track->video.stereo_mode); +ret = mkv_stereo3d_conv(st, track->video.stereo_mode); if (ret < 0) return ret; } @@ -4683,8 +4683,7 @@ static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range) AVBPrint bprint; char *buf; int64_t cues_start = -1, cues_end = -1, before_pos, bandwidth; -int i; -int ret; +int i, ret; // determine cues start and end positions for (i = 0; i < seekhead_list->nb_elem; i++) @@ -4740,7 +4739,7 @@ static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range) // Store cue point timestamps as a comma separated list // for checking subsegment alignment in the muxer. av_bprint_init(&bprint, 0, AV_BPRINT_SIZE_UNLIMITED); -for (int i = 0; i < sti->nb_index_entries; i++) +for (i = 0; i < sti->nb_index_entries; i++) av_bprintf(&bprint, "%" PRId64",", sti->index_entries[i].timestamp); if (!av_bprint_is_complete(&bprint)) { av_bprint_finalize(&bprint, NULL); -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 55/60] avformat/img2enc: fix variable shadowing
--- libavformat/img2enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c index 526a11e5ee..ae239d27ea 100644 --- a/libavformat/img2enc.c +++ b/libavformat/img2enc.c @@ -224,7 +224,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) goto fail; for (i = 0; i < nb_renames; i++) { -int ret = ff_rename(img->tmp[i], img->target[i], s); +ret = ff_rename(img->tmp[i], img->target[i], s); if (ret < 0) return ret; } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 56/60] avformat/http: fix variable shadowing
--- libavformat/http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/http.c b/libavformat/http.c index ec60bc0b17..22e4126790 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -150,7 +150,7 @@ typedef struct HTTPContext { #define E AV_OPT_FLAG_ENCODING_PARAM #define DEFAULT_USER_AGENT "Lavf/" AV_STRINGIFY(LIBAVFORMAT_VERSION) -static const AVOption options[] = { +static const AVOption http_options[] = { { "seekable", "control seekability of connection", OFFSET(seekable), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, D }, { "chunked_post", "use chunked transfer-encoding for posts", OFFSET(chunked_post), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, E }, { "http_proxy", "set HTTP proxy to tunnel through", OFFSET(http_proxy), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D | E }, @@ -2048,7 +2048,7 @@ static int http_get_short_seek(URLContext *h) static const AVClass flavor ## _context_class = { \ .class_name = # flavor, \ .item_name = av_default_item_name, \ -.option = options, \ +.option = http_options, \ .version= LIBAVUTIL_VERSION_INT,\ } -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 57/60] avformat/bonk: fix variable shadowing
--- libavformat/bonk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/bonk.c b/libavformat/bonk.c index 44de8e2087..d5eacfdc91 100644 --- a/libavformat/bonk.c +++ b/libavformat/bonk.c @@ -63,7 +63,7 @@ static int bonk_read_header(AVFormatContext *s) const int b = avio_r8(s->pb); if (!b) { uint32_t t; -int ret = ffio_ensure_seekback(s->pb, 3); +ret = ffio_ensure_seekback(s->pb, 3); if (ret < 0) return ret; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 58/60] avformat/avio: fix variable shadowing
--- libavformat/avio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/avio.c b/libavformat/avio.c index d109f3adff..fd767c9ba9 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -57,7 +57,7 @@ static void *urlcontext_child_next(void *obj, void *prev) #define OFFSET(x) offsetof(URLContext,x) #define E AV_OPT_FLAG_ENCODING_PARAM #define D AV_OPT_FLAG_DECODING_PARAM -static const AVOption options[] = { +static const AVOption url_context_options[] = { {"protocol_whitelist", "List of protocols that are allowed to be used", OFFSET(protocol_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D }, {"protocol_blacklist", "List of protocols that are not allowed to be used", OFFSET(protocol_blacklist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D }, {"rw_timeout", "Timeout for IO operations (in microseconds)", offsetof(URLContext, rw_timeout), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM }, @@ -67,7 +67,7 @@ static const AVOption options[] = { static const AVClass url_context_class = { .class_name = "URLContext", .item_name= urlcontext_to_name, -.option = options, +.option = url_context_options, .version = LIBAVUTIL_VERSION_INT, .child_next = urlcontext_child_next, .child_class_iterate = ff_urlcontext_child_class_iterate, -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 59/60] avformat/apetag: fix variable shadowing
--- libavformat/apetag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/apetag.c b/libavformat/apetag.c index 0989fcb094..84645607de 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -81,7 +81,7 @@ static int ape_tag_read_field(AVFormatContext *s) av_dict_set(&st->metadata, key, filename, 0); if ((id = ff_guess_image2_codec(filename)) != AV_CODEC_ID_NONE) { -int ret = ff_add_attached_pic(s, st, s->pb, NULL, size); +ret = ff_add_attached_pic(s, st, s->pb, NULL, size); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Error reading cover art.\n"); return ret; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 60/60] avfilter/drawutils: fix variable shadowing
--- libavfilter/drawutils.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 95525d38b4..b29d3e565e 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -156,7 +156,6 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags) void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4]) { -unsigned i; double yuvad[4]; double rgbad[4]; const AVPixFmtDescriptor *desc = draw->desc; @@ -190,7 +189,7 @@ void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4 if (desc->nb_components <= 2) yuvad[1] = yuvad[3]; -for (i = 0; i < desc->nb_components; i++) { +for (unsigned i = 0; i < desc->nb_components; i++) { unsigned val = yuvad[i] * ((1 << (draw->desc->comp[i].depth + draw->desc->comp[i].shift)) - 1) + 0.5; if (desc->comp[i].depth > 8) color->comp[desc->comp[i].plane].u16[desc->comp[i].offset / 2] = val; -- 2.39.3 (Apple Git-146) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()
ping. On 2024-08-24 9:19 a.m., Brad Smith wrote: avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul() Initially used for getauxval() but will be used to add support for other API. Signed-off-by: Brad Smith --- libavutil/aarch64/cpu.c | 4 ++-- libavutil/arm/cpu.c | 2 +- libavutil/cpu.c | 14 ++ libavutil/cpu_internal.h | 2 ++ libavutil/loongarch/cpu.c | 2 +- libavutil/mips/cpu.c | 2 +- libavutil/riscv/cpu.c | 2 +- 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c index cfa9306663..084c81e999 100644 --- a/libavutil/aarch64/cpu.c +++ b/libavutil/aarch64/cpu.c @@ -31,8 +31,8 @@ static int detect_flags(void) { int flags = 0; -unsigned long hwcap = getauxval(AT_HWCAP); -unsigned long hwcap2 = getauxval(AT_HWCAP2); +unsigned long hwcap = ff_getauxval(AT_HWCAP); +unsigned long hwcap2 = ff_getauxval(AT_HWCAP2); if (hwcap & HWCAP_AARCH64_ASIMDDP) flags |= AV_CPU_FLAG_DOTPROD; diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c index c84a655c37..b84882005a 100644 --- a/libavutil/arm/cpu.c +++ b/libavutil/arm/cpu.c @@ -55,7 +55,7 @@ static int get_auxval(uint32_t *hwcap) { #if HAVE_GETAUXVAL -unsigned long ret = getauxval(AT_HWCAP); +unsigned long ret = ff_getauxval(AT_HWCAP); if (ret == 0) return -1; *hwcap = ret; diff --git a/libavutil/cpu.c b/libavutil/cpu.c index 41cee7fa77..61c1cf3faf 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -49,6 +49,10 @@ #include #endif +#if HAVE_GETAUXVAL +#include +#endif + static atomic_int cpu_flags = -1; static atomic_int cpu_count = -1; @@ -283,3 +287,13 @@ size_t av_cpu_max_align(void) return 8; } + +unsigned long ff_getauxval(unsigned long type) +{ +#if HAVE_GETAUXVAL +return getauxval(type); +#else +errno = ENOSYS; +return 0; +#endif +} diff --git a/libavutil/cpu_internal.h b/libavutil/cpu_internal.h index 634f28bac4..585a115c49 100644 --- a/libavutil/cpu_internal.h +++ b/libavutil/cpu_internal.h @@ -59,4 +59,6 @@ size_t ff_get_cpu_max_align_ppc(void); size_t ff_get_cpu_max_align_x86(void); size_t ff_get_cpu_max_align_loongarch(void); +unsigned long ff_getauxval(unsigned long type); + #endif /* AVUTIL_CPU_INTERNAL_H */ diff --git a/libavutil/loongarch/cpu.c b/libavutil/loongarch/cpu.c index cad8504fde..d8c67ad7c8 100644 --- a/libavutil/loongarch/cpu.c +++ b/libavutil/loongarch/cpu.c @@ -28,7 +28,7 @@ static int cpu_flags_getauxval(void) { int flags = 0; -int flag = (int)getauxval(AT_HWCAP); +int flag = (int)ff_getauxval(AT_HWCAP); if (flag & LA_HWCAP_LSX) flags |= AV_CPU_FLAG_LSX; diff --git a/libavutil/mips/cpu.c b/libavutil/mips/cpu.c index 59619d54de..2009c70f71 100644 --- a/libavutil/mips/cpu.c +++ b/libavutil/mips/cpu.c @@ -34,7 +34,7 @@ static int cpucfg_available(void) { -return getauxval(AT_HWCAP) & HWCAP_LOONGSON_CPUCFG; +return ff_getauxval(AT_HWCAP) & HWCAP_LOONGSON_CPUCFG; } /* Most toolchains have no CPUCFG support yet */ diff --git a/libavutil/riscv/cpu.c b/libavutil/riscv/cpu.c index 52ca2ce814..4ec6d6c826 100644 --- a/libavutil/riscv/cpu.c +++ b/libavutil/riscv/cpu.c @@ -86,7 +86,7 @@ int ff_get_cpu_flags_riscv(void) } #elif HAVE_GETAUXVAL { -const unsigned long hwcap = getauxval(AT_HWCAP); +const unsigned long hwcap = ff_getauxval(AT_HWCAP); if (hwcap & HWCAP_RV('I')) ret |= AV_CPU_FLAG_RVI; ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 03/60] fftools/opt_common: use av_err2str instead of strerror
Marvin Scholz: > The strerror function must not be used here, as the error is a AVERROR > errno, which depending on the platform no longer corresponds to the > actual errno that can be handled by strerror. > --- > fftools/opt_common.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fftools/opt_common.c b/fftools/opt_common.c > index 059f7a53d2..dc5fc7b96d 100644 > --- a/fftools/opt_common.c > +++ b/fftools/opt_common.c > @@ -1207,7 +1207,7 @@ int init_report(const char *env, FILE **file) > if (!report_file) { > int err = AVERROR(errno); > av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n", > - filename.str, strerror(errno)); > + filename.str, av_err2str(errno)); > return err; > } > av_log_set_callback(log_callback_report); The code uses strerror(errno) and not strerror(err), so I don't get the rationale for this commit. - Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 03/60] fftools/opt_common: use av_err2str instead of strerror
On 9 Sep 2024, at 3:30, Andreas Rheinhardt wrote: > Marvin Scholz: >> The strerror function must not be used here, as the error is a AVERROR >> errno, which depending on the platform no longer corresponds to the >> actual errno that can be handled by strerror. >> --- >> fftools/opt_common.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/fftools/opt_common.c b/fftools/opt_common.c >> index 059f7a53d2..dc5fc7b96d 100644 >> --- a/fftools/opt_common.c >> +++ b/fftools/opt_common.c >> @@ -1207,7 +1207,7 @@ int init_report(const char *env, FILE **file) >> if (!report_file) { >> int err = AVERROR(errno); >> av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n", >> - filename.str, strerror(errno)); >> + filename.str, av_err2str(errno)); >> return err; >> } >> av_log_set_callback(log_callback_report); > > The code uses strerror(errno) and not strerror(err), so I don't get the > rationale for this commit. Noticed that as well when looking through the patches again before sending but apparently forgot to drop it… Dropped locally now, thanks. > > - Andreas > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v1 4/4] tests/fate/matroska: check the demuxer and decoder allyes before fate-matroska-side-data-pref-codec
fix error message when use --disable-everything --samples=fate-suite/ Signed-off-by: Steven Liu --- tests/fate/matroska.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak index 738c7fe30a..563d756485 100644 --- a/tests/fate/matroska.mak +++ b/tests/fate/matroska.mak @@ -268,7 +268,7 @@ fate-matroska-side-data-pref-codec: CMD = run ffprobe$(PROGSSUF)$(EXESUF) $(TARG -select_streams v:0 -show_streams -show_frames -show_entries stream=stream_side_data:frame=frame_side_data_list fate-matroska-side-data-pref-packet: CMD = run ffprobe$(PROGSSUF)$(EXESUF) $(TARGET_SAMPLES)/mkv/hdr10tags-both.mkv \ -select_streams v:0 -show_streams -show_frames -show_entries stream=stream_side_data:frame=frame_side_data_list -side_data_prefer_packet mastering_display_metadata,content_light_level -FATE_MATROSKA_FFPROBE-$(call ALLYES MATROSKA_DEMUXER HEVC_DECODER) += fate-matroska-side-data-pref-codec fate-matroska-side-data-pref-packet +FATE_MATROSKA_FFPROBE-$(call ALLYES, MATROSKA_DEMUXER HEVC_DECODER) += fate-matroska-side-data-pref-codec fate-matroska-side-data-pref-packet FATE_SAMPLES_AVCONV += $(FATE_MATROSKA-yes) FATE_SAMPLES_FFPROBE += $(FATE_MATROSKA_FFPROBE-yes) -- 2.45.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v1 3/4] tests/fate/audio: set flcl1905 test case with depend formats, decoder, protocol
move fate-flcl1905 with depend on test case, because there will get an error when disable-everything with fate-suite samples. Signed-off-by: Steven Liu --- tests/fate/audio.mak | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/fate/audio.mak b/tests/fate/audio.mak index cfac90424b..4d6c479b6b 100644 --- a/tests/fate/audio.mak +++ b/tests/fate/audio.mak @@ -82,11 +82,10 @@ fate-smacker-audio: CMD = framecrc -i $(TARGET_SAMPLES)/smacker/wetlogo.smk -vn FATE_SAMPLES_AUDIO-$(call DEMDEC, WSVQA, WS_SND1, ARESAMPLE_FILTER) += fate-ws_snd fate-ws_snd: CMD = md5 -i $(TARGET_SAMPLES)/vqa/ws_snd.vqa -f s16le -af aresample +FATE_SAMPLES_AUDIO-$(call DEMDEC, WAV, WMAV2, FILE_PROTOCOL) += fate-flcl1905 fate-flcl1905: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_frames -show_packets -print_format compact $(TARGET_SAMPLES)/wav/FLCL_Ending_My-short.wav FATE_SAMPLES_AUDIO += $(FATE_SAMPLES_AUDIO-yes) -FATE_SAMPLES_FFPROBE += fate-flcl1905 - FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_AUDIO) -fate-audio: $(FATE_SAMPLES_AUDIO) fate-flcl1905 +fate-audio: $(FATE_SAMPLES_AUDIO) -- 2.45.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v1 2/4] tests/fate/mov: check mov formats build status be for make test
fix make fate error when make fate with --disable-everything, should check the mov build into ffmpeg status before test mov functions. Signed-off-by: Steven Liu --- tests/fate/mov.mak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index 81cc2a23af..4160c63a45 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -1,4 +1,4 @@ -FATE_MOV = fate-mov-3elist \ +FATE_MOV-$(call FRAMEMD5, MOV) = fate-mov-3elist \ fate-mov-3elist-1ctts \ fate-mov-1elist-1ctts \ fate-mov-1elist-noctts \ @@ -281,4 +281,4 @@ fate-mov-mp4-iamf-ambisonic_1: CMD = transcode wav $(SRC) mp4 "-auto_conversion_ FATE_FFMPEG += $(FATE_MOV_FFMPEG-yes) FATE_FFMPEG_FFPROBE += $(FATE_MOV_FFMPEG_FFPROBE-yes) -fate-mov: $(FATE_MOV) $(FATE_MOV_FFMPEG-yes) $(FATE_MOV_FFMPEG_FFPROBE-yes) $(FATE_MOV_FFPROBE) $(FATE_MOV_FASTSTART) $(FATE_MOV_FFMPEG_SAMPLES-yes) $(FATE_MOV_FFMPEG_FFPROBE_SAMPLES-yes) +fate-mov: $(FATE_MOV-yes) $(FATE_MOV_FFMPEG-yes) $(FATE_MOV_FFMPEG_FFPROBE-yes) $(FATE_MOV_FFPROBE) $(FATE_MOV_FASTSTART) $(FATE_MOV_FFMPEG_SAMPLES-yes) $(FATE_MOV_FFMPEG_FFPROBE_SAMPLES-yes) -- 2.45.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v1 1/4] tests/fate/libavcodec: add mjpeg encoder depend for fate-libavcodec-huffman
fix make fate failed problem, because fate libavcodec-avcodec need mjpeg encoder when fate-libavcodec-huffman Signed-off-by: Steven Liu --- tests/fate/libavcodec.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fate/libavcodec.mak b/tests/fate/libavcodec.mak index 1a5694fa5f..ef6e6ec40e 100644 --- a/tests/fate/libavcodec.mak +++ b/tests/fate/libavcodec.mak @@ -99,7 +99,7 @@ fate-libavcodec-avcodec: libavcodec/tests/avcodec$(EXESUF) fate-libavcodec-avcodec: CMD = run libavcodec/tests/avcodec$(EXESUF) fate-libavcodec-avcodec: CMP = null -FATE_LIBAVCODEC-yes += fate-libavcodec-huffman +FATE_LIBAVCODEC-$(call ALLYES, MJPEG_ENCODER) += fate-libavcodec-huffman fate-libavcodec-huffman: libavcodec/tests/mjpegenc_huffman$(EXESUF) fate-libavcodec-huffman: CMD = run libavcodec/tests/mjpegenc_huffman$(EXESUF) fate-libavcodec-huffman: CMP = null -- 2.45.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2 1/5] tests/fate/libavcodec: add mjpeg encoder depend for fate-libavcodec-huffman
fix make fate failed problem, because fate libavcodec-avcodec need mjpeg encoder when fate-libavcodec-huffman Signed-off-by: Steven Liu --- tests/fate/libavcodec.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fate/libavcodec.mak b/tests/fate/libavcodec.mak index 1a5694fa5f..ef6e6ec40e 100644 --- a/tests/fate/libavcodec.mak +++ b/tests/fate/libavcodec.mak @@ -99,7 +99,7 @@ fate-libavcodec-avcodec: libavcodec/tests/avcodec$(EXESUF) fate-libavcodec-avcodec: CMD = run libavcodec/tests/avcodec$(EXESUF) fate-libavcodec-avcodec: CMP = null -FATE_LIBAVCODEC-yes += fate-libavcodec-huffman +FATE_LIBAVCODEC-$(call ALLYES, MJPEG_ENCODER) += fate-libavcodec-huffman fate-libavcodec-huffman: libavcodec/tests/mjpegenc_huffman$(EXESUF) fate-libavcodec-huffman: CMD = run libavcodec/tests/mjpegenc_huffman$(EXESUF) fate-libavcodec-huffman: CMP = null -- 2.45.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2 2/5] tests/fate/mov: check mov formats build status be for make test
fix make fate error when make fate with --disable-everything, should check the mov build into ffmpeg status before test mov functions. Signed-off-by: Steven Liu --- tests/fate/mov.mak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index 81cc2a23af..4160c63a45 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -1,4 +1,4 @@ -FATE_MOV = fate-mov-3elist \ +FATE_MOV-$(call FRAMEMD5, MOV) = fate-mov-3elist \ fate-mov-3elist-1ctts \ fate-mov-1elist-1ctts \ fate-mov-1elist-noctts \ @@ -281,4 +281,4 @@ fate-mov-mp4-iamf-ambisonic_1: CMD = transcode wav $(SRC) mp4 "-auto_conversion_ FATE_FFMPEG += $(FATE_MOV_FFMPEG-yes) FATE_FFMPEG_FFPROBE += $(FATE_MOV_FFMPEG_FFPROBE-yes) -fate-mov: $(FATE_MOV) $(FATE_MOV_FFMPEG-yes) $(FATE_MOV_FFMPEG_FFPROBE-yes) $(FATE_MOV_FFPROBE) $(FATE_MOV_FASTSTART) $(FATE_MOV_FFMPEG_SAMPLES-yes) $(FATE_MOV_FFMPEG_FFPROBE_SAMPLES-yes) +fate-mov: $(FATE_MOV-yes) $(FATE_MOV_FFMPEG-yes) $(FATE_MOV_FFMPEG_FFPROBE-yes) $(FATE_MOV_FFPROBE) $(FATE_MOV_FASTSTART) $(FATE_MOV_FFMPEG_SAMPLES-yes) $(FATE_MOV_FFMPEG_FFPROBE_SAMPLES-yes) -- 2.45.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2 3/5] tests/fate/audio: set flcl1905 test case with depend formats, decoder, protocol
move fate-flcl1905 with depend on test case, because there will get an error when disable-everything with fate-suite samples. Signed-off-by: Steven Liu --- tests/fate/audio.mak | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/fate/audio.mak b/tests/fate/audio.mak index cfac90424b..4d6c479b6b 100644 --- a/tests/fate/audio.mak +++ b/tests/fate/audio.mak @@ -82,11 +82,10 @@ fate-smacker-audio: CMD = framecrc -i $(TARGET_SAMPLES)/smacker/wetlogo.smk -vn FATE_SAMPLES_AUDIO-$(call DEMDEC, WSVQA, WS_SND1, ARESAMPLE_FILTER) += fate-ws_snd fate-ws_snd: CMD = md5 -i $(TARGET_SAMPLES)/vqa/ws_snd.vqa -f s16le -af aresample +FATE_SAMPLES_AUDIO-$(call DEMDEC, WAV, WMAV2, FILE_PROTOCOL) += fate-flcl1905 fate-flcl1905: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_frames -show_packets -print_format compact $(TARGET_SAMPLES)/wav/FLCL_Ending_My-short.wav FATE_SAMPLES_AUDIO += $(FATE_SAMPLES_AUDIO-yes) -FATE_SAMPLES_FFPROBE += fate-flcl1905 - FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_AUDIO) -fate-audio: $(FATE_SAMPLES_AUDIO) fate-flcl1905 +fate-audio: $(FATE_SAMPLES_AUDIO) -- 2.45.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2 4/5] tests/fate/matroska: check the demuxer and decoder allyes before fate-matroska-side-data-pref-codec
fix error message when use --disable-everything --samples=fate-suite/ Signed-off-by: Steven Liu --- tests/fate/matroska.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak index 738c7fe30a..563d756485 100644 --- a/tests/fate/matroska.mak +++ b/tests/fate/matroska.mak @@ -268,7 +268,7 @@ fate-matroska-side-data-pref-codec: CMD = run ffprobe$(PROGSSUF)$(EXESUF) $(TARG -select_streams v:0 -show_streams -show_frames -show_entries stream=stream_side_data:frame=frame_side_data_list fate-matroska-side-data-pref-packet: CMD = run ffprobe$(PROGSSUF)$(EXESUF) $(TARGET_SAMPLES)/mkv/hdr10tags-both.mkv \ -select_streams v:0 -show_streams -show_frames -show_entries stream=stream_side_data:frame=frame_side_data_list -side_data_prefer_packet mastering_display_metadata,content_light_level -FATE_MATROSKA_FFPROBE-$(call ALLYES MATROSKA_DEMUXER HEVC_DECODER) += fate-matroska-side-data-pref-codec fate-matroska-side-data-pref-packet +FATE_MATROSKA_FFPROBE-$(call ALLYES, MATROSKA_DEMUXER HEVC_DECODER) += fate-matroska-side-data-pref-codec fate-matroska-side-data-pref-packet FATE_SAMPLES_AVCONV += $(FATE_MATROSKA-yes) FATE_SAMPLES_FFPROBE += $(FATE_MATROSKA_FFPROBE-yes) -- 2.45.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2 5/5] tests/fate/mov: check mov and framemd5 has enabled when test
fix error st fate-mov-neg-firstpts-discard when --disable-everything --samples=fate-suite Signed-off-by: Steven Liu --- tests/fate/mov.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index 4160c63a45..682997f7fe 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -17,7 +17,7 @@ FATE_MOV-$(call FRAMEMD5, MOV) = fate-mov-3elist \ fate-mov-stream-shorter-than-movie \ fate-mov-pcm-remux \ -FATE_MOV_FFPROBE = fate-mov-neg-firstpts-discard \ +FATE_MOV_FFPROBE-$(call FRAMEMD5, MOV) = fate-mov-neg-firstpts-discard \ fate-mov-neg-firstpts-discard-vorbis \ fate-mov-aac-2048-priming \ fate-mov-zombie \ -- 2.45.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".