Revision 36cd3069

View differences:

libavcodec/dsputil.c
93 93
};
94 94

  
95 95
/* a*inverse[b]>>32 == a/b for all 0<=a<=65536 && 2<=b<=255 */
96
const uint32_t inverse[256]={
96
const uint32_t ff_inverse[256]={
97 97
         0, 4294967295U,2147483648U,1431655766, 1073741824,  858993460,  715827883,  613566757,
98 98
 536870912,  477218589,  429496730,  390451573,  357913942,  330382100,  306783379,  286331154,
99 99
 268435456,  252645136,  238609295,  226050911,  214748365,  204522253,  195225787,  186737709,
libavcodec/i386/mpegvideo_mmx_template.c
76 76
        asm volatile (
77 77
                "mul %%ecx                \n\t"
78 78
                : "=d" (level), "=a"(dummy)
79
                : "a" ((block[0]>>2) + q), "c" (inverse[q<<1])
79
                : "a" ((block[0]>>2) + q), "c" (ff_inverse[q<<1])
80 80
        );
81 81
#else
82 82
        asm volatile (
libavcodec/msmpeg4.c
675 675
        "mull %4                \n\t"
676 676
        "movl %%edx, %2         \n\t"
677 677
        : "+b" (a), "+c" (b), "+D" (c)
678
        : "g" (scale), "S" (inverse[scale])
678
        : "g" (scale), "S" (ff_inverse[scale])
679 679
        : "%eax", "%edx"
680 680
    );
681 681
#else
libavcodec/vorbis.c
1438 1438
        voffset=vr->begin;
1439 1439
        for(partition_count=0;partition_count<ptns_to_read;) {  // SPEC        error
1440 1440
            if (!pass) {
1441
                uint_fast32_t inverse_class = inverse[vr->classifications];
1441
                uint_fast32_t inverse_class = ff_inverse[vr->classifications];
1442 1442
                for(j_times_ptns_to_read=0, j=0;j<ch_used;++j) {
1443 1443
                    if (!do_not_decode[j]) {
1444 1444
                        uint_fast32_t temp=get_vlc2(gb, vc->codebooks[vr->classbook].vlc.table,
libavutil/internal.h
103 103

  
104 104
#    define av_abort()      do { av_log(NULL, AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
105 105

  
106
extern const uint32_t inverse[256];
106
extern const uint32_t ff_inverse[256];
107 107

  
108 108
#if defined(ARCH_X86)
109 109
#    define FASTDIV(a,b) \
......
112 112
        asm volatile(\
113 113
            "mull %3"\
114 114
            :"=d"(ret),"=a"(dmy)\
115
            :"1"(a),"g"(inverse[b])\
115
            :"1"(a),"g"(ff_inverse[b])\
116 116
            );\
117 117
        ret;\
118 118
    })
......
123 123
        asm volatile(\
124 124
            "umull %1, %0, %2, %3"\
125 125
            :"=&r"(ret),"=&r"(dmy)\
126
            :"r"(a),"r"(inverse[b])\
126
            :"r"(a),"r"(ff_inverse[b])\
127 127
            );\
128 128
        ret;\
129 129
    })
130 130
#elif defined(CONFIG_FASTDIV)
131
#    define FASTDIV(a,b)   ((uint32_t)((((uint64_t)a)*inverse[b])>>32))
131
#    define FASTDIV(a,b)   ((uint32_t)((((uint64_t)a)*ff_inverse[b])>>32))
132 132
#else
133 133
#    define FASTDIV(a,b)   ((a)/(b))
134 134
#endif

Also available in: Unified diff