Data decoding method, device and data encoding method, device

By flexibly selecting the encoding mode and candidate encoding mode in the encoding unit, including the intra-block copy encoding mode, the poor decoding quality and frequent switching caused by the encoding mode limitation in the prior art are solved, and a more accurate encoding and decoding process is achieved. .

CN114979630BActive Publication Date: 2024-11-05TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210514948.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-26
Publication Date
2024-11-05
Estimated Expiration
2039-08-26

AI Technical Summary

Technical Problem

The existing encoder has limitations in encoding mode when encoding, resulting in poor quality of decoded images and frequent switching of encoding modes, so it is impossible to flexibly select the encoding mode.

Method used

Provide a data decoding and encoding method, allowing flexible selection of encoding modes in the encoding unit. The candidate encoding mode includes intra-block copy encoding mode, and determine the set of candidate encoding modes by obtaining the encoding mode restriction type in the encoded data, and according to the target Encoding mode for decoding or encoding.

Benefits of technology

It achieves accurate decoding or encoding data in the target encoding mode, improves image quality, and avoids the instability caused by frequent switching of encoding modes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114979630B_ABST
    Figure CN114979630B_ABST
Patent Text Reader

Abstract

The present application relates to a data decoding method, device and a data encoding method, device, the data decoding method comprising: obtaining a coding mode restriction type of a coding tree unit; the coding tree unit comprises a plurality of sub-coding units; for a unit to be decoded corresponding to a sub-coding unit, when the coding mode restriction type is an inter-frame coding mode restriction type or when the coding mode restriction type is an intra-frame coding mode restriction type, determining a candidate coding mode set corresponding to the unit to be decoded according to the coding mode restriction type, the candidate coding mode set at least comprising an intra-frame block copy coding mode; when the coding mode restriction type is a standard inter-frame coding mode restriction type, determining that the candidate coding mode set corresponding to the unit to be decoded only comprises a standard inter-frame coding mode; decoding the unit to be decoded according to a target coding mode selected from the candidate coding mode set to obtain corresponding decoded data. The method can improve the accuracy of data decoding.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application was submitted to the China Patent Office on August 26, 2019, with application number 2019107924499. The name of the invention is a divisional application of "Data decoding method, device and data encoding method, device", all of which are incorporated by reference in this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a data decoding method, apparatus, computer-readable storage medium and computer equipment, and a data encoding method, apparatus, computer-readable storage medium and computer equipment. Background Art

[0003] With the development of digital media technology and computer technology, video is applied to various fields, such as mobile communication, network TV, etc. With the improvement of hardware performance and screen resolution, users' demand for high-definition video is becoming increasingly strong.

[0004] When the current encoder encodes the current coding unit, there is a restriction on the coding mode. The current coding unit can only use the intra-frame coding mode or the inter-frame coding mode, and the coding mode needs to be frequently switched according to the restriction type of the coding mode. This restriction of the coding mode easily leads to poor quality of the decoded image unit. Summary of the invention

[0005] Based on this, it is necessary to provide a data decoding method, device, computer-readable storage medium and computer equipment, as well as a data encoding method, device, computer-readable storage medium and computer equipment for the above technical problems. When the encoding unit is encoded, the encoding mode restriction type can be flexibly selected, and the candidate encoding mode corresponding to the encoding mode restriction type is not limited to one, and the candidate encoding mode includes an intra-frame block copy encoding mode, so the selection range of determining the target encoding mode corresponding to the encoding unit from at least one candidate encoding mode is larger, and encoding in the target encoding mode can obtain accurate encoded data. In addition, when decoding the unit to be decoded, it can be flexibly decoded according to the target encoding mode, and accurate decoded data corresponding to the unit to be decoded can be obtained.

[0006] A data decoding method, comprising:

[0007] Obtain the encoded data corresponding to the current unit to be decoded;

[0008] Decoding the encoded data to obtain the encoding mode restriction type corresponding to the current unit to be decoded;

[0009] Determine a candidate coding mode set corresponding to the current unit to be decoded according to the coding mode restriction type, where the candidate coding mode set at least includes an intra-block copy coding mode;

[0010] The current unit to be decoded is decoded according to the target coding mode selected from the candidate coding mode set to obtain corresponding decoded data.

[0011] A data decoding device, the device comprising:

[0012] A coding data acquisition module is used to acquire the coding data corresponding to the current unit to be decoded;

[0013] A coding data parsing module, used for decoding from the coded data to obtain the coding mode restriction type corresponding to the current unit to be decoded;

[0014] A target coding mode determination module, used to determine a candidate coding mode set corresponding to a current unit to be decoded according to a coding mode restriction type, wherein the candidate coding mode set at least includes an intra-block copy coding mode;

[0015] The decoding data generation module is used to decode the current unit to be decoded according to the target coding mode selected from the candidate coding mode set to obtain corresponding decoding data.

[0016] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the following steps are implemented:

[0017] Obtain the encoded data corresponding to the current unit to be decoded;

[0018] Decoding the encoded data to obtain the encoding mode restriction type corresponding to the current unit to be decoded;

[0019] Determine a candidate coding mode set corresponding to the current unit to be decoded according to the coding mode restriction type, where the candidate coding mode set at least includes an intra-block copy coding mode;

[0020] The current unit to be decoded is decoded according to the target coding mode selected from the candidate coding mode set to obtain corresponding decoded data.

[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:

[0022] Obtain the encoded data corresponding to the current unit to be decoded;

[0023] Decoding the encoded data to obtain the encoding mode restriction type corresponding to the current unit to be decoded;

[0024] Determine a candidate coding mode set corresponding to the current unit to be decoded according to the coding mode restriction type, where the candidate coding mode set at least includes an intra-block copy coding mode;

[0025] The current unit to be decoded is decoded according to the target coding mode selected from the candidate coding mode set to obtain corresponding decoded data.

[0026] The above-mentioned data decoding method, device, computer-readable storage medium and computer equipment obtain the coded data corresponding to the current unit to be decoded, parse the coded data to obtain the coding mode restriction type corresponding to the current unit to be decoded, determine the target coding mode corresponding to the current unit to be decoded according to the coding mode restriction type, the target coding mode is one of the candidate coding modes, and the candidate coding modes include the intra-frame block copy coding mode, and decode the current unit to be decoded according to the target coding mode to obtain the corresponding decoded data. Therefore, when decoding, under the coding mode restriction type, the decoding can be flexibly performed according to the target coding mode, and the accurate decoded data corresponding to the unit to be decoded can be obtained.

[0027] A data encoding method, comprising:

[0028] Get the current encoding unit;

[0029] Obtaining a coding mode restriction type corresponding to a current coding unit, wherein a candidate coding mode set corresponding to the coding mode restriction type includes an intra block copy coding mode;

[0030] The current coding unit is encoded according to the coding mode restriction type, a target coding mode corresponding to the current coding unit is determined from a candidate coding mode set, and coding data corresponding to the current coding unit is obtained according to the target coding mode.

[0031] In one of the embodiments, when the coding mode restriction type is an intra-frame coding mode restriction type, the candidate coding modes corresponding to the intra-frame coding mode restriction type include an intra-frame block copy coding mode and a standard intra-frame coding mode.

[0032] In one of the embodiments, when the intra-frame coding mode restriction type includes the intra-frame block copy coding mode, the candidate coding modes corresponding to the inter-frame coding mode restriction type do not include the intra-frame block copy coding mode.

[0033] In one of the embodiments, when the coding mode restriction type is an inter-frame coding mode restriction type, the candidate coding modes corresponding to the inter-frame coding mode restriction type include an intra-block copy coding mode and a standard inter-frame coding mode.

[0034] In one of the embodiments, when the inter-frame coding mode restriction type includes the intra-frame block copy coding mode, the candidate coding modes corresponding to the intra-frame coding mode restriction type do not include the intra-frame block copy coding mode.

[0035] In one of the embodiments, when the coding mode restriction type is an intra block copy coding mode restriction type, the candidate coding modes corresponding to the intra block copy coding mode restriction type only include the intra block copy coding mode.

[0036] In one of the embodiments, the coding mode restriction type further includes a standard intra-frame coding mode restriction type, and the candidate coding modes corresponding to the standard intra-frame coding mode restriction type only include the standard intra-frame coding mode.

[0037] In one of the embodiments, the coding mode restriction type further includes a standard inter-frame coding mode restriction type, and the candidate coding modes corresponding to the standard inter-frame coding mode restriction type only include the standard inter-frame coding mode.

[0038] A data encoding device, comprising:

[0039] A current coding unit acquisition module is used to acquire the current coding unit;

[0040] A coding mode restriction type acquisition module, used to acquire a coding mode restriction type corresponding to a current coding unit, wherein a candidate coding mode set corresponding to the coding mode restriction type includes an intra-block copy coding mode;

[0041] The current coding unit encoding module is used to encode the current coding unit according to the coding mode restriction type, determine the target coding mode corresponding to the current coding unit from the candidate coding mode set, and obtain the coding data corresponding to the current coding unit according to the target coding mode.

[0042] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the following steps are implemented:

[0043] Get the current encoding unit;

[0044] Obtaining a coding mode restriction type corresponding to a current coding unit, wherein a candidate coding mode set corresponding to the coding mode restriction type includes an intra block copy coding mode;

[0045] The current coding unit is encoded according to the coding mode restriction type, a target coding mode corresponding to the current coding unit is determined from a candidate coding mode set, and coding data corresponding to the current coding unit is obtained according to the target coding mode.

[0046] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:

[0047] Get the current encoding unit;

[0048] Obtaining a coding mode restriction type corresponding to a current coding unit, wherein a candidate coding mode set corresponding to the coding mode restriction type includes an intra block copy coding mode;

[0049] The current coding unit is encoded according to the coding mode restriction type, a target coding mode corresponding to the current coding unit is determined from a candidate coding mode set, and coding data corresponding to the current coding unit is obtained according to the target coding mode.

[0050] The above-mentioned data encoding method, apparatus, computer-readable storage medium and computer equipment obtain the current coding unit, obtain the coding mode restriction type corresponding to the current coding unit, the candidate coding mode corresponding to the coding mode restriction type includes the intra-frame block copy coding mode, encode the current coding unit according to the coding mode restriction type, determine the target coding mode corresponding to the current coding unit from the candidate coding mode, and obtain the coding data corresponding to the current coding unit according to the target coding mode. When encoding the coding unit, the coding mode restriction type can be flexibly selected, the candidate coding mode corresponding to the coding mode restriction type is not limited to one, and the candidate coding mode includes the intra-frame block copy coding mode, so the selection range of determining the target coding mode corresponding to the coding unit from at least one candidate coding mode is larger, and encoding in the target coding mode can obtain accurate coding data. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A diagram of an application environment of a data decoding method or a data encoding method in an embodiment;

[0052] Figure 2 A decoding framework diagram corresponding to a data decoding method in an embodiment;

[0053] Figure 3 A coding framework diagram corresponding to a data coding method in an embodiment;

[0054] Figure 4 A schematic diagram of dividing the current coding unit in one embodiment;

[0055] Figure 5 is a flow chart of a data decoding method in one embodiment;

[0056] Figure 5A is a schematic diagram of the structure of a coding tree unit in one embodiment;

[0057] Figure 6 A schematic flow chart of a target coding mode selection step in one embodiment;

[0058] Figure 7 A schematic flow chart of a target coding mode selection step in another embodiment;

[0059] Figure 8 A schematic flow chart of a target coding mode selection step in yet another embodiment;

[0060] Fig. 9 A schematic diagram of a flow chart of a data decoding step in an embodiment;

[0061] Fig.10 is a schematic flow chart of a data encoding method in one embodiment;

[0062] Fig.11 is a flow chart of a data encoding method in another embodiment;

[0063] Fig.12 A schematic diagram of a flow chart of a coding data generation step in one embodiment;

[0064] Fig.13 is a structural block diagram of a data decoding device in one embodiment;

[0065] Fig.14 It is a structural block diagram of a target coding mode selection module in another embodiment;

[0066] Fig.15 A structural block diagram of a decoding data generating module in one embodiment;

[0067] Fig.16 is a structural block diagram of a data encoding device in one embodiment;

[0068] Fig.17 is a structural block diagram of a data encoding device in another embodiment;

[0069] Fig.18 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION

[0070] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0071] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first flag bit may be referred to as a second flag bit, and similarly, a second flag bit may be referred to as a first flag bit.

[0072] Figure 1 FIG. 1 is an application environment diagram of a data decoding method in an embodiment. Figure 1, the data decoding method is applied to a data decoding system. The data decoding system includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected via a network. The terminal 110 can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, a tablet computer, a laptop computer, etc. The server 120 can be implemented by an independent server or a server cluster composed of multiple servers.

