22 character*1,
intent(in) :: in(*)
23 integer,
intent(inout) :: iout(*)
24 integer,
intent(in) :: iskip, nbits
44 character*1,
intent(inout) :: out(*)
45 integer,
intent(in) :: in(*)
46 integer,
intent(in) :: iskip, nbits
65 character*1,
intent(in) :: in(*)
66 integer,
intent(out) :: iout(*)
67 integer,
intent(in) :: iskip, nbits, nskip, n
68 integer :: tbit, bitcnt
69 integer,
parameter :: ones(8) = (/ 1, 3, 7, 15, 31, 63, 127, 255 /)
71 integer :: nbit, i, index, ibit, itmp
72 integer,
external :: mova2i
80 nbit = nbit + nbits + nskip
83 tbit = min(bitcnt, 8 - ibit)
84 itmp = iand(mova2i(in(index)), ones(8 - ibit))
85 if (tbit .ne. 8 - ibit) itmp = ishft(itmp, tbit - 8 + ibit)
87 bitcnt = bitcnt - tbit
90 do while (bitcnt .ge. 8)
91 itmp = ior(ishft(itmp,8), mova2i(in(index)))
97 if (bitcnt .gt. 0)
then
98 itmp = ior(ishft(itmp, bitcnt), iand(ishft(mova2i(in(index)), &
99 - (8 - bitcnt)), ones(bitcnt)))
122 character*1,
intent(out) :: out(*)
123 integer,
intent(in) :: in(n)
124 integer,
intent(in) :: iskip, nbits, nskip, n
126 integer :: bitcnt, tbit
127 integer,
parameter :: ones(8)=(/ 1, 3, 7, 15, 31, 63, 127, 255/)
128 integer :: nbit, i, itmp, index, ibit, imask, itmp2, itmp3
129 integer,
external :: mova2i
133 nbit = iskip + nbits - 1
139 nbit = nbit + nbits + nskip
142 if (ibit .ne. 7)
then
143 tbit = min(bitcnt, ibit + 1)
144 imask = ishft(ones(tbit), 7 - ibit)
145 itmp2 = iand(ishft(itmp, 7 - ibit),imask)
146 itmp3 = iand(mova2i(out(index)), 255 - imask)
147 out(index) = char(ior(itmp2, itmp3))
148 bitcnt = bitcnt - tbit
149 itmp = ishft(itmp, -tbit)
156 do while (bitcnt .ge. 8)
157 out(index) = char(iand(itmp, 255))
158 itmp = ishft(itmp, -8)
164 if (bitcnt .gt. 0)
then
165 itmp2 = iand(itmp, ones(bitcnt))
166 itmp3 = iand(mova2i(out(index)), 255 - ones(bitcnt))
167 out(index) = char(ior(itmp2, itmp3))
subroutine g2_gbytesc(in, iout, iskip, nbits, nskip, n)
Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked a...
subroutine g2_gbytec(in, iout, iskip, nbits)
Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked a...
subroutine g2_sbytec(out, in, iskip, nbits)
Put arbitrary size values into a packed bit string, taking the low order bits from each value in the ...
subroutine g2_sbytesc(out, in, iskip, nbits, nskip, n)
Put arbitrary size values into a packed bit string, taking the low order bits from each value in the ...