K
Kenneth Lantrip
Anyone got any ideas as to how this process could be improved for speed?
this is what I have...
Dim j, q As Integer
Dim x(16), y(16) As Byte
[ not all code is shown ... only the relevant parts ]
x.CopyTo(y, 0) ' shift left circular 24 bits
For j = 0 To 15
q = (j + 3) And 15
x(j + 1) = y(q + 1)
Next
' shift left circular 1 more bit
If x(1) And &H80 Then q = True Else q = False
For j = 1 To 16
x(j) = (x(j) * 2) And &HFF
If j < 16 Then
If x(j + 1) And &H80 Then x(j) += 1
Else
If q Then x(j) += 1
End If
Next
I need to shift shift all the bits in the array [x] 25 bits to the left
(circular) as quickly as possible.
I don't "have" to have an array. I could use a 64 bit integer if needed.
this is what I have...
Dim j, q As Integer
Dim x(16), y(16) As Byte
[ not all code is shown ... only the relevant parts ]
x.CopyTo(y, 0) ' shift left circular 24 bits
For j = 0 To 15
q = (j + 3) And 15
x(j + 1) = y(q + 1)
Next
' shift left circular 1 more bit
If x(1) And &H80 Then q = True Else q = False
For j = 1 To 16
x(j) = (x(j) * 2) And &HFF
If j < 16 Then
If x(j + 1) And &H80 Then x(j) += 1
Else
If q Then x(j) += 1
End If
Next
I need to shift shift all the bits in the array [x] 25 bits to the left
(circular) as quickly as possible.
I don't "have" to have an array. I could use a 64 bit integer if needed.