[FFmpeg-devel] [PATCH v2 1/2] avutil: move bswapdsp from avcodec to avutil

James Almer jamrial at gmail.com
Tue Dec 6 20:21:33 EET 2022


On 12/5/2022 7:16 PM, mindmark at gmail.com wrote:
> diff --git a/libavcodec/bswapdsp.h b/libavutil/bswapdsp.h
> similarity index 71%
> rename from libavcodec/bswapdsp.h
> rename to libavutil/bswapdsp.h
> index 6f4db66115..b540560d6a 100644
> --- a/libavcodec/bswapdsp.h
> +++ b/libavutil/bswapdsp.h
> @@ -16,18 +16,16 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> -#ifndef AVCODEC_BSWAPDSP_H
> -#define AVCODEC_BSWAPDSP_H
> +#ifndef AVUTIL_BSWAPDSP_H
> +#define AVUTIL_BSWAPDSP_H
>  
>  #include <stdint.h>
>  
> -typedef struct BswapDSPContext {
> -    void (*bswap_buf)(uint32_t *dst, const uint32_t *src, int w);
> +typedef struct AVBSwapDSPContext {
> +    void (*bswap32_buf)(uint32_t *dst, const uint32_t *src, int len);
>      void (*bswap16_buf)(uint16_t *dst, const uint16_t *src, int len);
> -} BswapDSPContext;
> +} AVBSwapDSPContext;
>  
> -void ff_bswapdsp_init(BswapDSPContext *c);
> -void ff_bswapdsp_init_riscv(BswapDSPContext *c);
> -void ff_bswapdsp_init_x86(BswapDSPContext *c);
> +void av_bswapdsp_init(AVBSwapDSPContext *c);
>  
> -#endif /* AVCODEC_BSWAPDSP_H */
> +#endif /* AVUTIL_BSWAPDSP_H */

For what's supposed to become an installer header, this is barebones in 
the documentation department.

Also, does this have any real use for API users? If you want to access 
these functions from swscale as well as lavc, you could either duplicate 
the code, or use the avpriv prefix.
I'm not a fan of adding public API for something that has no use outside 
of our own libraries.


More information about the ffmpeg-devel mailing list