Coding and decoding method and device

By selecting different inter prediction methods based on the foreground or background information of the monitoring video encoding unit, the problems of inaccurate prediction and redundant encoding information in the prior art are solved, and more efficient encoding and reducing encoding complexity are achieved.

CN113301337BActive Publication Date: 2025-05-06BEIJING SAMSUNG TELECOM R&D CENT +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010113883.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-24
Publication Date
2025-05-06
Estimated Expiration
2040-02-24

AI Technical Summary

Technical Problem

The existing video encoding standards use the same inter-prediction encoding and decoding technology for the foreground and background in monitoring videos, resulting in inaccurate prediction and redundant encoding information, high encoding complexity and reduced encoding efficiency.

Method used

According to the foreground or background information of the current encoding unit, different inter prediction methods and encoding and decoding methods are used to derive the predicted values ​​and quantization parameters by obtaining the foreground and/or background information of the encoding unit, thereby improving the encoding efficiency.

Benefits of technology

By distinguishing the motion characteristics of the foreground and background, the encoding efficiency of the monitoring video is improved, the encoding complexity is reduced, and the encoding effect is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113301337B_ABST
    Figure CN113301337B_ABST
Patent Text Reader

Abstract

The present invention relates to a coding and decoding method and a device thereof. The decoding method comprises obtaining information about a prediction unit to be decoded currently from a bit stream, wherein the information about the prediction unit to be decoded currently comprises foreground and / or background information of a coding unit where the prediction unit to be decoded currently is located; and obtaining a reconstruction value of the prediction unit to be decoded currently according to the information about the prediction unit to be decoded currently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video coding and decoding, and in particular to a method and device for coding and decoding of surveillance videos. Background Art

[0002] Unlike natural images, surveillance videos are mostly shot by stationary cameras, usually with a fixed background, and the main background scenery is unchanged. In surveillance videos, users mainly focus on the moving objects in the foreground, and the movement of the foreground is usually more intense. For surveillance videos, if the existing video coding standards, such as HEVC and H.264, are used, the same inter-frame prediction coding and decoding technology is used for the foreground and background, which will not only lead to inaccurate prediction, but also generate redundant coding information, increase coding complexity, and reduce coding efficiency. Summary of the invention

[0003] Technical issues

[0004] To solve the above problems, the present invention proposes a coding and decoding method and a device thereof, in which different inter-frame prediction methods and coding and decoding methods are adopted according to the foreground or background information of the current coding unit.

[0005] Technical Solution

[0006] In one aspect of the present invention, a decoding method is provided, the method comprising: obtaining information about a prediction unit to be currently decoded from a bitstream, the information about the prediction unit to be currently decoded comprising foreground and / or background information of a coding unit where the prediction unit to be currently decoded is located; and obtaining a reconstructed value of the prediction unit to be currently decoded according to the information about the prediction unit to be currently decoded.

[0007] In one aspect of the present invention, a decoding method is provided, wherein obtaining a reconstructed value of a prediction unit to be decoded currently based on the information about the prediction unit to be decoded currently includes: obtaining a prediction value of the prediction unit to be decoded currently based on foreground and / or background information of a coding unit where the prediction unit to be decoded currently is located; and obtaining a reconstructed value of the prediction unit to be decoded currently based on the prediction value of the prediction unit to be decoded currently.

[0008] In one aspect of the present invention, a decoding method is provided, wherein obtaining a prediction value of a prediction unit to be decoded currently based on foreground and / or background information of a coding unit where the prediction unit to be decoded currently is located comprises: obtaining information about adjacent prediction units of the prediction unit to be decoded currently; deriving inter-frame prediction information of the prediction unit to be decoded currently based on foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and information about adjacent prediction units; and obtaining a prediction value of the prediction unit to be decoded currently based on the derived inter-frame prediction information of the prediction unit to be decoded currently.

[0009] According to one aspect of the present invention, a decoding method is provided, wherein the information of the adjacent prediction units includes: foreground and / or background information of the coding unit where the adjacent prediction units are located.

[0010] In one aspect of the present invention, a decoding method is provided, wherein obtaining a reconstructed value of a prediction unit to be decoded currently based on the information about the prediction unit to be decoded currently includes: obtaining a residual value of the prediction unit to be decoded currently; and obtaining a reconstructed value of the prediction unit to be decoded currently based on the prediction value of the prediction unit to be decoded currently and the residual value of the prediction unit to be decoded currently.

[0011] According to one aspect of the present invention, a decoding method is provided, wherein the information about the prediction unit currently to be decoded further includes at least one of the following: residual information and basic quantization parameter information.

[0012] According to one aspect of the present invention, a decoding method is provided, wherein obtaining the residual value of the prediction unit currently to be decoded comprises: obtaining the residual value of the prediction unit currently to be decoded according to information about the prediction unit currently to be decoded.

[0013] In one aspect of the present invention, a decoding method is provided, wherein the inter-frame prediction information of the prediction unit to be decoded currently includes at least one of the following: a motion vector prediction value of the prediction unit to be decoded currently, motion information of the prediction unit to be decoded currently, motion vector accuracy of the prediction unit to be decoded currently, and reference image queue information of the prediction unit to be decoded currently.

[0014] In one aspect of the present invention, a decoding method is provided, wherein the deriving the inter-frame prediction information of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the information of the adjacent prediction units includes: obtaining the motion information of the prediction unit to be decoded currently; deriving the motion vector prediction value of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the motion information of the prediction unit to be decoded currently, as well as the information of the adjacent prediction units.

[0015] In one aspect of the present invention, a decoding method is provided, wherein the deriving the inter-frame prediction information of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the information of the adjacent prediction units comprises: obtaining the coding unit type information of the prediction unit to be decoded currently; deriving the motion information of the skip mode or direct mode of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the coding unit type information of the prediction unit to be decoded currently, as well as the information of the adjacent prediction units.

[0016] In one aspect of the present invention, a decoding method is provided, wherein the inter-frame prediction information of the prediction unit to be decoded currently is derived based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the information of the adjacent prediction units includes: obtaining the motion vector accuracy collection and the motion vector accuracy index value of the prediction unit to be decoded currently according to the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located; obtaining the motion vector accuracy of the current prediction unit with decoding according to the motion vector accuracy collection and the motion vector accuracy index value of the prediction unit to be decoded currently.

[0017] In one aspect of the present invention, a decoding method is provided, wherein deriving inter-frame prediction information of a prediction unit to be decoded currently based on foreground and / or background information of a coding unit where the prediction unit to be decoded currently is located and information of adjacent prediction units includes: constructing a reference image queue of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located.

[0018] In one aspect of the present invention, a decoding method is provided, wherein obtaining the residual value of the prediction unit to be decoded currently based on information about the prediction unit to be decoded currently includes: deriving the quantization parameter of the prediction unit to be decoded currently based on the foreground and / or background information and basic quantization parameter information of the coding unit where the prediction unit to be decoded currently is located, and obtaining the residual value based on the quantization parameter and the residual information.

[0019] In one aspect of the present invention, a decoding method is provided, wherein the deriving of the quantization parameter of the current prediction unit to be decoded based on the foreground and / or background information of the coding unit where the current prediction unit to be decoded is located and the basic quantization parameter information includes: according to the foreground and / or background information of the coding unit where the current prediction unit to be decoded is located, the quantization parameter of the current coding unit to be decoded is obtained according to the absolute value of the difference between the basic quantization parameter and the preset first quantization parameter.

[0020] In one aspect of the present invention, a decoding method is provided, wherein the deriving of the quantization parameter of the current prediction unit to be decoded based on the foreground and / or background information and basic quantization parameter information of the coding unit where the current prediction unit to be decoded is located comprises: decoding the difference of the quantization parameter of the coding unit where the current prediction unit to be decoded is located; and obtaining the value of the quantization parameter of the coding unit where the current prediction unit to be decoded is located based on the difference between the basic quantization parameter and the quantization parameter.

[0021] In one aspect of the present invention, a coding method is provided, the method comprising: obtaining information about a prediction unit to be currently coded, the information comprising foreground and / or background information of a coding unit where the prediction unit to be currently coded is located; and outputting the information about the prediction unit to be currently coded into a bitstream.

[0022] In one aspect of the present invention, a coding method is provided, wherein the method further comprises: when predicting a current prediction unit using an inter-frame prediction mode, deriving a prediction value of the current prediction unit to be encoded according to foreground and / or background information of the coding unit where the current prediction unit to be encoded is located, and obtaining a residual value according to the original pixel value and the prediction value; setting a quantization parameter according to the foreground and / or background information of the coding unit where the current prediction unit to be encoded is located; deriving residual information using the set quantization parameter and the obtained residual value; and outputting the residual information and basic quantization parameter information to a bitstream.

[0023] According to one aspect of the present invention, a coding method is provided, wherein obtaining information about a current prediction unit to be encoded comprises: acquiring a background image, obtaining foreground and / or background information of each coding unit in the current image according to the background image and the current image to be encoded, and encoding the foreground and / or background information of each coding unit according to a set parameter identifying the size of the coding unit.

[0024] In one aspect of the present invention, a coding method is provided, wherein the deriving of the prediction value of the current prediction unit to be encoded based on the foreground and / or background information of the coding unit where the current prediction unit to be encoded is located includes: obtaining the predicted motion information of the current prediction unit to be encoded; setting the range of motion search based on the foreground and / or background information and the predicted motion information of the coding unit where the current prediction unit to be encoded is located; and obtaining the motion vector difference of the current prediction unit to be encoded based on the predicted motion information and the range of motion search of the current prediction unit to be encoded.

