Patent Description:
This application relates to the field of communication technologies, and in particular, to an encoding and decoding method and an apparatus.

Multimedia communication is a new communication mode in which a plurality of types of media data (for example, a voice, data, an image, or a video) can be provided during a call. At present, multimedia data coding and transmission technologies have become a hot research focus in the field of multimedia communication. A sending apparatus usually encodes different multimedia data by using a same coding matrix, to obtain an encoded codeword; and then transmits the encoded codeword to a receiving apparatus. However, in practical application, different multimedia data has different priorities. If the foregoing coding scheme is used, when a coding rate is high, transmission reliability of high-priority multimedia data cannot be ensured; and when the coding rate is low, low-priority multimedia data also occupies a large number of transmission resources, resulting in high transmission resource overheads.

<NUM> discloses code rate, code length and parity check matrices. This document discloses a table linking information length to code rate and codeword length.

<CIT> discloses an apparatus and method. The apparatus includes a transceiver and processor, which attach transport block (TB) level CRC bits to a TB, select an LDPC base graph (BG) based on a code rate (CR) and TB size of the TB including TB level CRC bits, determine a number of code blocks (CBs) to use for segmenting the TB including TB level CRC bits depending on the selected LDPC BG, determine a single CB size for each of the CBs based on the number of CBs, segment the TB including TB level CRC bits into the CBs based on the number of CBs and CB size, pad zeros to a last CB of the CBs in the segmented TB, attach CB level CRC bits to each CB in the segmented TB, encode each CB in the segmented TB using the selected LDPC base graph, and transmit the encoded CBs.

HONGJIANG XIAO ET AL discloses a cooperative multiple-input multiple output (MIMO) architecture to transmit the video reliably.

This application provides an encoding and decoding method and an apparatus, to improve data transmission reliability and save transmission resources.

To achieve the objective, this application provides the following technical solutions.

According to a first aspect, an embodiment of this application provides a sending apparatus. The sending apparatus includes a processing unit and a sending unit. The processing unit is configured to determine a first low-density parity-check LDPC matrix based on a quantity n<NUM> of first transmission bits; the processing unit is further configured to encode information bits based on the first LDPC matrix, to obtain the first transmission bits; and the sending unit is configured to send the first transmission bits; wherein the quantity n<NUM> of the first transmission bits has a correspondence with a coding rate of the first LDPC matrix, including: if n<NUM> is less than N0, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to NO and less than N1, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to N1 and less than N2, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to N2 and less than N3, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to N3 and less than or equal to N4, the coding rate of the first LDPC matrix is <NUM>/<NUM>; or if n<NUM> is greater than N4, the coding rate of the first LDPC matrix is <NUM>/<NUM>; wherein NO is <NUM>; N1 is <NUM>; N2 is <NUM>; N3 is <NUM>; and N4 is <NUM>.

According to a second aspect, an embodiment of this application provides a receiving apparatus. The receiving apparatus includes a processing unit and a receiving unit. The receiving unit is configured to receive first transmission bits; the processing unit is configured to determine a first low-density parity-check LDPC matrix based on a quantity n<NUM> of the first transmission bits; and the processing unit is further configured to decode the first transmission bits based on the first LDPC matrix, to obtain information bits; wherein the quantity n<NUM> of the first transmission bits has a correspondence with a coding rate of the first LDPC matrix, including: if n<NUM> is less than N0, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to NO and less than N1, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to N1 and less than N2, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to N2 and less than N3, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to N3 and less than or equal to N4, the coding rate of the first LDPC matrix is <NUM>/<NUM>; or if n<NUM> is greater than N4, the coding rate of the first LDPC matrix is <NUM>/<NUM>; wherein NO is <NUM>; N1 is <NUM>; N2 is <NUM>; N3 is <NUM>; and N4 is <NUM>.

According to a third aspect, an embodiment of this application provides an encoding method. The method includes: determining, by a sending apparatus, a first low-density parity-check LDPC matrix based on a quantity n<NUM> of first transmission bits; encoding, by the sending apparatus, information bits based on the first LDPC matrix, to obtain the first transmission bits; andsending, by the sending apparatus, the first transmission bits; wherein the quantity n<NUM> of the first transmission bits has a correspondence with a coding rate of the first LDPC matrix, comprising: if n<NUM> is less than N0, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to NO and less than N1, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to N1 and less than N2, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to N2 and less than N3, the coding rate of the first LDPC matrix is <NUM>/<NUM>; if n<NUM> is greater than or equal to N3 and less than or equal to N4, the coding rate of the first LDPC matrix is <NUM>/<NUM>; or if n<NUM> is greater than N4, the coding rate of the first LDPC matrix is <NUM>/<NUM>; wherein NO is <NUM>; N1 is <NUM>; N2 is <NUM>; N3 is <NUM>; and N4 is <NUM>.

The following describes technical solutions in embodiments of this application with reference to the accompanying drawings in embodiments of this application. In description of this application, the term "a plurality of" means two or more than two unless otherwise specified. In addition, to clearly describe the technical solutions in embodiments of this application, words such as "first" and "second" are used in embodiments of this application to distinguish between same items or similar items that have basically the same functions or purposes. A person skilled in the art may understand that the words such as "first" and "second" do not limit a quantity and an execution sequence, and the words such as "first" and "second" do not indicate a definite difference.

To make this application clearer, some concepts and processing procedures mentioned in this application are first briefly described.

Source encoding is a transformation performed on a signal source to improve communication effectiveness, or a transformation performed on a signal source to reduce or eliminate source redundancy. Specifically, it is to find a method based on statistical characteristics of the signal source, to transform the signal source into a shortest bit sequence, so as to maximize an average amount of information carried by each bit in the shortest bit sequence while ensuring the signal source to be restored without distortion. A key indicator of source encoding is encoding efficiency.

A reverse process of source encoding is source decoding. The source decoding is a process of restoring a signal that is before source decoding, to obtain the signal source.

Channel encoding, also called error control encoding, means that a sending apparatus adds redundant bits to information bits (for example, source-encoded bits in <FIG>), where the redundant bits are associated with the information bits. A channel-encoded signal includes information bits and redundant bits in sequence.

A reverse process of channel encoding is channel decoding. Channel decoding means that a receiving apparatus detects and corrects, based on an association between the redundant bits and the information bits, an error generated in a transmission process, to restore the information bits, so as to counteract interference in the transmission process and improve data transmission reliability.

The coding rate is a ratio of bits that are before encoding (that is, information bits) to encoded bits. If a bit sequence is encoded by using a coding scheme with a lower coding rate, there are more redundant bits in an encoded bit sequence, ensuring more reliable data transmission. The coding rate may be denoted as R.

The coding length is a quantity of bits in an encoded bit sequence. When a quantity of information bits is fixed, if encoding is performed by using a coding scheme with a longer coding length, there are more redundant bits in an encoded bit sequence, ensuring more reliable data transmission.

The LDPC code is a code obtained through channel coding. The LDPC code is a standard channel coding scheme for a low-frequency short-range wireless local area network (wireless local area networks, WLAN) communication system such as the institute of electrical and electronics engineers (the institute of electrical and electronics engineers, IEEE) <NUM>. When a bandwidth is greater than or equal to <NUM>, the LDPC code becomes a mandatory channel coding scheme.

The LDPC code is generally represented by a check matrix or a Tanner graph. The check matrix of the LDPC code is a sparse matrix, in which a quantity of non-zero elements is far less than a quantity of zero elements. The check matrix of the LDPC code corresponds to the Tanner graph on a one-to-one basis. The Tanner graph includes variable nodes and check nodes. The variable node represents a codeword symbol, and the check node represents a check constraint relationship. The check matrix of the LDPC code is denoted as H. For example, the check matrix H of the LDPC code is as follows: <MAT>.

A Tanner graph corresponding to the check matrix H of the LDPC code is shown in <FIG>. In <FIG>, V<NUM>, V<NUM>, V<NUM>, V<NUM>, V<NUM>, V<NUM>, V<NUM>, and Vs are all variable nodes and are represented by circular nodes. C<NUM>, C<NUM>, C<NUM>, and C<NUM> are all check nodes, and are represented by square nodes.

