[FFmpeg-devel] [PATCH] avformat/dashdec: The segments in dash file doesn't read completely when segment's size and duration is very small.

2024-09-02 Thread jiangjie
If the segment is very small, avformat_find_stream_info will read all 
audio/video data in this segment. cur->is_restart_needed is set to 0 later in 
dash_read_packet function, and no chance to be set to 1 again in the read_data 
function.

Reproduction:
ffmpeg -f lavfi -i mandelbrot -f lavfi -i anullsrc -c:v vp8 -g 5 -r 5 -c:a 
libopus -use_template 0 -seg_duration 1 -t 15 -y test_720.mpd
ffprobe -show_packets test_720.mpd

The duration of the test_720.mpd file is 15 seconds, but the duration that 
ffprobe show is small than 15 second.
---
 libavformat/dashdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 63070b77be..12960d0312 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -2207,9 +2207,9 @@ static int dash_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 if (cur->is_restart_needed) {
 cur->cur_seg_offset = 0;
 cur->init_sec_buf_read_offset = 0;
+cur->is_restart_needed = 0;
 ff_format_io_close(cur->parent, &cur->input);
 ret = reopen_demux_for_component(s, cur);
-cur->is_restart_needed = 0;
 }
 }
 return AVERROR_EOF;
-- 
2.43.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".


[FFmpeg-devel] [PATCH v2] tests/fate/hlsenc: add test case for var stream map of hlsenc

2024-09-02 Thread Steven Liu
Output var stream map m3u8 list file,
and check the list file correct.

Signed-off-by: Steven Liu 
---
 tests/fate-run.sh |  4 
 tests/fate/hlsenc.mak | 17 +
 2 files changed, 21 insertions(+)

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 6ae0320c60..12d8faa65b 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -173,6 +173,10 @@ md5pipe(){
 ffmpeg "$@" md5:
 }
 
+md5file(){
+do_md5sum "$@" | awk '{print $1}'
+}
+
 md5(){
 encfile="${outdir}/${test}.out"
 cleanfiles="$cleanfiles $encfile"
diff --git a/tests/fate/hlsenc.mak b/tests/fate/hlsenc.mak
index 98341b2b81..9f194c21d1 100644
--- a/tests/fate/hlsenc.mak
+++ b/tests/fate/hlsenc.mak
@@ -85,6 +85,23 @@ FATE_HLSENC-$(call ALLYES, HLS_DEMUXER MPEGTS_MUXER 
MPEGTS_DEMUXER AEVALSRC_FILT
 fate-hls-list-size: tests/data/hls_list_size.m3u8
 fate-hls-list-size: CMD = framecrc -auto_conversion_filters -flags +bitexact 
-i $(TARGET_PATH)/tests/data/hls_list_size.m3u8 -vf setpts=N*23
 
+tests/data/with_vtt_var_stream_map.m3u8: TAG = GEN
+tests/data/with_vtt_var_stream_map.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | 
tests/data
+   $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
+-stream_loop 9 -i $(TARGET_SAMPLES)/mov/buck480p30_na.mp4 \
+-stream_loop 120 -i 
$(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_stereo_aac_lc.mp4 \
+-i $(TARGET_SAMPLES)/sub/WebVTT_capability_tester.vtt \
+-c copy -map 0:v:0 -map 0:v:0 -map 0:v:0 -map 1:a:0 -map 1:a:0 -map 
2:s:0 -map 2:s:0 \
+-f hls -master_pl_name "with_vtt_var_stream_map.m3u8" \
+-var_stream_map 
"a:0,name:en_audio,agroup:audio,language:en,default:YES 
a:1,name:nl_audio,agroup:audio,language:nl,default:NO 
v:0,name:en,s:0,sgroup:subtitle,language:en,default:NO 
v:1,name:nl,s:1,sgroup:subtitle,language:nl,default:NO 
v:2,name:high,agroup:audio" \
+"$(TARGET_PATH)/tests/data/%v.m3u8" 2>/dev/null
+
+FATE_HLSENC-$(call ALLYES, HLS_DEMUXER MPEGTS_MUXER WEBVTT_DEMUXER) += 
fate-hls-with-vtt-var-stream_map
+fate-hls-with-vtt-var-stream_map: tests/data/with_vtt_var_stream_map.m3u8
+fate-hls-with-vtt-var-stream_map: CMD = md5file 
$(TARGET_PATH)/tests/data/with_vtt_var_stream_map.m3u8
+fate-hls-with-vtt-var-stream_map: CMP = oneline
+fate-hls-with-vtt-var-stream_map: REF = d52c10274103e68e8818654e2c2c6545
+
 tests/data/hls_fmp4.m3u8: TAG = GEN
 tests/data/hls_fmp4.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
-- 
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] avformat/dashdec: The segments in dash file doesn't read completely when segment's size and duration is very small.

2024-09-02 Thread Steven Liu
jiangjie  于2024年9月2日周一 16:35写道:
>
> If the segment is very small, avformat_find_stream_info will read all 
> audio/video data in this segment. cur->is_restart_needed is set to 0 later in 
> dash_read_packet function, and no chance to be set to 1 again in the 
> read_data function.
>
> Reproduction:
> ffmpeg -f lavfi -i mandelbrot -f lavfi -i anullsrc -c:v vp8 -g 5 -r 5 -c:a 
> libopus -use_template 0 -seg_duration 1 -t 15 -y test_720.mpd
> ffprobe -show_packets test_720.mpd
>
> The duration of the test_720.mpd file is 15 seconds, but the duration that 
> ffprobe show is small than 15 second.
> ---
>  libavformat/dashdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
> index 63070b77be..12960d0312 100644
> --- a/libavformat/dashdec.c
> +++ b/libavformat/dashdec.c
> @@ -2207,9 +2207,9 @@ static int dash_read_packet(AVFormatContext *s, 
> AVPacket *pkt)
>  if (cur->is_restart_needed) {
>  cur->cur_seg_offset = 0;
>  cur->init_sec_buf_read_offset = 0;
> +cur->is_restart_needed = 0;
>  ff_format_io_close(cur->parent, &cur->input);
>  ret = reopen_demux_for_component(s, cur);
> -cur->is_restart_needed = 0;
>  }
>  }
>  return AVERROR_EOF;
> --
> 2.43.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".

good catch
LGTM

Thanks
Steven
___
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 v1] tests/fate/hlsenc: add test case for var stream map of hlsenc

2024-09-02 Thread Steven Liu
Steven Liu  于2024年9月2日周一 14:31写道:
>
> Signed-off-by: Steven Liu 
> ---
>  tests/fate/hlsenc.mak  | 15 +++
>  tests/ref/fate/hls-with-vtt-var-stream_map |  1 +
>  2 files changed, 16 insertions(+)
>  create mode 100644 tests/ref/fate/hls-with-vtt-var-stream_map
Don't need create refence file, i have resubmit version 2 patch:
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20240902084836.3650395-1...@chinaffmpeg.org/
>
> diff --git a/tests/fate/hlsenc.mak b/tests/fate/hlsenc.mak
> index 98341b2b81..0befe7de7a 100644
> --- a/tests/fate/hlsenc.mak
> +++ b/tests/fate/hlsenc.mak
> @@ -85,6 +85,21 @@ FATE_HLSENC-$(call ALLYES, HLS_DEMUXER MPEGTS_MUXER 
> MPEGTS_DEMUXER AEVALSRC_FILT
>  fate-hls-list-size: tests/data/hls_list_size.m3u8
>  fate-hls-list-size: CMD = framecrc -auto_conversion_filters -flags +bitexact 
> -i $(TARGET_PATH)/tests/data/hls_list_size.m3u8 -vf setpts=N*23
>
> +tests/data/with_vtt_var_stream_map.m3u8: TAG = GEN
> +tests/data/with_vtt_var_stream_map.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | 
> tests/data
> +   $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
> +-stream_loop 9 -i $(TARGET_SAMPLES)/mov/buck480p30_na.mp4 \
> +-stream_loop 120 -i 
> $(TARGET_SAMPLES)/audiomatch/tones_dolby_44100_stereo_aac_lc.mp4 \
> +-i $(TARGET_SAMPLES)/sub/WebVTT_capability_tester.vtt \
> +-c copy -map 0:v:0 -map 0:v:0 -map 0:v:0 -map 1:a:0 -map 1:a:0 -map 
> 2:s:0 -map 2:s:0 \
> +-f hls -master_pl_name "with_vtt_var_stream_map.m3u8" \
> +-var_stream_map 
> "a:0,name:en_audio,agroup:audio,language:en,default:YES 
> a:1,name:nl_audio,agroup:audio,language:nl,default:NO 
> v:0,name:en,s:0,sgroup:subtitle,language:en,default:NO 
> v:1,name:nl,s:1,sgroup:subtitle,language:nl,default:NO 
> v:2,name:high,agroup:audio" \
> +"$(TARGET_PATH)/tests/data/%v.m3u8" 2>/dev/null
> +
> +FATE_HLSENC-$(call ALLYES, HLS_DEMUXER MPEGTS_MUXER WEBVTT_DEMUXER) += 
> fate-hls-with-vtt-var-stream_map
> +fate-hls-with-vtt-var-stream_map: tests/data/with_vtt_var_stream_map.m3u8
> +fate-hls-with-vtt-var-stream_map: CMD = do_md5sum 
> $(TARGET_PATH)/tests/data/with_vtt_var_stream_map.m3u8
> +
>  tests/data/hls_fmp4.m3u8: TAG = GEN
>  tests/data/hls_fmp4.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
> $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \
> diff --git a/tests/ref/fate/hls-with-vtt-var-stream_map 
> b/tests/ref/fate/hls-with-vtt-var-stream_map
> new file mode 100644
> index 00..94540963b8
> --- /dev/null
> +++ b/tests/ref/fate/hls-with-vtt-var-stream_map
> @@ -0,0 +1 @@
> +d52c10274103e68e8818654e2c2c6545 
> */data/upstream/ubuild/tests/data/with_vtt_var_stream_map.m3u8
> --
> 2.43.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".
___
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 0/2] avformat/mxfenc: Fix guess frame_rate

2024-09-02 Thread Nicolas Gaullier
Following yesterday posts by Anton/Tomas on version 1.

