Patent Description:
The intra prediction is a coding tool for video coding. In a conventional video coding method, an encoder and a decoder only use the previously reconstructed pixels in a closest pixel line adjacent to a coding block to generate reference pixels and predictors for predicting or reconstructing the coding block along an orientation. However, the orientation is selected from a plurality of intra modes included in a predefined mode list. Thus, the encoder needs to adjust the predefined mode list for adapting to different coding blocks. When the encoder adjusts the predefined mode list for adapting to different coding blocks, the decoder needs to adjust the predefined mode list to adapt to different coding blocks in the same way. Further coding methods are known from <NPL>, and from documents <CIT> and <CIT>.

The present disclosure is directed to a device and method for decoding a bitstream as defined in the independent claims.

Aspects of the exemplary disclosure are best understood from the following detailed description when read with the accompanying figures. Various features are not drawn to scale, dimensions of various features may be arbitrarily increased or reduced for clarity of discussion.

The following description contains specific information pertaining to exemplary implementations in the present disclosure. The drawings in the present disclosure and their accompanying detailed description are directed to merely exemplary implementations. However, the present disclosure is not limited to merely these exemplary implementations. Other variations and implementations of the present disclosure will occur to those skilled in the art. Unless noted otherwise, like or corresponding elements among the figures may be indicated by like or corresponding reference numerals. Moreover, the drawings and illustrations in the present disclosure are generally not to scale, and are not intended to correspond to actual relative dimensions.

For the purpose of consistency and ease of understanding, like features are identified (although, in some examples, not shown) by numerals in the exemplary figures. However, the features in different implementations may be differed in other respects, and thus shall not be narrowly confined to what is shown in the figures.

The description uses the phrases "in one implementation," or "in some implementations," which may each refer to one or more of the same or different implementations. The term "coupled" is defined as connected, whether directly or indirectly through intervening components, and is not necessarily limited to physical connections. The term "comprising," when utilized, means "including, but not necessarily limited to"; it specifically indicates open-ended inclusion or membership in the so-described combination, group, series and the equivalent.

Additionally, for the purposes of explanation and non-limitation, specific details, such as functional entities, techniques, protocols, standard, and the like are set forth for providing an understanding of the described technology. In other examples, detailed description of well-known methods, technologies, system, architectures, and the like are omitted so as not to obscure the description with unnecessary details.

Persons skilled in the art will immediately recognize that any coding function(s) or algorithm(s) described in the present disclosure may be implemented by hardware, software or a combination of software and hardware. Described functions may correspond to modules may be software, hardware, firmware, or any combination thereof. The software implementation may comprise computer executable instructions stored on computer readable medium such as memory or other type of storage devices. For example, one or more microprocessors or general purpose computers with communication processing capability may be programmed with corresponding executable instructions and carry out the described network function(s) or algorithm(s). The microprocessors or general purpose computers may be formed of applications specific integrated circuitry (ASIC), programmable logic arrays, and/or using one or more digital signal processor (DSPs). Although some of the exemplary implementations described in this specification are oriented to software installed and executing on computer hardware, nevertheless, alternative exemplary implementations implemented as firmware or as hardware or combination of hardware and software are well within the scope of the present disclosure.

The computer readable medium includes but is not limited to random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, compact disc read-only memory (CD ROM), magnetic cassettes, magnetic tape, magnetic disk storage, or any other equivalent medium capable of storing computer-readable instructions.

<FIG> is a block diagram of an exemplary implementation of a system that may be configured to encode and decode video data according to one or more techniques of this disclosure. In the implementation, the system includes a first electronic device <NUM>, a second electronic device <NUM>, and communication medium <NUM>. In at least one implementation, the first electronic device <NUM> may be a source device including any device configured to encode video data and transmit encoded video data to the communication medium <NUM>. In at least one implementation, the second electronic device <NUM> may be a destination device including any device configured to receive encoded video data via the communication medium <NUM> and to decode encoded video data.

In at least one implementation, the first electronic device <NUM> may wiredly and/or wirelessly communicate with the second electronic device <NUM> via the communication medium <NUM>. The first electronic device <NUM> may include a source module <NUM>, an encoder module <NUM>, and a first interface <NUM>. The second electronic device <NUM> may include a display module <NUM>, a decoder module <NUM>, and a second interface <NUM>. In at least one implementation, the first electronic device <NUM> may be a video encoder, and the second electronic device <NUM> may be a video decoder.

In at least one implementation, the first electronic device <NUM> and/or the second electronic device <NUM> may be a mobile phone, a tablet, a desktop, a notebook, or other electronic device. <FIG> merely illustrates one example of the first electronic device <NUM> and the second electronic device <NUM>, and the first electronic device <NUM> and the second electronic device <NUM> in other implementations may include more or less components than illustrated, or have a different configuration of the various components.

In at least one implementation, the source module <NUM> of the first electronic device <NUM> may include a video capture device to capture a new video, a video archive storing previously captured video, and/or a video feed interface to receive video from a video content provider. In at least one implementation, the source module <NUM> of the first electronic device <NUM> may generate computer graphics-based data as the source video, or a combination of live video, archived video, and computer-generated video. In at least one implementation, the video capturing device may be a charge-coupled device (CCD) image sensor, a complementary metal-oxide-semiconductor (CMOS) image sensor, or a camera.

In at least one implementation, the encoder module <NUM> and the decoder module <NUM> may each be implemented as any of a variety of suitable encoder/decoder circuitry, such as one or more microprocessors, a central processing unit (CPU), a graphic processing unit (GPU), a system on chip (SoC), digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware or any combinations thereof. In at least one implementation, each of the encoder module <NUM> and the decoder module <NUM> may be included in one or more encoders or decoders, any of which may be integrated as part of a combined encoder/decoder (CODEC) in a respective device.

In at least one implementation, the first interface <NUM> and the second interface <NUM> may adopt customized protocols or follow existing standards or de facto standards including, but not limited to, Ethernet, IEEE <NUM> or IEEE <NUM> series, Wireless USB or telecommunication standards including, but not limited to, GSM, CDMA2000, TD-SCDMA, WiMAX, 3GPP-LTE or TD-LTE. In at least one implementation, the first interface <NUM> and the second interface <NUM> may each include any device configured to transmit and/or store a compliant video bitstream to the communication medium <NUM> and to receive the compliant video bitstream from the communication medium <NUM>. In at least one implementation, the first interface <NUM> and the second interface <NUM> may include a computer system interface that may enable a compliant video bitstream to be stored on a storage device or to be received from the storage device. For example, the first interface <NUM> and the second interface <NUM> may include a chipset supporting Peripheral Component Interconnect (PCI) and Peripheral Component Interconnect Express (PCIe) bus protocols, proprietary bus protocols, Universal Serial Bus (USB) protocols, I2C, or any other logical and physical structure that may be used to interconnect peer devices.

In at least one implementation, the display module <NUM> may include a display using liquid crystal display (LCD) technology, a plasma display technology, an organic light emitting diode (OLED) display technology, or light emitting polymer display (LPD) technology, although other display technologies may be used in other implementations. In at least one implementation, the display module <NUM> may include a high definition display or an ultra high definition display.

<FIG> is a block diagram of a decoder module <NUM> representing an exemplary implementation of the decoder module <NUM> of the second electronic device <NUM> in the system of <FIG>. In at least one implementation, the decoder module <NUM> includes an entropy decoding unit <NUM>, a prediction process unit <NUM>, an inverse quantization/inverse transform unit <NUM>, a first summer <NUM>, a filtering unit <NUM>, and a decoded picture buffer <NUM>. In at least one implementation, the prediction process unit <NUM> of the decoder module <NUM> further includes an intra prediction unit <NUM>, and an inter prediction unit <NUM>. In at least one implementation, the decoder module <NUM> receives a bitstream, and decodes the bitstream to output a decoded video.

In at least one implementation, the entropy decoding unit <NUM> may receive the bitstream including a plurality of syntax elements from the second interface <NUM> in <FIG>, and perform a parsing operation on the bitstream to extract syntax elements from the bitstream. As part of performing the parsing operation, the entropy decoding unit <NUM> may entropy decode the bitstream to generate quantized transform coefficients, quantization parameters, transform data, motion vectors, intra modes, partition information, and other syntax information. In at least one implementation, the entropy decoding unit <NUM> may perform context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding or another entropy coding technique to generate the quantized transform coefficients. In at least one implementation, the entropy decoding unit <NUM> provides the quantized transform coefficients, the quantization parameters, and the transform data to the inverse quantization/inverse transform unit <NUM>, and provides the motion vectors, the intra modes, the partition information, and other syntax information to the prediction process unit <NUM>.

In at least one implementation, the prediction process unit <NUM> may receive syntax elements, such as motion vectors, intra modes, partition information, and other syntax information, from the entropy decoding unit <NUM>. In at least one implementation, the prediction process unit <NUM> may receive the syntax elements including the partition information, and then divide image frames according to the partition information. In at least one implementation, each of the image frames may be divided into at least one image block according to the partition information. The at least one image block may include a luminance block for reconstructing a plurality of luminance samples, and at least one chrominance block for reconstructing a plurality of chrominance samples. The luminance block and the at least one chrominance block may be further divided to generate macroblocks, coding tree units (CTUs), coding blocks (CBs), sub-divisions thereof, and/or another equivalent coding unit.

In at least one implementation, during the decoding process, the prediction process unit <NUM> receives predicted data including the intra mode or the motion vector for a current image block of a specific one of the image frames. The current image block may be one of the luminance block and the at least one of the chrominance block in the specific image frame.

