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> |
* Copyright(C) 2001-2004 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 |
46 |
#include "utils/timer.h" |
#include "utils/timer.h" |
47 |
#include "bitstream/mbcoding.h" |
#include "bitstream/mbcoding.h" |
48 |
#include "image/qpel.h" |
#include "image/qpel.h" |
49 |
|
#include "image/postprocessing.h" |
50 |
|
|
51 |
#if defined(_DEBUG) |
#if defined(_DEBUG) |
52 |
unsigned int xvid_debug = 0; /* xvid debug mask */ |
unsigned int xvid_debug = 0; /* xvid debug mask */ |
229 |
interpolate8x8_avg2 = interpolate8x8_avg2_c; |
interpolate8x8_avg2 = interpolate8x8_avg2_c; |
230 |
interpolate8x8_avg4 = interpolate8x8_avg4_c; |
interpolate8x8_avg4 = interpolate8x8_avg4_c; |
231 |
|
|
232 |
|
/* postprocessing */ |
233 |
|
image_brightness = image_brightness_c; |
234 |
|
|
235 |
/* reduced resolution */ |
/* reduced resolution */ |
236 |
copy_upsampled_8x8_16to8 = xvid_Copy_Upsampled_8x8_16To8_C; |
copy_upsampled_8x8_16to8 = xvid_Copy_Upsampled_8x8_16To8_C; |
237 |
add_upsampled_8x8_16to8 = xvid_Add_Upsampled_8x8_16To8_C; |
add_upsampled_8x8_16to8 = xvid_Add_Upsampled_8x8_16To8_C; |
251 |
bgra_to_yv12 = bgra_to_yv12_c; |
bgra_to_yv12 = bgra_to_yv12_c; |
252 |
abgr_to_yv12 = abgr_to_yv12_c; |
abgr_to_yv12 = abgr_to_yv12_c; |
253 |
rgba_to_yv12 = rgba_to_yv12_c; |
rgba_to_yv12 = rgba_to_yv12_c; |
254 |
|
argb_to_yv12 = argb_to_yv12_c; |
255 |
yuyv_to_yv12 = yuyv_to_yv12_c; |
yuyv_to_yv12 = yuyv_to_yv12_c; |
256 |
uyvy_to_yv12 = uyvy_to_yv12_c; |
uyvy_to_yv12 = uyvy_to_yv12_c; |
257 |
|
|
261 |
bgrai_to_yv12 = bgrai_to_yv12_c; |
bgrai_to_yv12 = bgrai_to_yv12_c; |
262 |
abgri_to_yv12 = abgri_to_yv12_c; |
abgri_to_yv12 = abgri_to_yv12_c; |
263 |
rgbai_to_yv12 = rgbai_to_yv12_c; |
rgbai_to_yv12 = rgbai_to_yv12_c; |
264 |
|
argbi_to_yv12 = argbi_to_yv12_c; |
265 |
yuyvi_to_yv12 = yuyvi_to_yv12_c; |
yuyvi_to_yv12 = yuyvi_to_yv12_c; |
266 |
uyvyi_to_yv12 = uyvyi_to_yv12_c; |
uyvyi_to_yv12 = uyvyi_to_yv12_c; |
267 |
|
|
|
|
|
268 |
/* All colorspace transformation functions YV12->User format */ |
/* All colorspace transformation functions YV12->User format */ |
269 |
yv12_to_rgb555 = yv12_to_rgb555_c; |
yv12_to_rgb555 = yv12_to_rgb555_c; |
270 |
yv12_to_rgb565 = yv12_to_rgb565_c; |
yv12_to_rgb565 = yv12_to_rgb565_c; |
272 |
yv12_to_bgra = yv12_to_bgra_c; |
yv12_to_bgra = yv12_to_bgra_c; |
273 |
yv12_to_abgr = yv12_to_abgr_c; |
yv12_to_abgr = yv12_to_abgr_c; |
274 |
yv12_to_rgba = yv12_to_rgba_c; |
yv12_to_rgba = yv12_to_rgba_c; |
275 |
|
yv12_to_argb = yv12_to_argb_c; |
276 |
yv12_to_yuyv = yv12_to_yuyv_c; |
yv12_to_yuyv = yv12_to_yuyv_c; |
277 |
yv12_to_uyvy = yv12_to_uyvy_c; |
yv12_to_uyvy = yv12_to_uyvy_c; |
278 |
|
|
282 |
yv12_to_bgrai = yv12_to_bgrai_c; |
yv12_to_bgrai = yv12_to_bgrai_c; |
283 |
yv12_to_abgri = yv12_to_abgri_c; |
yv12_to_abgri = yv12_to_abgri_c; |
284 |
yv12_to_rgbai = yv12_to_rgbai_c; |
yv12_to_rgbai = yv12_to_rgbai_c; |
285 |
|
yv12_to_argbi = yv12_to_argbi_c; |
286 |
yv12_to_yuyvi = yv12_to_yuyvi_c; |
yv12_to_yuyvi = yv12_to_yuyvi_c; |
287 |
yv12_to_uyvyi = yv12_to_uyvyi_c; |
yv12_to_uyvyi = yv12_to_uyvyi_c; |
288 |
|
|
296 |
sad16v = sad16v_c; |
sad16v = sad16v_c; |
297 |
sse8_16bit = sse8_16bit_c; |
sse8_16bit = sse8_16bit_c; |
298 |
|
|
|
/* Halfpel8_Refine = Halfpel8_Refine_c; */ |
|
|
|
|
299 |
#if defined(ARCH_IS_IA32) |
#if defined(ARCH_IS_IA32) |
300 |
|
|
301 |
if ((cpu_flags & XVID_CPU_ASM)) { |
if ((cpu_flags & XVID_CPU_ASM)) { |
355 |
interpolate8x8_avg2 = interpolate8x8_avg2_mmx; |
interpolate8x8_avg2 = interpolate8x8_avg2_mmx; |
356 |
interpolate8x8_avg4 = interpolate8x8_avg4_mmx; |
interpolate8x8_avg4 = interpolate8x8_avg4_mmx; |
357 |
|
|
358 |
|
/* postprocessing */ |
359 |
|
image_brightness = image_brightness_mmx; |
360 |
|
|
361 |
/* reduced resolution */ |
/* reduced resolution */ |
362 |
copy_upsampled_8x8_16to8 = xvid_Copy_Upsampled_8x8_16To8_mmx; |
copy_upsampled_8x8_16to8 = xvid_Copy_Upsampled_8x8_16To8_mmx; |
363 |
add_upsampled_8x8_16to8 = xvid_Add_Upsampled_8x8_16To8_mmx; |
add_upsampled_8x8_16to8 = xvid_Add_Upsampled_8x8_16To8_mmx; |
489 |
interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dne; |
interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dne; |
490 |
} |
} |
491 |
|
|
|
#if defined(EXPERIMENTAL_SSE2_CODE) /* mark the whole SSE2 stuff as experimental. At least on |
|
|
my P4, it crashes... */ |
|
492 |
if ((cpu_flags & XVID_CPU_SSE2)) { |
if ((cpu_flags & XVID_CPU_SSE2)) { |
493 |
|
|
494 |
calc_cbp = calc_cbp_sse2; |
calc_cbp = calc_cbp_sse2; |
503 |
sad16 = sad16_sse2; |
sad16 = sad16_sse2; |
504 |
dev16 = dev16_sse2; |
dev16 = dev16_sse2; |
505 |
|
|
506 |
/* DCT operators */ |
/* DCT operators |
507 |
|
* no iDCT because it's not "Walken matching" */ |
508 |
fdct = fdct_sse2_skal; |
fdct = fdct_sse2_skal; |
|
idct = idct_sse2_dmitry; |
|
509 |
} |
} |
510 |
#endif |
#endif /* ARCH_IS_IA32 */ |
|
#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? */ |