[0025] In one aspect of the present invention, a device for executing a decoding method is provided, the device comprising: a receiving unit, which is configured to receive data from a bitstream; a decoder, which is coupled to the receiving unit and configured to: obtain information about a prediction unit to be decoded from the received data, the information about the prediction unit to be decoded includes foreground and / or background information of a coding unit where the prediction unit to be decoded is located; obtain a prediction value of the prediction unit to be decoded according to the foreground and / or background information of the coding unit where the prediction unit to be decoded is located; and obtain a reconstructed value according to the prediction value of the prediction unit to be decoded.

[0026] In one aspect of the present invention, a device for performing a coding method is provided, the device comprising: an encoder, configured to: obtain information about a prediction unit currently to be encoded, the information comprising foreground and / or background information of a coding unit where the prediction unit currently to be encoded is located; output the information about the prediction unit currently to be encoded to a sending unit; and a sending unit, coupled to the encoder and configured to encode the information about the prediction unit currently to be encoded into a bitstream.

[0027] According to one aspect of the present invention, an electronic device is provided, comprising: a memory configured to store a computer program; and a processor configured to read the computer program from the memory and execute the method described.

[0028] Other technical features may be apparent to those skilled in the art from the following drawings and descriptions.

[0029] Advantageous Effects of the Invention

[0030] According to the above scheme of the present invention, the efficiency of monitoring video encoding is improved and the encoding complexity is reduced according to the different motion characteristics between the foreground prediction unit and the background prediction unit and the different focus points of the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] For a more complete understanding of the present disclosure and its advantages, reference is now made to the following description in conjunction with the accompanying drawings, wherein like reference numerals represent like parts:

[0032] Figure 1 is a block diagram showing the spatial position relationship between the current coding unit and the adjacent units;

[0033] Figure 2a and Figure 2b is a block diagram showing a decoding method according to an embodiment of the present invention;

[0034] Figure 3 is a block diagram showing a method for identifying foreground and / or background information of a coding unit according to an embodiment of the present invention;

[0035] Figure 4 is a block diagram showing a method for obtaining a motion vector prediction value of a prediction unit according to an embodiment of the present invention;

[0036] Figure 5 is a block diagram showing the spatial position relationship between the current coding unit and the adjacent units;

[0037] Figure 6 is a block diagram showing a method for deriving motion information of a prediction unit using a skip mode or a direct mode according to an embodiment of the present invention;

[0038] Figure 7 is a block diagram showing a method for deriving a basic unit of a motion vector according to an embodiment of the present invention;

[0039] Figure 8a and Figure 8b is a block diagram showing a method for deriving a quantization parameter of a coding unit in a decoding device according to an embodiment of the present invention;

[0040] Figure 9a and Figure 9b is a block diagram showing an encoding method according to an embodiment of the present invention;

[0041] Fig.10 is a block diagram showing a method for setting a motion search range in an encoding device according to an embodiment of the present invention;

[0042] Fig.11 is a block diagram showing a device for executing a decoding method according to an embodiment of the present invention;

[0043] Fig.12 is a block diagram showing an apparatus for performing an encoding method according to an embodiment of the present invention; and

[0044] Fig.13 is a block diagram showing an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0045] Before proceeding to the following detailed description, it may be advantageous to set forth the definitions of certain words and phrases used throughout this patent document. The term "coupling" and its derivatives refer to any direct or indirect communication between two or more elements, whether or not those elements are in physical contact with each other. The terms "transmission", "receiving" and "communication" and their derivatives cover direct and indirect communication. The terms "include" and "comprising" and their derivatives refer to including but not limited to. The term "or" is inclusive, meaning and / or. The phrase "associated with..." and its derivatives refer to including, including within, interconnecting, containing, contained within, connecting or connecting with, coupling or coupling with, communicating with, cooperating, interweaving, parallel, approaching, binding or binding with, having, having attributes, having a relationship or having a relationship with, etc. The term "controller" refers to any device, system or part thereof that controls at least one operation. Such a controller can be implemented with hardware, or a combination of hardware and software and / or firmware. The functions associated with any particular controller can be centralized or distributed, whether local or remote. The phrase "at least one of", when used with a list of items, means that different combinations of one or more of the listed items may be used, and only one of the items in the list may be required. For example, "at least one of A, B, C" includes any of the following combinations: A, B, C, A and B, A and C, B and C, A and B and C.

[0046] Definitions for other specific words and phrases are provided throughout this patent document. Those of ordinary skill in the art should understand that in many, if not most instances, such definitions apply to prior and future uses of such defined words and phrases.

[0047] In the present invention, the application combination, scanning order and division form of the current coding unit and the adjacent coding unit are only used for illustration, and the application combination, scanning order and division form of the coding unit may have different forms without departing from the scope of the present disclosure.

[0048] The inter-frame prediction modes that may be selected for each prediction unit defined in existing video coding standards (such as HEVC, AVS2, AVS3, VVC, H.264, etc.) include normal motion vector prediction mode, skip mode and direct mode.

[0049] If the current prediction unit is in the normal motion vector prediction mode, the motion information is derived through the following steps: 1) deriving the motion vector prediction value, decoding the motion vector difference information and the motion vector basic unit to obtain the motion vector difference, and adding the motion vector prediction value and the difference to obtain the motion vector value; 2) decoding the reference image information, and obtaining the prediction value of the prediction unit according to the position pointed to by the motion vector on the obtained reference image; 3) decoding the residual information, inverse quantizing and inverse transforming the residual information to obtain the residual value, and adding the residual value and the prediction value to obtain the reconstructed value of the current prediction unit.

[0050] If the current prediction unit is in skip mode or direct mode, the motion information can be derived in the following way: the motion vector and reference image information (prediction direction and reference index) of the spatially adjacent prediction units of the prediction unit are obtained from the adjacent prediction units of the current prediction unit according to a preset scanning order and acquisition rule as the motion information of the current prediction unit.

[0051] The spatial neighboring prediction units of the current prediction unit described in the above method are defined in the AVS3 first stage standard as follows: Figure 1 As shown, the coordinates of the upper left corner sample of E in the image are (x0, y0), (x 1 ,y 0 ) is the coordinate of the upper right corner sample of block E in the image, (x 0 ,y 1 ) is the coordinate of the lower left corner sample of block E in the image. The neighboring units of E are: neighboring unit A is the unit where sample (x0-1, y0) is located, neighboring unit B is the block where sample (x0, y0-1) is located, neighboring block C is the block where sample (x1+1, y0-1) is located, neighboring block D is the block where sample (x0-1, y0-1) is located, neighboring block F is the block where sample (x0-1, y1) is located, and neighboring block G is the block where sample (x1, y0-1) is located. The spatial position relationship between block E and its neighboring blocks is shown in Figure 1 .

[0052] In the AVS3 Phase 1 standard, the above-mentioned motion vector accuracy, that is, the basic unit of the motion vector, is obtained by: obtaining the basic unit of the motion vector according to the decoded motion vector accuracy index:

[0053] If the value of the motion vector precision index is 0, the basic unit of the motion vector is 1 / 4 integer sample;

[0054] If the value of the motion vector precision index is 1, the basic unit of the motion vector is 1 / 2 integer sample;

[0055] If the value of the motion vector precision index is 2, the basic unit of the motion vector is 1 integer sample;

[0056] If the value of the motion vector precision index is 3, the basic unit of the motion vector is 2 integer samples;

[0057] If the value of the motion vector precision index is 4, the basic unit of the motion vector is 4 integer samples.

[0058] However, in existing video coding standards, such as HEVC and H.264, the same inter-frame prediction coding and decoding technology is used for foreground and background in surveillance videos, which leads to inaccurate prediction and redundancy of coding information, resulting in greater coding complexity and reduced coding efficiency.

[0059] The following will refer to Figures 2 to Fig.13 The various embodiments used to describe the principles of the present disclosure in this patent document are merely exemplary and should not be interpreted in any way to limit the scope of the disclosure.

[0060] exist Figure 2a , a block diagram of a decoding method according to an embodiment of the present invention is shown. Figure 2a The embodiments shown in the figure are for illustration only. Other partitioning methods may be used without departing from the scope of the present disclosure.

[0061] refer to Figure 2a At step 201, information about a prediction unit to be currently decoded is obtained from a bitstream, wherein the information about the prediction unit to be currently decoded includes foreground and / or background information of a coding unit where the prediction unit to be currently decoded is located; at step 202, a reconstructed value of the prediction unit to be currently decoded is obtained according to the information about the prediction unit to be currently decoded.

[0062] In one embodiment, obtaining the reconstructed value of the prediction unit to be decoded currently based on the information about the prediction unit to be decoded currently includes: obtaining the prediction value of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located; and obtaining the reconstructed value of the prediction unit to be decoded currently based on the prediction value of the prediction unit to be decoded currently.

[0063] In one embodiment, obtaining the prediction value of the prediction unit to be decoded currently according to the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located includes: obtaining information about adjacent prediction units of the prediction unit to be decoded currently; deriving inter-frame prediction information of the prediction unit to be decoded currently according to the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and information of adjacent prediction units; and obtaining the prediction value of the prediction unit to be decoded currently according to the derived inter-frame prediction information of the prediction unit to be decoded currently.

