CN113301337A - Coding and decoding method and device - Google Patents

Coding and decoding method and device Download PDF

Info

Publication number
CN113301337A
CN113301337A CN202010113883.2A CN202010113883A CN113301337A CN 113301337 A CN113301337 A CN 113301337A CN 202010113883 A CN202010113883 A CN 202010113883A CN 113301337 A CN113301337 A CN 113301337A
Authority
CN
China
Prior art keywords
prediction unit
decoded
information
current prediction
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010113883.2A
Other languages
Chinese (zh)
Inventor
吕卓逸
周川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Samsung Telecom R&D Center
Beijing Samsung Telecommunications Technology Research Co Ltd
Samsung Electronics Co Ltd
Original Assignee
Beijing Samsung Telecommunications Technology Research Co Ltd
Samsung Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Samsung Telecommunications Technology Research Co Ltd, Samsung Electronics Co Ltd filed Critical Beijing Samsung Telecommunications Technology Research Co Ltd
Priority to CN202010113883.2A priority Critical patent/CN113301337A/en
Priority to PCT/KR2021/002261 priority patent/WO2021172847A1/en
Publication of CN113301337A publication Critical patent/CN113301337A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/167Position within a video image, e.g. region of interest [ROI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/20Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video object coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present invention relates to encoding and decoding methods and apparatuses thereof. The decoding method comprises the steps of obtaining information about a current prediction unit to be decoded from a code stream, wherein the information about the current prediction unit to be decoded comprises foreground and/or background information of an encoding unit where the current prediction unit to be decoded is located; and obtaining a reconstruction value of the current prediction unit to be decoded according to the information about the current prediction unit to be decoded.

Description

Coding and decoding method and device
Technical Field
The invention relates to the technical field of video coding and decoding, in particular to a method and a device for coding and decoding for monitoring videos.
Background
Unlike natural images, surveillance video is mostly captured by a still camera, usually with a fixed background, and the main background scene is unchanged. In surveillance video, a user mainly focuses on foreground moving objects, and the motion of the foreground is usually severe. For a surveillance video, if the existing video coding standards such as HEVC, h.264 and the like are used, the same inter-frame prediction coding and decoding technology is used for the foreground and the background, which may cause inaccurate prediction on the one hand, and may cause redundancy of coding information on the other hand, resulting in high coding complexity and reduced coding efficiency.
Disclosure of Invention
Technical problem
In order to solve the above problems, the present invention provides a coding and decoding method and a device thereof, wherein different inter-frame prediction methods and coding and decoding methods are adopted according to the foreground or background information of the current coding unit.
Technical scheme
In an aspect of the present invention, there is provided a decoding method, including: acquiring information about a current prediction unit to be decoded from a code stream, wherein the information about the current prediction unit to be decoded comprises foreground and/or background information of a coding unit where the current prediction unit to be decoded is located; and obtaining a reconstruction value of the current prediction unit to be decoded according to the information about the current prediction unit to be decoded.
In an aspect of the present invention, there is provided a decoding method, wherein the obtaining a reconstructed value of a current prediction unit to be decoded according to the information about the current prediction unit to be decoded includes: obtaining a predicted value of the current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located; and obtaining a reconstruction value of the current prediction unit to be decoded according to the prediction value of the current prediction unit to be decoded.
One aspect of the present invention provides a decoding method, where the obtaining a prediction value of a current prediction unit to be decoded according to foreground and/or background information of an encoding unit in which the current prediction unit to be decoded is located includes: obtaining information on neighboring prediction units of a prediction unit to be currently decoded; deriving inter-frame prediction information of the current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located and information of an adjacent prediction unit; and obtaining a predicted value of the current prediction unit to be decoded according to the derived inter-frame prediction information of the current prediction unit to be decoded.
In an aspect of the present invention, there is provided a decoding method, wherein the information of the neighboring prediction unit includes: foreground and/or background information of the coding unit where the adjacent prediction unit is located.
In an aspect of the present invention, there is provided a decoding method, wherein the obtaining a reconstructed value of a current prediction unit to be decoded according to the information about the current prediction unit to be decoded includes: obtaining a residual error value of a current prediction unit to be decoded; and obtaining a reconstruction value of the current prediction unit to be decoded according to the prediction value of the current prediction unit to be decoded and the residual value of the current prediction unit to be decoded.
In an aspect of the present invention, there is provided a decoding method, wherein the information about the current prediction unit to be decoded further includes at least one of: residual information and basic quantization parameter information.
In an aspect of the present invention, there is provided a decoding method, wherein the obtaining a residual value of a prediction unit to be currently decoded includes: obtaining a residual value of the prediction unit to be currently decoded according to information on the prediction unit to be currently decoded.
In an aspect of the present invention, a decoding method is provided, wherein the inter prediction information of the prediction unit to be currently decoded includes at least one of: the motion vector prediction value of the current prediction unit to be decoded, the motion information of the current prediction unit to be decoded, the motion vector precision of the current prediction unit to be decoded, and the reference image queue information of the current prediction unit to be decoded.
In an aspect of the present invention, a decoding method is provided, where the deriving inter-frame prediction information of a current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located and information of an adjacent prediction unit includes: acquiring motion information of a current prediction unit to be decoded; and deriving a motion vector predicted value of the current prediction unit to be decoded according to the foreground and/or background information of the coding unit where the current prediction unit to be decoded is located, the motion information of the current prediction unit to be decoded and the information of the adjacent prediction units.
In an aspect of the present invention, a decoding method is provided, where the deriving inter-frame prediction information of a current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located and information of an adjacent prediction unit includes: acquiring coding unit type information of a current prediction unit to be decoded; and deriving the motion information of the skip mode or the direct mode of the current prediction unit to be decoded according to the foreground and/or background information of the coding unit where the current prediction unit to be decoded is located, the coding unit type information of the current prediction unit to be decoded and the information of the adjacent prediction units.
In an aspect of the present invention, a decoding method is provided, where the deriving inter-frame prediction information of a current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located and information of an adjacent prediction unit includes: acquiring a motion vector precision collection and a motion vector precision index value of a current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located; and obtaining the motion vector precision of the current prediction unit with decoding according to the motion vector precision aggregate and the motion vector precision index value of the current prediction unit to be decoded.
In one aspect of the present invention, a decoding method is provided, where deriving inter-frame prediction information of a current prediction unit to be decoded according to foreground and/or background information of a coding unit in which the current prediction unit to be decoded is located and information of an adjacent prediction unit includes: and constructing a reference image queue of the current prediction unit to be decoded according to the foreground and/or background information of the coding unit where the current prediction unit to be decoded is located.
In an aspect of the present invention, there is provided a decoding method, wherein the obtaining a residual value of a prediction unit to be currently decoded according to information about the prediction unit to be currently decoded includes: and deriving the quantization parameter of the current prediction unit to be decoded according to the foreground and/or background information and the basic quantization parameter information of the coding unit where the current prediction unit to be decoded is located, and obtaining a residual value according to the quantization parameter and the residual information.
In an aspect of the present invention, a decoding method is provided, where deriving quantization parameters of a current prediction unit to be decoded according to foreground and/or background information of an encoding unit in which the current prediction unit to be decoded is located and basic quantization parameter information includes: and acquiring the quantization parameter of the current coding unit to be decoded according to 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 and the preset absolute value of the difference value of the first quantization parameter.
In an aspect of the present invention, a decoding method is provided, where deriving quantization parameters of a current prediction unit to be decoded according to foreground and/or background information of an encoding unit in which the current prediction unit to be decoded is located and basic quantization parameter information includes: decoding the difference value of the quantization parameters of the coding unit where the 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 according to the difference value of the basic quantization parameter and the quantization parameter.
In an aspect of the present invention, there is provided an encoding method, including: obtaining information about a current prediction unit to be coded, wherein the information comprises foreground and/or background information of a coding unit where the current prediction unit to be coded is located; and outputting information about the prediction unit to be currently coded into the code stream.
In an aspect of the present invention, an encoding method is provided, where the method further includes: when the current prediction unit is predicted by using the inter-frame prediction mode, deriving a prediction value of the current prediction unit to be coded according to foreground and/or background information of a coding unit where the current prediction unit to be coded is located, and obtaining a residual value according to an original pixel value and the prediction value; setting quantization parameters according to foreground and/or background information of a coding unit where a current prediction unit to be coded is located; deriving residual information using the set quantization parameter and the obtained residual value; and outputting the residual error information and the basic quantization parameter information to a code stream.
In an aspect of the present invention, there is provided an encoding method, wherein the obtaining information about a prediction unit to be currently encoded includes: acquiring a background image, acquiring foreground and/or background information of each coding unit in the current image according to the background image and the current image to be coded, and coding the foreground and/or background information of each coding unit according to a set parameter for marking the size of the coding unit.
In an aspect of the present invention, an encoding method is provided, where deriving a prediction value of a current prediction unit to be encoded according to foreground and/or background information of an encoding unit in which the current prediction unit to be encoded is located includes: obtaining the prediction motion information of a prediction unit to be coded currently; setting a motion search range according to foreground and/or background information and predicted motion information of a coding unit where a current prediction unit to be coded is located; and obtaining the motion vector difference value of the current prediction unit to be coded according to the prediction motion information of the current prediction unit to be coded and the motion search range.
In an aspect of the present invention, there is provided an apparatus for performing a decoding method, the apparatus including: a receiving unit configured to receive data from the codestream; a decoder coupled with the receiving unit and configured to: acquiring information about a current prediction unit to be decoded from received data, wherein the information about the current prediction unit to be decoded comprises foreground and/or background information of an encoding unit where the current prediction unit to be decoded is located; obtaining a predicted value of the current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located; and obtaining a reconstruction value according to the prediction value of the current prediction unit to be decoded.
In an aspect of the present invention, there is provided an apparatus for performing an encoding method, the apparatus including: an encoder configured to: obtaining information about a current prediction unit to be coded, wherein the information comprises foreground and/or background information of a coding unit where the current prediction unit to be coded is located; outputting information on a prediction unit to be currently encoded to a transmission unit; and a transmitting unit coupled to the encoder and configured to encode information on a prediction unit currently to be encoded into the codestream.
In one aspect of the present invention, an electronic device is provided, including: a memory configured to store a computer program; and a processor configured to read the computer program from the memory and to execute the method.
Other technical features may be readily apparent to one skilled in the art from the following figures, descriptions, and claims.
Advantageous effects of the invention
According to the scheme of the invention, the efficiency of monitoring video coding is improved and the coding complexity is reduced according to different motion characteristics and different user attention points between the foreground prediction unit and the background prediction unit.
Drawings
For a more complete understanding of the present disclosure and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, wherein like reference numbers represent like parts:
FIG. 1 is a block diagram illustrating the spatial positional relationship of a current coding unit to neighboring units;
FIGS. 2a and 2b are block diagrams illustrating a decoding method according to an embodiment of the present invention;
FIG. 3 is a block diagram illustrating an identification method for foreground and/or background information of a coding unit according to an embodiment of the present invention;
fig. 4 is a block diagram illustrating a method for obtaining a motion vector predictor of a prediction unit according to an embodiment of the present invention;
FIG. 5 is a block diagram illustrating the spatial positional relationship of a current coding unit to neighboring units;
fig. 6 is a block diagram illustrating a method of deriving motion information of a prediction unit employing a skip mode or a direct mode according to an embodiment of the present invention;
fig. 7 is a block diagram illustrating a method of deriving a basic unit of a motion vector according to an embodiment of the present invention;
fig. 8a and 8b are block diagrams illustrating a method of deriving a quantization parameter of a coding unit in a decoding apparatus according to an embodiment of the present invention;
FIGS. 9a and 9b are block diagrams illustrating an encoding method according to an embodiment of the present invention;
fig. 10 is a block diagram illustrating a setting method of a motion search range in an encoding apparatus according to an embodiment of the present invention;
fig. 11 is a block diagram illustrating an apparatus for performing a decoding method according to an embodiment of the present invention;
fig. 12 is a block diagram illustrating an apparatus for performing an encoding method according to an embodiment of the present invention; and
fig. 13 is a block diagram illustrating an electronic device according to an embodiment of the present invention.
Detailed Description
Before proceeding with the following detailed description, it may be advantageous to set forth definitions of certain words and phrases used throughout this patent document. The term "couple" 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 one another. The terms "transmit," "receive," and "communicate," as well as derivatives thereof, encompass both direct and indirect communication. The terms "include" and "comprise," as well as derivatives thereof, mean inclusion without limitation. The term "or" is inclusive, meaning and/or. The phrase "associated with … …" and derivatives thereof means including, included within … …, interconnected, contained within … …, connected or connected with … …, coupled or coupled with … …, in communication with … …, mated, interwoven, juxtaposed, proximate, bound or bound with … …, having an attribute, having a relationship or having a relationship with … …, and the like. The term "controller" refers to any device, system, or part thereof that controls at least one operation. Such a controller may be implemented in hardware, or a combination of hardware and software and/or firmware. The functionality associated with any particular controller may be centralized or distributed, whether locally or remotely. The phrase "at least one of, when used with a list of items, means that a different combination of one or more of the listed items can be used and only one item in the list may be required. For example, "at least one of A, B, C" includes any one of the following combinations: A. b, C, A and B, A and C, B and C, A and B and C.
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, as well as future uses of such defined words and phrases.
In the present invention, the applied combination of the current coding unit and the adjacent coding units, the scanning order and the division form thereof are merely used for illustration, and the applied combination of the coding units, the scanning order and the division form thereof may have different manners without departing from the scope of the present disclosure.
The inter prediction modes that each prediction unit defined in the existing video coding standards (e.g., HEVC, AVS2, AVS3, VVC, h.264, etc.) may select are normal motion vector prediction mode, skip mode, and direct mode.
If the current prediction unit is in the normal motion vector prediction mode, deriving motion information by: 1) deriving a motion vector predictor, decoding the motion vector difference information and the motion vector base unit to obtain a difference value of the motion vector, and adding the motion vector predictor and the difference value to obtain a motion vector value; 2) decoding reference image information, and obtaining a predicted value of a prediction unit on the obtained reference image according to the position pointed by the motion vector; 3) and decoding residual information, carrying out inverse quantization and inverse transformation on the residual information to obtain a residual value, and adding the residual value and the predicted value to obtain a reconstructed value of the current prediction unit.
If the current prediction unit is in skip mode or direct mode, motion information may be derived by: and obtaining the motion vector and the reference image information (prediction direction and reference index) of the spatial domain adjacent prediction unit of the prediction unit from the adjacent prediction unit of the current prediction unit according to the preset scanning sequence and the acquisition rule as the motion information of the current prediction unit.
The method described above wherein the current prediction unit is emptyThe domain neighbor prediction unit is defined in the AVS3 first stage standard as shown in FIG. 1, and the coordinates of the top left corner sample E in the image are (x0, y0), (x 0)1,y0) Is the coordinate of the top right sample of block E in the image, (x)0,y1) Is the coordinate of the lower left corner sample of block E in the image, the neighboring cells of E are: the adjacent cell A is a cell where the sample (x0-1, y0) is located, the adjacent cell B is a block where the sample (x0, y0-1) is located, the adjacent block C is a block where the sample (x1+1, y0-1) is located, the adjacent block D is a block where the sample (x0-1, y0-1) is located, the adjacent block F is a block where the sample (x0-1, y1) is located, and the adjacent block G is a block where the sample (x1, y0-1) is located. The spatial position relationship of block E and its neighboring blocks is shown in fig. 1.
In the first stage standard of AVS3, the motion vector accuracy, i.e., the basic unit of the motion vector, is obtained by: obtaining a base unit of a motion vector from the decoded motion vector precision index:
if the value of the motion vector precision index is 0, the basic unit of the motion vector is 1/4 integer samples;
if the value of the motion vector precision index is 1, the basic unit of the motion vector is 1/2 integer samples;
if the value of the motion vector precision index is 2, the basic unit of the motion vector is 1 integer sample;
if the value of the motion vector precision index is 3, the basic unit of the motion vector is 2 integer samples;
if the value of the motion vector precision index is 4, the basic unit of the motion vector is 4 integer samples.
However, in the existing video coding standards, such as HEVC, h.264, etc., for surveillance video, the same inter-frame prediction coding and decoding technology is used for the foreground and the background, which results in inaccurate prediction and also causes redundancy of coding information, higher coding complexity and reduced coding efficiency.
Various embodiments of the present invention will be described below with reference to fig. 2 to 13. The various embodiments used to describe the principles of the present disclosure in this patent document are by way of illustration only and should not be construed in any way to limit the scope of the disclosure.
In fig. 2a, a block diagram of a decoding method according to an embodiment of the invention is shown. The embodiment shown in fig. 2a is for illustration only. Other divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 2a, at step 201, information about a prediction unit to be currently decoded is obtained from a code stream, where the information about the prediction unit to be currently decoded includes foreground and/or background information of an encoding unit where the prediction unit to be currently decoded is located; at step 202, a reconstructed value of the current prediction unit to be decoded is obtained according to the information on the current prediction unit to be decoded.
In one embodiment, the obtaining of the reconstructed value of the current prediction unit to be decoded by the information on the current prediction unit to be decoded includes: obtaining a predicted value of the current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located; and obtaining a reconstruction value of the current prediction unit to be decoded according to the prediction value of the current prediction unit to be decoded.
In an embodiment, the obtaining the prediction value of the current prediction unit to be decoded according to the foreground and/or background information of the coding unit where the current prediction unit to be decoded is located includes: obtaining information on neighboring prediction units of a prediction unit to be currently decoded; deriving inter-frame prediction information of the current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located and information of an adjacent prediction unit; and obtaining a predicted value of the current prediction unit to be decoded according to the derived inter-frame prediction information of the current prediction unit to be decoded.
In one embodiment, the information of the neighbor prediction unit includes: foreground and/or background information of the coding unit where the adjacent prediction unit is located.
In one embodiment, the obtaining a reconstructed value of the current prediction unit to be decoded according to the information on the current prediction unit to be decoded includes: obtaining a residual error value of a current prediction unit to be decoded; and obtaining a reconstruction value of the current prediction unit to be decoded according to the prediction value of the current prediction unit to be decoded and the residual value of the current prediction unit to be decoded.
In one embodiment, the information on the prediction unit to be currently decoded further includes at least one of: residual information and basic quantization parameter information.
In one embodiment, the obtaining the residual value of the prediction unit to be currently decoded includes: obtaining a residual value of the prediction unit to be currently decoded according to information on the prediction unit to be currently decoded.
In one embodiment, the inter prediction information of the prediction unit to be currently decoded includes at least one of: the motion vector prediction value of the current prediction unit to be decoded, the motion information of the current prediction unit to be decoded, the motion vector precision of the current prediction unit to be decoded, and the reference image queue information of the current prediction unit to be decoded.
In one embodiment, the deriving inter-frame prediction information of the current prediction unit to be decoded according to foreground and/or background information of a coding unit in which the current prediction unit to be decoded is located and information of an adjacent prediction unit includes: acquiring motion information of a current prediction unit to be decoded; and deriving a motion vector predicted value of the current prediction unit to be decoded according to the foreground and/or background information of the coding unit where the current prediction unit to be decoded is located, the motion information of the current prediction unit to be decoded and the information of the adjacent prediction units.
In one embodiment, the deriving inter-frame prediction information of the current prediction unit to be decoded according to foreground and/or background information of a coding unit in which the current prediction unit to be decoded is located and information of an adjacent prediction unit includes: acquiring coding unit type information of a current prediction unit to be decoded; and deriving the motion information of the skip mode or the direct mode of the current prediction unit to be decoded according to the foreground and/or background information of the coding unit where the current prediction unit to be decoded is located, the coding unit type information of the current prediction unit to be decoded and the information of the adjacent prediction units.
In one embodiment, the deriving inter-frame prediction information of the current prediction unit to be decoded according to foreground and/or background information of a coding unit in which the current prediction unit to be decoded is located and information of an adjacent prediction unit includes: acquiring a motion vector precision collection and a motion vector precision index value of a current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located; and obtaining the motion vector precision of the current prediction unit with decoding according to the motion vector precision aggregate and the motion vector precision index value of the current prediction unit to be decoded.
In one embodiment, deriving inter-prediction information of a current prediction unit to be decoded according to foreground and/or background information of a coding unit in which the current prediction unit to be decoded is located and information of neighboring prediction units comprises: and constructing a reference image queue of the current prediction unit to be decoded according to the foreground and/or background information of the coding unit where the current prediction unit to be decoded is located.
In one embodiment, the obtaining the residual value of the prediction unit to be currently decoded according to the information on the prediction unit to be currently decoded includes: and deriving the quantization parameter of the current prediction unit to be decoded according to the foreground and/or background information and the basic quantization parameter information of the coding unit where the current prediction unit to be decoded is located, and obtaining a residual value according to the quantization parameter and the residual information.
In an embodiment, the deriving the quantization parameter of the current prediction unit to be decoded according to the foreground and/or background information and the basic quantization parameter information of the coding unit in which the current prediction unit to be decoded is located includes: and acquiring the quantization parameter of the current coding unit to be decoded according to 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 and the preset absolute value of the difference value of the first quantization parameter.
In an embodiment, the deriving the quantization parameter of the current prediction unit to be decoded according to the foreground and/or background information and the basic quantization parameter information of the coding unit in which the current prediction unit to be decoded is located includes: decoding the difference value of the quantization parameters of the coding unit where the 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 according to the difference value of the basic quantization parameter and the quantization parameter.
A block diagram of yet another decoding method according to an embodiment of the invention is shown in fig. 2 b. The embodiment shown in fig. 2b is for illustration only. Other divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 2b, in step 201', information about a current prediction unit to be decoded is obtained from a code stream, where the information includes foreground and/or background information, residual information, basic quantization parameter information, and the like of a coding unit where the current prediction unit to be decoded is located; in step 202', obtaining information about a neighboring prediction unit of a prediction unit to be currently decoded, wherein the information includes foreground and/or background information, motion information, type information of the coding unit, position information and the like of a coding unit in which the neighboring prediction unit is located; in step 203', deriving inter-frame prediction information according to foreground and/or background information of a current prediction unit to be decoded and information of an adjacent prediction unit; in step 204', obtaining a prediction value of a current prediction unit to be decoded according to the derived inter-frame prediction information; in step 205', obtaining residual information and quantization parameter information of the current prediction unit to be decoded, and inverse-quantizing the residual information to obtain a residual value of the current prediction unit to be decoded; and in step 206', adding the predicted value and the residual value of the current prediction unit to be decoded to obtain a reconstructed value.
Fig. 3 shows a block diagram of an identification method for foreground and/or background information of a coding unit according to an embodiment of the invention. The embodiment shown in fig. 3 is for illustration only. Other divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 3, in step 301, a background image is acquired; the method for acquiring the background image may be any one of the following methods, which are not limited herein: 1) k-means clustering; 2) averaging; 3) a median method; 4) modeling a single Gaussian background; 5) modeling a Gaussian mixture background, and the like. In step 302, the background image and the current image to be encoded are subtracted to obtain foreground and/or background information of each encoding unit in the current image. Specifically, counting the number of difference values between the current image pixel value and the background image pixel value at the corresponding position in the coding unit, which are greater than a set first threshold; when the number exceeds a set second threshold value, the current coding unit is a foreground and is marked as 1; otherwise, the current coding unit is background and is marked as 0. In step 303, foreground and/or background information of the current coding unit, i.e. in this embodiment a foreground-background flag (1 bit, 1 or 0) is encoded and transmitted to the decoding apparatus.
The foreground and/or background information can be set for each maximum coding unit, or can be set for each coding unit in the maximum coding units, and if the small coding units do not independently set the foreground and/or background information, the small coding units share the foreground and/or background information of the large coding unit where the small coding units are located. For example, in the AVS3 standard, the size of the coding unit includes: 128x128, 64x64, 32x32, 16x16, and 8x8, the coding unit size that sets 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 8x 8. The size of the coding unit for specifically setting the foreground and/or background information is not limited, but at least includes a maximum coding unit, for example: the AVS3 includes at least 128x 128.
The same parameter for identifying the size of the coding unit of the foreground background is set in the encoding device and the decoding device, taking AVS3 as an example, specifically:
if the coding unit size of the foreground and/or background information is 128x128, this parameter is 0 (or the parameter is 1);
if the coding unit size of the foreground and/or background information is 128x128, 64x64, this parameter is 1 (or the parameter is 2);
if the coding unit size of the foreground and/or background information is 128x128, 64x64, 32x32, then this parameter is 2 (or the parameter is 3);
if the coding unit size of the foreground and/or background information is 128x128, 64x64, 32x32, 16x16, then this parameter is 3 (or the parameter is 4);
if the coding unit size of the foreground and/or background information is 128x128, 64x64, 32x32, 16x16, 8x8, this parameter is 4 (or the parameter is 5).
In the decoding apparatus, the foreground and/or background information is decoded according to a "parameter for identifying the size of the coding unit of the foreground background", specifically:
if the parameter is 0, only one piece of coded foreground and/or background information is decoded in each 128x128 coding unit, and the 128x128 information is shared by small-size coding units inside the 128x128 coding unit;
if the parameter is 1, decoding only one coded foreground and/or background information in each 128x128 coding unit and each 64x64 coding unit, wherein the 64x64 information is shared by the small-size coding units inside the 64x64 coding unit;
if the parameter is 2, decoding only one coded foreground and/or background information in each 128x128 coding unit, each 64x64 coding unit and each 32x32 coding unit, wherein the small-sized coding units inside the 32x32 coding unit share the information of 32x 32;
if the parameter is 3, decoding only one coded foreground and/or background information in each 128x128 coding unit, each 64x64 coding unit, each 32x32 coding unit and each 16x16 coding unit, wherein the small-sized coding units inside the 16x16 coding unit share the information of the 16x 16;
if the parameter is 4, one encoded foreground and/or background information is decoded only in each 128x128 coding unit, each 64x64 coding unit, each 32x32 coding unit, each 16x16 coding unit, and each 8x8 coding unit.
Fig. 4 is a block diagram illustrating a method for obtaining a motion vector predictor of a prediction unit according to an embodiment of the present invention. The embodiment shown in fig. 4 is for illustration only. Other ways and orders of division may be used without departing from the scope of the present disclosure.
Referring to fig. 4, in step 401, foreground and/or background information of a coding unit where a current prediction unit to be decoded is located and motion vector prediction information of the current prediction unit to be decoded are obtained, where the motion vector prediction information includes: the type of motion vector, etc. In step 402, a motion vector predictor is obtained according to the type of the motion vector of the prediction unit to be currently decoded.
The type of motion vector to be currently predicted may be: ordinary motion vectors, affine motion vectors, etc.
(I) If the type of the motion vector to be predicted at present is a common motion vector, the following operations are performed:
1) motion information of a neighboring prediction unit of a prediction unit currently to be decoded is obtained, and availability of the motion information of the neighboring prediction unit is judged.
Specifically, if the coding unit of the current prediction unit E to be decoded is foreground, and the neighboring prediction unit is X (X is A, B, C, D, F or G in fig. 5, which is not limited herein), the motion information of the neighboring prediction unit X is "available" if the neighboring prediction unit X satisfies all the following conditions, and is "unavailable" otherwise: a) the neighboring prediction unit is available, i.e., does not exceed the boundary of the current image; b) the coding unit where the adjacent prediction unit is located is a foreground; c) the neighboring prediction unit does not employ an intra prediction mode; d) the neighboring prediction unit has a motion vector of a normal motion vector type.
If the coding unit in which the current prediction unit E to be decoded is located is a background, its neighboring prediction unit X satisfies all the following conditions, then the motion information of the neighboring prediction unit is "available", otherwise "unavailable": a) the neighboring prediction unit is available, i.e., does not exceed the boundary of the current image; b) the coding unit where the adjacent prediction unit is located is a background; c) the neighboring prediction unit does not employ an intra prediction mode; d) the neighboring prediction unit has motion vectors of the same type as the general motion vector.
2) And obtaining a motion vector predicted value of the current prediction unit E to be decoded according to the available motion information.
(II) if the type of the currently predicted motion vector is an affine motion vector, performing the following operations:
1) motion information of a neighboring prediction unit of a prediction unit to be currently decoded is obtained, and the availability of the neighboring prediction unit motion information is judged.
Specifically, if the coding unit of the current prediction unit E to be decoded is foreground, and the neighboring prediction units are X (X is A, B, C, D, F or G in fig. 5, A, D and B are foreground, and C, G and F are background), X satisfies all the following conditions, then the motion information of X is "available", otherwise "unavailable": a) the neighboring prediction unit is available, i.e., does not exceed the boundary of the current image; b) the coding unit where the adjacent prediction unit is located is a foreground; c) the neighboring prediction unit does not employ an intra prediction mode; d) the neighboring prediction unit has motion vectors of the same type as the affine motion vectors.
If the coding unit in which the current prediction unit E to be decoded is located is a background, its neighboring prediction unit X satisfies all the following conditions, then the motion information of the neighboring prediction unit is "available", otherwise "unavailable": a) the neighboring prediction unit is available, i.e., does not exceed the boundary of the current image; b) the coding unit where the adjacent prediction unit is located is a background; c) the neighboring prediction unit does not employ an intra prediction mode; d) the neighboring prediction unit has motion vectors of the same type as the affine motion vectors.
2) And obtaining a motion vector predicted value of the current prediction unit E to be decoded according to the available motion information.
Fig. 6 is a block diagram illustrating a method of deriving motion information of a prediction unit employing 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 comprises: 1) the prediction unit uses the queue 0 reference, the number of motion vectors of the prediction unit is equal to 1; 2) the prediction unit uses the queue 1 reference, the number of motion vectors of the prediction unit is equal to 1; 3) the prediction unit uses a double queue reference, and the number of motion vectors of the prediction unit is equal to 2. The embodiment shown in fig. 6 is for illustration only. Other sequences and cell divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 6, in step 601, the type of the coding unit where the prediction unit to be currently decoded is located and foreground and/or background information of the coding unit where the prediction unit is located are obtained; in step 602, if the type of the coding unit where the current prediction unit is located is a P picture skip mode, a P picture direct mode, a B picture skip mode, or a B picture direct mode, a subtype of the coding unit is obtained, where the P picture is a unidirectional inter-frame prediction, i.e., only referring to the spatial reference queue 0, and the B picture is a bidirectional inter-frame prediction, i.e., referring to the spatial reference queue 0, or 1, or both the spatial reference queues 0 and 1; in step 603, motion information of a neighboring prediction unit of the current prediction unit to be decoded and foreground and/or background information of a coding unit where the neighboring prediction unit is located are obtained, where the motion information includes: and predicting information such as a reference mode, a motion vector, a reference index and the like, and deriving motion information according to the subtype of the coding unit where the prediction unit to be decoded currently is located.
The subtypes of the coding units of the P-picture skip mode and the P-picture direct mode include: temporal reference, spatial queue 0 reference, advanced motion vector representation, affine motion, and historical information based motion vector prediction. The subtype "use spatial queue 0 reference" indicates that the prediction reference mode of the current prediction unit to be decoded is use queue 0 reference.
The subtypes of the coding units of the B-picture skip mode and the B-picture direct mode include: using temporal references, using spatial cohort 0 references, using spatial cohort 1 references, using spatial double cohort (0 and 1) references, advanced motion vector representation, affine motion, and motion vector prediction based on historical information. The subtype "use spatial queue 0 reference" indicates that the prediction reference mode of the current prediction unit to be decoded is use queue 0 reference; "use spatial queue 1 reference" indicates that the prediction reference mode of the current prediction unit to be decoded is use queue 0 reference; the "using spatial double-queue reference" indicates that the prediction reference mode of the current prediction unit to be decoded is using double-queue reference.
For the case of the foreground
(I) If the coding unit where the prediction unit to be decoded currently is located is a foreground, and the subtype is any one of the following types: 1) use of spatial queue 0 reference in P picture skip mode; 2) using spatial domain queue 0 reference in P-picture direct mode, motion information is derived as follows:
if the coding unit where the adjacent prediction unit is located is a foreground in six adjacent prediction units F, G, C, A, B, D of the prediction unit E to be decoded currently, and the number of the adjacent prediction units whose prediction reference mode is 'queue 0 reference' is greater than or equal to 1, scanning the adjacent prediction units in turn according to the sequence F, G, C, A, B, D (or other methods can be adopted without limitation) to obtain the first scanned prediction unit whose coding unit is a foreground and whose prediction reference mode is 'queue 0 reference'), and respectively using the queue 0 motion vector and the queue 0 reference index of the spatial motion information storage unit of the prediction unit as the queue 0 motion vector and the queue 0 reference index of the prediction unit to be decoded currently;
otherwise, the motion vector of the queue 0 of the prediction unit to be decoded currently is a zero vector, and the value of the queue 0 reference index of the prediction unit to be decoded currently is equal to 0;
the prediction reference mode of the prediction unit currently to be decoded is set to 'queue 0 reference'.
(II) if the coding unit of the current prediction unit to be decoded is the foreground, and the subtype is any one of the following types: b, using a spatial queue 0 reference, or using a spatial queue 1 reference, or using a spatial double queue (0 and 1) reference in a picture skipping mode; or using a spatial queue 0 reference, or using a spatial queue 1 reference, or using a spatial double queue (0 and 1) reference in the B-picture direct mode, deriving motion information according to the following steps:
(A) if, in the six adjacent prediction units F, G, C, A, B, 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 'double-queue reference' is greater than or equal to 1, then sequentially scanning the adjacent prediction units in the order of F, G, C, A, B, D (or other ways can be used, without limitation) to obtain the first scanned prediction unit whose coding unit is the foreground and whose prediction reference mode is 'double-queue reference'), taking the queue 0 motion vector and queue 1 motion vector of the spatial motion information storage unit of the prediction unit as the queue 0 motion vector and queue 1 motion vector of the prediction unit to be currently decoded, and taking the queue 0 reference index and queue 1 reference index of the spatial motion information storage unit as the queue 0 reference index and queue 1 reference index of the prediction unit to be currently decoded respectively .
Otherwise, if, in the six neighboring prediction units F, G, C, A, B, D of the prediction unit to be decoded currently, the coding unit where the neighboring prediction unit is located is the foreground, 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 sequentially scanning the neighboring prediction units in the order of F, G, C, A, B, D (or other ways may be adopted, without limitation thereto) to obtain the first scanned prediction unit whose coding unit is the foreground and whose prediction reference mode is 'queue 0 reference' and the first scanned prediction unit whose coding unit is the foreground and whose prediction reference mode is 'queue 1 reference'), and storing the queue 0 motion vector of the spatial motion information storage unit of the prediction unit whose prediction reference mode is 'queue 0 reference' and the queue 0 motion index of the prediction unit Queue 0 motion vector and queue 0 motion index as the prediction unit to be decoded currently; and taking the queue 1 motion vector and the queue 1 reference index of the spatial motion information storage unit of the prediction unit with the prediction reference mode of 'queue 1 reference' as the queue 1 motion vector and the queue 1 reference index of the prediction unit to be decoded currently.
Otherwise, the motion vectors of queue 0 and queue 1 of the current prediction unit to be decoded are both zero vectors, and the values of the reference index of queue 0 and the reference index of queue 1 of the current prediction unit to be decoded are both equal to 0.
The prediction reference mode of the prediction unit to be currently decoded is set to 'dual queue reference'.
(B) If, in the six neighboring prediction units F, G, C, A, B, D of the current prediction unit to be decoded, the coding unit where the neighboring 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 neighboring prediction units are sequentially scanned in the order of F, G, C, A, B, D (or other ways may be used, without limitation thereto) 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 current prediction unit to be decoded.
Otherwise, if, in the six neighboring prediction units F, G, C, A, B, D of the prediction unit to be currently decoded, the coding unit where the neighboring 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 neighboring prediction units are sequentially scanned in the order of D, B, A, C, G, F (or in other orders, without limitation) 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 prediction unit to be currently decoded.
Otherwise, the motion vector of queue 1 of the current prediction unit to be decoded is a zero vector, and the value of the queue 1 reference index of the current prediction unit to be decoded is equal to 0.
The prediction reference mode of the current prediction unit is set to 'queue 1 reference'.
(C) If, in the six neighboring prediction units F, G, C, A, B, D of the current prediction unit to be decoded, the coding unit where the neighboring 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, then the neighboring prediction units are sequentially scanned in the order of F, G, C, A, B, D (or other ways may be used, without limitation thereto) to obtain the first scanned prediction unit whose coding unit is 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 current prediction unit to be decoded.
Otherwise, if, in the six neighboring prediction units F, G, C, A, B, D of the prediction unit to be currently decoded, the coding unit where the neighboring 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 sequentially scanning the neighboring prediction units in the order of D, B, A, C, G, F (or other ways may be adopted, without limitation thereto) to obtain the first scanned prediction unit whose coding unit is the foreground and whose prediction reference mode is 'double-queue reference', and using the queue 0 motion vector and queue 0 reference index of the spatial domain motion information storage unit of the prediction unit as the queue 0 motion vector and queue 0 reference index of the prediction unit to be currently decoded.
Otherwise, the motion vector of queue 0 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.
The prediction reference mode of the prediction unit currently to be decoded is set to 'queue 0 reference'.
(III) if the coding unit where the prediction unit to be decoded currently is located is a foreground, and the subtype is any one of the following types: 1) advanced motion vector representation for P picture skip mode; 2) high-level motion vector representation of P-picture direct mode; 3) high-level motion vector representation of B picture skip mode; 4) b, high-level motion vector expression of the image direct mode, and deriving motion information according to the following steps:
the availability of the neighboring prediction units of the prediction unit to be currently decoded is determined, F, G, C, A and D are the neighboring prediction units of the prediction unit to be currently decoded E (or other combinations may be used, and are not limited herein).
a) If F exists and the coding unit is foreground, and the inter-frame prediction mode is adopted, F is available; otherwise, F is "unavailable".
b) If G exists and the located coding unit is foreground, and the inter-frame prediction mode is adopted and the motion information of G and F are different, G is available; otherwise, G is "unavailable".
c) C is "available" if C exists and the coding unit in which C is located is foreground, and inter prediction mode is adopted and the motion information of C and G are not the same; otherwise, C is "unavailable".
d) If A exists and the coding unit is foreground, and the interframe prediction mode is adopted and the motion information of A and F are different, then A is available; otherwise, a is "unavailable".
e) If D exists and the coding unit where D is located is a foreground, and an inter-frame prediction mode is adopted, 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".
And determining the information expressed by the advanced motion vector of the current prediction unit to be decoded according to the availability of the adjacent prediction units of the current prediction unit to be decoded.
(IV) if the coding unit of the current prediction unit to be decoded is foreground, and the subtype is any one of the following types: 1) affine motion of P-picture skip mode; 2) affine motion of P-picture direct mode; 3) affine motion of the B image skip mode; 4) and B, affine motion of the image direct mode, and deriving affine motion information of a current prediction unit to be decoded according to the following steps:
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 current coding unit is foreground and is in inter prediction mode, the neighboring unit X is "available"; otherwise the neighboring cell X is "unavailable".
And deriving affine motion information of the current prediction unit to be decoded according to the availability of the adjacent prediction units of the current prediction unit to be decoded.
Against the background
(I) If the coding unit where the prediction unit to be decoded currently is located is a background, and the subtype is any one of the following types: 1) use of spatial queue 0 reference in P picture skip mode; 2) using spatial domain queue 0 reference in P-picture direct mode, motion information is derived as follows:
if, in the six neighboring prediction units F, G, C, A, B, D of the current prediction unit to be decoded, the coding unit where the neighboring 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 neighboring prediction units are sequentially scanned in the order of F, G, C, A, B, D (or other ways may be used, without limitation thereto) 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.
Otherwise, the motion vector of queue 0 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.
The prediction reference mode of the prediction unit currently to be decoded is set to 'queue 0 reference'.
(II) if the coding unit where the current prediction unit to be decoded is located is the background, and the subtype is any one of the following types: b, using a spatial queue 0 reference, or using a spatial queue 1 reference, or using a spatial double queue (0 and 1) reference in a picture skipping mode; or using a spatial queue 0 reference, or using a spatial queue 1 reference, or using a spatial double queue (0 and 1) reference in the B-picture direct mode, deriving motion information according to the following steps:
(A) if, in the six neighboring prediction units F, G, C, A, B, D of the current prediction unit to be decoded, the coding unit where the neighboring 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 scanning the neighboring prediction units in the order of F, G, C, A, B, D (or other ways can be used without limitation) to obtain the first scanned prediction unit whose coding unit is the background and whose prediction reference mode is 'double-queue reference'), taking the queue 0 motion vector and queue 1 motion vector of the spatial motion information storage unit of the prediction unit as the queue 0 motion vector and queue 1 motion vector of the current prediction unit to be decoded, and taking the queue 0 reference index and queue 1 reference index of the spatial motion information storage unit as the queue 0 reference index and queue 1 motion vector of the current prediction unit to be decoded respectively Column 1 refers to the index.
Otherwise, if, in the six neighboring prediction units F, G, C, A, B, D of the prediction unit to be decoded currently, the coding unit in which the neighboring prediction unit is located is the background, 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 neighboring prediction units are sequentially scanned in the order of F, G, C, A, B, D (or other manners may be adopted, without limitation), to obtain the first scanned prediction unit whose coding unit is the background and whose prediction reference mode is 'queue 0 reference' and the first scanned prediction unit whose coding unit is the background and whose prediction reference mode is 'queue 1 reference', and 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' are stored in the spatial motion information storage unit of the queue 0 reference Queue 0 motion vector and queue 0 motion index as the prediction unit to be decoded currently; and taking the queue 1 motion vector and the queue 1 reference index of the spatial motion information storage unit of the prediction unit with the prediction reference mode of 'queue 1 reference' as the queue 1 motion vector and the queue 1 reference index of the prediction unit to be decoded currently.
Otherwise, the motion vectors of queue 0 and queue 1 of the current prediction unit to be decoded are both zero vectors, and the values of the reference index of queue 0 and the reference index of queue 1 of the current prediction unit to be decoded are both equal to 0.
The prediction reference mode of the prediction unit to be currently decoded is set to 'dual queue reference'.
(B) If, in the six neighboring prediction units F, G, C, A, B, D of the current prediction unit to be decoded, the coding unit where the neighboring prediction unit is located is the background, and the number of prediction units whose prediction reference mode is 'queue 1 reference' is greater than or equal to 1, then the neighboring prediction units are sequentially scanned in the order of F, G, C, A, B, D (or other ways may be used, without limitation thereto) 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 current prediction unit to be decoded.
Otherwise, if, in the six neighboring prediction units F, G, C, A, B, D of the current prediction unit to be decoded, the coding unit where the neighboring prediction unit is located is the background, and the number of prediction units whose prediction reference mode is 'dual-queue reference' is greater than or equal to 1, then the neighboring prediction units are sequentially scanned in the order of D, B, A, C, G, F (or other ways may be adopted, without limitation thereto) to obtain the first scanned prediction unit whose coding unit is the background and whose prediction reference mode is 'dual-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.
Otherwise, the motion vector of queue 1 of the current prediction unit to be decoded is a zero vector, and the value of the queue 1 reference index of the current prediction unit to be decoded is equal to 0.
The prediction reference mode of the prediction unit currently to be decoded is set to 'queue 1 reference'.
(C) If, in the six neighboring prediction units F, G, C, A, B, D of the current prediction unit to be decoded, the coding unit where the neighboring 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 neighboring prediction units are sequentially scanned in the order of F, G, C, A, B, D (or other ways may be used, without limitation thereto) 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.
Otherwise, if, in the six neighboring prediction units F, G, C, A, B, D of the prediction unit to be decoded currently, the coding unit where the neighboring 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 neighboring prediction units are sequentially scanned in the order of D, B, A, C, G, F (or other ways may be adopted, without limitation thereto) 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 domain 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 to be decoded currently.
Otherwise, the motion vector of queue 0 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.
The prediction reference mode of the prediction unit currently to be decoded is set to 'queue 0 reference'.
(III) if the coding unit where the current prediction unit to be decoded is located is a background and the subtype is any one of the following types: 1) advanced motion vector representation for P picture skip mode; 2) high-level motion vector representation of P-picture direct mode; 3) high-level motion vector representation of B picture skip mode; 4) b, high-level motion vector expression of the image direct mode, and deriving motion information according to the following steps:
the availability of the neighbor prediction units of the prediction unit currently to be decoded is determined, F, G, C, A and D being neighbor prediction units of the current prediction unit E (or other combinations may be used, not limited herein).
f) If F exists and the coding unit in which F exists is a background and an inter-frame prediction mode is adopted, F is 'available'; otherwise, F is "unavailable".
g) If G exists and the coding unit where G is located is a background, and an inter-frame prediction mode is adopted and the motion information of G and F is different, G is available; otherwise, G is "unavailable".
h) If C exists and the coding unit where C exists is a background, and an inter-frame prediction mode is adopted and the motion information of C and G is different, C is available; otherwise, C is "unavailable".
i) If A exists and the coding unit where A exists is a background, and an inter-frame prediction mode is adopted and the motion information of A and F is different, the A is available; otherwise, a is "unavailable".
j) If D exists and the coding unit where D is located is a background, and an inter-frame prediction mode is adopted, 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".
And determining the information expressed by the advanced motion vector of the current prediction unit to be decoded according to the availability of the adjacent prediction units of the current prediction unit to be decoded.
(IV) if the coding unit where the current prediction unit to be decoded is located is the background, and the subtype is any one of the following types: 1) affine motion of P-picture skip mode; 2) affine motion of P-picture direct mode; 3) affine motion of the B image skip mode; 4) and B, affine motion of the image direct mode, and deriving affine motion information of the current prediction unit according to the following steps:
if a neighboring prediction unit X (X is F, G, C, A, B or D) of a prediction unit to be currently decoded exists, and the located coding unit is a background and is an inter prediction mode, the neighboring unit X is "available"; otherwise the adjacent cell X is "unavailable";
and deriving affine motion information of the current prediction unit according to the availability of the adjacent prediction units of the prediction unit to be decoded currently.
Fig. 7 is a block diagram illustrating a method of deriving a basic unit of a motion vector, which may also be referred to as motion vector precision, according to an embodiment of the present invention. The embodiment shown in fig. 7 is for illustration only. Other sequences and cell divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 7, a method of obtaining motion vector accuracy in a decoding apparatus is disclosed, the obtaining method of setting different motion vector accuracy for differences in motion characteristics of a foreground and a background. In step 701, foreground and/or background information of a coding unit where a current prediction unit to be decoded is located is obtained; in step 702, a motion vector precision set of a current prediction unit to be decoded is obtained according to the obtained foreground and/or background information of the coding unit where the current prediction unit to be decoded is located; in step 703, obtaining a motion vector precision index value of a current prediction unit to be decoded; in step 704, the basic unit of the motion vector of the current prediction unit to be decoded is obtained according to the motion vector precision index value and the motion vector precision set.
Specifically, if the coding unit where the current prediction unit to be decoded is located is a foreground, the motion vector precision set of the current prediction unit is {1/4, 1/2, 1,2,4}, and the value range of the index value of the motion vector precision is 0-4 and is an integer; namely:
-when the index value is 0, the basic unit of the motion vector is 1/4 integer samples;
-when the index value is 1, the basic unit of the motion vector is 1/2 integer samples;
-when the index value is 2, the basic unit of the motion vector is 1 integer sample;
-when the index value is 3, the basic unit of the motion vector is 2 integer samples;
when the index value is 4, the basic unit of the motion vector is 4 integer samples.
If the coding unit where the prediction unit to be decoded is located is a background, the motion proper precision set is {1/4, 1/2, 1}, and the value range of the index value of the motion vector precision is 0,1, 2; namely:
-when the index value is 0, the basic unit of the motion vector is 1/4 integer samples;
-when the index value is 1, the basic unit of the motion vector is 1/2 integer samples;
when the index value is 2, the basic unit of the motion vector is 1 integer sample.
In another embodiment, the motion vector precision set of the prediction unit whose coding unit is foreground contains a value less than 1, a value equal to 1 and a value greater than 1; the motion vector precision set of which the coding unit is a background prediction unit comprises a value smaller than 1 and a value equal to 1; the particular number of precision values in the motion vector precision set is not limited herein.
In a normal case, the background of the image has no motion or very slight motion, and therefore the basic unit value of the set motion vector is small; whereas foreground motion may be severe or slight in general, the basic unit value of the set motion vector may range from small to large. According to the embodiment of the invention, the bit number used for coding the index value of the motion vector precision can be saved, and the code rate can be saved.
According to the embodiment of the invention, a method for constructing a reference image queue is provided, wherein different reference image queue construction methods are adopted for a prediction unit with a foreground as a coding unit and a prediction unit with a background as a coding unit, and the construction methods in an encoding device and a decoding device are consistent.
Specifically, for the case where the coding unit where the prediction unit is located is the background, the reference image queue includes: 1) a background image, or 2) a background image and an encoded or decoded image immediately adjacent to the current image.
In the case where the coding unit in which the prediction unit is located is foreground, the images included in the reference image queue are not limited, but in general, the case where the coded or decoded image is included is more than the case where the background image is included.
In the usual case, the background is stationary or there is only slight motion, such as wind disturbances of leaves and grass, so the reference image can be set relatively rarely, either using only the background image as a reference or using the encoded/decoded image that is most relevant in the time domain (next to the current image) as a reference. According to the embodiment of the invention, the coding complexity of a coding end can be reduced, the bit number of the index value of the coded reference image can be reduced, and the code rate is saved.
Fig. 8a and 8b are block diagrams illustrating a method of deriving a quantization parameter of a coding unit in a decoding apparatus according to an embodiment of the present invention. The embodiments shown in fig. 8a and 8b are for illustration only. Other divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 8a, in step 801, foreground and/or background information of a coding unit to be currently 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 may be an average quantization parameter of a current image to be decoded, or a quantization parameter of a previously decoded coding unit, and the like, which is not limited herein.
In another embodiment, if the current coding unit to be decoded is foreground, the quantization parameter of the current coding unit to be decoded is set to be the basic quantization parameter minus the absolute value of the difference value of the first quantization parameter; and if the coding unit to be decoded currently is the background, setting the quantization parameter of the coding unit to be decoded currently as the basic quantization parameter value.
In another embodiment, if the coding unit to be decoded currently is a background, the quantization parameter of the coding unit to be decoded currently is set to be the basic quantization parameter plus the second quantization parameter difference absolute value; and if the coding unit to be decoded currently is the foreground, setting the quantization parameter of the coding unit to be decoded currently as the basic quantization parameter.
The first quantization parameter difference absolute value and the second quantization parameter difference absolute value are preset according to the same rule in the encoding device and the decoding device, and the specific values are not limited herein.
Another possible embodiment is shown in fig. 8b, wherein in step 801', a difference value of the quantization parameter of the coding unit currently to be decoded is decoded, wherein the difference value 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.
According to the embodiment of the invention, in the monitoring video, the user usually only pays attention to the moving object of the foreground, so that a smaller quantization parameter is set for the foreground coding unit, the quality of the reconstructed image of the foreground part can be improved, and the user experience is improved; or a larger quantization parameter is set for the background coding unit, so that the code rate is saved.
In fig. 9a, a block diagram for an encoding method according to an embodiment of the invention is shown. The embodiment shown in fig. 9a is for illustration only. Other divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 9a, at step 901, information about a prediction unit to be currently encoded is obtained, where the information includes foreground and/or background information of a coding unit in which the prediction unit to be currently encoded is located; at step 902, information about a prediction unit currently to be encoded is output into a code stream.
In one embodiment, the encoding method further comprises: when the current prediction unit is predicted by using the inter-frame prediction mode, deriving a prediction value of the current prediction unit to be coded according to foreground and/or background information of a coding unit where the current prediction unit to be coded is located, and obtaining a residual value according to an original pixel value and the prediction value; setting quantization parameters according to foreground and/or background information of a coding unit where a current prediction unit to be coded is located; deriving residual information using the set quantization parameter and the obtained residual value; and outputting the residual error information and the basic quantization parameter information to a code stream.
In one embodiment, the obtaining information on the prediction unit to be currently encoded includes: acquiring a background image, acquiring foreground and/or background information of each coding unit in the current image according to the background image and the current image to be coded, and coding the foreground and/or background information of each coding unit according to a set parameter for marking the size of the coding unit.
In one embodiment, the deriving the prediction value of the current prediction unit to be coded according to foreground and/or background information of a coding unit where the current prediction unit to be coded is located includes: obtaining the prediction motion information of a prediction unit to be coded currently; setting a motion search range according to foreground and/or background information and predicted motion information of a coding unit where a current prediction unit to be coded is located; and obtaining the motion vector difference value of the current prediction unit to be coded according to the prediction motion information of the current prediction unit to be coded and the motion search range.
In fig. 9b, an encoding method according to an embodiment of the invention is shown. The embodiment shown in fig. 9b is for illustration only. Other divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 9b, at step 901', foreground and/or background information of a coding unit where a prediction unit to be currently coded is located is obtained; at step 902', when the current prediction unit is predicted using the inter-frame prediction mode, deriving a prediction value of the current prediction unit to be encoded according to foreground and/or background information of an encoding unit in which the current prediction unit to be encoded is located, subtracting the prediction value from an original pixel value to obtain a residual value, and transforming the residual value; at step 903', setting a quantization parameter according to foreground and/or background information of a coding unit where a prediction unit to be currently coded is located; at step 904', quantizing the transformed residual values using the set quantization parameters, obtaining residual information; and outputting foreground and/or background information, residual information, and basic quantization parameter information into the code stream at step 905'.
In fig. 10, a block diagram of a setting method of a motion search range in an encoding apparatus according to an embodiment of the present invention is shown. The embodiment shown in fig. 10 is for illustration only. Other divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 10, in step 1001, if the coding unit where the current prediction unit to be coded is located is a foreground, a search range with a larger value is set; if the coding unit where the prediction unit to be coded is located is a background, setting a search range with a smaller numerical value; in step 1002, obtaining predicted motion information of a prediction unit to be currently encoded, the predicted motion information including: a motion vector predicted value, a prediction reference mode, an index value of a reference image in a reference image queue and the like; in step 1003, a reference image corresponding to the index value is found in the reference image queue according to the prediction reference mode, a position pointed by the motion vector prediction value is taken as a search center, motion search is performed within a set search range, a block which is most matched with the current prediction unit to be coded is found, and the distance between the position of the search center and the position of the upper left corner of the most matched block is calculated, wherein the distance is the motion vector difference.
Specifically, if the prediction reference mode is referred to as a queue 0, a reference image corresponding to the index value is found in the reference image queue 0, and a motion vector difference value of the queue 0 after motion search is obtained; if the prediction reference mode is referred to as a queue 1, finding a reference image corresponding to the index value in the reference image queue 1, and obtaining a motion vector difference value of the queue 1 after motion search; if the prediction reference mode is double-queue reference, respectively finding the reference images corresponding to the index values in the reference image queue 0 and the queue 1, and respectively obtaining the motion vector difference value of the queue 0 and the motion vector difference value of the queue 1 after motion search.
According to the embodiment of the invention, the background is static or only slight motion exists, such as the wind disturbance of leaves and grass, so that the absolute value of the motion vector and the absolute value of the motion vector difference are not large, the range of motion search is set to be small, and the complexity of the encoding end can be reduced.
In fig. 11, a block diagram of an apparatus for performing a decoding method according to an embodiment of the present invention is shown. The embodiment shown in fig. 11 is for illustration only. Other divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 11, the apparatus includes a receiving unit 1101 for receiving data from a code stream, and a decoder 1102 coupled to the receiving unit and configured to: acquiring information about a current prediction unit to be decoded from received data, wherein the information about the current prediction unit to be decoded comprises foreground and/or background information of an encoding unit where the current prediction unit to be decoded is located; obtaining a predicted value of the current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located; and obtaining a reconstruction value according to the prediction value of the current prediction unit to be decoded.
In fig. 12, a block diagram of an apparatus for performing an encoding method according to an embodiment of the present invention is shown. The embodiment shown in fig. 12 is for illustration only. Other divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 12, the apparatus includes an encoder 1201 configured to: obtaining information about a current prediction unit to be coded, wherein the information comprises foreground and/or background information of a coding unit where the current prediction unit to be coded is located; outputting information on a prediction unit to be currently encoded to the transmission unit 1202; and a transmitting unit 1202 coupled to the encoder and configured to encode information on a prediction unit currently to be encoded into the codestream.
In fig. 13, a block diagram of an electronic device according to an embodiment of the invention is shown. The embodiment shown in fig. 13 is for illustration only. Other divisions may be used without departing from the scope of the present disclosure.
Referring to fig. 13, the electronic device comprises a memory 1301 configured for storing a computer program; and a processor 1302 configured to read the computer program from the memory and to perform the decoding method and/or the encoding method as described above.
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 embrace such alterations and modifications as fall within the scope of the appended claims.
None of the description in this application should be read as implying that any particular element, step, or function is an essential element which must be included in the claim scope. The scope of patented subject matter is defined only by the claims.

