[FFmpeg-devel] [PATCH] avcodec/adpcm: take into account block_align when decoding ADPCM_PSX
Zane van Iperen
zane at zanevaniperen.com
Sat Sep 12 15:45:45 EEST 2020
On Fri, 11 Sep 2020 15:27:42 +0200
"Paul B Mahol" <onemda at gmail.com> wrote:
> get_nb_samples() gives number of samples in single packet depending on its size.
> We here uses blocks and block_align to decode mutliple frames at once.
>
> Imagine decoding stereo int16 pcm so that you pick only 4 bytes each time.
> This would give so big overhead that it would be not usable at all.
> Some ADPCM codecs just do this, and thus in player give excessive CPU usage.
> Also when decoding with ffmpeg -i input -f null -, realtime speed is nowhere
> near optimum value. In my case with this patch and modified demuxer to return
> mutliple frames it changes from 50x to >1000x speed.
I just applied the same changes to the argo decoder and demuxer and saw a
similar speedup. It's insane how much of a difference it makes. (I'll
send a patch for it after I've dealt with the BRP demuxer).
Also, this LGTM.
More information about the ffmpeg-devel
mailing list