WO2021172847A1 - Method and apparatus for encoding or decoding a video according to background and foreground - Google Patents
Method and apparatus for encoding or decoding a video according to background and foreground Download PDFInfo
- Publication number
- WO2021172847A1 WO2021172847A1 PCT/KR2021/002261 KR2021002261W WO2021172847A1 WO 2021172847 A1 WO2021172847 A1 WO 2021172847A1 KR 2021002261 W KR2021002261 W KR 2021002261W WO 2021172847 A1 WO2021172847 A1 WO 2021172847A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- prediction
- information
- prediction unit
- decoded
- unit
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods 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/167—Position within a video image, e.g. region of interest [ROI]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/103—Selection of coding mode or of prediction mode
- H04N19/105—Selection 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods 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/146—Data rate or code amount at the encoder output
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods 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/157—Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N19/159—Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/17—Methods 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/176—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/20—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video object coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/44—Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/46—Embedding additional information in the video signal during the compression process
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/70—Methods 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
Definitions
- This disclosure relates to video coding and decoding, in particular to a method and apparatus of surveillance video encoding and decoding.
- surveillance videos are mostly taken by stationary cameras, usually with a fixed background, and the main background scene is unchanged.
- users mainly focus on foreground moving objects, and the foreground movements are usually more intense.
- existing video coding standards such as HEVC, H.264, etc., and a same inter prediction codec technology is used for the foreground and background, it will lead to inaccurate predictions, and on the other hand, encoded information redundancy would occur, the coding complexity is relatively large, and the coding efficiency decreases.
- this disclosure provides a coding and decoding method and an apparatus thereof, in which, different inter prediction methods and coding and decoding methods are adopted according to the foreground or background information of the current coding unit.
- the efficiency of surveillance video coding is improved and the coding complexity is reduced.
- FIG. 1 illustrates an exemplary spatial position relationship between a current coding unit and neighbouring units
- FIGs. 2A and 2B illustrate a decoding method according to an embodiment of the present disclosure
- FIG. 3 illustrates a method for identifying foreground and/or background information of a coding unit according to an embodiment of the present disclosure
- FIG. 4 illustrates a method for obtaining a motion vector prediction value of a prediction unit according to an embodiment of the present disclosure
- FIG. 5 illustrates the spatial position relationship between the current coding unit and neighbouring units
- FIG. 6 illustrates a method for deriving motion information of a prediction unit in skip mode or direct mode according to an embodiment of the present disclosure
- FIG. 7 is a block diagram showing a method for deriving a basic unit of a motion vector according to an embodiment of the present disclosure
- FIGs. 8A and 8B illustrate a method for deriving a quantization parameter of a coding unit in a decoding device according to an embodiment of the present disclosure
- FIGs. 9A and 9B illustrate an encoding method according to an embodiment of the present disclosure
- FIG. 10 illustrates a method for setting a motion search range in an encoding device according to an embodiment of the present disclosure
- FIG. 11 is a block diagram illustrating an apparatus for performing a decoding method according to an embodiment of the present disclosure
- FIG. 12 is a block diagram illustrating an apparatus for performing an encoding method according to an embodiment of the present disclosure.
- FIG. 13 is a block diagram illustrating an electronic device according to an embodiment of the present disclosure.
- a decoding method includes: obtaining information about a prediction unit currently to be decoded from a bit-stream, wherein the information about the prediction unit currently to be decoded includes the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtaining a reconstructed value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded.
- the obtaining the reconstructed value of the prediction unit comprises, when the prediction unit to be decoded is included in the foreground according to the foreground and/or background information, obtaining an information of one or more neighbouring prediction units located on the foreground, when the prediction unit to be decoded is included in the background according to the foreground and/or background information, obtaining an information of one or more neighbouring prediction units located on the background, and obtaining a prediction value of the prediction unit to be decoded using the information of the one or more neighbouring prediction units.
- the information of the one or more neighbouring prediction units includes inter prediction information of the one or more neighbouring prediction units, and the inter prediction information of the prediction unit to be decoded is determined using the inter prediction information of the one or more neighbouring prediction units.
- the inter prediction information of the prediction unit to be decoded includes at least one of motion vector prediction value of the prediction unit to be decoded, motion information of the prediction unit to be decoded, motion vector resolution of the prediction unit to be decoded, and reference picture list information of the prediction unit to be decoded.
- a neighbouring prediction unit is determined to be available, when all the following conditions, i) the neighbouring prediction unit is within boundary of a current image, ii) a coding unit including the neighbouring prediction unit is located on same type with the coding unit including the prediction unit to be decoded between the foreground and the background, iii) the neighbouring prediction unit does not apply the intra prediction mode, and iv) the neighbouring prediction unit has a motion vector type, are satisfied.
- the inter prediction information of the one or more neighbouring prediction units is determined according to a predetermined scan order.
- the inter prediction information of the prediction unit to be decoded includes a motion vector resolution set and a motion vector resolution index value of the prediction unit to be decoded.
- the inter prediction information of the prediction unit to be decoded includes a reference picture list of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located.
- the obtaining the prediction value of the prediction unit to be decoded includes obtaining a quantization parameter of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located and basic quantization parameter information, and obtaining the residual value according to the quantization parameter and the residual information.
- obtaining the quantization parameter of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located and the basic quantization parameter information includes obtaining the quantization parameter of the prediction unit to be decoded based on the basic quantization parameter and the absolute value of the preset first quantization parameter difference, according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located.
- the obtaining the quantization parameter of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located and the basic quantization parameter information includes decoding a difference of the quantization parameter of the coding unit where the prediction unit to be decoded is located, and obtaining a value of the quantization parameter of the coding unit where the prediction unit to be decoded is located according to the basic quantization parameter and the difference of the quantization parameter.
- a decoding method wherein the obtaining the reconstructed value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded includes: obtaining the prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtaining the reconstructed value of the prediction unit currently to be decoded according to the prediction value of the prediction unit currently to be decoded.
- a decoding method wherein the obtaining the prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located includes: obtaining information of the neighbouring prediction units of the prediction unit currently to be decoded; deriving inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units; obtaining the prediction value of the prediction unit currently to be decoded according to the derived inter prediction information of the prediction unit currently to be decoded.
- a decoding method wherein the information of the neighbouring prediction units include: foreground and/or background information of the coding unit where the neighbouring prediction units are located.
- a decoding method wherein the obtaining the reconstructed value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded includes: obtaining a residual value of the prediction unit currently to be decoded; obtaining the reconstructed value of the prediction unit currently to be decoded according to the prediction value of the prediction unit currently to be decoded and the residual value of the prediction unit currently to be decoded.
- a decoding method wherein the information about the prediction unit currently to be decoded further includes at least one of the residual information and basic quantization parameter information.
- a decoding method wherein the obtaining the residual value of the prediction unit currently to be decoded comprises: obtaining the residual value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded.
- a decoding method wherein the inter prediction information of the prediction unit currently to be decoded includes at least one of motion vector prediction value of the prediction unit currently to be decoded, motion information of the prediction unit currently to be decoded, motion vector resolution of the prediction unit currently to be decoded, and reference picture list information of the prediction unit currently to be decoded.
- a decoding method wherein the deriving the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units includes: obtaining the motion information of the prediction unit currently to be decoded; deriving the motion vector prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the motion information of the prediction unit currently to be decoded, and the information of the neighbouring prediction units.
- a decoding method wherein the deriving the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units includes: obtaining coding unit type information of the prediction unit currently to be decoded; deriving motion information of skip mode or direct mode of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the coding unit type information of the prediction unit currently to be decoded, and the information of the neighbouring prediction units.
- a decoding method wherein the deriving the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units includes: obtaining the motion vector resolution set and the motion vector resolution index value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtaining the motion vector resolution of the prediction unit currently to be decoded according to the motion vector resolution set and the motion vector resolution index value of the prediction unit currently to be decoded.
- a decoding method wherein the deriving the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units includes: generating a reference picture list of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located.
- a decoding method wherein the obtaining the residual value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded includes: deriving the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and basic quantization parameter information, and obtaining the residual value according to the quantization parameter and the residual information.
- a decoding method wherein the deriving the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and basic quantization parameter information includes: obtaining the quantization parameter of the prediction unit currently to be decoded based on the basic quantization parameter and the absolute value of the preset first quantization parameter difference, according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located.
- a decoding method wherein the deriving the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and basic quantization parameter information includes: decoding the difference of the quantization parameter of the coding unit where the prediction unit to be decoded is currently located; obtaining the value of the quantization parameter of the coding unit where the prediction unit currently to be decoded is located according to the basic quantization parameter and the difference of the quantization parameter.
- a encoding method includes: obtaining information about a prediction unit currently to be encoded, the information including foreground and/or background information of a coding unit where the prediction unit currently to be encoded is located; outputting the information about the prediction unit currently to be encoded into the bit-stream.
- an encoding method further includes: when the current prediction unit is predicted by using the inter prediction mode, deriving a predicted value of the prediction unit currently to be encoded according to the foreground and/or background information of a coding unit where the prediction unit currently to be encoded is located, obtaining a residual value according to an original pixel value and a predicted value; setting the quantization parameter according to the foreground and/or background information of a coding unit where the prediction unit currently to be encoded is located; using the set quantization parameter and the obtained residual value to derive residual information; outputting the residual information and basic quantization parameter information to the bit-stream.
- an encoding method wherein the obtaining information about the prediction unit currently to be encoded includes: obtaining a background image, obtaining the foreground and/or background information of each coding unit in the current image according to the background image and the current image to be encoded, encoding the foreground and/or background information of each coding unit according to a set parameter identifying the size of the coding unit.
- an encoding method wherein the deriving the prediction value of the prediction unit currently to be encoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located includes: obtaining prediction motion information of the prediction unit currently to be encoded; setting the motion search range according to the foreground and/or background information of the coding unit where the prediction unit to be coded is currently located and the prediction motion information; obtaining the motion vector difference of the prediction unit currently to be coded according to the prediction motion information of the prediction unit currently to be coded and the motion search range.
- an apparatus for performing a decoding method comprises: a receiving unit configured to receive data from a bit-stream; a decoder coupled to the receiving unit , and configured to: obtain information about the prediction unit currently to be decoded from the received data, wherein the information about the prediction unit currently to be decoded includes foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtain a prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtain a reconstructed value according to the prediction value of the prediction unit currently to be decoded.
- an apparatus for performing an encoding method includes: an encoder configured to obtain information about a prediction unit currently to be encoded, the information including the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located; output the information about the prediction unit currently to be encoded to a sending unit; and the sending unit, which is coupled to the encoder and is configured to encode the information of the prediction unit currently to be encoded into a bit-stream.
- an electronic device includes: a memory, which is configured to store a computer program; and a processor, which is configured to read the computer program from the memory, and is configured to execute the method described above.
- 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.
- transmit and “communicate,” as well as derivatives thereof, encompass both direct and indirect communication.
- the term “or” is inclusive, meaning and/or.
- controller means 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.
- phrases "at least one of,” when used with a list of items, means that different combinations of one or more of the listed items may be used, and only one item in the list may be needed.
- “at least one of: A, B, and C” includes any of the following combinations: A, B, C, A and B, A and C, B and C, and A and B and C.
- the application combination of the current coding unit and the neighbouring coding units, the scanning order and a split structure of a current coding unit and neighbouring coding units are only used for illustration. Without departing from the scope of the present disclosure, the application combination of the coding unit and the neighbouring coding units, the scanning order and split structure of the current coding unit and the neighbouring coding units may be implemented in different ways.
- the inter prediction modes applied to a prediction unit defined in the existing video coding standards include normal motion vector prediction mode, skip mode, and direct mode.
- the motion information is obtained through the following operations: 1) obtaining the motion vector prediction value, decoding the motion vector difference information indicating a difference between a motion vector of the current prediction unit and the motion vector prediction value, and adding the motion vector prediction value and the motion vector difference to obtain the motion vector value; 2) decoding a reference image information, and obtaining a prediction value of the prediction unit according to a position pointed by the motion vector on the obtained reference image; 3) decoding a residual information, obtaining a residual value by performing inverse quantization and inverse transformation on the residual information, and adding the residual value to the predicted value to obtain a reconstructed value of the current prediction unit.
- the motion information of the current prediction unit can be derived from a motion vector information of spatial neighbouring prediction units.
- the motion vector of the spatial neighbouring prediction unit adjacent to the current prediction unit and reference image information such as prediction direction and reference index are obtained according to the preset scanning order and acquisition rules from the neighbouring prediction units of the current prediction unit, and the motion vector of the spatial neighbouring prediction unit and reference image information are determined as the motion information of the current prediction unit.
- FIG. 1 illustrates an exemplary spatial position relationship between a current coding unit and neighbouring units.
- the spatial neighbouring prediction units of the current prediction unit may be predetermined according to a type of the video codec.
- the spatial neighbouring prediction units of the current prediction unit E may be defined in the first stage standard of AVS3 as shown in FIG. 1. It is assumed that the coordinate of the upper left sample of block E in the image is (x0, y0), and (x1, y0) is the coordinate of the upper right sample of the block E in the image.
- (x0, y1) is the coordinate of the lower left sample of the block E in the image
- the neighbouring units of block E are: the neighbouring unit A, which is block where the sample (x0-1, y0) is located; the neighbouring unit B, which is the block where the sample (x0, y0-1) is located; the neighbouring block C, which is the block where the sample (x1+1, y0-1) is located; the neighbouring block D, which is the block where the sample (x0-1 , y0-1) is located; the neighbouring block F, which is the block where the sample (x0-1, y1) is located; and the neighbouring block G, which is the block where the sample (x1, y0-1) is located.
- the spatial position relationship between block E and its neighbouring blocks is shown in Figure 1.
- the above-mentioned motion vector resolution that is, the basic unit of the motion vector is obtained by: obtaining the basic unit of the motion vector according to the decoded motion vector resolution index.
- the basic unit of the motion vector is 1/4 integer sample.
- the basic unit of the motion vector is 1/2 integer sample.
- the basic unit of the motion vector is 1 integer sample.
- the basic unit of the motion vector is 2 integer samples.
- the basic unit of the motion vector is 4 integer samples.
- FIG. 2A illustrates a decoding method according to an embodiment of the present disclosure is shown.
- the embodiment shown in FIG.2A is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
- information about the prediction unit currently to be decoded is obtained from the bit-stream.
- the information about the prediction unit currently to be decoded includes the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; in operation 202, a reconstructed value of the prediction unit currently to be decoded is obtained according to the information about the prediction unit currently to be decoded.
- the obtaining the reconstructed value of the prediction unit comprises, when the prediction unit to be decoded is included in the foreground according to the foreground and/or background information, obtaining an information of one or more neighbouring prediction units located on the foreground, when the prediction unit to be decoded is included in the background according to the foreground and/or background information, obtaining an information of one or more neighbouring prediction units located on the background, and obtaining a prediction value of the prediction unit to be decoded using the information of the one or more neighbouring prediction units.
- the information of the one or more neighbouring prediction units includes inter prediction information of the one or more neighbouring prediction units, and the inter prediction information of the prediction unit to be decoded is determined using the inter prediction information of the one or more neighbouring prediction units.
- the inter prediction information of the prediction unit to be decoded includes at least one of motion vector prediction value of the prediction unit to be decoded, motion information of the prediction unit to be decoded, motion vector resolution of the prediction unit to be decoded, and reference picture list information of the prediction unit to be decoded.
- a neighbouring prediction unit is determined to be available, when all the following conditions, i) the neighbouring prediction unit is within boundary of a current image, ii) a coding unit including the neighbouring prediction unit is located on same type with the coding unit including the prediction unit to be decoded between the foreground and the background, iii) the neighbouring prediction unit does not apply the intra prediction mode, and iv) the neighbouring prediction unit has a motion vector type, are satisfied.
- the inter prediction information of the one or more neighbouring prediction units is determined according to a predetermined scan order.
- obtaining the reconstructed value of the prediction unit currently to be decoded from the information about the prediction unit currently to be decoded includes: obtaining the prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtaining the reconstructed value of the prediction unit currently to be decoded according to the prediction value of the prediction unit currently to be decoded.
- the obtaining the prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located includes: obtaining the information of the neighbouring prediction units of the prediction unit currently to be decoded; deriving the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units; obtaining the prediction value of the prediction unit currently to be decoded according to the derived inter prediction information of the prediction unit currently to be decoded.
- the information of the neighbouring prediction unit includes: the foreground and/or background information of the coding unit where the neighbouring prediction units are located.
- the obtaining the reconstructed value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded includes: obtaining the residual value of the prediction unit currently to be decoded; obtaining the reconstructed value of the prediction unit currently to be decoded according to the prediction value of prediction unit currently to be decoded and the residual value of the prediction unit currently to be decoded.
- the information about the prediction unit currently to be decoded further includes at least one of the residual information and basic quantization parameter information.
- the obtaining the residual value of the prediction unit currently to be decoded includes: obtaining the residual value of the prediction unit currently to be decoded according to information about the prediction unit currently to be decoded.
- the inter prediction information of the prediction unit currently to be decoded includes at least one of the motion vector prediction value of the prediction unit currently to be decoded, the motion information of the prediction unit currently to be decoded, the motion vector resolution of the prediction unit currently to be decoded, and the reference picture list information of the prediction unit currently to be decoded.
- the obtaining the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and information of neighbouring prediction units includes: obtaining the motion information of the prediction unit currently to be decoded; obtaining the motion vector prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located, the motion information of the prediction unit currently to be decoded, and the information of neighbouring prediction units.
- the obtaining the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and information of neighbouring prediction units includes: obtaining the coding unit type information of the prediction unit currently to be decoded; obtaining the motion information of the prediction unit the current to be decoded in the skip mode or direct mode according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located, the coding unit type information of the prediction unit currently to be decoded, and the information of neighbouring prediction units.
- the obtaining the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and information of neighbouring prediction units includes: obtaining the motion vector resolution set and the motion vector resolution index value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtaining the motion vector resolution of the prediction unit currently to be decoded according to the motion vector resolution set and the motion vector resolution index value of the prediction unit currently to be decoded.
- the obtaining the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and information of neighbouring prediction units includes: generating a reference picture list of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located.
- the obtaining the residual value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded includes: obtaining the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the basic quantization parameter information, obtaining the residual value according to the quantization parameter and residual information.
- the obtaining the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the basic quantization parameter information includes: obtaining the quantization parameter of the coding unit currently to be decoded based on the basic quantization parameter and the absolute value of the preset first quantization parameter difference, according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located.
- the obtaining the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the basic quantization parameter information includes: decoding the difference value of the quantization parameter of the coding unit where the prediction unit currently to be decoded is located; obtaining the value of quantization parameter of the coding unit where the prediction unit currently to be decoded is located according to the difference between the basic quantization parameter and the quantization parameter.
- FIG. 2B illustrates another decoding method according to an embodiment of the present disclosure.
- the embodiment shown in Figure 2B is for illustration only. Other decoding methods may be used without departing from the scope of the present disclosure.
- information about the prediction unit currently to be decoded is obtained from the bit-stream, and the information includes the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located, residual information, basic quantization parameter information, etc.
- information about the neighbouring prediction units of the prediction unit currently to be decoded is obtained, and the information includes the foreground and/or background information of the coding unit where the neighbouring prediction units are located, motion information, coding unit type information and location information, etc.
- the inter prediction information is obtained according to foreground and/or background information of the prediction unit currently to be decoded and the information of neighbouring prediction units; in operation 204', the prediction value of the prediction unit currently to be decoded is obtained according to the derived inter prediction information, In operation 205', the residual information and the quantization parameter information of the prediction unit currently to be decoded are obtained, and the residual information is inversely quantized and inversely transformed to obtain the residual value of the prediction unit currently to be decoded, and in operation 206', the prediction value of the prediction unit currently to be decoded and the residual value are added to obtain the reconstructed value.
- FIG. 3 illustrates a method for identifying foreground and/or background information of a coding unit according to an embodiment of the present disclosure.
- the embodiment shown in Figure 3 is for illustration only. Other identifying methods may be used without departing from the scope of the present disclosure.
- a background image is obtained; the method for obtaining the background image can be any of the following methods, which are not limited here: 1) K-means clustering method; 2) Mean value method; 3) Median method; 4) Single Gaussian background modeling method; 5) Mixed Gaussian background modeling method, etc..
- the background image and the image currently to be coded are subtracted to obtain foreground and/or background information of each coding unit in the current image.
- the foreground and/or background information of the current coding unit that is, the foreground background identifier (1 bit, 1 or 0) in this embodiment, is encoded and transmitted to the decoding device.
- the foreground and/or background information may be set for each maximum coding unit, or may be set for each coding unit in the maximum coding unit.
- the foreground and/or background information may be set for a coding unit having a size equal to or larger than a predetermined size. If the small coding unit is not separately set for the foreground and/or background information, the foreground and/or background information of the large coding unit where the small coding unit is located will be shared.
- the size of the coding unit includes: 128x128, 64x64, 32x32, 16x16 and 8x8.
- the size of the coding unit for setting the foreground and/or background information can be: 1) 128x128, 2) 128x128 and 64x64, 3) 128x128, 64x64 and 32x32, 4) 128x128, 64x64, 32x32 and 16x16, 5) 128x128, 64x64, 32x32, 16x16 and 8x8.
- the size of the coding unit for setting the foreground and/or background information is not limited, but it contains at least the largest coding unit. In other words, the foreground and/or background information for the largest coding unit may be always set. For example, AVS3 contains at least the size of 128x128, and the foreground and/or background information for the largest coding unit of 128x128 is set.
- a same parameter for identifying the size of the coding unit of the foreground and background is set in the encoding device and the decoding device, taking AVS3 as an example, specifically:
- this parameter is 0 (or the parameter is 1);
- the coding unit size of the foreground and/or background information is set for 128x128 or 64x64, this parameter is 1 (or the parameter is 2);
- the coding unit size of the foreground and/or background information is set for 128x128, 64x64, 32x32, this parameter is 2 (or the parameter is 3);
- the coding unit size of the foreground and/or background information is set for 128x128, 64x64, 32x32, 16x16, then this parameter is 3 (or the parameter is 4);
- the coding unit size of the foreground and/or background information is set for 128x128, 64x64, 32x32, 16x16, 8x8, this parameter is 4 (or the parameter is 5).
- the foreground and/or background information is decoded according to the "parameter used to identify the size of the coding unit of the foreground and background", specifically:
- the parameter is 1, only one coded foreground and/or background information is decoded in each 128x128 coding unit and each 64x64 coding unit, and the small-size coding units within the 64x64 coding unit share this foreground and/or background information of the 64x64 coding unit;
- each 128x128 coding unit each 64x64 coding unit, each 32x32 coding unit, each 16x16 coding unit, and each 8x8 coding unit.
- FIG. 4 illustrates a method for obtaining a motion vector prediction value of a prediction unit according to an embodiment of the present disclosure.
- the embodiment shown in Figure 4 is for illustration only. Other methods and orders may be used without departing from the scope of the present disclosure.
- the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the motion vector prediction information of the prediction unit currently to be decoded are obtained.
- the motion vector prediction information includes the type of motion vector, etc.
- a motion vector prediction value is obtained according to the type of the motion vector of the prediction unit currently to be decoded.
- the type of the motion vector currently to be predicted may be: normal motion vector, affine motion vector, etc.
- the motion information of the neighbouring prediction unit is "available", otherwise "unavailable”: a) the neighbouring prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the neighbouring prediction unit is located is the foreground; c) the neighbouring prediction unit does not adopt the intra prediction mode; d) the neighbouring prediction unit has a motion vector of the normal motion vector type. For example, referring to FIG. 5, if the coding unit where the prediction unit (510, 520) currently to be decoded is located is the foreground, and the neighbouring prediction unit is X (X is A, B, C, D, F, or G in FIG.
- the motion information of the neighbouring prediction unit X is "available", otherwise "unavailable".
- the prediction unit (510,520) currently to be decoded is the foreground, and the neighbouring prediction units A, D, and B are the foreground, the neighbouring prediction unit C, G, and F are background.
- the motion information of the neighbouring prediction unit C, G, and F is unavailable, because the neighbouring prediction unit C, G, and F are located on the background.
- the motion information of the neighbouring prediction unit is "available", otherwise "unavailable”: a) the neighbouring prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the neighbouring prediction unit is located is the background; c) the neighbouring prediction unit does not adopt the intra prediction mode; d) the neighbouring prediction unit has a motion vector of the normal motion vector type.
- the motion information of the neighbouring prediction unit is "available", otherwise "unavailable”: a) the neighbouring prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the neighbouring prediction unit is located is the foreground; c) the neighbouring prediction unit does not adopt the intra prediction mode; d) the neighbouring prediction unit has a motion vector of the affine motion vector type.
- the prediction unit (510,520) currently to be decoded is the foreground, and the neighbouring prediction units A, D, and B are the foreground, the neighbouring prediction unit C, G, and F are background. In this case, the motion information of the neighbouring prediction unit C, G, and F is unavailable, because the neighbouring prediction unit C, G, and F are located on the background.
- the motion information of the neighbouring prediction unit is "available", otherwise "unavailable”: a) the neighbouring prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the neighbouring prediction unit is located is the background; c) the neighbouring prediction unit does not adopt the intra prediction mode; d) the neighbouring prediction unit has a motion vector of the affine motion vector type.
- FIG. 6 illustrates a method for deriving motion information of a prediction unit in skip mode or direct mode according to an embodiment of the present disclosure.
- the motion information includes information such as prediction reference mode, motion vector and reference index, etc.
- the prediction reference mode may include 1) information whether the prediction unit uses list 0 reference, and the number of motion vectors of the prediction unit is equal to 1; 2) information whether the prediction unit uses list 1 reference, the number of motion vectors of the prediction unit is equal to 1; 3) information whether the prediction unit uses double-list reference, and the number of motion vectors of the prediction unit is equal to 2.
- the type of the coding unit where the prediction unit currently to be decoded is located and the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located are obtained.
- the type of the coding unit where the current prediction unit is located is one of types among a P-picture skip mode, P-picture direct mode, B-picture skip mode, or B-picture direct mode
- the subtype of coding unit is obtained.
- P-picture indicates a picture which is predicted by unidirectional inter prediction, that is, only the spatial reference list 0 is referred to
- B-picture indicates a picture which is predicted by bidirectional inter prediction, that is, the spatial reference list 0 or spatial reference list 1 is referred to or both the spatial reference lists 0 and 1 are referred to at the same time.
- the motion information of the neighbouring prediction unit of the prediction unit currently to be decoded and the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located are obtained.
- the motion information includes: prediction reference mode, motion vector, reference index and other information, and the motion information is obtained according to the subtype of the coding unit where the prediction unit currently to be decoded is located.
- the sub-types of coding units in P-picture skip mode or P-picture direct mode include: using temporal reference, using spatial list 0 reference, advanced motion vector expression, affine motion, and motion vector prediction based on historical information.
- the sub-type "using spatial list 0 reference” indicates that the prediction reference mode of the prediction unit currently to be decoded uses list 0 reference.
- the sub-types of coding units in B-picture skip mode and B-picture direct mode include: using temporal reference, using spatial list 0 reference, using spatial list 1 reference, using spatial double-list (0 and 1) reference, advanced motion vector expression, affine motion and motion vector prediction based on historical information.
- the subtype "using spatial list 0 reference” indicates that the prediction reference mode of the prediction unit currently to be decoded uses list 0 reference
- "using spatial list 1 reference” indicates that the prediction reference mode of the current prediction unit currently to be decoded used list 1 reference
- “using spatial double-list reference” indicates that the prediction reference mode of the prediction unit currently to be decoded uses the double-list reference, i.e. both list 0 reference and list 1 reference.
- the motion information of the prediction unit may be obtained as following description.
- the motion information is obtained according to the following the operations.
- the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is 'list 0 reference'.
- the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit currently to be decoded.
- the neighbouring prediction units F, G, C, A, B, D are scanned in the order of F, G, C, A, B, D, and the motion information of the first scanned prediction unit, whose coding unit is the foreground and the prediction reference mode is 'list 0 reference', is determined as the motion information of the prediction unit E.
- the list 0 motion vector of the prediction unit currently to be decoded is a zero motion vector, and the value of the list 0 reference index of the prediction unit currently to be decoded is equal to 0. In other words, if there is no neighbouring prediction unit located on the foreground, and whose prediction reference mode is "list 0 reference". Furthermore, the prediction reference mode of the prediction unit currently to be decoded is set as 'list 0 reference'.
- the subtype is any of the following: using the spatial list 0 reference, or using the spatial list 1 reference, or using spatial double-list (0 and 1) reference in the B-picture skip mode; or using spatial list 0 reference, or using the spatial list 1 reference, or using spatial double-list (0 and 1) reference in B-picture direct mode, the motion information of the prediction unit is obtained according to the following operations.
- the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is ' double-list reference ', the list 0 motion vector and the list 1 motion vector of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 1 motion vector of the prediction unit currently to be decoded, and the list 0 reference index and the list 1 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 reference index and the list 1 reference index of the prediction unit currently to be decoded.
- the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to get the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is ' list 0 reference ', and the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is ' list 1 reference ', the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit with the prediction reference mode of ' list 0 reference' are respectively regarded as the list 0 motion vector
- the list 0 motion vector and the list 1 motion vector of the prediction unit currently to be decoded are both zero motion vectors, and the values *?*of the list 0 reference index and the list 1 reference index of the prediction unit currently to be decoded are both equal to zero. Furthermore, the prediction reference mode of the prediction unit currently to be decoded is set as "double-list reference".
- the neighbouring prediction units are scanned in the order of D, B, A, C, G, F (or other methods can be used, without limitation here) to get the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is ' double-list reference ', the list 1 motion vector and the list 1 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 1 motion vector and the list 1 reference index of the prediction unit currently to be decoded.
- the list 1 motion vector of the prediction unit currently to be decoded is a zero motion vector, and the value of the list 1 reference index of the prediction unit currently to be decoded is equal to zero. Furthermore, the prediction reference mode of the current prediction unit is set as 'list 1 reference'.
- the neighbouring prediction units are scanned in the order of D, B, A, C, G, F (or other methods can be used, without limitation here) to get the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is ' double-list reference ', the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit currently to be decoded.
- the list 0 motion vector of the prediction unit currently to be decoded is a zero motion vector, and the value of the list 0 reference index of the prediction unit currently to be decoded is equal to zero. Furthermore, the prediction reference mode of the prediction unit currently to be decoded is set as 'list 0 reference'.
- the neighbouring prediction units F, G, C, A, and D are the neighbouring prediction units of the prediction unit E currently to be decoded (or other combinations can be used, which are not limited here).
- the information of the advanced motion vector expression of the prediction unit currently to be decoded is determined.
- the subtype is any of the following: 1) affine motion in P-picture skip mode; 2) affine motion in P-picture direct mode ; 3) affine motion in B-picture skip mode; 4) affine motion in B-picture direct mode.
- the affine motion information of the prediction unit currently to be decoded is derived by the following operations.
- neighbouring prediction unit X (X is F, G, C, A, B, or D) of the prediction unit E currently to be decoded exists, and the coding unit including the neighbouring prediction unit X is the foreground and is the prediction mode of the neighbouring prediction unit X is the inter prediction mode, then the neighbouring prediction unit X is "available", otherwise the neighbouring prediction unit X is "unavailable".
- the affine motion information of the prediction unit currently to be decoded is derived.
- the motion information of the prediction unit may be obtained as following description.
- the motion information is derived by the following operations.
- the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the background and the prediction reference mode is 'list 0 reference', the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit E currently to be decoded.
- the neighbouring prediction units F, G, C, A, B, D are scanned in the order of F, G, C, A, B, D, and the motion information of the first scanned prediction unit, whose coding unit is the foreground and the prediction reference mode is 'list 0 reference', is determined as the motion information of the prediction unit E.
- the list 0 motion vector of the prediction unit currently to be decoded is a zero motion vector, and the value of the list 0 reference index of the prediction unit E currently to be decoded is equal to 0. Furthermore, the prediction reference mode of the prediction unit E currently to be decoded is set as 'list 0 reference'.
- the subtype is any of the following: using the spatial list 0 reference, or using the spatial list 1 reference, or using spatial double-list (0 and 1) reference in the B-picture skip mode; or using spatial list 0 reference, or using the spatial list 1 reference, or using spatial double-list (0 and 1) reference in B-picture direct mode, the motion information is derived according to the following operations.
- the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the background and the prediction reference mode is ' list 0 reference ', and the first scanned prediction unit whose coding unit is the background and the prediction reference mode is ' list 1 reference ', the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit with the prediction reference mode of ' list 0 reference' are respectively regarded as the list 0 motion vector and the list 0 reference index
- the list 0 motion vector and the list 1 motion vector of the prediction unit currently to be decoded are both zero motion vectors, and the values of the list 0 reference index and the list 1 reference index of the prediction unit E currently to be decoded are both equal to zero. Furthermore, the prediction reference mode of the prediction unit currently to be decoded is set as "double-list reference".
- the neighbouring prediction units are scanned in the order of D, B, A, C, G, F (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the background and the prediction reference mode is ' double-list reference ', the list 1 motion vector and the list 1 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 1 motion vector and the list 1 reference index of the prediction unit E currently to be decoded.
- the list 1 motion vector of the prediction unit E currently to be decoded is a zero motion vector, and the value of the list 1 reference index of the prediction unit currently to be decoded is equal to zero. Furtheremore, the prediction reference mode of the prediction unit E currently to be decoded is set as 'list 1 reference'.
- the neighbouring prediction units are scanned in the order of D, B, A, C, G, F (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the background and the prediction reference mode is ' double-list reference ', the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit currently to be decoded.
- the list 0 motion vector of the prediction unit currently to be decoded is a zero motion vector, and the value of the list 0 reference index of the prediction unit currently to be decoded is equal to zero.
- the prediction reference mode of the prediction unit E currently to be decoded is set as 'list 0 reference'.
- the subtype is any of the following: 1) advanced motion vector expression in P-picture skip mode; 2) advanced motion vector expression in P-picture direct mode; 3) advanced motion vector expression in B-picture skip mode; 4) advanced motion vector expression in B-picture direct mode, motion information is derived by the following operations.
- the availability of the neighbouring prediction units of the prediction unit E currently to be decoded are determined. Referring back to FIG.1, it is assumed that the neighbouring prediction units F, G, C, A, and D are the neighbouring prediction units of the current prediction unit E (or other combinations can be used, which are not limited here).
- the information of the advanced motion vector expression of the prediction unit currently to be decoded is determined.
- the coding unit where the prediction unit currently to be decoded is located is the background, and the subtype is any of the following: 1) affine motion in P-picture skip mode; 2) affine motion in P-picture direct mode ; 3) affine motion in B-picture skip mode; 4) affine motion in B-picture direct mode.
- the affine motion information of the current prediction unit is derived by the followingoperations.
- neighbouring prediction unit X (X is F, G, C, A, B, or D) of the prediction unit E currently to be decoded exists, and the coding unit is the background and it is in the inter prediction mode, then the neighbouring unit X is "available”; otherwise the neighbouring unit X is "unavailable”.
- the affine motion information of the current prediction unit is derived.
- FIG. 7 illustrates a method for deriving the basic unit of a motion vector according to an embodiment of the present disclosure, wherein the basic unit of a motion vector may also be referred to as motion vector resolution.
- the embodiment shown in Figure 7 is for illustration only. Without departing from the scope of the present disclosure, other various methods may be used.
- a method for obtaining motion vector resolution in a decoding device is disclosed, and different methods for obtaining motion vector resolution are set according to the difference of the motion characteristics between the foreground and the background.
- operation 701 the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located is obtained.
- operation 702 the motion vector resolution set of the prediction unit currently to be decoded is obtained according to the obtained foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located.
- the motion vector resolution index value of the prediction unit currently to be decoded is obtained.
- the basic unit of the motion vector of the prediction unit currently to be decoded is obtained according to the motion vector resolution index value and the motion vector resolution set.
- the coding unit where the prediction unit to be decoded is located is the foreground
- its motion vector resolution set is ⁇ 1/4, 1/2, 1, 2, 4 ⁇
- the value range for the index value of its motion vector resolution is 0 ⁇ 4 and is an integer.
- the basic unit of the motion vector is 1/4 integer samples.
- the basic unit of the motion vector is 1/2 integer samples.
- the basic unit of the motion vector is 1 integer sample.
- the basic unit of the motion vector is 2 integer samples.
- the basic unit of the motion vector is 4 integer samples.
- the coding unit where the prediction unit currently to be decoded is located is the background, its proper motion vector resolution set is ⁇ 1/4, 1/2, 1 ⁇ , and the value range for the index value of its motion vector resolution is 0, 1, 2.
- the basic unit of the motion vector is 1/4 integer samples.
- the basic unit of the motion vector is 1/2 integer samples.
- the basic unit of the motion vector is 1 integer sample.
- the motion vector resolution set of the prediction unit whose coding unit is the foreground may include values less than 1, a value equal to 1, and the values greater than 1 at the same time.
- the motion vector resolution set of the prediction unit whose coding unit is the background prediction may include values less than 1 and a value equal to 1.
- the specific number of resolution value in the motion vector resolution set is not limited here.
- the background of the image has no or very slight movement, so the basic unit value of the set motion vector is small, and the foreground usually can have a strong or slight movement, so the basic unit value range of the set motion vector can be a range from small to large.
- motion vector resolution values included in the motion vector resolution set for the prediction unit included in the foreground are set relatively larger than motion vector resolution values included in the motion vector resolution set for the prediction unit included in background. According to the embodiment of the present disclosure, it can save the number of bits used for encoding and transmitting the index value of the motion vector resolution, and save the code rate.
- a method for generating a reference picture list wherein different reference picture list generation methods are used for the prediction unit whose coding unit is the foreground and the prediction unit whose coding unit is the background, and the generation methods are the same in the coding device and the decoding device.
- the reference picture list includes: 1) a background image, or 2) a background image and an encoded or decoded image immediately neighbouring to the current image.
- the image contained in the reference picture list is not limited, but under normal circumstances, there are more cases that include encoded or decoded pictures than the background images.
- the background is static, or there is only slight movement, such as the wind disturbance of leaves and grass, therefore reference image for the background may be limited.
- the prediction unit may only use the background image as a reference, or use the encoded/decoded picture temporally adjacent to the current picture including the prediction unit currently to be processed as a reference.
- background image or temporally adjacent picture are used as reference picture.
- the coding complexity of the coding end can be reduced, the number of bits of the coding reference image index value can be reduced, and the code rate can be saved.
- FIGs. 8A and 8B illustrate a method for deriving quantization parameters of coding units in a decoding device according to an embodiment of the present disclosure.
- the embodiments shown in FIGs.8A and 8B are for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
- the foreground and/or background information of the coding unit currently to be decoded is obtained.
- basic quantization parameter information is obtained, and the quantization parameter information of the coding unit currently to be decoded is obtained according to the foreground and/or background information of the coding unit currently to be decoded.
- the basic quantization parameter information may be the average quantization parameter of the current image currently to be decoded, or the quantization parameter of the previously decoded coding unit, etc., which is not limited here.
- the quantization parameter of the coding unit currently to be decoded is set as the basic quantization parameter minus the absolute value of the first quantization parameter difference. If the coding unit currently to be decoded is the background, the quantization parameter of the coding unit currently to be decoded is set as the basic quantization parameter value.
- the quantization parameter of the coding unit currently to be decoded is set as the basic quantization parameter plus the absolute value of the second quantization parameter difference. If the coding unit currently to be decoded is the foreground, the quantization parameter of the coding unit currently to be decoded is set as the basic quantization parameter.
- the absolute value of the first quantization parameter difference and the absolute value of the second quantization parameter difference are preset in the encoding device and the decoding device according to the same rule, and the specific values *?*are not limited here.
- FIG. 8B illustrates another embodiment.
- a difference value of the quantization parameter of the coding unit currently to be decoded is obtained.
- the difference value may be a signed value.
- the basic quantization parameter is obtained, and the basic quantization parameter and the difference value of the quantization parameter is added to obtain the value of the quantization parameter of the coding unit currently to be decoded.
- the user in the surveillance video, the user usually only pays attention to the moving objects in the foreground. Therefore, setting a relatively smaller quantization parameter to the foreground coding unit can improve the quality of the reconstructed image in the foreground and improve the user experience, or setting a relatively larger quantization parameter to the background coding unit can save the code rate.
- FIG. 9A a block diagram for an encoding method according to an embodiment of the present disclosure is shown.
- the embodiment shown in FIG. 9A is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
- operation 901 information about the prediction unit currently to be coded is obtained, and the information includes foreground and/or background information of the coding unit where the prediction unit currently to be coded is located.
- operation 902 the information of the prediction unit currently to be coded is output to the bit-stream.
- the encoding method further includes: when the inter prediction mode is applied to predict a prediction unit currently to be encoded, the prediction value of the prediction unit currently to be encoded is obtained according to the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located, and the residual value is obtained according to the original pixel value and the prediction value,
- the quantization parameter is set according to the foreground and/or background information of the coding unit where the prediction unit currently to be coded is located, the residual information is obtained by using the set quantization parameter and the obtained residual value, and the residual information and basic quantization parameter information are output to the bit-stream.
- the obtaining information about the prediction unit currently to be encoded includes: obtaining the background image, obtaining the foreground and/or background information of each coding unit in the current image according to the background image and the image currently to be encoded, and encoding the foreground and/or background information of each coding unit according to the set parameter for identifying the size of the coding unit.
- the obtaining the prediction value of the prediction unit currently to be encoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located includes: obtaining the prediction motion information of the prediction unit currently to be encoded; setting the motion search range according to the foreground and/or background information of the coding unit where the prediction unit currently to be coded is located and the predicted motion information; obtaining the difference of the motion vector of the prediction unit currently to be coded according to the prediction motion information of the prediction unit currently to be coded and the motion search range.
- FIG. 9B an encoding method according to an embodiment of the present disclosure is shown.
- the embodiment shown in FIG. 9B is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
- the foreground and/or background information of the coding unit where the prediction unit currently to be coded is located is obtained.
- the prediction value of the prediction unit currently to be encoded is obtained according to the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located, the prediction value is subtracted from the original pixel value to obtain the residual value, and the residual value is transformed.
- the quantization parameter is set according to the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located.
- the set quantization parameter is used for quantizing the transformed residual value to obtain residual information
- the foreground and/or background information, residual information, and basic quantization parameter information are output to the bit-stream.
- FIG. 10 a block diagram of a method for setting a motion search range in an encoding device according to an embodiment of the present disclosure is shown.
- the embodiment shown in FIF. 10 is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
- operation 1001 if the coding unit where the prediction unit currently to be coded is located is the foreground, a search range with a larger value is determined. If the coding unit where the prediction unit currently to be coded is located is the background, a search range with a smaller value is determined. In operation 1002, the predicted motion information of the prediction unit currently to be encoded is obtained, the predicted motion information includes motion vector prediction value, prediction reference mode, index value of the reference image in the reference picture list, etc.
- the reference image corresponding to the index value is determined in the reference picture list according to the prediction reference mode, the position pointed by the motion vector prediction value is used as the search center, a motion search is performed within the determined search range to find the most matched block corresponding to the prediction unit currently to be encoded, the distance between the search center position and the upper left corner of the most matched block is calculated, and the distance is the motion vector difference.
- the prediction reference mode is using the list 0 reference
- the reference image corresponding to the index value is determined in the reference picture list 0 and the motion vector difference of the list 0 after the motion search is obtained.
- the prediction reference mode is using the list 1 reference
- the reference image corresponding to the index value is determined in the reference picture list 1, and the motion vector difference of the list 1 after the motion search is obtained.
- the prediction reference mode is using a double-list reference
- the reference image corresponding to the index value isdetermined in reference picture list 0 and reference picture list 1, respectively, and the motion vector difference of list 0 and the motion vector difference of list 1 after the motion search are obtained.
- the motion search range is set small, which can reduce the complexity of the encoding end.
- FIG. 11 a block diagram of an apparatus for performing a decoding method according to an embodiment of the present disclosure is shown.
- the embodiment shown in FIG. 11 is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
- the apparatus includes a receiving unit 1101 for receiving data from a bit-stream, and a decoder 1102, which is coupled to the receiving unit and configured to: obtain information about prediction unit currently to be decoded from the received data, wherein the information about the prediction unit currently to be decoded includes the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtain the prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtain the reconstructed value according to the prediction value of the prediction unit currently to be decoded.
- FIG. 12 a block diagram of an apparatus for executing an encoding method according to an embodiment of the present disclosure is shown.
- the embodiment shown in FIG. 12 is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
- the apparatus includes an encoder 1201, which is configured to: obtain information about a prediction unit currently to be encoded, wherein the information includes the foreground and/or background information of a coding unit where the prediction unit currently to be encoded is located; output the information about the prediction unit currently to be encoded to a sending unit 1202; and the sending unit 1202 is coupled to the encoder and is configured to encode the information about the prediction unit currently to be encoded into the code flow.
- an encoder 1201 is configured to: obtain information about a prediction unit currently to be encoded, wherein the information includes the foreground and/or background information of a coding unit where the prediction unit currently to be encoded is located; output the information about the prediction unit currently to be encoded to a sending unit 1202; and the sending unit 1202 is coupled to the encoder and is configured to encode the information about the prediction unit currently to be encoded into the code flow.
- FIG. 13 a block diagram of an electronic device according to an embodiment of the present disclosure is shown.
- the embodiment shown in FIG. 13 is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
- the electronic device includes a memory 1301, which is configured to store a computer program; and a processor 1302, which is configured to read the computer program from the memory, and is configured to perform the decoding method and/or the encoding method described above.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Provided are an encoding and decoding method and an apparatus thereof. The decoding method includes: obtaining information about a prediction unit currently to be decoded from a bit-stream, wherein the information about the prediction unit currently to be decoded includes the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtaining a reconstructed value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded.
Description
This disclosure relates to video coding and decoding, in particular to a method and apparatus of surveillance video encoding and decoding.
Unlike natural images, surveillance videos are mostly taken by stationary cameras, usually with a fixed background, and the main background scene is unchanged. In surveillance video, users mainly focus on foreground moving objects, and the foreground movements are usually more intense. For surveillance video, if existing video coding standards are adopted, such as HEVC, H.264, etc., and a same inter prediction codec technology is used for the foreground and background, it will lead to inaccurate predictions, and on the other hand, encoded information redundancy would occur, the coding complexity is relatively large, and the coding efficiency decreases.
A same inter prediction codec technology is used for the foreground and background, it will lead to inaccurate predictions, and on the other hand, encoded information redundancy would occur, the coding complexity is relatively large, and the coding efficiency decreases.
In order to solve the above problems, this disclosure provides a coding and decoding method and an apparatus thereof, in which, different inter prediction methods and coding and decoding methods are adopted according to the foreground or background information of the current coding unit.
According to the present disclosure, according to the different motion characteristics between the foreground prediction unit and the background prediction unit and the differences between the users focuses, the efficiency of surveillance video coding is improved and the coding complexity is reduced.
For a more complete understanding of the present disclosure and its advantages, reference is now made to the following description taken in conjunction with the accompanying drawings, in which like reference numerals represent like parts:
FIG. 1 illustrates an exemplary spatial position relationship between a current coding unit and neighbouring units;
FIGs. 2A and 2B illustrate a decoding method according to an embodiment of the present disclosure;
FIG. 3 illustrates a method for identifying foreground and/or background information of a coding unit according to an embodiment of the present disclosure;
FIG. 4 illustrates a method for obtaining a motion vector prediction value of a prediction unit according to an embodiment of the present disclosure;
FIG. 5 illustrates the spatial position relationship between the current coding unit and neighbouring units;
FIG. 6 illustrates a method for deriving motion information of a prediction unit in skip mode or direct mode according to an embodiment of the present disclosure;
FIG. 7 is a block diagram showing a method for deriving a basic unit of a motion vector according to an embodiment of the present disclosure;
FIGs. 8A and 8B illustrate a method for deriving a quantization parameter of a coding unit in a decoding device according to an embodiment of the present disclosure;
FIGs. 9A and 9B illustrate an encoding method according to an embodiment of the present disclosure;
FIG. 10 illustrates a method for setting a motion search range in an encoding device according to an embodiment of the present disclosure;
FIG. 11 is a block diagram illustrating an apparatus for performing a decoding method according to an embodiment of the present disclosure;
FIG. 12 is a block diagram illustrating an apparatus for performing an encoding method according to an embodiment of the present disclosure; and
FIG. 13 is a block diagram illustrating an electronic device according to an embodiment of the present disclosure.
In one aspect of the present disclosure, a decoding method is provided. The method includes: obtaining information about a prediction unit currently to be decoded from a bit-stream, wherein the information about the prediction unit currently to be decoded includes the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtaining a reconstructed value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded. The obtaining the reconstructed value of the prediction unit comprises, when the prediction unit to be decoded is included in the foreground according to the foreground and/or background information, obtaining an information of one or more neighbouring prediction units located on the foreground, when the prediction unit to be decoded is included in the background according to the foreground and/or background information, obtaining an information of one or more neighbouring prediction units located on the background, and obtaining a prediction value of the prediction unit to be decoded using the information of the one or more neighbouring prediction units.
In one aspect of the present disclosure, the information of the one or more neighbouring prediction units includes inter prediction information of the one or more neighbouring prediction units, and the inter prediction information of the prediction unit to be decoded is determined using the inter prediction information of the one or more neighbouring prediction units.
In one aspect of the present disclosure, the inter prediction information of the prediction unit to be decoded includes at least one of motion vector prediction value of the prediction unit to be decoded, motion information of the prediction unit to be decoded, motion vector resolution of the prediction unit to be decoded, and reference picture list information of the prediction unit to be decoded.
In one aspect of the present disclosure, a neighbouring prediction unit is determined to be available, when all the following conditions, i) the neighbouring prediction unit is within boundary of a current image, ii) a coding unit including the neighbouring prediction unit is located on same type with the coding unit including the prediction unit to be decoded between the foreground and the background, iii) the neighbouring prediction unit does not apply the intra prediction mode, and iv) the neighbouring prediction unit has a motion vector type, are satisfied.
In one aspect of the present disclosure, the inter prediction information of the one or more neighbouring prediction units is determined according to a predetermined scan order.
In one aspect of the present disclosure, the inter prediction information of the prediction unit to be decoded includes a motion vector resolution set and a motion vector resolution index value of the prediction unit to be decoded.
In one aspect of the present disclosure, the inter prediction information of the prediction unit to be decoded includes a reference picture list of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located.
In one aspect of the present disclosure, the obtaining the prediction value of the prediction unit to be decoded includes obtaining a quantization parameter of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located and basic quantization parameter information, and obtaining the residual value according to the quantization parameter and the residual information.
In one aspect of the present disclosure, obtaining the quantization parameter of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located and the basic quantization parameter information includes obtaining the quantization parameter of the prediction unit to be decoded based on the basic quantization parameter and the absolute value of the preset first quantization parameter difference, according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located.
In one aspect of the present disclosure, the obtaining the quantization parameter of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located and the basic quantization parameter information includes decoding a difference of the quantization parameter of the coding unit where the prediction unit to be decoded is located, and obtaining a value of the quantization parameter of the coding unit where the prediction unit to be decoded is located according to the basic quantization parameter and the difference of the quantization parameter.
In one aspect of the present disclosure, a decoding method is provided, wherein the obtaining the reconstructed value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded includes: obtaining the prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtaining the reconstructed value of the prediction unit currently to be decoded according to the prediction value of the prediction unit currently to be decoded.
In one aspect of the present disclosure, a decoding method is provided, wherein the obtaining the prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located includes: obtaining information of the neighbouring prediction units of the prediction unit currently to be decoded; deriving inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units; obtaining the prediction value of the prediction unit currently to be decoded according to the derived inter prediction information of the prediction unit currently to be decoded.
In one aspect of the present disclosure, a decoding method is provided, wherein the information of the neighbouring prediction units include: foreground and/or background information of the coding unit where the neighbouring prediction units are located.
In one aspect of the present disclosure, a decoding method is provided, wherein the obtaining the reconstructed value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded includes: obtaining a residual value of the prediction unit currently to be decoded; obtaining the reconstructed value of the prediction unit currently to be decoded according to the prediction value of the prediction unit currently to be decoded and the residual value of the prediction unit currently to be decoded.
In one aspect of the present disclosure, a decoding method is provided, wherein the information about the prediction unit currently to be decoded further includes at least one of the residual information and basic quantization parameter information.
In one aspect of the present disclosure, a decoding method is provided, wherein the obtaining the residual value of the prediction unit currently to be decoded comprises: obtaining the residual value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded.
In one aspect of the present disclosure, a decoding method is provided, wherein the inter prediction information of the prediction unit currently to be decoded includes at least one of motion vector prediction value of the prediction unit currently to be decoded, motion information of the prediction unit currently to be decoded, motion vector resolution of the prediction unit currently to be decoded, and reference picture list information of the prediction unit currently to be decoded.
In one aspect of the present disclosure, a decoding method is provided, wherein the deriving the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units includes: obtaining the motion information of the prediction unit currently to be decoded; deriving the motion vector prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the motion information of the prediction unit currently to be decoded, and the information of the neighbouring prediction units.
In one aspect of the present disclosure, a decoding method is provided, wherein the deriving the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units includes: obtaining coding unit type information of the prediction unit currently to be decoded; deriving motion information of skip mode or direct mode of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the coding unit type information of the prediction unit currently to be decoded, and the information of the neighbouring prediction units.
In one aspect of the present disclosure, a decoding method is provided, wherein the deriving the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units includes: obtaining the motion vector resolution set and the motion vector resolution index value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtaining the motion vector resolution of the prediction unit currently to be decoded according to the motion vector resolution set and the motion vector resolution index value of the prediction unit currently to be decoded.
In one aspect of the present disclosure, a decoding method is provided, wherein the deriving the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units includes: generating a reference picture list of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located.
In one aspect of the present disclosure, a decoding method is provided, wherein the obtaining the residual value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded includes: deriving the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and basic quantization parameter information, and obtaining the residual value according to the quantization parameter and the residual information.
In one aspect of the present disclosure, a decoding method is provided, wherein the deriving the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and basic quantization parameter information includes: obtaining the quantization parameter of the prediction unit currently to be decoded based on the basic quantization parameter and the absolute value of the preset first quantization parameter difference, according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located.
In one aspect of the present disclosure, a decoding method is provided, wherein the deriving the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and basic quantization parameter information includes: decoding the difference of the quantization parameter of the coding unit where the prediction unit to be decoded is currently located; obtaining the value of the quantization parameter of the coding unit where the prediction unit currently to be decoded is located according to the basic quantization parameter and the difference of the quantization parameter.
In one aspect of the present disclosure, a encoding method is provided, the method includes: obtaining information about a prediction unit currently to be encoded, the information including foreground and/or background information of a coding unit where the prediction unit currently to be encoded is located; outputting the information about the prediction unit currently to be encoded into the bit-stream.
In one aspect of the present disclosure, an encoding method is provided, wherein the method further includes: when the current prediction unit is predicted by using the inter prediction mode, deriving a predicted value of the prediction unit currently to be encoded according to the foreground and/or background information of a coding unit where the prediction unit currently to be encoded is located, obtaining a residual value according to an original pixel value and a predicted value; setting the quantization parameter according to the foreground and/or background information of a coding unit where the prediction unit currently to be encoded is located; using the set quantization parameter and the obtained residual value to derive residual information; outputting the residual information and basic quantization parameter information to the bit-stream.
In one aspect of the present disclosure, an encoding method is provided, wherein the obtaining information about the prediction unit currently to be encoded includes: obtaining a background image, obtaining the foreground and/or background information of each coding unit in the current image according to the background image and the current image to be encoded, encoding the foreground and/or background information of each coding unit according to a set parameter identifying the size of the coding unit.
In one aspect of the present disclosure, an encoding method is provided, wherein the deriving the prediction value of the prediction unit currently to be encoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located includes: obtaining prediction motion information of the prediction unit currently to be encoded; setting the motion search range according to the foreground and/or background information of the coding unit where the prediction unit to be coded is currently located and the prediction motion information; obtaining the motion vector difference of the prediction unit currently to be coded according to the prediction motion information of the prediction unit currently to be coded and the motion search range.
In one aspect of the present disclosure, an apparatus for performing a decoding method is provided, the apparatus comprises: a receiving unit configured to receive data from a bit-stream; a decoder coupled to the receiving unit , and configured to: obtain information about the prediction unit currently to be decoded from the received data, wherein the information about the prediction unit currently to be decoded includes foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtain a prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtain a reconstructed value according to the prediction value of the prediction unit currently to be decoded.
In one aspect of the present disclosure, an apparatus for performing an encoding method is provided, the apparatus includes: an encoder configured to obtain information about a prediction unit currently to be encoded, the information including the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located; output the information about the prediction unit currently to be encoded to a sending unit; and the sending unit, which is coupled to the encoder and is configured to encode the information of the prediction unit currently to be encoded into a bit-stream.
In one aspect of the present disclosure, an electronic device is provided, the electronic device includes: a memory, which is configured to store a computer program; and a processor, which is configured to read the computer program from the memory, and is configured to execute the method described above.
Various example of the disclosure will now be described in greater detail below with reference to the accompanying drawings. However, the disclosure may have different forms and should not be understood as being limited to embodiments set forth herein. Parts not related to the disclosure may be omitted for clarity. Throughout the drawings, it should be noted that like reference numbers are used to depict the same or similar elements, features, and structures.
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," as well as derivatives thereof, means to include, be included within, interconnect with, contain, be contained within, connect to or with, couple to or with, be communicable with, cooperate with, interleave, juxtapose, be proximate to, be bound to or with, have, have a property of, have a relationship to or with, or the like. The term "controller" means 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 different combinations of one or more of the listed items may be used, and only one item in the list may be needed. For example, "at least one of: A, B, and C" includes any of the following combinations: A, B, C, A and B, A and C, B and C, and A and B and C.
Definitions for other certain 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 disclosure, the application combination of the current coding unit and the neighbouring coding units, the scanning order and a split structure of a current coding unit and neighbouring coding units are only used for illustration. Without departing from the scope of the present disclosure, the application combination of the coding unit and the neighbouring coding units, the scanning order and split structure of the current coding unit and the neighbouring coding units may be implemented in different ways.
The inter prediction modes applied to a prediction unit defined in the existing video coding standards (for example, HEVC, AVS2, AVS3, VVC, H.264, etc.) include normal motion vector prediction mode, skip mode, and direct mode.
When a inter prediction mode of the current prediction unit is the normal motion vector prediction mode, the motion information is obtained through the following operations: 1) obtaining the motion vector prediction value, decoding the motion vector difference information indicating a difference between a motion vector of the current prediction unit and the motion vector prediction value, and adding the motion vector prediction value and the motion vector difference to obtain the motion vector value; 2) decoding a reference image information, and obtaining a prediction value of the prediction unit according to a position pointed by the motion vector on the obtained reference image; 3) decoding a residual information, obtaining a residual value by performing inverse quantization and inverse transformation on the residual information, and adding the residual value to the predicted value to obtain a reconstructed value of the current prediction unit.
When the inter prediction mode of the current prediction unit is skip mode or direct mode, the motion information of the current prediction unit can be derived from a motion vector information of spatial neighbouring prediction units. For example,the motion vector of the spatial neighbouring prediction unit adjacent to the current prediction unit and reference image information such as prediction direction and reference index are obtained according to the preset scanning order and acquisition rules from the neighbouring prediction units of the current prediction unit, and the motion vector of the spatial neighbouring prediction unit and reference image information are determined as the motion information of the current prediction unit.
FIG. 1 illustrates an exemplary spatial position relationship between a current coding unit and neighbouring units. The spatial neighbouring prediction units of the current prediction unit may be predetermined according to a type of the video codec. For example, referring to FIG.1, the spatial neighbouring prediction units of the current prediction unit E may be defined in the first stage standard of AVS3 as shown in FIG. 1. It is assumed that the coordinate of the upper left sample of block E in the image is (x0, y0), and (x1, y0) is the coordinate of the upper right sample of the block E in the image. (x0, y1) is the coordinate of the lower left sample of the block E in the image, and the neighbouring units of block E are: the neighbouring unit A, which is block where the sample (x0-1, y0) is located; the neighbouring unit B, which is the block where the sample (x0, y0-1) is located; the neighbouring block C, which is the block where the sample (x1+1, y0-1) is located; the neighbouring block D, which is the block where the sample (x0-1 , y0-1) is located; the neighbouring block F, which is the block where the sample (x0-1, y1) is located; and the neighbouring block G, which is the block where the sample (x1, y0-1) is located. The spatial position relationship between block E and its neighbouring blocks is shown in Figure 1.
In the first stage standard of AVS3, the above-mentioned motion vector resolution, that is, the basic unit of the motion vector is obtained by: obtaining the basic unit of the motion vector according to the decoded motion vector resolution index.
If the value of the motion vector resolution index is 0, the basic unit of the motion vector is 1/4 integer sample.
If the value of the motion vector resolution index is 1, the basic unit of the motion vector is 1/2 integer sample.
If the value of the motion vector resolution index is 2, the basic unit of the motion vector is 1 integer sample.
If the value of the motion vector resolution index is 3, the basic unit of the motion vector is 2 integer samples.
If the value of the motion vector resolution index is 4, the basic unit of the motion vector is 4 integer samples.
However, in existing video coding standards, such as HEVC, H.264, etc., for surveillance video, the same inter prediction coding and decoding technology is used for the foreground and bac kground, which leads to inaccurate predictions and also causes coding information redundant. In addition, the coding complexity is relatively large, and the coding efficiency decreases.
The various embodiments of the present disclosure will be described below with reference to FIGs. 2A through 13. The various embodiments used to describe the principles of the present disclosure in this patent document are merely exemplary and should not be construed as limiting the scope of the present disclosure in any way.
In FIG. 2A, illustrates a decoding method according to an embodiment of the present disclosure is shown. The embodiment shown in FIG.2A is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
According to FIG. 2A, in operation 201, information about the prediction unit currently to be decoded is obtained from the bit-stream. The information about the prediction unit currently to be decoded includes the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; in operation 202, a reconstructed value of the prediction unit currently to be decoded is obtained according to the information about the prediction unit currently to be decoded.
The obtaining the reconstructed value of the prediction unit comprises, when the prediction unit to be decoded is included in the foreground according to the foreground and/or background information, obtaining an information of one or more neighbouring prediction units located on the foreground, when the prediction unit to be decoded is included in the background according to the foreground and/or background information, obtaining an information of one or more neighbouring prediction units located on the background, and obtaining a prediction value of the prediction unit to be decoded using the information of the one or more neighbouring prediction units.
The information of the one or more neighbouring prediction units includes inter prediction information of the one or more neighbouring prediction units, and the inter prediction information of the prediction unit to be decoded is determined using the inter prediction information of the one or more neighbouring prediction units.
The inter prediction information of the prediction unit to be decoded includes at least one of motion vector prediction value of the prediction unit to be decoded, motion information of the prediction unit to be decoded, motion vector resolution of the prediction unit to be decoded, and reference picture list information of the prediction unit to be decoded.
A neighbouring prediction unit is determined to be available, when all the following conditions, i) the neighbouring prediction unit is within boundary of a current image, ii) a coding unit including the neighbouring prediction unit is located on same type with the coding unit including the prediction unit to be decoded between the foreground and the background, iii) the neighbouring prediction unit does not apply the intra prediction mode, and iv) the neighbouring prediction unit has a motion vector type, are satisfied. The inter prediction information of the one or more neighbouring prediction units is determined according to a predetermined scan order.
In an embodiment, obtaining the reconstructed value of the prediction unit currently to be decoded from the information about the prediction unit currently to be decoded includes: obtaining the prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtaining the reconstructed value of the prediction unit currently to be decoded according to the prediction value of the prediction unit currently to be decoded.
In an embodiment, the obtaining the prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located includes: obtaining the information of the neighbouring prediction units of the prediction unit currently to be decoded; deriving the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the information of the neighbouring prediction units; obtaining the prediction value of the prediction unit currently to be decoded according to the derived inter prediction information of the prediction unit currently to be decoded.
In an embodiment, the information of the neighbouring prediction unit includes: the foreground and/or background information of the coding unit where the neighbouring prediction units are located.
In an embodiment, the obtaining the reconstructed value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded includes: obtaining the residual value of the prediction unit currently to be decoded; obtaining the reconstructed value of the prediction unit currently to be decoded according to the prediction value of prediction unit currently to be decoded and the residual value of the prediction unit currently to be decoded.
In an embodiment, the information about the prediction unit currently to be decoded further includes at least one of the residual information and basic quantization parameter information.
In an embodiment, the obtaining the residual value of the prediction unit currently to be decoded includes: obtaining the residual value of the prediction unit currently to be decoded according to information about the prediction unit currently to be decoded.
In an embodiment, the inter prediction information of the prediction unit currently to be decoded includes at least one of the motion vector prediction value of the prediction unit currently to be decoded, the motion information of the prediction unit currently to be decoded, the motion vector resolution of the prediction unit currently to be decoded, and the reference picture list information of the prediction unit currently to be decoded.
In an embodiment, the obtaining the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and information of neighbouring prediction units includes: obtaining the motion information of the prediction unit currently to be decoded; obtaining the motion vector prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located, the motion information of the prediction unit currently to be decoded, and the information of neighbouring prediction units.
In an embodiment, the obtaining the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and information of neighbouring prediction units includes: obtaining the coding unit type information of the prediction unit currently to be decoded; obtaining the motion information of the prediction unit the current to be decoded in the skip mode or direct mode according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located, the coding unit type information of the prediction unit currently to be decoded, and the information of neighbouring prediction units.
In an embodiment, the obtaining the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and information of neighbouring prediction units includes: obtaining the motion vector resolution set and the motion vector resolution index value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtaining the motion vector resolution of the prediction unit currently to be decoded according to the motion vector resolution set and the motion vector resolution index value of the prediction unit currently to be decoded.
In an embodiment, the obtaining the inter prediction information of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and information of neighbouring prediction units includes: generating a reference picture list of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located.
In an embodiment, the obtaining the residual value of the prediction unit currently to be decoded according to the information about the prediction unit currently to be decoded includes: obtaining the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the basic quantization parameter information, obtaining the residual value according to the quantization parameter and residual information.
In an embodiment, the obtaining the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the basic quantization parameter information includes: obtaining the quantization parameter of the coding unit currently to be decoded based on the basic quantization parameter and the absolute value of the preset first quantization parameter difference, according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located.
In an embodiment, the obtaining the quantization parameter of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the basic quantization parameter information includes: decoding the difference value of the quantization parameter of the coding unit where the prediction unit currently to be decoded is located; obtaining the value of quantization parameter of the coding unit where the prediction unit currently to be decoded is located according to the difference between the basic quantization parameter and the quantization parameter.
FIG. 2B illustrates another decoding method according to an embodiment of the present disclosure. The embodiment shown in Figure 2B is for illustration only. Other decoding methods may be used without departing from the scope of the present disclosure.
Referring to Figure 2B, in operation 201', information about the prediction unit currently to be decoded is obtained from the bit-stream, and the information includes the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located, residual information, basic quantization parameter information, etc. In operation 202', information about the neighbouring prediction units of the prediction unit currently to be decoded is obtained, and the information includes the foreground and/or background information of the coding unit where the neighbouring prediction units are located, motion information, coding unit type information and location information, etc. In operation 203', the inter prediction information is obtained according to foreground and/or background information of the prediction unit currently to be decoded and the information of neighbouring prediction units; in operation 204', the prediction value of the prediction unit currently to be decoded is obtained according to the derived inter prediction information, In operation 205', the residual information and the quantization parameter information of the prediction unit currently to be decoded are obtained, and the residual information is inversely quantized and inversely transformed to obtain the residual value of the prediction unit currently to be decoded, and in operation 206', the prediction value of the prediction unit currently to be decoded and the residual value are added to obtain the reconstructed value.
FIG. 3 illustrates a method for identifying foreground and/or background information of a coding unit according to an embodiment of the present disclosure. The embodiment shown in Figure 3 is for illustration only. Other identifying methods may be used without departing from the scope of the present disclosure.
Referring to FIG. 3, in operation 301, a background image is obtained; the method for obtaining the background image can be any of the following methods, which are not limited here: 1) K-means clustering method; 2) Mean value method; 3) Median method; 4) Single Gaussian background modeling method; 5) Mixed Gaussian background modeling method, etc.. In operation 302, the background image and the image currently to be coded are subtracted to obtain foreground and/or background information of each coding unit in the current image. Specifically, the number of the absolute value of the difference between the pixel value of the current image and the pixel value of the background image at corresponding position in the coding unit, which is greater than a set first threshold, is counted; the current coding unit is identified as foreground when the number exceeds a set second threshold, marked as 1; otherwise, the current coding unit is identified as background, marked as 0. In operation 303, the foreground and/or background information of the current coding unit, that is, the foreground background identifier (1 bit, 1 or 0) in this embodiment, is encoded and transmitted to the decoding device.
The foreground and/or background information may be set for each maximum coding unit, or may be set for each coding unit in the maximum coding unit. The foreground and/or background information may be set for a coding unit having a size equal to or larger than a predetermined size. If the small coding unit is not separately set for the foreground and/or background information, the foreground and/or background information of the large coding unit where the small coding unit is located will be shared. For example, in the AVS3 standard, the size of the coding unit includes: 128x128, 64x64, 32x32, 16x16 and 8x8. The size of the coding unit for setting the foreground and/or background information can be: 1) 128x128, 2) 128x128 and 64x64, 3) 128x128, 64x64 and 32x32, 4) 128x128, 64x64, 32x32 and 16x16, 5) 128x128, 64x64, 32x32, 16x16 and 8x8. The size of the coding unit for setting the foreground and/or background information is not limited, but it contains at least the largest coding unit. In other words, the foreground and/or background information for the largest coding unit may be always set. For example, AVS3 contains at least the size of 128x128, and the foreground and/or background information for the largest coding unit of 128x128 is set.
A same parameter for identifying the size of the coding unit of the foreground and 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 set for 128x128, then this parameter is 0 (or the parameter is 1);
If the coding unit size of the foreground and/or background information is set for 128x128 or 64x64, this parameter is 1 (or the parameter is 2);
If the coding unit size of the foreground and/or background information is set for 128x128, 64x64, 32x32, this parameter is 2 (or the parameter is 3);
If the coding unit size of the foreground and/or background information is set for 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 set for 128x128, 64x64, 32x32, 16x16, 8x8, this parameter is 4 (or the parameter is 5).
In the decoding device, the foreground and/or background information is decoded according to the "parameter used to identify the size of the coding unit of the foreground and background", specifically:
If the parameter is 0, only one coded foreground and/or background information is decoded in each 128x128 coding unit, and the small-size coding units within the 128x128 coding unit share this foreground and/or background information of the 128x128 coding unit;
If the parameter is 1, only one coded foreground and/or background information is decoded in each 128x128 coding unit and each 64x64 coding unit, and the small-size coding units within the 64x64 coding unit share this foreground and/or background information of the 64x64 coding unit;
If the parameter is 2, only one coded foreground and/or background information is decoded in each 128x128 coding unit, each 64x64 coding unit, and each 32x32 coding unit, and the small size coding units within the 32x32 coding unit share this foreground and/or background information of the 32x32 coding unit;
If the parameter is 3, only one coded foreground and/or background information is decoded in each 128x128 coding unit, each 64x64 coding unit, each 32x32 coding unit, and each 16x16 coding unit, and the small size coding units within the 16x16 coding unit share this foreground and/or background information of the 16x16 coding unit;
If the parameter is 4, only one coded foreground and/or background information is decoded in each 128x128 coding unit, each 64x64 coding unit, each 32x32 coding unit, each 16x16 coding unit, and each 8x8 coding unit.
FIG. 4 illustrates a method for obtaining a motion vector prediction value of a prediction unit according to an embodiment of the present disclosure. The embodiment shown in Figure 4 is for illustration only. Other methods and orders may be used without departing from the scope of the present disclosure.
Referring to FIG. 4, in operation 401, the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located and the motion vector prediction information of the prediction unit currently to be decoded are obtained. The motion vector prediction information includes the type of motion vector, etc. In operation 402, a motion vector prediction value is obtained according to the type of the motion vector of the prediction unit currently to be decoded.
The type of the motion vector currently to be predicted may be: normal motion vector, affine motion vector, etc.
(I) In case that the type of the motion vector currently to be predicted is a normal motion vector, the following operations are performed:
1) The motion information of the neighbouring prediction units of the prediction unit currently to be decoded is obtained, and the availability of the motion information of the neighbouring prediction units is determined.
Specifically, when the neighbouring prediction unit satisfies all the following conditions, the motion information of the neighbouring prediction unit is "available", otherwise "unavailable": a) the neighbouring prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the neighbouring prediction unit is located is the foreground; c) the neighbouring prediction unit does not adopt the intra prediction mode; d) the neighbouring prediction unit has a motion vector of the normal motion vector type. For example, referring to FIG. 5, if the coding unit where the prediction unit (510, 520) currently to be decoded is located is the foreground, and the neighbouring prediction unit is X (X is A, B, C, D, F, or G in FIG. 5, there is no limitation here), when the neighbouring prediction unit X satisfies all the above conditions, the motion information of the neighbouring prediction unit X is "available", otherwise "unavailable". For example, referring to FIG. 5, it is assumed that the prediction unit (510,520) currently to be decoded is the foreground, and the neighbouring prediction units A, D, and B are the foreground, the neighbouring prediction unit C, G, and F are background. In this case, the motion information of the neighbouring prediction unit C, G, and F is unavailable, because the neighbouring prediction unit C, G, and F are located on the background.
If the coding unit where the prediction unit currently to be decoded is located is the background and its neighbouring prediction unit X satisfies all the following conditions, the motion information of the neighbouring prediction unit is "available", otherwise "unavailable": a) the neighbouring prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the neighbouring prediction unit is located is the background; c) the neighbouring prediction unit does not adopt the intra prediction mode; d) the neighbouring prediction unit has a motion vector of the normal motion vector type.
2) The motion vector prediction value of the prediction unit currently to be decoded is obtained according to the available motion information.
(II) In case that the type of the motion vector currently predicted is an affine motion vector, the following operations are performed:
1) The motion information of the neighbouring prediction unit of the prediction unit currently to be decoded is obtained, and the availability of the motion information of the neighbouring prediction unit is determined.
Specifically, when the neighbouring prediction unit satisfies all the following conditions, the motion information of the neighbouring prediction unit is "available", otherwise "unavailable": a) the neighbouring prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the neighbouring prediction unit is located is the foreground; c) the neighbouring prediction unit does not adopt the intra prediction mode; d) the neighbouring prediction unit has a motion vector of the affine motion vector type. For example, referring to FIG. 5, it is assumed that the prediction unit (510,520) currently to be decoded is the foreground, and the neighbouring prediction units A, D, and B are the foreground, the neighbouring prediction unit C, G, and F are background. In this case, the motion information of the neighbouring prediction unit C, G, and F is unavailable, because the neighbouring prediction unit C, G, and F are located on the background.
If the coding unit where the prediction unit currently to be decoded is the background and its neighbouring prediction unit X satisfies all the following conditions, the motion information of the neighbouring prediction unit is "available", otherwise "unavailable": a) the neighbouring prediction unit is available, that is, it does not exceed the boundary of the current image; b) the coding unit where the neighbouring prediction unit is located is the background; c) the neighbouring prediction unit does not adopt the intra prediction mode; d) the neighbouring prediction unit has a motion vector of the affine motion vector type.
2) The motion vector prediction value of the prediction unit currently to be decoded is obtained according to the available motion information.
FIG. 6 illustrates a method for deriving motion information of a prediction unit in skip mode or direct mode according to an embodiment of the present disclosure. The motion information includes information such as prediction reference mode, motion vector and reference index, etc. The prediction reference mode may include 1) information whether the prediction unit uses list 0 reference, and the number of motion vectors of the prediction unit is equal to 1; 2) information whether the prediction unit uses list 1 reference, the number of motion vectors of the prediction unit is equal to 1; 3) information whether the prediction unit uses double-list reference, and the number of motion vectors of the prediction unit is equal to 2.
Referring to FIG. 6, in operation 601, the type of the coding unit where the prediction unit currently to be decoded is located and the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located are obtained. In operation, if the type of the coding unit where the current prediction unit is located is one of types among a P-picture skip mode, P-picture direct mode, B-picture skip mode, or B-picture direct mode, the subtype of coding unit is obtained. P-picture indicates a picture which is predicted by unidirectional inter prediction, that is, only the spatial reference list 0 is referred to, B-picture indicates a picture which is predicted by bidirectional inter prediction, that is, the spatial reference list 0 or spatial reference list 1 is referred to or both the spatial reference lists 0 and 1 are referred to at the same time. In operation 603, the motion information of the neighbouring prediction unit of the prediction unit currently to be decoded and the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located are obtained. The motion information includes: prediction reference mode, motion vector, reference index and other information, and the motion information is obtained according to the subtype of the coding unit where the prediction unit currently to be decoded is located.
The sub-types of coding units in P-picture skip mode or P-picture direct mode include: using temporal reference, using spatial list 0 reference, advanced motion vector expression, affine motion, and motion vector prediction based on historical information. Among them, the sub-type "using spatial list 0 reference" indicates that the prediction reference mode of the prediction unit currently to be decoded uses list 0 reference.
The sub-types of coding units in B-picture skip mode and B-picture direct mode include: using temporal reference, using spatial list 0 reference, using spatial list 1 reference, using spatial double-list (0 and 1) reference, advanced motion vector expression, affine motion and motion vector prediction based on historical information. Among them, the subtype "using spatial list 0 reference" indicates that the prediction reference mode of the prediction unit currently to be decoded uses list 0 reference, "using spatial list 1 reference" indicates that the prediction reference mode of the current prediction unit currently to be decoded used list 1 reference, and "using spatial double-list reference" indicates that the prediction reference mode of the prediction unit currently to be decoded uses the double-list reference, i.e. both list 0 reference and list 1 reference.
Firstly, in case that the coding unit including the prediction unit currently to be decoded is foreground, the motion information of the prediction unit may be obtained as following description.
(I) When the coding unit including the prediction unit currently to be decoded is foreground, and the subtype of the coding unit is any of the following: 1) using spatial list 0 reference in P-picture skip mode; 2) using the spatial list 0 reference in P-picture direct mode, the motion information is obtained according to the following the operations.
Referring back to FIG. 1, if , among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the foreground, and the number of neighbouring prediction units with prediction reference mode of "list 0 reference" is greater than or equal to 1, the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is 'list 0 reference'. The list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit currently to be decoded. In other words, the neighbouring prediction units F, G, C, A, B, D are scanned in the order of F, G, C, A, B, D, and the motion information of the first scanned prediction unit, whose coding unit is the foreground and the prediction reference mode is 'list 0 reference', is determined as the motion information of the prediction unit E.
Otherwise, the list 0 motion vector of the prediction unit currently to be decoded is a zero motion vector, and the value of the list 0 reference index of the prediction unit currently to be decoded is equal to 0. In other words, if there is no neighbouring prediction unit located on the foreground, and whose prediction reference mode is "list 0 reference". Furthermore, the prediction reference mode of the prediction unit currently to be decoded is set as 'list 0 reference'.
(II) When the coding unit where the prediction unit currently to be decoded is located is the foreground, and the subtype is any of the following: using the spatial list 0 reference, or using the spatial list 1 reference, or using spatial double-list (0 and 1) reference in the B-picture skip mode; or using spatial list 0 reference, or using the spatial list 1 reference, or using spatial double-list (0 and 1) reference in B-picture direct mode, the motion information of the prediction unit is obtained according to the following operations.
(A) If, among the six neighbouring prediction units F, G, C, A, B, and D of the current prediction unit E, at least one of the coding units where the neighbouring prediction units are located is the foreground, and the number of prediction units with prediction reference mode of the "double-list reference" is greater than or equal to 1, the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is ' double-list reference ', the list 0 motion vector and the list 1 motion vector of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 1 motion vector of the prediction unit currently to be decoded, and the list 0 reference index and the list 1 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 reference index and the list 1 reference index of the prediction unit currently to be decoded.
Otherwise, if, among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the foreground, and the number of prediction units with prediction reference mode of 'list 0 reference' is greater than or equal to 1, and the number of prediction units with prediction reference mode of 'list 1 reference' is greater than or equal to 1, the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to get the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is ' list 0 reference ', and the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is ' list 1 reference ', the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit with the prediction reference mode of ' list 0 reference' are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit currently to be decoded, and the list 1 motion vector and the list 1 reference index of the spatial motion information of the first scanned prediction unit with the prediction reference mode of ' list 1 reference' are respectively regarded as the list 1 motion vector and the list 1 reference index of the prediction unit currently to be decoded.
Otherwise, the list 0 motion vector and the list 1 motion vector of the prediction unit currently to be decoded are both zero motion vectors, and the values *?*of the list 0 reference index and the list 1 reference index of the prediction unit currently to be decoded are both equal to zero. Furthermore, the prediction reference mode of the prediction unit currently to be decoded is set as "double-list reference".
(B) If, among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the foreground, and the number of prediction units with prediction reference mode of the "list 1 reference" is greater than or equal to 1, the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is "list 1 reference", the list 1 motion vector and the list 1 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 1 motion vector and the list 1 reference index of the prediction unit currently to be decoded.
Otherwise, if, among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the foreground, and the number of prediction units with prediction reference mode of ' double-list reference ' is greater than or equal to 1, the neighbouring prediction units are scanned in the order of D, B, A, C, G, F (or other methods can be used, without limitation here) to get the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is ' double-list reference ', the list 1 motion vector and the list 1 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 1 motion vector and the list 1 reference index of the prediction unit currently to be decoded.
Otherwise, the list 1 motion vector of the prediction unit currently to be decoded is a zero motion vector, and the value of the list 1 reference index of the prediction unit currently to be decoded is equal to zero. Furthermore, the prediction reference mode of the current prediction unit is set as 'list 1 reference'.
(C) If, among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the foreground, and the number of prediction units with prediction reference mode of the "list 0 reference" is greater than or equal to 1, the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to get the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is "list 0 reference", the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit currently to be decoded.
Otherwise, if, among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the foreground, and the number of prediction units with prediction reference mode of ' double-list reference ' is greater than or equal to 1, the neighbouring prediction units are scanned in the order of D, B, A, C, G, F (or other methods can be used, without limitation here) to get the first scanned prediction unit whose coding unit is the foreground and the prediction reference mode is ' double-list reference ', the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit currently to be decoded.
Otherwise, the list 0 motion vector of the prediction unit currently to be decoded is a zero motion vector, and the value of the list 0 reference index of the prediction unit currently to be decoded is equal to zero. Furthermore, the prediction reference mode of the prediction unit currently to be decoded is set as 'list 0 reference'.
(III) When the coding unit where the prediction unit to be decoded is located is the foreground, and the subtype is any of the following: 1) advanced motion vector expression in P-picture skip mode; 2) advanced motion vector expression in P-picture direct mode; 3) advanced motion vector expression in B-picture skip mode; 4) advanced motion vector expression in B-picture direct mode, motion information is obtained by the following operations.
The availability of the neighbouring prediction units of the prediction unit currently to be decoded are determined. Referring back to FIG. 1, the neighbouring prediction units F, G, C, A, and D are the neighbouring prediction units of the prediction unit E currently to be decoded (or other combinations can be used, which are not limited here).
a) If the neighbouring prediction unit F exists and its coding unit is the foreground, and the inter prediction mode is applied to the neighbouring prediction unit F, then F is "available", otherwise, the neighbouring prediction unit F is "unavailable".
b) If the neighbouring prediction unit G exists and its coding unit is the foreground, the inter prediction mode is applied to the neighbouring prediction unit G, and the motion information of G and F are different, then G is "available", otherwise, G is "unavailable".
c) If the neighbouring prediction unit C exists and its coding unit is the foreground, the inter prediction mode is applied to the neighbouring prediction unit C and the motion information of C and G are different, then C is "available", otherwise, C is "unavailable".
d) If the neighbouring prediction unit A exists and its coding unit is the foreground, the inter prediction mode is applied to the neighbouring prediction unit Aand the motion information of A and F are different, then A is "available", otherwise, A is "unavailable".
e) If the neighbouring prediction unit D exists and its coding unit is the foreground, the inter prediction mode is applied to the neighbouring prediction unit D, the motion information of D and A are different, and the motion information of D and G are different, then D is "available", otherwise, D "unavailable".
According to the availability of neighbouring prediction units of the prediction unit currently to be decoded, the information of the advanced motion vector expression of the prediction unit currently to be decoded is determined.
(IV) If the coding unit where the prediction unit currently to be decoded is located is the foreground, and the subtype is any of the following: 1) affine motion in P-picture skip mode; 2) affine motion in P-picture direct mode ; 3) affine motion in B-picture skip mode; 4) affine motion in B-picture direct mode. The affine motion information of the prediction unit currently to be decoded is derived by the following operations.
If the neighbouring prediction unit X (X is F, G, C, A, B, or D) of the prediction unit E currently to be decoded exists, and the coding unit including the neighbouring prediction unit X is the foreground and is the prediction mode of the neighbouring prediction unit X is the inter prediction mode, then the neighbouring prediction unit X is "available", otherwise the neighbouring prediction unit X is "unavailable".
According to the availability of neighbouring prediction units of the prediction unit currently to be decoded, the affine motion information of the prediction unit currently to be decoded is derived.
Secondly, in case that the coding unit including the prediction unit currently to be decoded is background, the motion information of the prediction unit may be obtained as following description.
(I) When the coding unit where the prediction unit currently to be decoded is located is the background, and the subtype is any of the following: 1) using spatial list 0 reference in P-picture skip mode; 2) using the spatial list 0 for reference in P-picture direct mode, the motion information is derived by the following operations.
Referring back to FIG. 1, if, among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the background, and the number of prediction units with prediction reference mode of "list 0 reference" is greater than or equal to 1, the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the background and the prediction reference mode is 'list 0 reference', the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit E currently to be decoded. In other words, the neighbouring prediction units F, G, C, A, B, D are scanned in the order of F, G, C, A, B, D, and the motion information of the first scanned prediction unit, whose coding unit is the foreground and the prediction reference mode is 'list 0 reference', is determined as the motion information of the prediction unit E.
Otherwise, the list 0 motion vector of the prediction unit currently to be decoded is a zero motion vector, and the value of the list 0 reference index of the prediction unit E currently to be decoded is equal to 0. Furthermore, the prediction reference mode of the prediction unit E currently to be decoded is set as 'list 0 reference'.
(II) When the coding unit where the prediction unit currently to be decoded is located is the background, and the subtype is any of the following: using the spatial list 0 reference, or using the spatial list 1 reference, or using spatial double-list (0 and 1) reference in the B-picture skip mode; or using spatial list 0 reference, or using the spatial list 1 reference, or using spatial double-list (0 and 1) reference in B-picture direct mode, the motion information is derived according to the following operations.
(A) When, among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the background, and the number of prediction units with prediction reference mode of the "double-list reference" is greater than or equal to 1, the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the background and the prediction reference mode is ' double-list reference ', the list 0 motion vector and the list 1 motion vector of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 1 motion vector of the prediction unit currently to be decoded, and the list 0 reference index and the list 1 reference index of the spatial motion information are respectively regarded as the list 0 reference index and the list 1 reference index of the prediction unit E currently to be decoded.
Otherwise, when, among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the background, and the number of prediction units with prediction reference mode of 'list 0 reference' is greater than or equal to 1, and the number of prediction units with prediction reference mode of 'list 1 reference' is greater than or equal to 1, the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the background and the prediction reference mode is ' list 0 reference ', and the first scanned prediction unit whose coding unit is the background and the prediction reference mode is ' list 1 reference ', the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit with the prediction reference mode of ' list 0 reference' are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit E currently to be decoded, and the list 1 motion vector and the list 1 reference index of the spatial motion information of the first scanned prediction unit with the prediction reference mode of ' list 1 reference' are respectively regarded as the list 1 motion vector and the list 1 reference index of the prediction unit E currently to be decoded.
Otherwise, the list 0 motion vector and the list 1 motion vector of the prediction unit currently to be decoded are both zero motion vectors, and the values of the list 0 reference index and the list 1 reference index of the prediction unit E currently to be decoded are both equal to zero. Furthermore, the prediction reference mode of the prediction unit currently to be decoded is set as "double-list reference".
(B) When, among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the background, and the number of prediction units with prediction reference mode of the "list 1 reference" is greater than or equal to 1, the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the background and the prediction reference mode is "list 1 reference", the list 1 motion vector and the list 1 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 1 motion vector and the list 1 reference index of the prediction unit E currently to be decoded.
Otherwise, when, amongthe six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the background, and the number of prediction units with prediction reference mode of ' double-list reference ' is greater than or equal to 1, the neighbouring prediction units are scanned in the order of D, B, A, C, G, F (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the background and the prediction reference mode is ' double-list reference ', the list 1 motion vector and the list 1 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 1 motion vector and the list 1 reference index of the prediction unit E currently to be decoded.
Otherwise, the list 1 motion vector of the prediction unit E currently to be decoded is a zero motion vector, and the value of the list 1 reference index of the prediction unit currently to be decoded is equal to zero. Furtheremore, the prediction reference mode of the prediction unit E currently to be decoded is set as 'list 1 reference'.
(C) When, among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the background, and the number of prediction units with prediction reference mode of the "list 0 reference" is greater than or equal to 1, the neighbouring prediction units are scanned in the order of F, G, C, A, B, D (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the background and the prediction reference mode is "list 0 reference", the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit E currently to be decoded.
Otherwise, when, among the six neighbouring prediction units F, G, C, A, B, and D of the prediction unit E currently to be decoded, at least one of the coding units where the neighbouring prediction units are located is the background, and the number of prediction units with prediction reference mode of ' double-list reference ' is greater than or equal to 1, the neighbouring prediction units are scanned in the order of D, B, A, C, G, F (or other methods can be used, without limitation here) to obtain the first scanned prediction unit whose coding unit is the background and the prediction reference mode is ' double-list reference ', the list 0 motion vector and the list 0 reference index of the spatial motion information of the first scanned prediction unit are respectively regarded as the list 0 motion vector and the list 0 reference index of the prediction unit currently to be decoded.
Otherwise, the list 0 motion vector of the prediction unit currently to be decoded is a zero motion vector, and the value of the list 0 reference index of the prediction unit currently to be decoded is equal to zero. The prediction reference mode of the prediction unit E currently to be decoded is set as 'list 0 reference'.
(III) When the coding unit where the prediction unit to be decoded is located is the background, and the subtype is any of the following: 1) advanced motion vector expression in P-picture skip mode; 2) advanced motion vector expression in P-picture direct mode; 3) advanced motion vector expression in B-picture skip mode; 4) advanced motion vector expression in B-picture direct mode, motion information is derived by the following operations.
The availability of the neighbouring prediction units of the prediction unit E currently to be decoded are determined. Referring back to FIG.1, it is assumed that the neighbouring prediction units F, G, C, A, and D are the neighbouring prediction units of the current prediction unit E (or other combinations can be used, which are not limited here).
f) If the neighbouring prediction unit F exists and its coding unit is the background, and the inter prediction mode is applied to the neighbouring prediction unit F, then F is "available", otherwise, F is "unavailable".
g) If the neighbouring prediction unit G exists and its coding unit is the background, the inter prediction mode is applied to the neighbouring prediction unit G, and the motion information of G and F are different, then G is "available", otherwise, G is "unavailable".
h) If the neighbouring prediction unit C exists and its coding unit is the background, the inter prediction mode is applied to the neighbouring prediction unit C and the motion information of C and G are different, then C is "available", otherwise, C is "unavailable".
i) If the neighbouring prediction unit A exists and its coding unit is the background, the inter prediction mode is applied to the neighbouring prediction unit A and the motion information of A and F are different, then A is "available", otherwise, A is "unavailable".
j) If the neighbouring prediction unit D exists and its coding unit is the background, the inter prediction mode is applied to the neighbouring prediction unit D, the motion information of D and A are different, and the motion information of D and G are different, then D is "available", otherwise, D "unavailable".
According to the availability of neighbouring prediction units of the prediction unit currently to be decoded, the information of the advanced motion vector expression of the prediction unit currently to be decoded is determined.
(IV) Wehn the coding unit where the prediction unit currently to be decoded is located is the background, and the subtype is any of the following: 1) affine motion in P-picture skip mode; 2) affine motion in P-picture direct mode ; 3) affine motion in B-picture skip mode; 4) affine motion in B-picture direct mode. The affine motion information of the current prediction unit is derived by the followingoperations.
If the neighbouring prediction unit X (X is F, G, C, A, B, or D) of the prediction unit E currently to be decoded exists, and the coding unit is the background and it is in the inter prediction mode, then the neighbouring unit X is "available"; otherwise the neighbouring unit X is "unavailable".
According to the availability of neighbouring prediction units of the prediction unit currently to be decoded, the affine motion information of the current prediction unit is derived.
FIG. 7 illustrates a method for deriving the basic unit of a motion vector according to an embodiment of the present disclosure, wherein the basic unit of a motion vector may also be referred to as motion vector resolution. The embodiment shown in Figure 7 is for illustration only. Without departing from the scope of the present disclosure, other various methods may be used.
Referring to FIG. 7, a method for obtaining motion vector resolution in a decoding device is disclosed, and different methods for obtaining motion vector resolution are set according to the difference of the motion characteristics between the foreground and the background. In operation 701, the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located is obtained. In operation 702,the motion vector resolution set of the prediction unit currently to be decoded is obtained according to the obtained foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located. In operation 703, the motion vector resolution index value of the prediction unit currently to be decoded is obtained. In operation 704, the basic unit of the motion vector of the prediction unit currently to be decoded is obtained according to the motion vector resolution index value and the motion vector resolution set.
Specifically, if the coding unit where the prediction unit to be decoded is located is the foreground, its motion vector resolution set is {1/4, 1/2, 1, 2, 4}, and the value range for the index value of its motion vector resolution is 0~4 and is an integer.
-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 currently to be decoded is located is the background, its proper motion vector resolution set is {1/4, 1/2, 1}, and the value range for the index value of its motion vector resolution is 0, 1, 2.
-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 resolution set of the prediction unit whose coding unit is the foreground may include values less than 1, a value equal to 1, and the values greater than 1 at the same time. Furthemore, the motion vector resolution set of the prediction unit whose coding unit is the background prediction may include values less than 1 and a value equal to 1. The specific number of resolution value in the motion vector resolution set is not limited here.
Usually, the background of the image has no or very slight movement, so the basic unit value of the set motion vector is small, and the foreground usually can have a strong or slight movement, so the basic unit value range of the set motion vector can be a range from small to large. In other words, motion vector resolution values included in the motion vector resolution set for the prediction unit included in the foreground are set relatively larger than motion vector resolution values included in the motion vector resolution set for the prediction unit included in background. According to the embodiment of the present disclosure, it can save the number of bits used for encoding and transmitting the index value of the motion vector resolution, and save the code rate.
According to an embodiment of the present disclosure, a method for generating a reference picture list is provided, wherein different reference picture list generation methods are used for the prediction unit whose coding unit is the foreground and the prediction unit whose coding unit is the background, and the generation methods are the same in the coding device and the decoding device.
Specifically, in case that the coding unit where the prediction unit is located is the background, the reference picture list includes: 1) a background image, or 2) a background image and an encoded or decoded image immediately neighbouring to the current image.
For the case in which the coding unit where the prediction unit is located is the foreground, the image contained in the reference picture list is not limited, but under normal circumstances, there are more cases that include encoded or decoded pictures than the background images.
Under normal circumstances, the background is static, or there is only slight movement, such as the wind disturbance of leaves and grass, therefore reference image for the background may be limited. In case that the coding unit where the prediction unit is located is the background, the prediction unit may only use the background image as a reference, or use the encoded/decoded picture temporally adjacent to the current picture including the prediction unit currently to be processed as a reference. In other words, when a current prediction unit is included in the background, background image or temporally adjacent picture are used as reference picture. According to the embodiment of the present disclosure, the coding complexity of the coding end can be reduced, the number of bits of the coding reference image index value can be reduced, and the code rate can be saved.
FIGs. 8A and 8B illustrate a method for deriving quantization parameters of coding units in a decoding device according to an embodiment of the present disclosure. The embodiments shown in FIGs.8A and 8B are for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
Referring to FIG. 8A, in operation 801, the foreground and/or background information of the coding unit currently to be decoded is obtained. In operation 802, basic quantization parameter information is obtained, and the quantization parameter information of the coding unit currently to be decoded is obtained according to the foreground and/or background information of the coding unit currently to be decoded. The basic quantization parameter information may be the average quantization parameter of the current image currently to be decoded, or the quantization parameter of the previously decoded coding unit, etc., which is not limited here.
In another embodiment, if the coding unit currently to be decoded is the foreground, the quantization parameter of the coding unit currently to be decoded is set as the basic quantization parameter minus the absolute value of the first quantization parameter difference. If the coding unit currently to be decoded is the background, the quantization parameter of the coding unit currently to be decoded is set as the basic quantization parameter value.
In another embodiment, if the coding unit currently to be decoded is the background, the quantization parameter of the coding unit currently to be decoded is set as the basic quantization parameter plus the absolute value of the second quantization parameter difference. If the coding unit currently to be decoded is the foreground, the quantization parameter of the coding unit currently to be decoded is set as the basic quantization parameter.
The absolute value of the first quantization parameter difference and the absolute value of the second quantization parameter difference are preset in the encoding device and the decoding device according to the same rule, and the specific values *?*are not limited here.
FIG. 8B illustrates another embodiment. In operation, 801', a difference value of the quantization parameter of the coding unit currently to be decoded is obtained. The difference value may be a signed value. In operation 802', the basic quantization parameter is obtained, and the basic quantization parameter and the difference value of the quantization parameter is added to obtain the value of the quantization parameter of the coding unit currently to be decoded.
According to the embodiment of the present disclosure, in the surveillance video, the user usually only pays attention to the moving objects in the foreground. Therefore, setting a relatively smaller quantization parameter to the foreground coding unit can improve the quality of the reconstructed image in the foreground and improve the user experience, or setting a relatively larger quantization parameter to the background coding unit can save the code rate.
In FIG. 9A, a block diagram for an encoding method according to an embodiment of the present disclosure is shown. The embodiment shown in FIG. 9A is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
Referring to FIG. 9A, in operation 901, information about the prediction unit currently to be coded is obtained, and the information includes foreground and/or background information of the coding unit where the prediction unit currently to be coded is located. In operation 902, the information of the prediction unit currently to be coded is output to the bit-stream.
In an embodiment, the encoding method further includes: when the inter prediction mode is applied to predict a prediction unit currently to be encoded, the prediction value of the prediction unit currently to be encoded is obtained according to the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located, and the residual value is obtained according to the original pixel value and the prediction value, The quantization parameter is set according to the foreground and/or background information of the coding unit where the prediction unit currently to be coded is located, the residual information is obtained by using the set quantization parameter and the obtained residual value, and the residual information and basic quantization parameter information are output to the bit-stream.
In an embodiment, the obtaining information about the prediction unit currently to be encoded includes: obtaining the background image, obtaining the foreground and/or background information of each coding unit in the current image according to the background image and the image currently to be encoded, and encoding the foreground and/or background information of each coding unit according to the set parameter for identifying the size of the coding unit.
In an embodiment, the obtaining the prediction value of the prediction unit currently to be encoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located includes: obtaining the prediction motion information of the prediction unit currently to be encoded; setting the motion search range according to the foreground and/or background information of the coding unit where the prediction unit currently to be coded is located and the predicted motion information; obtaining the difference of the motion vector of the prediction unit currently to be coded according to the prediction motion information of the prediction unit currently to be coded and the motion search range.
In FIG. 9B, an encoding method according to an embodiment of the present disclosure is shown. The embodiment shown in FIG. 9B is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
Referring to FIG. 9B, in operation 901', the foreground and/or background information of the coding unit where the prediction unit currently to be coded is located is obtained. In operation 902', when the current prediction unit is predicted by using the inter prediction mode, the prediction value of the prediction unit currently to be encoded is obtained according to the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located, the prediction value is subtracted from the original pixel value to obtain the residual value, and the residual value is transformed. In operation 903' , the quantization parameter is set according to the foreground and/or background information of the coding unit where the prediction unit currently to be encoded is located. In operation 904', the set quantization parameter is used for quantizing the transformed residual value to obtain residual information, and in operation 905', the foreground and/or background information, residual information, and basic quantization parameter information are output to the bit-stream.
In FIG. 10, a block diagram of a method for setting a motion search range in an encoding device according to an embodiment of the present disclosure is shown. The embodiment shown in FIF. 10 is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
Referring to FIG. 10, in operation 1001, if the coding unit where the prediction unit currently to be coded is located is the foreground, a search range with a larger value is determined. If the coding unit where the prediction unit currently to be coded is located is the background, a search range with a smaller value is determined. In operation 1002, the predicted motion information of the prediction unit currently to be encoded is obtained, the predicted motion information includes motion vector prediction value, prediction reference mode, index value of the reference image in the reference picture list, etc. In operation 1003, the reference image corresponding to the index value is determined in the reference picture list according to the prediction reference mode, the position pointed by the motion vector prediction value is used as the search center, a motion search is performed within the determined search range to find the most matched block corresponding to the prediction unit currently to be encoded, the distance between the search center position and the upper left corner of the most matched block is calculated, and the distance is the motion vector difference.
Specifically, if the prediction reference mode is using the list 0 reference, the reference image corresponding to the index value is determined in the reference picture list 0, and the motion vector difference of the list 0 after the motion search is obtained. If the prediction reference mode is using the list 1 reference, the reference image corresponding to the index value is determined in the reference picture list 1, and the motion vector difference of the list 1 after the motion search is obtained. If the prediction reference mode is using a double-list reference, the reference image corresponding to the index value isdetermined in reference picture list 0 and reference picture list 1, respectively, and the motion vector difference of list 0 and the motion vector difference of list 1 after the motion search are obtained.
According to the embodiment of the present disclosure, under normal circumstances, the background is static or there is only slight movement, such as wind disturbance of leaves and grass, therefore the absolute value of the motion vector and the absolute value of the motion vector difference are not very large, the motion search range is set small, which can reduce the complexity of the encoding end.
In FIG. 11, a block diagram of an apparatus for performing a decoding method according to an embodiment of the present disclosure is shown. The embodiment shown in FIG. 11 is for illustration only. Other various methods 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 bit-stream, and a decoder 1102, which is coupled to the receiving unit and configured to: obtain information about prediction unit currently to be decoded from the received data, wherein the information about the prediction unit currently to be decoded includes the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtain the prediction value of the prediction unit currently to be decoded according to the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; obtain the reconstructed value according to the prediction value of the prediction unit currently to be decoded.
In FIG. 12, a block diagram of an apparatus for executing an encoding method according to an embodiment of the present disclosure is shown. The embodiment shown in FIG. 12 is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
Referring to FIG.12, the apparatus includes an encoder 1201, which is configured to: obtain information about a prediction unit currently to be encoded, wherein the information includes the foreground and/or background information of a coding unit where the prediction unit currently to be encoded is located; output the information about the prediction unit currently to be encoded to a sending unit 1202; and the sending unit 1202 is coupled to the encoder and is configured to encode the information about the prediction unit currently to be encoded into the code flow.
In FIG. 13, a block diagram of an electronic device according to an embodiment of the present disclosure is shown. The embodiment shown in FIG. 13 is for illustration only. Other various methods may be used without departing from the scope of the present disclosure.
Referring to FIG. 13, the electronic device includes a memory 1301, which is configured to store a computer program; and a processor 1302, which is configured to read the computer program from the memory, and is configured to perform the decoding method and/or the encoding method described above.
Although the present disclosure has been described with exemplary embodiments, various changes and modifications can be suggested to those skilled in the art. The present disclosure is intended to cover such changes and modifications that fall within the scope of the appended claims.
Any description in this application should not be construed as implying that any specific element, step or function is an essential element that must be included in the scope of the claims. The scope of patented subject matter is limited only by the claims.
Claims (15)
- A decoding method, includes:obtaining information about a prediction unit to be decoded from a bit-stream, wherein the information about the prediction unit to be decoded includes the foreground and/or background information of the coding unit where the prediction unit currently to be decoded is located; andobtaining a reconstructed value of the prediction unit to be decoded according to the information about the prediction unit currently to be decoded,wherein the obtaining the reconstructed value of the prediction unit comprises:when the prediction unit to be decoded is included in the foreground according to the foreground and/or background information, obtaining an information of one or more neighbouring prediction units located on the foreground;when the prediction unit to be decoded is included in the background according to the foreground and/or background information, obtaining an information of one or more neighbouring prediction units located on the background; andobtaining a prediction value of the prediction unit to be decoded using the information of the one or more neighbouring prediction units.
- The method of claim 1, wherein the information of the one or more neighbouring prediction units includes inter prediction information of the one or more neighbouring prediction units, andthe inter prediction information of the prediction unit to be decoded is determined using the inter prediction information of the one or more neighbouring prediction units.
- The method of claim 2, wherein the inter prediction information of the prediction unit to be decoded includes at least one of motion vector prediction value of the prediction unit to be decoded, motion information of the prediction unit to be decoded, motion vector resolution of the prediction unit to be decoded, and reference picture list information of the prediction unit to be decoded.
- The method of claim 2, wherein a neighbouring prediction unit is determined to be available, when all the following conditions, i) the neighbouring prediction unit is within boundary of a current image, ii) a coding unit including the neighbouring prediction unit is located on same type with the coding unit including the prediction unit to be decoded between the foreground and the background, iii) the neighbouring prediction unit does not apply the intra prediction mode, and iv) the neighbouring prediction unit has a motion vector type, are satisfied.
- The method of claim 2, wherein the inter prediction information of the one or more neighbouring prediction units is determined according to a predetermined scan order.
- The method of claim 2, wherein the inter prediction information of the prediction unit to be decoded includes a motion vector resolution set and a motion vector resolution index value of the prediction unit to be decoded.
- The method of claim 2, wherein the inter prediction information of the prediction unit to be decoded includes a reference picture list of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located.
- The method of claim 1, wherein the obtaining the prediction value of the prediction unit to be decoded includes:obtaining a quantization parameter of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located and basic quantization parameter information, andobtaining the residual value according to the quantization parameter and the residual information.
- The method of claim 8, wherein the obtaining the quantization parameter of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located and the basic quantization parameter information includes: obtaining the quantization parameter of the prediction unit to be decoded based on the basic quantization parameter and the absolute value of the preset first quantization parameter difference, according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located.
- The method of claim 8, wherein the obtaining the quantization parameter of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located and the basic quantization parameter information includes:decoding a difference of the quantization parameter of the coding unit where the prediction unit to be decoded is located; andobtaining a value of the quantization parameter of the coding unit where the prediction unit to be decoded is located according to the basic quantization parameter and the difference of the quantization parameter.
- An encoding method, includes:obtaining information about a prediction unit to be encoded, the information including foreground and/or background information of a coding unit where the prediction unit to be encoded is located;outputting the information about the prediction unit to be encoded into a bit-stream,wherein the obtaining the information about the prediction unit comprises:when the prediction unit to be encoded is included in the foreground, generating an information of the prediction unit to be encoded by using an information of one or more neighbouring prediction units located on the foreground; andwhen the prediction unit to be encoded is included in the background, generating an information of the prediction unit to be encoded by using an information of one or more neighbouring prediction units located on the background.
- The method of claim 11, wherein the method further includes:when the current prediction unit is predicted by using a inter prediction mode, deriving a predicted value of the prediction unit to be encoded according to the foreground and/or background information of a coding unit where the prediction unit to be encoded is located, obtaining a residual value according to an original pixel value and the predicted value;setting a quantization parameter according to the foreground and/or background information of a coding unit where the prediction unit to be encoded is located;using the set quantization parameter and the obtained residual value to derive residual information;outputting the residual information and the basic quantization parameter information to a bit-stream.
- An apparatus for performing a decoding method, the apparatus comprises:a receiving unit configured to receive data from a bit-stream;a decoder coupled to the receiving unit , and configured to:obtain information about the prediction unit to be decoded from the received data, wherein the information about the prediction unit to be decoded includes foreground and/or background information of the coding unit where the prediction unit to be decoded is located;obtain a prediction value of the prediction unit to be decoded according to the foreground and/or background information of the coding unit where the prediction unit to be decoded is located;obtain a reconstructed value according to the prediction value of the prediction unit to be decoded.wherein, when the prediction unit to be decoded is included in the foreground according to the foreground and/or background information, an information of one or more neighbouring prediction units located on the foreground is obtained;when the prediction unit to be decoded is included in the background according to the foreground and/or background information, an information of one or more neighbouring prediction units located on the background is obtained; andthe prediction value of the prediction unit to be decoded is obtained using the information of the one or more neighbouring prediction units.
- The apparatus of claim 13, wherein the information of the one or more neighbouring prediction units includes inter prediction information of the one or more neighbouring prediction units, and the inter prediction information of the prediction unit to be decoded is determined using the inter prediction information of the one or more neighbouring prediction units.
- An apparatus for performing an encoding method, the apparatus includes:an encoder configured to:obtain information about a prediction unit to be encoded, the information including foreground and/or background information of the coding unit where the prediction unit to be encoded is located;output the information about the prediction unit to be encoded to a sending unit; andthe sending unit, which is coupled to the encoder and is configured to encode the information of the prediction unit to be encoded into a bit-stream,wherein, when the prediction unit to be encoded is included in the foreground, an information of the prediction unit to be encoded is generated using an information of one or more neighbouring prediction units located on the foreground; andwhen the prediction unit to be encoded is included in the background, an information of the prediction unit to be encoded is generated using an information of one or more neighbouring prediction units located on the background.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010113883.2A CN113301337A (en) | 2020-02-24 | 2020-02-24 | Coding and decoding method and device |
CN202010113883.2 | 2020-02-24 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021172847A1 true WO2021172847A1 (en) | 2021-09-02 |
Family
ID=77317862
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
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 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113301337A (en) |
WO (1) | WO2021172847A1 (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100208812A1 (en) * | 1996-08-15 | 2010-08-19 | Mitsubishi Denki Kabushiki Kaisha | Image coding apparatus with segment classification and segmentation-type motion prediction circuit |
US20160337647A1 (en) * | 2008-11-17 | 2016-11-17 | Checkvideo Llc | Analytics-modulated coding of surveillance video |
US20180061199A1 (en) * | 2016-08-23 | 2018-03-01 | Oki Electric Industry Co., Ltd. | Image processing system and image decoding apparatus |
US20180131950A1 (en) * | 2015-04-30 | 2018-05-10 | Hangzhou Hikvision Digital Technology Co., Ltd. | Video coding and decoding methods and apparatus |
US20190116370A1 (en) * | 2015-03-10 | 2019-04-18 | Hangzhou Hikvision Digital Technology Co., Ltd. | Systems and Methods for Hybrid Video Encoding |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101830352B1 (en) * | 2011-11-09 | 2018-02-21 | 에스케이 텔레콤주식회사 | 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 |
EP3367681B1 (en) * | 2015-10-22 | 2021-03-24 | LG Electronics Inc. | Modeling-based image decoding method and device in image coding system |
WO2017069588A1 (en) * | 2015-10-22 | 2017-04-27 | 엘지전자(주) | Method for encoding/decoding image and device therefor |
-
2020
- 2020-02-24 CN CN202010113883.2A patent/CN113301337A/en active Pending
-
2021
- 2021-02-23 WO PCT/KR2021/002261 patent/WO2021172847A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100208812A1 (en) * | 1996-08-15 | 2010-08-19 | Mitsubishi Denki Kabushiki Kaisha | Image coding apparatus with segment classification and segmentation-type motion prediction circuit |
US20160337647A1 (en) * | 2008-11-17 | 2016-11-17 | Checkvideo Llc | Analytics-modulated coding of surveillance video |
US20190116370A1 (en) * | 2015-03-10 | 2019-04-18 | Hangzhou Hikvision Digital Technology Co., Ltd. | Systems and Methods for Hybrid Video Encoding |
US20180131950A1 (en) * | 2015-04-30 | 2018-05-10 | Hangzhou Hikvision Digital Technology Co., Ltd. | Video coding and decoding methods and apparatus |
US20180061199A1 (en) * | 2016-08-23 | 2018-03-01 | Oki Electric Industry Co., Ltd. | Image processing system and image decoding apparatus |
Also Published As
Publication number | Publication date |
---|---|
CN113301337A (en) | 2021-08-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020071830A1 (en) | Image coding method using history-based motion information, and device therefor | |
WO2017052081A1 (en) | Inter prediction method and apparatus in image coding system | |
WO2011087321A2 (en) | Method and apparatus for encoding and decoding motion vector | |
WO2012081879A1 (en) | Method for decoding inter predictive encoded motion pictures | |
WO2012023763A2 (en) | Inter prediction encoding method | |
WO2011087323A2 (en) | Method and apparatus for encoding and decoding image by using large transform unit | |
WO2017082443A1 (en) | Method and apparatus for adaptively predicting image using threshold value in image coding system | |
WO2011053050A2 (en) | Method and apparatus for encoding and decoding coding unit of picture boundary | |
WO2014171713A1 (en) | Method and apparatus for video encoding/decoding using intra prediction | |
WO2012005549A2 (en) | Methods and apparatuses for encoding and decoding motion vector | |
WO2013032073A1 (en) | Method for generating prediction block in amvp mode | |
WO2016143991A1 (en) | Image encoding and decoding method based on low-complexity transformation, and apparatus using same | |
WO2015012600A1 (en) | Method and apparatus for encoding/decoding image | |
WO2015009036A1 (en) | Method and apparatus for predicting inter-layer based on temporal sub-layer information | |
WO2017048008A1 (en) | Inter-prediction method and apparatus in video coding system | |
WO2015194913A1 (en) | Method for encoding/decoding image and device using same | |
WO2021125700A1 (en) | Prediction weighted table-based image/video coding method and apparatus | |
WO2019054838A1 (en) | Method and apparatus for coding video using merging candidate list according to block division | |
WO2015093810A1 (en) | Method and device for forward multiple-hypothesis encoding/decoding of image block | |
WO2019209026A1 (en) | Method and apparatus for inter prediction in video coding system | |
WO2020141833A1 (en) | Image decoding method, image encoding method, image decoding device, image encoding device, and computer-readable recording medium | |
WO2021172847A1 (en) | Method and apparatus for encoding or decoding a video according to background and foreground | |
WO2010098556A2 (en) | Image encoding/decoding apparatus and method | |
WO2019066602A1 (en) | Method and apparatus for inter prediction in image coding system | |
WO2019203513A1 (en) | Image decoding method and apparatus according to inter prediction using dmvd in image coding system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21760761 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21760761 Country of ref document: EP Kind code of ref document: A1 |