[FFmpeg-cvslog] opusdsp: add ability to modify deemphasis constant
ffmpeg | branch: master | Lynne | Mon Jan 29 04:31:43 2024 +0100| [134dba9544f4251ebf5fbbae72f2cddc390ac195] | committer: Lynne opusdsp: add ability to modify deemphasis constant xHE-AAC relies on the same postfilter mechanism that Opus uses to improve clarity (albeit with a steeper deemphasis filter). The code to apply it is identical, it's still just a simple IIR low-pass filter. This commit makes it possible to use alternative constants. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=134dba9544f4251ebf5fbbae72f2cddc390ac195 --- libavcodec/aarch64/opusdsp_init.c | 2 +- libavcodec/aarch64/opusdsp_neon.S | 28 +--- libavcodec/opusdec_celt.c | 6 -- libavcodec/opusdsp.c | 6 -- libavcodec/opusdsp.h | 4 +--- libavcodec/opusenc.c | 5 +++-- libavcodec/opustab.c | 28 libavcodec/opustab.h | 2 ++ libavcodec/x86/opusdsp.asm| 9 +++-- libavcodec/x86/opusdsp_init.c | 2 +- tests/checkasm/opusdsp.c | 9 + 11 files changed, 57 insertions(+), 44 deletions(-) diff --git a/libavcodec/aarch64/opusdsp_init.c b/libavcodec/aarch64/opusdsp_init.c index bb6d71b66b..a727006593 100644 --- a/libavcodec/aarch64/opusdsp_init.c +++ b/libavcodec/aarch64/opusdsp_init.c @@ -23,7 +23,7 @@ #include "libavcodec/opusdsp.h" void ff_opus_postfilter_neon(float *data, int period, float *gains, int len); -float ff_opus_deemphasis_neon(float *out, float *in, float coeff, int len); +float ff_opus_deemphasis_neon(float *out, float *in, float coeff, const float *weights, int len); av_cold void ff_opus_dsp_init_aarch64(OpusDSP *ctx) { diff --git a/libavcodec/aarch64/opusdsp_neon.S b/libavcodec/aarch64/opusdsp_neon.S index e933151ab4..253825aa61 100644 --- a/libavcodec/aarch64/opusdsp_neon.S +++ b/libavcodec/aarch64/opusdsp_neon.S @@ -18,29 +18,11 @@ #include "libavutil/aarch64/asm.S" - // 0.85..^10.85..^20.85..^30.85..^4 -const tab_st, align=4 -.word 0x3f599a00, 0x3f38f671, 0x3f1d382a, 0x3f05a32f -endconst -const tab_x0, align=4 -.word 0x0,0x3f599a00, 0x3f38f671, 0x3f1d382a -endconst -const tab_x1, align=4 -.word 0x0,0x0,0x3f599a00, 0x3f38f671 -endconst -const tab_x2, align=4 -.word 0x0,0x0,0x0,0x3f599a00 -endconst - function ff_opus_deemphasis_neon, export=1 -movrel x4, tab_st -ld1 {v4.4s}, [x4] -movrel x4, tab_x0 -ld1 {v5.4s}, [x4] -movrel x4, tab_x1 -ld1 {v6.4s}, [x4] -movrel x4, tab_x2 -ld1 {v7.4s}, [x4] +ld1 {v4.4s}, [x2], #16 +ld1 {v5.4s}, [x2], #16 +ld1 {v6.4s}, [x2], #16 +ld1 {v7.4s}, [x2] fmulv0.4s, v4.4s, v0.s[0] @@ -63,7 +45,7 @@ function ff_opus_deemphasis_neon, export=1 st1 {v1.4s, v2.4s}, [x0], #32 fmulv0.4s, v4.4s, v2.s[3] -subsw2, w2, #8 +subsw3, w3, #8 b.gt1b mov s0, v2.s[3] diff --git a/libavcodec/opusdec_celt.c b/libavcodec/opusdec_celt.c index fd8e9929e9..b19342337d 100644 --- a/libavcodec/opusdec_celt.c +++ b/libavcodec/opusdec_celt.c @@ -460,7 +460,9 @@ int ff_celt_decode_frame(CeltFrame *f, OpusRangeCoder *rc, /* deemphasis */ block->emph_coeff = f->opusdsp.deemphasis(output[i], &block->buf[1024 - frame_size], - block->emph_coeff, frame_size); + block->emph_coeff, + ff_opus_deemph_weights, + frame_size); } if (channels == 1) @@ -516,7 +518,7 @@ void ff_celt_flush(CeltFrame *f) * a lesser discontinuity when seeking. * The deemphasis functions differ from libopus in that they require * an initial state divided by the coefficient. */ -block->emph_coeff = 0.0f / CELT_EMPH_COEFF; +block->emph_coeff = 0.0f / ff_opus_deemph_weights[0]; } f->seed = 0; diff --git a/libavcodec/opusdsp.c b/libavcodec/opusdsp.c index 0764d712e4..e61cc36098 100644 --- a/libavcodec/opusdsp.c +++ b/libavcodec/opusdsp.c @@ -18,6 +18,7 @@ #include "config.h" #include "libavutil/attributes.h" +#include "libavutil/mem_internal.h" #include "opusdsp.h" static void postfilter_c(float *data, int period, float *gains, int len) @@ -43,10 +44,11 @@ static void postfilter_c(float *data, int period, float *gains, int len) } } -static float deemphasis_c(float *y, float *x, float coeff, int len) +static float deemphasis_c(float *y, floa
[FFmpeg-cvslog] aacdec: avoid generating unused code when either implementation is disabled
ffmpeg | branch: master | Lynne | Wed Apr 24 13:01:14 2024 +0200| [3390693bfb907765f833766f370e0ba8c7894f44] | committer: Lynne aacdec: avoid generating unused code when either implementation is disabled Minor optimization to remove extra branches. We need to include the header for xHE anyway, which is float-only. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3390693bfb907765f833766f370e0ba8c7894f44 --- libavcodec/aac/aacdec.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c index 4a29c1b092..72f2d7e7ba 100644 --- a/libavcodec/aac/aacdec.c +++ b/libavcodec/aac/aacdec.c @@ -33,6 +33,8 @@ * for which we need this to be defined for them to work as expected. */ #define USE_FIXED 1 +#include "config_components.h" + #include #include @@ -1312,9 +1314,9 @@ static void decode_ltp(AACDecContext *ac, LongTermPrediction *ltp, int sfb; ltp->lag = get_bits(gb, 11); -if (ac->is_fixed) +if (CONFIG_AAC_FIXED_DECODER && ac->is_fixed) ltp->coef_fixed = Q30(ff_ltp_coef[get_bits(gb, 3)]); -else +else if (CONFIG_AAC_DECODER) ltp->coef = ff_ltp_coef[get_bits(gb, 3)]; for (sfb = 0; sfb < FFMIN(max_sfb, MAX_LTP_LONG_SFB); sfb++) @@ -1623,9 +1625,9 @@ static int decode_tns(AACDecContext *ac, TemporalNoiseShaping *tns, tmp2_idx = 2 * coef_compress + coef_res; for (i = 0; i < tns->order[w][filt]; i++) { -if (ac->is_fixed) +if (CONFIG_AAC_FIXED_DECODER && ac->is_fixed) tns->coef_fixed[w][filt][i] = Q31(ff_tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)]); -else +else if (CONFIG_AAC_DECODER) tns->coef[w][filt][i] = ff_tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)]; } } @@ -1974,9 +1976,9 @@ static int decode_extension_payload(AACDecContext *ac, GetBitContext *gb, int cn ac->avctx->profile = AV_PROFILE_AAC_HE; } -if (ac->is_fixed) +if (CONFIG_AAC_FIXED_DECODER && ac->is_fixed) res = ff_aac_sbr_decode_extension_fixed(ac, che, gb, crc_flag, cnt, elem_type); -else +else if (CONFIG_AAC_DECODER) res = ff_aac_sbr_decode_extension(ac, che, gb, crc_flag, cnt, elem_type); @@ -2087,11 +2089,11 @@ static void spectral_to_sample(AACDecContext *ac, int samples) ac->dsp.update_ltp(ac, &che->ch[1]); } if (ac->oc[1].m4ac.sbr > 0) { -if (ac->is_fixed) +if (CONFIG_AAC_FIXED_DECODER && ac->is_fixed) ff_aac_sbr_apply_fixed(ac, che, type, (void *)che->ch[0].output, (void *)che->ch[1].output); -else +else if (CONFIG_AAC_DECODER) ff_aac_sbr_apply(ac, che, type, (void *)che->ch[0].output, (void *)che->ch[1].output); @@ -2550,6 +2552,7 @@ static const AVClass decoder_class = { .version= LIBAVUTIL_VERSION_INT, }; +#if CONFIG_AAC_DECODER const FFCodec ff_aac_decoder = { .p.name = "aac", CODEC_LONG_NAME("AAC (Advanced Audio Coding)"), @@ -2569,7 +2572,9 @@ const FFCodec ff_aac_decoder = { .flush = flush, .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), }; +#endif +#if CONFIG_AAC_FIXED_DECODER const FFCodec ff_aac_fixed_decoder = { .p.name = "aac_fixed", CODEC_LONG_NAME("AAC (Advanced Audio Coding)"), @@ -2589,3 +2594,4 @@ const FFCodec ff_aac_fixed_decoder = { .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), .flush = flush, }; +#endif ___ 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/vp8: Return error on error
ffmpeg | branch: master | Andreas Rheinhardt | Sat Apr 27 12:24:05 2024 +0200| [67c7c44c7956c4ecde0d36652f3d34bca13bffdb] | committer: Andreas Rheinhardt avcodec/vp8: Return error on error Regression since e1ba00ac8f755f37ebc8448d3dbea906d7b79da2. Reviewed-by: Ronald S. Bultje Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=67c7c44c7956c4ecde0d36652f3d34bca13bffdb --- libavcodec/vp8.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index f37938ad27..19f32b3400 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -107,8 +107,11 @@ static int vp8_alloc_frame(VP8Context *s, VP8Frame *f, int ref) ref ? AV_GET_BUFFER_FLAG_REF : 0); if (ret < 0) return ret; -if (!(f->seg_map = ff_refstruct_allocz(s->mb_width * s->mb_height))) +f->seg_map = ff_refstruct_allocz(s->mb_width * s->mb_height); +if (!f->seg_map) { +ret = AVERROR(ENOMEM); goto fail; +} ret = ff_hwaccel_frame_priv_alloc(s->avctx, &f->hwaccel_picture_private); if (ret < 0) goto fail; ___ 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_filter: Fix check
ffmpeg | branch: master | Andreas Rheinhardt | Mon Apr 22 23:22:09 2024 +0200| [4c8a6631ad13b6d68b7190507aa7a630a73884c9] | committer: Andreas Rheinhardt fftools/ffmpeg_filter: Fix check Fixes Coverity issues #1596529, #1596531. Introduced in 8e35e33d42efb89ff7e3da92b841a3b43a5a95bc. Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4c8a6631ad13b6d68b7190507aa7a630a73884c9 --- fftools/ffmpeg_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index f108f8daf9..382d0f75b1 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -862,7 +862,7 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, ofp->fps.vsync_method= opts->vsync_method; ofp->fps.framerate = ost->frame_rate; ofp->fps.framerate_max = ost->max_frame_rate; -ofp->fps.framerate_supported = ost->force_fps && opts->enc ? +ofp->fps.framerate_supported = ost->force_fps || !opts->enc ? NULL : opts->enc->supported_framerates; // reduce frame rate for mpeg4 to be within the spec limits ___ 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/hevcdec: Check ref frame
ffmpeg | branch: master | Michael Niedermayer | Sat Apr 27 00:09:02 2024 +0200| [5eb05f44503da3fdff82f1fed8ee2706d9841a9a] | committer: Michael Niedermayer avcodec/hevcdec: Check ref frame Fixes: NULL pointer dereferences Fixes: 68197/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-6382538823106560 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Andreas Rheinhardt Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5eb05f44503da3fdff82f1fed8ee2706d9841a9a --- libavcodec/hevcdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index fcfb275f63..b41dc46053 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -1969,13 +1969,13 @@ static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0, if (current_mv.pred_flag & PF_L0) { ref0 = refPicList[0].ref[current_mv.ref_idx[0]]; -if (!ref0 || !ref0->frame->data[0]) +if (!ref0 || !ref0->frame) return; hevc_await_progress(s, ref0, ¤t_mv.mv[0], y0, nPbH); } if (current_mv.pred_flag & PF_L1) { ref1 = refPicList[1].ref[current_mv.ref_idx[1]]; -if (!ref1 || !ref1->frame->data[0]) +if (!ref1 || !ref1->frame) return; hevc_await_progress(s, ref1, ¤t_mv.mv[1], y0, nPbH); } ___ 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/pngdec: Check last AVFrame before deref
ffmpeg | branch: master | Michael Niedermayer | Fri Apr 26 23:22:53 2024 +0200| [091fdce87e88c8622d8af89ffa6cbb0dc20c3816] | committer: Michael Niedermayer avcodec/pngdec: Check last AVFrame before deref Fixes: NULL pointer dereference Fixes: 68184/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-4926478069334016 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=091fdce87e88c8622d8af89ffa6cbb0dc20c3816 --- libavcodec/pngdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index f7751223b8..8934a95a7f 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1218,7 +1218,7 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s, return AVERROR_INVALIDDATA; } -if ((sequence_number == 0 || !s->last_picture.f->data[0]) && +if ((sequence_number == 0 || !s->last_picture.f) && dispose_op == APNG_DISPOSE_OP_PREVIOUS) { // No previous frame to revert to for the first frame // Spec says to just treat it as a APNG_DISPOSE_OP_BACKGROUND ___ 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/vp3: Call ff_progress_frame_unref() before ff_progress_frame_get_buffer()
ffmpeg | branch: master | Michael Niedermayer | Fri Apr 26 23:46:38 2024 +0200| [d9699464c3b2b2b02f21d60ead49c8eb829052fb] | committer: Michael Niedermayer avcodec/vp3: Call ff_progress_frame_unref() before ff_progress_frame_get_buffer() Fixes: Assertion !f->f && !f->progress failed at libavcodec/decode.c:1688 Fixes: 68190/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-5942090287611904 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Andreas Rheinhardt Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d9699464c3b2b2b02f21d60ead49c8eb829052fb --- libavcodec/vp3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 2a5f68dfa8..0952760776 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2651,6 +2651,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (avctx->skip_frame >= AVDISCARD_NONKEY && !s->keyframe) return buf_size; +ff_progress_frame_unref(&s->current_frame); ret = ff_progress_frame_get_buffer(avctx, &s->current_frame, AV_GET_BUFFER_FLAG_REF); if (ret < 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] fate: allow https for git URLs
ffmpeg | branch: master | Timo Rothenpieler | Wed Apr 24 22:00:39 2024 +0200| [59767636c77fa9014587c3084bbc210f65a5cd2a] | committer: Timo Rothenpieler fate: allow https for git URLs > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=59767636c77fa9014587c3084bbc210f65a5cd2a --- tests/fate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fate.sh b/tests/fate.sh index c5ee18de80..4081e865ae 100755 --- a/tests/fate.sh +++ b/tests/fate.sh @@ -30,14 +30,14 @@ lock(){ checkout(){ case "$repo" in file:*|/*) src="${repo#file:}" ;; -git:*) git clone --quiet --branch "$branch" "$repo" "$src" ;; +git:*|https:*) git clone --quiet --branch "$branch" "$repo" "$src" ;; esac } update()( cd ${src} || return case "$repo" in -git:*) git fetch --quiet --force && git reset --quiet --hard "origin/$branch" ;; +git:*|https:*) git fetch --quiet --force && git reset --quiet --hard "origin/$branch" ;; esac ) ___ 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/mov: fix the check for the heif item parsing loop
ffmpeg | branch: master | James Almer | Sat Apr 27 19:38:13 2024 -0300| [31327c2d075a413749c1461c06382993b9bba90e] | committer: James Almer avformat/mov: fix the check for the heif item parsing loop Fixes: Null pointer dereference Fixes: 67861/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5352628142800896 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=31327c2d075a413749c1461c06382993b9bba90e --- libavformat/mov.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index ecd29a7d08..ede25d3342 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -9440,7 +9440,8 @@ static int mov_parse_tiles(AVFormatContext *s) break; } -if (k == grid->nb_tiles) { +if (k == mov->nb_heif_item) { +av_assert0(loop); av_log(s, AV_LOG_WARNING, "HEIF item id %d referenced by grid id %d doesn't " "exist\n", tile_id, grid->item->item_id); ___ 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".