--- /dev/null
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx.c ffmpeg-20060326/libavcodec/i386/dsputil_mmx.c
+--- ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/dsputil_mmx.c 2006-03-26 22:13:32.000000000 +0200
+@@ -52,7 +52,7 @@
+ static const uint64_t ff_pb_3F attribute_used __attribute__ ((aligned(8))) = 0x3F3F3F3F3F3F3F3FULL;
+ static const uint64_t ff_pb_FC attribute_used __attribute__ ((aligned(8))) = 0xFCFCFCFCFCFCFCFCULL;
+
+-#define JUMPALIGN() __asm __volatile (".balign 8"::)
++#define JUMPALIGN() __asm __volatile (".p2align 3"::)
+ #define MOVQ_ZERO(regd) __asm __volatile ("pxor %%" #regd ", %%" #regd ::)
+
+ #define MOVQ_WONE(regd) \
+@@ -195,7 +195,7 @@
+ asm volatile(
+ "mov $-128, %%"REG_a" \n\t"
+ "pxor %%mm7, %%mm7 \n\t"
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%0), %%mm0 \n\t"
+ "movq (%0, %2), %%mm2 \n\t"
+@@ -223,7 +223,7 @@
+ asm volatile(
+ "pxor %%mm7, %%mm7 \n\t"
+ "mov $-128, %%"REG_a" \n\t"
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%0), %%mm0 \n\t"
+ "movq (%1), %%mm2 \n\t"
+@@ -366,7 +366,7 @@
+ {
+ __asm __volatile(
+ "lea (%3, %3), %%"REG_a" \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movd (%1), %%mm0 \n\t"
+ "movd (%1, %3), %%mm1 \n\t"
+@@ -392,7 +392,7 @@
+ {
+ __asm __volatile(
+ "lea (%3, %3), %%"REG_a" \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movq (%1), %%mm0 \n\t"
+ "movq (%1, %3), %%mm1 \n\t"
+@@ -418,7 +418,7 @@
+ {
+ __asm __volatile(
+ "lea (%3, %3), %%"REG_a" \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movq (%1), %%mm0 \n\t"
+ "movq 8(%1), %%mm4 \n\t"
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx_avg.h ffmpeg-20060326/libavcodec/i386/dsputil_mmx_avg.h
+--- ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx_avg.h 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/dsputil_mmx_avg.h 2006-03-26 22:13:51.000000000 +0200
+@@ -754,7 +754,7 @@
+ "lea (%3, %3), %%"REG_a" \n\t"
+ "movq (%1), %%mm0 \n\t"
+ PAVGB" 1(%1), %%mm0 \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movq (%1, %%"REG_a"), %%mm2 \n\t"
+ "movq (%1, %3), %%mm1 \n\t"
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx_rnd.h ffmpeg-20060326/libavcodec/i386/dsputil_mmx_rnd.h
+--- ffmpeg-20060326-bak/libavcodec/i386/dsputil_mmx_rnd.h 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/dsputil_mmx_rnd.h 2006-03-26 22:15:09.000000000 +0200
+@@ -28,7 +28,7 @@
+ MOVQ_BFE(mm6);
+ __asm __volatile(
+ "lea (%3, %3), %%"REG_a" \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movq (%1), %%mm0 \n\t"
+ "movq 1(%1), %%mm1 \n\t"
+@@ -69,7 +69,7 @@
+ "movq %%mm4, (%3) \n\t"
+ "add %5, %3 \n\t"
+ "decl %0 \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movq (%1), %%mm0 \n\t"
+ "movq (%2), %%mm1 \n\t"
+@@ -110,7 +110,7 @@
+ MOVQ_BFE(mm6);
+ __asm __volatile(
+ "lea (%3, %3), %%"REG_a" \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movq (%1), %%mm0 \n\t"
+ "movq 1(%1), %%mm1 \n\t"
+@@ -168,7 +168,7 @@
+ "movq %%mm5, 8(%3) \n\t"
+ "add %5, %3 \n\t"
+ "decl %0 \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movq (%1), %%mm0 \n\t"
+ "movq (%2), %%mm1 \n\t"
+@@ -206,7 +206,7 @@
+ __asm __volatile(
+ "lea (%3, %3), %%"REG_a" \n\t"
+ "movq (%1), %%mm0 \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movq (%1, %3), %%mm1 \n\t"
+ "movq (%1, %%"REG_a"),%%mm2 \n\t"
+@@ -246,7 +246,7 @@
+ "paddusw %%mm1, %%mm5 \n\t"
+ "xor %%"REG_a", %%"REG_a" \n\t"
+ "add %3, %1 \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movq (%1, %%"REG_a"), %%mm0 \n\t"
+ "movq 1(%1, %%"REG_a"), %%mm2 \n\t"
+@@ -458,7 +458,7 @@
+ __asm __volatile(
+ "lea (%3, %3), %%"REG_a" \n\t"
+ "movq (%1), %%mm0 \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movq (%1, %3), %%mm1 \n\t"
+ "movq (%1, %%"REG_a"), %%mm2 \n\t"
+@@ -509,7 +509,7 @@
+ "paddusw %%mm1, %%mm5 \n\t"
+ "xor %%"REG_a", %%"REG_a" \n\t"
+ "add %3, %1 \n\t"
+- ".balign 8 \n\t"
++ ".p2align 3 \n\t"
+ "1: \n\t"
+ "movq (%1, %%"REG_a"), %%mm0 \n\t"
+ "movq 1(%1, %%"REG_a"), %%mm2 \n\t"
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/fdct_mmx.c ffmpeg-20060326/libavcodec/i386/fdct_mmx.c
+--- ffmpeg-20060326-bak/libavcodec/i386/fdct_mmx.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/fdct_mmx.c 2006-03-26 22:19:01.000000000 +0200
+@@ -350,61 +350,61 @@
+
+ static always_inline void fdct_row_sse2(const int16_t *in, int16_t *out)
+ {
++#define FDCT_ROW_SSE2_H1(i,t) \
++ "movq " #i "(%0), %%xmm2 \n\t" \
++ "movq " #i "+8(%0), %%xmm0 \n\t" \
++ "movdqa " #t "+32(%1), %%xmm3 \n\t" \
++ "movdqa " #t "+48(%1), %%xmm7 \n\t" \
++ "movdqa " #t "(%1), %%xmm4 \n\t" \
++ "movdqa " #t "+16(%1), %%xmm5 \n\t"
++
++#define FDCT_ROW_SSE2_H2(i,t) \
++ "movq " #i "(%0), %%xmm2 \n\t" \
++ "movq " #i "+8(%0), %%xmm0 \n\t" \
++ "movdqa " #t "+32(%1), %%xmm3 \n\t" \
++ "movdqa " #t "+48(%1), %%xmm7 \n\t"
++
++#define FDCT_ROW_SSE2(i) \
++ "movq %%xmm2, %%xmm1 \n\t" \
++ "pshuflw $27, %%xmm0, %%xmm0 \n\t" \
++ "paddsw %%xmm0, %%xmm1 \n\t" \
++ "psubsw %%xmm0, %%xmm2 \n\t" \
++ "punpckldq %%xmm2, %%xmm1 \n\t" \
++ "pshufd $78, %%xmm1, %%xmm2 \n\t" \
++ "pmaddwd %%xmm2, %%xmm3 \n\t" \
++ "pmaddwd %%xmm1, %%xmm7 \n\t" \
++ "pmaddwd %%xmm5, %%xmm2 \n\t" \
++ "pmaddwd %%xmm4, %%xmm1 \n\t" \
++ "paddd %%xmm7, %%xmm3 \n\t" \
++ "paddd %%xmm2, %%xmm1 \n\t" \
++ "paddd %%xmm6, %%xmm3 \n\t" \
++ "paddd %%xmm6, %%xmm1 \n\t" \
++ "psrad %3, %%xmm3 \n\t" \
++ "psrad %3, %%xmm1 \n\t" \
++ "packssdw %%xmm3, %%xmm1 \n\t" \
++ "movdqa %%xmm1, " #i "(%4) \n\t"
++
+ asm volatile(
+- ".macro FDCT_ROW_SSE2_H1 i t \n\t"
+- "movq \\i(%0), %%xmm2 \n\t"
+- "movq \\i+8(%0), %%xmm0 \n\t"
+- "movdqa \\t+32(%1), %%xmm3 \n\t"
+- "movdqa \\t+48(%1), %%xmm7 \n\t"
+- "movdqa \\t(%1), %%xmm4 \n\t"
+- "movdqa \\t+16(%1), %%xmm5 \n\t"
+- ".endm \n\t"
+- ".macro FDCT_ROW_SSE2_H2 i t \n\t"
+- "movq \\i(%0), %%xmm2 \n\t"
+- "movq \\i+8(%0), %%xmm0 \n\t"
+- "movdqa \\t+32(%1), %%xmm3 \n\t"
+- "movdqa \\t+48(%1), %%xmm7 \n\t"
+- ".endm \n\t"
+- ".macro FDCT_ROW_SSE2 i \n\t"
+- "movq %%xmm2, %%xmm1 \n\t"
+- "pshuflw $27, %%xmm0, %%xmm0 \n\t"
+- "paddsw %%xmm0, %%xmm1 \n\t"
+- "psubsw %%xmm0, %%xmm2 \n\t"
+- "punpckldq %%xmm2, %%xmm1 \n\t"
+- "pshufd $78, %%xmm1, %%xmm2 \n\t"
+- "pmaddwd %%xmm2, %%xmm3 \n\t"
+- "pmaddwd %%xmm1, %%xmm7 \n\t"
+- "pmaddwd %%xmm5, %%xmm2 \n\t"
+- "pmaddwd %%xmm4, %%xmm1 \n\t"
+- "paddd %%xmm7, %%xmm3 \n\t"
+- "paddd %%xmm2, %%xmm1 \n\t"
+- "paddd %%xmm6, %%xmm3 \n\t"
+- "paddd %%xmm6, %%xmm1 \n\t"
+- "psrad %3, %%xmm3 \n\t"
+- "psrad %3, %%xmm1 \n\t"
+- "packssdw %%xmm3, %%xmm1 \n\t"
+- "movdqa %%xmm1, \\i(%4) \n\t"
+- ".endm \n\t"
+ "movdqa (%2), %%xmm6 \n\t"
+- "FDCT_ROW_SSE2_H1 0 0 \n\t"
+- "FDCT_ROW_SSE2 0 \n\t"
+- "FDCT_ROW_SSE2_H2 64 0 \n\t"
+- "FDCT_ROW_SSE2 64 \n\t"
+-
+- "FDCT_ROW_SSE2_H1 16 64 \n\t"
+- "FDCT_ROW_SSE2 16 \n\t"
+- "FDCT_ROW_SSE2_H2 112 64 \n\t"
+- "FDCT_ROW_SSE2 112 \n\t"
+-
+- "FDCT_ROW_SSE2_H1 32 128 \n\t"
+- "FDCT_ROW_SSE2 32 \n\t"
+- "FDCT_ROW_SSE2_H2 96 128 \n\t"
+- "FDCT_ROW_SSE2 96 \n\t"
+-
+- "FDCT_ROW_SSE2_H1 48 192 \n\t"
+- "FDCT_ROW_SSE2 48 \n\t"
+- "FDCT_ROW_SSE2_H2 80 192 \n\t"
+- "FDCT_ROW_SSE2 80 \n\t"
++ FDCT_ROW_SSE2_H1(0,0)
++ FDCT_ROW_SSE2(0)
++ FDCT_ROW_SSE2_H2(64,0)
++ FDCT_ROW_SSE2(64)
++
++ FDCT_ROW_SSE2_H1(16,64)
++ FDCT_ROW_SSE2(16)
++ FDCT_ROW_SSE2_H2(112,64)
++ FDCT_ROW_SSE2(112)
++
++ FDCT_ROW_SSE2_H1(32,128)
++ FDCT_ROW_SSE2(32)
++ FDCT_ROW_SSE2_H2(96,128)
++ FDCT_ROW_SSE2(96)
++
++ FDCT_ROW_SSE2_H1(48,192)
++ FDCT_ROW_SSE2(48)
++ FDCT_ROW_SSE2_H2(80,192)
++ FDCT_ROW_SSE2(80)
+ :
+ : "r" (in), "r" (tab_frw_01234567_sse2.tab_frw_01234567_sse2), "r" (fdct_r_row_sse2.fdct_r_row_sse2), "i" (SHIFT_FRW_ROW), "r" (out)
+ );
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/idct_mmx_xvid.c ffmpeg-20060326/libavcodec/i386/idct_mmx_xvid.c
+--- ffmpeg-20060326-bak/libavcodec/i386/idct_mmx_xvid.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/idct_mmx_xvid.c 2006-03-26 22:20:28.000000000 +0200
+@@ -295,17 +295,17 @@
+ "movq 8+" #A1 ",%%mm1 \n\t"/* 1 ; x7 x6 x5 x4*/\
+ "movq %%mm0,%%mm2 \n\t"/* 2 ; x3 x2 x1 x0*/\
+ "movq " #A3 ",%%mm3 \n\t"/* 3 ; w05 w04 w01 w00*/\
+- "pshufw $0b10001000,%%mm0,%%mm0 \n\t"/* x2 x0 x2 x0*/\
++ "pshufw $0x88,%%mm0,%%mm0 \n\t"/* x2 x0 x2 x0*/\
+ "movq 8+" #A3 ",%%mm4 \n\t"/* 4 ; w07 w06 w03 w02*/\
+ "movq %%mm1,%%mm5 \n\t"/* 5 ; x7 x6 x5 x4*/\
+ "pmaddwd %%mm0,%%mm3 \n\t"/* x2*w05+x0*w04 x2*w01+x0*w00*/\
+ "movq 32+" #A3 ",%%mm6 \n\t"/* 6 ; w21 w20 w17 w16*/\
+- "pshufw $0b10001000,%%mm1,%%mm1 \n\t"/* x6 x4 x6 x4*/\
++ "pshufw $0x88,%%mm1,%%mm1 \n\t"/* x6 x4 x6 x4*/\
+ "pmaddwd %%mm1,%%mm4 \n\t"/* x6*w07+x4*w06 x6*w03+x4*w02*/\
+ "movq 40+" #A3 ",%%mm7 \n\t"/* 7 ; w23 w22 w19 w18*/\
+- "pshufw $0b11011101,%%mm2,%%mm2 \n\t"/* x3 x1 x3 x1*/\
++ "pshufw $0xdd,%%mm2,%%mm2 \n\t"/* x3 x1 x3 x1*/\
+ "pmaddwd %%mm2,%%mm6 \n\t"/* x3*w21+x1*w20 x3*w17+x1*w16*/\
+- "pshufw $0b11011101,%%mm5,%%mm5 \n\t"/* x7 x5 x7 x5*/\
++ "pshufw $0xdd,%%mm5,%%mm5 \n\t"/* x7 x5 x7 x5*/\
+ "pmaddwd %%mm5,%%mm7 \n\t"/* x7*w23+x5*w22 x7*w19+x5*w18*/\
+ "paddd " #A4 ",%%mm3 \n\t"/* +%4*/\
+ "pmaddwd 16+" #A3 ",%%mm0 \n\t"/* x2*w13+x0*w12 x2*w09+x0*w08*/\
+@@ -330,7 +330,7 @@
+ "packssdw %%mm0,%%mm3 \n\t"/* 0 ; y3 y2 y1 y0*/\
+ "packssdw %%mm4,%%mm7 \n\t"/* 4 ; y6 y7 y4 y5*/\
+ "movq %%mm3, " #A2 " \n\t"/* 3 ; save y3 y2 y1 y0*/\
+- "pshufw $0b10110001,%%mm7,%%mm7 \n\t"/* y7 y6 y5 y4*/\
++ "pshufw $0xb1,%%mm7,%%mm7 \n\t"/* y7 y6 y5 y4*/\
+ "movq %%mm7,8 +" #A2 "\n\t"/* 7 ; save y7 y6 y5 y4*/\
+
+
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/motion_est_mmx.c ffmpeg-20060326/libavcodec/i386/motion_est_mmx.c
+--- ffmpeg-20060326-bak/libavcodec/i386/motion_est_mmx.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/motion_est_mmx.c 2006-03-26 22:24:48.000000000 +0200
+@@ -34,7 +34,7 @@
+ {
+ long len= -(stride*h);
+ asm volatile(
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%1, %%"REG_a"), %%mm0 \n\t"
+ "movq (%2, %%"REG_a"), %%mm2 \n\t"
+@@ -70,7 +70,7 @@
+ {
+ long len= -(stride*h);
+ asm volatile(
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%1, %%"REG_a"), %%mm0 \n\t"
+ "movq (%2, %%"REG_a"), %%mm2 \n\t"
+@@ -92,7 +92,7 @@
+ {
+ long len= -(stride*h);
+ asm volatile(
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%1, %%"REG_a"), %%mm0 \n\t"
+ "movq (%2, %%"REG_a"), %%mm2 \n\t"
+@@ -118,7 +118,7 @@
+ { //FIXME reuse src
+ long len= -(stride*h);
+ asm volatile(
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "movq "MANGLE(bone)", %%mm5 \n\t"
+ "1: \n\t"
+ "movq (%1, %%"REG_a"), %%mm0 \n\t"
+@@ -155,7 +155,7 @@
+ {
+ long len= -(stride*h);
+ asm volatile(
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%1, %%"REG_a"), %%mm0 \n\t"
+ "movq (%2, %%"REG_a"), %%mm1 \n\t"
+@@ -193,7 +193,7 @@
+ {
+ long len= -(stride*h);
+ asm volatile(
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%1, %%"REG_a"), %%mm0 \n\t"
+ "movq (%2, %%"REG_a"), %%mm1 \n\t"
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/mpegvideo_mmx.c ffmpeg-20060326/libavcodec/i386/mpegvideo_mmx.c
+--- ffmpeg-20060326-bak/libavcodec/i386/mpegvideo_mmx.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/mpegvideo_mmx.c 2006-03-26 22:25:09.000000000 +0200
+@@ -66,7 +66,7 @@
+ "packssdw %%mm5, %%mm5 \n\t"
+ "psubw %%mm5, %%mm7 \n\t"
+ "pxor %%mm4, %%mm4 \n\t"
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%0, %3), %%mm0 \n\t"
+ "movq 8(%0, %3), %%mm1 \n\t"
+@@ -129,7 +129,7 @@
+ "packssdw %%mm5, %%mm5 \n\t"
+ "psubw %%mm5, %%mm7 \n\t"
+ "pxor %%mm4, %%mm4 \n\t"
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%0, %3), %%mm0 \n\t"
+ "movq 8(%0, %3), %%mm1 \n\t"
+@@ -222,7 +222,7 @@
+ "packssdw %%mm6, %%mm6 \n\t"
+ "packssdw %%mm6, %%mm6 \n\t"
+ "mov %3, %%"REG_a" \n\t"
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%0, %%"REG_a"), %%mm0 \n\t"
+ "movq 8(%0, %%"REG_a"), %%mm1 \n\t"
+@@ -285,7 +285,7 @@
+ "packssdw %%mm6, %%mm6 \n\t"
+ "packssdw %%mm6, %%mm6 \n\t"
+ "mov %3, %%"REG_a" \n\t"
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%0, %%"REG_a"), %%mm0 \n\t"
+ "movq 8(%0, %%"REG_a"), %%mm1 \n\t"
+@@ -357,7 +357,7 @@
+ "packssdw %%mm6, %%mm6 \n\t"
+ "packssdw %%mm6, %%mm6 \n\t"
+ "mov %3, %%"REG_a" \n\t"
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%0, %%"REG_a"), %%mm0 \n\t"
+ "movq 8(%0, %%"REG_a"), %%mm1 \n\t"
+@@ -418,7 +418,7 @@
+ "packssdw %%mm6, %%mm6 \n\t"
+ "packssdw %%mm6, %%mm6 \n\t"
+ "mov %3, %%"REG_a" \n\t"
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "movq (%0, %%"REG_a"), %%mm0 \n\t"
+ "movq 8(%0, %%"REG_a"), %%mm1 \n\t"
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/mpegvideo_mmx_template.c ffmpeg-20060326/libavcodec/i386/mpegvideo_mmx_template.c
+--- ffmpeg-20060326-bak/libavcodec/i386/mpegvideo_mmx_template.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/mpegvideo_mmx_template.c 2006-03-26 22:25:33.000000000 +0200
+@@ -111,7 +111,7 @@
+ "pxor %%mm6, %%mm6 \n\t"
+ "psubw (%3), %%mm6 \n\t" // -bias[0]
+ "mov $-128, %%"REG_a" \n\t"
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "pxor %%mm1, %%mm1 \n\t" // 0
+ "movq (%1, %%"REG_a"), %%mm0 \n\t" // block[i]
+@@ -155,7 +155,7 @@
+ "pxor %%mm7, %%mm7 \n\t" // 0
+ "pxor %%mm4, %%mm4 \n\t" // 0
+ "mov $-128, %%"REG_a" \n\t"
+- ".balign 16 \n\t"
++ ".p2align 4 \n\t"
+ "1: \n\t"
+ "pxor %%mm1, %%mm1 \n\t" // 0
+ "movq (%1, %%"REG_a"), %%mm0 \n\t" // block[i]
+diff -ru ffmpeg-20060326-bak/libavcodec/i386/simple_idct_mmx.c ffmpeg-20060326/libavcodec/i386/simple_idct_mmx.c
+--- ffmpeg-20060326-bak/libavcodec/i386/simple_idct_mmx.c 2006-03-26 22:04:53.000000000 +0200
++++ ffmpeg-20060326/libavcodec/i386/simple_idct_mmx.c 2006-03-26 22:39:09.000000000 +0200
+@@ -459,10 +459,10 @@
+
+
+ //IDCT( src0, src4, src1, src5, dst, rounder, shift)
+-COL_IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
+-COL_IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
+-COL_IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
+-COL_IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
++COL_IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), "nop", 20)
++COL_IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), "nop", 20)
++COL_IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), "nop", 20)
++COL_IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), "nop", 20)
+
+ #else
+
+@@ -783,10 +783,10 @@
+
+
+ //IDCT( src0, src4, src1, src5, dst, rounder, shift)
+-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
+-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
+-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
+-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
++IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), "nop", 20)
++IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), "nop", 20)
++IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), "nop", 20)
++IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), "nop", 20)
+ "jmp 9f \n\t"
+
+ "#.balign 16 \n\t"\
+@@ -860,10 +860,10 @@
+ "movd %%mm5, 80+" #dst " \n\t"
+
+ //IDCT( src0, src4, src1, src5, dst, rounder, shift)
+-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
+-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
+-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
+-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
++IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), "nop", 20)
++IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), "nop", 20)
++IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), "nop", 20)
++IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), "nop", 20)
+ "jmp 9f \n\t"
+
+ "#.balign 16 \n\t"\
+@@ -928,10 +928,10 @@
+
+
+ //IDCT( src0, src4, src1, src5, dst, rounder, shift)
+-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
+-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
+-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
+-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
++IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), "nop", 20)
++IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), "nop", 20)
++IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), "nop", 20)
++IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), "nop", 20)
+ "jmp 9f \n\t"
+
+ "#.balign 16 \n\t"\
+@@ -1007,10 +1007,10 @@
+ "movd %%mm5, 80+" #dst " \n\t"
+
+ //IDCT( src0, src4, src1, src5, dst, rounder, shift)
+-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
+-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
+-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
+-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
++IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), "nop", 20)
++IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), "nop", 20)
++IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), "nop", 20)
++IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), "nop", 20)
+ "jmp 9f \n\t"
+
+ "#.balign 16 \n\t"\
+@@ -1073,10 +1073,10 @@
+
+
+ //IDCT( src0, src4, src1, src5, dst, rounder, shift)
+-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
+-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
+-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
+-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
++IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), "nop", 20)
++IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), "nop", 20)
++IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), "nop", 20)
++IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), "nop", 20)
+ "jmp 9f \n\t"
+
+ "#.balign 16 \n\t"\
+@@ -1141,9 +1141,9 @@
+
+
+ //IDCT( src0, src4, src1, src5, dst, rounder, shift)
+-IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
++IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0), "nop", 20)
+ //IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
+-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
++IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), "nop", 20)
+ //IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
+ "jmp 9f \n\t"
+
+@@ -1217,10 +1217,10 @@
+
+
+ //IDCT( src0, src4, src1, src5, dst, rounder, shift)
+-IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
+-IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
+-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
+-IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
++IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0), "nop", 20)
++IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0), "nop", 20)
++IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), "nop", 20)
++IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0), "nop", 20)
+ "jmp 9f \n\t"
+
+
+@@ -1259,9 +1259,9 @@
+ "movq %%mm0, 80+" #dst " \n\t"
+
+ //IDCT( src0, src4, src1, src5, dst, rounder, shift)
+-IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
++IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0), "nop", 20)
+ //IDCT( 8(%1), 72(%1), 40(%1), 104(%1), 4(%0),/nop, 20)
+-IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0),/nop, 20)
++IDCT( 16(%1), 80(%1), 48(%1), 112(%1), 8(%0), "nop", 20)
+ //IDCT( 24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
+
+
--- /dev/null
+diff -Naur t/ffmpeg/configure ffmpeg/configure
+--- t/ffmpeg/configure 2007-01-13 12:58:43.000000000 +0100
++++ ffmpeg/configure 2007-01-13 20:41:28.000000000 +0100
+@@ -674,7 +674,7 @@
+ 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
+ mmx="no"
+ ;;
+-*20010315*) echo "BeBits gcc"
++*20010315*|2.95.3*) echo "BeBits gcc"
+ add_cflags "-fno-expensive-optimizations"
+ ;;
+ esac
+diff -Naur t/ffmpeg/libavformat/Makefile ffmpeg/libavformat/Makefile
+--- t/ffmpeg/libavformat/Makefile 2007-01-13 12:58:43.000000000 +0100
++++ ffmpeg/libavformat/Makefile 2007-01-13 20:41:28.000000000 +0100
+@@ -58,6 +58,7 @@
+ OBJS-$(CONFIG_TGP_MUXER) += movenc.o riff.o isom.o
+ OBJS-$(CONFIG_MP4_MUXER) += movenc.o riff.o isom.o
+ OBJS-$(CONFIG_PSP_MUXER) += movenc.o riff.o isom.o
++OBJS-$(CONFIG_IPOD_MUXER) += movenc.o riff.o isom.o
+ OBJS-$(CONFIG_TG2_MUXER) += movenc.o riff.o isom.o
+ OBJS-$(CONFIG_MP3_DEMUXER) += mp3.o
+ OBJS-$(CONFIG_MP2_MUXER) += mp3.o
+diff -Naur t/ffmpeg/libavformat/allformats.c ffmpeg/libavformat/allformats.c
+--- t/ffmpeg/libavformat/allformats.c 2007-01-13 12:58:43.000000000 +0100
++++ ffmpeg/libavformat/allformats.c 2007-01-13 20:41:28.000000000 +0100
+@@ -91,6 +91,9 @@
+ REGISTER_MUXDEMUX(IMAGE2PIPE, image2pipe);
+ REGISTER_DEMUXER (INGENIENT, ingenient);
+ REGISTER_DEMUXER (IPMOVIE, ipmovie);
++#ifdef CONFIG_IPOD_MUXER
++ REGISTER_MUXER (IPOD, ipod);
++#endif
+ REGISTER_MUXDEMUX(M4V, m4v);
+ REGISTER_DEMUXER (MATROSKA, matroska);
+ REGISTER_MUXDEMUX(MJPEG, mjpeg);
+diff -Naur t/ffmpeg/libavformat/allformats.h ffmpeg/libavformat/allformats.h
+--- t/ffmpeg/libavformat/allformats.h 2007-01-13 12:58:43.000000000 +0100
++++ ffmpeg/libavformat/allformats.h 2007-01-13 20:41:28.000000000 +0100
+@@ -77,6 +77,7 @@
+ extern AVOutputFormat mov_muxer;
+ extern AVOutputFormat tgp_muxer;
+ extern AVOutputFormat mp4_muxer;
++extern AVOutputFormat ipod_muxer;
+ extern AVOutputFormat psp_muxer;
+ extern AVOutputFormat tg2_muxer;
+ extern AVInputFormat mp3_demuxer;
+diff -Naur t/ffmpeg/libavformat/movenc.c ffmpeg/libavformat/movenc.c
+--- t/ffmpeg/libavformat/movenc.c 2007-01-13 12:58:43.000000000 +0100
++++ ffmpeg/libavformat/movenc.c 2007-01-13 20:41:28.000000000 +0100
+@@ -36,6 +36,7 @@
+ #define MODE_PSP 3 // example working PSP command line:
+ // ffmpeg -i testinput.avi -f psp -r 14.985 -s 320x240 -b 768 -ar 24000 -ab 32 M4V00001.MP4
+ #define MODE_3G2 4
++#define MODE_IPOD 5
+
+ typedef struct MOVIentry {
+ unsigned int flags, size;
+@@ -54,6 +55,7 @@
+ long time;
+ int64_t trackDuration;
+ long sampleCount;
++ long sampleDuration;
+ long sampleSize;
+ int hasKeyframes;
+ int hasBframes;
+@@ -598,6 +600,18 @@
+ return tag;
+ }
+
++static int mov_write_colr_tag(ByteIOContext *pb)
++{
++ put_be32( pb, 0x12 );
++ put_tag( pb, "colr" );
++ put_tag( pb, "nclc" );
++ put_be16( pb, 6 );
++ put_be16( pb, 1 );
++ put_be16( pb, 6 );
++ put_be32( pb, 0 );
++ return 0x12;
++}
++
+ static int mov_write_video_tag(ByteIOContext *pb, MOVTrack* track)
+ {
+ offset_t pos = url_ftell(pb);
+@@ -647,8 +661,21 @@
+ mov_write_d263_tag(pb);
+ else if(track->enc->codec_id == CODEC_ID_SVQ3)
+ mov_write_svq3_tag(pb);
+- else if(track->enc->codec_id == CODEC_ID_H264)
+- mov_write_avcc_tag(pb, track);
++ else if(track->enc->codec_id == CODEC_ID_H264) {
++ mov_write_avcc_tag(pb, track);
++ if (track->mode == MODE_IPOD) {
++ put_be32(pb, 0x1C); /* size ... reports as 28 in mp4box! */
++ put_tag(pb, "uuid");
++ put_be32(pb, 0x6B6840F2);
++ put_be32(pb, 0x5F244FC5);
++ put_be32(pb, 0xBA39A51B);
++ put_be32(pb, 0xCF0323F3);
++ put_be32(pb, 0x00000001);
++ put_be32(pb, 0x0000039C);
++ }
++ }
++
++ mov_write_colr_tag(pb);
+
+ return updateSize (pb, pos);
+ }
+@@ -700,46 +727,18 @@
+ return atom_size;
+ }
+
++/* TODO: */
+ /* Time to sample atom */
+ static int mov_write_stts_tag(ByteIOContext *pb, MOVTrack* track)
+ {
+- Time2Sample *stts_entries;
+- uint32_t entries = -1;
+- uint32_t atom_size;
+- int i;
+-
+- if (track->enc->codec_type == CODEC_TYPE_AUDIO && !track->audio_vbr) {
+- stts_entries = av_malloc(sizeof(*stts_entries)); /* one entry */
+- stts_entries[0].count = track->sampleCount;
+- stts_entries[0].duration = 1;
+- entries = 1;
+- } else {
+- stts_entries = av_malloc(track->entry * sizeof(*stts_entries)); /* worst case */
+- for (i=0; i<track->entry; i++) {
+- int64_t duration = i + 1 == track->entry ?
+- track->trackDuration - track->cluster[i].dts + track->cluster[0].dts : /* readjusting */
+- track->cluster[i+1].dts - track->cluster[i].dts;
+- if (i && duration == stts_entries[entries].duration) {
+- stts_entries[entries].count++; /* compress */
+- } else {
+- entries++;
+- stts_entries[entries].duration = duration;
+- stts_entries[entries].count = 1;
+- }
+- }
+- entries++; /* last one */
+- }
+- atom_size = 16 + (entries * 8);
+- put_be32(pb, atom_size); /* size */
++ put_be32(pb, 0x18); /* size */
+ put_tag(pb, "stts");
+ put_be32(pb, 0); /* version & flags */
+- put_be32(pb, entries); /* entry count */
+- for (i=0; i<entries; i++) {
+- put_be32(pb, stts_entries[i].count);
+- put_be32(pb, stts_entries[i].duration);
+- }
+- av_free(stts_entries);
+- return atom_size;
++ put_be32(pb, 1); /* entry count */
++
++ put_be32(pb, track->sampleCount); /* sample count */
++ put_be32(pb, track->sampleDuration); /* sample duration */
++ return 0x18;
+ }
+
+ static int mov_write_dref_tag(ByteIOContext *pb)
+@@ -929,6 +928,10 @@
+ /* Track width and height, for visual only */
+ if(track->enc->codec_type == CODEC_TYPE_VIDEO) {
+ double sample_aspect_ratio = av_q2d(track->enc->sample_aspect_ratio);
++ if (track->mode == MODE_IPOD) {
++ /* FIXME , I do not believe this is needed, bad assumption */
++ sample_aspect_ratio = 1;
++ }
+ if( !sample_aspect_ratio ) sample_aspect_ratio = 1;
+ put_be32(pb, sample_aspect_ratio * track->enc->width*0x10000);
+ put_be32(pb, track->enc->height*0x10000);
+@@ -1340,6 +1343,8 @@
+ for (i=0; i<mov->nb_streams; i++) {
+ if(mov->tracks[i].entry <= 0) continue;
+
++ mov->tracks[i].trackDuration =
++ (int64_t)mov->tracks[i].sampleCount * mov->tracks[i].sampleDuration;
+ mov->tracks[i].time = mov->time;
+ mov->tracks[i].trackID = i+1;
+ }
+@@ -1387,6 +1392,8 @@
+ put_tag(pb, "MSNV");
+ else if ( mov->mode == MODE_MP4 )
+ put_tag(pb, "isom");
++ else if ( mov->mode == MODE_IPOD )
++ put_tag(pb, "isom");
+ else
+ put_tag(pb, "qt ");
+
+@@ -1398,6 +1405,8 @@
+ put_tag(pb, "3g2a");
+ else if ( mov->mode == MODE_PSP )
+ put_tag(pb, "MSNV");
++ else if ( mov->mode == MODE_IPOD )
++ put_tag(pb, "mp41");
+ else if ( mov->mode == MODE_MP4 )
+ put_tag(pb, "mp41");
+ else
+@@ -1479,7 +1488,8 @@
+ else if (!strcmp("3g2", s->oformat->name)) mov->mode = MODE_3G2;
+ else if (!strcmp("mov", s->oformat->name)) mov->mode = MODE_MOV;
+ else if (!strcmp("psp", s->oformat->name)) mov->mode = MODE_PSP;
+-
++ else if (!strcmp("ipod", s->oformat->name)) mov->mode = MODE_IPOD;
++
+ mov_write_ftyp_tag(pb,s);
+ if ( mov->mode == MODE_PSP ) {
+ if ( s->nb_streams != 2 ) {
+@@ -1500,10 +1510,12 @@
+ if(st->codec->codec_type == CODEC_TYPE_VIDEO){
+ track->tag = mov_find_video_codec_tag(s, track);
+ track->timescale = st->codec->time_base.den;
++ track->sampleDuration = st->codec->time_base.num;
+ av_set_pts_info(st, 64, 1, st->codec->time_base.den);
+ }else if(st->codec->codec_type == CODEC_TYPE_AUDIO){
+ track->tag = mov_find_audio_codec_tag(s, track);
+ track->timescale = st->codec->sample_rate;
++ track->sampleDuration = st->codec->frame_size;
+ av_set_pts_info(st, 64, 1, st->codec->sample_rate);
+ switch(track->enc->codec_id){
+ case CODEC_ID_MP3:
+@@ -1689,6 +1701,21 @@
+ .flags = AVFMT_GLOBALHEADER,
+ };
+ #endif
++#ifdef CONFIG_IPOD_MUXER
++AVOutputFormat ipod_muxer = {
++ "ipod",
++ "ipod mp4 format",
++ "application/mp4",
++ "mp4,m4v,ipod",
++ sizeof(MOVContext),
++ CODEC_ID_AAC,
++ CODEC_ID_MPEG4,
++ mov_write_header,
++ mov_write_packet,
++ mov_write_trailer,
++ .flags = AVFMT_GLOBALHEADER,
++};
++#endif
+ #ifdef CONFIG_PSP_MUXER
+ AVOutputFormat psp_muxer = {
+ "psp",
+diff -Naur t/ffmpeg/libavformat/tcp.c ffmpeg/libavformat/tcp.c
+--- t/ffmpeg/libavformat/tcp.c 2007-01-13 12:58:43.000000000 +0100
++++ ffmpeg/libavformat/tcp.c 2007-01-13 20:41:28.000000000 +0100
+@@ -114,11 +114,13 @@
+ break;
+ }
+
++#ifndef __BEOS__
+ /* test error */
+ optlen = sizeof(ret);
+ getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen);
+ if (ret != 0)
+ goto fail;
++#endif
+ }
+ s->fd = fd;
+ return 0;