Beispiel #1
0
void oc_enc_vtable_init_x86(oc_enc_ctx *_enc){
  ogg_uint32_t cpu_flags;
  cpu_flags=oc_cpu_flags_get();
  oc_enc_vtable_init_c(_enc);
  if(cpu_flags&OC_CPU_X86_MMX){
    _enc->opt_vtable.frag_sub=oc_enc_frag_sub_mmx;
    _enc->opt_vtable.frag_sub_128=oc_enc_frag_sub_128_mmx;
    _enc->opt_vtable.frag_recon_intra=oc_frag_recon_intra_mmx;
    _enc->opt_vtable.frag_recon_inter=oc_frag_recon_inter_mmx;
    _enc->opt_vtable.fdct8x8=oc_enc_fdct8x8_mmx;
  }
  if(cpu_flags&OC_CPU_X86_MMXEXT){
    _enc->opt_vtable.frag_sad=oc_enc_frag_sad_mmxext;
    _enc->opt_vtable.frag_sad_thresh=oc_enc_frag_sad_thresh_mmxext;
    _enc->opt_vtable.frag_sad2_thresh=oc_enc_frag_sad2_thresh_mmxext;
    _enc->opt_vtable.frag_satd_thresh=oc_enc_frag_satd_thresh_mmxext;
    _enc->opt_vtable.frag_satd2_thresh=oc_enc_frag_satd2_thresh_mmxext;
    _enc->opt_vtable.frag_intra_satd=oc_enc_frag_intra_satd_mmxext;
    _enc->opt_vtable.frag_copy2=oc_enc_frag_copy2_mmxext;
  }
  if(cpu_flags&OC_CPU_X86_SSE2){
# if defined(OC_X86_64_ASM)
    _enc->opt_vtable.fdct8x8=oc_enc_fdct8x8_x86_64sse2;
# endif
  }
}
Beispiel #2
0
void oc_state_accel_init_x86(oc_theora_state *_state){
  oc_state_accel_init_c(_state);
  _state->cpu_flags=oc_cpu_flags_get();
# if defined(OC_STATE_USE_VTABLE)
  if(_state->cpu_flags&OC_CPU_X86_MMX){
    _state->opt_vtable.frag_copy=oc_frag_copy_mmx;
    _state->opt_vtable.frag_copy_list=oc_frag_copy_list_mmx;
    _state->opt_vtable.frag_recon_intra=oc_frag_recon_intra_mmx;
    _state->opt_vtable.frag_recon_inter=oc_frag_recon_inter_mmx;
    _state->opt_vtable.frag_recon_inter2=oc_frag_recon_inter2_mmx;
    _state->opt_vtable.idct8x8=oc_idct8x8_mmx;
    _state->opt_vtable.state_frag_recon=oc_state_frag_recon_mmx;
    _state->opt_vtable.loop_filter_init=oc_loop_filter_init_mmx;
    _state->opt_vtable.state_loop_filter_frag_rows=
     oc_state_loop_filter_frag_rows_mmx;
    _state->opt_vtable.restore_fpu=oc_restore_fpu_mmx;
    _state->opt_data.dct_fzig_zag=OC_FZIG_ZAG_MMX;
  }
  if(_state->cpu_flags&OC_CPU_X86_MMXEXT){
    _state->opt_vtable.loop_filter_init=oc_loop_filter_init_mmxext;
    _state->opt_vtable.state_loop_filter_frag_rows=
     oc_state_loop_filter_frag_rows_mmxext;
  }
  if(_state->cpu_flags&OC_CPU_X86_SSE2){
    _state->opt_vtable.idct8x8=oc_idct8x8_sse2;
# endif
    _state->opt_data.dct_fzig_zag=OC_FZIG_ZAG_SSE2;
# if defined(OC_STATE_USE_VTABLE)
  }
# endif
}
Beispiel #3
0
void oc_state_vtable_init_x86(oc_theora_state *_state){
  _state->cpu_flags=oc_cpu_flags_get();  
  if(_state->cpu_flags&OC_CPU_X86_MMX){
    _state->opt_vtable.frag_recon_intra=oc_frag_recon_intra_mmx;
    _state->opt_vtable.frag_recon_inter=oc_frag_recon_inter_mmx;
    _state->opt_vtable.frag_recon_inter2=oc_frag_recon_inter2_mmx;
    _state->opt_vtable.state_frag_copy=oc_state_frag_copy_mmx;
    _state->opt_vtable.state_frag_recon=oc_state_frag_recon_mmx;
    _state->opt_vtable.state_loop_filter_frag_rows=
     oc_state_loop_filter_frag_rows_mmx;
    _state->opt_vtable.restore_fpu=oc_restore_fpu_mmx;
  }
  else oc_state_vtable_init_c(_state);
}
Beispiel #4
0
void oc_state_vtable_init_x86(oc_theora_state *_state){
  _state->cpu_flags=oc_cpu_flags_get();
  if(_state->cpu_flags&OC_CPU_X86_MMX){
    _state->opt_vtable.frag_copy=oc_frag_copy_mmx;
    _state->opt_vtable.frag_recon_intra=oc_frag_recon_intra_mmx;
    _state->opt_vtable.frag_recon_inter=oc_frag_recon_inter_mmx;
    _state->opt_vtable.frag_recon_inter2=oc_frag_recon_inter2_mmx;
    _state->opt_vtable.idct8x8=oc_idct8x8_mmx;
    _state->opt_vtable.state_frag_recon=oc_state_frag_recon_mmx;
    _state->opt_vtable.state_frag_copy_list=oc_state_frag_copy_list_mmx;
    _state->opt_vtable.state_loop_filter_frag_rows=
     oc_state_loop_filter_frag_rows_mmx;
    _state->opt_vtable.restore_fpu=oc_restore_fpu_mmx;
    _state->opt_data.dct_fzig_zag=OC_FZIG_ZAG_MMX;
  }
  else oc_state_vtable_init_c(_state);
}
Beispiel #5
0
void oc_state_vtable_init_x86(oc_theora_state *_state){
  _state->cpu_flags=oc_cpu_flags_get();

  /* fill with defaults */
  oc_state_vtable_init_c(_state);

  /* patch MMX functions */
  if(_state->cpu_flags&OC_CPU_X86_MMX){
    _state->opt_vtable.frag_recon_intra=oc_frag_recon_intra_mmx;
    _state->opt_vtable.frag_recon_inter=oc_frag_recon_inter_mmx;
    _state->opt_vtable.frag_recon_inter2=oc_frag_recon_inter2_mmx;
    _state->opt_vtable.restore_fpu=oc_restore_fpu_mmx;
    _state->opt_vtable.state_frag_copy=oc_state_frag_copy_mmx;
    _state->opt_vtable.state_frag_recon=oc_state_frag_recon_mmx;
    _state->opt_vtable.state_loop_filter_frag_rows=oc_state_loop_filter_frag_rows_mmx;
  }
}
Beispiel #6
0
/**
 * Initialize the function pointers in yuv_conv.
 *
 * Initialize the function pointers in yuv_conv, based on the
 * the available CPU extensions.
 */