In at least one implementation, the intra prediction unit <NUM> may perform intra-predictive coding of a current block unit relative to one or more neighboring blocks in the same frame as the current block unit based on the syntax elements related to the intra mode to generate a predicted block. In at least one implementation, the intra mode may specify the location of reference samples selected from the neighboring blocks within the current frame.

In at least one implementation, the intra prediction unit <NUM> may reconstruct a plurality of chroma components of the current block unit based on the plurality of luma components of the current block unit, when the chroma components of the current block are reconstructed by the prediction process unit <NUM>.

In at least one implementation, the inter prediction unit <NUM> may perform inter-predictive coding of the current block unit relative to one or more blocks in one or more reference image block based on the syntax elements related to the motion vector to generate the predicted block. In at least one implementation, the motion vector may indicate a displacement of the current block unit within the current image block relative to a reference block unit within the reference image block. The reference block unit is a block that is determined to closely match the current block unit. In at least one implementation, the inter prediction unit <NUM> receives the reference image block stored in the decoded picture buffer <NUM> and reconstructs the current block unit based on the received reference image blocks.

In at least one implementation, the inverse quantization/inverse transform unit <NUM> may apply inverse quantization and inverse transformation to reconstruct the residual block in the pixel domain. In at least one implementation, the inverse quantization/inverse transform unit <NUM> may apply inverse quantization to the residual quantized transform coefficient to generate a residual transform coefficient, and then apply inverse transformation to the residual transform coefficient to generate the residual block in the pixel domain. In at least one implementation, the inverse transformation may be inversely applied the transformation process, such as discrete cosine transform (DCT), discrete sine transform (DST), adaptive multiple transform (AMT), mode-dependent non-separable secondary transform (MDNSST), hypercube-givens transform (HyGT), signal dependent transform, Karhunen-Loéve transform (KLT), wavelet transform, integer transform, sub-band transform or a conceptually similar transform. In at least one implementation, the inverse transformation may convert the residual information from a transform domain, such as a frequency domain, back to the pixel domain. In at least one implementation, the degree of inverse quantization may be modified by adjusting a quantization parameter.

In at least one implementation, the first summer <NUM> adds the reconstructed residual block to the predicted block provided from the prediction process unit <NUM> to produce a reconstructed block.

In at least one implementation, the filtering unit <NUM> may include a deblocking filter, a sample adaptive offset (SAO) filter, a bilateral filter, and/or an adaptive loop filter (ALF) to remove blockiness artifacts from the reconstructed block. Additional filters (in loop or post loop) may also be used in addition to the deblocking filter, the SAO filter, the bilateral filter and the ALF. Such filters are not shown for brevity, but if desired, may filter the output of the first summer <NUM>. In at least one implementation, the filtering unit <NUM> may output the decoded video to the display module <NUM> or other video receiving unit, after the filtering unit <NUM> performs the filtering process for the reconstructed blocks of the specific image frame.

In at least one implementation, the decoded picture buffer <NUM> may be a reference picture memory that stores the reference block for use in decoding the bitstream by the prediction process unit <NUM>, e.g., in inter-coding modes. The decoded picture buffer <NUM> may be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magneto-resistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. In at least one implementation, the decoded picture buffer <NUM> may be on-chip with other components of the decoder module <NUM>, or off-chip relative to those components.

<FIG> illustrates a flowchart in accordance with a first exemplary implementation of the mode list adjustment for intra prediction. The example method is provided by way of example only, as there are a variety of ways to carry out the method. The method described below may be carried out using the configurations illustrated in <FIG> and <FIG>, for example, and various elements of these figures are referenced in explaining the example method. Each block shown in <FIG> represents one or more processes, methods, or subroutines, carried out in the example method. Furthermore, the order of blocks is illustrative only and may change. Additional blocks may be added or less blocks may be utilized without departing from this disclosure.

At block <NUM>, the decoder module <NUM> determines a block unit in an image frame from video data, and determines a plurality of neighboring blocks neighboring with the block unit.

In at least one implementation, the video data may be a bitstream. The second electronic device <NUM> may receive the bitstream from an encoder, such as the first electronic device <NUM>, via the second interface <NUM> of the second electronic device <NUM>. The second interface <NUM> provides the bitstream to the decoder module <NUM>. The decoder module <NUM> determines the image frame based on the bitstream, and divides the image frame to determine the block unit according to a plurality of partition indications in the bitstream. For example, the decoder module <NUM> may divide the image frames to generate a plurality of coding tree units, and further divide one of the coding tree units to determine the block unit having a block size according to the partition indications based on any video coding standard.

In at least one implementation, the entropy decoding unit <NUM> may decode the bitstream to determine a plurality of prediction indications for the block unit, and then the decoder module <NUM> may further reconstruct the block unit based on the prediction indications. In at least one implementation, the prediction indications may include a plurality of flags and a plurality of indices.

In at least one implementation, the prediction process unit <NUM> of the second electronic device <NUM> determines the neighboring blocks neighboring with the block unit. In at least one implementation, the neighboring blocks may be reconstructed prior to reconstructing the block unit, so the neighboring blocks may include a plurality of reference samples for reconstructing the block unit. In at least one implementation, the block unit may be reconstructed prior to reconstructing some of the neighboring blocks, so the unreconstructed neighboring blocks may not include the reference samples for the block unit. <FIG> is a schematic illustration of one exemplary implementation of an image frame <NUM> having a block unit <NUM>. The prediction process unit <NUM> may receive the reference samples <NUM> neighboring with the block unit <NUM>. The reference samples <NUM> includes a plurality of first reference samples <NUM> located above the block unit <NUM> and a plurality of second reference samples <NUM> located in the left of the block unit <NUM>.

Referring back to <FIG>, at block <NUM>, the intra prediction unit <NUM> determines a first mode list having a plurality of first candidate modes and a second mode list having a plurality of second candidate modes.

In at least one implementation, the first candidate modes and the second candidate modes are selected from a plurality of intra modes. In one implementation, at least one of the first candidate modes may be identical to at least one of the second candidate modes. In another implementation, each of the first candidate modes may be different from the second candidate modes.

Table <NUM> schematically shows an exemplary implementation where indices are assigned to the intra modes each having an intra prediction angle. In the implementation, each of the first candidate modes and the second candidate modes may correspond to one of a planar mode, a DC mode, and a plurality of intra modes <NUM>-<NUM> in Table <NUM>.

Table <NUM> schematically shows an exemplary implementation where indices are assigned to the intra modes each having an intra prediction angle. In the implementation, each of the first candidate modes and the second candidate modes may correspond to one of a planar mode, a DC mode, and the intra modes <NUM>-<NUM> in Table <NUM>.

In at least one implementation, the intra prediction unit <NUM> may select the first candidate modes and the second candidate modes based on the first example in Table <NUM>, the second example in Table <NUM>, and other predefined prediction mode list. For example, the intra prediction unit <NUM> may select the planar mode, the DC mode, and all of the intra mode <NUM>-<NUM> in Table <NUM> to be the first candidate modes, and select the planar mode, the DC mode, and all of the intra mode <NUM>, <NUM>, and <NUM>-<NUM> in Table <NUM> to be the second candidate modes.

At block <NUM>, the intra prediction unit <NUM> selects one of the first mode list and the second mode list.

In at least one implementation, the entropy decoding unit <NUM> may decode the bitstream to determine a list flag for the block unit, and then the decoder module <NUM> may further reconstruct the block unit based on the list flag. In at least one implementation, the intra prediction unit <NUM> may generate the selected mode list from the first mode list and the second mode list based on the list flag.

In at least one implementation, the intra prediction unit <NUM> may directly determine, without the list flag, which one of the first mode list and the second mode list is selected for the block unit <NUM>. In one implementation, the intra prediction unit <NUM> may determine whether the neighboring blocks include the reference samples for determining how to select one of the first mode list and the second mode list. In another implementation, the intra prediction unit <NUM> may determine how to select one of the first mode list and the second mode list based on a block size of the block unit <NUM>.

At block <NUM>, the intra prediction unit <NUM> selects a prediction mode from the selected mode list.

In at least one implementation, the entropy decoding unit <NUM> may decode the bitstream to determine an orientation flag for the block unit. In one implementation, the intra prediction unit <NUM> may select the prediction mode from the selected mode list based on the orientation flag. In one implementation, the intra prediction unit <NUM> may select one of the first candidate modes from the first mode list based on the orientation flag, when the selected mode list is the first mode list. Then, the intra prediction unit <NUM> may set the selected first candidate mode as the prediction mode. In another implementation, the intra prediction unit <NUM> may select one of the second candidate modes from the second mode list based on the orientation flag, when the selected mode list is the second mode list. Then, the intra prediction unit <NUM> may set the selected second candidate mode as the prediction mode.

At block <NUM>, the decoder module <NUM> generates a plurality of reconstructed components in the block unit based on the neighboring blocks and the prediction mode.

In at least one implementation, the block unit may include a plurality of block elements. In the implementation, each of the block elements may be a pixel element. In at least one implementation, the intra prediction unit <NUM> may determine, along the prediction mode derived for the block unit, one of the predictors for each of the block elements based on the reference samples determined from the neighboring blocks.

In at least one implementation, the first summer <NUM> of the decoder module <NUM> in the second electronic device <NUM> may add the predictors derived based on the prediction mode into a plurality of residual samples determined from the bitstream to reconstruct the block unit. In addition, the decoder module <NUM> may reconstruct all of the other block units in the image frame for reconstructing the image frame and the video.