[0064] In one embodiment, the information of the adjacent prediction unit includes: foreground and / or background information of the coding unit where the adjacent prediction unit is located.

[0065] In one embodiment, obtaining the reconstructed value of the prediction unit to be decoded currently according to the information about the prediction unit to be decoded currently includes: obtaining the residual value of the prediction unit to be decoded currently; and obtaining the reconstructed value of the prediction unit to be decoded currently according to the prediction value of the prediction unit to be decoded currently and the residual value of the prediction unit to be decoded currently.

[0066] In one embodiment, the information about the prediction unit currently to be decoded further includes at least one of the following: residual information and basic quantization parameter information.

[0067] In one embodiment, obtaining the residual value of the prediction unit to be currently decoded comprises: obtaining the residual value of the prediction unit to be currently decoded according to information about the prediction unit to be currently decoded.

[0068] In one embodiment, the inter-frame prediction information of the prediction unit to be decoded currently includes at least one of the following: a motion vector prediction value of the prediction unit to be decoded currently, motion information of the prediction unit to be decoded currently, motion vector accuracy of the prediction unit to be decoded currently, and reference image queue information of the prediction unit to be decoded currently.

[0069] In one embodiment, deriving the inter-frame prediction information of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the information of the adjacent prediction units includes: obtaining the motion information of the prediction unit to be decoded currently; deriving the motion vector prediction value of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the motion information of the prediction unit to be decoded currently, as well as the information of the adjacent prediction units.

[0070] In one embodiment, deriving the inter-frame prediction information of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the information of the adjacent prediction units includes: obtaining the coding unit type information of the prediction unit to be decoded currently; deriving the motion information of the skip mode or direct mode of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the coding unit type information of the prediction unit to be decoded currently, as well as the information of the adjacent prediction units.

[0071] In one embodiment, the method of deriving the inter-frame prediction information of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the information of the adjacent prediction units includes: obtaining the motion vector accuracy collection and the motion vector accuracy index value of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located; and obtaining the motion vector accuracy of the current prediction unit with decoding based on the motion vector accuracy collection and the motion vector accuracy index value of the prediction unit to be decoded currently.

[0072] In one embodiment, deriving the inter-frame prediction information of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the information of the adjacent prediction units includes: constructing a reference image queue of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located.

[0073] In one embodiment, obtaining the residual value of the prediction unit to be decoded currently based on the information about the prediction unit to be decoded currently includes: deriving the quantization parameter of the prediction unit to be decoded currently based on the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the basic quantization parameter information, and obtaining the residual value based on the quantization parameter and the residual information.

[0074] In one embodiment, deriving the quantization parameter of the current prediction unit to be decoded based on the foreground and / or background information of the coding unit where the current prediction unit to be decoded is located and the basic quantization parameter information includes: obtaining the quantization parameter of the current coding unit to be decoded based on the absolute value of the difference between the basic quantization parameter and the preset first quantization parameter according to the foreground and / or background information of the coding unit where the current prediction unit to be decoded is located.

[0075] In one embodiment, deriving the quantization parameter of the current prediction unit to be decoded based on the foreground and / or background information and basic quantization parameter information of the coding unit where the current prediction unit to be decoded is located includes: decoding the difference of the quantization parameter of the coding unit where the current prediction unit to be decoded is located; and obtaining the value of the quantization parameter of the coding unit where the current prediction unit to be decoded is located based on the difference between the basic quantization parameter and the quantization parameter.

[0076] Figure 2b A block diagram of yet another decoding method according to an embodiment of the present invention is shown in FIG. Figure 2b The embodiments shown in the figure are for illustration only. Other partitioning methods may be used without departing from the scope of the present disclosure.

[0077] refer to Figure 2bIn step 201', information about the prediction unit to be decoded is obtained from the bitstream, the information including the foreground and / or background information, residual information, basic quantization parameter information, etc. of the coding unit where the prediction unit to be decoded is located; in step 202', information about the neighboring prediction units of the prediction unit to be decoded is obtained, the information including the foreground and / or background information, motion information, coding unit type information and position information, etc. of the coding unit where the neighboring prediction units are located; in step 203', inter-frame prediction information is derived according to the foreground and / or background information of the prediction unit to be decoded and the information of the neighboring prediction units; in step 204', a prediction value of the prediction unit to be decoded is obtained according to the derived inter-frame prediction information; in step 205', residual information and quantization parameter information of the prediction unit to be decoded is obtained, and the residual information is inversely quantized and inversely transformed to obtain the residual value of the prediction unit to be decoded; and in step 206', the prediction value and the residual value of the prediction unit to be decoded are added to obtain a reconstructed value.

[0078] Figure 3 A block diagram of a method for identifying foreground and / or background information of a coding unit according to an embodiment of the present invention is shown. Figure 3 The embodiments shown in the figure are for illustration only. Other partitioning methods may be used without departing from the scope of the present disclosure.

[0079] refer to Figure 3 In step 301, a background image is obtained; the method for obtaining the background image can be any of the following methods, which are not limited here: 1) K-means clustering method; 2) mean method; 3) median method; 4) single Gaussian background modeling method; 5) mixed Gaussian background modeling method, etc. In step 302, the background image and the current image to be encoded are subtracted to obtain the foreground and / or background information of each coding unit in the current image. Specifically, the absolute value of the difference between the current image pixel value and the background image pixel value at the corresponding position in the coding unit is greater than the number of the set first threshold; when the number exceeds the set second threshold, the current coding unit is the foreground, marked as 1; otherwise, the current coding unit is the background, marked as 0. In step 303, the foreground and / or background information of the current coding unit, that is, the foreground background mark (1 bit, 1 or 0) in this embodiment is encoded and transmitted to the decoding device.

[0080] The foreground and / or background information may be set for each maximum coding unit, or may be set for each coding unit in the maximum coding unit. If the small coding unit does not have the foreground and / or background information set separately, the foreground and / or background information of the large coding unit in which it is located may be shared. For example, in the AVS3 standard, the sizes of the coding units include: 128x128, 64x64, 32x32, 16x16 and 8x8, and the sizes of the coding units for setting the foreground and / or background information may be: 1) 128x128, 2) 128x128 and 64x64, 3) 128x128, 64x64 and 32x32, 4) 128x128, 64x64, 32x32 and 16x16, 5) 128x128, 64x64, 32x32, 16x16 and 8x8. There is no restriction on the size of the coding unit for the foreground and / or background information, but the size must contain at least the maximum coding unit. For example, AVS3 contains at least 128x128.

[0081] The same parameters for identifying the size of the coding unit of the foreground and background are set in the encoding device and the decoding device. Taking AVS3 as an example, specifically:

[0082] If the coding unit size of the foreground and / or background information is 128x128, this parameter is 0 (or the parameter is 1);

[0083] If the coding unit size of the foreground and / or background information is 128x128, 64x64, this parameter is 1 (or the parameter is 2);

[0084] If the coding unit size of the foreground and / or background information is 128x128, 64x64, or 32x32, this parameter is 2 (or 3);

[0085] If the coding unit size of the foreground and / or background information is 128x128, 64x64, 32x32, or 16x16, this parameter is 3 (or 4);

[0086] If the coding unit size of the foreground and / or background information is 128x128, 64x64, 32x32, 16x16, or 8x8, this parameter is 4 (or 5).

[0087] In the decoding device, the foreground and / or background information is decoded according to the "parameter for identifying the size of the coding unit of the foreground and background", specifically:

[0088] If the parameter is 0, only one coded foreground and / or background information is decoded in each 128x128 coding unit, and the small-sized coding units within the 128x128 coding unit share this 128x128 information;

[0089] If the parameter is 1, only one coded foreground and / or background information is decoded in each 128x128 coding unit and each 64x64 coding unit, and the small-size coding units within the 64x64 coding unit share this 64x64 information;

[0090] If the parameter is 2, only one coded foreground and / or background information is decoded in each 128x128 coding unit, each 64x64 coding unit, and each 32x32 coding unit, and the small-size coding units within the 32x32 coding unit share this 32x32 information;

[0091] If the parameter is 3, only one coded foreground and / or background information is decoded in each 128x128 coding unit, each 64x64 coding unit, each 32x32 coding unit, and each 16x16 coding unit, and the small-size coding units within the 16x16 coding unit share this 16x16 information;

[0092] If the parameter is 4, only one coded foreground and / or background information is decoded in each 128x128 coding unit, each 64x64 coding unit, each 32x32 coding unit, each 16x16 coding unit and each 8x8 coding unit.

[0093] Figure 4 is a block diagram showing a method for obtaining a motion vector prediction value of a prediction unit according to an embodiment of the present invention. Figure 4 The embodiments shown in the embodiment are for illustration only. Other partitioning methods and sequences may be used without departing from the scope of the present disclosure.

[0094] refer to Figure 4 In step 401, foreground and / or background information of the coding unit where the prediction unit to be decoded is located and motion vector prediction information of the prediction unit to be decoded are obtained, and the motion vector prediction information includes: the type of the motion vector, etc. In step 402, a motion vector prediction value is obtained according to the type of the motion vector of the prediction unit to be decoded.

[0095] The type of the current motion vector to be predicted may be: ordinary motion vector, affine motion vector, etc.