[0073] In another embodiment, Figure 1 It can also be an application environment diagram of a data encoding method in an embodiment, where the data encoding method is applied to a data encoding system. The data encoding system also includes a terminal 110 and a server 120.

[0074] The data decoding method and the data encoding method can be completed in the terminal 110 or the server 120. The terminal 110 can encode the encoding unit using the data encoding method provided in the embodiment of the present application, and then send the encoded data to the server 120, or receive the encoded data from the server 120 and decode it to obtain a decoded image unit. The server 120 can encode the encoding unit, and the data encoding method is completed in the server 120 at this time. If the server 120 needs to decode the encoded data, the data decoding method is completed in the server 120. Of course, the server 120 can also send the encoded data sent by the terminal 110 to the corresponding receiving terminal after receiving it, and the receiving terminal will decode it.

[0075] Figure 2 The decoding framework diagram corresponding to the data decoding method provided in an embodiment is shown in FIG. 2 . The data decoding method provided in the embodiment of the present application can obtain the coded data corresponding to one or more coded units through the coded data acquisition unit 200, and obtain the coding mode restriction type through the coded data parsing unit 202 by parsing the received coded data, and then determine the corresponding target coding mode according to the coding mode restriction type through the coded data parsing unit 202, and then parse the coded data through the coded data parsing unit 202 to obtain block vector information and residual information. After the entropy decoding unit 204 performs entropy decoding on the residual information, entropy decoding data is obtained, the inverse quantization unit 206 performs inverse quantization on the entropy decoding data to obtain inverse quantized data, and the inverse transformation unit 208 performs inverse transformation on the inverse quantized data to obtain spatial residual information. The prediction unit 210 determines the corresponding prediction information according to the block vector information, which can be specifically obtained by obtaining the current vector information, determining the reference block position according to the current vector information and the block vector information, and determining the prediction information according to the reference block position. The reconstruction unit 212 reconstructs according to the spatial residual information and the prediction information to obtain a reconstructed image unit. The playback storage unit can play or store the reconstructed image unit, or play and store it.

[0076] Figure 3 The data encoding method provided in an embodiment is a coding framework diagram corresponding to the data encoding method provided in the embodiment of the present application. The data encoding method provided in the embodiment of the present application can obtain the current coding unit through the coding unit acquisition unit 300. At the decision unit 302, the coding mode restriction type of the current coding unit can be decided to obtain the coding mode restriction type corresponding to the current coding unit. At the processing unit 304, the current coding unit is encoded according to the coding mode restriction type, and the target coding mode corresponding to the current coding unit is determined from the candidate coding modes corresponding to the coding mode restriction type. The coding data corresponding to the current coding unit is obtained according to the target coding mode. Finally, the coded data is stored or sent through the storage and sending unit 306, or the coded data is stored and sent.

[0077] It can be understood that the above-mentioned encoding framework diagram and decoding framework diagram are only examples and do not constitute a limitation on the data encoding method or data decoding method to which the present application scheme is applied. The specific encoding framework diagram and decoding framework diagram may include more or fewer units than those shown in the diagram, or combine certain units, or have different component units. For example, loop filtering can also be performed on the decoded image unit to reduce the block effect of the decoded image unit to improve the video quality.

[0078] The current coding unit can be divided into multiple sub-coding units, and the size of the sub-coding units can be set or calculated as needed. For example, the size of the sub-coding units can be 8*8 pixels. Alternatively, the rate-distortion cost corresponding to the division method of various sub-coding units can be calculated, and the division method with the smallest rate-distortion cost can be selected to divide the sub-coding units. Figure 4 The figure shows a schematic diagram of the division of a 64*64 pixel current coding unit, where a square represents a sub-coding unit. Figure 4 It can be seen that the size of the sub-coding unit can include 32*32 pixels, 16*16 pixels, 8*8 pixels and 4*4 pixels. Of course, the size of the sub-coding unit can also be other sizes, for example, it can be 32*16 pixels or 64*64 pixels. It can be understood that during decoding, since the sub-coding unit corresponds to the unit to be decoded one by one, the pixel size of the unit to be decoded can also include 32*32 pixels, 16*16 pixels, 8*8 pixels and 4*4 pixels, etc.

[0079] like Figure 5 As shown, in one embodiment, a data decoding method is provided. This embodiment mainly applies this method to the above Figure 1 The terminal 110 or the server 120 in FIG. Figure 5 , the data decoding method specifically includes the following steps:

[0080] Step 502: Obtain the coded data corresponding to the current unit to be decoded.

[0081] Among them, the current unit to be decoded refers to the decoding unit currently being decoded, and the decoding unit corresponds to the coding unit. The coding unit (CodingUnit, CU) is a sub-block of the coding tree unit (Coding Tree Unit, CTU), that is, the coding unit is the unit that constitutes the coding tree unit, and the coding tree unit is a structure divided by a quad or binary tree, and is divided recursively layer by layer. Finally, a coding tree unit CTU can be composed of several coding units. Figure 5A As shown, Figure 5A A schematic diagram showing the structure of a coding tree unit in one embodiment is shown. Figure 5A Each small block in the final leaf node is a coding unit, and the coding tree unit is the entire set (the entire large block) composed of each coding unit. Figure 5A The pixel size of the largest block in the CNN is 16*32, but generally speaking, the pixel size of the coding tree unit is 64*64 or 128*128. It should be noted that Figure 5A The pictures shown are only for understanding the tree-like partitioning structure of the coding tree unit. Figure 5A The number in indicates whether this node will continue to be split. If this node will continue to be split, it is 1, and if it will not continue to be split, it is 0. Coding may include at least one of prediction, transformation, quantization and entropy coding. The coded data is the data obtained by encoding the coding unit. When the current coding unit is encoded, the coded data will be generated. The current coding unit here refers to the coding unit currently being encoded. The encoding process may be to first obtain the current coding unit, decide the coding mode restriction type corresponding to the current coding unit, and there are corresponding candidate coding modes for the coding mode restriction type. Then, according to the decided coding mode restriction type, the coding mode flag information corresponding to the current coding unit is determined, and the target coding mode corresponding to the current coding unit is determined according to the coding mode restriction type and the flag information. Finally, the coded data is obtained according to the target coding mode. That is, the coded data includes but is not limited to the coding mode restriction type and the syntax elements corresponding to the target coding mode.

[0082] Step 504: Decode the encoded data to obtain the encoding mode restriction type corresponding to the current unit to be decoded.

[0083] The coded data may carry a coding mode restriction type, where the coding mode restriction type refers to the type of coding mode restriction, which is used to limit whether the coding mode of the coding unit will be restricted to a specific coding mode. There are corresponding candidate coding modes for each coding mode restriction type, that is, after parsing the coded data corresponding to the current unit to be decoded to obtain the corresponding coding mode restriction type, the coding mode of the current unit to be decoded can only be at least one of the candidate coding modes corresponding to the coding mode restriction type. In the data decoding process, the encoding end has already decided that the coded data carries the coding mode restriction type, and the decoding end only needs to parse to obtain the coding mode restriction type carried in the coded data.

[0084] In one embodiment, during the data encoding process, the coding mode restriction type can determine whether it is an intra-frame coding mode restriction type, an inter-frame coding mode restriction type, or an intra-frame block copy coding mode restriction type. The candidate coding modes corresponding to the intra-frame coding mode restriction type are the standard intra-frame coding mode and the intra-frame block copy coding mode. The candidate coding mode corresponding to the inter-frame coding mode restriction type is the standard inter-frame coding mode. The candidate coding mode corresponding to the intra-frame block copy coding mode restriction type is the intra-frame block copy coding mode. The standard intra-frame coding mode here refers to the intra-frame coding mode of the prior art. Similarly, the standard inter-frame coding mode refers to the inter-frame coding mode of the prior art, and the intra-frame block copy coding mode is similar to the standard inter-frame coding mode, but the difference is that the reference block information of the standard inter-frame coding mode comes from the reference frame, while the reference block information of the intra-frame block copy coding mode comes from the current frame.

[0085] Specifically, a flag root_cu_mode used to describe the coding mode restriction type can be added to the encoded data, that is, a syntax element describing the coding mode restriction type is added to the encoded data, and the value corresponding to the flag of the coding mode restriction type can be set to the name corresponding to the coding mode restriction type. For example, if the coding mode restriction type is an intra-frame coding mode restriction type, the syntax in the encoded data is: root_cu_mode = 'PRED_Intra_only'.

[0086] Furthermore, in the encoding process, after the encoding mode restriction type is determined, because the intra-block copy encoding mode is added to the candidate encoding modes corresponding to the encoding mode restriction type, a flag bit needs to be added, and the corresponding target encoding mode is further determined by the flag bit value corresponding to the flag bit. Among them, when the candidate encoding mode corresponding to the encoding mode restriction type can only be the intra-block copy encoding mode, there is no need to add a flag bit, and the corresponding target encoding mode can be directly determined to be the intra-block copy encoding mode.

[0087] For example, when the coding mode restriction type is the intra-frame coding mode restriction type, the candidate coding modes are the standard intra-frame coding mode and the intra-frame block copy coding mode, so ibc_flag can be added to the encoded data. ibc_flag is the intra-frame block copy coding mode flag information. Since the coding mode restriction type is the intra-frame coding mode restriction type, and the intra-frame coding mode restriction type includes the intra-frame block copy coding mode, ibc_flag needs to be added to the encoded data. However, when the coding mode in the intra-frame coding mode restriction type is the standard intra-frame coding mode, ibc_flag=0, and when the coding mode in the intra-frame coding mode restriction type is the intra-frame block copy coding mode, ibc_flag=1. When the coding mode restriction type is the inter-frame coding mode restriction type, and the inter-frame coding mode restriction type is the standard inter-frame coding mode, the syntax in the encoded data is: root_cu_mode = 'PRED_Inter_only'. Since the coding mode restriction type of the current coding unit is the inter-frame coding mode restriction type, the current coding unit can only be the standard inter-frame coding mode. There is no need to add the intra-frame block copy flag information ibc_flag to the encoded data. The syntax elements corresponding to the standard inter-frame coding mode, such as skip_flag, are directly added to the encoded data.

[0088] Furthermore, when the coding mode restriction type is the intra block copy coding mode restriction type, the coding mode of the current coding unit can only be the intra block copy coding mode, so there is no need to transmit and decode the intra block copy flag information ibc_flag. At this time, the syntax in the coded data is: root_cu_mode = 'PRED_Ibc_only'.

[0089] In this embodiment, the coding mode restriction type may also be a standard intra-frame coding mode restriction type, and the coding mode of the standard intra-frame coding mode restriction type may only be a standard intra-frame coding mode, so there is no need to add ibc_flag as a syntax element to the coded data. In another embodiment, during the data coding process, the coding mode restriction type may be determined to be an intra-frame coding mode restriction type, an inter-frame coding mode restriction type, or an intra-frame block copy coding mode restriction type, and the candidate coding mode corresponding to the intra-frame coding mode restriction type is a standard intra-frame coding mode, and the candidate coding mode corresponding to the inter-frame coding mode restriction type is a standard inter-frame coding mode and an intra-frame block copy coding mode, and the candidate coding mode corresponding to the intra-frame block copy coding mode restriction type is an intra-frame block copy coding mode.

[0090] Specifically, when the coding mode restriction type is the intra-frame coding mode restriction type, because the coding mode of the current coding unit can only be the standard intra-frame coding mode, there is no need to transmit the intra-frame block copy flag information ibc_flag, and the syntax elements corresponding to the standard intra-frame coding mode are directly added to the encoded data.

[0091] When the coding mode restriction type is the inter-frame coding mode restriction type, the coding mode of the current coding unit may be the standard inter-frame coding mode or the intra-frame block copy coding mode. Therefore, it is necessary to transmit the intra-frame block copy flag as the information ibc_flag. Specifically, the standard inter-frame coding mode and the intra-frame block copy coding mode are distinguished by the value corresponding to ibc_flag, such as ibc_flag=0 for the standard inter-frame coding mode, and ibc_flag=1 for the intra-frame block copy coding mode.

[0092] When the coding mode restriction type is an intra-frame block copy coding mode restriction type, the coding mode of the current coding unit may only be an intra-frame block copy coding mode, so there is no need to transmit and decode the intra-frame block copy flag information ibc_flag. In this embodiment, the coding mode restriction type may also be a standard inter-frame coding mode restriction type, and the coding mode of the standard inter-frame coding mode restriction type may only be a standard inter-frame coding mode, so there is no need to add ibc_flag as a syntax element to the coded data.

