Lines Matching refs:rs

2318             $rs = null;
2321 if($symsize < 0 || $symsize > 8) return $rs;
2322 if($fcr < 0 || $fcr >= (1<<$symsize)) return $rs;
2323 if($prim <= 0 || $prim >= (1<<$symsize)) return $rs;
2324 …if($nroots < 0 || $nroots >= (1<<$symsize)) return $rs; // Can't have more roots than sym…
2325 if($pad < 0 || $pad >= ((1<<$symsize) -1 - $nroots)) return $rs; // Too much padding
2327 $rs = new QRrsItem();
2328 $rs->mm = $symsize;
2329 $rs->nn = (1<<$symsize)-1;
2330 $rs->pad = $pad;
2332 $rs->alpha_to = array_fill(0, $rs->nn+1, 0);
2333 $rs->index_of = array_fill(0, $rs->nn+1, 0);
2336 $NN =& $rs->nn;
2340 $rs->index_of[0] = $A0; // log(zero) = -inf
2341 $rs->alpha_to[$A0] = 0; // alpha**-inf = 0
2344 for($i=0; $i<$rs->nn; $i++) {
2345 $rs->index_of[$sr] = $i;
2346 $rs->alpha_to[$i] = $sr;
2351 $sr &= $rs->nn;
2356 $rs = NULL;
2357 return $rs;
2361 $rs->genpoly = array_fill(0, $nroots+1, 0);
2363 $rs->fcr = $fcr;
2364 $rs->prim = $prim;
2365 $rs->nroots = $nroots;
2366 $rs->gfpoly = $gfpoly;
2369 for($iprim=1;($iprim % $prim) != 0;$iprim += $rs->nn)
2372 $rs->iprim = (int)($iprim / $prim);
2373 $rs->genpoly[0] = 1;
2376 $rs->genpoly[$i+1] = 1;
2380 if ($rs->genpoly[$j] != 0) {
2381 …$rs->genpoly[$j] = $rs->genpoly[$j-1] ^ $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[$j]] +…
2383 $rs->genpoly[$j] = $rs->genpoly[$j-1];
2387 $rs->genpoly[0] = $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[0]] + $root)];
2392 $rs->genpoly[$i] = $rs->index_of[$rs->genpoly[$i]];
2394 return $rs;
2449 foreach(self::$items as $rs) {
2450 if($rs->pad != $pad) continue;
2451 if($rs->nroots != $nroots) continue;
2452 if($rs->mm != $symsize) continue;
2453 if($rs->gfpoly != $gfpoly) continue;
2454 if($rs->fcr != $fcr) continue;
2455 if($rs->prim != $prim) continue;
2457 return $rs;
2460 $rs = QRrsItem::init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad);
2461 array_unshift(self::$items, $rs);
2463 return $rs;
2842 public function __construct($dl, $data, $el, &$ecc, QRrsItem $rs) argument
2844 $rs->encode_rs_char($data, $ecc);
2899 $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el);
2907 …->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs);
2920 $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el);
2922 if($rs == NULL) return -1;
2926 …s->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs);