Patent Description:
A basic principle of video coding compression is to eliminate redundancy as much as possible based on a correlation between a space domain, a time domain, and a codeword. Currently, a prevalent method is to use a picture-block-based hybrid video coding framework to implement video coding compression by performing steps such as prediction (including intra prediction and inter prediction), transform, quantization, and entropy coding.

Currently, in intra prediction, a reconstructed neighbouring block of a current block is usually used to predict the current block. While in most cases only spatially neighboring blocks are considered, prior art document <CIT> discloses considering also blocks that are not spatially adjacent to the current block for the purpose of selecting the intra coding mode of the current block.

This application provides a method and an apparatus for intra prediction of a picture block, to provide a manner of predicting a current block by using spatial non-adjacent blocks and, optionally, also a temporal neighbouring block, thereby improving coding performances. The invention is defined by the appended independent claims, with further optional features and details being provided by the dependent claims.

The following clearly describes the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application.

The key feature of the invention is exemplified effectively in <FIG> and disclosed in detail in the corresponding passages of the description.

In the description the expressions "embodiment" and "invention" are not always used consistently. When used for subject-matter that does not fall under the scope of the claims said expressions are to be understood to mean "example". As a matter of fact, the scope of the invention is defined by the appended claims.

In a feasible implementation, in this application, a set (where the set may also be referred to as a list) of most probable intra prediction modes (most probable mode, MPM) in intra prediction modes and a set of selected intra prediction modes (selected modes) are constructed, and a chroma intra prediction mode (which may be referred to as a set of conventional chroma intra modes in this application) is improved. For example, according to some video coding technologies, a video encoder may construct the set of MPMs or selected modes or the set of conventional chroma intra modes before determining and signalling intra prediction information of a current encoding block; or a video decoder may construct the set of MPMs or selected modes or the set of conventional chroma intra modes before determining and receiving intra prediction information of a current decoding block. This application relates to the construction of the set of MPMs or selected modes or the set of conventional chroma intra modes, so as to select a proper method to encode and decode an intra prediction mode. In this way, prior information obtained in a coding process is more effectively used, so that coding performance is improved.

It should be noted that a capacity of the set of MPMs or selected modes or a capacity of the set of conventional chroma intra modes is limited. For differentiation, the capacity of the set of MPMs is a first preset value, the capacity of the set of selected modes is a second preset value, and the capacity of the set of conventional chroma intra modes is a third preset value.

In a feasible implementation, candidate luma intra prediction modes are classified into luma intra prediction modes in the set of MPMs and remaining luma intra prediction modes. The video encoder may generate, from the set of MPMs, a list of MPMs in order (for example, a decoding order) in which the MPMs appear in a picture or a slice of video data. The list includes an intra prediction mode. In another feasible implementation, the video decoder may check intra prediction modes of spatial adjacent or non-adjacent blocks, or temporal neighboring blocks to generate a list of MPMs. The video encoder may signal the MPMs based on indexes of the generated list without ordering or reordering the MPMs in the list. The video decoder may perform the same process to generate a list of MPMs, obtain indexes of the list from an encoded bitstream, and select an MPM from the list based on the indexes without ordering or reordering the MPMs in the list. In a feasible implementation, candidate luma intra prediction modes are classified into intra prediction modes in the set of MPMs, luma intra prediction modes in the set of selected modes, and remaining luma intra prediction modes. The remaining luma intra prediction modes may also be referred to as luma intra prediction modes in a set of non-selected modes. The intra prediction modes in the set of selected modes are processed by using a same principle as that for processing the intra prediction modes in the set of MPMs. Details are not described again. In a feasible implementation, candidate chroma intra prediction modes are classified into chroma intra prediction modes in the set of conventional chroma intra modes and remaining chroma intra prediction modes. The video encoder may check intra prediction modes of spatial adjacent or non-adjacent blocks or temporal neighboring blocks to generate the set of conventional chroma intra modes.

In a feasible implementation, for illustration, the video decoder may first check whether an intra prediction mode of a block located on the left of a current decoding block (referred to as a "left neighboring block" in this specification) is the same as an intra prediction mode of the current block. The video decoder may then check whether an intra prediction mode of a block above the current decoding block (referred to as an "upper neighboring block" in this specification) is the same as the intra prediction mode of the current block. In this feasible implementation, according to the aspects of this application, the intra prediction mode of the left neighboring block may have an index of <NUM> in the list of MPMs that is maintained by the video decoder, and the intra prediction mode of the upper neighboring block may have an index of <NUM> in the list. In this case, the video encoder may signal the index <NUM> of the intra mode of the left neighboring block and the index <NUM> of the upper neighboring block regardless of whether an actual intra prediction mode number (for example, a predefined mode number specified in a video coding standard) of the left neighboring block is greater than that of the upper neighboring block. Alternatively, if the video decoder checks the intra prediction mode of the upper neighboring block before checking the intra prediction mode of the left neighboring block, the video decoder may signal the index <NUM> of the upper neighboring block and the index <NUM> of the left neighboring block. In any case, according to these feasible implementations and aspects of this application, the video encoder may signal indexes of intra modes without reordering or ordering the intra prediction modes in the list. In some feasible implementations, if an intra mode is not one of the MPMs, ordering may be applied to intra prediction mode decoding. In other words, when signaling intra prediction modes that are not MPMs, the video encoder may order a list of the intra prediction modes or modify a list of the intra prediction modes in another manner. In this application, an order in which the video decoder checks intra prediction modes of neighboring blocks (referred to as a "check order" in this specification) may be used to implicitly derive an intra prediction mode based on statistical data collected for intra prediction modes of previously decoded blocks. In other feasible implementations, the video decoder may derive a check order based on availability of neighboring blocks. In a further feasible implementation, the video encoder may signal an explicit indication of the check order (and the video decoder may obtain the check order from an encoded bitstream). Similarly, the set of selected modes and the set of conventional chroma intra modes are processed by using a similar method and a feasible implementation, and details are not described again.

A solution for intra prediction of a picture block provided in the embodiments of this application may be applied to video picture encoding or decoding. <FIG> is a schematic block diagram of a video coding system <NUM> according to an embodiment of this application. As shown in <FIG>, the system <NUM> includes a source apparatus <NUM> and a destination apparatus <NUM>. The source apparatus <NUM> generates encoded video data and sends the encoded video data to the destination apparatus <NUM>. The destination apparatus <NUM> is configured to receive the encoded video data, decode the encoded video data, and display decoded video data. The source apparatus <NUM> and the destination apparatus <NUM> may include any one of a wide range of apparatuses, including a desktop computer, a laptop computer, a tablet computer, a set-top box, a mobile phone such as a so-called "smart" phone, a so-called "smart" touch panel, a television, a camera, a display apparatus, a digital media player, a video gaming console, a video streaming transmission apparatus, and the like.

The destination apparatus <NUM> may receive to-be-decoded encoded video data via a link <NUM>. Any kind of medium or apparatus capable of transmitting the encoded video data from the source apparatus <NUM> to the destination apparatus <NUM> may be included on the link <NUM>. In a possible implementation, a communications medium enabling the source apparatus <NUM> to directly transmit the encoded video data to the destination apparatus <NUM> in real time may be included on the link <NUM>. The encoded video data may be modulated according to a communications standard (for example, a wireless communication protocol) and transmitted to the destination apparatus <NUM>. The communications medium may include any wireless or wired communications medium, for example, a radio spectrum or one or more physical transmission lines. The communications medium may constitute a part of a packet-based network (for example, a local area network, a wide area network, or a global network of the internet). The communications medium may include a router, a switch, a base station, or any other device for facilitating communication from the source apparatus <NUM> to the destination apparatus <NUM>.

Alternatively, the video coding system <NUM> further includes a storage apparatus. Encoded data may be output to the storage apparatus through an output interface <NUM>. Similarly, the encoded data may be accessed from the storage apparatus through an input interface <NUM>. The storage apparatus may include any one of a variety of distributed or local data storage media, for example, a hard disk drive, a Blu-ray disc, a DVD, a CD-ROM, a flash memory, a volatile or non-volatile storage, or any other appropriate digital storage medium used for storing the encoded video data. In another feasible implementation, the storage apparatus may correspond to a file server or another intermediate storage apparatus that is capable of keeping an encoded video generated by the source apparatus <NUM>. The destination apparatus <NUM> may access the stored video data from the storage apparatus through streaming transmission or downloading. The file server may be any type of server capable of storing the encoded video data and transmitting the encoded video data to the destination apparatus <NUM>. In a feasible implementation, the file server includes a website server, a file transfer protocol server, a network-attached storage apparatus, or a local disk drive. The destination apparatus <NUM> may access the encoded video data through any standard data connection including an internet connection. The data connection may include a wireless channel (for example, a Wi-Fi connection), a wired connection (for example, a cable modem), or a combination thereof, that is suitable for accessing the encoded video data stored on the file server. Transmission of the encoded video data from the storage apparatus may be streaming transmission, downloading transmission, or a combination thereof.

Technologies in this application are not necessarily limited to wireless applications or settings. The technologies may be applied to video coding, to support any one of a variety of multimedia applications, for example, over-the-air television broadcasting, cable television transmission, satellite television transmission, streaming video transmission (for example, through the internet), digital video coding for storage on a data storage medium, decoding of digital video stored on a data storage medium, or the like. In some possible implementations, the system <NUM> may be configured to support unidirectional or bidirectional video transmission, so as to support applications such as video streaming transmission, video playing, video broadcasting, and/or videotelephony.

In a possible implementation of <FIG>, the source apparatus <NUM> may include a video source <NUM>, a video encoder <NUM>, and the output interface <NUM>. In some applications, the output interface <NUM> may include a modulator/demodulator (a modem) and/or a transmitter. In the source apparatus <NUM>, the video source <NUM> may include, for example, the following source devices: a video capturing apparatus (for example, a video camera), an archive including a previously captured video, a video feed-in interface for receiving a video from a video content provider, and/or a computer graphics system for generating computer graphics data as a source video, or a combination thereof. In a possible implementation, if the video source <NUM> is a video camera, the source apparatus <NUM> and the destination apparatus <NUM> may constitute a so-called camera phone or a video phone. For example, the technologies described in this application may be applied to video coding, and may be applied to wireless and/or wired applications.

The video encoder <NUM> may encode a video that is captured or pre-captured, or generated through calculation. The encoded video data may be directly transmitted to the destination apparatus <NUM> through the output interface <NUM> of the source apparatus <NUM>. The encoded video data may also (or alternatively) be stored on the storage apparatus for subsequent access by the destination apparatus <NUM> or another apparatus for decoding and/or playing.

