--- xvid.c 2003/11/30 16:13:15 1.45.2.22 +++ xvid.c 2004/04/14 19:51:06 1.48.2.3 @@ -19,7 +19,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: xvid.c,v 1.45.2.22 2003/11/30 16:13:15 edgomez Exp $ + * $Id: xvid.c,v 1.48.2.3 2004/04/14 19:51:06 edgomez Exp $ * ****************************************************************************/ @@ -46,6 +46,7 @@ #include "utils/timer.h" #include "bitstream/mbcoding.h" #include "image/qpel.h" +#include "image/postprocessing.h" #if defined(_DEBUG) unsigned int xvid_debug = 0; /* xvid debug mask */ @@ -247,6 +248,7 @@ bgra_to_yv12 = bgra_to_yv12_c; abgr_to_yv12 = abgr_to_yv12_c; rgba_to_yv12 = rgba_to_yv12_c; + argb_to_yv12 = argb_to_yv12_c; yuyv_to_yv12 = yuyv_to_yv12_c; uyvy_to_yv12 = uyvy_to_yv12_c; @@ -256,10 +258,10 @@ bgrai_to_yv12 = bgrai_to_yv12_c; abgri_to_yv12 = abgri_to_yv12_c; rgbai_to_yv12 = rgbai_to_yv12_c; + argbi_to_yv12 = argbi_to_yv12_c; yuyvi_to_yv12 = yuyvi_to_yv12_c; uyvyi_to_yv12 = uyvyi_to_yv12_c; - /* All colorspace transformation functions YV12->User format */ yv12_to_rgb555 = yv12_to_rgb555_c; yv12_to_rgb565 = yv12_to_rgb565_c; @@ -267,6 +269,7 @@ yv12_to_bgra = yv12_to_bgra_c; yv12_to_abgr = yv12_to_abgr_c; yv12_to_rgba = yv12_to_rgba_c; + yv12_to_argb = yv12_to_argb_c; yv12_to_yuyv = yv12_to_yuyv_c; yv12_to_uyvy = yv12_to_uyvy_c; @@ -276,6 +279,7 @@ yv12_to_bgrai = yv12_to_bgrai_c; yv12_to_abgri = yv12_to_abgri_c; yv12_to_rgbai = yv12_to_rgbai_c; + yv12_to_argbi = yv12_to_argbi_c; yv12_to_yuyvi = yv12_to_yuyvi_c; yv12_to_uyvyi = yv12_to_uyvyi_c; @@ -445,42 +449,45 @@ if ((cpu_flags & XVID_CPU_3DNOWEXT)) { - /* Inverse DCT */ - idct = idct_3dne; - /* Buffer transfer */ transfer_8to16copy = transfer_8to16copy_3dne; transfer_16to8copy = transfer_16to8copy_3dne; transfer_8to16sub = transfer_8to16sub_3dne; transfer_8to16subro = transfer_8to16subro_3dne; - transfer_8to16sub2 = transfer_8to16sub2_3dne; transfer_16to8add = transfer_16to8add_3dne; transfer8x8_copy = transfer8x8_copy_3dne; - /* Quantization */ - quant_h263_intra = quant_h263_intra_3dne; - quant_h263_inter = quant_h263_inter_3dne; - dequant_mpeg_intra = dequant_mpeg_intra_3dne; - dequant_mpeg_inter = dequant_mpeg_inter_3dne; - dequant_h263_intra = dequant_h263_intra_3dne; - dequant_h263_inter = dequant_h263_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_MMXEXT)) { + /* Inverse DCT */ + idct = idct_3dne; + + /* Buffer transfer */ + transfer_8to16sub2 = transfer_8to16sub2_3dne; + + /* Interpolation */ + interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_3dne; + interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_3dne; + interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_3dne; + + /* Quantization */ + quant_h263_intra = quant_h263_intra_3dne; /* cmov only */ + quant_h263_inter = quant_h263_inter_3dne; + dequant_mpeg_intra = dequant_mpeg_intra_3dne; /* cmov only */ + dequant_mpeg_inter = dequant_mpeg_inter_3dne; + dequant_h263_intra = dequant_h263_intra_3dne; + dequant_h263_inter = dequant_h263_inter_3dne; + + /* ME functions */ + calc_cbp = calc_cbp_3dne; + + sad16 = sad16_3dne; + sad8 = sad8_3dne; + sad16bi = sad16bi_3dne; + sad8bi = sad8bi_3dne; + dev16 = dev16_3dne; + } } -#if defined(EXPERIMENTAL_SSE2_CODE) /* mark the whole SSE2 stuff as experimental. At least on - my P4, it crashes... */ if ((cpu_flags & XVID_CPU_SSE2)) { calc_cbp = calc_cbp_sse2; @@ -495,12 +502,11 @@ sad16 = sad16_sse2; dev16 = dev16_sse2; - /* DCT operators */ + /* DCT operators + * no iDCT because it's not "Walken matching" */ fdct = fdct_sse2_skal; - idct = idct_sse2_dmitry; } -#endif -#endif +#endif /* ARCH_IS_IA32 */ #if defined(ARCH_IS_IA64) if ((cpu_flags & XVID_CPU_ASM)) { /* use assembler routines? */