Thanks a lot. I thought for some reason that bswap is for 16-bit values.

вс, 14 февр. 2021 г. в 22:31, Carl Eugen Hoyos <[email protected]>:
>
> Am So., 14. Feb. 2021 um 19:07 Uhr schrieb Vasily Postnicov
> <[email protected]>:
> >
> > 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,
>
> No, bswap_buf() is about doing a byte swap on 32bit data, what
> you describe would be a byte swap on 16 bit data.
>
> > but it does something more than
> > that. It's written in assembly code which I can not read clearly.
>
> A debugger has many disadvantages over running git grep:
> See libavcodec/bswapdsp.c and libavutil/bswap.h
>
> > Also it lacks any documentation.
>
> The function is only for internal use and byte swapping is
> assumed to be common knowledge, FFmpeg is supposed
> to run on both little- and big-endian hardware.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [email protected]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [email protected] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to