summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2008-10-25 05:12:34 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2008-10-25 05:12:34 +0300
commit030130942562bb7b84eeba53e0226abed5a63a4c (patch)
tree9b49208facf2801369c9d2d7b3e7af11fab36829 /libmpcodecs
parent562d86d95cbba67cb58358f6fc334553a467dee7 (diff)
parent15a80092161a1cd305f8005c780c744416a5252b (diff)
downloadmpv-030130942562bb7b84eeba53e0226abed5a63a4c.tar.bz2
mpv-030130942562bb7b84eeba53e0226abed5a63a4c.tar.xz
Merge svn changes up to 27824
Conflicts: cfg-common-opts.h libmpcodecs/dec_video.c libmpcodecs/vd.c libvo/x11_common.h mplayer.c stream/cache2.c
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_ffmpeg.c2
-rw-r--r--libmpcodecs/ad_twin.c2
-rw-r--r--libmpcodecs/dec_audio.c14
-rw-r--r--libmpcodecs/dec_video.c4
-rw-r--r--libmpcodecs/native/mmx.h10
-rw-r--r--libmpcodecs/pullup.c6
-rw-r--r--libmpcodecs/vd.c3
-rw-r--r--libmpcodecs/vd_libmpeg2.c4
-rw-r--r--libmpcodecs/vd_zrmjpeg.c2
-rw-r--r--libmpcodecs/vf_decimate.c2
-rw-r--r--libmpcodecs/vf_divtc.c6
-rw-r--r--libmpcodecs/vf_eq.c4
-rw-r--r--libmpcodecs/vf_eq2.c4
-rw-r--r--libmpcodecs/vf_filmdint.c22
-rw-r--r--libmpcodecs/vf_fspp.c16
-rw-r--r--libmpcodecs/vf_geq.c1
-rw-r--r--libmpcodecs/vf_halfpack.c4
-rw-r--r--libmpcodecs/vf_ilpack.c6
-rw-r--r--libmpcodecs/vf_ivtc.c4
-rw-r--r--libmpcodecs/vf_noise.c10
-rw-r--r--libmpcodecs/vf_palette.c16
-rw-r--r--libmpcodecs/vf_pp7.c6
-rw-r--r--libmpcodecs/vf_qp.c2
-rw-r--r--libmpcodecs/vf_sab.c2
-rw-r--r--libmpcodecs/vf_scale.c2
-rw-r--r--libmpcodecs/vf_spp.c10
-rw-r--r--libmpcodecs/vf_tfields.c16
-rw-r--r--libmpcodecs/vf_unsharp.c4
-rw-r--r--libmpcodecs/vf_uspp.c4
-rw-r--r--libmpcodecs/vf_yadif.c6
-rw-r--r--libmpcodecs/vf_zrmjpeg.c21
31 files changed, 95 insertions, 120 deletions
diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c
index a8a8a18120..560dd90c0a 100644
--- a/libmpcodecs/ad_ffmpeg.c
+++ b/libmpcodecs/ad_ffmpeg.c
@@ -177,6 +177,8 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m
src_ch_layout = AF_CHANNEL_LAYOUT_LAVC_LIBA52_DEFAULT;
else if (!strcasecmp(codec, "vorbis"))
src_ch_layout = AF_CHANNEL_LAYOUT_VORBIS_DEFAULT;
+ else if (!strcasecmp(codec, "flac"))
+ src_ch_layout = AF_CHANNEL_LAYOUT_FLAC_DEFAULT;
else
src_ch_layout = AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT;
reorder_channel_nch(buf, src_ch_layout,
diff --git a/libmpcodecs/ad_twin.c b/libmpcodecs/ad_twin.c
index 3915101ae4..51b260d061 100644
--- a/libmpcodecs/ad_twin.c
+++ b/libmpcodecs/ad_twin.c
@@ -138,7 +138,7 @@ static int init_vqf_audio_codec(sh_audio_t *sh_audio){
priv->framesize=TvqGetFrameSize();
sh_audio->audio_in_minsize=priv->framesize*in_fmt->nChannels;
sh_audio->a_in_buffer_size=4*sh_audio->audio_in_minsize;
- sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size);
+ sh_audio->a_in_buffer=av_malloc(sh_audio->a_in_buffer_size);
sh_audio->a_in_buffer_len=0;
diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c
index 23f19ac405..947b47bbfc 100644
--- a/libmpcodecs/dec_audio.c
+++ b/libmpcodecs/dec_audio.c
@@ -74,8 +74,7 @@ static int init_audio_codec(sh_audio_t *sh_audio)
sh_audio->a_in_buffer_size = sh_audio->audio_in_minsize;
mp_msg(MSGT_DECAUDIO, MSGL_V, MSGTR_AllocatingBytesForInputBuffer,
sh_audio->a_in_buffer_size);
- sh_audio->a_in_buffer = memalign(16, sh_audio->a_in_buffer_size);
- memset(sh_audio->a_in_buffer, 0, sh_audio->a_in_buffer_size);
+ sh_audio->a_in_buffer = av_mallocz(sh_audio->a_in_buffer_size);
sh_audio->a_in_buffer_len = 0;
}
@@ -84,12 +83,11 @@ static int init_audio_codec(sh_audio_t *sh_audio)
mp_msg(MSGT_DECAUDIO, MSGL_V, MSGTR_AllocatingBytesForOutputBuffer,
sh_audio->audio_out_minsize, MAX_OUTBURST, sh_audio->a_buffer_size);
- sh_audio->a_buffer = memalign(16, sh_audio->a_buffer_size);
+ sh_audio->a_buffer = av_mallocz(sh_audio->a_buffer_size);
if (!sh_audio->a_buffer) {
mp_msg(MSGT_DECAUDIO, MSGL_ERR, MSGTR_CantAllocAudioBuf);
return 0;
}
- memset(sh_audio->a_buffer, 0, sh_audio->a_buffer_size);
sh_audio->a_buffer_len = 0;
if (!sh_audio->ad_driver->init(sh_audio)) {
@@ -306,12 +304,8 @@ void uninit_audio(sh_audio_t *sh_audio)
free(sh_audio->a_out_buffer);
sh_audio->a_out_buffer = NULL;
sh_audio->a_out_buffer_size = 0;
- if (sh_audio->a_buffer)
- free(sh_audio->a_buffer);
- sh_audio->a_buffer = NULL;
- if (sh_audio->a_in_buffer)
- free(sh_audio->a_in_buffer);
- sh_audio->a_in_buffer = NULL;
+ av_freep(&sh_audio->a_buffer);
+ av_freep(&sh_audio->a_in_buffer);
}
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c
index 7a3e826e45..4259377342 100644
--- a/libmpcodecs/dec_video.c
+++ b/libmpcodecs/dec_video.c
@@ -414,9 +414,9 @@ void *decode_video(sh_video_t *sh_video, unsigned char *start, int in_size,
// some codecs are broken, and doesn't restore MMX state :(
// it happens usually with broken/damaged files.
if (gCpuCaps.has3DNow) {
- __asm __volatile("femms\n\t":::"memory");
+ __asm__ volatile("femms\n\t":::"memory");
} else if (gCpuCaps.hasMMX) {
- __asm __volatile("emms\n\t":::"memory");
+ __asm__ volatile("emms\n\t":::"memory");
}
#endif
diff --git a/libmpcodecs/native/mmx.h b/libmpcodecs/native/mmx.h
index d9a6fb65cb..1661b318a4 100644
--- a/libmpcodecs/native/mmx.h
+++ b/libmpcodecs/native/mmx.h
@@ -57,24 +57,24 @@ typedef union {
#define mmx_i2r(op,imm,reg) \
- __asm__ __volatile__ (#op " %0, %%" #reg \
+ __asm__ volatile (#op " %0, %%" #reg \
: /* nothing */ \
: "i" (imm) )
#define mmx_m2r(op, mem, reg) \
- __asm__ __volatile__ (#op " %0, %%" #reg \
+ __asm__ volatile (#op " %0, %%" #reg \
: /* nothing */ \
: "m" (mem))
#define mmx_r2m(op, reg, mem) \
- __asm__ __volatile__ (#op " %%" #reg ", %0" \
+ __asm__ volatile (#op " %%" #reg ", %0" \
: "=m" (mem) \
: /* nothing */ )
#define mmx_r2r(op, regs, regd) \
- __asm__ __volatile__ (#op " %" #regs ", %" #regd)
+ __asm__ volatile (#op " %" #regs ", %" #regd)
-#define emms() __asm__ __volatile__ ("emms")
+#define emms() __asm__ volatile ("emms")
#endif /* MPLAYER_MMX_H */
diff --git a/libmpcodecs/pullup.c b/libmpcodecs/pullup.c
index b5229052a4..f71bf790ce 100644
--- a/libmpcodecs/pullup.c
+++ b/libmpcodecs/pullup.c
@@ -14,7 +14,7 @@
static int diff_y_mmx(unsigned char *a, unsigned char *b, int s)
{
int ret;
- asm volatile (
+ __asm__ volatile (
"movl $4, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t"
"pxor %%mm7, %%mm7 \n\t"
@@ -61,7 +61,7 @@ static int diff_y_mmx(unsigned char *a, unsigned char *b, int s)
static int licomb_y_mmx(unsigned char *a, unsigned char *b, int s)
{
int ret;
- asm volatile (
+ __asm__ volatile (
"movl $4, %%ecx \n\t"
"pxor %%mm6, %%mm6 \n\t"
"pxor %%mm7, %%mm7 \n\t"
@@ -150,7 +150,7 @@ static int licomb_y_mmx(unsigned char *a, unsigned char *b, int s)
static int var_y_mmx(unsigned char *a, unsigned char *b, int s)
{
int ret;
- asm volatile (
+ __asm__ volatile (
"movl $3, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t"
"pxor %%mm7, %%mm7 \n\t"
diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c
index 1e23d2eced..fe9d1d7861 100644
--- a/libmpcodecs/vd.c
+++ b/libmpcodecs/vd.c
@@ -103,6 +103,9 @@ const vd_functions_t * const mpcodecs_vd_drivers[] = {
#include "libvo/video_out.h"
+#define SCREEN_SIZE_X 1
+#define SCREEN_SIZE_Y 1
+
int mpcodecs_config_vo(sh_video_t *sh, int w, int h,
unsigned int preferred_outfmt)
{
diff --git a/libmpcodecs/vd_libmpeg2.c b/libmpcodecs/vd_libmpeg2.c
index eeab4b23be..7505768dee 100644
--- a/libmpcodecs/vd_libmpeg2.c
+++ b/libmpcodecs/vd_libmpeg2.c
@@ -83,9 +83,7 @@ static int init(sh_video_t *sh){
#elif ARCH_ARM
accel |= MPEG2_ACCEL_ARM;
#endif
- #ifdef HAVE_IWMMXT
- accel |= MPEG2_ACCEL_ARM_IWMMXT;
- #elif HAVE_MVI
+ #ifdef HAVE_MVI
accel |= MPEG2_ACCEL_ALPHA_MVI;
#elif HAVE_VIS
accel |= MPEG2_ACCEL_SPARC_VIS;
diff --git a/libmpcodecs/vd_zrmjpeg.c b/libmpcodecs/vd_zrmjpeg.c
index a2d1d21e8b..2d35ec1420 100644
--- a/libmpcodecs/vd_zrmjpeg.c
+++ b/libmpcodecs/vd_zrmjpeg.c
@@ -109,7 +109,7 @@ static int get_int2(unsigned char *buf) {
static unsigned int guess_mjpeg_type(unsigned char *data, unsigned int size,
int d_height) {
unsigned int p;
- int marker, length, height, ncomps, i, hf[3], vf[3];
+ int marker, length, height, i, hf[3], vf[3];
unsigned int app0 = 0, header = 0;
/* The initial marker must be SIO */
diff --git a/libmpcodecs/vf_decimate.c b/libmpcodecs/vf_decimate.c
index 5fb633d3c5..81b58cccb7 100644
--- a/libmpcodecs/vf_decimate.c
+++ b/libmpcodecs/vf_decimate.c
@@ -23,7 +23,7 @@ struct vf_priv_s {
static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
{
volatile short out[4];
- asm (
+ __asm__ (
"movl $8, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t"
"pxor %%mm7, %%mm7 \n\t"
diff --git a/libmpcodecs/vf_divtc.c b/libmpcodecs/vf_divtc.c
index 4dade860f1..307a14890d 100644
--- a/libmpcodecs/vf_divtc.c
+++ b/libmpcodecs/vf_divtc.c
@@ -37,7 +37,7 @@ struct vf_priv_s
static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
{
volatile short out[4];
- asm (
+ __asm__ (
"movl $8, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t"
"pxor %%mm7, %%mm7 \n\t"
@@ -128,7 +128,7 @@ static unsigned int checksum_plane(unsigned char *p, unsigned char *z,
unsigned int shift;
uint32_t sum, t;
unsigned char *e, *e2;
-#if MP_WORDSIZE==64
+#if __WORDSIZE==64
typedef uint64_t wsum_t;
#else
typedef uint32_t wsum_t;
@@ -143,7 +143,7 @@ static unsigned int checksum_plane(unsigned char *p, unsigned char *z,
for(wsum=0, e2=e-sizeof(wsum_t)+1; p<e2; p+=sizeof(wsum_t))
wsum^=*(wsum_t *)p;
-#if MP_WORDSIZE==64
+#if __WORDSIZE==64
t=be2me_32((uint32_t)(wsum>>32^wsum));
#else
t=be2me_32(wsum);
diff --git a/libmpcodecs/vf_eq.c b/libmpcodecs/vf_eq.c
index 0b65720849..a0dc04ae39 100644
--- a/libmpcodecs/vf_eq.c
+++ b/libmpcodecs/vf_eq.c
@@ -44,7 +44,7 @@ static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, in
contvec[0] = contvec[1] = contvec[2] = contvec[3] = contrast;
while (h--) {
- asm volatile (
+ __asm__ volatile (
"movq (%5), %%mm3 \n\t"
"movq (%6), %%mm4 \n\t"
"pxor %%mm0, %%mm0 \n\t"
@@ -82,7 +82,7 @@ static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, in
src += sstep;
dest += dstep;
}
- asm volatile ( "emms \n\t" ::: "memory" );
+ __asm__ volatile ( "emms \n\t" ::: "memory" );
}
#endif
diff --git a/libmpcodecs/vf_eq2.c b/libmpcodecs/vf_eq2.c
index dbe751fbca..b3a501719f 100644
--- a/libmpcodecs/vf_eq2.c
+++ b/libmpcodecs/vf_eq2.c
@@ -130,7 +130,7 @@ void affine_1d_MMX (eq2_param_t *par, unsigned char *dst, unsigned char *src,
dstep = dstride - w;
while (h-- > 0) {
- asm volatile (
+ __asm__ volatile (
"movq (%5), %%mm3 \n\t"
"movq (%6), %%mm4 \n\t"
"pxor %%mm0, %%mm0 \n\t"
@@ -170,7 +170,7 @@ void affine_1d_MMX (eq2_param_t *par, unsigned char *dst, unsigned char *src,
dst += dstep;
}
- asm volatile ( "emms \n\t" ::: "memory" );
+ __asm__ volatile ( "emms \n\t" ::: "memory" );
}
#endif
diff --git a/libmpcodecs/vf_filmdint.c b/libmpcodecs/vf_filmdint.c
index f479569536..5c022e5920 100644
--- a/libmpcodecs/vf_filmdint.c
+++ b/libmpcodecs/vf_filmdint.c
@@ -366,13 +366,13 @@ block_metrics_faster_c(unsigned char *a, unsigned char *b, int as, int bs,
#define MEQ(X,Y) ((X).even == (Y).even && (X).odd == (Y).odd && (X).temp == (Y).temp && (X).noise == (Y).noise)
#define BLOCK_METRICS_TEMPLATE() \
- asm volatile("pxor %mm7, %mm7\n\t" /* The result is colleted in mm7 */ \
+ __asm__ volatile("pxor %mm7, %mm7\n\t" /* The result is colleted in mm7 */ \
"pxor %mm6, %mm6\n\t" /* Temp to stay at 0 */ \
); \
a -= as; \
b -= bs; \
do { \
- asm volatile( \
+ __asm__ volatile( \
"movq (%0,%2), %%mm0\n\t" \
"movq (%1,%3), %%mm1\n\t" /* mm1 = even */ \
PSADBW(%%mm1, %%mm0, %%mm4, %%mm6) \
@@ -437,7 +437,7 @@ block_metrics_3dnow(unsigned char *a, unsigned char *b, int as, int bs,
static const unsigned long long ones = 0x0101010101010101ull;
BLOCK_METRICS_TEMPLATE();
- asm volatile("movq %%mm7, %0\n\temms" : "=m" (tm));
+ __asm__ volatile("movq %%mm7, %0\n\temms" : "=m" (tm));
get_block_stats(&tm, p, s);
#endif
return tm;
@@ -469,7 +469,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
#ifdef DEBUG
struct frame_stats ts = *s;
#endif
- asm volatile("prefetcht0 (%0,%2)\n\t"
+ __asm__ volatile("prefetcht0 (%0,%2)\n\t"
"prefetcht0 (%1,%3)\n\t" :
: "r" (a), "r" (b),
"r" (prefetch_line * as), "r" (prefetch_line * bs));
@@ -477,7 +477,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
BLOCK_METRICS_TEMPLATE();
s->num_blocks++;
- asm volatile(
+ __asm__ volatile(
"movq %3, %%mm0\n\t"
"movq %%mm7, %%mm1\n\t"
"psubusw %%mm0, %%mm1\n\t"
@@ -523,7 +523,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
s->interlaced_high += interlaced >> 16;
s->interlaced_low += interlaced;
} else {
- asm volatile(
+ __asm__ volatile(
"pcmpeqw %%mm0, %%mm0\n\t" /* -1 */
"psubw %%mm0, %%mm4\n\t"
"psubw %%mm0, %%mm5\n\t"
@@ -537,7 +537,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
: "=m" (s->tiny), "=m" (s->low), "=m" (s->high)
);
- asm volatile(
+ __asm__ volatile(
"pshufw $0, %2, %%mm0\n\t"
"psubusw %%mm7, %%mm0\n\t"
"pcmpeqw %%mm6, %%mm0\n\t" /* 0 if below sad_thres */
@@ -554,7 +554,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
);
}
- asm volatile(
+ __asm__ volatile(
"movq %%mm7, (%1)\n\t"
PMAXUW((%0), %%mm7)
"movq %%mm7, (%0)\n\t"
@@ -595,7 +595,7 @@ dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos,
#else
unsigned long len = (w+7) >> 3;
int ret;
- asm volatile (
+ __asm__ volatile (
"pxor %%mm6, %%mm6 \n\t" /* deinterlaced pixel counter */
"movd %0, %%mm7 \n\t"
"punpcklbw %%mm7, %%mm7 \n\t"
@@ -605,7 +605,7 @@ dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos,
: "rm" (t)
);
do {
- asm volatile (
+ __asm__ volatile (
"movq (%0), %%mm0\n\t"
"movq (%0,%3,2), %%mm1\n\t"
"movq %%mm0, (%2)\n\t"
@@ -637,7 +637,7 @@ dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos,
dst += 8;
} while (--len);
- asm volatile ("pxor %%mm7, %%mm7 \n\t"
+ __asm__ volatile ("pxor %%mm7, %%mm7 \n\t"
"psadbw %%mm6, %%mm7 \n\t"
"movd %%mm7, %0 \n\t"
"emms \n\t"
diff --git a/libmpcodecs/vf_fspp.c b/libmpcodecs/vf_fspp.c
index a6c2c58a3b..46c8468745 100644
--- a/libmpcodecs/vf_fspp.c
+++ b/libmpcodecs/vf_fspp.c
@@ -187,7 +187,7 @@ static void store_slice_mmx(uint8_t *dst, int16_t *src, long dst_stride, long sr
width = (width+7)&~7;
dst_stride-=width;
//src_stride=(src_stride-width)*2;
- asm volatile(
+ __asm__ volatile(
"mov %5, %%"REG_d" \n\t"
"mov %6, %%"REG_S" \n\t"
"mov %7, %%"REG_D" \n\t"
@@ -255,7 +255,7 @@ static void store_slice2_mmx(uint8_t *dst, int16_t *src, long dst_stride, long s
width = (width+7)&~7;
dst_stride-=width;
//src_stride=(src_stride-width)*2;
- asm volatile(
+ __asm__ volatile(
"mov %5, %%"REG_d" \n\t"
"mov %6, %%"REG_S" \n\t"
"mov %7, %%"REG_D" \n\t"
@@ -318,7 +318,7 @@ static void store_slice2_mmx(uint8_t *dst, int16_t *src, long dst_stride, long s
static void mul_thrmat_mmx(struct vf_priv_s *p, int q)
{
uint64_t *adr=&p->threshold_mtx_noq[0];
- asm volatile(
+ __asm__ volatile(
"movd %0, %%mm7 \n\t"
"add $8*8*2, %%"REG_D" \n\t"
"movq 0*8(%%"REG_S"), %%mm0 \n\t"
@@ -558,10 +558,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts)
}
#ifdef HAVE_MMX
- if(gCpuCaps.hasMMX) asm volatile ("emms\n\t");
+ if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
#ifdef HAVE_MMX2
- if(gCpuCaps.hasMMX2) asm volatile ("sfence\n\t");
+ if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
return vf_next_put_image(vf,dmpi, pts);
}
@@ -868,7 +868,7 @@ static void column_fidct_c(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int
static void column_fidct_mmx(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt)
{
uint64_t __attribute__((aligned(8))) temps[4];
- asm volatile(
+ __asm__ volatile(
ASMALIGN(4)
"1: \n\t"
"movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm1 \n\t"
@@ -1669,7 +1669,7 @@ static void row_idct_mmx (DCTELEM* workspace,
int16_t* output_adr, int output_stride, int cnt)
{
uint64_t __attribute__((aligned(8))) temps[4];
- asm volatile(
+ __asm__ volatile(
"lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t"
"1: \n\t"
"movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm0 \n\t"
@@ -1935,7 +1935,7 @@ static void row_fdct_c(DCTELEM *data, const uint8_t *pixels, int line_size, int
static void row_fdct_mmx(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt)
{
uint64_t __attribute__((aligned(8))) temps[4];
- asm volatile(
+ __asm__ volatile(
"lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t"
"6: \n\t"
"movd (%%"REG_S"), %%mm0 \n\t"
diff --git a/libmpcodecs/vf_geq.c b/libmpcodecs/vf_geq.c
index e8f16776d7..d2cbe6554b 100644
--- a/libmpcodecs/vf_geq.c
+++ b/libmpcodecs/vf_geq.c
@@ -33,7 +33,6 @@
#include "mp_image.h"
#include "vf.h"
-#define HAVE_AV_CONFIG_H
#include "libavcodec/avcodec.h"
#include "libavcodec/eval.h"
diff --git a/libmpcodecs/vf_halfpack.c b/libmpcodecs/vf_halfpack.c
index 39ba69bb81..f15a9a439b 100644
--- a/libmpcodecs/vf_halfpack.c
+++ b/libmpcodecs/vf_halfpack.c
@@ -37,7 +37,7 @@ static void halfpack_MMX(unsigned char *dst, unsigned char *src[3],
vinc = srcstride[2] - w/2;
for (h/=2; h; h--) {
- asm (
+ __asm__ (
"pxor %%mm0, %%mm0 \n\t"
ASMALIGN(4)
"1: \n\t"
@@ -99,7 +99,7 @@ static void halfpack_MMX(unsigned char *dst, unsigned char *src[3],
v += vinc;
dst += dstinc;
}
- asm volatile ( "emms \n\t" ::: "memory" );
+ __asm__ volatile ( "emms \n\t" ::: "memory" );
}
#endif
diff --git a/libmpcodecs/vf_ilpack.c b/libmpcodecs/vf_ilpack.c
index 0ffca173da..4b5612643d 100644
--- a/libmpcodecs/vf_ilpack.c
+++ b/libmpcodecs/vf_ilpack.c
@@ -61,7 +61,7 @@ static void pack_li_1_C(unsigned char *dst, unsigned char *y,
static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
unsigned char *u, unsigned char *v, int w)
{
- asm volatile (""
+ __asm__ volatile (""
ASMALIGN(4)
"1: \n\t"
"movq (%0), %%mm1 \n\t"
@@ -91,7 +91,7 @@ static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
unsigned char *u, unsigned char *v, int w, int us, int vs)
{
- asm volatile (""
+ __asm__ volatile (""
"push %%"REG_BP" \n\t"
#ifdef ARCH_X86_64
"mov %6, %%"REG_BP" \n\t"
@@ -199,7 +199,7 @@ static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
unsigned char *u, unsigned char *v, int w, int us, int vs)
{
- asm volatile (""
+ __asm__ volatile (""
"push %%"REG_BP" \n\t"
#ifdef ARCH_X86_64
"mov %6, %%"REG_BP" \n\t"
diff --git a/libmpcodecs/vf_ivtc.c b/libmpcodecs/vf_ivtc.c
index c54405a4eb..450ccb0a3c 100644
--- a/libmpcodecs/vf_ivtc.c
+++ b/libmpcodecs/vf_ivtc.c
@@ -46,7 +46,7 @@ static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char
int i;
short out[24]; // output buffer for the partial metrics from the mmx code
- asm (
+ __asm__ (
"movl $4, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t" // 4 even difference sums
"pxor %%mm5, %%mm5 \n\t" // 4 odd difference sums
@@ -105,7 +105,7 @@ static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char
m->o = out[4]+out[5]+out[6]+out[7];
m->d = m->e + m->o;
- asm (
+ __asm__ (
// First loop to measure first four columns
"movl $4, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t" // Past spacial noise
diff --git a/libmpcodecs/vf_noise.c b/libmpcodecs/vf_noise.c
index ab88cb5964..02fe9d9e16 100644
--- a/libmpcodecs/vf_noise.c
+++ b/libmpcodecs/vf_noise.c
@@ -150,7 +150,7 @@ static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int
long mmx_len= len&(~7);
noise+=shift;
- asm volatile(
+ __asm__ volatile(
"mov %3, %%"REG_a" \n\t"
"pcmpeqb %%mm7, %%mm7 \n\t"
"psllw $15, %%mm7 \n\t"
@@ -179,7 +179,7 @@ static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int
long mmx_len= len&(~7);
noise+=shift;
- asm volatile(
+ __asm__ volatile(
"mov %3, %%"REG_a" \n\t"
"pcmpeqb %%mm7, %%mm7 \n\t"
"psllw $15, %%mm7 \n\t"
@@ -220,7 +220,7 @@ static inline void lineNoise_C(uint8_t *dst, uint8_t *src, int8_t *noise, int le
static inline void lineNoiseAvg_MMX(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
long mmx_len= len&(~7);
- asm volatile(
+ __asm__ volatile(
"mov %5, %%"REG_a" \n\t"
ASMALIGN(4)
"1: \n\t"
@@ -357,10 +357,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
vf_clone_mpi_attributes(dmpi, mpi);
#ifdef HAVE_MMX
- if(gCpuCaps.hasMMX) asm volatile ("emms\n\t");
+ if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
#ifdef HAVE_MMX2
- if(gCpuCaps.hasMMX2) asm volatile ("sfence\n\t");
+ if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
return vf_next_put_image(vf,dmpi, pts);
diff --git a/libmpcodecs/vf_palette.c b/libmpcodecs/vf_palette.c
index 449516f758..b2105f9487 100644
--- a/libmpcodecs/vf_palette.c
+++ b/libmpcodecs/vf_palette.c
@@ -108,15 +108,15 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
break;
case 24:
if (IMGFMT_IS_BGR(dmpi->imgfmt))
- palette8tobgr24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
+ palette8topacked24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
else
- palette8torgb24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
+ palette8topacked24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
break;
case 32:
if (IMGFMT_IS_BGR(dmpi->imgfmt))
- palette8tobgr32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
+ palette8topacked32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
else
- palette8torgb32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
+ palette8topacked32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
break;
}
} else {
@@ -139,15 +139,15 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
break;
case 24:
if (IMGFMT_IS_BGR(dmpi->imgfmt))
- palette8tobgr24(src,dst,mpi->w,mpi->planes[1]);
+ palette8topacked24(src,dst,mpi->w,mpi->planes[1]);
else
- palette8torgb24(src,dst,mpi->w,mpi->planes[1]);
+ palette8topacked24(src,dst,mpi->w,mpi->planes[1]);
break;
case 32:
if (IMGFMT_IS_BGR(dmpi->imgfmt))
- palette8tobgr32(src,dst,mpi->w,mpi->planes[1]);
+ palette8topacked32(src,dst,mpi->w,mpi->planes[1]);
else
- palette8torgb32(src,dst,mpi->w,mpi->planes[1]);
+ palette8topacked32(src,dst,mpi->w,mpi->planes[1]);
break;
}
}
diff --git a/libmpcodecs/vf_pp7.c b/libmpcodecs/vf_pp7.c
index 2fc76b1752..4221625abf 100644
--- a/libmpcodecs/vf_pp7.c
+++ b/libmpcodecs/vf_pp7.c
@@ -157,7 +157,7 @@ static void dctB_c(DCTELEM *dst, DCTELEM *src){
#ifdef HAVE_MMX
static void dctB_mmx(DCTELEM *dst, DCTELEM *src){
- asm volatile (
+ __asm__ volatile (
"movq (%0), %%mm0 \n\t"
"movq 1*4*2(%0), %%mm1 \n\t"
"paddw 6*4*2(%0), %%mm0 \n\t"
@@ -398,10 +398,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
}
#ifdef HAVE_MMX
- if(gCpuCaps.hasMMX) asm volatile ("emms\n\t");
+ if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
#ifdef HAVE_MMX2
- if(gCpuCaps.hasMMX2) asm volatile ("sfence\n\t");
+ if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
return vf_next_put_image(vf,dmpi, pts);
diff --git a/libmpcodecs/vf_qp.c b/libmpcodecs/vf_qp.c
index b08a0d5523..98aeab7535 100644
--- a/libmpcodecs/vf_qp.c
+++ b/libmpcodecs/vf_qp.c
@@ -33,8 +33,6 @@
#include "vf.h"
#include "libvo/fastmemcpy.h"
-// Needed to bring in lrintf.
-#define HAVE_AV_CONFIG_H
#include "libavcodec/avcodec.h"
#include "libavcodec/eval.h"
diff --git a/libmpcodecs/vf_sab.c b/libmpcodecs/vf_sab.c
index 1f7bdbccc1..61a5a7bc32 100644
--- a/libmpcodecs/vf_sab.c
+++ b/libmpcodecs/vf_sab.c
@@ -140,7 +140,7 @@ static int config(struct vf_instance* vf,
unsigned int flags, unsigned int outfmt){
int sw, sh;
-//asm volatile("emms\n\t");
+//__asm__ volatile("emms\n\t");
allocStuff(&vf->priv->luma, width, height);
getSubSampleFactors(&sw, &sh, outfmt);
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c
index 0daa23c605..02cd1ac919 100644
--- a/libmpcodecs/vf_scale.c
+++ b/libmpcodecs/vf_scale.c
@@ -557,7 +557,7 @@ void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, Sw
#ifdef ARCH_X86
if(gCpuCaps.hasMMX)
- asm volatile("emms\n\t"::: "memory"); //FIXME this shouldnt be required but it IS (even for non mmx versions)
+ __asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
#endif
if(firstTime)
{
diff --git a/libmpcodecs/vf_spp.c b/libmpcodecs/vf_spp.c
index b94948d549..11a7cae1ff 100644
--- a/libmpcodecs/vf_spp.c
+++ b/libmpcodecs/vf_spp.c
@@ -153,7 +153,7 @@ static void hardthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *pe
threshold1= qp*((1<<4) - bias) - 1;
- asm volatile(
+ __asm__ volatile(
#define REQUANT_CORE(dst0, dst1, dst2, dst3, src0, src1, src2, src3) \
"movq " #src0 ", %%mm0 \n\t"\
"movq " #src1 ", %%mm1 \n\t"\
@@ -221,7 +221,7 @@ static void softthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *pe
threshold1= qp*((1<<4) - bias) - 1;
- asm volatile(
+ __asm__ volatile(
#undef REQUANT_CORE
#define REQUANT_CORE(