[0093] Therefore, during the data decoding process, the coded data corresponding to the current unit to be decoded is obtained, and the coded data can be parsed to obtain the coding mode restriction type in the coded data. Specifically, it can be obtained by parsing the syntax in the coded data by the decoder. For example, if the syntax in the coded data is: root_cu_mode = 'PRED_Inter_only', the coding mode restriction type parsed by the decoder is the inter-frame coding mode restriction type.

[0094] In another embodiment, in the process of encoding data processing, the encoding mode restriction type can determine the intra-frame encoding mode restriction type, the inter-frame encoding mode restriction type, and the intra-frame block copy encoding mode restriction type. The intra-frame encoding mode restriction type, the inter-frame encoding mode restriction type, and the intra-frame block copy encoding mode restriction type are independent of each other. The candidate encoding mode corresponding to the intra-frame encoding mode restriction type is the standard intra-frame encoding mode, the candidate encoding mode corresponding to the inter-frame encoding mode restriction type is the standard inter-frame encoding mode, and the candidate encoding mode corresponding to the intra-frame block copy encoding mode restriction type is the intra-frame block copy encoding mode. In this case, there is no need to add a flag bit, such as the intra-frame block copy encoding mode flag bit information ibc_flag, during the encoding process. Therefore, there is no need to read the flag bit during the decoding process.

[0095] In one embodiment, during the coding data processing, the number of final decisions of the coding mode restriction types may be determined by the hardware manufacturer, and the specific number of the coding mode restriction types exemplified in this application is not limited by this application. For example, in some embodiments, there may be two types of coding mode restriction types, which may be a combination of an intra-frame coding mode restriction type and an inter-frame coding mode restriction type, or a combination of one of the intra-frame coding mode restriction type and the inter-frame coding mode restriction type with an intra-frame block copy coding mode restriction type, and so on.

[0096] Step 506: Determine a candidate coding mode set corresponding to the current unit to be decoded according to the coding mode restriction type, where the candidate coding mode set at least includes an intra block copy coding mode.

[0097] Specifically, after parsing the coding data to obtain the coding mode restriction type, determine whether it is necessary to read the coding mode flag related to the intra-frame block copy coding mode according to the coding mode restriction type. If it is necessary to read, after reading the coding mode flag related to the intra-frame block copy coding mode, determine the candidate coding mode set according to the coding mode flag. Among them, the candidate coding mode set includes at least the intra-frame block coding mode, and the candidate coding mode set may also include one of the standard intra-frame coding mode and the standard inter-frame coding mode. For example, when the coding mode restriction type is the intra-frame coding mode restriction type, the corresponding candidate coding mode set includes the intra-frame block copy coding mode and the standard intra-frame coding mode. Or, for another example, when the coding mode restriction type is the inter-frame coding mode restriction type, the corresponding candidate coding mode set includes the intra-frame block copy coding mode and the standard inter-frame coding mode.

[0098] Furthermore, the target coding mode is selected from the candidate coding mode set according to the value corresponding to the coding mode flag. If it is not necessary to read the coding mode flag, the target coding mode can be directly determined. The flag related to the intra-frame block copy coding mode can be the intra-frame block copy coding mode flag information ibc_flag. For example, the coding mode restriction type obtained by parsing the coded data is the intra-frame coding mode restriction type, root_cu_mode = 'PRED_Intra_only', and then determine whether it is necessary to read the flag ibc_flag related to the intra-frame block copy coding mode from the coded data. If it is not necessary to read ibc_flag, it can be directly determined that the coding mode corresponding to the intra-frame coding mode restriction type can only be the standard intra-frame coding mode, and the target coding mode corresponding to the current unit to be decoded is the standard intra-frame coding mode. If it is necessary to read ibc_flag, it means that the coding mode corresponding to the intra-frame coding mode restriction type may be the standard intra-frame coding mode or the intra-frame block copy coding mode, and then further read the value of the flag bit ibc_flag to determine the target coding mode. If the value of ibc_flag is 0, the target coding mode is the standard intra-frame coding mode, and the value of ibc_flag is 1, then the target coding mode is the intra-frame block copy coding mode.

[0099] For another example, the coding mode restriction type obtained by parsing the coded data is the intra block copy coding mode restriction type, root_cu_mode = 'PRED_Ibc_only'. Since it is known in advance that the coding mode corresponding to the intra block copy coding mode restriction type can only be the intra block copy coding mode, there is no need to read the flag ibc_flag related to the intra block copy coding mode. Therefore, it can be directly determined that the target coding mode corresponding to the current unit to be decoded can only be the intra block copy coding mode.

[0100] Step 508: decode the current unit to be decoded according to the target coding mode selected from the candidate coding mode set to obtain corresponding decoded data.

[0101] Specifically, after determining the target coding mode corresponding to the current unit to be decoded, the current unit to be decoded is decoded according to the target coding mode, and specifically, the current unit to be decoded is decoded according to the decoding method corresponding to the target coding mode to obtain corresponding decoded data. Decoding may include at least one of prediction, inverse transformation, inverse quantization and entropy decoding, which may be specifically determined according to the encoding process.

[0102] In one embodiment, when the target coding mode is an intra-frame block copy coding mode, first, the coded data is parsed to obtain block vector information and residual information. Next, the residual information is entropy decoded to obtain entropy decoded data. The entropy decoded data is then inversely quantized to obtain inverse quantized data, and the inverse quantized data is further inversely transformed to obtain spatial domain residual information. Further, the corresponding prediction information is determined according to the block vector information, specifically, the current vector information can be obtained, the reference block position can be determined according to the current vector information and the block vector information, and the prediction information can be determined according to the reference block position. Finally, reconstruction is performed according to the spatial domain residual information and the prediction information to obtain a reconstructed image unit, thereby obtaining decoded data. Further, after obtaining the reconstructed image unit, in order to reconstruct the quality of the image unit, the reconstructed image unit can be further processed, such as sampling processing, and the sampling processing can be upsampling processing, so as to obtain the final image unit.

[0103] The above data decoding method obtains the coded data corresponding to the current unit to be decoded, parses the coded data to obtain the coding mode restriction type corresponding to the current unit to be decoded, determines the target coding mode corresponding to the current unit to be decoded according to the coding mode restriction type, the target coding mode is one of the candidate coding modes, and the candidate coding modes include the intra-frame block copy coding mode, and decodes the current unit to be decoded according to the target coding mode to obtain the corresponding decoded data. Therefore, when decoding, under the coding mode restriction type, the decoding can be flexibly performed according to the target coding mode, and the accurate decoded data corresponding to the unit to be decoded can be obtained.

[0104] In one embodiment, Figure 6 As shown, the steps of selecting the target encoding mode include:

[0105] Step 602: Decode the encoded data to obtain the encoding mode flag information corresponding to the current unit to be decoded.

[0106] Among them, the coding mode flag information here refers to the flag related to the intra-frame block copy coding mode, that is, the syntax elements used to describe the intra-frame block copy coding mode are added to the encoded data. Further, the target coding mode corresponding to the current unit to be decoded can be determined according to the value corresponding to the coding mode flag information.

[0107] Specifically, the encoded data can be parsed by the decoder to obtain the encoding mode restriction type corresponding to the current unit to be decoded, and then determine whether it is necessary to read the encoding mode flag information related to the intra-frame block copy encoding mode according to the encoding mode restriction type. If reading is required, read the encoding mode flag information corresponding to the current unit to be decoded, such as ibc_flag.

[0108] Among them, the intra-frame block copy coding mode flag information ibc_flag exists only when the candidate coding modes corresponding to the coding mode restriction type include the intra-frame block copy coding mode. The target coding mode corresponding to the current unit to be decoded can be further determined according to the value corresponding to ibc_flag. If the parsed result is ibc_flag=1, the target coding mode corresponding to the current unit to be decoded is the intra-frame block copy coding mode.

[0109] During the encoding process, when the coding mode restriction type is the intra block copy coding mode restriction type, since the coding mode corresponding to the intra block copy coding mode restriction type can only be the intra block copy coding mode, there is no need to add the intra block copy coding mode flag information ibc_flag to the encoded data. Therefore, when the decoding obtained the coding mode restriction type is the intra block copy coding mode restriction type, there is no need to read the coding mode flag information ibc_flag related to the intra block copy coding mode.

[0110] In one embodiment, the syntax in the encoded data is:

[0111] root_cu_mode='PRED_Intra_only';

[0112] ibc_flag=1;

[0113] Specifically, the decoder decodes the encoded data to obtain that the encoding mode restriction type corresponding to the current unit to be decoded is the intra-frame encoding mode restriction type. Because it is known in advance that the encoding mode corresponding to the intra-frame encoding mode restriction type may be the standard intra-frame encoding mode, or the intra-frame block copy encoding mode, it is necessary to read the intra-frame block copy encoding mode flag information ibc_flag from the encoded data, and then further read the value corresponding to the intra-frame block copy encoding mode flag information ibc_flag to determine the target encoding mode. When the value corresponding to ibc_flag is parsed to be 1, it can be determined that the target encoding mode corresponding to the current unit to be decoded is the intra-frame block copy encoding mode.

[0114] Step 604: determine the target coding mode corresponding to the current unit to be decoded according to the coding mode restriction type and the coding mode flag information.

[0115] Specifically, after parsing and obtaining the coding mode restriction type and coding mode flag information corresponding to the current unit to be decoded, the target coding mode corresponding to the current unit to be decoded can be determined according to the coding mode flag information. Specifically, the target coding mode corresponding to the current unit to be decoded can be determined according to the value corresponding to the flag information.

[0116] In one embodiment, the syntax in the encoded data is:

[0117] root_cu_mode='PRED_Inter_only';

[0118] ibc_flag=0;

[0119] Specifically, the decoder decodes the encoded data and obtains that the encoding mode restriction type corresponding to the current unit to be decoded is the inter-frame encoding mode restriction type. Because it is known in advance that the encoding mode corresponding to the inter-frame encoding mode restriction type may be the standard inter-frame encoding mode or the intra-frame block copy encoding mode, it is necessary to read the intra-frame block copy encoding mode flag information ibc_flag. Further, the value corresponding to the intra-frame block copy encoding mode flag information ibc_flag is read to determine the final target encoding mode. After parsing ibc_flag as 0, it can be determined that the target encoding mode corresponding to the current unit to be decoded is the standard inter-frame encoding mode.

[0120] In another embodiment, the syntax in the encoded data is:

[0121] root_cu_mode='PRED_Inter_only';

[0122] skip_flag;

[0123] Specifically, the decoder decodes the coded data to obtain that the coding mode restriction type corresponding to the current unit to be decoded is the inter-frame coding mode restriction type. Since it is known in advance that the coding mode corresponding to the inter-frame coding mode restriction type can only be the standard inter-frame coding mode, there is no intra-frame block copy coding mode flag information ibc_flag in the coded data, so it does not need to be read. The coded data can be parsed to obtain the skip mode flag information as skip_flag. In this embodiment, skip_flag is the coding mode flag information unique to the standard inter-frame coding mode.

[0124] In yet another embodiment, the syntax in the encoded data is:

[0125] root_cu_mode='PRED_Ibc_only';

[0126] Specifically, the decoder decodes the encoded data to obtain that the encoding mode restriction type corresponding to the current unit to be decoded is the intra-frame block copy encoding mode restriction type. Because it is known in advance that the encoding mode corresponding to the intra-frame block copy encoding mode restriction type can only be the intra-frame block copy encoding mode, there is no need to read the intra-frame block copy coding mode flag information ibc_flag, and it can be directly determined that the target encoding mode corresponding to the current unit to be decoded is the intra-frame block copy coding mode.

[0127] In one embodiment, Figure 7 As shown, the coding mode restriction type is an intra-frame coding mode restriction type, and the target coding mode corresponding to the current unit to be decoded is determined according to the coding mode restriction type and the coding mode flag information, including:

[0128] Step 702: When the value corresponding to the coding mode flag information is the first flag value, the target coding mode is the standard intra-frame coding mode.

[0129] Step 704: When the value corresponding to the coding mode flag information is the second flag value, the target coding mode is the intra block copy coding mode.

[0130] Among them, when the coding mode restriction type is an intra-frame coding mode restriction type, the candidate coding modes corresponding to the intra-frame coding mode restriction type at this time include a standard intra-frame coding mode and an intra-frame block copy coding mode. After the decoder decodes the coded data corresponding to the current unit to be decoded and obtains the coding mode restriction type corresponding to the current unit to be decoded, the target coding mode can be determined according to the value corresponding to the coding mode flag information read in the current coded data. The target coding mode is one of the candidate coding modes corresponding to the coding mode restriction type. Specifically, the target coding mode can be determined according to the flag value corresponding to the coding mode flag information parsed by the decoder.

