From: Christophe Massiot Date: Wed, 5 Sep 2001 16:07:50 +0000 (+0000) Subject: * Altivec IDCT and motion compensation, based on Paul Mackerras's mpeg2dec X-Git-Tag: 0.2.91~131 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=b3b880766e2b815d460916cb0c44e5d6f7b593c3;p=vlc * Altivec IDCT and motion compensation, based on Paul Mackerras's mpeg2dec (untested !) ; * Local minor optimizations in IDCT ; * Removed a hopeless kludge in input_clock.c --- diff --git a/AUTHORS b/AUTHORS index cd33b53f0f..83f6f49751 100644 --- a/AUTHORS +++ b/AUTHORS @@ -175,6 +175,10 @@ D: AC3 decoder D: MPEG audio decoder D: MPEG video decoder +N: Paul Mackerras +E: paulus@linuxcare.com.au +D: Altivec IDCT and motion + N: Wade Majors E: guru@startrek.com D: BeOS testing, icon integration, debugging and fixes diff --git a/Makefile.opts.in b/Makefile.opts.in index fcd950ba32..4fd690881f 100644 --- a/Makefile.opts.in +++ b/Makefile.opts.in @@ -74,7 +74,7 @@ LIB_GGI = @LIB_GGI@ LIB_GLIDE = @LIB_GLIDE@ LIB_GNOME = @LIB_GNOME@ LIB_GTK = @LIB_GTK@ -LIB_IDCTALTIVEC = @LIB_IDCTALTIVEC@ +LIB_ALTIVEC = @LIB_ALTIVEC@ LIB_LIBDVDCSS = @LIB_LIBDVDCSS@ LIB_KDE = @LIB_KDE@ LIB_MACOSX = @LIB_MACOSX@ diff --git a/configure b/configure index cd020fd5ac..69ae9fbec9 100755 --- a/configure +++ b/configure @@ -16,7 +16,7 @@ ac_help="$ac_help ac_help="$ac_help --disable-mmx Disable MMX optimizations (default enabled for x86)" ac_help="$ac_help - --enable-altivec Enable altivec optimizations (default disabled since it is broken)" + --disable-altivec Disable altivec optimizations (default enabled on PPC)" ac_help="$ac_help --enable-debug Enable debug mode (default disabled)" ac_help="$ac_help @@ -2136,12 +2136,15 @@ else #include #include #include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -2196,7 +2199,7 @@ main() /* * First, make a file with some known garbage in it. */ - data = malloc(pagesize); + data = (char*)malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) @@ -2217,7 +2220,7 @@ main() fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); - data2 = malloc(2 * pagesize); + data2 = (char*)malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); @@ -2235,7 +2238,7 @@ main() */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; - data3 = malloc(pagesize); + data3 = (char*)malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) @@ -2249,7 +2252,7 @@ main() } EOF -if { (eval echo configure:2253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2272,12 +2275,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2276: checking return type of signal handlers" >&5 +echo "configure:2279: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2294,7 +2297,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2313,7 +2316,7 @@ EOF echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2317: checking for dlopen in -ldl" >&5 +echo "configure:2320: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2321,7 +2324,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2353,7 +2356,7 @@ else fi echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6 -echo "configure:2357: checking for pow in -lm" >&5 +echo "configure:2360: checking for pow in -lm" >&5 ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2361,7 +2364,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2396,7 +2399,7 @@ fi THREAD_LIB=error if test "x${THREAD_LIB}" = xerror; then echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6 -echo "configure:2400: checking for pthread_attr_init in -lpthread" >&5 +echo "configure:2403: checking for pthread_attr_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2404,7 +2407,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2438,7 +2441,7 @@ fi fi if test "x${THREAD_LIB}" = xerror; then echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6 -echo "configure:2442: checking for pthread_attr_init in -lpthreads" >&5 +echo "configure:2445: checking for pthread_attr_init in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2446,7 +2449,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2480,7 +2483,7 @@ fi fi if test "x${THREAD_LIB}" = xerror; then echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6 -echo "configure:2484: checking for pthread_attr_init in -lc_r" >&5 +echo "configure:2487: checking for pthread_attr_init in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2488,7 +2491,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2522,12 +2525,12 @@ fi fi if test "x${THREAD_LIB}" = xerror; then echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6 -echo "configure:2526: checking for pthread_attr_init" >&5 +echo "configure:2529: checking for pthread_attr_init" >&5 if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pthread_attr_init=yes" else @@ -2573,7 +2576,7 @@ fi fi echo $ac_n "checking for cthread_fork in -lthreads""... $ac_c" 1>&6 -echo "configure:2577: checking for cthread_fork in -lthreads" >&5 +echo "configure:2580: checking for cthread_fork in -lthreads" >&5 ac_lib_var=`echo threads'_'cthread_fork | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2581,7 +2584,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2614,7 +2617,7 @@ fi cat > conftest.$ac_ext < EOF @@ -2630,7 +2633,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -2650,17 +2653,17 @@ for ac_hdr in stddef.h getopt.h strings.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2654: checking for $ac_hdr" >&5 +echo "configure:2657: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2690,17 +2693,17 @@ for ac_hdr in sys/sockio.h fcntl.h sys/time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2694: checking for $ac_hdr" >&5 +echo "configure:2697: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2730,17 +2733,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2734: checking for $ac_hdr" >&5 +echo "configure:2737: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2770,17 +2773,17 @@ for ac_hdr in dlfcn.h image.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2774: checking for $ac_hdr" >&5 +echo "configure:2777: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2810,17 +2813,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2814: checking for $ac_hdr" >&5 +echo "configure:2817: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2850,17 +2853,17 @@ for ac_hdr in machine/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2854: checking for $ac_hdr" >&5 +echo "configure:2857: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2891,17 +2894,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2895: checking for $ac_hdr" >&5 +echo "configure:2898: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2930,9 +2933,9 @@ done CFLAGS="${save_CFLAGS} -Wall -Werror" echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6 -echo "configure:2934: checking for ntohl in sys/param.h" >&5 +echo "configure:2937: checking for ntohl in sys/param.h" >&5 cat > conftest.$ac_ext < void foo() { int meuh; ntohl(meuh); } @@ -2940,7 +2943,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define NTOHL_IN_SYS_PARAM_H 1 @@ -2957,16 +2960,16 @@ rm -f conftest* CFLAGS="${save_CFLAGS} -finline-limit-20000" echo $ac_n "checking if \$CC accepts -finline-limit""... $ac_c" 1>&6 -echo "configure:2961: checking if \$CC accepts -finline-limit" >&5 +echo "configure:2964: checking if \$CC accepts -finline-limit" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* save_CFLAGS="${save_CFLAGS} -finline-limit-20000"; echo "$ac_t""yes" 1>&6 else @@ -2979,16 +2982,16 @@ rm -f conftest* CFLAGS="${save_CFLAGS} -bundle -undefined suppress" echo $ac_n "checking if \$CC accepts -bundle -undefined suppress""... $ac_c" 1>&6 -echo "configure:2983: checking if \$CC accepts -bundle -undefined suppress" >&5 +echo "configure:2986: checking if \$CC accepts -bundle -undefined suppress" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* PLCFLAGS="${PLCFLAGS} -bundle -undefined suppress"; echo "$ac_t""yes" 1>&6 else @@ -3001,16 +3004,16 @@ rm -f conftest* CFLAGS="${save_CFLAGS} -shared" echo $ac_n "checking if \$CC accepts -shared""... $ac_c" 1>&6 -echo "configure:3005: checking if \$CC accepts -shared" >&5 +echo "configure:3008: checking if \$CC accepts -shared" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* PLCFLAGS="${PLCFLAGS} -shared"; echo "$ac_t""yes" 1>&6 else @@ -3025,16 +3028,16 @@ if test x"${SOFLAGS}" = x; then try_SOFLAGS="-Wl,-soname -Wl," LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0" echo $ac_n "checking if linker accepts ${try_SOFLAGS}foo.so.0""... $ac_c" 1>&6 -echo "configure:3029: checking if linker accepts ${try_SOFLAGS}foo.so.0" >&5 +echo "configure:3032: checking if linker accepts ${try_SOFLAGS}foo.so.0" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* SOFLAGS="${try_SOFLAGS}"; echo "$ac_t""yes" 1>&6 else @@ -3050,16 +3053,16 @@ if test x"${SOFLAGS}" = x; then try_SOFLAGS="-Wl,-h -Wl," LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0" echo $ac_n "checking if linker accepts ${try_SOFLAGS}foo.so.0""... $ac_c" 1>&6 -echo "configure:3054: checking if linker accepts ${try_SOFLAGS}foo.so.0" >&5 +echo "configure:3057: checking if linker accepts ${try_SOFLAGS}foo.so.0" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* SOFLAGS="${try_SOFLAGS}"; echo "$ac_t""yes" 1>&6 else @@ -3075,9 +3078,9 @@ CFLAGS="${save_CFLAGS}" LDFLAGS="${save_LDFLAGS}" echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3079: checking for boolean_t in sys/types.h" >&5 +echo "configure:3082: checking for boolean_t in sys/types.h" >&5 cat > conftest.$ac_ext < void quux() { boolean_t foo; } @@ -3085,7 +3088,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define BOOLEAN_T_IN_SYS_TYPES_H 1 @@ -3100,9 +3103,9 @@ else fi rm -f conftest* echo $ac_n "checking for boolean_t in pthread.h""... $ac_c" 1>&6 -echo "configure:3104: checking for boolean_t in pthread.h" >&5 +echo "configure:3107: checking for boolean_t in pthread.h" >&5 cat > conftest.$ac_ext < void quux() { boolean_t foo; } @@ -3110,7 +3113,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define BOOLEAN_T_IN_PTHREAD_H 1 @@ -3125,9 +3128,9 @@ else fi rm -f conftest* echo $ac_n "checking for boolean_t in cthreads.h""... $ac_c" 1>&6 -echo "configure:3129: checking for boolean_t in cthreads.h" >&5 +echo "configure:3132: checking for boolean_t in cthreads.h" >&5 cat > conftest.$ac_ext < void quux() { boolean_t foo; } @@ -3135,7 +3138,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define BOOLEAN_T_IN_CTHREADS_H 1 @@ -3151,18 +3154,18 @@ fi rm -f conftest* echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3155: checking for working const" >&5 +echo "configure:3158: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3226,12 +3229,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3230: checking for ANSI C header files" >&5 +echo "configure:3233: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3239,7 +3242,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3243: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3256,7 +3259,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3274,7 +3277,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3295,7 +3298,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3306,7 +3309,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3330,12 +3333,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3334: checking for size_t" >&5 +echo "configure:3337: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3363,12 +3366,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3367: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3370: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3377,7 +3380,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3399,21 +3402,21 @@ fi echo $ac_n "checking __attribute__ ((aligned ())) support""... $ac_c" 1>&6 -echo "configure:3403: checking __attribute__ ((aligned ())) support" >&5 +echo "configure:3406: checking __attribute__ ((aligned ())) support" >&5 if eval "test \"`echo '$''{'ac_cv_c_attribute_aligned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_attribute_aligned=0 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try else @@ -3445,16 +3448,16 @@ THREEDNOW_MODULES="imdct3dn downmix3dn" SSE_MODULES="imdctsse downmixsse" echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6 -echo "configure:3449: checking if \$CC groks MMX inline assembly" >&5 +echo "configure:3452: checking if \$CC groks MMX inline assembly" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}" echo "$ac_t""yes" 1>&6 @@ -3467,16 +3470,16 @@ fi rm -f conftest* echo $ac_n "checking if \$CC groks MMX EXT inline assembly""... $ac_c" 1>&6 -echo "configure:3471: checking if \$CC groks MMX EXT inline assembly" >&5 +echo "configure:3474: checking if \$CC groks MMX EXT inline assembly" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}" echo "$ac_t""yes" 1>&6 @@ -3489,16 +3492,16 @@ fi rm -f conftest* echo $ac_n "checking if \$CC groks 3D Now! inline assembly""... $ac_c" 1>&6 -echo "configure:3493: checking if \$CC groks 3D Now! inline assembly" >&5 +echo "configure:3496: checking if \$CC groks 3D Now! inline assembly" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}" echo "$ac_t""yes" 1>&6 @@ -3511,16 +3514,16 @@ fi rm -f conftest* echo $ac_n "checking if \$CC groks SSE inline assembly""... $ac_c" 1>&6 -echo "configure:3515: checking if \$CC groks SSE inline assembly" >&5 +echo "configure:3518: checking if \$CC groks SSE inline assembly" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}" echo "$ac_t""yes" 1>&6 @@ -3532,6 +3535,28 @@ else fi rm -f conftest* +echo $ac_n "checking if \$CC groks Altivec inline assembly""... $ac_c" 1>&6 +echo "configure:3540: checking if \$CC groks Altivec inline assembly" >&5 +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}" + echo "$ac_t""yes" 1>&6 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + CAN_BUILD_LIBDVDCSS=0 @@ -3539,17 +3564,17 @@ for ac_hdr in winioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3543: checking for $ac_hdr" >&5 +echo "configure:3568: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3582,17 +3607,17 @@ for ac_hdr in sys/ioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3586: checking for $ac_hdr" >&5 +echo "configure:3611: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3621: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3618,17 +3643,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3622: checking for $ac_hdr" >&5 +echo "configure:3647: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3632: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3657: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3657,7 +3682,7 @@ done BSD_DVD_STRUCT=0 LINUX_DVD_STRUCT=0 cat > conftest.$ac_ext < EOF @@ -3675,7 +3700,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -3693,7 +3718,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -3712,7 +3737,7 @@ rm -f conftest* NEED_BSDI_LIBDVD=0 cat > conftest.$ac_ext < EOF @@ -3734,17 +3759,17 @@ else do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3738: checking for $ac_hdr" >&5 +echo "configure:3763: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3748: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3784,17 +3809,17 @@ rm -f conftest* ac_safe=`echo "sys/scsi/scsi_types.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/scsi/scsi_types.h""... $ac_c" 1>&6 -echo "configure:3788: checking for sys/scsi/scsi_types.h" >&5 +echo "configure:3813: checking for sys/scsi/scsi_types.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3813,17 +3838,17 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ac_safe=`echo "sys/scsi/impl/uscsi.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/scsi/impl/uscsi.h""... $ac_c" 1>&6 -echo "configure:3817: checking for sys/scsi/impl/uscsi.h" >&5 +echo "configure:3842: checking for sys/scsi/impl/uscsi.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3900,23 +3925,23 @@ fi if test "${enable_mmx+set}" = set; then enableval="$enable_mmx" if test x$enableval = xyes; then ARCH="${ARCH} mmx"; - BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi + BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi else if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86 -o x${host_cpu} = xi386; then ARCH="${ARCH} mmx"; - BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi + BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi fi # Check whether --enable-altivec or --disable-altivec was given. if test "${enable_altivec+set}" = set; then enableval="$enable_altivec" - if test x$enableval = xyes; then ARCH="${ARCH} altivec" - BUILTINS="${BUILTINS} idctaltivec" - LIB_IDCTALTIVEC="-framework vecLib" - fi + if test x$enableval = xyes; then ARCH="${ARCH} altivec"; + BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi +else + if test x${host_cpu} = xpowerpc; then ARCH="${ARCH} altivec"; + BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi fi -#[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH="${ARCH} altivec"; PLUGINS="${PLUGINS} idctaltivec"; fi ]) DEBUG=0 # Check whether --enable-debug or --disable-debug was given. @@ -3977,7 +4002,7 @@ if test "${enable_pth+set}" = set; then enableval="$enable_pth" if test x$enableval = xyes; then echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6 -echo "configure:3981: checking for pth_init in -lpth" >&5 +echo "configure:4006: checking for pth_init in -lpth" >&5 ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3985,7 +4010,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpth $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4024,7 +4049,7 @@ else fi cat > conftest.$ac_ext < EOF @@ -4188,7 +4213,7 @@ if test "${enable_esd+set}" = set; then # Extract the first word of "esd-config", so it can be a program name with args. set dummy esd-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4192: checking for $ac_word" >&5 +echo "configure:4217: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4249,23 +4274,24 @@ if test "${enable_macosx+set}" = set; then LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL" LIB_TS="${LIB_TS} -framework AGL -framework Carbon" LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon" + LIB_ALTIVEC="-framework vecLib" fi else for ac_hdr in Carbon/Carbon.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4259: checking for $ac_hdr" >&5 +echo "configure:4285: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4269: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4289,6 +4315,7 @@ EOF LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL" LIB_TS="${LIB_TS} -framework AGL -framework Carbon" LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon" + LIB_ALTIVEC="-framework vecLib" else echo "$ac_t""no" 1>&6 @@ -4310,17 +4337,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4314: checking for $ac_hdr" >&5 +echo "configure:4341: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4398,7 +4425,7 @@ fi # Extract the first word of "sdl12-config", so it can be a program name with args. set dummy sdl12-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4402: checking for $ac_word" >&5 +echo "configure:4429: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SDL12_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4438,7 +4465,7 @@ fi # Extract the first word of "sdl11-config", so it can be a program name with args. set dummy sdl11-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4442: checking for $ac_word" >&5 +echo "configure:4469: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SDL11_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4479,7 +4506,7 @@ fi # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4483: checking for $ac_word" >&5 +echo "configure:4510: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4525,17 +4552,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4529: checking for $ac_hdr" >&5 +echo "configure:4556: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4539: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4598,17 +4625,17 @@ if test "${with_directx+set}" = set; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4602: checking for $ac_hdr" >&5 +echo "configure:4629: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4646,17 +4673,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4650: checking for $ac_hdr" >&5 +echo "configure:4677: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4768,7 +4795,7 @@ then # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4772: checking for $ac_word" >&5 +echo "configure:4799: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4813,17 +4840,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4817: checking for $ac_hdr" >&5 +echo "configure:4844: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4874,17 +4901,17 @@ if test x$enable_x11 != xno; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4878: checking for $ac_hdr" >&5 +echo "configure:4905: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4915: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4936,17 +4963,17 @@ if test x$enable_xvideo != xno; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4940: checking for $ac_hdr" >&5 +echo "configure:4967: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4986,17 +5013,17 @@ if test "${enable_alsa+set}" = set; then then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6 -echo "configure:4990: checking for sys/asoundlib.h" >&5 +echo "configure:5017: checking for sys/asoundlib.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5013,7 +5040,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6 -echo "configure:5017: checking for main in -lasound" >&5 +echo "configure:5044: checking for main in -lasound" >&5 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5021,14 +5048,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lasound $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5308,7 +5335,7 @@ s%@LIB_GGI@%$LIB_GGI%g s%@LIB_GLIDE@%$LIB_GLIDE%g s%@LIB_GNOME@%$LIB_GNOME%g s%@LIB_GTK@%$LIB_GTK%g -s%@LIB_IDCTALTIVEC@%$LIB_IDCTALTIVEC%g +s%@LIB_ALTIVEC@%$LIB_ALTIVEC%g s%@LIB_LIBDVDCSS@%$LIB_LIBDVDCSS%g s%@LIB_KDE@%$LIB_KDE%g s%@LIB_MACOSX@%$LIB_MACOSX%g diff --git a/configure.in b/configure.in index 61e38dbcfd..2b7f853ec2 100644 --- a/configure.in +++ b/configure.in @@ -239,6 +239,11 @@ AC_TRY_COMPILE([void quux(){void *p;asm("xorps %%xmm1,%%xmm2"::"r"(p));}],, ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}" AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) +AC_MSG_CHECKING([if \$CC groks Altivec inline assembly]) +AC_TRY_COMPILE([void quux(){void *p;asm("mtspr 256,%0"::"r"(-1));}],, + ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}" + AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) + dnl dnl libdvdcss: check for DVD ioctls dnl @@ -354,20 +359,19 @@ dnl AC_ARG_ENABLE(mmx, [ --disable-mmx Disable MMX optimizations (default enabled for x86)], [ if test x$enableval = xyes; then ARCH="${ARCH} mmx"; - BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ], + BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ], [ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86 -o x${host_cpu} = xi386; then ARCH="${ARCH} mmx"; - BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ]) + BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ]) dnl dnl AltiVec acceleration dnl AC_ARG_ENABLE(altivec, -[ --enable-altivec Enable altivec optimizations (default disabled since it is broken)], -[ if test x$enableval = xyes; then ARCH="${ARCH} altivec" - BUILTINS="${BUILTINS} idctaltivec" - LIB_IDCTALTIVEC="-framework vecLib" - fi ]) -#[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH="${ARCH} altivec"; PLUGINS="${PLUGINS} idctaltivec"; fi ]) +[ --disable-altivec Disable altivec optimizations (default enabled on PPC)], +[ if test x$enableval = xyes; then ARCH="${ARCH} altivec"; + BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ], +[ if test x${host_cpu} = xpowerpc; then ARCH="${ARCH} altivec"; + BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ]) dnl dnl Debugging mode @@ -394,7 +398,7 @@ AC_ARG_ENABLE(trace, [ if test x$enableval = xyes; then TRACE=1; fi ]) dnl -dnl Trace mode +dnl Profiling dnl GPROF=0 AC_ARG_ENABLE(gprof, @@ -601,12 +605,14 @@ AC_ARG_ENABLE(macosx, LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL" LIB_TS="${LIB_TS} -framework AGL -framework Carbon" LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon" + LIB_ALTIVEC="-framework vecLib" fi], [AC_CHECK_HEADERS(Carbon/Carbon.h, BUILTINS="${BUILTINS} macosx" LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL" LIB_TS="${LIB_TS} -framework AGL -framework Carbon" LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon" + LIB_ALTIVEC="-framework vecLib" )]) dnl @@ -921,7 +927,7 @@ AC_SUBST(LIB_GGI) AC_SUBST(LIB_GLIDE) AC_SUBST(LIB_GNOME) AC_SUBST(LIB_GTK) -AC_SUBST(LIB_IDCTALTIVEC) +AC_SUBST(LIB_ALTIVEC) AC_SUBST(LIB_LIBDVDCSS) AC_SUBST(LIB_KDE) AC_SUBST(LIB_MACOSX) diff --git a/include/input_ext-intf.h b/include/input_ext-intf.h index efb0751391..bc0741987b 100644 --- a/include/input_ext-intf.h +++ b/include/input_ext-intf.h @@ -4,7 +4,7 @@ * control the pace of reading. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: input_ext-intf.h,v 1.41 2001/07/18 14:21:00 massiot Exp $ + * $Id: input_ext-intf.h,v 1.42 2001/09/05 16:07:49 massiot Exp $ * * Authors: Christophe Massiot * @@ -125,7 +125,6 @@ typedef struct pgrm_descriptor_s mtime_t cr_ref, sysdate_ref; mtime_t last_cr; /* reference to detect unexpected stream * discontinuities */ - mtime_t last_syscr; count_t c_average_count; /* counter used to compute dynamic average values */ int i_synchro_state; diff --git a/include/modules.h b/include/modules.h index 1b707c4d42..fb29c6eba0 100644 --- a/include/modules.h +++ b/include/modules.h @@ -2,7 +2,7 @@ * modules.h : Module management functions. ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules.h,v 1.28 2001/08/22 17:21:45 massiot Exp $ + * $Id: modules.h,v 1.29 2001/09/05 16:07:49 massiot Exp $ * * Authors: Samuel Hocevar * @@ -170,13 +170,15 @@ typedef struct function_list_s struct { void ( * pf_idct_init ) ( void ** ); - void ( * pf_sparse_idct ) ( void *, dctelem_t *, int ); - void ( * pf_idct ) ( void *, dctelem_t *, int ); + void ( * pf_sparse_idct_add )( dctelem_t *, yuv_data_t *, int, + void *, int ); + void ( * pf_idct_add ) ( dctelem_t *, yuv_data_t *, int, + void *, int ); + void ( * pf_sparse_idct_copy )( dctelem_t *, yuv_data_t *, int, + void *, int ); + void ( * pf_idct_copy ) ( dctelem_t *, yuv_data_t *, int, + void *, int ); void ( * pf_norm_scan ) ( u8 ppi_scan[2][64] ); - - void ( * pf_decode_init ) ( ); - void ( * pf_addblock ) ( dctelem_t *, yuv_data_t *, int ); - void ( * pf_copyblock ) ( dctelem_t *, yuv_data_t *, int ); } idct; /* YUV transformation plugin */ diff --git a/include/vdec_ext-plugins.h b/include/vdec_ext-plugins.h index d6ee8f11ae..dd74f09d8b 100644 --- a/include/vdec_ext-plugins.h +++ b/include/vdec_ext-plugins.h @@ -2,7 +2,7 @@ * vdec_ext-plugins.h : structures from the video decoder exported to plug-ins ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: vdec_ext-plugins.h,v 1.3 2001/08/22 17:21:45 massiot Exp $ + * $Id: vdec_ext-plugins.h,v 1.4 2001/09/05 16:07:49 massiot Exp $ * * Authors: Christophe Massiot * @@ -28,8 +28,9 @@ typedef struct idct_inner_s { dctelem_t pi_block[64]; /* block */ - void ( * pf_idct ) ( void *, dctelem_t*, int ); - /* sparse IDCT or not ? */ + void ( * pf_idct ) ( dctelem_t *, yuv_data_t *, int, + void *, int ); + /* sparse IDCT or not, add or copy ? */ int i_sparse_pos; /* position of the * non-NULL coeff */ yuv_data_t * p_dct_data; /* pointer to the position diff --git a/plugins/idct/Makefile b/plugins/idct/Makefile index c98dd769fe..56cd234c50 100644 --- a/plugins/idct/Makefile +++ b/plugins/idct/Makefile @@ -12,27 +12,14 @@ PLUGIN_IDCTCLASSIC = idctclassic.o PLUGIN_IDCTMMX = idctmmx.o PLUGIN_IDCTMMXEXT = idctmmxext.o PLUGIN_IDCTALTIVEC = idctaltivec.o -PLUGIN_IDCTCOMMON = vdec_idct.o -PLUGIN_VDECBLOCK_C = vdec_block_c.o -PLUGIN_VDECBLOCK_MMX = vdec_block_mmx.o - -BUILTIN_IDCT = $(PLUGIN_IDCT:%.o=BUILTIN_IDCT_%.o) \ - $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCT_%.o) \ - $(PLUGIN_VDECBLOCK_C:%.o=BUILTIN_IDCT_%.o) -BUILTIN_IDCTCLASSIC = $(PLUGIN_IDCTCLASSIC:%.o=BUILTIN_IDCTCLASSIC_%.o) \ - $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTCLASSIC_%.o) \ - $(PLUGIN_VDECBLOCK_C:%.o=BUILTIN_IDCTCLASSIC_%.o) -BUILTIN_IDCTMMX = $(PLUGIN_IDCTMMX:%.o=BUILTIN_IDCTMMX_%.o) \ - $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTMMX_%.o) \ - $(PLUGIN_VDECBLOCK_MMX:%.o=BUILTIN_IDCTMMX_%.o) -BUILTIN_IDCTMMXEXT = $(PLUGIN_IDCTMMXEXT:%.o=BUILTIN_IDCTMMXEXT_%.o) \ - $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTMMXEXT_%.o) \ - $(PLUGIN_VDECBLOCK_MMX:%.o=BUILTIN_IDCTMMXEXT_%.o) -BUILTIN_IDCTALTIVEC = $(PLUGIN_IDCTALTIVEC:%.o=BUILTIN_IDCTALTIVEC_%.o) \ - $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTALTIVEC_%.o) \ - $(PLUGIN_VDECBLOCK_C:%.o=BUILTIN_IDCTALTIVEC_%.o) - -PLUGIN_C = $(PLUGIN_IDCT) $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_C) $(PLUGIN_VDECBLOCK_MMX) + +BUILTIN_IDCT = $(PLUGIN_IDCT:%.o=BUILTIN_IDCT_%.o) +BUILTIN_IDCTCLASSIC = $(PLUGIN_IDCTCLASSIC:%.o=BUILTIN_IDCTCLASSIC_%.o) +BUILTIN_IDCTMMX = $(PLUGIN_IDCTMMX:%.o=BUILTIN_IDCTMMX_%.o) +BUILTIN_IDCTMMXEXT = $(PLUGIN_IDCTMMXEXT:%.o=BUILTIN_IDCTMMXEXT_%.o) +BUILTIN_IDCTALTIVEC = $(PLUGIN_IDCTALTIVEC:%.o=BUILTIN_IDCTALTIVEC_%.o) + +PLUGIN_C = $(PLUGIN_IDCT) $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMXEXT) ALL_OBJ = $(PLUGIN_C) $(PLUGIN_IDCTALTIVEC) $(BUILTIN_IDCT) $(BUILTIN_IDCTCLASSIC) $(BUILTIN_IDCTMMX) $(BUILTIN_IDCTMMXEXT) $(BUILTIN_IDCTALTIVEC) # @@ -69,36 +56,36 @@ $(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: %.c # Real targets # -../idct.so: $(PLUGIN_IDCT) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_C) +../idct.so: $(PLUGIN_IDCT) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) ../idct.a: $(BUILTIN_IDCT) ar r $@ $^ $(RANLIB) $@ -../idctclassic.so: $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_C) +../idctclassic.so: $(PLUGIN_IDCTCLASSIC) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) ../idctclassic.a: $(BUILTIN_IDCTCLASSIC) ar r $@ $^ $(RANLIB) $@ -../idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_MMX) +../idctmmx.so: $(PLUGIN_IDCTMMX) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) ../idctmmx.a: $(BUILTIN_IDCTMMX) ar r $@ $^ $(RANLIB) $@ -../idctmmxext.so: $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_MMX) +../idctmmxext.so: $(PLUGIN_IDCTMMXEXT) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) ../idctmmxext.a: $(BUILTIN_IDCTMMXEXT) ar r $@ $^ $(RANLIB) $@ -../idctaltivec.so: $(PLUGIN_IDCTALTIVEC) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_C) - $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_IDCTALTIVEC) +../idctaltivec.so: $(PLUGIN_IDCTALTIVEC) + $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_ALTIVEC) ../idctaltivec.a: $(BUILTIN_IDCTALTIVEC) ar r $@ $^ diff --git a/plugins/idct/vdec_block_c.c b/plugins/idct/block_c.h similarity index 76% rename from plugins/idct/vdec_block_c.c rename to plugins/idct/block_c.h index db50d13909..777123242b 100644 --- a/plugins/idct/vdec_block_c.c +++ b/plugins/idct/block_c.h @@ -1,8 +1,8 @@ /***************************************************************************** - * vdec_block_c.c: Macroblock copy functions in C + * block_c.h: Macroblock copy functions in C ***************************************************************************** * Copyright (C) 1999, 2000, 2001 VideoLAN - * $Id: vdec_block_c.c,v 1.6 2001/08/22 17:21:45 massiot Exp $ + * $Id: block_c.h,v 1.1 2001/09/05 16:07:49 massiot Exp $ * * Authors: Christophe Massiot * @@ -21,32 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -/* MODULE_NAME defined in Makefile together with -DBUILTIN */ -#ifdef BUILTIN -# include "modules_inner.h" -#else -# define _M( foo ) foo -#endif - -/***************************************************************************** - * Preamble - *****************************************************************************/ -#include "defs.h" - -#include - -#include "config.h" -#include "common.h" -#include "threads.h" -#include "mtime.h" - -#include "intf_msg.h" - -#include "vdec_idct.h" - -#include "modules.h" -#include "modules_export.h" - /***************************************************************************** * Static variables ***************************************************************************** @@ -56,9 +30,9 @@ static u8 pi_crop_buf[VDEC_CROPRANGE]; static u8 *pi_crop; /***************************************************************************** - * vdec_InitDecode: initialize video decoder thread + * InitBlock: initialize the crop table *****************************************************************************/ -void _M( vdec_InitDecode ) ( ) +static void InitBlock ( ) { int i_dummy; @@ -82,10 +56,10 @@ void _M( vdec_InitDecode ) ( ) } /***************************************************************************** - * vdec_AddBlock : add a block + * AddBlock: add a block *****************************************************************************/ -void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data, - int i_incr ) +static __inline__ void AddBlock( dctelem_t * p_block, yuv_data_t * p_data, + int i_incr ) { int i = 8; @@ -105,10 +79,10 @@ void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data, } /***************************************************************************** - * vdec_CopyBlock : copy a block + * CopyBlock: copy a block *****************************************************************************/ -void _M( vdec_CopyBlock )( dctelem_t * p_block, yuv_data_t * p_data, - int i_incr ) +static __inline__ void CopyBlock( dctelem_t * p_block, yuv_data_t * p_data, + int i_incr ) { int i = 8; diff --git a/plugins/idct/vdec_block_mmx.c b/plugins/idct/block_mmx.h similarity index 78% rename from plugins/idct/vdec_block_mmx.c rename to plugins/idct/block_mmx.h index 3bc2d172c3..b6fbb9aa3c 100644 --- a/plugins/idct/vdec_block_mmx.c +++ b/plugins/idct/block_mmx.h @@ -1,8 +1,8 @@ /***************************************************************************** - * vdec_block_mmx.c: Macroblock copy functions in MMX assembly + * block_mmx.h: Macroblock copy functions in MMX assembly ***************************************************************************** * Copyright (C) 1999, 2000, 2001 VideoLAN - * $Id: vdec_block_mmx.c,v 1.6 2001/08/22 17:21:45 massiot Exp $ + * $Id: block_mmx.h,v 1.1 2001/09/05 16:07:49 massiot Exp $ * * Authors: Michel Lespinasse * Aaron Holtzman @@ -22,49 +22,16 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -/* MODULE_NAME defined in Makefile together with -DBUILTIN */ -#ifdef BUILTIN -# include "modules_inner.h" -#else -# define _M( foo ) foo -#endif - -/***************************************************************************** - * Preamble - *****************************************************************************/ -#include "defs.h" - -#include - -#include "config.h" -#include "common.h" -#include "threads.h" -#include "mtime.h" - -#include "intf_msg.h" - -#include "input_ext-dec.h" - -#include "video.h" -#include "video_output.h" - -#include "vdec_idct.h" - -#include "modules.h" -#include "modules_export.h" - -#include "mmx.h" - /***************************************************************************** - * vdec_InitDecode: initialize video decoder thread + * InitBlock: placeholder because we don't need a crop table, MMX does it for us *****************************************************************************/ -void _M( vdec_InitDecode ) ( ) +static __inline__ void InitBlock( ) { ; } /***************************************************************************** - * vdec_AddBlock : add a block + * AddBlock: add a block *****************************************************************************/ #define ADD_MMX(offset,r1,r2,r3,r4) \ movq_m2r (*(p_data+2*i_incr), r1); \ @@ -77,8 +44,8 @@ void _M( vdec_InitDecode ) ( ) punpckhbw_r2r (mm0, r2); \ paddsw_m2r (*(p_block+offset+4), r2); -void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data, - int i_incr ) +static __inline__ void AddBlock( dctelem_t * p_block, yuv_data_t * p_data, + int i_incr ) { movq_m2r (*p_data, mm1); pxor_r2r (mm0, mm0); @@ -106,7 +73,7 @@ void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data, } /***************************************************************************** - * vdec_CopyBlock : copy a block + * CopyBlock: copy a block *****************************************************************************/ #define COPY_MMX(offset,r0,r1,r2) \ movq_m2r (*(p_block+offset), r0); \ @@ -115,8 +82,8 @@ void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data, movq_r2m (r2, *p_data); \ packuswb_r2r (r1, r0); -void _M( vdec_CopyBlock ) ( dctelem_t * p_block, yuv_data_t * p_data, - int i_incr ) +static __inline__ void CopyBlock( dctelem_t * p_block, yuv_data_t * p_data, + int i_incr ) { movq_m2r (*(p_block+0*8), mm0); movq_m2r (*(p_block+0*8+4), mm1); diff --git a/plugins/idct/idct.c b/plugins/idct/idct.c index 2eafe3b79e..f3e1c0b9a5 100644 --- a/plugins/idct/idct.c +++ b/plugins/idct/idct.c @@ -1,10 +1,10 @@ /***************************************************************************** - * idct.c : IDCT module + * idct.c : C IDCT module ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: idct.c,v 1.14 2001/08/22 17:21:45 massiot Exp $ + * $Id: idct.c,v 1.15 2001/09/05 16:07:49 massiot Exp $ * - * Authors: Gaƫl Hendryckx + * Author: Gaƫl Hendryckx * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,8 @@ #include "mtime.h" #include "tests.h" -#include "vdec_idct.h" +#include "idct.h" +#include "block_c.h" #include "modules.h" #include "modules_export.h" @@ -46,8 +47,6 @@ * Local and extern prototypes. *****************************************************************************/ static void idct_getfunctions( function_list_t * p_function_list ); -static int idct_Probe ( probedata_t *p_data ); -static void vdec_NormScan ( u8 ppi_scan[2][64] ); /***************************************************************************** * Build configuration tree. @@ -72,24 +71,6 @@ MODULE_DEACTIVATE_STOP /* Following functions are local */ -/***************************************************************************** - * Functions exported as capabilities. They are declared as static so that - * we don't pollute the namespace too much. - *****************************************************************************/ -static void idct_getfunctions( function_list_t * p_function_list ) -{ - p_function_list->pf_probe = idct_Probe; -#define F p_function_list->functions.idct - F.pf_idct_init = _M( vdec_InitIDCT ); - F.pf_sparse_idct = _M( vdec_SparseIDCT ); - F.pf_idct = _M( vdec_IDCT ); - F.pf_norm_scan = vdec_NormScan; - F.pf_decode_init = _M( vdec_InitDecode ); - F.pf_addblock = _M( vdec_AddBlock ); - F.pf_copyblock = _M( vdec_CopyBlock ); -#undef F -} - /***************************************************************************** * idct_Probe: returns a preference score *****************************************************************************/ @@ -106,17 +87,16 @@ static int idct_Probe( probedata_t *p_data ) } /***************************************************************************** - * vdec_NormScan : Unused in this IDCT + * NormScan : Unused in this IDCT *****************************************************************************/ -static void vdec_NormScan( u8 ppi_scan[2][64] ) +static void NormScan( u8 ppi_scan[2][64] ) { } /***************************************************************************** - * vdec_IDCT : IDCT function for normal matrices + * IDCT : IDCT function for normal matrices *****************************************************************************/ -void _M( vdec_IDCT )( void * p_unused_data, dctelem_t * p_block, - int i_idontcare ) +static __inline__ void IDCT( dctelem_t * p_block ) { s32 tmp0, tmp1, tmp2, tmp3; s32 tmp10, tmp11, tmp12, tmp13; @@ -1294,3 +1274,5 @@ void _M( vdec_IDCT )( void * p_unused_data, dctelem_t * p_block, } } +#include "idct_sparse.h" +#include "idct_decl.h" diff --git a/plugins/idct/vdec_idct.h b/plugins/idct/idct.h similarity index 89% rename from plugins/idct/vdec_idct.h rename to plugins/idct/idct.h index de73718f74..ea8171ec4c 100644 --- a/plugins/idct/vdec_idct.h +++ b/plugins/idct/idct.h @@ -1,8 +1,8 @@ /***************************************************************************** - * vdec_idct.h : macros for the inverse discrete cosine transform + * idct.h : macros for the inverse discrete cosine transform ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: vdec_idct.h,v 1.3 2001/08/22 17:21:45 massiot Exp $ + * $Id: idct.h,v 1.5 2001/09/05 16:07:49 massiot Exp $ * * Authors: Gaƫl Hendryckx * Christophe Massiot @@ -140,14 +140,3 @@ #define MULTIPLY(var,const) ((var) * (const)) #endif -/***************************************************************************** - * Protoypes - *****************************************************************************/ -void _M( vdec_SparseIDCT ) ( void *, dctelem_t * p_block, int i_sparse_pos ); -void _M( vdec_InitIDCT ) ( void ** ); -void _M( vdec_IDCT ) ( void *, dctelem_t * p_block, int i_idontcare ); -void _M( vdec_InitDecode ) ( ); -void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data, - int i_incr ); -void _M( vdec_CopyBlock ) ( dctelem_t * p_block, yuv_data_t * p_data, - int i_incr ); diff --git a/plugins/idct/idct_decl.h b/plugins/idct/idct_decl.h new file mode 100644 index 0000000000..c4e1bfcbf5 --- /dev/null +++ b/plugins/idct/idct_decl.h @@ -0,0 +1,57 @@ +/***************************************************************************** + * idct_decl.h : common declarations, must be included at the very end + ***************************************************************************** + * Copyright (C) 1999, 2000 VideoLAN + * $Id: idct_decl.h,v 1.1 2001/09/05 16:07:49 massiot Exp $ + * + * Author: Christophe Massiot + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +/***************************************************************************** + * Final declarations + *****************************************************************************/ +static void IDCTCopy( dctelem_t * p_block, yuv_data_t * p_dest, + int i_stride, void * p_unused, int i_unused ) +{ + IDCT( p_block ); + CopyBlock( p_block, p_dest, i_stride ); +} + +static void IDCTAdd( dctelem_t * p_block, yuv_data_t * p_dest, + int i_stride, void * p_unused, int i_unused ) +{ + IDCT( p_block ); + AddBlock( p_block, p_dest, i_stride ); +} + +/***************************************************************************** + * Functions exported as capabilities. They are declared as static so that + * we don't pollute the namespace too much. + *****************************************************************************/ +static void idct_getfunctions( function_list_t * p_function_list ) +{ + p_function_list->pf_probe = idct_Probe; +#define F p_function_list->functions.idct + F.pf_idct_init = InitIDCT; + F.pf_norm_scan = NormScan; + F.pf_sparse_idct_add = SparseIDCTAdd; + F.pf_sparse_idct_copy = SparseIDCTCopy; + F.pf_idct_add = IDCTAdd; + F.pf_idct_copy = IDCTCopy; +#undef F +} + diff --git a/plugins/idct/vdec_idct.c b/plugins/idct/idct_sparse.h similarity index 79% rename from plugins/idct/vdec_idct.c rename to plugins/idct/idct_sparse.h index b8ad5fc129..11b68bb73c 100644 --- a/plugins/idct/vdec_idct.c +++ b/plugins/idct/idct_sparse.h @@ -1,10 +1,10 @@ /***************************************************************************** - * vdec_idct.c : common IDCT functions + * idct_sparse.h : Sparse IDCT functions (must be include at the end) ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: vdec_idct.c,v 1.4 2001/08/22 17:21:45 massiot Exp $ + * $Id: idct_sparse.h,v 1.1 2001/09/05 16:07:49 massiot Exp $ * - * Authors: Gaƫl Hendryckx + * Author: Gaƫl Hendryckx * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,37 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -/* MODULE_NAME defined in Makefile together with -DBUILTIN */ -#ifdef BUILTIN -# include "modules_inner.h" -#else -# define _M( foo ) foo -#endif - -/***************************************************************************** - * Preamble - *****************************************************************************/ -#include "defs.h" - -#include /* malloc() */ -#include /* memcpy(), memset() */ - -#include "config.h" -#include "common.h" -#include "threads.h" -#include "mtime.h" - -#include "video.h" -#include "video_output.h" - -#include "modules.h" - -#include "vdec_idct.h" - /***************************************************************************** - * vdec_InitIDCT : initialize datas for vdec_SparseIDCT + * InitIDCT : initialize data for SparseIDCT *****************************************************************************/ -void _M( vdec_InitIDCT ) ( void ** pp_idct_data ) +static void InitIDCT ( void ** pp_idct_data ) { int i; dctelem_t * p_pre; @@ -63,16 +36,17 @@ void _M( vdec_InitIDCT ) ( void ** pp_idct_data ) for( i = 0 ; i < 64 ; i++ ) { p_pre[i*64+i] = 1 << SPARSE_SCALE_FACTOR; - _M( vdec_IDCT )( NULL, &p_pre[i*64], 0) ; + IDCT( &p_pre[i*64] ) ; } - return; + + InitBlock(); } /***************************************************************************** - * vdec_SparseIDCT : IDCT function for sparse matrices + * SparseIDCT : IDCT function for sparse matrices *****************************************************************************/ -void _M( vdec_SparseIDCT ) ( void * p_idct_data, - dctelem_t * p_block, int i_sparse_pos ) +static __inline__ void SparseIDCT( dctelem_t * p_block, void * p_idct_data, + int i_sparse_pos ) { short int val; int * dp; @@ -124,6 +98,21 @@ void _M( vdec_SparseIDCT ) ( void * p_idct_data, p_dest += 16; p_source += 16; } - return; } +/***************************************************************************** + * Final declarations + *****************************************************************************/ +static void SparseIDCTCopy( dctelem_t * p_block, yuv_data_t * p_dest, + int i_stride, void * p_idct_data, int i_sparse_pos ) +{ + SparseIDCT( p_block, p_idct_data, i_sparse_pos ); + CopyBlock( p_block, p_dest, i_stride ); +} + +static void SparseIDCTAdd( dctelem_t * p_block, yuv_data_t * p_dest, + int i_stride, void * p_idct_data, int i_sparse_pos ) +{ + SparseIDCT( p_block, p_idct_data, i_sparse_pos ); + AddBlock( p_block, p_dest, i_stride ); +} diff --git a/plugins/idct/idctaltivec.S b/plugins/idct/idctaltivec.S new file mode 100644 index 0000000000..d9cca76268 --- /dev/null +++ b/plugins/idct/idctaltivec.S @@ -0,0 +1,481 @@ +#***************************************************************************** +# idctaltivec.S : Altivec IDCT code +#***************************************************************************** +# Copyright (C) 1999, 2001 VideoLAN +# $Id: idctaltivec.S,v 1.1 2001/09/05 16:07:49 massiot Exp $ +# +# Author: Paul Mackerras +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. +#*****************************************************************************/ + + .data + .align 4 +wvec: .long 0x3f0a8bd4 + .long 0x3e8d42af + .long 0x3f3504f3 + .long 0x3f968317 + .long 0x3f8e39da + .long 0x3fd4db31 + .long 0x3ec7c5c2 + .long 0x3ffb14be + .long 0x3f43ef15 + .long 0x3fec835e + .long 0 + .long 0 + +d: .long 0,0,0,0 + + .text + .globl idct_block_copy_altivec +idct_block_copy_altivec: + li 6,0 + b idct_asm_altivec + + .global idct_block_add_altivec +idct_block_add_altivec: + li 6,1 + + .globl idct_asm_altivec +idct_asm_altivec: + lvx 22,0,3 # ih = *(vector signed short *)(p); + addi 3,3,16 # p += 8; + vupkhsh 20,22 # i0 = vec_unpackh(ih); + vupklsh 21,22 # i1 = vec_unpackl(ih); + vcfsx 0,20,3 # x00 = vec_ctf(i0, 3); + vcfsx 10,21,3 # x01 = vec_ctf(i1, 3); + lvx 22,0,3 # ih = *(vector signed short *)(p); + addi 3,3,16 # p += 8; + vupkhsh 20,22 # i0 = vec_unpackh(ih); + vupklsh 21,22 # i1 = vec_unpackl(ih); + vcfsx 1,20,3 # x10 = vec_ctf(i0, 3); + vcfsx 11,21,3 # x11 = vec_ctf(i1, 3); + lvx 22,0,3 # ih = *(vector signed short *)(p); + addi 3,3,16 # p += 8; + vupkhsh 20,22 # i0 = vec_unpackh(ih); + vupklsh 21,22 # i1 = vec_unpackl(ih); + vcfsx 2,20,3 # x20 = vec_ctf(i0, 3); + vcfsx 12,21,3 # x21 = vec_ctf(i1, 3); + lvx 22,0,3 # ih = *(vector signed short *)(p); + addi 3,3,16 # p += 8; + vupkhsh 20,22 # i0 = vec_unpackh(ih); + vupklsh 21,22 # i1 = vec_unpackl(ih); + vcfsx 3,20,3 # x30 = vec_ctf(i0, 3); + vcfsx 13,21,3 # x31 = vec_ctf(i1, 3); + lvx 22,0,3 # ih = *(vector signed short *)(p); + addi 3,3,16 # p += 8; + vupkhsh 20,22 # i0 = vec_unpackh(ih); + vupklsh 21,22 # i1 = vec_unpackl(ih); + vcfsx 4,20,3 # x40 = vec_ctf(i0, 3); + vcfsx 14,21,3 # x41 = vec_ctf(i1, 3); + lvx 22,0,3 # ih = *(vector signed short *)(p); + addi 3,3,16 # p += 8; + vupkhsh 20,22 # i0 = vec_unpackh(ih); + vupklsh 21,22 # i1 = vec_unpackl(ih); + vcfsx 5,20,3 # x50 = vec_ctf(i0, 3); + vcfsx 15,21,3 # x51 = vec_ctf(i1, 3); + lvx 22,0,3 # ih = *(vector signed short *)(p); + addi 3,3,16 # p += 8; + vupkhsh 20,22 # i0 = vec_unpackh(ih); + vupklsh 21,22 # i1 = vec_unpackl(ih); + vcfsx 6,20,3 # x60 = vec_ctf(i0, 3); + vcfsx 16,21,3 # x61 = vec_ctf(i1, 3); + lvx 22,0,3 # ih = *(vector signed short *)(p); + vupkhsh 20,22 # i0 = vec_unpackh(ih); + vupklsh 21,22 # i1 = vec_unpackl(ih); + vcfsx 7,20,3 # x70 = vec_ctf(i0, 3); + vcfsx 17,21,3 # x71 = vec_ctf(i1, 3); + + vmrghw 8,0,2 # x80 = vec_mergeh(x00, x20); + vmrghw 9,1,3 # x90 = vec_mergeh(x10, x30); + vmrglw 18,0,2 # x81 = vec_mergel(x00, x20); + vmrglw 19,1,3 # x91 = vec_mergel(x10, x30); + vmrghw 0,8,9 # x00 = vec_mergeh(x80, x90); + vmrglw 1,8,9 # x10 = vec_mergel(x80, x90); + vmrghw 2,18,19 # x20 = vec_mergeh(x81, x91); + vmrglw 3,18,19 # x30 = vec_mergel(x81, x91); + + vmrghw 8,10,12 # x80 = vec_mergeh(x01, x21); + vmrghw 9,11,13 # x90 = vec_mergeh(x11, x31); + vmrglw 18,10,12 # x81 = vec_mergel(x01, x21); + vmrglw 19,11,13 # x91 = vec_mergel(x11, x31); + vmrghw 20,4,6 # y80 = vec_mergeh(x40, x60); + vmrghw 22,5,7 # y90 = vec_mergeh(x50, x70); + vmrglw 21,4,6 # y81 = vec_mergel(x40, x60); + vmrglw 23,5,7 # y91 = vec_mergel(x50, x70); + vmrghw 4,8,9 # x40 = vec_mergeh(x80, x90); + vmrglw 5,8,9 # x50 = vec_mergel(x80, x90); + vmrghw 6,18,19 # x60 = vec_mergeh(x81, x91); + vmrglw 7,18,19 # x70 = vec_mergel(x81, x91); + vmrghw 10,20,22 # x01 = vec_mergeh(y80, y90); + vmrglw 11,20,22 # x11 = vec_mergel(y80, y90); + vmrghw 12,21,23 # x21 = vec_mergeh(y81, y91); + vmrglw 13,21,23 # x31 = vec_mergel(y81, y91); + + vmrghw 20,14,16 # y80 = vec_mergeh(x41, x61); + vmrghw 22,15,17 # y90 = vec_mergeh(x51, x71); + vmrglw 21,14,16 # y81 = vec_mergel(x41, x61); + vmrglw 23,15,17 # y91 = vec_mergel(x51, x71); + vmrghw 14,20,22 # x41 = vec_mergeh(y80, y90); + vmrglw 15,20,22 # x51 = vec_mergel(y80, y90); + vmrghw 16,21,23 # x61 = vec_mergeh(y81, y91); + vmrglw 17,21,23 # x71 = vec_mergel(y81, y91); + + lis 7,wvec@ha + addi 7,7,wvec@l + addi 8,7,16 + addi 9,7,32 + lvx 28,0,7 # *(vector float *)wvec2; + lvx 29,0,8 # *(vector float *)wvec3; + lvx 30,0,9 # *(vector float *)wvec4; + + vspltw 20,28,3 # W3 = vec_splat(wvec2, 3); + vspltw 21,28,1 # W7 = vec_splat(wvec2, 1); + vspltw 22,29,0 # W1_W7 = vec_splat(wvec3, 0); + vspltw 23,29,1 # W1pW7 = vec_splat(wvec3, 1); + vspltw 24,29,2 # W3_W5 = vec_splat(wvec3, 2); + vspltw 25,29,3 # W3pW5 = vec_splat(wvec3, 3); + vspltisw 31,0 # z = (vector float)(0); + + # /* first stage */ + vaddfp 26,1,7 + vmaddfp 8,21,26,31 # x80 = vec_madd(W7, vec_add(x10, x70), z); + vaddfp 27,11,17 + vmaddfp 18,21,27,31 # x81 = vec_madd(W7, vec_add(x11, x71), z); + vmaddfp 1,22,1,8 # x10 = vec_madd(W1_W7, x10, x80); + vmaddfp 11,22,11,18 # x11 = vec_madd(W1_W7, x11, x81); + vnmsubfp 7,23,7,8 # x70 = vec_nmsub(W1pW7, x70, x80); + vnmsubfp 17,23,17,18 # x71 = vec_nmsub(W1pW7, x71, x81); + vaddfp 26,5,3 + vmaddfp 8,20,26,31 # x80 = vec_madd(W3, vec_add(x50, x30), z); + vaddfp 27,15,13 + vmaddfp 18,20,27,31 # x81 = vec_madd(W3, vec_add(x51, x31), z); + vnmsubfp 5,24,5,8 # x50 = vec_nmsub(W3_W5, x50, x80); + vnmsubfp 15,24,15,18 # x51 = vec_nmsub(W3_W5, x51, x81); + vnmsubfp 3,25,3,8 # x30 = vec_nmsub(W3pW5, x30, x80); + vnmsubfp 13,25,13,18 # x31 = vec_nmsub(W3pW5, x31, x81); + + vspltw 20,28,0 # W6 = vec_splat(wvec2, 0); + vspltw 21,30,0 # W2_W6 = vec_splat(wvec4, 0); + vspltw 22,30,1 # W2pW6 = vec_splat(wvec4, 1); + vspltw 23,28,2 # SQRT0_5 = vec_splat(wvec2, 2); + + # /* second stage */ + vaddfp 8,0,4 # x80 = vec_add(x00, x40); + vaddfp 18,10,14 # x81 = vec_add(x01, x41); + vsubfp 0,0,4 # x00 = vec_sub(x00, x40); + vsubfp 10,10,14 # x01 = vec_sub(x01, x41); + vaddfp 26,2,6 + vmaddfp 4,20,26,31 # x40 = vec_madd(W6, vec_add(x20, x60), z); + vaddfp 27,12,16 + vmaddfp 14,20,27,31 # x41 = vec_madd(W6, vec_add(x21, x61), z); + vnmsubfp 6,22,6,4 # x60 = vec_nmsub(W2pW6, x60, x40); + vnmsubfp 16,22,16,14 # x61 = vec_nmsub(W2pW6, x61, x41); + vmaddfp 2,21,2,4 # x20 = vec_madd(W2_W6, x20, x40); + vmaddfp 12,21,12,14 # x21 = vec_madd(W2_W6, x21, x41); + vaddfp 4,1,5 # x40 = vec_add(x10, x50); + vaddfp 14,11,15 # x41 = vec_add(x11, x51); + vsubfp 1,1,5 # x10 = vec_sub(x10, x50); + vsubfp 11,11,15 # x11 = vec_sub(x11, x51); + vaddfp 5,7,3 # x50 = vec_add(x70, x30); + vaddfp 15,17,13 # x51 = vec_add(x71, x31); + vsubfp 7,7,3 # x70 = vec_sub(x70, x30); + vsubfp 17,17,13 # x71 = vec_sub(x71, x31); + + # /* third stage */ + vaddfp 3,8,2 # x30 = vec_add(x80, x20); + vaddfp 13,18,12 # x31 = vec_add(x81, x21); + vsubfp 8,8,2 # x80 = vec_sub(x80, x20); + vsubfp 18,18,12 # x81 = vec_sub(x81, x21); + vaddfp 2,0,6 # x20 = vec_add(x00, x60); + vaddfp 12,10,16 # x21 = vec_add(x01, x61); + vsubfp 0,0,6 # x00 = vec_sub(x00, x60); + vsubfp 10,10,16 # x01 = vec_sub(x01, x61); + vaddfp 24,1,7 + vmaddfp 6,23,24,31 # x60 = vec_madd(SQRT0_5, vec_add(x10, x70), z); + vaddfp 25,11,17 + vmaddfp 16,23,25,31 # x61 = vec_madd(SQRT0_5, vec_add(x11, x71), z); + vsubfp 26,1,7 + vmaddfp 1,23,26,31 # x10 = vec_madd(SQRT0_5, vec_sub(x10, x70), z); + vsubfp 27,11,17 + vmaddfp 11,23,27,31 # x11 = vec_madd(SQRT0_5, vec_sub(x11, x71), z); + + # /* fourth stage */ + vsubfp 7,3,4 # x70 = vec_sub(x30, x40); + vsubfp 17,13,14 # x71 = vec_sub(x31, x41); + vaddfp 9,3,4 # x90 = vec_add(x30, x40); + vaddfp 19,13,14 # x91 = vec_add(x31, x41); + vaddfp 3,8,5 # x30 = vec_add(x80, x50); + vaddfp 13,18,15 # x31 = vec_add(x81, x51); + vsubfp 4,8,5 # x40 = vec_sub(x80, x50); + vsubfp 14,18,15 # x41 = vec_sub(x81, x51); + vsubfp 5,0,1 # x50 = vec_sub(x00, x10); + vsubfp 15,10,11 # x51 = vec_sub(x01, x11); + vaddfp 8,0,1 # x80 = vec_add(x00, x10); + vaddfp 18,10,11 # x81 = vec_add(x01, x11); + vaddfp 1,2,6 # x10 = vec_add(x20, x60); + vaddfp 11,12,16 # x11 = vec_add(x21, x61); + vsubfp 6,2,6 # x60 = vec_sub(x20, x60); + vsubfp 16,12,16 # x61 = vec_sub(x21, x61); + # /* x0* is now in x9*, x2* is in x8* */ + + vmrghw 20,9,8 # y80 = vec_mergeh(x90, x80); + vmrghw 22,1,3 # y90 = vec_mergeh(x10, x30); + vmrglw 21,9,8 # y81 = vec_mergel(x90, x80); + vmrglw 23,1,3 # y91 = vec_mergel(x10, x30); + vmrghw 0,20,22 # x00 = vec_mergeh(y80, y90); + vmrglw 1,20,22 # x10 = vec_mergel(y80, y90); + vmrghw 2,21,23 # x20 = vec_mergeh(y81, y91); + vmrglw 3,21,23 # x30 = vec_mergel(y81, y91); + + vmrghw 8,19,18 # x80 = vec_mergeh(x91, x81); + vmrghw 9,11,13 # x90 = vec_mergeh(x11, x31); + vmrglw 18,19,18 # x81 = vec_mergel(x91, x81); + vmrglw 19,11,13 # x91 = vec_mergel(x11, x31); + vmrghw 20,4,6 # y80 = vec_mergeh(x40, x60); + vmrghw 22,5,7 # y90 = vec_mergeh(x50, x70); + vmrglw 21,4,6 # y81 = vec_mergel(x40, x60); + vmrglw 23,5,7 # y91 = vec_mergel(x50, x70); + vmrghw 4,8,9 # x40 = vec_mergeh(x80, x90); + vmrglw 5,8,9 # x50 = vec_mergel(x80, x90); + vmrghw 6,18,19 # x60 = vec_mergeh(x81, x91); + vmrglw 7,18,19 # x70 = vec_mergel(x81, x91); + vmrghw 10,20,22 # x01 = vec_mergeh(y80, y90); + vmrglw 11,20,22 # x11 = vec_mergel(y80, y90); + vmrghw 12,21,23 # x21 = vec_mergeh(y81, y91); + vmrglw 13,21,23 # x31 = vec_mergel(y81, y91); + + vmrghw 20,14,16 # y80 = vec_mergeh(x41, x61); + vmrghw 22,15,17 # y90 = vec_mergeh(x51, x71); + vmrglw 21,14,16 # y81 = vec_mergel(x41, x61); + vmrglw 23,15,17 # y91 = vec_mergel(x51, x71); + vmrghw 14,20,22 # x41 = vec_mergeh(y80, y90); + vmrglw 15,20,22 # x51 = vec_mergel(y80, y90); + vmrghw 16,21,23 # x61 = vec_mergeh(y81, y91); + vmrglw 17,21,23 # x71 = vec_mergel(y81, y91); + + vspltw 20,28,3 # W3 = vec_splat(wvec2, 3); + vspltw 21,28,1 # W7 = vec_splat(wvec2, 1); + vspltw 22,29,0 # W1_W7 = vec_splat(wvec3, 0); + vspltw 23,29,1 # W1pW7 = vec_splat(wvec3, 1); + vspltw 24,29,2 # W3_W5 = vec_splat(wvec3, 2); + vspltw 25,29,3 # W3pW5 = vec_splat(wvec3, 3); + + # /* first stage */ + vaddfp 26,1,7 + vmaddfp 8,21,26,31 # x80 = vec_madd(W7, vec_add(x10, x70), z); + vaddfp 27,11,17 + vmaddfp 18,21,27,31 # x81 = vec_madd(W7, vec_add(x11, x71), z); + vmaddfp 1,22,1,8 # x10 = vec_madd(W1_W7, x10, x80); + vmaddfp 11,22,11,18 # x11 = vec_madd(W1_W7, x11, x81); + vnmsubfp 7,23,7,8 # x70 = vec_nmsub(W1pW7, x70, x80); + vnmsubfp 17,23,17,18 # x71 = vec_nmsub(W1pW7, x71, x81); + vaddfp 26,5,3 + vmaddfp 8,20,26,31 # x80 = vec_madd(W3, vec_add(x50, x30), z); + vaddfp 27,15,13 + vmaddfp 18,20,27,31 # x81 = vec_madd(W3, vec_add(x51, x31), z); + vnmsubfp 5,24,5,8 # x50 = vec_nmsub(W3_W5, x50, x80); + vnmsubfp 15,24,15,18 # x51 = vec_nmsub(W3_W5, x51, x81); + vnmsubfp 3,25,3,8 # x30 = vec_nmsub(W3pW5, x30, x80); + vnmsubfp 13,25,13,18 # x31 = vec_nmsub(W3pW5, x31, x81); + + vspltw 20,28,0 # W6 = vec_splat(wvec2, 0); + vspltw 21,30,0 # W2_W6 = vec_splat(wvec4, 0); + vspltw 22,30,1 # W2pW6 = vec_splat(wvec4, 1); + vspltw 23,28,2 # SQRT0_5 = vec_splat(wvec2, 2); + + # /* second stage */ + vaddfp 8,0,4 # x80 = vec_add(x00, x40); + vaddfp 18,10,14 # x81 = vec_add(x01, x41); + vsubfp 0,0,4 # x00 = vec_sub(x00, x40); + vsubfp 10,10,14 # x01 = vec_sub(x01, x41); + vaddfp 26,2,6 + vmaddfp 4,20,26,31 # x40 = vec_madd(W6, vec_add(x20, x60), z); + vaddfp 27,12,16 + vmaddfp 14,20,27,31 # x41 = vec_madd(W6, vec_add(x21, x61), z); + vnmsubfp 6,22,6,4 # x60 = vec_nmsub(W2pW6, x60, x40); + vnmsubfp 16,22,16,14 # x61 = vec_nmsub(W2pW6, x61, x41); + vmaddfp 2,21,2,4 # x20 = vec_madd(W2_W6, x20, x40); + vmaddfp 12,21,12,14 # x21 = vec_madd(W2_W6, x21, x41); + vaddfp 4,1,5 # x40 = vec_add(x10, x50); + vaddfp 14,11,15 # x41 = vec_add(x11, x51); + vsubfp 1,1,5 # x10 = vec_sub(x10, x50); + vsubfp 11,11,15 # x11 = vec_sub(x11, x51); + vaddfp 5,7,3 # x50 = vec_add(x70, x30); + vaddfp 15,17,13 # x51 = vec_add(x71, x31); + vsubfp 7,7,3 # x70 = vec_sub(x70, x30); + vsubfp 17,17,13 # x71 = vec_sub(x71, x31); + + # /* third stage */ + vaddfp 3,8,2 # x30 = vec_add(x80, x20); + vaddfp 13,18,12 # x31 = vec_add(x81, x21); + vsubfp 8,8,2 # x80 = vec_sub(x80, x20); + vsubfp 18,18,12 # x81 = vec_sub(x81, x21); + vaddfp 2,0,6 # x20 = vec_add(x00, x60); + vaddfp 12,10,16 # x21 = vec_add(x01, x61); + vsubfp 0,0,6 # x00 = vec_sub(x00, x60); + vsubfp 10,10,16 # x01 = vec_sub(x01, x61); + vaddfp 24,1,7 + vmaddfp 6,23,24,31 # x60 = vec_madd(SQRT0_5, vec_add(x10, x70), z); + vaddfp 25,11,17 + vmaddfp 16,23,25,31 # x61 = vec_madd(SQRT0_5, vec_add(x11, x71), z); + vsubfp 26,1,7 + vmaddfp 1,23,26,31 # x10 = vec_madd(SQRT0_5, vec_sub(x10, x70), z); + vsubfp 27,11,17 + vmaddfp 11,23,27,31 # x11 = vec_madd(SQRT0_5, vec_sub(x11, x71), z); + + # /* fourth stage */ + vsubfp 7,3,4 # x70 = vec_sub(x30, x40); + vsubfp 17,13,14 # x71 = vec_sub(x31, x41); + vaddfp 9,3,4 # x90 = vec_add(x30, x40); + vaddfp 19,13,14 # x91 = vec_add(x31, x41); + vaddfp 3,8,5 # x30 = vec_add(x80, x50); + vaddfp 13,18,15 # x31 = vec_add(x81, x51); + vsubfp 4,8,5 # x40 = vec_sub(x80, x50); + vsubfp 14,18,15 # x41 = vec_sub(x81, x51); + vsubfp 5,0,1 # x50 = vec_sub(x00, x10); + vsubfp 15,10,11 # x51 = vec_sub(x01, x11); + vaddfp 8,0,1 # x80 = vec_add(x00, x10); + vaddfp 18,10,11 # x81 = vec_add(x01, x11); + vaddfp 1,2,6 # x10 = vec_add(x20, x60); + vaddfp 11,12,16 # x11 = vec_add(x21, x61); + vsubfp 6,2,6 # x60 = vec_sub(x20, x60); + vsubfp 16,12,16 # x61 = vec_sub(x21, x61); + # /* x0* is now in x9*, x2* is in x8* */ + + cmpwi 6,0 + lis 6,d@ha + addi 6,6,d@l + vctsxs 20,9,0 # i0 = vec_cts(x90, 0); + vctsxs 21,19,0 # i1 = vec_cts(x91, 0); + vpkswss 22,20,21 # ih = vec_packs(i0, i1); + beq 1f # if (accum) { + lfd 0,0(4) + stfd 0,0(6) # *(long long *)&d = *(long long *)dest; + lvx 24,0,6 + vmrghb 23,31,24 # dh = (vector signed short) vec_mergeh(zb, d); + vaddshs 22,23,22 # ih = vec_adds(dh, ih); +1: # } + vpkshus 24,22,31 + stvx 24,0,6 # d = vec_packsu(ih, zh); + lfd 0,0(6) + stfd 0,0(4) # *(long long *)dest = *(long long *)&d; + add 4,4,5 # dest += stride; + vctsxs 20,1,0 # i0 = vec_cts(x10, 0); + vctsxs 21,11,0 # i1 = vec_cts(x11, 0); + vpkswss 22,20,21 # ih = vec_packs(i0, i1); + beq 1f # if (accum) { + lfd 0,0(4) + stfd 0,0(6) # *(long long *)&d = *(long long *)dest; + lvx 24,0,6 + vmrghb 23,31,24 # dh = (vector signed short) vec_mergeh(zb, d); + vaddshs 22,23,22 # ih = vec_adds(dh, ih); +1: # } + vpkshus 24,22,31 + stvx 24,0,6 # d = vec_packsu(ih, zh); + lfd 0,0(6) + stfd 0,0(4) # *(long long *)dest = *(long long *)&d; + add 4,4,5 # dest += stride; + vctsxs 20,8,0 # i0 = vec_cts(x80, 0); + vctsxs 21,18,0 # i1 = vec_cts(x81, 0); + vpkswss 22,20,21 # ih = vec_packs(i0, i1); + beq 1f # if (accum) { + lfd 0,0(4) + stfd 0,0(6) # *(long long *)&d = *(long long *)dest; + lvx 24,0,6 + vmrghb 23,31,24 # dh = (vector signed short) vec_mergeh(zb, d); + vaddshs 22,23,22 # ih = vec_adds(dh, ih); +1: # } + vpkshus 24,22,31 + stvx 24,0,6 # d = vec_packsu(ih, zh); + lfd 0,0(6) + stfd 0,0(4) # *(long long *)dest = *(long long *)&d; + add 4,4,5 # dest += stride; + vctsxs 20,3,0 # i0 = vec_cts(x30, 0); + vctsxs 21,13,0 # i1 = vec_cts(x31, 0); + vpkswss 22,20,21 # ih = vec_packs(i0, i1); + beq 1f # if (accum) { + lfd 0,0(4) + stfd 0,0(6) # *(long long *)&d = *(long long *)dest; + lvx 24,0,6 + vmrghb 23,31,24 # dh = (vector signed short) vec_mergeh(zb, d); + vaddshs 22,23,22 # ih = vec_adds(dh, ih); +1: # } + vpkshus 24,22,31 + stvx 24,0,6 # d = vec_packsu(ih, zh); + lfd 0,0(6) + stfd 0,0(4) # *(long long *)dest = *(long long *)&d; + add 4,4,5 # dest += stride; + vctsxs 20,4,0 # i0 = vec_cts(x40, 0); + vctsxs 21,14,0 # i1 = vec_cts(x41, 0); + vpkswss 22,20,21 # ih = vec_packs(i0, i1); + beq 1f # if (accum) { + lfd 0,0(4) + stfd 0,0(6) # *(long long *)&d = *(long long *)dest; + lvx 24,0,6 + vmrghb 23,31,24 # dh = (vector signed short) vec_mergeh(zb, d); + vaddshs 22,23,22 # ih = vec_adds(dh, ih); +1: # } + vpkshus 24,22,31 + stvx 24,0,6 # d = vec_packsu(ih, zh); + lfd 0,0(6) + stfd 0,0(4) # *(long long *)dest = *(long long *)&d; + add 4,4,5 # dest += stride; + vctsxs 20,5,0 # i0 = vec_cts(x50, 0); + vctsxs 21,15,0 # i1 = vec_cts(x51, 0); + vpkswss 22,20,21 # ih = vec_packs(i0, i1); + beq 1f # if (accum) { + lfd 0,0(4) + stfd 0,0(6) # *(long long *)&d = *(long long *)dest; + lvx 24,0,6 + vmrghb 23,31,24 # dh = (vector signed short) vec_mergeh(zb, d); + vaddshs 22,23,22 # ih = vec_adds(dh, ih); +1: # } + vpkshus 24,22,31 + stvx 24,0,6 # d = vec_packsu(ih, zh); + lfd 0,0(6) + stfd 0,0(4) # *(long long *)dest = *(long long *)&d; + add 4,4,5 # dest += stride; + vctsxs 20,6,0 # i0 = vec_cts(x60, 0); + vctsxs 21,16,0 # i1 = vec_cts(x61, 0); + vpkswss 22,20,21 # ih = vec_packs(i0, i1); + beq 1f # if (accum) { + lfd 0,0(4) + stfd 0,0(6) # *(long long *)&d = *(long long *)dest; + lvx 24,0,6 + vmrghb 23,31,24 # dh = (vector signed short) vec_mergeh(zb, d); + vaddshs 22,23,22 # ih = vec_adds(dh, ih); +1: # } + vpkshus 24,22,31 + stvx 24,0,6 # d = vec_packsu(ih, zh); + lfd 0,0(6) + stfd 0,0(4) # *(long long *)dest = *(long long *)&d; + add 4,4,5 # dest += stride; + vctsxs 20,7,0 # i0 = vec_cts(x70, 0); + vctsxs 21,17,0 # i1 = vec_cts(x71, 0); + vpkswss 22,20,21 # ih = vec_packs(i0, i1); + beq 1f # if (accum) { + lfd 0,0(4) + stfd 0,0(6) # *(long long *)&d = *(long long *)dest; + lvx 24,0,6 + vmrghb 23,31,24 # dh = (vector signed short) vec_mergeh(zb, d); + vaddshs 22,23,22 # ih = vec_adds(dh, ih); +1: # } + vpkshus 24,22,31 + stvx 24,0,6 # d = vec_packsu(ih, zh); + lfd 0,0(6) + stfd 0,0(4) # *(long long *)dest = *(long long *)&d; + + blr diff --git a/plugins/idct/idctaltivec.c b/plugins/idct/idctaltivec.c index 22b33f0cac..3dede5e091 100644 --- a/plugins/idct/idctaltivec.c +++ b/plugins/idct/idctaltivec.c @@ -2,7 +2,7 @@ * idctaltivec.c : Altivec IDCT module ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: idctaltivec.c,v 1.11 2001/08/22 17:21:45 massiot Exp $ + * $Id: idctaltivec.c,v 1.12 2001/09/05 16:07:49 massiot Exp $ * * Authors: Christophe Massiot * @@ -37,9 +37,7 @@ #include "mtime.h" #include "tests.h" /* TestCPU() */ -#include "vdec_idct.h" - -#include "idctaltivec.h" +#include "idct.h" #include "modules.h" #include "modules_export.h" @@ -48,8 +46,8 @@ * Local prototypes. *****************************************************************************/ static void idct_getfunctions( function_list_t * p_function_list ); -static int idct_Probe ( probedata_t *p_data ); -static void vdec_NormScan ( u8 ppi_scan[2][64] ); +void idct_block_copy_altivec( dctelem_t *, yuv_data_t *, int, void *, int ); +void idct_block_add_altivec( dctelem_t *, yuv_data_t *, int, void *, int ); /***************************************************************************** * Build configuration tree. @@ -74,23 +72,6 @@ MODULE_DEACTIVATE_STOP /* Following functions are local */ -/***************************************************************************** - * Functions exported as capabilities. - *****************************************************************************/ -static void idct_getfunctions( function_list_t * p_function_list ) -{ - p_function_list->pf_probe = idct_Probe; -#define F p_function_list->functions.idct - F.pf_idct_init = _M( vdec_InitIDCT ); - F.pf_sparse_idct = _M( vdec_SparseIDCT ); - F.pf_idct = _M( vdec_IDCT ); - F.pf_norm_scan = vdec_NormScan; - F.pf_decode_init = _M( vdec_InitDecode ); - F.pf_addblock = _M( vdec_AddBlock ); - F.pf_copyblock = _M( vdec_CopyBlock ); -#undef F -} - /***************************************************************************** * idct_Probe: return a preference score *****************************************************************************/ @@ -107,23 +88,36 @@ static int idct_Probe( probedata_t *p_data ) return( 999 ); } - /* The Altivec iDCT is deactivated until it really works */ - return( 0 /* 200 */ ); + return( 200 ); } /***************************************************************************** - * vdec_NormScan : Soon, transpose + * Placeholders for unused functions *****************************************************************************/ -static void vdec_NormScan( u8 ppi_scan[2][64] ) +static void NormScan( u8 ppi_scan[2][64] ) { } +static void InitIDCT( void * p_idct_data ) +{ +} + + /***************************************************************************** - * vdec_IDCT : + * Functions exported as capabilities. They are declared as static so that + * we don't pollute the namespace too much. *****************************************************************************/ -void _M( vdec_IDCT )( void * p_unused_data, dctelem_t * p_block, - int i_idontcare ) +static void idct_getfunctions( function_list_t * p_function_list ) { - IDCT( p_block, p_block ); + p_function_list->pf_probe = idct_Probe; +#define F p_function_list->functions.idct + F.pf_idct_init = InitIDCT; + F.pf_norm_scan = NormScan; + /* FIXME : it would be a nice idea to use sparse IDCT functions */ + F.pf_sparse_idct_add = idct_block_add_altivec; + F.pf_sparse_idct_copy = idct_block_copy_altivec; + F.pf_idct_add = idct_block_add_altivec; + F.pf_idct_copy = idct_block_copy_altivec; +#undef F } diff --git a/plugins/idct/idctaltivec.h b/plugins/idct/idctaltivec.h deleted file mode 100644 index 0c52a8123e..0000000000 --- a/plugins/idct/idctaltivec.h +++ /dev/null @@ -1,238 +0,0 @@ -/*************************************************************** - * - * Copyright: (c) Copyright Motorola Inc. 1998 - * - * Date: April 17, 1998 - * - * Function: Matrix_Transpose - * - * Description: The following Matrix Transpose is adapted - * from an algorithm developed by Brett Olsson - * from IBM. It performs a 8x8 16-bit element - * full matrix transpose. - * - * Inputs: array elements stored in input - * input[0] = [ 00 01 02 03 04 05 06 07 ] - * input[1] = [ 10 11 12 13 14 15 16 17 ] - * input[2] = [ 20 21 22 23 24 25 26 27 ] - * input[3] = [ 30 31 32 33 34 35 36 37 ] - * input[4] = [ 40 41 42 43 44 45 46 47 ] - * input[5] = [ 50 51 52 53 54 55 56 57 ] - * input[6] = [ 60 61 62 63 64 65 66 67 ] - * input[7] = [ 70 71 72 73 74 75 76 77 ] - * - * Outputs: transposed elements in output - * - **************************************************************/ - -static __inline__ void Matrix_Transpose ( vector signed short *input, - vector signed short *output ) -{ - vector signed short a0, a1, a2, a3, a4, a5, a6, a7; - vector signed short b0, b1, b2, b3, b4, b5, b6, b7; - - b0 = vec_mergeh( input[0], input[4] ); /* [ 00 40 01 41 02 42 03 43 ]*/ - b1 = vec_mergel( input[0], input[4] ); /* [ 04 44 05 45 06 46 07 47 ]*/ - b2 = vec_mergeh( input[1], input[5] ); /* [ 10 50 11 51 12 52 13 53 ]*/ - b3 = vec_mergel( input[1], input[5] ); /* [ 14 54 15 55 16 56 17 57 ]*/ - b4 = vec_mergeh( input[2], input[6] ); /* [ 20 60 21 61 22 62 23 63 ]*/ - b5 = vec_mergel( input[2], input[6] ); /* [ 24 64 25 65 26 66 27 67 ]*/ - b6 = vec_mergeh( input[3], input[7] ); /* [ 30 70 31 71 32 72 33 73 ]*/ - b7 = vec_mergel( input[3], input[7] ); /* [ 34 74 35 75 36 76 37 77 ]*/ - - a0 = vec_mergeh( b0, b4 ); /* [ 00 20 40 60 01 21 41 61 ]*/ - a1 = vec_mergel( b0, b4 ); /* [ 02 22 42 62 03 23 43 63 ]*/ - a2 = vec_mergeh( b1, b5 ); /* [ 04 24 44 64 05 25 45 65 ]*/ - a3 = vec_mergel( b1, b5 ); /* [ 06 26 46 66 07 27 47 67 ]*/ - a4 = vec_mergeh( b2, b6 ); /* [ 10 30 50 70 11 31 51 71 ]*/ - a5 = vec_mergel( b2, b6 ); /* [ 12 32 52 72 13 33 53 73 ]*/ - a6 = vec_mergeh( b3, b7 ); /* [ 14 34 54 74 15 35 55 75 ]*/ - a7 = vec_mergel( b3, b7 ); /* [ 16 36 56 76 17 37 57 77 ]*/ - - output[0] = vec_mergeh( a0, a4 ); /* [ 00 10 20 30 40 50 60 70 ]*/ - output[1] = vec_mergel( a0, a4 ); /* [ 01 11 21 31 41 51 61 71 ]*/ - output[2] = vec_mergeh( a1, a5 ); /* [ 02 12 22 32 42 52 62 72 ]*/ - output[3] = vec_mergel( a1, a5 ); /* [ 03 13 23 33 43 53 63 73 ]*/ - output[4] = vec_mergeh( a2, a6 ); /* [ 04 14 24 34 44 54 64 74 ]*/ - output[5] = vec_mergel( a2, a6 ); /* [ 05 15 25 35 45 55 65 75 ]*/ - output[6] = vec_mergeh( a3, a7 ); /* [ 06 16 26 36 46 56 66 76 ]*/ - output[7] = vec_mergel( a3, a7 ); /* [ 07 17 27 37 47 57 67 77 ]*/ - -} - - -/*************************************************************** - * - * Copyright: (c) Copyright Motorola Inc. 1998 - * - * Date: April 20, 1998 - * - * Macro: IDCT_Transform - * - * Description: Discrete Cosign Transform implemented by the - * Scaled Chen (III) Algorithm developed by Haifa - * Research Lab. The major difference between this - * algorithm and the Scaled Chen (I) is that - * certain multiply-subtracts are replaced by - * multiply adds. A full description of the - * Scaled Chen (I) algorithm can be found in: - * W.C.Chen, C.H.Smith and S.C.Fralick, "A Fast - * Computational Algorithm for the Discrete Cosine - * Transform", IEEE Transactions on Commnuications, - * Vol. COM-25, No. 9, pp 1004-1009, Sept. 1997. - * - * Inputs: vx : array of vector short - * t1-t10 : temporary vector variables set up by caller - * c4 : cos(4*pi/16) - * mc4 : -c4 - * a0 : c6/c2 - * a1 : c7/c1 - * a2 : c5/c3 - * ma2 : -a2 - * zero : an array of zero elements - * - * Outputs: vy : array of vector short - * - **************************************************************/ - -#define IDCT_Transform(vx,vy) \ - \ - /* 1st stage. */ \ - t9 = vec_mradds( a1, vx[1], zero ); /* t8 = (a1) * x1 - x7 */ \ - t8 = vec_subs( t9, vx[7]); \ - t1 = vec_mradds( a1, vx[7], vx[1] ); /* t1 = (a1) * x7 + x1 */ \ - t7 = vec_mradds( a2, vx[5], vx[3] ); /* t7 = (a2) * x5 + x3 */ \ - t3 = vec_mradds( ma2, vx[3], vx[5] );/* t3 = (-a2) * x5 + x3 */ \ - \ - /* 2nd stage */ \ - t5 = vec_adds( vx[0], vx[4] ); /* t5 = x0 + x4 */ \ - t0 = vec_subs( vx[0], vx[4] ); /* t0 = x0 - x4 */ \ - t9 = vec_mradds( a0, vx[2], zero ); /* t4 = (a0) * x2 - x6 */ \ - t4 = vec_subs( t9, vx[6] ); \ - t2 = vec_mradds( a0, vx[6], vx[2] ); /* t2 = (a0) * x6 + x2 */ \ - \ - t6 = vec_adds( t8, t3 ); /* t6 = t8 + t3 */ \ - t3 = vec_subs( t8, t3 ); /* t3 = t8 - t3 */ \ - t8 = vec_subs( t1, t7 ); /* t8 = t1 - t7 */ \ - t1 = vec_adds( t1, t7 ); /* t1 = t1 + t7 */ \ - \ - /* 3rd stage. */ \ - t7 = vec_adds( t5, t2 ); /* t7 = t5 + t2 */ \ - t2 = vec_subs( t5, t2 ); /* t2 = t5 - t2 */ \ - t5 = vec_adds( t0, t4 ); /* t5 = t0 + t4 */ \ - t0 = vec_subs( t0, t4 ); /* t0 = t0 - t4 */ \ - \ - t4 = vec_subs( t8, t3 ); /* t4 = t8 - t3 */ \ - t3 = vec_adds( t8, t3 ); /* t3 = t8 + t3 */ \ - \ - /* 4th stage. */ \ - vy[0] = vec_adds( t7, t1 ); /* y0 = t7 + t1 */ \ - vy[7] = vec_subs( t7, t1 ); /* y7 = t7 - t1 */ \ - vy[1] = vec_mradds( c4, t3, t5 ); /* y1 = (c4) * t3 + t5 */ \ - vy[6] = vec_mradds( mc4, t3, t5 ); /* y6 = (-c4) * t3 + t5 */ \ - vy[2] = vec_mradds( c4, t4, t0 ); /* y2 = (c4) * t4 + t0 */ \ - vy[5] = vec_mradds( mc4, t4, t0 ); /* y5 = (-c4) * t4 + t0 */ \ - vy[3] = vec_adds( t2, t6 ); /* y3 = t2 + t6 */ \ - vy[4] = vec_subs( t2, t6 ); /* y4 = t2 - t6 */ - - -/* Pre-Scaling matrix -- scaled by 1 */ -static vector signed short PreScale[8] = { - (vector signed short)( 4095, 5681, 5351, 4816, 4095, 4816, 5351, 5681 ), - (vector signed short)( 5681, 7880, 7422, 6680, 5681, 6680, 7422, 7880 ), - (vector signed short)( 5351, 7422, 6992, 6292, 5351, 6292, 6992, 7422 ), - (vector signed short)( 4816, 6680, 6292, 5663, 4816, 5663, 6292, 6680 ), - (vector signed short)( 4095, 5681, 5351, 4816, 4095, 4816, 5351, 5681 ), - (vector signed short)( 4816, 6680, 6292, 5663, 4816, 5663, 6292, 6680 ), - (vector signed short)( 5351, 7422, 6992, 6292, 5351, 6292, 6992, 7422 ), - (vector signed short)( 5681, 7880, 7422, 6680, 5681, 6680, 7422, 7880 ) -}; - -/*************************************************************** - * - * Copyright: (c) Copyright Motorola Inc. 1998 - * - * Date: April 17, 1998 - * - * Function: IDCT - * - * Description: Scaled Chen (III) algorithm for IDCT - * Arithmetic is 16-bit fixed point. - * - * Inputs: input - Pointer to input data (short), which - * must be between -2048 to +2047. - * It is assumed that the allocated array - * has been 128-bit aligned and contains - * 8x8 short elements. - * - * Outputs: output - Pointer to output area for the transfored - * data. The output values are between -255 - * and 255 . It is assumed that a 128-bit - * aligned 8x8 array of short has been - * pre-allocated. - * - * Return: None - * - ***************************************************************/ - -static __inline__ void IDCT(short *input, short *output) { - - vector signed short t0, t1, t2, t3, t4, t5, t6, t7, t8, t9; - vector signed short a0, a1, a2, ma2, c4, mc4, zero; - vector signed short vx[8], vy[8]; - vector signed short *vec_ptr; /* used for conversion between - arrays of short and vector - signed short array. */ - - - /* Load the multiplication constants. Note: these constants - * could all be loaded directly ( like zero case ), but using the - * SpecialConstants approach causes vsplth instructions to be - * generated instead of lvx which is more efficient given the remainder - * of the instruction mix. - */ - vector signed short SpecialConstants = - (vector signed short)( 23170, 13573, 6518, 21895, -23170, -21895, 0 , 0 -); - - c4 = vec_splat( SpecialConstants, 0 ); /* c4 = cos(4*pi/16) */ - a0 = vec_splat( SpecialConstants, 1 ); /* a0 = c6/c2 */ - a1 = vec_splat( SpecialConstants, 2 ); /* a1 = c7/c1 */ - a2 = vec_splat( SpecialConstants, 3 ); /* a2 = c5/c3 */ - mc4 = vec_splat( SpecialConstants, 4 ); /* -c4 */ - ma2 = vec_splat( SpecialConstants, 5 ); /* -a2 */ - zero = (vector signed short)(0); - - /* Load the rows of input data and Pre-Scale them. */ - vec_ptr = ( vector signed short * ) input; - vx[0] = vec_mradds( vec_ptr[0], PreScale[0], zero ); - vx[1] = vec_mradds( vec_ptr[1], PreScale[1], zero ); - vx[2] = vec_mradds( vec_ptr[2], PreScale[2], zero ); - vx[3] = vec_mradds( vec_ptr[3], PreScale[3], zero ); - vx[4] = vec_mradds( vec_ptr[4], PreScale[4], zero ); - vx[5] = vec_mradds( vec_ptr[5], PreScale[5], zero ); - vx[6] = vec_mradds( vec_ptr[6], PreScale[6], zero ); - vx[7] = vec_mradds( vec_ptr[7], PreScale[7], zero ); - - /* Perform IDCT first on the 8 columns */ - IDCT_Transform( vx, vy ); - - /* Transpose matrix to work on rows */ - Matrix_Transpose( vy, vx ); - - /* Perform IDCT next on the 8 rows */ - IDCT_Transform( vx, vy ); - - /* Post-scale and store result. */ - vec_ptr = (vector signed short *) output; - vec_ptr[0] = vy[0]; - vec_ptr[1] = vy[1]; - vec_ptr[2] = vy[2]; - vec_ptr[3] = vy[3]; - vec_ptr[4] = vy[4]; - vec_ptr[5] = vy[5]; - vec_ptr[6] = vy[6]; - vec_ptr[7] = vy[7]; - -} - diff --git a/plugins/idct/idctclassic.c b/plugins/idct/idctclassic.c index b47fcaf31f..8d97a22677 100644 --- a/plugins/idct/idctclassic.c +++ b/plugins/idct/idctclassic.c @@ -2,7 +2,7 @@ * idctclassic.c : Classic IDCT module ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: idctclassic.c,v 1.14 2001/08/22 17:21:45 massiot Exp $ + * $Id: idctclassic.c,v 1.15 2001/09/05 16:07:49 massiot Exp $ * * Authors: Gaƫl Hendryckx * @@ -37,7 +37,8 @@ #include "mtime.h" #include "tests.h" -#include "vdec_idct.h" +#include "idct.h" +#include "block_c.h" #include "modules.h" #include "modules_export.h" @@ -46,9 +47,6 @@ * Local and extern prototypes. *****************************************************************************/ static void idct_getfunctions( function_list_t * p_function_list ); -static int idct_Probe ( probedata_t *p_data ); -static void vdec_NormScan ( u8 ppi_scan[2][64] ); - /***************************************************************************** * Build configuration tree. @@ -73,24 +71,6 @@ MODULE_DEACTIVATE_STOP /* Following functions are local */ -/***************************************************************************** - * Functions exported as capabilities. They are declared as static so that - * we don't pollute the namespace too much. - *****************************************************************************/ -static void idct_getfunctions( function_list_t * p_function_list ) -{ - p_function_list->pf_probe = idct_Probe; -#define F p_function_list->functions.idct - F.pf_idct_init = _M( vdec_InitIDCT ); - F.pf_sparse_idct = _M( vdec_SparseIDCT ); - F.pf_idct = _M( vdec_IDCT ); - F.pf_norm_scan = vdec_NormScan; - F.pf_decode_init = _M( vdec_InitDecode ); - F.pf_addblock = _M( vdec_AddBlock ); - F.pf_copyblock = _M( vdec_CopyBlock ); -#undef F -} - /***************************************************************************** * idct_Probe: returns a preference score *****************************************************************************/ @@ -107,20 +87,17 @@ static int idct_Probe( probedata_t *p_data ) } /***************************************************************************** - * vdec_NormScan : Unused in this IDCT + * NormScan : Unused in this IDCT *****************************************************************************/ -static void vdec_NormScan( u8 ppi_scan[2][64] ) +static void NormScan( u8 ppi_scan[2][64] ) { } /***************************************************************************** - * vdec_IDCT : IDCT function for normal matrices + * IDCT : IDCT function for normal matrices *****************************************************************************/ -void _M( vdec_IDCT )( void * p_unused_data, dctelem_t * p_block, - int i_idontcare ) +static __inline__ void IDCT( dctelem_t * p_block ) { - /* dct classique: pour tester la meilleure entre la classique et la */ - /* no classique */ s32 tmp0, tmp1, tmp2, tmp3; s32 tmp10, tmp11, tmp12, tmp13; s32 z1, z2, z3, z4, z5; @@ -337,3 +314,6 @@ void _M( vdec_IDCT )( void * p_unused_data, dctelem_t * p_block, } } +#include "idct_sparse.h" +#include "idct_decl.h" + diff --git a/plugins/idct/idctmmx.c b/plugins/idct/idctmmx.c index 020d0c14ec..72a2032f86 100644 --- a/plugins/idct/idctmmx.c +++ b/plugins/idct/idctmmx.c @@ -2,7 +2,7 @@ * idctmmx.c : MMX IDCT module ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: idctmmx.c,v 1.16 2001/08/22 17:21:45 massiot Exp $ + * $Id: idctmmx.c,v 1.17 2001/09/05 16:07:49 massiot Exp $ * * Authors: Aaron Holtzman * Michel Lespinasse @@ -41,10 +41,11 @@ #include "mtime.h" #include "tests.h" /* TestCPU() */ -#include "vdec_idct.h" - #include "mmx.h" +#include "idct.h" +#include "block_mmx.h" + #include "modules.h" #include "modules_export.h" @@ -52,8 +53,6 @@ * Local prototypes. *****************************************************************************/ static void idct_getfunctions( function_list_t * p_function_list ); -static int idct_Probe ( probedata_t *p_data ); -static void vdec_NormScan ( u8 ppi_scan[2][64] ); /***************************************************************************** * Build configuration tree. @@ -78,23 +77,6 @@ MODULE_DEACTIVATE_STOP /* Following functions are local */ -/***************************************************************************** - * Functions exported as capabilities. - *****************************************************************************/ -static void idct_getfunctions( function_list_t * p_function_list ) -{ - p_function_list->pf_probe = idct_Probe; -#define F p_function_list->functions.idct - F.pf_idct_init = _M( vdec_InitIDCT ); - F.pf_sparse_idct = _M( vdec_SparseIDCT ); - F.pf_idct = _M( vdec_IDCT ); - F.pf_norm_scan = vdec_NormScan; - F.pf_decode_init = _M( vdec_InitDecode ); - F.pf_addblock = _M( vdec_AddBlock ); - F.pf_copyblock = _M( vdec_CopyBlock ); -#undef F -} - /***************************************************************************** * idct_Probe: return a preference score *****************************************************************************/ @@ -115,9 +97,9 @@ static int idct_Probe( probedata_t *p_data ) } /***************************************************************************** - * vdec_NormScan : This IDCT uses reordered coeffs, so we patch the scan table + * NormScan : This IDCT uses reordered coeffs, so we patch the scan table *****************************************************************************/ -static void vdec_NormScan( u8 ppi_scan[2][64] ) +static void NormScan( u8 ppi_scan[2][64] ) { int i, j; @@ -132,7 +114,7 @@ static void vdec_NormScan( u8 ppi_scan[2][64] ) } /***************************************************************************** - * vdec_IDCT : + * IDCT : *****************************************************************************/ #define ROW_SHIFT 11 #define COL_SHIFT 6 @@ -426,8 +408,7 @@ static s32 rounder3[] ATTR_ALIGN(8) = static s32 rounder5[] ATTR_ALIGN(8) = rounder (-0.441341716183); // C3*(-C5/C4+C5-C3)/2 -void _M( vdec_IDCT )( void * p_unused_data, dctelem_t * p_block, - int i_idontcare ) +static __inline__ void IDCT( dctelem_t * p_block ) { static dctelem_t table04[] ATTR_ALIGN(16) = table (22725, 21407, 19266, 16384, 12873, 8867, 4520); @@ -460,3 +441,5 @@ void _M( vdec_IDCT )( void * p_unused_data, dctelem_t * p_block, Col( p_block, 4 ); } +#include "idct_sparse.h" +#include "idct_decl.h" diff --git a/plugins/idct/idctmmxext.c b/plugins/idct/idctmmxext.c index 97ab2eba7e..bd773bd553 100644 --- a/plugins/idct/idctmmxext.c +++ b/plugins/idct/idctmmxext.c @@ -2,7 +2,7 @@ * idctmmxext.c : MMX EXT IDCT module ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: idctmmxext.c,v 1.13 2001/08/22 17:21:45 massiot Exp $ + * $Id: idctmmxext.c,v 1.14 2001/09/05 16:07:49 massiot Exp $ * * Authors: Aaron Holtzman * Michel Lespinasse @@ -41,10 +41,11 @@ #include "mtime.h" #include "tests.h" /* TestCPU() */ -#include "vdec_idct.h" - #include "mmx.h" +#include "idct.h" +#include "block_mmx.h" + #include "modules.h" #include "modules_export.h" @@ -52,8 +53,6 @@ * Local prototypes. *****************************************************************************/ static void idct_getfunctions( function_list_t * p_function_list ); -static int idct_Probe ( probedata_t *p_data ); -static void vdec_NormScan ( u8 ppi_scan[2][64] ); /***************************************************************************** * Build configuration tree. @@ -78,23 +77,6 @@ MODULE_DEACTIVATE_STOP /* Following functions are local */ -/***************************************************************************** - * Functions exported as capabilities. - *****************************************************************************/ -static void idct_getfunctions( function_list_t * p_function_list ) -{ - p_function_list->pf_probe = idct_Probe; -#define F p_function_list->functions.idct - F.pf_idct_init = _M( vdec_InitIDCT ); - F.pf_sparse_idct = _M( vdec_SparseIDCT ); - F.pf_idct = _M( vdec_IDCT ); - F.pf_norm_scan = vdec_NormScan; - F.pf_decode_init = _M( vdec_InitDecode ); - F.pf_addblock = _M( vdec_AddBlock ); - F.pf_copyblock = _M( vdec_CopyBlock ); -#undef F -} - /***************************************************************************** * idct_Probe: return a preference score *****************************************************************************/ @@ -116,9 +98,9 @@ static int idct_Probe( probedata_t *p_data ) } /***************************************************************************** - * vdec_NormScan : This IDCT uses reordered coeffs, so we patch the scan table + * NormScan : This IDCT uses reordered coeffs, so we patch the scan table *****************************************************************************/ -static void vdec_NormScan( u8 ppi_scan[2][64] ) +static void NormScan( u8 ppi_scan[2][64] ) { int i, j; @@ -133,7 +115,7 @@ static void vdec_NormScan( u8 ppi_scan[2][64] ) } /***************************************************************************** - * vdec_IDCT : + * IDCT : *****************************************************************************/ #define ROW_SHIFT 11 #define COL_SHIFT 6 @@ -410,8 +392,7 @@ static s32 rounder3[] ATTR_ALIGN(8) = static s32 rounder5[] ATTR_ALIGN(8) = rounder (-0.441341716183); // C3*(-C5/C4+C5-C3)/2 -void _M( vdec_IDCT )( void * p_unused_data, dctelem_t * p_block, - int i_idontcare ) +static __inline__ void IDCT( dctelem_t * p_block ) { static dctelem_t table04[] ATTR_ALIGN(16) = table (22725, 21407, 19266, 16384, 12873, 8867, 4520); @@ -444,3 +425,5 @@ void _M( vdec_IDCT )( void * p_unused_data, dctelem_t * p_block, Col( p_block, 4 ); } +#include "idct_sparse.h" +#include "idct_decl.h" diff --git a/plugins/motion/Makefile b/plugins/motion/Makefile index 31bbd5f145..fd9cddb9ca 100644 --- a/plugins/motion/Makefile +++ b/plugins/motion/Makefile @@ -11,14 +11,16 @@ PLUGIN_MOTION = motion.o PLUGIN_MOTIONMMX = motionmmx.o PLUGIN_MOTIONMMXEXT = motionmmxext.o PLUGIN_MOTION3DNOW = motion3dnow.o +PLUGIN_MOTIONALTIVEC = motionaltivec.o BUILTIN_MOTION = $(PLUGIN_MOTION:%.o=BUILTIN_MOTION_%.o) BUILTIN_MOTIONMMX = $(PLUGIN_MOTIONMMX:%.o=BUILTIN_MOTIONMMX_%.o) BUILTIN_MOTIONMMXEXT = $(PLUGIN_MOTIONMMXEXT:%.o=BUILTIN_MOTIONMMXEXT_%.o) BUILTIN_MOTION3DNOW = $(PLUGIN_MOTION3DNOW:%.o=BUILTIN_MOTION3DNOW_%.o) +BUILTIN_MOTIONALTIVEC = $(PLUGIN_MOTIONALTIVEC:%.o=BUILTIN_MOTIONALTIVEC_%.o) PLUGIN_C = $(PLUGIN_MOTION) $(PLUGIN_MOTIONMMX) $(PLUGIN_MOTIONMMXEXT) $(PLUGIN_MOTION3DNOW) -ALL_OBJ = $(PLUGIN_C) $(BUILTIN_MOTION) $(BUILTIN_MOTIONMMX) $(BUILTIN_MOTIONMMXEXT) $(BUILTIN_MOTION3DNOW) +ALL_OBJ = $(PLUGIN_C) $(PLUGIN_MOTIONALTIVEC) $(BUILTIN_MOTION) $(BUILTIN_MOTIONMMX) $(BUILTIN_MOTIONMMXEXT) $(BUILTIN_MOTION3DNOW) # # Virtual targets @@ -26,6 +28,10 @@ ALL_OBJ = $(PLUGIN_C) $(BUILTIN_MOTION) $(BUILTIN_MOTIONMMX) $(BUILTIN_MOTIONMMX include ../../Makefile.modules +$(PLUGIN_MOTIONALTIVEC): %.o: .dep/%.d +$(PLUGIN_MOTIONALTIVEC): %.o: %.c + $(CC) $(CFLAGS) -DPLUGIN $(PCFLAGS) -faltivec -c -o $@ $< + $(BUILTIN_MOTION): BUILTIN_MOTION_%.o: .dep/%.d $(BUILTIN_MOTION): BUILTIN_MOTION_%.o: %.c $(CC) $(CFLAGS) -DBUILTIN -DMODULE_NAME=motion -c -o $@ $< @@ -42,6 +48,10 @@ $(BUILTIN_MOTION3DNOW): BUILTIN_MOTION3DNOW_%.o: .dep/%.d $(BUILTIN_MOTION3DNOW): BUILTIN_MOTION3DNOW_%.o: %.c $(CC) $(CFLAGS) -DBUILTIN -DMODULE_NAME=motion3dnow -c -o $@ $< +$(BUILTIN_MOTIONALTIVEC): BUILTIN_MOTIONALTIVEC_%.o: .dep/%.d +$(BUILTIN_MOTIONALTIVEC): BUILTIN_MOTIONALTIVEC_%.o: %.c + $(CC) $(CFLAGS) -DBUILTIN -DMODULE_NAME=motionaltivec -c -o $@ $< + # # Real targets # @@ -81,3 +91,9 @@ $(BUILTIN_MOTION3DNOW): BUILTIN_MOTION3DNOW_%.o: %.c ar r $@ $^ $(RANLIB) $@ +../motionaltivec.so: $(PLUGIN_MOTIONALTIVEC) + $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_ALTIVEC) + +../motionaltivec.a: $(BUILTIN_MOTIONALTIVEC) + ar r $@ $^ + $(RANLIB) $@ diff --git a/plugins/motion/motion3dnow.c b/plugins/motion/motion3dnow.c index 2a1f916094..e93a723770 100644 --- a/plugins/motion/motion3dnow.c +++ b/plugins/motion/motion3dnow.c @@ -2,7 +2,7 @@ * motion3dnow.c : 3DNow! motion compensation module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: motion3dnow.c,v 1.1 2001/08/22 17:21:45 massiot Exp $ + * $Id: motion3dnow.c,v 1.2 2001/09/05 16:07:49 massiot Exp $ * * Authors: Aaron Holtzman * Michel Lespinasse @@ -85,7 +85,7 @@ static int motion_Probe( probedata_t *p_data ) return( 999 ); } - return( 200 ); + return( 250 ); } /***************************************************************************** diff --git a/plugins/motion/motionaltivec.c b/plugins/motion/motionaltivec.c new file mode 100644 index 0000000000..325820c57c --- /dev/null +++ b/plugins/motion/motionaltivec.c @@ -0,0 +1,599 @@ +/***************************************************************************** + * motionaltivec.c : Altivec motion compensation module for vlc + ***************************************************************************** + * Copyright (C) 2001 VideoLAN + * $Id: motionaltivec.c,v 1.1 2001/09/05 16:07:49 massiot Exp $ + * + * Authors: Aaron Holtzman + * Paul Mackerras + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +#define MODULE_NAME motionaltivec +#include "modules_inner.h" + +/***************************************************************************** + * Preamble + *****************************************************************************/ +#include "defs.h" + +#include /* malloc(), free() */ + +#include "config.h" +#include "common.h" /* boolean_t, byte_t */ +#include "threads.h" +#include "mtime.h" +#include "tests.h" + +#include "modules.h" +#include "modules_export.h" + +/***************************************************************************** + * Local and extern prototypes. + *****************************************************************************/ +static void motion_getfunctions( function_list_t * p_function_list ); + +/***************************************************************************** + * Build configuration tree. + *****************************************************************************/ +MODULE_CONFIG_START +ADD_WINDOW( "Configuration for Altivec motion compensation module" ) + ADD_COMMENT( "Ha, ha -- nothing to configure yet" ) +MODULE_CONFIG_STOP + +MODULE_INIT_START + p_module->i_capabilities = MODULE_CAPABILITY_NULL + | MODULE_CAPABILITY_MOTION; + p_module->psz_longname = "MMX motion compensation module"; +MODULE_INIT_STOP + +MODULE_ACTIVATE_START + motion_getfunctions( &p_module->p_functions->motion ); +MODULE_ACTIVATE_STOP + +MODULE_DEACTIVATE_START +MODULE_DEACTIVATE_STOP + +/***************************************************************************** + * motion_Probe: tests probe the CPU and return a score + *****************************************************************************/ +static int motion_Probe( probedata_t *p_data ) +{ + if( !TestCPU( CPU_CAPABILITY_ALTIVEC ) ) + { + return( 0 ); + } + + if( TestMethod( MOTION_METHOD_VAR, "motionaltivec" ) + || TestMethod( MOTION_METHOD_VAR, "altivec" ) ) + { + return( 999 ); + } + + return( 150 ); +} + +/***************************************************************************** + * Motion compensation in Altivec + *****************************************************************************/ + +#define COPY_8(d, s) (*(long long *)(d) = *(long long *)(s)) +#define COPY_16(d, s) (((long long *)(d))[0] = ((long long *)(s))[0], \ + ((long long *)(d))[1] = ((long long *)(s))[1]) + +void +MC_put_16_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift, refw0, refw1, d; + + do { + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + d = vec_perm(refw0, refw1, rshift); + if ((unsigned long)dest & 15) { + /* unaligned store, yuck */ + vector unsigned char x = d; + COPY_16(dest, &x); + } else + vec_st(d, 0, dest); + ref += stride; + dest += stride; + } while (--height); +} + +void +MC_avg_16_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift, refw0, refw1; + vector unsigned char r, d; + + do { + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + r = vec_perm(refw0, refw1, rshift); + if ((unsigned long)dest & 15) { + /* unaligned load/store, yuck */ + vector unsigned char dw0, dw1, dshift, mask; + + dshift = vec_lvsr(0, dest); + dw0 = vec_ld(0, dest); + dw1 = vec_ld(16, dest); + d = vec_perm(r, r, dshift); + mask = vec_perm((vector unsigned char)(0), + (vector unsigned char)(255), dshift); + dw0 = vec_sel(dw0, vec_avg(dw0, d), mask); + dw1 = vec_sel(vec_avg(dw1, d), dw1, mask); + vec_st(dw0, 0, dest); + vec_st(dw1, 16, dest); + } else { + d = vec_ld(0, dest); + d = vec_avg(d, r); + vec_st(d, 0, dest); + } + ref += stride; + dest += stride; + } while (--height); +} + +void +MC_put_x16_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift0, rshift1, refw0, refw1; + vector unsigned char t0, t1, d, one; + + one = (vector unsigned char)(1); + do { + rshift0 = vec_lvsl(0, ref); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + d = vec_avg(t0, t1); + if ((unsigned long)dest & 15) { + /* unaligned store, yuck */ + vector unsigned char x = d; + COPY_16(dest, &x); + } else + vec_st(d, 0, dest); + ref += stride; + dest += stride; + } while (--height); +} + +void +MC_avg_x16_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift0, rshift1, refw0, refw1; + vector unsigned char t0, t1, r, d, one; + + one = (vector unsigned char)(1); + do { + rshift0 = vec_lvsl(0, ref); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + r = vec_avg(t0, t1); + if ((unsigned long)dest & 15) { + /* unaligned load/store, yuck */ + vector unsigned char dw0, dw1, dshift, mask; + + dshift = vec_lvsr(0, dest); + dw0 = vec_ld(0, dest); + dw1 = vec_ld(16, dest); + d = vec_perm(r, r, dshift); + mask = vec_perm((vector unsigned char)(0), + (vector unsigned char)(255), dshift); + dw0 = vec_sel(dw0, vec_avg(dw0, d), mask); + dw1 = vec_sel(vec_avg(dw1, d), dw1, mask); + vec_st(dw0, 0, dest); + vec_st(dw1, 16, dest); + } else { + d = vec_ld(0, dest); + d = vec_avg(d, r); + vec_st(d, 0, dest); + } + ref += stride; + dest += stride; + } while (--height); +} + +void +MC_put_y16_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift, refw0, refw1; + vector unsigned char r0, r1, d; + + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + r0 = vec_perm(refw0, refw1, rshift); + do { + ref += stride; + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + r1 = vec_perm(refw0, refw1, rshift); + d = vec_avg(r0, r1); + r0 = r1; + if ((unsigned long)dest & 15) { + /* unaligned store, yuck */ + vector unsigned char x = d; + COPY_16(dest, &x); + } else + vec_st(d, 0, dest); + dest += stride; + } while (--height); +} + +void +MC_avg_y16_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift, refw0, refw1; + vector unsigned char r0, r1, r, d; + + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + r0 = vec_perm(refw0, refw1, rshift); + do { + ref += stride; + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + r1 = vec_perm(refw0, refw1, rshift); + r = vec_avg(r0, r1); + r0 = r1; + if ((unsigned long)dest & 15) { + /* unaligned load/store, yuck */ + vector unsigned char dw0, dw1, dshift, mask; + + dshift = vec_lvsr(0, dest); + dw0 = vec_ld(0, dest); + dw1 = vec_ld(16, dest); + d = vec_perm(r, r, dshift); + mask = vec_perm((vector unsigned char)(0), + (vector unsigned char)(255), dshift); + dw0 = vec_sel(dw0, vec_avg(dw0, d), mask); + dw1 = vec_sel(vec_avg(dw1, d), dw1, mask); + vec_st(dw0, 0, dest); + vec_st(dw1, 16, dest); + } else { + d = vec_ld(0, dest); + d = vec_avg(d, r); + vec_st(d, 0, dest); + } + dest += stride; + } while (--height); +} + +void +MC_put_xy16_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift0, rshift1, refw0, refw1; + vector unsigned char t0, t1, r0, r1, d, one; + + rshift0 = vec_lvsl(0, ref); + one = (vector unsigned char)(1); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + r0 = vec_avg(t0, t1); + do { + ref += stride; + rshift0 = vec_lvsl(0, ref); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + r1 = vec_avg(t0, t1); + d = vec_avg(r0, r1); + r0 = r1; + if ((unsigned long)dest & 15) { + /* unaligned store, yuck */ + vector unsigned char x = d; + COPY_16(dest, &x); + } else + vec_st(d, 0, dest); + dest += stride; + } while (--height); +} + +void +MC_avg_xy16_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift0, rshift1, refw0, refw1; + vector unsigned char t0, t1, r0, r1, r, d, one; + + rshift0 = vec_lvsl(0, ref); + one = (vector unsigned char)(1); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + r0 = vec_avg(t0, t1); + do { + ref += stride; + rshift0 = vec_lvsl(0, ref); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + r1 = vec_avg(t0, t1); + r = vec_avg(r0, r1); + r0 = r1; + if ((unsigned long)dest & 15) { + /* unaligned load/store, yuck */ + vector unsigned char dw0, dw1, dshift, mask; + + dshift = vec_lvsr(0, dest); + dw0 = vec_ld(0, dest); + dw1 = vec_ld(16, dest); + d = vec_perm(r, r, dshift); + mask = vec_perm((vector unsigned char)(0), + (vector unsigned char)(255), dshift); + dw0 = vec_sel(dw0, vec_avg(dw0, d), mask); + dw1 = vec_sel(vec_avg(dw1, d), dw1, mask); + vec_st(dw0, 0, dest); + vec_st(dw1, 16, dest); + } else { + d = vec_ld(0, dest); + d = vec_avg(d, r); + vec_st(d, 0, dest); + } + dest += stride; + } while (--height); +} + +void +MC_put_8_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift, refw0, refw1, d; + + do { + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + d = vec_perm(refw0, refw1, rshift); + COPY_8(dest, &d); + ref += stride; + dest += stride; + } while (--height); +} + +void +MC_avg_8_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift, refw0, refw1; + vector unsigned char r, d; + + do { + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + r = vec_perm(refw0, refw1, rshift); + COPY_8(&d, dest); + d = vec_avg(d, r); + COPY_8(dest, &d); + ref += stride; + dest += stride; + } while (--height); +} + +void +MC_put_x8_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift0, rshift1, refw0, refw1; + vector unsigned char t0, t1, d, one; + + one = (vector unsigned char)(1); + do { + rshift0 = vec_lvsl(0, ref); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + d = vec_avg(t0, t1); + COPY_8(dest, &d); + ref += stride; + dest += stride; + } while (--height); +} + +void +MC_avg_x8_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift0, rshift1, refw0, refw1; + vector unsigned char t0, t1, r, d, one; + + one = (vector unsigned char)(1); + do { + rshift0 = vec_lvsl(0, ref); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + r = vec_avg(t0, t1); + COPY_8(&d, dest); + d = vec_avg(d, r); + COPY_8(dest, &d); + ref += stride; + dest += stride; + } while (--height); +} + +void +MC_put_y8_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift, refw0, refw1; + vector unsigned char r0, r1, d; + + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + r0 = vec_perm(refw0, refw1, rshift); + do { + ref += stride; + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + r1 = vec_perm(refw0, refw1, rshift); + d = vec_avg(r0, r1); + r0 = r1; + COPY_8(dest, &d); + dest += stride; + } while (--height); +} + +void +MC_avg_y8_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift, refw0, refw1; + vector unsigned char r0, r1, r, d; + + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + r0 = vec_perm(refw0, refw1, rshift); + do { + ref += stride; + rshift = vec_lvsl(0, ref); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + r1 = vec_perm(refw0, refw1, rshift); + r = vec_avg(r0, r1); + r0 = r1; + COPY_8(&d, dest); + d = vec_avg(d, r); + COPY_8(dest, &d); + dest += stride; + } while (--height); +} + +void +MC_put_xy8_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift0, rshift1, refw0, refw1; + vector unsigned char t0, t1, r0, r1, d, one; + + rshift0 = vec_lvsl(0, ref); + one = (vector unsigned char)(1); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + r0 = vec_avg(t0, t1); + do { + ref += stride; + rshift0 = vec_lvsl(0, ref); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + r1 = vec_avg(t0, t1); + d = vec_avg(r0, r1); + r0 = r1; + COPY_8(dest, &d); + dest += stride; + } while (--height); +} + +void +MC_avg_xy8_altivec(uint8_t * dest, uint8_t * ref, int stride, int height) +{ + vector unsigned char rshift0, rshift1, refw0, refw1; + vector unsigned char t0, t1, r0, r1, r, d, one; + + rshift0 = vec_lvsl(0, ref); + one = (vector unsigned char)(1); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + r0 = vec_avg(t0, t1); + do { + ref += stride; + rshift0 = vec_lvsl(0, ref); + rshift1 = vec_add(rshift0, one); + refw0 = vec_ld(0, ref); + refw1 = vec_ld(16, ref); + t0 = vec_perm(refw0, refw1, rshift0); + t1 = vec_perm(refw0, refw1, rshift1); + r1 = vec_avg(t0, t1); + r = vec_avg(r0, r1); + r0 = r1; + COPY_8(&d, dest); + d = vec_avg(d, r); + COPY_8(dest, &d); + dest += stride; + } while (--height); +} + +/***************************************************************************** + * Functions exported as capabilities. They are declared as static so that + * we don't pollute the namespace too much. + *****************************************************************************/ +static void motion_getfunctions( function_list_t * p_function_list ) +{ + static void (* ppppf_motion[2][2][4])( yuv_data_t *, yuv_data_t *, + int, int ) = + { + { + /* Copying functions */ + { + /* Width == 16 */ + MC_put_16_altivec, MC_put_x16_altivec, MC_put_y16_altivec, MC_put_xy16_altivec + }, + { + /* Width == 8 */ + MC_put_8_altivec, MC_put_x8_altivec, MC_put_y8_altivec, MC_put_xy8_altivec + } + }, + { + /* Averaging functions */ + { + /* Width == 16 */ + MC_avg_16_altivec, MC_avg_x16_altivec, MC_avg_y16_altivec, MC_avg_xy16_altivec + }, + { + /* Width == 8 */ + MC_avg_8_altivec, MC_avg_x8_altivec, MC_avg_y8_altivec, MC_avg_xy8_altivec + } + } + }; + + p_function_list->pf_probe = motion_Probe; + +#define list p_function_list->functions.motion + memcpy( list.ppppf_motion, ppppf_motion, sizeof( void * ) * 16 ); +#undef list + + return; +} diff --git a/src/input/input_clock.c b/src/input/input_clock.c index bcebd87c7b..950532b06f 100644 --- a/src/input/input_clock.c +++ b/src/input/input_clock.c @@ -2,7 +2,7 @@ * input_clock.c: Clock/System date convertions, stream management ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: input_clock.c,v 1.21 2001/07/20 16:20:25 massiot Exp $ + * $Id: input_clock.c,v 1.22 2001/09/05 16:07:50 massiot Exp $ * * Authors: Christophe Massiot * @@ -84,6 +84,8 @@ /***************************************************************************** * ClockToSysdate: converts a movie clock to system date *****************************************************************************/ +static void ClockNewRef( input_thread_t * p_input, pgrm_descriptor_t * p_pgrm, + mtime_t i_clock, mtime_t i_sysdate ); static mtime_t ClockToSysdate( input_thread_t * p_input, pgrm_descriptor_t * p_pgrm, mtime_t i_clock ) { @@ -93,10 +95,10 @@ static mtime_t ClockToSysdate( input_thread_t * p_input, { i_sysdate = (mtime_t)(i_clock - p_pgrm->cr_ref) * (mtime_t)p_input->stream.control.i_rate - * (mtime_t)300 - / (mtime_t)27 - / (mtime_t)DEFAULT_RATE - + (mtime_t)p_pgrm->sysdate_ref; + * (mtime_t)300; + i_sysdate /= 27; + i_sysdate /= 1000; + i_sysdate += (mtime_t)p_pgrm->sysdate_ref; } return( i_sysdate ); @@ -122,7 +124,7 @@ static void ClockNewRef( input_thread_t * p_input, pgrm_descriptor_t * p_pgrm, mtime_t i_clock, mtime_t i_sysdate ) { p_pgrm->cr_ref = i_clock; - p_pgrm->sysdate_ref = p_pgrm->last_syscr ? p_pgrm->last_syscr : i_sysdate; + p_pgrm->sysdate_ref = i_sysdate; } /***************************************************************************** @@ -132,7 +134,6 @@ static void ClockNewRef( input_thread_t * p_input, pgrm_descriptor_t * p_pgrm, void input_ClockInit( pgrm_descriptor_t * p_pgrm ) { p_pgrm->last_cr = 0; - p_pgrm->last_syscr = 0; p_pgrm->cr_ref = 0; p_pgrm->sysdate_ref = 0; p_pgrm->delta_cr = 0; @@ -160,7 +161,6 @@ int input_ClockManageControl( input_thread_t * p_input, p_input->stream.control.i_status = PAUSE_S; vlc_cond_wait( &p_input->stream.stream_wait, &p_input->stream.stream_lock ); - p_pgrm->last_syscr = 0; ClockNewRef( p_input, p_pgrm, i_clock, mdate() ); if( p_input->stream.i_new_status == PAUSE_S ) @@ -233,7 +233,6 @@ void input_ClockManageRef( input_thread_t * p_input, else { p_pgrm->last_cr = 0; - p_pgrm->last_syscr = 0; p_pgrm->delta_cr = 0; p_pgrm->c_average_count = 0; } @@ -261,8 +260,7 @@ void input_ClockManageRef( input_thread_t * p_input, /* Wait a while before delivering the packets to the decoder. * In case of multiple programs, we arbitrarily follow the * clock of the first program. */ - p_pgrm->last_syscr = ClockToSysdate( p_input, p_pgrm, i_clock ); - mwait( p_pgrm->last_syscr ); + mwait( ClockToSysdate( p_input, p_pgrm, i_clock ) ); /* Now take into account interface changes. */ input_ClockManageControl( p_input, p_pgrm, i_clock ); diff --git a/src/interface/main.c b/src/interface/main.c index 844b222e6f..858195eb53 100644 --- a/src/interface/main.c +++ b/src/interface/main.c @@ -4,7 +4,7 @@ * and spawn threads. ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: main.c,v 1.112 2001/08/22 14:23:57 sam Exp $ + * $Id: main.c,v 1.113 2001/09/05 16:07:50 massiot Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -1068,7 +1068,7 @@ static int CPUCapabilities( void ) slot_name( hi.cpu_type, hi.cpu_subtype, &psz_name, &psz_subname ); /* FIXME: need better way to detect newer proccessors. * could do strncmp(a,b,5), but that's real ugly */ - if( strcmp(psz_name, "ppc7400") || strcmp(psz_name, "ppc7450") ) + if( !strcmp(psz_name, "ppc7400") || !strcmp(psz_name, "ppc7450") ) { i_capabilities |= CPU_CAPABILITY_ALTIVEC; } @@ -1183,6 +1183,30 @@ static int CPUCapabilities( void ) signal( SIGILL, NULL ); return( i_capabilities ); +#elif defined( __powerpc__ ) +# if defined( vector ) + /* Test for Altivec */ + signal( SIGILL, InstructionSignalHandler ); + + i_illegal = 0; + if( setjmp( env ) == 0 ) + { + /* Set VSCR to 0 */ + vec_mtvscr( (vector unsigned int)(0) ); + /* Set the VRSAVE register in case the kernel looks at it */ + asm volatile ("mtspr 256,%0" : : "r" (-1)); + } + + if( i_illegal == 0 ) + { + i_capabilities |= CPU_CAPABILITY_ALTIVEC; + } + + signal( SIGILL, NULL ); +# endif + + return( i_capabilities ); + #else /* default behaviour */ return( i_capabilities ); diff --git a/src/video_decoder/video_decoder.c b/src/video_decoder/video_decoder.c index 94a60c5839..7090411cda 100644 --- a/src/video_decoder/video_decoder.c +++ b/src/video_decoder/video_decoder.c @@ -2,7 +2,7 @@ * video_decoder.c : video decoder thread ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: video_decoder.c,v 1.57 2001/08/22 17:21:45 massiot Exp $ + * $Id: video_decoder.c,v 1.58 2001/09/05 16:07:50 massiot Exp $ * * Authors: Christophe Massiot * Michel Lespinasse @@ -150,7 +150,6 @@ void vdec_InitThread( vdec_thread_t * p_vdec ) p_vdec->p_idct_data = NULL; - p_vdec->p_pool->pf_decode_init( p_vdec ); p_vdec->p_pool->pf_idct_init( &p_vdec->p_idct_data ); /* Mark thread as running and return */ @@ -259,18 +258,15 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \ if( p_mb->i_coded_block_pattern & (1 << (5 - i)) ) \ { \ /* \ - * Inverse DCT (ISO/IEC 13818-2 section Annex A) \ - */ \ - p_idct->pf_idct( p_vdec->p_idct_data, p_idct->pi_block, \ - p_idct->i_sparse_pos ); \ - \ - /* \ - * Adding prediction and coefficient data (ISO/IEC \ + * Inverse DCT (ISO/IEC 13818-2 section Annex A) and \ + * adding prediction and coefficient data (ISO/IEC \ * 13818-2 section 7.6.8) \ */ \ - p_pool->pf_addblock( p_idct->pi_block, p_idct->p_dct_data, \ - i < 4 ? p_mb->i_lum_dct_stride : \ - p_mb->i_chrom_dct_stride ); \ + p_idct->pf_idct( p_idct->pi_block, p_idct->p_dct_data, \ + i < 4 ? p_mb->i_lum_dct_stride : \ + p_mb->i_chrom_dct_stride, \ + p_vdec->p_idct_data, \ + p_idct->i_sparse_pos ); \ } \ } \ } \ @@ -280,11 +276,11 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \ for( i = 0, p_idct = p_mb->p_idcts; i < 4 + 2 * B_COLOR; \ i++, p_idct++ ) \ { \ - p_idct->pf_idct( p_vdec->p_idct_data, p_idct->pi_block, \ + p_idct->pf_idct( p_idct->pi_block, p_idct->p_dct_data, \ + i < 4 ? p_mb->i_lum_dct_stride : \ + p_mb->i_chrom_dct_stride, \ + p_vdec->p_idct_data, \ p_idct->i_sparse_pos ); \ - p_pool->pf_copyblock( p_idct->pi_block, p_idct->p_dct_data, \ - i < 4 ? p_mb->i_lum_dct_stride : \ - p_mb->i_chrom_dct_stride ); \ } \ } \ } diff --git a/src/video_decoder/video_parser.c b/src/video_decoder/video_parser.c index e843960a5a..368408eee4 100644 --- a/src/video_decoder/video_parser.c +++ b/src/video_decoder/video_parser.c @@ -2,7 +2,7 @@ * video_parser.c : video parser thread ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: video_parser.c,v 1.4 2001/08/22 17:21:45 massiot Exp $ + * $Id: video_parser.c,v 1.5 2001/09/05 16:07:50 massiot Exp $ * * Authors: Christophe Massiot * Samuel Hocevar @@ -153,12 +153,11 @@ static int InitThread( vpar_thread_t *p_vpar ) #define f p_vpar->p_idct_module->p_functions->idct.functions.idct p_vpar->pool.pf_idct_init = f.pf_idct_init; - p_vpar->pf_sparse_idct = f.pf_sparse_idct; - p_vpar->pf_idct = f.pf_idct; + p_vpar->pf_sparse_idct_add = f.pf_sparse_idct_add; + p_vpar->pf_idct_add = f.pf_idct_add; + p_vpar->pf_sparse_idct_copy = f.pf_sparse_idct_copy; + p_vpar->pf_idct_copy = f.pf_idct_copy; p_vpar->pf_norm_scan = f.pf_norm_scan; - p_vpar->pool.pf_decode_init = f.pf_decode_init; - p_vpar->pool.pf_addblock = f.pf_addblock; - p_vpar->pool.pf_copyblock = f.pf_copyblock; #undef f /* Initialize input bitstream */ diff --git a/src/video_decoder/video_parser.h b/src/video_decoder/video_parser.h index be23b69189..83fa23bc50 100644 --- a/src/video_decoder/video_parser.h +++ b/src/video_decoder/video_parser.h @@ -2,7 +2,7 @@ * video_parser.h : video parser thread ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: video_parser.h,v 1.12 2001/08/22 17:21:45 massiot Exp $ + * $Id: video_parser.h,v 1.13 2001/09/05 16:07:50 massiot Exp $ * * Authors: Christophe Massiot * Jean-Marc Dressler @@ -330,11 +330,18 @@ typedef struct vpar_thread_s /* Motion compensation plug-in used and shortcuts */ struct module_s * p_motion_module; - /* IDCT plugin used and shortcuts */ + /* IDCT plug-in used and shortcuts */ struct module_s * p_idct_module; - void ( * pf_sparse_idct ) ( void *, dctelem_t*, int ); - void ( * pf_idct ) ( void *, dctelem_t*, int ); - void ( * pf_norm_scan ) ( u8 ppi_scan[2][64] ); + void ( * pf_sparse_idct_add )( dctelem_t *, yuv_data_t *, int, + void *, int ); + void ( * pf_idct_add ) ( dctelem_t *, yuv_data_t *, int, + void *, int ); + void ( * pf_sparse_idct_copy )( dctelem_t *, yuv_data_t *, int, + void *, int ); + void ( * pf_idct_copy ) ( dctelem_t *, yuv_data_t *, int, + void *, int ); + + void ( * pf_norm_scan ) ( u8 ppi_scan[2][64] ); #ifdef STATS /* Statistics */ diff --git a/src/video_decoder/vpar_blocks.c b/src/video_decoder/vpar_blocks.c index 1de5a5de92..87a072a925 100644 --- a/src/video_decoder/vpar_blocks.c +++ b/src/video_decoder/vpar_blocks.c @@ -2,7 +2,7 @@ * vpar_blocks.c : blocks parsing ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: vpar_blocks.c,v 1.8 2001/09/04 23:21:34 jlj Exp $ + * $Id: vpar_blocks.c,v 1.9 2001/09/05 16:07:50 massiot Exp $ * * Authors: Michel Lespinasse * Aaron Holtzman @@ -304,23 +304,23 @@ store_coeff: { if( i_nc == 0 ) { - p_idct->pf_idct = p_vpar->pf_sparse_idct; + p_idct->pf_idct = p_vpar->pf_sparse_idct_copy; p_idct->i_sparse_pos = 63; } else { - p_idct->pf_idct = p_vpar->pf_idct; + p_idct->pf_idct = p_vpar->pf_idct_copy; } } else { - p_idct->pf_idct = p_vpar->pf_sparse_idct; + p_idct->pf_idct = p_vpar->pf_sparse_idct_copy; p_idct->i_sparse_pos = i_coeff - p_tab->i_run; } } else { - p_idct->pf_idct = p_vpar->pf_idct; + p_idct->pf_idct = p_vpar->pf_idct_copy; } } @@ -448,23 +448,23 @@ store_coeff: { if( i_nc == 0 ) { - p_idct->pf_idct = p_vpar->pf_sparse_idct; + p_idct->pf_idct = p_vpar->pf_sparse_idct_copy; p_idct->i_sparse_pos = 63; } else { - p_idct->pf_idct = p_vpar->pf_idct; + p_idct->pf_idct = p_vpar->pf_idct_copy; } } else { - p_idct->pf_idct = p_vpar->pf_sparse_idct; + p_idct->pf_idct = p_vpar->pf_sparse_idct_copy; p_idct->i_sparse_pos = i_coeff - p_tab->i_run; } } else { - p_idct->pf_idct = p_vpar->pf_idct; + p_idct->pf_idct = p_vpar->pf_idct_copy; } } @@ -614,17 +614,17 @@ coeff_2: { if( i_nc == 0 ) { - p_idct->pf_idct = p_vpar->pf_sparse_idct; + p_idct->pf_idct = p_vpar->pf_sparse_idct_add; p_idct->i_sparse_pos = 63; } else { - p_idct->pf_idct = p_vpar->pf_idct; + p_idct->pf_idct = p_vpar->pf_idct_add; } } else { - p_idct->pf_idct = p_vpar->pf_sparse_idct; + p_idct->pf_idct = p_vpar->pf_sparse_idct_add; if( i_nc == 0 ) { p_idct->i_sparse_pos = 0; @@ -637,7 +637,7 @@ coeff_2: } else { - p_idct->pf_idct = p_vpar->pf_idct; + p_idct->pf_idct = p_vpar->pf_idct_add; } } @@ -775,12 +775,12 @@ store_coeff: if( i_nc <= 1 ) { - p_idct->pf_idct = p_vpar->pf_sparse_idct; + p_idct->pf_idct = p_vpar->pf_sparse_idct_copy; p_idct->i_sparse_pos = i_coeff - p_tab->i_run; } else { - p_idct->pf_idct = p_vpar->pf_idct; + p_idct->pf_idct = p_vpar->pf_idct_copy; } } @@ -930,7 +930,7 @@ coeff_2: if( i_nc <= 1 ) { - p_idct->pf_idct = p_vpar->pf_sparse_idct; + p_idct->pf_idct = p_vpar->pf_sparse_idct_add; if( i_nc == 0 ) { p_idct->i_sparse_pos = 0; @@ -942,7 +942,7 @@ coeff_2: } else { - p_idct->pf_idct = p_vpar->pf_idct; + p_idct->pf_idct = p_vpar->pf_idct_add; } } diff --git a/src/video_decoder/vpar_pool.h b/src/video_decoder/vpar_pool.h index a4d7830ab8..242a0ad193 100644 --- a/src/video_decoder/vpar_pool.h +++ b/src/video_decoder/vpar_pool.h @@ -2,7 +2,7 @@ * vpar_pool.h : video parser/video decoders communication ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: vpar_pool.h,v 1.2 2001/08/22 17:21:46 massiot Exp $ + * $Id: vpar_pool.h,v 1.3 2001/09/05 16:07:50 massiot Exp $ * * Authors: Christophe Massiot * @@ -74,10 +74,6 @@ typedef struct vdec_pool_s /* Access to the plug-ins needed by the video decoder thread */ void ( * pf_idct_init ) ( void ** ); - void ( * pf_decode_init ) ( ); - void ( * pf_addblock ) ( dctelem_t *, yuv_data_t *, int ); - void ( * pf_copyblock ) ( dctelem_t *, yuv_data_t *, int ); - void ( * ppppf_motion[2][2][4] ) ( yuv_data_t *, yuv_data_t *, int, int ); } vdec_pool_t;