The LDPC code used in the IEEE802.11ac/ax standard is a quasi cyclic LDPC code (quasi cyclic low-density parity-check, QC-LDPC). A unique structure of a check matrix of the QC-LDPC code better resolves a problem of complex coding of the LDPC code. In IEEE802.11ac, the check matrix of the LDPC code supports a coding length of <NUM> and a coding rate of <NUM>/<NUM>.

For example, <FIG> shows check matrices of four kinds of LDPC codes, and the check matrices of the four kinds of LDPC code support a coding length of <NUM>. Different codewords are obtained by using the check matrices of the four kinds of LDPC codes, and a coding rate, an information bit length, and a check bit length of the codeword are as follows:.

A raptor like low-density parity-check (raptor like low-density parity-check, RL-LDPC) code is an LDPC code with a coding rate of lower than <NUM>/<NUM>.

A likelihood ratio of a bit is a natural logarithm of a ratio of a probability that the bit is <NUM> to a probability that the bit is <NUM>. If the probability that the bit is <NUM> is denoted as p(<NUM>), and the probability that the bit is <NUM> is denoted as p(<NUM>), the likelihood ratio of the bit is ln[p(<NUM>)/p(<NUM>)].

Refer to <FIG>. In a data sending and receiving process, a sending apparatus performs source encoding, channel encoding, constellation modulation, and resource mapping on a signal source, to obtain a to-be-transmitted signal, and sends the signal to a receiving apparatus. When being transmitted over a channel between the sending apparatus and the receiving apparatus, the signal may be interfered with by noise. After receiving the signal, the receiving apparatus performs resource demapping, constellation demodulation, channel decoding, and source decoding on the signal, to obtain a signal sink (that is, a restored signal source).

<FIG> shows only some steps in the data sending and receiving process. In actual implementation, there may be other steps. This is not limited in embodiments of this application.

Video data transmission is used as an example. Currently, common source (for example, video data) coding methods include the following five methods. The first and the second methods are methods for performing digital-analog hybrid video coding, the third and the fourth methods are methods for performing pure digital video coding, and the fifth method is a wireless transmission method for joint source and channel transmission.

A processing process of SoftCast includes: performing discrete cosine transform (discrete cosine transform, DCT), power allocation, whitening, and resource mapping on an image and sending the image; and performing, by a receiving apparatus, linear least square estimate (linear least square estimate, LLSE) decoding and DCT inverse transformation on the received signal, to obtain the image.

A processing process of Amimon's JSCC includes: layering an image, to obtain information about a coarse information layer and information about a fine information layer, directly performing constellation modulation and resource mapping on information about each layer, and sending a signal mapped to a transmission resource.

In both the first method and the second method, channel coding is not used, and information is directly transmitted over a channel, which is greatly affected by noise. In particular, when a signal-to-noise ratio (signal-to-noise ratio, SNR) is low, a signal received by a receiving apparatus is poor, and visual quality of a video cannot meet an actual requirement.

Third method: advanced television systems committee (advanced television systems committee, ATSC) layered division multiplexing (layered division multiplexing, LDM) and scalable high-efficiency video coding (scalable high-efficiency video coding, SHVC), which may be referred to as ATSC's LDM & SHVC for short.

A processing process of ATSC's LDM & SHVC includes: layering an image (into a basic layer and an enhancement layer) based on sampling points, performing channel coding and constellation modulation for each layer, integrating information obtained after constellation modulation, and mapping the information to a transmission resource for sending.

When channel coding is performed in ATSC's LDM & SHVC, a channel coding rate is fixed. In addition, in ATSC's LDM & SHVC, the image is divided into only two layers, and therefore an ability to adapt to the channel is fairly limited.

A processing process of FlexCast includes: performing DCT conversion, binary conversion, rateless coding, and resource mapping on an image, and sending the image. A rateless coded signal includes only redundant bits. Rateless coding is applicable to a binary erasure channel (binary erasure channel, BEC) and has poor performance under additive white Gaussian noise (additive white gaussian noise, AWGN). Fifth method: wireless transmission method for joint source and channel transmission.

Refer to <FIG>. A processing process of the method includes: A sending apparatus performs layering according to priorities (for example, importance) of information bits in a signal source (for example, video data or an instruction). Layered control information (for example, layered bit width information) is transmitted over a control signal channel. The control information undergoes channel encoding, binary phase shift keying (binary phase shift keying, BPSK) modulation, and resource mapping processing. A start phase of the BPSK is π/<NUM>. Layered data information (that is, the information bits) is transmitted over a data signal channel. Data information of different priorities is distributed in N bit planes. Rateless encoding is performed on data information in different bit planes separately. Bit stream splicing, symbol modulation, symbol sequence splicing, and resource mapping are performed on the encoded information. A signal is mapped to a resource block. After block (block) assembly (for example, adding a preamble (preamble) or a demodulation pilot reference signal) is performed on the signal, the signal is sent.

The layered bit width information includes a quantity of transmission bits in each bit plane, a probability that bits are <NUM> and a probability that bits are <NUM> before source encoding, and encoding-related information. N is an integer greater than <NUM>. The control information and the data information are independently encoded and modulated. A low coding rate (for example, <NUM>/<NUM>) coding scheme and a low-order modulation scheme (for example, BPSK) are used for the control information. For the data information, medium and low coding rates (for example, <NUM>/<NUM>) are used for high-priority information bits, and high and medium coding rates (for example, <NUM>/<NUM>) are used for low-priority information bits. The information bits enter N independent encoders.

The receiving apparatus performs synchronization, channel estimation, and equalization processing on the received signal, and then obtains control information and data information through resource demapping. Demodulation and channel decoding are performed on the control information, to obtain the layered bit width information. Soft information in each layer is obtained by performing symbol sequence splitting, demodulation, bit stream splitting, and the like on the data information. Then, a probability that bits are <NUM> or a probability that bits are <NUM> is obtained through channel decoding. Finally, the information is merged based on the probability, to restore original source information, that is, obtain target information. The soft information is a likelihood ratio corresponding to each bit in the data information. However, rateless coding is still used for the channel coding, with poor channel coding performance. Moreover, rateless coding cannot be applied to an existing LDPC encoding and decoding architecture.

In view of this, an embodiment of this application provides an encoding and decoding method, and a communication system to which the encoding and decoding method provided in this embodiment of this application is applicable includes a sending apparatus and a receiving apparatus. The sending apparatus is an apparatus or a chip that supports wireless communication, such as an apparatus or a chip that supports <NUM> family of protocols, or an apparatus or a chip that supports cellular communication. The sending apparatus may be a network device, a terminal, a chip in a terminal, a chip in a network device, or the like. The sending apparatus may also be described as an originating apparatus or a sending apparatus. The receiving apparatus is an apparatus or a chip that supports wireless communication, such as an apparatus or a chip that supports <NUM> family of protocols, or an apparatus or a chip that supports cellular communication. The receiving apparatus may be a network device, a terminal, a chip in a terminal, a chip in a network device, or the like. The receiving apparatus may also be described as a terminating apparatus or a receiving apparatus. In addition, the sending apparatus and the receiving apparatus may be two apparatuses in a communication system. For example, the sending apparatus may be a first apparatus in the communication system, the receiving apparatus may be a second apparatus in the communication system, and data can be exchanged between the first apparatus and the second apparatus. The network device may be a communication entity such as a communication server, a router, a switch, and a bridge, a macro base station, a micro base station, a relay station, a wireless local area network access point, or the like. The terminal may be a mobile phone, a tablet computer, a smart home device, an internet of things node, an internet of vehicles device, an augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR) device, or the like.

<FIG> shows a wireless local area network communication system to which an encoding and decoding method according to an embodiment of this application is applicable. A network device may be an access point (access point, AP) in the wireless local area network communication system, and a terminal may be a station (station, STA) in the wireless local area network communication system. Refer to <FIG>. A system architecture of the wireless local area network includes at least one AP and at least one station (station, STA). The AP is a network element providing services for the station, and may be an access point supporting <NUM> family of protocols. The station STA may be a station supporting <NUM> family of protocols. The <NUM> family of protocols may include extremely high throughput (extremely high throughput, EHT) or IEEE <NUM>.

