[FFmpeg-user] What's the purpose of bswap_buf() function?

Vasily Postnicov shamaz.mazum at gmail.com
Sun Feb 14 20:07:13 EET 2021


Hello. I try to add APE decoder support to my own library of audio
codecs. Since APE is a closed format, I use ffmpeg as a reference
trying to understand how it works.

I cannot understand how this line works in libavcodec/apedec.c:
s->bdsp.bswap_buf((uint32_t *) s->data, (const uint32_t *) buf, buf_size >> 2);
I thought it swaps even and odd bytes, but it does something more than
that. It's written in assembly code which I can not read clearly. Also
it lacks any documentation. Can anyone explain what it does?


More information about the ffmpeg-user mailing list