[0131] For example, the decoder parses the root_cu_mode syntax element in the encoded data to learn the coding mode restriction type. By reading the ibc_flag syntax element in the encoded data, it can be learned that the coding mode restriction type includes the intra-frame block copy coding mode. Then, by reading the flag value corresponding to the ibc_flag syntax element, it can be determined whether the coding mode is the intra-frame block copy coding mode or the standard intra-frame coding mode.

[0132] Among them, the first flag value and the second flag value here are both values ​​corresponding to the coding mode flag information, which are used to determine the target coding mode from the candidate coding modes corresponding to the coding mode restriction type. The first flag value here can be used to determine that the target coding mode is a standard intra-frame coding mode, that is, when the decoder reads the value corresponding to the coding mode flag information as the first flag value, the target coding mode is a standard intra-frame coding mode. The second flag value can be used to determine that the target coding mode is an intra-frame block copy coding mode, that is, when the decoder reads the value corresponding to the coding mode flag information as the second flag value, the target coding mode is an intra-frame block copy coding mode, wherein the first flag value and the second flag value can be set according to actual needs.

[0133] For example, the coding mode flag information is the intra-frame block copy coding mode flag information ibc_flag, and the first flag value can be set to 0 to indicate that the coding mode is the standard intra-frame coding mode, then the syntax in the coded data is: ibc_flag=0, then the decoder parses and obtains that the coding mode restriction type of the current unit to be decoded is the intra-frame coding mode restriction type, and the target coding mode is the standard intra-frame coding mode. Similarly, the second flag value can be set to 1 to indicate that the coding mode is the intra-frame block copy coding mode, then the syntax in the coded data is: ibc_flag=1, then the decoder parses and obtains that the coding mode restriction type of the current unit to be decoded is the intra-frame coding mode restriction type, and the target coding mode is the intra-frame block copy coding mode.

[0134] In one embodiment, during the encoding process, the syntax in the encoded data is set to: root_cu_mode = 'PRED_Intra_only', ibc_flag = 0, then the encoding mode restriction type obtained by the decoder from decoding the encoded data is an intra-frame encoding mode restriction type, and the candidate encoding modes of the intra-frame encoding mode restriction type include an intra-frame block copy encoding mode, but since the flag value corresponding to the intra-frame block copy encoding mode flag information ibc_flag obtained by parsing is 0, it can be determined that the target encoding mode is a standard intra-frame encoding mode.

[0135] Similarly, if the syntax in the encoded data is set to: root_cu_mode = 'PRED_Intra_only', ibc_flag = 1, the coding mode restriction type obtained by the decoder when decoding the encoded data is an intra-frame coding mode restriction type, and the candidate coding modes of the intra-frame coding mode restriction type include the intra-frame block copy coding mode, but since the flag value corresponding to the read intra-frame block copy coding mode flag information ibc_flag is 1, it can be determined that the target coding mode is the intra-frame block copy coding mode.

[0136] In another embodiment, the syntax in the encoded data is: root_cu_mode = 'PRED_Inter_only', then the coding mode restriction type obtained by the decoder from decoding the encoded data is the inter-frame coding mode restriction type, and the intra-frame block copy coding mode flag information ibc_flag is not parsed out in the encoded data, then the coding mode of the inter-frame coding mode restriction type can only be the standard inter-frame coding mode, and therefore it can be determined that the target coding mode is the standard inter-frame coding mode.

[0137] In yet another embodiment, the syntax in the coded data is: root_cu_mode = 'PRED_Ibc_only', then the coding mode restriction type obtained by the decoder from decoding the coded data is the intra-frame block copy coding mode restriction type, although the intra-frame block copy coding mode flag information ibc_flag is not parsed out in the coded data, but since the intra-frame block copy coding mode restriction type can only be the intra-frame block copy coding mode, it can be determined that the target coding mode is the intra-frame block copy coding mode. In yet another embodiment, the syntax in the coded data is: root_cu_mode = 'PRED_NormalIntra_only', then the coding mode restriction type obtained by the decoder from decoding the coded data is the standard intra-frame coding mode restriction type, and the intra-frame block copy coding mode flag information ibc_flag is not parsed out in the coded data, then the coding mode of the standard intra-frame coding mode restriction type can only be the standard intra-frame coding mode, so it can be determined that the target coding mode is the standard intra-frame coding mode.

[0138] In one embodiment, Figure 8 As shown, the coding mode restriction type is an inter-frame coding mode restriction type, and the target coding mode corresponding to the current unit to be decoded is determined according to the coding mode restriction type and the coding mode flag information, including:

[0139] Step 802: When the value corresponding to the coding mode flag information is the first flag value, the target coding mode is the standard inter-frame coding mode.

[0140] Step 804: When the value corresponding to the coding mode flag information is the second flag value, the target coding mode is the intra block copy coding mode.

[0141] Among them, when the coding mode restriction type is an inter-frame coding mode restriction type, the candidate coding modes corresponding to the inter-frame coding mode restriction type at this time include a standard inter-frame coding mode and an intra-frame block copy coding mode. After the decoder decodes the coded data corresponding to the current unit to be decoded and obtains the coding mode restriction type corresponding to the current unit to be decoded, the target coding mode can be determined by parsing the coding mode flag information in the current coded data. The target coding mode is one of the candidate coding modes corresponding to the coding mode restriction type.

[0142] Specifically, the target coding mode can be determined according to the flag value corresponding to the coding mode flag information parsed by the decoder. For example, the decoder parses the root_cu_mode syntax element in the encoded data to obtain the coding mode restriction type. After parsing the ibc_flag syntax element in the encoded data, it can be obtained that the coding mode restriction type includes the intra-frame block copy coding mode. Then, the flag value corresponding to the ibc_flag syntax element is used to determine whether the coding mode is the intra-frame block copy coding mode or the standard inter-frame coding mode.

[0143] Among them, the first flag value and the second flag value here are both values ​​corresponding to the coding mode flag information, which are used to determine the target coding mode from the candidate coding modes corresponding to the coding mode restriction type. The first flag value here can be used to determine that the target coding mode is a standard inter-frame coding mode, that is, when the decoder parses the coding mode flag information and the value corresponding to the first flag value, the target coding mode is a standard inter-frame coding mode. The second flag value can be used to determine that the target coding mode is an intra-frame block copy coding mode, that is, when the decoder parses the coding mode flag information and the value corresponding to the second flag value, the target coding mode is an intra-frame block copy coding mode, wherein the first flag value and the second flag value can be set according to actual needs.

[0144] For example, the coding mode flag information is the intra-frame block copy coding mode flag information ibc_flag, and the first flag value can be set to 0 to indicate that the coding mode is the standard inter-frame coding mode, then the syntax in the coded data is: ibc_flag=0, then the decoder parses and obtains that the coding mode restriction type of the current unit to be decoded is the inter-frame coding mode restriction type, and the target coding mode is the standard inter-frame coding mode. Similarly, the second flag value can be set to 1 to indicate that the coding mode is the intra-frame block copy coding mode, then the syntax in the coded data is: ibc_flag=1, then the decoder parses and obtains that the coding mode restriction type of the current unit to be decoded is the inter-frame coding mode restriction type, and the target coding mode is the intra-frame block copy coding mode.

[0145] In one embodiment, during the encoding process, the syntax in the encoded data is set to: root_cu_mode = 'PRED_Inter_only', ibc_flag = 0, then the coding mode restriction type obtained by the decoder from decoding the encoded data is an inter-frame coding mode restriction type, and the candidate coding modes of the inter-frame coding mode restriction type include an intra-frame block copy coding mode, but since the flag value corresponding to the intra-frame block copy coding mode flag information ibc_flag obtained by parsing is 0, it can be determined that the target coding mode is a standard inter-frame coding mode.

[0146] Similarly, if the syntax setting in the encoded data is: root_cu_mode = 'PRED_Inter_only', ibc_flag = 1, the coding mode restriction type obtained by the decoder when decoding the encoded data is the inter-frame coding mode restriction type, and the candidate coding modes of the inter-frame coding mode restriction type include the intra-frame block copy coding mode, but since the flag value corresponding to the intra-frame block copy coding mode flag information ibc_flag obtained by parsing is 1, it can be determined that the target coding mode is the intra-frame block copy coding mode.

[0147] In another embodiment, the syntax in the encoded data is: root_cu_mode = 'PRED_Intra_only', then the coding mode restriction type obtained by the decoder from decoding the encoded data is the intra-frame coding mode restriction type, and the intra-frame block copy coding mode flag information ibc_flag is not parsed out in the encoded data, then the coding mode of the intra-frame coding mode restriction type can only be the standard intra-frame coding mode, and therefore it can be determined that the target coding mode is the standard intra-frame coding mode.

[0148] In another embodiment, the syntax in the encoded data is: root_cu_mode = 'PRED_Ibc_only', then the coding mode restriction type obtained by the decoder when decoding the encoded data is the intra block copy coding mode restriction type, although the intra block copy coding mode flag information ibc_flag is not parsed out from the encoded data, but since the intra block copy coding mode restriction type can only be the intra block copy coding mode, it can be determined that the target coding mode is the intra block copy coding mode.

[0149] In still another embodiment, the syntax in the encoded data is: root_cu_mode='PRED_NormalInter_only', then the coding mode restriction type obtained by the decoder from decoding the encoded data is the standard inter-frame coding mode restriction type, and the intra-frame block copy coding mode flag information ibc_flag is not parsed out in the encoded data, then the coding mode of the standard inter-frame coding mode restriction type can only be the standard inter-frame coding mode, and therefore it can be determined that the target coding mode is the standard inter-frame coding mode.

[0150] In one embodiment, the coding mode restriction type is an intra-block copy coding mode restriction type, and the step of selecting the target coding mode includes: directly determining that the target coding mode corresponding to the current unit to be decoded is an intra-block copy coding mode.

[0151] Among them, since the coding mode corresponding to the intra-frame block copy coding mode restriction type can only be the intra-frame block copy coding mode, the decoder obtains the coding mode restriction type corresponding to the current unit to be decoded after decoding the coded data corresponding to the current unit to be decoded. When the coding mode restriction type is the intra-frame block copy coding mode restriction type, it can be directly determined that the target coding mode corresponding to the current unit to be decoded is the intra-frame block copy coding mode. Among them, because the coding mode of the intra-frame block copy coding mode restriction type can only be the intra-frame block copy coding mode, it is not necessary to add the intra-frame block copy coding mode flag information ibc_flag corresponding to the intra-frame block copy coding mode to the coded data. In other words, when the decoder parses and obtains that the coding mode restriction type corresponding to the current unit to be decoded is the intra-frame block copy coding mode restriction type, it can directly determine that the target coding mode corresponding to the current unit to be decoded is the intra-frame block copy coding mode.

[0152] In one embodiment, the syntax in the encoded data is: root_cu_mode='PRED_Ibc_only', then the coding mode restriction type obtained by the decoder from decoding the encoded data is the intra block copy coding mode restriction type, although the intra block copy coding mode flag information ibc_flag is not parsed out from the encoded data, but since the intra block copy coding mode restriction type can only be the intra block copy coding mode, it can be directly determined that the target coding mode is the intra block copy coding mode.

[0153] In one embodiment, the data decoding method further includes: when the decoding obtains that the coding mode restriction type is a standard intra-frame coding mode restriction type, determining that the target coding mode corresponding to the current unit to be decoded is a standard intra-frame coding mode.

[0154] Among them, when the coding mode restriction type is the standard intra-frame coding mode restriction type, the coding mode corresponding to the standard intra-frame coding mode restriction type at this time can only be the standard intra-frame coding mode. Therefore, after the decoder decodes the coded data corresponding to the current unit to be decoded, the coding mode restriction type corresponding to the current unit to be decoded is obtained. When the coding mode restriction type is the standard intra-frame coding mode restriction type, it can be directly determined that the target coding mode corresponding to the current unit to be decoded is the standard intra-frame coding mode. Among them, because the coding mode of the standard intra-frame coding mode restriction type can only be the standard intra-frame coding mode, it is not necessary to add the intra-frame block copy coding mode flag information ibc_flag used to describe the intra-frame block copy coding mode corresponding to the coding data. In other words, when the decoder parses and obtains that the coding mode restriction type corresponding to the current unit to be decoded is the standard intra-frame coding mode restriction type, it can directly determine that the target coding mode corresponding to the current unit to be decoded is the standard intra-frame coding mode.

[0155] In one embodiment, the syntax in the encoded data is: root_cu_mode = 'PRED_NormalIntra_only', then the coding mode restriction type obtained by the decoder from decoding the encoded data is the standard intra-frame coding mode restriction type, and the intra-frame block copy coding mode flag information ibc_flag is not parsed out in the encoded data, then the coding mode of the standard intra-frame coding mode restriction type can only be the standard intra-frame coding mode, so the target coding mode can be directly determined to be the standard intra-frame coding mode.