static void
init_yuv_converters(void)
{
    ogg_uint32_t features = 0;

    if ( yuv_conv.yuv420rgba == NULL )
    {
        init_vanilla_coeffs ();
#ifndef DISABLE_CPU_FEATURES
        features = oc_cpu_flags_get();
#endif
#ifdef ENABLE_SSE2
        if (features & OC_CPU_X86_SSE2)
        {
            yuv_conv.yuv420rgba = yuv420_to_rgba_sse2;
            yuv_conv.yuv420bgra = yuv420_to_bgra_sse2;
            yuv_conv.yuv420argb = yuv420_to_argb_sse2;
            yuv_conv.yuv422rgba = yuv422_to_rgba_sse2;
            yuv_conv.yuv422bgra = yuv422_to_bgra_sse2;
            yuv_conv.yuv422argb = yuv422_to_argb_sse2;
            yuv_conv.yuv444rgba = yuv444_to_rgba_sse2;
            yuv_conv.yuv444bgra = yuv444_to_bgra_sse2;
            yuv_conv.yuv444argb = yuv444_to_argb_sse2;
            return;
        }
#endif /* SSE2 */
#ifdef ENABLE_MMX
#ifdef ENABLE_SSE2
        else
#endif
            if (features & OC_CPU_X86_MMXEXT)
            {
                yuv_conv.yuv420rgba = yuv420_to_rgba_sse;
                yuv_conv.yuv420bgra = yuv420_to_bgra_sse;
                yuv_conv.yuv420argb = yuv420_to_argb_sse;
                yuv_conv.yuv422rgba = yuv422_to_rgba_sse;
                yuv_conv.yuv422bgra = yuv422_to_bgra_sse;
                yuv_conv.yuv422argb = yuv422_to_argb_sse;
                yuv_conv.yuv444rgba = yuv444_to_rgba_sse;
                yuv_conv.yuv444bgra = yuv444_to_bgra_sse;
                yuv_conv.yuv444argb = yuv444_to_argb_sse;
                return;
            }
            else if (features & OC_CPU_X86_MMX)
            {
                yuv_conv.yuv420rgba = yuv420_to_rgba_mmx;
                yuv_conv.yuv420bgra = yuv420_to_bgra_mmx;
                yuv_conv.yuv420argb = yuv420_to_argb_mmx;
                yuv_conv.yuv422rgba = yuv422_to_rgba_mmx;
                yuv_conv.yuv422bgra = yuv422_to_bgra_mmx;
                yuv_conv.yuv422argb = yuv422_to_argb_mmx;
                yuv_conv.yuv444rgba = yuv444_to_rgba_mmx;
                yuv_conv.yuv444bgra = yuv444_to_bgra_mmx;
                yuv_conv.yuv444argb = yuv444_to_argb_mmx;
                return;
            }
#elif defined(ENABLE_ALTIVEC)
        if (features & OC_CPU_PPC_ALTIVEC)
        {
            yuv_conv.yuv420rgba = yuv420_to_abgr_vanilla;
            yuv_conv.yuv420bgra = yuv420_to_argb_vanilla;
            yuv_conv.yuv420argb = yuv420_to_bgra_vanilla;
            yuv_conv.yuv422rgba = yuv422_to_abgr_vanilla;
            yuv_conv.yuv422bgra = yuv422_to_argb_vanilla;
            yuv_conv.yuv422argb = yuv422_to_bgra_vanilla;
            yuv_conv.yuv444rgba = yuv444_to_abgr_vanilla;
            yuv_conv.yuv444bgra = yuv444_to_argb_vanilla;
            yuv_conv.yuv444argb = yuv444_to_bgra_vanilla;
            return;
        }
#endif

        /*
        * no CPU extension was found... using vanilla converter, with respect
        * to the endianness of the host
        */
#if WORDS_BIGENDIAN || IS_BIG_ENDIAN
        yuv_conv.yuv420rgba = yuv420_to_abgr_vanilla;
        yuv_conv.yuv420bgra = yuv420_to_argb_vanilla;
        yuv_conv.yuv420argb = yuv420_to_bgra_vanilla;
        yuv_conv.yuv422rgba = yuv422_to_abgr_vanilla;
        yuv_conv.yuv422bgra = yuv422_to_argb_vanilla;
        yuv_conv.yuv422argb = yuv422_to_bgra_vanilla;
        yuv_conv.yuv444rgba = yuv444_to_abgr_vanilla;
        yuv_conv.yuv444bgra = yuv444_to_argb_vanilla;
        yuv_conv.yuv444argb = yuv444_to_bgra_vanilla;
#else
        yuv_conv.yuv420rgba = yuv420_to_rgba_vanilla;
        yuv_conv.yuv420bgra = yuv420_to_bgra_vanilla;
        yuv_conv.yuv420argb = yuv420_to_argb_vanilla;
        yuv_conv.yuv422rgba = yuv422_to_rgba_vanilla;
        yuv_conv.yuv422bgra = yuv422_to_bgra_vanilla;
        yuv_conv.yuv422argb = yuv422_to_argb_vanilla;
        yuv_conv.yuv444rgba = yuv444_to_rgba_vanilla;
        yuv_conv.yuv444bgra = yuv444_to_bgra_vanilla;
        yuv_conv.yuv444argb = yuv444_to_argb_vanilla;
#endif
    }
}