v3:
- do not fall back to time_base (that was my v2)
- do not remove "-r 25" in the fate test with streamcopy (see below)

What comes out:
- mxfenc behaves the same as matroskaenc for example
- avienc behaves differently: still sticked to time_base only

--

Another issue on this: "-r" as an output option with streamcopy
is not honored with mxf/matroska, but it is with avienc. This is because
streamcopy_init() only overrides time_base, not *_frame_rate.

In my understanding:
- streamcopy_init() should override avg_frame_rate/r_frame_rate
- avienc should be fixed similarly to this patch for mxfenc

[Note that if streamcopy_init() is fixed, fate-time_base data will be
updated because currently the input frame_rate is (wrongly) probed as 50.]

Nicolas Gaullier (2):
  avformat/mxfenc: Fix guess frame_rate
  tests: Remove void -time_base overrides when streamcopying to mxf

 libavformat/mxfenc.c | 8 ++--
 tests/fate/ffmpeg.mak| 4 ++--
 tests/ref/fate/time_base | 2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

-- 
2.30.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 v3 1/2] avformat/mxfenc: Fix guess frame_rate

2024-09-02 Thread Nicolas Gaullier
The time_base was a bad guess.

Currently, fate-time_base test data assumed that overriding the input
time_base would affect the frame_rate, but this behaviour is not
documented, so just fix the fate data now that this is fixed.

Fix regression since 10185e2d4c1e9839bc58a1d6a63c861677b13fd0:
previously, when streamcopying, the time_base was guessed from the
frame_rate considering it is often constant, so guessing the frame_rate
back from the time_base was often not a problem.

To reproduce:
ffmpeg -i fate-suite/mpeg2/dvd_still_frame.vob -an -c copy out.mxf

Signed-off-by: Nicolas Gaullier 
---
 libavformat/mxfenc.c | 8 ++--
 tests/ref/fate/time_base | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 4ac6a2d715..57be9e6ef6 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2894,8 +2894,12 @@ static int mxf_init(AVFormatContext *s)
 
 if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
 const AVPixFmtDescriptor *pix_desc = 
av_pix_fmt_desc_get(st->codecpar->format);
-// TODO: should be avg_frame_rate
-AVRational tbc = st->time_base;
+AVRational tbc = (AVRational){ 0, 0 };
+if (st->avg_frame_rate.num > 0 && st->avg_frame_rate.den > 0)
+tbc = av_inv_q(st->avg_frame_rate);
+else if (st->r_frame_rate.num > 0 && st->r_frame_rate.den > 0)
+tbc = av_inv_q(st->r_frame_rate);
+
 // Default component depth to 8
 sc->component_depth = 8;
 sc->h_chroma_sub_sample = 2;
diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base
index fd6cac53fc..23875d1fb8 100644
--- a/tests/ref/fate/time_base
+++ b/tests/ref/fate/time_base
@@ -1 +1 @@
-d408aba82d62a90ed7f46a1999b014f1
+b28d4ca13029fdc80a114b56467be9d7
-- 
2.30.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 v3 2/2] tests: Remove void -time_base overrides when streamcopying to mxf

2024-09-02 Thread Nicolas Gaullier
Signed-off-by: Nicolas Gaullier 
---
 tests/fate/ffmpeg.mak | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index 9e0c68da20..3ffaaeb295 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -146,7 +146,7 @@ fate-copy-trac236: CMD = transcode mov 
$(TARGET_SAMPLES)/mov/fcp_export8-236.mov
 
 FATE_STREAMCOPY-$(call TRANSCODE, RAWVIDEO MPEG2VIDEO, MXF, MPEGTS_DEMUXER 
MPEGVIDEO_PARSER MPEGAUDIO_PARSER MP2_DECODER ARESAMPLE_FILTER 
PCM_S16LE_DECODER) += fate-copy-trac4914
 fate-copy-trac4914: CMD = transcode mpegts 
$(TARGET_SAMPLES)/mpeg2/xdcam8mp2-1s_small.ts\
-  mxf "-c:a pcm_s16le -af aresample -c:v copy -time_base 
1001/3"
+  mxf "-c:a pcm_s16le -af aresample -c:v copy"
 
 FATE_STREAMCOPY-$(call TRANSCODE, RAWVIDEO MPEG2VIDEO, AVI, MPEGTS_DEMUXER 
MPEGVIDEO_PARSER MPEGAUDIO_PARSER EXTRACT_EXTRADATA_BSF MP2_DECODER 
ARESAMPLE_FILTER) += fate-copy-trac4914-avi
 fate-copy-trac4914-avi: CMD = transcode mpegts 
$(TARGET_SAMPLES)/mpeg2/xdcam8mp2-1s_small.ts\
@@ -220,7 +220,7 @@ FATE_SAMPLES_FFMPEG-$(call DEMMUX, APNG, FRAMECRC, 
SETTS_BSF PIPE_PROTOCOL) += f
 fate-ffmpeg-setts-bsf: CMD = framecrc -i $(TARGET_SAMPLES)/apng/clock.png -c:v 
copy -bsf:v 
"setts=duration=if(eq(NEXT_PTS\,NOPTS)\,PREV_OUTDURATION\,(NEXT_PTS-PTS)/2):ts=PTS/2"
 -fflags +bitexact
 
 FATE_TIME_BASE-$(call PARSERDEMDEC, MPEGVIDEO, MPEGPS, MPEG2VIDEO, 
MPEGVIDEO_DEMUXER MXF_MUXER) += fate-time_base
-fate-time_base: CMD = md5 -i $(TARGET_SAMPLES)/mpeg2/dvd_single_frame.vob -an 
-sn -c:v copy -r 25 -time_base 1001:3 -fflags +bitexact -f mxf
+fate-time_base: CMD = md5 -i $(TARGET_SAMPLES)/mpeg2/dvd_single_frame.vob -an 
-sn -c:v copy -r 25 -fflags +bitexact -f mxf
 
 FATE_SAMPLES_FFMPEG-yes += $(FATE_TIME_BASE-yes)
 
-- 
2.30.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 v3 0/2] avformat/mxfenc: Fix guess frame_rate

2024-09-02 Thread Anton Khirnov
Quoting Nicolas Gaullier (2024-09-02 11:52:15)
> Following yesterday posts by Anton/Tomas on version 1.
> 
> v3:
> - do not fall back to time_base (that was my v2)
> - do not remove "-r 25" in the fate test with streamcopy (see below)
> 
> What comes out:
> - mxfenc behaves the same as matroskaenc for example
> - avienc behaves differently: still sticked to time_base only
> 
> --
> 
> Another issue on this: "-r" as an output option with streamcopy
> is not honored with mxf/matroska, but it is with avienc. This is because
> streamcopy_init() only overrides time_base, not *_frame_rate.

Output -r should set avg_frame_rate, see line 958 in ffmpeg_mux_init.c.

-- 
Anton Khirnov
___
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 v3 0/2] avformat/mxfenc: Fix guess frame_rate

2024-09-02 Thread Tomas Härdin
mån 2024-09-02 klockan 11:52 +0200 skrev Nicolas Gaullier:
> Following yesterday posts by Anton/Tomas on version 1.
> 
> v3:
> - do not fall back to time_base (that was my v2)
> - do not remove "-r 25" in the fate test with streamcopy (see below)
> 
> What comes out:
> - mxfenc behaves the same as matroskaenc for example
> - avienc behaves differently: still sticked to time_base only
> 
> --
> 
> Another issue on this: "-r" as an output option with streamcopy
> is not honored with mxf/matroska, but it is with avienc. This is
> because
> streamcopy_init() only overrides time_base, not *_frame_rate.
> 
> In my understanding:
> - streamcopy_init() should override avg_frame_rate/r_frame_rate
> - avienc should be fixed similarly to this patch for mxfenc
> 
> [Note that if streamcopy_init() is fixed, fate-time_base data will be
> updated because currently the input frame_rate is (wrongly) probed as
> 50.]
> 
> Nicolas Gaullier (2):
>   avformat/mxfenc: Fix guess frame_rate
>   tests: Remove void -time_base overrides when streamcopying to mxf
> 
>  libavformat/mxfenc.c | 8 ++--
>  tests/fate/ffmpeg.mak    | 4 ++--
>  tests/ref/fate/time_base | 2 +-
>  3 files changed, 9 insertions(+), 5 deletions(-)
> 

No major complaints from me.

/Tomas
___
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 07/13] avcodec/hevcdec: export LCEVC metadata as frame side data

2024-09-02 Thread Derek Buitenhuis
On 8/31/2024 5:31 PM, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  configure |  1 +
>  libavcodec/hevc/hevcdec.c |  3 +++
>  libavcodec/hevc/refs.c| 15 ++-
>  3 files changed, 18 insertions(+), 1 deletion(-)

Maybe I've misunderstood, but doesn't requiring every possible base layer
codec to explicitly support exporting LCEVC kind of defeat the point of
a 'generic' enhancement layer codec like LCEVC?

- Derek
___
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/13] avcodec/decode: support applying LCEVC enhacements

2024-09-02 Thread Derek Buitenhuis
On 8/31/2024 5:31 PM, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  libavcodec/avcodec.c   |  2 ++
>  libavcodec/avcodec.h   |  5 +
>  libavcodec/decode.c| 42 +-
>  libavcodec/internal.h  |  2 ++
>  libavcodec/lcevcdec.c  |  2 ++
>  libavcodec/options_table.h |  1 +
>  libavcodec/pthread_frame.c |  7 +++
>  7 files changed, 60 insertions(+), 1 deletion(-)

No real opinion on the other patches, but this one feels really gross. I feel
liek we should not be adding new codec-specific things in AVCodecInternal or
in generic threding, decode, etc. It really feels quite wrong.

I probably missed discussion on this in previous revisions of this patch set,
but I wanted to get my thoughts in writing.