[0156] In one embodiment, the data decoding method further includes: when the decoding obtains that the coding mode restriction type is a standard inter-frame coding mode restriction type, determining that the target coding mode corresponding to the current unit to be decoded is a standard inter-frame coding mode.

[0157] Among them, when the coding mode restriction type is the standard inter-frame coding mode restriction type, the coding mode corresponding to the standard inter-frame coding mode restriction type at this time can only be the standard inter-frame coding mode. Therefore, after the decoder decodes the coded data corresponding to the current unit to be decoded, it obtains the coding mode restriction type corresponding to the current unit to be decoded. When the coding mode restriction type is the standard inter-frame coding mode restriction type, it can be directly determined that the target coding mode corresponding to the current unit to be decoded is the standard inter-frame coding mode. Among them, because the coding mode of the standard inter-frame coding mode restriction type can only be the standard inter-frame coding mode, it is not necessary to add the intra-frame block copy coding mode flag information ibc_flag used to describe the intra-frame block copy coding mode corresponding to the coding data. In other words, when the decoder parses and obtains that the coding mode restriction type corresponding to the current unit to be decoded is the standard inter-frame coding mode restriction type, it can directly determine that the target coding mode corresponding to the current unit to be decoded is the standard inter-frame coding mode.

[0158] In one embodiment, the syntax in the encoded data is: root_cu_mode = 'PRED_NormalInter_only', then the coding mode restriction type obtained by the decoder from decoding the encoded data is the standard inter-frame coding mode restriction type, and the intra-frame block copy coding mode flag information ibc_flag is not parsed out in the encoded data, then the coding mode of the standard inter-frame coding mode restriction type can only be the standard inter-frame coding mode, and therefore it can be determined that the target coding mode is the standard inter-frame coding mode.

[0159] In one embodiment, Fig. 9 As shown, the current unit to be decoded is decoded according to the target coding mode selected from the candidate coding mode set to obtain corresponding decoded data, including:

[0160] Step 902: when the target coding mode is the intra block copy coding mode, obtain block vector information and residual information corresponding to the current unit to be decoded from the coded data.

[0161] Among them, block vector information refers to information related to block vectors. Block vector is a term dedicated to intra-frame block copy coding mode, similar to the concept of mv (motion vector) in inter-frame coding mode. The coded data includes block vector information, and the decoder can determine the corresponding reference block position based on the block vector information, that is, the block vector information is used to point to the reference block position. Among them, when the target coding mode is intra-frame block copy coding mode, the intra-frame block copy coding mode flag information ibc_flag may exist in the coded data, or the intra-frame block copy coding mode flag information ibc_flag may not exist. When the coding mode restriction type is an intra-frame coding mode restriction type or an inter-frame coding mode restriction type, and the candidate coding mode corresponding to the intra-frame coding mode restriction type or the inter-frame coding mode restriction type includes an intra-frame block copy coding mode, the intra-frame block copy coding mode flag information ibc_flag exists in the coded data. When the coding mode restriction type is the intra block copy coding mode restriction type, the intra block copy coding mode flag information ibc_flag does not exist in the encoded data, that is, the decoder does not need to decode the syntax element, but can implicitly infer that the ibc_flag is "true".

[0162] Specifically, when the target coding mode is the intra-block copy coding mode, the decoder decodes the coded data to obtain the block vector information and residual information corresponding to the previous unit to be decoded.

[0163] Step 904: Determine prediction information corresponding to the current unit to be decoded according to the block vector information.

[0164] Specifically, when the decoder parses and obtains the block vector information, since the block vector information is used to point to the reference block position. Therefore, the prediction information corresponding to the current unit to be decoded can be determined based on the block vector information, specifically, the current vector information corresponding to the current unit to be decoded can be obtained, and the current vector information is information related to the position of the current unit to be decoded. The reference block position is then calculated based on the current vector information and the block vector information, and a target area of ​​the same size as the area to be copied for the current unit to be decoded is determined from the reference block position, and the reference pixel values ​​in the target area are copied to the area corresponding to the current unit to be decoded. The prediction information can be calculated based on the original pixel values ​​in the area corresponding to the current unit to be decoded and the reference pixel values ​​corresponding to the copied reference block.

[0165] That is to say, during the encoding process, if the encoding mode corresponding to the current coding unit is the intra block copy encoding mode, the block vector information is carried from the encoded data, and the block vector information is used to point to the reference position. Then the reference block will be copied to the current coding area. Subsequently, the residual information is calculated based on the original pixels corresponding to the current coding unit and the reference pixels corresponding to the reference block, and is used for subsequent encoding.

[0166] Step 906: Obtain a decoded image unit corresponding to the current unit to be decoded according to the residual information and the prediction information.

[0167] Specifically, after the decoder parses and obtains the residual information, the residual information is entropy decoded, dequantized, and inversely transformed to obtain the spatial domain residual information. Specifically, the residual information is first entropy decoded to obtain the corresponding entropy decoded data, and then the entropy decoded data is inversely quantized to obtain the inverse quantized data. The inverse quantized data is further inversely transformed to obtain the spatial domain residual information.

[0168] Among them, inverse quantization is the inverse process of quantization, and the principle of quantization is expressed by the formula as follows: FQ = round (y / Qstep). Among them, y is the value corresponding to the current coding unit before quantization, Qstep is the quantization step, and FQ is the quantization value obtained by quantizing y. The Round (x) function refers to rounding the value to an even number, that is, rounding to an even number. The correspondence between the quantization parameter and the quantization step can be set as needed. For example, in some video coding standards, for brightness coding, the quantization step has a total of 52 values, which are integers between 0 and 51. For chrominance coding, the quantization step has a value between 0 and 39, and the quantization step increases with the increase of the quantization parameter. Every time the quantization parameter increases by 6, the quantization step doubles.

[0169] Entropy decoding is the reverse process of entropy coding. Entropy coding is a data coding method that encodes according to the entropy principle without losing any information, and can use smaller characters to express certain information. Entropy coding methods can be, for example, Shannon coding or Huffman coding.

[0170] Further, after obtaining the spatial residual information and the prediction information, the decoded image unit corresponding to the current unit to be decoded is obtained according to the spatial residual information and the prediction information, and specifically, the reconstructed image unit is obtained according to the spatial residual information and the prediction information. The reconstructed image unit is further played or stored, or played and stored.

[0171] In one embodiment, Fig.10 As shown, a data encoding method is provided. This embodiment mainly applies this method to the above Figure 1The terminal 110 or the server 120 in FIG. Fig.10 , the data encoding method specifically includes the following steps:

[0172] Step 1002, obtaining the current coding unit.

[0173] The current coding unit refers to the coding unit currently being encoded. The coding unit (CodingUnit, CU) is a sub-block of the coding tree unit (Coding Tree Unit, CTU), that is, the coding unit is a unit that constitutes the coding tree unit, and the coding tree unit is a structure divided by a quad or binary tree, and is divided recursively layer by layer. Finally, a coding tree unit CTU can be composed of several coding units. It can be as follows Figure 5A As shown, Figure 5A A schematic diagram showing the structure of a coding tree unit in one embodiment is shown. Figure 5A Each small block in the final leaf node is a coding unit, and the coding tree unit is the entire set (the entire large block) composed of each coding unit. Figure 5A The pixel size of the largest block in the CNN is 16*32, but generally speaking, the pixel size of the coding tree unit is 64*64 or 128*128. It should be noted that Figure 5A The pictures shown are only for understanding the tree-like partitioning structure of the coding tree unit. Figure 5A The number in indicates whether this node will continue to split. If this node will continue to split, it is 1, and if not, it is 0.

[0174] Step 1004: Obtain a coding mode restriction type corresponding to the current coding unit, wherein the candidate coding mode set corresponding to the coding mode restriction type includes an intra block copy coding mode.

[0175] Among them, the encoding may include at least one of prediction, transformation, quantization and entropy encoding. The encoding process may be to first obtain the current coding unit, decide the coding mode restriction type corresponding to the current coding unit, and there are corresponding candidate coding modes for each coding mode restriction type, and then determine the flag information corresponding to the current coding unit according to the decided coding mode restriction type, determine the target coding mode corresponding to the current coding unit according to the coding mode restriction type and the flag information, and finally obtain the encoded data according to the target coding mode. That is, the encoded data includes but is not limited to the syntax elements corresponding to the coding mode restriction type and the target coding mode.

[0176] The coding mode restriction type refers to the type of coding mode restriction, which is used to restrict whether the coding mode of the coding unit will be restricted to a specific coding mode. There are corresponding candidate coding modes for each coding mode restriction type, and the candidate coding modes include the intra-frame block copy coding mode. The intra-frame block copy coding mode is similar to the standard inter-frame coding mode, but the difference is that the reference block information of the standard inter-frame coding mode comes from the reference frame, while the reference block information of the intra-frame block copy coding mode comes from the current frame.

[0177] In one embodiment, during the data encoding process, the coding mode restriction type can determine whether it is an intra-frame coding mode restriction type, an inter-frame coding mode restriction type, or an intra-frame block copy coding mode restriction type. The candidate coding modes corresponding to the intra-frame coding mode restriction type are the standard intra-frame coding mode and the intra-frame block copy coding mode. The candidate coding mode corresponding to the inter-frame coding mode restriction type is the standard inter-frame coding mode. The candidate coding mode corresponding to the intra-frame block copy coding mode restriction type is the intra-frame block copy coding mode. The standard intra-frame coding mode here refers to the intra-frame coding mode of the prior art. Similarly, the standard inter-frame coding mode refers to the inter-frame coding mode of the prior art, and the intra-frame block copy coding mode is similar to the standard inter-frame coding mode, but the difference is that the reference block information of the standard inter-frame coding mode comes from the reference frame, while the reference block information of the intra-frame block copy coding mode comes from the current frame.

[0178] In another embodiment, during the data encoding process, the coding mode restriction type can be determined as an intra-frame coding mode restriction type, an inter-frame coding mode restriction type, or an intra-frame block copy coding mode restriction type. The candidate coding mode corresponding to the intra-frame coding mode restriction type is a standard intra-frame coding mode, the candidate coding mode corresponding to the inter-frame coding mode restriction type is a standard inter-frame coding mode and an intra-frame block copy coding mode, and the candidate coding mode corresponding to the intra-frame block copy coding mode restriction type is an intra-frame block copy coding mode.

[0179] Step 1006: encode the current coding unit according to the coding mode restriction type, determine the target coding mode corresponding to the current coding unit from the candidate coding mode set, and obtain the coding data corresponding to the current coding unit according to the target coding mode.

[0180] Specifically, in the data encoding process, the coding mode restriction type can determine whether it is an intra-frame coding mode restriction type, an inter-frame coding mode restriction type, or an intra-frame block copy coding mode restriction type. The candidate coding modes corresponding to the intra-frame coding mode restriction type are the standard intra-frame coding mode and the intra-frame block copy coding mode. The candidate coding mode corresponding to the inter-frame coding mode restriction type is the standard inter-frame coding mode, and the candidate coding mode corresponding to the intra-frame block copy coding mode restriction type is the intra-frame block copy coding mode.

[0181] Specifically, a flag root_cu_mode used to describe the coding mode restriction type can be added to the encoded data, that is, a syntax element describing the coding mode restriction type is added to the encoded data, and the value corresponding to the flag of the coding mode restriction type can be set to the name corresponding to the coding mode restriction type. For example, if the coding mode restriction type is an intra-frame coding mode restriction type, the syntax in the encoded data is: root_cu_mode = 'PRED_Intra_only'.

[0182] Furthermore, the flag bit corresponding to the corresponding candidate coding mode is determined according to the coding mode restriction type, and the flag bit used to describe the coding mode corresponding to the coding mode restriction type can be added to the encoded data, and the coding mode corresponding to the coding mode restriction type can be determined specifically by the value corresponding to the flag bit.

[0183] For example, when the coding mode restriction type is the intra-frame coding mode restriction type, the candidate coding modes are the standard intra-frame coding mode and the intra-frame block copy coding mode, so ibc_flag can be added to the encoded data. ibc_flag is the intra-frame block copy coding mode flag information. Since the coding mode restriction type is the intra-frame coding mode restriction type, and the intra-frame coding mode restriction type includes the intra-frame block copy coding mode, ibc_flag needs to be added to the encoded data. However, when the coding mode in the intra-frame coding mode restriction type is the standard intra-frame coding mode, ibc_flag=0, and when the coding mode in the intra-frame coding mode restriction type is the intra-frame block copy coding mode, ibc_flag=1. When the coding mode restriction type is the inter-frame coding mode restriction type, and the inter-frame coding mode restriction type is the standard inter-frame coding mode, the syntax in the encoded data is: root_cu_mode = 'PRED_Inter_only'. Since the coding mode restriction type of the current coding unit is the inter-frame coding mode restriction type, the current coding unit can only be the standard inter-frame coding mode. There is no need to add the intra-frame block copy flag information ibc_flag to the encoded data. The syntax elements corresponding to the standard inter-frame coding mode, such as skip_flag, are directly added to the encoded data.