[0096] (I) If the type of the current motion vector to be predicted is a common motion vector, perform the following operations:

[0097] 1) Obtain motion information of neighboring prediction units of a current prediction unit to be decoded, and determine the availability of the motion information of the neighboring prediction units.

[0098] Specifically, if the coding unit where the current prediction unit E to be decoded is located is the foreground, the adjacent prediction unit is X (X is Figure 5 A, B, C, D, F or G in (not limited here), if the adjacent prediction unit X meets all the following conditions, the motion information of the adjacent prediction unit X is "available", otherwise it is "unavailable": a) the adjacent prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the adjacent prediction unit is located is the foreground; c) the adjacent prediction unit does not adopt the intra-frame prediction mode; d) the adjacent prediction unit has a motion vector of the ordinary motion vector type.

[0099] If the coding unit where the current prediction unit E to be decoded is located is the background, and its adjacent prediction unit X meets all the following conditions, the motion information of the adjacent prediction unit is "available", otherwise it is "unavailable": a) the adjacent prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the adjacent prediction unit is located is the background; c) the adjacent prediction unit does not adopt the intra-frame prediction mode; d) the adjacent prediction unit has a motion vector of the same type as the ordinary motion vector.

[0100] 2) Obtain the motion vector prediction value of the prediction unit E currently to be decoded according to the available motion information.

[0101] (II) If the type of the currently predicted motion vector is an affine motion vector, perform the following operations:

[0102] 1) Obtain motion information of neighboring prediction units of the current prediction unit to be decoded, and determine the availability of the motion information of the neighboring prediction units.

[0103] Specifically, if the coding unit where the current prediction unit E to be decoded is located is the foreground, the adjacent prediction unit is X (X is Figure 5 A, B, C, D, F or G in, A, D and B are foregrounds, C, G and F are backgrounds), if X meets all the following conditions, the motion information of X is "available", otherwise it is "unavailable": a) the neighboring prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the neighboring prediction unit is located is the foreground; c) the neighboring prediction unit does not adopt the intra prediction mode; d) the neighboring prediction unit has a motion vector of the same type as the affine motion vector.

[0104] If the coding unit where the current prediction unit E to be decoded is located is the background, and its adjacent prediction unit X meets all the following conditions, the motion information of the adjacent prediction unit is "available", otherwise it is "unavailable": a) the adjacent prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the adjacent prediction unit is located is the background; c) the adjacent prediction unit does not adopt the intra-frame prediction mode; d) the adjacent prediction unit has a motion vector of the same type as the affine motion vector.

[0105] 2) Obtain the motion vector prediction value of the prediction unit E currently to be decoded according to the available motion information.

[0106] Figure 6 The invention is a block diagram showing a method for deriving motion information of a prediction unit using a skip mode or a direct mode according to an embodiment of the present invention. The motion information includes: prediction reference mode, motion vector, reference index and other information; wherein the prediction reference mode includes: 1) the prediction unit uses queue 0 reference, and the number of motion vectors of the prediction unit is equal to 1; 2) the prediction unit uses queue 1 reference, and the number of motion vectors of the prediction unit is equal to 1; 3) the prediction unit uses dual queue reference, and the number of motion vectors of the prediction unit is equal to 2. Figure 6 The embodiments shown in the embodiment are for illustration only. Other orders and unit divisions may be used without departing from the scope of the present disclosure.

[0107] refer to Figure 6 In step 601, the type of the coding unit where the current prediction unit to be decoded is located and the foreground and / or background information of the coding unit is obtained; in step 602, if the type of the coding unit where the current prediction unit is located is P picture skip mode, P picture direct mode, B picture skip mode, or B picture direct mode, then the subtype of the coding unit is obtained, wherein the P picture is unidirectional inter-frame prediction, that is, only reference is made to the spatial reference queue 0, and the B picture is bidirectional inter-frame prediction, that is, the spatial reference queue 0, or 1, or both the reference queues 0 and 1 can be referenced; in step 603, the motion information of the adjacent prediction units of the current prediction unit to be decoded and the foreground and / or background information of the coding unit is obtained, wherein the motion information includes: prediction reference mode, motion vector, reference index and other information, and the motion information is derived according to the subtype of the coding unit where the current prediction unit to be decoded is located.

[0108] The subtypes of the coding units of the P-picture skip mode and the P-picture direct mode include: using temporal reference, using spatial queue 0 reference, advanced motion vector expression, affine motion, and motion vector prediction based on historical information. Among them, the subtype "using spatial queue 0 reference" indicates that the prediction reference mode of the prediction unit to be decoded is using queue 0 reference.

[0109] The subtypes of the coding units of the B-picture skip mode and the B-picture direct mode include: using temporal reference, using spatial queue 0 reference, using spatial queue 1 reference, using spatial dual queue (0 and 1) reference, advanced motion vector expression, affine motion, and motion vector prediction based on historical information. Among them, the subtype "using spatial queue 0 reference" means that the prediction reference mode of the prediction unit to be decoded currently is using queue 0 reference; "using spatial queue 1 reference" means that the prediction reference mode of the prediction unit to be decoded currently is using queue 0 reference; "using spatial dual queue reference" means that the prediction reference mode of the prediction unit to be decoded currently is using dual queue reference.

[0110] Forecast

[0111] (I) If the coding unit where the current prediction unit to be decoded is located is foreground, and the subtype is any of the following: 1) using spatial queue 0 reference in P picture skip mode; 2) using spatial queue 0 reference in P picture direct mode, the motion information is derived according to the following steps:

[0112] If, among the six adjacent prediction units F, G, C, A, B, and D of the prediction unit E to be decoded currently, the number of adjacent prediction units whose coding unit is located in the foreground and whose prediction reference mode is 'queue 0 reference' is greater than or equal to 1, the adjacent prediction units are sequentially scanned in the order of F, G, C, A, B, and D (or other methods may be used, which are not limited here) to obtain the first scanned prediction unit whose coding unit is located in the foreground and whose prediction reference mode is 'queue 0 reference', and the queue 0 motion vector and the queue 0 reference index of the spatial motion information storage unit of the prediction unit are respectively used as the queue 0 motion vector and the queue 0 reference index of the prediction unit to be decoded currently;

[0113] Otherwise, the queue 0 motion vector of the current prediction unit to be decoded is a zero vector, and the value of the queue 0 reference index of the current prediction unit to be decoded is equal to 0;

[0114] Set the prediction reference mode of the prediction unit to be decoded to 'queue 0 reference'.

[0115] (II) If the coding unit where the current prediction unit to be decoded is located is foreground, and the subtype is any of the following: using spatial queue 0 reference, using spatial queue 1 reference, or using spatial double queue (0 and 1) reference in B picture skip mode; or using spatial queue 0 reference, using spatial queue 1 reference, or using spatial double queue (0 and 1) reference in B picture direct mode, the motion information is derived according to the following steps:

[0116] (A) If, among the six adjacent prediction units F, G, C, A, B, and D of the current prediction unit, the coding unit where the adjacent prediction unit is located is the foreground, and the number of prediction units whose prediction reference mode is "dual queue reference" is greater than or equal to 1, then the adjacent prediction units are scanned in sequence in the order of F, G, C, A, B, and D (or other methods can be used, which are not limited here) to obtain the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is "dual queue reference", and the queue 0 motion vector and queue 1 motion vector of the spatial motion information storage unit of the prediction unit are respectively used as the queue 0 motion vector and queue 1 motion vector of the current prediction unit to be decoded, and the queue 0 reference index and queue 1 reference index of the spatial motion information storage unit are respectively used as the queue 0 reference index and queue 1 reference index of the current prediction unit to be decoded.

[0117] Otherwise, if, among the six adjacent prediction units F, G, C, A, B, and D of the current prediction unit to be decoded, the coding unit where the adjacent prediction unit is located is the foreground, and the number of prediction units whose prediction reference mode is 'queue 0 reference' is greater than or equal to 1, and the number of prediction units whose prediction reference mode is 'queue 1 reference' is greater than or equal to 1, then the adjacent prediction units are scanned in the order of F, G, C, A, B, and D (or other methods can be used, which are not limited here) to obtain the first scanned adjacent prediction unit whose coding unit is the foreground and whose prediction reference mode is 'queue 0 reference' The prediction unit and the first scanned prediction unit whose coding unit is the foreground and whose prediction reference mode is 'queue 1 reference', use the queue 0 motion vector and queue 0 motion index of the spatial motion information storage unit of the prediction unit whose prediction reference mode is 'queue 0 reference' as the queue 0 motion vector and queue 0 motion index of the current prediction unit to be decoded; use the queue 1 motion vector and queue 1 reference index of the spatial motion information storage unit of the prediction unit whose prediction reference mode is 'queue 1 reference' as the queue 1 motion vector and queue 1 reference index of the current prediction unit to be decoded.

[0118] Otherwise, the queue 0 motion vector and the queue 1 motion vector of the prediction unit to be decoded currently are both zero vectors, and the values ​​of the queue 0 reference index and the queue 1 reference index of the prediction unit to be decoded currently are both equal to 0.

[0119] Set the prediction reference mode of the current prediction unit to be decoded to 'dual queue reference'.

