[FFmpeg-cvslog] lavc/exrdsp: unroll predictor
ffmpeg | branch: master | Rémi Denis-Courmont | Sat Nov 11 17:08:45 2023 +0200| [ce467421dc9e2061b8af22973ba4ba6248f16de9] | committer: Rémi Denis-Courmont lavc/exrdsp: unroll predictor With explicit unrolling, we can skip half of the sign bit flips, and the compiler is then better able to optimise the scalar loop: predictor_c: 31376.0 (before) predictor_c: 23703.0 (after) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce467421dc9e2061b8af22973ba4ba6248f16de9 --- libavcodec/exrdsp.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libavcodec/exrdsp.c b/libavcodec/exrdsp.c index 752e1eb553..248cb93c5a 100644 --- a/libavcodec/exrdsp.c +++ b/libavcodec/exrdsp.c @@ -40,10 +40,20 @@ static void reorder_pixels_scalar(uint8_t *dst, const uint8_t *src, ptrdiff_t si static void predictor_scalar(uint8_t *src, ptrdiff_t size) { -ptrdiff_t i; +/* Unrolled: `src[i + 1] += src[i] - 128;` */ +if ((size & 1) == 0) { +src[1] += src[0] ^ 0x80; +src++; +size--; +} + +for (ptrdiff_t i = 1; i < size; i += 2) { +uint8_t a = src[i] + src[i - 1]; -for (i = 1; i < size; i++) -src[i] += src[i-1] - 128; +src[i] = a; +src[i + 1] += a; +src[i] ^= 0x80; +} } av_cold void ff_exrdsp_init(ExrDSPContext *c) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] checkasm: test the noise case of sbrdsp.hf_apply_noise
ffmpeg | branch: master | Rémi Denis-Courmont | Fri Nov 10 21:17:43 2023 +0200| [20e6195c54106203e79cb0aa148561b4d469b115] | committer: Rémi Denis-Courmont checkasm: test the noise case of sbrdsp.hf_apply_noise The tested functions treat s_m[i] == 0 as a special case. Other than that, the functions are slightly complicated vector additions. This actually makes the zero case happen pseudorandomly. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=20e6195c54106203e79cb0aa148561b4d469b115 --- tests/checkasm/sbrdsp.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/checkasm/sbrdsp.c b/tests/checkasm/sbrdsp.c index 5cc3b33215..d6c10853af 100644 --- a/tests/checkasm/sbrdsp.c +++ b/tests/checkasm/sbrdsp.c @@ -233,7 +233,10 @@ static void test_hf_apply_noise(const SBRDSPContext *sbrdsp) int kx, int m_max); randomize((INTFLOAT *)ref, 128 * 2); -randomize((INTFLOAT *)s_m, 128); + +for (int i = 0; i < 128; i++) +s_m[i] = (rnd() & 1) ? ((INTFLOAT)rnd() / UINT_MAX) : (INTFLOAT)0; + randomize((INTFLOAT *)q_filt, 128); for (i = 0; i < 4; i++) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc/sbrdsp: R-V V hf_apply_noise functions
ffmpeg | branch: master | Rémi Denis-Courmont | Fri Nov 10 18:21:27 2023 +0200| [c536e9220702dec7fbccd6a03f043cc142d68c79] | committer: Rémi Denis-Courmont lavc/sbrdsp: R-V V hf_apply_noise functions This is restricted to 128-bit vectors as larger vector sizes could read past the end of the noise array. Support for future hardware with larger vector sizes is left for some other time. hf_apply_noise_0_c: 2319.7 hf_apply_noise_0_rvv_f32: 1229.0 hf_apply_noise_1_c: 2539.0 hf_apply_noise_1_rvv_f32: 1244.7 hf_apply_noise_2_c: 2319.7 hf_apply_noise_2_rvv_f32: 1232.7 hf_apply_noise_3_c: 2541.2 hf_apply_noise_3_rvv_f32: 1244.2 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c536e9220702dec7fbccd6a03f043cc142d68c79 --- libavcodec/riscv/sbrdsp_init.c | 17 +++ libavcodec/riscv/sbrdsp_rvv.S | 67 ++ 2 files changed, 84 insertions(+) diff --git a/libavcodec/riscv/sbrdsp_init.c b/libavcodec/riscv/sbrdsp_init.c index e5736452ec..2ed46153ea 100644 --- a/libavcodec/riscv/sbrdsp_init.c +++ b/libavcodec/riscv/sbrdsp_init.c @@ -21,6 +21,7 @@ #include "config.h" #include "libavutil/attributes.h" #include "libavutil/cpu.h" +#include "libavutil/riscv/cpu.h" #include "libavcodec/sbrdsp.h" void ff_sbr_sum64x5_rvv(float *z); @@ -32,6 +33,14 @@ void ff_sbr_hf_gen_rvv(float (*X_high)[2], const float (*X_low)[2], float bw, int start, int end); void ff_sbr_hf_g_filt_rvv(float (*Y)[2], const float (*X_high)[40][2], const float *g_filt, int m_max, intptr_t ixh); +void ff_sbr_hf_apply_noise_0_rvv(float (*Y)[2], const float *s, + const float *f, int n, int kx, int max); +void ff_sbr_hf_apply_noise_1_rvv(float (*Y)[2], const float *s, + const float *f, int n, int kx, int max); +void ff_sbr_hf_apply_noise_2_rvv(float (*Y)[2], const float *s, + const float *f, int n, int kx, int max); +void ff_sbr_hf_apply_noise_3_rvv(float (*Y)[2], const float *s, + const float *f, int n, int kx, int max); av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c) { @@ -44,6 +53,14 @@ av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c) c->sum_square = ff_sbr_sum_square_rvv; c->hf_gen = ff_sbr_hf_gen_rvv; c->hf_g_filt = ff_sbr_hf_g_filt_rvv; +if (ff_get_rv_vlenb() <= 16) { +c->hf_apply_noise[0] = ff_sbr_hf_apply_noise_0_rvv; +c->hf_apply_noise[2] = ff_sbr_hf_apply_noise_2_rvv; +if (flags & AV_CPU_FLAG_RVB_BASIC) { +c->hf_apply_noise[1] = ff_sbr_hf_apply_noise_1_rvv; +c->hf_apply_noise[3] = ff_sbr_hf_apply_noise_3_rvv; +} +} } c->autocorrelate = ff_sbr_autocorrelate_rvv; } diff --git a/libavcodec/riscv/sbrdsp_rvv.S b/libavcodec/riscv/sbrdsp_rvv.S index 43fab1f65f..02feb6451e 100644 --- a/libavcodec/riscv/sbrdsp_rvv.S +++ b/libavcodec/riscv/sbrdsp_rvv.S @@ -243,3 +243,70 @@ func ff_sbr_hf_g_filt_rvv, zve32f ret endfunc + +.macro hf_apply_noise n +lla a6, ff_sbr_noise_table +fmv.s.x ft0, zero +addia6, a6, 8 +1: +.if \n & 1 +min t0, t0, a5 // preserve parity of t0 for v4 sign injector +vsetvli zero, t0, e32, m4, ta, mu +.else +vsetvli t0, a5, e32, m4, ta, mu +.endif +sh3add t6, a3, a6 +vle32.v v8, (a1) // s_m +sub a5, a5, t0 +vle32.v v12, (a2) // q_filt +sh2add a1, t0, a1 +vmfeq.vf v0, v8, ft0 // s_m == 0.f +vlseg2e32.v v24, (t6) // ff_sbr_noise_table +sh2add a2, t0, a2 +.if \n == 2 +vfneg.v v8, v8 +.endif +.if \n & 1 +vfsgnjx.vv v8, v8, v4 // could equivalent use vxor.vv +.endif +add a3, t0, a3 +vlseg2e32.v v16, (a0) // Y +andia3, a3, 0x1ff +.if \n & 1 +vfmul.vv v28, v12, v28 +vfmacc.vv v16, v12, v24, v0.t +vmerge.vvm v28, v8, v28, v0 +vfadd.vv v20, v20, v28 +.else +vfmul.vv v24, v12, v24 +vfmacc.vv v20, v12, v28, v0.t +vmerge.vvm v24, v8, v24, v0 +vfadd.vv v16, v16, v24 +.endif +vsseg2e32.v v16, (a0) +sh3add a0, t0, a0 +bneza5, 1b + +ret +.endm + +func ff_sbr_hf_apply_noise_0_rvv, zve32f +hf_apply_noise 0 +endfunc + +func ff_sbr_hf_apply_noise_3_rvv, zve32f + not a4, a4 // invert parity of kx + // fall through +endfunc + +func ff_sbr_hf_apply_noise_1_rvv, zve32f +vsetvli t0, zero, e32, m4, ta, ma +vid.v v4 +vxor.vx v4, v4, a4 +vsll.vi v4, v4, 31 // v4[i] = (kx & 1) ? -0.f : +0.f +hf_apply_noise 1 +endfunc + +func ff_sbr_hf_apply_noise_2_rvv, zve32f +hf_apply_noise 2 +endfunc ___ ffmpeg-
[FFmpeg-cvslog] tests/fate/ffmpeg: replace deprecated -vbsf with -bsf:v
ffmpeg | branch: master | Anton Khirnov | Sat Apr 8 11:51:43 2023 +0200| [23de85d1ec1788fa67d8b5158f7fc4411c71faaa] | committer: Anton Khirnov tests/fate/ffmpeg: replace deprecated -vbsf with -bsf:v > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=23de85d1ec1788fa67d8b5158f7fc4411c71faaa --- tests/fate/ffmpeg.mak | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak index 835770a924..1a9da10188 100644 --- a/tests/fate/ffmpeg.mak +++ b/tests/fate/ffmpeg.mak @@ -237,11 +237,11 @@ fate-h264_mp4toannexb_ticket5927_2: CMD = transcode "mp4" $(TARGET_SAMPLES)/h264 FATE_SAMPLES_FFMPEG-$(call TRANSCODE, MPEG4 MPEG2VIDEO, AVI, MPEGPS_DEMUXER MPEGVIDEO_DEMUXER MPEGVIDEO_PARSER EXTRACT_EXTRADATA_BSF REMOVE_EXTRADATA_BSF) += fate-ffmpeg-bsf-remove-k fate-ffmpeg-bsf-remove-r fate-ffmpeg-bsf-remove-e fate-ffmpeg-bsf-remove-k: CMD = transcode "mpeg" $(TARGET_SAMPLES)/mpeg2/matrixbench_mpeg2.lq1.mpg\ - avi "-vbsf remove_extra=k" "-codec copy" + avi "-bsf:v remove_extra=k" "-codec copy" fate-ffmpeg-bsf-remove-r: CMD = transcode "mpeg" $(TARGET_SAMPLES)/mpeg2/matrixbench_mpeg2.lq1.mpg\ - avi "-vbsf remove_extra=keyframe" "-codec copy" + avi "-bsf:v remove_extra=keyframe" "-codec copy" fate-ffmpeg-bsf-remove-e: CMD = transcode "mpeg" $(TARGET_SAMPLES)/mpeg2/matrixbench_mpeg2.lq1.mpg\ - avi "-vbsf remove_extra=e" "-codec copy" + avi "-bsf:v remove_extra=e" "-codec copy" FATE_SAMPLES_FFMPEG-$(call DEMMUX, APNG, FRAMECRC, SETTS_BSF PIPE_PROTOCOL) += fate-ffmpeg-setts-bsf fate-ffmpeg-setts-bsf: CMD = framecrc -i $(TARGET_SAMPLES)/apng/clock.png -c:v copy -bsf:v "setts=duration=if(eq(NEXT_PTS\,NOPTS)\,PREV_OUTDURATION\,(NEXT_PTS-PTS)/2):ts=PTS/2" -fflags +bitexact ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] tests/fate: replace deprecated -vsync with -fps_mode
ffmpeg | branch: master | Anton Khirnov | Sat Apr 8 11:59:20 2023 +0200| [a8d9d6b08d638adf5f3b5a93da9d2fb93ce19bbf] | committer: Anton Khirnov tests/fate: replace deprecated -vsync with -fps_mode > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a8d9d6b08d638adf5f3b5a93da9d2fb93ce19bbf --- tests/fate/ffmpeg.mak | 4 ++-- tests/fate/filter-video.mak | 2 +- tests/fate/gif.mak| 2 +- tests/fate/hevc.mak | 2 +- tests/fate/lossless-video.mak | 6 +++--- tests/fate/mov.mak| 4 ++-- tests/fate/mpeg4.mak | 2 +- tests/fate/vcodec.mak | 2 +- tests/fate/vpx.mak| 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak index 1a9da10188..e8daf27b76 100644 --- a/tests/fate/ffmpeg.mak +++ b/tests/fate/ffmpeg.mak @@ -87,7 +87,7 @@ fate-sub2video: CMD = framecrc -auto_conversion_filters \ FATE_SAMPLES_FFMPEG-$(call FRAMECRC, VOBSUB, DVDSUB, SCALE_FILTER) += fate-sub2video_basic fate-sub2video_basic: CMD = framecrc -auto_conversion_filters \ -i $(TARGET_SAMPLES)/sub/vobsub.idx \ - -vsync passthrough -copyts \ + -fps_mode passthrough -copyts \ -filter_complex "sws_flags=+accurate_rnd+bitexact\;[0:s:0]scale" \ -c:v rawvideo -threads 1 @@ -96,7 +96,7 @@ fate-sub2video_basic: CMD = framecrc -auto_conversion_filters \ FATE_SAMPLES_FFMPEG-$(call FRAMECRC, SUP, PGSSUB, SCALE_FILTER RAWVIDEO_ENCODER) += fate-sub2video_time_limited fate-sub2video_time_limited: CMD = framecrc -auto_conversion_filters \ -i $(TARGET_SAMPLES)/sub/pgs_sub.sup \ - -vsync passthrough -copyts \ + -fps_mode passthrough -copyts \ -t 15 \ -filter_complex "sws_flags=+accurate_rnd+bitexact\;[0:s:0]scale" \ -c:v rawvideo -threads 1 diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak index 58edc70f46..e4bdf59db9 100644 --- a/tests/fate/filter-video.mak +++ b/tests/fate/filter-video.mak @@ -392,7 +392,7 @@ fate-filter-fps-start-drop: CMD = framecrc -lavfi testsrc2=r=7:d=3.5,fps=3:start fate-filter-fps-start-fill: CMD = framecrc -lavfi testsrc2=r=7:d=1.5,setpts=PTS+14,fps=3:start_time=1.5 FATE_FILTER_SAMPLES-$(call FILTERDEMDEC, FPS SCALE, MOV, QTRLE) += fate-filter-fps-cfr fate-filter-fps -fate-filter-fps-cfr: CMD = framecrc -auto_conversion_filters -i $(TARGET_SAMPLES)/qtrle/apple-animation-variable-fps-bug.mov -r 30 -vsync cfr -pix_fmt yuv420p +fate-filter-fps-cfr: CMD = framecrc -auto_conversion_filters -i $(TARGET_SAMPLES)/qtrle/apple-animation-variable-fps-bug.mov -r 30 -fps_mode cfr -pix_fmt yuv420p fate-filter-fps: CMD = framecrc -auto_conversion_filters -i $(TARGET_SAMPLES)/qtrle/apple-animation-variable-fps-bug.mov -vf fps=30 -pix_fmt yuv420p FATE_FILTER_ALPHAEXTRACT_ALPHAMERGE := $(addprefix fate-filter-alphaextract_alphamerge_, rgb yuv) diff --git a/tests/fate/gif.mak b/tests/fate/gif.mak index 1eef2a1026..fc5a73218d 100644 --- a/tests/fate/gif.mak +++ b/tests/fate/gif.mak @@ -11,7 +11,7 @@ FATE_GIF += fate-gif-gray fate-gif-gray: CMD = framecrc -i $(TARGET_SAMPLES)/gif/Newtons_cradle_animation_book_2.gif -pix_fmt bgra -vf scale FATE_GIF += fate-gif-deal -fate-gif-deal: CMD = framecrc -i $(TARGET_SAMPLES)/gif/deal.gif -vsync cfr -pix_fmt bgra -auto_conversion_filters +fate-gif-deal: CMD = framecrc -i $(TARGET_SAMPLES)/gif/deal.gif -fps_mode cfr -pix_fmt bgra -auto_conversion_filters FATE_GIF-$(call FRAMECRC, GIF, GIF, SCALE_FILTER) += $(FATE_GIF) diff --git a/tests/fate/hevc.mak b/tests/fate/hevc.mak index 20c2e5ba9c..b3c6792140 100644 --- a/tests/fate/hevc.mak +++ b/tests/fate/hevc.mak @@ -210,7 +210,7 @@ FATE_HEVC-$(call FRAMECRC, HEVC, HEVC, HEVC_PARSER SCALE_FILTER) += \ $(HEVC_TESTS_422_10BIN) \ $(HEVC_TESTS_444_12BIT) \ -fate-hevc-paramchange-yuv420p-yuv420p10: CMD = framecrc -vsync passthrough -i $(TARGET_SAMPLES)/hevc/paramchange_yuv420p_yuv420p10.hevc -sws_flags area+accurate_rnd+bitexact +fate-hevc-paramchange-yuv420p-yuv420p10: CMD = framecrc -i $(TARGET_SAMPLES)/hevc/paramchange_yuv420p_yuv420p10.hevc -fps_mode passthrough -sws_flags area+accurate_rnd+bitexact FATE_HEVC-$(call FRAMECRC, HEVC, HEVC, HEVC_PARSER SCALE_FILTER LARGE_TESTS) += fate-hevc-paramchange-yuv420p-yuv420p10 tests/data/hevc-mp4.mov: TAG = GEN diff --git a/tests/fate/lossless-video.mak b/tests/fate/lossless-video.mak index 05a8ba29e1..74292d13c7 100644 --- a/tests/fate/lossless-video.mak +++ b/tests/fate/lossless-video.mak @@ -15,9 +15,9 @@ fate-lagarith-red: CMD = framecrc -i $(TARGET_SAMPLES)/lagarith/lagarith-red.avi FATE_LAGARITH += fate-lagarith-ticket4119 fate-lagarith-ticket4119-cfr fate-lagarith-ticket4119-vfr fate-lagarith-ticket4119-pass fate-lagarith-ticket4119: CMD = framecrc -i $(TARGET_SAMPLES)/lagarith/lagarith-1.3.27-black-frames-and-off-by-ones.avi -fate-lagarith-ticket4119-cfr : CMD = fr
[FFmpeg-cvslog] lavf/mux: do not apply max_interleave_delta to subtitles
ffmpeg | branch: master | Anton Khirnov | Tue Oct 31 13:19:04 2023 +0100| [de85815bfaa3e25b7ea46ffc837983df216fcd1b] | committer: Anton Khirnov lavf/mux: do not apply max_interleave_delta to subtitles It is common for subtitle streams to have large gaps between packets. When the caller is interleaving packets from multiple files, it can easily happen that two successive subtitle packets trigger this limit, even though no excessive buffering is happening. Should fix #7064 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de85815bfaa3e25b7ea46ffc837983df216fcd1b --- libavformat/mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index c7877c5d98..de10d2c008 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -995,7 +995,7 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *pkt, const PacketListEntry *const last = sti->last_in_packet_buffer; int64_t last_dts; -if (!last) +if (!last || st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) continue; last_dts = av_rescale_q(last->pkt.dts, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] doc/ffmpeg: expand -bsf documentation
ffmpeg | branch: master | Anton Khirnov | Sat Apr 8 12:11:41 2023 +0200| [436b972fc82ea40e8dcdd1981605250c155ba321] | committer: Anton Khirnov doc/ffmpeg: expand -bsf documentation Explain how to pass options to filters. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=436b972fc82ea40e8dcdd1981605250c155ba321 --- doc/ffmpeg.texi | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index ea473e14e8..68363ae045 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -1888,9 +1888,19 @@ ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts @end example @item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{output,per-stream}) -Set bitstream filters for matching streams. @var{bitstream_filters} is -a comma-separated list of bitstream filters. Use the @code{-bsfs} option -to get the list of bitstream filters. +Apply bitstream filters to matching streams. + +@var{bitstream_filters} is a comma-separated list of bitstream filter +specifications. The specified bitstream filters are applied to coded packets in +the order they are written in. Each bitstream filter specification is of the +form +@example +@var{filter}[=@var{optname0}=@var{optval0}:@var{optname1}=@var{optval1}:...] +@end example +Any of the ',=:' characters that are to be a part of an option value need to be +escaped with a backslash. + +Use the @code{-bsfs} option to get the list of bitstream filters. @example ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264 @end example ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] fftools/ffmpeg: move a few inline function into a new header
ffmpeg | branch: master | Anton Khirnov | Wed Oct 25 13:48:50 2023 +0200| [7c97a0c63f89ba6a18e8969e8460a16dcff48fc4] | committer: Anton Khirnov fftools/ffmpeg: move a few inline function into a new header Will allow to use them in future commits without including the whole ffmpeg.h. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c97a0c63f89ba6a18e8969e8460a16dcff48fc4 --- fftools/ffmpeg.c | 1 + fftools/ffmpeg.h | 21 - fftools/ffmpeg_dec.c | 1 + fftools/ffmpeg_demux.c | 1 + fftools/ffmpeg_mux.c | 1 + fftools/ffmpeg_utils.h | 50 ++ 6 files changed, 54 insertions(+), 21 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 46a85b41a8..cdb16ef90b 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -99,6 +99,7 @@ #include "cmdutils.h" #include "ffmpeg.h" +#include "ffmpeg_utils.h" #include "sync_queue.h" const char program_name[] = "ffmpeg"; diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 0983d026cd..d52c954df5 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -880,17 +880,6 @@ int trigger_fix_sub_duration_heartbeat(OutputStream *ost, const AVPacket *pkt); int fix_sub_duration_heartbeat(InputStream *ist, int64_t signal_pts); void update_benchmark(const char *fmt, ...); -/** - * Merge two return codes - return one of the error codes if at least one of - * them was negative, 0 otherwise. - * Currently just picks the first one, eventually we might want to do something - * more sophisticated, like sorting them by priority. - */ -static inline int err_merge(int err0, int err1) -{ -return (err0 < 0) ? err0 : FFMIN(err1, 0); -} - #define SPECIFIER_OPT_FMT_str "%s" #define SPECIFIER_OPT_FMT_i"%i" #define SPECIFIER_OPT_FMT_i64 "%"PRId64 @@ -942,14 +931,4 @@ extern const char * const opt_name_frame_rates[]; extern const char * const opt_name_top_field_first[]; #endif -static inline void pkt_move(void *dst, void *src) -{ -av_packet_move_ref(dst, src); -} - -static inline void frame_move(void *dst, void *src) -{ -av_frame_move_ref(dst, src); -} - #endif /* FFTOOLS_FFMPEG_H */ diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index fcee8b65ac..8795a94c1a 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -30,6 +30,7 @@ #include "libavfilter/buffersrc.h" #include "ffmpeg.h" +#include "ffmpeg_utils.h" #include "thread_queue.h" struct Decoder { diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 350f233ab7..ec96daf26b 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -20,6 +20,7 @@ #include #include "ffmpeg.h" +#include "ffmpeg_utils.h" #include "libavutil/avassert.h" #include "libavutil/avstring.h" diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index 7a924dba6c..30c033036d 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -22,6 +22,7 @@ #include "ffmpeg.h" #include "ffmpeg_mux.h" +#include "ffmpeg_utils.h" #include "objpool.h" #include "sync_queue.h" #include "thread_queue.h" diff --git a/fftools/ffmpeg_utils.h b/fftools/ffmpeg_utils.h new file mode 100644 index 00..20cde94969 --- /dev/null +++ b/fftools/ffmpeg_utils.h @@ -0,0 +1,50 @@ +/* + * 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 + */ + +#ifndef FFTOOLS_FFMPEG_UTILS_H +#define FFTOOLS_FFMPEG_UTILS_H + +#include + +#include "libavutil/common.h" +#include "libavutil/frame.h" + +#include "libavcodec/packet.h" + +/** + * Merge two return codes - return one of the error codes if at least one of + * them was negative, 0 otherwise. + * Currently just picks the first one, eventually we might want to do something + * more sophisticated, like sorting them by priority. + */ +static inline int err_merge(int err0, int err1) +{ +return (err0 < 0) ? err0 : FFMIN(err1, 0); +} + +static inline void pkt_move(void *dst, void *src) +{ +av_packet_move_ref(dst, src); +} + +static inline void frame_move(void *dst, void *src) +{ +av_frame_move_ref(dst, src); +} + +#endif // FFTOOLS_FFMPEG_UTILS_H ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, o
[FFmpeg-cvslog] fftools/thread_queue: count receive-finished streams as finished
ffmpeg | branch: master | Anton Khirnov | Wed Oct 18 12:02:42 2023 +0200| [87016e031ffa2ed99d466e99a1d7fc68f7bdd8e7] | committer: Anton Khirnov fftools/thread_queue: count receive-finished streams as finished This ensures that tq_receive() will always return EOF after all streams were receive-finished, even though the sending side might not have closed them yet. This may allow the receiver to avoid manually tracking which streams it has already closed. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=87016e031ffa2ed99d466e99a1d7fc68f7bdd8e7 --- fftools/thread_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/thread_queue.c b/fftools/thread_queue.c index feac6a7748..fd73cc0a9b 100644 --- a/fftools/thread_queue.c +++ b/fftools/thread_queue.c @@ -177,7 +177,7 @@ static int receive_locked(ThreadQueue *tq, int *stream_idx, } for (unsigned int i = 0; i < tq->nb_streams; i++) { -if (!(tq->finished[i] & FINISHED_SEND)) +if (!tq->finished[i]) continue; /* return EOF to the consumer at most once for each stream */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavfi/af_amix: make sure the output does not depend on input ordering
ffmpeg | branch: master | Paul B Mahol | Sat Oct 28 13:41:01 2023 +0200| [7282137f48c3e71734a2aa55c51b3096a1a63b5f] | committer: Anton Khirnov lavfi/af_amix: make sure the output does not depend on input ordering Signed-off-by: Anton Khirnov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7282137f48c3e71734a2aa55c51b3096a1a63b5f --- libavfilter/af_amix.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index aa42514106..120a97f48c 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -394,6 +394,8 @@ static int request_samples(AVFilterContext *ctx, int min_samples) int i; av_assert0(s->nb_inputs > 1); +if (min_samples == 1 && s->duration_mode == DURATION_FIRST) +min_samples = av_audio_fifo_size(s->fifos[0]); for (i = 1; i < s->nb_inputs; i++) { if (!(s->input_state[i] & INPUT_ON) || @@ -402,6 +404,7 @@ static int request_samples(AVFilterContext *ctx, int min_samples) if (av_audio_fifo_size(s->fifos[i]) >= min_samples) continue; ff_inlink_request_frame(ctx->inputs[i]); +return 0; } return output_frame(ctx->outputs[0]); } @@ -471,17 +474,13 @@ static int activate(AVFilterContext *ctx) if (ff_inlink_acknowledge_status(ctx->inputs[i], &status, &pts)) { if (status == AVERROR_EOF) { -if (i == 0) { -s->input_state[i] = 0; +s->input_state[i] |= INPUT_EOF; +if (av_audio_fifo_size(s->fifos[i]) == 0) { +s->input_state[i] &= ~INPUT_ON; if (s->nb_inputs == 1) { ff_outlink_set_status(outlink, status, pts); return 0; } -} else { -s->input_state[i] |= INPUT_EOF; -if (av_audio_fifo_size(s->fifos[i]) == 0) { -s->input_state[i] = 0; -} } } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavc/8bps: fix exporting palette after 63767b79a570404628b2521b83104108b7b6884c
ffmpeg | branch: master | Anton Khirnov | Tue Oct 24 15:03:51 2023 +0200| [6dbde68cb5467302fe99c331ea9b14d824238016] | committer: Anton Khirnov lavc/8bps: fix exporting palette after 63767b79a570404628b2521b83104108b7b6884c It would be left empty on each frame whose packet does not come with palette attached. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6dbde68cb5467302fe99c331ea9b14d824238016 --- libavcodec/8bps.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index 0becaa9320..11b9f526b7 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -43,6 +43,8 @@ typedef struct EightBpsContext { uint8_t planes; uint8_t planemap[4]; + +uint32_t pal[256]; } EightBpsContext; static int decode_frame(AVCodecContext *avctx, AVFrame *frame, @@ -116,10 +118,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, FF_DISABLE_DEPRECATION_WARNINGS frame->palette_has_changed = #endif -ff_copy_palette(frame->data[1], avpkt, avctx); +ff_copy_palette(c->pal, avpkt, avctx); #if FF_API_PALETTE_HAS_CHANGED FF_ENABLE_DEPRECATION_WARNINGS #endif + +memcpy(frame->data[1], c->pal, AVPALETTE_SIZE); } *got_frame = 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] fftools/thread_queue: do not return elements for receive-finished streams
ffmpeg | branch: master | Anton Khirnov | Wed Oct 18 11:45:06 2023 +0200| [4f7b91a6980d4d593ce0bf5ae398996f878a18e2] | committer: Anton Khirnov fftools/thread_queue: do not return elements for receive-finished streams It does not cause any issues in current callers, but still should not happen. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f7b91a6980d4d593ce0bf5ae398996f878a18e2 --- fftools/thread_queue.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/fftools/thread_queue.c b/fftools/thread_queue.c index a1ab4ce92e..feac6a7748 100644 --- a/fftools/thread_queue.c +++ b/fftools/thread_queue.c @@ -164,7 +164,12 @@ static int receive_locked(ThreadQueue *tq, int *stream_idx, FifoElem elem; unsigned int nb_finished = 0; -if (av_fifo_read(tq->fifo, &elem, 1) >= 0) { +while (av_fifo_read(tq->fifo, &elem, 1) >= 0) { +if (tq->finished[elem.stream_idx] & FINISHED_RECV) { +objpool_release(tq->obj_pool, &elem.obj); +continue; +} + tq->obj_move(data, elem.obj); objpool_release(tq->obj_pool, &elem.obj); *stream_idx = elem.stream_idx; @@ -197,7 +202,14 @@ int tq_receive(ThreadQueue *tq, int *stream_idx, void *data) pthread_mutex_lock(&tq->lock); while (1) { +size_t can_read = av_fifo_can_read(tq->fifo); + ret = receive_locked(tq, stream_idx, data); + +// signal other threads if the fifo state changed +if (can_read != av_fifo_can_read(tq->fifo)) +pthread_cond_broadcast(&tq->cond); + if (ret == AVERROR(EAGAIN)) { pthread_cond_wait(&tq->cond, &tq->lock); continue; @@ -206,9 +218,6 @@ int tq_receive(ThreadQueue *tq, int *stream_idx, void *data) break; } -if (ret == 0) -pthread_cond_broadcast(&tq->cond); - pthread_mutex_unlock(&tq->lock); return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] fftools/ffmpeg: rework keeping track of file duration for -stream_loop
ffmpeg | branch: master | Anton Khirnov | Wed Oct 11 17:43:51 2023 +0200| [889a022cceea88072e3b9716af3d7c795728f5c5] | committer: Anton Khirnov fftools/ffmpeg: rework keeping track of file duration for -stream_loop Current code tracks min/max pts for each stream separately; then when the file ends it combines them with last frame's duration to compute the total duration of each stream; finally it selects the longest of those durations as the file duration. This is incorrect - the total file duration is the largest timestamp difference between any frames, regardless of the stream. Also change the way the last frame information is reported from decoders to the muxer - previously it would be just the last frame's duration, now the end timestamp is sent, which is simpler. Changes the result of the fate-ffmpeg-streamloop-transcode-av test, where the timestamps are shifted slightly forward. Note that the matroska demuxer does not return the first audio packet after seeking (due to buggy interaction betwen the generic code and the demuxer), so there is a gap in audio. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=889a022cceea88072e3b9716af3d7c795728f5c5 --- fftools/ffmpeg.h | 13 +-- fftools/ffmpeg_dec.c | 16 +-- fftools/ffmpeg_demux.c| 111 -- fftools/ffmpeg_utils.h| 6 + tests/ref/fate/ffmpeg-streamloop-transcode-av | 160 +- 5 files changed, 140 insertions(+), 166 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index d52c954df5..41935d39d5 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -347,8 +347,6 @@ typedef struct InputStream { AVRational framerate_guessed; -int64_t nb_samples; /* number of samples in the last decoded audio frame before looping */ - AVDictionary *decoder_opts; AVRational framerate; /* framerate forced with -r */ #if FFMPEG_OPT_TOP @@ -391,11 +389,6 @@ typedef struct InputStream { uint64_t decode_errors; } InputStream; -typedef struct LastFrameDuration { -int stream_idx; -int64_t duration; -} LastFrameDuration; - typedef struct InputFile { const AVClass *class; @@ -427,9 +420,9 @@ typedef struct InputFile { int accurate_seek; /* when looping the input file, this queue is used by decoders to report - * the last frame duration back to the demuxer thread */ -AVThreadMessageQueue *audio_duration_queue; -int audio_duration_queue_size; + * the last frame timestamp back to the demuxer thread */ +AVThreadMessageQueue *audio_ts_queue; +int audio_ts_queue_size; } InputFile; enum forced_keyframes_const { diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index 8795a94c1a..517d6b3ced 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -632,7 +632,6 @@ static int packet_decode(InputStream *ist, AVPacket *pkt, AVFrame *frame) if (dec->codec_type == AVMEDIA_TYPE_AUDIO) { ist->samples_decoded += frame->nb_samples; -ist->nb_samples = frame->nb_samples; audio_ts_process(ist, ist->decoder, frame); } else { @@ -724,14 +723,9 @@ static void *decoder_thread(void *arg) /* report last frame duration to the demuxer thread */ if (ist->dec->type == AVMEDIA_TYPE_AUDIO) { -LastFrameDuration dur; - -dur.stream_idx = ist->index; -dur.duration = av_rescale_q(ist->nb_samples, - (AVRational){ 1, ist->dec_ctx->sample_rate}, - ist->st->time_base); - -av_thread_message_queue_send(ifile->audio_duration_queue, &dur, 0); +Timestamp ts = { .ts = d->last_frame_pts + d->last_frame_duration_est, + .tb = d->last_frame_tb }; +av_thread_message_queue_send(ifile->audio_ts_queue, &ts, 0); } avcodec_flush_buffers(ist->dec_ctx); @@ -760,8 +754,8 @@ finish: // make sure the demuxer does not get stuck waiting for audio durations // that will never arrive -if (ifile->audio_duration_queue && ist->dec->type == AVMEDIA_TYPE_AUDIO) -av_thread_message_queue_set_err_recv(ifile->audio_duration_queue, AVERROR_EOF); +if (ifile->audio_ts_queue && ist->dec->type == AVMEDIA_TYPE_AUDIO) +av_thread_message_queue_set_err_recv(ifile->audio_ts_queue, AVERROR_EOF); dec_thread_uninit(&dt); diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index ec96daf26b..791952f120 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -74,9 +74,6 @@ typedef struct DemuxStream { ///< dts of the last packet read for this stream (in AV_TIME_BASE units) int64_t dts; -int64_t min_pts; /* pts with the
[FFmpeg-cvslog] fftools/ffplay: add hwaccel decoding support
ffmpeg | branch: master | Zhao Zhili | Wed Nov 8 00:45:04 2023 +0800| [a1a6a328f0f58af23c174828775754b28ac64b2d] | committer: Zhao Zhili fftools/ffplay: add hwaccel decoding support Add vulkan renderer via libplacebo. Simple usage: $ ffplay -hwaccel vulkan foo.mp4 Use cuda to vulkan map: $ ffplay -hwaccel cuda foo.mp4 Create vulkan instance by libplacebo, and enable debug: $ ffplay -hwaccel vulkan \ -vulkan_params create_by_placebo=1:debug=1 foo.mp4 Signed-off-by: Zhao Zhili > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a1a6a328f0f58af23c174828775754b28ac64b2d --- configure | 2 +- doc/ffplay.texi | 12 + fftools/Makefile | 2 + fftools/ffplay.c | 96 +- fftools/ffplay_renderer.c | 824 ++ fftools/ffplay_renderer.h | 41 +++ 6 files changed, 971 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 46d7a5cf0e..055d558c5a 100755 --- a/configure +++ b/configure @@ -3904,7 +3904,7 @@ ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter ffmpeg_suggest="ole32 psapi shell32" ffplay_deps="avcodec avformat avfilter swscale swresample sdl2" ffplay_select="crop_filter transpose_filter hflip_filter vflip_filter rotate_filter" -ffplay_suggest="shell32" +ffplay_suggest="shell32 libplacebo vulkan" ffprobe_deps="avcodec avformat" ffprobe_suggest="shell32" diff --git a/doc/ffplay.texi b/doc/ffplay.texi index 5dd860b846..93f77eeece 100644 --- a/doc/ffplay.texi +++ b/doc/ffplay.texi @@ -196,6 +196,18 @@ will produce a thread pool with this many threads available for parallel processing. The default is 0 which means that the thread count will be determined by the number of available CPUs. +@item -enable_vulkan +Use vulkan renderer rather than SDL builtin renderer. Depends on libplacebo. + +@item -vulkan_params + +Vulkan configuration using a list of @var{key}=@var{value} pairs separated by +":". + +@item -hwaccel +Use HW accelerated decoding. Enable this option will enable vulkan renderer +automatically. + @end table @section While playing diff --git a/fftools/Makefile b/fftools/Makefile index 56820e6bc8..3c763e3db9 100644 --- a/fftools/Makefile +++ b/fftools/Makefile @@ -22,6 +22,8 @@ OBJS-ffmpeg += \ fftools/sync_queue.o\ fftools/thread_queue.o \ +OBJS-ffplay += fftools/ffplay_renderer.o + define DOFFTOOL OBJS-$(1) += fftools/cmdutils.o fftools/opt_common.o fftools/$(1).o $(OBJS-$(1)-yes) ifdef HAVE_GNU_WINDRES diff --git a/fftools/ffplay.c b/fftools/ffplay.c index d8c69e10bc..873ee8cc74 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -58,6 +58,7 @@ #include #include "cmdutils.h" +#include "ffplay_renderer.h" #include "opt_common.h" const char program_name[] = "ffplay"; @@ -350,6 +351,9 @@ static char *afilters = NULL; static int autorotate = 1; static int find_stream_info = 1; static int filter_nbthreads = 0; +static int enable_vulkan = 0; +static char *vulkan_params = NULL; +static const char *hwaccel = NULL; /* current context */ static int is_full_screen; @@ -362,6 +366,8 @@ static SDL_Renderer *renderer; static SDL_RendererInfo renderer_info = {0}; static SDL_AudioDeviceID audio_dev; +static VkRenderer *vk_renderer; + static const struct TextureFormatEntry { enum AVPixelFormat format; int texture_fmt; @@ -954,6 +960,11 @@ static void video_image_display(VideoState *is) SDL_Rect rect; vp = frame_queue_peek_last(&is->pictq); +if (vk_renderer) { +vk_renderer_display(vk_renderer, vp->frame); +return; +} + if (is->subtitle_st) { if (frame_queue_nb_remaining(&is->subpq) > 0) { sp = frame_queue_peek(&is->subpq); @@ -1289,6 +1300,8 @@ static void do_exit(VideoState *is) } if (renderer) SDL_DestroyRenderer(renderer); +if (vk_renderer) +vk_renderer_destroy(vk_renderer); if (window) SDL_DestroyWindow(window); uninit_opts(); @@ -2546,6 +2559,37 @@ static int audio_open(void *opaque, AVChannelLayout *wanted_channel_layout, int return spec.size; } +static int create_hwaccel(AVBufferRef **device_ctx) +{ +enum AVHWDeviceType type; +int ret; +AVBufferRef *vk_dev; + +*device_ctx = NULL; + +if (!hwaccel) +return 0; + +type = av_hwdevice_find_type_by_name(hwaccel); +if (type == AV_HWDEVICE_TYPE_NONE) +return AVERROR(ENOTSUP); + +ret = vk_renderer_get_hw_dev(vk_renderer, &vk_dev); +if (ret < 0) +return ret; + +ret = av_hwdevice_ctx_create_derived(device_ctx, type, vk_dev, 0); +if (!ret) +return 0; + +if (ret != AVERROR(ENOSYS)) +return ret; + +av_log(NULL, AV_LOG_WARNING, "Derive %s from vulkan not supported.\n", hwaccel); +ret = av_hwdevice_ctx_create(device_ctx, type, NULL, NULL, 0); +return ret; +} + /* open a given stream. Return 0 if OK */ stati
[FFmpeg-cvslog] avcodec/codecpar: mention how to allocate coded_side_data
ffmpeg | branch: master | James Almer | Mon Nov 13 13:28:46 2023 -0300| [b360c917523ea4a896285160db4b20c695145fc2] | committer: James Almer avcodec/codecpar: mention how to allocate coded_side_data Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b360c917523ea4a896285160db4b20c695145fc2 --- libavcodec/codec_par.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/codec_par.h b/libavcodec/codec_par.h index 64882a9726..f42dd3b1d5 100644 --- a/libavcodec/codec_par.h +++ b/libavcodec/codec_par.h @@ -219,6 +219,9 @@ typedef struct AVCodecParameters { /** * Additional data associated with the entire stream. + * + * Should be allocated with av_packet_side_data_new() or + * av_packet_side_data_add(), and will be freed by avcodec_parameters_free(). */ AVPacketSideData *coded_side_data; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] tools/general_assembly.pl - add options to print names, emails or both
ffmpeg | branch: master | Cosmin Stejerean via ffmpeg-devel | Mon Nov 6 18:41:54 2023 +| [575efc0406864542a65aa3f31ebe8eb0bbef5087] | committer: Anton Khirnov tools/general_assembly.pl - add options to print names, emails or both Signed-off-by: Cosmin Stejerean Signed-off-by: Anton Khirnov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=575efc0406864542a65aa3f31ebe8eb0bbef5087 --- tools/general_assembly.pl | 43 +-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/tools/general_assembly.pl b/tools/general_assembly.pl index 898a6262ef..e59ce0f350 100644 --- a/tools/general_assembly.pl +++ b/tools/general_assembly.pl @@ -6,9 +6,41 @@ use strict; use POSIX qw(strftime); use Encode qw(decode); use Data::Dumper; +use Getopt::Long; + +binmode(STDOUT, ":utf8"); sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s }; +sub print_help { +print "Usage: $0 [options]\n"; +print "Options:\n"; +print " --names Print only the names\n"; +print " --emails Print only the email addresses\n"; +print " --full Print both names and email addresses (default)\n"; +print " -h, --help Show this help message\n"; +exit; +} + +my $print_full = 1; +my $print_names = 0; +my $print_emails = 0; +my $help = 0; + +GetOptions( +"full" => \$print_full, +"names" => \$print_names, +"emails" => \$print_emails, +"help" => \$help, +"h" => \$help, +); + +print_help() if $help; + +if ($print_names || $print_emails) { +$print_full = 0; +} + my @shortlog = split /\n/, decode('UTF-8', `git log --pretty=format:"%aN <%aE>" --since="last 36 months" | sort | uniq -c | sort -r`, Encode::FB_CROAK); my %assembly = (); @@ -35,6 +67,13 @@ foreach my $line (@shortlog) { } printf("# %s %s", strftime("%Y-%m-%d", localtime), decode('UTF-8', `git rev-parse HEAD`, Encode::FB_CROAK)); -foreach my $email (sort values %assembly) { -printf("%s\n", $email); +foreach my $name (sort keys %assembly) { +my $email = $assembly{$name}; +if ($print_full) { +printf("%s <%s>\n", $name, $email); +} elsif ($print_names) { +printf("%s\n", $name); +} elsif ($print_emails) { +printf("%s\n", $email); +} } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".