[0184] Furthermore, when the coding mode restriction type is the intra block copy coding mode restriction type, the coding mode of the current coding unit can only be the intra block copy coding mode, so there is no need to transmit and decode the intra block copy flag information ibc_flag. At this time, the syntax in the coded data is: root_cu_mode = 'PRED_Ibc_only'.

[0185] In this embodiment, the coding mode restriction type may also be a standard intra-frame coding mode restriction type. The coding mode of the standard intra-frame coding mode restriction type may only be a standard intra-frame coding mode. Therefore, there is no need to add ibc_flag as a syntax element to the coded data.

[0186] In another embodiment, during the data encoding process, the coding mode restriction type can be determined as an intra-frame coding mode restriction type, an inter-frame coding mode restriction type, or an intra-frame block copy coding mode restriction type. The candidate coding mode corresponding to the intra-frame coding mode restriction type is a standard intra-frame coding mode, the candidate coding mode corresponding to the inter-frame coding mode restriction type is a standard inter-frame coding mode and an intra-frame block copy coding mode, and the candidate coding mode corresponding to the intra-frame block copy coding mode restriction type is an intra-frame block copy coding mode.

[0187] Specifically, when the coding mode restriction type is the intra-frame coding mode restriction type, because the coding mode of the current coding unit can only be the standard intra-frame coding mode, there is no need to transmit the intra-frame block copy flag information ibc_flag, and the syntax elements corresponding to the standard intra-frame coding mode are directly added to the encoded data.

[0188] When the coding mode restriction type is the inter-frame coding mode restriction type, the coding mode of the current coding unit may be the standard inter-frame coding mode or the intra-frame block copy coding mode. Therefore, it is necessary to transmit the intra-frame block copy flag as the information ibc_flag. Specifically, the standard inter-frame coding mode and the intra-frame block copy coding mode are distinguished by the value corresponding to ibc_flag, such as ibc_flag=0 for the standard inter-frame coding mode, and ibc_flag=1 for the intra-frame block copy coding mode.

[0189] When the coding mode restriction type is an intra-frame block copy coding mode restriction type, the coding mode of the current coding unit may only be an intra-frame block copy coding mode, so there is no need to transmit and decode the intra-frame block copy flag information ibc_flag. In this embodiment, the coding mode restriction type may also be a standard inter-frame coding mode restriction type, and the coding mode of the standard inter-frame coding mode restriction type may only be a standard inter-frame coding mode, so there is no need to add ibc_flag as a syntax element to the coded data.

[0190] The above data encoding method obtains the current coding unit, obtains the coding mode restriction type corresponding to the current coding unit, the candidate coding modes corresponding to the coding mode restriction type include the intra-frame block copy coding mode, encodes the current coding unit according to the coding mode restriction type, determines the target coding mode corresponding to the current coding unit from the candidate coding modes, and obtains the coding data corresponding to the current coding unit according to the target coding mode. When encoding the coding unit, the coding mode restriction type can be flexibly selected, the candidate coding mode corresponding to the coding mode restriction type is not limited to one, and the candidate coding mode includes the intra-frame block copy coding mode, so the selection range of determining the target coding mode corresponding to the coding unit from at least one candidate coding mode is larger, and encoding in the target coding mode can obtain accurate coding data.

[0191] In one embodiment, Fig.11 As shown, the current coding unit is a coding tree unit, the current coding unit includes multiple sub-coding units, the coding mode restriction type includes at least two different types of coding mode restriction types, and the data encoding method further includes:

[0192] Step 1102, encode the current coding unit under different types of coding mode restriction types, determine the target coding mode corresponding to each sub-coding unit from the candidate coding mode set, and obtain the sub-coding cost information corresponding to each sub-coding unit according to the target coding mode corresponding to each sub-coding unit.

[0193] Among them, the current coding unit is a coding tree unit, and a coding unit (CodingUnit, CU) is a sub-block of a coding tree unit (Coding Tree Unit, CTU), that is, a coding unit is a unit that constitutes a coding tree unit, and a coding tree unit is a structure divided by a quad or binary tree, and is divided recursively layer by layer. Finally, a coding tree unit CTU can be composed of several coding units. It can be as follows Figure 5A As shown, Figure 5A A schematic diagram showing the structure of a coding tree unit in one embodiment is shown. Figure 5A Each small block in the final leaf node is a coding unit, and the coding tree unit is the entire set (the entire large block) composed of each coding unit.

[0194] Among them, the current coding unit includes multiple sub-coding units, and the coding mode restriction type includes at least two different types of coding mode restriction types. The sub-coding unit here refers to the sub-block in the current coding unit, which is a unit constituting the current coding unit. The coding mode restriction type here includes at least two different types of coding mode restriction types, for example, the coding mode restriction type includes an intra-frame coding mode restriction type, an inter-frame coding mode restriction type, and an intra-frame block copy coding mode restriction type. The specific types of coding mode restriction types included in the coding mode restriction type can be determined by hardware, and the hardware can determine the coding mode restriction type according to its own hardware conditions.

[0195] Specifically, the current coding unit is encoded under different types of coding mode restriction types. Since there are corresponding candidate coding modes for each coding mode restriction type, the target coding mode corresponding to each sub-coding unit is determined from the candidate coding modes corresponding to each coding mode restriction type, and the sub-coding cost information corresponding to each sub-coding unit is obtained according to the target coding mode corresponding to each sub-coding unit. The sub-coding cost information needs to be calculated during the encoding process, but not during the decoding process.

[0196] In one embodiment, the coding mode restriction type includes an intra-frame coding mode restriction type, an inter-frame coding mode restriction type, and an intra-frame block copy coding mode restriction type. The candidate coding modes corresponding to the intra-frame coding mode restriction type include a standard intra-frame coding mode and an intra-frame block copy coding mode. The candidate coding modes corresponding to the inter-frame coding mode restriction type only include a standard inter-frame coding mode, and the candidate coding modes corresponding to the intra-frame block copy coding mode restriction type only include an intra-frame block copy coding mode. The current coding unit is encoded under the intra-frame coding mode restriction type, the inter-frame coding mode restriction type, and the intra-frame block copy coding mode restriction type, respectively.

[0197] Specifically, the current coding unit is encoded under the intra-frame coding mode restriction type, and the candidate coding modes corresponding to each sub-coding unit of the current coding unit can be a standard intra-frame coding mode or an intra-frame block copy coding mode. Therefore, the sub-coding cost information obtained by each sub-coding unit in the standard intra-frame coding mode and the sub-coding cost information obtained by each sub-coding unit in the intra-frame block copy coding mode are calculated respectively. Finally, the target coding mode corresponding to each sub-coding unit is determined according to the sub-coding cost information under different coding modes, and the sub-coding cost information corresponding to the target coding mode is determined as the final sub-coding cost information of each sub-coding unit.

[0198] Among them, the current coding unit is encoded in the inter-frame coding mode restriction type, and the candidate coding modes corresponding to each sub-coding unit of the current coding unit only include the standard inter-frame coding mode, then the sub-coding cost information obtained by each sub-coding unit in the standard inter-frame coding mode is calculated.

[0199] Similarly, the current coding unit is encoded in the intra block copy coding mode restriction type, and the candidate coding modes corresponding to the sub coding units of the current coding unit only include the intra block copy coding mode, then the sub coding cost information obtained by each sub coding unit in the intra block copy coding mode is calculated.

[0200] In one embodiment, the coding mode restriction type includes at least two different types of coding mode restriction types, which may be an intra-frame coding mode restriction type and an intra-frame block copy coding mode restriction type, and the candidate coding modes corresponding to the intra-frame coding mode restriction type are the standard intra-frame coding mode and the intra-frame block copy coding mode, while the coding modes corresponding to the intra-frame block copy coding mode restriction type only include the intra-frame block copy coding mode.

[0201] In another embodiment, the coding mode restriction type includes at least two different types of coding mode restriction types, for example, an intra-frame coding mode restriction type, an inter-frame coding mode restriction type, and an intra-frame block copy coding mode restriction type, and the candidate coding modes corresponding to the intra-frame coding mode restriction type are the standard intra-frame coding mode and the intra-frame block copy coding mode, the coding modes corresponding to the intra-frame block copy coding mode restriction type only include the intra-frame block copy coding mode, and the coding modes corresponding to the inter-frame coding mode restriction type only include the standard inter-frame coding mode.

[0202] In another embodiment, the coding mode restriction type includes at least two different types of coding mode restriction types, which may be an intra-frame coding mode restriction type, an inter-frame coding mode restriction type, an intra-frame block copy coding mode restriction type, and a standard intra-frame coding mode restriction type. The candidate coding modes corresponding to the intra-frame coding mode restriction type are the standard intra-frame coding mode and the intra-frame block copy coding mode. The coding modes corresponding to the intra-frame block copy coding mode restriction type only include the intra-frame block copy coding mode, the coding modes corresponding to the inter-frame coding mode restriction type only include the standard inter-frame coding mode, and the coding modes corresponding to the standard intra-frame coding mode restriction type only include the standard intra-frame coding mode.

[0203] In one embodiment, the coding mode restriction type includes at least two different types of coding mode restriction types, which may be specifically determined by the hardware manufacturer, and the examples of this application do not limit the scope of this application.

[0204] Step 1104: determine tree coding cost information corresponding to the current coding unit under different coding mode restriction types according to the sub-coding cost information corresponding to each sub-coding unit.

[0205] Specifically, after obtaining the sub-coding cost information corresponding to each sub-coding unit according to the target coding mode corresponding to each sub-coding unit, the tree coding cost information corresponding to the current coding unit under different coding mode restriction types can be determined according to the sub-coding cost information corresponding to each sub-coding unit. The determination method can be customized, and customization can be to use the minimum sub-coding cost information among the sub-coding cost information corresponding to each sub-coding unit as the tree coding cost information corresponding to the current coding unit under different coding mode restriction types, or it can also be to calculate the average value according to the sub-coding cost information corresponding to each sub-coding unit, and use the minimum average value as the tree coding cost information corresponding to the current coding unit under different coding mode restriction types, and so on.

[0206] For example, the current coding unit a is a coding tree unit, the current coding unit includes sub-coding unit 1, sub-coding unit 2, and sub-coding unit 3, the coding mode restriction type includes intra-frame coding mode restriction type, inter-frame coding mode restriction type, and intra-frame block copy coding mode restriction type, the sub-coding cost information corresponding to sub-coding unit 1 under the intra-frame coding mode restriction type is 390, the sub-coding cost information corresponding to sub-coding unit 2 is 350, and the sub-coding cost information corresponding to sub-coding unit 3 is 300, then the sub-coding cost information corresponding to sub-coding unit 3 can be used as the tree coding cost information corresponding to the current coding unit a under the intra-frame coding mode restriction type.

[0207] Step 1106: Determine a target coding mode restriction type corresponding to the current coding unit from different types of coding mode restriction types according to the tree coding cost information corresponding to the current coding unit.

[0208] Specifically, after determining the tree coding cost information corresponding to the current coding unit under each type of coding mode restriction type, the target coding mode restriction type corresponding to the current coding unit can be determined from different types of coding mode restriction types according to the tree coding cost information corresponding to the current coding unit. Among them, the determination method can be customized, and customization can be to determine the coding mode restriction type corresponding to the smallest tree coding cost information in the tree coding cost information corresponding to the current coding unit as the target coding mode restriction type corresponding to the current coding unit. Or it is also possible to set preset conditions according to actual needs or actual application scenarios, and select the target coding mode restriction type that meets the preset conditions from the coding mode restriction types under various types according to the preset conditions and the tree coding cost information corresponding to the current coding unit.

[0209] Step 1108, obtaining the encoding data corresponding to the current encoding unit according to the target encoding mode restriction type.

[0210] Specifically, after determining the target coding mode restriction type corresponding to the current coding unit, the coding data corresponding to the current coding unit can be obtained according to the target coding mode restriction type. Specifically, a syntax element describing the coding mode restriction type, such as root_cu_mode, is added to the coding data, that is, a syntax element describing the coding mode restriction type is added to the coding data, and the value corresponding to the flag bit of the coding mode restriction type can be set to the name corresponding to the coding mode restriction type. For example, if the coding mode restriction type is an intra-frame coding mode restriction type, the syntax in the coding data is: root_cu_mode = 'PRED_Intra_only'.

[0211] In one embodiment, Fig.12 As shown, the coded data corresponding to the current coding unit obtained according to the target coding mode includes:

