Method for decoding bit stream and electronic device

By selecting reference lines based on the block size and the number of reference lines, and selecting the prediction mode from the most likely mode list without parsing the mode flag, the problem of low intra prediction efficiency in the existing technology is solved and video coding is achieved efficiency improvement.

CN112369026BActive Publication Date: 2024-08-23SHARP KK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201980043309.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-06-29
Filing Date
2019-06-27
Publication Date
2024-08-23
Estimated Expiration
2039-06-27

AI Technical Summary

Technical Problem

Existing video coding methods use multiple pixel lines during intra-frame prediction, making it difficult for the encoder to quickly select an appropriate prediction result, and multiple mode lists need to be parsed, resulting in low efficiency.

Method used

Select the prediction mode directly based on the mode index by determining the block size and number of reference lines of the block unit based on the image frame, selecting one or more reference lines, and selecting the prediction mode from the most likely mode list without parsing the mode flag. , which simplifies the encoding and decoding process.

Benefits of technology

It improves the efficiency and speed of video encoding, reduces the need for parsing mode lists, and simplifies the encoder's prediction mode selection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112369026B_ABST
    Figure CN112369026B_ABST
Patent Text Reader

Abstract

The present invention provides a method for decoding a bit stream and an electronic device. A block unit having a block size is determined from an image frame according to the bit stream. The number of one or more reference lines adjacent to the block unit is determined based on the block size. One of the one or more reference lines is selected based on the number of the one or more reference lines. When a selected one of the one or more reference lines is different from a first reference line of the one or more reference lines, a prediction mode is selected from a most likely mode MPM list based on a mode index without parsing a mode tag. A plurality of mode candidates are classified into the MPM list and a non-MPM list. The mode tag indicates which of the MPM list and the non-MPM list includes the prediction mode. The block unit is reconstructed based on a selected one of the one or more reference lines.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of and priority to provisional U.S. patent application 62 / 692,175, entitled “Multi Reference Line Selection Method and Most Probable Modes Selection Method,” filed on June 29, 2018, with agent docket number US74319 (hereinafter referred to as “US74319 application”). The disclosure of US74319 application is hereby incorporated by reference into this application in its entirety. Technical Field

[0003] The present disclosure relates generally to video encoding, and more particularly, to techniques for selecting prediction modes and reference lines. Background Art

[0004] Intra prediction is a coding tool used in video coding. In conventional video coding methods, the encoder and decoder use only previously reconstructed pixels in the nearest pixel line adjacent to the coding block to generate reference pixels and predictors for predicting or reconstructing the coding block along the direction.

[0005] However, the nearest pixel line may include texture and / or signal noise of an object that is different from other objects in the coding block. Therefore, the encoder can use the nearest pixel line and other neighboring pixel lines near the nearest pixel line to generate reference pixels and predictors. When the encoder uses more than one pixel line to generate reference pixels and predictors, the encoder needs to signal a marker indicating the selected reference line into the bitstream. Therefore, it is necessary for the decoder to parse the marker from the bitstream and determine which pixel lines to select for the coding block based on the marker.

[0006] In addition, when the encoder selects different reference lines to predict a coding block based on multiple intra modes included in the predefined mode list, the number of prediction results may be too large to cause the encoder to be unable to quickly select an appropriate prediction result. Therefore, the encoder may need different mode lists for different reference lines. Summary of the invention

[0007] The present disclosure relates to apparatus and methods for encoding video data based on one or more reference lines.

[0008] In one example, a method for decoding a bitstream by an electronic device, the method comprising: determining a block size of a block unit from an image frame according to the bitstream; determining the number of one or more reference lines based on the block size; selecting one of the one or more reference lines based on the number of the one or more reference lines; when the selected one of the one or more reference lines is different from the first reference line of the one or more reference lines, selecting a prediction mode from a most probable mode MPM list based on a mode index without parsing a mode tag, wherein a plurality of mode candidates are classified into the MPM list and a non-MPM list, and the mode tag indicates which of the MPM list and the non-MPM list includes the prediction mode; and reconstructing the block unit based on the selected one of the one or more reference lines.

[0009] In one example, an electronic device for decoding a bitstream comprises: at least one processor; and a storage device, the storage device being coupled to the at least one processor and storing a plurality of instructions, the plurality of instructions, when executed by the at least one processor, causing the at least one processor to: determine a block size of a block unit from an image frame according to the bitstream; determine a number of one or more reference lines based on the block size; select one of the one or more reference lines based on the number of the one or more reference lines; when the selected one of the one or more reference lines is different from a first reference line of the one or more reference lines, select a prediction mode from a most probable mode (MPM) list based on a mode index without parsing a mode tag, wherein a plurality of mode candidates are classified into the MPM list and a non-MPM list, and the mode tag indicates which of the MPM list and the non-MPM list includes the prediction mode; and reconstruct the block unit based on the selected one of the one or more reference lines.

[0010] In one example, a method for decoding a bit stream by an electronic device is characterized in that: the method includes: determining a block width and a block height of a block unit from an image frame according to the bit stream; determining the number of one or more reference lines based on the block width and the block height; when the number of the one or more reference lines is equal to one, setting the one or more reference lines as prediction lines; when the number of the one or more reference lines is greater than one, selecting the prediction line from the one or more reference lines based on a line index; when the prediction line is different from the first reference line among the one or more reference lines, directly selecting a prediction mode of the block unit from a most likely mode MPM list based on a mode index without parsing a mode tag; and reconstructing the block unit based on the prediction line and the prediction mode. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] When with Figure 1 Various aspects of the exemplary disclosure are best understood from the following detailed description when read in conjunction with the following detailed description. Various features are not drawn to scale, and the dimensions of the various features may be arbitrarily increased or reduced for clarity of discussion.

[0012] Figure 1 is a block diagram illustrating an example implementation of a system configured to encode and decode video data in accordance with one or more techniques of this disclosure.

[0013] Figure 2 yes Figure 1 A block diagram of an exemplary implementation of a decoder module of a target device in a system.

[0014] Figure 3 A flow chart of a selection method for selecting a reference line and a prediction mode according to an exemplary implementation is shown.

[0015] Figure 4 is a schematic diagram of an exemplary implementation of a block unit and a plurality of reference lines adjacent to the block unit.

[0016] Figure 5 A flow chart of a selection method for selecting a reference line and a prediction mode according to an exemplary implementation is shown.

[0017] Figure 6 A flow chart of a prediction method based on line indexes and mode tags according to an exemplary implementation is shown.

[0018] Figure 7 A flow chart of a line quantity determination method according to an exemplary implementation is shown.

[0019] Figure 8 yes Figure 1 A block diagram of an exemplary implementation of an encoder module of a source device in a system.

[0020] Fig. 9 A flow chart of a selection method for selecting a reference line and a prediction mode according to an exemplary implementation is shown. DETAILED DESCRIPTION

[0021] The following description contains specific information related to exemplary implementations in the present disclosure. The drawings in the present disclosure and the specific embodiments attached thereto relate only to exemplary implementations. However, the present disclosure is not limited to these exemplary implementations. Other variations and implementations of the present disclosure will occur to those skilled in the art. Unless otherwise specified, the same or corresponding reference numerals in the drawings may indicate the same or corresponding elements. In addition, the drawings and illustrations in the present disclosure are generally not drawn to scale and are not intended to correspond to actual relative sizes.

[0022] For the purpose of consistency and ease of understanding, the same features are identified by numbers in the exemplary drawings (although not shown in some examples). However, features in different implementations may differ in other aspects and should not be narrowly limited to the features shown in the drawings.

[0023] As used herein, the phrases "in one implementation" or "in some implementations" may each refer to one or more implementations in 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 used means "including but not necessarily limited to"; it specifically indicates open inclusion or membership in combinations, groups, series, and equivalents described thereby.

[0024] In addition, for the purpose of explanation and non-limitation, specific details such as functional entities, technologies, protocols, standards, etc. are set forth to provide an understanding of the technology. In other examples, detailed descriptions of well-known methods, technologies, systems, architectures, etc. are omitted to avoid obscuring the specification with unnecessary details.

[0025] Those skilled in the art will immediately recognize that any coding function or algorithm described in the present disclosure may be implemented by hardware, software, or a combination of software and hardware. The function may correspond to a module that may be software, hardware, firmware, or any combination thereof. A software implementation may include computer executable instructions stored on a computer-readable medium such as a memory or other type of storage device. For example, one or more microprocessors or general-purpose computers with communication processing capabilities may be programmed using corresponding executable instructions, and the microprocessor or general-purpose computer performs the network function or algorithm. A microprocessor or general-purpose computer may be formed by an application specific integrated circuit (ASIC), a programmable logic array, and / or using one or more digital signal processors (DSP). Although some exemplary implementations described in this specification are oriented to software installed and executed on computer hardware, another exemplary implementation implemented as firmware or hardware or a combination of hardware and software is also fully within the scope of the present disclosure.

[0026] Computer readable media include, but are 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 disk read-only memory (CD ROM), magnetic cassettes, magnetic tapes, disk storage, or any other equivalent medium capable of storing computer readable instructions.

[0027] Figure 1 1 is a block diagram illustrating an exemplary implementation of a system that may be configured to encode and decode video data according to one or more techniques of the present disclosure. In an implementation, the system includes a source device 11, a target device 12, and a communication medium 13. In at least one implementation, the source device 11 may include any device configured to encode video data and send the encoded video data to the communication medium 13. In at least one implementation, the target device 12 may include any device configured to receive the encoded video data via the communication medium 13 and decode the encoded video data.

[0028] In at least one specific implementation, the source device 11 may perform wired and / or wireless communication with the target device 12 via the communication medium 13. The source device 11 may include a source module 111, an encoder module 112, and a first interface 113. The target device 12 may include a display module 121, a decoder module 122, and a second interface 123. In at least one specific implementation, the source device 11 may be a video encoder, and the target device 12 may be a video decoder.

[0029] In at least one specific implementation, the source device 11 and / or the target device 12 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, or other electronic devices. Figure 1 Only one example of the source device 11 and the target device 12 is shown, and in other implementations, the source device 11 and the target device 12 may include more or fewer components than shown, or various components with different configurations.

[0030] In at least one specific implementation, the source module 111 of the source device 11 may include a video capture device for capturing new video, a video archiving device for storing previously captured video, and / or a video feed interface for receiving video from a video content provider. In at least one specific implementation, the source module 111 of the source device 11 may generate computer graphics-based data as the source video, or a combination of real-time video, archived video, and computer-generated video. In at least one specific implementation, the video capture device may be a charge-coupled device (CCD) image sensor, a complementary metal-oxide-semiconductor (CMOS) image sensor, or a camera.