The destination apparatus <NUM> includes the input interface <NUM>, a video decoder <NUM>, and a display apparatus <NUM>. In some applications, the input interface <NUM> may include a receiver and/or a modem. The input interface <NUM> of the destination apparatus <NUM> receives the encoded video data via the link <NUM>. The encoded video data transmitted or provided to the storage apparatus via the link <NUM> may include a plurality of syntactic elements generated by the video encoder <NUM> for the video decoder <NUM> to decode video data. These syntax elements may be included in the encoded video data that is transmitted on the communications medium and that is stored in the storage medium or stored on the file server.

The display apparatus <NUM> may be integrated with the destination apparatus <NUM> or disposed outside the destination apparatus <NUM>. In some possible implementations, the destination apparatus <NUM> may include an integrated display apparatus and also be configured to connect to an interface of an external display apparatus. In other possible implementations, the destination apparatus <NUM> may be a display apparatus. Generally, the display apparatus <NUM> displays decoded video data to a user, and may include any of a variety of display apparatuses, for example, a liquid crystal display, a plasma display, an organic light-emitting diode display, or another type of display apparatus.

The video encoder <NUM> and the video decoder <NUM> may operate according to, for example, a next-generation video coding compression standard (H. <NUM>) that is currently being developed, and may comply with an H. <NUM> test model (JEM). Alternatively, the video encoder <NUM> and the video decoder <NUM> may operate according to, for example, other dedicated or industrial standards or their extensions of the ITU-T H. <NUM> standard or the ITU-T H. <NUM> standard, where the ITU-T H. <NUM> standard is also referred to as a high efficiency video coding standard. Alternatively, the ITU-T H. <NUM> standard is also referred to as MPEG-<NUM> Part <NUM>, or advanced video coding (advanced video coding, AVC). However, the technologies of this application are not limited to any specific coding standard. Other possible implementations of the video compression standard include MPEG-<NUM> and ITU-TH.

Although not shown in <FIG>, in some aspects, the video encoder <NUM> and the video decoder <NUM> may be integrated with an audio encoder and an audio decoder, respectively, and may include an appropriate multiplexer-demultiplexer (MUX-DEMUX) unit or other hardware and software to encode both audio and video in a same data stream or separate data streams. If applicable, in some feasible implementations, the MUX-DEMUX unit may comply with the ITU H. <NUM> multiplexer protocol or another protocol such as the user datagram protocol (UDP).

The video encoder <NUM> and the video decoder <NUM> each may be implemented as any one of a variety of appropriate encoder circuitry, for example, one or more microprocessors, digital signal processors (digital signal processing, DSP), application specific integrated circuits (application specific integrated circuit, ASIC), field-programmable gate arrays (field-programmable gate array, FPGA), discrete logic, software, hardware, firmware, or any combination thereof. When some of the technologies are implemented as software, an apparatus may store an instruction for the software into an appropriate non-transitory computer-readable medium, and execute the instruction in a form of hardware by using one or more processors, to implement the technologies in this application. The video encoder <NUM> and the video decoder <NUM> each may be included in one or more encoders or decoders, and any one of the one or more encoders or decoders may be integrated as a part of a combined encoder/decoder (CODEC) in a corresponding apparatus.

The JCT-VC has developed the H. <NUM> (HEVC) standard. HEVC standardization is based on an evolved model of a video coding apparatus, and the model is referred to as an HEVC test model (HM). A latest H. <NUM> standard document is available at http://www. int/rec/T-REC-H. A latest version of the standard document is H. <NUM> (<NUM>/<NUM>). In the HM, it is assumed that the video coding apparatus has several additional capabilities compared with an existing algorithm of ITU-TH. For example, H. <NUM> provides nine intra prediction coding modes, whereas the HM can provide up to <NUM> intra prediction coding modes.

The JVET is committed to developing the H. <NUM> standard. <NUM> standardization process is based on an evolved model of a video coding apparatus, and the model is referred to as an H. <NUM> test model. <NUM> algorithm descriptions are available at http://phenix. fr/jvet, and latest algorithm descriptions are included in JVET-F1001-v2. In addition, reference software for the JEM test model is available at https://jvet. fraunhofer. de/svn/svn_HMJEMSoftware/.

Generally, as described in an HM working model, a video frame or picture may be split into a sequence of tree blocks including both luma and chroma samples or a sequence of largest coding units (largest coding unit, LCU) including both luma and chroma samples, where the LCU is also referred to as CTU. A tree block has a function similar to a macroblock in the H. <NUM> standard. A slice includes several consecutive tree blocks in a decoding order. A video frame or picture may be partitioned into one or more slices. Each tree block can be split into coding units based on a quadtree. For example, a tree block serving as a root node of the quadtree may be split into four child nodes, and each child node may serve as a parent node and be split into four other child nodes. A final non-splittable child node serving as a leaf node of the quadtree includes a decoding node, for example, a decoded video block. In syntactic data associated with a decoded bitstream, a maximum quantity of splittable times of a tree block and a minimum size of a decoding node may be defined.

A coding unit includes a decoding node, a prediction unit (prediction unit, PU), and a transform unit (transform unit, TU) associated with the decoding node. A size of the CU corresponds to a size of the decoding node, and a shape of the CU needs to be square. The size of the CU may range from <NUM> × <NUM> pixels up to at most <NUM> × <NUM> pixels, or be a larger tree block size. Each CU may include one or more PUs and one or more TUs. For example, syntactic data associated with the CU may describe partitioning of one CU into one or more PUs. Partitioning patterns may vary when the CU is encoded in a skip or direct mode, encoded in an intra prediction mode, or encoded in an inter prediction mode. The PU obtained through partitioning may be in a non-square shape. For example, the syntactic data associated with the CU may also describe partitioning of one CU into one or more TUs based on the quadtree. The TU may be in a square or non-square shape.

The HEVC standard allows TU-based transform, and TUs may be different for different CUs. A size of a TU is usually set based on a size of a PU within a given CU defined for a partitioned LCU. However, this may not always be the case. The size of the TU is generally the same as or less than the size of the PU. In some feasible implementations, a quadtree structure referred to as a "residual quadtree" (residual quadtree, RQT) may be used to split a residual sample corresponding to the CU into smaller units. A leaf node of the RQT may be referred to as a TU. A pixel difference associated with the TU may be transformed to generate a transform coefficient, and the transform coefficient may be quantized.

Generally, the PU includes data related to a prediction process. For example, when the PU is encoded in an intra mode, the PU may include data describing the intra prediction mode of the PU. In another feasible implementation, when the PU is encoded in an inter mode, the PU may include data defining a motion vector of the PU. For example, the data defining the motion vector of the PU may describe a horizontal component of the motion vector, a vertical component of the motion vector, a resolution (for example, quarter-pixel precision or one-eighth-pixel precision) of the motion vector, a reference picture to which the motion vector points, and/or a reference picture list (for example, a list <NUM>, a list <NUM>, or a list C) of the motion vector.

Generally, transform and quantization processes are used for the TU. A given CU including one or more PUs may also include one or more TUs. After prediction, the video encoder <NUM> may calculate a residual value corresponding to the PU. The residual value includes a pixel difference, and the pixel difference may be transformed into a transform coefficient, the transform coefficient is quantized, and the TU is scanned, to generate serialized transform coefficients for entropy decoding. In this application, the term "picture block" is usually used to indicate a decoding node of a CU. In some specific applications, in this application, the term "picture block" may also be used to indicate a tree block including a decoding node, a PU, and a TU. For example, the tree block is an LCU or a CU.

A video sequence usually includes a series of video frames or pictures. For example, a group of pictures (group of picture, GOP) includes a series of video pictures, one video picture, or a plurality of video pictures. The GOP may include syntactic data in header information of the GOP, in header information of one or more of the pictures, or elsewhere, and the syntactic data describes a quantity of pictures included in the GOP. Each slice of a picture may include slice syntactic data describing a coding mode of the corresponding picture. The video encoder <NUM> usually performs an operation on a video block in a video slice, to encode video data. The video block may correspond to the decoding node in the CU. A size of the video block may be fixed or changeable, and may vary according to a specified coding standard.

In a feasible implementation, the HM supports prediction for a variety of PU sizes. Assuming that a size of a specific CU is 2N × 2N, the HM supports intra prediction for a PU size of 2N × 2N or N × N, and inter prediction for a symmetric PU size of 2N × 2N, 2N × N, N × 2N, or N × N. The HM also supports asymmetric partitioning for inter prediction for PU sizes of 2N × nU, 2N × nD, nL × 2N, and nR × 2N. In asymmetric partitioning, the CU is not partitioned in one direction, and is partitioned into two parts in the other direction, where one part occupies <NUM>% of the CU and the other part occupies <NUM>% of the CU. The part occupying <NUM>% of the CU is indicated by an indicator including "n" followed by "U (Up)", "D (Down)", "L (Left)" or "R (Right)". Therefore, for example, "2N × nU" refers to a horizontally partitioned 2N × 2N CU, with a 2N × <NUM>. 5N PU at the top and a 2N × <NUM>. 5N PU at the bottom.

In this application, "N × N" and "N multiplied by N" may be used interchangeably to indicate a pixel size of a picture block in a vertical dimension and a horizontal dimension, for example, <NUM> × <NUM> pixels or <NUM> multiplied by <NUM> pixels. Usually, a <NUM> × <NUM> block has <NUM> pixels (y = <NUM>) in a vertical direction and <NUM> pixels (x = <NUM>) in a horizontal direction. Similarly, an N × N block usually has N pixels in the vertical direction and N pixels in the horizontal direction, where N represents a non-negative integer. Pixels in a block may be arranged in rows and columns. In addition, in a block, a quantity of pixels in the horizontal direction and a quantity of pixels in the vertical direction may be not necessarily the same. For example, a block may include N × M pixels, where M is not necessarily equal to N.

After intra or inter prediction decoding by a PU in a CU, the video encoder <NUM> may calculate residual data of a TU in the CU. The PU may include pixel data in a space domain (which is also referred to as a pixel domain), and the TU may include a coefficient in a transform domain obtained after transform (for example, discrete cosine transform (discrete cosine transform, DCT), integer transform, wavelet transform, or other conceptually similar transform) is applied to residual video data. The residual data may correspond to a difference between a pixel value of a picture that is not encoded and a prediction value corresponding to the PU. The video encoder <NUM> may generate a TU including residual data of the CU, and then transform the TU to generate a transform coefficient of the CU.

The JEM model further improves a video picture coding structure. Specifically, a block coding structure referred to as a "quadtree plus binary tree" (QTBT) is introduced. Without using such concepts as CU, PU, and TU in HEVC, the QTBT structure supports a more flexible CU split shape. A CU may be in a square or rectangular shape. Quadtree split is first performed on a CTU, and binary tree split is further performed on a leaf node of the quadtree. In addition, there are two binary tree split modes: symmetric horizontal partitioning and symmetric vertical partitioning. A leaf node of a binary tree is referred to as a CU. A CU in the JEM cannot be further split during prediction and transform. In other words, a CU, a PU, and a TU in the JEM have a same block size. In the existing JEM, a maximum CTU size is <NUM> × <NUM> luma pixels.