[0212] Step 1202, generating a corresponding target flag bit according to the target coding mode.

[0213] Step 1204, write the target flag into the coded data corresponding to the current coding unit.

[0214] Specifically, when the coding mode restriction type is an intra-frame coding mode restriction type, an inter-frame coding mode restriction type, or an intra-frame block copy coding mode restriction type, a corresponding target flag is generated according to the target coding mode. The target flag here refers to a flag related to the candidate coding mode corresponding to the coding mode restriction type. Finally, the target flag is written into the coded data corresponding to the current coding unit.

[0215] In one embodiment, when the coding mode restriction type is an intra-frame coding mode restriction type, the candidate coding corresponding to the intra-frame coding mode restriction type includes a standard intra-frame coding mode and an intra-frame block copy coding mode, and it is necessary to add flag information ibc_flag used to express the intra-frame block copy coding mode to the coded data, that is, ibc_flag is written into the coded data corresponding to the current coding unit, that is, the syntax in the coded data is:

[0216] root_cu_mode='PRED_Intra_only';

[0217] ibc_flag = ae(v);

[0218] Specifically, the standard intra-frame coding mode and the intra-frame block copy coding mode can be distinguished according to the value of ae(v). For example, when ae(v) is 0, it indicates the coding mode is the standard intra-frame coding mode, and when ae(v) is 1, it indicates the intra-frame block copy coding mode.

[0219] In another embodiment, when the coding mode restriction type is an inter-frame coding mode restriction type, the candidate coding corresponding to the inter-frame coding mode restriction type includes a standard inter-frame coding mode and an intra-frame block copy coding mode, and it is necessary to add flag information ibc_flag used to express the intra-frame block copy coding mode to the coded data, that is, ibc_flag is written into the coded data corresponding to the current coding unit, that is, the syntax in the coded data is:

[0220] root_cu_mode='PRED_Inter_only';

[0221] ibc_flag = ae(v);

[0222] Specifically, the standard inter-frame coding mode and the intra-frame block copy coding mode can be distinguished according to the value of ae(v). For example, when ae(v) is 0, it indicates the coding mode is the standard inter-frame coding mode, and when ae(v) is 1, it indicates the intra-frame block copy coding mode.

[0223] In a specific embodiment, a data encoding method and a data decoding method are provided, which specifically include the following steps:

[0224] S1. Get the current coding unit.

[0225] S2. Obtain a coding mode restriction type corresponding to the current coding unit, where the candidate coding modes corresponding to the coding mode restriction type include an intra block copy coding mode.

[0226] S3. Encode the current coding unit according to the coding mode restriction type, determine the target coding mode corresponding to the current coding unit from the candidate coding modes, and obtain the coding data corresponding to the current coding unit according to the target coding mode.

[0227] S3-1. When the coding mode restriction type is an intra-frame coding mode restriction type or an inter-frame coding mode restriction type, a corresponding target flag is generated according to the target coding mode.

[0228] S3-2. Write the target flag into the coded data corresponding to the current coding unit.

[0229] S4. The current coding unit is a coding tree unit, the current coding unit includes multiple sub-coding units, the coding mode restriction type includes at least two different types of coding mode restriction types, the current coding unit is encoded under different types of coding mode restriction types, a target coding mode corresponding to each sub-coding unit is determined from the candidate coding modes, and sub-coding cost information corresponding to each sub-coding unit is obtained according to the target coding mode corresponding to each sub-coding unit.

[0230] S5. Determine tree coding cost information corresponding to the current coding unit under different coding mode restriction types according to sub-coding cost information corresponding to each sub-coding unit.

[0231] S6. Determine a target coding mode restriction type corresponding to the current coding unit from different types of coding mode restriction types according to the tree coding cost information corresponding to the current coding unit.

[0232] S7. Obtain the encoding data corresponding to the current encoding unit according to the target encoding mode restriction type.

[0233] S8. Obtain the encoded data corresponding to the current unit to be decoded.

[0234] S9. Analyze the encoded data to obtain the encoding mode restriction type corresponding to the current unit to be decoded.

[0235] S10. Determine a target coding mode corresponding to the current unit to be decoded according to the coding mode restriction type, where the target coding mode is one of the candidate coding modes, and the candidate coding modes include an intra block copy coding mode.

[0236] S10-1. Analyze the encoded data to obtain the flag information corresponding to the current unit to be decoded.

[0237] S10-2. Determine the target coding mode corresponding to the current unit to be decoded according to the coding mode restriction type and the flag information.

[0238] S10-2-1. The coding mode restriction type is an intra-frame coding mode restriction type. When the value corresponding to the flag information is the first flag value, the target coding mode is a standard intra-frame coding mode. When the value corresponding to the flag information is the second flag value, the target coding mode is an intra-frame block copy coding mode.

[0239] S10-2-2, the coding mode restriction type is the inter-frame coding mode restriction type. When the value corresponding to the flag information is the first flag value, the target coding mode is the standard inter-frame coding mode. When the value corresponding to the flag information is the second flag value, the target coding mode is the intra-frame block copy coding mode.

[0240] S10-3. The coding mode restriction type is the intra block copy coding mode restriction type, and directly determining that the target coding mode corresponding to the current unit to be decoded is the intra block copy coding mode.

[0241] S10-4: When the coding mode restriction type is the standard intra-frame coding mode restriction type, determine that the target coding mode corresponding to the current unit to be decoded is the standard intra-frame coding mode.

[0242] S10-5. When the coding mode restriction type is the standard inter-frame coding mode restriction type, determine that the target coding mode corresponding to the current unit to be decoded is the standard inter-frame coding mode.

[0243] S11. Decode the current unit to be decoded according to the target coding mode to obtain corresponding decoded data.

[0244] S11-1. When the target coding mode is the intra block copy coding mode, the block vector information and residual information corresponding to the current unit to be decoded are obtained from the coded data.

[0245] S11-2. Determine prediction information corresponding to the current unit to be decoded according to the block vector information.

[0246] S11-3. Obtain a decoded image unit corresponding to the current unit to be decoded according to the residual information and the prediction information.

[0247] It should be understood that, although the various steps in the above-mentioned flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above-mentioned flow chart may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0248] In one embodiment, Fig.13 As shown, a data decoding device 1300 is provided. The data decoding device 1300 can be integrated in the above-mentioned server 120 or terminal 110, and specifically can include a coding data acquisition module 1302, a coding data parsing module 1304, a target coding mode determination module 1306 and a decoding data generation module 1308, wherein:

[0249] The coded data acquisition module 1302 is used to acquire the coded data corresponding to the current unit to be decoded.

[0250] The coded data parsing module 1304 is used to decode the coded data to obtain the coding mode restriction type corresponding to the current unit to be decoded.

[0251] The target coding mode determination module 1306 is used to determine a candidate coding mode set corresponding to the current unit to be decoded according to the coding mode restriction type, and determine the target coding mode based on the candidate coding mode set, where the candidate coding mode set at least includes an intra-block copy coding mode.

[0252] The decoded data generating module 1308 is used to decode the current unit to be decoded according to the target coding mode to obtain corresponding decoded data.

[0253] In one embodiment, Fig.14 As shown, the target coding mode determination module 1306 includes:

[0254] The flag information obtaining unit 1306a is used to decode the encoded data to obtain the encoding mode flag information corresponding to the current unit to be decoded.

[0255] The target coding mode determining unit 1306b is used to determine the target coding mode corresponding to the current unit to be decoded according to the coding mode restriction type and the coding mode flag information.

[0256] In one embodiment, the coding mode restriction type is an intra-frame coding mode restriction type, and the target coding mode determination module 1306 is also used to, when the value corresponding to the coding mode flag information is a first flag value, the target coding mode is a standard intra-frame coding mode, and when the value corresponding to the coding mode flag information is a second flag value, the target coding mode is an intra-frame block copy coding mode.

[0257] In one embodiment, the coding mode restriction type is an inter-frame coding mode restriction type, and the target coding mode determination module 1306 is also used to, when the value corresponding to the coding mode flag information is a first flag value, the target coding mode is a standard inter-frame coding mode, and when the value corresponding to the coding mode flag information is a second flag value, the target coding mode is an intra-frame block copy coding mode.

[0258] In one embodiment, the coding mode restriction type is an intra-block copy coding mode restriction type, and the target coding mode determination module 1306 is further configured to directly determine that the target coding mode corresponding to the current unit to be decoded is an intra-block copy coding mode.

[0259] In one embodiment, the data decoding device 1300 is further configured to determine that the target coding mode corresponding to the current unit to be decoded is the standard intra-frame coding mode when the coding mode restriction type obtained through decoding is the standard intra-frame coding mode restriction type.

[0260] In one embodiment, the data decoding device 1300 is further configured to determine that the target coding mode corresponding to the current unit to be decoded is the standard inter-frame coding mode when the coding mode restriction type obtained through decoding is the standard inter-frame coding mode restriction type.

[0261] In one embodiment, Fig.15 As shown, the decoded data generation module 1308 includes:

[0262] The coded data processing unit 1308a is configured to obtain block vector information and residual information corresponding to the current unit to be decoded from the coded data when the target coding mode is the intra block copy coding mode.

[0263] The prediction information determining unit 1308b is used to determine the prediction information corresponding to the current unit to be decoded according to the block vector information.

[0264] The decoded image generating unit 1308c is used to obtain a decoded image unit corresponding to the current unit to be decoded according to the residual information and the prediction information.

[0265] In one embodiment, Fig.16 As shown, a data encoding device 1600 is provided. The data decoding device 1600 can be integrated in the above-mentioned server 120 or terminal 110, and can specifically include a current encoding unit acquisition module 1602, an encoding mode restriction type acquisition module 1604, and a current encoding unit encoding module 1606, wherein:

[0266] The current coding unit acquisition module 1602 is used to acquire the current coding unit.

[0267] The coding mode restriction type acquisition module 1604 is used to acquire the coding mode restriction type corresponding to the current coding unit, and the candidate coding mode set corresponding to the coding mode restriction type includes the intra block copy coding mode.

[0268] The current coding unit encoding module 1606 is used to encode the current coding unit according to the coding mode restriction type, determine the target coding mode corresponding to the current coding unit from the candidate coding mode set, and obtain the coding data corresponding to the current coding unit according to the target coding mode.

[0269] In one embodiment, Fig.17 As shown, the current coding unit is a coding tree unit, the current coding unit includes multiple sub-coding units, the coding mode restriction type includes at least two different types of coding mode restriction types, and the data encoding device 1600 further includes:

[0270] The sub-coding cost information determination module 1608 is used to encode the current coding unit under different types of coding mode restriction types, determine the target coding mode corresponding to each sub-coding unit from the candidate coding mode set, and obtain the sub-coding cost information corresponding to each sub-coding unit according to the target coding mode corresponding to each sub-coding unit.

[0271] The tree coding cost information determining module 1610 is configured to determine the tree coding cost information corresponding to the current coding unit under different coding mode restriction types according to the sub coding cost information corresponding to each sub coding unit.

[0272] The target coding mode restriction type determining module 1612 is configured to determine a target coding mode restriction type corresponding to the current coding unit from different types of coding mode restriction types according to the tree coding cost information corresponding to the current coding unit.

[0273] The coding data generating module 1614 is used to obtain the coding data corresponding to the current coding unit according to the target coding mode restriction type.

[0274] In one embodiment, the current coding unit encoding module 1606 is also used to generate a corresponding target flag according to the target coding mode when the coding mode restriction type is an intra-frame coding mode restriction type or an inter-frame coding mode restriction type, and write the target flag into the coding data corresponding to the current coding unit.

[0275] In one embodiment, the coding mode restriction type includes one of the following combinations: a combination of an intra-frame coding mode restriction type and an intra-frame block copy coding mode restriction type, a combination of an inter-frame coding mode restriction type and an intra-frame block copy coding mode restriction type, and a combination of an intra-frame coding mode restriction type, an inter-frame coding mode restriction type and an intra-frame block copy coding mode restriction type.

[0276] Fig.18 The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 1 The terminal 110 or the server 120 in FIG. Fig.18As shown, the computer device includes a processor, a memory, a network interface, an input device and a display screen connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement a data decoding method or a data encoding method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute a data decoding method or a data encoding method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a button, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0277] Those skilled in the art will understand that Fig.18 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0278] In one embodiment, the data decoding device or data encoding device provided by the present application can be implemented in the form of a computer program. The computer program can be Fig.18 The memory of the computer device may store various program modules constituting the data decoding device or the data encoding device, for example, Fig.13 The coded data acquisition module, coded data parsing module, target coding mode determination module and decoded data generation module shown in the figure. The computer program composed of each program module enables the processor to execute the steps of the data decoding method of each embodiment of the present application described in this specification.

