3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* - Native API implementation - |
* - Native API implementation - |
5 |
* |
* |
|
* This program is an implementation of a part of one or more MPEG-4 |
|
|
* Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
|
|
* to use this software module in hardware or software products are |
|
|
* advised that its use may infringe existing patents or copyrights, and |
|
|
* any such use would be at such party's own risk. The original |
|
|
* developer of this software module and his/her company, and subsequent |
|
|
* editors and their companies, will have no liability for use of this |
|
|
* software or modifications or derivatives thereof. |
|
|
* |
|
6 |
* This program is free software ; you can redistribute it and/or modify |
* This program is free software ; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
8 |
* the Free Software Foundation ; either version 2 of the License, or |
* the Free Software Foundation ; either version 2 of the License, or |
17 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
* |
* |
20 |
****************************************************************************/ |
* $Id: xvid.c,v 1.47 2003-06-11 14:10:55 Isibaar Exp $ |
|
|
|
|
/***************************************************************************** |
|
|
* |
|
|
* History |
|
|
* |
|
|
* - 23.06.2002 added XVID_CPU_CHKONLY |
|
|
* - 17.03.2002 Added interpolate8x8_halfpel_hv_xmm |
|
|
* - 22.12.2001 API change: added xvid_init() - Isibaar |
|
|
* - 16.12.2001 inital version; (c)2001 peter ross <pross@cs.rmit.edu.au> |
|
|
* |
|
|
* $Id: xvid.c,v 1.41 2003-02-15 15:22:17 edgomez Exp $ |
|
21 |
* |
* |
22 |
****************************************************************************/ |
****************************************************************************/ |
23 |
|
|
64 |
|
|
65 |
|
|
66 |
/* |
/* |
67 |
calls the funcptr, and returns whether SIGILL (illegal instruction) was signalled |
* Calls the funcptr, and returns whether SIGILL (illegal instruction) was |
68 |
return values: |
* signalled |
69 |
-1 : could not determine |
* |
70 |
0 : SIGILL was *not* signalled |
* Return values: |
71 |
1 : SIGILL was signalled |
* -1 : could not determine |
72 |
|
* 0 : SIGILL was *not* signalled |
73 |
|
* 1 : SIGILL was signalled |
74 |
*/ |
*/ |
75 |
|
|
76 |
int |
int |
298 |
dev16 = dev16_c; |
dev16 = dev16_c; |
299 |
sad16v = sad16v_c; |
sad16v = sad16v_c; |
300 |
|
|
301 |
// Halfpel8_Refine = Halfpel8_Refine_c; |
/* Halfpel8_Refine = Halfpel8_Refine_c; */ |
302 |
|
|
303 |
#if defined(ARCH_IS_IA32) |
#if defined(ARCH_IS_IA32) |
304 |
|
|
488 |
|
|
489 |
if ((cpu_flags & XVID_CPU_SSE2)) { |
if ((cpu_flags & XVID_CPU_SSE2)) { |
490 |
|
|
491 |
|
#if defined(EXPERIMENTAL_SSE2_CODE) /* many people reported crashes with SSE2 */ |
492 |
|
/* better deactivate it completely and fix everything */ |
493 |
|
/* in dev-api-4 */ |
494 |
calc_cbp = calc_cbp_sse2; |
calc_cbp = calc_cbp_sse2; |
495 |
|
|
496 |
/* Quantization */ |
/* Quantization */ |
499 |
quant_inter = quant_inter_sse2; |
quant_inter = quant_inter_sse2; |
500 |
dequant_inter = dequant_inter_sse2; |
dequant_inter = dequant_inter_sse2; |
501 |
|
|
|
#if defined(EXPERIMENTAL_SSE2_CODE) |
|
502 |
/* ME; slower than xmm */ |
/* ME; slower than xmm */ |
503 |
sad16 = sad16_sse2; |
sad16 = sad16_sse2; |
504 |
dev16 = dev16_sse2; |
dev16 = dev16_sse2; |
505 |
#endif |
#endif |
506 |
/* Forward and Inverse DCT */ |
/* Forward and Inverse DCT */ |
507 |
idct = idct_sse2; |
/* idct = idct_sse2; |
508 |
fdct = fdct_sse2; |
/* fdct = fdct_sse2; Both are none to be unprecise - better deactivate for now */ |
509 |
} |
} |
510 |
#endif |
#endif |
511 |
|
|
512 |
#if defined(ARCH_IS_IA64) |
#if defined(ARCH_IS_IA64) |
513 |
if ((cpu_flags & XVID_CPU_ASM)) { //use assembler routines? |
if ((cpu_flags & XVID_CPU_ASM)) { /* use assembler routines? */ |
514 |
idct_ia64_init(); |
idct_ia64_init(); |
515 |
fdct = fdct_ia64; |
fdct = fdct_ia64; |
516 |
idct = idct_ia64; //not yet working, crashes |
idct = idct_ia64; /*not yet working, crashes */ |
517 |
interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_ia64; |
interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_ia64; |
518 |
interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_ia64; |
interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_ia64; |
519 |
interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_ia64; |
interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_ia64; |
521 |
sad16bi = sad16bi_ia64; |
sad16bi = sad16bi_ia64; |
522 |
sad8 = sad8_ia64; |
sad8 = sad8_ia64; |
523 |
dev16 = dev16_ia64; |
dev16 = dev16_ia64; |
524 |
// Halfpel8_Refine = Halfpel8_Refine_ia64; |
/* Halfpel8_Refine = Halfpel8_Refine_ia64; */ |
525 |
quant_intra = quant_intra_ia64; |
quant_intra = quant_intra_ia64; |
526 |
dequant_intra = dequant_intra_ia64; |
dequant_intra = dequant_intra_ia64; |
527 |
quant_inter = quant_inter_ia64; |
quant_inter = quant_inter_ia64; |
532 |
transfer_8to16sub2 = transfer_8to16sub2_ia64; |
transfer_8to16sub2 = transfer_8to16sub2_ia64; |
533 |
transfer_16to8add = transfer_16to8add_ia64; |
transfer_16to8add = transfer_16to8add_ia64; |
534 |
transfer8x8_copy = transfer8x8_copy_ia64; |
transfer8x8_copy = transfer8x8_copy_ia64; |
535 |
DEBUG("Using IA-64 assembler routines.\n"); |
DPRINTF(DPRINTF_DEBUG, "Using IA-64 assembler routines."); |
536 |
} |
} |
537 |
#endif |
#endif |
538 |
|
|
562 |
static int |
static int |
563 |
xvid_init_convert(XVID_INIT_CONVERTINFO* convert) |
xvid_init_convert(XVID_INIT_CONVERTINFO* convert) |
564 |
{ |
{ |
565 |
// const int flip1 = (convert->input.colorspace & XVID_CSP_VFLIP) ^ (convert->output.colorspace & XVID_CSP_VFLIP); |
/* |
566 |
|
const int flip1 = |
567 |
|
(convert->input.colorspace & XVID_CSP_VFLIP) ^ |
568 |
|
(convert->output.colorspace & XVID_CSP_VFLIP); |
569 |
|
*/ |
570 |
const int width = convert->width; |
const int width = convert->width; |
571 |
const int height = convert->height; |
const int height = convert->height; |
572 |
const int width2 = convert->width/2; |
const int width2 = convert->width/2; |
652 |
#define TEST_FDCT (TEST_FORWARD) |
#define TEST_FDCT (TEST_FORWARD) |
653 |
#define TEST_IDCT (0) |
#define TEST_IDCT (0) |
654 |
|
|
655 |
int test_transform(void * funcA, void * funcB, const char * nameB, |
static int test_transform(void * funcA, void * funcB, const char * nameB, |
656 |
int test, int flags) |
int test, int flags) |
657 |
{ |
{ |
658 |
int i; |
int i; |
732 |
#define TEST_DEQUANT_INTRA (TEST_INTRA) |
#define TEST_DEQUANT_INTRA (TEST_INTRA) |
733 |
#define TEST_DEQUANT_INTER (0) |
#define TEST_DEQUANT_INTER (0) |
734 |
|
|
735 |
int test_quant(void * funcA, void * funcB, const char * nameB, |
static int test_quant(void * funcA, void * funcB, const char * nameB, |
736 |
int test, int flags) |
int test, int flags) |
737 |
{ |
{ |
738 |
int q,i; |
int q,i; |
739 |
int64_t timeSTART; |
int64_t timeSTART; |
740 |
int64_t timeA = 0; |
int64_t timeA = 0; |
741 |
int64_t timeB = 0; |
int64_t timeB = 0; |
742 |
int retA, retB; |
int retA = 0, retB = 0; |
743 |
DECLARE_ALIGNED_MATRIX(arrayX, 1, 64, int16_t, CACHE_LINE); |
DECLARE_ALIGNED_MATRIX(arrayX, 1, 64, int16_t, CACHE_LINE); |
744 |
DECLARE_ALIGNED_MATRIX(arrayA, 1, 64, int16_t, CACHE_LINE); |
DECLARE_ALIGNED_MATRIX(arrayA, 1, 64, int16_t, CACHE_LINE); |
745 |
DECLARE_ALIGNED_MATRIX(arrayB, 1, 64, int16_t, CACHE_LINE); |
DECLARE_ALIGNED_MATRIX(arrayB, 1, 64, int16_t, CACHE_LINE); |
813 |
|
|
814 |
int xvid_init_test(int flags) |
int xvid_init_test(int flags) |
815 |
{ |
{ |
816 |
|
#if defined(ARCH_IS_IA32) |
817 |
int cpu_flags; |
int cpu_flags; |
818 |
|
#endif |
819 |
|
|
820 |
srand(time(0)); |
printf("XviD tests\n\n"); |
|
|
|
|
printf("xvid_init_test\n"); |
|
821 |
|
|
822 |
#if defined(ARCH_X86) |
#if defined(ARCH_IS_IA32) |
823 |
cpu_flags = detect_cpu_flags(); |
cpu_flags = detect_cpu_flags(); |
824 |
|
#endif |
825 |
|
|
826 |
idct_int32_init(); |
idct_int32_init(); |
827 |
emms_mmx(); |
emms(); |
828 |
|
|
829 |
|
srand(time(0)); |
830 |
|
|
831 |
|
/* fDCT test */ |
832 |
printf("--- fdct ---\n"); |
printf("--- fdct ---\n"); |
833 |
test_transform(fdct_int32, fdct_int32, "c", TEST_FDCT, flags); |
test_transform(fdct_int32, fdct_int32, "c", TEST_FDCT, flags); |
834 |
|
|
835 |
|
#if defined(ARCH_IS_IA32) |
836 |
if (cpu_flags & XVID_CPU_MMX) |
if (cpu_flags & XVID_CPU_MMX) |
837 |
test_transform(fdct_int32, fdct_mmx, "mmx", TEST_FDCT, flags); |
test_transform(fdct_int32, fdct_mmx, "mmx", TEST_FDCT, flags); |
838 |
if (cpu_flags & XVID_CPU_SSE2) |
if (cpu_flags & XVID_CPU_SSE2) |
839 |
test_transform(fdct_int32, fdct_sse2, "sse2", TEST_FDCT, flags); |
test_transform(fdct_int32, fdct_sse2, "sse2", TEST_FDCT, flags); |
840 |
|
#endif |
841 |
|
|
842 |
|
/* iDCT test */ |
843 |
printf("\n--- idct ---\n"); |
printf("\n--- idct ---\n"); |
844 |
test_transform(idct_int32, idct_int32, "c", TEST_IDCT, flags); |
test_transform(idct_int32, idct_int32, "c", TEST_IDCT, flags); |
845 |
|
|
846 |
|
#if defined(ARCH_IS_IA32) |
847 |
if (cpu_flags & XVID_CPU_MMX) |
if (cpu_flags & XVID_CPU_MMX) |
848 |
test_transform(idct_int32, idct_mmx, "mmx", TEST_IDCT, flags); |
test_transform(idct_int32, idct_mmx, "mmx", TEST_IDCT, flags); |
849 |
if (cpu_flags & XVID_CPU_MMXEXT) |
if (cpu_flags & XVID_CPU_MMXEXT) |
852 |
test_transform(idct_int32, idct_3dne, "3dne", TEST_IDCT, flags); |
test_transform(idct_int32, idct_3dne, "3dne", TEST_IDCT, flags); |
853 |
if (cpu_flags & XVID_CPU_SSE2) |
if (cpu_flags & XVID_CPU_SSE2) |
854 |
test_transform(idct_int32, idct_sse2, "sse2", TEST_IDCT, flags); |
test_transform(idct_int32, idct_sse2, "sse2", TEST_IDCT, flags); |
855 |
|
#endif |
856 |
|
|
857 |
|
/* Intra quantization test */ |
858 |
printf("\n--- quant intra ---\n"); |
printf("\n--- quant intra ---\n"); |
859 |
test_quant(quant_intra_c, quant_intra_c, "c", TEST_QUANT_INTRA, flags); |
test_quant(quant_intra_c, quant_intra_c, "c", TEST_QUANT_INTRA, flags); |
860 |
|
|
861 |
|
#if defined(ARCH_IS_IA32) |
862 |
if (cpu_flags & XVID_CPU_MMX) |
if (cpu_flags & XVID_CPU_MMX) |
863 |
test_quant(quant_intra_c, quant_intra_mmx, "mmx", TEST_QUANT_INTRA, flags); |
test_quant(quant_intra_c, quant_intra_mmx, "mmx", TEST_QUANT_INTRA, flags); |
864 |
if (cpu_flags & XVID_CPU_3DNOWEXT) |
if (cpu_flags & XVID_CPU_3DNOWEXT) |
865 |
test_quant(quant_intra_c, quant_intra_3dne, "3dne", TEST_QUANT_INTRA, flags); |
test_quant(quant_intra_c, quant_intra_3dne, "3dne", TEST_QUANT_INTRA, flags); |
866 |
if (cpu_flags & XVID_CPU_SSE2) |
if (cpu_flags & XVID_CPU_SSE2) |
867 |
test_quant(quant_intra_c, quant_intra_sse2, "sse2", TEST_QUANT_INTRA, flags); |
test_quant(quant_intra_c, quant_intra_sse2, "sse2", TEST_QUANT_INTRA, flags); |
868 |
|
#endif |
869 |
|
|
870 |
|
/* Inter quantization test */ |
871 |
printf("\n--- quant inter ---\n"); |
printf("\n--- quant inter ---\n"); |
872 |
test_quant(quant_inter_c, quant_inter_c, "c", TEST_QUANT_INTER, flags); |
test_quant(quant_inter_c, quant_inter_c, "c", TEST_QUANT_INTER, flags); |
873 |
|
|
874 |
|
#if defined(ARCH_IS_IA32) |
875 |
if (cpu_flags & XVID_CPU_MMX) |
if (cpu_flags & XVID_CPU_MMX) |
876 |
test_quant(quant_inter_c, quant_inter_mmx, "mmx", TEST_QUANT_INTER, flags); |
test_quant(quant_inter_c, quant_inter_mmx, "mmx", TEST_QUANT_INTER, flags); |
877 |
if (cpu_flags & XVID_CPU_3DNOWEXT) |
if (cpu_flags & XVID_CPU_3DNOWEXT) |
878 |
test_quant(quant_inter_c, quant_inter_3dne, "3dne", TEST_QUANT_INTER, flags); |
test_quant(quant_inter_c, quant_inter_3dne, "3dne", TEST_QUANT_INTER, flags); |
879 |
if (cpu_flags & XVID_CPU_SSE2) |
if (cpu_flags & XVID_CPU_SSE2) |
880 |
test_quant(quant_inter_c, quant_inter_sse2, "sse2", TEST_QUANT_INTER, flags); |
test_quant(quant_inter_c, quant_inter_sse2, "sse2", TEST_QUANT_INTER, flags); |
881 |
|
#endif |
882 |
|
|
883 |
|
/* Intra dequantization test */ |
884 |
printf("\n--- dequant intra ---\n"); |
printf("\n--- dequant intra ---\n"); |
885 |
test_quant(dequant_intra_c, dequant_intra_c, "c", TEST_DEQUANT_INTRA, flags); |
test_quant(dequant_intra_c, dequant_intra_c, "c", TEST_DEQUANT_INTRA, flags); |
886 |
|
|
887 |
|
#if defined(ARCH_IS_IA32) |
888 |
if (cpu_flags & XVID_CPU_MMX) |
if (cpu_flags & XVID_CPU_MMX) |
889 |
test_quant(dequant_intra_c, dequant_intra_mmx, "mmx", TEST_DEQUANT_INTRA, flags); |
test_quant(dequant_intra_c, dequant_intra_mmx, "mmx", TEST_DEQUANT_INTRA, flags); |
890 |
if (cpu_flags & XVID_CPU_MMXEXT) |
if (cpu_flags & XVID_CPU_MMXEXT) |
893 |
test_quant(dequant_intra_c, dequant_intra_3dne, "3dne", TEST_DEQUANT_INTRA, flags); |
test_quant(dequant_intra_c, dequant_intra_3dne, "3dne", TEST_DEQUANT_INTRA, flags); |
894 |
if (cpu_flags & XVID_CPU_SSE2) |
if (cpu_flags & XVID_CPU_SSE2) |
895 |
test_quant(dequant_intra_c, dequant_intra_sse2, "sse2", TEST_DEQUANT_INTRA, flags); |
test_quant(dequant_intra_c, dequant_intra_sse2, "sse2", TEST_DEQUANT_INTRA, flags); |
896 |
|
#endif |
897 |
|
|
898 |
|
/* Inter dequantization test */ |
899 |
printf("\n--- dequant inter ---\n"); |
printf("\n--- dequant inter ---\n"); |
900 |
test_quant(dequant_inter_c, dequant_inter_c, "c", TEST_DEQUANT_INTER, flags); |
test_quant(dequant_inter_c, dequant_inter_c, "c", TEST_DEQUANT_INTER, flags); |
901 |
|
|
902 |
|
#if defined(ARCH_IS_IA32) |
903 |
if (cpu_flags & XVID_CPU_MMX) |
if (cpu_flags & XVID_CPU_MMX) |
904 |
test_quant(dequant_inter_c, dequant_inter_mmx, "mmx", TEST_DEQUANT_INTER, flags); |
test_quant(dequant_inter_c, dequant_inter_mmx, "mmx", TEST_DEQUANT_INTER, flags); |
905 |
if (cpu_flags & XVID_CPU_MMXEXT) |
if (cpu_flags & XVID_CPU_MMXEXT) |
908 |
test_quant(dequant_inter_c, dequant_inter_3dne, "3dne", TEST_DEQUANT_INTER, flags); |
test_quant(dequant_inter_c, dequant_inter_3dne, "3dne", TEST_DEQUANT_INTER, flags); |
909 |
if (cpu_flags & XVID_CPU_SSE2) |
if (cpu_flags & XVID_CPU_SSE2) |
910 |
test_quant(dequant_inter_c, dequant_inter_sse2, "sse2", TEST_DEQUANT_INTER, flags); |
test_quant(dequant_inter_c, dequant_inter_sse2, "sse2", TEST_DEQUANT_INTER, flags); |
911 |
|
#endif |
912 |
|
|
913 |
printf("\n--- quant4_intra ---\n"); |
/* Intra quantization test */ |
914 |
|
printf("\n--- quant4 intra ---\n"); |
915 |
test_quant(quant4_intra_c, quant4_intra_c, "c", TEST_QUANT_INTRA, flags); |
test_quant(quant4_intra_c, quant4_intra_c, "c", TEST_QUANT_INTRA, flags); |
916 |
|
|
917 |
|
#if defined(ARCH_IS_IA32) |
918 |
if (cpu_flags & XVID_CPU_MMX) |
if (cpu_flags & XVID_CPU_MMX) |
919 |
test_quant(quant4_intra_c, quant4_intra_mmx, "mmx", TEST_QUANT_INTRA, flags); |
test_quant(quant4_intra_c, quant4_intra_mmx, "mmx", TEST_QUANT_INTRA, flags); |
920 |
if (cpu_flags & XVID_CPU_MMXEXT) |
if (cpu_flags & XVID_CPU_MMXEXT) |
921 |
test_quant(quant4_intra_c, quant4_intra_xmm, "xmm", TEST_QUANT_INTRA, flags); |
test_quant(quant4_intra_c, quant4_intra_xmm, "xmm", TEST_QUANT_INTRA, flags); |
922 |
|
#endif |
923 |
|
|
924 |
printf("\n--- quant4_inter ---\n"); |
/* Inter quantization test */ |
925 |
|
printf("\n--- quant4 inter ---\n"); |
926 |
test_quant(quant4_inter_c, quant4_inter_c, "c", TEST_QUANT_INTER, flags); |
test_quant(quant4_inter_c, quant4_inter_c, "c", TEST_QUANT_INTER, flags); |
927 |
|
|
928 |
|
#if defined(ARCH_IS_IA32) |
929 |
if (cpu_flags & XVID_CPU_MMX) |
if (cpu_flags & XVID_CPU_MMX) |
930 |
test_quant(quant4_inter_c, quant4_inter_mmx, "mmx", TEST_QUANT_INTER, flags); |
test_quant(quant4_inter_c, quant4_inter_mmx, "mmx", TEST_QUANT_INTER, flags); |
931 |
if (cpu_flags & XVID_CPU_MMXEXT) |
if (cpu_flags & XVID_CPU_MMXEXT) |
932 |
test_quant(quant4_inter_c, quant4_inter_xmm, "xmm", TEST_QUANT_INTER, flags); |
test_quant(quant4_inter_c, quant4_inter_xmm, "xmm", TEST_QUANT_INTER, flags); |
933 |
|
#endif |
934 |
|
|
935 |
printf("\n--- dequant4_intra ---\n"); |
/* Intra dequantization test */ |
936 |
|
printf("\n--- dequant4 intra ---\n"); |
937 |
test_quant(dequant4_intra_c, dequant4_intra_c, "c", TEST_DEQUANT_INTRA, flags); |
test_quant(dequant4_intra_c, dequant4_intra_c, "c", TEST_DEQUANT_INTRA, flags); |
938 |
|
|
939 |
|
#if defined(ARCH_IS_IA32) |
940 |
if (cpu_flags & XVID_CPU_MMX) |
if (cpu_flags & XVID_CPU_MMX) |
941 |
test_quant(dequant4_intra_c, dequant4_intra_mmx, "mmx", TEST_DEQUANT_INTRA, flags); |
test_quant(dequant4_intra_c, dequant4_intra_mmx, "mmx", TEST_DEQUANT_INTRA, flags); |
942 |
if (cpu_flags & XVID_CPU_3DNOWEXT) |
if (cpu_flags & XVID_CPU_3DNOWEXT) |
943 |
test_quant(dequant4_intra_c, dequant4_intra_3dne, "3dne", TEST_DEQUANT_INTRA, flags); |
test_quant(dequant4_intra_c, dequant4_intra_3dne, "3dne", TEST_DEQUANT_INTRA, flags); |
944 |
|
#endif |
945 |
|
|
946 |
printf("\n--- dequant4_inter ---\n"); |
/* Inter dequantization test */ |
947 |
|
printf("\n--- dequant4 inter ---\n"); |
948 |
test_quant(dequant4_inter_c, dequant4_inter_c, "c", TEST_DEQUANT_INTER, flags); |
test_quant(dequant4_inter_c, dequant4_inter_c, "c", TEST_DEQUANT_INTER, flags); |
949 |
|
|
950 |
|
#if defined(ARCH_IS_IA32) |
951 |
if (cpu_flags & XVID_CPU_MMX) |
if (cpu_flags & XVID_CPU_MMX) |
952 |
test_quant(dequant4_inter_c, dequant4_inter_mmx, "mmx", TEST_DEQUANT_INTER, flags); |
test_quant(dequant4_inter_c, dequant4_inter_mmx, "mmx", TEST_DEQUANT_INTER, flags); |
953 |
if (cpu_flags & XVID_CPU_3DNOWEXT) |
if (cpu_flags & XVID_CPU_3DNOWEXT) |
954 |
test_quant(dequant4_inter_c, dequant4_inter_3dne, "3dne", TEST_DEQUANT_INTER, flags); |
test_quant(dequant4_inter_c, dequant4_inter_3dne, "3dne", TEST_DEQUANT_INTER, flags); |
|
|
|
|
emms_mmx(); |
|
|
|
|
955 |
#endif |
#endif |
956 |
|
|
957 |
|
emms(); |
958 |
|
|
959 |
return XVID_ERR_OK; |
return XVID_ERR_OK; |
960 |
} |
} |
961 |
|
|
975 |
return xvid_init_convert((XVID_INIT_CONVERTINFO*)param1); |
return xvid_init_convert((XVID_INIT_CONVERTINFO*)param1); |
976 |
|
|
977 |
case XVID_INIT_TEST : |
case XVID_INIT_TEST : |
978 |
return xvid_init_test((int)param1); |
{ |
979 |
|
ptr_t flags = (ptr_t)param1; |
980 |
|
return xvid_init_test((int)flags); |
981 |
|
} |
982 |
default : |
default : |
983 |
return XVID_ERR_FAIL; |
return XVID_ERR_FAIL; |
984 |
} |
} |
1036 |
case XVID_ENC_ENCODE: |
case XVID_ENC_ENCODE: |
1037 |
|
|
1038 |
if (((Encoder *) handle)->mbParam.max_bframes >= 0) |
if (((Encoder *) handle)->mbParam.max_bframes >= 0) |
1039 |
return encoder_encode_bframes((Encoder *) handle, (XVID_ENC_FRAME *) param1, |
return encoder_encode_bframes((Encoder *) handle, |
1040 |
|
(XVID_ENC_FRAME *) param1, |
1041 |
(XVID_ENC_STATS *) param2); |
(XVID_ENC_STATS *) param2); |
1042 |
else |
else |
1043 |
return encoder_encode((Encoder *) handle, (XVID_ENC_FRAME *) param1, |
return encoder_encode((Encoder *) handle, |
1044 |
|
(XVID_ENC_FRAME *) param1, |
1045 |
(XVID_ENC_STATS *) param2); |
(XVID_ENC_STATS *) param2); |
1046 |
|
|
1047 |
case XVID_ENC_CREATE: |
case XVID_ENC_CREATE: |