In the embodiments of this application, the video encoder may perform intra prediction to reduce spatial redundancy between pictures. As described above, a CU may have one or more prediction units PUs depending on stipulations of different video compression coding standards. In other words, a plurality of PUs may belong to a CU. Alternatively, a PU and a CU have a same size. In this specification, when the PU and the CU have a same size, a partition pattern of the CU is that the CU is not partitioned or the CU is partitioned into one PU, and the PU is uniformly used for description. When the video encoder performs intra prediction, the video encoder may signal intra prediction information for the PU to the video decoder.

In some feasible implementations, the video encoder <NUM> and/or the video decoder <NUM> may identify a so-called "most probable" intra prediction mode during intra prediction decoding. In other words, for example, the video encoder <NUM> and/or the video decoder <NUM> may identify intra prediction modes of previously decoded blocks (blocks with determined intra prediction modes may also be referred to as "reference blocks") neighbouring to a current decoding block, and compare these intra prediction modes with an intra prediction mode of the current decoding block (which is referred to as a "current block"). Due to spatial or temporal proximity of neighboring blocks to the current block, there may be a comparatively high probability that intra modes of these reference blocks are the same as or similar to an intra mode of the current block. As described in more detail below, intra prediction modes of a plurality of reference blocks may be considered during identifying of an MPM.

In addition, in some feasible implementations, the video encoder <NUM> and/or the video decoder <NUM> may signal an index used to identifying the MPM. To be specific, as defined according to a coding standard, each intra prediction mode may have an associated intra prediction mode index (an index that is pre-assigned to each mode in the standard instead of temporarily assigned in a coding process), and the intra prediction mode index is used to identify the intra prediction mode as one of a plurality of probable intra prediction modes. For example, the JEM standard can support up to <NUM> luma intra prediction modes, where an index value (for example, an index value used for looking up a table) is assigned to each luma intra prediction mode, and the index value may be used to identify the intra prediction mode.

<FIG> is a schematic block diagram of a video encoder <NUM> according to an embodiment of this application.

As shown in <FIG>, the video encoder <NUM> may include a prediction module <NUM>, a summator <NUM>, a transform module <NUM>, a quantization module <NUM>, and an entropy coding module <NUM>. In an example, the prediction module <NUM> may include an inter prediction module <NUM> and an intra prediction module <NUM>. An internal structure of the prediction module <NUM> is not limited in this embodiment of this application. Optionally, for a video encoder with a hybrid architecture, the video encoder <NUM> may further include an inverse quantization module <NUM>, an inverse transform module <NUM>, and a summator <NUM>.

In a feasible implementation of <FIG>, the video encoder <NUM> may further include a storage module <NUM>. It should be understood that the storage module <NUM> may alternatively be disposed outside the video encoder <NUM>.

In another feasible implementation, the video encoder <NUM> may further include a filter (not shown in <FIG>) to filter a boundary of a picture block, so as to remove an artifact from a reconstructed video picture. When necessary, the filter usually filters an output of the summator <NUM>.

Optionally, the video encoder <NUM> may further include a partitioning unit (not shown in <FIG>). The video encoder <NUM> receives video data, and the partitioning unit partitions the video data into picture blocks. Such partitioning may further include partitioning into slices, picture blocks, or other larger units, and (for example) video block partitioning based on quadtree structures of an LCU and a CU. For example, for the video encoder <NUM>, components for encoding video blocks in a to-be-coded video slice are described. A slice may usually be split into a plurality of picture blocks (or may be split into a set of video blocks referred to as picture blocks).

The prediction module <NUM> is configured to perform intra or inter prediction on a current coding picture block (a current block for short) to obtain a prediction value (which may be referred to as prediction information in this application) of the current block. Specifically, the inter prediction module <NUM> included in the prediction module <NUM> performs inter prediction on the current block, to obtain an inter prediction value. The intra prediction module <NUM> performs intra prediction on the current block, to obtain an intra prediction value. The inter prediction module <NUM> needs to try a plurality of reference blocks in a reference picture for the current block. One or more specific reference blocks finally used for prediction is determined through rate-distortion optimization (rate-distortion optimization, RDO) or by using another method. In some feasible implementations, the intra prediction module <NUM> may (for example) encode the current block by using various intra prediction modes during separate coding traversal.

The intra prediction module <NUM> may calculate ratios of distortions to bit rates of various encoded blocks, to determine a specific intra prediction mode that presents a best rate-distortion value of the block. According to the JEM standard, there may be up to <NUM> intra prediction modes, and each intra prediction mode may be associated with an index.

This application relates to, for example, intra decoding. Therefore, a particular technology in this application may be executed by the intra prediction module <NUM>. In other feasible implementations, one or more other units of the video encoder <NUM> may additionally or alternatively be responsible for executing the technologies in this application.

For example, the intra prediction module <NUM> may determine an intra prediction mode of a current coding block (for example, according to a rate-distortion analysis as described above). The intra prediction module <NUM> may alternatively determine an intra prediction mode or intra prediction modes (referred to as an MPM or MPMs) of one or more previously decoded blocks neighbouring to a current intra decoding block. The intra prediction module <NUM> may (for example) compare the MPM with an intra mode of the current block, to indicate a determined intra mode of the current block based on a determined intra mode of a neighboring block, as described in more detail below.

After the prediction module <NUM> generates the prediction value of the current block through inter prediction or intra prediction, the video encoder <NUM> subtracts the prediction value from the current block, to form residual information. The transform module <NUM> is configured to transform the residual information. The transform module <NUM> transforms the residual information into a residual transform coefficient by performing, for example, discrete cosine transform (DCT) or conceptually similar transform (for example, discrete sine transform DST). The transform module <NUM> may send the obtained residual transform coefficient to the quantization module <NUM>. The quantization module <NUM> quantizes the residual transform coefficient to further reduce a bit rate. In some feasible implementations, the quantization module <NUM> may continue to scan a matrix including a quantized transform coefficient. Alternatively, the entropy coding module <NUM> may perform scanning.

After quantization, the entropy coding module <NUM> may perform entropy coding on a quantized residual transform coefficient to obtain a bitstream. For example, the entropy coding module <NUM> may perform context-adaptive variable-length coding (CAVLC), context-based adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or another entropy coding method or technology. After the entropy coding module <NUM> performs entropy coding, an encoded bitstream may be transmitted to the video decoder <NUM>, or stored for subsequent transmission or retrieval by the video decoder <NUM>.

The inverse quantization module <NUM> and the inverse transform module <NUM> perform inverse quantization and inverse transform, respectively, to reconstruct a residual block in a pixel domain as a reference block of the reference picture. The summator <NUM> adds residual information obtained through reconstruction and the prediction value generated by the prediction module <NUM>, to generate a reconstructed block, and uses the reconstructed block as the reference block for storage in the storage module <NUM>. The reference block may be used by the prediction module <NUM> to perform inter or intra prediction on a block in a subsequent video frame or picture.

It should be understood that another structural variant of the video encoder <NUM> can be used to encode a video stream. For example, for some picture blocks or picture frames, the video encoder <NUM> may directly quantize the residual information without processing by the transform module <NUM> or processing by the inverse transform module <NUM>. Alternatively, for some picture blocks or picture frames, the video encoder <NUM> does not generate residual information, and correspondingly, processing by the transform module <NUM>, processing by the quantization module <NUM>, processing by the inverse quantization module <NUM>, and processing by the inverse transform module <NUM> are not required. Alternatively, the video encoder <NUM> may directly store a reconstructed picture block as a reference block without processing by a filter unit. Alternatively, the quantization module <NUM> and the inverse quantization module <NUM> in the video encoder <NUM> may be combined together. Alternatively, the transform module <NUM> and the inverse transform module <NUM> in the video encoder <NUM> may be combined together. Alternatively, the summator <NUM> and the summator <NUM> may be combined together.

<FIG> is a schematic block diagram of a video decoder <NUM> according to an embodiment of this application.

As shown in <FIG>, the video decoder <NUM> may include an entropy decoding module <NUM>, a prediction module <NUM>, an inverse quantization module <NUM>, an inverse transform module <NUM>, and a reconstruction module <NUM>. In an example, the prediction module <NUM> may include an inter prediction module <NUM> and an intra prediction module <NUM>. This is not limited in this embodiment of this application.

In a feasible implementation, the video decoder <NUM> may further include a storage module <NUM>. It should be understood that the storage module <NUM> may alternatively be disposed outside the video decoder <NUM>. In some feasible implementations, the video decoder <NUM> may perform an example decoding process inverse to the encoding process described in the video encoder <NUM> in <FIG>.

During decoding, the video decoder <NUM> receives a bitstream from the video encoder <NUM>. The entropy decoding module <NUM>, the inverse quantization module <NUM>, and the inverse transform module <NUM> successively perform entropy decoding, inverse quantization, and inverse transform respectively on the bitstream received by the video decoder <NUM>, to obtain residual information. Then, whether intra prediction or inter prediction is performed for a current block is determined based on the bitstream. If intra prediction is performed, the intra prediction module <NUM> in the prediction module <NUM> constructs prediction information according to a used intra prediction method and by using pixel values of reference pixels of reconstructed blocks around the current block. If inter prediction is performed, motion information needs to be obtained through parsing, a reference block is determined from the reconstructed picture blocks based on the motion information obtained through parsing, and pixel values of samples in the reference block are used as the prediction information. (This process is referred to as motion compensation (Motion compensation, MC)). The reconstruction module <NUM> can obtain reconstruction information by adding the prediction information and the residual information.

As noted in the foregoing, this application relates to, for example, intra decoding. Therefore, a particular technology in this application may be executed by the intra prediction module <NUM>. In other feasible implementations, one or more other units of the video decoder <NUM> may additionally or alternatively be responsible for executing the technologies in this application.

For example, the intra prediction module <NUM> may obtain, from the entropy decoding module <NUM>, an index of a list of MPMs of a current block used to decode video data. The intra prediction module <NUM> may generate a list, to which the index belongs, by adding the MPM to the list in the same manner as the video encoder <NUM>. Then, the intra prediction module <NUM> may determine, based on the obtained index, an appropriate intra mode of the current block used to decode the video data. In this manner, when the MPMs are not ordered based on intra mode index values (an index that is pre-assigned to each mode in a standard instead of temporarily assigned in a coding process) of the MPMs, the intra prediction module <NUM> may determine the appropriate MPM used for decoding the current block.

In some feasible implementations, the video decoder may identify a so-called "most probable" intra prediction mode during intra prediction decoding. In other words, for example, the video encoder (for example, the video encoder <NUM>) may identify intra prediction modes of previously encoded blocks (for example, reference blocks). Due to spatial or temporal proximity of the reference blocks to the current block, there may be a comparatively high probability that the intra prediction modes of these reference blocks are the same as or similar to an intra prediction mode of the current block. As described in more detail below, intra prediction modes of a plurality of reference blocks may be considered during identifying of an MPM.