[0279] For example, Fig.16 The current coding unit acquisition module, the coding mode restriction type acquisition module and the current coding unit encoding module shown in the figure. The computer program composed of each program module enables the processor to execute the steps of the data encoding method of each embodiment of the present application described in this specification.

[0280] For example, Fig.18 The computer device shown can be Fig.13The coded data acquisition module in the data decoding device shown acquires the coded data corresponding to the current unit to be decoded. The computer device can decode the coded data through the coded data parsing module to obtain the coding mode restriction type corresponding to the current unit to be decoded. The computer device can determine the candidate coding mode set corresponding to the current unit to be decoded according to the coding mode restriction type through the target coding mode determination module, and the candidate coding mode set includes at least the intra-frame block copy coding mode. The computer device can decode the current unit to be decoded according to the target coding mode selected from the candidate coding mode set through the decoding data generation module to obtain the corresponding decoded data.

[0281] For example, Fig.18 The computer device shown can be Fig.16 The current coding unit acquisition module in the data encoding device shown in the figure acquires the current coding unit. The computer device can acquire the coding mode restriction type corresponding to the current coding unit through the coding mode restriction type acquisition module, and the candidate coding mode set corresponding to the coding mode restriction type includes the intra-block copy coding mode. The computer device can encode the current coding unit according to the coding mode restriction type through the current coding unit encoding module, determine the target coding mode corresponding to the current coding unit from the candidate coding mode set, and obtain the encoded data corresponding to the current coding unit according to the target coding mode.

[0282] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned data decoding method or data encoding method. The steps of the data decoding method or data encoding method here may be the steps in the data decoding method or data encoding method of each of the above-mentioned embodiments.

[0283] In one embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the above-mentioned data decoding method or data encoding method. The steps of the data decoding method or data encoding method here can be the steps in the data decoding method or data encoding method of each of the above-mentioned embodiments.

[0284] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0285] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0286] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data decoding method, comprising: Get the coding mode restriction type of the coding tree unit; The coding tree unit includes a plurality of sub-coding units; The coding mode restriction type is used to restrict the coding mode of the coding tree unit to at least one of the candidate coding mode set corresponding to the coding mode restriction type; For the unit to be decoded corresponding to the sub-coding unit, when the coding mode restriction type is an inter-frame coding mode restriction type or when the coding mode restriction type is an intra-frame coding mode restriction type, determining a candidate coding mode set corresponding to the unit to be decoded according to the coding mode restriction type, the candidate coding mode set at least including an intra-frame block copy coding mode; In a case where the coding mode restriction type is a standard inter-frame coding mode restriction type, determining that the candidate coding mode set corresponding to the to-be-decoded unit only includes the standard inter-frame coding mode; The unit to be decoded is decoded according to a target coding mode selected from the candidate coding mode set to obtain decoded data corresponding to the unit to be decoded.

2. The method according to claim 1, characterized in that The step of selecting the target coding mode comprises: Decoding the encoded data to obtain the encoding mode flag information corresponding to the unit to be decoded; The target coding mode corresponding to the unit to be decoded is determined according to the coding mode restriction type and the coding mode flag information.

3. The method according to claim 2, characterized in that The coding mode restriction type is an intra-frame coding mode restriction type, and determining the target coding mode corresponding to the unit to be decoded according to the coding mode restriction type and the coding mode flag information includes: When the value corresponding to the coding mode flag information is the first flag value, determining that the target coding mode is a standard intra-frame coding mode; When the value corresponding to the coding mode flag information is the second flag value, it is determined that the target coding mode is an intra-block copy coding mode.

4. The method according to claim 2, characterized in that: The coding mode restriction type is an inter-frame coding mode restriction type, and determining the target coding mode corresponding to the unit to be decoded according to the coding mode restriction type and the coding mode flag information includes: When the value corresponding to the coding mode flag information is the first flag value, determining that the target coding mode is a standard inter-frame coding mode; When the value corresponding to the coding mode flag information is the second flag value, it is determined that the target coding mode is an intra-block copy coding mode.

5. The method according to claim 1, characterized in that The coding mode restriction type is an intra-block copy coding mode restriction type, and the step of selecting the target coding mode includes: Directly determine that the target coding mode corresponding to the unit to be decoded is the intra block copy coding mode.

6. The method according to claim 1, characterized in that The method further comprises: When the decoding results in that the coding mode restriction type is a standard intra-frame coding mode restriction type, it is determined that the target coding mode corresponding to the unit to be decoded is a standard intra-frame coding mode.

7. The method according to any one of claims 1 to 6, characterized in that: The decoding of the to-be-decoded unit according to the target coding mode selected from the candidate coding mode set to obtain corresponding decoded data includes: When the target coding mode is an intra-block copy coding mode, obtaining block vector information and residual information corresponding to the unit to be decoded from the coded data; Determine prediction information corresponding to the unit to be decoded according to the block vector information; A decoded image unit corresponding to the unit to be decoded is obtained according to the residual information and the prediction information.

8. A data encoding method, comprising: Get the coding mode restriction type of the coding tree unit; The coding tree unit includes a plurality of sub-coding units; The coding mode restriction type is used to restrict the coding mode of the coding tree unit to at least one of the candidate coding mode set corresponding to the coding mode restriction type; For the sub-coding unit, when the coding mode restriction type is an inter-frame coding mode restriction type or when the coding mode restriction type is an intra-frame coding mode restriction type, determining a candidate coding mode set corresponding to the sub-coding unit according to the coding mode restriction type, the candidate coding mode set at least including an intra-frame block copy coding mode; In a case where the coding mode restriction type is a standard inter-frame coding mode restriction type, determining that the candidate coding mode set corresponding to the sub-coding unit includes only the standard inter-frame coding mode; The sub-coding unit is encoded according to a target coding mode selected from the candidate coding mode set to obtain coding data corresponding to the sub-coding unit.

9. The method according to claim 8, characterized in that The method further comprises: Encoding the coding tree unit under different types of coding mode restriction types respectively, determining a target coding mode corresponding to each sub-coding unit from the candidate coding mode set, and obtaining sub-coding cost information corresponding to each sub-coding unit according to the target coding mode corresponding to each sub-coding unit; Determining tree coding cost information corresponding to the coding tree unit under different coding mode restriction types according to sub-coding cost information corresponding to each sub-coding unit; Determining a target coding mode restriction type corresponding to the coding tree unit from the different types of coding mode restriction types according to the tree coding cost information corresponding to the coding tree unit; The coding data corresponding to the coding tree unit is obtained according to the target coding mode restriction type.

10. The method according to claim 9, characterized in that The different types of coding mode restriction types include one of the following combinations: a combination of an intra-frame coding mode restriction type and an intra-frame block copy coding mode restriction type, a combination of an inter-frame coding mode restriction type and an intra-frame block copy coding mode restriction type, and a combination of an intra-frame coding mode restriction type, an inter-frame coding mode restriction type and an intra-frame block copy coding mode restriction type.

11. The method according to claim 8, characterized in that The obtaining, according to the target coding mode, the coding data corresponding to the coding tree unit comprises: Generate a corresponding target flag bit according to the target coding mode; The target flag is written into the coding data corresponding to the coding tree unit.

12. A data decoding device, characterized in that: The device comprises: A coding data acquisition module, configured to acquire a coding mode restriction type of a coding tree unit; the coding tree unit includes a plurality of sub-coding units; the coding mode restriction type is used to restrict the coding mode of the coding tree unit to at least one of a candidate coding mode set corresponding to the coding mode restriction type; a target coding mode determination module, configured to determine, for a unit to be decoded corresponding to the sub-coding unit, a candidate coding mode set corresponding to the unit to be decoded according to the coding mode restriction type when the coding mode restriction type is an inter-frame coding mode restriction type or when the coding mode restriction type is an intra-frame coding mode restriction type, wherein the candidate coding mode set at least includes an intra-frame block copy coding mode; and when the coding mode restriction type is a standard inter-frame coding mode restriction type, determine that the candidate coding mode set corresponding to the unit to be decoded includes only a standard inter-frame coding mode; The decoding data generating module is used to decode the unit to be decoded according to the target coding mode selected from the candidate coding mode set to obtain decoding data corresponding to the unit to be decoded.

13. The device according to claim 12, characterized in that The target coding mode determination module is further used to: decode from the encoded data to obtain the coding mode flag information corresponding to the unit to be decoded; and determine the target coding mode corresponding to the unit to be decoded according to the coding mode restriction type and the coding mode flag information.

14. The device according to claim 13, characterized in that The coding mode restriction type is an intra-frame coding mode restriction type, and the target coding mode determination module is further used to: when the value corresponding to the coding mode flag information is a first flag value, determine that the target coding mode is a standard intra-frame coding mode; when the value corresponding to the coding mode flag information is a second flag value, determine that the target coding mode is an intra-frame block copy coding mode.

15. The device according to claim 13, characterized in that The coding mode restriction type is an inter-frame coding mode restriction type, and the target coding mode determination module is further used to: when the value corresponding to the coding mode flag information is a first flag value, determine that the target coding mode is a standard inter-frame coding mode; when the value corresponding to the coding mode flag information is a second flag value, determine that the target coding mode is an intra-frame block copy coding mode.

16. The device according to claim 12, characterized in that The coding mode restriction type is an intra-block copy coding mode restriction type, and the target coding mode determination module is further used to: directly determine that the target coding mode corresponding to the to-be-decoded unit is an intra-block copy coding mode.

17. The device according to claim 12, characterized in that The target coding mode determination module is further used to: when the coding mode restriction type obtained through decoding is a standard intra-frame coding mode restriction type, determine that the target coding mode corresponding to the unit to be decoded is a standard intra-frame coding mode.

18. The device according to any one of claims 12 to 17, characterized in that The decoding data generation module comprises: A coded data processing unit, configured to obtain block vector information and residual information corresponding to the unit to be decoded from the coded data when the target coding mode is an intra-frame block copy coding mode; A prediction information determining unit, configured to determine prediction information corresponding to the unit to be decoded according to the block vector information; A decoded image generation unit is used to obtain a decoded image unit corresponding to the unit to be decoded according to the residual information and the prediction information.

19. A data encoding device, characterized in that: The device comprises: An acquisition module, configured to acquire a coding mode restriction type of a coding tree unit; the coding tree unit includes a plurality of sub-coding units; the coding mode restriction type is used to restrict the coding mode of the coding tree unit to at least one of a candidate coding mode set corresponding to the coding mode restriction type; a coding mode acquisition module, configured to, for the sub-coding unit, determine, according to the coding mode restriction type, a candidate coding mode set corresponding to the sub-coding unit when the coding mode restriction type is an inter-frame coding mode restriction type or when the coding mode restriction type is an intra-frame coding mode restriction type, wherein the candidate coding mode set at least includes an intra-frame block copy coding mode; and determine, when the coding mode restriction type is a standard inter-frame coding mode restriction type, that the candidate coding mode set corresponding to the sub-coding unit includes only a standard inter-frame coding mode; The encoding module is used to encode the sub-coding unit according to the target encoding mode selected from the candidate encoding mode set to obtain encoding data corresponding to the sub-coding unit.

20. The device according to claim 19, characterized in that The coding mode restriction type includes at least two different types of coding mode restriction types, and the data encoding device further includes: a sub-coding cost information determination module, configured to encode the coding tree unit under different types of coding mode restriction types, determine a target coding mode corresponding to each sub-coding unit from the candidate coding mode set, and obtain sub-coding cost information corresponding to each sub-coding unit according to the target coding mode corresponding to each sub-coding unit; A tree coding cost information determination module, configured to determine the tree coding cost information corresponding to the coding tree unit under different coding mode restriction types according to the sub-coding cost information corresponding to each sub-coding unit; a target coding mode restriction type determining module, configured to determine a target coding mode restriction type corresponding to the coding tree unit from the different types of coding mode restriction types according to the tree coding cost information corresponding to the coding tree unit; The coding data generating module is used to obtain the coding data corresponding to the coding tree unit according to the target coding mode restriction type.

21. The device according to claim 20, characterized in that The different types of coding mode restriction types include one of the following combinations: a combination of an intra-frame coding mode restriction type and an intra-frame block copy coding mode restriction type, a combination of an inter-frame coding mode restriction type and an intra-frame block copy coding mode restriction type, and a combination of an intra-frame coding mode restriction type, an inter-frame coding mode restriction type and an intra-frame block copy coding mode restriction type.

22. The device according to claim 19, characterized in that The encoding module is also used to generate a corresponding target flag bit according to the target encoding mode when the encoding mode restriction type is an intra-frame encoding mode restriction type or an inter-frame encoding mode restriction type; and write the target flag bit into the encoding data corresponding to the encoding tree unit.

23. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7 or 8 to 11.

24. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 7 or 8 to 11.