<FIG> illustrates a flowchart in accordance with a second exemplary implementation of the mode list adjustment for intra prediction. The example method is provided by way of example only, as there are a variety of ways to carry out the method. The method described below may be carried out using the configurations illustrated in <FIG> and <FIG>, for example, and various elements of these figures are referenced in explaining the example method. Each block shown in <FIG> represents one or more processes, methods, or subroutines, carried out in the example method. Furthermore, the order of blocks is illustrative only and may change. Additional blocks may be added or less blocks may be utilized without departing from this disclosure.

At block <NUM>, the decoder module <NUM> determines a block unit in an image frame from video data.

In at least one implementation, the prediction process unit <NUM> of the second electronic device <NUM> determines the neighboring blocks neighboring with the block unit. In at least one implementation, the neighboring blocks may be reconstructed prior to reconstructing the block unit, so the neighboring blocks may include a plurality of reference samples for reconstructing the block unit. In at least one implementation, the block unit may be reconstructed prior to reconstructing some of the neighboring blocks, so the unreconstructed neighboring blocks may not include the reference samples for the block unit.

At block <NUM>, the intra prediction unit <NUM> determines a mode list including a plurality of candidate modes separated into a first mode group and a second mode group.

In at least one implementation, the candidate modes in the mode list may be predefined in the second electronic device <NUM> and the first electronic device <NUM>. For example, the candidate modes may be predefined as a planar mode, a DC mode, and/or a plurality of directional modes.

In at least one implementation, the intra prediction unit <NUM> may divide the candidate modes into a first mode group and a second mode group. In the implementation, the candidate modes in the first mode group may be a plurality of default modes selected from the mode list, and the candidate modes in the second mode group may be a plurality of added modes selected from the mode list for replacing at least one of the default modes. In at least one implementation, the default modes in the first mode group may include a planar mode, a DC mode, and a plurality of first directional modes, and the added modes in the second mode group may include a plurality of second directional modes. In the implementation, the second directional modes may be selected to replace at least one of the first directional modes. In the implementation, each of the added modes in the second mode group is different from the default modes in the first mode group, since the candidate modes are separated into the first mode group and the second mode group.

In at least one implementation, each of the candidate modes has a prediction index. In one implementation, the prediction indices of the default modes in the first mode group may be equal to <NUM> to <NUM>, when the decoder module <NUM> decodes the bitstream in high efficiency video coding (HEVC). In the implementation, the prediction indices of the planer mode and the DC mode may be equal to <NUM> and <NUM>, and the prediction indices of the first directional modes may be equal to <NUM> to <NUM>. In the implementation, the prediction indices of the added modes in the second mode group may be greater than <NUM> or less than <NUM>. In one implementation, the prediction indices of the default modes in the first mode group may be equal to <NUM> to <NUM>, when the decoder module <NUM> decodes the bitstream in versatile video coding (VVC) test model (VTM). In the implementation, the prediction indices of the planer modes and the DC mode may be equal to <NUM> and <NUM>, and the prediction indices of the default modes may be equal to <NUM> to <NUM>. In the implementation, the prediction indices of the added modes in the second mode group may be greater than <NUM> or less than <NUM>.

Table <NUM> schematically shows an exemplary implementation where indices are assigned to the intra modes each having an intra prediction angle. In the implementation, each of the first candidate modes and the second candidate modes may correspond to one of a planar mode, a DC mode, and a plurality of intra modes <NUM> - <NUM> in Table <NUM>.

Table <NUM> schematically shows an exemplary implementation where indices are assigned to the intra modes each having an intra prediction angle. In the implementation, each of the first candidate modes and the second candidate modes may correspond to one of a planar mode, a DC mode, and the intra modes -<NUM> - -<NUM> and <NUM> - <NUM> in the table <NUM>.

In at least one implementation, the intra prediction unit <NUM> may select the first candidate modes and the second candidate modes based on the third example in Table <NUM>, the fourth example in Table <NUM>, and other predefined prediction mode list. For example, the candidate modes in the mode list may include the first mode group having the planar mode, the DC mode, and the intra modes <NUM>-<NUM> in Table <NUM>, and the second mode group having the intra modes -<NUM> - -<NUM> and <NUM>-<NUM> in Table <NUM>. In the implementation, the planar mode, the DC mode, and the intra modes <NUM>-<NUM> in the first mode group are the default modes, and the intra modes -<NUM> - -<NUM> and <NUM>-<NUM> in the second mode group are the added modes.

At block <NUM>, the intra prediction unit <NUM> determines whether a specific one of the candidate modes in the first mode group is replaced by one of the candidate modes in the second mode group.

In at least one implementation, the entropy decoding unit <NUM> may decode the bitstream to determine a replacement flag and an orientation index for the block unit, and then the decoder module <NUM> may further reconstruct the block unit based on the replacement flag and the orientation index. In at least one implementation, the intra prediction unit <NUM> may determine the specific candidate mode in the first mode group based on the orientation index, and determine whether the specific candidate mode in the first mode group is replaced by one of the candidate modes in the second mode group based on the replacement flag.

In at least one implementation, the entropy decoding unit <NUM> may decode the bitstream to determine the orientation index for the block unit to determine the specific candidate mode in the first mode group. In the implementation, there may be no replacement flag in the bitstream for the specific candidate mode in the first mode group. In the implementation, the intra prediction unit <NUM> may directly determine, without the replacement flag, whether the specific candidate mode in the first mode group is replaced by one of the candidate modes in the second mode group. In one implementation, the intra prediction unit <NUM> may determine whether the neighboring blocks include the reference samples for determining whether to replace at least one of the candidate modes in the first mode group by at least one of the candidate modes in the second mode group. In one implementation, all of the candidate modes in the first mode group is not replaced by the candidate modes in the second mode group, so the intra prediction unit <NUM> may determine that the specific candidate modes in the first mode group is not replaced by the candidate modes in the second mode group. In another implementation, the intra prediction unit <NUM> may determine that the at least one of the candidate modes in the first mode group is replaced by at least one of the candidate modes in the second mode group according to the relationship between the neighboring blocks and the reference samples. Then, the intra prediction unit <NUM> further determines which of the candidate modes in the first mode group is selected and replaced by the at least one of the candidate modes in the second mode group. In one implementation, the intra prediction unit <NUM> determines that the specific candidate mode in the first mode group is replaced by one of the at least one of the candidate modes in the second mode group, if the specific candidate mode in the first mode group is selected to be replaced. In another implementation, the intra prediction unit <NUM> determines that the specific candidate mode in the first mode group is not replaced by the candidate modes in the second mode group, if the specific candidate mode in the first mode group is not selected.

In at least one implementation, the intra prediction unit <NUM> may determine based on a block size of the block unit <NUM> whether to replace at least one of the candidate modes in the first mode group by at least one of the candidate modes in the second mode group. When a block width is equal to a block height, the intra prediction unit <NUM> may determine that the at least one of the candidate modes in the first mode group is not replaced by the at least one of the candidate modes in the second mode group. When the block width is different from the block height, the intra prediction unit <NUM> may determine that the at least one of the candidate modes in the first mode group is replaced by the at least one of the candidate modes in the second mode group. Then, the intra prediction unit <NUM> further determines which of the candidate modes in the first mode group is selected and replaced by the at least one of the candidate modes in the second mode group for checking whether the specific candidate modes in the first mode group is selected or not.

At block <NUM>, the intra prediction unit <NUM> determines the specific candidate mode in the first mode group as a prediction mode.

In at least one implementation, the intra prediction unit <NUM> may directly set the specific candidate mode in the first mode group as the prediction mode based on the orientation index.

At block <NUM>, the intra prediction unit <NUM> determines which one of the candidate modes in the second mode group is selected as the prediction mode to replace the specific candidate mode in the first mode group.

In at least one implementation, the intra prediction unit <NUM> determines that the at least one of the candidate modes in the first mode group is replaced by the at least one of the candidate modes in the second mode group. In the implementation, the number of the at least one of the candidate modes in the first mode group is equal to the number of the at least one of the candidate modes in the second mode group. In addition, each of the at least one of the candidate modes in the first mode group corresponds to one of the at least one of the candidate modes in the second mode group. Thus, the intra prediction unit <NUM> further determine which one of the at least one of the candidate modes in the second mode group corresponds to the specific candidate mode in the first mode group. Then, the intra prediction unit <NUM> sets the determined candidate mode in the second mode group corresponding to the specific candidate mode in the first mode group as the prediction mode.

At block <NUM>, the decoder module <NUM> generates a plurality of predictors in the block unit based on the prediction mode.

<FIG> illustrates a flowchart in accordance with a third exemplary implementation of the mode list adjustment for intra prediction. The example method is provided by way of example only, as there are a variety of ways to carry out the method. The method described below may be carried out using the configurations illustrated in <FIG> and <FIG>, for example, and various elements of these figures are referenced in explaining the example method. Each block shown in <FIG> represents one or more processes, methods, or subroutines, carried out in the example method. Furthermore, the order of blocks is illustrative only and may change. Additional blocks may be added or less blocks may be utilized without departing from this disclosure. In one implementation, <FIG> may be a detailed exemplary implementation of block <NUM> in <FIG>.

At block <NUM>, the intra prediction unit <NUM> determines a plurality of sample positions and a plurality of reference samples of the block unit.

