diff --git a/libavcodec/sparc/dsputil_vis.c b/libavcodec/sparc/dsputil_vis.c index 9c3494bc45..414d6ca50e 100644 --- a/libavcodec/sparc/dsputil_vis.c +++ b/libavcodec/sparc/dsputil_vis.c @@ -18,33 +18,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/* The *no_round* functions have been added by James A. Morrison, 2003,2004. - The vis code from libmpeg2 was adapted for libavcodec by James A. Morrison. - */ - -#include "config.h" - -#include - #include "libavutil/attributes.h" #include "libavcodec/dsputil.h" -#include "libavutil/mem.h" #include "dsputil_vis.h" - #include "vis.h" -#define ACCEL_SPARC_VIS 1 -#define ACCEL_SPARC_VIS2 2 - -static int vis_level(void) -{ - int accel = 0; - accel |= ACCEL_SPARC_VIS; - accel |= ACCEL_SPARC_VIS2; - return accel; -} - -/* libavcodec initialization code */ av_cold void ff_dsputil_init_vis(DSPContext *c, AVCodecContext *avctx) { /* VIS-specific optimizations */ diff --git a/libavcodec/sparc/hpeldsp_vis.c b/libavcodec/sparc/hpeldsp_vis.c index da2d47e266..be2a85d8f6 100644 --- a/libavcodec/sparc/hpeldsp_vis.c +++ b/libavcodec/sparc/hpeldsp_vis.c @@ -22,13 +22,12 @@ The vis code from libmpeg2 was adapted for libavcodec by James A. Morrison. */ -#include "config.h" +#include +#include -#include - -#include "libavcodec/hpeldsp.h" +#include "libavutil/attributes.h" #include "libavutil/mem.h" - +#include "libavcodec/hpeldsp.h" #include "vis.h" /* The trick used in some of this file is the formula from the MMX @@ -3481,19 +3480,7 @@ static void MC_avg_no_round_xy_16_vis (uint8_t * dest, const uint8_t * ref, /* End of no rounding code */ -#define ACCEL_SPARC_VIS 1 -#define ACCEL_SPARC_VIS2 2 - -static int vis_level(void) -{ - int accel = 0; - accel |= ACCEL_SPARC_VIS; - accel |= ACCEL_SPARC_VIS2; - return accel; -} - -/* libavcodec initialization code */ -void ff_hpeldsp_init_vis(HpelDSPContext* c, int flags) +av_cold void ff_hpeldsp_init_vis(HpelDSPContext *c, int flags) { /* VIS-specific optimizations */ int accel = vis_level (); diff --git a/libavcodec/sparc/vis.h b/libavcodec/sparc/vis.h index adee91bd6f..af5b5fa79e 100644 --- a/libavcodec/sparc/vis.h +++ b/libavcodec/sparc/vis.h @@ -42,6 +42,17 @@ #ifndef AVCODEC_SPARC_VIS_H #define AVCODEC_SPARC_VIS_H +#define ACCEL_SPARC_VIS 1 +#define ACCEL_SPARC_VIS2 2 + +static inline int vis_level(void) +{ + int accel = 0; + accel |= ACCEL_SPARC_VIS; + accel |= ACCEL_SPARC_VIS2; + return accel; +} + #define vis_opc_base ((0x1 << 31) | (0x36 << 19)) #define vis_opf(X) ((X) << 5) #define vis_sreg(X) (X)