Claims (20)

1. A method of decoding, the method comprising:
acquiring information about a current prediction unit to be decoded from a code stream, wherein the information about the current prediction unit to be decoded comprises foreground and/or background information of a coding unit where the current prediction unit to be decoded is located;
and obtaining a reconstruction value of the current prediction unit to be decoded according to the information about the current prediction unit to be decoded.
2. The method according to claim 1, wherein the obtaining a reconstructed value of the current prediction unit to be decoded according to the information on the current prediction unit to be decoded comprises:
obtaining a predicted value of the current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located;
and obtaining a reconstruction value of the current prediction unit to be decoded according to the prediction value of the current prediction unit to be decoded.
3. The method according to claim 2, wherein the obtaining the prediction value of the current prediction unit to be decoded according to foreground and/or background information of an encoding unit where the current prediction unit to be decoded is located comprises:
obtaining information on neighboring prediction units of a prediction unit to be currently decoded;
deriving inter-frame prediction information of the current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located and information of an adjacent prediction unit;
and obtaining a predicted value of the current prediction unit to be decoded according to the derived inter-frame prediction information of the current prediction unit to be decoded.
4. The method of claim 3, wherein the information of the neighbor prediction unit comprises: foreground and/or background information of the coding unit where the adjacent prediction unit is located.
5. The method according to claim 2, wherein the obtaining of the reconstructed value of the current prediction unit to be decoded according to the information on the current prediction unit to be decoded comprises:
obtaining a residual error value of a current prediction unit to be decoded;
and obtaining a reconstruction value of the current prediction unit to be decoded according to the prediction value of the current prediction unit to be decoded and the residual value of the current prediction unit to be decoded.
6. The method according to any of claims 1 to 5, wherein the information on the prediction unit currently to be decoded further comprises at least one of: residual information and basic quantization parameter information.
7. The method according to claim 5 or 6, wherein said obtaining residual values of a prediction unit currently to be decoded comprises: obtaining a residual value of the prediction unit to be currently decoded according to information on the prediction unit to be currently decoded.
8. The method according to claim 3 or 4, wherein the inter prediction information of the prediction unit to be currently decoded comprises at least one of: the motion vector prediction value of the current prediction unit to be decoded, the motion information of the current prediction unit to be decoded, the motion vector precision of the current prediction unit to be decoded, and the reference image queue information of the current prediction unit to be decoded.
9. The method according to claim 8, wherein the deriving inter-frame prediction information of the current prediction unit to be decoded according to foreground and/or background information of a coding unit in which the current prediction unit to be decoded is located and information of adjacent prediction units comprises:
acquiring motion information of a current prediction unit to be decoded;
and deriving a motion vector predicted value of the current prediction unit to be decoded according to the foreground and/or background information of the coding unit where the current prediction unit to be decoded is located, the motion information of the current prediction unit to be decoded and the information of the adjacent prediction units.
10. The method according to claim 8, wherein the deriving inter-frame prediction information of the current prediction unit to be decoded according to foreground and/or background information of a coding unit in which the current prediction unit to be decoded is located and information of adjacent prediction units comprises:
acquiring coding unit type information of a current prediction unit to be decoded;
and deriving the motion information of the skip mode or the direct mode of the current prediction unit to be decoded according to the foreground and/or background information of the coding unit where the current prediction unit to be decoded is located, the coding unit type information of the current prediction unit to be decoded and the information of the adjacent prediction units.
11. The method according to claim 8, wherein the deriving inter-frame prediction information of the current prediction unit to be decoded according to foreground and/or background information of a coding unit in which the current prediction unit to be decoded is located and information of adjacent prediction units comprises:
acquiring a motion vector precision collection and a motion vector precision index value of a current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located;
and obtaining the motion vector precision of the current prediction unit with decoding according to the motion vector precision aggregate and the motion vector precision index value of the current prediction unit to be decoded.
12. The method of claim 8, wherein deriving inter-prediction information of the current prediction unit to be decoded according to foreground and/or background information of a coding unit in which the current prediction unit to be decoded is located and information of neighboring prediction units comprises:
and constructing a reference image queue of the current prediction unit to be decoded according to the foreground and/or background information of the coding unit where the current prediction unit to be decoded is located.
13. The method of claim 7, wherein the obtaining the residual value of the prediction unit to be currently decoded according to the information on the prediction unit to be currently decoded comprises:
and deriving the quantization parameter of the current prediction unit to be decoded according to the foreground and/or background information and the basic quantization parameter information of the coding unit where the current prediction unit to be decoded is located, and obtaining a residual value according to the quantization parameter and the residual information.
14. The method according to claim 13, wherein the deriving the quantization parameter of the current prediction unit to be decoded according to the foreground and/or background information and the basic quantization parameter information of the coding unit in which the current prediction unit to be decoded is located comprises:
and acquiring the quantization parameter of the current coding unit to be decoded according to 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 and the preset absolute value of the difference value of the first quantization parameter.
15. The method according to claim 13, wherein the deriving the quantization parameter of the current prediction unit to be decoded according to the foreground and/or background information and the basic quantization parameter information of the coding unit in which the current prediction unit to be decoded is located comprises:
decoding the difference value of the quantization parameters of the coding unit where the 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 according to the difference value of the basic quantization parameter and the quantization parameter.
16. A method of encoding, the method comprising:
obtaining information about a current prediction unit to be coded, wherein the information comprises foreground and/or background information of a coding unit where the current prediction unit to be coded is located;
and outputting information about the prediction unit to be currently coded into the code stream.
17. The method of claim 16, further comprising:
when the current prediction unit is predicted by using the inter-frame prediction mode, deriving a prediction value of the current prediction unit to be coded according to foreground and/or background information of a coding unit where the current prediction unit to be coded is located, and obtaining a residual value according to an original pixel value and the prediction value;
setting quantization parameters according to foreground and/or background information of a coding unit where a current prediction unit to be coded is located;
deriving residual information using the set quantization parameter and the obtained residual value;
and outputting the residual error information and the basic quantization parameter information to a code stream.
18. An apparatus for performing a decoding method, the apparatus comprising:
a receiving unit configured to receive data from the codestream;
a decoder coupled with the receiving unit and configured to:
acquiring information about a current prediction unit to be decoded from received data, wherein the information about the current prediction unit to be decoded comprises foreground and/or background information of an encoding unit where the current prediction unit to be decoded is located;
obtaining a predicted value of the current prediction unit to be decoded according to foreground and/or background information of a coding unit where the current prediction unit to be decoded is located;
and obtaining a reconstruction value according to the prediction value of the current prediction unit to be decoded.
19. An apparatus for performing an encoding method, the apparatus comprising:
an encoder configured to:
obtaining information about a current prediction unit to be coded, wherein the information comprises foreground and/or background information of a coding unit where the current prediction unit to be coded is located;
outputting information on a prediction unit to be currently encoded to a transmission unit; and
a transmitting unit coupled to the encoder and configured to encode information on a prediction unit currently to be encoded into a codestream.
20. An electronic device, comprising:
a memory configured to store a computer program; and
a processor configured to read the computer program from the memory and to perform the method of any one of claims 1-17.
CN202010113883.2A 2020-02-24 2020-02-24 Coding and decoding method and device Pending CN113301337A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010113883.2A CN113301337A (en) 2020-02-24 2020-02-24 Coding and decoding method and device
PCT/KR2021/002261 WO2021172847A1 (en) 2020-02-24 2021-02-23 Method and apparatus for encoding or decoding a video according to background and foreground

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010113883.2A CN113301337A (en) 2020-02-24 2020-02-24 Coding and decoding method and device