- Derek
___
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/13] lavfi/af_apulsator: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Also, simplify code, and drop a redundant call that also happens
implicitly in generic code.
---
 libavfilter/af_apulsator.c | 29 -
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/libavfilter/af_apulsator.c b/libavfilter/af_apulsator.c
index 4487bec956..8e01cd6feb 100644
--- a/libavfilter/af_apulsator.c
+++ b/libavfilter/af_apulsator.c
@@ -185,19 +185,30 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 return ff_filter_frame(outlink, out);
 }
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
 {
-AVFilterChannelLayouts *layout = NULL;
-AVFilterFormats *formats = NULL;
+static const enum AVSampleFormat formats[] = {
+AV_SAMPLE_FMT_DBL,
+AV_SAMPLE_FMT_NONE,
+};
+static const AVChannelLayout layouts[] = {
+(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO,
+(AVChannelLayout){ .nb_channels = 0 },
+};
+
 int ret;
 
-if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_DBL  )) 
< 0 ||
-(ret = ff_set_common_formats (ctx , formats)) 
< 0 ||
-(ret = ff_add_channel_layout (&layout , 
&(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) < 0 ||
-(ret = ff_set_common_channel_layouts (ctx , layout )) 
< 0)
+ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats);
+if (ret < 0)
 return ret;
 
-return ff_set_common_all_samplerates(ctx);
+ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, 
layouts);
+if (ret < 0)
+return ret;
+
+return 0;
 }
 
 static int config_input(AVFilterLink *inlink)
@@ -245,5 +256,5 @@ const AVFilter ff_af_apulsator = {
 .priv_class= &apulsator_class,
 FILTER_INPUTS(inputs),
 FILTER_OUTPUTS(ff_audio_default_filterpad),
-FILTER_QUERY_FUNC(query_formats),
+FILTER_QUERY_FUNC2(query_formats),
 };
-- 
2.43.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".


[FFmpeg-devel] [PATCH 01/13] lavfi/af_agate: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
---
 libavfilter/af_agate.c | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/libavfilter/af_agate.c b/libavfilter/af_agate.c
index d725485950..09655b7f82 100644
--- a/libavfilter/af_agate.c
+++ b/libavfilter/af_agate.c
@@ -310,26 +310,28 @@ static int activate(AVFilterContext *ctx)
 return 0;
 }
 
-static int scquery_formats(AVFilterContext *ctx)
+static int scquery_formats(const AVFilterContext *ctx,
+   AVFilterFormatsConfig **cfg_in,
+   AVFilterFormatsConfig **cfg_out)
 {
 static const enum AVSampleFormat sample_fmts[] = {
 AV_SAMPLE_FMT_DBL,
 AV_SAMPLE_FMT_NONE
 };
-int ret = ff_channel_layouts_ref(ff_all_channel_counts(),
- &ctx->inputs[1]->outcfg.channel_layouts);
+int ret;
+
+/* Generic code will link the channel properties of the main input and the
+ * output; it won't touch the second input as its channel_layouts is 
already
+ * set. */
+ret = ff_channel_layouts_ref(ff_all_channel_counts(),
+ &cfg_in[1]->channel_layouts);
 if (ret < 0)
 return ret;
 
-/* This will link the channel properties of the main input and the output;
- * it won't touch the second input as its channel_layouts is already set. 
*/
-if ((ret = ff_set_common_all_channel_counts(ctx)) < 0)
+if ((ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, 
sample_fmts)) < 0)
 return ret;
 
-if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts)) < 0)
-return ret;
-
-return ff_set_common_all_samplerates(ctx);
+return 0;
 }
 
 static int scconfig_output(AVFilterLink *outlink)
@@ -385,7 +387,7 @@ const AVFilter ff_af_sidechaingate = {
 .uninit = uninit,
 FILTER_INPUTS(sidechaingate_inputs),
 FILTER_OUTPUTS(sidechaingate_outputs),
-FILTER_QUERY_FUNC(scquery_formats),
+FILTER_QUERY_FUNC2(scquery_formats),
 .process_command = ff_filter_process_command,
 .flags  = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
 };
-- 
2.43.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".


[FFmpeg-devel] [PATCH 03/13] lavfi/af_anequalizer: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Also, simplify code and drop redundant calls that also happen implicitly
in generic code.
---
 libavfilter/af_anequalizer.c | 32 +---
 1 file changed, 9 insertions(+), 23 deletions(-)

diff --git a/libavfilter/af_anequalizer.c b/libavfilter/af_anequalizer.c
index fdc9404857..26e9c3cdd7 100644
--- a/libavfilter/af_anequalizer.c
+++ b/libavfilter/af_anequalizer.c
@@ -217,13 +217,11 @@ static av_cold int init(AVFilterContext *ctx)
 return 0;
 }
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
 {
-AVFilterLink *inlink = ctx->inputs[0];
-AVFilterLink *outlink = ctx->outputs[0];
-AudioNEqualizerContext *s = ctx->priv;
-AVFilterFormats *formats;
-AVFilterChannelLayouts *layouts;
+const AudioNEqualizerContext *s = ctx->priv;
 static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, 
AV_PIX_FMT_NONE };
 static const enum AVSampleFormat sample_fmts[] = {
 AV_SAMPLE_FMT_DBLP,
@@ -232,25 +230,13 @@ static int query_formats(AVFilterContext *ctx)
 int ret;
 
 if (s->draw_curves) {
-AVFilterLink *videolink = ctx->outputs[1];
-formats = ff_make_format_list(pix_fmts);
-if ((ret = ff_formats_ref(formats, &videolink->incfg.formats)) < 0)
+ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, pix_fmts);
+if (ret < 0)
 return ret;
 }
 
-formats = ff_make_format_list(sample_fmts);
-if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0 ||
-(ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0)
-return ret;
-
-layouts = ff_all_channel_counts();
-if ((ret = ff_channel_layouts_ref(layouts, 
&inlink->outcfg.channel_layouts)) < 0 ||
-(ret = ff_channel_layouts_ref(layouts, 
&outlink->incfg.channel_layouts)) < 0)
-return ret;
-
-formats = ff_all_samplerates();
-if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0 ||
-(ret = ff_formats_ref(formats, &outlink->incfg.samplerates)) < 0)
+ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts);
+if (ret < 0)
 return ret;
 
 return 0;
@@ -775,7 +761,7 @@ const AVFilter ff_af_anequalizer = {
 .uninit= uninit,
 FILTER_INPUTS(inputs),
 .outputs   = NULL,
-FILTER_QUERY_FUNC(query_formats),
+FILTER_QUERY_FUNC2(query_formats),
 .process_command = process_command,
 .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS |
  AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
-- 
2.43.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".


[FFmpeg-devel] [PATCH 02/13] lavfi/af_aiir: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Drop redundant ff_set_common_all_channel_counts() /
ff_set_common_all_samplerates() calls, since those happen implicitly in
generic code.
---
 libavfilter/af_aiir.c | 20 
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c
index 462fa4666e..dfeeb34c9b 100644
--- a/libavfilter/af_aiir.c
+++ b/libavfilter/af_aiir.c
@@ -78,9 +78,11 @@ typedef struct AudioIIRContext {
 int (*iir_channel)(AVFilterContext *ctx, void *arg, int ch, int nb_jobs);
 } AudioIIRContext;
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
 {
-AudioIIRContext *s = ctx->priv;
+const AudioIIRContext *s = ctx->priv;
 AVFilterFormats *formats;
 enum AVSampleFormat sample_fmts[] = {
 AV_SAMPLE_FMT_DBLP,
@@ -93,23 +95,17 @@ static int query_formats(AVFilterContext *ctx)
 int ret;
 
 if (s->response) {
-AVFilterLink *videolink = ctx->outputs[1];
-
 formats = ff_make_format_list(pix_fmts);
-if ((ret = ff_formats_ref(formats, &videolink->incfg.formats)) < 0)
+if ((ret = ff_formats_ref(formats, &cfg_out[1]->formats)) < 0)
 return ret;
 }
 
-ret = ff_set_common_all_channel_counts(ctx);
-if (ret < 0)
-return ret;
-
 sample_fmts[0] = s->sample_format;
-ret = ff_set_common_formats_from_list(ctx, sample_fmts);
+ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts);
 if (ret < 0)
 return ret;
 
-return ff_set_common_all_samplerates(ctx);
+return 0;
 }
 
 #define IIR_CH(name, type, min, max, need_clipping) \
@@ -1572,7 +1568,7 @@ const AVFilter ff_af_aiir = {
 .init  = init,
 .uninit= uninit,
 FILTER_INPUTS(inputs),
-FILTER_QUERY_FUNC(query_formats),
+FILTER_QUERY_FUNC2(query_formats),
 .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS |
  AVFILTER_FLAG_SLICE_THREADS,
 };
-- 
2.43.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".


[FFmpeg-devel] [PATCH 06/13] lavfi/af_aresample: convert to query_func2()

2024-09-02 Thread Anton Khirnov
---
 libavfilter/af_aresample.c | 23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index 2a67b06260..9ee4082c0c 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -63,16 +63,15 @@ static av_cold void uninit(AVFilterContext *ctx)
 swr_free(&aresample->swr);
 }
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
 {
-AResampleContext *aresample = ctx->priv;
+const AResampleContext *aresample = ctx->priv;
 enum AVSampleFormat out_format;
 AVChannelLayout out_layout = { 0 };
 int64_t out_rate;
 
-AVFilterLink *inlink  = ctx->inputs[0];
-AVFilterLink *outlink = ctx->outputs[0];
-
 AVFilterFormats*in_formats, *out_formats;
 AVFilterFormats*in_samplerates, *out_samplerates;
 AVFilterChannelLayouts *in_layouts, *out_layouts;
@@ -84,15 +83,15 @@ static int query_formats(AVFilterContext *ctx)
 av_opt_get_int(aresample->swr, "osr", 0, &out_rate);
 
 in_formats  = ff_all_formats(AVMEDIA_TYPE_AUDIO);
-if ((ret = ff_formats_ref(in_formats, &inlink->outcfg.formats)) < 0)
+if ((ret = ff_formats_ref(in_formats, &cfg_in[0]->formats)) < 0)
 return ret;
 
 in_samplerates  = ff_all_samplerates();
-if ((ret = ff_formats_ref(in_samplerates, &inlink->outcfg.samplerates)) < 
0)
+if ((ret = ff_formats_ref(in_samplerates, &cfg_out[0]->samplerates)) < 0)
 return ret;
 
 in_layouts  = ff_all_channel_counts();
-if ((ret = ff_channel_layouts_ref(in_layouts, 
&inlink->outcfg.channel_layouts)) < 0)
+if ((ret = ff_channel_layouts_ref(in_layouts, 
&cfg_in[0]->channel_layouts)) < 0)
 return ret;
 
 if(out_rate > 0) {
@@ -102,7 +101,7 @@ static int query_formats(AVFilterContext *ctx)
 out_samplerates = ff_all_samplerates();
 }
 
-if ((ret = ff_formats_ref(out_samplerates, &outlink->incfg.samplerates)) < 
0)
+if ((ret = ff_formats_ref(out_samplerates, &cfg_out[0]->samplerates)) < 0)
 return ret;
 
 if(out_format != AV_SAMPLE_FMT_NONE) {
@@ -110,7 +109,7 @@ static int query_formats(AVFilterContext *ctx)
 out_formats = ff_make_format_list(formatlist);
 } else
 out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
-if ((ret = ff_formats_ref(out_formats, &outlink->incfg.formats)) < 0)
+if ((ret = ff_formats_ref(out_formats, &cfg_out[0]->formats)) < 0)
 return ret;
 
 av_opt_get_chlayout(aresample->swr, "ochl", 0, &out_layout);
@@ -121,7 +120,7 @@ static int query_formats(AVFilterContext *ctx)
 out_layouts = ff_all_channel_counts();
 av_channel_layout_uninit(&out_layout);
 
-return ff_channel_layouts_ref(out_layouts, 
&outlink->incfg.channel_layouts);
+return ff_channel_layouts_ref(out_layouts, &cfg_out[0]->channel_layouts);
 }
 
 