A network architecture and a service scenario that are described in embodiments of this application are intended to describe the technical solutions in embodiments of this application more clearly, and do not constitute a limitation on the technical solutions provided in embodiments of this application. A person of ordinary skill in the art may know that the technical solutions provided in embodiments of this application are also applicable to a similar technical problem as a network architecture evolves and a new service scenario emerges.

The following describes in detail an encoding and decoding method provided in embodiments of this application.

An embodiment of this application provides an encoding and decoding method. Refer to <FIG>. The coding method includes the following steps.

S600: A sending apparatus obtains information bits and a quantity n<NUM> of first transmission bits.

The information bits are one of N layers of bit sequences obtained by layering original information. Herein, the original information is at least one bit sequence. N is an integer greater than <NUM>. For example, the process in which "a sending apparatus obtains information bits" includes step <NUM> to step <NUM>.

Step <NUM>: The sending apparatus obtains the original information.

For example, refer to <FIG>. Pixels of one frame of image are <NUM> ×<NUM>, and pixels of one block are <NUM>×<NUM>. The frame of image is divided in unit of blocks, to obtain <NUM> ×<NUM> blocks. In <FIG>, one square represents one block. Discrete cosine transform (discrete cosine transform, DCT) or wavelet transform is performed on all pixels in one block. The DCT transform is used as an example. The DCT transform is performed on all pixels in each block, to obtain a corresponding DCT coefficient. Each DCT coefficient is quantized, to obtain a corresponding DCT quantized coefficient. Then, eight bits are used to represent DCT quantized coefficients, and a quantized bit sequence (including a plurality of bits), that is, the original information, can be obtained. The DCT coefficients are real numbers, and the DCT quantized coefficients are integers.

Step <NUM>: The sending apparatus layers the original information, to obtain N layers of bit sequences.

The layering processing technology may be a bit-plane layering technology, or video coding technologies such as source coding (for example, scalable video coding (scalable video coding, SVC), and tile-based <NUM>° layering (Tile-based <NUM>°)) or other schemes may be used to layer the original information, so that all bits in the bit sequence are distributed in different bit planes, to obtain a bit sequence distributed on N layers of bit planes.

Herein, the sending apparatus layers a plurality of bits in the original information into N layers of bit sequences based on priorities of bits in the original information. For example, at a granularity of <NUM> DCT blocks, the bit sequences in the original information are grouped into eight layers, and a quantity of bits distributed in each layer is <NUM>, or an integer multiple of <NUM>.

Step <NUM>: The sending apparatus uses any layer of the N layers of bit sequences as the information bits.

The sending apparatus may obtain the to-be-encoded information bits. Certainly, the sending apparatus may alternatively obtain the to-be-encoded information bits in other ways.

Optionally, the quantity n<NUM> of the first transmission bits is determined based on the priorities of the information bits. Different priorities of the first transmission bits distributed on different bit planes correspond to different quantities of configured first transmission bits. A higher-priority bit plane has a larger quantity of configured first transmission bits, so as to ensure data transmission reliability.

Video transmission is used as an example. Because the high-priority information bits are more critical for restoring video data, if the receiving apparatus can accurately receive this part of information, basic image quality and viewing experience can be guaranteed. Regardless of a signal-to-noise ratio (signal-to-noise ratio, SNR), the high-priority information bits correspond to key information in the video data. By virtue of a more reliable channel encoding scheme, this part of information can be well restored, regardless of whether channel quality is good or not. The low-priority information bits are insensitive to the human eyes. In the case of good channel quality and a high SNR, the receiving apparatus can restore this part of information with high quality, which enhances image quality. In the case of poor channel quality and a low SNR, if the receiving apparatus cannot restore this part of information, image quality is not greatly affected. Therefore, the higher-priority information bits correspond to a larger quantity of first transmission bits and a higher coding rate used, so as to improve the data transmission reliability. The lower-priority information bits correspond to a smaller quantity of first transmission bits and a lower coding rate used, so as to avoid wasting transmission resources. In addition, during video data transmission, if a video rate does not match a channel capacity, and a value of channel noise is greater than a predicted value, reconstructed video is greatly distorted. Moreover, when the value of channel noise is smaller than the predicted value, distortion of the reconstructed video is not reduced. Such phenomenon may be called a cliff effect. If the information bits of different priorities are configured with different quantities of the first transmission bits, the information bits of different priorities can have a strong adaptability to a channel, to avoid the cliff effect and reduce delay required for retransmission and feedback, guaranteeing low-latency video transmission.

S601: The sending apparatus determines a first LDPC matrix based on the quantity n<NUM> of the first transmission bits.

A coding length corresponding to the first LDPC matrix is fixed, to be specific, a quantity of columns of the first LDPC matrix is fixed. The quantity n<NUM> of the first transmission bits has a correspondence with a coding rate of the first LDPC matrix. A larger quantity n<NUM> of the first transmission bits means a lower coding rate of the first LDPC matrix. The following example is used.

If n<NUM> ∈ [N<NUM>, N<NUM>) or n<NUM> ∈ [<NUM>, N<NUM>), the coding rate of the first LDPC matrix is a first coding rate.

If n<NUM> ∈ [N<NUM>, N<NUM>), the coding rate of the first LDPC matrix is a second coding rate.

If n<NUM> ∈ [N<NUM>, N<NUM>), the coding rate of the first LDPC matrix is a third coding rate.

If n<NUM> ∈ [N<NUM>, N<NUM>] or n<NUM>〉N<NUM>, the coding rate of the first LDPC matrix is a fourth coding rate.

The first coding rate is greater than the second coding rate, the second coding rate is greater than the third coding rate, the third coding rate is greater than the fourth coding rate, and N<NUM>〈N<NUM>〈N<NUM>〈N<NUM>〈N<NUM>.

The sending apparatus may determine the coding rate of the first LDPC matrix based on the quantity of the first transmission bits, to encode the information bits. In a conventional technology, an LDPC matrix with a same coding rate is used to encode information bits, resulting in poor data transmission reliability and large transmission resource overheads. In this embodiment of this application, the sending apparatus selects the first LDPC matrix with a different coding rate based on the quantity of the first transmission bits, to encode the information bits. Different to-be-transmitted information bits correspond to different quantities of the first transmission bits, and further, to different coding rates of the selected first LDPC matrix. For the higher-priority information bits, a lower coding rate of the first LDPC matrix is selected, ensuring data transmission reliability. For the lower-priority information bits, a higher coding rate of the first LDPC matrix is selected, reducing data transmission resource overheads.

In a practical application process, the codeword obtained by encoding the information bits by using the first LDPC matrix includes three coding lengths: <NUM>, <NUM>, and <NUM>. Video transmission is used as an example. Most packets in the video transmission are long packets, and the first LDPC matrix with a coding length of <NUM> is mostly used, meaning that a quantity of columns of the first LDPC matrix is <NUM>. Taking the coding length of <NUM>, according to the present invention, N<NUM>=<NUM>, N<NUM>=<NUM>, N<NUM>=<NUM>, N<NUM>=<NUM>, and N<NUM>=<NUM>. The first coding rate is <NUM>/<NUM>, the second coding rate is <NUM>/<NUM>, the third coding rate is <NUM>/<NUM>, and the fourth coding rate is <NUM>/<NUM>. The following gives specific descriptions.

If n<NUM> ∈ [<NUM>,<NUM>) or n<NUM> ∈ [<NUM>,<NUM>), the coding rate of the first LDPC matrix is R = <NUM>/<NUM>.

If n<NUM> ∈ [<NUM>,<NUM>), the coding rate of the first LDPC matrix is R = <NUM>/<NUM>.

If n<NUM> ∈ [<NUM>,<NUM>] or n<NUM>〉<NUM>, the coding rate of the first LDPC matrix is R = <NUM>/<NUM>.

S602: The sending apparatus encodes the information bits based on the first LDPC matrix, to obtain the first transmission bits.

Different coding rates of the first LDPC matrix lead to different bit positions of the first transmission bits in a first codeword.

