[FFmpeg-devel] [PATCH] avcodec/adpcm: take into account block_align when decoding ADPCM_PSX
Zane van Iperen
zane at zanevaniperen.com
Fri Sep 11 16:14:02 EEST 2020
On Fri, 11 Sep 2020 13:29:39 +0200
"Paul B Mahol" <onemda at gmail.com> wrote:
>
> Should reduce decoding overhead.
>
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
> libavcodec/adpcm.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
> index 71e37efde7..e409a3aa6a 100644
> --- a/libavcodec/adpcm.c
> +++ b/libavcodec/adpcm.c
> @@ -1966,11 +1966,13 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
> }
> break;
> case AV_CODEC_ID_ADPCM_PSX:
> + for (int block = 0; block < avpkt->size / FFMAX(avctx->block_align, 16 * avctx->channels); block++) {
> + int nb_samples_per_block = 28 * FFMAX(avctx->block_align, 16 * avctx->channels) / (16 * avctx->channels);
Shouldn't get_nb_samples() be updated instead?
More information about the ffmpeg-devel
mailing list