In at least one implementation, the image frame includes a plurality of block units having a first block unit, a second block unit, a third block unit, and a fourth block unit. <FIG> is a schematic illustration of one exemplary implementation of the first block unit <NUM>, the second block unit <NUM>, the third block unit <NUM>, the fourth block unit <NUM>, and the reference samples <NUM>, <NUM> and <NUM> of the first block unit <NUM>. In the implementation, the first block unit <NUM> further includes a first sub-block unit <NUM> and a second sub-block unit <NUM>. In one implementation, the intra prediction unit <NUM> may determine a first sample position <NUM>, a second sample position <NUM>, a third sample position <NUM>, and a fourth sample position <NUM> for the second sub-block unit <NUM>, when the decoder module <NUM> reconstructs the second sub-block unit <NUM>. In the implementation, the first sample position <NUM> may be an Above position, the second sample position <NUM> may be an AboveRight position, the third sample position <NUM> may be a Left position, and the fourth sample position <NUM> may be a BelowLeft position. In at least one implementation, the first sub-block unit <NUM> may be reconstructed prior to reconstructing the second sub-block unit <NUM>, so the first sample position <NUM> may include the first reference samples <NUM> for reconstructing the block unit. In at least one implementation, the second sub-block unit <NUM> may be reconstructed prior to reconstructing the second block unit <NUM>, so there is no reference sample at the second sample position <NUM> for reconstructing the second sub-block unit <NUM>. In one implementation, the third sample position <NUM> may include the second reference samples <NUM>, when there is a previous decoded block located in the left of the block units <NUM>-<NUM>. In addition, the fourth sample position <NUM> may include the third reference samples <NUM>.

<FIG> is a schematic illustration of one exemplary implementation of the sub-block unit <NUM> and the reference samples <NUM>. In at least one implementation, the image frame <NUM> includes a fifth block unit <NUM>, a sixth block unit <NUM>, and a seventh block unit <NUM>, and the seventh block unit <NUM> further includes a third sub-block unit <NUM> and a fourth sub-block unit <NUM>. When the decoder module <NUM> reconstructs the fourth sub-block unit <NUM>, the intra prediction unit <NUM> may determine a fifth sample position <NUM>, a sixth sample position <NUM>, a seventh sample position <NUM>, and an eighth sample position <NUM> for the fourth sub-block unit <NUM>. In the implementation, the fifth sample position <NUM> may be an Above position, the sixth sample position <NUM> may be an AboveRight position, the seventh sample position <NUM> may be a Left position, and the eighth sample position <NUM> may be a BelowLeft position. In the implementation, there is no reference samples at the fifth sample position <NUM> and the sixth sample position <NUM>, since there is no block unit located above the fourth sub-block unit <NUM>. In the implementation, the third sub-block unit <NUM> may be reconstructed prior to reconstructing the fourth sub-block unit <NUM>, so the seventh sample position <NUM> may include the fourth reference samples <NUM> for reconstructing the block unit. In at least one implementation, the fourth sub-block unit <NUM> may be reconstructed prior to reconstructing another block unit located below the block unit <NUM>, so there is no reference sample at the eighth sample position <NUM> for reconstructing the second sub-block unit <NUM>.

At block <NUM>, the intra prediction unit <NUM> determines the selected candidate list based on relationships between the reference samples and the sample positions.

In at least one implementation, there may be more than one candidate list predefined in the first electronic device <NUM> and the second electronic device <NUM>. In addition, a predefined selection rule for determining how to select one of the candidate lists may also be predefined in the first electronic device <NUM> and the second electronic device <NUM>. For example, the predefined candidate lists may include a first candidate list, a second candidate list, a third candidate list, and a fourth candidate list. In the implementation, each of the first to fourth candidate lists is different from each other. In the implementation, some of the candidate modes in one of the candidate lists may be identical to the candidate modes in the other candidate lists. In one implementation, the first candidate list may be selected, when there are reference samples at each of the first to fourth sample positions for the block unit. In another implementation, the second candidate list may be selected, when there are reference samples at the first to third sample positions for the block unit. In other words, there is no reference sample at the BelowLeft position. In addition, the third candidate list may be selected, when there is no reference sample at the AboveRight position. In other implementations, the fourth candidate list may be selected, when there are reference samples at the first sample position and the third to fourth sample positions for the block unit. In other words, there is no reference sample at the AboveRight position. For example, the intra prediction unit <NUM> may determine that there is no reference sample at the second sample position <NUM>. Thus, the intra prediction unit <NUM> may select the third candidate list for reconstructing the second sub-block unit <NUM> based on the predefined selection rule.

<FIG> illustrates a flowchart in accordance with a fourth exemplary implementation of the mode list adjustment for intra prediction. The example method is provided by way of example only, as there are a variety of ways to carry out the method. The method described below may be carried out using the configurations illustrated in <FIG> and <FIG>, for example, and various elements of these figures are referenced in explaining the example method. Each block shown in <FIG> represents one or more processes, methods, or subroutines, carried out in the example method. Furthermore, the order of blocks is illustrative only and may change. Additional blocks may be added or less blocks may be utilized without departing from this disclosure. In one implementation, <FIG> may be a detailed exemplary implementation of block <NUM> in <FIG>.

In at least one implementation, the intra prediction unit <NUM> may determine a first sample position, a second sample position, a third sample position, and a fourth sample position for the block unit, when the decoder module <NUM> reconstructs the block unit. In the implementation, the first sample position may be an Above position, the second sample position may be an AboveRight position, the third sample position may be a Left position, and the fourth sample position may be a BelowLeft position. In one implementation, a first neighboring block covering the first sample position may be reconstructed prior to reconstructing the block unit. Thus, the first sample position may include a plurality of first reference samples generated based on the first neighboring block for the block unit. In another implementation, the block unit may be reconstructed prior to reconstructing a second neighboring block covering the second sample position. Thus, there may be no reference sample at the second sample position for reconstructing the block unit. In another implementation, there may be no reference sample at the third sample position and the fourth sample position, when there is no block unit located in the left of the block unit.

At block <NUM>, the intra prediction unit <NUM> determines whether at least one of the candidate modes in the first mode group is replaced based on relationships between the reference samples and the sample positions.

In at least one implementation, the candidate modes in the mode list may be predefined in the second electronic device <NUM> and the first electronic device <NUM>, and divided into the first mode group and the second mode group. In the implementation, the candidate modes in the first mode group predefined in the first electronic device <NUM> are identical to the candidate modes in the first mode group predefined in the second electronic device <NUM>. In the implementation, the candidate modes in the second mode group predefined in the first electronic device <NUM> are identical to the candidate modes in the second mode group predefined in the second electronic device <NUM>. In the implementation, the candidate modes in the first mode group may be a plurality of default modes selected from the mode list, and the candidate modes in the second mode group may be a plurality of added modes selected from the mode list for replacing at least one of the default modes. In at least one implementation, the default modes in the first mode group may include a planar mode, a DC mode, and a plurality of first directional modes, and the added modes in the second mode group may include a plurality of second directional modes. In the implementation, the at least one of the second directional modes may be selected to replace the at least one of the first directional modes. In the implementation, each of the candidate modes in the second mode group is different from the candidate modes in the first mode group.

In at least one implementation, a predefined replacement rule for determining whether the at least one of the default modes is replaced may be predefined in the first electronic device <NUM> and the second electronic device <NUM>. In one implementation, each of the default modes may remain unchanged, when there are reference samples at each of the first to fourth sample positions for the block unit. Thus, the block unit may be predicted by one of the default modes. In another implementation, the at least one of the default modes may be replaced by the at least one of the added modes, when there is no reference sample at one of the first to fourth sample positions for the block unit.

In at least one implementation, the default modes in the first mode group may remain unchanged, when the intra prediction unit <NUM> determines that there are reconstructed samples at the BelowLeft position and the AboveRight position. In the implementation, the intra prediction unit <NUM> replaces the at least one of the default modes having orientations directing toward the AboveRight position by the at least one of the added modes, when the intra prediction unit <NUM> determines that there are reconstructed samples at the BelowLeft position and that there is no reconstructed sample at the AboveRight position. In the implementation, the at least one of the added modes may be selected from a plurality of outermost candidate modes in the second mode group, such as the candidate modes directing toward the BelowLeft position. In the implementation, the intra prediction unit <NUM> replaces the at least one of the default modes having orientations directing toward the BelowLeft position by the at least one of the added modes, when the intra prediction unit <NUM> determines that there are reconstructed samples at the AboveRight position and that there is no reconstructed sample at the BelowLeft position. In the implementation, the at least one of the added modes may be selected from the outermost candidate modes, such as the candidate modes directing toward the AboveRight position. In the implementation, the default modes in the first mode group may remain unchanged, when the intra prediction unit <NUM> determines that there is no reconstructed sample at the AboveRight position and the BelowLeft position.

In at least one implementation, the intra prediction unit <NUM> may replace at least one of the default modes having orientations directing toward the BelowLeft position and the AboveRight position by the at least one of the added modes, when the intra prediction unit <NUM> determines that there is no reconstructed sample at the BelowLeft position and the AboveRight position. In the implementation, the at least one of the added modes may be selected based on a cost function. In the implementation, the cost function may be the sum of absolute differences (SAD). In at least one implementation, the intra prediction unit <NUM> may replace at least one of the default modes by the at least one of the added modes, when the intra prediction unit <NUM> determines that there are reconstructed samples at each of the four sample positions. In the implementation, the at least one of the added modes and the at least one of the default modes may be selected based on the cost function.