[0120] (B) If, among the six adjacent prediction units F, G, C, A, B, and D of the prediction unit currently to be decoded, the coding unit where the adjacent prediction unit is located is the foreground, and the number of prediction units whose prediction reference mode is "queue 1 reference" is greater than or equal to 1, then the adjacent prediction units are scanned in sequence in the order of F, G, C, A, B, and D (or other methods may be used, which are not limited here) to obtain the first scanned prediction unit whose coding unit is the foreground and whose prediction reference mode is "queue 1 reference", and the queue 1 motion vector and queue 1 reference index of the spatial motion information storage unit of the prediction unit are used as the queue 1 motion vector and queue 1 reference index of the prediction unit currently to be decoded.

[0121] Otherwise, if among the six adjacent prediction units F, G, C, A, B, and D of the current prediction unit to be decoded, the coding unit where the adjacent prediction unit is located is the foreground, and the number of prediction units whose prediction reference mode is "double queue reference" is greater than or equal to 1, then the adjacent prediction units are scanned in the order of D, B, A, C, G, and F (it can also be other orders, which are not limited here) to obtain the first scanned prediction unit whose coding unit is the foreground and whose prediction reference mode is "double queue reference", and the queue 1 motion vector and queue 1 reference index of the spatial motion information storage unit of the prediction unit are used as the queue 1 motion vector and L queue 1 reference index of the current prediction unit to be decoded.

[0122] Otherwise, the queue 1 motion vector of the prediction unit to be currently decoded is a zero vector, and the value of the queue 1 reference index of the prediction unit to be currently decoded is equal to 0.

[0123] Set the prediction reference mode of the current prediction unit to 'queue 1 reference'.

[0124] (C) If, among the six adjacent prediction units F, G, C, A, B, and D of the prediction unit currently to be decoded, the number of prediction units whose coding unit is located in the foreground and whose prediction reference mode is 'queue 0 reference' is greater than or equal to 1, then the adjacent prediction units are scanned in sequence in the order of F, G, C, A, B, and D (or other methods may be used, which are not limited here) to obtain the first scanned prediction unit whose coding unit is located in the foreground and whose prediction reference mode is 'queue 0 reference', and the queue 0 motion vector and queue 0 reference index of the spatial motion information storage unit of the prediction unit are used as the queue 0 motion vector and queue 0 reference index of the prediction unit currently to be decoded.

[0125] Otherwise, if among the six adjacent prediction units F, G, C, A, B, and D of the current prediction unit to be decoded, the coding unit where the adjacent prediction unit is located is the foreground, and the number of prediction units whose prediction reference mode is "double queue reference" is greater than or equal to 1, then the adjacent prediction units are scanned in sequence in the order of D, B, A, C, G, and F (or other methods can be used, which are not limited here) to obtain the first scanned prediction unit whose coding unit is the foreground and whose prediction reference mode is "double queue reference", and the queue 0 motion vector and queue 0 reference index of the spatial motion information storage unit of the prediction unit are used as the queue 0 motion vector and queue 0 reference index of the current prediction unit to be decoded.

[0126] Otherwise, the queue 0 motion vector of the prediction unit currently to be decoded is a zero vector, and the value of the queue 0 reference index of the prediction unit currently to be decoded is equal to 0.

[0127] Set the prediction reference mode of the prediction unit to be decoded to 'queue 0 reference'.

[0128] (III) If the coding unit where the current prediction unit to be decoded is located is foreground, and the subtype is any of the following: 1) advanced motion vector expression of P picture skip mode; 2) advanced motion vector expression of P picture direct mode; 3) advanced motion vector expression of B picture skip mode; 4) advanced motion vector expression of B picture direct mode, the motion information is derived according to the following steps:

[0129] The availability of neighboring prediction units of the current prediction unit to be decoded is determined, and F, G, C, A and D are neighboring prediction units of the current prediction unit E to be decoded (or other combinations may be used, which are not limited here).

[0130] a) If F exists and the coding unit it belongs to is the foreground and the inter-frame prediction mode is used, then F is "available"; otherwise, F is "unavailable".

[0131] b) If G exists and the coding unit it belongs to is the foreground, and the inter-frame prediction mode is used and the motion information of G and F are different, then G is "available"; otherwise, G is "unavailable".

[0132] c) If C exists and the coding unit it belongs to is the foreground, and the inter-frame prediction mode is used and the motion information of C and G are different, then C is "available"; otherwise, C is "unavailable".

[0133] d) If A exists and the coding unit it belongs to is the foreground, and the inter-frame prediction mode is used and the motion information of A and F are different, then A is "available"; otherwise, A is "unavailable".

[0134] e) If D exists and the coding unit it belongs to is the foreground, and the inter-frame prediction mode is used, and the motion information of D and A is different, and the motion information of D and G is also different, then D is "available"; otherwise, D is "unavailable".

[0135] According to the availability of neighboring prediction units of the prediction unit to be currently decoded, information expressed by a high-level motion vector of the prediction unit to be currently decoded is determined.

[0136] (IV) If the coding unit where the prediction unit to be decoded is located is the foreground, and the subtype is any of the following: 1) affine motion of P picture skip mode; 2) affine motion of P picture direct mode; 3) affine motion of B picture skip mode; 4) affine motion of B picture direct mode, derive the affine motion information of the prediction unit to be decoded according to the following steps:

[0137] If the neighboring prediction unit X (X is F, G, C, A, B or D) of the current prediction unit E to be decoded exists, and the coding unit is the foreground and the prediction mode is inter-frame, then the neighboring unit X is "available"; otherwise, the neighboring unit X is "unavailable".

[0138] According to the availability of neighboring prediction units of the current prediction unit to be decoded, affine motion information of the current prediction unit to be decoded is derived.

[0139] Background

[0140] (I) If the coding unit where the current prediction unit to be decoded is located is background, and the subtype is any of the following: 1) using spatial queue 0 reference in P picture skip mode; 2) using spatial queue 0 reference in P picture direct mode, the motion information is derived according to the following steps:

[0141] If, among the six adjacent prediction units F, G, C, A, B, and D of the current prediction unit to be decoded, the coding unit where the adjacent prediction unit is located is the background, and the number of prediction units whose prediction reference mode is 'queue 0 reference' is greater than or equal to 1, then the adjacent prediction units are scanned in sequence in the order of F, G, C, A, B, and D (or other methods can be used, which are not limited here) to obtain the first scanned prediction unit whose coding unit is the background and whose prediction reference mode is 'queue 0 reference', and the queue 0 motion vector and queue 0 reference index of the spatial motion information storage unit of the prediction unit are respectively used as the queue 0 motion vector and queue 0 reference index of the current prediction unit to be decoded.

[0142] Otherwise, the queue 0 motion vector of the prediction unit currently to be decoded is a zero vector, and the value of the queue 0 reference index of the prediction unit currently to be decoded is equal to 0.

[0143] Set the prediction reference mode of the prediction unit to be decoded to 'queue 0 reference'.

[0144] (II) If the coding unit where the current prediction unit to be decoded is located is the background, and the subtype is any of the following: using spatial queue 0 reference, using spatial queue 1 reference, or using spatial double queue (0 and 1) reference in B-picture skip mode; or using spatial queue 0 reference, using spatial queue 1 reference, or using spatial double queue (0 and 1) reference in B-picture direct mode, the motion information is derived according to the following steps:

[0145] (A) If, among the six adjacent prediction units F, G, C, A, B, and D of the prediction unit to be currently decoded, the number of prediction units whose coding units are located as background and whose prediction reference mode is "dual queue reference" is greater than or equal to 1, the adjacent prediction units are scanned in sequence in the order of F, G, C, A, B, and D (or other methods may be used, which are not limited here) to obtain the first scanned prediction unit whose coding unit is located as background and whose prediction reference mode is "dual queue reference", and the queue 0 motion vector and queue 1 motion vector of the spatial motion information storage unit of the prediction unit are respectively used as the queue 0 motion vector and queue 1 motion vector of the prediction unit to be currently decoded, and the queue 0 reference index and queue 1 reference index of the spatial motion information storage unit are respectively used as the queue 0 reference index and queue 1 reference index of the prediction unit to be currently decoded.

[0146] Otherwise, if, among the six adjacent prediction units F, G, C, A, B, and D of the current prediction unit to be decoded, the coding unit where the adjacent prediction unit is located is the background, and the number of prediction units whose prediction reference mode is 'queue 0 reference' is greater than or equal to 1, and the number of prediction units whose prediction reference mode is 'queue 1 reference' is greater than or equal to 1, then the adjacent prediction units are scanned in the order of F, G, C, A, B, and D (or other methods can be used, which are not limited here) to obtain the first scanned adjacent prediction unit, whose coding unit is the background and whose prediction reference mode is 'queue 0 reference' The prediction unit and the first scanned prediction unit whose coding unit is the background and whose prediction reference mode is 'queue 1 reference', use the queue 0 motion vector and queue 0 motion index of the spatial motion information storage unit of the prediction unit whose prediction reference mode is 'queue 0 reference' as the queue 0 motion vector and queue 0 motion index of the current prediction unit to be decoded; use the queue 1 motion vector and queue 1 reference index of the spatial motion information storage unit of the prediction unit whose prediction reference mode is 'queue 1 reference' as the queue 1 motion vector and queue 1 reference index of the current prediction unit to be decoded.