Publications (1)

Publication Number Publication Date
CN113301337A true CN113301337A (en) 2021-08-24

Family

ID=77317862

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010113883.2A Pending CN113301337A (en) 2020-02-24 2020-02-24 Coding and decoding method and device

Country Status (2)

Country Link
CN (1) CN113301337A (en)
WO (1) WO2021172847A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013070006A1 (en) * 2011-11-09 2013-05-16 에스케이텔레콤 주식회사 Method and apparatus for encoding and decoding video using skip mode
WO2015085575A1 (en) * 2013-12-13 2015-06-18 Mediatek Singapore Pte. Ltd. Methods for background residual prediction
WO2017069588A1 (en) * 2015-10-22 2017-04-27 엘지전자(주) Method for encoding/decoding image and device therefor
CN108293113A (en) * 2015-10-22 2018-07-17 Lg电子株式会社 The picture decoding method and equipment based on modeling in image encoding system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6798834B1 (en) * 1996-08-15 2004-09-28 Mitsubishi Denki Kabushiki Kaisha Image coding apparatus with segment classification and segmentation-type motion prediction circuit
WO2010057170A1 (en) * 2008-11-17 2010-05-20 Cernium Corporation Analytics-modulated coding of surveillance video
CN106034237B (en) * 2015-03-10 2020-07-03 杭州海康威视数字技术股份有限公司 Hybrid coding method and system based on coding switching
CN106210612A (en) * 2015-04-30 2016-12-07 杭州海康威视数字技术股份有限公司 Method for video coding, coding/decoding method and device thereof
JP6729170B2 (en) * 2016-08-23 2020-07-22 沖電気工業株式会社 Image processing system and image decoding device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013070006A1 (en) * 2011-11-09 2013-05-16 에스케이텔레콤 주식회사 Method and apparatus for encoding and decoding video using skip mode
CN104041048A (en) * 2011-11-09 2014-09-10 Sk电信有限公司 Method And Apparatus Video Encoding And Decoding Using Skip Mode
WO2015085575A1 (en) * 2013-12-13 2015-06-18 Mediatek Singapore Pte. Ltd. Methods for background residual prediction
WO2017069588A1 (en) * 2015-10-22 2017-04-27 엘지전자(주) Method for encoding/decoding image and device therefor
CN108293113A (en) * 2015-10-22 2018-07-17 Lg电子株式会社 The picture decoding method and equipment based on modeling in image encoding system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
PUSHKAR GORUR ET AL.: "Skip Decision and Reference Frame Selection for Low-Complexity H.264/AVC Surveillance Video Coding", 《IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS FOR VIDEO TECHNOLOGY 》, 25 April 2014 (2014-04-25) *
祁睿: "H.264视频解码器运动矢量预测模块设计与实现", 《万方数据库》, 17 August 2015 (2015-08-17) *
黄胜等: "基于背景帧的监控和会议视频帧间快速算法", 《计算机工程与应用》, 13 January 2020 (2020-01-13) *

