double qcache_value(struct gcache_s *lgp, int j) { if ( j<=0 ) return 0; if ( j>=GCACHE ) return qval(lgp->par,j,lgp->lgpar); if ( lgp->cache[j]==0 ) { if ( j==1 ) lgp->cache[j] = 1/(1-lgp->par); else if ( j==2 ) lgp->cache[j] = 3/(2-lgp->par); else if ( j==3 ) lgp->cache[j] = (11-7*lgp->par)/(3-lgp->par)/(2-lgp->par); else lgp->cache[j] = qval(lgp->par,j,lgp->lgpar); } return lgp->cache[j]; }
void App::setPreference(const std::string &key, const std::string &val) { QSettings settings; std::string keyrep(getKeyRepr(key)); QString qkeyrep(keyrep.c_str()); QString qval(val.c_str()); settings.setValue(qkeyrep, qval); settings.sync(); }
void CccModule::handleLine(uint8_t *line, uint16_t width) { uint32_t index, sig, sig2, usum, vsum, ysum; int32_t x, r, g1, g2, b, u, v, u0, v0; Qval newline; // new line m_qq->enqueue(&newline); x = 1; next: usum = vsum = ysum = 0; r = line[x]; g1 = line[x-1]; g2 = line[x-width]; b = line[x-width-1]; u = r-g1; v = b-g2; ysum += r + (g1+g2)/2 + b; usum += u; vsum += v; u0 = u>>(9-CL_LUT_COMPONENT_SCALE); v0 = v>>(9-CL_LUT_COMPONENT_SCALE); u0 &= (1<<CL_LUT_COMPONENT_SCALE)-1; v0 &= (1<<CL_LUT_COMPONENT_SCALE)-1; index = (u0<<CL_LUT_COMPONENT_SCALE) | v0; sig = m_lut[index]; x += 2; if (x>=width) return; if (sig==0) goto next; r = line[x]; g1 = line[x-1]; g2 = line[x-width]; b = line[x-width-1]; u = r-g1; v = b-g2; ysum += r + (g1+g2)/2 + b; usum += u; vsum += v; u0 = u>>(9-CL_LUT_COMPONENT_SCALE); v0 = v>>(9-CL_LUT_COMPONENT_SCALE); u0 &= (1<<CL_LUT_COMPONENT_SCALE)-1; v0 &=(1<<CL_LUT_COMPONENT_SCALE)-1; index = (u0<<CL_LUT_COMPONENT_SCALE) | v0; sig2 = m_lut[index]; x += 2; if (x>=width) return; if (sig==sig2) goto save; goto next; save: Qval qval(usum, vsum, ysum, (x/2<<3) | sig); m_qq->enqueue(&qval); x += 2; if (x>=width) return; goto next; }