@@ -372,5 +371,5 @@ const AVFilter ff_af_aresample = {
 .priv_class= &aresample_class,
 FILTER_INPUTS(ff_audio_default_filterpad),
 FILTER_OUTPUTS(aresample_outputs),
-FILTER_QUERY_FUNC(query_formats),
+FILTER_QUERY_FUNC2(query_formats),
 };
-- 
2.43.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".


[FFmpeg-devel] [PATCH 09/13] lavfi/af_asetrate: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Also, drop redundant calls that also happen implicitly in generic code.
---
 libavfilter/af_asetrate.c | 18 +++---
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/libavfilter/af_asetrate.c b/libavfilter/af_asetrate.c
index 80f76fbb70..061edebdf0 100644
--- a/libavfilter/af_asetrate.c
+++ b/libavfilter/af_asetrate.c
@@ -47,23 +47,19 @@ static const AVOption asetrate_options[] = {
 
 AVFILTER_DEFINE_CLASS(asetrate);
 
-static av_cold int query_formats(AVFilterContext *ctx)
+static av_cold int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
 {
-ASetRateContext *sr = ctx->priv;
+const ASetRateContext *sr = ctx->priv;
 int ret, sample_rates[] = { sr->sample_rate, -1 };
 
-if ((ret = ff_set_common_formats(ctx, ff_all_formats(AVMEDIA_TYPE_AUDIO))) 
< 0)
-return ret;
-
-if ((ret = ff_set_common_all_channel_counts(ctx)) < 0)
-return ret;
-
 if ((ret = ff_formats_ref(ff_all_samplerates(),
-  &ctx->inputs[0]->outcfg.samplerates)) < 0)
+  &cfg_in[0]->samplerates)) < 0)
 return ret;
 
 return ff_formats_ref(ff_make_format_list(sample_rates),
-  &ctx->outputs[0]->incfg.samplerates);
+  &cfg_out[0]->samplerates);
 }
 
 static av_cold int config_props(AVFilterLink *outlink)
@@ -122,7 +118,7 @@ const AVFilter ff_af_asetrate = {
 .priv_size = sizeof(ASetRateContext),
 FILTER_INPUTS(asetrate_inputs),
 FILTER_OUTPUTS(asetrate_outputs),
-FILTER_QUERY_FUNC(query_formats),
+FILTER_QUERY_FUNC2(query_formats),
 .priv_class= &asetrate_class,
 .flags = AVFILTER_FLAG_METADATA_ONLY,
 };
-- 
2.43.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".


[FFmpeg-devel] [PATCH 07/13] lavfi/af_arls: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Also, drop redundant calls that also happen implicitly in generic code.
---
 libavfilter/af_arls.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavfilter/af_arls.c b/libavfilter/af_arls.c
index de50da6473..3f182454e4 100644
--- a/libavfilter/af_arls.c
+++ b/libavfilter/af_arls.c
@@ -84,9 +84,11 @@ static const AVOption arls_options[] = {
 
 AVFILTER_DEFINE_CLASS(arls);
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
 {
-AudioRLSContext *s = ctx->priv;
+const AudioRLSContext *s = ctx->priv;
 static const enum AVSampleFormat sample_fmts[3][3] = {
 { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE },
 { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE },
@@ -94,13 +96,11 @@ static int query_formats(AVFilterContext *ctx)
 };
 int ret;
 
-if ((ret = ff_set_common_all_channel_counts(ctx)) < 0)
+if ((ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out,
+sample_fmts[s->precision])) < 
0)
 return ret;
 
-if ((ret = ff_set_common_formats_from_list(ctx, 
sample_fmts[s->precision])) < 0)
-return ret;
-
-return ff_set_common_all_samplerates(ctx);
+return 0;
 }
 
 static int activate(AVFilterContext *ctx)
@@ -291,7 +291,7 @@ const AVFilter ff_af_arls = {
 .activate   = activate,
 FILTER_INPUTS(inputs),
 FILTER_OUTPUTS(outputs),
-FILTER_QUERY_FUNC(query_formats),
+FILTER_QUERY_FUNC2(query_formats),
 .flags  = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
   AVFILTER_FLAG_SLICE_THREADS,
 .process_command = ff_filter_process_command,
-- 
2.43.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".


[FFmpeg-devel] [PATCH 10/13] lavfi/af_asr: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Also, simplify code.
---
 libavfilter/af_asr.c | 33 +++--
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/libavfilter/af_asr.c b/libavfilter/af_asr.c
index e19b7c3be2..26963222fd 100644
--- a/libavfilter/af_asr.c
+++ b/libavfilter/af_asr.c
@@ -122,20 +122,33 @@ static av_cold int asr_init(AVFilterContext *ctx)
 return 0;
 }
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
 {
-ASRContext *s = ctx->priv;
+static const enum AVSampleFormat formats[] = {
+AV_SAMPLE_FMT_S16,
+AV_SAMPLE_FMT_NONE,
+};
+static const AVChannelLayout layouts[] = {
+(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO,
+(AVChannelLayout){ .nb_channels = 0 },
+};
+
+const ASRContext *s = ctx->priv;
 int sample_rates[] = { s->rate, -1 };
 int ret;
 
-AVFilterFormats *formats = NULL;
-AVFilterChannelLayouts *layout = NULL;
+ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats);
+if (ret < 0)
+return ret;
 
-if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_S16  
   )) < 0 ||
-(ret = ff_set_common_formats (ctx , formats
   )) < 0 ||
-(ret = ff_add_channel_layout (&layout , 
&(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO )) < 0 ||
-(ret = ff_set_common_channel_layouts (ctx , layout 
   )) < 0 ||
-(ret = ff_set_common_samplerates_from_list(ctx, sample_rates )) < 
0)
+ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, 
layouts);
+if (ret < 0)
+return ret;
+
+ret = ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, 
sample_rates);
+if (ret < 0)
 return ret;
 
 return 0;
@@ -170,5 +183,5 @@ const AVFilter ff_af_asr = {
 .flags = AVFILTER_FLAG_METADATA_ONLY,
 FILTER_INPUTS(asr_inputs),
 FILTER_OUTPUTS(ff_audio_default_filterpad),
-FILTER_QUERY_FUNC(query_formats),
+FILTER_QUERY_FUNC2(query_formats),
 };
-- 
2.43.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".


[FFmpeg-devel] [PATCH 11/13] lavfi/af_biquads: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Also, drop redundant calls that also happen implicitly in generic code.
---
 libavfilter/af_biquads.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 784782f14d..dc7f19d7ea 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -154,9 +154,11 @@ typedef struct BiquadsContext {
void *cache, int *clip, int disabled);
 } BiquadsContext;
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
 {
-BiquadsContext *s = ctx->priv;
+const BiquadsContext *s = ctx->priv;
 static const enum AVSampleFormat auto_sample_fmts[] = {
 AV_SAMPLE_FMT_S16P,
 AV_SAMPLE_FMT_S32P,
@@ -169,9 +171,7 @@ static int query_formats(AVFilterContext *ctx)
 AV_SAMPLE_FMT_NONE
 };
 const enum AVSampleFormat *sample_fmts_list = sample_fmts;
-int ret = ff_set_common_all_channel_counts(ctx);
-if (ret < 0)
-return ret;
+int ret;
 
 switch (s->precision) {
 case 0:
@@ -190,11 +190,11 @@ static int query_formats(AVFilterContext *ctx)
 sample_fmts_list = auto_sample_fmts;
 break;
 }
-ret = ff_set_common_formats_from_list(ctx, sample_fmts_list);
+ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, 
sample_fmts_list);
 if (ret < 0)
 return ret;
 
-return ff_set_common_all_samplerates(ctx);
+return 0;
 }
 
 #define BIQUAD_FILTER(name, type, ftype, min, max, need_clipping) \
@@ -1463,7 +1463,7 @@ const AVFilter ff_af_##name_ = { \
 .uninit= uninit, \
 FILTER_INPUTS(ff_audio_default_filterpad),   \
 FILTER_OUTPUTS(outputs), \
-FILTER_QUERY_FUNC(query_formats),\
+FILTER_QUERY_FUNC2(query_formats),   \
 .process_command = process_command,  \
 .flags = AVFILTER_FLAG_SLICE_THREADS | 
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, \
 }
-- 
2.43.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".


[FFmpeg-devel] [PATCH 08/13] lavfi/af_arnndn: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Also, drop redundant calls that also happen implicitly in generic code.
---
 libavfilter/af_arnndn.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/libavfilter/af_arnndn.c b/libavfilter/af_arnndn.c
