[FFmpeg-cvslog] avformat/hlsenc: Add CHANNELS to EXT-X-MEDIA for Audio
ffmpeg | branch: master | Dave Johansen | Thu Oct 26 19:43:59 2023 -0600| [39878fc50400f347075f75d1a0cbb77b16fb9c9d] | committer: Steven Liu avformat/hlsenc: Add CHANNELS to EXT-X-MEDIA for Audio Signed-off-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=39878fc50400f347075f75d1a0cbb77b16fb9c9d --- libavformat/dashenc.c | 3 ++- libavformat/hlsenc.c | 8 +++- libavformat/hlsplaylist.c | 5 - libavformat/hlsplaylist.h | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 96f4a5fbdf..15f700acbc 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -1284,7 +1284,8 @@ static int write_manifest(AVFormatContext *s, int final) continue; get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i); ff_hls_write_audio_rendition(c->m3u8_out, audio_group, - playlist_file, NULL, i, is_default); + playlist_file, NULL, i, is_default, + s->streams[i]->codecpar->ch_layout.nb_channels); max_audio_bitrate = FFMAX(st->codecpar->bit_rate + os->muxer_overhead, max_audio_bitrate); if (!av_strnstr(audio_codec_str, os->codec_str, sizeof(audio_codec_str))) { diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index fa2f3946e9..8c001a0d39 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1386,6 +1386,7 @@ static int create_master_playlist(AVFormatContext *s, int is_file_proto = proto && !strcmp(proto, "file"); int use_temp_file = is_file_proto && ((hls->flags & HLS_TEMP_FILE) || hls->master_publish_rate); char temp_filename[MAX_URL_SIZE]; +int nb_channels; input_vs->m3u8_created = 1; if (!hls->master_m3u8_created) { @@ -1434,8 +1435,13 @@ static int create_master_playlist(AVFormatContext *s, av_log(s, AV_LOG_ERROR, "Unable to find relative URL\n"); goto fail; } +nb_channels = 0; +for (j = 0; j < vs->nb_streams; j++) +if (vs->streams[j]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) +if (vs->streams[j]->codecpar->ch_layout.nb_channels > nb_channels) +nb_channels = vs->streams[j]->codecpar->ch_layout.nb_channels; -ff_hls_write_audio_rendition(hls->m3u8_out, vs->agroup, m3u8_rel_name, vs->language, i, hls->has_default_key ? vs->is_default : 1); +ff_hls_write_audio_rendition(hls->m3u8_out, vs->agroup, m3u8_rel_name, vs->language, i, hls->has_default_key ? vs->is_default : 1, nb_channels); } /* For variant streams with video add #EXT-X-STREAM-INF tag with attributes*/ diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c index 2bf05f3c7c..4f35d0388f 100644 --- a/libavformat/hlsplaylist.c +++ b/libavformat/hlsplaylist.c @@ -39,7 +39,7 @@ void ff_hls_write_playlist_version(AVIOContext *out, int version) void ff_hls_write_audio_rendition(AVIOContext *out, const char *agroup, const char *filename, const char *language, - int name_id, int is_default) + int name_id, int is_default, int nb_channels) { if (!out || !agroup || !filename) return; @@ -49,6 +49,9 @@ void ff_hls_write_audio_rendition(AVIOContext *out, const char *agroup, if (language) { avio_printf(out, "LANGUAGE=\"%s\",", language); } +if (nb_channels) { +avio_printf(out, "CHANNELS=\"%d\",", nb_channels); +} avio_printf(out, "URI=\"%s\"\n", filename); } diff --git a/libavformat/hlsplaylist.h b/libavformat/hlsplaylist.h index 1928fe787d..c2744c227c 100644 --- a/libavformat/hlsplaylist.h +++ b/libavformat/hlsplaylist.h @@ -38,7 +38,7 @@ typedef enum { void ff_hls_write_playlist_version(AVIOContext *out, int version); void ff_hls_write_audio_rendition(AVIOContext *out, const char *agroup, const char *filename, const char *language, - int name_id, int is_default); + int name_id, int is_default, int nb_channels); void ff_hls_write_subtitle_rendition(AVIOContext *out, const char *sgroup, const char *filename, const char *language, int name_id, int is_default); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/hlsenc: Fix name of flag in error message
ffmpeg | branch: master | Dave Johansen | Thu Oct 26 21:59:40 2023 -0600| [ab78d22553fe7052e0763f9bb319b0ba9c3bca47] | committer: Steven Liu avformat/hlsenc: Fix name of flag in error message Reviewed-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ab78d22553fe7052e0763f9bb319b0ba9c3bca47 --- libavformat/hlsenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 8c001a0d39..7049956dd7 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -998,7 +998,7 @@ static int sls_flags_filename_process(struct AVFormatContext *s, HLSContext *hls 't', (int64_t)round(duration * HLS_MICROSECOND_UNIT)) < 1) { av_log(hls, AV_LOG_ERROR, "Invalid second level segment filename template '%s', " - "you can try to remove second_level_segment_time flag\n", + "you can try to remove second_level_segment_duration flag\n", vs->avf->url); av_freep(&filename); return AVERROR(EINVAL); @@ -1091,7 +1091,7 @@ static int sls_flag_use_localtime_filename(AVFormatContext *oc, HLSContext *c, V char *filename = NULL; if (replace_int_data_in_filename(&filename, oc->url, 't', 0) < 1) { av_log(c, AV_LOG_ERROR, "Invalid second level segment filename template '%s', " -"you can try to remove second_level_segment_time flag\n", +"you can try to remove second_level_segment_duration flag\n", oc->url); av_freep(&filename); return AVERROR(EINVAL); ___ 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/aacpsdsp: rework R-V V add_squares
ffmpeg | branch: master | Rémi Denis-Courmont | Sat Jul 15 23:23:50 2023 +0300| [eb508702a899f4a41d3653d90b077b487083d2ab] | committer: Rémi Denis-Courmont lavc/aacpsdsp: rework R-V V add_squares Segmented loads may be slower than not. So this advantageously uses a unit-strided load and narrowing shifts instead. Before: ps_add_squares_c: 60757.7 ps_add_squares_rvv_f32: 22242.5 After: ps_add_squares_c: 60516.0 ps_add_squares_rvv_i64: 17067.7 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eb508702a899f4a41d3653d90b077b487083d2ab --- libavcodec/riscv/aacpsdsp_init.c | 3 ++- libavcodec/riscv/aacpsdsp_rvv.S | 9 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libavcodec/riscv/aacpsdsp_init.c b/libavcodec/riscv/aacpsdsp_init.c index c5ec796232..f72d1bc330 100644 --- a/libavcodec/riscv/aacpsdsp_init.c +++ b/libavcodec/riscv/aacpsdsp_init.c @@ -46,7 +46,8 @@ av_cold void ff_psdsp_init_riscv(PSDSPContext *c) c->hybrid_analysis = ff_ps_hybrid_analysis_rvv; if (flags & AV_CPU_FLAG_RVB_ADDR) { -c->add_squares = ff_ps_add_squares_rvv; +if (flags & AV_CPU_FLAG_RVV_I64) +c->add_squares = ff_ps_add_squares_rvv; c->mul_pair_single = ff_ps_mul_pair_single_rvv; c->stereo_interpolate[0] = ff_ps_stereo_interpolate_rvv; } diff --git a/libavcodec/riscv/aacpsdsp_rvv.S b/libavcodec/riscv/aacpsdsp_rvv.S index fe250cd83b..cf872599c8 100644 --- a/libavcodec/riscv/aacpsdsp_rvv.S +++ b/libavcodec/riscv/aacpsdsp_rvv.S @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Rémi Denis-Courmont. + * Copyright © 2022-2023 Rémi Denis-Courmont. * * This file is part of FFmpeg. * @@ -20,13 +20,16 @@ #include "libavutil/riscv/asm.S" -func ff_ps_add_squares_rvv, zve32f +func ff_ps_add_squares_rvv, zve64f +li t1, 32 1: vsetvli t0, a2, e32, m4, ta, ma -vlseg2e32.v v24, (a1) +vle64.v v8, (a1) sub a2, a2, t0 +vnsrl.wxv24, v8, zero vle32.v v16, (a0) sh3add a1, t0, a1 +vnsrl.wxv28, v8, t1 vfmacc.vv v16, v24, v24 vfmacc.vv v16, v28, v28 vse32.v v16, (a0) ___ 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/aacpsdsp: rework R-V V hybrid_synthesis_deint
ffmpeg | branch: master | Rémi Denis-Courmont | Tue Nov 7 21:56:02 2023 +0200| [f576a0835b45940aad08507257ecd8d61d42452c] | committer: Rémi Denis-Courmont lavc/aacpsdsp: rework R-V V hybrid_synthesis_deint Given the size of the data set, strided memory accesses cannot be avoided. We can still do better than the current code. ps_hybrid_synthesis_deint_c: 12065.5 ps_hybrid_synthesis_deint_rvv_i32: 13650.2 (before) ps_hybrid_synthesis_deint_rvv_i64: 8181.0 (after) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f576a0835b45940aad08507257ecd8d61d42452c --- libavcodec/riscv/aacpsdsp_init.c | 8 +++--- libavcodec/riscv/aacpsdsp_rvv.S | 61 +--- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/libavcodec/riscv/aacpsdsp_init.c b/libavcodec/riscv/aacpsdsp_init.c index f72d1bc330..e094660cf3 100644 --- a/libavcodec/riscv/aacpsdsp_init.c +++ b/libavcodec/riscv/aacpsdsp_init.c @@ -46,16 +46,16 @@ av_cold void ff_psdsp_init_riscv(PSDSPContext *c) c->hybrid_analysis = ff_ps_hybrid_analysis_rvv; if (flags & AV_CPU_FLAG_RVB_ADDR) { -if (flags & AV_CPU_FLAG_RVV_I64) +if (flags & AV_CPU_FLAG_RVV_I64) { c->add_squares = ff_ps_add_squares_rvv; +c->hybrid_synthesis_deint = ff_ps_hybrid_synthesis_deint_rvv; +} c->mul_pair_single = ff_ps_mul_pair_single_rvv; c->stereo_interpolate[0] = ff_ps_stereo_interpolate_rvv; } } -if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) { +if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) c->hybrid_analysis_ileave = ff_ps_hybrid_analysis_ileave_rvv; -c->hybrid_synthesis_deint = ff_ps_hybrid_synthesis_deint_rvv; -} #endif } diff --git a/libavcodec/riscv/aacpsdsp_rvv.S b/libavcodec/riscv/aacpsdsp_rvv.S index cf872599c8..1dc426e01c 100644 --- a/libavcodec/riscv/aacpsdsp_rvv.S +++ b/libavcodec/riscv/aacpsdsp_rvv.S @@ -190,38 +190,41 @@ func ff_ps_hybrid_analysis_ileave_rvv, zve32x /* no needs for zve32f here */ ret endfunc -func ff_ps_hybrid_synthesis_deint_rvv, zve32x -sllit1, a2, 5 + 1 + 2 -sh2add a0, a2, a0 -add a1, a1, t1 -addia2, a2, -64 -li t1, 38 * 64 * 4 -li t6, 64 * 4 -add a4, a0, t1 -beqza2, 3f +func ff_ps_hybrid_synthesis_deint_rvv, zve64x +sllit0, a2, 5 + 1 + 2 +sh2add a0, a2, a0 +add a1, a1, t0 +addit2, a2, -64 +li t0, 38 * 64 +li t1, 32 * 2 * 4 +li t4, 8 - 16384 // offset from in[64][n][0] to in[0][n + 1][0] +sllit5, a2, 5 + 1 + 2 // and from in[0][n+1][0] to in[0][n+1][s] +neg t2, t2 +li t3, 32 +add a4, t4, t5 +sh2add t0, t0, a0 1: -mv t0, a0 -mv t1, a1 -mv t3, a3 -mv t4, a4 -addia2, a2, 1 +mv t4, t2 +addia3, a3, -1 2: -vsetvli t5, t3, e32, m4, ta, ma -vlseg2e32.v v16, (t1) -sub t3, t3, t5 -vsse32.vv16, (t0), t6 -mul t2, t5, t6 -vsse32.vv20, (t4), t6 -sh3add t1, t5, t1 -add t0, t0, t2 -add t4, t4, t2 -bnezt3, 2b +vsetvli t5, t4, e32, m4, ta, ma +vlse64.v v16, (a1), t1 /* sizeof (float[32][2]) */ +sub t4, t4, t5 +vnsrl.wx v24, v16, zero +sllit6, t5, 5 + 1 + 2 +vnsrl.wx v28, v16, t3 /* 32 */ +add a1, a1, t6 +vse32.v v24, (a0) +sh2add a0, t5, a0 +vse32.v v28, (t0) +sh2add t0, t5, t0 +bnezt4, 2b + +add a1, a1, a4 +sh2add a0, a2, a0 +sh2add t0, a2, t0 +bneza3, 1b -add a0, a0, 4 -add a1, a1, 32 * 2 * 4 -add a4, a4, 4 -bneza2, 1b -3: ret endfunc ___ 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 autocorrelate
ffmpeg | branch: master | Rémi Denis-Courmont | Wed Nov 8 22:17:39 2023 +0200| [cd7b352c534c097c8009d4022daff4027655d207] | committer: Rémi Denis-Courmont lavc/sbrdsp: R-V V autocorrelate With 5 accumulator vectors and 6 inputs, this can only use LMUL=2. Also the number of vector loop iterations is small, just 5 on 128-bit vector hardware. The vector loop is somewhat unusual in that it processes data in descending memory order, in order to save on vector slides: in descending order, we can extract elements to carry over to the next iteration from the bottom of the vectors directly. With ascending order (see in the Opus postfilter function), there are no ways to get the top elements directly. On the downside, this requires the use of separate shift and sub (the would-be SH3SUB instruction does not exist), with a small pipeline stall on the vector load address. The edge cases in scalar are done in scalar as this saves on loads and remains significantly faster than C. autocorrelate_c: 669.2 autocorrelate_rvv_f32: 421.0 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd7b352c534c097c8009d4022daff4027655d207 --- libavcodec/riscv/sbrdsp_init.c | 12 -- libavcodec/riscv/sbrdsp_rvv.S | 89 ++ 2 files changed, 97 insertions(+), 4 deletions(-) diff --git a/libavcodec/riscv/sbrdsp_init.c b/libavcodec/riscv/sbrdsp_init.c index 71de681185..c1ed5b639c 100644 --- a/libavcodec/riscv/sbrdsp_init.c +++ b/libavcodec/riscv/sbrdsp_init.c @@ -26,6 +26,7 @@ void ff_sbr_sum64x5_rvv(float *z); float ff_sbr_sum_square_rvv(float (*x)[2], int n); void ff_sbr_neg_odd_64_rvv(float *x); +void ff_sbr_autocorrelate_rvv(const float x[40][2], float phi[3][2][2]); 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); @@ -34,10 +35,13 @@ av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c) #if HAVE_RVV int flags = av_get_cpu_flags(); -if ((flags & AV_CPU_FLAG_RVV_F32) && (flags & AV_CPU_FLAG_RVB_ADDR)) { -c->sum64x5 = ff_sbr_sum64x5_rvv; -c->sum_square = ff_sbr_sum_square_rvv; -c->hf_g_filt = ff_sbr_hf_g_filt_rvv; +if (flags & AV_CPU_FLAG_RVV_F32) { +if (flags & AV_CPU_FLAG_RVB_ADDR) { +c->sum64x5 = ff_sbr_sum64x5_rvv; +c->sum_square = ff_sbr_sum_square_rvv; +c->hf_g_filt = ff_sbr_hf_g_filt_rvv; +} +c->autocorrelate = ff_sbr_autocorrelate_rvv; } #if __riscv_xlen >= 64 if ((flags & AV_CPU_FLAG_RVV_I64) && (flags & AV_CPU_FLAG_RVB_ADDR)) diff --git a/libavcodec/riscv/sbrdsp_rvv.S b/libavcodec/riscv/sbrdsp_rvv.S index 932a5dd7d1..2f3a0969d7 100644 --- a/libavcodec/riscv/sbrdsp_rvv.S +++ b/libavcodec/riscv/sbrdsp_rvv.S @@ -85,6 +85,95 @@ func ff_sbr_neg_odd_64_rvv, zve64x endfunc #endif +func ff_sbr_autocorrelate_rvv, zve32f +vsetvli t0, zero, e32, m4, ta, ma +vmv.v.x v0, zero +flw fa0, (a0) +vmv.v.x v4, zero +flw fa1, 4(a0) +vmv.v.x v8, zero +flw fa2, 8(a0) +li a2, 37 +flw fa3, 12(a0) +fmul.s ft10, fa0, fa0 +flw fa4, 16(a0) +fmul.s ft6, fa0, fa2 +flw fa5, 20(a0) +addia0, a0, 38 * 8 +fmul.s ft7, fa0, fa3 +fmul.s ft2, fa0, fa4 +fmul.s ft3, fa0, fa5 +flw fa0, (a0) +fmadd.s ft10, fa1, fa1, ft10 +fmadd.s ft6, fa1, fa3, ft6 +flw fa3, 12(a0) +fnmsub.s ft7, fa1, fa2, ft7 +flw fa2, 8(a0) +fmadd.s ft2, fa1, fa5, ft2 +fnmsub.s ft3, fa1, fa4, ft3 +flw fa1, 4(a0) +fmul.s ft4, fa0, fa0 +fmul.s ft0, fa0, fa2 +fmul.s ft1, fa0, fa3 +fmadd.s ft4, fa1, fa1, ft4 +fmadd.s ft0, fa1, fa3, ft0 +fnmsub.s ft1, fa1, fa2, ft1 +1: +vsetvli t0, a2, e32, m2, tu, ma +sllit1, t0, 3 +sub a0, a0, t1 +vlseg2e32.v v16, (a0) +sub a2, a2, t0 +vfmacc.vv v0, v16, v16 +vfslide1down.vf v20, v16, fa0 +vfmacc.vv v4, v16, v20 +vfslide1down.vf v22, v18, fa1 +vfmacc.vv v0, v18, v18 +vfslide1down.vf v24, v20, fa2 +vfmacc.vv v4, v18, v22 +vfslide1down.vf v26, v22, fa3 +vfmacc.vv v6, v16, v22 +vfmv.f.s fa0, v16 +vfmacc.vv v8, v16, v24 +vfmv.f.s fa1, v18 +vfmacc.vv v10, v16, v26 +vfmv.f.s fa2, v20 +vfnmsac.vv v6, v18, v20 +vfmv.f.s fa3, v22 +vfmacc.vv v8, v18, v26 +vfnmsac.vv v10, v18, v24 +bneza2, 1b + +vsetvli t0, zero, e32, m2, ta, ma +vfredusum.vs v0, v0, v2 +vfredusum.vs v4, v4, v2 +vfmv.f.s fa0, v0 +vfredusum.vs v6, v6, v2 +vfmv.f.s fa2, v4 +fadd.s ft4, ft4, fa0 +vfredusum.vs v8, v8, v2 +vfmv.f.s fa3, v6 +fadd.s f
[FFmpeg-cvslog] Tag n6.2-dev : Main development, master branch after release/6.1 branched off
[ffmpeg] [branch: refs/tags/n6.2-dev] Tag:01d94eb55b0de36db31121010378497ed05eeeb2 > http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=01d94eb55b0de36db31121010378497ed05eeeb2 Tagger: James Almer Date: Sun Nov 12 13:33:18 2023 -0300 Main development, master branch after release/6.1 branched off ___ 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] avcodec/fft: Use av_mallocz to avoid invalid free/uninit
ffmpeg | branch: master | Sebastian Ramacher | Sun Nov 12 18:46:27 2023 +0100| [a562cfee2e214252f8b3f516527272ae32ef9532] | committer: James Almer avcodec/fft: Use av_mallocz to avoid invalid free/uninit Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a562cfee2e214252f8b3f516527272ae32ef9532 --- libavcodec/avfft.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c index fb635abfff..3ef076d222 100644 --- a/libavcodec/avfft.c +++ b/libavcodec/avfft.c @@ -46,7 +46,7 @@ FFTContext *av_fft_init(int nbits, int inverse) { int ret; float scale = 1.0f; -AVTXWrapper *s = av_malloc(sizeof(*s)); +AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -85,7 +85,7 @@ FFTContext *av_mdct_init(int nbits, int inverse, double scale) { int ret; float scale_f = scale; -AVTXWrapper *s = av_malloc(sizeof(*s)); +AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -146,7 +146,7 @@ RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) if (trans != IDFT_C2R && trans != DFT_R2C) return NULL; -s = av_malloc(sizeof(*s)); +s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -199,7 +199,7 @@ DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse) [DST_I] = AV_TX_FLOAT_DST_I, }; -AVTXWrapper *s = av_malloc(sizeof(*s)); +AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcoded/fft: Fix memory leak if ctx2 is used
ffmpeg | branch: master | Sebastian Ramacher | Sun Nov 12 18:46:28 2023 +0100| [250471ea1745fc703eb346a2a662304536a311b1] | committer: James Almer avcoded/fft: Fix memory leak if ctx2 is used Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=250471ea1745fc703eb346a2a662304536a311b1 --- libavcodec/avfft.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c index 3ef076d222..999b5ed79a 100644 --- a/libavcodec/avfft.c +++ b/libavcodec/avfft.c @@ -130,6 +130,7 @@ av_cold void av_mdct_end(FFTContext *s) { if (s) { AVTXWrapper *w = (AVTXWrapper *)s; +av_tx_uninit(&w->ctx2); av_tx_uninit(&w->ctx); av_free(w); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/fft: Use av_mallocz to avoid invalid free/uninit
ffmpeg | branch: release/6.1 | Sebastian Ramacher | Sun Nov 12 18:46:27 2023 +0100| [af912d80d8880797bef9f2ba9809ecd84ed9acd9] | committer: James Almer avcodec/fft: Use av_mallocz to avoid invalid free/uninit Signed-off-by: James Almer (cherry picked from commit a562cfee2e214252f8b3f516527272ae32ef9532) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=af912d80d8880797bef9f2ba9809ecd84ed9acd9 --- libavcodec/avfft.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c index fb635abfff..3ef076d222 100644 --- a/libavcodec/avfft.c +++ b/libavcodec/avfft.c @@ -46,7 +46,7 @@ FFTContext *av_fft_init(int nbits, int inverse) { int ret; float scale = 1.0f; -AVTXWrapper *s = av_malloc(sizeof(*s)); +AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -85,7 +85,7 @@ FFTContext *av_mdct_init(int nbits, int inverse, double scale) { int ret; float scale_f = scale; -AVTXWrapper *s = av_malloc(sizeof(*s)); +AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -146,7 +146,7 @@ RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) if (trans != IDFT_C2R && trans != DFT_R2C) return NULL; -s = av_malloc(sizeof(*s)); +s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -199,7 +199,7 @@ DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse) [DST_I] = AV_TX_FLOAT_DST_I, }; -AVTXWrapper *s = av_malloc(sizeof(*s)); +AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcoded/fft: Fix memory leak if ctx2 is used
ffmpeg | branch: release/6.1 | Sebastian Ramacher | Sun Nov 12 18:46:28 2023 +0100| [c7fe7ee8d4dcae510453abedabae53e45135144a] | committer: James Almer avcoded/fft: Fix memory leak if ctx2 is used Signed-off-by: James Almer (cherry picked from commit 250471ea1745fc703eb346a2a662304536a311b1) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c7fe7ee8d4dcae510453abedabae53e45135144a --- libavcodec/avfft.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c index 3ef076d222..999b5ed79a 100644 --- a/libavcodec/avfft.c +++ b/libavcodec/avfft.c @@ -130,6 +130,7 @@ av_cold void av_mdct_end(FFTContext *s) { if (s) { AVTXWrapper *w = (AVTXWrapper *)s; +av_tx_uninit(&w->ctx2); av_tx_uninit(&w->ctx); av_free(w); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] checkasm: test with random bw value
ffmpeg | branch: master | Rémi Denis-Courmont | Thu Nov 9 22:25:47 2023 +0200| [427347309b44471448668b47cccf9360f177bfe9] | committer: Rémi Denis-Courmont checkasm: test with random bw value With a value of zero, the function is a glorified memory copy. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=427347309b44471448668b47cccf9360f177bfe9 --- tests/checkasm/sbrdsp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/checkasm/sbrdsp.c b/tests/checkasm/sbrdsp.c index 2fb14d5bf8..5cc3b33215 100644 --- a/tests/checkasm/sbrdsp.c +++ b/tests/checkasm/sbrdsp.c @@ -190,8 +190,8 @@ static void test_hf_gen(void) for (i = 2; i < 64; i += 2) { memset(dst0, 0, 128 * 2 * sizeof(INTFLOAT)); memset(dst1, 0, 128 * 2 * sizeof(INTFLOAT)); -call_ref(dst0, low, alpha0, alpha1, 0.0, i, 128); -call_new(dst1, low, alpha0, alpha1, 0.0, i, 128); +call_ref(dst0, low, alpha0, alpha1, bw, i, 128); +call_new(dst1, low, alpha0, alpha1, bw, i, 128); if (!float_near_abs_eps_array((INTFLOAT *)dst0, (INTFLOAT *)dst1, EPS, 128 * 2)) fail(); bench_new(dst1, low, alpha0, alpha1, bw, i, 128); ___ 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] libavcodec/amfenc: Fix issue with missing headers in AV1 encoder
ffmpeg | branch: master | Evgeny Pavlov | Wed Jul 12 15:35:14 2023 +0200| [da3ce21f687932932030b39c38fc820bee6ff351] | committer: Dmitrii Ovchinnikov libavcodec/amfenc: Fix issue with missing headers in AV1 encoder This commit fixes issue with missing SPS/PPS headers in video encoded by AMF AV1 encoder. Missing headers leads to broken seek in MPV video player. Default value for property AV1_HEADER_INSERTION_MODE shouldn't be setup to NONE (no headers insertion). We need to skip definition of this property, because default value depends on USAGE property. Signed-off-by: Dmitrii Ovchinnikov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da3ce21f687932932030b39c38fc820bee6ff351 --- libavcodec/amfenc_av1.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/amfenc_av1.c b/libavcodec/amfenc_av1.c index 8f13aea29e..3f164ccc59 100644 --- a/libavcodec/amfenc_av1.c +++ b/libavcodec/amfenc_av1.c @@ -77,7 +77,7 @@ static const AVOption options[] = { { "qvbr_quality_level", "Sets the QVBR quality level", OFFSET(qvbr_quality_level), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 51, VE }, -{ "header_insertion_mode", "Set header insertion mode", OFFSET(header_insertion_mode), AV_OPT_TYPE_INT,{.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_NONE }, AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_NONE, AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_KEY_FRAME_ALIGNED, VE, "hdrmode" }, +{ "header_insertion_mode", "Set header insertion mode", OFFSET(header_insertion_mode), AV_OPT_TYPE_INT,{.i64 = -1 }, -1, AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_KEY_FRAME_ALIGNED, VE, "hdrmode" }, { "none", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_NONE }, 0, 0, VE, "hdrmode" }, { "gop","", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_GOP_ALIGNED }, 0, 0, VE, "hdrmode" }, { "frame", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_KEY_FRAME_ALIGNED }, 0, 0, VE, "hdrmode" }, @@ -220,7 +220,9 @@ FF_ENABLE_DEPRECATION_WARNINGS // Picture control properties AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_GOP_SIZE, avctx->gop_size); -AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE, ctx->header_insertion_mode); +// Setup header insertion mode only if this option was defined explicitly +if (ctx->header_insertion_mode != -1) +AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE, ctx->header_insertion_mode); // Rate control // autodetect rate control method ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/buffersrc: switch to activate
ffmpeg | branch: master | Paul B Mahol | Fri Oct 27 14:26:50 2023 +0200| [84e400ae37b1e2849a3ead399ef86c808356cdd6] | committer: Paul B Mahol avfilter/buffersrc: switch to activate Fixes OOM when caller keeps adding frames into filtergraph that reached EOF by other means, for example EOF is signalled by other filter in filtergraph or by buffersink. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=84e400ae37b1e2849a3ead399ef86c808356cdd6 --- libavfilter/buffersrc.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 453fc0fd5c..b0a905d455 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -36,6 +36,7 @@ #include "audio.h" #include "avfilter.h" #include "buffersrc.h" +#include "filters.h" #include "formats.h" #include "internal.h" #include "video.h" @@ -194,7 +195,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (!frame) return av_buffersrc_close(ctx, s->last_pts, flags); if (s->eof) -return AVERROR(EINVAL); +return AVERROR_EOF; s->last_pts = frame->pts + frame->duration; @@ -484,21 +485,28 @@ static int config_props(AVFilterLink *link) return 0; } -static int request_frame(AVFilterLink *link) +static int activate(AVFilterContext *ctx) { -BufferSourceContext *c = link->src->priv; +AVFilterLink *outlink = ctx->outputs[0]; +BufferSourceContext *c = ctx->priv; -if (c->eof) -return AVERROR_EOF; +if (!c->eof && ff_outlink_get_status(outlink)) { +c->eof = 1; +return 0; +} + +if (c->eof) { +ff_outlink_set_status(outlink, AVERROR_EOF, c->last_pts); +return 0; +} c->nb_failed_requests++; -return AVERROR(EAGAIN); +return FFERROR_NOT_READY; } static const AVFilterPad avfilter_vsrc_buffer_outputs[] = { { .name = "default", .type = AVMEDIA_TYPE_VIDEO, -.request_frame = request_frame, .config_props = config_props, }, }; @@ -507,7 +515,7 @@ const AVFilter ff_vsrc_buffer = { .name = "buffer", .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them accessible to the filterchain."), .priv_size = sizeof(BufferSourceContext), - +.activate = activate, .init = init_video, .uninit= uninit, @@ -521,7 +529,6 @@ static const AVFilterPad avfilter_asrc_abuffer_outputs[] = { { .name = "default", .type = AVMEDIA_TYPE_AUDIO, -.request_frame = request_frame, .config_props = config_props, }, }; @@ -530,7 +537,7 @@ const AVFilter ff_asrc_abuffer = { .name = "abuffer", .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them accessible to the filterchain."), .priv_size = sizeof(BufferSourceContext), - +.activate = activate, .init = init_audio, .uninit= uninit, ___ 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] avcodec/libsvtav1: add version guard for external param
ffmpeg | branch: master | Gyan Doshi | Wed Nov 8 10:33:19 2023 +0530| [67a2571a5547d39990e7f709f24d7a5b452ff8b9] | committer: Gyan Doshi avcodec/libsvtav1: add version guard for external param Setting of external param 'force_key_frames' was added in 7bcc1b4eb8. It is available since v1.1.0 but ffmpeg allows linking against v0.9.0. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=67a2571a5547d39990e7f709f24d7a5b452ff8b9 --- libavcodec/libsvtav1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 8d2c7f3be4..862192945b 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -250,6 +250,7 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, if (avctx->gop_size > 1) param->intra_period_length = avctx->gop_size - 1; +#if SVT_AV1_CHECK_VERSION(1, 1, 0) // In order for SVT-AV1 to force keyframes by setting pic_type to // EB_AV1_KEY_PICTURE on any frame, force_key_frames has to be set. Note // that this does not force all frames to be keyframes (it only forces a @@ -260,6 +261,7 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, // to be updated to set force_key_frames accordingly. if (avctx->gop_size == 1) param->force_key_frames = 1; +#endif if (avctx->framerate.num > 0 && avctx->framerate.den > 0) { param->frame_rate_numerator = avctx->framerate.num; ___ 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".