[0147] Otherwise, the queue 0 motion vector and the queue 1 motion vector of the prediction unit to be decoded currently are both zero vectors, and the values ​​of the queue 0 reference index and the queue 1 reference index of the prediction unit to be decoded currently are both equal to 0.

[0148] Set the prediction reference mode of the current prediction unit to be decoded to 'dual queue reference'.

[0149] (B) If, among the six adjacent prediction units F, G, C, A, B, and D of the prediction unit currently to be decoded, the number of prediction units whose coding units are located as the background and whose prediction reference mode is "queue 1 reference" is greater than or equal to 1, then the adjacent prediction units are scanned in sequence in the order of F, G, C, A, B, and D (or other methods may be used, which are not limited here) to obtain the first scanned prediction unit whose coding unit is the background and whose prediction reference mode is "queue 1 reference", and the queue 1 motion vector and queue 1 reference index of the spatial motion information storage unit of the prediction unit are used as the queue 1 motion vector and queue 1 reference index of the prediction unit currently to be decoded.

[0150] Otherwise, if among the six adjacent prediction units F, G, C, A, B, and D of the current prediction unit to be decoded, the coding unit where the adjacent prediction unit is located is the background, and the number of prediction units whose prediction reference mode is "double queue reference" is greater than or equal to 1, then the adjacent prediction units are scanned in sequence in the order of D, B, A, C, G, and F (or other methods can be used, which are not limited here) to obtain the first scanned prediction unit whose coding unit is the background and whose prediction reference mode is "double queue reference", and the queue 1 motion vector and queue 1 reference index of the spatial motion information storage unit of the prediction unit are used as the queue 1 motion vector and L queue 1 reference index of the current prediction unit to be decoded.

[0151] Otherwise, the queue 1 motion vector of the prediction unit to be currently decoded is a zero vector, and the value of the queue 1 reference index of the prediction unit to be currently decoded is equal to 0.

[0152] Set the prediction reference mode of the prediction unit to be decoded to 'queue 1 reference'.

[0153] (C) If, among the six adjacent prediction units F, G, C, A, B, and D of the current prediction unit to be decoded, the number of prediction units whose coding units are located as the background and whose prediction reference mode is 'queue 0 reference' is greater than or equal to 1, then the adjacent prediction units are scanned in sequence in the order of F, G, C, A, B, and D (or other methods can be used, which are not limited here) to obtain the first scanned prediction unit whose coding unit is the background and whose prediction reference mode is 'queue 0 reference', and the queue 0 motion vector and queue 0 reference index of the spatial motion information storage unit of the prediction unit are used as the queue 0 motion vector and queue 0 reference index of the current prediction unit to be decoded.

[0154] Otherwise, if among the six adjacent prediction units F, G, C, A, B, and D of the current prediction unit to be decoded, the coding unit where the adjacent prediction unit is located is the background, and the number of prediction units whose prediction reference mode is "double queue reference" is greater than or equal to 1, then the adjacent prediction units are scanned in sequence in the order of D, B, A, C, G, and F (or other methods can be used, which are not limited here) to obtain the first scanned prediction unit whose coding unit is the background and whose prediction reference mode is "double queue reference", and the queue 0 motion vector and queue 0 reference index of the spatial motion information storage unit of the prediction unit are used as the queue 0 motion vector and queue 0 reference index of the current prediction unit to be decoded.

[0155] Otherwise, the queue 0 motion vector of the prediction unit currently to be decoded is a zero vector, and the value of the queue 0 reference index of the prediction unit currently to be decoded is equal to 0.

[0156] Set the prediction reference mode of the prediction unit to be decoded to 'queue 0 reference'.

[0157] (III) If the coding unit where the prediction unit to be decoded is located is background, and the subtype is any of the following: 1) advanced motion vector expression of P picture skip mode; 2) advanced motion vector expression of P picture direct mode; 3) advanced motion vector expression of B picture skip mode; 4) advanced motion vector expression of B picture direct mode, the motion information is derived according to the following steps:

[0158] The availability of neighboring prediction units of the current prediction unit to be decoded is determined, and F, G, C, A and D are neighboring prediction units of the current prediction unit E (or other combinations may be used, which are not limited here).

[0159] f) If F exists and the coding unit it belongs to is the background, and the inter-frame prediction mode is adopted, then F is "available"; otherwise, F is "unavailable".

[0160] g) If G exists and the coding unit it belongs to is the background, and the inter-frame prediction mode is used and the motion information of G and F are different, then G is "available"; otherwise, G is "unavailable".

[0161] h) If C exists and the coding unit it belongs to is the background, and the inter-frame prediction mode is used and the motion information of C and G are different, then C is "available"; otherwise, C is "unavailable".

[0162] i) If A exists and the coding unit it belongs to is the background, and the inter-frame prediction mode is used and the motion information of A and F are different, then A is "available"; otherwise, A is "unavailable".

[0163] j) If D exists and the coding unit it belongs to is the background, and the inter-frame prediction mode is used, and the motion information of D and A are different, and the motion information of D and G are also different, then D is "available"; otherwise, D is "unavailable".

[0164] According to the availability of neighboring prediction units of the prediction unit to be currently decoded, information expressed by a high-level motion vector of the prediction unit to be currently decoded is determined.

[0165] (IV) If the coding unit where the prediction unit to be decoded is located is the background, and the subtype is any of the following: 1) affine motion of P picture skip mode; 2) affine motion of P picture direct mode; 3) affine motion of B picture skip mode; 4) affine motion of B picture direct mode, derive the affine motion information of the current prediction unit according to the following steps:

[0166] If the neighboring prediction unit X (X is F, G, C, A, B or D) of the current prediction unit to be decoded exists, and the coding unit is the background, and the prediction mode is inter-frame, then the neighboring unit X is "available"; otherwise, the neighboring unit X is "unavailable";

[0167] According to the availability of neighboring prediction units of the current prediction unit to be decoded, affine motion information of the current prediction unit is derived.

[0168] Figure 7 is a block diagram showing a method for deriving a basic unit of a motion vector according to an embodiment of the present invention, wherein the basic unit of a motion vector may also be referred to as a motion vector accuracy. Figure 7 The embodiments shown in the embodiment are for illustration only. Other orders and unit divisions may be used without departing from the scope of the present disclosure.

[0169] refer to Figure 7, discloses a method for obtaining motion vector accuracy in a decoding device, and sets different methods for obtaining motion vector accuracy according to different motion characteristics of foreground and background. In step 701, obtain foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located; in step 702, obtain a motion vector accuracy set of the prediction unit to be decoded currently according to the obtained foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located; in step 703, obtain a motion vector accuracy index value of the prediction unit to be decoded currently; in step 704, obtain a basic unit of the motion vector of the prediction unit to be decoded currently according to the motion vector accuracy index value and the motion vector accuracy set.

[0170] Specifically, if the coding unit where the current prediction unit to be decoded is located is the foreground, its motion vector precision set is {1 / 4, 1 / 2, 1, 2, 4}, and the index value of its motion vector precision ranges from 0 to 4 and is an integer; that is:

[0171] -When the index value is 0, the basic unit of the motion vector is 1 / 4 integer sample;

[0172] -When the index value is 1, the basic unit of the motion vector is 1 / 2 integer sample;

[0173] -When the index value is 2, the basic unit of the motion vector is 1 integer sample;

[0174] -When the index value is 3, the basic unit of the motion vector is 2 integer samples;

[0175] -When the index value is 4, the basic unit of the motion vector is 4 integer samples.

[0176] If the coding unit where the prediction unit to be decoded is located is the background, its motion vector precision set is {1 / 4, 1 / 2, 1}, and the index value of its motion vector precision ranges from 0, 1, 2; that is:

[0177] -When the index value is 0, the basic unit of the motion vector is 1 / 4 integer sample;

[0178] -When the index value is 1, the basic unit of the motion vector is 1 / 2 integer sample;

[0179] -When the index value is 2, the basic unit of the motion vector is 1 integer sample.

[0180] In another embodiment, the motion vector accuracy set of the prediction unit whose coding unit is the foreground includes values ​​less than 1, values ​​equal to 1, and values ​​greater than 1; the motion vector accuracy set of the prediction unit whose coding unit is the background includes values ​​less than 1 and values ​​equal to 1; the specific number of accuracy values ​​in the motion vector accuracy set is not limited here.

[0181] Under normal circumstances, the background of an image has no motion or very slight motion, so the basic unit value of the motion vector is set to be small; while the foreground may move violently or slightly, so the basic unit value of the motion vector can range from small to large. According to an embodiment of the present invention, it can save the number of bits used for encoding and transmitting the index value of the motion vector precision, thereby saving the bit rate.

[0182] According to an embodiment of the present invention, a method for constructing a reference image queue is provided, wherein different reference image queue construction methods are adopted for prediction units whose coding units are foregrounds and prediction units whose coding units are backgrounds, while the construction methods in the encoding device and the decoding device are consistent.

[0183] Specifically, when the coding unit where the prediction unit is located is a background, the reference image queue includes: 1) a background image, or 2) a background image and an encoded or decoded image that is adjacent to the current image.

[0184] When the coding unit where the prediction unit is located is a foreground, there is no restriction on the images included in the reference image queue, but in general, the cases where the reference image queue includes encoded or decoded images are more common than the cases where the reference image queue includes background images.