Optionally, refer to <FIG>. A specific implementation process of S602 includes S6021 and S6022.

S6021: The sending apparatus encodes the information bits based on the first LDPC matrix, to obtain a first codeword.

The first codeword includes the information bits and m check bits.

For example, the coding length is still <NUM>. If n<NUM> ∈ [<NUM>,<NUM>) or n<NUM> ∈ [<NUM>,<NUM>), the coding rate of the first LDPC matrix is R = <NUM>/<NUM>. The information bits are encoded by using the first LDPC matrix with the coding rate of R = <NUM>/<NUM> , to obtain the first codeword. In this case, the first codeword includes the information bits and <NUM> check bits (as shown in the part filled with slashes in <FIG>). If the quantity of the information bits is less than <NUM>, the first codeword further includes shortened all-zero bits (as shown in the part filled with grid in <FIG>). The quantity of the information bits and shortened all-zero bits is <NUM>.

If n<NUM> ∈ [<NUM>,<NUM>), the coding rate of the first LDPC matrix is R = <NUM>/<NUM>. The information bits are encoded by using the first LDPC matrix with the coding rate of R = <NUM>/<NUM> , to obtain the first codeword. In this case, the first codeword includes the information bits and <NUM> check bits. If the quantity of the information bits is less than <NUM>, the first codeword further includes shortened all-zero bits. The quantity of the information bits and shortened all-zero bits is <NUM>.

If n<NUM> ∈ [<NUM>,<NUM>] or n<NUM>〉<NUM>, the coding rate of the first LDPC matrix is R = <NUM>/<NUM>. The information bits are encoded by using the first LDPC matrix with the coding rate of R = <NUM>/<NUM>, to obtain the first codeword. In this case, the first codeword includes the information bits and <NUM> check bits (as shown in the part filled with slashes in <FIG>). If the quantity of the information bits is less than <NUM>, the first codeword further includes shortened all-zero bits (as shown in the part filled with grids in <FIG>). The quantity of the information bits and shortened all-zero bits is <NUM>.

S6022: The sending apparatus determines the first transmission bits from the first codeword based on the quantity n<NUM> of the first transmission bits.

Different quantities of the first transmission bits correspond to different bits included in the first transmission bits. For example, the first transmission bits include a part of m check bits, or the first transmission bits include m check bits, or the first transmission bits include m check bits and a part of the information bits, or the first transmission bits include the first codeword; or the quantity of the first transmission bits is zero.

In an example, if n<NUM> ∈ [<NUM>, N<NUM>), the first transmission bits include the first n<NUM> bits in the m check bits. Herein, the first transmission bits may alternatively be n<NUM> bits selected from the m check bits according to a preset selection rule.

If n<NUM> ∈ [N<NUM>, N<NUM>), the first transmission bits include the m check bits and the first (n<NUM> -m) bits in the information bits.

If n<NUM> ∈ [N<NUM>, N<NUM>], the first transmission bits include the m check bits and the first (n<NUM> -m) bits in the information bits. Herein, the sending apparatus may alternatively select (n<NUM> -m) bits from the information bits according to a preset selection rule.

If n<NUM>〉N<NUM>, the first transmission bits include the information bits and the m check bits. In an actual application process, because a total quantity of the information bits and the m check bits is still less than n<NUM>, the sending apparatus may sequentially select bits from the foregoing "information bits and m check bits" until a quantity of bits is equal to n<NUM>.

In this embodiment of this application, the sending apparatus determines the first transmission bits based on the quantity of the first transmission bits. Because the higher-priority information bits correspond to a larger quantity of the first transmission bits, the information bits may be encoded by using the first LDPC matrix with a low coding rate, so as to ensure information transmission reliability. Because the lower-priority information bits correspond to a smaller quantity of the first transmission bits, the information bits may be encoded by using the first LDPC matrix with a high coding rate, so as to reduce data transmission resource overheads. Compared with a method for encoding information bits of different priorities by using an LDPC matrix with a fixed coding rate, the encoding and decoding method provided in this embodiment of this application is more flexible and reliable.

For example, the coding length is <NUM>, N<NUM>=<NUM>, N<NUM>=<NUM>, N<NUM>=<NUM>, N<NUM>=<NUM>, and N<NUM>=<NUM>. The first coding rate is <NUM>/<NUM>, the second coding rate is <NUM>/<NUM>, the third coding rate is <NUM>/<NUM>, and the fourth coding rate is <NUM>/<NUM>. The following gives specific descriptions.

If n<NUM> ∈ [<NUM>,<NUM>), the first transmission bits include a part of the <NUM> check bits, for example, the first n<NUM> bits, as specifically shown by the thick line box in <FIG>, or the first transmission bits are a part of the <NUM> check bits that satisfy another selection rule.

If n<NUM> ∈ [<NUM>,<NUM>), the first transmission bits include the check bits and a part of the information bits. Herein, the part of the information bits may be the first (n<NUM>-<NUM>) bits in the information bits, or a part of the information bits that satisfy another selection rule.

If n<NUM> ∈ [<NUM>,<NUM>], the first transmission bits include the check bits and a part of the information bits. Herein, the part of the information bits may be the first (n<NUM>-<NUM>) bits in the information bits, as specifically shown in the black line box in <FIG>, or a part of the information bits that satisfy another selection rule.

If n<NUM>〉<NUM>, the first transmission bits include the information bits and m check bits. For example, the sending apparatus may sequentially select bits in the foregoing "information bits and m check bits" until a quantity of bits is equal to n<NUM>. If all of the foregoing "information bits and m check bits" are selected and a total quantity is still less than n<NUM>, the sending apparatus sequentially selects bits from the foregoing "information bits and m check bits" again until the quantity of bits is equal to n<NUM>.

S603: The sending apparatus sends the first transmission bits to a receiving apparatus. Correspondingly, the receiving apparatus receives the first transmission bits from the sending apparatus.

S604: The receiving apparatus determines the first LDPC matrix based on the quantity n<NUM> of the first transmission bits.

The quantity n<NUM> of the first transmission bits has a correspondence with a coding rate of the first LDPC matrix. For details, refer to the related description in S601, which is not repeated herein.

S605: The receiving apparatus decodes the first transmission bits based on the first LDPC matrix, to obtain the information bits.

Optionally, refer to <FIG>. A specific implementation process of S605 includes S6051 and <NUM>.

S6051: The receiving apparatus obtains the first codeword based on the first transmission bits and the first LDPC matrix corresponding to the quantity n<NUM> of the first transmission bits.

For example, if n<NUM> ∈ [<NUM>,<NUM>), that is, the first transmission bits include the first n<NUM> bits in the <NUM> check bits, the first codeword includes the first transmission bits and other bits. The other bits include other information bits and other check bits. An LLR value of the other information bits in the other bits is a first LLR value, and the first LLR value is a value determined based on information about a ratio of <NUM> or <NUM> in the information bits. An LLR value of the other check bits in the other bits is <NUM>. The receiving apparatus determines values of the other information bits based on the first LLR value, and then determines values of the other check bits other than the "the part of the check bits included in the first transmission bits" based on the LLR value of the other check bits, meaning that the other check bits are assigned to <NUM>. Herein, the "information about a ratio of <NUM> or <NUM> in the information bits" is also information transmitted from the sending apparatus to the receiving apparatus.

If n<NUM> ∈ [<NUM>,<NUM>), or n<NUM> ∈ [<NUM>,<NUM>), or n<NUM> ∈ [<NUM>,<NUM>), or n<NUM> ∈ [<NUM>,<NUM>], that is, the first transmission bits include the check bits and a part of the information bits, the first codeword includes the first transmission bits and other bits. The other bits include other information bits. The receiving apparatus still determines values of the other information bits other than the "the part of the information bits included in the first transmission bits" based on the first LLR value.

If n<NUM>〉<NUM>, that is, the first transmission bits include the information bits and m check bits, the first codeword includes the first transmission bits.

S6052: The receiving apparatus decodes the first codeword by using the first LDPC matrix, to obtain the information bits.