In at least one implementation, the intra prediction unit <NUM> may generate an intra predictor based on each of the added modes, and calculate the cost function for each of the added modes. Then, the intra prediction unit <NUM> may select at least one of the added modes having the lowest cost results to replace the at least one of the default modes. In at least one implementation, in <FIG>, the intra prediction unit <NUM> may determine four sample positions <NUM>, <NUM>, <NUM>, and <NUM>, and determine that there are reconstructed samples <NUM>, <NUM>, and <NUM> at the sample positions <NUM>, <NUM>, and <NUM>. Thus, the intra prediction unit <NUM> may determine that there is no reconstructed sample at the second sample position <NUM>, i.e. the AboveRight position. In the implementation, the intra prediction unit <NUM> may select at least one of the candidate modes in the second mode group having the lowest cost results, or directing toward the BelowLeft position. Then, the intra prediction unit <NUM> may replace the at least one candidate modes in the first mode group by the selected at least one candidate modes in the second mode group. Thus, the intra prediction unit <NUM> may compare the at least one of the candidate modes in the first mode group with a specific one of the candidate modes in the first mode group determined based on an orientation flag to determine whether the specific candidate mode in the first mode group is replaced or not.

<FIG> illustrates a flowchart in accordance with a first exemplary implementation of the multi-reference line prediction for chroma prediction. The example method is provided by way of example only, as there are a variety of ways to carry out the method. The method described below may be carried out using the configurations illustrated in <FIG> and <FIG>, for example, and various elements of these figures are referenced in explaining the example method. Each block shown in <FIG> represents one or more processes, methods, or subroutines, carried out in the example method. Furthermore, the order of blocks is illustrative only and may change. Additional blocks may be added or less blocks may be utilized without departing from this disclosure.

At block <NUM>, the decoder module <NUM> determines a block unit from the video data, and a prediction mode of the block unit.

In at least one implementation, the entropy decoding unit <NUM> may decode the bitstream to determine a plurality of prediction indications for the block unit, and then the decoder module <NUM> may further reconstruct the block unit based on the prediction indications. In at least one implementation, the prediction indications may include a plurality of flags and a plurality of indices. In the implementation, the prediction indications include at least one mode flag indicating that the block unit is predicted based on the prediction mode.

In at least one implementation, the intra prediction unit <NUM> determines a plurality of reconstructed samples neighboring with the block unit. <FIG> is a schematic illustration of one exemplary implementation of the block unit <NUM> and a plurality of reference lines <NUM>, <NUM>, <NUM>, and <NUM> each having a plurality of reconstructed samples. In the implementation, the number of the reference lines may be equal to L, and the number L may be an integer greater than one. In one implementation, the intra prediction unit <NUM> selects at least one of the reference lines to reconstruct the block unit based on the selected at least one of the reference lines according to the prediction mode.

In at least one implementation, the prediction mode is selected from a plurality of candidate modes. In at least one implementation, the candidate modes may include a plurality of direct modes (DMs), a plurality of most probable modes (MPMs) and a plurality of linear modes (LMs). In the implementation, the LMs may include a linear model mode, a multiple-model linear mode (MMLM), and a multiple-filter linear mode (MFLM). In one implementation, the intra prediction unit <NUM> may reconstruct the block unit <NUM> based on the reconstructed samples in one of the reference lines <NUM>-<NUM>, when the intra prediction unit <NUM> determines that the prediction mode is selected from the LMs based on the at least one prediction flag. In the implementation, the one of the reference lines may be predefined as a first one of the reference lines. For example, the predefined one of the reference lines may be the first reference line <NUM> in <FIG>. In one implementation, the intra prediction unit <NUM> may reconstruct the block unit based on the reconstructed samples in at least one of the reference lines, when the intra prediction unit <NUM> determines that the prediction mode is selected from the DMs and MPMs based on the at least one prediction flag. In the implementation, in <FIG>, the intra prediction unit <NUM> may select at least one of the reference lines <NUM>-<NUM> to reconstruct the block unit <NUM> based on the selected at least one of the reference lines <NUM>-<NUM> according to the prediction mode.

At block <NUM>, the decoder module <NUM> determines whether the prediction mode is included in a first mode group. When the prediction mode is included in the first mode group, the procedure proceeds to block <NUM>. When the prediction mode is different from the candidate modes in the first mode group, the procedure directly proceeds to block <NUM>.

In at least one implementation, the first electronic device <NUM> and the second electronic device <NUM> may separate the candidate modes into a plurality of mode groups. In the implementation, the first mode group may include a plurality of first candidate modes, and a second mode group may include a plurality of second candidate modes. In one implementation, the encoder module <NUM> may predict the block unit based on the reconstructed samples in the at least one of the reference lines, when the encoder module <NUM> determines to predict the block unit based on a specific one of the first candidate modes. In addition, the decoder module <NUM> may reconstruct the block unit based on the reconstructed samples in the at least one of the reference lines, when the decoder module <NUM> determines to reconstruct the block unit based on the specific first candidate mode. In one implementation, the encoder module <NUM> may predict the block unit based on the reconstructed samples in the predefined one of the reference lines, when the encoder module <NUM> determines to predict the block unit based on a specific one of the second candidate modes. In addition, the decoder module <NUM> may reconstruct the block unit based on the reconstructed samples in the predefined one of the reference lines, when the decoder module <NUM> determines to reconstruct the block unit based on the specific second candidate mode. In one implementation, the first candidate modes may be the DMs, and the MPMs, and the second candidate modes may be the LMs.

In at least one implementation, the intra prediction unit <NUM> may reconstruct the block unit based on the reconstructed samples in the at least one of the reference lines, when the intra prediction unit <NUM> determines that the prediction mode belongs to the first mode group having the DMs and MPMs. Thus, the decoder module <NUM> needs to further determine which of the reference lines is used to predict the block unit.

In at least one implementation, the intra prediction unit <NUM> may reconstruct the block unit based on the reconstructed samples in the predefined one of the reference lines, when the intra prediction unit <NUM> determines that the prediction mode is included in the second mode group having the LMs. Thus, the intra prediction unit <NUM> may directly select the predefined one of the reference lines to reconstruct the block unit without decoding a line indication indicating an index corresponding to the at least one of the reference lines.

At block <NUM>, the decoder module <NUM> decodes the bitstream to obtain the line indication indicating the at least one of the reference lines.

In at least one implementation, the intra prediction unit <NUM> may reconstruct the block unit based on the reconstructed samples in the at least one of the reference lines, when the intra prediction unit <NUM> determines that the prediction mode belongs to the first mode group. In one implementation, the decoder module <NUM> decodes the bitstream to obtain the line indication. In the implementation, the line indication may be a line index. In the implementation, the intra prediction unit <NUM> may determine the at least one of the reference lines based on the line index. For example, the number of the at least one reference lines may equal to one, when the line index is equal to zero. In one implementation, the at least one reference lines may be the first reference line, when the line index is equal to zero. In another implementation, the at least one reference lines may be the second reference line or a combination of the first reference line and the second reference line, when the line index is equal to one.

At block <NUM>, the decoder module <NUM> directly selects one of the reference lines without further decoding the line indication.

In at least one implementation, the intra prediction unit <NUM> may reconstruct the block unit based on the reconstructed samples in the predefined one of the reference lines, when the intra prediction unit <NUM> determines that the prediction mode is different from the first candidate modes in the first mode group. In one implementation, the predefined one of the reference lines may be the first reference line.

At block <NUM>, the decoder module <NUM> generates a plurality of predictors in the block unit based on the prediction mode and the at least one reference line.

In at least one implementation, the block unit may include a plurality of block elements. In the implementation, each of the block elements may be a pixel element. In at least one implementation, the intra prediction unit <NUM> may determine, according to the prediction mode derived for the block unit, one of the predictors for each of the block elements based on the reference samples in the at least one reference line.

<FIG> illustrates a flowchart in accordance with a second exemplary implementation of the multi-reference line prediction for chroma prediction. The example method is provided by way of example only, as there are a variety of ways to carry out the method. The method described below may be carried out using the configurations illustrated in <FIG> and <FIG>, for example, and various elements of these figures are referenced in explaining the example method. Each block shown in <FIG> represents one or more processes, methods, or subroutines, carried out in the example method. Furthermore, the order of blocks is illustrative only and may change. Additional blocks may be added or less blocks may be utilized without departing from this disclosure.

At block <NUM>, the decoder module <NUM> determines a block unit from video data and determines a line index indicating at least one of reference lines for reconstructing the block unit.

In at least one implementation, the intra prediction unit <NUM> may determine a plurality of reconstructed samples in the reference lines. In one implementation, the number of the reference lines may be equal to L, and the number L may be an integer greater than one. In one implementation, the intra prediction unit <NUM> may select the indicated at least one of the reference lines for reconstructing the block unit.

In at least one implementation, the entropy decoding unit <NUM> may decode the bitstream to determine a plurality of prediction indications for the block unit, and then the decoder module <NUM> may further reconstruct the block unit based on the prediction indications. In at least one implementation, the prediction indications may include a plurality of flags and a plurality of indices. In the implementation, the prediction indications include the line index indicating which of the reference lines is the indicated at least one of the reference lines.

At block <NUM>, the decoder module <NUM> determines whether the line index is equal to zero. When the line index is equal to zero, the procedure proceeds to block <NUM>. When the line index is different from zero, the procedure proceeds to block <NUM>.

In at least one implementation, the prediction indications may include a mode flag indicating that the block unit is predicted based on a prediction mode. In at least one implementation, the prediction mode is selected from a plurality of candidate modes. In at least one implementation, the candidate modes may include a plurality of direct modes (DMs), a plurality of most probable modes (MPMs) and a plurality of linear modes (LMs). In the implementation, the LMs may include a linear model mode, a multiple-model linear mode (MMLM), and a multiple-filter linear mode (MFLM).