<FIG> shows a feasible implementation of a current block ("current CU") and two reference blocks (for example, "A" and "B") that may be considered during intra decoding. For example, a video encoder (for example, the video encoder <NUM>) may consider intra modes associated with the reference block A (which is on the left of the current block) and the reference block B (which is above the current block) as MPMs of the current block. In some feasible implementations, if any one of MPM candidates (for example, for the block A or the block B) is not an intra mode, or is unavailable in another manner (for example, for a block that has not been decoded), the video encoder <NUM> may assign a default intra mode, for example, a DC mode, to the block. Similarly, in some feasible implementations, a quantity of MPMs may be greater than <NUM>. For example, the video encoder <NUM> may generate an additional MPM based on intra modes of more than two reference blocks.

If an actual intra mode (which is, for example, calculated by the intra prediction module <NUM>) of the current block is the same as that of the reference block A or the reference block B, the video encoder <NUM> may signal a <NUM>-bit flag to indicate that the MPM is used to encode the current block (for example, the MPM flag is set to "<NUM>").

In addition, in some feasible implementations, the video encoder <NUM> may signal an index used to identify the MPM. For example, <FIG> shows <NUM> intra modes supported in the JEM standard and an index value assigned to each of the intra modes.

In a feasible implementation of <FIG>, a planar mode has an original index value <NUM>, a direct current mode (DC mode) has an original index value <NUM>, and directional prediction modes have original index values <NUM> to <NUM>. The original index value refers to an index pre-assigned to each mode in a standard instead of temporarily assigned in a coding process.

In a directional prediction mode, a reference pixel is mapped to a sample in a current block in a specific direction (which is marked by using an intra mode index) to obtain a prediction value of a current sample; or for each sample in the current block, a position of the sample is reversely mapped to a reference pixel in a specific direction (which is marked by using an intra mode index), and correspondingly, a pixel value of the reference pixel is a prediction value of a current sample.

A difference from the directional prediction mode lies in that, in the DC mode, an average value of reference pixels is used as a prediction value of a pixel in a current block, while in the planar mode, a prediction value of a current sample is calculated based on pixel values of reference pixels on the above and left of the current sample and pixel values of reference samples on the upper-right side and the bottom-left side of the current sample.

First, several concepts in this application are described, to facilitate understanding by a person skilled in the art.

The picture blocks that are adjacent to the current block and whose intra prediction modes have been determined include a reconstructed block that is located in the same picture as the current block, for which a prediction value is obtained based on an intra prediction mode, and that is adjacent to the current block.

Specifically, on the left side of the current block, a picture block adjacent to a bottom-left corner of the current block may be included; and on the above side of the current block, picture blocks adjacent to the top-left corner of the current block, and the bottom left, above right, and above left of the current block.

More specifically, the picture blocks in (<NUM>) may include picture blocks with an intra prediction mode on the left (L), above (A), the bottom left (BL), the above right (AR), and the above left (AL) of the current block shown in <FIG>.

(<NUM>) For ease of description, picture blocks that are in a picture in which a current block is located, that are spatial non-adjacent to the current block, and whose intra prediction modes have been determined may be referred to as spatial non-adjacent picture blocks or picture blocks that are spatially non-adjacent to the current block.

The picture in which the current block is located is divided into M groups of picture blocks that are not adjacent to the current block and whose intra prediction modes have been determined, each group of picture blocks that are not adjacent to the current block and whose intra prediction modes have been determined has a group number, and the current block has a width of w and a height of h. Picture blocks with a group number i include picture blocks in which pixel set basic units in the following coordinate positions in a virtual coordinate system are located: (-i × w,-i × h), (<NUM>+m × w,-i × h), (-m × w,-i × h), (-i × w,-m × h), and (-i × w,m × h+<NUM>), where m is an integer in a range from <NUM> to i - <NUM>; M, i, w, and h are positive integers; i is not greater than M, and a value of i is not <NUM>; and in the virtual coordinate system, a position, in the picture, of a pixel set basic unit at a bottom-right corner of the current block is used as an origin, a straight line on which the bottom boundary of the current block is located is used as a horizontal coordinate axis with a rightward direction as a positive horizontal direction, and a straight line on which the right boundary of the current block is located is used as a vertical coordinate axis with a downward direction as a positive vertical direction. For example, as shown in <FIG>, when the group number i is equal to <NUM>, the picture blocks are picture blocks in a first circle (picture blocks in which a set of pixels marked <NUM> to <NUM> is located) neighboring to the current block; when the group number i is equal to <NUM>, the picture blocks are picture blocks in a second circle (picture blocks in which a set of pixels marked <NUM> to <NUM> is located) that does not neighbor to the current block; when the group number i is equal to <NUM>, the picture blocks are picture blocks in a third circle (picture blocks in which a set of pixels marked <NUM> to <NUM> is located) that does not neighbor to the current block.

For example, <FIG> is an example schematic diagram of the current block and picture blocks, associated with the current block, in non-adjacent positions according to an embodiment of this application. Before the current block is encoded or decoded, reconstruction of the plurality of spatial non-adjacent picture blocks is completed, in other words, intra prediction modes of the plurality of spatial non-adjacent picture blocks have been determined. When any one of the plurality of spatial non-adjacent picture blocks is unavailable, to be specific, when the any one of the plurality of spatial non-adjacent picture blocks is an intra-encoded block, or goes beyond a boundary of picture, a slice, or a tile, or the like, the picture block may be excluded during a subsequent operation. It is clearly that the plurality of spatial non-adjacent picture blocks include picture blocks whose intra prediction modes have been determined and that are not adjacent to the current block, for example, picture blocks in which a set of pixels marked <NUM> to <NUM> in <FIG> are located. The picture blocks in which the set of pixels marked <NUM> to <NUM> in <FIG> are located are the spatially adjacent picture blocks described in (<NUM>).

In a feasible implementation, picture blocks in which a set of pixels marked <NUM> to <NUM> in <FIG> are located do not represent the PU or the CU described above. The following describes an example of <FIG> in detail. A large rectangular block marked C is the current block. It is assumed that small rectangles marked <NUM> to <NUM> are set as basic pixel units, and the large rectangle has the length of w basic pixel units and the height of h basic pixel units. w and h are both positive integers. A size of a picture block in which each small rectangle is located is the same as a size of the current block. The basic pixel unit may be a sample, may be a 4x4 pixel set, may be a 4x2 pixel set, or may be a pixel set of another size. This is not limited. If a virtual coordinate system is created on a picture plane of the current block by using a position, in the picture, of a pixel set basic unit at a bottom-right corner of the current block as an origin, a straight line on which the bottom boundary of the current block is located as a horizontal coordinate axis with a rightward direction as a positive horizontal direction, a straight line on which the right boundary of the current block is located as a vertical coordinate axis with a downward direction as a positive vertical direction, coordinate positions of small rectangles marked <NUM> to <NUM> are (-w, <NUM>), (<NUM>, -h), (<NUM>, -h), (-w, <NUM>), (-w, -h), (-<NUM> × w, <NUM>), (<NUM>, -<NUM> × h), (<NUM>, -<NUM> × h), (-<NUM> × w, <NUM>), (-w, -<NUM> × h), (-<NUM> × w, -h), (-<NUM> × w, h + <NUM>), (w + <NUM>, -<NUM> × h), (-<NUM> × w, -<NUM> × h), (-<NUM> × w, <NUM>), (<NUM>, -<NUM> × h), (<NUM>, -<NUM> × h), (-<NUM> × w, <NUM>), (-w, -<NUM> × h), (-<NUM> × w, -h), (w + <NUM>, -<NUM> × h), (-<NUM> × w, h + <NUM>), (-<NUM> × w, -<NUM> × h), (-<NUM> × w, -<NUM> × h), (<NUM> × w + <NUM>, -<NUM> × h), (-<NUM> × w, <NUM> × h + <NUM>), and (-<NUM> × w, -<NUM> × h).

It should be understood that <FIG> shows an example feasible implementation of the current block and the picture blocks that are in non-adjacent positions and that are associated with the current block in this embodiment of this application. There may be more than or less than <NUM> spatial neighboring picture blocks. This is not limited.

For example, the picture in which the current block is located may include at least two rows of coding tree units CTUs, and the size of the current block is not greater than a size of the coding tree unit. A difference between a number of a row (or a number of a column), in the picture, of a coding tree unit in which a picture block whose intra prediction mode has been determined and that is not spatially adjacentto the current block is located and a number of a row (or a number of a column), in the picture, of a coding tree unit in which the current block is located is less than N, where N is an integer greater than <NUM>, for example, N = <NUM>.

Specifically, it is assumed that a length of a CTU is twice w, a height of the CTU is twice h, and the current block C is located at the top-left corner of the CTU. In this case, a difference between a number of a row of the CTU in which picture blocks in which basic pixel units marked <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> in <FIG> are located and whose intra prediction modes have been determined are located and a number of a row of the CTU in which the current block is located is <NUM>. When N is <NUM>, picture blocks in which basic pixel units marked <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> are located are not spatial non-adjacent picture blocks.

In some feasible implementations, similarly, picture blocks in which basic pixel units marked <NUM>, <NUM>, <NUM>, and <NUM> are located are spatial non-adjacent picture blocks.

In some feasible implementations, similarly, picture blocks in which basic pixel units marked <NUM>, <NUM>, and <NUM> are located are not spatial non-adjacent blocks, either.

(<NUM>) For ease of description, a picture block whose intra prediction mode has been determined and that neighbors to the current block in time domain is referred to as a temporal neighboring picture block, a picture block whose intra prediction mode has been determined and that temporally neighbors to the current block, or a picture block temporally neighboring to the current block.

Specifically, <FIG> is an example schematic diagram of the current block and a temporal neighboring picture block associated with the current block according to an embodiment of this application.

<FIG> shows a spatial neighboring block at the bottom-right corner of a co-located block of the current block and a sub-block in the center of the current block. The sub-block is a basic unit for storing prediction information. The co-located block is a picture block, whose size, shape, and position are all the same as those of the current block, in a reference picture temporally neighboring to the picture in which the current block is located. In <FIG>, TCtr represents the sub-block in the center, and TRb represents the spatial neighboring block at the bottom-right corner.

The basic unit for storing the prediction information may be a 4x4 pixel set, may be a 4x8 pixel set, or may be a pixel set of another size. This is not limited.

For example, a sub-block has a size of 4x4 pixel set. It is assumed that the current block has a length of w pixels and a height of h pixels, and coordinates of the top-left corner of the center 4x4 sub-block relative to the top-left corner of the co-located block are ( <MAT>, <MAT>), where the mathematical symbol └ ┘ represents rounding down. For example, ifA = <NUM>, LAJ =<NUM>.