index b29af87df9..3c2ae6370d 100644
--- a/libavfilter/af_arnndn.c
+++ b/libavfilter/af_arnndn.c
@@ -327,7 +327,9 @@ static int rnnoise_model_from_file(FILE *f, RNNModel **rnn)
 return 0;
 }
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
 {
 static const enum AVSampleFormat sample_fmts[] = {
 AV_SAMPLE_FMT_FLTP,
@@ -335,15 +337,11 @@ static int query_formats(AVFilterContext *ctx)
 };
 int ret, sample_rates[] = { 48000, -1 };
 
-ret = ff_set_common_formats_from_list(ctx, sample_fmts);
+ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts);
 if (ret < 0)
 return ret;
 
-ret = ff_set_common_all_channel_counts(ctx);
-if (ret < 0)
-return ret;
-
-return ff_set_common_samplerates_from_list(ctx, sample_rates);
+return ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, 
sample_rates);
 }
 
 static int config_input(AVFilterLink *inlink)
@@ -1608,7 +1606,7 @@ const AVFilter ff_af_arnndn = {
 .uninit= uninit,
 FILTER_INPUTS(inputs),
 FILTER_OUTPUTS(ff_audio_default_filterpad),
-FILTER_QUERY_FUNC(query_formats),
+FILTER_QUERY_FUNC2(query_formats),
 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
  AVFILTER_FLAG_SLICE_THREADS,
 .process_command = process_command,
-- 
2.43.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".


[FFmpeg-devel] [PATCH 04/13] lavfi/af_anlms: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Also, drop redundant calls that also happen implicitly in generic code.
---
 libavfilter/af_anlms.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavfilter/af_anlms.c b/libavfilter/af_anlms.c
index 1764b01072..4e83a0501d 100644
--- a/libavfilter/af_anlms.c
+++ b/libavfilter/af_anlms.c
@@ -87,9 +87,11 @@ static const AVOption anlms_options[] = {
 
 AVFILTER_DEFINE_CLASS_EXT(anlms, "anlm(f|s)", anlms_options);
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
 {
-AudioNLMSContext *s = ctx->priv;
+const AudioNLMSContext *s = ctx->priv;
 static const enum AVSampleFormat sample_fmts[3][3] = {
 { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE },
 { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE },
@@ -97,13 +99,11 @@ static int query_formats(AVFilterContext *ctx)
 };
 int ret;
 
-if ((ret = ff_set_common_all_channel_counts(ctx)) < 0)
+if ((ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out,
+sample_fmts[s->precision])) < 
0)
 return ret;
 
-if ((ret = ff_set_common_formats_from_list(ctx, 
sample_fmts[s->precision])) < 0)
-return ret;
-
-return ff_set_common_all_samplerates(ctx);
+return 0;
 }
 
 static int activate(AVFilterContext *ctx)
@@ -277,7 +277,7 @@ const AVFilter ff_af_anlmf = {
 .activate   = activate,
 FILTER_INPUTS(inputs),
 FILTER_OUTPUTS(outputs),
-FILTER_QUERY_FUNC(query_formats),
+FILTER_QUERY_FUNC2(query_formats),
 .flags  = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
   AVFILTER_FLAG_SLICE_THREADS,
 .process_command = ff_filter_process_command,
-- 
2.43.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".


[FFmpeg-devel] [PATCH 12/13] lavfi/af_bs2b: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Also, drop redundant calls that also happen implicitly in generic code.
---
 libavfilter/af_bs2b.c | 19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/libavfilter/af_bs2b.c b/libavfilter/af_bs2b.c
index d6a974051e..de2c30fede 100644
--- a/libavfilter/af_bs2b.c
+++ b/libavfilter/af_bs2b.c
@@ -90,9 +90,14 @@ static av_cold void uninit(AVFilterContext *ctx)
 bs2b_close(bs2b->bs2bp);
 }
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
 {
-AVFilterChannelLayouts *layouts = NULL;
+static const AVChannelLayout layouts[] = {
+(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO,
+(AVChannelLayout){ .nb_channels = 0 },
+};
 
 static const enum AVSampleFormat sample_fmts[] = {
 AV_SAMPLE_FMT_U8,
@@ -104,17 +109,15 @@ static int query_formats(AVFilterContext *ctx)
 };
 int ret;
 
-if (ff_add_channel_layout(&layouts, 
&(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO) != 0)
-return AVERROR(ENOMEM);
-ret = ff_set_common_channel_layouts(ctx, layouts);
+ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, 
layouts);
 if (ret < 0)
 return ret;
 
-ret = ff_set_common_formats_from_list(ctx, sample_fmts);
+ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts);
 if (ret < 0)
 return ret;
 
-return ff_set_common_all_samplerates(ctx);
+return 0;
 }
 
 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
@@ -211,5 +214,5 @@ const AVFilter ff_af_bs2b = {
 .uninit = uninit,
 FILTER_INPUTS(bs2b_inputs),
 FILTER_OUTPUTS(bs2b_outputs),
-FILTER_QUERY_FUNC(query_formats),
+FILTER_QUERY_FUNC2(query_formats),
 };
-- 
2.43.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".


[FFmpeg-devel] [PATCH 13/13] lavfi/af_channelmap: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Also, drop redundant calls that also happen implicitly in generic code.
---
 libavfilter/af_channelmap.c | 27 +--
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index 8d65fb3cd2..3f02a7fd8f 100644
--- a/libavfilter/af_channelmap.c
+++ b/libavfilter/af_channelmap.c
@@ -321,21 +321,28 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
 return 0;
 }
 
-static int channelmap_query_formats(AVFilterContext *ctx)
+static int channelmap_query_formats(const AVFilterContext *ctx,
+AVFilterFormatsConfig **cfg_in,
+AVFilterFormatsConfig **cfg_out)
 {
-ChannelMapContext *s = ctx->priv;
+const ChannelMapContext *s = ctx->priv;
 AVFilterChannelLayouts *channel_layouts = NULL;
+
 int ret;
 
-if ((ret = ff_set_common_formats(ctx,  ff_planar_sample_fmts()))  < 0 
||
-(ret = ff_set_common_all_samplerates(ctx  
)) < 0 ||
-(ret = ff_add_channel_layout(&channel_layouts, &s->output_layout)) < 0 
||
-(ret = ff_channel_layouts_ref(channel_layouts,
-  
&ctx->outputs[0]->incfg.channel_layouts)) < 0)
+ret = ff_set_common_formats2(ctx, cfg_in, cfg_out, 
ff_planar_sample_fmts());
+if (ret < 0)
 return ret;
 
-return ff_channel_layouts_ref(ff_all_channel_counts(),
-  &ctx->inputs[0]->outcfg.channel_layouts);
+ret = ff_add_channel_layout(&channel_layouts, &s->output_layout);
+if (ret < 0)
+return ret;
+
+ret = ff_channel_layouts_ref(channel_layouts, 
&cfg_out[0]->channel_layouts);
+if (ret < 0)
+return ret;
+
+return 0;
 }
 
 static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf)
@@ -425,5 +432,5 @@ const AVFilter ff_af_channelmap = {
 .priv_class= &channelmap_class,
 FILTER_INPUTS(avfilter_af_channelmap_inputs),
 FILTER_OUTPUTS(ff_audio_default_filterpad),
-FILTER_QUERY_FUNC(channelmap_query_formats),
+FILTER_QUERY_FUNC2(channelmap_query_formats),
 };
-- 
2.43.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 v3 01/17] avcodec/internal: add FFCodec.color_ranges

2024-09-02 Thread Anton Khirnov
Quoting Niklas Haas (2024-08-30 12:15:24)
> diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h
> index 1cd1f684f9..6fdd261066 100644
> --- a/libavcodec/codec_internal.h
> +++ b/libavcodec/codec_internal.h
> @@ -132,7 +132,13 @@ typedef struct FFCodec {
>  /**
>   * Internal codec capabilities FF_CODEC_CAP_*.
>   */
> -unsigned caps_internal:29;
> +unsigned caps_internal:27;
> +
> +/**
> + * This field determines the video color ranges supported by a codec.

s/codec/encoder?

> + * Should be set to a bitmask of AVCOL_RANGE_MPEG and AVCOL_RANGE_JPEG.
> + */
> +unsigned color_ranges:2;

-- 
Anton Khirnov
___
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 v3 02/17] avcodec: add avcodec_get_supported_config()

2024-09-02 Thread Anton Khirnov
Quoting Niklas Haas (2024-08-30 12:15:25)
> diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
> index 6065f1b689..ad25e02613 100644
> --- a/libavcodec/avcodec.c
> +++ b/libavcodec/avcodec.c
> @@ -28,6 +28,7 @@
>  #include "libavutil/avstring.h"
>  #include "libavutil/bprint.h"
>  #include "libavutil/channel_layout.h"
> +#include "libavutil/common.h"
>  #include "libavutil/emms.h"
>  #include "libavutil/fifo.h"
>  #include "libavutil/imgutils.h"
> @@ -706,3 +707,96 @@ int attribute_align_arg 
> avcodec_receive_frame(AVCodecContext *avctx, AVFrame *fr
>  return ff_decode_receive_frame(avctx, frame);
>  return ff_encode_receive_frame(avctx, frame);
>  }
> +
> +#define WRAP_CONFIG(allowed_type, field, terminator)\
> +do {\
> +static const __typeof__(*(field)) sentinel = terminator;\

We don't allow typeof, it's not in C11. Just pass the type as parameter
to the macro.

-- 
Anton Khirnov
___
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/2] MAINTAINERS: aacdec_usac seems not actively maintained

2024-09-02 Thread Michael Niedermayer
My ping on a patch on 21 Jul has no reaction

Signed-off-by: Michael Niedermayer 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index a513bec72a9..d73536370a0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -146,6 +146,7 @@ Codecs:
   4xm.c [2] Michael Niedermayer
   8bps.cRoberto Togni
   8svx.cJaikrishnan Menon
+  aacdec_usac.c [0]
   aacenc*, aaccoder.c   Rostislav Pehlivanov
   adpcm.c   Zane van Iperen
   alacenc.c Jaikrishnan Menon
-- 
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".


[FFmpeg-devel] [PATCH 2/2] MAINTAINERS: mark vf_volumedetect as unmaintained

2024-09-02 Thread Michael Niedermayer
A ping from last month by Yigithan Yigit had no reaction

Signed-off-by: Michael Niedermayer 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index d73536370a0..0b323962ed4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -324,6 +324,7 @@ Filters:
   af_hdcd.c Burt P.
   af_loudnorm.c Kyle Swanson
   af_pan.c  Nicolas George
