3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* - Native API implementation - |
* - Native API implementation - |
5 |
* |
* |
6 |
|
* Copyright(C) 2001-2003 Peter Ross <pross@xvid.org> |
7 |
|
* |
8 |
* This program is free software ; you can redistribute it and/or modify |
* This program is free software ; you can redistribute it and/or modify |
9 |
* 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 |
10 |
* the Free Software Foundation ; either version 2 of the License, or |
* the Free Software Foundation ; either version 2 of the License, or |
19 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: xvid.c,v 1.45.2.1 2003-02-22 08:49:44 suxen_drol Exp $ |
* $Id: xvid.c,v 1.45.2.8 2003-06-11 14:10:40 Isibaar Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
47 |
#include "utils/timer.h" |
#include "utils/timer.h" |
48 |
#include "bitstream/mbcoding.h" |
#include "bitstream/mbcoding.h" |
49 |
|
|
50 |
|
#if defined(_DEBUG) |
51 |
|
unsigned int xvid_debug = 0; /* xvid debug mask */ |
52 |
|
#endif |
53 |
|
|
54 |
#if defined(ARCH_IS_IA32) |
#if defined(ARCH_IS_IA32) |
55 |
|
|
56 |
#if defined(_MSC_VER) |
#if defined(_MSC_VER) |
288 |
|
|
289 |
#if defined(ARCH_IS_IA32) |
#if defined(ARCH_IS_IA32) |
290 |
|
|
291 |
if ((cpu_flags & XVID_CPU_ASM)) |
if ((cpu_flags & XVID_CPU_ASM)) { |
|
{ |
|
292 |
vfilter_31 = xvid_VFilter_31_x86; |
vfilter_31 = xvid_VFilter_31_x86; |
293 |
hfilter_31 = xvid_HFilter_31_x86; |
hfilter_31 = xvid_HFilter_31_x86; |
294 |
} |
} |
487 |
dev16 = dev16_sse2; |
dev16 = dev16_sse2; |
488 |
#endif |
#endif |
489 |
/* Forward and Inverse DCT */ |
/* Forward and Inverse DCT */ |
490 |
|
#if 0 /* Both function are known to be unprecise, better keep them deactivated */ |
491 |
idct = idct_sse2; |
idct = idct_sse2; |
492 |
fdct = fdct_sse2; |
fdct = fdct_sse2; |
493 |
|
#endif |
494 |
} |
} |
495 |
#endif |
#endif |
496 |
|
|
539 |
} |
} |
540 |
#endif |
#endif |
541 |
|
|
542 |
|
#if defined(_DEBUG) |
543 |
|
xvid_debug = init->debug; |
544 |
|
#endif |
545 |
|
|
546 |
return 0; |
return 0; |
547 |
} |
} |
548 |
|
|
579 |
if (XVID_MAJOR(convert->version) != 1) /* v1.x.x */ |
if (XVID_MAJOR(convert->version) != 1) /* v1.x.x */ |
580 |
return XVID_ERR_VERSION; |
return XVID_ERR_VERSION; |
581 |
|
|
582 |
// const int flip1 = (convert->input.colorspace & XVID_CSP_VFLIP) ^ (convert->output.colorspace & XVID_CSP_VFLIP); |
#if 0 |
583 |
|
const int flip1 = (convert->input.colorspace & XVID_CSP_VFLIP) ^ (convert->output.colorspace & XVID_CSP_VFLIP); |
584 |
|
#endif |
585 |
width = convert->width; |
width = convert->width; |
586 |
height = convert->height; |
height = convert->height; |
587 |
width2 = convert->width/2; |
width2 = convert->width/2; |
653 |
{ |
{ |
654 |
int i, diff = 0; |
int i, diff = 0; |
655 |
for (i = 0; i < size; i++) |
for (i = 0; i < size; i++) |
656 |
diff += ABS(blockA[i]-blockB[i]); |
diff += abs(blockA[i]-blockB[i]); |
657 |
return diff; |
return diff; |
658 |
} |
} |
659 |
|
|
1068 |
(xvid_enc_stats_t *) param2); |
(xvid_enc_stats_t *) param2); |
1069 |
|
|
1070 |
case XVID_ENC_CREATE: |
case XVID_ENC_CREATE: |
1071 |
return enc_create((xvid_enc_create_t *) param1, (xvid_enc_rc_t*)param2); |
return enc_create((xvid_enc_create_t *) param1); |
1072 |
|
|
1073 |
case XVID_ENC_DESTROY: |
case XVID_ENC_DESTROY: |
1074 |
return enc_destroy((Encoder *) handle); |
return enc_destroy((Encoder *) handle); |