--- xvid.c 2002/11/20 19:52:32 1.33.2.14 +++ xvid.c 2002/12/19 00:37:56 1.33.2.18 @@ -37,7 +37,7 @@ * - 22.12.2001 API change: added xvid_init() - Isibaar * - 16.12.2001 inital version; (c)2001 peter ross * - * $Id: xvid.c,v 1.33.2.14 2002/11/20 19:52:32 Isibaar Exp $ + * $Id: xvid.c,v 1.33.2.18 2002/12/19 00:37:56 Isibaar Exp $ * ****************************************************************************/ @@ -49,6 +49,7 @@ #include "dct/fdct.h" #include "image/colorspace.h" #include "image/interpolate8x8.h" +#include "image/reduced.h" #include "utils/mem_transfer.h" #include "utils/mbfunctions.h" #include "quant/quant_h263.h" @@ -234,6 +235,20 @@ interpolate8x8_avg2 = interpolate8x8_avg2_c; interpolate8x8_avg4 = interpolate8x8_avg4_c; + /* reduced resoltuion */ + + copy_upsampled_8x8_16to8 = xvid_Copy_Upsampled_8x8_16To8_C; + add_upsampled_8x8_16to8 = xvid_Add_Upsampled_8x8_16To8_C; +#ifdef ARCH_X86 + vfilter_31 = xvid_VFilter_31_x86; + hfilter_31 = xvid_HFilter_31_x86; +#else + vfilter_31 = xvid_VFilter_31_C; + hfilter_31 = xvid_HFilter_31_C; +#endif + filter_18x18_to_8x8 = xvid_Filter_18x18_To_8x8_C; + filter_diff_18x18_to_8x8 = xvid_Filter_Diff_18x18_To_8x8_C; + /* Initialize internal colorspace transformation tables */ colorspace_init(); @@ -337,6 +352,13 @@ interpolate8x8_avg2 = interpolate8x8_avg2_mmx; interpolate8x8_avg4 = interpolate8x8_avg4_mmx; + /* reduced resolution */ + copy_upsampled_8x8_16to8 = xvid_Copy_Upsampled_8x8_16To8_mmx; + add_upsampled_8x8_16to8 = xvid_Add_Upsampled_8x8_16To8_mmx; + hfilter_31 = xvid_HFilter_31_mmx; + filter_18x18_to_8x8 = xvid_Filter_18x18_To_8x8_mmx; + filter_diff_18x18_to_8x8 = xvid_Filter_Diff_18x18_To_8x8_mmx; + /* image input xxx_to_yv12 related functions */ yv12_to_yv12 = yv12_to_yv12_mmx; bgr_to_yv12 = bgr_to_yv12_mmx; @@ -386,7 +408,14 @@ interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_xmm; interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_xmm; + /* reduced resolution */ + copy_upsampled_8x8_16to8 = xvid_Copy_Upsampled_8x8_16To8_xmm; + add_upsampled_8x8_16to8 = xvid_Add_Upsampled_8x8_16To8_xmm; + /* Quantization */ + quant4_intra = quant4_intra_xmm; + quant4_inter = quant4_inter_xmm; + dequant_intra = dequant_intra_xmm; dequant_inter = dequant_inter_xmm; @@ -415,6 +444,42 @@ interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dn; } + if ((cpu_flags & XVID_CPU_3DNOWEXT) > 0) { + + /* Inverse DCT */ + idct = idct_3dne; + + /* Buffer transfer */ + transfer_8to16copy = transfer_8to16copy_3dne; + transfer_16to8copy = transfer_16to8copy_3dne; + transfer_8to16sub = transfer_8to16sub_3dne; + transfer_8to16sub2 = transfer_8to16sub2_3dne; + transfer_16to8add = transfer_16to8add_3dne; + transfer8x8_copy = transfer8x8_copy_3dne; + + /* Quantization */ + dequant4_intra = dequant4_intra_3dne; + dequant4_inter = dequant4_inter_3dne; + quant_intra = quant_intra_3dne; + quant_inter = quant_inter_3dne; + dequant_intra = dequant_intra_3dne; + dequant_inter = dequant_inter_3dne; + + /* ME functions */ + calc_cbp = calc_cbp_3dne; + sad16 = sad16_3dne; + sad8 = sad8_3dne; + sad16bi = sad16bi_3dne; + sad8bi = sad8bi_3dne; + dev16 = dev16_3dne; + + /* Interpolation */ + interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_3dne; + interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_3dne; + interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dne; + } + + if ((cpu_flags & XVID_CPU_SSE2) > 0) { #ifdef EXPERIMENTAL_SSE2_CODE @@ -487,7 +552,7 @@ static int xvid_init_convert(XVID_INIT_CONVERTINFO* convert) { - const int flip1 = (convert->input.colorspace & XVID_CSP_VFLIP) ^ (convert->output.colorspace & XVID_CSP_VFLIP); + // const int flip1 = (convert->input.colorspace & XVID_CSP_VFLIP) ^ (convert->output.colorspace & XVID_CSP_VFLIP); const int width = convert->width; const int height = convert->height; const int width2 = convert->width/2;