+  af_volumedetect.c [0]
   avf_showcqt.c Muhammad Faiz
   vf_bwdif  Thomas Mundt (CC )
   vf_chromakey.cTimo Rothenpieler
-- 
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 v3 09/17] avcodec/codec_internal: nuke init_static_data()

2024-09-02 Thread Anton Khirnov
Quoting Niklas Haas (2024-08-30 12:15:32)
> From: Niklas Haas 
> 
> All hail get_supported_config()

\o/

-- 
Anton Khirnov
___
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 v3 0/2] avformat/mxfenc: Fix guess frame_rate

2024-09-02 Thread Nicolas Gaullier
>De : Anton Khirnov  
>Envoyé : lundi 2 septembre 2024 13:26
>
>Quoting Nicolas Gaullier (2024-09-02 11:52:15)
>> Following yesterday posts by Anton/Tomas on version 1.
>> 
>> v3:
>> - do not fall back to time_base (that was my v2)
>> - do not remove "-r 25" in the fate test with streamcopy (see below)
>> 
>> What comes out:
>> - mxfenc behaves the same as matroskaenc for example
>> - avienc behaves differently: still sticked to time_base only
>> 
>> --
>> 
>> Another issue on this: "-r" as an output option with streamcopy is not 
>> honored with mxf/matroska, but it is with avienc. This is because
>> streamcopy_init() only overrides time_base, not *_frame_rate.
>
>Output -r should set avg_frame_rate, see line 958 in ffmpeg_mux_init.c.

Yes, but this is reset a few lines below.
So, I will send a third patch in the same serie to address this; but maybe it 
can be discussed afterwards independently...
Except that issue,  do the patches for mxfenc look good to you ?

Thanks
Nicolas
___
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 3/3] fftools/ffmpeg: Fix honor -r output option with streamcopy

2024-09-02 Thread Nicolas Gaullier
Fix "ost->st->avg_frame_rate = ost->frame_rate" in streamcopy_init()
being reset to input's frame rate a few lines below.
Note that in current code, there are some discrepancies amongst the
muxers. For example, avienc relies on time_base, so it is not affected
by this patch, whereas mxfenc and matroskaenc do use avg_frame_rate,
so this patch fixes -r being honored.

In the update fate test, the input is wrongly probeb as 50fps. With
this patch, the correct value (25fps) is forced with -r.

Signed-off-by: Nicolas Gaullier 
---
 fftools/ffmpeg_mux_init.c | 1 -
 tests/ref/fate/time_base  | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index e84fa9719f..37d626add6 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -1012,7 +1012,6 @@ static int streamcopy_init(const Muxer *mux, OutputStream 
*ost, AVDictionary **e
 else
 sar = par->sample_aspect_ratio;
 ost->st->sample_aspect_ratio = par->sample_aspect_ratio = sar;
-ost->st->avg_frame_rate = ist->st->avg_frame_rate;
 ost->st->r_frame_rate = ist->st->r_frame_rate;
 break;
 }
diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base
index 23875d1fb8..ae96232e60 100644
--- a/tests/ref/fate/time_base
+++ b/tests/ref/fate/time_base
@@ -1 +1 @@
-b28d4ca13029fdc80a114b56467be9d7
+69ffc45e19ab070bc3e964d7b718fe53
-- 
2.30.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/2] MAINTAINERS: mark vf_volumedetect as unmaintained

2024-09-02 Thread Yigithan Yigit
Hi Michael,

I am new to community, and I am not sure about qualifications of maintainer but 
If you prefer I can be the maintainer. 

Best Regards,
Yiğithan Yiğit

> On 2 Sep 2024, at 16:39, Michael Niedermayer  wrote:
> A ping from last month by Yigithan Yigit had no reaction
> 
> Signed-off-by: Michael Niedermayer 
> ---
> MAINTAINERS | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d73536370a0..0b323962ed4 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -324,6 +324,7 @@ Filters:
>   af_hdcd.c Burt P.
>   af_loudnorm.c Kyle Swanson
>   af_pan.c  Nicolas George
> +  af_volumedetect.c [0]
>   avf_showcqt.c Muhammad Faiz
>   vf_bwdif  Thomas Mundt (CC )
>   vf_chromakey.cTimo Rothenpieler
> --
> 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".
___
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/amfenc: increase precision of Sleep() on Windows

2024-09-02 Thread Cameron Gutman
On Wed, Aug 21, 2024 at 12:02 PM Kieran Kunhya via ffmpeg-devel
 wrote:
>
> On Mon, Aug 19, 2024 at 7:31 PM Timo Rothenpieler  
> wrote:
> >
> > On 19.08.2024 16:23, Araz Iusubov wrote:
> > > From: Evgeny Pavlov 
> > >
> > > This commit increase precision of Sleep() function on Windows.
> > > This fix reduces the sleep time on Windows to improve AMF encoding
> > > performance on low resolution input videos.
> > >
> > > Fix for issue #10622
> > >
> > > We evaluated CreateWaitableTimerExW with
> > > CREATE_WAITABLE_TIMER_HIGH_RESOLUTION flag. In fact, this function has
> > > the same precision level as the Sleep() function.
> > >
> > > Usually changing the time resolution will only affect the current
> > > process and will not impact other processes, thus it will not cause a
> > > global effect on the current system. Here is an info from
> > > documentation on timeBeginPeriod
> > > https://learn.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timebeginperiod
> > >
> > > "Prior to Windows 10, version 2004, this function affects a global
> > > Windows setting. For all processes Windows uses the lowest value (that
> > > is, highest resolution) requested by any process. Starting with
> > > Windows 10, version 2004, this function no longer affects global timer
> > > resolution. For processes which call this function, Windows uses the
> > > lowest value (that is, highest resolution) requested by any process.
> > > For processes which have not called this function, Windows does not
> > > guarantee a higher resolution than the default system resolution."
> >
> > Even modifying the current process is not acceptable, since lavc is
> > frequently embedded in other applications, which might not expect
> > this/be aversely impacted by it.
> >
> > Why does the AMF wrapper need to sleep at all?
>
> Agreed, we can't have things like this in FFmpeg. This might be
> acceptable in a binary blob but not in an open source project.

I took a look at this using AMD's AMF EncoderLatency sample and found that
setting the QUERY_TIMEOUT option to 50 ms (as is default for the new AMF
HQ and HQLL usage values) results in latency that is better than the
current AMF code in FFmpeg *and* this patch without having to touch
the process's timer precision.

Here are the results from QUERY_TIMEOUT=0, amf_sleep(1), 1ms timer period:
Encoder: AMFVideoEncoderVCE_AVC
Total  : Frames = 500 Duration = 1157.16ms FPS = 432.09frames
Latency: First,Min,Max = 7.12ms, 1.53ms, 3.73ms
Latency: Average = 1.99ms

and the results from QUERY_TIMEOUT=50, default timer period:
Encoder: AMFVideoEncoderVCE_AVC
Total  : Frames = 500 Duration = 933.03ms FPS = 535.89frames
Latency: First,Min,Max = 5.80ms, 1.49ms, 2.50ms
Latency: Average = 1.58ms

This seems to clearly demonstrate that QUERY_TIMEOUT is a better approach
than adjusting timer resolution. It avoids process-wide effects *and*
it even performs better on top of that.


Cameron
___
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 07/13] avcodec/hevcdec: export LCEVC metadata as frame side data

2024-09-02 Thread James Almer

On 9/2/2024 9:00 AM, Derek Buitenhuis wrote:

On 8/31/2024 5:31 PM, James Almer wrote:

Signed-off-by: James Almer 
---
  configure |  1 +
  libavcodec/hevc/hevcdec.c |  3 +++
  libavcodec/hevc/refs.c| 15 ++-
  3 files changed, 18 insertions(+), 1 deletion(-)


Maybe I've misunderstood, but doesn't requiring every possible base layer
codec to explicitly support exporting LCEVC kind of defeat the point of
a 'generic' enhancement layer codec like LCEVC?
We don't require that. Those codecs that have it embedded in the 
bitstream do it, like hevc here. Those who don't will require the caller 
to insert the lcevc payload (which most likely came from the container) 
into the base layer packets as side data, which decode.c will make sure 
makes it to the frame for decoding.
The last patch in this set makes ffmpeg.c (the aforementioned caller) do 
exactly that for split variants (exported by mov/mp4 for now).




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 03/13] avcodec/decode: support applying LCEVC enhacements

2024-09-02 Thread James Almer

On 9/2/2024 9:03 AM, Derek Buitenhuis wrote:

On 8/31/2024 5:31 PM, James Almer wrote:

Signed-off-by: James Almer 
---
  libavcodec/avcodec.c   |  2 ++
  libavcodec/avcodec.h   |  5 +
  libavcodec/decode.c| 42 +-
  libavcodec/internal.h  |  2 ++
  libavcodec/lcevcdec.c  |  2 ++
  libavcodec/options_table.h |  1 +
  libavcodec/pthread_frame.c |  7 +++
  7 files changed, 60 insertions(+), 1 deletion(-)


No real opinion on the other patches, but this one feels really gross. I feel
liek we should not be adding new codec-specific things in AVCodecInternal or
in generic threding, decode, etc. It really feels quite wrong.


I could try to make it a bit more opaque to decode.c, making i call a 
function that would then set any needed post processing callback or 
something like that.




I probably missed discussion on this in previous revisions of this patch set,
but I wanted to get my thoughts in writing.





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] hevc/sei: return INVALIDDATA when a referenced SPS is not available

