Apparatus and method for encoding video data
By using template matching technology to arrange and select merging candidates, the problem of excessively long selection time in existing video coding methods is solved, thus improving the efficiency of encoding and decoding.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHARP KK
- Filing Date
- 2022-09-27
- Publication Date
- 2026-07-21
AI Technical Summary
Existing video coding methods take too long to select merging candidates, resulting in low encoding and decoding efficiency. A more efficient method for selecting merging candidates is needed.
Template matching technology is used to sort and select merging candidates. The merging candidate list is narrowed down by determining the template matching cost. Only the top K merging candidates are selected for encoding, which reduces the number of candidates and improves efficiency.
Template matching technology effectively reduces the computational load of merging candidates, thereby improving the speed and efficiency of video encoding and decoding.
Smart Images

Figure CN117795954B_ABST
Abstract
Description
[0001] Cross-references to related applications
[0002] This disclosure claims the benefit and priority of U.S. Provisional Patent Application Serial No. 63 / 249,492, entitled “GROUP-BASED INDEX SIGNALING OFARMC”, filed on September 28, 2021, the contents of which are incorporated herein by reference in their entirety. Technical Field
[0003] This disclosure generally relates to video coding, and more specifically, to techniques for arranging and selecting multiple merge candidates in a merge candidate list. Background Technology
[0004] Merging mode is a video coding tool. In traditional video coding methods, encoders and decoders can predict and reconstruct block units in image frames by using motion information from multiple previously reconstructed samples to point to reference blocks in different image frames, thereby generating prediction blocks for predicting block units.
[0005] However, the motion information from previously reconstructed samples can be selected from many merging candidates. Estimating each merging candidate in detail to determine the degree of difference between a block unit and a reference block determined from its corresponding merging candidate could waste significant time encoding the video and decoding the bitstream. Therefore, encoders and decoders may require candidate selection methods for more efficient prediction or reconstruction of block units. Summary of the Invention
[0006] This disclosure relates to an electronic device and method for selecting one of a plurality of merging candidates for a block unit in an image frame by arranging merging candidates using template matching.
[0007] In a first aspect of this disclosure, a method for encoding video data and an electronic device for performing the method are provided. The method includes receiving the video data; determining block units from image frames included in the video data; for the block unit, determining a first merge candidate list including a plurality of merge candidates; identifying a plurality of merge subgroups from the first merge candidate list, wherein the number of the plurality of merge candidates in each of the plurality of merge subgroups is equal to or less than a first value of a number N, where N is a first positive integer; determining a first generation value for each of the plurality of merge candidates; determining an arrangement of the plurality of merge candidates in each of the plurality of merge subgroups based on the first generation value; determining a second merge candidate list by selecting the top K of the plurality of merge candidates ordered based on the arrangement from each of the plurality of merge subgroups, wherein a second value of the number K is a second positive integer less than N; and selecting one of the plurality of merge candidates in the second merge candidate list to predict the block unit, and encoding one or more merge indices into a bitstream based on the selected merge candidate.
[0008] In one embodiment of the first aspect, the first generation value of each of the plurality of merge candidates is a template matching generation value, which is determined based on a plurality of first reconstruction samples in a plurality of adjacent regions adjacent to the block unit and a plurality of second reconstruction samples determined based on a corresponding one of the plurality of merge candidates.
[0009] In one embodiment of the first aspect, the plurality of merge candidates in each of the plurality of merge subgroups are sorted in ascending order according to the first cost value.
[0010] An embodiment of the first aspect further includes: determining a second-generation value for each of the plurality of merge candidates in the second merge candidate list, wherein the second-generation value of the plurality of merge candidates in the second merge candidate list is different from the first-generation value of the plurality of merge candidates in the second merge candidate list; determining one of the plurality of merge candidates based on the second-generation value; and determining the one or more merge indices for indicating the selection of one of the plurality of merge candidates.
[0011] In another embodiment of the first aspect, the second generation value of each of the plurality of merge candidates in the second merge candidate list is determined based on the block unit and a plurality of third reconstruction samples determined based on a corresponding one of the plurality of merge candidates.
[0012] In another embodiment of the first aspect, the one or more merge indexes include: a first of the one or more merge indexes indicating which of the plurality of merge subgroups includes one selected from the plurality of merge candidates; and a second of the one or more merge indexes indicating which of the plurality of merge candidates is one selected from the plurality of merge candidates in the one of the plurality of merge subgroups.
[0013] In a second aspect of this disclosure, a method for decoding a bitstream by an electronic device is provided. The method includes receiving the bitstream; determining block units and one or more merge indices of the block units from an image frame based on the bitstream; selecting one of a plurality of merge subgroups identified from a list of merge candidates for the block units based on a first of the one or more merge indices, wherein: each of the plurality of merge subgroups includes a plurality of merge candidates, and the number of the plurality of merge candidates in each of the plurality of merge subgroups is equal to or less than a first value N, where N is a positive integer; determining a cost value for each of the plurality of merge candidates in the selected plurality of merge subgroups; determining an arrangement of the plurality of merge candidates in the selected plurality of merge subgroups based on the cost value; selecting one of the top K merge candidates ordered according to the arrangement from the selected plurality of merge subgroups based on a second of the one or more merge indices, wherein a second value of the number K is a second positive integer less than N; and reconstructing the block unit based on the selected one of the top K merge candidates.
[0014] In another embodiment of the second aspect, the cost value of each of the plurality of merge candidates in one of the plurality of merge subgroups is a template matching cost value, which is determined based on a plurality of first reconstruction samples in a plurality of adjacent regions adjacent to the block unit and a plurality of second reconstruction samples determined based on a corresponding one of the plurality of merge candidates in one of the plurality of merge subgroups.
[0015] In another embodiment of the second aspect, the plurality of merger candidates in one of the plurality of merge subgroups are sorted in ascending order of the cost values.
[0016] In another embodiment of the second aspect, the index value of the second of the one or more merged indices is in the index range of 0 to K-1.
[0017] In another embodiment of the second aspect, in the arrangement of one of the plurality of merge subgroups, the plurality of merge candidates arranged after the Kth merge candidate are excluded from selection.
[0018] In another embodiment of the second aspect, the first of the one or more merged indices may be the same as or different from the second of the one or more merged indices.
[0019] Brief description of the attached figures
[0020] The various aspects of this disclosure can be best understood from the detailed disclosure below and the corresponding drawings. The features are not drawn to scale, and for clarity of discussion, the dimensions of the features may be arbitrarily increased or decreased.
[0021] Figure 1 A block diagram of a system configured to encode and decode video data according to an embodiment of the present disclosure is shown.
[0022] Figure 2 Embodiments according to this disclosure are shown. Figure 1 The block diagram shows the decoder module of the second electronic device.
[0023] Figure 3 Embodiments according to this disclosure are shown. Figure 1 The block diagram shown is of the encoder module of the first electronic device.
[0024] Figure 4 A flowchart illustrating a method for encoding video data using an electronic device according to an embodiment of the present disclosure is shown.
[0025] Figure 5 A flowchart illustrating a method for decoding video data using an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0026] The following disclosure contains specific information relating to embodiments of this application. The accompanying drawings and corresponding detailed disclosures are exemplary embodiments. However, this application is not limited to these exemplary embodiments. Other variations and embodiments of this application will be apparent to those skilled in the art.
[0027] Unless otherwise stated, the same or corresponding elements in the drawings may be indicated by the same or corresponding reference numerals. The drawings and illustrations in this application are generally not to scale and are not intended to correspond to actual relative dimensions.
[0028] For the purposes of consistency and ease of understanding, similar features are identified in the exemplary drawings by reference indicators (although not shown in some examples). However, features in different embodiments may differ in other respects and should not be narrowly limited to what is shown in the drawings.
[0029] This application uses the phrases “in one embodiment” or “in some embodiments”, which may refer to one or more of the same or different embodiments. The term “coupled” is defined as a connection, whether direct or indirect through an intermediate element, and is not necessarily limited to a physical connection. The term “comprising” means “including, but not necessarily limited to” and specifically indicates an open inclusion or membership in the described combination, group, series, and equivalents.
[0030] For purposes of explanation and non-limitation, specific details such as functional entities, technologies, protocols, and standards are described to provide an understanding of the disclosed technologies. Detailed disclosures of well-known methods, technologies, systems, and architectures are omitted to avoid obscuring this application with unnecessary detail.
[0031] Those skilled in the art will recognize that any disclosed coding function or algorithm described in this application can be implemented in hardware, software, or a combination of both. The disclosed functionality can correspond to a module as software, hardware, firmware, or any combination thereof.
[0032] Software implementations may include programs having calculator-executable instructions stored on a calculator-readable medium (e.g., memory or other type of storage device). For example, one or more microprocessors or general-purpose calculators with processing capabilities may be programmed with the executable instructions to perform the disclosed functions or algorithms.
[0033] Microprocessors or general-purpose calculators can be formed using application-specific integrated circuits (ASICs), programmable logic arrays, and / or one or more digital signal processors (DSPs). Although some of the disclosed embodiments are directed to software installed and executed on calculator hardware, alternative embodiments implemented as firmware, or hardware, or a combination of hardware and software, are also within the scope of this application. Calculator-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 disc read-only memory (CD ROM), cassette tape, magnetic tape, disk storage, or any other equivalent medium capable of storing computer-readable instructions.
[0034] Figure 1 A block diagram of a system 100 configured to encode and decode video data according to an embodiment of the present invention is shown. The system 100 includes a first electronic device 110, a second electronic device 120, and a communication medium 130.
[0035] The first electronic device 110 can be a source device, including any device configured to encode video data and transmit the encoded video data to the communication medium 130. The second electronic device 120 can be a destination device, including any device configured to receive encoded video data via the communication medium 130 and decode the encoded video data.
[0036] The first electronic device 110 can communicate with the second electronic device 120 via a communication medium 130, either wired or wirelessly. The first electronic device 110 may include components such as a source module 112, an encoder module 114, and a first interface 116. The second electronic device 120 may include components such as a display module 122, a decoder module 124, and a second interface 126. The first electronic device 110 may be a video encoder, and the second electronic device 120 may be a video decoder.
[0037] The first electronic device 110 and / or the second electronic device 120 may be a mobile phone, tablet computer, desktop computer, laptop computer or other electronic device. Figure 1 An example of a first electronic device 110 and a second electronic device 120 is shown. The first electronic device 110 and the second electronic device 120 may include more or fewer elements than shown, or have different configurations of the various elements shown.
[0038] Source module 112 may include a video capture device for capturing new video, a video database for storing previously captured video, and / or a video feed interface for receiving video from a video content provider. Source module 112 may generate calculator-based graph data as source video or generate a combination of live video, saved video, and calculator-generated video as source video. The video capture device may be a charge-coupled device (CCD) image sensor, a complementary metal-oxide-semiconductor (CMOS) image sensor, or a camera.
[0039] Encoder module 114 and decoder module 124 can 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), system-on-a-chip (SoCs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware, or any combination thereof. When implemented in part in software, the device may store a program with software instructions in a suitable non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the disclosed methods. Each of encoder module 114 and decoder module 124 may be included in one or more encoders or decoders, wherein any encoder or decoder may be integrated as part of a combined encoder / decoder (CODEC) in the device.
[0040] The first interface 116 and the second interface 126 may utilize custom protocols or comply with existing or de facto standards, including, but not limited to, Ethernet, IEEE 802.11 or IEEE 802.15 series, wireless USB, or telecommunications standards, including, but not limited to, Global System for Mobile Communications (GSM), Code-Division Multiple Access 2000 (CDMA2000), Time-Division Synchronous Code Division Multiple Access (TD-SCDMA), Worldwide Interoperability for Microwave Access (WiMAX), Third Generation Partnership Project Long-Term Evolution (3GPP-LTE), or Time-Division LTE (TD-LTE). The first interface 116 and the second interface 126 may each include any device configured to transmit and / or store compatible video bitstreams via communication medium 130 and to receive compatible video bitstreams via communication medium 130.
[0041] The first interface 116 and the second interface 126 may include a calculator system interface that enables compatible video bitstreams to be stored on or received from a storage device. For example, the first interface 116 and the second interface 126 may include support for Peripheral Component Interconnect (PCI) and Peripheral Component Interconnect Express (PCIe) bus protocols, proprietary bus protocols, Universal Serial Bus (USB) protocols, Inter-Integrated Circuit (I2C) protocols, or any other logical and physical architecture that can be used to interconnect peer devices.
[0042] Display module 122 may include a display using liquid crystal display (LCD), plasma display, organic light emitting diode (OLED), or light-emitting polymer display (LPD) technology, as well as other display technologies used in other embodiments. Display module 122 may include a high-definition display or an ultra-high-definition display.
[0043] Figure 2 This illustrates an exemplary embodiment according to the present disclosure. Figure 1 The block diagram shown is of the decoder module 124 of the second electronic device 120. The decoder module 124 includes an entropy decoder (e.g., entropy decoding unit 2241), a prediction processor (e.g., prediction processing unit 2242), an inverse quantization / inverse transform processor (e.g., inverse quantization / inverse transform unit 2243), an adder (e.g., adder 2244), a filter (e.g., filter unit 2245), and a decoded image buffer (e.g., decoded image buffer 2246). The prediction processing unit 2242 further includes an intra-frame prediction processor (e.g., intra-frame prediction unit 22421) and an inter-frame prediction processor (e.g., inter-frame prediction unit 22422). The decoder module 124 receives a bitstream, decodes the bitstream, and outputs the decoded video.
[0044] Entropy decoding unit 2241 can be from Figure 1 The second interface 126 receives a bitstream including multiple syntax elements and performs a parsing operation on the bitstream to extract the syntax elements. As part of the parsing operation, the entropy decoding unit 2241 can perform entropy decoding on the bitstream to generate quantized transform coefficients, quantization parameters, transform data, motion vectors, intra-frame modes, partition information, and other syntax information.
[0045] The entropy decoding unit 2241 can perform context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or another entropy coding technique to generate quantized transform coefficients. The entropy decoding unit 2241 can provide the quantized transform coefficients, quantization parameters, and transform data to the inverse quantization / inverse transform unit 2243, and provide the motion vector, intra-frame mode, partitioning information, and other syntactic information to the prediction processing unit 2242.
[0046] The prediction processing unit 2242 may receive syntax elements, such as motion vectors, intra-frame modes, partitioning information, and other syntax information, from the entropy decoding unit 2241. The prediction processing unit 2242 may receive syntax elements including partitioning information and segment video frames according to the partitioning information.
[0047] Each video frame can be divided into at least one image block based on partitioning information. The at least one image block may include a luma block for reconstructing multiple luma samples and at least one chroma block for reconstructing multiple chroma samples. The luma block and at least one chroma block may be further subdivided to generate macroblocks, coding tree units (CTUs), coding blocks (CBs) and their subdivisions, and / or another equivalent coding unit.
[0048] During the decoding process, the prediction processing unit 2242 may receive prediction data, which includes the intra-frame mode or motion vector of the current image block in a specific video frame. The current image block may be a luma block or one of multiple chroma blocks in the specific image frame.
[0049] Intra-prediction unit 22421 can perform intra-predictive coding of the current block unit relative to one or more neighboring blocks in the same frame, based on syntax elements associated with the intra-frame mode, to generate a prediction block. The intra-frame mode can specify the position of reference samples selected from neighboring blocks in the current frame. When prediction processing unit 2242 reconstructs chroma components, intra-prediction unit 22421 can reconstruct multiple chroma components of the current block unit based on multiple luma components of the current block unit.
[0050] When the prediction processing unit 2242 reconstructs multiple luminance components of the current block, the intra-prediction unit 22421 can reconstruct multiple chrominance components of the current block unit based on the multiple luminance components of the current block unit.
[0051] Inter-frame prediction unit 22422 can perform inter-frame prediction coding of the current block unit relative to one or more blocks in one or more reference images based on syntax elements associated with motion vectors, in order to generate a prediction block. The motion vectors can indicate the displacement of the current block unit within the current image block relative to reference block units within the reference images. Reference block units are blocks determined to closely match the current block unit. Inter-frame prediction unit 22422 can receive reference images stored in decoded image buffer 2246 and reconstruct the current block unit based on the received reference images. Reference images can be selected from a first reference image list L0 and a second reference image list L1, each list constructed for the current block unit. When the result of inter-frame prediction coding is single prediction, the current block unit can be predicted based on one reference block unit selected from either the first reference image list L0 or the second reference image list L1. When the result of inter-frame prediction coding is bidirectional prediction, the current block unit can be predicted based on two reference block units selected from the first reference image list L0 and the second reference image list L1, respectively.
[0052] The inverse quantization / inverse transform unit 2243 can apply inverse quantization and inverse transform to reconstruct the residual block in the pixel domain. The inverse quantization / inverse transform unit 2243 can apply inverse quantization to the residual quantization 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.
[0053] The inverse transform can be applied in reverse through a transform process. Transform processes include the discrete cosine transform (DCT), discrete sine transform (DST), adaptive multiple transform (AMT), mode-dependent non-separable secondary transform (MDNSST), hypercube-given transform (HyGT), signal-correlated transform, Karhunen-Loéve transform (KLT), wavelet transform, integer transform, subband transform, or conceptually similar transforms. The inverse transform can convert residual information from a transform domain, such as the frequency domain, back to the pixel domain. The degree of inverse quantization can be modified by adjusting the quantization parameters.
[0054] Adder 2244 adds the reconstructed residual block to the prediction block provided by prediction processing unit 2242 to generate a reconstructed block.
[0055] Filtering unit 2245 may include a deblocking filter, a sample adaptive offset (SAO) filter, a bilateral filter, and / or an adaptive loop filter (ALF) to remove block artifacts from the reconstructed blocks. In addition to the deblocking filter, SAO filter, bilateral filter, and ALF, additional filters (in-loop or post-loop) may also be used. For simplicity, such filters are not explicitly shown, but the output of adder 2244 can be filtered. After filtering unit 2245 performs filtering on the reconstructed blocks of a specific image frame, filtering unit 2245 can output the decoded video to display module 122 or other video receiving units.
[0056] The decoded image buffer 2246 can be a reference image memory that stores reference blocks for use by the prediction processing unit 2242 when decoding the bitstream (in inter-frame coding mode). The decoded image buffer 2246 can be formed from any of a variety of storage devices, such as dynamic random-access memory (DRAM), including synchronous DRAM (SDRAM), magneto-resistive RAM (MRAM), resistive RAM (RRAM), or other types of storage devices. The decoded image buffer 2246 can be on-chip along with other components of the decoder module 124 or off-chip relative to those components.
[0057] Figure 3 This is illustrated according to one embodiment of the present application. Figure 1The block diagram shown is of the encoder module 114 of the first electronic device 110. The encoder module 114 may include a prediction processor (e.g., prediction processing unit 3141), at least a first adder (e.g., first adder 3142) and a second adder (e.g., second adder 3145), a transform / quantization processor (e.g., transform / quantization unit 3143), an inverse quantization / inverse transform processor (e.g., inverse quantization / inverse transform unit 3144), a filter (e.g., filter unit 3146), a decoded image buffer (e.g., decoded image buffer 3147), and an entropy encoder (e.g., entropy coding unit 3148). The prediction processing unit 3141 of the encoder module 114 may further include a partition processor (e.g., partition unit 31411), an intra-frame prediction processor (e.g., intra-frame prediction unit 31412), and an inter-frame prediction processor (e.g., inter-frame prediction unit 31413).
[0058] Encoder module 114 can receive source video and encode the source video to output a bitstream. Encoder module 114 can receive source video comprising multiple image frames, and then divide each of the multiple video frames according to the encoding structure. Each of the multiple video frames can be divided into at least one image block.
[0059] At least one image block may include a luminance block having multiple luminance samples and at least one chrominance block having multiple chrominance samples. The luminance block and at least one chrominance block may be further subdivided to generate macroblocks, coding tree units (CTUs), coding blocks (CBs), their subdivisions, and / or other equivalent coding units.
[0060] Encoder module 114 can perform additional subdivision of the source video. It should be noted that the disclosed implementation is generally applicable to video encoding, regardless of how the source video is subdivided before and / or during encoding.
[0061] During the encoding process, the prediction processing unit 3141 may receive the current image block of a specific video frame from among multiple video frames. The current image block may be a luma block or one of multiple chroma blocks in the specific image frame.
[0062] Partitioning unit 31411 can divide the current image block into multiple block units. Intra-frame prediction unit 31412 can perform intra-frame prediction coding 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. Inter-frame prediction unit 31413 can perform inter-frame prediction coding of the current block unit relative to one or more blocks in one or more reference images to provide temporal prediction.
[0063] The prediction processing unit 3141 can select one of several coding results generated by the intra-frame prediction unit 31412 and the inter-frame prediction unit 31413 based on a mode selection method such as a cost function. The mode selection method can be a rate-distortion optimization (RDO) process.
[0064] The prediction processing unit 3141 can determine the selected coding result and provide the prediction block corresponding to the selected coding result to the first adder 3142 for generating residual blocks and to the second adder 3145 for reconstructing coding block units. The prediction processing unit 3141 can also provide syntax elements, such as motion vectors, intra-frame mode indicators, partition information and other syntax information, to the entropy coding unit 3148.
[0065] Intra-prediction unit 31412 can perform intra-prediction on the current block unit. Intra-prediction unit 31412 can determine the intra-prediction mode for the reconstructed samples adjacent to the current block unit so as to encode the current block unit.
[0066] Intra-prediction unit 31412 can encode the current block unit using various intra-prediction modes. Intra-prediction modes can include multiple non-angular modes and multiple angular modes. Multiple non-angular modes can include planar modes and DC modes. Additionally, when encoder module 114 encodes the block unit using high-efficiency video coding (HEVC), the number of angular modes can be equal to 32. When encoder module 114 encodes the block unit using versatile video coding (VVC) or the VVC test model (VTM), the number of angular modes can be equal to 65. Intra-prediction unit 31412 of prediction processing unit 3141 can select an appropriate intra-prediction mode from the selected modes. Intra-prediction unit 31412 can encode the current block unit using cross-component prediction modes to predict one of the two chrominance components of the current block unit based on the luma component of the current block unit. Intra-prediction unit 31412 can predict the first of the two chrominance components of the current block unit based on the second of the two chrominance components of the current block unit.
[0067] As an alternative to the intra-prediction performed by the intra-prediction unit 31412, the inter-prediction unit 31413 can perform inter-prediction on the current block unit. The inter-prediction unit 31413 can perform motion estimation to estimate the motion of the current block unit to generate a motion vector.
[0068] A motion vector can indicate the displacement of a current block unit within the current image patch relative to a reference block unit within a reference image. The inter-frame prediction unit 31413 can receive at least one reference image stored in the decoded image buffer 3147 and estimate motion based on the received reference image to generate a motion vector. The reference images can be selected from a first reference image list L0 and a second reference image list L1, each list constructed for the current block unit. When the result of inter-frame prediction coding is single prediction, the current block unit can be predicted based on one reference block unit selected from either the first reference image list L0 or the second reference image list L1. When the result of inter-frame prediction coding is bidirectional prediction, the current block unit can be predicted based on two reference block units selected from the first reference image list L0 and the second reference image list L1, respectively.
[0069] The first adder 3142 can generate a residual block by subtracting the prediction block determined by the prediction processing unit 3141 from the original current block unit. The first adder 3142 can represent one or more elements performing the subtraction.
[0070] The transform / quantization unit 3143 can apply a transform to the residual block to generate residual transform coefficients, and then quantize the residual transform coefficients to further reduce the bit rate. This transform can be one of DCT, DST, AMT, MDNSST, HyGT, signal-dependent transform, KLT, wavelet transform, integer transform, subband transform, or a conceptually similar transform.
[0071] Transformation can convert residual information from the pixel value domain to the transform domain, such as the frequency domain. The degree of quantization can be modified by adjusting the quantization parameters.
[0072] The transform / quantization unit 3143 can perform a scan of a matrix including the quantized transform coefficients. Alternatively, the entropy encoding unit 3148 can perform the scan.
[0073] The entropy coding unit 3148 can receive multiple syntax elements from the prediction processing unit 3141 and the transform / quantization unit 3143, including quantization parameters, transform data, motion vectors, intra-frame modes, partition information, and other syntax information. The entropy coding unit 3148 can encode the syntax elements into a bitstream.
[0074] Entropy coding unit 3148 can entropy code the quantized transform coefficients to generate a coded bitstream by performing CAVLC, CABAC, SBAC, PIPE coding, or another entropy coding technique. The coded bitstream can be sent to another device (e.g., Figure 1 The second electronic device 120 in the system may be archived for later transmission or retrieval.
[0075] The inverse quantization / inverse transform unit 3144 can apply inverse quantization and inverse transform to reconstruct the residual block in the pixel domain for later use as a reference block. The second adder 3145 can add the reconstructed residual block to the prediction block provided from the prediction processing unit 3141 to produce a reconstructed block for storage in the decoded image buffer 3147.
[0076] Filtering unit 3146 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, SAO filter, bilateral filter, and ALF, additional filters (in-loop or post-loop) may be used. For simplicity, such filters are not shown and may filter the output of the second adder 3145.
[0077] The decoding image buffer 3147 may be a reference image memory storing reference blocks for use by the encoder module 714 to encode video, such as in intra-frame or inter-frame coding modes. The decoding image buffer 3147 may include various memory devices, such as DRAM (including SDRAM), MRAM, RRAM, or other types of memory devices. The decoding image buffer 3147 may be on-chip along with other components of the encoder module 114 or off-chip relative to those components.
[0078] Figure 4 A flowchart of a method 400 for encoding video data by an electronic device according to an embodiment of the present disclosure is shown. Method 400 is merely an example, as there are various ways to perform video data encoding.
[0079] Method 400 can be used Figure 1 and Figure 3 The configuration shown is used to execute the method, and the individual elements of these diagrams are referenced in relation to method 400. Figure 4 Each box shown can represent one or more procedures, methods, or subroutines being executed.
[0080] Figure 4 The order of the boxes in this document is illustrative only and may be changed. Additional boxes may be added or fewer boxes may be used without departing from this disclosure.
[0081] In block 410, encoder module 114 receives video data and determines block units from image frames included in the video data.
[0082] refer to Figures 1 to 3The encoder module 114 of the first electronic device 110 can receive video data from the source module 112. The video data received by the encoder module 114 can be video. The encoder module 114 can identify one of a plurality of video frames in the video as an image frame, and determine block units from the image frame in the video.
[0083] In some implementations, the prediction processing unit 3141 of the encoder module 114 can determine block units from the determined image frames via the partitioning unit 31411, and the encoder module 114 can provide multiple partitioning indications to the bitstream based on the partitioning results of the partitioning unit 31411.
[0084] In block 420, encoder module 114 determines a first merge candidate list for block units, which includes multiple merge candidates.
[0085] refer to Figure 1 and Figure 3 The encoder module 114 can apply a merging mode to the block cells to determine merging candidates for the block cells included in a first merging candidate list. The first merging candidate list can be constructed based on a variety of merging candidates, such as multiple spatial motion vector predictions (MVPs) determined from multiple spatially adjacent blocks, multiple temporal MVPs determined from multiple juxtaposed blocks, multiple spatial MVPs determined from multiple non-adjacent blocks, multiple history-based MVPs determined from a first-in-first-out (FIFO) table, multiple pairwise averaged MVPs, and multiple zero motion vectors (zero MVs).
[0086] In some implementations, since the movement of a block unit can be similar to the movement of one of a plurality of spatially adjacent blocks, the MV of the spatially adjacent blocks adjacent to the block unit can be reused for the block unit. Therefore, the spatial MVP of the spatially adjacent blocks can be selected as a merging candidate for the block unit. In some implementations, the plurality of spatially adjacent blocks may include a coding block located to the upper left of the upper left corner of the block unit, a coding block located to the upper right of the upper right corner of the block unit, a coding block located above the upper right corner of the block unit, a coding block located to the lower left of the lower left corner of the block unit, and a coding block located to the left of the lower left corner of the block unit.
[0087] In some implementations, the temporal MVP of a juxtaposed block in multiple reference images, different from the image frame, can be reused for block units because the motion of a block unit can be similar to the motion of one of the multiple juxtaposed blocks. Therefore, the temporal MVP of the juxtaposed block can be selected as a candidate for merging block units.
[0088] In some implementations, the spatial maximum value (MV) of non-adjacent blocks in an image frame can be reused for block units because the motion of a block unit can be similar to the motion of one of a plurality of non-adjacent blocks. Therefore, the spatial MVP of non-adjacent blocks can be selected as candidates for merging block units. In some implementations, non-adjacent blocks can be selected based on the block width (WB) and block height (HB) of the block unit.
[0089] In some implementations, for history-based MVPs, motion information of previously encoded blocks can be stored in a FIFO table and used as merge candidates for block units. When a new MV is inserted into the FIFO table, the FIFO table can be updated using constrained FIFO rules. In some implementations, pairwise average candidates can be generated by averaging candidate pairs included in a first merge candidate list. In some implementations, pairwise average candidates can be generated using the first two merge candidates in the first merge candidate list. In some implementations, when the first merge candidate list is not full, zero MV candidates can be added last until the maximum number of merge candidates is met. In some implementations, the maximum number of merge candidates in the first merge candidate list can be predefined.
[0090] In some implementations, the merging mode may also include a merging mode with motion vector difference (MMVD). In MMVD mode, encoder module 114 may further determine merging candidates for block units included in a first merging candidate list of block units. Each merging candidate for a block unit may be determined based on one of a plurality of basic motion candidates, one of a plurality of motion differences, and one of a plurality of prediction directions. For example, one of the plurality of motion differences and one of the plurality of prediction directions may be used to determine one of a plurality of difference motion vectors, and one of the plurality of difference motion vectors and one of the plurality of basic motion candidates may be combined to determine one of the plurality of merging candidates. In implementation, one of the difference motion vectors and the basic motion vector of one of the basic motion candidates may be combined to generate a merged motion vector.
[0091] In box 430, encoder module 114 identifies multiple merge subgroups from the first merge candidate list.
[0092] refer to Figure 1 and Figure 3 The encoder module 114 can determine the merge subgroups and add the merge candidates from the first merge candidate list to the merge subgroups. The number of merge candidates in each of the multiple merge subgroups can be equal to or less than the value of the quantity N. In addition, the quantity N can be a predefined number as a positive integer.
[0093] In some implementations, the first merge candidate list can be divided to generate merge subgroups. In some implementations, the number of merge candidates in a merge subgroup can be determined based on the value of the quantity N. The number of merge candidates in at least one merge subgroup can be equal to the value of the quantity N. In some implementations, the number of merge candidates in a merge subgroup may not be equal to each other when the number of merge candidates Nt1 in the first merge candidate list is not divisible by the quantity N. For example, the number of merge candidates Nt1 in the first merge candidate list can be equal to 15. Therefore, when the quantity N is equal to 4, the number of merge candidates in the merge subgroup can be equal to 3 or 4. In some implementations, the number of merge candidates Nt1 in the first merge candidate list can be divisible by the quantity N. Therefore, the number of merge subgroups can be equal to the quotient that is a positive integer. For example, the number of merge candidates Nt1 in the first merge candidate list can be equal to 15, and the quantity N can be equal to 5. Therefore, the number of merge subgroups can be equal to 3.
[0094] In some implementations, when at least one of the zero MV candidates is included in the first merge candidate list, at least one of the zero MV candidates may not be added to the merge subgroup. In some implementations, when the number of other merge candidates in the first merge candidate list is not divisible by the number N, the number of merge candidates in the merge subgroup may not be equal to each other.
[0095] In some implementations, the number of merge candidates in the merged subgroups can be different from each other and equal to or less than the number N. The number of merged subgroups is equal to the number G. Therefore, the number of merge candidates in the merged subgroups can be equal to M1, M2, ..., and MG. Additionally, the k-th merged subgroup may include Mk merge candidates, which includes the J-th to L-th merge candidates. In some implementations, the numbers k, J, L, G, M1, M2, ..., Mk, ..., and MG can be positive integers. The number J can be equal to... And the quantity L can be equal to In some implementations, the number G can be equal to two. Therefore, the first merge subgroup may include M1 merge candidates with multiple candidate indices in a first index range of 0 to M1-1, and the second merge subgroup may include M2 merge candidates with multiple candidate indices in a second index range of M1 to M1+M2-1.
[0096] In some implementations, the number of merge candidates Nt1 in the first merge candidate list can be equal to 15, and the number of merge candidates in the merge subgroups can be predefined as equal to 4, 5, or 6. Therefore, the first merge candidate list can be divided to generate three subgroups, each with a different number of merge candidates. The first merge subgroup may include four merge candidates with candidate indices from 0 to 3, the second subgroup may include five merge candidates with candidate indices from 4 to 8, and the third subgroup may include six merge candidates with candidate indices from 9 to 14.
[0097] In some implementations, the number of merge candidates in a merge subgroup can be determined based on the size parameter of the block cell. When the size parameter is greater than or equal to a size threshold, the number of merge candidates in the merge subgroup can be increased to a number greater than a predefined number. In some implementations, the size threshold can be a positive integer. In some implementations, the size parameter of the block cell can be determined based on at least one of the block width WB or the block height HB of the block cell. For example, the size parameter of the block cell can be equal to either the block width WB or the block height HB of the block cell. The size parameter of the block cell can be equal to the product of the block width WB and the block height HB of the block cell. The size parameter of the block cell can be equal to the quotient obtained by dividing the block width WB by the block height HB of the block cell, or the quotient obtained by dividing the block height HB by the block width WB of the block cell.
[0098] In some implementations, encoder module 114 can identify multiple merging subgroups from a first merging candidate list based on basic motion candidates. Merging candidates can be determined based on basic motion candidates, motion differences, and prediction directions. Additionally, the motion differences and prediction directions can be used to determine the difference motion vector, thus merging candidates can be determined based on basic motion candidates and the difference motion vector. Therefore, merging subgroups can be directly determined based on basic motion candidates. In some implementations, the number of basic motion candidates can be equal to the number of merging subgroups. Therefore, the number of merging candidates in a merging subgroup can be determined based on the number of difference motion vectors.
[0099] In some implementations, when one of the basic motion candidates is a single prediction candidate, the number of merged candidates in the merged subgroup corresponding to that basic motion candidate can be equal to the number of difference motion vectors. For example, the number of motion differences can be equal to 6 and the number of prediction directions can be equal to 16. Therefore, the number of merged candidates in the merged subgroup corresponding to a single prediction candidate can be equal to 96.
[0100] In some implementations, when one of the basic motion candidates is a bidirectional prediction candidate, the number of merged candidates determined based on one of the sum and difference motion vectors of the basic motion candidate can be equal to three. One of these three merged candidates can be a single prediction candidate corresponding to the first reference image list L0, another of these three merged candidates can be another single prediction candidate corresponding to the second reference image list L1, and the third of these three merged candidates can be a bidirectional prediction candidate corresponding to the first reference image list L0 and the second reference image list L1. Therefore, when one of the basic motion candidates is a bidirectional prediction candidate, the number of merged candidates in the merged subgroup corresponding to one of the basic motion candidates can be equal to the product of the number of difference motion vectors and 3. For example, the number of motion differences can be equal to 6 and the number of prediction directions can be equal to 16. Therefore, the number of merged candidates in the merged subgroup corresponding to the bidirectional prediction candidate can be equal to up to 288. In some implementations, since each basic motion candidate can be one of a single prediction candidate and a bidirectional prediction candidate, the maximum value of the number of merged candidates in the merged subgroup determined based on the number of difference motion vectors can be equal to the number Ns.
[0101] In box 440, encoder module 114 determines the first-generation value of each of the multiple merging candidates.
[0102] refer to Figure 1 and Figure 3 As shown, encoder module 114 can calculate the first-generation value of each merging candidate based on template matching. Encoder module 114 can determine a reference block for each merging candidate and further determine a reference template region for each reference block. Additionally, encoder module 114 can determine the block template region adjacent to the block unit. Encoder module 114 can compare the reference template region with the block template region to determine the first-generation value of the merging candidate.
[0103] In some embodiments, the block template region may include a first adjacent region located above the block unit and a second adjacent region located to the left of the block unit. The first adjacent region may have a first region width Wr1 and a first region height Hr1, and the second adjacent region may have a second region width Wr2 and a second region height Hr2. In some embodiments, the first region width Wr1 of the first adjacent region may be determined based on the block width WB of the block unit, and the second region height Hr2 of the second adjacent region may be determined based on the block height HB of the block unit. Furthermore, the first region height Hr1 of the first adjacent region and the second region width Wr2 of the second adjacent region may be predefined in the encoder module 114. In some embodiments, the first region width Wr1 of the first adjacent region may be equal to the block width WB of the block unit, and the second region height Hr2 of the second adjacent region may be equal to the block height HB of the block unit. In some embodiments, the first region width Wr1 of the first adjacent region can be equal to a first width parameter Wp1 generated by multiplying the block width WB of the block unit by a first width factor Fw1, and the second region height Hr2 of the second adjacent region can be equal to a first height parameter Hp1 generated by multiplying the block height HB of the block unit by a first height factor Fh1. In some embodiments, the lengths Wr1, Hr1, Wr2, Hr2, Wp1, Hp1, WB, and HB can be positive integers, and the first width factor Fw1 and the first height factor Fh1 can be positive values.
[0104] In some implementations, each reference template region may be adjacent to a corresponding reference block, and each reference block has a reference width WR and a reference height HR. Each reference template region may include a first reference region located above the corresponding reference block and a second reference region located to the left of the corresponding reference block. The first reference region may have a third region width Wr3 and a third region height Hr3, and the second reference region may have a fourth region width Wr4 and a fourth region height Hr4. In some implementations, the reference width WR of the reference block and the third region width Wr3 of the first reference region may be determined based on the block width WB of the block unit and the reference height HR of the reference block, and the fourth region height Hr4 of the second reference region may be determined based on the block height HB of the block unit and the third region height Hr3 of the first reference region. The fourth region width Wr4 of the second reference region may be predefined in the encoder module. In some implementations, the reference width WR of the reference block and the third region width Wr3 of the first reference region may be equal to the block width WB of the block unit, and the reference height HR of the reference block and the fourth region height Hr4 of the second reference region may be equal to the block height HB of the block unit.
[0105] In some embodiments, the third region width Wr3 of the first reference region can be equal to the second width parameter Wp2 generated by multiplying the reference width WR of the reference block by the second width factor Fw2, and the fourth region height Hr4 of the second reference region can be equal to the second height parameter Hp2 generated by multiplying the reference height HR of the reference block by the second height factor Fh2. In some embodiments, the lengths Wr3, Hr3, Wr4, Hr4, Wp2, Hp2, WR, and HR can be positive integers, and the second width factor Fw2 and the second height factor Fh2 can be positive values.
[0106] In some implementations, to compare each reference template region with the block template region, the width Wr3 of each third region may be equal to the width Wr1 of the first region, the height Hr3 of each third region may be equal to the height Hr1 of the first region, the width Wr4 of each fourth region may be equal to the width Wr2 of the second region, and the height Hr4 of each fourth region may be equal to the height Hr2 of the second region. The block template region may include multiple first reconstructed samples predicted and reconstructed before the prediction block unit. Each reference template region may include multiple second reconstructed samples predicted and reconstructed before the prediction block unit. The number of first reconstructed samples in each reference template region may be equal to the number of second reconstructed samples.
[0107] In some implementations, encoder module 114 can determine the first-generation value of a merging candidate by comparing each reference template region with a block template region using a first cost function. Encoder module 114 can also determine the first-generation value by comparing a second reconstructed sample in each reference template region with a first reconstructed sample based on the first cost function. The first cost function may include, but is not limited to, the sum of absolute differences (SAD), the sum of absolute transformed differences (SATD), the mean absolute difference (MAD), the mean squared difference (MSD), and structural similarity (SSIM). It should be noted that any cost function may be used without departing from this disclosure.
[0108] In some implementations, the first generation value of each merge candidate is a template matching generation value, which is determined based on a first reconstruction sample in the neighboring region of the block template region adjacent to the block unit and a second reconstruction sample in the neighboring reference template region of the corresponding one of the determined reference blocks in the merge candidate.
[0109] In box 450, encoder module 114 determines the permutation of multiple merge candidates in each of the multiple merge subgroups based on the first-generation value.
[0110] refer to Figure 1 and Figure 3 As shown, encoder module 114 can reorder the merge candidates in each merge subgroup based on the first-generation value of the merge candidates in the corresponding merge subgroup. In some embodiments, the merge candidates in each merge subgroup can be reordered in ascending or descending order according to the first cost value of the merge candidates in the corresponding merge subgroup.
[0111] In some implementations, the merge candidates in each merge subgroup can be sorted according to any rules before determining the ranking based on the first-generation value. For example, the merge candidates in each merge subgroup can be sorted based on the order in which they were added to the first merge candidate list. In some implementations, when the number of merge subgroups is greater than one, the last merge subgroup can remain unchanged.
[0112] In some implementations, the merge candidates in each merge subgroup can be reordered in ascending order of their first cost values. Therefore, when the first-generation value of a specific merge candidate included in a particular merge subgroup is less than the first-generation values of other merge candidates in that particular merge subgroup, based on this reordering, that specific merge candidate can be moved forward to become the first merge candidate in that particular merge subgroup. In other words, when the first-generation value of a specific merge candidate in a particular merge subgroup is the minimum among the first-generation values of the particular merge group, the specific merge candidate can be moved to become the first merge candidate in the particular merge subgroup. Additionally, when the first-generation value of a specific merge candidate in a particular merge subgroup is the maximum among the first-generation values of the particular merge group, the specific merge candidate can be moved to become the last merge candidate in the particular merge subgroup. For example, a particular merge group may include four merge candidates MC1, MC2, MC3, and MC4 with four first-generation values (CV1, CV2, CV3, and CV4). When the relationship between the four first-generation values is CV4>CV2>CV1>CV3, the permutation of a particular merge candidate can be changed from the original order of the four merge candidates MC1, MC2, MC3 and MC4 to a new order of the four merge candidates MC3, MC1, MC2 and MC4.
[0113] In some implementations, the permutation can be further determined based on diversity criteria. Encoder module 114 can determine the difference between two first-generation values selected from two adjacent merge candidates in the merge candidates. When the difference is less than or equal to a diversity threshold, the last of the two adjacent merge candidates can be moved backward. For example, the relationship between the four first-generation values is CV4>CV2>CV1>CV3, and the difference between the two first-generation values CV1 and CV3 is less than the diversity threshold. Therefore, merge candidate MC1 can be moved backward in a specific merge subgroup. Thus, the permutation of a specific merge candidate can be changed from the original order of the four merge candidates MC1, MC2, MC3, and MC4 to a new order of the four merge candidates MC3, MC2, MC1, and MC4.
[0114] In some implementations, this arrangement may be determined by encoder module 114, but it may not be necessary to adjust the order of the merge candidates in each merge subgroup. In other words, encoder module 114 may determine the first-generation value and determine the arrangement of merge candidates in each merge subgroup according to the ascending or descending order of the first cost values of the merge candidates in the corresponding merge subgroup. Then, encoder module 114 may directly select merge candidates based on the arrangement without needing to reorder the merge subgroups.
[0115] In some implementations, encoder module 114 can identify merged subgroups from a first merged candidate list based on basic motion candidates. Since motion differences and predicted directions can be used to determine difference motion vectors, merged candidates can be determined based on basic motion candidates and difference motion vectors. Therefore, merged subgroups can be determined directly based on basic motion candidates. In other words, the arrangement can be determined for difference motion vectors. Thus, encoder module 114 can determine the arrangement of difference motion vectors for each basic motion candidate.
[0116] In box 460, encoder module 114 determines a second merge candidate list by selecting the top K of a plurality of merge candidates sorted based on the permutation from each of the plurality of merge subgroups.
[0117] refer to Figure 1 and Figure 3 As shown, encoder module 114 can determine the top K merging candidates from each merging subgroup and add the top K merging candidates to a second merging candidate list. The value of the number K is a positive integer less than N and greater than or equal to 1. Therefore, the number of merging candidates Nt2 in the second merging candidate list can be equal to K×G, which is less than the number of merging candidates Nt1 in the first merging candidate list.
[0118] In some implementations, the merge candidates selected from the same merge subgroup into the second merge candidate list can be arranged based on the permutation determined by the first-generation values of the merge candidates in the same merge subgroup. In other words, in the second merge candidate list, the merge candidates selected from a particular merge subgroup can be arranged based on the permutation of that particular merge subgroup. Therefore, in the second merge candidate list, the merge candidates selected from a particular merge subgroup can be arranged in ascending or descending order according to the first cost values of the merge candidates in that particular merge subgroup.
[0119] In some implementations, the merge candidates in the second merge candidate list can be arranged based on the group order of the merged subgroups. In other words, in the second merge candidate list, merge candidates in the first merge subgroup can be arranged before merge candidates in other merge subgroups, and merge candidates in the second merge subgroup can be arranged before merge candidates in the third merge subgroup and after merge candidates in the first merge subgroup.
[0120] For example, the first merge subgroup may include four merge candidates MC1, MC2, MC3, and MC4, and the first merge subgroup may be reordered based on a relation (e.g., CV4>CV2>CV1>CV3) to have a permutation MC3, MC1, MC2, and MC4. Additionally, the second merge subgroup may include four merge candidates MC5, MC6, MC7, and MC8, and the second merge subgroup may be reordered based on a relation (e.g., CV7>CV6>CV5>CV8) to have another permutation MC8, MC5, MC6, and MC7. When the quantity K equals 2, merge candidates MC3 and MC1 from the first merge subgroup and merge candidates MC8 and MC5 from the second merge subgroup can be selected to be added to the second merge candidate list. Furthermore, in the second merge candidate list, merge candidates MC3 and MC1 from the first merge subgroup and merge candidates MC8 and MC5 from the second merge subgroup can be arranged in the order MC3, MC1, MC8, and MC5.
[0121] In some implementations, when the number of merged subgroups is equal to 1, the merge candidates in the second merge candidate list are the top K merge candidates arranged based on the permutation in the first merge candidate list. In another implementation, when the number of merged subgroups is equal to 1, the merge candidates in the second merge candidate list are the K merge candidates with the K minimum values of the first generation of merge candidate values.
[0122] In some implementations, each merge candidate in the second merge candidate list may include a merge candidate index. In some implementations, the number of merge candidates in the second merge candidate list may be equal to Nt2, and the merge candidate index of the second merge candidate list may be in the index range of 0 to Nt2-1. In some implementations, the number Nt2 may be a positive integer. Since the number Nt2 may be equal to K×G, the merge candidate index of the second merge candidate list may be in the index range of 0 to K×G-1.
[0123] In box 470, encoder module 114 selects one of a plurality of merge candidates from a second merge candidate list to predict block cells.
[0124] refer to Figure 1 and Figure 3 As shown, encoder module 114 can determine the second-generation value of each merging candidate in the second merging candidate list, and determine the selected merging candidate based on the second-generation value. The second-generation value of the merging candidate in the second merging candidate list is different from the first-generation value of the merging candidate in the second merging candidate list. In addition, encoder module 114 can also encode one or more merging indices into the bitstream based on the selected merging candidate.
[0125] In some implementations, encoder module 114 may determine a second-generation value based on a block cell and a plurality of third reconstructed samples determined based on a corresponding one of the merging candidates, using a second cost function for each of the plurality of merging candidates in a second merging candidate list. The third reconstructed sample indicated by the corresponding one of the merging candidates may be predicted and reconstructed before predicting the block cell. The second cost function may differ from the first cost function. In some implementations, the second cost function may be a rate-distortion optimization (RDO) process. In implementation, encoder module 114 determines one of the merging candidates as the prediction mode for the block cell used to generate the encoded result. Therefore, encoder module 114 may predict the block cell based on one of the merging candidates to generate a plurality of prediction samples for the block cell.
[0126] In some implementations, encoder module 114 may compare multiple block components of a block unit with predicted samples of the block unit to generate multiple residual components of the block unit. Encoder module 114 may also encode the residual components of the block unit into a bitstream and signal one or more merge indices to the bitstream indicating the selection of one of the merge candidates in a second merge candidate list. Furthermore, to further predict multiple subsequent blocks, encoder module 114 may reconstruct the block unit based on the residual components and one of the merge candidates in the second merge candidate list to generate multiple fourth reconstructed samples of the block unit. The fourth reconstructed samples may be used for intra-frame predictive coding to predict subsequent blocks in an image frame. Additionally, the fourth reconstructed samples may be filtered by encoder module 114 and stored in decoded image buffer 3147 for inter-frame predictive coding to predict subsequent blocks in multiple subsequent images.
[0127] In some implementations, one or more merge indices may include only one merge prediction index corresponding to one of the merge candidate indices, indicating one of the merge candidates in the second merge candidate list. One of the merge candidates indicated by the merge prediction index in the second merge candidate list may be the same as the selected merge candidate in the second merge candidate list. When only K merge candidates are selected for each merge subgroup into the second merge candidate list, the merge prediction index can be used to determine which of the merge subgroups includes the selected merge candidate. For example, when K equals three and the merge prediction index equals seven, because seven is greater than the product of 3 and 2, the selected merge candidate may be included in the third merge subgroup. Therefore, when the decoder module 124 receives the merge prediction index, the decoder module 124 may select one of the merge subgroups that includes the selected merge candidate to determine the arrangement of the merge candidates in the selected merge subgroups, thereby determining the selected merge candidate based on the merge prediction index. For example, since the merge candidate indices of the merge candidates in the first and second merge subgroups are in the range of 0 to 5, one of the selected merge candidates may be the second merge candidate in the third merge subgroup.
[0128] In some implementations, one or more merge indices may include a first merge index indicating which of the merge subgroups includes one selected from the merge candidates, and a second merge index indicating which of the merge candidates in the indicated merge subgroup is one selected from a plurality of merge candidates. The first merge index may be a merge subgroup index for determining a merge subgroup within the indicated merge subgroup, and the second merge index may be a subgroup candidate index for determining one of the indicated merge candidates in the indicated merge subgroup. Additionally, the index value of the subgroup candidate index may be in the index range of 0 to K-1. In some implementations, when one or more merge indices include more than one index, the encoder module 114 may not need to provide merge candidate indices to the merge candidates in the second merge candidate list.
[0129] In some implementations, in MMVD mode, the merged subgroup index can be a basic motion index used to select one of the basic motion candidates, and the subgroup candidate index can be regarded as a difference motion index used to select one of the difference motion vectors or to select one of multiple difference motion indices and multiple prediction direction indices.
[0130] Figure 5 A flowchart of a method 500 for decoding video data by an electronic device according to an embodiment of the present disclosure is shown. Method 500 is merely an example, as there are various ways to perform video data decoding.
[0131] Method 500 can be used Figure 1 and Figure 2 The configuration shown is used to execute the method, and the individual elements of these diagrams are referenced in relation to method 500. Figure 5 Each box in the table can represent one or more procedures, methods, or subroutines to be executed.
[0132] In some implementations, the video data decoded by method 500 may be a bitstream generated by encoding the video by method 400. Therefore, method 500 for decoding the bitstream may be a decoding method corresponding to the encoding method for encoding the video performed by method 400.
[0133] Figure 5 The order of the boxes in this document is illustrative only and may be changed. Additional boxes may be added or fewer boxes may be used without departing from this disclosure.
[0134] In block 510, decoder module 124 receives a bitstream and determines block units and one or more merge indices of block units from image frames based on the bitstream. The bitstream may be video data generated by encoding video through encoder module 114.
[0135] refer to Figure 1 and Figure 2 As shown, the second electronic device 120 can receive bitstreams from an encoder, such as the first electronic device 110 or other video providers, via a second interface 126. The second interface 126 can provide the bitstreams to the decoder module 124.
[0136] In some implementations, the entropy decoding unit 2241 may decode the bitstream to determine multiple prediction indicators and multiple partition indicators for multiple video frames. The decoder module 124 may then further reconstruct the multiple video frames based on the prediction indicators and partition indicators. The prediction indicators and partition indicators may include multiple flags and multiple indices.
[0137] In some implementations, decoder module 124 may determine one of the video frames as an image frame based on the bitstream, and divide the image frame according to partitioning instructions in the bitstream to determine block units. For example, decoder module 124 may divide the image frame to generate multiple CTUs, and further divide one of the CTUs to determine a block unit according to partitioning instructions based on any video coding standard.
[0138] In some implementations, the index of the prediction indication in the bitstream may include one or more merging indices for the block cell, used to select one of a plurality of merging candidates as the prediction mode when the encoder module 114 predicts the block cell in a merging mode. Furthermore, the residual component of the block cell may also be encoded in the bitstream. Therefore, the decoder module 124 can decode the bitstream to determine the prediction mode and residual component of the block cell for reconstructing the block cell.
[0139] At box 520, decoder module 124 selects one of a plurality of merge subgroups identified from a list of merge candidates for block units based on the first of one or more merge indices.
[0140] refer to Figure 1 and Figure 2 As shown, decoder module 124 can determine merge subgroups generated from the merge candidate list. The merge candidate list may include multiple merge candidates.
[0141] In some implementations, the merge candidate list in method 500 may correspond to the first merge candidate list in method 400. Each merge subgroup may include a portion of the merge candidates. The number of merge candidates in each merge subgroup may be equal to or less than a first value N, which is a positive integer.
[0142] In some implementations, the merge candidate list can be divided in the encoder module 114 and decoder module 124 to generate merged subgroups. The number of merge candidates in a merged subgroup can be determined based on the value of the quantity N. The number of merge candidates in at least one merged subgroup can be equal to the value of the quantity N. In some implementations, the number of merge candidates in a merged subgroup may not be equal to each other when the number Nt1 of merge candidates in the merge candidate list is not divisible by the quantity N. In some implementations, the number Nt1 of merge candidates in the merge candidate list is divisible by the quantity N. Therefore, the number of merged subgroups can be equal to the quotient, which is a positive integer.
[0143] In some implementations, the number of merge candidates in a merge subgroup can be different from each other and equal to or less than the number N. The number of merge subgroups is equal to the number G. Therefore, the number of merge candidates in a merge subgroup can be equal to M1, M2, ..., MG. For example, the number of merge candidates Nt1 in the merge candidate list can be equal to 15, and the number of merge candidates in the merge subgroups can be predefined to be equal to 4, 5, and 6. Therefore, the merge candidate list can be divided to generate 3 subgroups, each with a different number of merge candidates. The first merge subgroup may include 4 merge candidates with candidate indices from 0 to 3, the second subgroup may include 5 merge candidates with candidate indices from 4 to 8, and the third subgroup may include 6 merge candidates with candidate indices from 9 to 14.
[0144] In some implementations, the number of merge candidates in a merge subgroup can be determined based on the size parameter of the block cell. When the size parameter is greater than or equal to a size threshold, the number of merge candidates in the merge subgroup can be increased to a number greater than a predefined number. In some implementations, the size threshold can be a positive integer. In some implementations, the size parameter of the block cell can be determined based on at least one of the block width WB or the block height HB of the block cell.
[0145] In some implementations, during the merging mode, the merging candidates in the merging candidate list can be constructed based on several merging candidates, such as multiple spatial motion vector predictions (MVPs) determined from multiple spatially adjacent blocks, multiple temporal MVPs from multiple juxtaposed blocks, multiple spatial MVPs determined from multiple non-adjacent blocks, multiple history-based MVPs determined according to a first-in-first-out (FIFO) table, multiple pairwise average MVPs, and multiple zero motion vectors (zero MVs) with no motion. In some implementations, when at least one of the zero MV candidates is included in the first merging candidate list, at least one of the zero MV candidates may not be added to the merging subgroup. Since the first construction method of the first merging candidate list in method 400 is the same as the second construction method of the merging candidate list in method 500, the merging candidates in the first merging candidate list constructed for block units by method 400 can be the same as the merging candidates in the merging candidate list constructed for block units by method 500. Furthermore, the first identification method in method 400 for identifying merged subgroups from the first merged candidate list is the same as the second identification method in method 500 for identifying merged subgroups from the merged candidate list, and the merged subgroups identified by method 400 for block units can be the same as the merged subgroups identified by method 500 for block units.
[0146] In some implementations, in merge mode with motion vector difference (MMVD), decoder module 124 can also determine merge candidates for block units included in the merge candidate list of block units. Each merge candidate for a block unit can be determined based on one of a plurality of basic motion candidates, one of a plurality of motion differences, and one of a plurality of prediction directions. For example, one of the motion differences and one of the prediction directions can be used to determine one of a plurality of difference motion vectors, and one of the difference motion vectors and one of the basic motion candidates can be combined to determine one of the merge candidates. In one embodiment, one of the difference motion vectors and the basic motion vectors of one of the basic motion candidates can be combined to generate a merged motion vector.
[0147] In some implementations, merged subgroups can be identified from a merged candidate list based on basic motion candidates. Merged candidates can be determined based on basic motion candidates, motion differences, and prediction directions. Alternatively, motion differences and prediction directions can be used to determine difference motion vectors, thus merged candidates can be determined based on basic motion candidates and difference motion vectors. Therefore, merged subgroups can be directly determined based on basic motion candidates. The number of basic motion candidates can be equal to the number of merged subgroups. Therefore, the number of merged candidates in a merged subgroup can be determined based on the number of difference motion vectors.
[0148] In some implementations, when one of the basic motion candidates is a single prediction candidate, the number of merged candidates in the merged subgroup corresponding to one of the basic motion candidates can be equal to the number of difference motion vectors. For example, the number of motion differences can be equal to 6 and the number of prediction directions can be equal to 16. Therefore, the number of merged candidates in the merged subgroup corresponding to a single prediction candidate can be equal to 96.
[0149] In some implementations, when one of the basic motion candidates is a bidirectional prediction candidate, the number of merged candidates determined based on one of the basic motion candidates and one of the difference motion vectors can be equal to three. Two of these three merged candidates can be single prediction candidates corresponding to one of the first reference image list L0 and the second reference image list L1, respectively, and the other of these three merged candidates can be a bidirectional prediction candidate corresponding to both the first reference image list L0 and the second reference image list L1. Therefore, when one of the basic motion candidates is a bidirectional prediction candidate, the number of merged candidates in the merged subgroup corresponding to one of the basic motion candidates can be equal to the product of the number of difference motion vectors and 3. For example, the number of merged candidates in the merged subgroup corresponding to a bidirectional prediction candidate can be equal to 288. In some implementations, since each basic motion candidate can be one of a single prediction candidate or a bidirectional prediction candidate, the maximum number of merged candidates in the merged subgroup determined based on the number of difference motion vectors can be equal to the number N.
[0150] In some implementations, when the bitstream is generated by encoder module 114, one or more merge indices may include only one merge prediction index corresponding to one of the merge candidate indices, indicating the prediction mode in the second merge candidate list in method 400. When each merge subgroup in method 400 selects only K merge candidates into the second merge candidate list, the merge prediction index can be used to determine which of the merge subgroups includes the selected merge candidate. For example, when K equals three and the merge prediction index equals seven, since seven is greater than the product of 3 and 2, the prediction mode can be included in the third merge subgroup. Therefore, when decoder module 124 receives the merge prediction index, decoder module 124 can determine, based on the merge prediction index, one of the selected merge subgroups that includes the prediction mode.
[0151] In some implementations, when the bitstream is generated by encoder module 114, one or more merge indices may include a first merge index and a second merge index, the first merge index indicating which of the merge subgroups includes the prediction mode, and the second merge index indicating which of the merge candidates in the indicated merge subgroup is selected from a plurality of merge candidates. The first merge index may be a merge subgroup index for determining the selected merge subgroup, and the second merge index may be a subgroup candidate index for determining the prediction mode in the selected merge subgroup.
[0152] In box 530, decoder module 124 determines the cost value of each merge candidate in the selected merge subgroup.
[0153] refer to Figure 1 and Figure 2 As shown, decoder module 124 can calculate the cost value of each merge candidate in the selected merge subgroups based on template matching. Decoder module 124 can determine a reference block for each merge candidate in the selected merge subgroups, and also determine a reference template region for each reference block. Additionally, decoder module 124 can determine the block template region adjacent to the block unit. Decoder module 124 can compare the reference template region with the block template region to determine the cost value of the merge candidate in one of the selected merge subgroups.
[0154] In some implementations, since the decoder module 124 has already determined which of the merge subgroups includes the prediction mode, it may not be necessary to determine the cost value of each merge candidate in the merge candidate list. To decode the bitstream more efficiently, the decoder module 124 may determine only the cost value of each merge candidate in the selected merge subgroup.
[0155] In some implementations, a block template region may include a first adjacent region located above the block cell and a second adjacent region located to the left of the block cell. Each reference template region may be adjacent to a corresponding reference block and includes a first reference region located above the corresponding reference block and a second reference region located to the left of the corresponding reference block. To compare each reference template region with the block template region, the reference region size of the reference template region may be the same as the block region size of the block template region. The block template region may include a plurality of first reconstruction samples predicted and reconstructed before the prediction block cell. Each reference template region may include a plurality of second reconstruction samples predicted and reconstructed before the prediction block cell. The number of first reconstruction samples in each reference template region may be equal to the number of second reconstruction samples.
[0156] In some implementations, the decoder module 124 can determine the cost of merging candidates in the selected merging subgroup by comparing each of the reference template regions with the block template regions using a cost function. The decoder module 124 can also determine the cost by comparing a second reconstructed sample in each reference template region with a first reconstructed sample based on the cost function. The cost function may include, but is not limited to, the Sum of Absolute Difference (SAD), the Sum of Absolute Transformed Difference (SATD), the Mean Absolute Difference (MAD), the Mean Squared Difference (MSD), and the Structural Similarity (SSIM). It should be noted that any cost function may be used without departing from this disclosure.
[0157] In some implementations, the cost of each merge candidate in the selected merge subgroup is a template matching cost determined based on a first reconstruction sample in an adjacent region of a block template region adjacent to the block cell and a second reconstruction sample in a reference template region adjacent to a corresponding reference block in a reference block determined based on a corresponding merge candidate in the selected merge subgroup.
[0158] In box 540, decoder module 124 determines the permutation of the merge candidates in one of the selected merge subgroups based on the cost value.
[0159] refer to Figure 1 and Figure 2 As shown, decoder module 124 can reorder one of the selected merge subgroups based on the cost value of the merge candidates in one of the selected merge subgroups. In some embodiments, the merge candidates in one of the selected merge subgroups can be reordered in ascending or descending order of the cost values of the merge candidates in one of the selected merge subgroups.
[0160] In some implementations, the merger candidates in one of the selected merge subgroups can be sorted according to any rule before determining the ranking based on cost value. For example, the merger candidates in one of the selected merge subgroups can be sorted based on the order in which they were added to the merge candidate list.
[0161] In some implementations, the merger candidates in a selected subgroup can be reordered in ascending order of their cost values. Therefore, when the cost of a particular merger candidate in a selected subgroup is less than the cost of other merger candidates in that subgroup, that particular merger candidate can be moved forward to become the first merger candidate in the selected subgroup based on this reordering. In other words, when the cost of a particular merger candidate in a selected subgroup is the minimum cost among all the merger candidates in that subgroup, that particular merger candidate can be moved to become the first merger candidate in the selected subgroup.
[0162] In some implementations, the permutation can be further determined based on diversity criteria. Decoder module 124 can determine the difference between two values among two adjacent merge candidates selected from the merge candidates in the selected merge subgroup. When the difference is less than or equal to a diversity threshold, the last of the two adjacent merge candidates can be moved backward. For example, the relationship between the four values is CV4>CV2>CV1>CV3, and the difference between the two values CV1 and CV3 is less than the diversity threshold. Therefore, merge candidate MC1 can be moved backward in the selected merge subgroup. Thus, the permutation of a particular merge candidate can be changed from the original order of the four merge candidates MC1, MC2, MC3, and MC4 to a new order of the four merge candidates MC3, MC2, MC1, and MC4.
[0163] In some implementations, decoder module 124 can identify merged subgroups from a merged candidate list based on basic motion candidates. Since the motion difference and predicted direction can be used to determine the difference motion vector, merged candidates can be determined based on the basic motion candidates and the difference motion vector. Therefore, one selected in the merged subgroup can directly correspond to one selected in the basic motion candidates. In other words, the permutation can be determined for the difference motion vector. Thus, decoder module 124 can determine the permutation of the difference motion vectors of one selected in the basic motion candidates.
[0164] In some implementations, in order to determine the same permutation of one of the selected merged subgroups in encoder module 114 and decoder module 124, the first cost calculation method in method 400 for determining the multiple first generation values of merged candidates in the first merged candidate list can be the same as the second cost calculation method in method 500 for determining the generation value of a merged candidate in one of the selected merged subgroups. Furthermore, the first permutation determination method in method 400 for determining the permutation of merged candidates in each merged subgroup can be the same as the second permutation determination method in method 500 for determining the permutation of merged candidates in one of the selected merged subgroups.
[0165] In box 550, decoder module 124 selects one of the top K merge candidates from the selected merge subgroup based on the second of one or more merge indices.
[0166] refer to Figure 1 and Figure 2 As shown, decoder module 124 can select one of the permutation-sorted merge candidates from a selected merge subgroup based on the second of one or more merge indices. The second of the one or more merge indices can indicate the prediction pattern of the first K block units from the merge candidates sorted by permutation based on the selected merge subgroup. In some embodiments, the second value of the number K is a second positive integer less than N.
[0167] In some implementations, since the decoder module 124 can select a prediction mode from one of the selected merge subgroups based on the second of one or more merge indices, the index value of the second of the one or more merge indices can be in the index range of 0 to K-1. Therefore, since the index value of the second of one or more merge indices may not be greater than K-1, merge candidates after the Kth merge candidate in the permutation of one of the selected merge subgroups are excluded from the selection of prediction modes.
[0168] In some implementations, the first of one or more merge indices can be used to determine the selected one in the merged subgroup. Therefore, since the number of merged subgroups is equal to the quantity G, the index value of the first of the one or more merge indices can be in the index range of 0 to G-1. Thus, the first of the one or more merge indices can be different from the second of the one or more merge indices.
[0169] In some implementations, the decoder module 124 may determine one of the selected difference motion vectors based on the second of one or more mode indices, and then determine the prediction mode based on the selected difference motion vector and the selected basic motion candidate.
[0170] In some implementations, when the bitstream is generated by encoder module 114, one or more merge indices may include only one merge prediction index corresponding to one of the merge candidate indices, indicating the prediction mode in the second merge candidate list in method 400. When each merge subgroup in method 400 selects only K merge candidates to the second merge candidate list, the merge prediction index can be used to determine which of the merge subgroups includes the selected merge candidate. For example, when K equals three and the merge prediction index equals seven, since seven is greater than the product of 3 and 2, the prediction mode can be included in the third merge subgroup. In other words, when decoder module 124 receives the merge prediction index for determining the prediction mode, the merge prediction index can be considered as the first of one or more merge indices indicating which of the merge subgroups includes the prediction mode, and also as the second of one or more merge indices indicating which merge candidate in the selected merge subgroup is the prediction mode. Therefore, both the first and second of one or more merge indices can be merge prediction indices, and thus the first of one or more merge indices can be the same as the second of one or more merge indices.
[0171] Return to reference Figure 5 In box 560, decoder module 124 reconstructs block units based on one of the top K merge candidates from a plurality of merge candidates.
[0172] Further reference Figure 1 and Figure 2 The decoder module 124 can determine prediction blocks based on the prediction mode and add residual components to the prediction blocks to reconstruct block units. The decoder module 124 can reconstruct all other block units in the image frame to reconstruct the image frame and video.
[0173] The disclosed embodiments should be considered illustrative rather than restrictive in all respects. It should also be understood that this disclosure is not limited to the specific embodiments disclosed, but many rearrangements, modifications and substitutions are possible without departing from the scope of this disclosure.
Claims
1. A method for encoding video data by an electronic device, characterized in that, The method includes: Receive the video data; Determine block units from image frames included in the video data; For the block unit, a first merge candidate list including multiple merge candidates is determined; Multiple merge subgroups are identified from the first merge candidate list, wherein the number of the multiple merge candidates in each of the multiple merge subgroups is equal to or less than a first value of a number N, where N is a first positive integer; A first-generation value is determined for each of the plurality of merging candidates, wherein the first-generation value for each of the plurality of merging candidates is a template matching generation value, which is determined based on a plurality of first reconstruction samples in a plurality of adjacent regions adjacent to the block unit and a plurality of second reconstruction samples determined based on a corresponding one of the plurality of merging candidates; Based on the first generation value, the arrangement of the plurality of merger candidates in each of the plurality of merger subgroups is determined, wherein the arrangement is that the plurality of merger candidates in each of the plurality of merger subgroups are sorted in ascending order according to the first cost value; A second merge candidate list is determined by selecting the top K merge candidates from each of the plurality of merge subgroups, based on the sorted plurality of merge candidates, wherein the second value of K is a second positive integer less than N; and One of the plurality of merge candidates in the second merge candidate list is selected to predict the block cell, and one or more merge indices are encoded into the bitstream based on the selected merge candidate.
2. The method according to claim 1, characterized in that, Also includes: Determine a second-generation value for each of the plurality of merge candidates in the second merge candidate list, wherein the second-generation value is different from the first-generation value; The selection of one of the plurality of merge candidates in the second merge candidate list is based on the second generation value; and Determine one or more merge indices to indicate the selection of one of the plurality of merge candidates.
3. The method according to claim 2, characterized in that, The second generation value of each of the plurality of merge candidates in the second merge candidate list is determined based on the block unit and a plurality of third reconstruction samples determined based on a corresponding one of the plurality of merge candidates.
4. The method according to claim 2, characterized in that, The one or more merged indexes include: The first of the one or more merge indices, the first being used to indicate which of the plurality of merge subgroups includes one selected from the plurality of merge candidates; and The second of the one or more merge indices, the second being used to indicate which of the plurality of merge candidates is selected from the plurality of merge candidates in the one of the plurality of merge subgroups.
5. A method for decoding a bitstream by an electronic device, characterized in that, The method includes: Receive the bit stream; Based on the bitstream, block units and one or more merging indices of the block units are determined from the image frame; Based on the first of the one or more merge indices, one of a plurality of merge subgroups identified from the merge candidate list of the block unit is selected, wherein: Each of the plurality of merge subgroups includes a plurality of merge candidates, and The number of the plurality of merging candidates in each of the plurality of merging subgroups is equal to or less than a first value of N, where N is a positive integer; Determine the cost value of each of the plurality of merge candidates in one of the plurality of merge subgroups, wherein the cost value of each of the plurality of merge candidates in one of the plurality of merge subgroups is a template matching cost value, which is determined based on a plurality of first reconstruction samples in a plurality of adjacent regions adjacent to the block unit and a plurality of second reconstruction samples determined based on a corresponding one of the plurality of merge candidates in one of the plurality of merge subgroups; Based on the cost value, determine the arrangement of the plurality of merger candidates in one of the plurality of merger subgroups, wherein the arrangement is the plurality of merger candidates in one of the plurality of merger subgroups sorted in ascending order of the cost value; Based on the second of the one or more merge indices, select one of the top K merge candidates from the selected one of the plurality of merge subgroups, where the second value of K is a second positive integer less than N; and The block unit is reconstructed based on one of the top K from the plurality of merge candidates.
6. The method according to claim 5, characterized in that, The index value of the second of the one or more merged indexes is in the index range of 0 to K-1.
7. The method according to claim 5, characterized in that, In the permutation of the plurality of merge subgroups, the plurality of merge candidates that are ranked after the Kth merge candidate are excluded from the selection.
8. The method according to claim 5, characterized in that, The first of the one or more merged indexes may be the same as or different from the second of the one or more merged indexes.
9. An electronic device for decoding bitstreams, the electronic device comprising: At least one processor; and At least one storage device, coupled to the at least one processor and storing a plurality of instructions, which, when executed by the at least one processor, cause the electronic device to: Receive the bit stream; Based on the bitstream, block units and one or more merging indices of the block units are determined from the image frame; Based on the first of the one or more merge indices, one of a plurality of merge subgroups identified from the merge candidate list of the block unit is selected, wherein: Each of the plurality of merge subgroups includes a plurality of merge candidates, and The number of the plurality of merging candidates in each of the plurality of merging subgroups is equal to or less than a first value of N, where N is a positive integer; Determine the cost value of each of the plurality of merge candidates in one of the plurality of merge subgroups, wherein the cost value of each of the plurality of merge candidates in one of the plurality of merge subgroups is a template matching cost value, which is determined based on a plurality of first reconstruction samples in a plurality of adjacent regions adjacent to the block unit and a plurality of second reconstruction samples determined based on a corresponding one of the plurality of merge candidates in one of the plurality of merge subgroups; Based on the cost value, determine the arrangement of the plurality of merger candidates in one of the plurality of merger subgroups, wherein the arrangement is the plurality of merger candidates in one of the plurality of merger subgroups sorted in ascending order of the cost value; Based on the second of the one or more merge indices, select one of the top K merge candidates from the selected one of the plurality of merge subgroups, where the second value of K is a second positive integer less than N; and The block unit is reconstructed based on one of the top K from the plurality of merge candidates.
10. The electronic device according to claim 9, characterized in that, The index value of the second of the one or more merged indexes is in the index range of 0 to K-1.
11. The electronic device according to claim 9, characterized in that, In the permutation of the plurality of merge subgroups, the plurality of merge candidates that are ranked after the Kth merge candidate are excluded from the selection.
12. The electronic device according to claim 9, characterized in that, The first of the one or more merged indexes may be the same as or different from the second of the one or more merged indexes.