[0031] In at least one specific implementation, the encoder module 112 and the decoder module 122 may each be implemented as any of a variety of suitable encoder / decoder circuits, such as: one or more microprocessors, central processing units (CPUs), graphics processing units (GPUs), systems on chips (SoCs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic components, software, hardware, firmware, or any combination thereof. When the technology is partially implemented in software, the device may store the instructions of the software in a suitable non-transitory computer-readable medium and use one or more processors in hardware to perform the technology of the present disclosure. In at least one specific implementation, each of the encoder module 112 and the decoder module 122 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 corresponding device.

[0032] In at least one specific implementation, the first interface 113 and the second interface 123 may adopt a customized protocol or follow an existing standard or a de facto standard, including but not limited to Ethernet, IEEE 802.11 or IEEE 802.15 series, wireless USB or telecommunication standards (including but not limited to GSM (Global System for Mobile Communications), CDMA2000 (Code Division Multiple Access), TD-SCDMA (Time Division-Synchronization Code Division Multiple Access), WiMAX (World Interoperability for Microwave Access), 3GPP-LTE (Long Term Evolution) or TD-LTE (Time Division Long Term Evolution). In at least one specific implementation, the first interface 113 and the second interface 123 may each include any device configured to transmit and / or store a compliant video bitstream to the communication medium 13 and receive a compatible video bitstream from the communication medium 13. In at least one specific implementation, the first interface 113 and the second interface 123 may include a computer system interface that enables a compatible video bitstream to be stored on a storage device or received from a storage device. For example, the first interface 113 and the second interface 123 may include a chipset that supports a Peripheral Component Interconnect (PCI) and a high-speed Peripheral Component Interconnect (PCIe) bus protocol, a dedicated bus protocol, a Universal Serial Bus (USB) protocol, I2C, or any other logical and physical structure that can be used to interconnect peer devices.

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

[0034] Figure 2 Yes means Figure 1 1 is a block diagram of a decoder module 222 of an exemplary implementation of a decoder module 122 of a target device 12 in a system of FIG. 1 . In at least one implementation, the decoder module 222 includes an entropy decoder (e.g., entropy decoding unit 2221), a prediction processor (e.g., prediction processing unit 2222), an inverse quantization / inverse transform processor (e.g., inverse quantization / inverse transform unit 2223), an adder (e.g., first adder 2224), a filter (e.g., filtering unit 2225), and a decoded picture buffer (e.g., decoded picture buffer 2226). In at least one implementation, the prediction processing unit 2222 of the decoder module 222 also includes an intra-frame prediction processor (e.g., intra-frame prediction unit 22221) and an inter-frame prediction processor (e.g., inter-frame prediction unit 22222). In at least one implementation, the decoder module 222 receives a bitstream and decodes the bitstream to output a decoded video.

[0035] In at least one specific implementation, the entropy decoding unit 2221 can be Figure 1 The second interface 123 in receives a bitstream including a plurality of syntax elements, and performs a parsing operation on the bitstream to extract the syntax elements from the bitstream. As part of performing the parsing operation, the entropy decoding unit 2221 may entropy decode the bitstream to generate quantized transform coefficients, quantization parameters, transform data, motion vectors, intra-frame modes, segmentation information, and other syntax information. In at least one specific implementation, the entropy decoding unit 2221 may perform context adaptive variable length coding (Context Adaptive Variable Length Coding, CAVLC), context adaptive binary arithmetic coding (Context Adaptive Binary Arithmetic Coding, CABAC), Syntax-based Context-Adaptive Binary Arithmetic Coding (Syntax-based Context-Adaptive Binary Arithmetic Coding, SBAC), Probability Interval Partitioning Entropy (Probability Interval Partitioning Entropy, PIPE) coding or another entropy coding technique to generate quantized transform coefficients. In at least one specific implementation, the entropy decoding unit 2221 provides quantized transform coefficients, quantization parameters and transform data to the inverse quantization / inverse transform unit 2223, and provides motion vectors, intra-frame modes, partition information and other syntax information to the prediction processing unit 2222.

[0036] In at least one specific implementation, the prediction processing unit 2222 may receive syntax elements such as motion vectors, intra-frame modes, segmentation information, and other syntax information from the entropy decoding unit 2221. In at least one specific implementation, the prediction processing unit 2222 may receive syntax elements including segmentation information and then divide the image frame according to the segmentation information. In at least one specific implementation, each image frame may be divided into at least one image block according to the segmentation information. The at least one image block may include a luma block for reconstructing a plurality of luma samples and at least one chroma block for reconstructing a plurality of chroma samples. The luma block and the one chroma block may be further divided to generate a macroblock, a coding tree unit (CTU), a coding block (CB), its sub-divisions, and / or another equivalent coding unit.

[0037] In at least one specific implementation, during a decoding process, the prediction processing unit 2222 receives prediction data including an intra mode or a motion vector for a current image block of a specific one of the image frames. The current image block may be one of the luma blocks and at least one of the chroma blocks in the specific image frame.

[0038] In at least one specific implementation, the intra prediction unit 22221 may perform intra prediction encoding of the current block unit relative to one or more neighboring blocks in the same frame as the current block unit based on syntax elements related to the intra mode to generate a prediction block. In at least one specific implementation, the intra mode may specify the position of the reference sample selected from the neighboring blocks in the current frame.

[0039] In at least one specific implementation, when the prediction processing unit 2222 reconstructs the luma component of the current block, the intra prediction unit 22221 may reconstruct multiple chroma components of the current block unit based on multiple luma components of the current block unit.

[0040] In at least one specific implementation, the inter-frame prediction unit 22222 may perform inter-frame prediction encoding of the current block unit relative to one or more blocks in one or more reference image blocks based on syntax elements related to the motion vector to generate a prediction block. In at least one specific implementation, the motion vector may indicate the displacement of the current block unit within the current image block relative to the reference block unit within the reference image block. The reference block unit is a block determined to be closely matched to the current block unit. In at least one specific implementation, the inter-frame prediction unit 22222 receives the reference image block stored in the decoded picture buffer 2226, and reconstructs the current block unit based on the received reference image block.

[0041] In at least one specific implementation, the inverse quantization / inverse transform unit 2223 may apply inverse quantization and inverse transform to reconstruct the residual block in the pixel domain. In at least one specific implementation, the inverse quantization / inverse transform unit 2223 may apply inverse quantization to the residual quantized transform coefficients to generate residual transform coefficients, and then apply inverse transform to the residual transform coefficients to generate the residual block in the pixel domain. In at least one specific implementation, the inverse transform may be applied to a transform 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, subband transform, or a conceptually similar transform. In at least one implementation, the inverse transform may convert the residual information from a transform domain (such as a frequency domain) back to a pixel domain. In at least one implementation, the degree of inverse quantization may be modified by adjusting a quantization parameter.

[0042] In at least one specific implementation, the first adder 2224 adds the reconstructed residual block to the prediction block provided by the prediction processing unit 2222 to generate a reconstructed block.

[0043] In at least one specific implementation, the filtering unit 2225 may include a deblocking filter, a sample adaptive offset (Sample Adaptive Offset, SAO) filter, a bilateral filter and / or an adaptive loop filter (AdaptiveLoop Filter, ALF) to remove block artifacts from the reconstructed block. In addition to the deblocking filter, SAO filter, bilateral filter and ALF, additional filters (loop filters or loop post filters) may also be used. For simplicity, such filters are not shown, but if necessary, the output of the first adder 2224 may be filtered. In at least one specific implementation, after the filtering unit 2225 performs a filtering procedure on the reconstructed block of a particular image frame, the filtering unit 2225 may output the decoded video to the display module 121 or other video receiving unit.

[0044] In at least one implementation, the decoded picture buffer 2226 may be a reference picture memory that stores reference blocks used, for example, in an inter-coding mode for decoding a bitstream by the prediction processing unit 2222. The decoded picture buffer 2226 may be formed by any of a variety of memory devices, such as a dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. In at least one implementation, the decoded picture buffer 2226 may be co-located on-chip with other components of the decoder module 222, or off-chip relative to those components.

[0045] Figure 3 A flow chart of a method for selecting a reference line and a prediction mode according to an exemplary embodiment is shown. Because there are many ways to perform the exemplary method, the method is provided only by way of example. For example: Figure 1 and Figure 2 The illustrated configuration is used to perform the methods described below, and the exemplary methods are explained with reference to the various elements of these figures. Figure 3 Each frame shown represents one or more programs, methods or subroutines performed in the exemplary method. In addition, the order of the frames is only exemplary and can be changed. Additional frames can be added or fewer frames can be used without departing from the present disclosure.

[0046] At box 31, the decoder module 222 determines a block unit from an image frame according to the video data, and determines a plurality of prediction indicators for the block unit.

[0047] In at least one specific implementation, the video data may be a bitstream. In at least one specific implementation, the target device 12 may receive the bitstream from an encoder, such as the source device 11, via the second interface 123 of the target device 12. The second interface 123 provides the bitstream to the decoder module 222. The decoder module 222 determines the image frame based on the bitstream, and divides the image frame according to multiple segmentation indications in the bitstream to determine the block unit. For example, the decoder module 222 may divide the image frame according to the segmentation indication based on any video coding standard to generate multiple coding tree units, and further divide one of the coding tree units to determine the block unit.

[0048] In at least one specific implementation, the entropy decoding unit 2221 can decode the bitstream to determine multiple prediction indicators for the block unit, and then the decoder module 222 can further reconstruct the block unit based on the prediction indicator. In at least one specific implementation, the prediction indicator can include multiple flags and multiple indexes.

[0049] At box 32, the intra prediction unit 22221 determines a plurality of mode candidates and classifies the plurality of mode candidates into a plurality of candidate groups in block units.

[0050] In at least one specific implementation, the mode candidate may be a plurality of intra-prediction modes including a plurality of angle modes and a plurality of non-angle modes. In this specific implementation, the candidate group includes a first candidate group and a second candidate group. The intra-prediction unit 22221 may add at least one mode candidate of the mode candidates to the first candidate group, and add the remaining mode candidates to the second candidate group.

[0051] In at least one specific implementation, the intra prediction unit 22221 may determine the most probable list based on multiple prediction results of neighboring blocks adjacent to the block unit 400. When predicting neighboring blocks through the intra prediction method, the neighboring blocks may be predicted based on mode candidates. Therefore, the intra prediction unit 22221 may select the mode candidates of the neighboring blocks as multiple most probable modes (MPM) in the most probable list. In at least one specific implementation, the most probable list including the MPM may be the first candidate group, and the remaining mode candidates may be added to the second candidate group.

[0052] At box 33, the intra prediction unit 22221 selects at least one reference line of the multiple reference lines of the block unit and one mode candidate of the multiple mode candidates in one candidate group of the multiple candidate groups based on the prediction indication.

[0053] In at least one specific implementation, the prediction processing unit 2222 of the target device 12 determines a block unit according to the video data via the entropy decoding unit 2221 , and determines a reference line adjacent to the block unit and having a plurality of line samples. Figure 4 4 is a schematic diagram of an exemplary implementation of a block unit 400 and a reference line having line samples, such as line samples 4111, 4121, 4131, and 4141 located in a first reference line 411, a second reference line 412, a third reference line 413, and a fourth reference line 414, respectively. In at least one implementation, the block unit 400 includes a plurality of block components, such as a first block component 401. In at least one implementation, the intra prediction unit 22221 may generate a prediction component for each of the block components based on some of the line samples selected according to the orientation 420, and the first adder 2224 may generate a plurality of reconstructed components based on the prediction component and a plurality of residual components. In this implementation, the first adder 2224 may receive the residual component of the block unit 400 via the entropy decoding unit 2221 and the inverse quantization / inverse transformation unit 2223.

[0054] In at least one specific implementation, the intra-frame prediction unit 22221 may select one of the reference lines and reconstruct the block unit based on the selected reference line. In at least one specific implementation, when the selected reference line is the first reference line of the reference lines, the intra-frame prediction unit 22221 may reconstruct the block unit using one of the mode candidates selected from one of the first candidate group and the second candidate group. In this specific implementation, the first reference line is the first reference line 411 adjacent to the block unit 400. In at least one specific implementation, when the selected reference line is different from the first reference line of the reference lines, the intra-frame prediction unit 22221 may reconstruct the block unit using one of the mode candidates selected from the first candidate group. In at least one specific implementation, the intra-frame prediction unit 22221 may select more than one of the reference lines and reconstruct the block unit based on the selected reference line using one of the mode candidates selected from the first candidate group.

[0055] In at least one specific implementation, the prediction indication may include at least one of an MPM tag, a line index, an MPM index, and a non-MPM index. In this specific implementation, the MPM tag may indicate whether the selected mode candidate of the block unit is included in the first candidate group. When the selected mode candidate of the block unit is one of the MPMs in the first candidate group, the intra-frame prediction unit 22221 may further determine which of the mode candidates is the selected mode candidate of the block unit based on the MPM index. When the selected mode candidate of the block unit is one of the non-MPMs in the second candidate group, the intra-frame prediction unit 22221 may further determine which of the mode candidates is the selected mode candidate of the block unit based on the non-MPM index. In addition, the intra-frame prediction unit 22221 may select at least one of the reference lines based on the line index.

[0056] In at least one specific implementation, the intra-prediction unit 22221 may first determine whether the selected mode candidate of the block unit is one of the MPMs in the MPM based on the MPM flag, and then determine which mode candidate of the mode candidates is the selected mode candidate based on one of the MPM index and the non-MPM index. In at least one specific implementation, when the selected mode candidate is included in the MPM list, the intra-prediction unit 22221 may determine that the selected mode candidate belongs to the first candidate group. Therefore, the intra-prediction unit 22221 may select at least one of the reference lines of the block unit based on the line index. In at least one specific implementation, when the selected mode candidate is not included in the MPM list, the intra-prediction unit 22221 may determine that the selected mode candidate belongs to the second candidate group. Therefore, the intra-prediction unit 22221 may directly determine the first reference line as the selected reference line of the block unit. In this specific implementation, when the selected mode candidate belongs to the second candidate group, there is no line index of the block unit in the bitstream.

[0057] In at least one specific implementation, the intra-prediction unit 22221 may first select at least one of the reference lines of the block unit based on the line index. Then, the intra-prediction unit 22221 determines which of the mode candidates is the selected mode candidate based on at least one of the MPM tag, the MPM index, and the non-MPM index. In at least one specific implementation, when the intra-prediction unit 22221 selects the first reference line as the selected reference line of the block unit based on the line index, the intra-prediction unit 22221 determines which of the mode candidates is the selected mode candidate based on the MPM tag and one of the MPM index and the non-MPM index. In at least one specific implementation, when the selected reference line is different from the first reference line 411, the intra-prediction unit 22221 may determine that the selected mode candidate is one of the MPMs. In at least one specific implementation, when the number of selected reference lines is greater than one, the selected reference lines include one of the reference lines different from the first reference line 411. Therefore, when the number of selected reference lines is greater than one, the intra prediction unit 22221 may determine that the selected mode candidate is one of the MPMs. In this specific implementation, when the selected at least one of the reference lines includes one of the reference lines different from the first reference line 411, there is no MPM tag of the block unit in the bitstream.

[0058] At box 34, the intra prediction unit 22221 reconstructs the block unit based on the selected at least one reference line among the reference lines according to the selected mode candidate.

[0059] In at least one specific implementation, the intra prediction unit 22221 may select at least one line sample of the line samples of the selected at least one reference line in the reference line for each block component in the block component based on the prediction mode. Then, the intra prediction unit 22221 may generate multiple prediction components for the block component. In at least one specific implementation, the first adder 2224 of the decoder module 222 in the target device 12 may add the prediction component to the multiple residual components determined from the bitstream to reconstruct the block unit. In addition, the decoder module 222 may reconstruct all other block units in the image frame to reconstruct the image frame and the video.

[0060] Figure 5 A flow chart of a method for selecting a reference line and a prediction mode according to an exemplary embodiment is shown. Because there are many ways to perform the exemplary method, the method is provided only by way of example. For example: Figure 1 and Figure 2 The illustrated configurations are used to perform the methods described below, and the exemplary methods are explained with reference to the various elements of these figures. Figure 5 Each frame shown represents one or more programs, methods or subroutines performed in the exemplary method. In addition, the order of the frames is only exemplary and can be changed. Additional frames can be added or fewer frames can be used without departing from the present disclosure.

[0061] At block 51 , the decoder module 222 determines a block unit from an image frame according to video data, and determines a plurality of prediction indicators for the block unit.

[0062] In at least one specific implementation, the video data may be a bitstream. In at least one specific implementation, the target device 12 may receive the bitstream from an encoder, such as the source device 11, via the second interface 123 of the target device 12. The second interface 123 provides the bitstream to the decoder module 222. The decoder module 222 determines the image frame based on the bitstream, and divides the image frame according to multiple segmentation indications in the bitstream to determine the block unit. For example, the decoder module 222 may divide the image frame according to the segmentation indication based on any video coding standard to generate multiple coding tree units, and further divide one of the coding tree units to determine the block unit.

[0063] In at least one specific implementation, the entropy decoding unit 2221 can decode the bitstream to determine multiple prediction indicators for the block unit, and then the decoder module 222 can further reconstruct the block unit based on the prediction indicator. In at least one specific implementation, the prediction indicator can include multiple flags and multiple indexes.

[0064] At box 52, the intra prediction unit 22221 selects one or more reference lines from among the plurality of reference lines based on a first index from among the plurality of prediction indications.

[0065] In at least one specific implementation, the first index can be a line index used by the intra-frame prediction unit 22221 to select one or more reference lines. Figure 4 is a schematic diagram of an exemplary implementation of a block unit 400 and a reference line, the reference line having line samples, such as: line samples 4111, 4121, 4131, and 4141 located in a first reference line 411, a second reference line 412, a third reference line 413, and a fourth reference line 414, respectively. In at least one implementation, the intra-prediction unit 22221 may set a first reference line among the reference lines as a selected reference line based on a line index. In this implementation, the first reference line may be a first reference line 411 adjacent to the block unit 400. In at least one implementation, the intra-prediction unit 22221 may set a specific one of the reference lines different from the first reference line as the selected reference line. In addition, the intra-prediction unit 22221 may select more than one reference line among the reference lines as the selected reference line.

[0066] At block 53, the intra prediction unit 22221 determines whether the selected one or more reference lines include one of the plurality of reference lines that is different from a predefined reference line in the plurality of reference lines. In at least one specific implementation, when the selected one or more reference lines are the same as the predefined reference line, the procedure proceeds to block 54. In at least one specific implementation, when the selected one or more reference lines include one of the reference lines that is different from the predefined reference line, the procedure proceeds to block 55.

[0067] In at least one specific implementation, the intra-prediction unit 22221 may add multiple most probable modes (MPMs) to the first candidate group and add multiple non-MPMs to the second candidate group. In at least one specific implementation, the MPM is selected from multiple mode candidates including multiple angle modes and multiple non-angle modes. In at least one specific implementation, the intra-prediction unit 22221 may determine the most probable list based on multiple prediction results for neighboring blocks adjacent to the block unit 400. When predicting neighboring blocks through an intra-prediction method, the neighboring blocks may be predicted based on the mode candidates. Therefore, the intra-prediction unit 22221 may select some of the mode candidates as MPMs in the most probable list based on the prediction results for the neighboring blocks.

[0068] In at least one specific implementation, the most likely list including the MPM can be a first candidate group, and the remaining mode candidates different from the MPM can be added to a second candidate group.

[0069] In at least one implementation, the MPM may include a plurality of angle MPMs and a plurality of non-angle MPMs. In at least one implementation, the angle MPM may be added to the first candidate group, and the remaining mode candidates different from the MPM may be added to the second candidate group.

[0070] In at least one specific implementation, the encoder module 112 of the source device 11 may select more than one reference line from the reference lines to predict the block unit according to one of the mode candidates in the first candidate group. In at least one specific implementation, the encoder module 112 of the source device 11 may determine a selected reference line different from a predefined reference line to predict the block unit according to one of the mode candidates in the first candidate group. In at least one specific implementation, the encoder module 112 may select a predefined reference line to predict the block unit according to one of the mode candidates in the second candidate group. In this specific implementation, the predefined reference line may be Figure 4 The first reference line 411 in .

[0071] In at least one specific implementation, when the selected one or more reference lines include a reference line different from the predefined reference line, the intra prediction unit 22221 may determine to predict the block unit according to one of the mode candidates in the first candidate group. Therefore, the intra prediction unit 22221 may directly determine which mode candidate is used to predict the block unit based on the MPM index.

[0072] In at least one specific implementation, when the selected one or more reference lines are predefined reference lines, the intra prediction unit 22221 may determine to predict the block unit according to one of the mode candidates selected from one of the first candidate group and the second candidate group. Therefore, the intra prediction unit 22221 may determine which mode candidate among the mode candidates is used to predict the block unit based on at least one of the MPM flag, the MPM index, and the non-MPM index.

[0073] At block 54, the intra prediction unit 22221 determines whether the prediction flag in the prediction indication indicates the second candidate group. In at least one implementation, when one of the candidate groups indicated by the prediction flag is different from the second candidate group, the procedure proceeds to block 55. In at least one implementation, when the prediction flag indicates the second candidate group, the procedure proceeds to block 56.

[0074] In at least one specific implementation, when the selected one or more reference lines are predefined reference lines, the intra-frame prediction unit 22221 may determine to predict the block unit according to one of the mode candidates selected from one of the first candidate group and the second candidate group. Therefore, the intra-frame prediction unit 22221 may first determine whether to predict the block unit according to one of the MPMs or one of the non-MPMs in the non-MPMs based on the MPM tag. In at least one specific implementation, the second candidate group includes all non-MPMs. Therefore, when the prediction tag in the prediction indication indicates the second candidate group, the intra-frame prediction unit 22221 may determine to predict the block unit by one of the non-MPMs in the non-MPMs. In at least one specific implementation, when one of the candidate groups indicated by the prediction tag is different from the second candidate group, the intra-frame prediction unit 22221 may determine to predict the block unit by one of the MPMs in the MPMs.

[0075] At box 55, the intra-frame prediction unit 22221 selects one mode candidate from the multiple mode candidates based on the second index in the prediction indication.

[0076] In at least one implementation, the second index indicates which of the MPMs is used to predict the block unit. In this implementation, the second index may be an MPM index.

[0077] In at least one specific implementation, when the selected one or more reference lines include a reference line different from the predefined reference line in the reference lines, the intra prediction unit 22221 may determine to predict the block unit according to one of the mode candidates in the first candidate group. Therefore, the block unit is predicted according to one of the MPMs by the encoder module 112. In at least one specific implementation, the intra prediction unit 22221 may directly select one of the MPMs based on the MPM index.

[0078] In at least one specific implementation, when the selected one or more reference lines are predefined reference lines and one of the candidate groups indicated by the prediction flag is different from the second candidate group, the intra prediction unit 22221 may determine to predict the block unit according to one of the MPMs. In this specific implementation, the intra prediction unit 22221 may directly select one of the MPMs based on the MPM index.

[0079] At box 56, the intra prediction unit 22221 selects one mode candidate from the multiple mode candidates based on the third index in the prediction indication.

[0080] In at least one implementation, the third index indicates which of the non-MPMs is used to predict the block unit. In this implementation, the third index may be a non-MPM index.

[0081] In at least one specific implementation, when the selected one or more reference lines are predefined reference lines and the prediction flag indicates the second candidate group, the intra prediction unit 22221 may determine to predict the block unit according to one of the non-MPMs. In at least one specific implementation, the intra prediction unit 22221 may directly select one of the non-MPMs based on the non-MPM index.

[0082] At block unit 57, the intra prediction unit 22221 reconstructs the block unit based on the selected reference line or lines and the selected mode candidate.

[0083] In at least one specific implementation, the intra prediction unit 22221 may select at least one line sample of the line samples in the selected one or more reference lines for each block component in the block component based on the selected mode candidate. Then, the intra prediction unit 22221 may generate multiple prediction components for the block component. In at least one specific implementation, the first adder 2224 of the decoder module 222 in the target device 12 may add the prediction component to the multiple residual components determined from the bitstream to reconstruct the block unit. In addition, the decoder module 222 may reconstruct all other block units in the image frame to reconstruct the image frame and the video.

[0084] Figure 6 A flow chart of a prediction method based on line index and mode labeling according to an exemplary embodiment is shown. Because there are many ways to perform the exemplary method, the method is provided only by way of example. For example: Figure 1 and Figure 2 The illustrated configuration is used to perform the methods described below, and the exemplary methods are explained with reference to the various elements of these figures. Figure 6 Each frame shown represents one or more programs, methods or subroutines performed in the exemplary method. In addition, the order of the frames is only exemplary and can be changed. Additional frames can be added or fewer frames can be used without departing from the present disclosure.

[0085] At box 61, the decoder module 222 determines a block unit from an image frame according to the video data.

[0086] In at least one specific implementation, the video data may be a bitstream. The target device 12 may receive the bitstream from an encoder, such as the source device 11, via the second interface 123 of the target device 12. The second interface 123 provides the bitstream to the decoder module 222. The decoder module 222 determines the image frame based on the bitstream, and divides the image frame according to a plurality of segmentation indications in the bitstream to determine the block unit. For example, the decoder module 222 may divide the image frame according to the segmentation indication based on any video coding standard to generate a plurality of coding tree units, and further divide one of the coding tree units to determine the block unit.

[0087] In at least one specific implementation, the entropy decoding unit 2221 can decode the bitstream to determine multiple prediction indicators for the block unit, and then the decoder module 222 can further reconstruct the block unit based on the prediction indicator. In at least one specific implementation, the prediction indicator can include multiple flags and multiple indexes.

[0088] At block 62 , the decoder module 222 determines a line index from the video data.

[0089] In at least one specific implementation, there are a plurality of adjacent blocks adjacent to the block unit in the image frame. In at least one specific implementation, each of the adjacent blocks includes a plurality of adjacent samples. In at least one specific implementation, the adjacent samples adjacent to the block unit in the adjacent blocks may be classified into a plurality of reference lines. In this specific implementation, each of the reference lines includes a plurality of line samples selected from the adjacent samples adjacent to the block unit. Figure 4 is a schematic diagram of an exemplary implementation of a block unit 400 and reference lines having line samples such as line samples 4111, 4121, 4131, and 4141 located in a first reference line 411, a second reference line 412, a third reference line 413, and a fourth reference line 414, respectively.

[0090] In at least one specific implementation, the encoder module 112 may select one of the reference lines for predicting the block unit, and provide a line index indicating which reference line is the selected reference line to the target device 12. In this specific implementation, the decoder module 222 may determine the selected reference line based on the line index, and the decoder module 222 may determine that the line samples in the selected reference line are multiple reference samples. Therefore, the decoder module 222 may reconstruct the block unit based on the reference samples. In at least one specific implementation, the decoder module 222 may set the first reference line in the reference lines as the selected reference line based on the line index. In this specific implementation, the first reference line may be the first reference line 411 adjacent to the block unit 400. In at least one specific implementation, the decoder module 222 may set a specific one of the reference lines that is different from the first reference line as the selected reference line. In at least one specific implementation, the decoder module 222 may select more than one of the reference lines as the selected reference line.

[0091] In at least one implementation, when the line index is equal to the first predefined value, the decoder module 222 may select the first reference line 411 and determine the line samples in the first reference line 411 as reference samples. In at least one implementation, when the line index is different from the first predefined value, the decoder module 222 may select one of the other reference lines 412-414. In at least one implementation, the line index may be a syntax element intra_luma_ref_idx in Versatile Video Coding (VVC) or VVC Test Model (VTM). In at least one implementation, the first predefined value may be equal to zero.

[0092] At block 63, the decoder module 222 determines whether a mode flag is included in the video data based on the line index. In at least one implementation, when the decoder module 222 determines that the mode flag is included in the video data, the process proceeds to block 64. In at least one implementation, when the decoder module 222 determines that the mode flag is not present in the video data, the process proceeds to block 65.

[0093] In at least one specific implementation, the decoder module 222 may determine a prediction mode from a plurality of mode candidates to predict a block unit. In at least one specific implementation, the mode candidates may include a plurality of non-angle modes and a plurality of angle modes. In a specific implementation, the non-angle mode may include a plane mode and a DC mode. In one specific implementation, when the decoder module 222 decodes the block unit in VVC or VTM, the number of angle modes may be equal to 65. In another specific implementation, when the decoder module 222 decodes the block unit in High Efficiency Video Coding (HEVC), the number of angle modes may be equal to 32. In at least one specific implementation, the decoder module 222 may determine a plurality of most probable modes (MPMs) from the mode candidates based on neighboring blocks adjacent to the block unit. In at least one specific implementation, when the decoder module 222 reconstructs a particular one of the neighboring blocks according to a particular mode candidate, a particular one of the mode candidates may be set as one of the most probable modes of the block unit. In addition, the decoder module 222 may derive another most probable mode in the most probable mode based on the particular mode candidate. In this implementation, when the decoder module 222 selects the most probable mode from the mode candidates, the unselected mode candidates may be considered as a plurality of remaining mode candidates.

[0094] In at least one specific implementation, when the encoder module 112 selects the first reference line of the reference lines, the encoder module 112 may select a prediction mode from the most likely mode and the remaining mode candidates to predict the block unit. In this specific implementation, when the first reference line of the reference lines is selected, the intra prediction unit 22221 needs the mode flag received from the encoder module 112 to determine whether to select a prediction mode from the MPM to predict the block unit. Since the line index of the block unit equal to the first predefined value indicates that the first reference line of the reference lines is selected to predict the block unit, the decoder module 222 may determine that the mode flag is included in the video data based on the line index of the block unit.

[0095] In at least one specific implementation, when the encoder module 112 selects a specific one of the reference lines that is different from the first reference line, the encoder module 112 may select the intra-frame prediction mode only from the most probable mode to predict the block unit. In this specific implementation, when the selected reference line is different from the first reference line of the reference lines, the intra-frame prediction unit 22221 does not have to receive a mode flag indicating whether the prediction mode is selected from the MPM. Since the line index of the block unit that is different from the first predefined value indicates that the selected reference line is different from the first reference line of the reference lines, the decoder module 222 may determine that there is no mode flag in the video data based on the line index of the block unit.

[0096] At block 64, the decoder module 222 determines whether the flag value of the mode flag is equal to a predefined value. In at least one implementation, when the flag value is equal to the predefined value, the process proceeds to block 65. In at least one implementation, when the flag value is different from the predefined value, the process proceeds to block 66.

[0097] In at least one implementation, when the encoder module 112 selects a prediction mode from the MPM to predict a block unit, the encoder module 112 may set the mode flag to be equal to a second predefined value. In at least one implementation, when the encoder module 112 selects an intra-frame prediction mode from the remaining mode candidates to predict a block unit, the encoder module 112 may set the mode flag to be different from the second predefined value. In at least one implementation, the mode flag may be a syntax element prev_intra_luma_pred_flag in HEVC. In at least one implementation, the MPM index may be a syntax element intra_luma_mpm_flag in VCC or VTM. In at least one implementation, the second predefined value may be equal to one.

[0098] In at least one specific implementation, when the decoder module 222 determines to select the first reference line to reconstruct the block unit before parsing the mode flag, the prediction mode can be selected from the most likely mode and the remaining mode candidates. Therefore, the decoder module 222 can determine whether the mode flag is equal to a second predefined value for determining the prediction mode. In one specific implementation, when the decoder module 222 determines that the mode flag is different from the second predefined value, the decoder module 222 can determine to select the prediction mode from the remaining mode candidates. In another specific implementation, when the decoder module 222 determines that the mode flag is equal to the second predefined value, the decoder module 222 can determine to select the intra-frame prediction mode from the MPM.

[0099] At block 65 , the decoder module 222 determines a first mode index for determining a prediction mode from the video data.

[0100] In at least one specific implementation, when the line index is different from the first predefined value or the mode flag is equal to the second predefined value, the decoder module 222 may determine the prediction mode for selecting the block unit from the MPM. In this specific implementation, the intra-frame prediction unit 22221 may determine that the prediction mode can be selected from the MPM based on the first mode index. In at least one specific implementation, the first mode index may be an mpm index for selecting the prediction mode from the MPM. In at least one specific implementation, the mpm index may be a syntax element mpm_idx in HEVC. In at least one specific implementation, the mpm index may be a syntax element intra_luma_mpm_idx in VCC or VTM.

[0101] At block 66 , the decoder module 222 determines from the video data a second mode index different from the first mode index for determining a prediction mode.

[0102] In at least one specific implementation, when the mode flag is different from the second predefined value, the decoder module 222 may determine that the prediction mode of the block unit is selected from the remaining mode candidates. In this specific implementation, the decoder module 222 may determine that the prediction mode can be selected from the remaining mode candidates based on the second mode index. In at least one specific implementation, the second mode index may be a non-mpm index for selecting the prediction mode from the remaining mode candidates. In at least one specific implementation, the non-mpm index may be a syntax element rem_intra_luma_pred_mode in HEVC. In at least one specific implementation, the non-mpm index may be a syntax element intra_luma_mpm_remainder in VCC or VTM.

[0103] At block 67 , the decoder module 222 reconstructs the block unit based on the line index and one of the first mode index and the second mode index.

[0104] In at least one specific implementation, the intra prediction unit 22221 may determine the selected reference line based on the line index, and the intra prediction unit 22221 may determine the line samples in the selected reference line as reference samples. Therefore, the decoder module 222 may reconstruct the block unit based on the reference samples.

[0105] In at least one specific implementation, when the encoder module 112 predicts a block unit, the non-angle mode may be predefined to be added to the MPM. Therefore, the encoder module 112 may add the planar mode and the DC mode to the MPM. In at least one specific implementation, the intra-frame prediction unit 22221 also adds the non-angle mode to the MPM to generate the most likely list. In other words, the most likely list may include more than one angle mode in the non-angle mode and the angle mode selected based on the prediction results of the neighboring blocks.

[0106] In at least one specific implementation, when the encoder module 112 determines that the selected reference line for predicting the block unit is different from the first reference line, the encoder module 112 may adjust the most probable list. In one specific implementation, when the encoder module 112 determines that the selected reference line is different from the first reference line, the non-angle mode in the most probable list may be excluded to generate a sub-list. In this specific implementation, when the intra-frame prediction unit 22221 determines that the selected reference line for reconstructing the block unit determined based on the line index is different from the first reference line, the intra-frame prediction unit 22221 may exclude the non-angle mode in the most probable list to generate the sub-list. In other words, when the intra-frame prediction unit 22221 determines that the selected reference line for reconstructing the block unit is different from the first reference line, the prediction mode can be selected from the MPM included in the sub-list based only on the first mode index.

[0107] In at least one specific implementation, when the encoder module 112 determines that the selected reference line for predicting the block unit is different from the first reference line, the encoder module 112 may keep the most probable list unchanged. Therefore, when the encoder module 112 determines that the selected reference line is different from the first reference line, the encoder module 112 may determine that the non-angle mode in the most probable list can be used to predict the block unit. In this specific implementation, when the intra-frame prediction unit 22221 determines that the selected reference line for reconstructing the block unit determined based on the line index is different from the first reference line, the intra-frame prediction unit 22221 also keeps the most probable list unchanged. In other words, when the intra-frame prediction unit 22221 determines that the selected reference line for reconstructing the block unit is different from the first reference line, a non-angle mode may be selected to reconstruct the block unit.

[0108] In at least one specific implementation, when the selected reference line is the first reference line, the prediction mode may be selected from one of the MPM and the remaining mode candidates. In at least one specific implementation, when the selected reference line is different from the first reference line, the prediction mode may be selected from one of the MPMs. Therefore, when the prediction mode is selected from the remaining mode candidates based on the second mode index, the selected reference line is the first reference line. In at least one specific implementation, since the non-angle mode is predefined to be added to the MPM, the non-angle mode is excluded from the remaining mode candidates. Therefore, when the intra-frame prediction unit 22221 determines the prediction mode of the block unit based on the second mode index, the selected mode candidate is different from the non-angle mode. In this specific implementation, when the intra-frame prediction unit 22221 determines the prediction mode of the block unit based on the second mode index, the prediction mode is an angle mode among the angle modes.

[0109] In at least one specific implementation, the block unit may include multiple block components. In this specific implementation, each block component in the block component may be a pixel element. The intra-frame prediction unit 22221 may select at least one line sample in the line samples of the selected reference line for each block component in the block component based on the prediction mode. Then, the intra-frame prediction unit 22221 may generate multiple prediction components for the block component.

[0110] In at least one specific implementation, the first adder 2224 of the decoder module 222 in the target device 12 can add the prediction component to the plurality of residual components determined from the bitstream to reconstruct the block unit. In addition, the decoder module 222 can reconstruct all other block units in the image frame to reconstruct the image frame and the video.

[0111] Figure 7 A flow chart of a method for determining the number of lines according to an exemplary embodiment is shown. Because there are many ways to perform the exemplary method, the method is provided only by way of example. For example: Figure 1 and Figure 2 The illustrated configurations are used to perform the methods described below, and the exemplary methods are explained with reference to the various elements of these figures. Figure 7 Each frame shown represents one or more programs, methods or subroutines performed in the exemplary method. In addition, the order of the frames is only exemplary and can be changed. Additional frames can be added or fewer frames can be used without departing from the present disclosure.

[0112] At box 71, the decoder module 222 determines a block unit having a block size from an image frame according to video data.

[0113] In at least one specific implementation, the video data may be a bitstream. The target device 12 may receive the bitstream from an encoder, such as the source device 11, via the second interface 123 of the target device 12. The second interface 123 provides the bitstream to the decoder module 222. The decoder module 222 determines the image frame based on the bitstream, and divides the image frame according to multiple segmentation indications in the bitstream to determine the block unit. For example, the decoder module 222 may divide the image frame according to the segmentation indication based on any video coding standard to generate multiple coding tree units, and further divide one of the coding tree units to determine a block unit having a block size. In at least one specific implementation, the block size may include a block height and a block width.

[0114] In at least one specific implementation, the entropy decoding unit 2221 can decode the bitstream to determine multiple prediction indicators for the block unit, and then the decoder module 222 can further reconstruct the block unit based on the prediction indicator. In at least one specific implementation, the prediction indicator can include multiple flags and multiple indexes.

[0115] At box 72, the intra prediction unit 22221 determines the number of one or more reference lines based on the block size.

[0116] In at least one specific implementation, the prediction processing unit 2222 of the target device 12 determines the block unit according to the video data via the entropy decoding unit 2221, and determines the one or more reference lines of the block unit. In at least one specific implementation, each of the one or more reference lines has a plurality of line samples. Figure 4 , when the number of the one or more reference lines is equal to four, the decoder module 222 may determine the block unit 400 and the one or more reference lines each having a line sample, such as: line samples 4111-4141 in the first reference line 411, the second reference line 412, the third reference line 413, and the fourth reference line 414. In at least one specific implementation, the block unit 400 includes a plurality of block components, such as: the first block component 401. The intra prediction unit 22221 may generate a prediction component of each of the block components based on the one or more reference lines according to a prediction mode.

[0117] In at least one specific implementation, the intra-prediction unit 22221 may first determine the number of one or more reference lines, and then determine the prediction mode based on the number of one or more reference lines. For example: when the number of one or more reference lines is greater than one, the intra-prediction unit 22221 may determine that the prediction mode can be selected from multiple most probable modes (MPMs). In addition, when the number of one or more reference lines is equal to one, the intra-prediction unit 22221 may determine that the prediction mode can be selected from multiple mode candidates. In at least one specific implementation, the mode candidate may be a plurality of intra-prediction modes. In at least one specific implementation, when selecting an adjacent mode from the mode candidates, an MPM may be selected from the mode candidates based on a plurality of adjacent modes of a plurality of adjacent blocks adjacent to the block unit to enter the MPM list. In at least one specific implementation, other unselected mode candidates may be set to a plurality of non-MPMs in a non-MPM list.

[0118] In at least one specific implementation, the intra-prediction unit 22221 may determine the size comparison result based on the block size. In at least one specific implementation, the intra-prediction unit 22221 may determine the size comparison result based on the block size and the size threshold. In at least one specific implementation, when the size comparison result satisfies a predefined condition, the intra-prediction unit 22221 may determine that the number of the one or more reference lines is equal to a predefined number greater than one. In at least one specific implementation, when the size comparison result does not satisfy the predefined condition, the intra-prediction unit 22221 may determine that the number of the one or more reference lines is equal to one. In at least one specific implementation, the predefined condition may include at least one comparison condition of a plurality of comparison conditions. In at least one specific implementation, when the predefined condition includes two comparison conditions of the comparison condition, the intra-prediction unit 22221 may determine whether the size comparison result satisfies the two comparison conditions of the comparison condition.

[0119] In at least one specific implementation, when the size product W×H of the block width W and the block height H is less than the first size threshold in the first comparison condition, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to the first predefined number. In at least one specific implementation, when the size product W×H is greater than the second size threshold in the second comparison condition, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to the second predefined number. In at least one specific implementation, the first size threshold is different from the second size threshold. In one specific implementation, the first size threshold is greater than the second size threshold. In at least one specific implementation, when the size quotient W / H or H / W of the block width W and the block height H is less than the third size threshold in the third comparison condition, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to the third predefined number. In one specific implementation, when the block height H is longer than the block width W, the intra-frame prediction unit 22221 may compare the size quotient W / H with the third size threshold. In another specific implementation, when the block height H is longer than the block width W, the intra-frame prediction unit 22221 may compare the size quotient H / W with the third size threshold. In at least one specific implementation, when the block width W is equal to the block height H, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to the fourth predefined number in the fourth comparison condition. In other words, when the size quotient W / H is equal to the fourth size threshold in the fourth comparison condition, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to the fourth predefined number, and the fourth size threshold is equal to one and different from the third size threshold. In at least one specific implementation, each of the first predefined number, the second predefined number, the third predefined number, and the fourth predefined number may be a pre-assigned positive integer. For example: each of the first predefined number, the third predefined number, and the fourth predefined number may be equal to four, and the second predefined number may be equal to two. In at least one specific implementation, each of the first size threshold, the second size threshold, and the third size threshold may be a pre-assigned positive integer. For example, the first size threshold may be equal to 4096, the second size threshold may be equal to 128, and the third size threshold may be equal to 2. In at least one specific implementation, the intra prediction unit 22221 may determine the number of the one or more reference lines based on at least one of the first predefined number, the second predefined number, the third predefined number, the fourth predefined number, and any other predefined number, using at least one of the first size threshold, the second size threshold, the third size threshold, a comparison result between the block width W and the block height H, and any other size comparison conditions.

[0120] In at least one specific implementation, when the intra prediction unit 22221 determines the number of the one or more reference lines based on the predefined conditions (including more than one of the comparison conditions corresponding to the selected number), more than one of the predefined numbers may be selected to simultaneously determine the number of the one or more reference lines. In this specific implementation, the predefined conditions may include more than one of the first comparison condition, the second comparison condition, the third comparison condition, the fourth comparison condition, and any other size comparison condition.

[0121] In at least one specific implementation, the selected numbers may be equal to each other. In at least one specific implementation, when the size comparison result satisfies each comparison condition in the comparison conditions in the predefined conditions, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to the selected number. In addition, when the size comparison result does not satisfy one of the comparison conditions in the predefined conditions, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to one. For example: when the first predefined number is equal to the third predefined number, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to the first predefined number based on the comparison result, that is, the size product W×H is less than the first size threshold and the size quotient W / H is less than the third size threshold. In at least one specific implementation, when the size comparison result satisfies one of the comparison conditions in the predefined conditions, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to the selected number. In addition, when the size comparison result does not satisfy each of the comparison conditions in the predefined conditions, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to one. For example: when the first predefined number is equal to the third predefined number, the intra-frame prediction unit 22221 can determine that the number of one or more reference lines is equal to the first predefined number based on the comparison result, that is, the size product W×H is greater than the first size threshold and the size quotient W / H is less than the third size threshold.

[0122] In at least one specific implementation, the selected numbers may be different from each other. In at least one specific implementation, the intra-frame prediction unit 22221 may determine which comparison condition of the comparison conditions in the predefined conditions the size comparison result satisfies. In at least one specific implementation, when the size comparison result satisfies only one comparison condition of the comparison conditions in the predefined conditions corresponding to the determined number, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to one selected number of the selected numbers. In at least one specific implementation, when the size comparison result satisfies more than one comparison condition of the comparison conditions corresponding to the determined number, the intra-frame prediction unit 22221 may determine the number of the one or more reference lines based on more than one selected number of the selected numbers. In at least one specific implementation, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to the minimum value of the determined numbers. In at least one specific implementation, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to the maximum value of the determined numbers. In addition, when the size comparison result does not satisfy each of the comparison conditions in the predefined conditions, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to one. For example, when the second predefined number is less than the third predefined number, the intra-frame prediction unit 22221 may determine that the number of the one or more reference lines is equal to the second predefined number based on the comparison result, that is, the size product W×H is greater than the second size threshold and the size quotient W / H is less than the third size threshold.

[0123] At box 73, the intra prediction unit 22221 selects one of the one or more reference lines based on the number of the one or more reference lines.

[0124] In at least one specific implementation, when the number of the one or more reference lines is greater than one, the intra-frame prediction unit 22221 may decode a line index in the bitstream to select one of the one or more reference lines as a prediction line. In at least one specific implementation, when the number of the one or more reference lines is equal to one, the intra-frame prediction unit 22221 may directly determine the one or more reference lines as prediction lines. In this specific implementation, the line index of the block unit may not exist in the bitstream. In at least one specific implementation, when the number of the one or more reference lines is equal to one, the one or more reference lines may be predefined as the first reference line 411.

[0125] In at least one specific implementation, when the intra prediction unit 22221 determines that the size product W×H is less than the first size threshold, the intra prediction unit 22221 may decode the line index in the bitstream to select one of the one or more reference lines. In at least one specific implementation, when the size product W×H is greater than or equal to the first size threshold, the line index of the block unit may not exist in the bitstream.

[0126] In at least one specific implementation, when the intra prediction unit 22221 determines that the size product W×H is greater than the second size threshold, the intra prediction unit 22221 may decode the line index in the bitstream to select one of the one or more reference lines. In at least one specific implementation, when the size product W×H is less than or equal to the second size threshold, the line index of the block unit may not exist in the bitstream.

[0127] In at least one specific implementation, when the intra prediction unit 22221 determines that the size quotient W / H or H / W is less than the third size threshold, the intra prediction unit 22221 may decode the line index in the bitstream to select one of the one or more reference lines. In at least one specific implementation, when the size quotient W / H or H / W is greater than or equal to the third size threshold, the line index of the block unit may not exist in the bitstream.

[0128] In at least one specific implementation, when the intra prediction unit 22221 determines that the block height H is equal to the block width W, the intra prediction unit 22221 may decode the line index in the bitstream to select one of the one or more reference lines. In at least one specific implementation, when the block height H is different from the block width W, the line index of the block unit may not exist in the bitstream.

[0129] In at least one specific implementation, when the intra prediction unit 22221 determines that the size comparison result satisfies at least one of the comparison conditions in the predefined conditions, the intra prediction unit 22221 may decode the line index in the bitstream to select one of the one or more reference lines. In at least one specific implementation, when the size comparison result does not satisfy each of the comparison conditions in the predefined conditions, the line index of the block unit may not exist in the bitstream.

[0130] In at least one specific implementation, when the intra prediction unit 22221 determines that the size comparison result satisfies each comparison condition in the predefined conditions, the intra prediction unit 22221 may decode the line index in the bitstream to select one of the one or more reference lines. In at least one specific implementation, when the size comparison result does not satisfy one of the comparison conditions in the predefined conditions, the line index of the block unit may not exist in the bitstream.

[0131] At box 74, the intra prediction unit 22221 predicts a block unit of the image frame based on the selected one of the one or more reference lines.

[0132] In at least one specific implementation, a prediction mode may be selected from the mode candidates based on a mode flag and a mode index. In at least one specific implementation, the mode flag indicates whether the prediction mode is selected from the MPM list. In at least one specific implementation, when the prediction mode is selected from the MPM list, the mode index is an MPM index indicating an MPM in the MPM. In at least one specific implementation, when the prediction mode is included in the non-MPM list, the mode index is a non-MPM index indicating a non-MPM in the non-MPM. In at least one specific implementation, when the selected one of the one or more reference lines is the same as the first reference line of the one or more reference lines, the intra-frame prediction unit 22221 determines the prediction mode based on the mode flag and the mode index. In at least one specific implementation, when the selected one of the one or more reference lines includes a reference line of the one or more reference lines that is different from the first reference line of the one or more reference lines, the intra-frame prediction unit 22221 determines the prediction mode based on the MPM index without parsing the mode flag. In at least one specific implementation, the first reference line of the one or more reference lines is adjacent to the block unit.

[0133] In at least one specific implementation, the intra prediction unit 22221 may select at least one line sample of the line samples in the selected one of the one or more reference lines for each block component in the block component based on the prediction mode. Then, the intra prediction unit 22221 may generate a prediction component for the block component. In at least one specific implementation, the first adder 2224 of the decoder module 222 in the target device 12 may add the prediction component to the multiple residual components determined from the bitstream to reconstruct the block unit. In addition, the decoder module 222 may reconstruct all other block units in the image frame to reconstruct the image frame and the video.

[0134] Figure 8 Yes means Figure 1812 is a block diagram of an exemplary implementation of an encoder module 812 of a source device 11 in a system of FIG. 812. In at least one implementation, the encoder module 812 includes a prediction processor (e.g., a prediction processing unit 8121), at least one adder (e.g., a first adder 8122 and a second adder 8125), a quantization / inverse transform processor (e.g., a transform / quantization unit 8123), an inverse quantization / inverse transform processor (e.g., an inverse quantization / inverse transform unit 8124), a filter (e.g., a filtering unit 8126), a decoded picture buffer (e.g., a decoded picture buffer 8127), and an entropy encoder (e.g., an entropy encoding unit 8128). In at least one implementation, the prediction processing unit 8121 of the encoder module 812 also includes a segmentation processor (e.g., a segmentation unit 81211), an intra-frame prediction processor (e.g., an intra-frame prediction unit 81212), and an inter-frame prediction processor (e.g., an inter-frame prediction unit 81213). In at least one specific implementation, the encoder module 812 receives a source video and encodes the source video to output a bitstream.

[0135] In at least one specific implementation, the encoder module 812 may receive a source video including a plurality of image frames and then divide the image frames according to the coding structure. In at least one specific implementation, each image frame in the image frame 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 one chrominance block may be further divided to generate a macroblock, a coding tree unit (CTU), a coding block (CB), its sub-divisions and / or another equivalent coding unit. In at least one specific implementation, the encoder module 812 may perform additional sub-divisions of the source video. It should be noted that the present disclosure described herein is generally applicable to video encoding, regardless of how the source video is segmented before and / or during encoding.

[0136] In at least one specific implementation, during an encoding procedure, a prediction processing unit 8121 receives a current image block of a specific one of the image frames. The current image block may be one of the luminance blocks and at least one of the chrominance blocks in the specific image frame. The segmentation unit 81211 divides the current image block into a plurality of block units. The intra-frame prediction unit 81212 may perform intra-frame prediction encoding of the 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-frame prediction unit 81213 may perform inter-frame prediction encoding of the current block unit relative to one or more blocks in one or more reference image blocks to provide temporal prediction.

[0137] In at least one specific implementation, the prediction processing unit 8121 may select one of the encoding results generated by the intra-frame prediction unit 81212 and the inter-frame prediction unit 81213 based on a mode selection method (such as a cost function). In at least one specific implementation, the mode selection method may be a rate-distortion optimization (RDO) program. The prediction processing unit 8121 determines the selected encoding result and provides a prediction block corresponding to the selected encoding result to the first adder 8122 and the second adder 8125 for generating a residual block and reconstructing the encoded block unit, respectively. In at least one specific implementation, the prediction processing unit 8121 may also provide syntax elements such as motion vectors, intra-mode indicators, partition information, and other syntax information to the entropy coding unit 8128.

[0138] In at least one specific implementation, the intra-prediction unit 81212 may perform intra-prediction on the current block unit. In at least one specific implementation, the intra-prediction unit 81212 may determine an intra-prediction mode pointing to a reconstructed sample adjacent to the current block unit to encode the current block unit. In at least one specific implementation, the intra-prediction unit 81212 may use various intra-prediction modes to encode the current block unit, and the intra-prediction unit 81212 or the prediction processing unit 8121 may select an appropriate intra-prediction mode from a test mode. In at least one specific implementation, the intra-prediction unit 81212 may use a cross-component prediction mode to encode the current block unit to predict one of the two chroma components of the current block unit based on the luminance component of the current block unit. In addition, the intra-prediction unit 81212 may predict the first chroma component of the two chroma components of the current block unit based on the other chroma component of the two chroma components of the current block unit.

[0139] In at least one specific implementation, as an alternative to the intra prediction performed by the intra prediction unit 81212 as described above, the inter prediction unit 81213 may perform inter prediction on the current block unit. The inter prediction unit 81213 may perform motion estimation to estimate the motion of the current block unit for generating a motion vector. The motion vector may indicate the displacement of the current block unit within the current image block relative to the reference block unit within the reference image block. In at least one specific implementation, the inter prediction unit 81213 receives at least one reference image block stored in the decoded picture buffer 8127, and estimates the motion based on the received reference image block to generate a motion vector.

[0140] In at least one specific implementation, the first adder 8122 generates a residual block by subtracting the prediction block determined by the prediction processing unit 8121 from the initial current block unit. The first adder 8122 represents one or more components that perform the subtraction operation.

[0141] In at least one implementation, the transform / quantization unit 8123 applies a transform to the residual block to generate residual transform coefficients, and then quantizes the residual transform coefficients to further reduce the bit rate. In at least one implementation, the transform can be a DCT, DST, AMT, MDNSST, HyGT, a signal-dependent transform, KLT, a wavelet transform, an integer transform, a subband transform, or a conceptually similar transform. In at least one implementation, the transform can 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 can be modified by adjusting a quantization parameter. In at least one implementation, the transform / quantization unit 8123 can perform a scan on a matrix including quantized transform coefficients. In addition, the entropy coding unit 8128 can perform the scan.

[0142] In at least one implementation, the entropy coding unit 8128 may receive multiple syntax elements from the prediction processing unit 8121 and the transform / quantization unit 8123, including quantization parameters, transform data, motion vectors, intra-frame modes, segmentation information, and other syntax information, and encode these syntax elements into a bitstream. In at least one implementation, the entropy coding unit 8128 performs entropy coding on the quantized transform coefficients. In at least one implementation, the entropy coding unit 8128 may perform CAVLC, CABAC, SBAC, PIPE encoding, 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., target device 12) or archived for later transmission or retrieval.

[0143] In at least one specific implementation, the inverse quantization / inverse transform unit 8124 may apply inverse quantization and inverse transform to reconstruct the residual block in the pixel domain for later use as a reference block. In at least one specific implementation, the second adder 8125 adds the reconstructed residual block to the prediction block provided by the prediction processing unit 8121 to generate a reconstructed block for storage in the decoded picture buffer 8127.

[0144] In at least one specific implementation, the filtering unit 8126 may include a deblocking filter, a SAO filter, a bilateral filter, and / or an ALF to remove block artifacts from the reconstructed block. In addition to the deblocking filter, the SAO filter, the bilateral filter, and the ALF, additional filters (in-loop filters or post-loop filters) may also be used. For simplicity, such filters are not shown, but if necessary, the output of the second adder 8125 may be filtered.

[0145] In at least one specific implementation, the decoded picture buffer 8127 can be a reference picture memory that stores reference blocks used, for example, for encoding video by the encoder module 812 in intra-frame coding or inter-frame coding mode. The decoded picture buffer 8127 can 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 specific implementation, the decoded picture buffer 8127 can be co-located on the chip with other components of the encoder module 812, or off-chip relative to those components.

[0146] Fig. 9 A flow chart of a method for selecting a reference line and a prediction mode according to an exemplary embodiment is shown. Because there are many ways to perform the exemplary method, the method is provided only by way of example. For example: Figure 1 and Figure 8 The illustrated configurations are used to perform the methods described below, and the exemplary methods are explained with reference to the various elements of these figures. Fig. 9 Each frame shown represents one or more programs, methods or subroutines performed in the exemplary method. In addition, the order of the frames is only exemplary and can be changed. Additional frames can be added or fewer frames can be used without departing from the present disclosure.

[0147] At block 91 , the encoder module 812 determines a block unit from video data, and determines a plurality of reference lines adjacent to the block unit.

[0148] In at least one specific implementation, the video data may be a video. The source device 11 may receive the video via the source module 111. The encoder module 812 determines an image frame according to the video, and divides the image frame into block units.

[0149] In at least one specific implementation, the prediction processing unit 8121 of the source device 11 determines the block unit according to the video via the segmentation unit 81211, and then the encoder module 812 provides multiple segmentation indications to the bitstream based on the segmentation result of the segmentation unit 81211.

[0150] In at least one specific implementation, the prediction processing unit 8121 of the target device 12 determines a neighboring block adjacent to the block unit. In at least one specific implementation, the neighboring block may be predicted before predicting the block unit, so the neighboring block may include multiple neighboring samples that can be used to predict the block unit. In at least one specific implementation, the neighboring samples adjacent to the block unit may be classified as reference lines based on multiple sample positions of the neighboring samples. Figure 44 is a schematic diagram of an exemplary implementation of a block unit 400 and reference lines having line samples, such as line samples 4111, 4121, 4131, and 4141 respectively located in a first reference line 411, a second reference line 412, a third reference line 413, and a fourth reference line 414. In at least one implementation, the block unit may be predicted before predicting some of the neighboring blocks, and thus the unpredicted neighboring blocks may not include neighboring samples of the block unit.

[0151] At box 92, the prediction processing unit 8121 selects a prediction mode and at least one reference line of the plurality of reference lines for the block unit.

[0152] In at least one specific implementation, the intra-frame prediction unit 81212 may predict a block unit based on a reference line according to a plurality of mode candidates. In at least one specific implementation, the inter-frame prediction unit 81213 may predict a block unit based on at least one reference frame in the video data according to at least one motion vector. In at least one specific implementation, the prediction processing unit 8121 may select a prediction mode according to a plurality of prediction results generated by the intra-frame prediction unit 81212 and the inter-frame prediction unit 81213. In at least one specific implementation, when selecting a prediction mode from the mode candidates, the prediction processing unit 8121 may also determine at least one reference line selected from the reference lines for predicting the block unit.

[0153] At box 93, the encoder module 812 encodes a plurality of prediction indications into the bitstream, the plurality of prediction indications including a mode index and at least one of a line index and a mode flag for indicating a prediction mode and a selected at least one reference line of the plurality of reference lines.

[0154] In at least one implementation, the line index may be equal to one of the plurality of first index values. In at least one implementation, each of the first index values ​​corresponds to a reference set. In this implementation, the number of reference lines in each reference set may be equal to or greater than one. In at least one implementation, when determining the selected at least one of the reference lines by the prediction processing unit 8121, a specific one of the first index values ​​corresponding to the selected at least one of the reference lines may be selected for encoding into the bitstream.

[0155] In at least one specific implementation, the mode flag may indicate whether the prediction mode is included in a plurality of most probable modes (MPMs) selected from the mode candidates based on a plurality of adjacent modes of the adjacent blocks. In at least one specific implementation, when a specific adjacent mode is selected from the mode candidates, a specific one of the adjacent modes may be added to the MPM of the block unit. In at least one specific implementation, the mode candidates include a plurality of angle modes and a plurality of non-angle modes. In at least one specific implementation, the non-angle mode may be predefined to be added to the MPM. In at least one specific implementation, the mode candidates that are not selected to enter the MPM may be set to a plurality of remaining mode candidates. In at least one specific implementation, the encoder module 812 may determine the tag value of the mode tag based on the relationship between the prediction mode and the MPM. In at least one specific implementation, when the prediction mode is included in the MPM, the tag value may be equal to one. In at least one specific implementation, when the prediction mode is not included in the MPM, the tag value may be equal to zero.

[0156] In at least one implementation, the mode index may be one of an MPM index and a non-MPM index. In at least one implementation, when the prediction mode is included in the MPM, the mode index may be an MPM index indicating which of the MPMs is the prediction mode. In at least one implementation, when the prediction mode is not included in the MPM, the mode index may be a non-MPM index indicating which of the remaining mode candidates is the prediction mode.

[0157] In at least one specific implementation, the encoder module 812 may first encode the line index into the bitstream. In at least one specific implementation, when the selected at least one of the reference lines is a predefined one of the reference lines, the prediction mode may be selected from the MPM and the remaining mode candidates. Therefore, when the line index indicates that the selected at least one of the reference lines is a predefined reference line, the bitstream may include a mode tag. In at least one specific implementation, when the encoder module 812 may first encode the line index into the bitstream, the line index indicating that the selected at least one of the reference lines is a predefined reference line, the bitstream may include a mode tag and a mode index indicating the prediction mode and a line index indicating the predefined reference line. In at least one specific implementation, the predefined reference line may be the first reference line 411. In at least one specific implementation, when the selected at least one of the reference lines includes one of the reference lines that is different from the predefined reference lines, the prediction mode is only selected from the MPM. Therefore, when the line index indicates that the selected at least one of the reference lines includes one of the reference lines that is different from the predefined reference lines, the mode tag may not be present in the bitstream. In at least one specific implementation, when the encoder module 812 may first encode a line index into a bitstream, wherein the line index indicates that at least one selected reference line among the reference lines includes a reference line among the reference lines that is different from a predefined reference line, the bitstream may include a line index indicating at least one selected reference line among the reference lines and an MPM index indicating an MPM among the MPMs.

[0158] In at least one specific implementation, the encoder module 812 may first encode the mode tag into the bitstream. In at least one specific implementation, when the prediction mode is selected from the remaining mode candidates, the selected at least one reference line in the reference lines is a predefined reference line. Therefore, when the mode tag indicates that the prediction mode is included in the remaining mode candidates, the line index may not exist in the bitstream. In at least one specific implementation, when the encoder module 812 may first encode the mode tag indicating that the prediction mode is included in the remaining mode candidates into the bitstream, the bitstream may include a mode tag and a non-MPM index for determining one of the remaining mode candidates and a predefined reference line. In at least one specific implementation, when the prediction mode is selected from the MPM, the selected at least one reference line in the reference lines may be a predefined reference line or include a reference line in the reference lines that is different from the predefined reference line. Therefore, when the mode tag indicates that the prediction mode is included in the MPM, the bitstream includes a line index for indicating the selected at least one reference line in the reference lines. In at least one specific implementation, when the encoder module 812 may first encode into a bitstream a mode flag indicating that a prediction mode is included in an MPM, the bitstream may include a line index indicating at least one selected reference line among the reference lines and a mode flag and an MPM index indicating an MPM among the MPMs.

[0159] In at least one specific implementation, the encoder module 812 may perform the following Figure 7 The method for determining the number of lines shown. For example, you can use: Figure 1 and Figure 8 The configuration shown is used to perform Figure 7 The method in the drawings and the exemplary method are explained with reference to the various elements of these drawings. Figure 7 The order of the blocks in the embodiment is exemplary only and may be changed. Additional blocks may be added or fewer blocks may be used without departing from the present disclosure.

[0160] At box 71, the encoder module 812 determines the block size of the block unit from the image frame according to the video data.

[0161] In at least one specific implementation, the video data may be a video. The source device 11 may receive the video via the source module 111. The encoder module 812 determines an image frame according to the video, and divides the image frame into block units.

[0162] In at least one specific implementation, the prediction processing unit 8121 of the source device 11 determines a block unit having a block size according to the video via the segmentation unit 81211, and then the encoder module 812 provides multiple segmentation indications to the bitstream based on the segmentation result of the segmentation unit 81211. In at least one specific implementation, the block size may include a block height H and a block width W.

[0163] At box 72, the intra prediction unit 81212 determines the number of one or more reference lines based on the block size.

[0164] In at least one specific implementation, the prediction processing unit 2222 of the target device 12 determines a block unit according to the video data via the entropy decoding unit 2221 , and determines the one or more reference lines adjacent to the block unit.

[0165] In at least one specific implementation, the prediction processing unit 2222 determines the number of the one or more reference lines based on the size comparison result generated according to the block size and the size threshold. In at least one specific implementation, when the prediction processing unit 2222 determines that the size comparison result satisfies the predefined condition, the number of the one or more reference lines is equal to a predefined number greater than one. In at least one specific implementation, when the prediction processing unit 2222 determines that the size comparison result does not satisfy the predefined condition, the number of the one or more reference lines is equal to one. In at least one specific implementation, the predefined condition may include at least one of the following: a first condition, that the block size is less than a first threshold; a second condition, that the block size is greater than a second threshold, the second threshold being different from the first threshold; a third condition, that the block size determined based on the block width W and the block height H is less than a third threshold; a fourth condition, that the size ratio is equal to a fourth threshold, the fourth threshold being different from the third threshold; and any other size comparison condition.

[0166] At box 73, the intra prediction unit 81212 selects one of the one or more reference lines based on the number of the one or more reference lines.

[0167] In at least one specific implementation, when the number of the one or more reference lines is greater than one, the intra-frame prediction unit 81212 may select one of the one or more reference lines to predict the block unit. In at least one specific implementation, when the number of the one or more reference lines is equal to one, the intra-frame prediction unit may directly use the one or more reference lines to predict the block unit.

[0168] At box 74, the intra prediction unit 81212 predicts the block unit based on the selected one of the one or more reference lines.

[0169] In at least one implementation, the block unit may include multiple block components. In this implementation, each block component in the block components may be a pixel element. In at least one implementation, the intra-prediction unit 81212 may determine a prediction component of the multiple prediction components according to an intra-prediction mode in multiple intra-prediction modes based on a selected one of the one or more reference lines for each block component in the block components. In at least one implementation, the intra-prediction unit 81212 may select another reference line of the one or more reference lines to predict the block unit according to the intra-prediction mode.

[0170] In at least one specific implementation, the intra prediction unit 81212 may predict the block unit based on the one or more reference lines according to the intra prediction mode to generate multiple prediction results. In at least one specific implementation, the prediction processing unit 8121 may select one of the prediction results based on a mode selection method (such as a cost function). In at least one specific implementation, the mode selection method may be a rate-distortion optimization (RDO) procedure. In this specific implementation, the prediction processing unit 8121 sets one of the intra prediction modes and one of the one or more reference lines to generate the selected encoding result as the prediction mode of the block unit.

[0171] In at least one specific implementation, the encoder module 812 predicts a block unit based on the prediction component to generate a plurality of residual samples, and provides a bitstream including a plurality of coefficients corresponding to the residual samples.

[0172] From the above description, it is apparent that various techniques may be used to implement these concepts without departing from the scope of the concepts described in this patent application. In addition, although these concepts have been described with specific reference to specific implementations, those of ordinary skill in the art will recognize that these concepts may be changed in form and detail without departing from the scope of these concepts. Therefore, the described implementations will be considered in all respects as exemplary and non-restrictive. It should also be understood that the present application is not limited to the above-mentioned specific implementations, on the contrary, many reconfigurations, modifications and substitutions are possible without departing from the scope of the present disclosure.

Claims

1. A method for decoding a bit stream by an electronic device, the method comprising: determining a block size of a block unit from an image frame according to the bit stream; determining a number of one or more reference lines based on the block size; selecting one of the one or more reference lines based on the number of the one or more reference lines; When the selected one of the one or more reference lines is different from the first reference line of the one or more reference lines, a prediction mode is selected from a most probable mode MPM list based on a mode index without parsing the mode flag, wherein: A plurality of mode candidates are classified into the MPM list and the non-MPM list, and The mode flag indicates which one of the MPM list and the non-MPM list includes the prediction mode; as well as The block unit is reconstructed based on the selected one of the one or more reference lines.

2. The method according to claim 1, wherein: Also includes: determining a selected one of the one or more reference lines based on a line index when the number of the one or more reference lines is greater than one; as well as When the number of the one or more reference lines is equal to one, the one or more reference lines are set to the selected one of the one or more reference lines.

3. The method according to claim 1, wherein when a selected one of the one or more reference lines is the same as the first reference line of the one or more reference lines and is adjacent to the block unit, the prediction mode of the block unit is selected from the multiple mode candidates based on the mode flag and the mode index. 4 . The method of claim 1 , wherein the number of the one or more reference lines is determined based on a size comparison result generated according to the block size and a size threshold.

5. The method according to claim 4, wherein: Also includes: When the size comparison result satisfies a predefined condition, determining that the number of the one or more reference lines is a predefined number greater than one; as well as When the size comparison result does not satisfy the predefined condition, the number of the one or more reference lines is determined to be one.

6. The method according to claim 5, wherein the predefined conditions include at least one of the following: a first condition, namely, the block size is smaller than a first threshold; a second condition, namely, the block size is larger than a second threshold, and the second threshold is different from the first threshold; a third condition, namely, a size ratio determined based on a block width and a block height of the block size is smaller than a third threshold; and a fourth condition, namely, the size ratio is equal to a fourth threshold, and the fourth threshold is different from the third threshold.

7. An electronic device for decoding a bit stream, the electronic device comprising: at least one processor; and a storage device coupled to the at least one processor and storing a plurality of instructions that, when executed by the at least one processor, cause the at least one processor to: determining a block size of a block unit from an image frame according to the bit stream; determining a number of one or more reference lines based on the block size; selecting one of the one or more reference lines based on the number of the one or more reference lines; When the selected one of the one or more reference lines is different from the first reference line of the one or more reference lines, a prediction mode is selected from a most probable mode MPM list based on a mode index without parsing the mode flag, wherein: A plurality of mode candidates are classified into the MPM list and the non-MPM list, and The mode flag indicates which one of the MPM list and the non-MPM list includes the prediction mode; as well as The block unit is reconstructed based on the selected one of the one or more reference lines.

8. The electronic device of claim 7, wherein the plurality of instructions, when executed by the at least one processor, further cause the at least one processor to: when the number of the one or more reference lines is greater than one, determining a selected one of the one or more reference lines based on a line index; and When the number of the one or more reference lines is equal to one, the one or more reference lines are set to the selected one of the one or more reference lines.

9. An electronic device according to claim 7, wherein when a selected one of the one or more reference lines is the same as the first reference line of the one or more reference lines and is adjacent to the block unit, the prediction mode of the block unit is selected from the multiple mode candidates.

10. The electronic device of claim 7, wherein the plurality of instructions, when executed by the at least one processor, further cause the at least one processor to: When a size comparison result determined based on the block size and the size threshold satisfies a predefined condition, determining the number of the one or more reference lines to be a predefined number greater than one; and When the size comparison result does not satisfy the predefined condition, the number of the one or more reference lines is determined to be one.

11. An electronic device according to claim 10, wherein the predefined conditions include at least one of the following: a first condition, namely, the block size is smaller than a first threshold; a second condition, namely, the block size is larger than a second threshold, and the second threshold is different from the first threshold; a third condition, namely, a size ratio determined based on a block width and a block height of the block size is smaller than a third threshold; and a fourth condition, namely, the size ratio is equal to a fourth threshold, and the fourth threshold is different from the third threshold.

12. A method for decoding a bit stream by an electronic device, characterized in that: The method comprises: Determining a block width and a block height of a block unit from an image frame according to the bit stream; determining a number of one or more reference lines based on the block width and the block height; When the number of the one or more reference lines is equal to one, setting the one or more reference lines as prediction lines; selecting the prediction line from the one or more reference lines based on a line index when the number of the one or more reference lines is greater than one; When the prediction line is different from a first reference line among the one or more reference lines, directly selecting a prediction mode of the block unit from a most probable mode (MPM) list based on a mode index without parsing a mode flag; and The block unit is reconstructed based on the prediction line and the prediction mode.

13. The method of claim 12, wherein when the prediction line is the same as the first reference line among the one or more reference lines and is adjacent to the block unit, the prediction mode of the block unit is selected based on the mode index from one of the MPM list and the non-MPM list selected based on the mode flag. 14 . The method of claim 12 , wherein the number of the one or more reference lines is determined based on a size comparison result determined according to the block width and the block height and a size threshold.

15. The method according to claim 14, further comprising: When the size comparison result satisfies a predefined condition, determining that the number of the one or more reference lines is a predefined number greater than one; as well as When the comparison does not satisfy the predefined condition, the number of the one or more reference lines is determined to be one.

16. The method according to claim 15, wherein the predefined conditions include at least one of the following: a first condition, namely, a block area determined based on the block width and the block height is smaller than a first threshold; a second condition, namely, the block area is larger than a second threshold, the second threshold is different from the first threshold; a third condition, namely, a size ratio determined based on the block width and the block height is smaller than a third threshold; and a fourth condition, namely, the size ratio is equal to a fourth threshold, the fourth threshold is different from the third threshold.