Revision 00c081a8 libswscale/swscale.c

View differences:

libswscale/swscale.c
298 298

  
299 299
#endif /* ARCH_X86 && CONFIG_GPL */
300 300

  
301
// clipping helper table for C implementations:
302
static unsigned char clip_table[768];
303

  
304 301
static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b);
305 302

  
306 303
DECLARE_ALIGNED(8, static const uint8_t, dither_2x2_4[2][8])={
......
1850 1847
}
1851 1848
#endif /* COMPILE_MMX2 */
1852 1849

  
1853
static void globalInit(void)
1854
{
1855
    // generating tables:
1856
    int i;
1857
    for (i=0; i<768; i++) {
1858
        int c= av_clip_uint8(i-256);
1859
        clip_table[i]=c;
1860
    }
1861
}
1862

  
1863 1850
static SwsFunc getSwsFunc(SwsContext *c)
1864 1851
{
1865 1852
#if CONFIG_RUNTIME_CPUDETECT
......
2429 2416
    flags |= SWS_CPU_CAPS_BFIN;
2430 2417
#endif
2431 2418
#endif /* CONFIG_RUNTIME_CPUDETECT */
2432
    if (clip_table[512] != 255) globalInit();
2433 2419
    if (!rgb15to16) sws_rgb2rgb_init(flags);
2434 2420

  
2435 2421
    unscaled = (srcW == dstW && srcH == dstH);

Also available in: Unified diff