For example, if n<NUM> ∈ [<NUM>,<NUM>) or n<NUM> ∈ [<NUM>,<NUM>), the coding rate of the first LDPC matrix is R = <NUM>/<NUM>. The first codeword is decoded by using the first LDPC matrix with the coding rate of R = <NUM>/<NUM> , to obtain the information bits.

If n<NUM> ∈ [<NUM>,<NUM>), the coding rate of the first LDPC matrix is R = <NUM>/<NUM>. The first codeword is decoded by using the first LDPC matrix with the coding rate of R = <NUM>/<NUM> , to obtain the information bits.

If n<NUM> ∈ [<NUM>,<NUM>] or n<NUM>〉<NUM>, the coding rate of the first LDPC matrix is R = <NUM>/<NUM>. The first codeword is decoded by using the first LDPC matrix with the coding rate of R = <NUM>/<NUM>, to obtain the information bits.

In the encoding and decoding method provided in this embodiment of this application, the sending apparatus determines the corresponding first LDPC matrix based on the quantity of the first transmission bits. Different quantities of the first transmission bits correspond to different coding rates of the first LDPC matrix. To be specific, the first LDPC matrix with a different coding rate can be flexibly determined based on the quantity of the first transmission bits, improving flexibility and reliability of encoding and decoding. The coding rate of the first LDPC matrix is flexible, and therefore the sending apparatus can encode the information bits by flexibly using the first LDPC matrix with different coding rates. In the case of a large quantity of the first transmission bits, the information bits are encoded by using the first LDPC matrix with a low coding rate, to obtain the first transmission bits, thereby ensuring data transmission reliability. In the case of a small quantity of the first transmission bits, the information bits are encoded by using the first LDPC matrix with a high coding rate, to obtain the first transmission bits, thereby saving transmission resources. In addition, the encoding and decoding method provided in this embodiment of this application can be applied to an LDPC codec of an existing WLAN, with a flexible coding rate.

In all of the foregoing descriptions, encoding and decoding are performed at a fixed coding length. In addition, an embodiment of this application further provides an encoding and decoding method for a case in which a quantity of information bits is fixed. Refer to <FIG>. The encoding method includes the following steps.

S1000: A sending apparatus obtains information bits and a quantity n<NUM> of second transmission bits.

For specific implementation process of S1000, refer to related description in S600.

For example, at a granularity of <NUM> DCT blocks, bit sequences in original information are grouped into eight layers, and a quantity of bits distributed in each layer is <NUM>, or an integer multiple of <NUM>.

S1001: The sending apparatus processes the information bits based on the quantity n<NUM> of the second transmission bits, to obtain the second transmission bits.

Different values of the quantity n<NUM> of the second transmission bits make different processing on the information bits by the sending apparatus and different second transmission bits. Details are as follows.

If n<NUM> ∈ [<NUM>, N<NUM>) and N<NUM>=<NUM>, a specific implementation process of S1001 includes step <NUM> and step <NUM>.

Step <NUM>: The sending apparatus encodes the information bits by using an LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain a first codeword, where the first codeword includes first check bits.

A coding length corresponding to the LDPC matrix is <NUM>, meaning that a quantity of columns of the LDPC matrix is <NUM>. A coding length of the first codeword is <NUM>. The first codeword includes the information bits (as shown by an unfilled box in <FIG>), shortened all-zero bits (as shown by a box filled with grids in <FIG>), and check bits (as shown by a box filled with slashes in <FIG>).

Step <NUM>: The sending apparatus determines that the second transmission bits are the first n<NUM> check bits (as shown by the thick black line box in <FIG>) in the first check bits. Herein, the second transmission bits may alternatively be n<NUM> bits selected from the first check bits according to a preset selection rule.

If n<NUM> ∈ [N<NUM>, N<NUM>], where N<NUM> is a maximum quantity of check bits supported by an encoding and decoding system, a specific implementation process of S1001 includes step <NUM>, step <NUM>, and step <NUM>.

Step <NUM>: The sending apparatus encodes the information bits by using an LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain a first codeword, where the first codeword includes first check bits. The LDPC matrix with a coding rate of <NUM>/<NUM> is shown by the thick black line box in <FIG>.

Step <NUM>: The sending apparatus encodes the first codeword by using a low-density generator matrix (low density generator matrix, LDGM), to obtain a second codeword.

The LDGM is determined based on the quantity of the second transmission bits. Refer to <FIG>, or <FIG>. A check matrix of an RL-LDPC code includes a core matrix and an extension part. The core matrix is an LDPC matrix used by a WLAN chip (for example, an LDPC matrix that supports a coding length of <NUM> and a coding rate of <NUM>/<NUM>), as shown by the thick black line box in <FIG>, and the LDPC matrix includes a check part with a double-diagonal structure. The extension part includes an LDGM part and an identity matrix. A quantity of rows in the LDGM is determined by (n<NUM> - N<NUM>). In <FIG>, the quantity of rows in the LDGM can be determined from the square thick black dotted box. In <FIG>, the rectangular thick black dotted box shows the LDGM for encoding the first codeword. In addition, the core matrix may alternatively be an LDPC channel encoding part of a data channel for a new radio (new radio, NR) chip. Refer to <FIG>. The rectangular black dotted box in <FIG> shows an LDGM for encoding the first codeword. In this case, no information bits corresponding to punctured high weight columns (punctured high weight columns) in the check matrix of the RL-LDPC code are transmitted.

The second codeword includes second check bits (as shown by the box filled with vertical lines in <FIG>).

Step <NUM>: The sending apparatus determines that the second transmission bits include the first check bits and the second check bits, where a sum of a quantity of the first check bits and a quantity of the second check bits is n<NUM> (as shown by the black line box in <FIG>).

If n<NUM>〉N<NUM>, a specific implementation process of S1001 includes step <NUM>, step <NUM>, and step <NUM>.

Step <NUM>: The sending apparatus encodes the first codeword by using an LDGM, to obtain a second codeword.

For example, refer to <FIG>. In the LDGM part, the part covered by the black dotted box is the LDGM for encoding the first codeword.

Step <NUM>: The sending apparatus determines that the second transmission bits include the first (n<NUM>-N<NUM>) information bits in the information bits, the first check bits, and the second check bits (as shown by the black line box in <FIG>).

Based on the foregoing steps <NUM> to <NUM>, the sending apparatus can flexibly match different coding rates by using the LDGM, to encode the information bits.

S1002: The sending apparatus sends the second transmission bits to a receiving apparatus. Correspondingly, the receiving apparatus receives the second transmission bits from the sending apparatus.

S1003: The receiving apparatus processes the second transmission bits based on a quantity n<NUM> of the second transmission bits, to obtain the information bits.

Different quantities n<NUM> of the second transmission bits correspond to different second transmission bits. The following example is used.

If n<NUM> ∈ [<NUM>, N<NUM>) and N<NUM>=<NUM>, the second transmission bits are the first n<NUM> check bits in the first check bits.

If n<NUM> ∈ [N<NUM>, N<NUM>], where N<NUM> is a maximum quantity of check bits supported by an encoding and decoding system, the second transmission bits include the first check bits and the second check bits.

If n<NUM>〉N<NUM>, the second transmission bits include the first (n<NUM>-N<NUM>) information bits in the information bits, the first check bits, and the second check bits. The first check bits are obtained by encoding the information bits based on an LDPC matrix with a coding rate of <NUM>/<NUM>, and the second check bits are obtained by encoding the information bits and the first check bits based on an LDGM matrix.

Optionally, refer to <FIG>. A specific implementation process of S1003 includes S10031 and S10032.

S10031: The receiving apparatus determines a codeword based on the quantity n<NUM> of the second transmission bits.

Specifically, if n<NUM> ∈ [<NUM>, N<NUM>) and N<NUM>=<NUM>, the second transmission bits include the first check bits, the codeword includes the second transmission bits and other bits, and the other bits are information bits. In other words, the codeword includes the first check bits and the information bits.

If n<NUM> ∈ [N<NUM>, N<NUM>], where N<NUM> is a maximum quantity of check bits supported by an encoding and decoding system, the second transmission bits include the first check bits and the second check bits, the codeword includes the second transmission bits and other bits, and the other bits are information bits. In other words, the codeword includes the first check bits, the second check bits, and the information bits.