[0185] In general, the background is still or has only slight motion, such as the disturbance of leaves and grass in the wind, so the number of reference images can be relatively small, and only the background image can be used as a reference, or the most relevant (immediately adjacent to the current image) encoded / decoded image in the time domain can be used as a reference. According to the embodiment of the present invention, the encoding complexity of the encoding end can be reduced, and the number of bits of the encoding reference image index value can be reduced, thereby saving bit rate.

[0186] Figure 8a and Figure 8b is a block diagram illustrating a method for deriving a quantization parameter of a coding unit in a decoding device according to an embodiment of the present invention. Figure 8a and Figure 8b The embodiments shown in the figure are for illustration only. Other partitioning methods may be used without departing from the scope of the present disclosure.

[0187] refer to Figure 8a In step 801, the foreground and / or background information of the current coding unit to be decoded is obtained; in step 802, basic quantization parameter information is obtained, and the quantization parameter information of the current coding unit to be decoded is obtained according to the foreground and / or background information of the current coding unit to be decoded; the basic quantization parameter information can be an average quantization parameter of the current image to be decoded, or a quantization parameter of a previously decoded coding unit, etc., which is not limited here.

[0188] In another embodiment, if the current coding unit to be decoded is the foreground, the quantization parameter of the current coding unit to be decoded is set to the basic quantization parameter minus the absolute value of the first quantization parameter difference; if the current coding unit to be decoded is the background, the quantization parameter of the current coding unit to be decoded is set to the basic quantization parameter value.

[0189] In another embodiment, if the current coding unit to be decoded is the background, the quantization parameter of the current coding unit to be decoded is set to the basic quantization parameter plus the absolute value of the second quantization parameter difference; if the current coding unit to be decoded is the foreground, the quantization parameter of the current coding unit to be decoded is set to the basic quantization parameter.

[0190] The absolute value of the first quantization parameter difference and the absolute value of the second quantization parameter difference are pre-set in the encoding device and the decoding device according to the same rule, and their specific values ​​are not limited here.

[0191] Figure 8b Another possible embodiment is shown in FIG. 8 , in which, in step 801 ′, the difference of the quantization parameter of the current coding unit to be decoded is decoded, wherein the difference is a signed value; in step 802 ′, a basic quantization parameter is obtained, and the difference between the basic quantization parameter and the quantization parameter is added to obtain the value of the quantization parameter of the current coding unit to be decoded.

[0192] According to an embodiment of the present invention, in surveillance videos, users usually only pay attention to moving objects in the foreground. Therefore, setting a smaller quantization parameter for the foreground coding unit can improve the quality of the reconstructed image of the foreground part and improve the user experience; or setting a larger quantization parameter for the background coding unit can save bit rate.

[0193] exist Figure 9a In the figure, a block diagram of an encoding method according to an embodiment of the present invention is shown. Figure 9a The embodiments shown in the figure are for illustration only. Other partitioning methods may be used without departing from the scope of the present disclosure.

[0194] refer to Figure 9a At step 901, information about a prediction unit to be encoded is obtained, the information including foreground and / or background information of a coding unit where the prediction unit to be encoded is located; at step 902, the information about the prediction unit to be encoded is output to a bitstream.

[0195] In one embodiment, the encoding method further includes: when the inter-frame prediction mode is used to predict the current prediction unit, deriving the prediction value of the current prediction unit to be encoded according to the foreground and / or background information of the coding unit where the current prediction unit to be encoded is located, and obtaining the residual value according to the original pixel value and the prediction value; setting the quantization parameter according to the foreground and / or background information of the coding unit where the current prediction unit to be encoded is located; using the set quantization parameter and the obtained residual value to derive the residual information; and outputting the residual information and the basic quantization parameter information to the bitstream.

[0196] In one embodiment, obtaining information about the current prediction unit to be encoded includes: obtaining a background image, obtaining foreground and / or background information of each coding unit in the current image based on the background image and the current image to be encoded, and encoding the foreground and / or background information of each coding unit according to the set parameters identifying the size of the coding unit.

[0197] In one embodiment, deriving the prediction value of the current prediction unit to be encoded based on the foreground and / or background information of the coding unit where the current prediction unit to be encoded is located includes: obtaining the predicted motion information of the current prediction unit to be encoded; setting the range of motion search based on the foreground and / or background information and the predicted motion information of the coding unit where the current prediction unit to be encoded is located; and obtaining the motion vector difference of the current prediction unit to be encoded based on the predicted motion information of the current prediction unit to be encoded and the range of motion search.

[0198] exist Figure 9b In the figure, an encoding method according to an embodiment of the present invention is shown. Figure 9b The embodiments shown in the figure are for illustration only. Other partitioning methods may be used without departing from the scope of the present disclosure.

[0199] refer to Figure 9b , at step 901', obtaining the foreground and / or background information of the coding unit where the current prediction unit to be encoded is located; at step 902', when the inter-frame prediction mode is used to predict the current prediction unit, deriving the prediction value of the current prediction unit to be encoded according to the foreground and / or background information of the coding unit where the current prediction unit to be encoded is located, subtracting the original pixel value from the prediction value to obtain the residual value, and transforming the residual value; at step 903', setting the quantization parameter according to the foreground and / or background information of the coding unit where the current prediction unit to be encoded is located; at step 904', quantizing the transformed residual value using the set quantization parameter to obtain residual information; and at step 905', outputting the foreground and / or background information, the residual information and the basic quantization parameter information to the bitstream.

[0200] exist Fig.10, a block diagram of a method for setting a motion search range in an encoding device according to an embodiment of the present invention is shown. Fig.10 The embodiments shown in the figure are for illustration only. Other partitioning methods may be used without departing from the scope of the present disclosure.

[0201] refer to Fig.10 In step 1001, if the coding unit where the current prediction unit to be encoded is located is the foreground, a search range with a larger value is set; if the coding unit where the current prediction unit to be encoded is located is the background, a search range with a smaller value is set; in step 1002, the predicted motion information of the current prediction unit to be encoded is obtained, and the predicted motion information includes: a motion vector prediction value, a prediction reference mode, an index value of a reference image in a reference image queue, etc.; in step 1003, a reference image corresponding to the index value is found in the reference image queue according to the prediction reference mode, and a motion search is performed within the set search range with the position pointed to by the motion vector prediction value as the search center to find the block that best matches the current prediction unit to be encoded, and the distance between the search center position and the upper left corner position of the best matching block is calculated, and this distance is the motion vector difference.

[0202] Specifically, if the prediction reference mode is queue 0 reference, the reference image corresponding to the index value is found in the reference image queue 0, and the motion vector difference of queue 0 after the motion search is obtained; if the prediction reference mode is queue 1 reference, the reference image corresponding to the index value is found in the reference image queue 1, and the motion vector difference of queue 1 after the motion search is obtained; if the prediction reference mode is dual queue reference, the reference image corresponding to the index value is found in the reference image queue 0 and queue 1 respectively, and the motion vector difference of queue 0 and the motion vector difference of queue 1 after the motion search are obtained respectively.

[0203] According to an embodiment of the present invention, usually, the background is still, or there is only slight movement, such as the disturbance of leaves and grass by wind, so the absolute value of the motion vector and the absolute value of the motion vector difference will not be very large, and the range of the motion search is set small, which can reduce the complexity of the encoding end.

[0204] exist Fig.11 , a block diagram of an apparatus for executing a decoding method according to an embodiment of the present invention is shown. Fig.11 The embodiments shown in the figure are for illustration only. Other partitioning methods may be used without departing from the scope of the present disclosure.

[0205] refer to Fig.11The device includes a receiving unit 1101, which is used to receive data from a bit stream, and a decoder 1102, which is coupled to the receiving unit and is configured to: obtain information about a prediction unit to be decoded currently from the received data, wherein the information about the prediction unit to be decoded currently includes foreground and / or background information of a coding unit where the prediction unit to be decoded currently is located; obtain a prediction value of the prediction unit to be decoded currently according to the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located; and obtain a reconstructed value according to the prediction value of the prediction unit to be decoded currently.

[0206] exist Fig.12 , a block diagram of an apparatus for executing an encoding method according to an embodiment of the present invention is shown. Fig.12 The embodiments shown in the figure are for illustration only. Other partitioning methods may be used without departing from the scope of the present disclosure.

[0207] refer to Fig.12 The device includes an encoder 1201, which is configured to: obtain information about a prediction unit to be currently encoded, the information including foreground and / or background information of a coding unit where the prediction unit to be currently encoded is located; output the information about the prediction unit to be currently encoded to a sending unit 1202; and a sending unit 1202, which is coupled to the encoder and configured to encode the information about the prediction unit to be currently encoded into a bitstream.

[0208] exist Fig.13 , a block diagram of an electronic device according to an embodiment of the present invention is shown. Fig.13 The embodiments shown in the figure are for illustration only. Other partitioning methods may be used without departing from the scope of the present disclosure.

[0209] refer to Fig.13 The electronic device includes a memory 1301, which is configured to store a computer program; and a processor 1302, which is configured to read the computer program from the memory and to execute the decoding method and / or encoding method as described above.

[0210] Although the present disclosure has been described with exemplary embodiments, various changes and modifications may be suggested to one skilled in the art. The present disclosure is intended to encompass such changes and modifications as fall within the scope of the appended claims.

[0211] Any description in this application should not be construed as implying that any particular element, step, or function is an essential element that must be included in the claims scope. The scope of the patented subject matter is limited solely by the claims.

Claims

1. A method performed by an electronic device, the method comprising: Acquire information about a prediction unit to be currently decoded from a bitstream, wherein the information about the prediction unit to be currently decoded includes foreground and / or background information of a coding unit where the prediction unit to be currently decoded is located; obtaining a reconstructed value of the prediction unit to be decoded currently according to the information about the prediction unit to be decoded currently, The obtaining, according to the information about the prediction unit to be currently decoded, a reconstructed value of the prediction unit to be currently decoded comprises: Obtaining a prediction value of a prediction unit to be decoded currently according to foreground and / or background information of a coding unit where the prediction unit to be decoded currently is located; Obtaining a reconstructed value of the prediction unit to be decoded currently according to the prediction value of the prediction unit to be decoded currently, The step of obtaining the prediction value of the prediction unit to be decoded according to the foreground and / or background information of the coding unit where the prediction unit to be decoded is located includes: Obtaining information about neighboring prediction units of a current prediction unit to be decoded; Deriving inter-frame prediction information of the prediction unit to be decoded currently according to foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and information of adjacent prediction units; A prediction value of the prediction unit to be decoded currently is obtained according to the derived inter-frame prediction information of the prediction unit to be decoded currently.

2. The method according to claim 1, wherein: The information of the adjacent prediction unit includes: foreground and / or background information of the coding unit where the adjacent prediction unit is located.

3. The method according to claim 1, wherein: The obtaining, according to the information about the prediction unit to be currently decoded, a reconstructed value of the prediction unit to be currently decoded comprises: Obtaining a residual value of a prediction unit to be decoded currently; A reconstructed value of the prediction unit to be decoded currently is obtained according to the prediction value of the prediction unit to be decoded currently and the residual value of the prediction unit to be decoded currently.

4. The method according to any one of claims 1 to 3, wherein: The information about the prediction unit currently to be decoded further includes at least one of the following: residual information and basic quantization parameter information.

5. The method according to claim 3, wherein: The obtaining of the residual value of the prediction unit to be currently decoded includes: obtaining the residual value of the prediction unit to be currently decoded according to information about the prediction unit to be currently decoded.

6. The method according to claim 4, wherein: The obtaining of the residual value of the prediction unit to be currently decoded includes: obtaining the residual value of the prediction unit to be currently decoded according to information about the prediction unit to be currently decoded.

7. The method according to claim 1 or 2, wherein: The inter-frame prediction information of the prediction unit to be decoded currently includes at least one of the following: a motion vector prediction value of the prediction unit to be decoded currently, motion information of the prediction unit to be decoded currently, motion vector accuracy of the prediction unit to be decoded currently, and reference picture queue information of the prediction unit to be decoded currently.

8. The method according to claim 7, wherein: The deriving of the inter-frame prediction information of the prediction unit to be decoded currently according to the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the information of the adjacent prediction unit comprises: Obtaining motion information of the prediction unit to be decoded; The motion vector prediction value of the prediction unit to be decoded currently is derived according to the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located, the motion information of the prediction unit to be decoded currently, and the information of the adjacent prediction units.

9. The method according to claim 7, wherein: The deriving of the inter-frame prediction information of the prediction unit to be decoded currently according to the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the information of the adjacent prediction unit comprises: Obtaining the coding unit type information of the prediction unit to be decoded; The motion information of the skip mode or direct mode of the prediction unit to be decoded is derived according to the foreground and / or background information of the coding unit where the prediction unit to be decoded is located, the coding unit type information of the prediction unit to be decoded, and the information of the adjacent prediction units.

10. The method according to claim 7, wherein: The deriving of the inter-frame prediction information of the prediction unit to be decoded currently according to the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the information of the adjacent prediction unit comprises: Obtaining a motion vector precision set and a motion vector precision index value of a prediction unit to be decoded currently according to foreground and / or background information of a coding unit where the prediction unit to be decoded currently is located; The motion vector precision of the current prediction unit to be decoded is obtained according to the motion vector precision set and the motion vector precision index value of the current prediction unit to be decoded.

11. The method according to claim 7, wherein: Deriving the inter-frame prediction information of the prediction unit to be decoded currently according to the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the information of the adjacent prediction unit includes: A reference image queue of the prediction unit to be decoded currently is constructed according to foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located.

12. The method according to claim 5 or 6, wherein: The obtaining the residual value of the prediction unit to be decoded currently according to the information about the prediction unit to be decoded currently includes: A quantization parameter of the prediction unit to be decoded is derived according to foreground and / or background information of the coding unit where the prediction unit to be decoded is located and basic quantization parameter information, and a residual value is obtained according to the quantization parameter and residual information.

13. The method according to claim 12, wherein: The deriving the quantization parameter of the prediction unit to be decoded currently according to the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the basic quantization parameter information comprises: According to foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located, the quantization parameter of the coding unit to be decoded currently is obtained according to the absolute value of the difference between the basic quantization parameter and the preset first quantization parameter.

14. The method according to claim 12, wherein: The deriving the quantization parameter of the prediction unit to be decoded currently according to the foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and the basic quantization parameter information comprises: Decoding a difference in quantization parameters of a coding unit where a prediction unit to be decoded currently is located; The value of the quantization parameter of the coding unit where the prediction unit to be decoded currently is located is obtained according to the difference between the basic quantization parameter and the quantization parameter.

15. A method performed by an electronic device, the method comprising: Obtaining information about a prediction unit to be currently encoded, the information including foreground and / or background information of a coding unit where the prediction unit to be currently encoded is located; Output information about the current prediction unit to be encoded to the bitstream, The obtaining of information about the current prediction unit to be encoded includes: Get the background image, The foreground and / or background information of each coding unit in the current image is obtained according to the background image and the current image to be encoded, and the foreground and / or background information of each coding unit is encoded according to the set parameter identifying the size of the coding unit.

16. The method according to claim 15, further comprising: When the inter-frame prediction mode is used to predict the current prediction unit, a prediction value of the current prediction unit to be encoded is derived according to the foreground and / or background information of the coding unit where the current prediction unit to be encoded is located, and a residual value is obtained according to the original pixel value and the prediction value; Setting a quantization parameter according to foreground and / or background information of a coding unit where a current prediction unit to be encoded is located; Using the set quantization parameter and the obtained residual value, deriving residual information; The residual information and basic quantization parameter information are output to a bit stream.

17. The method according to claim 16, wherein: The deriving the prediction value of the current prediction unit to be encoded according to the foreground and / or background information of the coding unit where the current prediction unit to be encoded is located includes: Obtaining predicted motion information of a prediction unit to be encoded currently; Setting a range of motion search according to foreground and / or background information and predicted motion information of a coding unit where a current prediction unit to be encoded is located; The motion vector difference of the prediction unit to be encoded currently is obtained according to the prediction motion information of the prediction unit to be encoded currently and the range of the motion search.

18. An electronic device, comprising: A receiving unit, configured to receive data from a code stream; A decoder is coupled to the receiving unit and is configured to: Acquire information about a prediction unit to be currently decoded from the received data, wherein the information about the prediction unit to be currently decoded includes foreground and / or background information of a coding unit where the prediction unit to be currently decoded is located; Obtaining a prediction value of a prediction unit to be decoded currently according to foreground and / or background information of a coding unit where the prediction unit to be decoded currently is located; Obtain a reconstructed value according to the prediction value of the current prediction unit to be decoded, Wherein, obtaining a reconstructed value according to a prediction value of a prediction unit to be decoded currently includes: Obtaining a prediction value of a prediction unit to be decoded currently according to foreground and / or background information of a coding unit where the prediction unit to be decoded currently is located; Obtaining a reconstructed value of the prediction unit to be decoded currently according to the prediction value of the prediction unit to be decoded currently, The step of obtaining the prediction value of the prediction unit to be decoded according to the foreground and / or background information of the coding unit where the prediction unit to be decoded is located includes: Obtaining information about neighboring prediction units of a current prediction unit to be decoded; Deriving inter-frame prediction information of the prediction unit to be decoded currently according to foreground and / or background information of the coding unit where the prediction unit to be decoded currently is located and information of adjacent prediction units; A prediction value of the prediction unit to be decoded currently is obtained according to the derived inter-frame prediction information of the prediction unit to be decoded currently.

19. The electronic device according to claim 18, the decoder is further configured to perform the method according to any one of claims 2-14.

20. An electronic device, comprising: The encoder is configured as: Obtaining information about a prediction unit to be currently encoded, the information including foreground and / or background information of a coding unit where the prediction unit to be currently encoded is located; Outputting information about the prediction unit currently to be encoded to the sending unit; as well as a sending unit, which is coupled to the encoder and configured to encode information about a prediction unit to be currently encoded into a bitstream, The obtaining of information about the current prediction unit to be encoded includes: Get the background image, The foreground and / or background information of each coding unit in the current image is obtained according to the background image and the current image to be encoded, and the foreground and / or background information of each coding unit is encoded according to the set parameter identifying the size of the coding unit.

21. The electronic device according to claim 20, the encoder is further configured to perform the method according to any one of claims 16-17.

22. An electronic device, comprising: a memory configured to store a computer program; as well as A processor configured to read a computer program from a memory and to execute the method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Modeling-based image decoding method and device in image coding system

    CN108293113A

  • Method and apparatus for encoding and decoding video using skip mode

    WO2013070006A1