2024-09-02 Thread Hendrik Leppkes
On Fri, Aug 30, 2024 at 11:09 PM Jan Ekström  wrote:
>
> On Fri, Aug 30, 2024 at 8:40 PM Hendrik Leppkes  wrote:
> >
> > The code previously returned ENOMEM, despite this not being an
> > allocation problem, but rather a bitstream problem referring to data not
> > currently available.
> >
> > Fixes playback of such streams, as it allows further processing of NAL
> > units after skipping the broken SEI NAL.
> > ---
> >  libavcodec/hevc/sei.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/hevc/sei.c b/libavcodec/hevc/sei.c
> > index e39ac0c38a..b55ba71a8d 100644
> > --- a/libavcodec/hevc/sei.c
> > +++ b/libavcodec/hevc/sei.c
> > @@ -56,7 +56,7 @@ static int decode_nal_sei_pic_timing(HEVCSEI *s, 
> > GetBitContext *gb,
> >  const HEVCSPS *sps = ps->sps_list[s->active_seq_parameter_set_id];
> >
> >  if (!sps)
> > -return(AVERROR(ENOMEM));
> > +return AVERROR_INVALIDDATA;
> >
> >  if (sps->vui.frame_field_info_present_flag) {
> >  int pic_struct = get_bits(gb, 4);
> > --
> > 2.42.0.windows.2
>
> LGTM.
>
> Verified that FATE still passes and that the sample linked in
> https://github.com/mpv-player/mpv/issues/14764 once again decodes.
>

Will apply tomorrow if there are no further comments.

- Hendrik
___
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 06/13] lavfi/af_aresample: convert to query_func2()

2024-09-02 Thread Anton Khirnov
Quoting Anton Khirnov (2024-09-02 15:50:06)
> ---
>  libavfilter/af_aresample.c | 23 +++
>  1 file changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
> index 2a67b06260..9ee4082c0c 100644
> --- a/libavfilter/af_aresample.c
> +++ b/libavfilter/af_aresample.c
> @@ -63,16 +63,15 @@ static av_cold void uninit(AVFilterContext *ctx)
>  swr_free(&aresample->swr);
>  }
>  
> -static int query_formats(AVFilterContext *ctx)
> +static int query_formats(const AVFilterContext *ctx,
> + AVFilterFormatsConfig **cfg_in,
> + AVFilterFormatsConfig **cfg_out)
>  {
> -AResampleContext *aresample = ctx->priv;
> +const AResampleContext *aresample = ctx->priv;
>  enum AVSampleFormat out_format;
>  AVChannelLayout out_layout = { 0 };
>  int64_t out_rate;
>  
> -AVFilterLink *inlink  = ctx->inputs[0];
> -AVFilterLink *outlink = ctx->outputs[0];
> -
>  AVFilterFormats*in_formats, *out_formats;
>  AVFilterFormats*in_samplerates, *out_samplerates;
>  AVFilterChannelLayouts *in_layouts, *out_layouts;
> @@ -84,15 +83,15 @@ static int query_formats(AVFilterContext *ctx)
>  av_opt_get_int(aresample->swr, "osr", 0, &out_rate);
>  
>  in_formats  = ff_all_formats(AVMEDIA_TYPE_AUDIO);
> -if ((ret = ff_formats_ref(in_formats, &inlink->outcfg.formats)) < 0)
> +if ((ret = ff_formats_ref(in_formats, &cfg_in[0]->formats)) < 0)
>  return ret;
>  
>  in_samplerates  = ff_all_samplerates();
> -if ((ret = ff_formats_ref(in_samplerates, &inlink->outcfg.samplerates)) 
> < 0)
> +if ((ret = ff_formats_ref(in_samplerates, &cfg_out[0]->samplerates)) < 0)

Should be cfg_in. Fixed locally.

-- 
Anton Khirnov
___
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/13] avcodec/decode: support applying LCEVC enhacements

2024-09-02 Thread Jean-Baptiste Kempf
On Mon, 2 Sep 2024, at 18:48, James Almer wrote:
> On 9/2/2024 9:03 AM, Derek Buitenhuis wrote:
>> On 8/31/2024 5:31 PM, James Almer wrote:
>>> Signed-off-by: James Almer 
>>> ---
>>>   libavcodec/avcodec.c   |  2 ++
>>>   libavcodec/avcodec.h   |  5 +
>>>   libavcodec/decode.c| 42 +-
>>>   libavcodec/internal.h  |  2 ++
>>>   libavcodec/lcevcdec.c  |  2 ++
>>>   libavcodec/options_table.h |  1 +
>>>   libavcodec/pthread_frame.c |  7 +++
>>>   7 files changed, 60 insertions(+), 1 deletion(-)
>> 
>> No real opinion on the other patches, but this one feels really gross. I feel
>> liek we should not be adding new codec-specific things in AVCodecInternal or
>> in generic threding, decode, etc. It really feels quite wrong.
>
> I could try to make it a bit more opaque to decode.c, making i call a 
> function that would then set any needed post processing callback or 
> something like that.

If you could, that would be neat: I was also frustrated by this patch in the 
serie.

-- 
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 03/13] avcodec/decode: support applying LCEVC enhacements

2024-09-02 Thread Ronald S. Bultje
Hi,

On Sat, Aug 31, 2024 at 12:31 PM James Almer  wrote:

> --- a/libavcodec/options_table.h
> +++ b/libavcodec/options_table.h
> @@ -93,6 +93,7 @@ static const AVOption avcodec_options[] = {
>
[..]

> {"film_grain", "export film grain parameters through frame side data", 0,
> AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_FILM_GRAIN}, INT_MIN,
> INT_MAX, V|D, .unit = "export_side_data"},
> +{"enhancements", "export film grain parameters through frame side data",
> 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_ENHANCEMENTS}, INT_MIN,
> INT_MAX, V|D, .unit = "export_side_data"},
>

Copy/paste typo? Maybe change to "export stream enhancements through frame
side data".

Ronald
___
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] avformat/mxfdec: disallow generic seek search

2024-09-02 Thread Marton Balint



On Sun, 1 Sep 2024, Tomas Härdin wrote:


tis 2024-08-27 klockan 01:33 +0200 skrev Marton Balint:

If the demuxer does not provide per-stream indexes, the generic seek
search can
attempt to read the whole media file from the beginning when seeking.
For large
MXF files this can cause huge lockups for a seek after the last
timestamp,
which will eventually fail. So let's disable the generic seek for
mxf, the
demuxer's own seek code should handle seeking just fine.


Sounds reasonable. We already go through the trouble of extracting all
index table segments


Ok, will apply.

Thanks,
Marton



/Tomas
___
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] cbs_av1: Copy loop filter and segment parameters of repeat frame from its mapped frame

2024-09-02 Thread Dai, Jianhui J



> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> fei.w.wang-at-intel@ffmpeg.org
> Sent: Wednesday, August 28, 2024 8:02 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Wang, Fei W 
> Subject: [FFmpeg-devel] [PATCH] cbs_av1: Copy loop filter and segment
> parameters of repeat frame from its mapped frame
> 
> From: Fei Wang 
> 
> Implement load/save loop filter and segment parameters defined in section
> 7.20 and 7.21 in spec for show_existing_frame frames.
> 
> Fixes ticket #11151.
> 
> Signed-off-by: Fei Wang 
> ---
>  libavcodec/cbs_av1.h |  5 
>  libavcodec/cbs_av1_syntax_template.c | 36 +---
>  2 files changed, 33 insertions(+), 8 deletions(-)
> 
> diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h index
> a027013bc7..8586f2bf4a 100644
> --- a/libavcodec/cbs_av1.h
> +++ b/libavcodec/cbs_av1.h
> @@ -477,6 +477,11 @@ typedef struct CodedBitstreamAV1Context {
>  // Writing will fail with an error if an OBU larger than can be
>  // represented by the fixed size is encountered.
>  int fixed_obu_size_length;
> +
> +int8_t  loop_filter_ref_deltas[AV1_TOTAL_REFS_PER_FRAME];
> +int8_t  loop_filter_mode_deltas[2];
> +uint8_t feature_enabled[AV1_MAX_SEGMENTS][AV1_SEG_LVL_MAX];
> +int16_t feature_value[AV1_MAX_SEGMENTS][AV1_SEG_LVL_MAX];
>  } CodedBitstreamAV1Context;
> 
> 
> diff --git a/libavcodec/cbs_av1_syntax_template.c
> b/libavcodec/cbs_av1_syntax_template.c
> index 3f4b13a177..a4a912482c 100644
> --- a/libavcodec/cbs_av1_syntax_template.c
> +++ b/libavcodec/cbs_av1_syntax_template.c
> @@ -1374,6 +1374,15 @@ static int
> FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
>  priv->render_height   = ref->render_height;
>  priv->bit_depth   = ref->bit_depth;
>  priv->order_hint  = ref->order_hint;
> +
> +memcpy(priv->loop_filter_ref_deltas, 
> ref->loop_filter_ref_deltas,
> +   sizeof(ref->loop_filter_ref_deltas));
> +memcpy(priv->loop_filter_mode_deltas, ref-
> >loop_filter_mode_deltas,
> +   sizeof(ref->loop_filter_mode_deltas));
> +memcpy(priv->feature_enabled, ref->feature_enabled,
> +   sizeof(ref->feature_enabled));
> +memcpy(priv->feature_value, ref->feature_value,
> +   sizeof(ref->feature_value));
>  } else
>  infer(refresh_frame_flags, 0);
> 
> @@ -1691,14 +1700,25 @@ update_refs:
>  priv->order_hints[j + AV1_REF_FRAME_LAST];
>  }
> 
> -memcpy(priv->ref[i].loop_filter_ref_deltas, current-
> >loop_filter_ref_deltas,
> -   sizeof(current->loop_filter_ref_deltas));
> -memcpy(priv->ref[i].loop_filter_mode_deltas, current-
> >loop_filter_mode_deltas,
> -   sizeof(current->loop_filter_mode_deltas));
> -memcpy(priv->ref[i].feature_enabled, current->feature_enabled,
> -   sizeof(current->feature_enabled));
> -memcpy(priv->ref[i].feature_value, current->feature_value,
> -   sizeof(current->feature_value));
> +if (current->show_existing_frame) {
> +memcpy(priv->ref[i].loop_filter_ref_deltas, priv-
> >loop_filter_ref_deltas,
> +   sizeof(priv->loop_filter_ref_deltas));
> +memcpy(priv->ref[i].loop_filter_mode_deltas, priv-
> >loop_filter_mode_deltas,
> +   sizeof(priv->loop_filter_mode_deltas));
> +memcpy(priv->ref[i].feature_enabled, priv->feature_enabled,
> +   sizeof(priv->feature_enabled));
> +memcpy(priv->ref[i].feature_value, priv->feature_value,
> +   sizeof(priv->feature_value));
> +} else {
> +memcpy(priv->ref[i].loop_filter_ref_deltas, current-
> >loop_filter_ref_deltas,
> +   sizeof(current->loop_filter_ref_deltas));
> +memcpy(priv->ref[i].loop_filter_mode_deltas, current-
> >loop_filter_mode_deltas,
> +   sizeof(current->loop_filter_mode_deltas));
> +memcpy(priv->ref[i].feature_enabled, 
> current->feature_enabled,
> +   sizeof(current->feature_enabled));
> +memcpy(priv->ref[i].feature_value, current->feature_value,
> +   sizeof(current->feature_value));
> +}
>  }
>  }
> 

