Example #1
0
static arch_t get_arch(int opt, bool is_avsplus)
{
    if (opt == 0 || !has_sse2()) {
        return NO_SIMD;
    }
#if !defined(__AVX2__)
    return USE_SSE2;
#else
    if (opt == 1 || !has_avx2() || !is_avsplus) {
        return USE_SSE2;
    }
    return USE_AVX2;
#endif
}
Example #2
0
ASS_SynthPriv *ass_synth_init(double radius)
{
    ASS_SynthPriv *priv = calloc(1, sizeof(ASS_SynthPriv));
    if (!priv || !generate_tables(priv, radius)) {
        free(priv);
        return NULL;
    }
    #if (defined(__i386__) || defined(__x86_64__)) && CONFIG_ASM
        int avx2 = has_avx2();
        #ifdef __x86_64__
            priv->be_blur_func = avx2 ? ass_be_blur_avx2 : ass_be_blur_sse2;
        #else
            priv->be_blur_func = be_blur_c;
        #endif
    #else
        priv->be_blur_func = be_blur_c;
    #endif
    return priv;
}