Lines Matching defs:packed
127 /* The length of a byte sequence, according to its packed form. */
128 #define BOCU1_LENGTH_FROM_PACKED(packed) \
129 ((uint32_t)(packed)<0x04000000 ? (packed)>>24 : 4)
274 * and return a packed integer with them.
331 /* encode the length of the packed result */
360 * @return the packed 1/2/3/4-byte encoding, see packDiff(),
600 * Write a packed BOCU-1 byte sequence into a byte array,
604 * @param packed packed BOCU-1 byte sequence, see packDiff()
611 writePacked(int32_t packed, uint8_t *p) {
612 int32_t count=BOCU1_LENGTH_FROM_PACKED(packed);
615 *p++=(uint8_t)(packed>>24);
617 *p++=(uint8_t)(packed>>16);
619 *p++=(uint8_t)(packed>>8);
621 *p++=(uint8_t)packed;
630 * Unpack a packed BOCU-1 non-C0/space byte sequence and get
637 * @param packed packed BOCU-1 byte sequence
644 unpackDiff(int32_t initialPrev, int32_t packed) {
649 count=BOCU1_LENGTH_FROM_PACKED(packed);
652 decodeBocu1(&rx, (uint8_t)(packed>>24));
654 decodeBocu1(&rx, (uint8_t)(packed>>16));
656 decodeBocu1(&rx, (uint8_t)(packed>>8));
659 return decodeBocu1(&rx, (uint8_t)packed)-initialPrev;
679 /* generate the difference as a packed value and serialize it */
680 int32_t packed, initialPrev;
682 packed=packDiff(diff);
694 if(diff!=unpackDiff(initialPrev, packed)) {
696 diff, packed, unpackDiff(initialPrev, packed));
698 return p+writePacked(packed, p);