Good fixing. Could you please apply?

> --
> 2.34.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 mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.

Re: [FFmpeg-devel] [PATCH v3 0/2] avformat/mxfenc: Fix guess frame_rate

2024-09-02 Thread Anton Khirnov
Quoting Nicolas Gaullier (2024-09-02 17:49:04)
> >De : Anton Khirnov  
> >Envoyé : lundi 2 septembre 2024 13:26
> >
> >Quoting Nicolas Gaullier (2024-09-02 11:52:15)
> >> Following yesterday posts by Anton/Tomas on version 1.
> >> 
> >> v3:
> >> - do not fall back to time_base (that was my v2)
> >> - do not remove "-r 25" in the fate test with streamcopy (see below)
> >> 
> >> What comes out:
> >> - mxfenc behaves the same as matroskaenc for example
> >> - avienc behaves differently: still sticked to time_base only
> >> 
> >> --
> >> 
> >> Another issue on this: "-r" as an output option with streamcopy is not 
> >> honored with mxf/matroska, but it is with avienc. This is because
> >> streamcopy_init() only overrides time_base, not *_frame_rate.
> >
> >Output -r should set avg_frame_rate, see line 958 in ffmpeg_mux_init.c.
> 
> Yes, but this is reset a few lines below.
> So, I will send a third patch in the same serie to address this; but maybe it 
> can be discussed afterwards independently...

Right, didn't notice. Yes, that line should probably be just dropped.

> Except that issue,  do the patches for mxfenc look good to you ?

No objections from me.

-- 
Anton Khirnov
___
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/2] MAINTAINERS: aacdec_usac seems not actively maintained

2024-09-02 Thread Lynne via ffmpeg-devel

On 02/09/2024 16:32, Michael Niedermayer wrote:

My ping on a patch on 21 Jul has no reaction

Signed-off-by: Michael Niedermayer 
---
  MAINTAINERS | 1 +
  1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index a513bec72a9..d73536370a0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -146,6 +146,7 @@ Codecs:
4xm.c [2] Michael Niedermayer
8bps.cRoberto Togni
8svx.cJaikrishnan Menon
+  aacdec_usac.c [0]
aacenc*, aaccoder.c   Rostislav Pehlivanov
adpcm.c   Zane van Iperen
alacenc.c Jaikrishnan Menon


I still maintain it, but I simply missed the patch. I'll take a look.


OpenPGP_0xA2FEA5F03F034464.asc
Description: OpenPGP public key


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 4/6] avcodec/aac/aacdec_usac: Clean ics2->max_sfb when first SCE fails

2024-09-02 Thread Lynne via ffmpeg-devel

On 01/08/2024 19:07, Michael Niedermayer wrote:

On Thu, Aug 01, 2024 at 05:11:18PM +0200, Lynne via ffmpeg-devel wrote:

On 31/07/2024 21:54, Michael Niedermayer wrote:

Fixes: out of array access
Fixes: 
70734/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-4741427068731392

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
   libavcodec/aac/aacdec_usac.c | 4 +++-
   1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c
index 82db65eb0d0..2938e693874 100644
--- a/libavcodec/aac/aacdec_usac.c
+++ b/libavcodec/aac/aacdec_usac.c
@@ -918,8 +918,10 @@ static int decode_usac_stereo_info(AACDecContext *ac, 
AACUSACConfig *usac,
   }
   ret = setup_sce(ac, sce1, usac);
-if (ret < 0)
+if (ret < 0) {
+ics2->max_sfb = 0;
   return ret;
+}
   ret = setup_sce(ac, sce2, usac);
   if (ret < 0)


Err, the one and only place where setup_sce can return an error is also
where ics->max_sfb = 0; is cleaned up. It doesn't make sense that this patch
would do anything at all.


there are 2 single channel elements
when the first fails, it automatically cleans the firsts max_sfb but as is 
before
this patch it leaves the 2nd SCE max_sfb unchanged to whatever unchecked value
was put in it.
It would get checked and cleared in the next setup_sce() call but that is
never called if the first fails


Both patches from the patchset LGTM


OpenPGP_0xA2FEA5F03F034464.asc
Description: OpenPGP public key


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] cbs_av1: Copy loop filter and segment parameters of repeat frame from its mapped frame

2024-09-02 Thread Wang, Fei W
On Tue, 2024-09-03 at 01:20 +, Dai, Jianhui J wrote:
> 
> 
> > -Original Message-
> > From: ffmpeg-devel  On Behalf Of
> > fei.w.wang-at-intel@ffmpeg.org
> > Sent: Wednesday, August 28, 2024 8:02 PM
> > To: ffmpeg-devel@ffmpeg.org
> > Cc: Wang, Fei W 
> > Subject: [FFmpeg-devel] [PATCH] cbs_av1: Copy loop filter and
> > segment
> > parameters of repeat frame from its mapped frame
> > 
> > From: Fei Wang 
> > 
> > Implement load/save loop filter and segment parameters defined in
> > section
> > 7.20 and 7.21 in spec for show_existing_frame frames.
> > 
> > Fixes ticket #11151.
> > 
> > Signed-off-by: Fei Wang 
> > ---
> >  libavcodec/cbs_av1.h |  5 
> >  libavcodec/cbs_av1_syntax_template.c | 36 +---
> > 
> >  2 files changed, 33 insertions(+), 8 deletions(-)
> > 
> > diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h index
> > a027013bc7..8586f2bf4a 100644
> > --- a/libavcodec/cbs_av1.h
> > +++ b/libavcodec/cbs_av1.h
> > @@ -477,6 +477,11 @@ typedef struct CodedBitstreamAV1Context {
> >  // Writing will fail with an error if an OBU larger than can
> > be
> >  // represented by the fixed size is encountered.
> >  int fixed_obu_size_length;
> > +
> > +    int8_t  loop_filter_ref_deltas[AV1_TOTAL_REFS_PER_FRAME];
> > +    int8_t  loop_filter_mode_deltas[2];
> > +    uint8_t feature_enabled[AV1_MAX_SEGMENTS][AV1_SEG_LVL_MAX];
> > +    int16_t feature_value[AV1_MAX_SEGMENTS][AV1_SEG_LVL_MAX];
> >  } CodedBitstreamAV1Context;
> > 
> > 
> > diff --git a/libavcodec/cbs_av1_syntax_template.c
> > b/libavcodec/cbs_av1_syntax_template.c
> > index 3f4b13a177..a4a912482c 100644
> > --- a/libavcodec/cbs_av1_syntax_template.c
> > +++ b/libavcodec/cbs_av1_syntax_template.c
> > @@ -1374,6 +1374,15 @@ static int
> > FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext
> > *rw,
> >  priv->render_height   = ref->render_height;
> >  priv->bit_depth   = ref->bit_depth;
> >  priv->order_hint  = ref->order_hint;
> > +
> > +    memcpy(priv->loop_filter_ref_deltas, ref-
> > >loop_filter_ref_deltas,
> > +   sizeof(ref->loop_filter_ref_deltas));
> > +    memcpy(priv->loop_filter_mode_deltas, ref-
> > > loop_filter_mode_deltas,
> > +   sizeof(ref->loop_filter_mode_deltas));
> > +    memcpy(priv->feature_enabled, ref-
> > >feature_enabled,
> > +   sizeof(ref->feature_enabled));
> > +    memcpy(priv->feature_value, ref->feature_value,
> > +   sizeof(ref->feature_value));
> >  } else
> >  infer(refresh_frame_flags, 0);
> > 
> > @@ -1691,14 +1700,25 @@ update_refs:
> >  priv->order_hints[j + AV1_REF_FRAME_LAST];
> >  }
> > 
> > -    memcpy(priv->ref[i].loop_filter_ref_deltas, current-
> > > loop_filter_ref_deltas,
> > -   sizeof(current->loop_filter_ref_deltas));
> > -    memcpy(priv->ref[i].loop_filter_mode_deltas, current-
> > > loop_filter_mode_deltas,
> > -   sizeof(current->loop_filter_mode_deltas));
> > -    memcpy(priv->ref[i].feature_enabled, current-
> > >feature_enabled,
> > -   sizeof(current->feature_enabled));
> > -    memcpy(priv->ref[i].feature_value, current-
> > >feature_value,
> > -   sizeof(current->feature_value));
> > +    if (current->show_existing_frame) {
> > +    memcpy(priv->ref[i].loop_filter_ref_deltas, priv-
> > > loop_filter_ref_deltas,
> > +   sizeof(priv->loop_filter_ref_deltas));
> > +    memcpy(priv->ref[i].loop_filter_mode_deltas, priv-
> > > loop_filter_mode_deltas,
> > +   sizeof(priv->loop_filter_mode_deltas));
> > +    memcpy(priv->ref[i].feature_enabled, priv-
> > >feature_enabled,
> > +   sizeof(priv->feature_enabled));
> > +    memcpy(priv->ref[i].feature_value, priv-
> > >feature_value,
> > +   sizeof(priv->feature_value));
> > +    } else {
> > +    memcpy(priv->ref[i].loop_filter_ref_deltas,
> > current-
> > > loop_filter_ref_deltas,
> > +   sizeof(current->loop_filter_ref_deltas));
> > +    memcpy(priv->ref[i].loop_filter_mode_deltas,
> > current-
> > > loop_filter_mode_deltas,
> > +   sizeof(current->loop_filter_mode_deltas));
> > +    memcpy(priv->ref[i].feature_enabled, current-
> > >feature_enabled,
> > +   sizeof(current->feature_enabled));
> > +    memcpy(priv->ref[i].feature_value, current-
> > >feature_value,
> > +   sizeof(current->feature_value));
> > +    }
> >  }
> >  }
> > 
> 
> Good fixing. Could you please apply?

Applied, thanks.

Fei

> 
> > --
> > 2.34.1
> > 
> > __