In at least one implementation, the first electronic device <NUM> and the second electronic device <NUM> may separate the candidate modes into a plurality of mode groups. In the implementation, the first mode group may include a plurality of first candidate modes, and a second mode group may include a plurality of second candidate modes. In one implementation, the first candidate modes may be the DMs, and the MPMs, and the second candidate modes may be the LMs.

In one implementation, the encoder module <NUM> may predict the block unit based on the reconstructed samples in the indicated at least one of the reference lines, when the encoder module <NUM> determines to predict the block unit based on a specific one of the first candidate modes. In addition, the decoder module <NUM> may reconstruct the block unit based on the reconstructed samples in the indicated at least one of the reference lines, when the decoder module <NUM> determines to reconstruct the block unit based on the specific first candidate mode. In the implementation, in <FIG>, the intra prediction unit <NUM> may select at least one of the reference lines <NUM>-<NUM> to reconstruct the block unit <NUM> based on the line index indicating the selected at least one of the reference lines <NUM>-<NUM>. For example, the indicated at least one of the reference lines <NUM>-<NUM> may be the first reference line <NUM>, when the line index is equal to zero. In another implementation, the indicated at least one of the reference lines <NUM>-<NUM> may be the second reference line <NUM> or a combination of the first reference line <NUM> and the second reference line <NUM>, when the line index is equal to one.

In one implementation, the encoder module <NUM> may predict the block unit based on the reconstructed samples in the predefined one of the reference lines, when the encoder module <NUM> determines to predict the block unit based on a specific one of the second candidate modes. In addition, the decoder module <NUM> may reconstruct the block unit based on the reconstructed samples in the predefined one of the reference lines, when the decoder module <NUM> determines to reconstruct the block unit based on the specific second candidate mode. In one implementation, the predefined one of the reference lines may be the first reference line, and the line index is predefined to be equal to zero.

In at least one implementation, the prediction mode may be selected from the first mode group and the second mode group, when the line index is equal to zero. Thus, the intra prediction unit <NUM> needs to further select one of the first mode group and the second mode group to determine the prediction mode. In another implementation, the prediction mode may be selected only from the first mode group, when the line index is different from zero.

At block <NUM>, the decoder module <NUM> decodes the bitstream to obtain a group indication indicating one of the first mode group and the second mode group for selecting the prediction mode.

In at least one implementation, the prediction mode may be selected from the first mode group and the second mode group, when the line index is equal to zero. Thus, the intra prediction unit <NUM> may need the group indication to select one of the first mode group and the second mode group, when the line index is equal to zero. When the group indication indicates that the prediction mode is selected from the first mode group, the intra prediction unit <NUM> may further determine the prediction mode from the first mode group based on a first mode flag. When the group indication indicates that the prediction mode is selected from the second mode group, the intra prediction unit <NUM> may further determine the prediction mode from the second mode group based on a second mode flag. In one implementation, the intra prediction unit <NUM> may directly set the first candidate mode as the prediction mode without decoding the first mode flag, when the first mode group only includes one first candidate mode. In addition, the intra prediction unit <NUM> may directly set the second candidate mode as the prediction mode without decoding the second mode flag, when the second mode group only includes one second candidate mode.

At block <NUM>, the decoder module <NUM> directly selects the first mode group without decoding the group indication and selects the prediction mode from the first mode group.

In at least one implementation, the prediction mode may be selected only from the first mode group, when the line index is different from zero. Thus, the intra prediction unit <NUM> do not need the group indication, when the line index is different from zero. In one implementation, the intra prediction unit <NUM> may further determine the prediction mode from the first candidate modes in the first mode group based on the first mode flag. In another implementation, the intra prediction unit <NUM> may directly set the first candidate mode as the prediction mode without decoding the first mode flag, when the first mode group only includes one first candidate mode.

At block <NUM>, the intra prediction unit <NUM> generates a plurality of predictors in the block unit based on the prediction mode and the at least one of the reference lines.

<FIG> is a block diagram of an encoder module <NUM> representing an exemplary implementation of the encoder module <NUM> of the first electronic device <NUM> in the system of <FIG>. In at least one implementation, the encoder module <NUM> includes a prediction process unit <NUM>, a first summer <NUM>, a transform/quantization unit <NUM>, an inverse quantization/inverse transform unit <NUM>, a second summer <NUM>, a filtering unit <NUM>, a decoded picture buffer <NUM>, and an entropy encoding unit <NUM>. In at least one implementation, the prediction process unit <NUM> of the encoder module <NUM> further includes a partition unit <NUM>, an intra prediction unit <NUM>, and an inter prediction unit <NUM>. In at least one implementation, the encoder module <NUM> receives the source video, and encodes the source video to output a bitstream.

In at least one implementation, the encoder module <NUM> may receive a source video including a plurality of image frames, and then divide the image frames according to a coding structure. In at least one implementation, each of the image frames may be divided into at least one image block. The at least one image block may include a luminance block having a plurality of luminance samples, and at least one chrominance block having a plurality of chrominance samples. The luminance block and the at least one chrominance block may be further divided to generate macroblocks, coding tree units (CTUs), coding blocks (CBs), sub-divisions thereof, and/or another equivalent coding unit. In at least one implementation, the encoder module <NUM> may perform additional sub-divisions of the source video. It should be noted that the disclosure described herein are generally applicable to video coding, regardless of how the source video is partitioned prior to and/or during encoding.

In at least one implementation, during the encoding process, the prediction process unit <NUM> receives a current image block of a specific one of the image frames. The current image block may be one of the luminance block and the at least one of the chrominance block in the specific image frame. The partition unit <NUM> divides the current image block into multiple block units. The intra prediction unit <NUM> may perform intra-predictive coding of a current block unit relative to one or more neighboring blocks in the same frame as the current block unit to provide spatial prediction. The inter prediction unit <NUM> may perform inter-predictive coding of the current block unit relative to one or more blocks in one or more reference image block to provide temporal prediction.

In at least one implementation, the prediction process unit <NUM> may select one of the coding results generated by the intra prediction unit <NUM> and the inter prediction unit <NUM> based on a mode selection method, such as a cost function. In at least one implementation, the mode selection method may be a rate-distortion optimization (RDO) process. The prediction process unit <NUM> determines the selected coding result, and provides a predicted block corresponding to the selected coding result to the first summer <NUM> for generating a residual block and to the second summer <NUM> for reconstructing the encoded block unit. In at least one implementation, the prediction process unit <NUM> may further provide syntax elements, such as motion vectors, intra-mode indicators, partition information, and other syntax information, to the entropy encoding unit <NUM>.

In at least one implementation, the intra prediction unit <NUM> may intra-predict the current block unit. In at least one implementation, the intra prediction unit <NUM> may determine an intra-prediction mode directing toward reconstructed sample neighboring to the current block unit to encode the current block unit. In at least one implementation, the intra prediction unit <NUM> may encode the current block unit using various intra-prediction modes, and the intra prediction unit <NUM> or the prediction process unit <NUM> may select an appropriate intra-prediction mode from the tested modes. In at least one implementation, the intra prediction unit <NUM> may encode the current block unit using a cross component prediction mode to predict one of the two chroma components of the current block unit based on the luma components of the current block unit. In addition, the intra prediction unit <NUM> may predict a first one of the two chroma components of the current block unit based on the other of the two chroma components of the current block unit.

In at least one implementation, the inter prediction unit <NUM> may inter-predict the current block unit as an alternative to the intra-prediction performed by the intra prediction unit <NUM>, as described above. The inter prediction unit <NUM> may perform a motion estimation to estimate a motion of the current block unit for generating a motion vector. The motion vector may indicate a displacement of the current block unit within the current image block relative to a reference block unit within a reference image block. In at least one implementation, the inter prediction unit <NUM> receives at least one reference image block stored in the decoded picture buffer <NUM> and estimates the motion based on the received reference image blocks to generate the motion vector.

In at least one implementation, the first summer <NUM> generates the residual block by subtracting the prediction block determined by the prediction process unit <NUM> from the original current block unit. The first summer <NUM> represents the component or components that perform this subtraction operation.

In at least one implementation, the transform/quantization unit <NUM> applies a transform to the residual block to generate a residual transform coefficient, and then quantizes the residual transform coefficients to further reduce bit rate. In at least one implementation, the transform may be DCT, DST, AMT, MDNSST, HyGT, signal dependent transform, KLT, wavelet transform, integer transform, sub-band transform or a conceptually similar transform. In at least one implementation, the transform may convert the residual information from a pixel value domain to a transform domain, such as a frequency domain. In at least one implementation, the degree of quantization may be modified by adjusting a quantization parameter. In at least one implementation, the transform/quantization unit <NUM> may perform a scan of the matrix including the quantized transform coefficients. Alternatively, the entropy encoding unit <NUM> may perform the scan.

In at least one implementation, the entropy encoding unit <NUM> may receive a plurality of syntax elements including quantization parameter, transform data, motion vectors, intra modes, partition information, and other syntax information, from the prediction process unit <NUM>, and the transform/quantization unit <NUM>, and entropy encodes the syntax elements into the bitstream. In at least one implementation, the entropy encoding unit <NUM> entropy encodes the quantized transform coefficients. In at least one implementation, the entropy encoding unit <NUM> may perform CAVLC, CABAC, SBAC, PIPE coding or another entropy coding technique to generate an encoded bitstream. In at least one implementation, the encoded bitstream may be transmitted to another device (e.g., the second electronic device <NUM>) or archived for later transmission or retrieval.

In at least one implementation, the inverse quantization/inverse transform unit <NUM> may apply inverse quantization and inverse transformation to reconstruct the residual block in the pixel domain for later use as a reference block. In at least one implementation, the second summer <NUM> adds the reconstructed residual block to the prediction block provided from the prediction process unit <NUM> to produce a reconstructed block for storage in the decoded picture buffer <NUM>.