Referring to <FIG>, if W = <NUM> and H = <NUM>, coordinates of the top-left corner of the center 4x4 sub-block relative to the top-left corner of the co-located block are (<NUM>, <NUM>). If W = <NUM>, and H = <NUM>, coordinates of the top-left corner of the center 4x4 sub-block relative to the top-left corner of the co-located block are (<NUM>, <NUM>).

During intra prediction of a luma mode, for example, if the foregoing <NUM> intra modes are used as candidate luma intra prediction modes, the prediction modes may be classified into a set of MPMs, a set of selected modes, and a set of non-selected modes (which may also be referred to as remaining modes), to improve efficiency of finally selecting an intra prediction mode for encoding. Further, it is assumed that the set of MPMs includes six candidate intra prediction modes, the set of selected modes includes <NUM> candidate intra prediction modes, and the remaining <NUM> candidate intra prediction modes are remaining modes, that is, belong to the set of non-selected modes. It should be understood that no limitation is imposed on each of a quantity of directional prediction modes, a quantity of non-directional prediction modes, a quantity of prediction modes in the set of MPMs, a quantity of prediction modes in the set of selected modes, and a quantity of prediction modes in the set of non-selected modes.

It should be understood that a set of candidate intra prediction modes in the set of MPMs is a subset of the <NUM> candidate intra prediction modes.

It should be understood that the candidate intra prediction modes in the set of MPMs are different from each other, and the candidate intra prediction modes in the set of selected modes are different from each other.

Similar to a luma component, during intra mode prediction of a chroma component, a boundary pixel of an neighbouring reconstructed block around a current chroma block is also used as a reference pixel of the current block, the reference pixel is mapped to a sample in the current chroma block based on a specific prediction mode, and the sample is used as a prediction value of a pixel in the current chroma block. A difference lies in that because texture of the chroma component is usually simpler, a quantity of intra prediction modes of the chroma component is usually less than that of the luma component. Among chroma intra prediction modes, there are <NUM> intra prediction modes for the chroma component, including five conventional chroma intra modes and six cross-component linear model (cross-component linear model, CCLM) modes.

The chroma intra prediction modes may be classified into three types: a CCLM mode, a derived mode (derived mode, DM), and a chroma intra prediction mode that is obtained from a spatial neighboring block. In the CCLM mode, a chroma component prediction value of a pixel is calculated based on a correlation model by using a reconstructed value of a luma component of the pixel. A parameter of the correlation model is obtained through calculation based on reconstructed values of luma components and chroma components of reference pixels on the top and the left of the current block. In the DM mode, prediction is performed by using a luma component prediction mode of the current block as a chroma component prediction mode of the current block. The derived mode and the chroma intra prediction mode that is obtained from the spatial neighboring block may be collectively referred to as the set of conventional chroma intra modes.

In addition, it should be understood that in descriptions of this application, terms such as "first" and "second" are merely used for differentiation and description, but cannot be understood as an indication or implication of relative importance or an indication or implication of an order. The term "a plurality of" in the description of this application means two or more than two. In the description of this application, the term "and/or" describes an association relationship for describing associated objects and represents that three relationships may exist. The character "/" usually indicates an "or" relationship between the associated objects.

<FIG> and <FIG> are flowcharts of video data decoding methods in one or more feasible implementations described in the embodiments of this application. <FIG> is a flowchart of a luma intra prediction method, and <FIG> is a flowchart of a chroma intra prediction method.

Specifically, as shown in <FIG>, the method in this embodiment of this application includes the following steps.

Construct a first luma intra mode set. The first luma intra mode set is a subset of a plurality of preset candidate luma prediction modes.

Parse a bitstream to obtain a first identifier. It should be noted that there is no order between S902 and S901.

The first luma intra mode set may be a set of MPMs. Correspondingly, the first identifier is an identifier used to indicate whether a luma prediction mode, finally selected by an encoder side, of a current block is from the set of MPMs. For example, when the first identifier is "<NUM>", it indicates that the luma prediction mode of the current block is from the set of MPMs; and when the first identifier is "<NUM>", it indicates that the luma prediction mode of the current block does not belong to the set of MPMs. The first identifier may be MPM_flag.

It should be understood that the set of MPMs may be constructed in a plurality of manners, including determining types of candidate luma prediction modes in the set of MPMs and an arrangement order of the candidate luma prediction modes in the set.

The set of MPMs may include the following candidate luma prediction modes:.

The non-directional prediction mode in (D) includes a DC mode and/or a planar mode. The candidate luma prediction mode in (E) includes a candidate luma prediction mode represented by an index number whose difference from index number of the candidate luma prediction mode in (A) added to the set of MPMs is <NUM> (an absolute value of the index difference is <NUM>). For example, the candidate luma prediction mode in (E) may alternatively include candidate luma prediction mode represented by index number whose difference from index number of the candidate luma prediction mode in (A) added to the set of MPMs is <NUM>, <NUM>, or another integer. This is not limited.

It should be understood that in a process of adding different candidate luma prediction modes to the set of MPMs, "pruning" (pruning) needs to be performed, to avoid repeatedly adding a same candidate luma prediction mode to the set of MPMs, and ensure that each index value in the set of MPMs represents only one luma prediction mode.

It should be understood that a capacity of the set of MPMs is preset, to be specific, a quantity of candidate luma prediction modes included in the set of MPMs does not exceed a first preset value. In a process of constructing the set of MPMs, candidate luma prediction modes are sequentially added to the set of MPMs in a predetermined adding order until the first preset value is reached.

In a first possible implementation, candidate luma prediction modes in the set of MPMs include the candidate luma prediction modes in (A) to (F).

Based on the first possible implementation, a first possible adding order is: the candidate luma prediction modes in (A), the preset non-directional candidate luma prediction mode in (D), the candidate luma prediction modes in (C), the candidate luma prediction modes in (B), the candidate luma prediction modes in (E), and the default luma prediction modes in (F). It should be understood that the adding order in this application reflects only a trend, and specific implementation orders may be reversed or crossed. This is not limited.

For example, referring to <FIG>, the candidate luma prediction modes in (A) and the preset non-directional candidate luma prediction mode in (D) may be added to the set of MPMs in the following order: a luma prediction mode of the picture block (L) on the left of the current block and neighbouring to the bottom-left corner of the current block, a luma prediction mode of the picture block (A) above the current block and neighbouring to the top-left corner of the current block, the planar mode, the DC mode, a luma prediction mode of the picture block (BL) neighbouring to the bottom-left corner of the current block, a luma prediction mode of the picture block (AR) neighbouring to the top-right corner of the current block, and a luma prediction mode of the picture block (AL) neighbouring to the top-left corner of the current block.

For example, referring to <FIG>, the candidate luma prediction modes in (C) may be added to the set of MPMs in the following order: a luma prediction mode of a sub-block in the center of a co-located block and a luma prediction mode of a spatial neighboring block at the bottom-right corner of the co-located block.

For example, the candidate luma prediction modes in (B) may be added to the set of MPMs in ascending order of group numbers of picture blocks whose intra prediction modes have been determined. Referring to <FIG>, to be specific, the luma prediction modes of the spatial non-adjacent picture blocks are sequentially added to the set of MPMs in order of the first group, the second group, and the third group.

Optionally, when at least two picture blocks whose intra prediction modes have been determined and that are not adjacent to the current block have a same group number, luma prediction modes of the at least two picture blocks whose intra prediction modes have been determined and that are not adjacent to the current block may be sequentially added to the set of MPMs in ascending order of distances to an origin from the at least two picture blocks whose intra prediction modes have been determined and that are not adjacent to the current block. The distance is a sum of absolute values of a horizontal coordinate and a vertical coordinate, in a virtual coordinate system, of a pixel set basic unit in a preset position in the picture block whose intra prediction mode has been determined and that is not neighbouring to the current block.

Optionally, luma prediction modes of picture blocks whose intra prediction modes have been determined and that are not adjacent to the current block may be sequentially added to the set of MPMs in ascending order of distances to the origin from the picture blocks whose intra prediction modes have been determined and that are not adjacent to the current block. The distance is a sum of absolute values of a horizontal coordinate and a vertical coordinate, in the virtual coordinate system, of a pixel set basic unit in a preset position in the picture block whose intra prediction mode has been determined and that is not neighbouring to the current block.

Specifically, in a same group, distances from the basic pixel units to a preset basic pixel unit in the current block are compared, and a luma prediction mode of a picture block in which a basic pixel unit closer to the preset basic pixel unit is located is added preferentially. It is assumed that the preset basic pixel unit in the current block is located at the bottom-right corner of the picture block, that is, the origin position of the virtual coordinate system. Obtaining motion information in the second group includes the following steps.

For example, luma prediction modes of picture blocks in the second group may be added in order of luma prediction modes of picture blocks in which basic pixel units marked <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> are located.

For example, as shown in <FIG>, for the candidate luma prediction modes in (B), luma prediction modes of picture blocks in which basic pixel units marked <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> are located may be sequentially added to the set of MPMs in order of the picture blocks in which the basic pixel units marked <NUM> to <NUM> are located.

For example, an order of adding the candidate luma prediction modes in (B) may be a predetermined descending order of accuracy of performing prediction based on the luma prediction modes of all the spatially non-adjacent picture blocks. The prediction accuracy may be obtained through statistics collection within a historical duration.

In a specific embodiment corresponding to a first possible adding order, referring to <FIG>, the luma prediction modes of the corresponding picture blocks are sequentially added to the set of MPMs in order of L->A->planar->DC->BL->AR->AL. If the set of MPMs is not fully filled, to be specific, the quantity of candidate luma prediction modes does not reach the first preset value, the luma prediction mode of the sub-block in the center of the co-located block and the luma prediction mode of the spatial neighboring picture block at the bottom-right corner of the co-located block are sequentially added to the set of MPMs. In this case, if the set of MPMs is not fully filled yet, the luma prediction modes of the picture blocks marked <NUM> to <NUM> are sequentially added to the set of MPMs; if the set of MPMs is not fully filled yet, neighbouring directional prediction modes of the directional prediction modes in the current set of MPMs are sequentially added; and if the set of MPMs is not fully filled yet, the default luma prediction modes {planar, DC, VER (vertical mode), HOR (horizontal mode), luma prediction mode corresponding to the index <NUM>, luma prediction mode corresponding to the index <NUM>} are sequentially added.

Based on the first possible implementation, a second possible adding order is: the candidate luma prediction modes in (A), the preset non-directional candidate luma prediction mode in (D), the candidate luma prediction modes in (B), the candidate luma prediction modes in (C), the candidate luma prediction modes in (E), and the default luma prediction modes in (F).

