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

Mark Reid mindmark at gmail.com
Wed Dec 7 01:37:48 EET 2022


On Tue, Dec 6, 2022 at 10:21 AM James Almer <jamrial at gmail.com> wrote:

> 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.
>

I agree, I don't see a need for this to be public. I'll change it to use
the avpriv prefix if that's okay.
I'll add a little doc to the header too anyway.

the blockdsp is disappearing from configure is a mistake, I'll fix that too



> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-devel mailing list