* [FFmpeg-devel] [PATCH] avcodec/on2avc: use correct fft sizes @ 2023-08-06 12:42 Marton Balint 2023-08-06 17:35 ` Lynne 0 siblings, 1 reply; 5+ messages in thread From: Marton Balint @ 2023-08-06 12:42 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Marton Balint With the earlier patch this fixes the audio corruption regression caused by 6ba0aa1770ba29eb4126c6a706f6b0cd3809648f. Fixes ticket #10029. Signed-off-by: Marton Balint <cus@passwd.hu> --- libavcodec/on2avc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c index 474adb149d..0d0869bc9c 100644 --- a/libavcodec/on2avc.c +++ b/libavcodec/on2avc.c @@ -956,13 +956,13 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) if ((ret = av_tx_init(&c->mdct_small, &c->mdct_small_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft1024, &c->fft1024_fn, AV_TX_FLOAT_FFT, 1, 1024, NULL, 0)) < 0) + if ((ret = av_tx_init(&c->fft1024, &c->fft1024_fn, AV_TX_FLOAT_FFT, 1, 512, NULL, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft512, &c->fft512_fn, AV_TX_FLOAT_FFT, 1, 512, NULL, 0)) < 0) + if ((ret = av_tx_init(&c->fft512, &c->fft512_fn, AV_TX_FLOAT_FFT, 1, 256, NULL, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 0, 256, NULL, 0)) < 0) + if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 0, 128, NULL, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft128, &c->fft128_fn, AV_TX_FLOAT_FFT, 0, 128, NULL, 0)) < 0) + if ((ret = av_tx_init(&c->fft128, &c->fft128_fn, AV_TX_FLOAT_FFT, 0, 64, NULL, 0)) < 0) return ret; c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); -- 2.35.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-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/on2avc: use correct fft sizes 2023-08-06 12:42 [FFmpeg-devel] [PATCH] avcodec/on2avc: use correct fft sizes Marton Balint @ 2023-08-06 17:35 ` Lynne 2023-08-06 19:41 ` [FFmpeg-devel] [PATCH v2] " Marton Balint 0 siblings, 1 reply; 5+ messages in thread From: Lynne @ 2023-08-06 17:35 UTC (permalink / raw) To: FFmpeg development discussions and patches Aug 6, 2023, 14:42 by cus@passwd.hu: > With the earlier patch this fixes the audio corruption regression caused by > 6ba0aa1770ba29eb4126c6a706f6b0cd3809648f. > > Fixes ticket #10029. > > Signed-off-by: Marton Balint <cus@passwd.hu> > --- > libavcodec/on2avc.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c > index 474adb149d..0d0869bc9c 100644 > --- a/libavcodec/on2avc.c > +++ b/libavcodec/on2avc.c > @@ -956,13 +956,13 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) > if ((ret = av_tx_init(&c->mdct_small, &c->mdct_small_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0)) < 0) > return ret; > > - if ((ret = av_tx_init(&c->fft1024, &c->fft1024_fn, AV_TX_FLOAT_FFT, 1, 1024, NULL, 0)) < 0) > + if ((ret = av_tx_init(&c->fft1024, &c->fft1024_fn, AV_TX_FLOAT_FFT, 1, 512, NULL, 0)) < 0) > return ret; > - if ((ret = av_tx_init(&c->fft512, &c->fft512_fn, AV_TX_FLOAT_FFT, 1, 512, NULL, 0)) < 0) > + if ((ret = av_tx_init(&c->fft512, &c->fft512_fn, AV_TX_FLOAT_FFT, 1, 256, NULL, 0)) < 0) > return ret; > - if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 0, 256, NULL, 0)) < 0) > + if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 0, 128, NULL, 0)) < 0) > return ret; > - if ((ret = av_tx_init(&c->fft128, &c->fft128_fn, AV_TX_FLOAT_FFT, 0, 128, NULL, 0)) < 0) > + if ((ret = av_tx_init(&c->fft128, &c->fft128_fn, AV_TX_FLOAT_FFT, 0, 64, NULL, 0)) < 0) > return ret; > > c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); > -- > 2.35.3 > Could you rename the contexts and functions so they're not misleading? 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-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 5+ messages in thread
* [FFmpeg-devel] [PATCH v2] avcodec/on2avc: use correct fft sizes 2023-08-06 17:35 ` Lynne @ 2023-08-06 19:41 ` Marton Balint 2023-08-07 4:40 ` Lynne 0 siblings, 1 reply; 5+ messages in thread From: Marton Balint @ 2023-08-06 19:41 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Marton Balint Also rename the contexts and the functions so their names will reflect their intended size. With the earlier patch this fixes the audio corruption regression caused by 6ba0aa1770ba29eb4126c6a706f6b0cd3809648f. Fixes ticket #10029. Signed-off-by: Marton Balint <cus@passwd.hu> --- libavcodec/on2avc.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c index 474adb149d..b190f36e19 100644 --- a/libavcodec/on2avc.c +++ b/libavcodec/on2avc.c @@ -51,9 +51,9 @@ typedef struct On2AVCContext { AVCodecContext *avctx; AVFloatDSPContext *fdsp; AVTXContext *mdct, *mdct_half, *mdct_small; - AVTXContext *fft128, *fft256, *fft512, *fft1024; + AVTXContext *fft64, *fft128, *fft256, *fft512; av_tx_fn mdct_fn, mdct_half_fn, mdct_small_fn; - av_tx_fn fft128_fn, fft256_fn, fft512_fn, fft1024_fn; + av_tx_fn fft64_fn, fft128_fn, fft256_fn, fft512_fn; void (*wtf)(struct On2AVCContext *ctx, float *out, float *in, int size); int is_av500; @@ -475,16 +475,16 @@ static void wtf_end_512(On2AVCContext *c, float *out, float *src, zero_head_and_tail(tmp1 + 256, 128, 13, 7); zero_head_and_tail(tmp1 + 384, 128, 15, 5); - c->fft128_fn(c->fft128, src + 0, tmp1 + 0, sizeof(float)); - c->fft128_fn(c->fft128, src + 128, tmp1 + 128, sizeof(float)); - c->fft128_fn(c->fft128, src + 256, tmp1 + 256, sizeof(float)); - c->fft128_fn(c->fft128, src + 384, tmp1 + 384, sizeof(float)); + c->fft64_fn(c->fft64, src + 0, tmp1 + 0, sizeof(float)); + c->fft64_fn(c->fft64, src + 128, tmp1 + 128, sizeof(float)); + c->fft64_fn(c->fft64, src + 256, tmp1 + 256, sizeof(float)); + c->fft64_fn(c->fft64, src + 384, tmp1 + 384, sizeof(float)); combine_fft(src, src + 128, src + 256, src + 384, tmp1, ff_on2avc_ctab_1, ff_on2avc_ctab_2, ff_on2avc_ctab_3, ff_on2avc_ctab_4, 512, 2); - c->fft512_fn(c->fft512, src, tmp1, sizeof(float)); + c->fft256_fn(c->fft256, src, tmp1, sizeof(float)); pretwiddle(&tmp0[ 0], src, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); pretwiddle(&tmp0[128], src, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); @@ -503,16 +503,16 @@ static void wtf_end_1024(On2AVCContext *c, float *out, float *src, zero_head_and_tail(tmp1 + 512, 256, 13, 7); zero_head_and_tail(tmp1 + 768, 256, 15, 5); - c->fft256_fn(c->fft256, src + 0, tmp1 + 0, sizeof(float)); - c->fft256_fn(c->fft256, src + 256, tmp1 + 256, sizeof(float)); - c->fft256_fn(c->fft256, src + 512, tmp1 + 512, sizeof(float)); - c->fft256_fn(c->fft256, src + 768, tmp1 + 768, sizeof(float)); + c->fft128_fn(c->fft128, src + 0, tmp1 + 0, sizeof(float)); + c->fft128_fn(c->fft128, src + 256, tmp1 + 256, sizeof(float)); + c->fft128_fn(c->fft128, src + 512, tmp1 + 512, sizeof(float)); + c->fft128_fn(c->fft128, src + 768, tmp1 + 768, sizeof(float)); combine_fft(src, src + 256, src + 512, src + 768, tmp1, ff_on2avc_ctab_1, ff_on2avc_ctab_2, ff_on2avc_ctab_3, ff_on2avc_ctab_4, 1024, 1); - c->fft1024_fn(c->fft1024, src, tmp1, sizeof(float)); + c->fft512_fn(c->fft512, src, tmp1, sizeof(float)); pretwiddle(&tmp0[ 0], src, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); pretwiddle(&tmp0[256], src, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); @@ -956,14 +956,14 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) if ((ret = av_tx_init(&c->mdct_small, &c->mdct_small_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft1024, &c->fft1024_fn, AV_TX_FLOAT_FFT, 1, 1024, NULL, 0)) < 0) - return ret; if ((ret = av_tx_init(&c->fft512, &c->fft512_fn, AV_TX_FLOAT_FFT, 1, 512, NULL, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 0, 256, NULL, 0)) < 0) + if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 1, 256, NULL, 0)) < 0) return ret; if ((ret = av_tx_init(&c->fft128, &c->fft128_fn, AV_TX_FLOAT_FFT, 0, 128, NULL, 0)) < 0) return ret; + if ((ret = av_tx_init(&c->fft64, &c->fft64_fn, AV_TX_FLOAT_FFT, 0, 64, NULL, 0)) < 0) + return ret; c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!c->fdsp) @@ -998,10 +998,10 @@ static av_cold int on2avc_decode_close(AVCodecContext *avctx) av_tx_uninit(&c->mdct); av_tx_uninit(&c->mdct_half); av_tx_uninit(&c->mdct_small); + av_tx_uninit(&c->fft64); av_tx_uninit(&c->fft128); av_tx_uninit(&c->fft256); av_tx_uninit(&c->fft512); - av_tx_uninit(&c->fft1024); av_freep(&c->fdsp); -- 2.35.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-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avcodec/on2avc: use correct fft sizes 2023-08-06 19:41 ` [FFmpeg-devel] [PATCH v2] " Marton Balint @ 2023-08-07 4:40 ` Lynne 2023-08-08 17:36 ` Marton Balint 0 siblings, 1 reply; 5+ messages in thread From: Lynne @ 2023-08-07 4:40 UTC (permalink / raw) To: FFmpeg development discussions and patches Aug 6, 2023, 21:45 by cus@passwd.hu: > Also rename the contexts and the functions so their names will reflect their > intended size. > > With the earlier patch this fixes the audio corruption regression caused by > 6ba0aa1770ba29eb4126c6a706f6b0cd3809648f. > > Fixes ticket #10029. > > Signed-off-by: Marton Balint <cus@passwd.hu> > --- > libavcodec/on2avc.c | 32 ++++++++++++++++---------------- > 1 file changed, 16 insertions(+), 16 deletions(-) > > diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c > index 474adb149d..b190f36e19 100644 > --- a/libavcodec/on2avc.c > +++ b/libavcodec/on2avc.c > @@ -51,9 +51,9 @@ typedef struct On2AVCContext { > AVCodecContext *avctx; > AVFloatDSPContext *fdsp; > AVTXContext *mdct, *mdct_half, *mdct_small; > - AVTXContext *fft128, *fft256, *fft512, *fft1024; > + AVTXContext *fft64, *fft128, *fft256, *fft512; > av_tx_fn mdct_fn, mdct_half_fn, mdct_small_fn; > - av_tx_fn fft128_fn, fft256_fn, fft512_fn, fft1024_fn; > + av_tx_fn fft64_fn, fft128_fn, fft256_fn, fft512_fn; > void (*wtf)(struct On2AVCContext *ctx, float *out, float *in, int size); > > int is_av500; > @@ -475,16 +475,16 @@ static void wtf_end_512(On2AVCContext *c, float *out, float *src, > zero_head_and_tail(tmp1 + 256, 128, 13, 7); > zero_head_and_tail(tmp1 + 384, 128, 15, 5); > > - c->fft128_fn(c->fft128, src + 0, tmp1 + 0, sizeof(float)); > - c->fft128_fn(c->fft128, src + 128, tmp1 + 128, sizeof(float)); > - c->fft128_fn(c->fft128, src + 256, tmp1 + 256, sizeof(float)); > - c->fft128_fn(c->fft128, src + 384, tmp1 + 384, sizeof(float)); > + c->fft64_fn(c->fft64, src + 0, tmp1 + 0, sizeof(float)); > + c->fft64_fn(c->fft64, src + 128, tmp1 + 128, sizeof(float)); > + c->fft64_fn(c->fft64, src + 256, tmp1 + 256, sizeof(float)); > + c->fft64_fn(c->fft64, src + 384, tmp1 + 384, sizeof(float)); > > combine_fft(src, src + 128, src + 256, src + 384, tmp1, > ff_on2avc_ctab_1, ff_on2avc_ctab_2, > ff_on2avc_ctab_3, ff_on2avc_ctab_4, 512, 2); > > - c->fft512_fn(c->fft512, src, tmp1, sizeof(float)); > + c->fft256_fn(c->fft256, src, tmp1, sizeof(float)); > > pretwiddle(&tmp0[ 0], src, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); > pretwiddle(&tmp0[128], src, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); > @@ -503,16 +503,16 @@ static void wtf_end_1024(On2AVCContext *c, float *out, float *src, > zero_head_and_tail(tmp1 + 512, 256, 13, 7); > zero_head_and_tail(tmp1 + 768, 256, 15, 5); > > - c->fft256_fn(c->fft256, src + 0, tmp1 + 0, sizeof(float)); > - c->fft256_fn(c->fft256, src + 256, tmp1 + 256, sizeof(float)); > - c->fft256_fn(c->fft256, src + 512, tmp1 + 512, sizeof(float)); > - c->fft256_fn(c->fft256, src + 768, tmp1 + 768, sizeof(float)); > + c->fft128_fn(c->fft128, src + 0, tmp1 + 0, sizeof(float)); > + c->fft128_fn(c->fft128, src + 256, tmp1 + 256, sizeof(float)); > + c->fft128_fn(c->fft128, src + 512, tmp1 + 512, sizeof(float)); > + c->fft128_fn(c->fft128, src + 768, tmp1 + 768, sizeof(float)); > > combine_fft(src, src + 256, src + 512, src + 768, tmp1, > ff_on2avc_ctab_1, ff_on2avc_ctab_2, > ff_on2avc_ctab_3, ff_on2avc_ctab_4, 1024, 1); > > - c->fft1024_fn(c->fft1024, src, tmp1, sizeof(float)); > + c->fft512_fn(c->fft512, src, tmp1, sizeof(float)); > > pretwiddle(&tmp0[ 0], src, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); > pretwiddle(&tmp0[256], src, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); > @@ -956,14 +956,14 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) > if ((ret = av_tx_init(&c->mdct_small, &c->mdct_small_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0)) < 0) > return ret; > > - if ((ret = av_tx_init(&c->fft1024, &c->fft1024_fn, AV_TX_FLOAT_FFT, 1, 1024, NULL, 0)) < 0) > - return ret; > if ((ret = av_tx_init(&c->fft512, &c->fft512_fn, AV_TX_FLOAT_FFT, 1, 512, NULL, 0)) < 0) > return ret; > - if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 0, 256, NULL, 0)) < 0) > + if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 1, 256, NULL, 0)) < 0) > return ret; > if ((ret = av_tx_init(&c->fft128, &c->fft128_fn, AV_TX_FLOAT_FFT, 0, 128, NULL, 0)) < 0) > return ret; > + if ((ret = av_tx_init(&c->fft64, &c->fft64_fn, AV_TX_FLOAT_FFT, 0, 64, NULL, 0)) < 0) > + return ret; > > c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); > if (!c->fdsp) > @@ -998,10 +998,10 @@ static av_cold int on2avc_decode_close(AVCodecContext *avctx) > av_tx_uninit(&c->mdct); > av_tx_uninit(&c->mdct_half); > av_tx_uninit(&c->mdct_small); > + av_tx_uninit(&c->fft64); > av_tx_uninit(&c->fft128); > av_tx_uninit(&c->fft256); > av_tx_uninit(&c->fft512); > - av_tx_uninit(&c->fft1024); > > av_freep(&c->fdsp); > LGTM 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-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avcodec/on2avc: use correct fft sizes 2023-08-07 4:40 ` Lynne @ 2023-08-08 17:36 ` Marton Balint 0 siblings, 0 replies; 5+ messages in thread From: Marton Balint @ 2023-08-08 17:36 UTC (permalink / raw) To: FFmpeg development discussions and patches On Mon, 7 Aug 2023, Lynne wrote: > Aug 6, 2023, 21:45 by cus@passwd.hu: > >> Also rename the contexts and the functions so their names will reflect their >> intended size. >> >> With the earlier patch this fixes the audio corruption regression caused by >> 6ba0aa1770ba29eb4126c6a706f6b0cd3809648f. >> >> Fixes ticket #10029. >> [...] >> > > LGTM > Thanks Will apply, 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-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-08-08 17:39 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-08-06 12:42 [FFmpeg-devel] [PATCH] avcodec/on2avc: use correct fft sizes Marton Balint 2023-08-06 17:35 ` Lynne 2023-08-06 19:41 ` [FFmpeg-devel] [PATCH v2] " Marton Balint 2023-08-07 4:40 ` Lynne 2023-08-08 17:36 ` Marton Balint
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git