A difference between the second possible adding order and the first possible adding order lies in that the adding order of the candidate luma prediction modes in (B) and the adding order of the candidate luma prediction modes(C) are reversed. To be specific, in the first possible adding order, luma prediction modes of temporal neighboring picture blocks are preferentially added to the set of MPMs, and luma prediction modes of spatial non-adjacent picture blocks are added to the set of MPMs when the set of MPMs is not fully filled. In the second possible adding order, luma prediction modes of spatial non-adjacent picture blocks are preferentially added to the set of MPMs, and luma prediction modes of temporal neighboring picture blocks are added to the set of MPMs when the set of MPMs is not fully filled.

In a second possible implementation, candidate luma prediction modes in the set of MPMs include the candidate luma prediction modes in (A), (B), (D), (E), and (F). A difference between the second possible implementation and the first possible implementation lies in that the luma prediction modes of the temporal neighboring picture blocks in (C) are not included in the second possible implementation. For repeated content between the second possible implementation and the first possible implementation, details are not described herein again.

Based on the second possible implementation, a third possible adding order is: the candidate luma prediction modes in (A), the preset non-directional candidate luma prediction mode in (D), the candidate luma prediction modes in (B), the candidate luma prediction modes in (E), and the default luma prediction modes in (F). For a specific order of (A), (D), (B), (E), and (F), refer to the first possible implementation.

In a third possible implementation, the candidate luma prediction modes in the set of MPMs include the candidate luma prediction modes in (A), (C), (D), (E), and (F). A difference between the third possible implementation and the first possible implementation lies in that the luma prediction modes of the spatial non-adjacent picture blocks in (B) are not included in the third possible implementation.

Based on the third possible implementation, a fourth possible adding order is: the candidate luma prediction modes in (A), the preset non-directional candidate luma prediction mode in (D), the candidate luma prediction modes in (C), the candidate luma prediction modes in (E), and the default luma prediction modes in (F). For a specific order of (A), (D), (C), (E), and (F), refer to the first possible implementation.

Determine whether the luma prediction mode, indicated by the first identifier, of the current block belongs to the first luma intra mode set. If the luma prediction mode, indicated by the first identifier, of the current block belongs to the first luma intra mode set, perform S904; or if the luma prediction mode, indicated by the first identifier, of the current block does not belong to the first luma intra mode set, perform S906.

Parse the bitstream to obtain a second identifier when the first identifier indicates that the luma prediction mode of the current block belongs to the first luma intra mode set, where the second identifier is used to indicate that a candidate luma prediction mode in the first luma intra mode set is used as the luma prediction mode of the current block, and the second identifier may be MPM mode_flag.

That is, the candidate luma prediction mode indicated by the second identifier is used as the luma prediction mode of the current block.

In a feasible implementation, a unary code (Unary code) is used for the second identifier. When an arrangement order of the candidate luma prediction mode indicated by the second identifier ranks higher in the first mode set, a length of a codeword of the second identifier is shorter.

For example, in a manner shown in the following Table <NUM>, different codewords may be assigned to second identifiers representing different luma prediction modes.

Obtain a luma prediction value of the current block based on the luma prediction mode of the current block.

Construct a second luma intra mode set when the first identifier indicates that the luma prediction mode of the current block does not belong to the first luma intra mode set.

Parse the bitstream to obtain a third identifier. The third identifier may be selected_flag.

The second luma intra mode set may be a set of selected modes. Correspondingly, the third identifier is a flag used to identify whether the luma prediction mode, finally selected by the encoder side, of the current block is from the set of selected modes. For example, when the third identifier is "<NUM>", it indicates that the intra prediction mode of the current block is from the set of selected modes; and when the third identifier is "<NUM>", it indicates that the intra prediction mode of the current block does not belong to the set of selected modes.

The second luma intra mode set is a subset of the plurality of preset candidate luma prediction modes, and there is no intersection between the second luma intra mode set and the first luma intra mode set.