Also Published As

Publication number Publication date
WO2021172847A1 (en) 2021-09-02

Similar Documents

Publication Publication Date Title
US11375229B2 (en) Method, device, and computer program for optimizing transmission of motion vector related information when transmitting a video stream from an encoder to a decoder
CN110326295B (en) Method and device for obtaining video image motion vector and storage medium
CN112823518B (en) Apparatus and method for inter prediction of geometrically partitioned blocks of coded blocks
KR102542000B1 (en) History-based video coding method and apparatus
CN114009040B (en) Encoder, decoder and corresponding methods
CN104303502A (en) Disparity vector construction method for 3D-hevc
CN112673633B (en) Encoder, decoder and corresponding methods for merging modes
CN103430539A (en) Decoded picture buffer management
CN104756499A (en) Reference picture status for video coding
CN110891180B (en) Video decoding method and video decoder
CN101573985A (en) Method and apparatus for video predictive encoding and method and apparatus for video predictive decoding
CN113383550A (en) Early termination of optical flow modification
CN117280691A (en) Enhanced motion vector prediction
CN110832861A (en) Video processing method and device
CN114009041A (en) Method for calculating integer grid reference sample position for block-level boundary sample gradient calculation in bidirectional prediction optical flow calculation and bidirectional prediction correction
CN113301337A (en) Coding and decoding method and device
CN110958452B (en) Video decoding method and video decoder
CN109587496B (en) Skip block distinguishing method, encoder, electronic device and readable storage medium
CN113556551A (en) Encoding and decoding methods, devices and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination