static void calculate_comb_factor_yuy2_vektor( tvtime_t *tvtime, uint8_t *curframe, int instride, int frame_height, int width ){ /* we have yv12 format - to detect the pulldown we only use luminance (Y) data, so we only need the first frame_height * width bytes of the frame */ int i, j, top, mid, bot, wdt, dj, wdt2; tvtime->combfactor = 0; for(i=50; i<frame_height-50; i+=4) { wdt2 = 2*width; wdt = wdt2*i; for(j=50; j<width-50; j++) { dj = j*2+wdt; top = curframe[dj-(wdt2)]; mid = curframe[dj]; bot = curframe[dj+(wdt2)]; tvtime->combfactor += ((top - mid) * (bot - mid) - ( ((top - bot)^2) >> 7 )); } } tvtime->combfactor /= (43 * frame_height);}