In a fourth possible implementation, candidate luma prediction modes in the set of selected modes include directional prediction modes that are obtained by sampling (B), (C), and (G) at a preset direction interval. Specifically, for example, the candidate luma intra prediction modes in the set of selected modes may include intra prediction modes that are not included in the set of MPMs and whose index numbers are {<NUM>, <NUM>, <NUM>, <NUM>. The preset direction interval may be <NUM>, or certainly may be another value, for example, <NUM> or <NUM>.

In a process of adding a candidate luma prediction mode to the set of selected modes, the candidate luma prediction mode needs to be selected from candidate luma prediction modes other than the candidate luma prediction modes included in the set of MPMs.

Based on the fourth possible implementation, a fifth possible adding order is: the candidate luma prediction modes in (C), the candidate luma prediction modes in (B), and the candidate luma prediction modes in (G). For an adding order of the candidate luma prediction modes in (C) and an order of the candidate luma prediction modes in (B), refer to the description in the first possible implementation.

Based on the fourth possible implementation, a sixth possible adding order is: the candidate luma prediction modes in (B), the candidate luma prediction modes in (C), and the candidate luma prediction modes in (G). A difference between the sixth possible adding order and the fifth possible adding order lies in that the adding order of the candidate luma prediction modes in (B) and the adding order of the candidate luma prediction modes in (C) are reversed. To be specific, in the fifth possible adding order, the luma prediction modes (C) of the temporal neighboring picture blocks are preferentially added to the set of selected modes, and the luma prediction modes (B) of the spatial non-adjacent picture blocks are added to the set of selected modes when the set of selected modes is not fully filled. However, in the sixth possible adding order, the luma prediction modes (B) of the spatial non-adjacent picture blocks are preferentially added to the set of selected modes, and the luma prediction modes (C) of the temporal neighboring picture blocks are added to the set of selected modes when the set of MPMs is not fully filled.

It should be noted that if the set of MPMs is fully filled after the candidate luma prediction modes in (B) and the candidate luma prediction modes in (C) are added, the candidate luma prediction modes in (B) and the candidate luma prediction modes in (C) are not considered when the set of selected modes is constructed.

In a fifth possible implementation, candidate luma prediction modes in the set of selected modes include the candidate luma prediction modes in (C) and the directional prediction modes in (G) that are obtained by performing sampling at a preset direction interval. A difference between the fifth possible implementation and the fourth possible implementation lies in that the luma prediction modes of the spatial non-adjacent picture blocks in (B) are not included in the fifth possible implementation.

Based on the fifth possible implementation, a seventh possible adding order is: the candidate luma prediction modes in (C) and the candidate luma prediction modes in (G).

In a sixth possible implementation, candidate luma prediction modes in the set of selected modes include the candidate luma prediction modes in (B) and the directional prediction modes in (G) that are obtained by performing sampling at a preset direction interval. A difference between the fifth possible implementation and the fourth possible implementation lies in that the luma prediction modes of the spatial non-adjacent picture blocks in (C) are not included in the fifth possible implementation.

Based on the sixth possible implementation, an eighth possible adding order is: the candidate luma prediction modes in (B) and the candidate luma prediction modes in (G).

In a seventh possible implementation, candidate luma prediction modes in the set of MPMs do not include the candidate luma prediction modes in (B) and/or the candidate luma prediction modes in (C), and candidate luma prediction modes in the set of selected modes include the candidate luma prediction modes in (B) and/or the candidate luma prediction modes in (C).

In an eighth possible implementation, candidate luma prediction modes in the set of MPMs include the candidate luma prediction modes in (B) and/or the candidate luma prediction modes in (C), and candidate luma prediction modes in the set of selected modes do not include the candidate luma prediction modes in (B) and/or the candidate luma prediction modes in (C).

It should be understood that the fourth to the eighth possible implementations provide, as examples, several independent implementations of constructing the set of selected modes. When any possible implementation cannot make the candidate intra prediction modes in the set of selected modes reach a second preset value, the set of selected modes may be constructed in combination with an implementation method in another possible implementation. An independent implementation is not limited thereto, and a manner of combining different implementations is not limited.

It should be understood that the fourth to the sixth possible implementations of constructing the set of selected modes and the first to the third possible implementations of constructing the set of MPMs may be combined in any manner. This is not limited.

When the third identifier indicates that the luma prediction mode of the current block belongs to the second luma intra mode set, parse the bitstream to obtain a fourth identifier, where the fourth identifier is used to indicate that a candidate luma prediction mode in the second luma intra mode set is used as the luma prediction mode of the current block. The fourth identifier may be selected mode_flag. That is, the candidate luma prediction mode indicated by the fourth identifier is used as the luma prediction mode of the current block.

In a feasible implementation, a fixed-length code (fixed-length code) is used for the fourth identifier. Specifically, when there are <NUM> candidate luma prediction modes in the set of selected modes, each candidate luma prediction mode in the set of selected modes is coded by using a <NUM>-bit fixed-length codeword.

Obtain a luma prediction value of the current block based on the luma prediction mode of the current block.

In a feasible implementation, when the third identifier indicates that the luma prediction mode of the current block does not belong to the second luma intra mode set, the bitstream is parsed to obtain a fifth identifier. The fifth identifier is used to indicate a candidate luma prediction mode, used as the luma prediction mode of the current block, in candidate luma prediction modes in the plurality of preset candidate luma prediction modes other than the first luma intra mode set and the second luma intra mode set.

That is, the candidate luma prediction mode indicated by the fifth identifier is used as the luma prediction mode of the current block. The candidate luma prediction modes in the plurality of preset candidate luma prediction modes other than the first luma intra mode set and the second luma intra mode set are referred to as candidate luma prediction modes in a set of non-selected modes in some embodiments, and are referred to as remaining candidate luma prediction modes (remaining modes) in some other embodiments. This is not limited.

In a feasible implementation, a truncated binary code (truncated binary code) is used for the fifth identifier.

In a specific implementation solution, a set of <NUM> preset candidate luma prediction modes is classified into six candidate luma prediction modes belonging to the set of MPMs, <NUM> candidate luma prediction modes belonging to the set of selected modes, and remaining candidate luma prediction modes belonging to the set of non-selected modes. The following steps are performed.

Obtain MPM_flag through decoding. If MPM_flag is <NUM>, it indicates that the luma prediction mode of the current block is an MPM mode, and the luma prediction mode is derived based on an MPM mode index (MPM mode_flag) obtained through decoding and a list of MPMs. A decoding mode based on a unary code is used for the MPM mode index. A process of constructing the list of MPMs is as follows (referring to a position relationship between blocks in <FIG>). The following order is merely an example, and is not specifically limited.

Optionally, step <NUM> may alternatively be replaced in the following manner:
If there are less than six prediction modes in the list of MPMs, the luma prediction modes of the picture blocks marked <NUM> to <NUM> in <FIG>, the luma prediction mode of the sub-block in the center of the co-located block in <FIG>, and the luma prediction mode of the spatial neighboring block at the bottom-right corner of the co-located block in <FIG> are sequentially added to the list of MPMs, and it is ensured that a to-be-added luma prediction mode does not exist in the list of MPMs; and if a quantity of modes in the list of MPMs is up to <NUM>, the adding stops.

If there are less than six prediction modes in the list of MPMs, sequentially add neighbouring angle prediction modes, that is, angle_mode1 and angle_mode+<NUM>, of an angle prediction mode (a mode angle_mode other than the planar mode and the DC mode) in the list of MPMs to the list of MPMs in order of modes that have been added to the existing list of MPMs. As shown in <FIG>, when the angle mode is <NUM>, angle_mode-<NUM> corresponds to an adding mode <NUM>; and when the angle mode is <NUM>, angle_mode+<NUM> corresponds to an adding mode <NUM>. If the quantity of modes in the list of MPMs is up to <NUM>, the adding stops. The angle prediction mode may be referred to as a directional prediction mode.

If there are less than six prediction modes in the list of MPMs, sequentially add modes in a default mode list that are not added: {Planar, DC, Ver (vertical mode), Hor (horizontal mode), <NUM>, DIA (diagonal mode <NUM>, that is, oblique <NUM>-degree mode)}.

If MPM_flag is <NUM>, decode selected_flag. If selected_flag is <NUM>, it indicates that a prediction mode currently selected for decoding is a selected mode; and obtain an index of the selected mode (selected mode_flag) through decoding, and then derive the luma prediction mode based on a constructed list of selected modes, where a decoding mode based on a <NUM>-bit fixed-length code is used for the index of the selected mode, and a process of constructing the list of selected modes is as follows:.

Optionally, step <NUM> may alternatively be replaced in the following manner:
The luma prediction modes of the picture blocks marked <NUM> to <NUM> in <FIG>, the luma prediction mode of the sub-block in the center of the co-located block in <FIG>, and the luma prediction mode of the spatial neighboring block at the bottom-right corner of the co-located block are sequentially added to the list of selected modes, and it is ensured that a to-be-added luma prediction mode exists in neither the list of selected modes nor the list of MPMs; and if a quantity of modes in the list of selected modes is up to <NUM>, the adding stops.

Sequentially add neighbouring angle prediction modes of an angle mode to the list of selected modes in order of the angle prediction modes in the list of MPMs. An angle interval is a multiple of <NUM>. For example, if an angle interval for first adding is <NUM>, the neighbouring angle prediction modes are angle_mode-<NUM> and angle_mode+<NUM>. If there are still less than <NUM> selected modes in the set of selected modes after all angle modes in the list of MPMs are traversed, neighbouring angle modes with an angle interval of <NUM> continue to be added. By analogy, an angle interval is gradually increased until <NUM> modes are selected. In the adding process, it needs to be ensured that a to-be-added angle mode is not added and is not a mode in the list of MPMs. In the adding process, neighbouring angles of an angle mode circulate based on <NUM> modes, that is, a mode <NUM> and a mode <NUM> are neighbouring angle modes. It should be understood that the angle interval may alternatively be a multiple of <NUM>, a multiple of <NUM>, or the like. This is not limited, provided that the angle interval is consistent with that agreed on by the encoder side in advance in a protocol.

If selected_flag is <NUM>, it indicates that a luma prediction mode currently selected for decoding is a mode in the list of non-selected modes; and obtain a mode index through decoding, and derive a prediction mode, where an index of the non-selected mode may be represented by a truncated binary code (truncated binary code).

Referring to <FIG>, an embodiment of this application provides another method.

Parse a received bitstream to obtain a sixth identifier.

Construct a chroma intra mode set when the sixth identifier indicates that a chroma prediction mode of a current block is not a cross-component linear model CCLM mode.

Parse the bitstream to obtain a seventh identifier, where the seventh identifier is used to indicate that a candidate chroma prediction mode in the chroma intra mode set is used as the chroma prediction mode of the current block.

In this embodiment of this application, the chroma intra mode set may be a set of conventional chroma intra modes. Correspondingly, the sixth identifier is an identifier used to indicate whether the chroma prediction mode, finally selected by an encoder side, of the current block is from a set of MPMs. For example, when the sixth identifier is "<NUM>", it indicates that the chroma prediction mode of the current block is not the CCLM mode, that is, the chroma prediction mode of the current block is from the set of conventional chroma intra modes; and when the sixth identifier is "<NUM>", it indicates that the chroma prediction mode of the current block is the CCLM mode, but does not belong to the set of conventional chroma intra modes.

It should be understood that the set of conventional chroma intra modes is constructed in a plurality of manners, including determining types of candidate chroma prediction modes in the set of conventional chroma intra modes and an arrangement order of the candidate chroma prediction modes in the set.

The set of conventional chroma intra modes may include candidate chroma prediction modes:.

The non-directional prediction mode (K) includes a DC mode and/or a planar mode. The candidate chroma prediction mode in (L) includes a candidate chroma prediction mode represented by an index number whose difference from index number of the candidate chroma prediction mode in (H) added to the set of MPMs is <NUM> (an absolute value of the index difference is <NUM>). For example, the candidate chroma prediction mode in (L) may alternatively include candidate chroma prediction mode represented by index number whose difference from index number of the candidate chroma prediction mode in (H) added to the set of MPMs is <NUM>, <NUM>, or another integer. This is not limited.

It should be understood that in a process of adding different candidate chroma prediction modes to the set of conventional chroma intra modes, "pruning" (pruning) needs to be performed, to avoid repeatedly adding a same candidate chroma prediction mode to the set of conventional chroma intra modes, and ensure that each index value in the set of conventional chroma intra modes represents only one chroma prediction mode.

It should be understood that a capacity of the set of conventional chroma intra modes is preset, to be specific, a quantity of candidate chroma prediction modes included in the set of conventional chroma intra modes does not exceed a first preset value. In a process of constructing the set of conventional chroma intra modes, candidate chroma prediction modes are sequentially added to the set of conventional chroma intra modes in a predetermined adding order until a third preset value is reached.

In a ninth possible implementation, the candidate chroma prediction modes in the set of conventional chroma intra modes include the candidate chroma prediction modes in (H) to (M).

Based on the ninth possible implementation, a ninth possible adding order is: the candidate chroma prediction modes in (N), the candidate chroma prediction modes in (H), the candidate chroma prediction modes in (J), the candidate chroma prediction modes in (I), the candidate chroma prediction modes in (K), the candidate chroma prediction modes in (L), and the default chroma prediction modes in (M). It should be understood that the adding order in this application reflects only a trend, and specific implementation orders may be reversed or crossed. This is not limited.

For example, referring to <FIG>, the candidate chroma prediction modes in (J) may be added to the set of conventional chroma intra modes in the following order: a chroma prediction mode of a sub-block in the center of a co-located block and a chroma prediction mode of a spatial neighboring block at the bottom-right corner of the co-located block.

For example, the candidate chroma prediction modes in (I) may be added to the set of conventional chroma intra modes in ascending order of group numbers of picture blocks whose intra prediction modes have been determined. Referring to <FIG>, to be specific, the chroma prediction modes of the spatial non-adjacent picture blocks are sequentially added to the set of conventional chroma intra modes in order of the first group, the second group, and the third group.

Optionally, when at least two picture blocks whose intra prediction modes have been determined and that are not adjacent to the current block have a same group number, chroma prediction modes of the at least two picture blocks whose intra prediction modes have been determined and that are not adjacent to the current block may be sequentially added to the set of conventional chroma intra modes in ascending order of distances to an origin from the at least two picture blocks whose intra prediction modes have been determined and that are not adjacent to the current block. The distance is a sum of absolute values of a horizontal coordinate and a vertical coordinate, in a virtual coordinate system, of a pixel set basic unit in a preset position in the picture block whose intra prediction mode has been determined and that is not neighbouring to the current block.

Specifically, in a same group, distances from the basic pixel units to a preset basic pixel unit in the current block are compared, and a chroma prediction mode of a picture block in which a basic pixel unit closer to the preset basic pixel unit is located is added preferentially. For a specific calculation manner, refer to the description in the first possible implementation.

For example, chroma prediction modes of picture blocks in the second group may be added in order of chroma prediction modes of picture blocks in which basic pixel units marked <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> are located.

For example, as shown in <FIG>, for the candidate chroma prediction modes in (I), chroma prediction modes of picture blocks in which basic pixel units marked <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> are located may be sequentially added to the set of conventional chroma intra modes in order of the picture blocks in which the basic pixel units marked <NUM> to <NUM> are located.

In a specific embodiment corresponding to a ninth possible adding order, referring to <FIG>, the chroma prediction modes of the corresponding picture blocks are sequentially added to the set of conventional chroma intra modes in order of L->A->BL->AR->AL. If the set of conventional chroma intra modes is not fully filled, to be specific, the quantity of candidate chroma prediction modes does not reach the third preset value, the chroma prediction mode of the sub-block in the center of the co-located block and the chroma prediction mode of the spatial neighboring picture block at the bottom-right corner of the co-located block are sequentially added to the set of conventional chroma intra modes. In this case, if the set of conventional chroma intra modes is not fully filled yet, the chroma prediction modes of the picture blocks marked <NUM> to <NUM> are sequentially added to the set of conventional chroma intra modes; if the set of conventional chroma intra modes is not fully filled yet, the planar mode and the DC mode are sequentially added to the set of conventional chroma intra modes; if the set of conventional chroma intra modes is not fully filled yet, neighbouring directional prediction modes of the directional prediction modes in the current set of conventional chroma intra modes are sequentially added; and if the set of conventional chroma intra modes is not fully filled yet, the default chroma prediction modes {VER (vertical mode), HOR (horizontal mode), chroma prediction mode corresponding to the index <NUM>} are sequentially added.

Based on the ninth possible implementation, a tenth possible adding order is: the candidate chroma prediction modes in (N), the candidate chroma prediction modes in (H), the candidate chroma prediction modes in (I), the candidate chroma prediction modes in (J), the candidate chroma prediction modes in (K), the candidate chroma prediction modes in (L), and the default chroma prediction modes in (M).

A difference between the tenth possible adding order and the ninth possible adding order is that the adding order of the candidate chroma prediction modes in (I) and the adding order of the candidate chroma prediction modes in (J) are reversed. To be specific, in a first possible adding order, chroma prediction modes of temporal neighboring picture blocks are preferentially added to the set of conventional chroma intra modes; and chroma prediction modes of spatial non-adjacent picture blocks are added to the set of conventional chroma intra modes when the set of conventional chroma intra modes is not fully filled. In a second possible adding order, chroma prediction modes of spatial non-adjacent picture blocks are preferentially added to the set of conventional chroma intra modes, and chroma prediction modes of temporal neighboring picture blocks are added to the set of conventional chroma intra modes when the set of conventional chroma intra modes is not fully filled.

In a tenth possible implementation, the candidate chroma prediction modes in the set of conventional chroma intra modes include the candidate chroma prediction modes in (N), (H), (I), (K), (L), and (M). A difference between the tenth possible implementation and the ninth possible implementation lies in that the chroma prediction modes of the temporal neighboring picture blocks in (J) are not included in the tenth possible implementation. For repeated content between the tenth possible implementation and the ninth possible implementation, details are not described herein again.

Based on the tenth possible implementation, an eleventh possible adding order includes: the candidate chroma prediction modes in (N), the candidate chroma prediction modes in (H), the candidate chroma prediction modes in (I), the candidate chroma prediction mode in (K), the candidate chroma prediction modes in (L), and the default chroma prediction modes in (M). For a specific order of (N), (H), and (I), refer to the ninth possible implementation.

In an eleventh possible implementation, the candidate chroma prediction modes in the set of conventional chroma intra modes include the candidate chroma prediction modes in (N), (H), (J), (K), (L), and (M). A difference between the eleventh possible implementation and the ninth possible implementation lies in that the chroma prediction modes of the spatial non-adjacent picture blocks in (I) are not included in the eleventh possible implementation.

Based on the eleventh possible implementation, a twelfth possible adding order is: the candidate chroma prediction modes in (N), the candidate chroma prediction modes in (H), the candidate chroma prediction modes in (J), the candidate chroma prediction modes in (K), the candidate chroma prediction modes in (L), and the default chroma prediction modes in (M). For a specific order of (N), (H), and (J), refer to the ninth possible implementation.

It should be understood that the fourth to the sixth possible implementations of constructing the set of selected modes, the first to the third possible implementations of constructing the set of MPMs, and the ninth to the eleventh possible implementations of constructing the set of conventional chroma intra modes may be combined in any manner. This is not limited.

Obtain a chroma prediction value of the current block based on the chroma prediction mode of the current block.

In a specific implementation solution, <NUM> preset candidate chroma prediction modes are classified into five conventional chroma intra prediction modes and six CCLM modes, and the following step is performed:.

A flag is obtained through decoding. If the flag is <NUM>, it indicates that the chroma prediction mode of the current block is not a CCLM mode, but is a conventional chroma intra mode. The chroma prediction mode is derived based on an index (flag) through decoding and a list of conventional chroma intra modes. A process of constructing the list of conventional chroma intra modes is as follows (referring to a position relationship between blocks in <FIG>). The following order is merely an example, and is not specifically limited.

Optionally, step <NUM> may alternatively be replaced in the following manner:
If there are less than five prediction modes in the List of conventional chroma intra modes, the chroma prediction modes of the picture blocks marked <NUM> to <NUM> in <FIG>, the chroma prediction mode of the sub-block in the center of the co-located block in <FIG>, and the chroma prediction mode of the spatial neighboring block at the bottom-right corner of the co-located block in <FIG> are sequentially added to the list of conventional chroma intra modes, and it is ensured that a to-be-added chroma prediction mode does not exist in the list of conventional chroma intra modes; and If a quantity of modes in the list of conventional chroma intra modes is up to <NUM>, the adding stops.

If there are less than five prediction modes in the list of conventional chroma intra modes, sequentially add neighbouring angle prediction modes, that is, angle_mode-<NUM> and angle_mode+<NUM>, of an angle prediction mode (a mode angle_mode other than the planar mode and the DC mode) modes to the list of conventional chroma intra modes in order of modes that have been added to the list of conventional chroma intra modes. As shown in <FIG>, when the angle mode is <NUM>, angle_mode-<NUM> corresponds to an adding mode <NUM>; and when the angle mode is <NUM>, angle_mode+<NUM> corresponds to an adding mode <NUM>. If the quantity of modes in the list of conventional chroma intra modes is up to <NUM>, the adding stops.

If there are less than five prediction modes in the list of conventional chroma intra modes, sequentially add modes in a default mode list that are not added: {Ver (vertical mode), Hor (horizontal mode), <NUM>}.

Based on a same inventive concept as the method embodiments, an embodiment of this application further provides an apparatus <NUM>. The apparatus <NUM> may be specifically a processor, a chip, or a chip system in a video encoder, or a module in a video encoder, for example, an intra prediction module <NUM>; or may be a processor, a chip, or a chip system in a video decoder, or a module in a video decoder, for example, an intra prediction module <NUM>. For example, the apparatus may include a receiving unit <NUM>, a construction unit <NUM>, a parsing unit <NUM>, and a calculation unit <NUM>. The receiving unit <NUM>, the construction unit <NUM>, the parsing unit <NUM>, and the calculation unit <NUM> are configured to perform the steps in the methods in the embodiments corresponding to <FIG> and <FIG>. For example, the receiving unit <NUM> may be configured to receive a bitstream; the construction unit <NUM> is configured to construct a first luma intra mode set, a second luma intra mode set, and a chroma intra mode set; and the parsing unit <NUM> is configured to parse the bitstream to obtain an identifier, for example, parse the bitstream to obtain a first identifier to a seventh identifier. The calculation unit <NUM> is configured to obtain a luma prediction value and a chroma prediction value.

An embodiment of this application further provides another structure of the apparatus. As shown in <FIG>, the apparatus <NUM> may include a communications interface <NUM> and a processor <NUM>. Optionally, the apparatus <NUM> may further include a memory <NUM>. The memory <NUM> may be disposed inside the apparatus, or may be disposed outside the apparatus. The receiving unit <NUM>, the construction unit <NUM>, the parsing unit <NUM>, and the calculation unit <NUM> that are shown in <FIG> may all be implemented by the processor <NUM>. The processor <NUM> sends or receives a video stream or a bitstream through the communications interface <NUM>, and is configured to implement the methods in <FIG> and <FIG>. In an implementation process, steps in a processing procedure may be implemented by using an integrated logic circuit of hardware in the processor <NUM> or an instruction in a form of software, to complete the methods in <FIG> and <FIG>.

The communications interface <NUM> in this embodiment of this application may be a circuit, a bus, a transceiver, or any other apparatus that can be configured to exchange information. For example, the another apparatus may be a device connected to the apparatus <NUM>. For example, when the apparatus is a video encoder, the another apparatus may be a video decoder.

In the embodiments of this application, the processor <NUM> may be a general purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or another programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logical block diagrams disclosed in the embodiments of this application. The general purpose processor may be a microprocessor, any conventional processor, or the like. The steps in the methods disclosed with reference to the embodiments of this application may be directly performed by a hardware processor, or may be performed by using a combination of hardware in the processor and a software unit. Program code executed by the processor <NUM> to implement the foregoing methods may be stored in the memory <NUM>.

The coupling in this embodiment of this application is an indirect coupling or a communication connection between apparatuses, units, or modules, may be in an electrical form, a mechanical form, or another form, and is used for information exchange between the apparatuses, the units, or the modules.

The processor <NUM> may operate with the memory <NUM>. The memory <NUM> may be a nonvolatile memory such as a hard disk drive (hard disk drive, HDD) or a solid-state drive (solid-state drive, SSD); or may be a volatile memory (volatile memory) such as a random-access memory (random-access memory, RAM). The memory <NUM> is any other medium that can be configured to carry or store desirable program code that has an instruction or a data structure form and that can be accessed by a computer, but is not limited thereto.

This embodiment of this application does not limit a specific connection medium between the communications interface <NUM>, the processor <NUM>, and the memory <NUM>. In this embodiment of this application, in <FIG>, the memory <NUM>, the processor <NUM>, and the communications interface <NUM> are connected through a bus. The bus is represented by a thick line in <FIG>, and a connection mode between other parts is merely an example for description, and imposes no limitation. The bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used to represent the bus in <FIG>, but this does not mean that there is only one bus or only one type of bus.

Based on the foregoing embodiments, an embodiment of this application further provides a computer storage medium. The storage medium stores a software program, and the software program is read and executed by one or more processors, to implement the method provided in any one or more of the foregoing embodiments. The computer readable storage medium may include: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory, a random-access memory, a magnetic disk, or an optical disc.

Based on the foregoing embodiments, an embodiment of this application further provides a chip. The chip includes a processor configured to implement the functions in any one or more of the foregoing embodiments, for example, obtaining or processing the information or the message in the foregoing methods. Optionally, the chip further includes a memory. The memory is configured to store a program instruction and data that are necessary and executed by the processor. The chip system may include a chip, or may include a chip and another discrete device.

Moreover, this application may use a form of a computer program product that is implemented on one or more computer-usable storage media (including but not limited to a disk memory, a CD-ROM, an optical memory, and the like) that include computer-usable program code.

This application is described with reference to the flowcharts and/or block diagrams of the method, the device (system), and the computer program product according to this application. It should be understood that computer program instructions may be used to implement each process and/or each block in the flowcharts and/or the block diagrams and a combination of a process and/or a block in the flowcharts and/or the block diagrams. These computer program instructions may be provided for a general-purpose computer, a dedicated computer, an embedded processor, or a processor of any other programmable data processing device to generate a machine, so that the instructions executed by a computer or a processor of another programmable data processing device are used to generate an apparatus for implementing a specific function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.

Claim 1:
A method for intra prediction of a picture block, comprising:
constructing (S901) a first luma intra mode set for a current block, wherein the first luma intra mode set is a subset of a plurality of preset candidate luma prediction modes, and is a set of most probable intra prediction modes; and the first luma intra mode set comprises a determined luma prediction mode of a picture block that is not spatially adjacent to the current block in a picture in which the current block is located;
parsing (S902) a received bitstream to obtain a first identifier;
when the first identifier indicates that a luma prediction mode of the current block belongs to the first luma intra mode set, parsing (S904) the bitstream to obtain a second identifier, wherein the second identifier is used to indicate which candidate luma prediction mode in the first luma intra mode set is used as the luma prediction mode of the current block; and
obtaining (S905) a luma prediction value of the current block based on the luma prediction mode of the current block;
characterized in that
the current block has a width of w pixel set basic units and a height of h pixel set basic units, the picture in which the current block is located comprises M groups of picture blocks not spatially adjacent to the current block, and each group of picture blocks not spatially adjacent to the current block has a group number, wherein a picture block with a group number i comprises picture blocks in which pixel set basic units in the following coordinate positions in a virtual coordinate system are located: (-i×w,-i×h), (<NUM>+m×w,-i× h), (-m×w,-i×h), (-i×w,-m×h), and (-i×w,m×h+<NUM>), wherein m is an integer in a range from <NUM> to i - <NUM>; M, i, w, and h are positive integers; i is not greater than M, and a value of i is not <NUM>; and in the virtual coordinate system, a position, in the picture, of a pixel set basic unit at the bottom-right corner of the current block is used as an origin, a straight line on which the bottom boundary of the current block is located is used as a horizontal coordinate axis with a rightward direction as a positive horizontal direction, and a straight line on which the right boundary of the current block is located is used as a vertical coordinate axis with a downward direction as a positive vertical direction.