summaryrefslogtreecommitdiff
path: root/lib/fst4/encode240_101.f90
diff options
context:
space:
mode:
authorChristoph Berg <christoph.berg@credativ.de>2022-08-23 10:23:16 +0200
committerChristoph Berg <christoph.berg@credativ.de>2022-08-23 10:23:16 +0200
commit2d1068e60bce7ae1fff11623454900e8cee956b1 (patch)
treeacebe276e30466ef0ab91bc3da5e379bec0d7dc5 /lib/fst4/encode240_101.f90
parent43bebfbad6e7ba026bd3d55720c7d9e12a7ef8ef (diff)
New upstream version 2.6.0~rc3+repackupstream/2.6.0_rc3+repack
Diffstat (limited to 'lib/fst4/encode240_101.f90')
-rwxr-xr-xlib/fst4/encode240_101.f9088
1 files changed, 44 insertions, 44 deletions
diff --git a/lib/fst4/encode240_101.f90 b/lib/fst4/encode240_101.f90
index bd16b3ca..8c50ce1a 100755
--- a/lib/fst4/encode240_101.f90
+++ b/lib/fst4/encode240_101.f90
@@ -1,44 +1,44 @@
-subroutine encode240_101(message,codeword)
- use, intrinsic :: iso_c_binding
- use iso_c_binding, only: c_loc,c_size_t
- use crc
-
- integer, parameter:: N=240, K=101, M=N-K
- integer*1 codeword(N)
- integer*1 gen(M,K)
- integer*1 message(K)
- integer*1 pchecks(M)
- include "ldpc_240_101_generator.f90"
- logical first
- data first/.true./
- save first,gen
-
- if( first ) then ! fill the generator matrix
- gen=0
- do i=1,M
- do j=1,26
- read(g(i)(j:j),"(Z1)") istr
- ibmax=4
- if(j.eq.26) ibmax=1
- do jj=1, ibmax
- icol=(j-1)*4+jj
- if( btest(istr,4-jj) ) gen(i,icol)=1
- enddo
- enddo
- enddo
- first=.false.
- endif
-
- do i=1,M
- nsum=0
- do j=1,K
- nsum=nsum+message(j)*gen(i,j)
- enddo
- pchecks(i)=mod(nsum,2)
- enddo
-
- codeword(1:K)=message
- codeword(K+1:N)=pchecks
-
- return
-end subroutine encode240_101
+subroutine encode240_101(message,codeword)
+ use, intrinsic :: iso_c_binding
+ use iso_c_binding, only: c_loc,c_size_t
+ use crc
+
+ integer, parameter:: N=240, K=101, M=N-K
+ integer*1 codeword(N)
+ integer*1 gen(M,K)
+ integer*1 message(K)
+ integer*1 pchecks(M)
+ include "ldpc_240_101_generator.f90"
+ logical first
+ data first/.true./
+ save first,gen
+
+ if( first ) then ! fill the generator matrix
+ gen=0
+ do i=1,M
+ do j=1,26
+ read(g(i)(j:j),"(Z1)") istr
+ ibmax=4
+ if(j.eq.26) ibmax=1
+ do jj=1, ibmax
+ icol=(j-1)*4+jj
+ if( btest(istr,4-jj) ) gen(i,icol)=1
+ enddo
+ enddo
+ enddo
+ first=.false.
+ endif
+
+ do i=1,M
+ nsum=0
+ do j=1,K
+ nsum=nsum+message(j)*gen(i,j)
+ enddo
+ pchecks(i)=mod(nsum,2)
+ enddo
+
+ codeword(1:K)=message
+ codeword(K+1:N)=pchecks
+
+ return
+end subroutine encode240_101