摘要:
A method for encoding or decoding an LDPC code with variable code lengths is provided in an embodiment of the present invention. The method includes: obtaining a base exponential matrix of an LDPC code and grouping code lengths during construction of the base exponential matrix; correcting the base exponential matrix according to a grouping correction factor to obtain an exponential matrix of the group corresponding to the grouping correction factor; extending the exponential matrix by using an extension factor of a code length in the group to obtain an LDPC matrix corresponding to the code length; and implementing encoding or decoding by using the LDPC matrix.