If n<NUM>〉N<NUM>, the second transmission bits include the first (n<NUM>-N<NUM>) information bits in the information bits, the first check bits, and the second check bits. The codeword includes the second transmission bits and other bits, and the other bits are a part of the information bits. In other words, the codeword includes the first check bits, the second check bits, and the information bits.

S10032: The receiving apparatus decodes the codeword, to obtain the information bits.

Specifically, if n<NUM> ∈ [<NUM>, N<NUM>), a specific implementation process of S10032 includes step <NUM>.

Step <NUM>: The receiving apparatus decodes the codeword by using an LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain the information bits.

A coding length supported by the LDPC matrix is <NUM>, meaning that a quantity of columns of the LDPC matrix is <NUM>.

If n<NUM> ∈ [N<NUM>, N<NUM>] or n<NUM>〉N<NUM>, a specific implementation process of S10032 includes step <NUM> and step <NUM>.

Step <NUM>: The receiving apparatus decodes the codeword by using an LDGM matrix, to obtain a first codeword.

The first codeword includes the information bits and the first check bits.

Step <NUM>: The receiving apparatus decodes the first codeword by using an LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain the information bits.

A coding length corresponding to the LDPC matrix is <NUM>.

The receiving apparatus performs different processing on the second transmission bits based on the quantity of the second transmission bits, to obtain the corresponding information bits.

In the encoding and decoding method provided in this embodiment of this application, the sending apparatus processes the information bits based on the quantity of the second transmission bits, to obtain the second transmission bits of a corresponding quantity. Different quantities of the second transmission bits correspond to different processes for processing the information bits. To be specific, based on the quantity of the second transmission bits, the receiving apparatus may perform processing on the information bits by using different coding rates, so that the sending apparatus can flexibly match different coding rates. The sending apparatus performs corresponding processing on the information bits based on the quantity of the second transmission bits, to obtain the second transmission bits of a corresponding quantity. In the case of a large quantity of the second transmission bits, the information bits are encoded by using a matrix with a low coding rate, to obtain the second transmission bits, thereby ensuring data transmission reliability. In the case of a small quantity of the second transmission bits, the information bits are encoded by using a matrix with a high coding rate, to obtain the second transmission bits, thereby saving transmission resources.

Both of the two encoding and decoding methods proposed in this application can be applied to a data processing process shown in <FIG>. Refer to <FIG>. The sending apparatus performs layering according to priorities of information bits in video data. Layered control information (for example, layered bit width information) is transmitted over a control signal channel. The control information undergoes channel encoding, BPSK modulation, and resource mapping. Layered information bits are transmitted over a data signal channel. Data information of different priorities is distributed in different bit planes. The following uses two bit planes as an example to separately illustrate the two encoding and decoding methods.

Example <NUM>: The first encoding and decoding method is used.

Different quantities of the first transmission bits are configured for the two bit planes. The sending apparatus separately executes S600, S601, and <NUM> on data information in different bit planes, to obtain first transmission bits in the first bit plane and first transmission bits in the second bit plane. For example, for the information bits distributed in the first bit plane, a quantity of the first transmission bits is <NUM>, a coding rate of the first LDPC matrix is <NUM>/<NUM>, and a quantity of columns in the first LDPC matrix is <NUM>. The sending apparatus encodes the information bits in the first bit plane by using the first LDPC matrix with the coding rate of <NUM>/<NUM>, to obtain a codeword with a coding length of <NUM>, and further obtains the first transmission bits in the first bit plane. For the information bits distributed in the second bit plane, a quantity of the first transmission bits is <NUM>, and a coding rate of the first LDPC matrix is <NUM>/<NUM>. The sending apparatus encodes the information bits in the second bit plane by using the first LDPC matrix with the coding rate of <NUM>/<NUM>, to obtain a codeword with a coding length of <NUM>, and further obtains the first transmission bits in the second bit plane. The sending apparatus performs bit stream splicing, symbol modulation, symbol sequence splicing, and resource mapping on encoded information, and maps a signal to a resource block. After block (block) assembly (for example, adding a preamble (preamble) or a demodulation pilot reference signal) is performed on the signal, the sending apparatus sends the signal.

The receiving apparatus performs synchronization, channel estimation, and equalization processing on the received signal, and then obtains control information and data information through resource demapping. Demodulation and channel decoding are performed on the control information, to obtain the layered bit width information. Symbol sequence splitting, demodulation, bit stream splitting, and the like are performed on the data information, to obtain the first transmission bits of each layer, and then S604 and S605 are executed, to obtain the information bits of each layer. For example, for the first transmission bits distributed in the first bit plane, the quantity of the first transmission bits is <NUM>, and the receiving apparatus determines that a coding length of the first codeword including the first transmission bits is <NUM>. The receiving apparatus determines values of the other information bits in the first codeword based on a first LLR value of the control information. The receiving apparatus then decodes the first codeword in the first bit plane by using the first LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain the information bits in the first bit plane. For the first transmission bits distributed in the second bit plane, the quantity of the first transmission bits is <NUM>, and the receiving apparatus determines that a coding length of the first codeword including the first transmission bits is <NUM>. The receiving apparatus determines values of the other information bits in the first codeword based on a first LLR value of the control information. The receiving apparatus then decodes the first codeword by using the first LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain the information bits in the second bit plane. The receiving apparatus restores original source information based on the information bits of each layer, that is, obtains target information.

Example <NUM>: The second encoding and decoding method is used.

Different quantities of the second transmission bits are configured for the two bit planes. The sending apparatus separately executes S1000 and S1001 on data information in different bit planes, to obtain second transmission bits in the first bit plane and second transmission bits in the second bit plane. For example, for the information bits distributed in the first bit plane, a quantity of the second transmission bits is <NUM>, and a coding rate of the LDPC matrix is <NUM>/<NUM>. The sending apparatus encodes the information bits in the first bit plane by using the LDPC matrix with the coding rate of <NUM>/<NUM>, to obtain a codeword with a coding length of <NUM>, and further obtains the second transmission bits in the first bit plane. For the information bits distributed in the second bit plane, a quantity of the second transmission bits is <NUM>. The sending apparatus encodes the information bits in the second bit plane by using the LDPC matrix with the coding rate of <NUM>/<NUM>, to obtain a codeword with a coding length of <NUM>, encodes the codeword with the coding length of <NUM> by using the LDGM, and further obtains the second transmission bits in the second bit plane. Bit stream splicing, symbol modulation, symbol sequence splicing, and resource mapping are performed on encoded information, and a signal is mapped to a resource block. After block (block) assembly (for example, adding a preamble (preamble) or a demodulation pilot reference signal) is performed on the signal, the sending apparatus sends the signal.

The receiving apparatus performs synchronization, channel estimation, and equalization processing on the received signal, and then obtains control information and data information through resource demapping. Demodulation and channel decoding are performed on the control information, to obtain the layered bit width information. Symbol sequence splitting, demodulation, bit stream splitting, and the like are performed on the data information, to obtain the second transmission bits of each layer, and then S1003 is executed, to obtain the information bits of each layer. For example, for the second transmission bits distributed in the first bit plane, the quantity of the second transmission bits is <NUM>, and the receiving apparatus determines that the quantity of the information bits in the codeword corresponding to the second transmission bits is <NUM>. The receiving apparatus determines values of the other information bits in the codeword based on a first LLR value of the control information. The receiving apparatus then decodes the codeword in the first bit plane by using the LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain the information bits in the first bit plane. For the second transmission bits distributed in the second bit plane, the quantity of the second transmission bits is <NUM>, and the receiving apparatus determines that the quantity of the information bits in the codeword corresponding to the second transmission bits is <NUM>. The receiving apparatus determines values of the other information bits in the codeword based on a first LLR value of the control information. The receiving apparatus first decodes the codeword by using an LDGM, to obtain a second codeword. The second codeword includes the information bits, the first check bits, and the second check bits. The receiving apparatus then decodes the second codeword by using the first LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain the information bits in the second bit plane. Finally, the receiving apparatus restores original source information based on the information bits of each layer, that is, obtains target information.

