[FFmpeg-devel] [PATCH 05/12] fate-ts-small-demux: convert to ffprobe
It can handle side data cleanly. --- tests/fate/demux.mak | 2 +- tests/ref/fate/ts-small-demux | 229 ++ 2 files changed, 150 insertions(+), 81 deletions(-) diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak index c55488fe61..ac224d6bf4 100644 --- a/tests/fate/demux.mak +++ b/tests/fate/demux.mak @@ -83,7 +83,7 @@ FATE_SAMPLES_DEMUX-$(CONFIG_MPEGTS_DEMUXER) += fate-ts-opus-demux fate-ts-opus-demux: CMD = framecrc -i $(TARGET_SAMPLES)/opus/test-8-7.1.opus-small.ts -c copy FATE_SAMPLES_DEMUX-$(CONFIG_MPEGTS_DEMUXER) += fate-ts-small-demux -fate-ts-small-demux: CMD = framecrc -i $(TARGET_SAMPLES)/mpegts/h264small.ts -c copy +fate-ts-small-demux: CMD = ffprobe_demux $(TARGET_SAMPLES)/mpegts/h264small.ts FATE_SAMPLES_DEMUX-$(CONFIG_MTV_DEMUXER) += fate-mtv fate-mtv: CMD = framecrc -i $(TARGET_SAMPLES)/mtv/comedian_auto-partial.mtv -c copy diff --git a/tests/ref/fate/ts-small-demux b/tests/ref/fate/ts-small-demux index cdd7c09f27..d7167e3c6f 100644 --- a/tests/ref/fate/ts-small-demux +++ b/tests/ref/fate/ts-small-demux @@ -1,80 +1,149 @@ -#extradata 0: 35, 0x83f4073d -#tb 0: 1/9 -#media_type 0: video -#codec_id 0: h264 -#dimensions 0: 82x144 -#sar 0: 1/1 -0, 0, 0, 6000, 1290, 0x4684e0ab, S=1,1, 0x00e000e0 -0, 6000, 6000, 6000, 21, 0x267504dc, F=0x0, S=1, 1, 0x00e000e0 -0, 12000, 12000, 6000, 15, 0x0f9402f6, F=0x0, S=1, 1, 0x00e000e0 -0, 18000, 18000, 6000, 15, 0x0ff40316, F=0x0, S=1, 1, 0x00e000e0 -0, 24000, 24000, 6000, 15, 0x10540336, F=0x0, S=1, 1, 0x00e000e0 -0, 3, 3, 6000, 15, 0x10b40356, F=0x0, S=1, 1, 0x00e000e0 -0, 36000, 36000, 6000, 15, 0x11140376, F=0x0, S=1, 1, 0x00e000e0 -0, 42000, 42000, 6000, 15, 0x11740396, F=0x0, S=1, 1, 0x00e000e0 -0, 48000, 48000, 6000, 15, 0x0ed802b7, F=0x0, S=1, 1, 0x00e000e0 -0, 54000, 54000, 6000, 15, 0x0f3802d7, F=0x0, S=1, 1, 0x00e000e0 -0, 6, 6, 6000, 15, 0x0f9802f7, F=0x0, S=1, 1, 0x00e000e0 -0, 66000, 66000, 6000, 15, 0x0ff80317, F=0x0, S=1, 1, 0x00e000e0 -0, 72000, 72000, 6000, 15, 0x10580337, F=0x0, S=1, 1, 0x00e000e0 -0, 78000, 78000, 6000, 15, 0x10b80357, F=0x0, S=1, 1, 0x00e000e0 -0, 84000, 84000, 6000, 15, 0x11180377, F=0x0, S=1, 1, 0x00e000e0 -0, 9, 9, 6000, 15, 0x11780397, F=0x0, S=1, 1, 0x00e000e0 -0, 96000, 96000, 6000, 15, 0x0ed402b6, F=0x0, S=1, 1, 0x00e000e0 -0, 102000, 102000, 6000, 15, 0x0f3402d6, F=0x0, S=1, 1, 0x00e000e0 -0, 108000, 108000, 6000, 15, 0x0f9402f6, F=0x0, S=1, 1, 0x00e000e0 -0, 114000, 114000, 6000, 15, 0x0ff40316, F=0x0, S=1, 1, 0x00e000e0 -0, 12, 12, 6000, 15, 0x10540336, F=0x0, S=1, 1, 0x00e000e0 -0, 126000, 126000, 6000, 15, 0x10b40356, F=0x0, S=1, 1, 0x00e000e0 -0, 132000, 132000, 6000, 15, 0x11140376, F=0x0, S=1, 1, 0x00e000e0 -0, 138000, 138000, 6000, 15, 0x11740396, F=0x0, S=1, 1, 0x00e000e0 -0, 144000, 144000, 6000, 15, 0x0ed802b7, F=0x0, S=1, 1, 0x00e000e0 -0, 15, 15, 6000, 15, 0x0f3802d7, F=0x0, S=1, 1, 0x00e000e0 -0, 156000, 156000, 6000, 15, 0x0f9802f7, F=0x0, S=1, 1, 0x00e000e0 -0, 162000, 162000, 6000, 15, 0x0ff80317, F=0x0, S=1, 1, 0x00e000e0 -0, 168000, 168000, 6000, 15, 0x10580337, F=0x0, S=1, 1, 0x00e000e0 -0, 174000, 174000, 6000, 15, 0x10b80357, F=0x0, S=1, 1, 0x00e000e0 -0, 18, 18, 6000, 15, 0x11180377, F=0x0, S=1, 1, 0x00e000e0 -0, 186000, 186000, 6000, 15, 0x11780397, F=0x0, S=1, 1, 0x00e000e0 -0, 192000, 192000, 6000, 15, 0x0ed402b6, F=0x0, S=1, 1, 0x00e000e0 -0, 198000, 198000, 6000, 15, 0x0f3402d6, F=0x0, S=1, 1, 0x00e000e0 -0, 204000, 204000, 6000, 15, 0x0f9402f6, F=0x0, S=1, 1, 0x00e000e0 -0, 21, 21, 6000, 15, 0x0ff40316, F=0x0, S=1, 1, 0x00e000e0 -0, 216000, 216000, 6000, 15, 0x10540336, F=0x0, S=1, 1, 0x00e000e0 -0, 222000, 222000, 6000, 15, 0x10b40356, F=0x0, S=1, 1, 0x00e000e0 -0, 228000, 228000, 6000, 15, 0x11140376, F=0x0, S=1, 1, 0x00e000e0 -0, 234000, 234000, 6000, 15, 0x11740396, F=0x0, S=1, 1, 0x00e000e0 -0,
[FFmpeg-devel] [PATCH 01/12] ffprobe: only hash extradata when it is present
Passing zero-sized/NULL buffers to av_hash_update() is invalid and may crash with certain hashes. --- fftools/ffprobe.c | 7 +-- tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov | 1 - tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index a2cb7dc986..9039985dcb 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2741,8 +2741,11 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id if (do_show_data) writer_print_data(w, "extradata", par->extradata, par->extradata_size); -writer_print_data_hash(w, "extradata_hash", par->extradata, -par->extradata_size); + +if (par->extradata_size > 0) { +writer_print_data_hash(w, "extradata_hash", par->extradata, +par->extradata_size); +} /* Print disposition information */ #define PRINT_DISPOSITION(flagname, name) do {\ diff --git a/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov b/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov index b69181ace7..4ef569df89 100644 --- a/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov +++ b/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov @@ -50,7 +50,6 @@ bits_per_raw_sample=N/A nb_frames=1 nb_read_frames=N/A nb_read_packets=1 -extradata_hash=adler32:0001 DISPOSITION:default=1 DISPOSITION:dub=0 DISPOSITION:original=0 diff --git a/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov b/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov index 16923e8684..70e7cdc943 100644 --- a/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov +++ b/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov @@ -50,7 +50,6 @@ bits_per_raw_sample=N/A nb_frames=1 nb_read_frames=N/A nb_read_packets=1 -extradata_hash=adler32:0001 DISPOSITION:default=1 DISPOSITION:dub=0 DISPOSITION:original=0 -- 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 03/12] fate-oggopus-demux: convert to ffprobe
It can print side data cleanly. --- tests/fate-run.sh| 9 tests/fate/demux.mak | 2 +- tests/ref/fate/oggopus-demux | 93 +--- 3 files changed, 55 insertions(+), 49 deletions(-) diff --git a/tests/fate-run.sh b/tests/fate-run.sh index b69176f7c3..dd3f564e18 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -135,6 +135,15 @@ ffmpeg(){ run ffmpeg${PROGSUF}${EXECSUF} ${ffmpeg_args} } +ffprobe_demux(){ +filename=$1 +shift +print_filename=$(basename "$filename") +run ffprobe${PROGSUF}${EXECSUF} -print_filename "${print_filename}" \ +-of compact -bitexact -show_format -show_streams -show_packets \ +-show_data_hash CRC32 "$filename" "$@" +} + framecrc(){ ffmpeg "$@" -bitexact -f framecrc - } diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak index e9b8aeec0f..c55488fe61 100644 --- a/tests/fate/demux.mak +++ b/tests/fate/demux.mak @@ -101,7 +101,7 @@ FATE_SAMPLES_DEMUX-$(CONFIG_NSV_DEMUXER) += fate-nsv-demux fate-nsv-demux: CMD = framecrc -i $(TARGET_SAMPLES)/nsv/witchblade-51kbps.nsv -t 6 -c:v copy -c:a copy FATE_SAMPLES_DEMUX-$(CONFIG_OGG_DEMUXER) += fate-oggopus-demux -fate-oggopus-demux: CMD = framecrc -i $(TARGET_SAMPLES)/ogg/intro-partial.opus -c:a copy +fate-oggopus-demux: CMD = ffprobe_demux $(TARGET_SAMPLES)/ogg/intro-partial.opus FATE_SAMPLES_DEMUX-$(CONFIG_OGG_DEMUXER) += fate-oggvp8-demux fate-oggvp8-demux: CMD = framecrc -i $(TARGET_SAMPLES)/ogg/videotest.ogv -c:v copy diff --git a/tests/ref/fate/oggopus-demux b/tests/ref/fate/oggopus-demux index 580758c0dc..450ca9f7d5 100644 --- a/tests/ref/fate/oggopus-demux +++ b/tests/ref/fate/oggopus-demux @@ -1,48 +1,45 @@ -#extradata 0: 19, 0x399c0471 -#tb 0: 1/48000 -#media_type 0: audio -#codec_id 0: opus -#sample_rate 0: 48000 -#channel_layout 0: 3 -#channel_layout_name 0: stereo -0, -356, -356, 960, 402, 0x89b1c40f, S=1, 10, 0x03f10065 -0,604,604, 960, 216, 0x7bf97146 -0, 1564, 1564, 960, 215, 0x6cb86d8b -0, 2524, 2524, 960, 218, 0x9cfd691c -0, 3484, 3484, 960, 218, 0xd7fe6a94 -0, , , 960, 194, 0x35735de6 -0, 5404, 5404, 960, 216, 0x3ee6705a -0, 6364, 6364, 960, 218, 0x67eb6cb1 -0, 7324, 7324, 960, 218, 0x32d0700d -0, 8284, 8284, 960, 219, 0xcb7f6c60 -0, 9244, 9244, 960, 218, 0x9c866b33 -0, 10204, 10204, 960, 217, 0xfe3e6a53 -0, 11164, 11164, 960, 218, 0x13586833 -0, 12124, 12124, 960, 222, 0xbcb2669e -0, 13084, 13084, 960, 218, 0x8dfc6e33 -0, 14044, 14044, 960, 217, 0xf5957051 -0, 15004, 15004, 960, 210, 0xed126e6b -0, 15964, 15964, 960, 216, 0xbf947249 -0, 16924, 16924, 960, 203, 0x6c7e680a -0, 17884, 17884, 960, 209, 0xf78f6af4 -0, 18844, 18844, 960, 217, 0xd60c684d -0, 19804, 19804, 960, 218, 0x89056a7a -0, 20764, 20764, 960, 219, 0x0bc674ad -0, 21724, 21724, 960, 217, 0xb1d86d1a -0, 22684, 22684, 960, 220, 0x433d685a -0, 23644, 23644, 960, 364, 0x0c88be84 -0, 24604, 24604, 960, 221, 0x804a733d -0, 25564, 25564, 960, 215, 0x6e9d6e9b -0, 26524, 26524, 960, 215, 0x63016a83 -0, 27484, 27484, 960, 218, 0xf9a46fbe -0, 28444, 28444, 960, 216, 0xa0d66c08 -0, 29404, 29404, 960, 216, 0xa2ca6d0a -0, 30364, 30364, 960, 216, 0xf50e6f1d -0, 31324, 31324, 960, 215, 0x6aaa70b6 -0, 32284, 32284, 960, 219, 0x7ceb6ba0 -0, 33244, 33244, 960, 220, 0x398d6ca9 -0, 34204, 34204, 960, 218, 0x7bd06ed5 -0, 35164, 35164, 960, 219, 0xe2906c62 -0, 36124, 36124, 960, 217, 0xcf316ba1 -0, 37084, 37084, 960, 217, 0x470b6eea -0, 38044, 38044, 356, 359, 0x36c2a18a, S=1, 10, 0x0232005e +packet|codec_type=audio|stream_index=0|pts=-356|pts_time=-0.007417|dts=-356|dts_time=-0.007417|duration=960|duration_time=0.02|size=402|pos=841|flags=K_side_data|side_data_type=Skip Samples|skip_samples=356|discard_padding=0|skip_reason=0|discard_reason=0 +|data_hash=CRC32:052ff811 +packet|codec_type=audio|stream_index=0|pts=604|pts_time=0.012583|dts=604|dts_time=0.012583|duration=960|duration_time=0.02|size=216|pos=841|flags=K_|data_hash=CRC32:77f232d3 +packet|codec_type=audio|stream_index=0|pts=1564|pts_time=0.032583|dts=1564|dts_time=0.032583|duration=960|duration_time=0.02|size=215|pos=841|flags=K_|d
[FFmpeg-devel] [PATCH 02/12] ffprobe: support printing more packet side data types
Specifically WebVTT subtitle data, CPB properties, audio service type and mpegts stream id. --- fftools/ffprobe.c | 17 +++ tests/ref/fate/concat-demuxer-simple2-lavf-ts | 128 +- tests/ref/fate/mxf-probe-d10 | 5 + 3 files changed, 86 insertions(+), 64 deletions(-) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 9039985dcb..d95450d95b 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2022,6 +2022,23 @@ static void print_pkt_side_data(WriterContext *w, print_int("el_present_flag", dovi->el_present_flag); print_int("bl_present_flag", dovi->bl_present_flag); print_int("dv_bl_signal_compatibility_id", dovi->dv_bl_signal_compatibility_id); +} else if (sd->type == AV_PKT_DATA_AUDIO_SERVICE_TYPE) { +enum AVAudioServiceType *t = (enum AVAudioServiceType *)sd->data; +print_int("type", *t); +} else if (sd->type == AV_PKT_DATA_MPEGTS_STREAM_ID) { +print_int("id", *sd->data); +} else if (sd->type == AV_PKT_DATA_CPB_PROPERTIES) { +const AVCPBProperties *prop = (AVCPBProperties *)sd->data; +print_int("max_bitrate", prop->max_bitrate); +print_int("min_bitrate", prop->min_bitrate); +print_int("avg_bitrate", prop->avg_bitrate); +print_int("buffer_size", prop->buffer_size); +print_int("vbv_delay", prop->vbv_delay); +} else if (sd->type == AV_PKT_DATA_WEBVTT_IDENTIFIER || + sd->type == AV_PKT_DATA_WEBVTT_SETTINGS) { +if (do_show_data) +writer_print_data(w, "data", sd->data, sd->size); +writer_print_data_hash(w, "data_hash", sd->data, sd->size); } writer_print_section_footer(w); } diff --git a/tests/ref/fate/concat-demuxer-simple2-lavf-ts b/tests/ref/fate/concat-demuxer-simple2-lavf-ts index 72d9e57464..8a36b3e0ff 100644 --- a/tests/ref/fate/concat-demuxer-simple2-lavf-ts +++ b/tests/ref/fate/concat-demuxer-simple2-lavf-ts @@ -1,20 +1,20 @@ -video|1|982|0.010911|-2618|-0.029089|3600|0.04|24801|564|K_MPEGTS Stream ID +video|1|982|0.010911|-2618|-0.029089|3600|0.04|24801|564|K_MPEGTS Stream ID|224 -video|1|4582|0.050911|982|0.010911|3600|0.04|16429|25944|__MPEGTS Stream ID +video|1|4582|0.050911|982|0.010911|3600|0.04|16429|25944|__MPEGTS Stream ID|224 -video|1|8182|0.090911|4582|0.050911|3600|0.04|14508|42864|__MPEGTS Stream ID +video|1|8182|0.090911|4582|0.050911|3600|0.04|14508|42864|__MPEGTS Stream ID|224 -video|1|11782|0.130911|8182|0.090911|3600|0.04|12622|58092|__MPEGTS Stream ID +video|1|11782|0.130911|8182|0.090911|3600|0.04|12622|58092|__MPEGTS Stream ID|224 -video|1|15382|0.170911|11782|0.130911|3600|0.04|13393|71064|__MPEGTS Stream ID +video|1|15382|0.170911|11782|0.130911|3600|0.04|13393|71064|__MPEGTS Stream ID|224 -video|1|18982|0.210911|15382|0.170911|3600|0.04|13092|84788|__MPEGTS Stream ID +video|1|18982|0.210911|15382|0.170911|3600|0.04|13092|84788|__MPEGTS Stream ID|224 -video|1|22582|0.250911|18982|0.210911|3600|0.04|12755|98700|__MPEGTS Stream ID +video|1|22582|0.250911|18982|0.210911|3600|0.04|12755|98700|__MPEGTS Stream ID|224 -video|1|26182|0.290911|22582|0.250911|3600|0.04|12023|111860|__MPEGTS Stream ID +video|1|26182|0.290911|22582|0.250911|3600|0.04|12023|111860|__MPEGTS Stream ID|224 -audio|0|0|0.00|0|0.00|2351|0.026122|208|152844|K_MPEGTS Stream ID +audio|0|0|0.00|0|0.00|2351|0.026122|208|152844|K_MPEGTS Stream ID|192 audio|0|2351|0.026122|2351|0.026122|2351|0.026122|209|N/A|K_ audio|0|4702|0.052244|4702|0.052244|2351|0.026122|209|N/A|K_ @@ -29,27 +29,27 @@ audio|0|23510|0.261222|23510|0.261222|2351|0.026122|209|N/A|K_ audio|0|25861|0.287344|25861|0.287344|2351|0.026122|209|N/A|K_ audio|0|28212|0.313467|28212|0.313467|2351|0.026122|209|N/A|K_ audio|0|30563|0.339589|30563|0.339589|2351|0.026122|209|N/A|K_ -video|1|29782|0.330911|26182|0.290911|3600|0.04|14098|124268|__MPEGTS Stream ID +video|1|29782|0.330911|26182|0.290911|3600|0.04|14098|124268|__MPEGTS Stream ID|224 -video|1|33382|0.370911|29782|0.330911|3600|0.04|13329|139120|__MPEGTS Stream ID +video|1|33382|0.370911|29782|0.330911|3600|0.04|13329|139120|__MPEGTS Stream ID|224 -video|1|36982|0.410911|33382|0.370911|3600|0.04|12135|155852|__MPEGTS Stream ID +video|1|36982|0.410911|33382|0.370911|3600|0.04|12135|155852|__MPEGTS Stream ID|224 -video|1|40582|0.450911|36982|0.410911|3600|0.04|12282|168448|__MPEGTS Stream ID +video|1|40582|0.450911|36982|0.410911|3600|0.04|12282|168448|__MPEGTS Stream ID|224 -video|1|44182|0.490911|40582|0.450911|3600|0.04|24786|181420|K_MPEGTS Stream ID +video|1|44182|0.490911|40582|0.450911|3600|0.04|24786|181420|K_MPEGTS Stream ID|224 -video|1|47782|0.530911|44182|0.490911|3600|0.04|17440|2069
[FFmpeg-devel] [PATCH 11/12] fate: drop the vp8-alpha test
It is redundant with matroska-vp8-alpha-remux. --- tests/fate/vpx.mak | 3 - tests/ref/fate/vp8-alpha | 125 --- 2 files changed, 128 deletions(-) delete mode 100644 tests/ref/fate/vp8-alpha diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak index 857a4f2a1c..990d4e5adb 100644 --- a/tests/fate/vpx.mak +++ b/tests/fate/vpx.mak @@ -55,9 +55,6 @@ fate-vp6a-skip_alpha: CMD = framecrc -flags +bitexact -skip_alpha 1 -i $(TARGET_ FATE_VP6-$(call DEMDEC, FLV, VP6F) += fate-vp6f fate-vp6f: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/flash-vp6/clip1024.flv -FATE_VP8-$(CONFIG_MATROSKA_DEMUXER) += fate-vp8-alpha -fate-vp8-alpha: CMD = framecrc -i $(TARGET_SAMPLES)/vp8_alpha/vp8_video_with_alpha.webm -c:v copy - FATE_VP8-$(CONFIG_WEBM_DASH_MANIFEST_DEMUXER) += fate-webm-dash-manifest fate-webm-dash-manifest: CMD = run $(FFMPEG) -nostdin -f webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_video1.webm -f webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_video2.webm -f webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_audio1.webm -f webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_audio2.webm -c copy -map 0 -map 1 -map 2 -map 3 -f webm_dash_manifest -adaptation_sets "id=0,streams=0,1 id=1,streams=2,3" - diff --git a/tests/ref/fate/vp8-alpha b/tests/ref/fate/vp8-alpha deleted file mode 100644 index cc096c6d3a..00 --- a/tests/ref/fate/vp8-alpha +++ /dev/null @@ -1,125 +0,0 @@ -#tb 0: 1/1000 -#media_type 0: video -#codec_id 0: vp8 -#dimensions 0: 320x213 -#sar 0: 1/1 -0, 0, 0, 33, 2108, 0x59b92a34, S=2, 1900, 0x8fb3adc5, 12, 0x -0, 32, 32, 33, 142, 0x2f2a3fed, F=0x0, S=1, 160, 0xa13346af -0, 65, 65, 33, 157, 0x17804767, F=0x0, S=1, 209, 0x64115f15 -0, 99, 99, 33, 206, 0x537262ca, F=0x0, S=1, 317, 0x44a09dd0 -0,132,132, 33, 259, 0x73ff74b6, F=0x0, S=1, 384, 0x2ee2c588 -0,165,165, 33, 320, 0x0fcf8ce4, F=0x0, S=1, 415, 0xff68c953 -0,199,199, 33, 377, 0x8fffb5f5, F=0x0, S=1, 475, 0x4166f3eb -0,232,232, 33, 407, 0xe476c19e, F=0x0, S=1, 193, 0x3ff75489 -0,265,265, 33, 539, 0x90202334, F=0x0, S=1, 681, 0x776656b0 -0,299,299, 33, 560, 0xc6e2168d, F=0x0, S=1, 585, 0xddc81b8a -0,332,332, 33, 597, 0x201a32a7, F=0x0, S=1, 574, 0x8baa1d65 -0,365,365, 33, 770, 0xab2b8891, F=0x0, S=1, 666, 0xcd8e51eb -0,399,399, 33, 708, 0xc2386711, F=0x0, S=1, 706, 0x046b6444 -0,432,432, 33, 905, 0x7211c52d, F=0x0, S=1, 814, 0x5e288def -0,465,465, 33, 770, 0xda4f8574, F=0x0, S=1, 829, 0xa0e8a949 -0,499,499, 33, 955, 0xf9a1d77a, F=0x0, S=1, 857, 0x9b63b955 -0,532,532, 33, 970, 0xff4de39a, F=0x0, S=1, 153, 0x3b00416c -0,565,565, 33, 978, 0x12bcf81f, F=0x0, S=1, 1181, 0xce17 -0,599,599, 33, 1233, 0x2903744a, F=0x0, S=1, 860, 0x737eb566 -0,632,632, 33, 1118, 0x7f274f50, F=0x0, S=1, 933, 0xb669c6b6 -0,665,665, 33, 941, 0x6bffd4b1, F=0x0, S=1, 1058, 0x07581cee -0,699,699, 33, 1598, 0xc007219f, F=0x0, S=1, 939, 0x2c0bdc45 -0,732,732, 33, 1218, 0x25d962b6, F=0x0, S=1, 1090, 0x96482341 -0,765,765, 33, 1200, 0x86b85be3, F=0x0, S=1, 189, 0x3f085309 -0,799,799, 33, 1329, 0x298a848a, F=0x0, S=1, 1426, 0x6ea3df12 -0,832,832, 33, 1500, 0xe437edec, F=0x0, S=1, 1244, 0x32836b8d -0,865,865, 33, 1288, 0xc4447dd5, F=0x0, S=1, 1289, 0x06a57b0f -0,899,899, 33, 1281, 0xb5bf7e9f, F=0x0, S=1, 1227, 0xd96d5697 -0,932,932, 33, 1372, 0x09be9014, F=0x0, S=1, 1556, 0x2630fbff -0,965,965, 33, 1238, 0x42ce6316, F=0x0, S=1, 1287, 0x1d3084f6 -0,999,999, 33, 1655, 0xb94b45c2, F=0x0, S=1, 1494, 0x34dbd1a4 -0, 1032, 1032, 33, 1164, 0xf6b93ad0, F=0x0, S=1, 1337, 0xba6d9673 -0, 1065, 1065, 33, 1084, 0x58c50fb5, F=0x0, S=1, 1384, 0x3fabb82b -0, 1099, 1099, 33, 1151, 0x0b3f3359, F=0x0, S=1, 1353, 0x08e2a1d7 -0, 1132, 1132, 33, 1277, 0xa3ae77e1, F=0x0, S=1, 1409, 0xf65cb9f7 -0, 1165, 1165, 33, 782, 0xdcf671ff, F=0x0, S=1, 1408, 0x01e2ac53 -0, 1199, 1199, 33, 926,
[FFmpeg-devel] [PATCH 09/12] fate-webm-webvtt-remux: print packet side data in ffprobe output
--- tests/fate/matroska.mak | 2 +- tests/ref/fate/webm-webvtt-remux | 336 +++ 2 files changed, 337 insertions(+), 1 deletion(-) diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak index becca28e1a..ca7193a055 100644 --- a/tests/fate/matroska.mak +++ b/tests/fate/matroska.mak @@ -136,7 +136,7 @@ FATE_MATROSKA_FFMPEG_FFPROBE-$(call ALLYES, FILE_PROTOCOL WEBVTT_DEMUXER \ WEBM_MUXER MATROSKA_DEMUXER \ FRAMECRC_MUXER PIPE_PROTOCOL) \ += fate-webm-webvtt-remux -fate-webm-webvtt-remux: CMD = transcode webvtt $(TARGET_SAMPLES)/sub/WebVTT_capability_tester.vtt webm "-map 0 -map 0 -map 0 -map 0 -c:s copy -disposition:0 original+descriptions+hearing_impaired -disposition:1 lyrics+default+metadata -disposition:2 comment+forced -disposition:3 karaoke+captions+dub" "-map 0:0 -map 0:1 -c copy" "" "-show_entries stream_disposition:stream=index,codec_name" +fate-webm-webvtt-remux: CMD = transcode webvtt $(TARGET_SAMPLES)/sub/WebVTT_capability_tester.vtt webm "-map 0 -map 0 -map 0 -map 0 -c:s copy -disposition:0 original+descriptions+hearing_impaired -disposition:1 lyrics+default+metadata -disposition:2 comment+forced -disposition:3 karaoke+captions+dub" "-map 0:0 -map 0:1 -c copy" "" "-show_entries stream_disposition:stream=index,codec_name:packet=stream_index,pts:packet_side_data_list -show_data_hash CRC32" FATE_SAMPLES_AVCONV += $(FATE_MATROSKA-yes) FATE_SAMPLES_FFPROBE += $(FATE_MATROSKA_FFPROBE-yes) diff --git a/tests/ref/fate/webm-webvtt-remux b/tests/ref/fate/webm-webvtt-remux index 0737541be5..a0e9182f47 100644 --- a/tests/ref/fate/webm-webvtt-remux +++ b/tests/ref/fate/webm-webvtt-remux @@ -36,6 +36,342 @@ c5625f28e6968e12d91f125edef5f16c *tests/data/fate/webm-webvtt-remux.webm 1, 5, 5, 1134, 43, 0x534b0ee3 0,3540123,3540123, 148, 13, 0x216a04d8 1,3540123,3540123, 148, 13, 0x216a04d8 +[PACKET] +stream_index=0 +pts=11000 +[/PACKET] +[PACKET] +stream_index=1 +pts=11000 +[/PACKET] +[PACKET] +stream_index=2 +pts=11000 +[/PACKET] +[PACKET] +stream_index=3 +pts=11000 +[/PACKET] +[PACKET] +stream_index=0 +pts=13000 +[/PACKET] +[PACKET] +stream_index=1 +pts=13000 +[/PACKET] +[PACKET] +stream_index=2 +pts=13000 +[/PACKET] +[PACKET] +stream_index=3 +pts=13000 +[/PACKET] +[PACKET] +stream_index=0 +pts=16000 +[/PACKET] +[PACKET] +stream_index=1 +pts=16000 +[/PACKET] +[PACKET] +stream_index=2 +pts=16000 +[/PACKET] +[PACKET] +stream_index=3 +pts=16000 +[/PACKET] +[PACKET] +stream_index=0 +pts=18000 +[/PACKET] +[PACKET] +stream_index=1 +pts=18000 +[/PACKET] +[PACKET] +stream_index=2 +pts=18000 +[/PACKET] +[PACKET] +stream_index=3 +pts=18000 +[/PACKET] +[PACKET] +stream_index=0 +pts=2 +[/PACKET] +[PACKET] +stream_index=1 +pts=2 +[/PACKET] +[PACKET] +stream_index=2 +pts=2 +[/PACKET] +[PACKET] +stream_index=3 +pts=2 +[/PACKET] +[PACKET] +stream_index=0 +pts=22000 +[SIDE_DATA] +side_data_type=WebVTT ID +data_hash=CRC32:884863d2 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=1 +pts=22000 +[SIDE_DATA] +side_data_type=WebVTT ID +data_hash=CRC32:884863d2 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=2 +pts=22000 +[SIDE_DATA] +side_data_type=WebVTT ID +data_hash=CRC32:884863d2 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=3 +pts=22000 +[SIDE_DATA] +side_data_type=WebVTT ID +data_hash=CRC32:884863d2 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=0 +pts=24000 +[/PACKET] +[PACKET] +stream_index=1 +pts=24000 +[/PACKET] +[PACKET] +stream_index=2 +pts=24000 +[/PACKET] +[PACKET] +stream_index=3 +pts=24000 +[/PACKET] +[PACKET] +stream_index=0 +pts=27000 +[SIDE_DATA] +side_data_type=WebVTT ID +data_hash=CRC32:38ea6650 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=1 +pts=27000 +[SIDE_DATA] +side_data_type=WebVTT ID +data_hash=CRC32:38ea6650 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=2 +pts=27000 +[SIDE_DATA] +side_data_type=WebVTT ID +data_hash=CRC32:38ea6650 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=3 +pts=27000 +[SIDE_DATA] +side_data_type=WebVTT ID +data_hash=CRC32:38ea6650 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=0 +pts=3 +[SIDE_DATA] +side_data_type=WebVTT Settings +data_hash=CRC32:c85a02f9 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=1 +pts=3 +[SIDE_DATA] +side_data_type=WebVTT Settings +data_hash=CRC32:c85a02f9 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=2 +pts=3 +[SIDE_DATA] +side_data_type=WebVTT Settings +data_hash=CRC32:c85a02f9 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=3 +pts=3 +[SIDE_DATA] +side_data_type=WebVTT Settings +data_hash=CRC32:c85a02f9 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=0 +pts=30500 +[SIDE_DATA] +side_data_type=WebVTT Settings +data_hash=CRC32:5a60fed3 +[/SIDE_DATA] +[/PACKET] +[PACKET] +stream_index=1 +pts=30500 +[SIDE_DATA] +side_data_type=WebVTT Settings +data_hash=C
[FFmpeg-devel] [PATCH 04/12] fate/gapless: add a test for skip samples side data
--- tests/fate/gapless.mak | 3 + tests/ref/fate/gapless-mp3-side-data | 600 +++ 2 files changed, 603 insertions(+) create mode 100644 tests/ref/fate/gapless-mp3-side-data diff --git a/tests/fate/gapless.mak b/tests/fate/gapless.mak index 3a82c3ef68..b035e18d03 100644 --- a/tests/fate/gapless.mak +++ b/tests/fate/gapless.mak @@ -1,6 +1,9 @@ FATE_GAPLESS-$(CONFIG_MP3_DEMUXER) += fate-gapless-mp3 fate-gapless-mp3: CMD = gapless $(TARGET_SAMPLES)/gapless/gapless.mp3 "-c:a mp3" +FATE_GAPLESS-$(CONFIG_MP3_DEMUXER) += fate-gapless-mp3-side-data +fate-gapless-mp3-side-data: CMD = ffprobe_demux $(TARGET_SAMPLES)/gapless/gapless.mp3 + FATE_GAPLESS-$(CONFIG_MP3_DEMUXER) += fate-audiomatch-square-mp3 fate-audiomatch-square-mp3: CMD = audio_match $(TARGET_SAMPLES)/audiomatch/square3.mp3 $(SAMPLES)/audiomatch/square3.wav diff --git a/tests/ref/fate/gapless-mp3-side-data b/tests/ref/fate/gapless-mp3-side-data new file mode 100644 index 00..1cdca55d5e --- /dev/null +++ b/tests/ref/fate/gapless-mp3-side-data @@ -0,0 +1,600 @@ +packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.00|dts=0|dts_time=0.00|duration=368640|duration_time=0.026122|size=417|pos=1451|flags=K_side_data|side_data_type=Skip Samples|skip_samples=1105|discard_padding=0|skip_reason=0|discard_reason=0 +|data_hash=CRC32:ae0a5066 +packet|codec_type=audio|stream_index=0|pts=368640|pts_time=0.026122|dts=368640|dts_time=0.026122|duration=368640|duration_time=0.026122|size=418|pos=1868|flags=K_|data_hash=CRC32:dbb7aa6c +packet|codec_type=audio|stream_index=0|pts=737280|pts_time=0.052245|dts=737280|dts_time=0.052245|duration=368640|duration_time=0.026122|size=418|pos=2286|flags=K_|data_hash=CRC32:5fe9fd6b +packet|codec_type=audio|stream_index=0|pts=1105920|pts_time=0.078367|dts=1105920|dts_time=0.078367|duration=368640|duration_time=0.026122|size=418|pos=2704|flags=K_|data_hash=CRC32:baec14f8 +packet|codec_type=audio|stream_index=0|pts=1474560|pts_time=0.104490|dts=1474560|dts_time=0.104490|duration=368640|duration_time=0.026122|size=418|pos=3122|flags=K_|data_hash=CRC32:9916a4cf +packet|codec_type=audio|stream_index=0|pts=1843200|pts_time=0.130612|dts=1843200|dts_time=0.130612|duration=368640|duration_time=0.026122|size=418|pos=3540|flags=K_|data_hash=CRC32:a5897354 +packet|codec_type=audio|stream_index=0|pts=2211840|pts_time=0.156735|dts=2211840|dts_time=0.156735|duration=368640|duration_time=0.026122|size=418|pos=3958|flags=K_|data_hash=CRC32:3b3bd4e1 +packet|codec_type=audio|stream_index=0|pts=2580480|pts_time=0.182857|dts=2580480|dts_time=0.182857|duration=368640|duration_time=0.026122|size=418|pos=4376|flags=K_|data_hash=CRC32:5a319d96 +packet|codec_type=audio|stream_index=0|pts=2949120|pts_time=0.208980|dts=2949120|dts_time=0.208980|duration=368640|duration_time=0.026122|size=418|pos=4794|flags=K_|data_hash=CRC32:c62a20be +packet|codec_type=audio|stream_index=0|pts=3317760|pts_time=0.235102|dts=3317760|dts_time=0.235102|duration=368640|duration_time=0.026122|size=418|pos=5212|flags=K_|data_hash=CRC32:233edc53 +packet|codec_type=audio|stream_index=0|pts=3686400|pts_time=0.261224|dts=3686400|dts_time=0.261224|duration=368640|duration_time=0.026122|size=418|pos=5630|flags=K_|data_hash=CRC32:62ff9ae2 +packet|codec_type=audio|stream_index=0|pts=4055040|pts_time=0.287347|dts=4055040|dts_time=0.287347|duration=368640|duration_time=0.026122|size=418|pos=6048|flags=K_|data_hash=CRC32:de77ed5e +packet|codec_type=audio|stream_index=0|pts=4423680|pts_time=0.313469|dts=4423680|dts_time=0.313469|duration=368640|duration_time=0.026122|size=418|pos=6466|flags=K_|data_hash=CRC32:1ea533a1 +packet|codec_type=audio|stream_index=0|pts=4792320|pts_time=0.339592|dts=4792320|dts_time=0.339592|duration=368640|duration_time=0.026122|size=418|pos=6884|flags=K_|data_hash=CRC32:b5b48e4b +packet|codec_type=audio|stream_index=0|pts=5160960|pts_time=0.365714|dts=5160960|dts_time=0.365714|duration=368640|duration_time=0.026122|size=418|pos=7302|flags=K_|data_hash=CRC32:afdcd44b +packet|codec_type=audio|stream_index=0|pts=5529600|pts_time=0.391837|dts=5529600|dts_time=0.391837|duration=368640|duration_time=0.026122|size=418|pos=7720|flags=K_|data_hash=CRC32:10038cf1 +packet|codec_type=audio|stream_index=0|pts=5898240|pts_time=0.417959|dts=5898240|dts_time=0.417959|duration=368640|duration_time=0.026122|size=418|pos=8138|flags=K_|data_hash=CRC32:0d72e0e3 +packet|codec_type=audio|stream_index=0|pts=6266880|pts_time=0.444082|dts=6266880|dts_time=0.444082|duration=368640|duration_time=0.026122|size=418|pos=8556|flags=K_|data_hash=CRC32:7919c1eb +packet|codec_type=audio|stream_index=0|pts=6635520|pts_time=0.470204|dts=6635520|dts_time=0.470204|duration=368640|duration_time=0.026122|size=418|pos=8974|flags=K_|data_hash=CRC32:95549eee +packet|codec_type=audio|stream_index=0|pts=7004160|pts_time=0.496327|dts=7004160|dts_time=0.496327|duration=368640|duration_time=0.026122|size=418|pos=9392|flags=K_|data_hash=CRC32:d8d5c00
[FFmpeg-devel] [PATCH 07/12] fate-ts-demux: convert to ffprobe
It can handle side data cleanly. --- tests/fate/demux.mak| 2 +- tests/ref/fate/ts-demux | 80 - 2 files changed, 49 insertions(+), 33 deletions(-) diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak index 66a90a107a..dfc4ee2b4e 100644 --- a/tests/fate/demux.mak +++ b/tests/fate/demux.mak @@ -158,7 +158,7 @@ FATE_SAMPLES_DEMUX-$(CONFIG_XWMA_DEMUXER) += fate-xwma-demux fate-xwma-demux: CMD = crc -i $(TARGET_SAMPLES)/xwma/ergon.xwma -c:a copy FATE_SAMPLES_DEMUX-$(CONFIG_MPEGTS_DEMUXER) += fate-ts-demux -fate-ts-demux: CMD = framecrc -i $(TARGET_SAMPLES)/ac3/mp3ac325-4864-small.ts -codec copy +fate-ts-demux: CMD = ffprobe_demux $(TARGET_SAMPLES)/ac3/mp3ac325-4864-small.ts FATE_SAMPLES_DEMUX += $(FATE_SAMPLES_DEMUX-yes) FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_DEMUX) diff --git a/tests/ref/fate/ts-demux b/tests/ref/fate/ts-demux index cdf34d6af0..aafad9537f 100644 --- a/tests/ref/fate/ts-demux +++ b/tests/ref/fate/ts-demux @@ -1,32 +1,48 @@ -#extradata 0: 150, 0xb4192fb9 -#tb 0: 1/9 -#media_type 0: video -#codec_id 0: mpeg2video -#dimensions 0: 1280x720 -#sar 0: 1/1 -#tb 1: 1/9 -#media_type 1: audio -#codec_id 1: ac3 -#sample_rate 1: 48000 -#channel_layout 1: 60f -#channel_layout_name 1: 5.1(side) -1, 0, 0, 2880, 1536, 0x773ffeea, S=1,1, 0x00bd00bd -1, 2880, 2880, 2880, 1536, 0x6dc10748 -1, 5760, 5760, 2880, 1536, 0xbab5129c -1, 8640, 8640, 2880, 1536, 0x602f034b, S=1,1, 0x00bd00bd -1, 11520, 11520, 2880, 906, 0x69cdcbcd -0, 32037, 36541, 1501, 114336, 0x37a215a8, S=2,1, 0x00e000e0, 24, 0x663d0b52 -0, 33538, 33538, 1501,12560, 0xb559a3d4, F=0x0, S=1, 1, 0x00e000e0 -0, 35040, 35040, 1501,12704, 0x2614adf4, F=0x0, S=1, 1, 0x00e000e0 -0, 36541, 41046, 1501,51976, 0x9ff1dbfe, F=0x0, S=1, 1, 0x00e000e0 -0, 38043, 38043, 1501,13096, 0x4ff9ea23, F=0x0, S=1, 1, 0x00e000e0 -0, 39544, 39544, 1501,13744, 0xf2b2402a, F=0x0, S=1, 1, 0x00e000e0 -0, 41046, 45550, 1501,56568, 0x65f5aee1, F=0x0, S=1, 1, 0x00e000e0 -0, 42547, 42547, 1501,14720, 0x8855866c, F=0x0, S=1, 1, 0x00e000e0 -0, 44049, 44049, 1501,15216, 0x83cbc4fc, F=0x0, S=1, 1, 0x00e000e0 -0, 45550, 50055, 1501,61720, 0xecda6b05, F=0x0, S=1, 1, 0x00e000e0 -0, 47052, 47052, 1501,17416, 0xdf480c6d, F=0x0, S=1, 1, 0x00e000e0 -0, 48553, 48553, 1501,18144, 0x1950624c, F=0x0, S=1, 1, 0x00e000e0 -0, 50055, 54559, 1501,56848, 0xd4f315be, F=0x0, S=1, 1, 0x00e000e0 -0, 51556, 51556, 1501,16296, 0xd391a1d0, F=0x0, S=1, 1, 0x00e000e0 -0, 53058, 53058, 1501, 4944, 0x4d88640e, F=0x0 +packet|codec_type=video|stream_index=0|pts=3912669846|pts_time=43474.109400|dts=3912665342|dts_time=43474.059356|duration=1501|duration_time=0.016678|size=114336|pos=376|flags=K_side_data|side_data_type=MPEGTS Stream ID|id=224 +|data_hash=CRC32:9bc8b561 +packet|codec_type=video|stream_index=0|pts=3912666843|pts_time=43474.076033|dts=3912666843|dts_time=43474.076033|duration=1501|duration_time=0.016678|size=12560|pos=122012|flags=__side_data|side_data_type=MPEGTS Stream ID|id=224 +|data_hash=CRC32:4f8c97dd +packet|codec_type=video|stream_index=0|pts=3912668345|pts_time=43474.092722|dts=3912668345|dts_time=43474.092722|duration=1501|duration_time=0.016678|size=12704|pos=135548|flags=__side_data|side_data_type=MPEGTS Stream ID|id=224 +|data_hash=CRC32:27f259db +packet|codec_type=video|stream_index=0|pts=3912674351|pts_time=43474.159456|dts=3912669846|dts_time=43474.109400|duration=1501|duration_time=0.016678|size=51976|pos=149084|flags=__side_data|side_data_type=MPEGTS Stream ID|id=224 +|data_hash=CRC32:a6588b80 +packet|codec_type=video|stream_index=0|pts=3912671348|pts_time=43474.126089|dts=3912671348|dts_time=43474.126089|duration=1501|duration_time=0.016678|size=13096|pos=204356|flags=__side_data|side_data_type=MPEGTS Stream ID|id=224 +|data_hash=CRC32:33547f9f +packet|codec_type=video|stream_index=0|pts=3912672849|pts_time=43474.142767|dts=3912672849|dts_time=43474.142767|duration=1501|duration_time=0.016678|size=13744|pos=218456|flags=__side_data|side_data_type=MPEGTS Stream ID|id=224 +|data_hash=CRC32:547f3d4e +packet|codec_type=video|stream_index=0|pts=3912678855|pts_time=43474.209500|dts=3912674351|dts_time=43474.159456|duration=1501|duration_time=0.016678|size=56568|pos=232932|flags=__side_data|side_data_type=MPEGTS Stream ID|id=224 +|data_hash=CRC32:fb5f4b9e +packet|codec_type=video|stream_index=0|pts=3912675852|pts_time=43474.176133|dts=3912675852|dts_time=43474.176133|duration=1501|duration_time=0.016678|size=14720|p
[FFmpeg-devel] [PATCH 12/12] lavf/framecrcenc: do not hash side data
There are no guarantees that all side data types have the same representation on all platforms. Tests that change output due to this: id3v2-priv-remux, cover-art-mp3-id3v2-remux, gapless-mp3: SKIP_SAMPLES, which is tested by fate-gapless-mp3-side-data matroska-vp8-alpha-remux: MATROSKA_BLOCKADDITIONAL, which is tested by remux itself (side data is written into output) matroska-mastering-display-metadata: MASTERING_DISPLAY_METADATA and CONTENT_LIGHT_LEVEL, which are tested by ffprobe invocation in the same test matroska-spherical-mono-remux: STEREO3D and SPHERICAL, which are tested by ffprobe invocation in the same test segment-mp4-to-ts: MPEGTS_STREAM_ID, which is tested by ts remuxing tests webm-webvtt-remux: WEBVTT_IDENTIFIER/SETTINGS, which is tested by the ffprobe invocation in the same test mxf-d10-user-comments: CPB_PROPERTIES, which is tested by mxf-probe-d10 mov-cover-image: SKIP_SAMPLES, which is tested for mov by mov-aac-2048-priming copy-trac3074: AUDIO_SERVICE_TYPE, which is tested by fate-hls-fmp4_ac3 --- libavformat/framecrcenc.c | 71 - tests/ref/fate/copy-trac3074 | 2 +- tests/ref/fate/cover-art-mp3-id3v2-remux | 2 +- tests/ref/fate/gapless-mp3| 6 +- tests/ref/fate/id3v2-priv-remux | 2 +- .../fate/matroska-mastering-display-metadata | 4 +- tests/ref/fate/matroska-spherical-mono-remux | 4 +- tests/ref/fate/matroska-vp8-alpha-remux | 14 +- tests/ref/fate/mov-cover-image| 2 +- tests/ref/fate/mxf-d10-user-comments | 2 +- tests/ref/fate/segment-mp4-to-ts | 250 +- tests/ref/fate/webm-webvtt-remux | 24 +- 12 files changed, 156 insertions(+), 227 deletions(-) diff --git a/libavformat/framecrcenc.c b/libavformat/framecrcenc.c index 1fbe4aa4ee..863aedb7e8 100644 --- a/libavformat/framecrcenc.c +++ b/libavformat/framecrcenc.c @@ -21,10 +21,7 @@ #include -#include "config.h" #include "libavutil/adler32.h" -#include "libavutil/avstring.h" -#include "libavutil/intreadwrite.h" #include "libavcodec/avcodec.h" #include "avformat.h" #include "internal.h" @@ -45,17 +42,6 @@ static int framecrc_write_header(struct AVFormatContext *s) return ff_framehash_write_header(s); } -static av_unused void inline bswap(char *buf, int offset, int size) -{ -if (size == 8) { -uint64_t val = AV_RN64(buf + offset); -AV_WN64(buf + offset, av_bswap64(val)); -} else if (size == 4) { -uint32_t val = AV_RN32(buf + offset); -AV_WN32(buf + offset, av_bswap32(val)); -} -} - static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt) { uint32_t crc = av_adler32_update(0, pkt->data, pkt->size); @@ -65,63 +51,6 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt) pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size, crc); if (pkt->flags != AV_PKT_FLAG_KEY) av_strlcatf(buf, sizeof(buf), ", F=0x%0X", pkt->flags); -if (pkt->side_data_elems) { -int i; -av_strlcatf(buf, sizeof(buf), ", S=%d", pkt->side_data_elems); - -for (i=0; iside_data_elems; i++) { -const AVPacketSideData *const sd = &pkt->side_data[i]; -const uint8_t *data = sd->data; -uint32_t side_data_crc = 0; - -switch (sd->type) { -#if HAVE_BIGENDIAN -uint8_t bswap_buf[FFMAX(sizeof(AVCPBProperties), -sizeof(AVProducerReferenceTime))]; -case AV_PKT_DATA_PALETTE: -case AV_PKT_DATA_REPLAYGAIN: -case AV_PKT_DATA_DISPLAYMATRIX: -case AV_PKT_DATA_STEREO3D: -case AV_PKT_DATA_AUDIO_SERVICE_TYPE: -case AV_PKT_DATA_FALLBACK_TRACK: -case AV_PKT_DATA_MASTERING_DISPLAY_METADATA: -case AV_PKT_DATA_SPHERICAL: -case AV_PKT_DATA_CONTENT_LIGHT_LEVEL: -case AV_PKT_DATA_S12M_TIMECODE: -for (int j = 0; j < sd->size / 4; j++) { -uint8_t buf[4]; -AV_WL32(buf, AV_RB32(sd->data + 4 * j)); -side_data_crc = av_adler32_update(side_data_crc, buf, 4); -} -break; -case AV_PKT_DATA_CPB_PROPERTIES: -#define BSWAP(struct, field) bswap(bswap_buf, offsetof(struct, field), sizeof(((struct){0}).field)) -if (sd->size == sizeof(AVCPBProperties)) { -memcpy(bswap_buf, sd->data, sizeof(AVCPBProperties)); -data = bswap_buf; -BSWAP(AVCPBProperties, max_bitrate); -BSWAP(AVCPBProperties, min_bitrate); -BSWAP(AVCPBProperties, avg_bitrate); -BSWAP(AVCPBProperties, buffer_size); -BSWAP(AVCPBProperties, vbv_delay); -} -goto pod; -
[FFmpeg-devel] [PATCH 10/12] fate-run.sh: print stream side data in probeaudiostream()
Adds a test for reading AUDIO_SERVICE_TYPE in fate-hls-fmp4_ac3 --- tests/fate-run.sh | 2 +- tests/ref/fate/hls-fmp4_ac3 | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/fate-run.sh b/tests/fate-run.sh index dd3f564e18..ba437dfbb8 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -90,7 +90,7 @@ probefmt(){ } probeaudiostream(){ -run ffprobe${PROGSUF}${EXECSUF} -show_entries stream=codec_name,codec_time_base,sample_fmt,channels,channel_layout "$@" +run ffprobe${PROGSUF}${EXECSUF} -show_entries stream=codec_name,codec_time_base,sample_fmt,channels,channel_layout:side_data "$@" } probetags(){ diff --git a/tests/ref/fate/hls-fmp4_ac3 b/tests/ref/fate/hls-fmp4_ac3 index caccd70fa7..ce7367de4d 100644 --- a/tests/ref/fate/hls-fmp4_ac3 +++ b/tests/ref/fate/hls-fmp4_ac3 @@ -4,5 +4,7 @@ sample_fmt=fltp channels=6 channel_layout=5.1(side) [SIDE_DATA] +side_data_type=Audio Service Type +type=0 [/SIDE_DATA] [/STREAM] -- 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] lavc/videotoolboxenc: set DataRateLimits for hevc
>From the comment it's not available on old version. It works now by testing on macOS 11.2.1. There is no document about since when. So trying to set the configuration and ignore the error for hevc. --- libavcodec/videotoolboxenc.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 9b7ee6720c..cefd70fa88 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -1113,8 +1113,8 @@ static int vtenc_create_encoder(AVCodecContext *avctx, return AVERROR_EXTERNAL; } -if (vtctx->codec_id == AV_CODEC_ID_H264 && max_rate > 0) { -// kVTCompressionPropertyKey_DataRateLimits is not available for HEVC +if ((vtctx->codec_id == AV_CODEC_ID_H264 || vtctx->codec_id == AV_CODEC_ID_HEVC) +&& max_rate > 0) { bytes_per_second_value = max_rate >> 3; bytes_per_second = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, @@ -1152,7 +1152,11 @@ static int vtenc_create_encoder(AVCodecContext *avctx, if (status) { av_log(avctx, AV_LOG_ERROR, "Error setting max bitrate property: %d\n", status); -return AVERROR_EXTERNAL; +// kVTCompressionPropertyKey_DataRateLimits is available for HEVC +// now but not on old release. There is no document about since +// when. So ignore the error if it failed for hevc. +if (vtctx->codec_id != AV_CODEC_ID_HEVC) +return AVERROR_EXTERNAL; } } -- 2.31.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".
Re: [FFmpeg-devel] [PATCH] lavc/videotoolboxenc: set DataRateLimits for hevc
> 2021年4月25日 下午4:06,Zhao Zhili 写道: > > From the comment it's not available on old version. It works now > by testing on macOS 11.2.1. There is no document about since when. > So trying to set the configuration and ignore the error for hevc. > --- > libavcodec/videotoolboxenc.c | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c > index 9b7ee6720c..cefd70fa88 100644 > --- a/libavcodec/videotoolboxenc.c > +++ b/libavcodec/videotoolboxenc.c > @@ -1113,8 +1113,8 @@ static int vtenc_create_encoder(AVCodecContext *avctx, > return AVERROR_EXTERNAL; > } > > -if (vtctx->codec_id == AV_CODEC_ID_H264 && max_rate > 0) { > -// kVTCompressionPropertyKey_DataRateLimits is not available for HEVC > +if ((vtctx->codec_id == AV_CODEC_ID_H264 || vtctx->codec_id == > AV_CODEC_ID_HEVC) > +&& max_rate > 0) { > bytes_per_second_value = max_rate >> 3; > bytes_per_second = CFNumberCreate(kCFAllocatorDefault, > kCFNumberSInt64Type, > @@ -1152,7 +1152,11 @@ static int vtenc_create_encoder(AVCodecContext > *avctx, > > if (status) { > av_log(avctx, AV_LOG_ERROR, "Error setting max bitrate property: > %d\n", status); > -return AVERROR_EXTERNAL; > +// kVTCompressionPropertyKey_DataRateLimits is available for HEVC > +// now but not on old release. There is no document about since > +// when. So ignore the error if it failed for hevc. > +if (vtctx->codec_id != AV_CODEC_ID_HEVC) > +return AVERROR_EXTERNAL; > } > } > > -- > 2.31.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". > LGTM Thanks Steven Liu ___ 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] avfilter/af_adelay: make per channel delay argument an int64_t
Please apply. On Fri, Apr 23, 2021 at 4:39 PM Andreas Rheinhardt < andreas.rheinha...@outlook.com> wrote: > James Almer: > > On 4/23/2021 11:18 AM, Andreas Rheinhardt wrote: > >> James Almer: > >>> Should fix ticket #9196 > >>> > >>> Signed-off-by: James Almer > >>> --- > >>> libavfilter/af_adelay.c | 13 + > >>> 1 file changed, 9 insertions(+), 4 deletions(-) > >>> > >>> diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c > >>> index 6ac81c2a3e..81ff7947f5 100644 > >>> --- a/libavfilter/af_adelay.c > >>> +++ b/libavfilter/af_adelay.c > >>> @@ -28,9 +28,9 @@ > >>> #include "internal.h" > >>> typedef struct ChanDelay { > >>> -int delay; > >>> -unsigned delay_index; > >>> -unsigned index; > >>> +int64_t delay; > >>> +size_t delay_index; > >>> +size_t index; > >>> uint8_t *samples; > >>> } ChanDelay; > >>> @@ -152,7 +152,7 @@ static int config_input(AVFilterLink *inlink) > >>> p = NULL; > >>> -ret = av_sscanf(arg, "%d%c", &d->delay, &type); > >>> +ret = av_sscanf(arg, "%"SCNd64"%c", &d->delay, &type); > >>> if (ret != 2 || type != 'S') { > >>> div = type == 's' ? 1.0 : 1000.0; > >>> if (av_sscanf(arg, "%f", &delay) != 1) { > >>> @@ -194,6 +194,11 @@ static int config_input(AVFilterLink *inlink) > >>> if (!d->delay) > >>> continue; > >>> +if (d->delay > SIZE_MAX) { > >> > >> Does this give a new compiler warning on 64bit systems (where this check > >> is tautologically false)? > > > > Not here with GCC 10.2.0 mingw-w64, at least. > > With -Wextra it prints a -Wsign-compare warning, but it gets buried in a > > dozen other similar warnings. > > > > Do you prefer if i make the check "d->delay > SIZE_MAX / s->block_align" > > instead? > > > > Of course not. Then the compiler could not optimize the check (and the > string) away. > > >> > >>> +av_log(ctx, AV_LOG_ERROR, "Requested delay is too > big.\n"); > >>> +return AVERROR(EINVAL); > >>> +} > >>> + > >>> d->samples = av_malloc_array(d->delay, s->block_align); > >>> if (!d->samples) > >>> return AVERROR(ENOMEM); > >>> > ___ > 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 05/12] fate-ts-small-demux: convert to ffprobe
On Sun, Apr 25, 2021 at 09:03:13AM +0200, Anton Khirnov wrote: > It can handle side data cleanly. [] > +stream|index=0|codec_name=h264|profile=578|codec_type=video|codec_tag_string=[27][0][0][0]|codec_tag=0x001b|width=82|height=144|coded_width=82|coded_height=144|closed_captions=0|has_b_frames=0|sample_aspect_ratio=1:1|display_aspect_ratio=41:72|pix_fmt=yuv420p|level=10|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=progressive|refs=1|is_avc=false|nal_length_size=0|id=0x100|r_frame_rate=15/1|avg_frame_rate=15/1|time_base=1/9|start_pts=126000|start_time=1.40|duration_ts=444000|duration=4.93|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=74|extradata_hash=CRC32:e62cae27|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_th > > umbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0 > +format|filename=h264small.ts|nb_streams=1|nb_programs=1|format_name=mpegts|start_time=1.40|duration=4.93|size=16544|bit_rate=26828|probe_score=50 It seems something is cuttning long lines [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you fake or manipulate statistics in a paper in physics you will never get a job again. If you fake or manipulate statistics in a paper in medicin you will get a job for life at the pharma industry. 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".
[FFmpeg-devel] [PATCH 1/2] doc: fix generating doxy with out-of-tree builds
Broken in 753930bc7300dd595c4bab51c5a70d1da9083da4, as the path to Doxyfile passed to doxy-wrapper.sh is relative to the build dir, while the recipe cd's to the source dir before invoking the wrapper. --- doc/Makefile| 2 +- doc/doxy-wrapper.sh | 9 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index fa4996b5a3..58ca3fabd8 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -102,7 +102,7 @@ DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) ffbuild/config.mak doc/doxy/html: TAG = DOXY doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS) - $(M)OUT_DIR=$$PWD/doc/doxy; cd $(SRC_PATH); ./doc/doxy-wrapper.sh $$OUT_DIR $< $(DOXYGEN) $(DOXY_INPUT); + $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $$PWD/doc/doxy $(SRC_PATH) doc/Doxyfile $(DOXYGEN) $(DOXY_INPUT); install-doc: install-html install-man diff --git a/doc/doxy-wrapper.sh b/doc/doxy-wrapper.sh index fe0102b5bf..729caa6347 100755 --- a/doc/doxy-wrapper.sh +++ b/doc/doxy-wrapper.sh @@ -1,10 +1,13 @@ #!/bin/sh OUT_DIR="${1}" -DOXYFILE="${2}" -DOXYGEN="${3}" +SRC_DIR="${2}" +DOXYFILE="${3}" +DOXYGEN="${4}" -shift 3 +shift 4 + +cd ${SRC_DIR} if [ -e "VERSION" ]; then VERSION=`cat "VERSION"` -- 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 2/2] lavf: clarify probesize/format_probesize doxy
probesize is not used for probing the input format, but its documentation claims it does. --- libavformat/avformat.h | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 8600ee1bf7..00e78a4a11 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1394,9 +1394,15 @@ typedef struct AVFormatContext { #define AVFMT_FLAG_AUTO_BSF 0x20 ///< Add bitstream filters as requested by the muxer /** - * Maximum size of the data read from input for determining - * the input container format. + * Maximum number of bytes read from input in order to determine stream + * properties. Used when reading the global header and in + * avformat_find_stream_info(). + * * Demuxing only, set by the caller before avformat_open_input(). + * + * @note this is \e not used for determining the \ref AVInputFormat + * "input format" + * @sa format_probesize */ int64_t probesize; @@ -1671,9 +1677,13 @@ typedef struct AVFormatContext { int probe_score; /** - * number of bytes to read maximally to identify format. - * - encoding: unused - * - decoding: set by user + * Maximum number of bytes read from input in order to identify the + * \ref AVInputFormat "input format". Only used when the format is not set + * explicitly by the caller. + * + * Demuxing only, set by the caller before avformat_open_input(). + * + * @sa probesize */ int format_probesize; -- 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 01/14] avcodec/ffv1dec: Remove redundant writes, fix races
Quoting Andreas Rheinhardt (2021-04-24 12:53:24) > Every modification of the data that is copied in update_thread_context() > is a data race if it happens after ff_thread_finish_setup. ffv1dec's > update_thread_context() simply uses memcpy for updating the new context, > so that every modification of the src's context is a race. > Some of these modifications are unnecessary: picture_number is write-only > for the decoder and cur will be reset when decoding the next frame anyway. > So remove them. And while just at it, also don't set cur for the slice > contexts as this variable is write-only. > > Signed-off-by: Andreas Rheinhardt > --- > Weirdly ubitux's TSAN fate-box (which uses frame threading by default) > does not show any failing FFV1 tests; although (Clang-)TSAN does it > for me and it is totally obvious that these are data races. Ok -- 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 02/14] avcodec/ffv1dec: Don't set ThreadFrame properties, fix race
On Sat, Apr 24, 2021 at 01:14:34PM +0200, Andreas Rheinhardt wrote: > Each FFV1 slice has its own SAR and picture structure encoded; > when a slice header was parsed, the relevant fields of a ThreadFrame's > AVFrame were directly set based upon the parsed values. This is > a data race in case slice threading is in use because of the concurrent > writes. In case of frame threading, it is also a data race because > the writes happen after ff_thread_finish_setup(), so that the reads > performed by ff_thread_ref_frame() are unsynchronized with the writes > performed when parsing the header. > > This commit fixes these issues by not writing to the ThreadFrame at all; > instead the raw data is read into the each SliceContext first; after > decoding the current frame and creating the actual output frame these > values are compared to each other. If they are valid and coincide, the > derived value is written directly to the output frame, not to the > ThreadFrame, thereby avoiding data races. > > This fixes most FFV1 FATE-tests completely when using slice threading; > the exceptions are fate-vsynth3-ffv1, vsynth3-ffv1-v3-yuv420p and > vsynth3-ffv1-v3-yuv422p10. (In these tests the partitioning into slices > does not honour chroma subsampling; as a result, chroma pixels at slice > borders get set by more than one thread without any synchronization.) > > Signed-off-by: Andreas Rheinhardt > --- > The spec [1] does not rule out that these values differ on a per-slice > basis; I don't know whether this is even intended (is there a use-case > for this?). > That the slice dimensions needn't be compatible with subsampling is very > weird. I think it is possible for two adjacent slices to set different > values for the same chroma pixel. > > libavcodec/ffv1.h| 2 ++ > libavcodec/ffv1dec.c | 62 > 2 files changed, 42 insertions(+), 22 deletions(-) > > diff --git a/libavcodec/ffv1.h b/libavcodec/ffv1.h > index 147fe7ae16..81cbe8757d 100644 > --- a/libavcodec/ffv1.h > +++ b/libavcodec/ffv1.h > @@ -96,6 +96,8 @@ typedef struct FFV1Context { > struct FFV1Context *fsrc; > > AVFrame *cur; > +int picture_structure; > +AVRational sample_aspect_ratio; > int plane_count; > int ac; ///< 1=range coder <-> 0=golomb rice > int ac_byte_count; ///< number of bytes used for AC > coding > diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c > index 24dfc68ca4..b3481df922 100644 > --- a/libavcodec/ffv1dec.c > +++ b/libavcodec/ffv1dec.c > @@ -165,7 +165,7 @@ static int decode_slice_header(FFV1Context *f, > FFV1Context *fs) > { > RangeCoder *c = &fs->c; > uint8_t state[CONTEXT_SIZE]; > -unsigned ps, i, context_count; > +unsigned i, context_count; > memset(state, 128, sizeof(state)); > > av_assert0(f->version > 2); > @@ -203,26 +203,9 @@ static int decode_slice_header(FFV1Context *f, > FFV1Context *fs) > p->context_count = context_count; > } > > -ps = get_symbol(c, state, 0); > -if (ps == 1) { > -f->cur->interlaced_frame = 1; > -f->cur->top_field_first = 1; > -} else if (ps == 2) { > -f->cur->interlaced_frame = 1; > -f->cur->top_field_first = 0; > -} else if (ps == 3) { > -f->cur->interlaced_frame = 0; > -} > -f->cur->sample_aspect_ratio.num = get_symbol(c, state, 0); > -f->cur->sample_aspect_ratio.den = get_symbol(c, state, 0); > - > -if (av_image_check_sar(f->width, f->height, > - f->cur->sample_aspect_ratio) < 0) { > -av_log(f->avctx, AV_LOG_WARNING, "ignoring invalid SAR: %u/%u\n", > - f->cur->sample_aspect_ratio.num, > - f->cur->sample_aspect_ratio.den); > -f->cur->sample_aspect_ratio = (AVRational){ 0, 1 }; > -} > +fs->picture_structure = get_symbol(c, state, 0); > +fs->sample_aspect_ratio.num = get_symbol(c, state, 0); > +fs->sample_aspect_ratio.den = get_symbol(c, state, 0); > > if (fs->version > 3) { > fs->slice_reset_contexts = get_rac(c, state); > @@ -967,9 +950,44 @@ static int decode_frame(AVCodecContext *avctx, void > *data, int *got_frame, AVPac > > if (f->last_picture.f) > ff_thread_release_buffer(avctx, &f->last_picture); > -if ((ret = av_frame_ref(data, f->picture.f)) < 0) > +p = data; > +if ((ret = av_frame_ref(p, f->picture.f)) < 0) > return ret; > > +if (f->version > 2) { > +AVRational sar = f->slice_context[0]->sample_aspect_ratio; > +int picture_structure; > + > +for (i = f->slice_count - 1; i > 0; i--) > +if (f->slice_context[i]->sample_aspect_ratio.num != sar.num || > +f->slice_context[i]->sample_aspect_ratio.den != sar.den) > +break; > +if (i > 0) { > +av_log(avctx, AV_LOG_WARNING, "ignoring inconsistent SAR\n"); > +
Re: [FFmpeg-devel] [PATCH 03/14] avcodec/ffv1, ffv1dec: Add const where appropriate
On Sat, Apr 24, 2021 at 01:14:35PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/ffv1.c| 4 ++-- > libavcodec/ffv1.h| 4 ++-- > libavcodec/ffv1dec.c | 5 +++-- > 3 files changed, 7 insertions(+), 6 deletions(-) LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Elect your leaders based on what they did after the last election, not based on what they say before an election. 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 05/14] avcodec/ffv1dec: Fix data races emanating from copying whole context
On Sat, Apr 24, 2021 at 01:14:37PM +0200, Andreas Rheinhardt wrote: > When using frame threading, the FFV1 decoder's update_thread_context() > function copies the whole context and afterwards restores some allocated > fields with backups made earlier. Among these fields are the > ThreadFrames and the source context's ThreadFrames can change > concurrently without any synchronization, leading to data races which > are undefined behaviour even if they don't lead to problems in > practice (as the destination's own ThreadFrames are restored directly > thereafter). > > Fix this by only copying the actually needed fields. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/ffv1dec.c | 19 ++- > 1 file changed, 6 insertions(+), 13 deletions(-) LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The misfortune of the wise is better than the prosperity of the fool. -- Epicurus 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 07/14] avcodec/ffv1dec: Don't copy fields unnecessarily
On Sat, Apr 24, 2021 at 01:14:39PM +0200, Andreas Rheinhardt wrote: > Copy slice-only fields only for the slicecontexts and not for the main > contexts in update_thread_context(). The converse is true for e.g. > key_frame_ok which is only used with the main context; when not doing > frame-threaded decoding it is actually only ever set for the main > context, so not setting it for the slice contexts when doing frame > threading is more consistent. > > Signed-off-by: Andreas Rheinhardt > --- > I wonder whether one should use different structures for the main context > and the slice contexts. i think either we should have seperate structs or we should make sure all fields for which it makes sense are sensibly set. droping all code for "unused" fields but leaving the fields there is a bit feeling like placing mines one could step on. That said, spliting the struct seems a reasonable choice assuming this ends up looking nice and clean thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Modern terrorism, a quick summary: Need oil, start war with country that has oil, kill hundread thousand in war. Let country fall into chaos, be surprised about raise of fundamantalists. Drop more bombs, kill more people, be surprised about them taking revenge and drop even more bombs and strip your own citizens of their rights and freedoms. to be continued 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 08/14] avcodec/ffv1dec: Check allocations for failure
On Sat, Apr 24, 2021 at 01:14:40PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/ffv1dec.c | 12 > 1 file changed, 12 insertions(+) LGTM assuming the error path was tested thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Freedom in capitalist society always remains about the same as it was in ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin 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 14/14] avcodec/ffv1: Use av_memdup() instead of av_mallocz()+memcpy()
On Sat, Apr 24, 2021 at 01:14:46PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/ffv1.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is dangerous to be right in matters on which the established authorities are wrong. -- Voltaire 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".
[FFmpeg-devel] [PATCH] libavfilter: Add Documentation to SafeQueue
From: shubhanshu02 Adds documentation to queue.h in libavfilter/dnn Signed-off-by: shubhanshu02 --- libavfilter/dnn/safe_queue.h | 60 1 file changed, 60 insertions(+) diff --git a/libavfilter/dnn/safe_queue.h b/libavfilter/dnn/safe_queue.h index 36d6daabaf..577a02e24d 100644 --- a/libavfilter/dnn/safe_queue.h +++ b/libavfilter/dnn/safe_queue.h @@ -21,16 +21,76 @@ #ifndef AVFILTER_DNN_SAFE_QUEUE_H #define AVFILTER_DNN_SAFE_QUEUE_H +/** + * Double-ended queue with mutex locks ensuring + * data consistency while multithreading. + */ typedef struct SafeQueue SafeQueue; +/** + * @brief Create and initialize a SafeQueue instance. + * + * @return Pointer to the SafeQueue + * @retval NULL if initialization fails + */ SafeQueue *ff_safe_queue_create(void); + +/** + * @brief Destroy the SafeQueue instance. + * It also frees all elements of the queue, + * destroys the mutex and condition variable. + */ void ff_safe_queue_destroy(SafeQueue *sq); +/** + * @brief Return the length of the SafeQueue + */ size_t ff_safe_queue_size(SafeQueue *sq); +/** + * @brief Add data to the head of queue in the + * SafeQueue after locking mutex. After adding + * the data, it signals the condition variable + * and unlocks the mutex. It increases the length + * of queue in the SafeQueue by one. + * + * @param sq pointer to the SafeQueue + * @param v data to be added + * @return The length of the queue + * @retval 0 if the queue is not initialized + * @retval -1 if new entry cannot be created + */ int ff_safe_queue_push_front(SafeQueue *sq, void *v); + +/** + * @brief Add data to the tail of queue in the + * SafeQueue after locking mutex. After adding + * the data, it signals the condition variable + * and unlocks the mutex. It increases the length + * of queue in the SafeQueue by one. + * + * @param sq pointer to the SafeQueue + * @param v data to be added + * @return The length of the queue + * @retval 0 if the queue is not initialized + * @retval -1 if new entry cannot be created + */ int ff_safe_queue_push_back(SafeQueue *sq, void *v); +/** + * @brief Remove and free first element from + * the queue in SafeQueue. Before removing, it + * waits for the condition variable to signal and + * acquires the mutex. Finally, it signals the + * condition and unlocks the mutex. + * It shrinks the length of queue in the SafeQueue + * by one. + * + * @param sq pointer to the SafeQueue. + * @return The value of first element as void. + * If a null pointer or empty queue is passed, + * it returns NULL + */ void *ff_safe_queue_pop_front(SafeQueue *sq); #endif -- 2.27.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] libavfilter: Spelling Correction in OpenVino Backend
Thank you On Sun, Apr 25, 2021 at 6:47 AM Guo, Yejun wrote: > > > > -Original Message- > > From: ffmpeg-devel On Behalf Of > > shubhanshu02 > > Sent: 2021年4月23日 18:57 > > To: ffmpeg-devel@ffmpeg.org > > Cc: shubhanshu02 > > Subject: [FFmpeg-devel] [PATCH] libavfilter: Spelling Correction in > OpenVino > > Backend > > > > Correct Spelling of the word `descibe` to `describe` > > in init_model_ov > > > > Signed-off-by: shubhanshu02 > > --- > > libavfilter/dnn/dnn_backend_openvino.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/libavfilter/dnn/dnn_backend_openvino.c > > b/libavfilter/dnn/dnn_backend_openvino.c > > index 0757727a9c..a8032fe56b 100644 > > --- a/libavfilter/dnn/dnn_backend_openvino.c > > +++ b/libavfilter/dnn/dnn_backend_openvino.c > > @@ -318,7 +318,7 @@ static DNNReturnType init_model_ov(OVModel > > *ov_model, const char *input_name, co > > } > > > > // all models in openvino open model zoo use BGR with range [0.0f, > > 255.0f] as input, > > -// we don't have a AVPixelFormat to descibe it, so we'll use > > AV_PIX_FMT_BGR24 and > > +// we don't have a AVPixelFormat to describe it, so we'll use > > AV_PIX_FMT_BGR24 and > > // ask openvino to do the conversion internally. > > // the current supported SR model (frame processing) is generated > > from tensorflow model, > > // and its input is Y channel as float with range [0.0f, 1.0f], so > do not > > set for this case. > > -- > > LGTM, we can add the file name in the commit log title since only one file > is changed, will modify locally and push soon, thanks. > ___ > 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 05/12] fate-ts-small-demux: convert to ffprobe
Quoting Michael Niedermayer (2021-04-25 11:29:56) > On Sun, Apr 25, 2021 at 09:03:13AM +0200, Anton Khirnov wrote: > > It can handle side data cleanly. > [] > > +stream|index=0|codec_name=h264|profile=578|codec_type=video|codec_tag_string=[27][0][0][0]|codec_tag=0x001b|width=82|height=144|coded_width=82|coded_height=144|closed_captions=0|has_b_frames=0|sample_aspect_ratio=1:1|display_aspect_ratio=41:72|pix_fmt=yuv420p|level=10|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=progressive|refs=1|is_avc=false|nal_length_size=0|id=0x100|r_frame_rate=15/1|avg_frame_rate=15/1|time_base=1/9|start_pts=126000|start_time=1.40|duration_ts=444000|duration=4.93|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=74|extradata_hash=CRC32:e62cae27|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_th > > > > umbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0 > > +format|filename=h264small.ts|nb_streams=1|nb_programs=1|format_name=mpegts|start_time=1.40|duration=4.93|size=16544|bit_rate=26828|probe_score=50 > > It seems something is cuttning long lines The email arrives correctly when I send it directly to myself, so I assume the ML is mangling things. Didn't something similar happen to James recently? -- Anton Khirnov From b183a5c8997d7886072bb9853eea97d1fe51e061 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 24 Apr 2021 16:38:55 +0200 Subject: [PATCH] fate-ts-small-demux: convert to ffprobe It can handle side data cleanly. --- tests/fate/demux.mak | 2 +- tests/ref/fate/ts-small-demux | 229 ++ 2 files changed, 150 insertions(+), 81 deletions(-) diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak index c55488fe61..ac224d6bf4 100644 --- a/tests/fate/demux.mak +++ b/tests/fate/demux.mak @@ -83,7 +83,7 @@ FATE_SAMPLES_DEMUX-$(CONFIG_MPEGTS_DEMUXER) += fate-ts-opus-demux fate-ts-opus-demux: CMD = framecrc -i $(TARGET_SAMPLES)/opus/test-8-7.1.opus-small.ts -c copy FATE_SAMPLES_DEMUX-$(CONFIG_MPEGTS_DEMUXER) += fate-ts-small-demux -fate-ts-small-demux: CMD = framecrc -i $(TARGET_SAMPLES)/mpegts/h264small.ts -c copy +fate-ts-small-demux: CMD = ffprobe_demux $(TARGET_SAMPLES)/mpegts/h264small.ts FATE_SAMPLES_DEMUX-$(CONFIG_MTV_DEMUXER) += fate-mtv fate-mtv: CMD = framecrc -i $(TARGET_SAMPLES)/mtv/comedian_auto-partial.mtv -c copy diff --git a/tests/ref/fate/ts-small-demux b/tests/ref/fate/ts-small-demux index cdd7c09f27..d7167e3c6f 100644 --- a/tests/ref/fate/ts-small-demux +++ b/tests/ref/fate/ts-small-demux @@ -1,80 +1,149 @@ -#extradata 0: 35, 0x83f4073d -#tb 0: 1/9 -#media_type 0: video -#codec_id 0: h264 -#dimensions 0: 82x144 -#sar 0: 1/1 -0, 0, 0, 6000, 1290, 0x4684e0ab, S=1,1, 0x00e000e0 -0, 6000, 6000, 6000, 21, 0x267504dc, F=0x0, S=1,1, 0x00e000e0 -0, 12000, 12000, 6000, 15, 0x0f9402f6, F=0x0, S=1,1, 0x00e000e0 -0, 18000, 18000, 6000, 15, 0x0ff40316, F=0x0, S=1,1, 0x00e000e0 -0, 24000, 24000, 6000, 15, 0x10540336, F=0x0, S=1,1, 0x00e000e0 -0, 3, 3, 6000, 15, 0x10b40356, F=0x0, S=1,1, 0x00e000e0 -0, 36000, 36000, 6000, 15, 0x11140376, F=0x0, S=1,1, 0x00e000e0 -0, 42000, 42000, 6000, 15, 0x11740396, F=0x0, S=1,1, 0x00e000e0 -0, 48000, 48000, 6000, 15, 0x0ed802b7, F=0x0, S=1,1, 0x00e000e0 -0, 54000, 54000, 6000, 15, 0x0f3802d7, F=0x0, S=1,1, 0x00e000e0 -0, 6, 6, 6000, 15, 0x0f9802f7, F=0x0, S=1,1, 0x00e000e0 -0, 66000, 66000, 6000, 15, 0x0ff80317, F=0x0, S=1,1, 0x00e000e0 -0, 72000, 72000, 6000, 15, 0x10580337, F=0x0, S=1,1, 0x00e000e0 -0, 78000, 78000, 6000, 15, 0x10b80357, F=0x0, S=1,1, 0x00e000e0 -0, 84000, 84000, 6000, 15, 0x11180377, F=0x0, S=1,1, 0x00e000e0 -0, 9, 9, 6000, 15, 0x11780397, F=0x0, S=1,1, 0x00e000e0 -0, 96000, 96000, 6000, 15, 0x0ed402b6, F=0x0, S=1,1, 0x00e000e0 -0, 102000, 102000, 6000, 15, 0x0f3402d6, F=0x0, S=1,1, 0x00e000e0 -0, 108000, 108000, 6000, 15, 0x0f9402f6, F=0x0, S=1,1, 0x00e000e0 -0, 114000, 114000, 6000, 15, 0x0ff40316, F=0x0, S=1,1, 0x00e000e0 -0, 12, 12, 60
Re: [FFmpeg-devel] [PATCH 82/87] avformat: remove deprecated AVStream.codec
On 4/24/2021 9:52 AM, Andreas Rheinhardt wrote: James Almer: Signed-off-by: James Almer --- fftools/ffmpeg_opt.c | 13 --- libavformat/avformat.h| 8 +- libavformat/dump.c| 24 -- libavformat/isom.c| 12 +-- libavformat/mov.c | 17 libavformat/movenc.c | 38 + libavformat/mux.c | 27 --- libavformat/sdp.c | 18 - libavformat/segment.c | 6 -- libavformat/utils.c | 164 +- libavformat/version.h | 3 - libavformat/yuv4mpegenc.c | 7 -- 12 files changed, 7 insertions(+), 330 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 28069d45dc..3e307efb16 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -839,13 +839,7 @@ typedef struct AVStream { * encoding: set by the user, replaced by libavformat if left unset */ int id; -#if FF_API_LAVF_AVCTX -/** - * @deprecated use the codecpar struct instead - */ -attribute_deprecated -AVCodecContext *codec; -#endif The documentation of avformat_new_stream() must also be updated. E.g.: "User is required to call avcodec_close() and avformat_free_context() to clean up the allocation by avformat_new_stream()." Will do. Furthermore, the AVCodec parameter is currently only used for the public AVCodecContext that is about to be removed and not the private AVCodecContext, so I wonder whether this should be changed or if we should add a avformat_new_stream2() without this useless parameter. Adding a new public API function just to remove a unused parameter is not a good idea. It's forcing library users to migrate for no gain. And i really dislike functions with a 2 suffix. Any reason it's not being used for the private AVCodecContext, for that matter? + void *priv_data; /** diff --git a/libavformat/utils.c b/libavformat/utils.c index 2f66f539a6..49bf19b2b0 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -158,13 +158,6 @@ int ff_copy_whiteblacklists(AVFormatContext *dst, const AVFormatContext *src) static const AVCodec *find_decoder(AVFormatContext *s, const AVStream *st, enum AVCodecID codec_id) { -#if FF_API_LAVF_AVCTX -FF_DISABLE_DEPRECATION_WARNINGS -if (st->codec->codec) -return st->codec->codec; -FF_ENABLE_DEPRECATION_WARNINGS -#endif - switch (st->codecpar->codec_type) { case AVMEDIA_TYPE_VIDEO: if (s->video_codec)return s->video_codec; @@ -354,12 +347,6 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, st->codecpar->codec_id = fmt_id_type[i].id; st->codecpar->codec_type = fmt_id_type[i].type; st->internal->need_context_update = 1; -#if FF_API_LAVF_AVCTX -FF_DISABLE_DEPRECATION_WARNINGS -st->codec->codec_type = st->codecpar->codec_type; -st->codec->codec_id = st->codecpar->codec_id; -FF_ENABLE_DEPRECATION_WARNINGS -#endif return score; } } @@ -480,15 +467,6 @@ static int update_stream_avctx(AVFormatContext *s) if (ret < 0) return ret; -#if FF_API_LAVF_AVCTX -FF_DISABLE_DEPRECATION_WARNINGS -/* update deprecated public codec context */ -ret = avcodec_parameters_to_context(st->codec, st->codecpar); -if (ret < 0) -return ret; -FF_ENABLE_DEPRECATION_WARNINGS -#endif - st->internal->need_context_update = 0; } return 0; @@ -920,13 +898,6 @@ void ff_compute_frame_duration(AVFormatContext *s, int *pnum, int *pden, AVStrea av_mul_q(av_inv_q(st->internal->avctx->time_base), (AVRational){1, st->internal->avctx->ticks_per_frame}); int frame_size, sample_rate; -#if FF_API_LAVF_AVCTX -FF_DISABLE_DEPRECATION_WARNINGS -if ((!codec_framerate.den || !codec_framerate.num) && st->codec->time_base.den && st->codec->time_base.num) -codec_framerate = av_mul_q(av_inv_q(st->codec->time_base), (AVRational){1, st->codec->ticks_per_frame}); -FF_ENABLE_DEPRECATION_WARNINGS -#endif - *pnum = 0; *pden = 0; switch (st->codecpar->codec_type) { @@ -1547,17 +1518,6 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) return ret; } -#if FF_API_LAVF_AVCTX -FF_DISABLE_DEPRECATION_WARNINGS -/* update deprecated public codec context */ -ret = avcodec_parameters_to_context(st->codec, st->codecpar); -if (ret < 0) { -av_packet_unref(pkt); -return ret; -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif - st->internal->need_context_update = 0; } @@ -1680,10 +1640,6 @@ FF_ENABLE_DEPRECATION_WARNINGS av_opt_set_dict_val(s, "metadata", NULL, AV_OPT_SEARCH_CHILDREN); } -#if FF_API_LAVF_AVCT
[FFmpeg-devel] [PATCH] libavfilter: Add Documentation to Queue
From: shubhanshu02 Adds documentation to queue.h in libavfilter/dnn Signed-off-by: shubhanshu02 --- libavfilter/dnn/queue.h | 75 + 1 file changed, 75 insertions(+) diff --git a/libavfilter/dnn/queue.h b/libavfilter/dnn/queue.h index 4d7121366a..2524d5fa59 100644 --- a/libavfilter/dnn/queue.h +++ b/libavfilter/dnn/queue.h @@ -22,20 +22,95 @@ #ifndef AVFILTER_DNN_QUEUE_H #define AVFILTER_DNN_QUEUE_H +/** + * Linear double-ended data structure + */ typedef struct Queue Queue; +/** + * @brief Create a Queue instance. + * It initializes the length of the Queue as 0. + * + * @return Pointer to the Queue + * @retval NULL if allocation fails + */ Queue *ff_queue_create(void); + +/** + * @brief Destroy the Queue instance. + * It also frees all elements of the Queue. + */ void ff_queue_destroy(Queue *q); +/** + * @brief Return the length of the Queue + */ size_t ff_queue_size(Queue *q); +/** + * @brief Return a pointer to the data + * at the head of the queue. + * + * @retval NULL if null pointer was passed + * or queue is empty + */ void *ff_queue_peek_front(Queue *q); + +/** + * @brief Return a pointer to the data at + * the tail of the queue. + * + * @retval NULL if null pointer was passed + * or queue is empty + */ void *ff_queue_peek_back(Queue *q); +/** + * @brief Add data to the head of the queue. + * It increases the length of Queue by one. + * + * @param q pointer to the Queue. + * @param v data to be added + * @return The length of the Queue + * @retval 0 if the pointer to queue is NULL + * @retval -1 if new entry cannot be created + */ int ff_queue_push_front(Queue *q, void *v); + +/** + * @brief Add data to the tail of the queue. + * It increases the length of Queue by one. + * + * @param q pointer to the Queue + * @param v data to be added + * @return The length of the Queue + * @retval 0 if the pointer to queue is NULL + * @retval -1 if new entry cannot be created + */ int ff_queue_push_back(Queue *q, void *v); +/** + * @brief Remove and free first element from + * the Queue. It shrinks the length of Queue + * by one. + * + * @param q pointer to the Queue. + * @return The value of first element as void. + * If a null pointer or empty queue is passed, + * it returns NULL + */ void *ff_queue_pop_front(Queue *q); + +/** + * @brief Remove and free last element from + * the Queue. It shrinks the length of Queue + * by one. + * + * @param q pointer to the Queue. + * @return The value of last element as void. + * If a null pointer or empty queue is passed, + * it returns NULL + */ void *ff_queue_pop_back(Queue *q); #endif -- 2.27.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] lavc/videotoolboxenc: set DataRateLimits for hevc
On Sun, Apr 25, 2021 at 4:06 AM Zhao Zhili wrote: > From the comment it's not available on old version. It works now > by testing on macOS 11.2.1. There is no document about since when. > So trying to set the configuration and ignore the error for hevc. > --- > libavcodec/videotoolboxenc.c | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c > index 9b7ee6720c..cefd70fa88 100644 > --- a/libavcodec/videotoolboxenc.c > +++ b/libavcodec/videotoolboxenc.c > @@ -1113,8 +1113,8 @@ static int vtenc_create_encoder(AVCodecContext > *avctx, > return AVERROR_EXTERNAL; > } > > -if (vtctx->codec_id == AV_CODEC_ID_H264 && max_rate > 0) { > -// kVTCompressionPropertyKey_DataRateLimits is not available for > HEVC > +if ((vtctx->codec_id == AV_CODEC_ID_H264 || vtctx->codec_id == > AV_CODEC_ID_HEVC) > +&& max_rate > 0) { > bytes_per_second_value = max_rate >> 3; > bytes_per_second = CFNumberCreate(kCFAllocatorDefault, >kCFNumberSInt64Type, > @@ -1152,7 +1152,11 @@ static int vtenc_create_encoder(AVCodecContext > *avctx, > > if (status) { > av_log(avctx, AV_LOG_ERROR, "Error setting max bitrate > property: %d\n", status); > -return AVERROR_EXTERNAL; > +// kVTCompressionPropertyKey_DataRateLimits is available for > HEVC > +// now but not on old release. There is no document about > since > +// when. So ignore the error if it failed for hevc. > +if (vtctx->codec_id != AV_CODEC_ID_HEVC) > +return AVERROR_EXTERNAL; > The failure should be logged. Looks good otherwise. } > } > > -- > 2.31.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.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 05/12] fate-ts-small-demux: convert to ffprobe
On 4/25/2021 11:12 AM, Anton Khirnov wrote: Quoting Michael Niedermayer (2021-04-25 11:29:56) It seems something is cuttning long lines The email arrives correctly when I send it directly to myself, so I assume the ML is mangling things. Didn't something similar happen to James recently? Yeah. Maybe it's only happening with non base64 encoded emails. ___ 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] libavformat/adtsenc: Increase ADTS_MAX_FRAME_BYTES from 8k to 16k
ADTS frames may contain up to 768 bytes per channel. With 16 channels, this is 12k, which cannot fit into the maximum 8k buffer. Signed-off-by: Chris Ribble --- libavformat/adtsenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c index 3595cb3bb2..ae1b1b364c 100644 --- a/libavformat/adtsenc.c +++ b/libavformat/adtsenc.c @@ -44,7 +44,7 @@ typedef struct ADTSContext { uint8_t pce_data[MAX_PCE_SIZE]; } ADTSContext; -#define ADTS_MAX_FRAME_BYTES ((1 << 13) - 1) +#define ADTS_MAX_FRAME_BYTES ((1 << 14) - 1) static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, const uint8_t *buf, int size) { -- 2.26.3 ___ 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] libavformat/adtsenc: Increase ADTS_MAX_FRAME_BYTES from 8k to 16k
Apr 25, 2021, 18:47 by chris.rib...@resi.io: > ADTS frames may contain up to 768 bytes per channel. With 16 channels, > this is 12k, which cannot fit into the maximum 8k buffer. > Math checked out, pushed, thanks. ___ 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] avformat/dashenc: reopen new http session for http_persistent
Fix ticket: 8693 Based on implementation in hlsenc.c Signed-off-by: Chris Ribble --- libavformat/dashenc.c | 67 ++- 1 file changed, 53 insertions(+), 14 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 81a5c2b452..593c416850 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -122,6 +122,7 @@ typedef struct OutputStream { const char *single_file_name; /* file names selected for this particular stream */ const char *init_seg_name; const char *media_seg_name; +uint8_t *temp_buffer; char codec_str[100]; int written_len; @@ -242,12 +243,13 @@ static int dashenc_io_open(AVFormatContext *s, AVIOContext **pb, char *filename, return err; } -static void dashenc_io_close(AVFormatContext *s, AVIOContext **pb, char *filename) { +static int dashenc_io_close(AVFormatContext *s, AVIOContext **pb, char *filename) { DASHContext *c = s->priv_data; int http_base_proto = filename ? ff_is_http_proto(filename) : 0; +int ret = 0; if (!*pb) -return; +return ret; if (!http_base_proto || !c->http_persistent) { ff_format_io_close(s, pb); @@ -257,8 +259,10 @@ static void dashenc_io_close(AVFormatContext *s, AVIOContext **pb, char *filenam av_assert0(http_url_context); avio_flush(*pb); ffurl_shutdown(http_url_context, AVIO_FLAG_WRITE); +ret = ff_http_get_shutdown_status(http_url_context); #endif } +return ret; } static const char *get_format_str(SegmentType segment_type) { @@ -456,33 +460,38 @@ static void set_codec_str(AVFormatContext *s, AVCodecParameters *par, static int flush_dynbuf(DASHContext *c, OutputStream *os, int *range_length) { -uint8_t *buffer; +AVFormatContext *ctx = os->ctx; -if (!os->ctx->pb) { +if (!ctx->pb) { return AVERROR(EINVAL); } // flush -av_write_frame(os->ctx, NULL); -avio_flush(os->ctx->pb); +av_write_frame(ctx, NULL); +avio_flush(ctx->pb); if (!c->single_file) { // write out to file -*range_length = avio_close_dyn_buf(os->ctx->pb, &buffer); -os->ctx->pb = NULL; +*range_length = avio_close_dyn_buf(ctx->pb, &os->temp_buffer); +ctx->pb = NULL; if (os->out) -avio_write(os->out, buffer + os->written_len, *range_length - os->written_len); +avio_write(os->out, os->temp_buffer + os->written_len, *range_length - os->written_len); os->written_len = 0; -av_free(buffer); // re-open buffer -return avio_open_dyn_buf(&os->ctx->pb); +return avio_open_dyn_buf(&ctx->pb); } else { -*range_length = avio_tell(os->ctx->pb) - os->pos; +*range_length = avio_tell(ctx->pb) - os->pos; return 0; } } +static void reflush_dynbuf(OutputStream *os, int *range_length) +{ +// re-open buffer +avio_write(os->out, os->temp_buffer, *range_length);; +} + static void set_http_options(AVDictionary **options, DASHContext *c) { if (c->method) @@ -599,6 +608,7 @@ static int flush_init_segment(AVFormatContext *s, OutputStream *os) int ret, range_length; ret = flush_dynbuf(c, os, &range_length); +av_freep(&os->temp_buffer); if (ret < 0) return ret; @@ -645,6 +655,7 @@ static void dash_free(AVFormatContext *s) av_freep(&os->single_file_name); av_freep(&os->init_seg_name); av_freep(&os->media_seg_name); +av_freep(&os->temp_buffer); } av_freep(&c->streams); @@ -1250,7 +1261,18 @@ static int write_manifest(AVFormatContext *s, int final) avio_printf(out, "\n"); avio_flush(out); -dashenc_io_close(s, &c->mpd_out, temp_filename); +ret = dashenc_io_close(s, &c->mpd_out, temp_filename); +if (ret < 0) { +av_log(s, AV_LOG_WARNING, "upload manifest failed, will retry with a new http session.\n"); +ff_format_io_close(s, &c->mpd_out); + +set_http_options(&opts, c); +dashenc_io_open(s, &c->mpd_out, temp_filename, &opts); +av_dict_free(&opts); + +dashenc_io_close(s, &c->mpd_out, temp_filename); +return ret; +} if (use_rename) { if ((ret = ff_rename(temp_filename, s->url, s)) < 0) @@ -1955,7 +1977,21 @@ static int dash_flush(AVFormatContext *s, int final, int stream) if (c->single_file) { find_index_range(s, os->full_path, os->pos, &index_length); } else { -dashenc_io_close(s, &os->out, os->temp_path); +ret = dashenc_io_close(s, &os->out, os->temp_path); +if (ret < 0) { +AVDictionary *http_opts = NULL; + +av_log(s, AV_LOG_WARNING, "upload segment failed, will retry with a new http session.\n"); +ff_format_io_close(s, &os->out); + +set_http_options(&http_opts, c); +ret = dashenc_i
Re: [FFmpeg-devel] [PATCH 05/12] fate-ts-small-demux: convert to ffprobe
On Sun, Apr 25, 2021 at 04:12:41PM +0200, Anton Khirnov wrote: > Quoting Michael Niedermayer (2021-04-25 11:29:56) > > On Sun, Apr 25, 2021 at 09:03:13AM +0200, Anton Khirnov wrote: > > > It can handle side data cleanly. > > [] > > > +stream|index=0|codec_name=h264|profile=578|codec_type=video|codec_tag_string=[27][0][0][0]|codec_tag=0x001b|width=82|height=144|coded_width=82|coded_height=144|closed_captions=0|has_b_frames=0|sample_aspect_ratio=1:1|display_aspect_ratio=41:72|pix_fmt=yuv420p|level=10|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=progressive|refs=1|is_avc=false|nal_length_size=0|id=0x100|r_frame_rate=15/1|avg_frame_rate=15/1|time_base=1/9|start_pts=126000|start_time=1.40|duration_ts=444000|duration=4.93|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=74|extradata_hash=CRC32:e62cae27|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_th > > > > > > umbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0 > > > +format|filename=h264small.ts|nb_streams=1|nb_programs=1|format_name=mpegts|start_time=1.40|duration=4.93|size=16544|bit_rate=26828|probe_score=50 > > > > It seems something is cuttning long lines > > The email arrives correctly when I send it directly to myself, so I > assume the ML is mangling things. Didn't something similar happen to > James recently? yes, is this a new issue with the servers mail setup or did we just not have so long lines previously ? the length seems truncated around 1000 and smtp_line_length_limit has a default of around that. RFC 5321 also doesnt allow longer lines so iam not sure if bumping that limit up is the correct thing to do (if its that what truncates it) Iam not a mail expert, but naively to me this looks like the sender should use base64 or some other encoding if a long line is encountered Thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Modern terrorism, a quick summary: Need oil, start war with country that has oil, kill hundread thousand in war. Let country fall into chaos, be surprised about raise of fundamantalists. Drop more bombs, kill more people, be surprised about them taking revenge and drop even more bombs and strip your own citizens of their rights and freedoms. to be continued 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".
[FFmpeg-devel] [PATCH 1/6] avformat/subtitles: Check pts difference before use
Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long' Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MPL2_fuzzer-6747053545881600 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/subtitles.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c index 05c07cd852..6368ec74f9 100644 --- a/libavformat/subtitles.c +++ b/libavformat/subtitles.c @@ -206,7 +206,7 @@ void ff_subtitles_queue_finalize(void *log_ctx, FFDemuxSubtitlesQueue *q) q->sort == SUB_SORT_TS_POS ? cmp_pkt_sub_ts_pos : cmp_pkt_sub_pos_ts); for (i = 0; i < q->nb_subs; i++) -if (q->subs[i]->duration < 0 && i < q->nb_subs - 1) +if (q->subs[i]->duration < 0 && i < q->nb_subs - 1 && q->subs[i + 1]->pts - (uint64_t)q->subs[i]->pts <= INT64_MAX) q->subs[i]->duration = q->subs[i + 1]->pts - q->subs[i]->pts; if (!q->keep_duplicates) -- 2.17.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 2/6] avformat/msf: Check that channels doesnt overflow during extradata construction
Fixes: signed integer overflow: 2048 * 1122336 cannot be represented in type 'int' Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MSF_fuzzer-6726959600107520 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/msf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/msf.c b/libavformat/msf.c index 155f488e44..1eaed54357 100644 --- a/libavformat/msf.c +++ b/libavformat/msf.c @@ -70,6 +70,8 @@ static int msf_read_header(AVFormatContext *s) case 4: case 5: case 6: st->codecpar->block_align = (codec == 4 ? 96 : codec == 5 ? 152 : 192) * st->codecpar->channels; +if (st->codecpar->channels > UINT16_MAX / 2048) +return AVERROR_INVALIDDATA; ret = ff_alloc_extradata(st->codecpar, 14); if (ret < 0) return ret; -- 2.17.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 3/6] avformat/nutdec: Check tmp_size
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6739990530883584 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/nutdec.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index d1f3496990..4dd26c50ff 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -286,6 +286,11 @@ static int decode_main_header(NUTContext *nut) ret = AVERROR_INVALIDDATA; goto fail; } +if (tmp_size < 0 || tmp_size > INT_MAX - count) { +av_log(s, AV_LOG_ERROR, "illegal size\n"); +ret = AVERROR_INVALIDDATA; +goto fail; +} for (j = 0; j < count; j++, i++) { if (i == 'N') { -- 2.17.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 5/6] avformat/qcp: Avoid negative nb_rates
Fixes: signed integer overflow: 2 * -1725947872 cannot be represented in type 'int' Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_QCP_fuzzer-6726807632084992 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/qcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/qcp.c b/libavformat/qcp.c index 168030dc16..4478875f2d 100644 --- a/libavformat/qcp.c +++ b/libavformat/qcp.c @@ -93,7 +93,8 @@ static int qcp_read_header(AVFormatContext *s) QCPContext*c = s->priv_data; AVStream *st = avformat_new_stream(s, NULL); uint8_t buf[16]; -int i, nb_rates; +int i; +unsigned nb_rates; if (!st) return AVERROR(ENOMEM); -- 2.17.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 4/6] avformat/pp_bnk: Use 64bit in bitrate computation
Fixes: signed integer overflow: 1207959552 * 4 cannot be represented in type 'int' Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_PP_BNK_fuzzer-6747301169201152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/pp_bnk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/pp_bnk.c b/libavformat/pp_bnk.c index 07eeca3cd5..5ffe733b18 100644 --- a/libavformat/pp_bnk.c +++ b/libavformat/pp_bnk.c @@ -223,7 +223,7 @@ static int pp_bnk_read_header(AVFormatContext *s) par->bits_per_coded_sample = 4; par->bits_per_raw_sample= 16; par->block_align= 1; -par->bit_rate = par->sample_rate * par->bits_per_coded_sample * par->channels; +par->bit_rate = par->sample_rate * (int64_t)par->bits_per_coded_sample * par->channels; avpriv_set_pts_info(st, 64, 1, par->sample_rate); st->start_time = 0; -- 2.17.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 6/6] avformat/realtextdec: Check the pts difference before using it for the duration computation
Fixes: signed integer overflow: 540420 - -9223372031709351616 cannot be represented in type 'long' Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_REALTEXT_fuzzer-6737340551790592 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/realtextdec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/realtextdec.c b/libavformat/realtextdec.c index f534774420..368a741240 100644 --- a/libavformat/realtextdec.c +++ b/libavformat/realtextdec.c @@ -111,10 +111,11 @@ static int realtext_read_header(AVFormatContext *s) if (!merge) { const char *begin = ff_smil_get_attr_ptr(buf.str, "begin"); const char *end = ff_smil_get_attr_ptr(buf.str, "end"); +int64_t endi = end ? read_ts(end) : 0; sub->pos = pos; sub->pts = begin ? read_ts(begin) : 0; -sub->duration = end ? (read_ts(end) - sub->pts) : duration; +sub->duration = (end && endi > sub->pts && endi - (uint64_t)sub->pts <= INT64_MAX) ? endi - sub->pts : duration; } } av_bprint_clear(&buf); -- 2.17.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".
Re: [FFmpeg-devel] [PATCH 05/12] fate-ts-small-demux: convert to ffprobe
On 4/25/2021 4:28 PM, Michael Niedermayer wrote: On Sun, Apr 25, 2021 at 04:12:41PM +0200, Anton Khirnov wrote: Quoting Michael Niedermayer (2021-04-25 11:29:56) It seems something is cuttning long lines The email arrives correctly when I send it directly to myself, so I assume the ML is mangling things. Didn't something similar happen to James recently? yes, is this a new issue with the servers mail setup or did we just not have so long lines previously ? It may be the latter. Commit 461d04d956 by Andreas added new disposition entries to this kind of output, which is a good 100 extra characters per such line. But many of them were already longer than 1000 before it, so i can't say. the length seems truncated around 1000 and smtp_line_length_limit has a default of around that. RFC 5321 also doesnt allow longer lines so iam not sure if bumping that limit up is the correct thing to do (if its that what truncates it) Iam not a mail expert, but naively to me this looks like the sender should use base64 or some other encoding if a long line is encountered Can git send-email be configured for this? Thanks [...] ___ 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 05/12] fate-ts-small-demux: convert to ffprobe
Quoting Michael Niedermayer (2021-04-25 21:28:42) > On Sun, Apr 25, 2021 at 04:12:41PM +0200, Anton Khirnov wrote: > > Quoting Michael Niedermayer (2021-04-25 11:29:56) > > > On Sun, Apr 25, 2021 at 09:03:13AM +0200, Anton Khirnov wrote: > > > > It can handle side data cleanly. > > > [] > > > > +stream|index=0|codec_name=h264|profile=578|codec_type=video|codec_tag_string=[27][0][0][0]|codec_tag=0x001b|width=82|height=144|coded_width=82|coded_height=144|closed_captions=0|has_b_frames=0|sample_aspect_ratio=1:1|display_aspect_ratio=41:72|pix_fmt=yuv420p|level=10|color_range=unknown|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=progressive|refs=1|is_avc=false|nal_length_size=0|id=0x100|r_frame_rate=15/1|avg_frame_rate=15/1|time_base=1/9|start_pts=126000|start_time=1.40|duration_ts=444000|duration=4.93|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=74|extradata_hash=CRC32:e62cae27|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition: timed_th > > > > > > > > umbnails=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0 > > > > +format|filename=h264small.ts|nb_streams=1|nb_programs=1|format_name=mpegts|start_time=1.40|duration=4.93|size=16544|bit_rate=26828|probe_score=50 > > > > > > It seems something is cuttning long lines > > > > The email arrives correctly when I send it directly to myself, so I > > assume the ML is mangling things. Didn't something similar happen to > > James recently? > > yes, is this a new issue with the servers mail setup or did we just not > have so long lines previously ? > > the length seems truncated around 1000 and smtp_line_length_limit has a > default of around that. RFC 5321 also doesnt allow longer lines so iam > not sure if bumping that limit up is the correct thing to do (if its that > what truncates it) > > Iam not a mail expert, but naively to me this looks like the > sender should use base64 or some other encoding if a long line is > encountered The original mail was sent as 'quoted-printable' with "soft" line breaks ([1], section 6.7 (5)) with the actual "physical" lines in the file wrapped to 76 characters as per RFC. The mail that arrived from the list was '7bit', where the line length is indeed limited to 998 characters ([2], section 2.1.1). So it seems likely that the code that adds the mailing list footer is responsible. IMO it should be configured to always add the footer as a separate MIME part rather than mangling the original message body (if it's possible). [1] https://tools.ietf.org/html/rfc2045 [2] https://tools.ietf.org/html/rfc2822 -- 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 v5 1/3] avcodec/adpcmenc: Adds encoder for Westwood ADPCM.
Signed-off-by: Aidan Richmond --- libavcodec/Makefile| 1 + libavcodec/adpcmenc.c | 32 ++-- libavcodec/allcodecs.c | 1 + 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 4a597f727a..fcddde459d 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -898,6 +898,7 @@ OBJS-$(CONFIG_ADPCM_IMA_SMJPEG_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_IMA_WAV_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_IMA_WAV_ENCODER) += adpcmenc.o adpcm_data.o OBJS-$(CONFIG_ADPCM_IMA_WS_DECODER) += adpcm.o adpcm_data.o +OBJS-$(CONFIG_ADPCM_IMA_WS_ENCODER) += adpcmenc.o adpcm_data.o OBJS-$(CONFIG_ADPCM_MS_DECODER) += adpcm.o adpcm_data.o OBJS-$(CONFIG_ADPCM_MS_ENCODER) += adpcmenc.o adpcm_data.o OBJS-$(CONFIG_ADPCM_MTAF_DECODER) += adpcm.o adpcm_data.o diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c index 9dc77d519a..752cae5cf4 100644 --- a/libavcodec/adpcmenc.c +++ b/libavcodec/adpcmenc.c @@ -94,7 +94,8 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx) if (avctx->codec->id == AV_CODEC_ID_ADPCM_IMA_SSI || avctx->codec->id == AV_CODEC_ID_ADPCM_IMA_APM || -avctx->codec->id == AV_CODEC_ID_ADPCM_ARGO) { +avctx->codec->id == AV_CODEC_ID_ADPCM_ARGO|| +avctx->codec->id == AV_CODEC_ID_ADPCM_IMA_WS) { /* * The current trellis implementation doesn't work for extended * runs of samples without periodic resets. Disallow it. @@ -192,6 +193,11 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx) avctx->frame_size = 32; avctx->block_align = 17 * avctx->channels; break; +case AV_CODEC_ID_ADPCM_IMA_WS: +/* each 16 bits sample gives one nibble */ +avctx->frame_size = s->block_size * 2 / avctx->channels; +avctx->block_align = s->block_size; +break; default: return AVERROR(EINVAL); } @@ -594,7 +600,8 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, if (avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_SSI || avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_ALP || -avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_APM) +avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_APM || +avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_WS) pkt_size = (frame->nb_samples * avctx->channels) / 2; else pkt_size = avctx->block_align; @@ -929,6 +936,26 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, flush_put_bits(&pb); break; } +case AV_CODEC_ID_ADPCM_IMA_WS: +{ +PutBitContext pb; +init_put_bits(&pb, dst, pkt_size); + +av_assert0(avctx->trellis == 0); +for (n = frame->nb_samples / 2; n > 0; n--) { +/* stereo: 1 byte (2 samples) for left, 1 byte for right */ +for (ch = 0; ch < avctx->channels; ch++) { +int t1, t2; +t1 = adpcm_ima_compress_sample(&c->status[ch], *samples++); +t2 = adpcm_ima_compress_sample(&c->status[ch], samples[st]); +put_bits(&pb, 4, t2); +put_bits(&pb, 4, t1); +} +samples += avctx->channels; +} +flush_put_bits(&pb); +break; +} default: return AVERROR(EINVAL); } @@ -990,6 +1017,7 @@ ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_ALP, adpcm_ima_alp, sample_fmts, AV_CODEC_ ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt, sample_fmts_p, 0, "ADPCM IMA QuickTime"); ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_SSI, adpcm_ima_ssi, sample_fmts, AV_CODEC_CAP_SMALL_LAST_FRAME, "ADPCM IMA Simon & Schuster Interactive"); ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav, sample_fmts_p, 0, "ADPCM IMA WAV"); +ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_WS, adpcm_ima_ws, sample_fmts, AV_CODEC_CAP_SMALL_LAST_FRAME, "ADPCM IMA Westwood"); ADPCM_ENCODER(AV_CODEC_ID_ADPCM_MS, adpcm_ms, sample_fmts, 0, "ADPCM Microsoft"); ADPCM_ENCODER(AV_CODEC_ID_ADPCM_SWF, adpcm_swf, sample_fmts, 0, "ADPCM Shockwave Flash"); ADPCM_ENCODER(AV_CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha, sample_fmts, 0, "ADPCM Yamaha"); diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 2e9a3581de..b748c9718e 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -645,6 +645,7 @@ extern AVCodec ff_adpcm_ima_ssi_encoder; extern AVCodec ff_adpcm_ima_smjpeg_decoder; extern AVCodec ff_adpcm_ima_wav_encoder; extern AVCodec ff_adpcm_ima_wav_decoder; +extern AVCodec ff_adpcm_ima_ws_encoder; extern AVCodec ff_adpcm_ima_ws_decoder; extern AVCodec ff_adpcm_ms_encoder; extern AVCodec ff_adpcm_ms_decoder; -- 2.16.1.window
[FFmpeg-devel] [PATCH v5 2/3] avformat/westwoodaudenc: Adds muxer for Westwood AUD format.
Format is still used by modders of these old games. Signed-off-by: Aidan Richmond --- libavformat/Makefile | 1 + libavformat/allformats.c | 1 + libavformat/westwood_audenc.c | 141 ++ 3 files changed, 143 insertions(+) create mode 100644 libavformat/westwood_audenc.c diff --git a/libavformat/Makefile b/libavformat/Makefile index bc1ddfa81c..85b5d8e7eb 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -581,6 +581,7 @@ OBJS-$(CONFIG_WEBP_MUXER)+= webpenc.o OBJS-$(CONFIG_WEBVTT_DEMUXER)+= webvttdec.o subtitles.o OBJS-$(CONFIG_WEBVTT_MUXER) += webvttenc.o OBJS-$(CONFIG_WSAUD_DEMUXER) += westwood_aud.o +OBJS-$(CONFIG_WSAUD_MUXER) += westwood_audenc.o OBJS-$(CONFIG_WSD_DEMUXER) += wsddec.o rawdec.o OBJS-$(CONFIG_WSVQA_DEMUXER) += westwood_vqa.o OBJS-$(CONFIG_WTV_DEMUXER) += wtvdec.o wtv_common.o \ diff --git a/libavformat/allformats.c b/libavformat/allformats.c index fa093c7ac2..fe70a1e9a2 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -478,6 +478,7 @@ extern AVOutputFormat ff_webp_muxer; extern AVInputFormat ff_webvtt_demuxer; extern AVOutputFormat ff_webvtt_muxer; extern AVInputFormat ff_wsaud_demuxer; +extern AVOutputFormat ff_wsaud_muxer; extern AVInputFormat ff_wsd_demuxer; extern AVInputFormat ff_wsvqa_demuxer; extern AVInputFormat ff_wtv_demuxer; diff --git a/libavformat/westwood_audenc.c b/libavformat/westwood_audenc.c new file mode 100644 index 00..b95a3a5d72 --- /dev/null +++ b/libavformat/westwood_audenc.c @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2021 Aidan Richmond + * + * 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 + */ + +/** + * @file + * Westwood Studios AUD file muxer + * by Aidan Richmond (aidan...@hotmail.co.uk) + * + * This muxer supports IMA ADPCM packed in westwoods format. + * + * @see http://xhp.xwis.net/documents/aud3.txt + */ + +#include "libavutil/avassert.h" + +#include "avformat.h" +#include "avio_internal.h" +#include "internal.h" +#include + +#define AUD_CHUNK_SIGNATURE 0xDEAF + +typedef struct AUDMuxContext { +int uncomp_size; +int size; +} AUDMuxContext; + +static int wsaud_write_init(AVFormatContext *ctx) +{ +AVStream *st = ctx->streams[0]; +AVIOContext *pb = ctx->pb; + +/* Stream must be seekable to correctly write the file. */ +if (!(pb->seekable & AVIO_SEEKABLE_NORMAL)) { +av_log(ctx->streams[0], AV_LOG_ERROR, "Cannot write Westwood aud to" + " none seekable stream.\n"); +return AVERROR(EINVAL); +} + +if (st->codecpar->codec_id != AV_CODEC_ID_ADPCM_IMA_WS) { +av_log(st, AV_LOG_ERROR, "%s codec not supported for Westwood AUD.\n", + avcodec_get_name(st->codecpar->codec_id)); +return AVERROR(EINVAL); +} + +if (ctx->nb_streams != 1) { +av_log(st, AV_LOG_ERROR, "AUD files have exactly one stream\n"); +return AVERROR(EINVAL); +} + +return 0; +} + +static int wsaud_write_header(AVFormatContext *ctx) +{ +AVStream *st = ctx->streams[0]; +AVIOContext *pb = ctx->pb; +AUDMuxContext *a = ctx->priv_data; +int ret; +unsigned char flags = 0; + +a->uncomp_size = 0; +a->size = 0; + +/* Flag if we have stereo data. */ +if (st->codecpar->channels == 2) +flags |= 1; + +/* This flags that the file contains 16 bit samples rather than 8 bit + since the encoder only encodes 16 bit samples this should be set. */ +if (av_get_bits_per_sample(st->codecpar->codec_id) == 4) +flags |= 2; + +avio_wl16(pb, st->codecpar->sample_rate); +/* We don't know the file size yet, so just zero 8 bytes */ +ffio_fill(pb, 0, 8); +avio_w8(pb, flags); +/* 99 indicates the ADPCM format. Other formats not supported. */ +avio_w8(pb, 99); + +return 0; +} + +static int wsaud_write_packet(AVFormatContext *ctx, AVPacket *pkt) +{ +AVIOContext *pb = ctx->pb; +AUDMuxContext *a = ctx->priv_data; + +av_assert1(pkt->size < UINT16_MAX && (pkt->size * 4) < UINT16_MAX); +/* Assumes ADPCM since this muxer doesn't support SND1 or PCM fo
[FFmpeg-devel] [PATCH v5 3/3] avcodec/adpcm: Fixes output from Westwood ADPCM.
Fixes bug #9198 Signed-off-by: Aidan Richmond --- libavcodec/adpcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index be14607eac..5ec9691001 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -1400,16 +1400,16 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, for (n = nb_samples / 2; n > 0; n--) { int v = bytestream2_get_byteu(&gb); -*smp++ = adpcm_ima_expand_nibble(&c->status[channel], v >> 4 , 3); *smp++ = adpcm_ima_expand_nibble(&c->status[channel], v & 0x0F, 3); +*smp++ = adpcm_ima_expand_nibble(&c->status[channel], v >> 4 , 3); } } } else { for (n = nb_samples / 2; n > 0; n--) { for (channel = 0; channel < avctx->channels; channel++) { int v = bytestream2_get_byteu(&gb); -*samples++ = adpcm_ima_expand_nibble(&c->status[channel], v >> 4 , 3); -samples[st] = adpcm_ima_expand_nibble(&c->status[channel], v & 0x0F, 3); +*samples++ = adpcm_ima_expand_nibble(&c->status[channel], v & 0x0F, 3); +samples[st] = adpcm_ima_expand_nibble(&c->status[channel], v >> 4 , 3); } samples += avctx->channels; } -- 2.16.1.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".
Re: [FFmpeg-devel] [PATCH 05/12] fate-ts-small-demux: convert to ffprobe
Quoting James Almer (2021-04-25 21:43:31) > > > > the length seems truncated around 1000 and smtp_line_length_limit has a > > default of around that. RFC 5321 also doesnt allow longer lines so iam > > not sure if bumping that limit up is the correct thing to do (if its that > > what truncates it) > > > > Iam not a mail expert, but naively to me this looks like the > > sender should use base64 or some other encoding if a long line is > > encountered > > Can git send-email be configured for this? Yes, see --transfer-encoding -- 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] compile errors ffmpeg git
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Just ran into compile issues with vpx 20210423-c1c62 1.10.0-40 and the latest ffmpeg git c9fed043f1. libavutil/x86/tx_float.asm:842: error: symbol `ff_cos_32_float' not defined libavutil/x86/tx_float.asm:803: ... from macro `FFT32_FN' defined here libavutil/x86/x86util.asm:1341: ... from macro `movaps' defined here libavutil/x86/x86util.asm:1325: ... from macro `RUN_AVX_INSTR' defined here libavutil/x86/tx_float.asm:842: error: symbol `ff_cos_32_float' not defined libavutil/x86/tx_float.asm:804: ... from macro `FFT32_FN' defined here libavutil/x86/tx_float.asm:843: error: symbol `ff_cos_32_float' not defined libavutil/x86/tx_float.asm:803: ... from macro `FFT32_FN' defined here libavutil/x86/x86util.asm:1341: ... from macro `movaps' defined here libavutil/x86/x86util.asm:1325: ... from macro `RUN_AVX_INSTR' defined here libavutil/x86/tx_float.asm:843: error: symbol `ff_cos_32_float' not defined libavutil/x86/tx_float.asm:804: ... from macro `FFT32_FN' defined here MAN doc/ffmpeg-codecs.1 libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_32_float' not defined libavutil/x86/tx_float.asm:906: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/x86util.asm:1341: ... from macro `movaps' defined here libavutil/x86/x86util.asm:1325: ... from macro `RUN_AVX_INSTR' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_32_float' not defined libavutil/x86/tx_float.asm:907: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_64_float' not defined libavutil/x86/tx_float.asm:964: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/x86util.asm:1341: ... from macro `movaps' defined here libavutil/x86/x86util.asm:1325: ... from macro `RUN_AVX_INSTR' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_64_float' not defined libavutil/x86/tx_float.asm:965: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_64_float' not defined libavutil/x86/tx_float.asm:971: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:488: ... from macro `SPLIT_RADIX_COMBINE_64' defined here libavutil/x86/x86util.asm:1341: ... from macro `movaps' defined here libavutil/x86/x86util.asm:1325: ... from macro `RUN_AVX_INSTR' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_64_float' not defined libavutil/x86/tx_float.asm:971: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:489: ... from macro `SPLIT_RADIX_COMBINE_64' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_128_float' not defined libavutil/x86/tx_float.asm:992: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_128_float' not defined libavutil/x86/tx_float.asm:993: ... from macro `FFT_SPLIT_RADIX_FN' defined here MAN doc/ffmpeg-bitstream-filters.1 libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_256_float' not defined libavutil/x86/tx_float.asm:1019: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_256_float' not defined libavutil/x86/tx_float.asm:1020: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_512_float' not defined libavutil/x86/tx_float.asm:1047: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_512_float' not defined libavutil/x86/tx_float.asm:1048: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_1024_float' not defined libavutil/x86/tx_float.asm:1082: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_1024_float' not defined libavutil/x86/tx_float.asm:1083: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_2048_float' not defined libavutil/x86/tx_float.asm:1103: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:861: ... from macro `FFT_SPLIT_RADIX_DEF' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_2048_float' not defined libavutil/x86/tx_float.asm:1103: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:862: ... from macro `FFT_SPLIT_RADIX_DEF' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_4096_float' not defined libavutil/x86/tx_float.asm:1104: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:861: ... from macro `FFT_SPLIT_RADIX_DEF' defined here libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_4096_float' not defined libavutil/x86/tx_float.asm:1104: ... from macro `FFT_SPLIT_RADIX_FN' defined here libavutil/x86/tx_float.asm:862: ... from macro `FFT_SPLIT_RADIX_DEF' defined here MAN doc/ffmpeg-formats.1 libavutil/x86/tx_float.asm:1210: error: symbol `ff_cos_8192_floa
Re: [FFmpeg-devel] compile errors ffmpeg git
On 4/25/2021 5:03 PM, Helmut K. C. Tessarek wrote: Just ran into compile issues with vpx 20210423-c1c62 1.10.0-40 and the latest ffmpeg git c9fed043f1. libavutil/x86/tx_float.asm:842: error: symbol `ff_cos_32_float' not defined libavutil/x86/tx_float.asm:803: ... from macro `FFT32_FN' defined here libavutil/x86/x86util.asm:1341: ... from macro `movaps' defined here libavutil/x86/x86util.asm:1325: ... from macro `RUN_AVX_INSTR' defined here Does the attached patch fix this for you? From 960f189453902f30f8167dd0ed8411d5419e694f Mon Sep 17 00:00:00 2001 From: James Almer Date: Sun, 25 Apr 2021 17:26:58 -0300 Subject: [PATCH] x86/tx_float: remove ff_ prefix from external constant tables Might fix compilation with some assemblers Signed-off-by: James Almer --- libavutil/x86/tx_float.asm | 40 +++--- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/libavutil/x86/tx_float.asm b/libavutil/x86/tx_float.asm index 0eb2bf20d6..b71fb49592 100644 --- a/libavutil/x86/tx_float.asm +++ b/libavutil/x86/tx_float.asm @@ -485,8 +485,8 @@ SECTION .text movaps [outq + 10*mmsize], tx1_o0 movaps [outq + 14*mmsize], tx2_o0 -movaps tw_e, [ff_cos_64_float + mmsize] -vperm2f128 tw_o, tw_o, [ff_cos_64_float + 64 - 4*7 - mmsize], 0x23 +movaps tw_e, [cos_64_float + mmsize] +vperm2f128 tw_o, tw_o, [cos_64_float + 64 - 4*7 - mmsize], 0x23 movaps m0, [outq + 1*mmsize] movaps m1, [outq + 3*mmsize] @@ -800,8 +800,8 @@ cglobal fft32_float, 4, 4, 16, ctx, out, in, tmp LOAD64_LUT m2, inq, ctxq, (mmsize/2)*2, tmpq, m12, m13 LOAD64_LUT m3, inq, ctxq, (mmsize/2)*3, tmpq, m14, m15 -movaps m8, [ff_cos_32_float] -vperm2f128 m9, m9, [ff_cos_32_float + 4*8 - 4*7], 0x23 +movaps m8, [cos_32_float] +vperm2f128 m9, m9, [cos_32_float + 4*8 - 4*7], 0x23 FFT16 m0, m1, m2, m3, m10, m11, m12, m13 @@ -858,8 +858,8 @@ ALIGN 16 POP lenq sub outq, (%1*4) + (%1*2) + (%1/2) -lea rtabq, [ff_cos_ %+ %1 %+ _float] -lea itabq, [ff_cos_ %+ %1 %+ _float + %1 - 4*7] +lea rtabq, [cos_ %+ %1 %+ _float] +lea itabq, [cos_ %+ %1 %+ _float + %1 - 4*7] %if %0 > 1 cmp tgtq, %1 @@ -903,8 +903,8 @@ ALIGN 16 LOAD64_LUT m2, inq, lutq, (mmsize/2)*2, tmpq, m12, m13 LOAD64_LUT m3, inq, lutq, (mmsize/2)*3, tmpq, m14, m15 -movaps m8, [ff_cos_32_float] -vperm2f128 m9, m9, [ff_cos_32_float + 32 - 4*7], 0x23 +movaps m8, [cos_32_float] +vperm2f128 m9, m9, [cos_32_float + 32 - 4*7], 0x23 FFT16 m0, m1, m2, m3, m10, m11, m12, m13 @@ -961,8 +961,8 @@ ALIGN 16 FFT16 tx2_e0, tx2_e1, tx2_o0, tx2_o1, tmp1, tmp2, tw_e, tw_o -movaps tw_e, [ff_cos_64_float] -vperm2f128 tw_o, tw_o, [ff_cos_64_float + 64 - 4*7], 0x23 +movaps tw_e, [cos_64_float] +vperm2f128 tw_o, tw_o, [cos_64_float + 64 - 4*7], 0x23 add lutq, (mmsize/2)*8 cmp tgtq, 64 @@ -989,8 +989,8 @@ ALIGN 16 POP lenq sub outq, 24*mmsize -lea rtabq, [ff_cos_128_float] -lea itabq, [ff_cos_128_float + 128 - 4*7] +lea rtabq, [cos_128_float] +lea itabq, [cos_128_float + 128 - 4*7] cmp tgtq, 128 je .deinterleave @@ -1016,8 +1016,8 @@ ALIGN 16 POP lenq sub outq, 48*mmsize -lea rtabq, [ff_cos_256_float] -lea itabq, [ff_cos_256_float + 256 - 4*7] +lea rtabq, [cos_256_float] +lea itabq, [cos_256_float + 256 - 4*7] cmp tgtq, 256 je .deinterleave @@ -1044,8 +1044,8 @@ ALIGN 16 POP lenq sub outq, 96*mmsize -lea rtabq, [ff_cos_512_float] -lea itabq, [ff_cos_512_float + 512 - 4*7] +lea rtabq, [cos_512_float] +lea itabq, [cos_512_float + 512 - 4*7] cmp tgtq, 512 je .deinterleave @@ -1079,8 +1079,8 @@ ALIGN 16 POP lenq sub outq, 192*mmsize -lea rtabq, [ff_cos_1024_float] -lea itabq, [ff_cos_1024_float + 1024 - 4*7] +lea rtabq, [cos_1024_float] +lea itabq, [cos_1024_float + 1024 - 4*7] cmp tgtq, 1024 je .deinterleave @@ -1160,8 +1160,8 @@ FFT_SPLIT_RADIX_DEF 131072 vextractf128 [outq + 13*mmsize + 0], tw_e, 1 vextractf128 [outq + 13*mmsize + 16], tx2_e0, 1 -movaps tw_e, [ff_cos_64_float + mmsize] -vperm2f128 tw_o, tw_o, [ff_cos_64_float + 64 - 4*7 - mmsize], 0x23 +movaps tw_e, [cos_64_float + mmsize] +vperm2f128 tw_o, tw_o, [cos_64_float + 64 - 4*7 - mmsize], 0x23 movaps m0, [outq + 1*mmsize] movaps m1, [outq + 3*mmsize] -- 2.31.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".
Re: [FFmpeg-devel] [PATCH 00/87 v2] Major bump
On 4/19/2021 11:08 AM, James Almer wrote: First version, including the bump notes, is here: https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-April/278670.html Most patches from the first version were already applied. And as mentioned in the discussion there, this set here removes all the deprecated API one by one before the actual major bump commit. This is done to simplify bisecting for potential issues that can be tracked back to one specific removal, instead of to a commit that bumped versions and disabled everything simultaneously. Will rebase and apply soon. ___ 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] compile errors ffmpeg git
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hey James, On 2021-04-25 16:32, James Almer wrote: > Does the attached patch fix this for you? Yes, thanks. The patch works! Cheers, K. C. - -- regards Helmut K. C. Tessarek KeyID 0x172380A011EF4944 Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944 /* Thou shalt not follow the NULL pointer for chaos and madness await thee at its end. */ -BEGIN PGP SIGNATURE- iQIzBAEBCgAdFiEE191csiqpm8f5Ln9WvgmFNJ1E3QAFAmCF17oACgkQvgmFNJ1E 3QDbtQ/+PO0LUeMWQm5y8qXQjyO2pILRW2/pkkj6J1/gYLE4XZfWr+NDXMT4GiT8 Bkt8w9IXaPjWM+wD+ZDjGEczpeBsI1T02L5jgVgq1opDjhhWNs3ZhOD7mt6RwDmO LlCKyQVnPVBtQH+BaHo9wNaQhAnhHN2JGrPz20xMJxmhAvrzHI6YHTXH0AhVqmuW Jx8KuYUyG8QKAfE9S+Jo301vC7M2LAPQclHTeplkZq2WJgX4Ujh5x5FZVjBo41A/ jTfkWiyYYEQNdh+k+FjmTuTbjHSIDKYxMcOHw+gdxk3aY1LTXLG5ANo4nj/eFsRX HpoFgrQspvKs+HVBhj3qWlzV7x+cC/G9Cc2GxPskCiFXKxB05Jd1uFBxRioJWBmm GsAbz0Vq2GbN/kjMH4KBAp9lbgNj4jBH10ZjwJ1pcaIK8uvPliSFqYhDJpJyxl65 TQQOEJaey5JJRPBsB4tlSb4GM1zyFAcYILIIvFbbxSk7stDH0fO+0rKypVHvGxF1 m9Vo3sLQEZ2sGR9gH4mNsCq86JYf1W0TgMihKL105k2wAvoV9CUgpqXGkaMtkhg2 A9A48p05OsiWBHi+VSDTthST3D3TB9kFDl//AykyIXmvoitgFOkL3Wl2krlvBHxb VcTGLkmkDoRVtbk00j0xBO/d25MCgLqZsG5+s73z8JJuMm9B2Nk= =jkL1 -END 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".
[FFmpeg-devel] [PATCH] x86/tx_float: remove ff_ prefix from external constant tables
Fixes compilation with some assemblers. Signed-off-by: James Almer --- libavutil/x86/tx_float.asm | 40 +++--- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/libavutil/x86/tx_float.asm b/libavutil/x86/tx_float.asm index 0eb2bf20d6..b71fb49592 100644 --- a/libavutil/x86/tx_float.asm +++ b/libavutil/x86/tx_float.asm @@ -485,8 +485,8 @@ SECTION .text movaps [outq + 10*mmsize], tx1_o0 movaps [outq + 14*mmsize], tx2_o0 -movaps tw_e, [ff_cos_64_float + mmsize] -vperm2f128 tw_o, tw_o, [ff_cos_64_float + 64 - 4*7 - mmsize], 0x23 +movaps tw_e, [cos_64_float + mmsize] +vperm2f128 tw_o, tw_o, [cos_64_float + 64 - 4*7 - mmsize], 0x23 movaps m0, [outq + 1*mmsize] movaps m1, [outq + 3*mmsize] @@ -800,8 +800,8 @@ cglobal fft32_float, 4, 4, 16, ctx, out, in, tmp LOAD64_LUT m2, inq, ctxq, (mmsize/2)*2, tmpq, m12, m13 LOAD64_LUT m3, inq, ctxq, (mmsize/2)*3, tmpq, m14, m15 -movaps m8, [ff_cos_32_float] -vperm2f128 m9, m9, [ff_cos_32_float + 4*8 - 4*7], 0x23 +movaps m8, [cos_32_float] +vperm2f128 m9, m9, [cos_32_float + 4*8 - 4*7], 0x23 FFT16 m0, m1, m2, m3, m10, m11, m12, m13 @@ -858,8 +858,8 @@ ALIGN 16 POP lenq sub outq, (%1*4) + (%1*2) + (%1/2) -lea rtabq, [ff_cos_ %+ %1 %+ _float] -lea itabq, [ff_cos_ %+ %1 %+ _float + %1 - 4*7] +lea rtabq, [cos_ %+ %1 %+ _float] +lea itabq, [cos_ %+ %1 %+ _float + %1 - 4*7] %if %0 > 1 cmp tgtq, %1 @@ -903,8 +903,8 @@ ALIGN 16 LOAD64_LUT m2, inq, lutq, (mmsize/2)*2, tmpq, m12, m13 LOAD64_LUT m3, inq, lutq, (mmsize/2)*3, tmpq, m14, m15 -movaps m8, [ff_cos_32_float] -vperm2f128 m9, m9, [ff_cos_32_float + 32 - 4*7], 0x23 +movaps m8, [cos_32_float] +vperm2f128 m9, m9, [cos_32_float + 32 - 4*7], 0x23 FFT16 m0, m1, m2, m3, m10, m11, m12, m13 @@ -961,8 +961,8 @@ ALIGN 16 FFT16 tx2_e0, tx2_e1, tx2_o0, tx2_o1, tmp1, tmp2, tw_e, tw_o -movaps tw_e, [ff_cos_64_float] -vperm2f128 tw_o, tw_o, [ff_cos_64_float + 64 - 4*7], 0x23 +movaps tw_e, [cos_64_float] +vperm2f128 tw_o, tw_o, [cos_64_float + 64 - 4*7], 0x23 add lutq, (mmsize/2)*8 cmp tgtq, 64 @@ -989,8 +989,8 @@ ALIGN 16 POP lenq sub outq, 24*mmsize -lea rtabq, [ff_cos_128_float] -lea itabq, [ff_cos_128_float + 128 - 4*7] +lea rtabq, [cos_128_float] +lea itabq, [cos_128_float + 128 - 4*7] cmp tgtq, 128 je .deinterleave @@ -1016,8 +1016,8 @@ ALIGN 16 POP lenq sub outq, 48*mmsize -lea rtabq, [ff_cos_256_float] -lea itabq, [ff_cos_256_float + 256 - 4*7] +lea rtabq, [cos_256_float] +lea itabq, [cos_256_float + 256 - 4*7] cmp tgtq, 256 je .deinterleave @@ -1044,8 +1044,8 @@ ALIGN 16 POP lenq sub outq, 96*mmsize -lea rtabq, [ff_cos_512_float] -lea itabq, [ff_cos_512_float + 512 - 4*7] +lea rtabq, [cos_512_float] +lea itabq, [cos_512_float + 512 - 4*7] cmp tgtq, 512 je .deinterleave @@ -1079,8 +1079,8 @@ ALIGN 16 POP lenq sub outq, 192*mmsize -lea rtabq, [ff_cos_1024_float] -lea itabq, [ff_cos_1024_float + 1024 - 4*7] +lea rtabq, [cos_1024_float] +lea itabq, [cos_1024_float + 1024 - 4*7] cmp tgtq, 1024 je .deinterleave @@ -1160,8 +1160,8 @@ FFT_SPLIT_RADIX_DEF 131072 vextractf128 [outq + 13*mmsize + 0], tw_e, 1 vextractf128 [outq + 13*mmsize + 16], tx2_e0, 1 -movaps tw_e, [ff_cos_64_float + mmsize] -vperm2f128 tw_o, tw_o, [ff_cos_64_float + 64 - 4*7 - mmsize], 0x23 +movaps tw_e, [cos_64_float + mmsize] +vperm2f128 tw_o, tw_o, [cos_64_float + 64 - 4*7 - mmsize], 0x23 movaps m0, [outq + 1*mmsize] movaps m1, [outq + 3*mmsize] -- 2.31.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] avpacket: ABI bump additions
This is the same patch sent in January, rebased on top of the ABI bump patchset. Two additions mirror exactly what AVFrame has - an opaque field and an opaque_ref for user-side private data. For justification on the void *opaque field, you can read the archives, since the question was brought up in January. As for the time_base field, for now, it will only be used to inform the user, and will not alter the behavior of the libraries. That change will come as an optional flag. Patch attached. >From 097aed2ac33dda0bb2052d8b0402711ce95079ba Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 23 Jan 2021 19:56:18 +0100 Subject: [PATCH] avpacket: ABI bump additions --- libavcodec/avpacket.c | 5 + libavcodec/packet.h | 21 + 2 files changed, 26 insertions(+) diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index e32c467586..03b73b3b53 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -382,6 +382,10 @@ int av_packet_copy_props(AVPacket *dst, const AVPacket *src) dst->flags= src->flags; dst->stream_index = src->stream_index; +i = av_buffer_replace(&dst->opaque_ref, src->opaque_ref); +if (i < 0) +return i; + dst->side_data= NULL; dst->side_data_elems = 0; for (i = 0; i < src->side_data_elems; i++) { @@ -403,6 +407,7 @@ int av_packet_copy_props(AVPacket *dst, const AVPacket *src) void av_packet_unref(AVPacket *pkt) { av_packet_free_side_data(pkt); +av_buffer_unref(&pkt->opaque_ref); av_buffer_unref(&pkt->buf); get_packet_defaults(pkt); } diff --git a/libavcodec/packet.h b/libavcodec/packet.h index fad8341c12..c29ad18a2b 100644 --- a/libavcodec/packet.h +++ b/libavcodec/packet.h @@ -383,6 +383,27 @@ typedef struct AVPacket { int64_t duration; int64_t pos;///< byte position in stream, -1 if unknown + +/** + * for some private data of the user + */ +void *opaque; + +/** + * AVBufferRef for free use by the API user. FFmpeg will never check the + * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when + * the packet is unreferenced. av_packet_copy_props() calls create a new + * reference with av_buffer_ref() for the target packet's opaque_ref field. + * + * This is unrelated to the opaque field, although it serves a similar + * purpose. + */ +AVBufferRef *opaque_ref; + +/** + * Time base of the packet's timestamps. + */ +AVRational time_base; } AVPacket; #if FF_API_INIT_PACKET -- 2.31.1.498.g6c1eba8ee3d ___ 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] x86/tx_float: remove ff_ prefix from external constant tables
On 4/25/2021 5:59 PM, James Almer wrote: Fixes compilation with some assemblers. Signed-off-by: James Almer --- libavutil/x86/tx_float.asm | 40 +++--- 1 file changed, 20 insertions(+), 20 deletions(-) Approved by Lynne on IRC, so applied. ___ 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] avfilter/af_adelay: make per channel delay argument an int64_t
On 4/25/2021 6:06 AM, Paul B Mahol wrote: Please apply. Applied it earlier today, but forgot to reply, sorry. ___ 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/34] avcodec/adpcmenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/adpcmenc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c index 9dc77d519a..131e3b3910 100644 --- a/libavcodec/adpcmenc.c +++ b/libavcodec/adpcmenc.c @@ -598,7 +598,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, pkt_size = (frame->nb_samples * avctx->channels) / 2; else pkt_size = avctx->block_align; -if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, pkt_size)) < 0) return ret; dst = avpkt->data; @@ -933,7 +933,6 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return AVERROR(EINVAL); } -avpkt->size = pkt_size; *got_packet_ptr = 1; return 0; } -- 2.27.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/34] avcodec/aptxenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/aptxenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/aptxenc.c b/libavcodec/aptxenc.c index 60de73ec28..886ebe63e6 100644 --- a/libavcodec/aptxenc.c +++ b/libavcodec/aptxenc.c @@ -214,7 +214,7 @@ static int aptx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return ret; output_size = s->block_size * frame->nb_samples/4; -if ((ret = ff_alloc_packet2(avctx, avpkt, output_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, output_size, output_size)) < 0) return ret; for (pos = 0, ipos = 0; pos < output_size; pos += s->block_size, ipos += 4) { -- 2.27.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/34] avcodec/adxenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/adxenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c index 93b902b0e1..fabbc00aa6 100644 --- a/libavcodec/adxenc.c +++ b/libavcodec/adxenc.c @@ -148,7 +148,7 @@ static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, if (!samples) { if (c->eof) return 0; -if ((ret = ff_alloc_packet2(avctx, avpkt, 18, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, 18, 18)) < 0) return ret; c->eof = 1; dst = avpkt->data; @@ -162,7 +162,7 @@ static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, } out_size = BLOCK_SIZE * avctx->channels + !c->header_parsed * HEADER_SIZE; -if ((ret = ff_alloc_packet2(avctx, avpkt, out_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, out_size, out_size)) < 0) return ret; dst = avpkt->data; -- 2.27.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/34] avcodec/bmpenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/bmpenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/bmpenc.c b/libavcodec/bmpenc.c index e829d68475..867a53bd12 100644 --- a/libavcodec/bmpenc.c +++ b/libavcodec/bmpenc.c @@ -118,7 +118,7 @@ FF_ENABLE_DEPRECATION_WARNINGS #define SIZE_BITMAPINFOHEADER 40 hsize = SIZE_BITMAPFILEHEADER + SIZE_BITMAPINFOHEADER + (pal_entries << 2); n_bytes = n_bytes_image + hsize; -if ((ret = ff_alloc_packet2(avctx, pkt, n_bytes, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, n_bytes, n_bytes)) < 0) return ret; buf = pkt->data; bytestream_put_byte(&buf, 'B'); // BITMAPFILEHEADER.bfType -- 2.27.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 05/34] avcodec/dnxhdenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/dnxhdenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index 2461c51727..a896891c69 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -1268,7 +1268,7 @@ static int dnxhd_encode_picture(AVCodecContext *avctx, AVPacket *pkt, int offset, i, ret; uint8_t *buf; -if ((ret = ff_alloc_packet2(avctx, pkt, ctx->frame_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, ctx->frame_size, ctx->frame_size)) < 0) return ret; buf = pkt->data; -- 2.27.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/34] avcodec/g726: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/g726.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/g726.c b/libavcodec/g726.c index 71f5791416..b8df61a157 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -353,7 +353,7 @@ static int g726_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, int i, ret, out_size; out_size = (frame->nb_samples * c->code_size + 7) / 8; -if ((ret = ff_alloc_packet2(avctx, avpkt, out_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, out_size, out_size)) < 0) return ret; init_put_bits(&pb, avpkt->data, avpkt->size); @@ -370,7 +370,6 @@ static int g726_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, flush_put_bits(&pb); } -avpkt->size = out_size; *got_packet_ptr = 1; return 0; } -- 2.27.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/34] avcodec/dpxenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/dpxenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c index a5960334d5..4f2953108a 100644 --- a/libavcodec/dpxenc.c +++ b/libavcodec/dpxenc.c @@ -196,7 +196,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, need_align = size - len; size *= avctx->height; } -if ((ret = ff_alloc_packet2(avctx, pkt, size + HEADER_SIZE, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, size + HEADER_SIZE, +size + HEADER_SIZE)) < 0) return ret; buf = pkt->data; -- 2.27.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/34] avcodec/dvenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/dvenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c index e0679c538c..337bc326ef 100644 --- a/libavcodec/dvenc.c +++ b/libavcodec/dvenc.c @@ -1164,7 +1164,8 @@ static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt, DVVideoContext *s = c->priv_data; int ret; -if ((ret = ff_alloc_packet2(c, pkt, s->sys->frame_size, 0)) < 0) +if ((ret = ff_alloc_packet2(c, pkt, s->sys->frame_size, +s->sys->frame_size)) < 0) return ret; c->pix_fmt= s->sys->pix_fmt; -- 2.27.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/34] avcodec/fitsenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/fitsenc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/fitsenc.c b/libavcodec/fitsenc.c index b44507e436..201604aa59 100644 --- a/libavcodec/fitsenc.c +++ b/libavcodec/fitsenc.c @@ -80,7 +80,8 @@ static int fits_encode_frame(AVCodecContext *avctx, AVPacket *pkt, data_size = (bitpix >> 3) * avctx->height * avctx->width * naxis3; padded_data_size = ((data_size + 2879) / 2880 ) * 2880; -if ((ret = ff_alloc_packet2(avctx, pkt, padded_data_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, padded_data_size, +padded_data_size)) < 0) return ret; bytestream_start = @@ -104,9 +105,7 @@ static int fits_encode_frame(AVCodecContext *avctx, AVPacket *pkt, bytes_left = padded_data_size - data_size; memset(bytestream, 0, bytes_left); -bytestream += bytes_left; -pkt->size = bytestream - bytestream_start; pkt->flags |= AV_PKT_FLAG_KEY; *got_packet = 1; -- 2.27.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/34] avcodec/nellymoserenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/nellymoserenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index 8670431dcc..5b32b4c86d 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -405,7 +405,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, s->last_frame = 1; } -if ((ret = ff_alloc_packet2(avctx, avpkt, NELLY_BLOCK_LEN, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, NELLY_BLOCK_LEN, + NELLY_BLOCK_LEN)) < 0) return ret; encode_block(s, avpkt->data, avpkt->size); -- 2.27.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/34] avcodec/g722enc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/g722enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c index 9e2ebf67c5..7c7caadd48 100644 --- a/libavcodec/g722enc.c +++ b/libavcodec/g722enc.c @@ -346,7 +346,7 @@ static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, int nb_samples, out_size, ret; out_size = (frame->nb_samples + 1) / 2; -if ((ret = ff_alloc_packet2(avctx, avpkt, out_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, out_size, out_size)) < 0) return ret; nb_samples = frame->nb_samples - (frame->nb_samples & 1); -- 2.27.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/34] avcodec/pcm-dvdenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/pcm-dvdenc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/pcm-dvdenc.c b/libavcodec/pcm-dvdenc.c index 97ac778334..1635ac704c 100644 --- a/libavcodec/pcm-dvdenc.c +++ b/libavcodec/pcm-dvdenc.c @@ -119,7 +119,7 @@ static int pcm_dvd_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, PutByteContext pb; int ret; -if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, pkt_size)) < 0) return ret; memcpy(avpkt->data, s->header, 3); @@ -163,7 +163,6 @@ static int pcm_dvd_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, } avpkt->pts = frame->pts; -avpkt->size = pkt_size; avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); *got_packet_ptr = 1; -- 2.27.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 01/34] avcodec/adpcmenc: Avoid copying packet data
On 4/25/2021 7:28 PM, Andreas Rheinhardt wrote: When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. With 4.4 released and the bump about happen, we can start porting all (or most) encoders to get_encode_buffer(). And this one here is a no brainer for that. Signed-off-by: Andreas Rheinhardt --- libavcodec/adpcmenc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c index 9dc77d519a..131e3b3910 100644 --- a/libavcodec/adpcmenc.c +++ b/libavcodec/adpcmenc.c @@ -598,7 +598,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, pkt_size = (frame->nb_samples * avctx->channels) / 2; else pkt_size = avctx->block_align; -if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, pkt_size)) < 0) return ret; dst = avpkt->data; @@ -933,7 +933,6 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return AVERROR(EINVAL); } -avpkt->size = pkt_size; *got_packet_ptr = 1; return 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/34] avcodec/r210enc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/r210enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c index be1943f5f9..079378be18 100644 --- a/libavcodec/r210enc.c +++ b/libavcodec/r210enc.c @@ -46,7 +46,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, uint8_t *srcr_line, *srcg_line, *srcb_line; uint8_t *dst; -if ((ret = ff_alloc_packet2(avctx, pkt, 4 * aligned_width * avctx->height, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, 4 * aligned_width * avctx->height, +4 * aligned_width * avctx->height)) < 0) return ret; srcg_line = pic->data[0]; -- 2.27.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 14/34] avcodec/ra144enc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/ra144enc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c index c6965c5c47..9c8583c68c 100644 --- a/libavcodec/ra144enc.c +++ b/libavcodec/ra144enc.c @@ -444,7 +444,7 @@ static int ra144_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, if (ractx->last_frame) return 0; -if ((ret = ff_alloc_packet2(avctx, avpkt, FRAME_SIZE, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, FRAME_SIZE, FRAME_SIZE)) < 0) return ret; /** @@ -533,7 +533,6 @@ static int ra144_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ff_af_queue_remove(&ractx->afq, avctx->frame_size, &avpkt->pts, &avpkt->duration); -avpkt->size = FRAME_SIZE; *got_packet_ptr = 1; return 0; } -- 2.27.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 15/34] avcodec/roqaudioenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/roqaudioenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/roqaudioenc.c b/libavcodec/roqaudioenc.c index c09212d3d1..d33cb248a0 100644 --- a/libavcodec/roqaudioenc.c +++ b/libavcodec/roqaudioenc.c @@ -154,7 +154,8 @@ static int roq_dpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, else data_size = avctx->channels * avctx->frame_size; -if ((ret = ff_alloc_packet2(avctx, avpkt, ROQ_HEADER_SIZE + data_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, ROQ_HEADER_SIZE + data_size, + ROQ_HEADER_SIZE + data_size)) < 0) return ret; out = avpkt->data; -- 2.27.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 16/34] avcodec/s302menc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/s302menc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/s302menc.c b/libavcodec/s302menc.c index b04a54e482..1dcee7c208 100644 --- a/libavcodec/s302menc.c +++ b/libavcodec/s302menc.c @@ -83,7 +83,7 @@ static int s302m_encode2_frame(AVCodecContext *avctx, AVPacket *avpkt, return AVERROR(EINVAL); } -if ((ret = ff_alloc_packet2(avctx, avpkt, buf_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, buf_size, buf_size)) < 0) return ret; o = avpkt->data; -- 2.27.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 17/34] avcodec/v308enc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/v308enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/v308enc.c b/libavcodec/v308enc.c index 0891251dea..bbaa454880 100644 --- a/libavcodec/v308enc.c +++ b/libavcodec/v308enc.c @@ -44,7 +44,8 @@ static int v308_encode_frame(AVCodecContext *avctx, AVPacket *pkt, uint8_t *y, *u, *v; int i, j, ret; -if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 3, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 3, +avctx->width * avctx->height * 3)) < 0) return ret; dst = pkt->data; -- 2.27.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 18/34] avcodec/v408enc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/v408enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/v408enc.c b/libavcodec/v408enc.c index d2d84d9c40..e29186e275 100644 --- a/libavcodec/v408enc.c +++ b/libavcodec/v408enc.c @@ -39,7 +39,8 @@ static int v408_encode_frame(AVCodecContext *avctx, AVPacket *pkt, uint8_t *y, *u, *v, *a; int i, j, ret; -if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 4, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 4, +avctx->width * avctx->height * 4)) < 0) return ret; dst = pkt->data; -- 2.27.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 19/34] avcodec/xfaceenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/xfaceenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/xfaceenc.c b/libavcodec/xfaceenc.c index dd5bb689c2..4d6087fe17 100644 --- a/libavcodec/xfaceenc.c +++ b/libavcodec/xfaceenc.c @@ -195,7 +195,7 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt, intbuf[i++] = r + XFACE_FIRST_PRINT; } -if ((ret = ff_alloc_packet2(avctx, pkt, i+2, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, i + 2, i + 2)) < 0) return ret; /* revert the number, and close the buffer */ -- 2.27.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 22/34] avcodec/yuv4enc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/yuv4enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/yuv4enc.c b/libavcodec/yuv4enc.c index 63a7fae964..5096f81e1a 100644 --- a/libavcodec/yuv4enc.c +++ b/libavcodec/yuv4enc.c @@ -26,11 +26,12 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet) { +int64_t size = 6 * (avctx->width + 1 >> 1) * (avctx->height + 1 >> 1); uint8_t *dst; uint8_t *y, *u, *v; int i, j, ret; -if ((ret = ff_alloc_packet2(avctx, pkt, 6 * (avctx->width + 1 >> 1) * (avctx->height + 1 >> 1), 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, size, size)) < 0) return ret; dst = pkt->data; -- 2.27.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 20/34] avcodec/xwdenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/xwdenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/xwdenc.c b/libavcodec/xwdenc.c index 81cca6c963..04db2ceabc 100644 --- a/libavcodec/xwdenc.c +++ b/libavcodec/xwdenc.c @@ -147,7 +147,7 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, header_size = XWD_HEADER_SIZE + WINDOW_NAME_SIZE; out_size= header_size + ncolors * XWD_CMAP_SIZE + avctx->height * lsize; -if ((ret = ff_alloc_packet2(avctx, pkt, out_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, out_size, out_size)) < 0) return ret; buf = pkt->data; -- 2.27.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 21/34] avcodec/y41penc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/y41penc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/y41penc.c b/libavcodec/y41penc.c index 4340a3fbba..187c8bf03f 100644 --- a/libavcodec/y41penc.c +++ b/libavcodec/y41penc.c @@ -43,7 +43,8 @@ static int y41p_encode_frame(AVCodecContext *avctx, AVPacket *pkt, uint8_t *y, *u, *v; int i, j, ret; -if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 1.5, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, avctx->width * avctx->height * 1.5, +avctx->width * avctx->height * 1.5)) < 0) return ret; dst = pkt->data; -- 2.27.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 23/34] avcodec/zmbvenc: Simplify setting keyframe flag
Signed-off-by: Andreas Rheinhardt --- libavcodec/zmbvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index 319381dd48..4b3416219b 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -294,10 +294,10 @@ FF_ENABLE_DEPRECATION_WARNINGS *buf++ = c->fmt; // format *buf++ = ZMBV_BLOCK; // block width *buf++ = ZMBV_BLOCK; // block height +pkt->flags |= AV_PKT_FLAG_KEY; } memcpy(buf, c->comp_buf, c->zstream.total_out); -pkt->flags |= AV_PKT_FLAG_KEY*keyframe; *got_packet = 1; return 0; -- 2.27.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 24/34] avcodec/zmbvenc: Avoid copying packet data
Here the packet size is known before allocating the packet because the encoder itself works with an internal buffer, so one can pass this information to ff_alloc_packet2() to avoid the implicit use of another intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/zmbvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index 4b3416219b..8933d06ede 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -281,7 +281,7 @@ FF_ENABLE_DEPRECATION_WARNINGS } pkt_size = c->zstream.total_out + 1 + 6*keyframe; -if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size, pkt_size)) < 0) return ret; buf = pkt->data; -- 2.27.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 25/34] avcodec/libx264: Avoid copying packet data
Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can pass this information to ff_alloc_packet2() to avoid the implicit use of another intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/libx264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 4ddc4973a4..b23471a809 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -144,7 +144,7 @@ static int encode_nals(AVCodecContext *ctx, AVPacket *pkt, for (i = 0; i < nnal; i++) size += nals[i].i_payload; -if ((ret = ff_alloc_packet2(ctx, pkt, size, 0)) < 0) +if ((ret = ff_alloc_packet2(ctx, pkt, size, size)) < 0) return ret; p = pkt->data; -- 2.27.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 26/34] avcodec/libxavs: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- ff_alloc_packet2() call (for the actual packets, not this end-of-stream packet), yet the size known in advance is not exact. libavcodec/libxavs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c index a83b93b836..6be3d02be8 100644 --- a/libavcodec/libxavs.c +++ b/libavcodec/libxavs.c @@ -150,7 +150,7 @@ static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt, if (!ret) { if (!frame && !(x4->end_of_stream)) { -if ((ret = ff_alloc_packet2(avctx, pkt, 4, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, 4, 4)) < 0) return ret; pkt->data[0] = 0x0; -- 2.27.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 27/34] avcodec/libcodec2: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/libcodec2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c index 2164f36051..eadf3285f7 100644 --- a/libavcodec/libcodec2.c +++ b/libavcodec/libcodec2.c @@ -169,7 +169,7 @@ static int libcodec2_encode(AVCodecContext *avctx, AVPacket *avpkt, LibCodec2Context *c2 = avctx->priv_data; int16_t *samples = (int16_t *)frame->data[0]; -int ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align, 0); +int ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align, avctx->block_align); if (ret < 0) { return ret; } -- 2.27.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 28/34] avcodec/libmp3lame: Avoid copying packet data
The libmp3lame encoder already uses an internal buffer, so that the packet size is already known before allocating the packet; therefore one can avoid another (implicit) intermediate buffer by setting the min_size parameter in ff_alloc_packet2(). Signed-off-by: Andreas Rheinhardt --- libavcodec/libmp3lame.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 2beb28e569..bdb69424ee 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -264,7 +264,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ff_dlog(avctx, "in:%d packet-len:%d index:%d\n", avctx->frame_size, len, s->buffer_index); if (len <= s->buffer_index) { -if ((ret = ff_alloc_packet2(avctx, avpkt, len, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, len, len)) < 0) return ret; memcpy(avpkt->data, s->buffer, len); s->buffer_index -= len; @@ -296,7 +296,6 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, AV_WL32(side_data + 4, discard_padding); } -avpkt->size = len; *got_packet_ptr = 1; } return 0; -- 2.27.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 29/34] avcodec/libvorbisenc: Avoid copying packet data
Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can pass this information to ff_alloc_packet2() to avoid the implicit use of another intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/libvorbisenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libvorbisenc.c b/libavcodec/libvorbisenc.c index bf94764954..16b32631c2 100644 --- a/libavcodec/libvorbisenc.c +++ b/libavcodec/libvorbisenc.c @@ -349,7 +349,7 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, av_fifo_generic_read(s->pkt_fifo, &op, sizeof(ogg_packet), NULL); -if ((ret = ff_alloc_packet2(avctx, avpkt, op.bytes, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, op.bytes, op.bytes)) < 0) return ret; av_fifo_generic_read(s->pkt_fifo, avpkt->data, op.bytes, NULL); -- 2.27.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 30/34] avcodec/libvpxenc: Avoid copying packet data
Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can pass this information to ff_alloc_packet2() to avoid the implicit use of another intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- Will get rid of this unnecessary level of indirection in storeframe() after the bump. libavcodec/libvpxenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 3f36943c12..f852642ce8 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -1185,7 +1185,7 @@ static inline void cx_pktcpy(struct FrameListData *dst, static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, AVPacket *pkt) { -int ret = ff_alloc_packet2(avctx, pkt, cx_frame->sz, 0); +int ret = ff_alloc_packet2(avctx, pkt, cx_frame->sz, cx_frame->sz); uint8_t *side_data; if (ret >= 0) { int pict_type; -- 2.27.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 31/34] avcodec/libgsmenc: Avoid copying packet data
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- These encoders have the most unorthodox way of using their private data that I have ever seen. Will fix it later. libavcodec/libgsmenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/libgsmenc.c b/libavcodec/libgsmenc.c index fdb11c705e..eeaa5b2a10 100644 --- a/libavcodec/libgsmenc.c +++ b/libavcodec/libgsmenc.c @@ -98,7 +98,8 @@ static int libgsm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, gsm_signal *samples = (gsm_signal *)frame->data[0]; struct gsm_state *state = avctx->priv_data; -if ((ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align, 0)) < 0) +if ((ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align, + avctx->block_align)) < 0) return ret; switch(avctx->codec_id) { -- 2.27.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 32/34] avcodec/libtheoraenc: Avoid copying packet data
Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can pass this information to ff_alloc_packet2() to avoid the implicit use of another intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/libtheoraenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c index 16966ed433..5dd8c2084f 100644 --- a/libavcodec/libtheoraenc.c +++ b/libavcodec/libtheoraenc.c @@ -339,7 +339,8 @@ static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt, } /* Copy ogg_packet content out to buffer */ -if ((ret = ff_alloc_packet2(avc_context, pkt, o_packet.bytes, 0)) < 0) +if ((ret = ff_alloc_packet2(avc_context, pkt, o_packet.bytes, + o_packet.bytes)) < 0) return ret; memcpy(pkt->data, o_packet.packet, o_packet.bytes); -- 2.27.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 33/34] avcodec/libshine: Avoid copying packet data
The libshine encoder already uses an internal buffer, so that the packet size is already known before allocating the packet; therefore one can avoid another (implicit) intermediate buffer by setting the min_size parameter in ff_alloc_packet2(). Signed-off-by: Andreas Rheinhardt --- libavcodec/libshine.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/libshine.c b/libavcodec/libshine.c index 7056fcd2e3..dcda996ad1 100644 --- a/libavcodec/libshine.c +++ b/libavcodec/libshine.c @@ -102,7 +102,7 @@ static int libshine_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, len = hdr.frame_size; if (len <= s->buffer_index) { -if ((ret = ff_alloc_packet2(avctx, avpkt, len, 0))) +if ((ret = ff_alloc_packet2(avctx, avpkt, len, len))) return ret; memcpy(avpkt->data, s->buffer, len); s->buffer_index -= len; @@ -111,7 +111,6 @@ static int libshine_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts, &avpkt->duration); -avpkt->size = len; *got_packet_ptr = 1; } return 0; -- 2.27.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 34/34] avcodec/libaomenc: Avoid copying packet data
Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can pass this information to ff_alloc_packet2() to avoid the implicit use of another intermediate buffer for the packet data. Signed-off-by: Andreas Rheinhardt --- libavcodec/libaomenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index fcf75e835d..b4198ad903 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -970,7 +970,7 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, { AOMContext *ctx = avctx->priv_data; int av_unused pict_type; -int ret = ff_alloc_packet2(avctx, pkt, cx_frame->sz, 0); +int ret = ff_alloc_packet2(avctx, pkt, cx_frame->sz, cx_frame->sz); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %"SIZE_SPECIFIER".\n", cx_frame->sz); -- 2.27.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] avpacket: ABI bump additions
On Sun, 25 Apr 2021, Lynne wrote: This is the same patch sent in January, rebased on top of the ABI bump patchset. Two additions mirror exactly what AVFrame has - an opaque field and an opaque_ref for user-side private data. For justification on the void *opaque field, you can read the archives, since the question was brought up in January. As for the time_base field, for now, it will only be used to inform the user, and will not alter the behavior of the libraries. That change will come as an optional flag. I would like to see some documentation and code which shows when the time_base is respected and when it is not before it is added to AVPacket. After the bump we usually have a 1-2 months of cooldown when the ABI can change, so there really is no rush. Thanks, Marton ___ 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 6/6] lavfi/dnn_classify: add filter dnn_classify for classification based on detection bounding boxes
> -Original Message- > From: Guo, Yejun > Sent: 2021年4月18日 18:08 > To: ffmpeg-devel@ffmpeg.org > Cc: Guo, Yejun > Subject: [PATCH 6/6] lavfi/dnn_classify: add filter dnn_classify for > classification based on detection bounding boxes > > classification is done on every detection bounding box in frame's side data, > which are the results of object detection (filter dnn_detect). > > Please refer to commit log of dnn_detect for the material for detection, > and see below for classification. > > - download material for classifcation: > wget > https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 > 21.1/emotions-recognition-retail-0003.bin > wget > https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 > 21.1/emotions-recognition-retail-0003.xml > wget > https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 > 21.1/emotions-recognition-retail-0003.label > > - run command as: > ./ffmpeg -i cici.jpg -vf > dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml: > input=data:output=detection_out:confidence=0.6:labels=face-detection-ad > as-0001.label,dnn_classify=dnn_backend=openvino:model=emotions-recog > nition-retail-0003.xml:input=data:output=prob_emotion:confidence=0.3:la > bels=emotions-recognition-retail-0003.label:target=face,showinfo -f null - > > We'll see the detect&classify result as below: > [Parsed_showinfo_2 @ 0x55b7d25e77c0] side data - detection bounding > boxes: > [Parsed_showinfo_2 @ 0x55b7d25e77c0] source: > face-detection-adas-0001.xml, emotions-recognition-retail-0003.xml > [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 0, region: (1005, 813) -> > (1086, 905), label: face, confidence: 1/1. > [Parsed_showinfo_2 @ 0x55b7d25e77c0]classify: label: > happy, confidence: 6757/1. > [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 1, region: (888, 839) -> > (967, 926), label: face, confidence: 6917/1. > [Parsed_showinfo_2 @ 0x55b7d25e77c0]classify: label: > anger, confidence: 4320/1. > > Signed-off-by: Guo, Yejun > --- > configure | 1 + > doc/filters.texi | 36 > libavfilter/Makefile | 1 + > libavfilter/allfilters.c | 1 + > libavfilter/vf_dnn_classify.c | 330 > ++ > 5 files changed, 369 insertions(+) > create mode 100644 libavfilter/vf_dnn_classify.c > > + > +AVFilter ff_vf_dnn_classify = { > +.name = "dnn_classify", > +.description = NULL_IF_CONFIG_SMALL("Apply DNN classify filter > to the input."), > +.priv_size = sizeof(DnnClassifyContext), > +.init = dnn_classify_init, > +.uninit= dnn_classify_uninit, > +.query_formats = dnn_classify_query_formats, > +.inputs= dnn_classify_inputs, > +.outputs = dnn_classify_outputs, > +.priv_class= &dnn_classify_class, > +.activate = dnn_classify_activate, > +}; I've locally added 'const' for AVFilter ff_vf_dnn_classify, any other comment? thanks. ___ 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] avpacket: ABI bump additions
Lynne: > From 097aed2ac33dda0bb2052d8b0402711ce95079ba Mon Sep 17 00:00:00 2001 > From: Lynne > Date: Sat, 23 Jan 2021 19:56:18 +0100 > Subject: [PATCH] avpacket: ABI bump additions > > --- > libavcodec/avpacket.c | 5 + > libavcodec/packet.h | 21 + > 2 files changed, 26 insertions(+) > > diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c > index e32c467586..03b73b3b53 100644 > --- a/libavcodec/avpacket.c > +++ b/libavcodec/avpacket.c > @@ -382,6 +382,10 @@ int av_packet_copy_props(AVPacket *dst, const AVPacket > *src) > dst->flags= src->flags; > dst->stream_index = src->stream_index; > > +i = av_buffer_replace(&dst->opaque_ref, src->opaque_ref); > +if (i < 0) > +return i; 1. Don't use i here; add a new variable. 2. Up until now, av_packet_ref() and av_packet_copy_props() treat the destination packet as uninitialized and make no attempt at unreferencing its content; yet you try to reuse opaque_ref. Even worse, you might return potentially dangerous packets: If the properties were uninitialized and av_packet_copy_props() failed, then the caller were not allowed to unreference the packet even when the non-properties were set to sane values. The easiest way to fix this is to move setting opaque ref to the place after initializing side_data below and either set dst->opaque_ref to NULL before av_buffer_replace() or to not use av_buffer_replace(). It may also be best to unref it again if copying side data fails. > + > dst->side_data= NULL; > dst->side_data_elems = 0; > for (i = 0; i < src->side_data_elems; i++) { > @@ -403,6 +407,7 @@ int av_packet_copy_props(AVPacket *dst, const AVPacket > *src) > void av_packet_unref(AVPacket *pkt) > { > av_packet_free_side_data(pkt); > +av_buffer_unref(&pkt->opaque_ref); > av_buffer_unref(&pkt->buf); > get_packet_defaults(pkt); > } > diff --git a/libavcodec/packet.h b/libavcodec/packet.h > index fad8341c12..c29ad18a2b 100644 > --- a/libavcodec/packet.h > +++ b/libavcodec/packet.h > @@ -383,6 +383,27 @@ typedef struct AVPacket { > int64_t duration; > > int64_t pos;///< byte position in stream, -1 > if unknown > + > +/** > + * for some private data of the user > + */ > +void *opaque; The corresponding AVFrame field is copied when copying props. > + > +/** > + * AVBufferRef for free use by the API user. FFmpeg will never check the > + * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when > + * the packet is unreferenced. av_packet_copy_props() calls create a new > + * reference with av_buffer_ref() for the target packet's opaque_ref > field. > + * > + * This is unrelated to the opaque field, although it serves a similar > + * purpose. > + */ > +AVBufferRef *opaque_ref; > + > +/** > + * Time base of the packet's timestamps. > + */ > +AVRational time_base; > } AVPacket; > > #if FF_API_INIT_PACKET ___ 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 6/6] lavfi/dnn_classify: add filter dnn_classify for classification based on detection bounding boxes
Guo, Yejun: > > >> -Original Message- >> From: Guo, Yejun >> Sent: 2021年4月18日 18:08 >> To: ffmpeg-devel@ffmpeg.org >> Cc: Guo, Yejun >> Subject: [PATCH 6/6] lavfi/dnn_classify: add filter dnn_classify for >> classification based on detection bounding boxes >> >> classification is done on every detection bounding box in frame's side data, >> which are the results of object detection (filter dnn_detect). >> >> Please refer to commit log of dnn_detect for the material for detection, >> and see below for classification. >> >> - download material for classifcation: >> wget >> https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 >> 21.1/emotions-recognition-retail-0003.bin >> wget >> https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 >> 21.1/emotions-recognition-retail-0003.xml >> wget >> https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 >> 21.1/emotions-recognition-retail-0003.label >> >> - run command as: >> ./ffmpeg -i cici.jpg -vf >> dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml: >> input=data:output=detection_out:confidence=0.6:labels=face-detection-ad >> as-0001.label,dnn_classify=dnn_backend=openvino:model=emotions-recog >> nition-retail-0003.xml:input=data:output=prob_emotion:confidence=0.3:la >> bels=emotions-recognition-retail-0003.label:target=face,showinfo -f null - >> >> We'll see the detect&classify result as below: >> [Parsed_showinfo_2 @ 0x55b7d25e77c0] side data - detection bounding >> boxes: >> [Parsed_showinfo_2 @ 0x55b7d25e77c0] source: >> face-detection-adas-0001.xml, emotions-recognition-retail-0003.xml >> [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 0, region: (1005, 813) -> >> (1086, 905), label: face, confidence: 1/1. >> [Parsed_showinfo_2 @ 0x55b7d25e77c0]classify: label: >> happy, confidence: 6757/1. >> [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 1, region: (888, 839) -> >> (967, 926), label: face, confidence: 6917/1. >> [Parsed_showinfo_2 @ 0x55b7d25e77c0]classify: label: >> anger, confidence: 4320/1. >> >> Signed-off-by: Guo, Yejun >> --- >> configure | 1 + >> doc/filters.texi | 36 >> libavfilter/Makefile | 1 + >> libavfilter/allfilters.c | 1 + >> libavfilter/vf_dnn_classify.c | 330 >> ++ >> 5 files changed, 369 insertions(+) >> create mode 100644 libavfilter/vf_dnn_classify.c >> >> + >> +AVFilter ff_vf_dnn_classify = { >> +.name = "dnn_classify", >> +.description = NULL_IF_CONFIG_SMALL("Apply DNN classify filter >> to the input."), >> +.priv_size = sizeof(DnnClassifyContext), >> +.init = dnn_classify_init, >> +.uninit= dnn_classify_uninit, >> +.query_formats = dnn_classify_query_formats, >> +.inputs= dnn_classify_inputs, >> +.outputs = dnn_classify_outputs, >> +.priv_class= &dnn_classify_class, >> +.activate = dnn_classify_activate, >> +}; > > I've locally added 'const' for AVFilter ff_vf_dnn_classify, any other > comment? thanks. > If you did this, then this filter may only be added after the bump. - 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 v5 3/3] avcodec/adpcm: Fixes output from Westwood ADPCM.
On 26/4/21 6:00 am, Aidan Richmond wrote: Patch 1/3: lgtm Patch 2/3: +static int wsaud_write_init(AVFormatContext *ctx) +{ +AVStream *st = ctx->streams[0]; +AVIOContext *pb = ctx->pb; + +/* Stream must be seekable to correctly write the file. */ +if (!(pb->seekable & AVIO_SEEKABLE_NORMAL)) { +av_log(ctx->streams[0], AV_LOG_ERROR, "Cannot write Westwood aud to" + " none seekable stream.\n"); +return AVERROR(EINVAL); +} + Typo, Non-seekable? And capitalise aud -> AUD to be consistent. Patch 3/3: Fixes bug #9198 Signed-off-by: Aidan Richmond --- libavcodec/adpcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index be14607eac..5ec9691001 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -1400,16 +1400,16 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, for (n = nb_samples / 2; n > 0; n--) { int v = bytestream2_get_byteu(&gb); -*smp++ = adpcm_ima_expand_nibble(&c->status[channel], v >> 4 , 3); *smp++ = adpcm_ima_expand_nibble(&c->status[channel], v & 0x0F, 3); +*smp++ = adpcm_ima_expand_nibble(&c->status[channel], v >> 4 , 3); } } } else { for (n = nb_samples / 2; n > 0; n--) { for (channel = 0; channel < avctx->channels; channel++) { int v = bytestream2_get_byteu(&gb); -*samples++ = adpcm_ima_expand_nibble(&c->status[channel], v >> 4 , 3); -samples[st] = adpcm_ima_expand_nibble(&c->status[channel], v & 0x0F, 3); +*samples++ = adpcm_ima_expand_nibble(&c->status[channel], v & 0x0F, 3); +samples[st] = adpcm_ima_expand_nibble(&c->status[channel], v >> 4 , 3); } samples += avctx->channels; } As Andreas said in the previous patch, you need to update the FATE test. If it's easier (and with your permission), I can just do this and squash it into the commit before I apply it. Might as well fix the typo in 2/3 too. See https://github.com/vs49688/FFmpeg/commit/806f982ca2c310d6d639a3e554735b41b67c9259.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".
Re: [FFmpeg-devel] [PATCH 6/6] lavfi/dnn_classify: add filter dnn_classify for classification based on detection bounding boxes
> -Original Message- > From: ffmpeg-devel On Behalf Of > Andreas Rheinhardt > Sent: 2021年4月26日 9:34 > To: ffmpeg-devel@ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH 6/6] lavfi/dnn_classify: add filter > dnn_classify for classification based on detection bounding boxes > > Guo, Yejun: > > > > > >> -Original Message- > >> From: Guo, Yejun > >> Sent: 2021年4月18日 18:08 > >> To: ffmpeg-devel@ffmpeg.org > >> Cc: Guo, Yejun > >> Subject: [PATCH 6/6] lavfi/dnn_classify: add filter dnn_classify for > >> classification based on detection bounding boxes > >> > >> classification is done on every detection bounding box in frame's side > data, > >> which are the results of object detection (filter dnn_detect). > >> > >> Please refer to commit log of dnn_detect for the material for detection, > >> and see below for classification. > >> > >> - download material for classifcation: > >> wget > >> > https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 > >> 21.1/emotions-recognition-retail-0003.bin > >> wget > >> > https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 > >> 21.1/emotions-recognition-retail-0003.xml > >> wget > >> > https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 > >> 21.1/emotions-recognition-retail-0003.label > >> > >> - run command as: > >> ./ffmpeg -i cici.jpg -vf > >> > dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml: > >> > input=data:output=detection_out:confidence=0.6:labels=face-detection-ad > >> > as-0001.label,dnn_classify=dnn_backend=openvino:model=emotions-recog > >> > nition-retail-0003.xml:input=data:output=prob_emotion:confidence=0.3:la > >> bels=emotions-recognition-retail-0003.label:target=face,showinfo -f null > - > >> > >> We'll see the detect&classify result as below: > >> [Parsed_showinfo_2 @ 0x55b7d25e77c0] side data - detection > bounding > >> boxes: > >> [Parsed_showinfo_2 @ 0x55b7d25e77c0] source: > >> face-detection-adas-0001.xml, emotions-recognition-retail-0003.xml > >> [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 0, region: (1005, 813) > -> > >> (1086, 905), label: face, confidence: 1/1. > >> [Parsed_showinfo_2 @ 0x55b7d25e77c0]classify: label: > >> happy, confidence: 6757/1. > >> [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 1, region: (888, 839) > -> > >> (967, 926), label: face, confidence: 6917/1. > >> [Parsed_showinfo_2 @ 0x55b7d25e77c0]classify: label: > >> anger, confidence: 4320/1. > >> > >> Signed-off-by: Guo, Yejun > >> --- > >> configure | 1 + > >> doc/filters.texi | 36 > >> libavfilter/Makefile | 1 + > >> libavfilter/allfilters.c | 1 + > >> libavfilter/vf_dnn_classify.c | 330 > >> ++ > >> 5 files changed, 369 insertions(+) > >> create mode 100644 libavfilter/vf_dnn_classify.c > >> > >> + > >> +AVFilter ff_vf_dnn_classify = { > >> +.name = "dnn_classify", > >> +.description = NULL_IF_CONFIG_SMALL("Apply DNN classify > filter > >> to the input."), > >> +.priv_size = sizeof(DnnClassifyContext), > >> +.init = dnn_classify_init, > >> +.uninit= dnn_classify_uninit, > >> +.query_formats = dnn_classify_query_formats, > >> +.inputs= dnn_classify_inputs, > >> +.outputs = dnn_classify_outputs, > >> +.priv_class= &dnn_classify_class, > >> +.activate = dnn_classify_activate, > >> +}; > > > > I've locally added 'const' for AVFilter ff_vf_dnn_classify, any other > comment? thanks. > > > If you did this, then this filter may only be added after the bump. thanks, I'll remove/add 'const' by checking the bump when it can be pushed. btw, any rough estimate when the bump will happen? thanks. ___ 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 6/6] lavfi/dnn_classify: add filter dnn_classify for classification based on detection bounding boxes
Guo, Yejun: > > >> -Original Message- >> From: ffmpeg-devel On Behalf Of >> Andreas Rheinhardt >> Sent: 2021年4月26日 9:34 >> To: ffmpeg-devel@ffmpeg.org >> Subject: Re: [FFmpeg-devel] [PATCH 6/6] lavfi/dnn_classify: add filter >> dnn_classify for classification based on detection bounding boxes >> >> Guo, Yejun: >>> >>> -Original Message- From: Guo, Yejun Sent: 2021年4月18日 18:08 To: ffmpeg-devel@ffmpeg.org Cc: Guo, Yejun Subject: [PATCH 6/6] lavfi/dnn_classify: add filter dnn_classify for classification based on detection bounding boxes classification is done on every detection bounding box in frame's side >> data, which are the results of object detection (filter dnn_detect). Please refer to commit log of dnn_detect for the material for detection, and see below for classification. - download material for classifcation: wget >> https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 21.1/emotions-recognition-retail-0003.bin wget >> https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 21.1/emotions-recognition-retail-0003.xml wget >> https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 21.1/emotions-recognition-retail-0003.label - run command as: ./ffmpeg -i cici.jpg -vf >> dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml: >> input=data:output=detection_out:confidence=0.6:labels=face-detection-ad >> as-0001.label,dnn_classify=dnn_backend=openvino:model=emotions-recog >> nition-retail-0003.xml:input=data:output=prob_emotion:confidence=0.3:la bels=emotions-recognition-retail-0003.label:target=face,showinfo -f null >> - We'll see the detect&classify result as below: [Parsed_showinfo_2 @ 0x55b7d25e77c0] side data - detection >> bounding boxes: [Parsed_showinfo_2 @ 0x55b7d25e77c0] source: face-detection-adas-0001.xml, emotions-recognition-retail-0003.xml [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 0, region: (1005, 813) >> -> (1086, 905), label: face, confidence: 1/1. [Parsed_showinfo_2 @ 0x55b7d25e77c0]classify: label: happy, confidence: 6757/1. [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 1, region: (888, 839) >> -> (967, 926), label: face, confidence: 6917/1. [Parsed_showinfo_2 @ 0x55b7d25e77c0]classify: label: anger, confidence: 4320/1. Signed-off-by: Guo, Yejun --- configure | 1 + doc/filters.texi | 36 libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_dnn_classify.c | 330 ++ 5 files changed, 369 insertions(+) create mode 100644 libavfilter/vf_dnn_classify.c + +AVFilter ff_vf_dnn_classify = { +.name = "dnn_classify", +.description = NULL_IF_CONFIG_SMALL("Apply DNN classify >> filter to the input."), +.priv_size = sizeof(DnnClassifyContext), +.init = dnn_classify_init, +.uninit= dnn_classify_uninit, +.query_formats = dnn_classify_query_formats, +.inputs= dnn_classify_inputs, +.outputs = dnn_classify_outputs, +.priv_class= &dnn_classify_class, +.activate = dnn_classify_activate, +}; >>> >>> I've locally added 'const' for AVFilter ff_vf_dnn_classify, any other >> comment? thanks. >>> >> If you did this, then this filter may only be added after the bump. > > thanks, I'll remove/add 'const' by checking the bump when it can be pushed. > > btw, any rough estimate when the bump will happen? thanks. > Really soon if no issues are detected any more. Probably done in two days. - 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 6/6] lavfi/dnn_classify: add filter dnn_classify for classification based on detection bounding boxes
> -Original Message- > From: ffmpeg-devel On Behalf Of > Andreas Rheinhardt > Sent: 2021年4月26日 10:15 > To: ffmpeg-devel@ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH 6/6] lavfi/dnn_classify: add filter > dnn_classify for classification based on detection bounding boxes > > Guo, Yejun: > > > > > >> -Original Message- > >> From: ffmpeg-devel On Behalf Of > >> Andreas Rheinhardt > >> Sent: 2021年4月26日 9:34 > >> To: ffmpeg-devel@ffmpeg.org > >> Subject: Re: [FFmpeg-devel] [PATCH 6/6] lavfi/dnn_classify: add filter > >> dnn_classify for classification based on detection bounding boxes > >> > >> Guo, Yejun: > >>> > >>> > -Original Message- > From: Guo, Yejun > Sent: 2021年4月18日 18:08 > To: ffmpeg-devel@ffmpeg.org > Cc: Guo, Yejun > Subject: [PATCH 6/6] lavfi/dnn_classify: add filter dnn_classify for > classification based on detection bounding boxes > > classification is done on every detection bounding box in frame's side > >> data, > which are the results of object detection (filter dnn_detect). > > Please refer to commit log of dnn_detect for the material for > detection, > and see below for classification. > > - download material for classifcation: > wget > > >> > https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 > 21.1/emotions-recognition-retail-0003.bin > wget > > >> > https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 > 21.1/emotions-recognition-retail-0003.xml > wget > > >> > https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/20 > 21.1/emotions-recognition-retail-0003.label > > - run command as: > ./ffmpeg -i cici.jpg -vf > > >> > dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml: > > >> > input=data:output=detection_out:confidence=0.6:labels=face-detection-ad > > >> > as-0001.label,dnn_classify=dnn_backend=openvino:model=emotions-recog > > >> > nition-retail-0003.xml:input=data:output=prob_emotion:confidence=0.3:la > bels=emotions-recognition-retail-0003.label:target=face,showinfo -f > null > >> - > > We'll see the detect&classify result as below: > [Parsed_showinfo_2 @ 0x55b7d25e77c0] side data - detection > >> bounding > boxes: > [Parsed_showinfo_2 @ 0x55b7d25e77c0] source: > face-detection-adas-0001.xml, emotions-recognition-retail-0003.xml > [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 0, region: (1005, > 813) > >> -> > (1086, 905), label: face, confidence: 1/1. > [Parsed_showinfo_2 @ 0x55b7d25e77c0]classify: > label: > happy, confidence: 6757/1. > [Parsed_showinfo_2 @ 0x55b7d25e77c0] index: 1, region: (888, 839) > >> -> > (967, 926), label: face, confidence: 6917/1. > [Parsed_showinfo_2 @ 0x55b7d25e77c0]classify: > label: > anger, confidence: 4320/1. > > Signed-off-by: Guo, Yejun > --- > configure | 1 + > doc/filters.texi | 36 > libavfilter/Makefile | 1 + > libavfilter/allfilters.c | 1 + > libavfilter/vf_dnn_classify.c | 330 > ++ > 5 files changed, 369 insertions(+) > create mode 100644 libavfilter/vf_dnn_classify.c > > + > +AVFilter ff_vf_dnn_classify = { > +.name = "dnn_classify", > +.description = NULL_IF_CONFIG_SMALL("Apply DNN classify > >> filter > to the input."), > +.priv_size = sizeof(DnnClassifyContext), > +.init = dnn_classify_init, > +.uninit= dnn_classify_uninit, > +.query_formats = dnn_classify_query_formats, > +.inputs= dnn_classify_inputs, > +.outputs = dnn_classify_outputs, > +.priv_class= &dnn_classify_class, > +.activate = dnn_classify_activate, > +}; > >>> > >>> I've locally added 'const' for AVFilter ff_vf_dnn_classify, any other > >> comment? thanks. > >>> > >> If you did this, then this filter may only be added after the bump. > > > > thanks, I'll remove/add 'const' by checking the bump when it can be > pushed. > > > > btw, any rough estimate when the bump will happen? thanks. > > > Really soon if no issues are detected any more. Probably done in two days. nice, I'll wait for it, thanks. ___ 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] libavfilter: Add Documentation to SafeQueue
> -Original Message- > From: ffmpeg-devel On Behalf Of > Shubhanshu Saxena > Sent: 2021年4月25日 21:19 > To: ffmpeg-devel@ffmpeg.org > Cc: shubhanshu02 > Subject: [FFmpeg-devel] [PATCH] libavfilter: Add Documentation to > SafeQueue > > From: shubhanshu02 > > Adds documentation to queue.h in libavfilter/dnn > > Signed-off-by: shubhanshu02 > --- > libavfilter/dnn/safe_queue.h | 60 > > 1 file changed, 60 insertions(+) > > diff --git a/libavfilter/dnn/safe_queue.h b/libavfilter/dnn/safe_queue.h > index 36d6daabaf..577a02e24d 100644 > --- a/libavfilter/dnn/safe_queue.h > +++ b/libavfilter/dnn/safe_queue.h please change the commit title as below and send out v2 patch. lavfi/dnn/safe_queue.h: Add Documentation to SafeQueue and the same change for the other patch for queue.h ___ 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/qsvdec: reinit decoder according to decode() return value
From: "Chen,Wenbin" FFmpeg-qsv decoder reinit codec when width and height change, but there are not only resolution change need to reinit codec. I change it to use return value from DecodeFrameAsync() to decide whether decoder need to be reinitialized. Signed-off-by Wenbin Chen Signed-off-by Guangxin Xu --- libavcodec/qsvdec.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 5f2e641373..88232f5d8d 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -481,6 +481,13 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q, } while (ret == MFX_WRN_DEVICE_BUSY || ret == MFX_ERR_MORE_SURFACE); +if (ret == MFX_ERR_INCOMPATIBLE_VIDEO_PARAM) { +q->reinit_flag = 1; +av_log(avctx, AV_LOG_DEBUG, "Video parameter change\n"); +av_freep(&sync); +return 0; +} + if (ret != MFX_ERR_NONE && ret != MFX_ERR_MORE_DATA && ret != MFX_WRN_VIDEO_PARAM_CHANGED && @@ -632,9 +639,9 @@ static int qsv_process_data(AVCodecContext *avctx, QSVContext *q, ret = qsv_decode_header(avctx, q, pkt, pix_fmt, ¶m); -if (ret >= 0 && (q->orig_pix_fmt != ff_qsv_map_fourcc(param.mfx.FrameInfo.FourCC) || +if (q->reinit_flag || (ret >= 0 && (q->orig_pix_fmt != ff_qsv_map_fourcc(param.mfx.FrameInfo.FourCC) || avctx->coded_width != param.mfx.FrameInfo.Width || -avctx->coded_height != param.mfx.FrameInfo.Height)) { +avctx->coded_height != param.mfx.FrameInfo.Height))) { AVPacket zero_pkt = {0}; if (q->buffered_count) { -- 2.25.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 2/3] libavcodec/qsvdec: remove redundant decodeHeader()
From: "Chen,Wenbin" Since ffmpeg-qsv uses return value to reinit decoder, it doesn't need to decode header each time. Move qsv_decode_header's position so that it will be called only if codec needed to be reinitialized. Rearrange the code of flushing decoder and re-init decoder operation. Remove the buffer_count and use the got_frame to decide whether the decoder is drain. Signed-off-by: Wenbin Chen Signed-off-by Guangxin Xu --- libavcodec/qsvdec.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 88232f5d8d..fe416e74ca 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -63,7 +63,6 @@ typedef struct QSVContext { AVFifoBuffer *async_fifo; int zero_consume_run; -int buffered_count; int reinit_flag; enum AVPixelFormat orig_pix_fmt; @@ -504,8 +503,6 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q, ++q->zero_consume_run; if (q->zero_consume_run > 1) ff_qsv_print_warning(avctx, ret, "A decode call did not consume any data"); -} else if (!*sync && bs.DataOffset) { -++q->buffered_count; } else { q->zero_consume_run = 0; } @@ -637,20 +634,21 @@ static int qsv_process_data(AVCodecContext *avctx, QSVContext *q, if (!avctx->coded_height) avctx->coded_height = 720; -ret = qsv_decode_header(avctx, q, pkt, pix_fmt, ¶m); - -if (q->reinit_flag || (ret >= 0 && (q->orig_pix_fmt != ff_qsv_map_fourcc(param.mfx.FrameInfo.FourCC) || -avctx->coded_width != param.mfx.FrameInfo.Width || -avctx->coded_height != param.mfx.FrameInfo.Height))) { +/* decode zero-size pkt to flush the buffered pkt before reinit */ +if (q->reinit_flag) { AVPacket zero_pkt = {0}; +ret = qsv_decode(avctx, q, frame, got_frame, &zero_pkt); +if (*got_frame) +return ret; +} -if (q->buffered_count) { -q->reinit_flag = 1; -/* decode zero-size pkt to flush the buffered pkt before reinit */ -q->buffered_count--; -return qsv_decode(avctx, q, frame, got_frame, &zero_pkt); -} +if (q->reinit_flag || !q->session) { q->reinit_flag = 0; +ret = qsv_decode_header(avctx, q, pkt, pix_fmt, ¶m); +if (ret < 0) { +av_log(avctx, AV_LOG_ERROR, "Error decoding header\n"); +goto reinit_fail; +} q->orig_pix_fmt = avctx->pix_fmt = pix_fmt = ff_qsv_map_fourcc(param.mfx.FrameInfo.FourCC); -- 2.25.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".