mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
mpcodecs: Use _INLINE guards for inline asm.
Enabled compilation with compiler without inline asm support. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
cc5f731541
commit
70205f1799
@ -37,7 +37,7 @@ struct vf_priv_s {
|
||||
int contrast;
|
||||
};
|
||||
|
||||
#if HAVE_MMX && HAVE_6REGS
|
||||
#if HAVE_MMX_INLINE && HAVE_6REGS
|
||||
static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, int sstride,
|
||||
int w, int h, int brightness, int contrast)
|
||||
{
|
||||
@ -224,7 +224,7 @@ static int vf_open(vf_instance_t *vf, char *args)
|
||||
if (args) sscanf(args, "%d:%d", &vf->priv->brightness, &vf->priv->contrast);
|
||||
|
||||
process = process_C;
|
||||
#if HAVE_MMX && HAVE_6REGS
|
||||
#if HAVE_MMX_INLINE && HAVE_6REGS
|
||||
if(ff_gCpuCaps.hasMMX) process = process_MMX;
|
||||
#endif
|
||||
|
||||
|
@ -120,7 +120,7 @@ void create_lut (eq2_param_t *par)
|
||||
par->lut_clean = 1;
|
||||
}
|
||||
|
||||
#if HAVE_MMX && HAVE_6REGS
|
||||
#if HAVE_MMX_INLINE && HAVE_6REGS
|
||||
static
|
||||
void affine_1d_MMX (eq2_param_t *par, unsigned char *dst, unsigned char *src,
|
||||
unsigned w, unsigned h, unsigned dstride, unsigned sstride)
|
||||
@ -289,7 +289,7 @@ void check_values (eq2_param_t *par)
|
||||
if ((par->c == 1.0) && (par->b == 0.0) && (par->g == 1.0)) {
|
||||
par->adjust = NULL;
|
||||
}
|
||||
#if HAVE_MMX && HAVE_6REGS
|
||||
#if HAVE_MMX_INLINE && HAVE_6REGS
|
||||
else if (par->g == 1.0 && ff_gCpuCaps.hasMMX) {
|
||||
par->adjust = &affine_1d_MMX;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ struct vf_priv_s { //align 16 !
|
||||
};
|
||||
|
||||
|
||||
#if !HAVE_MMX
|
||||
#if !HAVE_MMX_INLINE
|
||||
|
||||
//This func reads from 1 slice, 1 and clears 0 & 1
|
||||
static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)
|
||||
@ -177,7 +177,7 @@ static void row_fdct_c(int16_t *data, const uint8_t *pixels, int line_size, int
|
||||
#define row_idct_s row_idct_c
|
||||
#define row_fdct_s row_fdct_c
|
||||
|
||||
#else /* HAVE_MMX */
|
||||
#else /* HAVE_MMX_INLINE */
|
||||
|
||||
//This func reads from 1 slice, 1 and clears 0 & 1
|
||||
static void store_slice_mmx(uint8_t *dst, int16_t *src, long dst_stride, long src_stride, long width, long height, long log2_scale)
|
||||
@ -404,7 +404,7 @@ static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size,
|
||||
#define column_fidct_s column_fidct_mmx
|
||||
#define row_idct_s row_idct_mmx
|
||||
#define row_fdct_s row_fdct_mmx
|
||||
#endif // HAVE_MMX
|
||||
#endif // HAVE_MMX_INLINE
|
||||
|
||||
static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src,
|
||||
int dst_stride, int src_stride,
|
||||
@ -563,10 +563,10 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
|
||||
}
|
||||
}
|
||||
|
||||
#if HAVE_MMX
|
||||
#if HAVE_MMX_INLINE
|
||||
if(ff_gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
|
||||
#endif
|
||||
#if HAVE_MMX2
|
||||
#if HAVE_MMXEXT_INLINE
|
||||
if(ff_gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
|
||||
#endif
|
||||
return ff_vf_next_put_image(vf,dmpi, pts);
|
||||
@ -707,7 +707,7 @@ const vf_info_t ff_vf_info_fspp = {
|
||||
#define THRESHOLD(r,x,t) if(((unsigned)((x)+t))>t*2) r=(x);else r=0;
|
||||
#define DESCALE(x,n) (((x) + (1 << ((n)-1))) >> n)
|
||||
|
||||
#if HAVE_MMX
|
||||
#if HAVE_MMX_INLINE
|
||||
|
||||
DECLARE_ASM_CONST(8, uint64_t, MM_FIX_0_382683433)=FIX64(0.382683433, 14);
|
||||
DECLARE_ALIGNED(8, uint64_t, ff_MM_FIX_0_541196100)=FIX64(0.541196100, 14);
|
||||
@ -728,7 +728,7 @@ DECLARE_ASM_CONST(8, uint64_t, MM_FIX_0_198912367)=FIX64(0.198912367, 14);
|
||||
DECLARE_ASM_CONST(8, uint64_t, MM_DESCALE_RND)=C64(4);
|
||||
DECLARE_ASM_CONST(8, uint64_t, MM_2)=C64(2);
|
||||
|
||||
#else /* !HAVE_MMX */
|
||||
#else /* !HAVE_MMX_INLINE */
|
||||
|
||||
typedef int32_t int_simd16_t;
|
||||
static const int16_t FIX_0_382683433=FIX(0.382683433, 14);
|
||||
@ -743,7 +743,7 @@ static const int16_t FIX_1_082392200=FIX(1.082392200, 13);
|
||||
|
||||
#endif
|
||||
|
||||
#if !HAVE_MMX
|
||||
#if !HAVE_MMX_INLINE
|
||||
|
||||
static void column_fidct_c(int16_t* thr_adr, int16_t *data, int16_t *output, int cnt)
|
||||
{
|
||||
@ -868,7 +868,7 @@ static void column_fidct_c(int16_t* thr_adr, int16_t *data, int16_t *output, int
|
||||
}
|
||||
}
|
||||
|
||||
#else /* HAVE_MMX */
|
||||
#else /* HAVE_MMX_INLINE */
|
||||
|
||||
static void column_fidct_mmx(int16_t* thr_adr, int16_t *data, int16_t *output, int cnt)
|
||||
{
|
||||
@ -1605,9 +1605,9 @@ static void column_fidct_mmx(int16_t* thr_adr, int16_t *data, int16_t *output,
|
||||
);
|
||||
}
|
||||
|
||||
#endif // HAVE_MMX
|
||||
#endif // HAVE_MMX_INLINE
|
||||
|
||||
#if !HAVE_MMX
|
||||
#if !HAVE_MMX_INLINE
|
||||
|
||||
static void row_idct_c(int16_t* workspace,
|
||||
int16_t* output_adr, int output_stride, int cnt)
|
||||
@ -1672,7 +1672,7 @@ static void row_idct_c(int16_t* workspace,
|
||||
}
|
||||
}
|
||||
|
||||
#else /* HAVE_MMX */
|
||||
#else /* HAVE_MMX_INLINE */
|
||||
|
||||
static void row_idct_mmx (int16_t* workspace,
|
||||
int16_t* output_adr, int output_stride, int cnt)
|
||||
@ -1876,9 +1876,9 @@ static void row_idct_mmx (int16_t* workspace,
|
||||
);
|
||||
}
|
||||
|
||||
#endif // HAVE_MMX
|
||||
#endif // HAVE_MMX_INLINE
|
||||
|
||||
#if !HAVE_MMX
|
||||
#if !HAVE_MMX_INLINE
|
||||
|
||||
static void row_fdct_c(int16_t *data, const uint8_t *pixels, int line_size, int cnt)
|
||||
{
|
||||
@ -1941,7 +1941,7 @@ static void row_fdct_c(int16_t *data, const uint8_t *pixels, int line_size, int
|
||||
}
|
||||
}
|
||||
|
||||
#else /* HAVE_MMX */
|
||||
#else /* HAVE_MMX_INLINE */
|
||||
|
||||
static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size, int cnt)
|
||||
{
|
||||
@ -2121,4 +2121,4 @@ static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size,
|
||||
: "%"REG_d);
|
||||
}
|
||||
|
||||
#endif // HAVE_MMX
|
||||
#endif // HAVE_MMX_INLINE
|
||||
|
@ -78,7 +78,7 @@ static void pack_li_1_C(unsigned char *dst, unsigned char *y,
|
||||
}
|
||||
}
|
||||
|
||||
#if HAVE_MMX
|
||||
#if HAVE_MMX_INLINE
|
||||
static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
|
||||
unsigned char *u, unsigned char *v, int w,
|
||||
int av_unused us, int av_unused vs)
|
||||
@ -420,7 +420,7 @@ static int vf_open(vf_instance_t *vf, char *args)
|
||||
pack_nn = pack_nn_C;
|
||||
pack_li_0 = pack_li_0_C;
|
||||
pack_li_1 = pack_li_1_C;
|
||||
#if HAVE_MMX
|
||||
#if HAVE_MMX_INLINE
|
||||
if(ff_gCpuCaps.hasMMX) {
|
||||
pack_nn = pack_nn_MMX;
|
||||
#if HAVE_EBX_AVAILABLE
|
||||
|
@ -155,7 +155,7 @@ static void dctB_c(int16_t *dst, int16_t *src){
|
||||
}
|
||||
}
|
||||
|
||||
#if HAVE_MMX
|
||||
#if HAVE_MMX_INLINE
|
||||
static void dctB_mmx(int16_t *dst, int16_t *src){
|
||||
__asm__ volatile (
|
||||
"movq (%0), %%mm0 \n\t"
|
||||
@ -397,10 +397,10 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
|
||||
memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
|
||||
}
|
||||
|
||||
#if HAVE_MMX
|
||||
#if HAVE_MMX_INLINE
|
||||
if(ff_gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
|
||||
#endif
|
||||
#if HAVE_MMX2
|
||||
#if HAVE_MMXEXT_INLINE
|
||||
if(ff_gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
|
||||
#endif
|
||||
|
||||
@ -464,7 +464,7 @@ static int vf_open(vf_instance_t *vf, char *args){
|
||||
case 2: requantize= mediumthresh_c; break;
|
||||
}
|
||||
|
||||
#if HAVE_MMX
|
||||
#if HAVE_MMX_INLINE
|
||||
if(ff_gCpuCaps.hasMMX){
|
||||
dctB= dctB_mmx;
|
||||
}
|
||||
|
@ -297,10 +297,10 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
|
||||
}
|
||||
}
|
||||
|
||||
#if HAVE_MMX
|
||||
#if HAVE_MMX_INLINE
|
||||
if(ff_gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
|
||||
#endif
|
||||
#if HAVE_MMX2
|
||||
#if HAVE_MMXEXT_INLINE
|
||||
if(ff_gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
|
||||
#endif
|
||||
|
||||
@ -375,7 +375,7 @@ static int vf_open(vf_instance_t *vf, char *args){
|
||||
if(vf->priv->qp < 0)
|
||||
vf->priv->qp = 0;
|
||||
|
||||
// #if HAVE_MMX
|
||||
// #if HAVE_MMX_INLINE
|
||||
// if(ff_gCpuCaps.hasMMX){
|
||||
// store_slice= store_slice_mmx;
|
||||
// }
|
||||
|
Loading…
Reference in New Issue
Block a user