In addition, compared with a rateless coding scheme, the encoding and decoding method provided in this embodiment of this application can increase a peak signal-to-noise ratio of video data transmission. For example, a coding rate of the rateless coding is the same as the coding rate of this application, and both are <NUM>/<NUM>. Refer to <FIG>. In a case in which the coding rates are the same in <FIG>, compared with the rateless coding scheme, the encoding and decoding method provided in this embodiment of this application has a good peak signal-to-noise ratio (peak signal to noise ratio, PSNR). A horizontal axis in <FIG> is a signal-to-noise ratio in dB. A longitudinal axis in <FIG> is a PSNR in dB. The PSNR is a variable for measuring image quality. If the PSNR is lower than or equal to <NUM> dB, the image quality is too poor to be accepted. If the PSNR is higher than <NUM> dB, the image quality is acceptable.

The solutions provided in embodiments of this application are mainly described above from the perspective of interaction between network elements. It may be understood that, to implement the foregoing functions, the sending apparatus and the receiving apparatus include corresponding hardware structures and/or software modules for executing the functions. A person skilled in the art should easily be aware that, in combination with units and algorithm steps of the examples described in embodiments disclosed in this specification, this application may be implemented by hardware or a combination of hardware and computer software. Whether a function is performed by hardware or hardware driven by computer software depends on particular applications and design constraints of the technical solutions.

For example, <FIG> is a schematic diagram of structure of a sending apparatus <NUM>. The sending apparatus may be a network device or a terminal, or may be a chip in a network device or a chip in a terminal, and is configured to implement the method relating to the sending apparatus in any of the foregoing embodiments. The sending apparatus <NUM> includes a processing unit <NUM> and a sending unit <NUM>, and optionally, may further include a storage unit <NUM>. The sending unit <NUM> may be a transmitter circuit, a transmitting machine, a transmitter, a communication interface, or an input/output interface. The processing unit <NUM> may be a processing circuit, a processor, or the like.

In a first possible implementation, the sending apparatus <NUM> is configured to implement the steps of the sending apparatus in the method embodiment corresponding to <FIG>. For example, the processing unit is configured to determine a first low-density parity-check LDPC matrix based on a quantity n<NUM> of first transmission bits; the processing unit is further configured to encode information bits based on the first LDPC matrix, to obtain the first transmission bits; and the sending unit is configured to send the first transmission bits.

In a possible design, that the processing unit is configured to encode information bits based on the first LDPC matrix, to obtain the first transmission bits includes: The processing unit is configured to: encode the information bits based on the first LDPC matrix, to obtain a first codeword, where the first codeword includes the information bits and m check bits; and determine the first transmission bits from the first codeword based on the quantity n<NUM> of the first transmission bits.

In a possible design, if n<NUM> is less than <NUM>, the first transmission bits include the first n<NUM> bits in <NUM> check bits.

If n<NUM> is greater than or equal to <NUM> and less than <NUM>, the first transmission bits include <NUM> check bits and the first (n<NUM> -<NUM>) bits in the information bits.

If n<NUM> is greater than or equal to <NUM> and less than <NUM>, the first transmission bits include <NUM> check bits and the first (n<NUM> n<NUM> -<NUM>) bits in the information bits.

If n<NUM> is greater than or equal to <NUM> and less than or equal to <NUM>, the first transmission bits include the <NUM> check bits and the first (n<NUM> n<NUM> -<NUM>) bits in the information bits.

If n<NUM> is greater than <NUM>, the first transmission bits include the information bits and <NUM> check bits.

In a possible design, if n<NUM> is less than <NUM>, the coding rate of the first LDPC matrix is <NUM>/<NUM>.

If n<NUM> is greater than or equal to <NUM> and less than <NUM>, the coding rate of the first LDPC matrix is <NUM>/<NUM>.

If n<NUM> is greater than or equal to <NUM> and less than or equal to <NUM>, the coding rate of the first LDPC matrix is <NUM>/<NUM>.

If n<NUM> is greater than <NUM>, the coding rate of the first LDPC matrix is <NUM>/<NUM>.

In a second possible implementation, the sending apparatus <NUM> is configured to implement the steps of the sending apparatus in the method embodiment corresponding to <FIG>. For example, the processing unit is configured to obtain information bits and obtain a quantity n<NUM> of second transmission bits. The processing unit is further configured to perform processing on the information bits based on the quantity n<NUM> of the second transmission bits, to obtain the second transmission bits. The sending unit is configured to send the second transmission bits.

In a possible design, if n<NUM> is less than <NUM>, that the processing unit is configured to perform processing on information bits based on the quantity n<NUM> of the second transmission bits, to obtain the second transmission bits includes: The processing unit is configured to encode the information bits by using a low-density parity-check LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain a first codeword, where the first codeword includes first check bits. The processing unit is further configured to determine that the second transmission bits are the first n<NUM> check bits in the first check bits.

If n<NUM> is greater than or equal to <NUM> and less than or equal to N5, where N5 is a maximum quantity of check bits supported by an encoding and decoding system, that the processing unit is configured to perform processing on information bits based on the quantity n<NUM> of the second transmission bits, to obtain the second transmission bits includes: The processing unit is configured to encode the information bits by using a low-density parity-check LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain a first codeword, where the first codeword includes first check bits. The processing unit is further configured to encode the first codeword by using a low-density generator matrix LDGM, to obtain a second codeword, where the second codeword includes second check bits. The processing unit is further configured to determine that the second transmission bits include the first check bits and the second check bits, where a sum of a quantity of the first check bits and a quantity of the second check bits is n<NUM>.

If n<NUM> is greater than N5, that the processing unit is configured to perform processing on information bits based on the quantity n<NUM> of the second transmission bits, to obtain the second transmission bits includes: The processing unit is configured to encode the information bits by using a low-density parity-check LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain a first codeword, where the first codeword includes first check bits. The processing unit is further configured to encode the first codeword by using a low-density generator matrix LDGM, to obtain a second codeword, where the second codeword includes second check bits. The processing unit is further configured to determine that the second transmission bits include the first (n<NUM> -N5) information bits in the information bits, the first check bits, and the second check bits.

All related content of the steps in the foregoing method embodiments may be referenced to function descriptions of a corresponding function module, and details are not described herein again.

For example, <FIG> is a schematic diagram of a structure of a receiving apparatus <NUM>. The receiving apparatus may be a network device or a terminal, or may be a chip in a network device or a chip in a terminal, and is configured to implement the method relating to the receiving apparatus in any of the foregoing embodiments. The receiving apparatus <NUM> includes a processing unit <NUM> and a receiving unit <NUM>, and optionally, may further include a storage unit <NUM>. The receiving unit <NUM> may be a receiver circuit, a receiving machine, a receiver, a communication interface, or an input/output interface. The processing unit <NUM> may be a processing circuit, a processor, or the like.

In a first possible implementation, the receiving apparatus <NUM> is configured to implement the steps of the receiving apparatus in the method embodiment corresponding to <FIG>. For example, the receiving unit is configured to receive first transmission bits. The processing unit is configured to determine a first low-density parity-check LDPC matrix based on a quantity n<NUM> of the first transmission bits. The processing unit is further configured to decode the first transmission bits based on the first LDPC matrix, to obtain information bits.

In a possible design, that the processing unit is configured to decode the first transmission bits based on the first LDPC matrix, to obtain information bits includes: The processing unit is configured to obtain a first codeword based on the first transmission bits and the first low-density parity-check LDPC matrix corresponding to the quantity n<NUM> of the first transmission bits, where the first codeword includes the first transmission bits and other bits, the other bits include other information bits and other check bits, an LLR value of the other information bits in the other bits is a first LLR value, and an LLR value of the other check bits in the other bits is <NUM>. The processing unit is further configured to decode the first codeword by using the first LDPC matrix, to obtain the information bits.

In a possible design, the quantity n<NUM> of the first transmission bits has a correspondence with a coding rate of the first LDPC matrix.