In at least one implementation, the filtering unit <NUM> may include a deblocking filter, a SAO filter, a bilateral filter, and/or an ALF to remove blockiness artifacts from the reconstructed block. Additional filters (in loop or post loop) may also be used in addition to the deblocking filter, the SAO filter, the bilateral filter and the ALF. Such filters are not shown for brevity, but if desired, may filter the output of the second summer <NUM>.

In at least one implementation, the decoded picture buffer <NUM> may be a reference picture memory that stores the reference block for use in encoding video by the encoder module <NUM>, e.g., in intra- or inter-coding modes. The decoded picture buffer <NUM> may be formed by any of a variety of memory devices, such as DRAM, including SDRAM, MRAM, RRAM), or other types of memory devices. In at least one implementation, the decoded picture buffer <NUM> may be on-chip with other components of the encoder module <NUM>, or off-chip relative to those components.

In at least one implementation, the encoder module <NUM> may perform the mode list adjustment method for intra prediction as shown in <FIG>. The method in <FIG> may be carried out using the configurations illustrated in <FIG> and <FIG>, for example, and various elements of these figures are referenced in explaining the example method. Furthermore, the order of blocks in <FIG> is illustrative only and may change. Additional blocks may be added or less blocks may be utilized without departing from this disclosure.

At block <NUM>, the encoder module <NUM> determines a block unit in an image frame from video data, and determines a plurality of neighboring blocks neighboring with the block unit.

In at least one implementation, the video data may be a video. The first electronic device <NUM> may receive the video by the source module <NUM>. The encoder module <NUM> determines the image frame from the video, and divides the image frame to determine the block unit.

In at least one implementation, the prediction process unit <NUM> of the first electronic device <NUM> determines the block unit from the video via the partition unit <NUM>, and then the encoder module <NUM> provides a plurality of partition indications into a bitstream based on a partition result of the partition unit <NUM>. In at least one implementation, the prediction process unit <NUM> determines the neighboring blocks neighboring with the block unit. In at least one implementation, the neighboring blocks may be predicted prior to predicting the block unit, so the neighboring blocks may include a plurality of reference samples for predicting the block unit. In at least one implementation, the block unit may be predicted prior to predicting some of the neighboring blocks, so the unpredicted neighboring blocks may not include the reference samples for the block unit.

At block <NUM>, the intra prediction unit <NUM> determines a first mode list having a plurality of first candidate modes and a second mode list having a plurality of second candidate modes.

In at least one implementation, the first candidate modes and the second candidate modes are selected from a plurality of intra modes predefined in the first electronic device <NUM> and the second electronic device <NUM>. In one implementation, at least one of the first candidate modes may be identical to at least one of the second candidate modes. In another implementation, each of the first candidate modes may be different from the second candidate modes.

In at least one implementation, the intra prediction unit <NUM> may determine, which one of the first mode list and the second mode list is selected for the block unit. In one implementation, the intra prediction unit <NUM> may determine whether the neighboring blocks include the reference samples for determining how to select one of the first mode list and the second mode list. In another implementation, the intra prediction unit <NUM> may determine how to select one of the first mode list and the second mode list based on a block size of the block unit.

In at least one implementation, the prediction process unit <NUM> may select one of coding results generated according to the selected one of the first mode list and the second mode list by the intra prediction unit <NUM> based on a mode selection method, such as a cost function. In at least one implementation, the mode selection method may be a rate-distortion optimization (RDO) process. When the selected one of the first mode list and the second mode list is the first mode list, the prediction process unit <NUM> may select one of the first candidate modes, and set the selected one of the first candidate modes as the prediction mode.

At block <NUM>, the intra prediction unit <NUM> generates a plurality of reconstructed components in the block unit based on the neighboring blocks and the prediction mode.

In at least one implementation, the block unit may include a plurality of block elements. In the implementation, each of the block elements may be a pixel element. In at least one implementation, the intra prediction unit <NUM> may determine the predictors based on the selected coding result for each of the block elements. In the implementation, the encoder module <NUM> predicts the block unit to generate a plurality of residual samples based on the predictors, and provide the bitstream including a plurality of coefficients corresponding to the residual samples. In addition, the encoder module <NUM> may return the residual samples based on the coefficients, and add the returned residual samples into the predictors to generate the reconstructed components.

<FIG> illustrates a flowchart in accordance with a fifth exemplary implementation of the mode list adjustment for intra prediction. The example method is provided by way of example only, as there are a variety of ways to carry out the method. The method described below may be carried out using the configurations illustrated in <FIG> and <FIG>, for example, and various elements of these figures are referenced in explaining the example method. Each block shown in <FIG> represents one or more processes, methods, or subroutines, carried out in the example method. Furthermore, the order of blocks is illustrative only and may change. Additional blocks may be added or less blocks may be utilized without departing from this disclosure.

At block <NUM>, the encoder module <NUM> determines a block unit in an image frame from video data.

In at least one implementation, the prediction process unit <NUM> of the first electronic device <NUM> determines the block unit from the video via the partition unit <NUM>, and then the encoder module <NUM> provides a plurality of partition indications into a bitstream based on a partition result of the partition unit <NUM>.

In at least one implementation, the prediction process unit <NUM> of the second electronic device <NUM> determines the neighboring blocks neighboring with the block unit. In at least one implementation, the neighboring blocks may be predicted prior to predicting the block unit, so the neighboring blocks may include a plurality of reference samples for predicting the block unit. In at least one implementation, the block unit may be predicted prior to predicting some of the neighboring blocks, so the unpredicted neighboring blocks may not include the reference samples for the block unit.

In at least one implementation, the candidate modes in the mode list may be predefined in the second electronic device <NUM> and the first electronic device <NUM>. For example, the candidate modes may be predefined as a planar mode, a DC mode, and/or a plurality of directional modes. In at least one implementation, the intra prediction unit <NUM> may divide the candidate modes into a first mode group and a second mode group. In the implementation, the candidate modes in the first mode group may be a plurality of default modes selected from the mode list, and the candidate modes in the second mode group may be a plurality of added modes selected from the mode list for replacing at least one of the default modes. In at least one implementation, the default modes in the first mode group may include a planar mode, a DC mode, and a plurality of first directional modes, and the added modes in the second mode group may include a plurality of second directional modes. In the implementation, the second directional modes may be selected for replacing at least one of the first directional modes. In the implementation, each of the added modes in the second mode group is different from the default modes in the first mode group.

At block <NUM>, the intra prediction unit <NUM> determines whether at least one of the candidate modes in the first mode group is replaced by the candidate modes in the second mode group.

In one implementation, the intra prediction unit <NUM> may determine whether the neighboring blocks include the reference samples for determining whether to replace the at least one of the candidate modes in the first mode group by at least one of the candidate modes in the second mode group. In the implementation, the intra prediction unit <NUM> may determine that the at least one of the candidate modes in the first mode group is replaced by the candidate modes in the second mode group according to relationships between the neighboring blocks and the reference samples. In the implementation, the relationships may include locations of the neighboring blocks including the reference samples and locations of the unpredicted neighboring blocks.

In at least one implementation, the intra prediction unit <NUM> may determine based on a block size of the block unit whether to replace the at least one of the candidate modes in the first mode group by the candidate modes in the second mode group. When a block width is equal to a block height, the intra prediction unit <NUM> may determine that the at least one of the candidate modes in the first mode group is not replaced by the candidate modes in the second mode group. When the block width is different from the block height, the intra prediction unit <NUM> may determine that the at least one of the candidate modes in the first mode group is replaced by the candidate modes in the second mode group.

At block <NUM>, the intra prediction unit <NUM> determines one of the candidate modes in the first mode group as a prediction mode.

In at least one implementation, the prediction process unit <NUM> may select one of coding results generated according to the candidate modes in the first mode group by the intra prediction unit <NUM> based on a mode selection method, such as a cost function. In at least one implementation, the mode selection method may be a rate-distortion optimization (RDO) process. In the implementation, a specific one of the candidate modes in the first mode group used to generate the selected one of the coding results may be set as the prediction mode by the intra prediction unit <NUM>.

At block <NUM>, the intra prediction unit <NUM> determines the prediction mode from a plurality of remaining modes in the first mode group and the at least one of the candidate modes in the second mode group.

In at least one implementation, the prediction process unit <NUM> may select one of coding results generated according to the remaining modes in the first mode group and the at least one of the candidate modes in the second mode group by the intra prediction unit <NUM> based on a mode selection method, such as a cost function. In at least one implementation, the mode selection method may be a rate-distortion optimization (RDO) process. In the implementation, the at least one of the candidate modes in the first mode group is replaced by the at least one of the candidate modes in the second mode group, and the other of the candidate modes in the first mode group may be regarded as the remaining modes. In the implementation, the selected one of the coding results is generated based on the prediction mode selected from the remaining modes in the first mode group and the at least one of the candidate modes in the second mode group.

At block <NUM>, the encoder module <NUM> generates a plurality of predictors in the block unit based on the prediction mode.

In at least one implementation, the block unit may include a plurality of block elements. In the implementation, each of the block elements may be a pixel element. In at least one implementation, the intra prediction unit <NUM> may determine, along an orientation of the prediction mode for the block unit, one of the predictors based on the neighboring blocks for each of the block elements. In the implementation, the encoder module <NUM> predicts the block unit to generate a plurality of residual samples based on the predictors, and provide the bitstream including a plurality of coefficients corresponding to the residual samples.

In at least one implementation, the encoder module <NUM> may perform the mode list adjustment for intra prediction as shown in <FIG>. The methods in <FIG> may be carried out using the configurations illustrated in <FIG> and <FIG>, for example, and various elements of these figures are referenced in explaining the example method. In addition, the procedure and the result for the method in <FIG> carried out using the configurations illustrated in <FIG> and <FIG> are substantially identical to those for the method in <FIG> carried out using the configurations illustrated in <FIG> and <FIG>. The procedure and the result for the method in <FIG> carried out using the configurations illustrated in <FIG> and <FIG> are substantially identical to those for the method in <FIG> carried out using the configurations illustrated in <FIG> and <FIG>. Furthermore, the orders of blocks in <FIG> for the encoder module <NUM> are illustrative only and may change. Additional blocks may be added or less blocks may be utilized without departing from this disclosure.

<FIG> illustrates a flowchart in accordance with a third exemplary implementation of the multi-reference line prediction for chroma prediction. The example method is provided by way of example only, as there are a variety of ways to carry out the method. The method described below may be carried out using the configurations illustrated in <FIG> and <FIG>, for example, and various elements of these figures are referenced in explaining the example method. Each block shown in <FIG> represents one or more processes, methods, or subroutines, carried out in the example method. Furthermore, the order of blocks is illustrative only and may change. Additional blocks may be added or less blocks may be utilized without departing from this disclosure.

At block <NUM>, the encoder module <NUM> determines a block unit from the video data, and a prediction mode of the block unit.

In at least one implementation, the prediction process unit <NUM> may select one of coding results generated according to a plurality of candidate modes by the intra prediction unit <NUM> based on a mode selection method, such as a cost function. In at least one implementation, the mode selection method may be a rate-distortion optimization (RDO) process. In the implementation, the prediction process unit <NUM> sets one of the candidate modes used to generate the selected coding result as the prediction mode. In at least one implementation, the candidate modes may include a plurality of direct modes (DMs), a plurality of most probable modes (MPMs) and a plurality of linear modes (LMs). In the implementation, the LMs may include a linear model mode, a multiple-model linear mode (MMLM), and a multiple-filter linear mode (MFLM). In one implementation, the intra prediction unit <NUM> may predict the block unit <NUM> based on a plurality of reconstructed samples in one of the reference lines <NUM>-<NUM> in <FIG>, when the prediction mode is selected from the LMs. In the implementation, the one of the reference lines may be predefined as a first one of the reference lines. In another implementation, the intra prediction unit <NUM> may predict the block unit based on the reconstructed samples in at least one of the reference lines, when the prediction mode is selected from the DMs and MPMs.

At block <NUM>, the prediction process unit <NUM> determines whether the prediction mode is included in a first mode group. When the prediction mode is included in the first mode group, the procedure proceeds to block <NUM>. When the prediction mode is not included in the first mode group, the procedure proceeds to block <NUM>.

In at least one implementation, the first electronic device <NUM> and the second electronic device <NUM> may separate the candidate modes into a plurality of mode groups. In the implementation, the first mode group may include a plurality of first candidate modes, and a second mode group may include a plurality of second candidate modes. In one implementation, the prediction process unit <NUM> may predict the block unit based on the reconstructed samples in one or more than one of the reference lines, when the prediction process unit <NUM> determines to predict the block unit based on a specific one of the first candidate modes. Thus, the entropy encoding unit <NUM> needs to further encode into a bitstream a line indication indicating how to select the at least one of the reference lines for the decoder module <NUM>. In one implementation, the encoder module <NUM> may predict the block unit based on the reconstructed samples in the predefined one of the reference lines, when the encoder module <NUM> determines to predict the block unit based on a specific one of the second candidate modes. Thus, the entropy encoding unit <NUM> may not encode the line indication, since the predefined one of the reference lines is predefined in the second electronic device <NUM>. In one implementation, the first candidate modes may be the DMs, and the MPMs, and the second candidate modes may be the LMs.

At block <NUM>, the entropy encoding unit <NUM> encodes into the bitstream the line indication indicating the at least one of the reference lines.

In at least one implementation, the line indication may be a line index. In one implementation, the line index may indicate the quantity of the at least one of the reference lines. For example, the number of the at least one reference lines may equal to one, when the line index is equal to zero. In one implementation, the line index may be set to be equal to zero, when the at least one of the reference lines only include the first reference line. In one implementation, the line index may be set to be equal to one, when the at least one reference lines only includes the second reference line. In another implementation, the line index may be set to be equal to one, when the at least one reference lines is a combination of the first reference line and the second reference line.

At block <NUM>, the encoder module <NUM> determines not to add the line indication into the bitstream for the block unit.

In at least one implementation, the entropy encoding unit <NUM> may not encode the line indication, since the predefined one of the reference lines is predefined in the second electronic device <NUM>.

<FIG> illustrates a flowchart in accordance with a fourth exemplary implementation of the multi-reference line prediction for chroma prediction. The example method is provided by way of example only, as there are a variety of ways to carry out the method. The method described below may be carried out using the configurations illustrated in <FIG> and <FIG>, for example, and various elements of these figures are referenced in explaining the example method. Each block shown in <FIG> represents one or more processes, methods, or subroutines, carried out in the example method. Furthermore, the order of blocks is illustrative only and may change. Additional blocks may be added or less blocks may be utilized without departing from this disclosure.

At block <NUM>, the encoder module <NUM> determines a block unit from the video data, and determines at least one of reference lines for predicting the block unit based on a prediction mode.

In at least one implementation, the intra prediction unit <NUM> may determine a plurality of reconstructed samples in the reference lines <NUM>-<NUM> in <FIG>. In one implementation, the number L of the reference lines may be an integer greater than one.

In at least one implementation, the prediction process unit <NUM> may select one of coding results generated according to a plurality of candidate modes by the intra prediction unit <NUM> based on a mode selection method, such as a cost function. In at least one implementation, the mode selection method may be a rate-distortion optimization (RDO) process. In the implementation, the prediction process unit <NUM> sets one of the candidate modes used to generate the selected coding result based on the at least one of the reference lines as the prediction mode.

At block <NUM>, the prediction process unit <NUM> determines whether the least one of the reference lines is a first one of the reference lines. When the least one of the reference lines is the first reference line, the procedure proceeds to block <NUM>. When the least one of the reference lines includes the other reference lines different from the first reference line, the procedure proceeds to block <NUM>.

In at least one implementation, the prediction mode is selected from a plurality of candidate modes. In at least one implementation, the candidate modes may include a plurality of direct modes (DMs), a plurality of most probable modes (MPMs) and a plurality of linear modes (LMs). In the implementation, the LMs may include a linear model mode, a multiple-model linear mode (MMLM), and a multiple-filter linear mode (MFLM).

In at least one implementation, the prediction mode may be selected from the first candidate modes and the second candidate modes, when the prediction process unit <NUM> determines to predict the block unit based on the reconstructed samples in the predefined one of the reference lines according to the prediction mode. Thus, the entropy encoding unit <NUM> needs to further encode into a bitstream a mode indication indicating one of the first mode group and the second mode group. In one implementation, the prediction mode is only selected from the first candidate modes, when the prediction process unit <NUM> determines the at least one of the reference lines includes one of the reference lines different from the predefined one of the reference lines. Thus, the entropy encoding unit <NUM> may not encode the mode indication, since the second electronic device <NUM> may directly select the first mode group based on the at least one of the reference lines.

At block <NUM>, the entropy encoding unit <NUM> encodes into the bitstream the mode indication indicating one of the first mode group and the second mode group for selecting the prediction mode.

In at least one implementation, the mode indication may be a group index. When the group index indicates that the prediction mode is selected from the first mode group, the entropy encoding unit <NUM> may further encode into the bitstream a first mode flag for the second electronic device <NUM> to select the prediction mode from the first candidate modes. When the group index indicates that the prediction mode is selected from the second mode group, the entropy encoding unit <NUM> may further encode into the bitstream a second mode flag for the second electronic device <NUM> to select the prediction mode from the second candidate modes.

At block <NUM>, the encoder module <NUM> determines not to add the mode indication into the bitstream for the block unit.

In at least one implementation, the entropy encoding unit <NUM> may not encode the mode indication, since the second electronic device <NUM> may directly select the first mode group based on the at least one of the reference lines. Then, the entropy encoding unit <NUM> may further encodes into the bitstream the first mode flag for the second electronic device <NUM> to select the prediction mode from the first candidate modes.

Claim 1:
A method of decoding a bitstream in intra prediction by an electronic device (<NUM>), the method comprising:
determining a block unit from an image frame according to the bitstream;
determining, for the block unit, an orientation index from the bitstream,
determining a specific one of a plurality of intra default modes based on the orientation index, wherein:
a mode list predefined in the electronic device includes the plurality of intra default modes and a plurality of added modes, and
each of the plurality of added modes is mutually different from each of the plurality of intra default modes;
determining whether the specific one of the plurality of intra default modes is replaced by one of the plurality of added modes, wherein:
each of at least one of the plurality of intra default modes corresponds to one of the plurality of added modes,
the number of the at least one of the plurality of intra default modes is equal to the number of at least one of the plurality of added modes, and
the specific one of the plurality of defaults modes is included in at least one of the plurality of intra default modes;
determining the one of the plurality of added modes as a prediction mode, if the specific one of the plurality of intra default modes is to be replaced by the one of the plurality of added modes;
determining the specific one of the plurality of intra default modes as the prediction mode, if the specific one of the plurality of intra default modes remains unchanged; and
reconstructing the block unit of the image frame based on the prediction mode.