Lines Matching defs:code
286 // the nearest integer to *lag_int (minus 8), but the ref code
383 * @param[in] code Pulse index (no. of bits varies, see below)
387 static inline void decode_1p_track(int *out, int code, int m, int off)
389 int pos = BIT_STR(code, 0, m) + off; ///code: m+1 bits
391 out[0] = BIT_POS(code, m) ? -pos : pos;
394 static inline void decode_2p_track(int *out, int code, int m, int off) ///code: 2m+1 bits
396 int pos0 = BIT_STR(code, m, m) + off;
397 int pos1 = BIT_STR(code, 0, m) + off;
399 out[0] = BIT_POS(code, 2*m) ? -pos0 : pos0;
400 out[1] = BIT_POS(code, 2*m) ? -pos1 : pos1;
404 static void decode_3p_track(int *out, int code, int m, int off) ///code: 3m+1 bits
406 int half_2p = BIT_POS(code, 2*m - 1) << (m - 1);
408 decode_2p_track(out, BIT_STR(code, 0, 2*m - 1),
410 decode_1p_track(out + 2, BIT_STR(code, 2*m, m + 1), m, off);
413 static void decode_4p_track(int *out, int code, int m, int off) ///code: 4m bits
418 switch (BIT_STR(code, 4*m - 2, 2)) { /* case ID (2 bits) */
420 half_4p = BIT_POS(code, 4*m - 3) << (m - 1); // which has 4 pulses
421 subhalf_2p = BIT_POS(code, 2*m - 3) << (m - 2);
423 decode_2p_track(out, BIT_STR(code, 0, 2*m - 3),
425 decode_2p_track(out + 2, BIT_STR(code, 2*m - 2, 2*m - 1),
429 decode_1p_track(out, BIT_STR(code, 3*m - 2, m),
431 decode_3p_track(out + 1, BIT_STR(code, 0, 3*m - 2),
435 decode_2p_track(out, BIT_STR(code, 2*m - 1, 2*m - 1),
437 decode_2p_track(out + 2, BIT_STR(code, 0, 2*m - 1),
441 decode_3p_track(out, BIT_STR(code, m, 3*m - 2),
443 decode_1p_track(out + 3, BIT_STR(code, 0, m),
449 static void decode_5p_track(int *out, int code, int m, int off) ///code: 5m bits
451 int half_3p = BIT_POS(code, 5*m - 1) << (m - 1);
453 decode_3p_track(out, BIT_STR(code, 2*m + 1, 3*m - 2),
456 decode_2p_track(out + 3, BIT_STR(code, 0, 2*m + 1), m, off);
459 static void decode_6p_track(int *out, int code, int m, int off) ///code: 6m-2 bits
463 int half_more = BIT_POS(code, 6*m - 5) << (m - 1);
466 switch (BIT_STR(code, 6*m - 4, 2)) { /* case ID (2 bits) */
468 decode_1p_track(out, BIT_STR(code, 0, m),
470 decode_5p_track(out + 1, BIT_STR(code, m, 5*m - 5),
474 decode_1p_track(out, BIT_STR(code, 0, m),
476 decode_5p_track(out + 1, BIT_STR(code, m, 5*m - 5),
480 decode_2p_track(out, BIT_STR(code, 0, 2*m - 1),
482 decode_4p_track(out + 2, BIT_STR(code, 2*m - 1, 4*m - 4),
486 decode_3p_track(out, BIT_STR(code, 3*m - 2, 3*m - 2),
488 decode_3p_track(out + 3, BIT_STR(code, 0, 3*m - 2),
613 // of the energies are not correct. Please check the reference code carefully
680 /* Circular convolution code in the reference
710 // XXX: This part is not so clear from the reference code
733 // gain by 1.5dB were taken from the reference code, maybe it could
794 // XXX: Weird part in both ref code and spec. A unknown parameter