If n<NUM> is greater than or equal to <NUM> and less than or equal to <NUM>, the first transmission bits include the <NUM> check bits and the first (n<NUM> -<NUM>) bits in the information bits.

In a possible design, that the processing unit is configured to decode the first transmission bits based on the first LDPC matrix, to obtain information bits includes: The processing unit is configured to obtain a first codeword based on the first transmission bits and a first low-density parity-check LDPC matrix corresponding to the quantity n<NUM> of the first transmission bits. The first codeword includes the first transmission bits and other bits, the other bits include other information bits and other check bits, an LLR value of the other information bits in the other bits is a first LLR value, and an LLR value of the other check bits in the other bits is <NUM>. The processing unit is configured to decode the first codeword by using the first LDPC matrix, to obtain the information bits.

In a possible design, the first LLR value is a value determined based on information about a ratio of <NUM> or <NUM> in the information bits. The receiving apparatus can determine, based on the first LLR value, the information bits not included in the first transmission bits, to accurately determine the first codeword.

In a second possible implementation, the receiving apparatus <NUM> is configured to implement the steps of the receiving apparatus in the method embodiment corresponding to <FIG>. For example, the receiving unit is configured to receive the second transmission bits. The processing unit is configured to perform processing on the second transmission bits based on a quantity n<NUM> of the second transmission bits, to obtain information bits.

In a possible design, that the processing unit is configured to perform processing on the second transmission bits based on a quantity n<NUM> of the second transmission bits, to obtain information bits includes: The processing unit is configured to determine a codeword based on the quantity n<NUM> of the second transmission bits, where the codeword includes the second transmission bits and other bits, an LLR value of information bits in the other bits is a second LLR value, and an LLR value of check bits in the other bits is <NUM>. The processing unit is further configured to decode the codeword, to obtain the information bits.

In a possible design, if n<NUM> is less than <NUM>, and the codeword includes the information bits and first check bits, that the processing unit is configured to decode the codeword, to obtain the information bits includes: The processing unit is configured to decode the codeword by using an LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain the information bits.

If n<NUM> is greater than or equal to <NUM>, and the codeword includes the information bits, first check bits, and second check bits, that the processing unit is configured to decode the codeword, to obtain the information bits includes: The processing unit is configured to decode the codeword by using an LDGM matrix, to obtain a first codeword, where the first codeword includes the information bits and the first check bits. The processing unit is further configured to decode the first codeword by using an LDPC matrix with a coding rate of <NUM>/<NUM>, to obtain the information bits.

In this embodiment, the sending apparatus <NUM> or the receiving apparatus <NUM> is presented with the function modules implemented through integration. The "unit" herein may be an application-specific integrated circuit (application specific integrated circuit, ASIC), a processor for executing one or more software or firmware programs, a memory, an integrated logical circuit, and/or another component that can provide the foregoing function. In a simple embodiment, a person skilled in the art may think that the sending apparatus <NUM> or the receiving apparatus <NUM> may use the form of the communication device <NUM> shown in <FIG>.

For example, the processor <NUM> in the communication device <NUM> shown in <FIG> enables, by invoking computer-executable instructions stored in a memory <NUM>, the communication device <NUM> to perform the encoding and decoding method in the foregoing method embodiments.

Specifically, functions/implementation processes of the processing unit <NUM> in <FIG> may be implemented by the processor <NUM> in the communication device <NUM> shown in <FIG> by invoking the computer-executable instructions stored in the memory <NUM>. Alternatively, functions/implementation processes of the sending unit <NUM> in <FIG> may be implemented by the communication interface <NUM> in the communication device <NUM> shown in <FIG>.

The sending apparatus <NUM> provided in this embodiment may perform the foregoing encoding method. Therefore, for technical effects that can be achieved by the sending apparatus <NUM>, refer to the foregoing method embodiments. The receiving apparatus <NUM> provided in this embodiment may perform the foregoing decoding method. Therefore, for technical effects that can be achieved by the receiving apparatus <NUM>, refer to the foregoing method embodiments.

It should be noted that one or more of the foregoing modules or units may be implemented by using software, hardware, or a combination thereof. When any one of the foregoing modules or units is implemented by using software, the software exists in a form of computer program instructions, and is stored in a memory. A processor may be configured to execute the program instructions to implement the foregoing method procedures. The processor may be built into a SoC (system-on-a-chip) or an ASIC, or may be an independent semiconductor chip. The processor includes a core for executing software instructions to perform operations or processing, and may further include a necessary hardware accelerator, for example, a field programmable gate array (field programmable gate array, FPGA), a PLD (programmable logic device), or a logic circuit that implements a special-purpose logic operation.

When the foregoing modules or units are implemented by using hardware, the hardware may be any one or any combination of a CPU, a microprocessor, a digital signal processing (digital signal processing, DSP) chip, a microcontroller unit (microcontroller unit, MCU), an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator, or a non-integrated discrete device, and the hardware may run necessary software or does not depend on software to perform the foregoing method procedures.

Optionally, an embodiment of this application further provides a sending apparatus (where for example, the sending apparatus may be a chip or a chip system). The sending apparatus includes a processor, configured to implement the encoding method according to any one of the foregoing method embodiments. In a possible design, the sending apparatus further includes a memory. The memory is configured to store necessary program instructions and data. The processor may invoke program code stored in the memory, to indicate the sending apparatus to perform the encoding method according to any one of the foregoing method embodiments. Certainly, the memory may alternatively not be located in the sending apparatus. When the sending apparatus is a chip system, the sending apparatus may include a chip, or may include a chip and another discrete device. This is not specifically limited in this embodiment of this application.

Optionally, an embodiment of this application further provides a receiving apparatus (where for example, the receiving apparatus may be a chip or a chip system). The receiving apparatus includes a processor, configured to implement the decoding method according to any one of the foregoing method embodiments. In a possible design, the receiving apparatus further includes a memory. The memory is configured to store necessary program instructions and data. The processor may invoke program code stored in the memory, to indicate the receiving apparatus to perform the decoding method according to any one of the foregoing method embodiments. Certainly, the memory may alternatively not be located in the receiving apparatus. When the receiving apparatus is a chip system, the receiving apparatus may include a chip, or may include a chip and another discrete device. This is not specifically limited in this embodiment of this application.

All or a part of the foregoing embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When a software program is used to implement embodiments, all or a part of embodiments may be implemented in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or a part of the procedures or functions according to embodiments of this application are generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable apparatuses. The computer instructions may be stored in a computer-readable storage medium or may be transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line (digital subscriber line, DSL)) or wireless (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium accessible to a computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a DVD), a semiconductor medium (for example, a solid-state drive (solid state disk, SSD)), or the like.

Claim 1:
A sending apparatus (<NUM>), comprising a processing unit (<NUM>, <NUM>) and a sending unit (<NUM>), wherein
the processing unit (<NUM>, <NUM>) is configured to determine a first low-density parity-check LDPC matrix based on a quantity n<NUM> of first transmission bits;
the processing unit (<NUM>, <NUM>) is further configured to encode information bits based on the first LDPC matrix, to obtain the first transmission bits; and
the sending unit (<NUM>) is configured to send the first transmission bits; wherein the quantity n<NUM> of the first transmission bits has a correspondence with a coding rate of the first LDPC matrix,
characterised in that:
if n<NUM> is less than No, the coding rate of the first LDPC matrix is <NUM>/<NUM>;
if n<NUM> is greater than or equal to N0 and less than N1, the coding rate of the first LDPC matrix is <NUM>/<NUM>;
if n<NUM> is greater than or equal to N1 and less than N2, the coding rate of the first LDPC matrix is <NUM>/<NUM>;
if n<NUM> is greater than or equal to N2 and less than N3, the coding rate of the first LDPC matrix is <NUM>/<NUM>;
if n<NUM> is greater than or equal to N3 and less than or equal to N4, the coding rate of the first LDPC matrix is <NUM>/<NUM>; or
if n<NUM> is greater than N4, the coding rate of the first LDPC matrix is <NUM>/<NUM>; wherein
N0 is <NUM>; N1 is <NUM>; N2 is <NUM>; N3 is <NUM>; and N4 is <NUM>.