WO2023173809A1 - 视频编解码方法、装置、存储介质、电子设备及计算机程序产品 - Google Patents

视频编解码方法、装置、存储介质、电子设备及计算机程序产品 Download PDF

Info

Publication number
WO2023173809A1
WO2023173809A1 PCT/CN2022/135499 CN2022135499W WO2023173809A1 WO 2023173809 A1 WO2023173809 A1 WO 2023173809A1 CN 2022135499 W CN2022135499 W CN 2022135499W WO 2023173809 A1 WO2023173809 A1 WO 2023173809A1
Authority
WO
WIPO (PCT)
Prior art keywords
vector
block
displacement vector
prediction
decoded
Prior art date
Application number
PCT/CN2022/135499
Other languages
English (en)
French (fr)
Inventor
王英彬
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to KR1020247009420A priority Critical patent/KR20240051197A/ko
Publication of WO2023173809A1 publication Critical patent/WO2023173809A1/zh
Priority to US18/516,013 priority patent/US20240089494A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/521Processing of motion vectors for estimating the reliability of the determined motion vectors or motion vector field, e.g. for smoothing the motion vector field or for correcting motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Definitions

  • the present application relates to the field of computer and communication technologies, and in particular to a video encoding and decoding method, device, storage medium, electronic equipment and computer program product.
  • a default prediction vector can be derived. However, if these default prediction vectors are improperly selected, it will affect the encoding performance.
  • Embodiments of the present application provide a video encoding and decoding method, device, computer-readable storage medium, electronic equipment and computer program products, which can, to a certain extent, construct a more suitable displacement vector based on the reference frame being the decoded block of the current frame.
  • a candidate list of predicted vectors to ensure that more accurate predicted vectors are selected, which is beneficial to improving coding performance.
  • An embodiment of the present application provides a video decoding method, which includes: generating a prediction vector candidate list based on the displacement vector of a decoded block whose reference frame is the current frame; and selecting a prediction of the current block to be decoded from the prediction vector candidate list.
  • Vector perform decoding processing on the current block based on the prediction vector of the current block.
  • An embodiment of the present application provides a video encoding method, which includes: generating a prediction vector candidate list based on the displacement vector of a coded block whose reference frame is the current frame; and selecting a prediction of the current block to be encoded from the prediction vector candidate list.
  • Vector encoding the current block based on the prediction vector of the current block.
  • An embodiment of the present application provides a video decoding device, including: a first generation unit configured to generate a prediction vector candidate list based on the reference frame being the displacement vector of the decoded block of the current frame; a first selection unit configured to generate a prediction vector candidate list from the decoded block of the current frame. Select the prediction vector of the current block to be decoded from the prediction vector candidate list; the first processing unit is configured to decode the current block based on the prediction vector of the current block.
  • An embodiment of the present application provides a video encoding device, including: a second generation unit configured to generate a prediction vector candidate list based on the reference frame being a displacement vector of a coded block of the current frame; a second selection unit configured to generate a prediction vector candidate list from the Select the prediction vector of the current block to be encoded from the prediction vector candidate list; the second processing unit is configured to perform encoding processing on the current block based on the prediction vector of the current block.
  • Embodiments of the present application provide a computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the computer program is executed by a processor, the method described in the above embodiments is implemented.
  • Embodiments of the present application provide an electronic device, including: one or more processors; a memory configured to store one or more programs, when the one or more programs are executed by the one or more processors , so that the electronic device implements the method described in the above embodiment.
  • Embodiments of the present application provide a computer program product or computer program.
  • the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided above.
  • a predictor vector candidate list is generated, and then the predictor vector of the current block is selected from the predictor vector candidate list, so that the reference frame can be the displacement vector of the decoded block of the current frame.
  • construct a more suitable prediction vector candidate list to ensure that more accurate prediction vectors are selected from it, which is beneficial to improving coding performance.
  • Figure 1 is a schematic diagram of an exemplary system architecture in an embodiment of the present application
  • Figure 2 is a schematic diagram of the placement of the video encoding device and the video decoding device in the streaming transmission system in the embodiment of the present application;
  • Figure 3 is a schematic diagram of the relationship between SB and B in the embodiment of the present application.
  • Figure 4 is a basic flow chart of a video encoder in an embodiment of the present application.
  • Figure 5 is a schematic diagram of inter-frame prediction in an embodiment of the present application.
  • Figure 6 is a schematic diagram of intra-frame block copying in an embodiment of the present application.
  • Figure 7 is a schematic diagram of the reference range of IBC in AV1 in the embodiment of the present application.
  • Figure 8 is a schematic diagram of the reference range of IBC in AV2 in the embodiment of the present application.
  • Figure 9 is a flow chart of the video decoding method in the embodiment of the present application.
  • Figure 10 is a schematic diagram of selecting decoded blocks adjacent to the current block in an embodiment of the present application.
  • Figure 11 is a flow chart of the video decoding method in the embodiment of the present application.
  • Figure 12 is a flow chart of the video encoding method in the embodiment of the present application.
  • Figure 13 is a block diagram of a video decoding device in an embodiment of the present application.
  • Figure 14 is a block diagram of a video encoding device in an embodiment of the present application.
  • FIG. 15 is a schematic structural diagram of a computer system of an electronic device in an embodiment of the present application.
  • Figure 1 is a schematic diagram of an exemplary system architecture of the technical solution of the embodiment of the present application.
  • system architecture 100 includes a plurality of terminal devices that can communicate with each other through, for example, network 150 .
  • the system architecture 100 may include a first terminal device 110 and a second terminal device 120 interconnected through a network 150 .
  • the first terminal device 110 and the second terminal device 120 perform one-way data transmission.
  • the first terminal device 110 may encode video data (such as a video picture stream collected by the terminal device 110) for transmission to the second terminal device 120 through the network 150.
  • the encoded video data is represented by one or more
  • the encoded video is transmitted in the form of a stream.
  • the second terminal device 120 can receive the encoded video data from the network 150, decode the encoded video data to restore the video data, and display video pictures according to the restored video data.
  • the system architecture 100 may include a third terminal device 130 and a fourth terminal device 140 that perform bidirectional transmission of encoded video data, which bidirectional transmission may occur, for example, during a video conference.
  • each of the third terminal device 130 and the fourth terminal device 140 may encode video data (eg, a video picture stream collected by the terminal device) for transmission to the third terminal device through the network 150 130 and another terminal device among the fourth terminal devices 140 .
  • Each of the third terminal device 130 and the fourth terminal device 140 may also receive the encoded video data transmitted by the other terminal device of the third terminal device 130 and the fourth terminal device 140, and may The video data is decoded to recover the video data, and the video picture can be displayed on an accessible display device based on the recovered video data.
  • the first terminal device 110 , the second terminal device 120 , the third terminal device 130 and the fourth terminal device 140 may be servers or terminals, but the principles disclosed in this application may not be limited thereto.
  • the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, and middleware. Cloud servers that provide basic cloud computing services such as software services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
  • the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smart voice interaction device, smart watch, smart home appliance, vehicle terminal, aircraft, etc., but is not limited to this.
  • the network 150 shown in FIG. 1 represents any number of networks for transmitting encoded video data between the first terminal device 110 , the second terminal device 120 , the third terminal device 130 and the fourth terminal device 140 , including, for example, wired and /or wireless communication network.
  • Communication network 150 may exchange data in circuit-switched and/or packet-switched channels.
  • the network may include telecommunications networks, local area networks, wide area networks, and/or the Internet. For purposes of this application, unless explained below, the architecture and topology of network 150 may be immaterial to the operations disclosed herein.
  • FIG. 2 illustrates the placement of a video encoding device and a video decoding device in a streaming environment.
  • the subject matter disclosed herein is equally applicable to other video-enabled applications, including, for example, video conferencing, digital television (TV), storage of compressed video on digital media including CDs, DVDs, memory sticks, etc., and the like.
  • the streaming system may include a capture subsystem 213, which may include a video source 201 such as a digital camera, which creates an uncompressed video picture stream 202.
  • the video picture stream 202 includes samples captured by a digital camera. Compared to the encoded video data 204 (or the encoded video stream 204), the video picture stream 202 is depicted as a thick line to emphasize the high data volume of the video picture stream.
  • the video picture stream 202 can be processed by the electronic device 220.
  • Device 220 includes video encoding device 203 coupled to video source 201 .
  • Video encoding device 203 may include hardware, software, or a combination of hardware and software to implement or implement aspects of the disclosed subject matter as described in greater detail below.
  • the encoded video data 204 (or encoded video stream 204 ) is depicted as a thin line compared to the video picture stream 202 to emphasize the lower data amount of the encoded video data 204 (or encoded video stream 202 ).
  • 204 which may be stored on the streaming server 205 for future use.
  • One or more streaming client subsystems such as client subsystem 206 and client subsystem 208 in FIG. 2 , may access streaming server 205 to retrieve copies 207 and 209 of encoded video data 204 .
  • Client subsystem 206 may include, for example, video decoding device 210 in electronic device 230 .
  • Video decoding device 210 decodes the incoming copy of the encoded video data 207 and produces an output video picture stream 211 that can be presented on a display 212 (eg, a display screen) or another presentation device.
  • the encoded video data 204, video data 207, and video data 209 may be encoded according to certain video encoding/compression standards.
  • electronic device 220 and electronic device 230 may include other components not shown in the figures.
  • electronic device 220 may include a video decoding device
  • electronic device 230 may further include a video encoding device.
  • the video frame image when After inputting a video frame image, the video frame image will be divided into several non-overlapping processing units according to a block size, and each processing unit will perform similar compression operations.
  • This processing unit is called the Coding Tree Unit (CTU), or the Largest Coding Unit (LCU).
  • the CTU can be further divided into more refined divisions to obtain one or more basic coding units (Coding Unit, CU).
  • CU is the most basic element in a coding link.
  • this processing unit may also be called a coding tile, which is a rectangular area of a multimedia data frame that can be independently decoded and encoded.
  • the coding slice can be divided further down to obtain one or more maximum coding blocks (Superblock, SB).
  • SB is the starting point of block division, which can be divided into multiple sub-blocks, and then the maximum coding block can be further divided into Divide down to obtain one or more blocks.
  • Each block is the most basic element of a coding session.
  • the relationship between SB and block (B) can be as shown in Figure 3, that is, one SB can contain several Bs.
  • Predictive Coding includes intra-frame prediction and inter-frame prediction. After the original video signal is predicted by the selected reconstructed video signal, the residual video signal is obtained. The encoding end needs to decide which predictive coding mode to select for the current coding unit (or coding block) and inform the decoding end. Among them, intra-frame prediction means that the predicted signal comes from an area in the same image that has been encoded and reconstructed; inter-frame prediction means that the predicted signal comes from other images that have been encoded and are different from the current image (called a reference image). .
  • Transform & Quantization After the residual video signal undergoes transformation operations such as Discrete Fourier Transform (DFT) and Discrete Cosine Transform (DCT), the signal is converted into the transform domain. Called the transformation coefficient. The transform coefficient performs a lossy quantization operation and loses certain information, making the quantized signal conducive to compressed expression. In some video coding standards, there may be more than one transformation method to choose from, so the encoding end also needs to select one of the transformation methods for the current coding unit (or coding block) and inform the decoding end. The degree of fineness of quantization is usually determined by the quantization parameter (Quantization Parameter, QP).
  • QP Quantization Parameter
  • a larger value of QP means that coefficients with a larger value range will be quantized into the same output, so it usually results in greater distortion and comparison.
  • Low code rate on the contrary, the QP value is small, which means that coefficients with a smaller value range will be quantized into the same output, so it usually brings smaller distortion and corresponds to a higher code rate.
  • Entropy Coding or statistical coding The quantized transform domain signal will be statistically compressed and coded according to the frequency of occurrence of each value, and finally a binary (0 or 1) compressed code stream will be output. At the same time, encoding produces other information, such as the selected encoding mode, motion vector data, etc., which also require entropy encoding to reduce the code rate.
  • Statistical coding is a lossless coding method that can effectively reduce the bit rate required to express the same signal. Common statistical coding methods include variable length coding (VLC) or context-based binary arithmetic coding (Content Adaptive Binary Arithmetic Coding, CABAC).
  • the context-based binary arithmetic coding (CABAC) process mainly includes three steps: binarization, context modeling and binary arithmetic coding.
  • the binary data can be encoded through conventional encoding mode and bypass coding mode (Bypass Coding Mode).
  • the bypass encoding mode does not need to assign a specific probability model to each binary bit.
  • the input binary bit bin value is directly encoded with a simple bypass encoder to speed up the entire encoding and decoding.
  • different grammatical elements are not completely independent, and the same grammatical elements themselves also have certain memorability.
  • the encoded symbolic information used as conditions is called context.
  • the binary bits of the syntax element enter the context modeler sequentially, and the encoder assigns an appropriate probability model to each input binary bit based on the value of the previously encoded syntax element or binary bit.
  • the process is context modeling.
  • the context model corresponding to the syntax element can be located through the context index increment (context index increment, ctxIdxInc) and the context start index (context index Start, ctxIdxStart). After the bin value and the assigned probability model are sent to the binary arithmetic encoder for encoding, the context model needs to be updated according to the bin value, which is the adaptive process in encoding.
  • Loop Filtering The changed and quantized signal will obtain a reconstructed image through the operations of inverse quantization, inverse transformation and prediction compensation. Compared with the original image, some information of the reconstructed image is different from the original image due to the influence of quantization, that is, the reconstructed image will produce distortion. Therefore, filtering operations can be performed on the reconstructed image, such as Deblocking filter (DB), Adaptive Pixel Offset (Sample Adaptive Offset, SAO) or Adaptive Loop Filter (ALF) and other filters. It can effectively reduce the distortion caused by quantization. Since these filtered reconstructed images will be used as references for subsequent encoded images to predict future image signals, the above-mentioned filtering operations are also called loop filtering, that is, filtering operations within the encoding loop.
  • DB Deblocking filter
  • SAO Sample Adaptive Offset
  • ALF Adaptive Loop Filter
  • FIG. 4 shows a basic flow chart of a video encoder, in which intra prediction is taken as an example for explanation.
  • the original image signal s k [x, y] and the predicted image signal Perform a difference operation to obtain the residual signal u k [x, y].
  • the residual signal u k [x, y] is transformed and quantized to obtain the quantized coefficients.
  • the quantized coefficients are encoded through entropy coding to obtain the encoded bits.
  • the reconstructed residual signal u' k [x, y] is obtained through inverse quantization and inverse transformation processing, and the predicted image signal Superimposed with the reconstructed residual signal u' k [x, y] to generate an image signal image signal
  • the reconstructed image signal s' k [x, y] is output through loop filtering.
  • the reconstructed image signal s' k [x, y] ] can be used as a reference image for the next frame for motion estimation and motion compensation prediction. Then based on the motion compensation prediction result s' r [x+m x ,y+m y ] and the intra prediction result Get the predicted image signal of the next frame And continue to repeat the above process until the encoding is completed.
  • the decoding end for each coding unit (or coding block), after obtaining the compressed code stream (ie, bit stream), entropy decoding is performed to obtain various mode information and quantization coefficients. Then the quantized coefficients undergo inverse quantization and inverse transformation to obtain the residual signal.
  • the prediction signal corresponding to the coding unit (or coding block) can be obtained, and then the reconstructed signal can be obtained by adding the residual signal and the prediction signal, and the reconstructed signal then passes through the loop Filtering and other operations produce the final output signal.
  • Mainstream video coding standards (such as HEVC, VVC, AVS3, AV1, AV2) all adopt block-based hybrid coding framework.
  • the original video data is divided into a series of coding blocks, and video coding methods such as prediction, transformation and entropy coding are combined to achieve video data compression.
  • motion compensation is a type of prediction method commonly used in video coding. Motion compensation is based on the redundant characteristics of video content in the time domain or spatial domain, and derives the prediction value of the current coding block from the coded area.
  • Such prediction methods include: inter-frame prediction, intra-frame block copy prediction, intra-frame string copy prediction, etc. In coding implementation, these prediction methods may be used alone or in combination.
  • AV1 is Alliance for Open Media Video 1, which is the first generation video coding standard formulated by the Open Media Alliance
  • AV2 is Alliance for Open Media Video 2 which is the second generation video coding standard formulated by the Open Media Alliance. standard.
  • the displacement vector may have different names. In the embodiments of this application, they are uniformly described in the following manner: 1) The displacement vector in inter-frame prediction is called motion displacement. Vector (Motion Vector, MV); 2) The displacement vector in intra-frame block copy is called block displacement vector (BV); 3) The displacement vector in intra-frame string copy is called string displacement vector (String Vector, SV) ).
  • Motion Vector Motion Vector
  • BV block displacement vector
  • String Vector String Vector
  • inter-frame prediction uses the correlation in the video time domain to predict the pixels of the current image using pixels adjacent to the encoded image to achieve the purpose of effectively removing video time domain redundancy and effectively saving coding residual data.
  • bits P represents the current frame
  • Pr represents the reference frame
  • B represents the current coding block
  • Br represents B's reference block.
  • the coordinates of B' in the reference frame are the same as the coordinates of B in the current frame.
  • the coordinates of Br are (x r , y r ), and the coordinates of B' are (x, y).
  • inter-frame prediction includes two MV prediction technologies: Merge and Advanced Motion Vector Prediction (AMVP).
  • Merge mode will create a MV candidate list for the current prediction unit (PU), in which there are 5 candidate MVs (and their corresponding reference images). Traverse these five candidate MVs and select the one with the smallest rate-distortion cost as the optimal MV. If the codec builds the candidate list in the same way, the encoder only needs to transmit the index of the optimal MV in the candidate list.
  • HEVC's MV prediction technology also has a skip mode, which is a special case of Merge mode. After finding the optimal MV through Merge mode, if the current block and the reference block are basically the same, then there is no need to transmit For residual data, you only need to transmit the MV index and a skip flag.
  • AMVP mode uses the MV correlation of neighboring blocks in the spatial and temporal domains to build a candidate prediction MV list for the current PU.
  • the AMVP candidate MV list also includes both air domain and time domain situations. The difference is that the length of the AMVP list is only 2.
  • Intra-frame block copy is an encoding tool adopted in the HEVC Screen Content Coding (SCC) extension, which significantly improves the encoding efficiency of screen content.
  • SCC Screen Content Coding
  • IBC technology is also adopted to improve the performance of screen content encoding. IBC uses the spatial correlation of screen content video and uses the pixels of the encoded image on the current image to predict the pixels of the current block to be encoded, which can effectively save money. The number of bits required to encode a pixel. As shown in Figure 6, the displacement between the current block and its reference block in IBC is called block displacement vector (Block Vector, BV).
  • Block Vector Block Vector
  • the IBC mode uses a global reference range scheme, that is, the reconstructed area of the current frame is allowed to be used as a reference block for the current block.
  • IBC uses off-chip memory to store reference samples, the following restrictions need to be added to solve potential hardware implementation issues of IBC:
  • the location of the reference block needs to meet the hardware writeback delay limit. For example, the area of 256 reconstructed samples in the horizontal direction of the current block is not allowed to be used as a reference block.
  • the reference range of IBC consists of two parts, called the global reference range and the local reference range.
  • the global reference range is the reference range allowed in AV1;
  • the local reference range is the newly added reference range, whose size can be, for example, 64 ⁇ 64 (that is, the SB area where the current block is located).
  • the pixel samples of this reference range are stored in the additional in on-chip memory, so there is no need to disable the loop filter when using only this reference range.
  • IBC allows the use of different reference ranges. For example, for key frames, IBC allows the use of global reference ranges and local reference ranges. For non-key frames, IBC only allows the use of local reference ranges.
  • the local reference range can have different sizes in different implementations. For example, in addition to 64 ⁇ 64, it can also be 128 ⁇ 128, etc.
  • the value of the block vector has a large change. For example, when the reference block is located in the local reference range, the absolute value of the block vector will be less than 64; and when the reference block is located in the global reference range, the absolute value of the block vector will be greater than 64.
  • the default prediction block vectors all point to the global reference range, without taking into account the situation that the current block is in the local reference range. For reference blocks within the local reference range, the default prediction block vector cannot provide better prediction and will result in larger block vector coding overhead.
  • FIG. 9 shows a flowchart of a video decoding method provided by an embodiment of the present application.
  • the video decoding method can be executed by a device with computing processing functions, such as a terminal device or a server.
  • the video decoding method at least includes the following steps:
  • Step S910 Generate a prediction vector candidate list based on the displacement vector of the decoded block in which the reference frame is the current frame;
  • Step S920 Select the prediction vector of the current block to be decoded from the prediction vector candidate list
  • Step S930 Decode the current block based on the prediction vector of the current block.
  • the technical solution of the embodiment shown in Figure 9 can construct a more suitable prediction vector candidate list based on the displacement vector of the decoded block of the current frame based on the reference frame, so as to ensure that a more accurate prediction vector is selected from it, which is beneficial to improving coding performance.
  • the technical solution of the embodiment shown in Figure 9 can be used to derive a "default" prediction vector, that is, only when each component of the prediction block vector of the current block is 0 is derived through the fixed rules in the standard.
  • the prediction vector is derived using the method shown in Figure 9.
  • the technical solution of the embodiment shown in Figure 9 can also be directly used.
  • steps S910 to S930 shown in Figure 9 are described in detail below:
  • step S910 a prediction vector candidate list is generated based on the displacement vector of the decoded block whose reference frame is the current frame.
  • the displacement vector may have different names.
  • the displacement vector in inter-frame prediction may be called the motion displacement vector MV
  • the displacement vector in intra-frame block copying The vector is called the block displacement vector BV
  • the displacement vector in intra-frame string copy is called the string displacement vector SV.
  • a prediction vector candidate list may be constructed based on the displacement vectors of decoded blocks adjacent to the current block.
  • the displacement vector of the decoded block adjacent to the current block can be obtained from the displacement vector of the decoded block whose reference frame is the current frame, and then the decoded blocks adjacent to the current block can be obtained in the set order.
  • the displacement vectors of the blocks are sorted to generate a first displacement vector list, and then a prediction vector candidate list is generated based on the first displacement vector list.
  • the first displacement vector list can be used as a prediction vector candidate list.
  • the decoded blocks adjacent to the current block may include at least one of the following: a decoded block located n 1 rows above the current block, a decoded block located n 2 columns left of the current block; where n 1 and n 2 are positive integers.
  • adjacent decoded blocks may be decoded blocks in 3 rows above the current block or in 3 columns to the left, and the basic unit of each row or column may be 8 ⁇ 8 in size.
  • the information of the displacement vector is usually stored in 4 ⁇ 4 units. In the implementation, multiple displacement vectors can be obtained by searching through an 8 ⁇ 8 unit, and for different rows or columns, the search can obtain The number of displacement vectors can be different.
  • the setting order may be the decoding order of decoded blocks, the scanning order of decoded blocks, and the weight corresponding to the displacement vector.
  • the weight corresponding to the displacement vector may be associated with at least one of the following factors: the number of repetitions of the displacement vector, the block size corresponding to the displacement vector, and the block position corresponding to the displacement vector.
  • the displacement vector repeats more times, the greater the weight corresponding to the displacement vector, the higher the order in the first displacement vector list; if the block corresponding to the displacement vector is smaller, then the displacement vector corresponds to a smaller block.
  • the greater the corresponding weight the higher the order in the first displacement vector list; if the position of the block corresponding to the displacement vector is closer to the current block, then the greater the weight corresponding to the displacement vector, the higher the order in the first displacement vector list.
  • the order in the list is also higher.
  • a prediction vector candidate list may be constructed based on the displacement vectors of historical decoded blocks.
  • the displacement vector of the historical decoded block can be obtained from the displacement vector of the decoded block whose reference frame is the current frame, and then the displacement vector of the historical decoded block can be obtained in a first-in, first-out manner according to the set order. Added to a queue of a set length to generate a second displacement vector list, and then generate a prediction vector candidate list based on the second displacement vector list.
  • the second displacement vector list can be used as a prediction vector candidate list.
  • the queue length is 3, then displacement vector 1, displacement vector 2 and displacement vector 3 can be stored in the set order.
  • the displacement vector in the queue becomes : Displacement vector 2, displacement vector 3 and displacement vector 4; if a new displacement vector 5 needs to be added, the displacement vectors in the queue become: displacement vector 3, displacement vector 4 and displacement vector 5.
  • the setting order may be the decoding order of decoded blocks, the scanning order of decoded blocks, and the weight corresponding to the displacement vector.
  • the weight corresponding to the displacement vector may be associated with at least one of the following factors: the number of repetitions of the displacement vector, the block size corresponding to the displacement vector, and the block position corresponding to the displacement vector.
  • the displacement vector repeats more times, the greater the weight corresponding to the displacement vector, the higher the order in the first displacement vector list; if the block corresponding to the displacement vector is smaller, then the displacement vector corresponds to a smaller block.
  • the greater the corresponding weight the higher the order in the first displacement vector list; if the position of the block corresponding to the displacement vector is closer to the current block, then the greater the weight corresponding to the displacement vector, the higher the order in the first displacement vector list.
  • the order in the list is also higher.
  • the same displacement vector that already exists in the queue is deleted.
  • the queue stores displacement vector 1, displacement vector 2 and displacement vector 3.
  • the displacement vector 4 is the same as the displacement vector 2, then the displacement vector 2 can be deleted from the queue.
  • the resulting queue becomes: displacement vector 1, displacement vector 3, and displacement vector 4.
  • a second displacement vector list may correspond to at least one area to be decoded, and the area to be decoded includes one of the following: a maximum coding block SB where the current block is located, a row in the maximum coding block SB where the current block is located , the tile where the current block is located.
  • a second displacement vector list corresponds to one SB, or a second displacement vector list corresponds to multiple SBs.
  • the displacement vector in the second displacement vector list corresponding to the target area to be decoded ie, the designated area to be decoded
  • Adding a displacement vector to the second displacement vector list means that a maximum number can be set for the second displacement vector list corresponding to the area to be decoded. When the maximum number is exceeded, the addition of displacement vectors to the corresponding second displacement vector list can be stopped.
  • the number of operations of adding a displacement vector to the corresponding second displacement vector list can also be recorded.
  • the operation of adding a displacement vector to the corresponding second displacement vector list is stopped. Add new displacement vector. That is, this embodiment determines whether to stop adding displacement vectors to the corresponding second displacement vector list by recording the number of operations of adding displacement vectors to the second displacement vector list.
  • a prediction vector candidate list may be constructed based on the displacement vectors of decoded blocks adjacent to the current block and the displacement vectors of historical decoded blocks.
  • the displacement vector of the decoded block adjacent to the current block can be obtained from the displacement vector of the decoded block whose reference frame is the current frame, and from the displacement vector of the decoded block whose reference frame is the current frame, Obtain the displacement vector of the historical decoded block, and then generate a prediction vector candidate list based on the acquired displacement vector of the adjacent decoded block and the displacement vector of the historical decoded block.
  • the acquired displacement vectors may be arranged in a set order to generate the Predictor vector candidate list. Duplicate displacement vectors can also be deleted during this process.
  • the displacement vectors that are not within the preset area may also be deleted,
  • the preset area includes at least one of the following: the current image, the current slice, the current global reference range, and the current local reference range.
  • the set order when arranging the obtained displacement vectors in a set order, may be the decoding order of decoded blocks, the scanning order of decoded blocks, the type of decoded blocks, the displacement vector the corresponding weight.
  • the weight corresponding to the displacement vector may be associated with at least one of the following factors: the number of repetitions of the displacement vector, the block size corresponding to the displacement vector, and the block position corresponding to the displacement vector.
  • a decoded block can be a decoded block adjacent to the current block (i.e., the coding block in the aforementioned first displacement vector list), or it can be a historical decoded block (i.e., the coding block in the aforementioned second displacement vector list). ).
  • the type of the decoded block is used to indicate whether the decoded block is a decoded block adjacent to the current block (that is, it represents a coded block in the aforementioned first displacement vector list) or a historical decoded block (that is, it represents the aforementioned coding block in the second displacement vector list).
  • the displacement vectors of the decoded blocks adjacent to the current block can be arranged before the displacement vectors of the historical decoded blocks.
  • the displacement vectors of the decoded blocks adjacent to the current block can also be arranged before the displacements of the historical decoded blocks. After vector.
  • the displacement vector of the decoded block adjacent to the current block can also be obtained from the displacement vector of the decoded block whose reference frame is the current frame, and the decoded blocks adjacent to the current block can be processed in a set order.
  • the displacement vectors of the blocks are sorted to generate a first displacement vector list; then the displacement vectors of the historical decoded blocks are obtained from the displacement vectors of the decoded blocks whose reference frame is the current frame, and the historical decoded blocks are sorted in the set order.
  • the displacement vectors are added to the queue of set length in a first-in-first-out manner to generate a second displacement vector list; and then a prediction vector candidate list is generated based on the first displacement vector list and the second displacement vector list.
  • the process of generating the prediction vector candidate list may be to merge the first displacement vector list and the second displacement vector list, and delete duplicate displacement vectors, to generate a candidate list of predicted vectors.
  • the displacement vectors in the first displacement vector list when merging the first displacement vector list and the second displacement vector list, can be arranged before the displacement vectors in the second displacement vector list; of course, it can also Arrange the displacement vectors in the first displacement vector list after the displacement vectors in the second displacement vector list.
  • the preset area includes at least one of the following: the current image, the current slice, the current global reference range, and the current local reference range; then, in the process of merging the first displacement vector list and the second displacement vector list, delete those that are not in the preset area. Let the displacement vector in the area.
  • step S920 the prediction vector of the current block to be decoded is selected from the prediction vector candidate list.
  • the process of selecting the prediction vector of the current block from the prediction vector candidate list may be to obtain the prediction vector index information from the code stream, and then select the corresponding prediction vector from the prediction vector candidate list based on the prediction vector index information. Select a prediction vector at the position as the prediction vector of the current block.
  • the prediction vector index information may employ context-based multi-symbol arithmetic encoding.
  • the code stream may also contain a maximum value of prediction vector index information.
  • the maximum value may be located in a sequence header, an image header, or a slice header.
  • the maximum value may represent the maximum amount of prediction vector index information.
  • the maximum values corresponding to different displacement vector prediction modes are the same or different.
  • the process of selecting the prediction vector of the current block from the prediction vector candidate list may also be to select a prediction vector from the prediction vector candidate list as the prediction vector of the current block according to a set selection strategy.
  • the i-th (i is a positive integer) prediction vector can be selected in order as the prediction vector of the current block, or one can be selected randomly.
  • step S930 the current block is decoded based on the prediction vector of the current block.
  • the process of decoding the current block based on the prediction vector of the current block in step S930 may be to use the prediction vector of the current block as the displacement vector of the current block to decode the current block.
  • the process of decoding the current block based on the prediction vector of the current block in step S930 may be to decode the vector residual of the current block from the code stream, and obtain the vector residual of the current block based on the vector residual and the prediction of the current block.
  • the vector calculates the displacement vector of the current block, and then decodes the current block according to the displacement vector of the current block.
  • FIG 11 shows a flow chart of a video decoding method according to an embodiment of the present application.
  • the video decoding method can be executed by a device with computing processing functions, such as a terminal device or a server.
  • the video decoding method at least includes the following steps:
  • Step S1110 decode the code stream to obtain the reference range type indication information.
  • the reference range type indication information is used to indicate the target reference range used in the intra-frame block copy mode.
  • the target reference range includes the global reference range and the local reference range. at least one.
  • the reference range category indication information can be implemented through two flag bits.
  • the reference range category indication information can include a first flag bit and a second flag bit.
  • the first flag bit is used to indicate the intra-frame block copy mode. Whether the global reference range is allowed to be used, the second flag bit is used to indicate whether the intra block copy mode allows the use of the local reference range.
  • the value of the first flag bit is 1, it means that the intra-block copy mode allows the use of the global reference range; the value of the first flag bit is 0, it means that the intra-block copy mode does not allow the use of the global reference range. Reference range. If the value of the second flag bit is 1, it means that the intra block copy mode allows the use of the local reference range; if the value of the second flag bit is 0, it means that the intra block copy mode does not allow the use of the local reference range.
  • the reference range category indication information can be implemented through a flag bit.
  • the reference range category indication information can include a third flag bit, and the third flag bit is a first value (such as 1).
  • the third flag bit is a second value (for example, 0), it indicates that the intra-block copy mode allows the use of the local reference range.
  • the reference range category indication information may include a fourth flag bit.
  • the fourth flag bit is a first value (such as 1), it indicates that the intra block copy mode allows the use of the global reference range and the local reference range;
  • the four flag bits are the second value (for example, 0), it indicates that the intra block copy mode allows the use of the local reference range.
  • Step S1120 Generate a prediction vector candidate list based on the displacement vector of the decoded block in which the reference frame is the current frame.
  • step S1110 and step S1120 does not limit the execution order of step S1110 and step S1120.
  • step S1120 based on the displacement vector of the decoded block whose reference frame is the current frame, the process of generating a prediction vector candidate list may be: from the displacement vector of the decoded block whose reference frame is the current frame. , obtain the target decoded block whose corresponding reference block is within the target reference range and adopts intra block copy mode, and then generate a prediction vector candidate list based on the displacement vector of the target decoded block.
  • the process of generating a prediction vector candidate list based on the reference frame being the displacement vector of the decoded block of the current frame may be: based on the reference frame being the displacement vector of the decoded block of the current frame, Calculate the reference block of the current block, then determine the target reference block within the target reference range among the reference blocks of the current block, and then generate a prediction vector candidate list based on the displacement vector of the decoded block corresponding to the target reference block.
  • the position information of the reference block of the current block may be determined according to the coordinates of the current block and the displacement vector of the decoded block. For example, based on the abscissa coordinate of the current block and the horizontal component of a displacement vector, the abscissa coordinate of a corresponding reference block can be calculated; based on the ordinate of the current block and the vertical component of a displacement vector, the ordinate of a corresponding reference block can be calculated. coordinate.
  • the reference range category indication information may be image-level reference range category indication information or slice-level reference range category indication information. Then if the number of displacement vectors included in the prediction vector candidate list does not reach the set number, Then, the preset block vector can be filled in the prediction vector candidate list according to the image-level reference range category indication information or the slice-level reference range category indication information.
  • At least one of the following block vectors can be selected to fill the prediction vector candidate list: (-sb_w-D,0), (0,-sb_h), (sb_x-b_w -cur_x-D,0), (0,sb_y-b_h-cur_y), (-M ⁇ sb_w-D,-N ⁇ sb_h).
  • the precision of these block vectors may be at the whole pixel level, and different precision representations may be used during implementation.
  • At least one of the following block vectors can be selected to fill the predictor vector candidate list: (-b_w,0), (0,-b_h), (-b_w,-b_h), (-2 ⁇ b_w,0), (0,-2 ⁇ b_h), (0,0), (0,-vb_w), (-vb_h,0), (-vb_w,-vb_h); where b_w represents The width of the current block; b_h represents the height of the current block; vb_w represents the preset block width, such as 64, 32, 16, 8 or 4; vb_h represents the preset block height, such as 64, 32, 16, 8 or 4.
  • the precision of these block vectors may be at the whole pixel level, and different precision representations may be used during implementation.
  • At least one of the above block vectors can be selected for filling.
  • candidate prediction block vectors that meet any of the following conditions can also be selected for filling:
  • cur_x represents the abscissa of the upper left corner of the current block
  • cur_y represents the ordinate of the upper left corner of the current block
  • b_w represents the width of the current block
  • b_h represents the height of the current block
  • bvpi_x represents the horizontal component of the i-th candidate prediction block vector
  • bvpi_y Represents the vertical component of the i-th candidate prediction block vector
  • min_x and min_y represent the coordinates of the upper left corner of the slice where the current block is located
  • max_x and max_y represent the global coordinates in the row where the specified maximum coding block is located.
  • the coordinates of the lower right corner of the reference range specifying the largest coding block as the largest coding block where the current block is located; if the target reference range is a local reference range, min_x and min_y represent the upper left corner coordinates of the local reference range where the current block is located, max_x and max_y represent The coordinates of the lower right corner of the local reference range where the current block is located.
  • the following operations can be performed:
  • Step S1130 Select a prediction vector corresponding to the target reference range from the prediction vector candidate list.
  • the process of selecting the prediction vector corresponding to the target reference range from the prediction vector candidate list may be
  • the prediction vector index information is obtained by decoding from the code stream, and then a prediction vector is selected from a corresponding position in the prediction vector candidate list as the prediction vector of the current block according to the prediction vector index information.
  • the process of selecting a prediction vector corresponding to the target reference range from the prediction vector candidate list may also be to select a prediction vector corresponding to the target reference range from the prediction vector candidate list according to a set selection strategy.
  • the corresponding prediction vector is used as the prediction vector of the current block.
  • the i-th (i is a positive integer) prediction vector corresponding to the target reference range can be selected in order as the prediction vector of the current block, or one can be selected randomly.
  • Step S1140 Decode the current block based on the prediction vector of the current block.
  • the process of decoding the current block based on the prediction vector of the current block may be to use the prediction vector of the current block as the displacement vector of the current block to decode the current block.
  • the vector residual of the current block may be obtained by decoding from the code stream, the displacement vector of the current block may be calculated based on the vector residual and the prediction vector of the current block, and then the current block may be decoded based on the displacement vector of the current block.
  • the displacement vector prediction mode indication information can also be obtained by decoding from the code stream. On this basis, if the displacement vector prediction mode indication information indicates that the current block adopts the Skip prediction mode, the prediction vector of the current block is used as the displacement vector of the current block, and the decoding process of the residual coefficient of the current block is skipped to The current block is decoded;
  • the displacement vector prediction mode indication information indicates that the current block adopts the NearMV prediction mode, then the prediction vector of the current block is used as the displacement vector of the current block, and the residual coefficient of the current block is decoded to decode the current block;
  • the displacement vector residual of the current block is obtained by decoding from the code stream, and the displacement vector of the current block is calculated based on the displacement vector residual and the prediction vector of the current block, and The residual coefficient of the current block is decoded to decode the current block.
  • the process of decoding to obtain the displacement vector residual of the current block from the code stream may be to directly decode the symbol and value of the displacement vector of the current block from the code stream; or it may also be to obtain the symbol and value of the displacement vector of the current block from the code stream; or it may be to obtain the displacement vector residue of the current block from the code stream.
  • the joint type indication information (joint_type) is obtained through decoding.
  • the joint type indication information is used to indicate the consistency of the components between the displacement vector residual of the current block and the prediction vector of the current block. That is, the joint type indication information can indicate the current Whether the components between the displacement vector residual of the block and the prediction vector of the current block are consistent, the displacement vector residual of the current block is obtained by decoding according to the joint type indication information.
  • the encoding end does not need to Encode the horizontal component of the displacement vector residual in the code stream; if the joint type indication information indicates that the horizontal component between the displacement vector residual and the prediction vector is inconsistent and the vertical component is consistent, then only the horizontal component needs to be decoded from the code stream.
  • the encoding end does not need to encode the vertical component of the displacement vector residual in the code stream; if the joint type indication information indicates that the horizontal and vertical components between the displacement vector residual and the prediction vector are consistent, then There is no need to decode the displacement vector residual from the code stream. In this case, the encoding end does not need to encode the displacement vector residual in the code stream; if the joint type indication information indicates the horizontal and vertical components between the displacement vector residual and the prediction vector If they are not consistent, then the horizontal and vertical components of the displacement vector residual need to be decoded from the code stream.
  • FIG. 12 shows a flowchart of a video encoding method according to an embodiment of the present application.
  • the video encoding method can be executed by a device with computing processing functions, such as a terminal device or a server.
  • the video encoding method at least includes step S1210 to step S1230. The details are as follows:
  • step S1210 generate a prediction vector candidate list based on the displacement vector of the encoded block whose reference frame is the current frame;
  • step S1220 select the prediction vector of the current block to be encoded from the prediction vector candidate list
  • step S1230 the current block is encoded based on the prediction vector of the current block.
  • selecting the prediction vector of the current block to be encoded from the prediction vector candidate list includes: decoding the code stream to obtain the prediction vector index information;
  • a prediction vector is selected from a corresponding position in the prediction vector candidate list as the prediction vector of the current block to be encoded.
  • prediction vector index information is obtained by decoding from the code stream, including:
  • the prediction vector index information is decoded from the code stream to obtain the prediction vector index information.
  • the prediction vector index information uses context-based multi-symbol arithmetic encoding.
  • the code stream contains the maximum value of the prediction vector index information, and the maximum value is located in the sequence header, image header or slice header;
  • the maximum values corresponding to different displacement vector prediction modes are the same or different.
  • selecting the prediction vector of the current block to be encoded from the prediction vector candidate list includes:
  • a predictor vector is selected from the predictor candidate list as the predictor vector of the current block to be encoded.
  • a prediction vector candidate list is generated based on the displacement vector of the coded block whose reference frame is the current frame, including:
  • a prediction vector candidate list is generated.
  • the adjacent coded blocks include at least one of the following: a coded block located n 1 rows above the current block, a coded block located n 2 columns to the left of the current block; where n 1 and n 2 is a positive integer.
  • a prediction vector candidate list is generated based on the displacement vector of the coded block whose reference frame is the current frame, including:
  • the displacement vectors of the historical coded blocks are added to the queue of the set length in a first-in, first-out manner to obtain the second displacement vector list;
  • a prediction vector candidate list is generated based on the second displacement vector list.
  • the video encoding method further includes:
  • a second displacement vector list corresponds to at least one region to be encoded, and the region to be encoded includes one of the following:
  • the largest coding block in which the current block is located the row in the largest coding block in which the current block is located, and the slice in which the current block is located.
  • the video encoding method further includes:
  • a prediction vector candidate list is generated based on the displacement vector of the coded block whose reference frame is the current frame, including:
  • a prediction vector candidate list is generated based on the first displacement vector list and the second displacement vector list.
  • generating a prediction vector candidate list based on the first displacement vector list and the second displacement vector list includes:
  • the video encoding method further includes:
  • the preset area includes at least one of the following: the current image, the current slice, the current global reference range, and the current local reference range.
  • the setting order includes one of the following: a coding order of coded blocks, a scanning order of coded blocks, a type of coded blocks, and a weight of a displacement vector;
  • the weight is associated with at least one of the following factors: the number of repetitions of the displacement vector, the block size corresponding to the displacement vector, and the block position corresponding to the displacement vector.
  • the video encoding method further includes:
  • the reference range category indication information is obtained by decoding from the code stream.
  • the reference range category indication information is used to indicate the target reference range used in the intra-frame block copy mode.
  • the target reference range includes at least one of a global reference range and a local reference range;
  • a prediction vector corresponding to the target reference range is selected as the prediction vector of the current block to be encoded.
  • a prediction vector candidate list is generated based on the displacement vector of the coded block whose reference frame is the current frame, including:
  • a prediction vector candidate list is generated based on the displacement vector of the coded block whose reference frame is the current frame, including:
  • a prediction vector candidate list is generated based on the displacement vector of the coded block corresponding to the target reference block.
  • the reference range category indication information is image-level reference range category indication information or slice-level reference range category indication information; the video encoding method further includes:
  • the preset block vectors are filled in the prediction vector candidate list according to the image-level reference range category indication information or the slice-level reference range category indication information.
  • the video encoding method further includes: decoding from the code stream to obtain the displacement vector prediction mode indication information;
  • Encoding the current block based on the prediction vector of the current block includes:
  • the prediction vector of the current block is used as the displacement vector of the current block, and the encoding process of the residual coefficient of the current block is skipped;
  • the prediction vector of the current block is used as the displacement vector of the current block, and the residual coefficient of the current block is encoded
  • the displacement vector residual of the current block is obtained by decoding from the code stream, and the displacement vector of the current block is determined based on the displacement vector residual and the prediction vector of the current block. , and encode the residual coefficient of the current block.
  • decoding the code stream to obtain the displacement vector prediction mode indication information includes: if it is determined that the displacement vector prediction mode indication information needs to be decoded according to the length of the predictor candidate list, decoding the code stream to obtain the displacement vector prediction Mode indication information.
  • the displacement vector residual of the current block is obtained by decoding from the code stream, including:
  • the joint type indication information is obtained by decoding from the code stream.
  • the joint type indication information is used to indicate the consistency of the components between the displacement vector residual of the current block and the prediction vector of the current block. According to the joint type indication information, the joint type indication information is decoded to obtain the current block's Displacement vector residual.
  • the technical solution of the embodiment of the present application can construct a more suitable prediction vector candidate list based on the displacement vector of the decoded block of the current frame based on the reference frame, so as to ensure that a more accurate prediction vector is selected from it, which is beneficial to improving coding. performance.
  • the displacement vector of the current block when decoding the current block, needs to be decoded.
  • the following description takes the current block as an IBC block as an example.
  • the displacement vector of the IBC block is the block vector bv(bv_x, bv_y).
  • bvp_mode may be included in the code stream to indicate the block vector prediction mode used.
  • the following prediction modes may be used alone or in combination:
  • Block vector prediction mode includes Skip prediction mode.
  • the bv of the current block is equal to the prediction block vector (Block Vector Prediction, bvp), and the residual coefficient of the current block defaults to 0, and no decoding is required.
  • Block vector prediction mode includes Near Motion Vector (NearMV) prediction mode.
  • NearMV Near Motion Vector
  • the bv of the current block is equal to bvp, but the residual coefficient of the current block needs to be decoded.
  • the block vector prediction mode includes the new motion vector (New Motion Vector, NewMV) prediction mode.
  • bvd Block Vector Difference, block vector residual
  • the bv of the current block bvd + bvp, At the same time, the residual coefficient of the current block needs to be decoded.
  • direct decoding can be used when decoding bvd, that is, decoding the symbol and absolute value of bvd from the code stream. Or you can also divide the decoding method of bvd into several categories, and then decode joint_type first to confirm the category, and then decode bvd. For example, there are four situations: the components of bvd and bvp are consistent, and there is no need to decode bvd; the horizontal components of bvd and bvp are consistent, but the vertical components are inconsistent.
  • the bvp of the current block can be derived from the predicted block vector candidate list.
  • the predicted block vector index bvp_index can be decoded, and then derived according to the position of the bvp indicated by bvp_index in the predicted block vector candidate list.
  • the bvp of the current block or you can also export bvp according to a fixed rule sequence without decoding index, such as checking the first 2 candidate bvp in the predicted block vector candidate list, and then export the first candidate bvp that is not 0 as the current block bvp.
  • the code stream contains reference range category indication information ibc_ref_type used to indicate the reference block of the current IBC block
  • the bvp of the corresponding category needs to be used. For example, if it indicates that the reference block of the current IBC block is within the global reference range, then the bvp corresponding to the global reference range needs to be used; if it indicates that the reference block of the current IBC block is within the local reference range, then the bvp corresponding to the local reference range needs to be used. Corresponding bvp.
  • ibc_ref_type belongs to block-level reference range category indication information.
  • the code stream can also contain image-level reference range category indication information, or slice-level reference range category indication information to respectively indicate the reference of the current image or IBC block in the current slice. scope.
  • the indication can also be provided through multi-level reference range category indication information, such as image-level reference range category indication information and block-level reference range category indication information.
  • the construction method of the prediction block vector candidate list bvp_list is as follows:
  • the predicted block vector candidate list bvp_list may include block vector information of adjacent decoded blocks in the spatial domain, that is, the spatial based block vector prediction list (SBVP).
  • SBVP spatial based block vector prediction list
  • an SBVP with a length of N1 can be constructed, and the BVs of adjacent decoded IBC blocks in the spatial domain are recorded in a set order.
  • the adjacent decoded IBC blocks in the spatial domain include decoded blocks in rows N1 above the current block or columns N2 to the left, and N1 and N2 are positive integers.
  • the setting order may be the decoding order of adjacent decoded IBC blocks in the spatial domain, the scanning order, the weight corresponding to the displacement vector of the adjacent decoded IBC blocks in the spatial domain, etc.
  • the weight corresponding to the displacement vector may be associated with at least one of the following factors: the number of repetitions of the displacement vector, the block size corresponding to the displacement vector, and the block position corresponding to the displacement vector.
  • the SBVP can be constructed according to the reference range type of the bv (such as global reference range, local reference range, etc.), for example, it can only include bvs whose reference blocks are within the corresponding reference range.
  • the predicted block vector candidate list bvp_list may include block vector information of historical decoded blocks, that is, history based block vector prediction list (HBVP).
  • HBVP history based block vector prediction list
  • an HBVP with a length of N2 can be constructed, and the BV of the decoded IBC blocks (or the BV of the decoded block whose reference frame is the current frame) is recorded in a set order. After each IBC block is decoded, the The bvs of the decoded block are added to the HBVP in First Input First Output (FIFO) order, where the bvs adjacent to the current block in decoding order have higher priority.
  • FIFO First Input First Output
  • duplication checking can be performed when inserting bv into HBVP. If there is a BV in the list that is duplicated with the new BV to be inserted, the duplicate BV in HBVP will be deleted.
  • HBVP may have a limit on the number of checks. For a SB, SB row or tile, when the number of BVs added to HBVP exceeds a preset value, the BVs of decoded blocks may be stopped being added to HBVP. And HBVP can also be reset by pressing SB, SB row or tile.
  • the bv in HBVP can also have different arrangement orders, such as according to the decoding order of the decoded IBC blocks, the scanning order, the weight corresponding to the displacement vector of the decoded IBC blocks, etc.
  • the weight corresponding to the displacement vector may be associated with at least one of the following factors: the number of repetitions of the displacement vector, the block size corresponding to the displacement vector, and the block position corresponding to the displacement vector.
  • the prediction block vector candidate list bvp_list can also be composed of a combination of the two.
  • bvp_list is constructed by SBVP and HBVP, duplication checking can be performed so that the list does not contain duplicate instances.
  • the code stream contains reference range category indication information (which can be block-level reference range category indication information ibc_ref_type, or image-level or slice-level reference range category indication information), then the following method can be used to construct bvp_list:
  • the code stream contains one or more of the reference range category indication information, bvp_mode and bvp_index.
  • the code stream includes ibc_ref_type, bvp_mode and bvp_index.
  • decoding ibc_ref_type If the value of ibc_ref_type is 0, it indicates that the reference block of the current IBC block is in the local reference range, otherwise the reference block of the current IBC block is in the global reference range.
  • the maximum length of the constructed bvp_list is 8, and during construction, only candidates corresponding to ibc_ref_type are used to construct the prediction block vector candidate list. And it is allowed to use candidate bvs that are adjacent in the spatial domain or in historical coding order. For example, you can first add the candidate bv in SBVP to the bvp_list. If the bvp_list list is not filled, then add the candidate bv in HBVP.
  • the code stream includes bvp_mode and bvp_index.
  • bvp_list there are two block vector prediction modes, including NearMV mode and NewMV mode. You can confirm the position of bvp in bvp_list based on bvp_index, and then determine the bvp.
  • the maximum length of the constructed bvp_list is 8. During specific construction, only the candidate bvs in the SBVP can be used.
  • the code stream includes bvp_index.
  • the block vector prediction mode has only one prediction mode, NewMV mode. You can confirm the position of bvp in bvp_list based on bvp_index, and then determine the bvp.
  • the maximum length of the constructed bvp_list is 8. During specific construction, only the candidate bvs in the SBVP can be used.
  • the code stream includes a flag indicating the reference range, bvp_mode and bvp_idx.
  • the flag indicating the reference range may be allowed_global_intrabc and allowed_local_intrabc, which respectively indicate whether the current image or the block in the current slice is allowed to use the global reference range or the local reference range.
  • allowed_global_intrabc For example, if the value of allowed_global_intrabc is 1, it indicates that the use of the global reference range is allowed; if the value of allowed_global_intrabc is 0, it indicates that the use of the global reference range is not allowed. If the value of allowed_local_intrabc is 1, it indicates that the local reference range is allowed to be used; if the value of allowed_local_intrabc is 0, it indicates that the use of the local reference range is not allowed.
  • the decoding end also includes:
  • Decode bvp_mode to confirm the mode used. For example, it can include two modes, 0 means NewMV mode, and 1 means NearMV mode.
  • the maximum length of the constructed bvp_list is 4, and the bvp_list is composed of SBVP and HBVP. If the list length is less than 4, the bvp_list is filled according to the reference range, as follows:
  • the technical solution of the embodiment of the present application can select an appropriate default prediction vector derivation method according to the reference range type, so as to select the corresponding prediction vector for different reference ranges, thereby improving the accuracy of vector prediction and reducing the error of the displacement vector.
  • Encoding cost improve encoding performance.
  • a more suitable prediction vector candidate list can also be constructed based on the displacement vector of the decoded block of the current frame based on the reference frame to ensure that a more accurate prediction vector is selected from it, which is beneficial to improving coding performance.
  • FIG. 13 shows a block diagram of a video decoding device according to an embodiment of the present application.
  • the video decoding device can be provided in a device with computing processing functions, such as a terminal device or a server.
  • a video decoding device 1300 includes: a first generation unit 1302, a first selection unit 1304, and a first processing unit 1306.
  • the first generation unit 1302 is configured to generate a prediction vector candidate list according to the displacement vector of the decoded block of the current frame whose reference frame is the current frame; the first selection unit 1304 is configured to select the current block to be decoded from the prediction vector candidate list. prediction vector; the first processing unit 1306 is configured to perform decoding processing on the current block based on the prediction vector of the current block.
  • the first selection unit 1304 is configured to: decode the code stream to obtain prediction vector index information, and select a prediction vector from a corresponding position in the prediction vector candidate list according to the prediction vector index information. as the prediction vector of the current block.
  • the first selection unit 1304 is further configured to: determine whether the predictor vector index information needs to be decoded according to the length of the predictor vector candidate list; if it is determined that the predictor vector index information needs to be decoded, The prediction vector index information is obtained by decoding in the code stream.
  • the prediction vector index information adopts context-based multi-symbol arithmetic coding.
  • the code stream contains the maximum value of the prediction vector index information, and the maximum value is located in the sequence header, image header or slice header; wherein, the maximum value corresponding to different displacement vector prediction modes The values are the same or different.
  • the first selection unit 1304 is configured to select a prediction vector from the prediction vector candidate list as the prediction vector of the current block according to the set selection strategy.
  • the first generation unit 1302 is configured to: obtain the displacement vector of the decoded block adjacent to the current block from the displacement vector of the decoded block whose reference frame is the current frame; according to the setting In sequence, the displacement vectors of decoded blocks adjacent to the current block are sorted to generate a first displacement vector list; and the prediction vector candidate list is generated according to the first displacement vector list.
  • the adjacent decoded blocks include at least one of the following: a decoded block located n 1 rows above the current block, a decoded block located n 2 columns left of the current block; wherein , n 1 and n 2 are positive integers.
  • the first generation unit 1302 is configured to: obtain the displacement vector of the historical decoded block from the displacement vector of the decoded block whose reference frame is the current frame; and convert the historical decoded block according to the set order.
  • the displacement vector of the decoded block is added to a queue of a set length in a first-in, first-out manner to generate a second displacement vector list; the prediction vector candidate list is generated based on the second displacement vector list.
  • the first generation unit 1302 is further configured to: when adding the displacement vector of the historical decoded block to the queue, if the same displacement vector already exists in the queue, delete Remove the same displacement vector that already exists in the queue.
  • one of the second displacement vector lists corresponds to at least one area to be decoded, and the area to be decoded includes one of the following: the largest coding block where the current block is located, the largest coding block where the current block is located, The row in the encoding block, the slice in which the current block is located.
  • the first generation unit 1302 is further configured to: if the displacement vector in the second displacement vector list corresponding to the target area to be decoded exceeds a set value, stop displacing data to the target area to be decoded. Add a displacement vector to the second displacement vector list.
  • the first generation unit 1302 is further configured to: if the number of times a displacement vector is added to the second displacement vector list corresponding to the target area to be decoded exceeds a set number of times, stop adding the displacement vector to the target area to be decoded. Add a displacement vector to the second displacement vector list corresponding to the region.
  • the first generation unit 1302 is configured to: obtain the displacement vector of the decoded block adjacent to the current block from the displacement vector of the decoded block whose reference frame is the current frame, and generate the displacement vector according to the setting. Sequentially sort the displacement vectors of decoded blocks adjacent to the current block to generate a first displacement vector list;
  • the prediction vector candidate list is generated based on the first displacement vector list and the second displacement vector list.
  • the first generation unit 1302 is configured to: merge the first displacement vector list and the second displacement vector list, and delete duplicate displacement vectors to generate the prediction vector candidate list .
  • the first generation unit 1302 is further configured to: detect whether there is a displacement vector that is not within a preset area in the first displacement vector list and the second displacement vector list, and the preset The area includes at least one of the following: the current image, the current slice, the current global reference range and the current local reference range; in the process of merging the first displacement vector list and the second displacement vector list, delete the The displacement vector within the preset area.
  • the setting order includes one of the following: the decoding order of decoded blocks, the scanning order of decoded blocks, the type of decoded blocks, and the weight corresponding to the displacement vector; wherein the weight and At least one of the following factors is associated: the number of repetitions of the displacement vector, the block size corresponding to the displacement vector, and the block position corresponding to the displacement vector.
  • the video decoding device further includes: a decoding unit configured to decode from the code stream to obtain reference range category indication information, where the reference range category indication information is used to indicate the target used in the intra block copy mode.
  • reference range the target reference range includes at least one of a global reference range and a local reference range; the first selection unit 1304 is configured to: select a prediction corresponding to the target reference range from the prediction vector candidate list Vector.
  • the first generation unit 1302 is configured to: from the displacement vector of the decoded block whose reference frame is the current frame, obtain the corresponding reference block that is within the target reference range and adopts an intra-frame block. Copy the target decoded block of the mode; generate the predictor vector candidate list according to the displacement vector of the target decoded block.
  • the first generation unit 1302 is configured to: calculate the reference block of the current block based on the reference frame being the displacement vector of the decoded block of the current frame; determine that the reference block of the current block is in the a target reference block within the target reference range; and generate the prediction vector candidate list according to the displacement vector of the decoded block corresponding to the target reference block.
  • the reference range category indication information is image-level reference range category indication information or slice-level reference range category indication information; the first generating unit 1302 is further configured to: if the prediction vector candidate list If the number of displacement vectors contained in the block vector does not reach the set number, then the preset block vector is filled in the prediction vector candidate list according to the image-level reference range category indication information or the slice-level reference range category indication information.
  • the video decoding device further includes: a decoding unit configured to decode the code stream to obtain the displacement vector prediction mode indication information; the first processing unit 1306 is configured to:
  • the prediction vector of the current block is used as the displacement vector of the current block, and the calculation of the residual coefficient of the current block is skipped.
  • the displacement vector prediction mode indication information indicates that the current block adopts the NearMV prediction mode, then the prediction vector of the current block is used as the displacement vector of the current block, and the residual coefficient of the current block is decoded, to decode the current block;
  • the displacement vector residual of the current block is obtained by decoding from the code stream. According to the displacement vector residual and the current block The prediction vector calculates the displacement vector of the current block, and decodes the residual coefficient of the current block to decode the current block.
  • the decoding unit is further configured to: determine whether the displacement vector prediction mode indication information needs to be decoded according to the length of the prediction vector candidate list; if it is determined that the displacement vector prediction mode indication information needs to be decoded, then The displacement vector prediction mode indication information is obtained by decoding the code stream.
  • the process by which the first processing unit 1306 decodes from the code stream to obtain the displacement vector residual of the current block includes: decoding from the code stream to obtain the displacement vector of the current block. the symbol and value; or
  • Joint type indication information is obtained by decoding from the code stream.
  • the joint type indication information is used to indicate whether the components between the displacement vector residual of the current block and the prediction vector of the current block are consistent. According to the joint type indication information, The type indication information is decoded to obtain the displacement vector residual of the current block.
  • FIG 14 shows a block diagram of a video encoding device according to an embodiment of the present application.
  • the video encoding device can be provided in a device with computing processing functions, such as a terminal device or a server.
  • a video encoding device 1400 includes: a second generation unit 1402, a second selection unit 1404, and a second processing unit 1406.
  • the second generation unit 1402 is configured to generate a prediction vector candidate list according to the displacement vector of the encoded block whose reference frame is the current frame; the second selection unit 1404 is configured to select the current block to be encoded from the prediction vector candidate list. prediction vector; the second processing unit 1406 is configured to perform encoding processing on the current block based on the prediction vector of the current block.
  • FIG. 15 shows a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present application.
  • the computer system 1500 includes a central processing unit (Central Processing Unit, CPU) 1501, which can be loaded into a random computer according to a program stored in a read-only memory (Read-Only Memory, ROM) 1502 or from a storage part 1508. Access the program in the memory (Random Access Memory, RAM) 1503 to perform various appropriate actions and processing, such as performing the method described in the above embodiment. In RAM 1503, various programs and data required for system operation are also stored.
  • CPU 1501, ROM 1502 and RAM 1503 are connected to each other through bus 1504.
  • An input/output (I/O) interface 1505 is also connected to bus 1504.
  • the following components are connected to the I/O interface 1505: an input part 1506 including a keyboard, a mouse, etc.; an output part 1507 including a cathode ray tube (Cathode Ray Tube, CRT), a liquid crystal display (Liquid Crystal Display, LCD), etc., and a speaker, etc. ; a storage part 1508 including a hard disk, etc.; and a communication part 1509 including a network interface card such as a Local Area Network (LAN) card, a modem, etc.
  • the communication section 1509 performs communication processing via a network such as the Internet.
  • Driver 1510 is also connected to I/O interface 1505 as needed.
  • Removable media 1511 such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive 1510 as needed, so that a computer program read therefrom is installed into the storage portion 1508 as needed.
  • the process described above with reference to the flowchart may be implemented as a computer software program.
  • embodiments of the present application include a computer program product including a computer program carried on a computer-readable storage medium, the computer program including a computer program for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network via communications portion 1509, and/or installed from removable media 1511.
  • CPU central processing unit
  • the computer-readable storage medium shown in the embodiments of the present application can be read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), erasable programmable read-only memory ( Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory, magnetic surface memory, optical disk, or CD-ROM; it can also include the above One or any combination of various devices.
  • Read-Only Memory Read-Only Memory
  • RAM Random Access Memory
  • EPROM Erasable Programmable Read-Only Memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • flash memory magnetic surface memory, optical disk, or CD-ROM; it can also include the above One or any combination of various devices.
  • the units involved in the embodiments of this application can be implemented in software or hardware, and the described units can also be provided in a processor. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
  • Embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium may be included in the electronic device described in the above embodiments; it may also exist independently without being assembled into the electronic device.
  • the computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiments.
  • the example embodiments described here can be implemented by software, or can be implemented by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , including several instructions to cause a computing device (which can be a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiment of the present application.
  • a non-volatile storage medium which can be a CD-ROM, U disk, mobile hard disk, etc.
  • a computing device which can be a personal computer, server, touch terminal, or network device, etc.

Landscapes

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

Abstract

本申请的实施例提供了一种视频编解码方法、装置、存储介质、电子设备及计算机程序产品。该视频解码方法包括:根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表;从所述预测矢量候选列表中选择待解码的当前块的预测矢量;基于所述当前块的预测矢量对所述当前块进行解码处理。

Description

视频编解码方法、装置、存储介质、电子设备及计算机程序产品
相关申请的交叉引用
本申请基于申请号为202210260543.1、申请日为2022年03月16日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本申请涉及计算机及通信技术领域,尤其涉及一种视频编解码方法、装置、存储介质、电子设备及计算机程序产品。
背景技术
在相关的音视频编解码技术中,如果码流中不包含当前块的预测矢量,那么可以导出默认的预测矢量,而这些默认的预测矢量如果选择不当,则会影响编码性能。
发明内容
本申请实施例提供了一种视频编解码方法、装置、计算机可读存储介质、电子设备及计算机程序产品,在一定程度上可以根据参考帧为当前帧的已解码块的位移矢量构建更适合的预测矢量候选列表,以保证从中选择出更为准确的预测矢量,有利于提升编码性能。
本申请实施例提供了一种视频解码方法,包括:根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表;从所述预测矢量候选列表中选择待解码的当前块的预测矢量;基于所述当前块的预测矢量对所述当前块进行解码处理。
本申请实施例提供了一种视频编码方法,包括:根据参考帧为当前帧的已编码块的位移矢量,生成预测矢量候选列表;从所述预测矢量候选列表中选择待编码的当前块的预测矢量;基于所述当前块的预测矢量对所述当前块进行编码处理。
本申请实施例提供了一种视频解码装置,包括:第一生成单元,配置为根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表;第一选择单元,配置为从所述预测矢量候选列表中选择待解码的当前块的预测矢量;第一处理单元,配置为基于所述当前块的预测矢量对所述当前块进行解码处理。
本申请实施例提供了一种视频编码装置,包括:第二生成单元,配置为根据参考帧为当前帧的已编码块的位移矢量,生成预测矢量候选列表;第二选择单元,配置为从所述预测矢量候选列表中选择待编码的当前块的预测矢量;第二处理单元,配置为基于所述当前块的预测矢量对所述当前块进行编码处理。
本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述实施例中所述的方法。
本申请实施例提供了一种电子设备,包括:一个或多个处理器;存储器,配置为存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述电子设备实现如上述实施例中所述的方法。
本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述提供的方法。
本申请实施例提供的技术方案可以带来如下有益效果:
通过根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表,进而从预测矢量候选列表中选择当前块的预测矢量,使得可以根据参考帧为当前帧的已解码块的位移矢量,构建更适 合的预测矢量候选列表,以保证从中选择出更为准确的预测矢量,有利于提升编码性能。
附图说明
图1是本申请实施例中的示例性系统架构的示意图;
图2是本申请实施例中的视频编码装置和视频解码装置在流式传输系统中的放置方式示意图;
图3是本申请实施例中的SB与B之间的关系示意图;
图4是本申请实施例中的一个视频编码器的基本流程图;
图5是本申请实施例中的帧间预测的示意图;
图6是本申请实施例中的帧内块复制的示意图;
图7是本申请实施例中的AV1中IBC的参考范围示意图;
图8是本申请实施例中的AV2中IBC的参考范围示意图;
图9是本申请实施例中的视频解码方法的流程图;
图10是本申请实施例中的选择当前块相邻近的已解码块的示意图;
图11是本申请实施例中的视频解码方法的流程图;
图12是本申请实施例中的视频编码方法的流程图;
图13是本申请实施例中的视频解码装置的框图;
图14是本申请实施例中的视频编码装置的框图;
图15是本申请实施例中的电子设备的计算机系统的结构示意图。
具体实施方式
现在参考附图以更全面的方式描述示例实施方式。然而,示例的实施方式能够以各种形式实施,且不应被理解为仅限于这些范例;相反,提供这些实施方式的目的是使得本申请更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。
此外,本申请所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,有许多细节从而可以充分理解本申请的实施例。然而,本领域技术人员应意识到,在实施本申请的技术方案时可以不需用到实施例中的所有细节特征,可以省略一个或更多特定细节,或者可以采用其它的方法、元件、装置、步骤等。
附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。
需要说明的是:在本文中提及的“多个”是指两个或两个以上。“和/或”描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
图1是本申请实施例的技术方案的示例性系统架构的示意图。
如图1所示,系统架构100包括多个终端装置,所述终端装置可通过例如网络150彼此通信。举例来说,系统架构100可以包括通过网络150互连的第一终端装置110和第二终端装置120。在图1的实施例中,第一终端装置110和第二终端装置120执行单向数据传输。
举例来说,第一终端装置110可对视频数据(例如由终端装置110采集的视频图片流)进行编码以通过网络150传输到第二终端装置120,已编码的视频数据以一个或多个已编码视频码 流形式传输,第二终端装置120可从网络150接收已编码视频数据,对已编码视频数据进行解码以恢复视频数据,并根据恢复的视频数据显示视频图片。
在本申请的一个实施例中,系统架构100可以包括执行已编码视频数据的双向传输的第三终端装置130和第四终端装置140,所述双向传输比如可以发生在视频会议期间。对于双向数据传输,第三终端装置130和第四终端装置140中的每个终端装置可对视频数据(例如由终端装置采集的视频图片流)进行编码,以通过网络150传输到第三终端装置130和第四终端装置140中的另一终端装置。第三终端装置130和第四终端装置140中的每个终端装置还可接收由第三终端装置130和第四终端装置140中的另一终端装置传输的已编码视频数据,且可对已编码视频数据进行解码以恢复视频数据,并可根据恢复的视频数据在可访问的显示装置上显示视频图片。
在图1所示的实施例中,第一终端装置110、第二终端装置120、第三终端装置130和第四终端装置140可为服务器或者终端,但本申请公开的原理可不限于此。
服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能语音交互设备、智能手表、智能家电、车载终端、飞行器等,但并不局限于此。
图1中所示的网络150表示在第一终端装置110、第二终端装置120、第三终端装置130和第四终端装置140之间传送已编码视频数据的任何数目的网络,包括例如有线和/或无线通信网络。通信网络150可在电路交换和/或分组交换信道中交换数据。该网络可包括电信网络、局域网、广域网和/或互联网。出于本申请的目的,除非在下文中有所解释,否则网络150的架构和拓扑对于本申请公开的操作来说可能是无关紧要的。
在本申请的一个实施例中,图2示出视频编码装置和视频解码装置在流式传输环境中的放置方式。本申请所公开主题可同等地适用于其它支持视频的应用,包括例如视频会议、数字电视机(television,TV)、在包括CD、DVD、存储棒等的数字介质上存储压缩视频等等。
流式传输系统可包括采集子系统213,采集子系统213可包括数码相机等视频源201,视频源创建未压缩的视频图片流202。在实施例中,视频图片流202包括由数码相机拍摄的样本。相较于已编码的视频数据204(或已编码的视频码流204),视频图片流202被描绘为粗线以强调高数据量的视频图片流,视频图片流202可由电子装置220处理,电子装置220包括耦接到视频源201的视频编码装置203。视频编码装置203可包括硬件、软件或软硬件组合以实现或实施如下文更详细地描述的所公开主题的各方面。相较于视频图片流202,已编码的视频数据204(或已编码的视频码流204)被描绘为细线以强调较低数据量的已编码的视频数据204(或已编码的视频码流204),其可存储在流式传输服务器205上以供将来使用。一个或多个流式传输客户端子系统,例如图2中的客户端子系统206和客户端子系统208,可访问流式传输服务器205以检索已编码的视频数据204的副本207和副本209。客户端子系统206可包括例如电子装置230中的视频解码装置210。视频解码装置210对已编码的视频数据的传入副本207进行解码,且产生可在显示器212(例如显示屏)或另一呈现装置上呈现的输出视频图片流211。在一些流式传输系统中,可根据某些视频编码/压缩标准对已编码的视频数据204、视频数据207和视频数据209(例如视频码流)进行编码。
应注意,电子装置220和电子装置230可包括图中未示出的其它组件。举例来说,电子装置220可包括视频解码装置,且电子装置230还可包括视频编码装置。
在本申请的一个实施例中,以国际视频编码标准高效率视频编码(High Efficiency Video Coding,HEVC)、多功能视频编码(Versatile Video Coding,VVC),以及中国国家视频编码标准AVS为例,当输入一个视频帧图像之后,会根据一个块大小,将视频帧图像划分成若干个不重叠的处理单元,每个处理单元将进行类似的压缩操作。这个处理单元被称作编码树单元(Coding Tree Unit,CTU),或者称之为最大编码单元(Largest Coding Unit,LCU)。CTU再往 下可以继续进行更加精细的划分,得到一个或多个基本的编码单元(Coding Unit,CU),CU是一个编码环节中最基本的元素。
在另一个实施例中,这个处理单元也可以被称作编码片(即Tile),是可以独立解码和编码的多媒体数据帧的矩形区域。其中,编码片再往下可以继续进行更加精细的划分,得到一个或多个最大编码块(Superblock,SB),SB是块划分的起点,可以继续划分为多个子块,然后最大编码块再往下划分,得到一个或多个块(Block)。每个块是一个编码环节中最基本的元素。在一些实施例中,SB与块(B)之间的关系可如图3所示,即一个SB可以包含若干个B。
以下介绍编码过程中的一些概念:
预测编码(Predictive Coding):预测编码包括了帧内预测和帧间预测等方式,原始视频信号经过选定的已重建视频信号的预测后,得到残差视频信号。编码端需要为当前编码单元(或编码块)决定选择哪一种预测编码模式,并告知解码端。其中,帧内预测是指预测的信号来自于同一图像内已经编码重建过的区域;帧间预测是指预测的信号来自已经编码过的、不同于当前图像的其它图像(称之为参考图像)。
变换及量化(Transform & Quantization):残差视频信号经过离散傅里叶变换(Discrete Fourier Transform,DFT)、离散余弦变换(Discrete Cosine Transform,DCT)等变换操作后,将信号转换到变换域中,称之为变换系数。变换系数进行有损的量化操作,丢失掉一定的信息,使得量化后的信号有利于压缩表达。在一些视频编码标准中,可能有多于一种变换方式可以选择,因此编码端也需要为当前编码单元(或编码块)选择其中的一种变换方式,并告知解码端。量化的精细程度通常由量化参数(Quantization Parameter,QP)来决定,QP取值较大,表示更大取值范围的系数将被量化为同一个输出,因此通常会带来更大的失真及较低的码率;相反,QP取值较小,表示较小取值范围的系数将被量化为同一个输出,因此通常会带来较小的失真,同时对应较高的码率。
熵编码(Entropy Coding)或统计编码:量化后的变换域信号将根据各个值出现的频率进行统计压缩编码,最后输出二值化(0或者1)的压缩码流。同时,编码产生其他信息,例如选择的编码模式、运动矢量数据等,也需要进行熵编码以降低码率。统计编码是一种无损的编码方式,可以有效的降低表达同样信号所需要的码率,常见的统计编码方式有变长编码(Variable Length Coding,VLC)或者基于上下文的二值化算术编码(Content Adaptive Binary Arithmetic Coding,CABAC)。
基于上下文的二值化算术编码(CABAC)过程主要包含3个步骤:二值化、上下文建模和二进制算术编码。在对输入的语法元素进行二值化处理后,可以通过常规编码模式和旁路编码模式(Bypass Coding Mode)对二元数据进行编码。旁路编码模式无须为每个二元位分配特定的概率模型,输入的二元位bin值直接用一个简单的旁路编码器进行编码,以加快整个编码以及解码的速度。一般情况下,不同的语法元素之间并不是完全独立的,且相同语法元素自身也具有一定的记忆性。因此,根据条件熵理论,利用其他已编码的语法元素进行条件编码,相对于独立编码或者无记忆编码能够提高编码性能。这些用来作为条件的已编码符号信息称为上下文。在常规编码模式中,语法元素的二元位顺序地进入上下文模型器,编码器根据先前编码过的语法元素或二元位的值,为每一个输入的二元位分配合适的概率模型,该过程即为上下文建模。通过上下文索引增量(context index increment,ctxIdxInc)和上下文起始索引(context index Start,ctxIdxStart)即可定位到语法元素所对应的上下文模型。将bin值和分配的概率模型一起送入二元算术编码器进行编码后,需要根据bin值更新上下文模型,也就是编码中的自适应过程。
环路滤波(Loop Filtering):经过变化及量化的信号会通过反量化、反变换及预测补偿的操作获得重建图像。重建图像与原始图像相比由于存在量化的影响,部分信息与原始图像有所不同,即重建图像会产生失真(Distortion)。因此,可以对重建图像进行滤波操作,例如去块效应滤波(Deblocking filter,DB)、自适应像素补偿(Sample Adaptive Offset,SAO)或者自适应环路滤波(Adaptive Loop Filter,ALF)等滤波器,可以有效降低量化所产生的失真程度。由于这些经过滤波后的重建图像将作为后续编码图像的参考来对将来的图像信号进行预测,因此上述的滤波操作也被称为环路滤波,即在编码环路内的滤波操作。
在本申请的一个实施例中,图4示出了一个视频编码器的基本流程图,在该流程中以帧内预测为例进行说明。其中,原始图像信号s k[x,y]与预测图像信号
Figure PCTCN2022135499-appb-000001
做差值运算,得到残差信号u k[x,y],残差信号u k[x,y]经过变换及量化处理之后得到量化系数,量化系数一方面通过熵编码得到编码后的比特流,另一方面通过反量化及反变换处理得到重构残差信号u' k[x,y],预测图像信号
Figure PCTCN2022135499-appb-000002
与重构残差信号u' k[x,y]叠加生成图像信号
Figure PCTCN2022135499-appb-000003
图像信号
Figure PCTCN2022135499-appb-000004
一方面输入至帧内模式决策模块和帧内预测模块进行帧内预测处理,另一方面通过环路滤波输出重建图像信号s' k[x,y],重建图像信号s' k[x,y]可以作为下一帧的参考图像进行运动估计及运动补偿预测。然后基于运动补偿预测的结果s' r[x+m x,y+m y]和帧内预测结果
Figure PCTCN2022135499-appb-000005
得到下一帧的预测图像信号
Figure PCTCN2022135499-appb-000006
并继续重复上述过程,直至编码完成。
基于上述的编码过程,在解码端针对每一个编码单元(或编码块),在获取到压缩码流(即比特流)之后,进行熵解码获得各种模式信息及量化系数。然后量化系数经过反量化及反变换处理得到残差信号。另一方面,根据已知的编码模式信息,可获得该编码单元(或编码块)对应的预测信号,然后将残差信号与预测信号相加之后即可得到重建信号,重建信号再经过环路滤波等操作,产生最终的输出信号。
主流的视频编码标准(如HEVC、VVC、AVS3、AV1、AV2),均采用基于块的混合编码框架。在实际应用中,将原始的视频数据分成一系列的编码块,结合预测、变换和熵编码等视频编码方法,实现视频数据的压缩。其中,运动补偿是视频编码常用的一类预测方法,运动补偿基于视频内容在时域或空域的冗余特性,从已编码的区域导出当前编码块的预测值。这类预测方法包括:帧间预测、帧内块复制预测、帧内串复制预测等,在编码实现中,可能单独或组合使用这些预测方法。对于使用了这些预测方法的编码块,通常需要在码流中显式或隐式的编码一个或多个二维的位移矢量,指示当前块(或当前块的同位块)相对它的一个或多个参考块的位移。
其中,AV1的全称为Alliance for Open Media Video 1,是由开放媒体联盟制定的第一代视频编码标准;AV2的全称为Alliance for Open Media Video 2,是由开放媒体联盟制定的第二代视频编码标准。
需要注意的是,在不同的预测模式及不同的实现下,位移矢量可能有不同的名称,本申请的实施例中统一按照以下方式进行描述:1)帧间预测中的位移矢量称为运动位移矢量(Motion Vector,MV);2)帧内块复制中的位移矢量称为块位移矢量(Block Vector,BV);3)帧内串复制中的位移矢量称为串位移矢量(String Vector,SV)。以下对帧间预测和帧内块复制预测中相关的技术进行介绍。
如图5所示,帧间预测利用视频时间域的相关性,使用邻近已编码图像的像素预测当前图像的像素,以达到有效去除视频时域冗余的目的,能够有效节省编码残差数据的比特。其中,P表示当前帧,Pr表示参考帧,B表示当前编码块,Br表示B的参考块。B'在参考帧中的坐标与B在当前帧中的坐标位置相同,Br的坐标为(x r,y r),B'的坐标为(x,y),当前编码块与其参考块之间的位移称为运动向量(即MV),其中,MV=(x r-x,y r-y)。
考虑到时域或空域邻近块具有较强的相关性,可以采用MV预测技术减少编码MV所需要的比特。在H.265/HEVC中,帧间预测包含Merge和高级运动矢量预测(Advanced Motion Vector Prediction,AMVP)两种MV预测技术。Merge模式会为当前预测单元(prediction unit,PU)建立一个MV候选列表,其中存在5个候选MV(及其对应的参考图像)。遍历这5个候选MV,选取率失真代价最小的作为最优MV。若编解码器依照相同的方式建立候选列表,则编码器只需要传输最优MV在候选列表中的索引即可。需要注意的是,HEVC的MV预测技术还有一种skip(跳过)模式,是Merge模式的一种特例,通过Merge模式找到最优MV后,如果当前块和参考块基本一样,那么不需要传输残差数据,只需要传送MV的索引和一个skip flag即可。
类似的,AMVP模式利用空域和时域邻近块的MV相关性,为当前PU建立候选预测MV 列表。与Merge模式不同,AMVP模式候选预测MV列表中选择最优的预测MV,与当前编码块通过运动搜索得到的最优MV进行差分编码,即编码MVD=MV-MVP;解码端通过建立相同的列表,仅需要运动位移矢量残差(Motion Vector Difference,MVD)与预测运动矢量(Motion Vector Predictor,MVP)在该列表中的序号即可计算当前编码块的MV。AMVP候选MV列表也包含空域和时域两种情形,不同的是AMVP列表长度仅为2。
帧内块复制是HEVC屏幕内容编码(Screen Content Coding,SCC)扩展中采纳的一种编码工具,它显著提升了屏幕内容的编码效率。在AVS3和VVC中,也采纳了IBC技术以提升屏幕内容编码的性能,IBC利用屏幕内容视频在空间的相关性,使用当前图像上已编码图像的像素预测当前待编码块的像素,能够有效节省编码像素所需的比特。如图6所示,在IBC中当前块与其参考块之间的位移称为块位移矢量(Block Vector,BV)。
在目前的AV1标准中,IBC模式使用了全局参考范围的方案,即当前帧已重构的区域允许用作当前块的参考块。但是由于IBC使用片外存储器存储参考样本,需要增加了下列限制以解决IBC潜在的硬件实现问题:
1)如果当前图像允许使用IBC模式,则环路滤波器将被禁用,从而避免增加额外的图像存储需求,而为了降低环路滤波器关闭带来的影响,IBC模式仅允许在关键帧中使用。
2)参考块的位置需要满足硬件回写时延限制,比如当前块水平方向上的256个已重建样本的区域不允许用作参考块。
3)参考块的位置需要满足并行处理的限制。
可以参考图7所示的目前AV1标准中IBC参考范围的示意图,其中SB的大小为128×128,编码器按SB行进行并行编码,当前块水平方向上的256个已重建样本的区域(即两个SB大小)不允许用作参考块。
相关技术中的开放媒体联盟(Alliance for Open Media,AOM)下一代标准AV2中,IBC模式得到改进。如图8所示,在AV2中,IBC的参考范围由两部分组成,分别称为全局参考范围和局部参考范围。其中,全局参考范围为AV1中允许的参考范围;局部参考范围为新增的参考范围,其大小比如可以为64×64(即当前块所在的SB区域),该参考范围的像素样本存储在额外的片上存储器中,因此在仅使用该参考范围时不需要禁用环路滤波器。同时,根据帧类型的不同,IBC允许使用不同的参考范围,比如对于关键帧,IBC允许使用全局参考范围和局部参考范围,对于非关键帧IBC仅允许使用局部参考范围。
需要说明的是:局部参考范围在不同的实现方式中可以有不同的大小,比如除了可以是64×64之外,还可以128×128等。
由于AV2允许使用不同类型的参考范围,那么当参考块位于不同类型的参考范围内时,块矢量的数值具有较大的变化。例如,当参考块位于局部参考范围内时,块矢量的绝对值将小于64;而当参考块位于全局参考范围时,块矢量的绝对值均大于64。但是,在当前版本的AV2中,默认预测块矢量均指向全局参考范围,未考虑到当前块位于局部参考范围的情况。对于局部参考范围内的参考块,默认预测块矢量不能提供较好的预测,将导致较大的块矢量编码开销。同时,在相关的音视频编解码技术中,如果码流中不包含当前块的预测矢量,那么需要导出默认的预测矢量,但是相关技术中对于这些默认的预测矢量的选择方式存在一定的局限性,进而影响了整体的编码性能。
图9示出了本申请实施例提供的视频解码方法的流程图,该视频解码方法可以由具有计算处理功能的设备来执行,比如可以由终端设备或服务器来执行。参照图9所示,该视频解码方法至少包括如下步骤:
步骤S910,根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表;
步骤S920,从预测矢量候选列表中选择待解码的当前块的预测矢量;
步骤S930,基于当前块的预测矢量对当前块进行解码处理。
图9所示实施例的技术方案可以根据参考帧为当前帧的已解码块的位移矢量构建更适合的预测矢量候选列表,以保证从中选择出更为准确的预测矢量,有利于提升编码性能。
需要说明的是:图9所示实施例的技术方案可以用于“默认”的预测矢量的导出,即在通 过标准中固定的规则导出当前块的预测块矢量的各分量均为0时,才使用图9所示的方法导出预测矢量。当然,在本申请的其它实施例中,也可以直接使用图9所示实施例的技术方案。
以下对图9中所示的步骤S910至步骤S930的实现细节进行详细阐述:
在步骤S910中,根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表。
在一些实施例中,在不同的预测模式及不同的实现下,位移矢量可能有不同的名称,比如在帧间预测中的位移矢量可以称为运动位移矢量MV,在帧内块复制中的位移矢量称为块位移矢量BV,在帧内串复制中的位移矢量称为串位移矢量SV。
在本申请的一个实施例中,可以根据当前块相邻近的已解码块的位移矢量来构建预测矢量候选列表。
在实际应用中,可以从参考帧为当前帧的已解码块的位移矢量中,获取当前块相邻近的已解码块的位移矢量,然后按照设定顺序,对当前块相邻近的已解码块的位移矢量进行排序,以生成第一位移矢量列表,进而根据第一位移矢量列表,生成预测矢量候选列表。比如可以将第一位移矢量列表作为预测矢量候选列表。
在一些实施例中,当前块相邻近的已解码块可以包括以下至少一个:处于当前块上方n 1行的已解码块、处于当前块左方n 2列的已解码块;其中,n 1和n 2为正整数。比如图10所示,相邻近的已解码块可以是当前块上方的3行或左边的3列已解码块,其中的每一行或列的基本单元可以是8×8的大小。需要说明的是:位移矢量的信息通常是按4×4的单元进行存储的,在实现中,可以通过一个8×8的单元搜索得到多个位移矢量,并且对于不同的行或列,搜索得到的位移矢量的数量可以是不同的。
在一些实施例中,该设定顺序可以是已解码块的解码顺序、已解码块的扫描顺序、位移矢量所对应的权重。该位移矢量所对应的权重可以与以下至少一个因素相关联:位移矢量的重复次数、位移矢量所对应的块大小、位移矢量所对应的块位置。
比如,若位移矢量的重复次数较多,那么位移矢量所对应的权重越大,在第一位移矢量列表中的顺序也就越靠前;若位移矢量所对应的块越小,那么位移矢量所对应的权重越大,在第一位移矢量列表中的顺序也就越靠前;若位移矢量所对应的块位置距离当前块越近,那么位移矢量所对应的权重越大,在第一位移矢量列表中的顺序也就越靠前。
在本申请的一个实施例中,可以根据历史已解码块的位移矢量来构建预测矢量候选列表。
在实际应用中,可以从参考帧为当前帧的已解码块的位移矢量中,获取历史已解码块的位移矢量,然后按照设定顺序,将历史已解码块的位移矢量按照先入先出的方式添加至设定长度的队列中,以生成第二位移矢量列表,进而根据第二位移矢量列表,生成预测矢量候选列表。比如可以将第二位移矢量列表作为预测矢量候选列表。
在一些实施例中,比如队列长度为3,那么可以按照设定顺序存储位移矢量1、位移矢量2和位移矢量3,当有新的位移矢量4需要加入时,该队列中的位移矢量变为:位移矢量2、位移矢量3和位移矢量4;如果有新的位移矢量5需要加入时,该队列中的位移矢量变为:位移矢量3、位移矢量4和位移矢量5。
在一些实施例中,该设定顺序可以是已解码块的解码顺序、已解码块的扫描顺序、位移矢量所对应的权重。该位移矢量所对应的权重可以与以下至少一个因素相关联:位移矢量的重复次数、位移矢量所对应的块大小、位移矢量所对应的块位置。
比如,若位移矢量的重复次数较多,那么位移矢量所对应的权重越大,在第一位移矢量列表中的顺序也就越靠前;若位移矢量所对应的块越小,那么位移矢量所对应的权重越大,在第一位移矢量列表中的顺序也就越靠前;若位移矢量所对应的块位置距离当前块越近,那么位移矢量所对应的权重越大,在第一位移矢量列表中的顺序也就越靠前。
在一些实施例中,在将历史已解码块的位移矢量添加至队列中时,若队列中已存在相同的位移矢量,则删掉队列中已存在的相同的位移矢量。比如队列中存储有位移矢量1、位移矢量2和位移矢量3,当有新的位移矢量4需要加入时,如果该位移矢量4与位移矢量2相同,那么可以将位移矢量2从队列中删除,进而得到的队列变为:位移矢量1、位移矢量3和位移矢量4。
在一些实施例中,一个第二位移矢量列表可以对应于至少一个待解码区域,待解码区域包 括以下中的一个:当前块所在的最大编码块SB、当前块所在的最大编码块SB中的行、当前块所在的片(tile)。比如一个第二位移矢量列表对应于一个SB,或者一个第二位移矢量列表对应于多个SB。在此基础上,在一些实施例中,如果目标待解码区域(即指定待解码区域)所对应的第二位移矢量列表中的位移矢量超过设定值,则停止向目标待解码区域所对应的第二位移矢量列表中添加位移矢量,即可以针对待解码区域所对应的第二位移矢量列表设定最大数量,当超过最大数量之后,可以停止向对应的第二位移矢量列表中添加位移矢量。
当然,对于一个待解码区域而言,也可以记录向其对应的第二位移矢量列表中添加位移矢量的操作次数,当该操作次数超过预设值时,停止向所对应的第二位移矢量列表添加新的位移矢量。即该实施例通过记录向第二位移矢量列表中添加位移矢量的操作次数来确定是否停止向对应的第二位移矢量列表中添加位移矢量。
在本申请的一个实施例中,可以根据当前块相邻近的已解码块的位移矢量,以及历史已解码块的位移矢量来构建预测矢量候选列表。
在实际应用中,可以从参考帧为当前帧的已解码块的位移矢量中获取当前块相邻近的已解码块的位移矢量,并从参考帧为当前帧的已解码块的位移矢量中,获取历史已解码块的位移矢量,然后根据获取到的相邻近的已解码块的位移矢量和历史已解码块的位移矢量生成预测矢量候选列表。其中,在根据获取到的相邻近的已解码块的位移矢量和历史已解码块的位移矢量生成预测矢量候选列表时,可以按照设定的顺序对获取到的位移矢量进行排列,以生成该预测矢量候选列表。在这个过程中还可以删掉重复的位移矢量。
在一些实施例中,在根据获取到的相邻近的已解码块的位移矢量和历史已解码块的位移矢量生成预测矢量候选列表时,还可以删除其中未处于预设区域内的位移矢量,预设区域包括以下至少一个:当前图像、当前片、当前的全局参考范围和当前的局部参考范围。
在一些实施例中,在按照设定的顺序对获取到的位移矢量进行排列时,该设定顺序可以是已解码块的解码顺序、已解码块的扫描顺序、已解码块的类型、位移矢量所对应的权重。该位移矢量所对应的权重可以与以下至少一个因素相关联:位移矢量的重复次数、位移矢量所对应的块大小、位移矢量所对应的块位置。一个已解码块可以是当前块相邻近的已解码块(即前述的第一位移矢量列表中的编码块),也可以是历史已解码块(即前述的第二位移矢量列表中的编码块)。因此已解码块的类型用于表示已解码块是当前块相邻近的已解码块(也即表示是前述的第一位移矢量列表中的编码块)还是历史已解码块(也即表示是前述的第二位移矢量列表中的编码块)。比如可以将当前块相邻近的已解码块的位移矢量排列在历史已解码块的位移矢量之前,当然也可以将当前块相邻近的已解码块的位移矢量排列在历史已解码块的位移矢量之后。
在一个实施例中,还可以从参考帧为当前帧的已解码块的位移矢量中获取当前块相邻近的已解码块的位移矢量,并按照设定顺序对当前块相邻近的已解码块的位移矢量进行排序,以生成第一位移矢量列表;然后从参考帧为当前帧的已解码块的位移矢量中,获取历史已解码块的位移矢量,并按照设定顺序将历史已解码块的位移矢量按照先入先出的方式添加至设定长度的队列中,以生成第二位移矢量列表;进而根据第一位移矢量列表和第二位移矢量列表,生成预测矢量候选列表。
其中,生成第一位移矢量列表和第二位移矢量列表的过程参照前述实施例的技术方案,不再赘述。
在一些实施例中,根据第一位移矢量列表和第二位移矢量列表,生成预测矢量候选列表的过程可以是将第一位移矢量列表和第二位移矢量列表进行合并,并删除重复的位移矢量,以生成预测矢量候选列表。
在一些实施例中,在将第一位移矢量列表和第二位移矢量列表进行合并时,可以将第一位移矢量列表中的位移矢量排列在第二位移矢量列表中的位移矢量之前;当然也可以将第一位移矢量列表中的位移矢量排列在第二位移矢量列表中的位移矢量之后。
在一些实施例中,在将第一位移矢量列表和第二位移矢量列表进行合并时,还可以检测第一位移矢量列表和第二位移矢量列表中是否存在未处于预设区域内的位移矢量,预设区域包括以下至少一个:当前图像、当前片、当前的全局参考范围和当前的局部参考范围;然后在将第 一位移矢量列表和第二位移矢量列表进行合并的过程中,删除未处于预设区域内的位移矢量。
继续参照图9所示,在步骤S920中,从预测矢量候选列表中选择待解码的当前块的预测矢量。
在本申请的一个实施例中,从预测矢量候选列表中选择当前块的预测矢量的过程可以是从码流中解码得到预测矢量索引信息,然后根据预测矢量索引信息从预测矢量候选列表中的相应位置处选择一个预测矢量作为当前块的预测矢量。
在一些实施例中,可以根据预测矢量候选列表的长度确定是否需要解码预测矢量索引信息,如果确定需要解码预测矢量索引信息,则从码流中解码得到预测矢量索引信息。在实际应用中,比如若预测矢量候选列表的长度为1,那么不需要从码流中解码预测矢量索引信息,可以直接将预测矢量候选列表中的预测矢量作为当前块的预测矢量。
在一些实施例中,预测矢量索引信息可以采用基于上下文的多符号算数编码。
在一些实施例中,码流中还可以包含有预测矢量索引信息的最大值,该最大值可以位于序列头、图像头或者片头中,该最大值可以表示预测矢量索引信息的最大数量。在一些实施例中,不同的位移矢量预测模式对应的最大值相同或者不同。
在本申请的一个实施例中,从预测矢量候选列表中选择当前块的预测矢量的过程也可以是按照设定的选择策略,从预测矢量候选列表中选择一个预测矢量作为当前块的预测矢量。比如可以按照顺序选择第i个(i为正整数)预测矢量作为当前块的预测矢量,或者随机选择一个。
在步骤S930中,基于当前块的预测矢量对当前块进行解码处理。
在本申请的一个实施例中,步骤S930中基于当前块的预测矢量对当前块进行解码处理的过程可以是将当前块的预测矢量作为当前块的位移矢量,以对当前块进行解码处理。
在本申请的一个实施例中,步骤S930中基于当前块的预测矢量对当前块进行解码处理的过程可以是从码流中解码得到当前块的矢量残差,根据矢量残差和当前块的预测矢量计算当前块的位移矢量,然后根据当前块的位移矢量对当前块进行解码处理。
图11示出了根据本申请的一个实施例的视频解码方法的流程图,该视频解码方法可以由具有计算处理功能的设备来执行,比如可以由终端设备或服务器来执行。参照图11所示,该视频解码方法至少包括如下步骤:
步骤S1110,从码流中解码得到参考范围类别指示信息,该参考范围类别指示信息用于指示帧内块复制模式所使用的目标参考范围,该目标参考范围包括全局参考范围和局部参考范围中的至少一个。
在一些实施例中,参考范围类别指示信息可以通过两个标志位来实现,比如参考范围类别指示信息可以包括第一标志位和第二标志位,第一标志位用于指示帧内块复制模式是否允许使用全局参考范围,第二标志位用于指示帧内块复制模式是否允许使用局部参考范围。
在一些实施例中,比如若第一标志位的值为1,则表示帧内块复制模式允许使用全局参考范围;第一标志位的值为0,则表示帧内块复制模式不允许使用全局参考范围。若第二标志位的值为1,则表示帧内块复制模式允许使用局部参考范围;第二标志位的值为0,则表示帧内块复制模式不允许使用局部参考范围。
在一些实施例中,参考范围类别指示信息可以通过一个标志位来实现,比如在一个实施例中,参考范围类别指示信息可以包括第三标志位,第三标志位为第一值(比如1)时,指示帧内块复制模式允许使用全局参考范围;第三标志位为第二值(比如0)时,指示帧内块复制模式允许使用局部参考范围。
在另一个实施例中,参考范围类别指示信息可以包括第四标志位,第四标志位为第一值(比如1)时,指示帧内块复制模式允许使用全局参考范围和局部参考范围;第四标志位为第二值(比如0)时,指示帧内块复制模式允许使用局部参考范围。
步骤S1120,根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表。
需要说明的是,本申请实施例对步骤S1110和步骤S1120的执行顺序不做限定。
在本申请的一个实施例中,步骤S1120中根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表的过程可以是:从参考帧为当前帧的已解码块的位移矢量中,获取所对应 的参考块处于目标参考范围内、且采用帧内块复制模式的目标已解码块,然后根据目标已解码块的位移矢量生成预测矢量候选列表。
在本申请的一个实施例中,步骤S1120中根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表的过程可以是:根据参考帧为当前帧的已解码块的位移矢量,计算当前块的参考块,然后确定当前块的参考块中处于目标参考范围内的目标参考块,进而根据目标参考块所对应的已解码块的位移矢量,生成预测矢量候选列表。
在一些实施例中,可以根据当前块的坐标与已解码块的位移矢量,确定当前块的参考块的位置信息。比如根据当前块的横坐标与一个位移矢量的水平分量,计算得到对应的一个参考块的横坐标;根据当前块的纵坐标与一个位移矢量的竖直分量,计算得到对应的一个参考块的纵坐标。
在一些实施例中,参考范围类别指示信息可以是图像级的参考范围类别指示信息或者片级的参考范围类别指示信息,那么如果预测矢量候选列表中包含的位移矢量的数量未达到设定数量,则可以根据图像级的参考范围类别指示信息或者片级的参考范围类别指示信息,向预测矢量候选列表中填充预设的块矢量。
比如,若指示的是全局参考范围,那么可以从以下的块矢量中选择至少一个来对预测矢量候选列表进行填充:(-sb_w-D,0)、(0,-sb_h)、(sb_x-b_w-cur_x-D,0)、(0,sb_y-b_h-cur_y)、(-M×sb_w-D,-N×sb_h)。在一些实施例中,这些块矢量的精度可以是整像素级的,实现时可以使用不同精度的表示方式。
其中,sb_w表示当前块所在的最大编码块的宽度;sb_h表示当前块所在的最大编码块的高度;sb_x表示当前块所在的最大编码块的左上角横坐标;sb_y表示当前块所在的最大编码块的左上角纵坐标;b_w表示当前块的宽度;b_h表示当前块的高度;cur_x表示当前块的左上角横坐标;cur_y表示当前块的左上角纵坐标;D、M和N为设定的常数。
若指示的是局部参考范围,那么可以从以下的块矢量中选择至少一个来对预测矢量候选列表进行填充:(-b_w,0)、(0,-b_h)、(-b_w,-b_h)、(-2×b_w,0)、(0,-2×b_h)、(0,0)、(0,-vb_w)、(-vb_h,0)、(-vb_w,-vb_h);其中,b_w表示当前块的宽度;b_h表示当前块的高度;vb_w表示预设的块宽度,比如可以是64、32、16、8或4;vb_h表示预设的块高度,比如可以是64、32、16、8或4。在一些实施例中,这些块矢量的精度可以是整像素级的,实现时可以使用不同精度的表示方式。
若指示的是全局参考范围和局部参考范围,那么可以从上述的块矢量中选择至少一个来进行填充。
在本申请的一个实施例中,在向预测矢量候选列表中填充预测块矢量时,也可以选择满足以下任一条件的候选预测块矢量进行填充:
cur_x+bvpi_x≥min_x;
cur_y+bvpi_y≥min_y;
cur_x+bvpi_x≥min_x且cur_y+bvpi_y≥min_y;
cur_x+b_w-1+bvpi_x≤max_x;
cur_y+b_h-1+bvpi_y≤max_y;
cur_x+b_w-1+bvpi_x≤max_x且cur_y+b_h-1+bvpi_y≤max_y;
其中,cur_x表示当前块的左上角横坐标;cur_y表示当前块的左上角纵坐标;b_w表示当前块的宽度;b_h表示当前块的高度;bvpi_x表示第i个候选预测块矢量的水平分量;bvpi_y表示第i个候选预测块矢量的竖直分量;若目标参考范围为全局参考范围,则min_x和min_y表示当前块所在片的左上角坐标,max_x和max_y表示处于指定最大编码块所在行中的全局参考范围的右下角坐标,指定最大编码块为当前块所在的最大编码块;若目标参考范围为局部参考范围,则min_x和min_y表示当前块所在的局部参考范围的左上角坐标,max_x和max_y表示当前块所在的局部参考范围的右下角坐标。
在一个实施例中,如果预测矢量候选列表中包含的位移矢量的数量不满4个,则可以进行以下操作:
A)如果允许使用全局参考范围和局部参考范围,则可以向预测矢量候选列表中添填充{(0,-sb_h)、(-sb_w-D,0)、(0,-h')、(-w',0)},其中,SB大小为128,D为256;
B)如果仅允许使用局部参考范围,则可以向预测矢量候选列表中添加{(0,-h')、(-w',0)、(-w',-h')、(0,-2×h')};
C)如果仅允许全局参考范围,则可以向预测矢量候选列表中添加{(0,-sb_h)、(-sb_w-D,0)、(-sb_w,-sb_h)、(-2×sb_w,-sb_h)},其中,SB大小为128,D为256;
D)填充预测矢量候选列表时可以进行查重操作,删除重复的预测矢量;
其中,w'=min(b_w,64);h'=min(b_h,64)。
步骤S1130,从预测矢量候选列表中选择与目标参考范围相对应的预测矢量。
在本申请的一个实施例中,如果预测矢量候选列表中所包含的预测矢量是与目标参考范围相对应的,那么从预测矢量候选列表中选择与目标参考范围相对应的预测矢量的过程可以是从码流中解码得到预测矢量索引信息,然后根据预测矢量索引信息从预测矢量候选列表中的相应位置处选择一个预测矢量作为当前块的预测矢量。
在本申请的一个实施例中,从预测矢量候选列表中选择与目标参考范围相对应的预测矢量的过程也可以是按照设定的选择策略,从预测矢量候选列表中选择一个与目标参考范围相对应的预测矢量作为当前块的预测矢量。比如可以按照顺序选择第i个(i为正整数)与目标参考范围相对应的预测矢量作为当前块的预测矢量,或者随机选择一个。
步骤S1140,基于当前块的预测矢量对当前块进行解码处理。
在本申请的一个实施例中,基于当前块的预测矢量对当前块进行解码处理的过程可以是将当前块的预测矢量作为当前块的位移矢量,以对当前块进行解码处理。或者也可以是从码流中解码得到当前块的矢量残差,根据矢量残差和当前块的预测矢量计算当前块的位移矢量,然后根据当前块的位移矢量对当前块进行解码处理。
基于图9或图11所示实施例的技术方案,在本申请的一个实施例中,还可以从码流中解码得到位移矢量预测模式指示信息。在此基础上,如果位移矢量预测模式指示信息指示当前块采用Skip预测模式,则将当前块的预测矢量作为当前块的位移矢量,且跳过对当前块的残差系数的解码过程,以对当前块进行解码处理;
如果位移矢量预测模式指示信息指示当前块采用NearMV预测模式,则将当前块的预测矢量作为当前块的位移矢量,并对当前块的残差系数进行解码,以对当前块进行解码处理;
如果位移矢量预测模式指示信息指示当前块采用NewMV预测模式,则从码流中解码得到当前块的位移矢量残差,根据位移矢量残差和当前块的预测矢量计算当前块的位移矢量,并对当前块的残差系数进行解码,以对当前块进行解码处理。
需要说明的是:上述三种预测模式在实现时可以随机进行组合,比如使用这三种模式中的一种、两种或者全部。
在本申请的一个实施例中,还可以根据预测矢量候选列表的长度确定是否需要解码位移矢量预测模式指示信息,如果确定需要解码位移矢量预测模式指示信息,则从码流中解码得到位移矢量预测模式指示信息。比如,若预测矢量候选列表的长度为0,那么说明当前块的预测矢量为0,此时可以默认使用NewMV预测模式,通过解码当前块的位移矢量残差来作为当前块的预测矢量。
在本申请的一个实施例中,从码流中解码得到当前块的位移矢量残差的过程可以是直接从码流中解码得到当前块的位移矢量的符号和数值;或者也可以是从码流中解码得到联合类型指示信息(joint_type),联合类型指示信息用于指示当前块的位移矢量残差与当前块的预测矢量之间的分量的一致性,也即,该联合类型指示信息能够指示当前块的位移矢量残差与当前块的预测矢量之间的分量是否一致,根据联合类型指示信息解码得到当前块的位移矢量残差。
比如,若该联合类型指示信息指示位移矢量残差与预测矢量之间的水平分量一致,竖直分量不一致,那么只需要从码流中解码竖直分量即可,这种情况下编码端也无需在码流中编码位移矢量残差的水平分量;若该联合类型指示信息指示位移矢量残差与预测矢量之间的水平分量不一致,竖直分量一致,那么只需要从码流中解码水平分量即可,这种情况下编码端无需在码 流中编码位移矢量残差的竖直分量;若该联合类型指示信息指示位移矢量残差与预测矢量之间的水平分量与竖直分量都一致,那么无需从码流解码位移矢量残差,这种情况下编码端无需在码流中编码位移矢量残差;若该联合类型指示信息指示位移矢量残差与预测矢量之间的水平分量与竖直分量均不一致,那么需要从码流解码位移矢量残差的水平分量和竖直分量。
图12示出了根据本申请的一个实施例的视频编码方法的流程图,该视频编码方法可以由具有计算处理功能的设备来执行,比如可以由终端设备或服务器来执行。参照图12所示,该视频编码方法至少包括步骤S1210至步骤S1230,详细介绍如下:
在步骤S1210中,根据参考帧为当前帧的已编码块的位移矢量,生成预测矢量候选列表;
在步骤S1220中,从预测矢量候选列表中选择待编码的当前块的预测矢量;
在步骤S1230中,基于当前块的预测矢量对当前块进行编码处理。
在一些实施例中,从预测矢量候选列表中选择待编码的当前块的预测矢量,包括:从码流中解码得到预测矢量索引信息;
根据预测矢量索引信息,从预测矢量候选列表中的相应位置处,选择一个预测矢量作为待编码的当前块的预测矢量。
在一些实施例中,从码流中解码得到预测矢量索引信息,包括:
当根据预测矢量候选列表的长度,确定需要解码预测矢量索引信息时,则从码流中解码得到预测矢量索引信息。
在一些实施例中,预测矢量索引信息采用基于上下文的多符号算数编码。
在一些实施例中,码流中包含有预测矢量索引信息的最大值,最大值位于序列头、图像头或者片头中;
其中,不同的位移矢量预测模式对应的最大值相同或者不同。
在一些实施例中,从预测矢量候选列表中选择待编码的当前块的预测矢量,包括:
按照设定的选择策略,从预测矢量候选列表中选择一个预测矢量作为待编码的当前块的预测矢量。
在一些实施例中,根据参考帧为当前帧的已编码块的位移矢量,生成预测矢量候选列表,包括:
从参考帧为当前帧的已编码块的位移矢量中,获取当前块相邻近的已编码块的位移矢量;
按照设定顺序,对当前块相邻近的已编码块的位移矢量进行排序,得到第一位移矢量列表;
根据第一位移矢量列表,生成预测矢量候选列表。
在一些实施例中,相邻近的已编码块包括以下至少一个:处于当前块上方n 1行的已编码块、处于当前块左方n 2列的已编码块;其中,n 1和n 2为正整数。
在一些实施例中,根据参考帧为当前帧的已编码块的位移矢量,生成预测矢量候选列表,包括:
从参考帧为当前帧的已编码块的位移矢量中,获取历史已编码块的位移矢量;
按照设定顺序,将历史已编码块的位移矢量按照先入先出的方式添加至设定长度的队列中,得到第二位移矢量列表;
根据第二位移矢量列表,生成预测矢量候选列表。
在一些实施例中,视频编码方法还包括:
在将历史已编码块的位移矢量添加至队列中时,若队列中已存在相同的位移矢量,则删掉队列中已存在的相同的位移矢量。
在一些实施例中,一个第二位移矢量列表对应至少一个待编码区域,待编码区域包括以下中的一个:
当前块所在的最大编码块、当前块所在的最大编码块中的行、当前块所在的片。
在一些实施例中,视频编码方法还包括:
若目标待编码区域所对应的第二位移矢量列表中的位移矢量超过设定值,则停止向目标待编码区域所对应的第二位移矢量列表中添加位移矢量;或者,
若向目标待编码区域所对应的第二位移矢量列表中添加位移矢量的次数超过设定次数,则 停止向目标待编码区域所对应的第二位移矢量列表中添加位移矢量。
在一些实施例中,根据参考帧为当前帧的已编码块的位移矢量,生成预测矢量候选列表,包括:
从参考帧为当前帧的已编码块的位移矢量中,获取当前块相邻近的已编码块的位移矢量,并按照设定顺序对当前块相邻近的已编码块的位移矢量进行排序,得到第一位移矢量列表;
从参考帧为当前帧的已编码块的位移矢量中,获取历史已编码块的位移矢量,并按照设定顺序将历史已编码块的位移矢量按照先入先出的方式添加至设定长度的队列中,得到第二位移矢量列表;
根据第一位移矢量列表和第二位移矢量列表,生成预测矢量候选列表。
在一些实施例中,根据第一位移矢量列表和第二位移矢量列表,生成预测矢量候选列表,包括:
将第一位移矢量列表和第二位移矢量列表进行合并,得到合并后的位移矢量列表;
从合并后的位移矢量列表中删除重复的位移矢量,得到预测矢量候选列表。
在一些实施例中,视频编码方法还包括:
检测第一位移矢量列表和第二位移矢量列表中的位移矢量;
在将第一位移矢量列表和第二位移矢量列表进行合并的过程中,删除未处于预设区域内的位移矢量;
其中,预设区域包括以下至少一个:当前图像、当前片、当前的全局参考范围和当前的局部参考范围。
在一些实施例中,其中,设定顺序包括以下中的一个:已编码块的编码顺序、已编码块的扫描顺序、已编码块的类型、位移矢量的权重;
其中,权重与以下至少一个因素相关联:位移矢量的重复次数、位移矢量所对应的块大小、位移矢量所对应的块位置。
在一些实施例中,视频编码方法还包括:
从码流中解码得到参考范围类别指示信息,参考范围类别指示信息用于指示帧内块复制模式所使用的目标参考范围,目标参考范围包括全局参考范围和局部参考范围中的至少一个;
从预测矢量候选列表中选择待编码的当前块的预测矢量,包括:
从预测矢量候选列表中,选择与目标参考范围相对应的预测矢量作为待编码的当前块的预测矢量。
在一些实施例中,根据参考帧为当前帧的已编码块的位移矢量,生成预测矢量候选列表,包括:
从参考帧为当前帧的已编码块的位移矢量中,获取所对应的参考块处于目标参考范围内、且采用帧内块复制模式的目标已编码块;
根据目标已编码块的位移矢量,生成预测矢量候选列表。
在一些实施例中,根据参考帧为当前帧的已编码块的位移矢量,生成预测矢量候选列表,包括:
根据参考帧为当前帧的已编码块的位移矢量,确定当前块的参考块;
在当前块的参考块中,确定处于目标参考范围内的目标参考块;
根据目标参考块所对应的已编码块的位移矢量,生成预测矢量候选列表。
在一些实施例中,参考范围类别指示信息为图像级的参考范围类别指示信息或者片级的参考范围类别指示信息;视频编码方法还包括:
若预测矢量候选列表中位移矢量的数量未达到设定数量,则根据图像级的参考范围类别指示信息或者片级的参考范围类别指示信息,向预测矢量候选列表中填充预设的块矢量。
在一些实施例中,视频编码方法还包括:从码流中解码得到位移矢量预测模式指示信息;
基于当前块的预测矢量对当前块进行编码处理,包括:
若位移矢量预测模式指示信息指示当前块采用跳过预测模式,则将当前块的预测矢量作为当前块的位移矢量,且跳过对当前块的残差系数的编码过程;
若位移矢量预测模式指示信息指示当前块采用近运动矢量预测模式,则将当前块的预测矢量作为当前块的位移矢量,并对当前块的残差系数进行编码;
若位移矢量预测模式指示信息指示当前块采用新运动矢量预测模式,则从码流中解码得到当前块的位移矢量残差,根据位移矢量残差和当前块的预测矢量,确定当前块的位移矢量,并对当前块的残差系数进行编码。
在一些实施例中,从码流中解码得到位移矢量预测模式指示信息,包括:若根据预测矢量候选列表的长度,确定需要解码位移矢量预测模式指示信息,则从码流中解码得到位移矢量预测模式指示信息。
在一些实施例中,当位移矢量预测模式指示信息指示当前块采用新运动矢量预测模式时,从码流中解码得到当前块的位移矢量残差,包括:
从码流中解码得到当前块的位移矢量的符号和数值;或者,
从码流中解码得到联合类型指示信息,联合类型指示信息用于指示当前块的位移矢量残差与当前块的预测矢量之间的分量的一致性,根据联合类型指示信息,解码得到当前块的位移矢量残差。
需要说明的是,上述视频编码方法中的实现细节与前述实施例中所述的视频解码方法的实现细节类似,不再赘述。
总体而言,本申请实施例的技术方案可以根据参考帧为当前帧的已解码块的位移矢量构建更适合的预测矢量候选列表,以保证从中选择出更为准确的预测矢量,有利于提升编码性能。并且也可以根据参考范围类型选择合适的默认预测矢量导出方法,以针对不同的参考范围,选择对应的预测矢量,进而可以提高矢量预测的准确率,降低位移矢量的编码代价,提升编码性能。
以下以解码端的角度,再次对本申请实施例的技术方案的实现细节进行详细阐述:
在一些实施例中,在对当前块进行解码时,需要解码当前块的位移矢量,以下以当前块为IBC块为例进行说明,IBC块的位移矢量为块矢量bv(bv_x,bv_y)。
在一些实施例中,码流中可以包含bvp_mode,指示所使用的块矢量预测模式,以下预测模式可以单独使用或组合在一起使用:
A)块矢量预测模式包括Skip预测模式,在这种预测模式下,当前块的bv等于预测块矢量(Block Vector Prediction,bvp),且当前块的残差系数默认为0,不需要进行解码。
B)块矢量预测模式包括近运动矢量(Near Motion Vector,NearMV)预测模式,在这种预测模式下,当前块的bv等于bvp,但是需要解码当前块的残差系数。
C)块矢量预测模式包括新运动矢量(New Motion Vector,NewMV)预测模式,在这种预测模式下,需要解码bvd(Block Vector Difference,块矢量残差),当前块的bv=bvd+bvp,同时需要解码当前块的残差系数。
在一些实施例中,在解码bvd时既可以采用直接解码的方式,即从码流中解码bvd的符号和绝对值。或者也可以将bvd的解码方式分为几类,然后先解码joint_type确认所属类别,再进行bvd的解码。例如分为以下4种情况:bvd与bvp各分量均一致,不需要解码bvd;bvd与bvp水平分量一致,竖直分量不一致,此时只需解码bvd的竖直分量;bvd与bvp水平分量不一致,竖直分量一致,此时只需解码bvd的水平分量;bvd与bvp各分量都不一致,此时需要从码流中解码bvd的水平分量和竖直分量。
在本申请的一个实施例中,可以从预测块矢量候选列表中导出当前块的bvp,比如可以解码预测块矢量索引bvp_index,然后根据bvp_index所指示的bvp在预测块矢量候选列表中的位置来导出当前块的bvp;或者也可以按照固定的规则顺序导出bvp,不需要解码索引,如检查预测块矢量候选列表中前2个候选bvp,然后将第一个不为0的候选bvp导出为当前块的bvp。
需要说明的是:如果码流中包含用于指示当前IBC块的参考块所在的参考范围类别指示信息ibc_ref_type,那么需要使用相应类别的bvp。比如指示当前IBC块的参考块在全局参考范围内,那么需要使用与该全局参考范围相对应的bvp;若指示当前IBC块的参考块在局部参考范围内,那么需要使用与该局部参考范围相对应的bvp。
ibc_ref_type属于块级的参考范围类别指示信息,码流中也可以包含图像级别的参考范围类别指示信息,或者片级的参考范围类别指示信息,以分别指示当前图像或当前片内的IBC块的参考范围。当然也可以通过多级的参考范围类别指示信息进行指示,比如通过图像级别的参考范围类别指示信息和块级的参考范围类别指示信息。
在本申请的一个实施例中,预测块矢量候选列表bvp_list的构建方法如下:
1、预测块矢量候选列表bvp_list可包括空域相邻已解码块的块矢量信息,即空域块矢量预测列表(space based block vector prediction,SBVP)。
示例性地,可以构建一个长度为N1的SBVP,按照设定顺序记录空域邻近已解码IBC块的BV。
其中,空域相邻已解码IBC块包括当前块上方N1行或左方N2列的已解码块,N1和N2为正整数。该设定顺序可以是空域邻近已解码IBC块的解码顺序、扫描顺序、空域邻近已解码IBC块的位移矢量所对应的权重等。该位移矢量所对应的权重可以与以下至少一个因素相关联:位移矢量的重复次数、位移矢量所对应的块大小、位移矢量所对应的块位置。
在一些实施例中,SBVP可以根据bv的参考范围类型(如全局参考范围、局部参考范围等)进行构建,比如可以只包含参考块在对应参考范围内的bv。
2、预测块矢量候选列表bvp_list可包括历史已解码块的块矢量信息,即历史块矢量预测列表(history based block vector prediction,HBVP)。
示例性地,可以构建一个长度为N2的HBVP,按照设定顺序记录已解码IBC块的BV(或者是参考帧为当前帧的已解码块的BV),每完成一个IBC块的解码后,将该解码块的bv按先入先出(First Input First Output,FIFO)的顺序加入HBVP,其中,解码顺序与当前块邻近的bv具有更高的优先级。
需要说明的是:在将bv插入HBVP时可进行查重操作,如果列表中存在与新的需要插入的BV重复的BV,则将HBVP中重复的BV删除。
在一些实施例中,HBVP可以具有检查次数限制,对于一个SB、SB行或tile,当加入HBVP的BV数量超过预设值时,可以停止将已解码块的BV加入HBVP。并且HBVP也可以按SB、SB行或tile进行重置。
HBVP中的bv也可以具有不同的排列顺序,比如按照已解码IBC块的解码顺序、扫描顺序、已解码IBC块的位移矢量所对应的权重等。该位移矢量所对应的权重可以与以下至少一个因素相关联:位移矢量的重复次数、位移矢量所对应的块大小、位移矢量所对应的块位置。
3、预测块矢量候选列表bvp_list除了单独由SBVP或HBVP构成之外,还可以是由两者的组合构成。
如果由SBVP和HBVP共同构建bvp_list,那么可以进行查重操作使列表中不含重复的实例。同时,如果码流中包含有参考范围类别指示信息(可以是块级的参考范围类别指示信息ibc_ref_type,也可以是图像级或者片级的参考范围类别指示信息),那么可以使用以下方法构建bvp_list:
使用参考块在参考范围类别指示信息所指示的参考范围内的已解码IBC块的bv构建bvp_list;或者先使用已解码块的bv计算当前IBC块的参考块,然后仅当该参考块在参考范围类别指示信息所指示的参考范围内时,才将该已解码块的bv用于构建bvp_list。
可见,在本申请的实施例中,码流中包含有参考范围类别指示信息、bvp_mode和bvp_index中的一个或多个,以下以参考范围类别指示信息是ibc_ref_type为例,对本申请实施例进行说明:
在一些实施例中:码流中包括ibc_ref_type、bvp_mode和bvp_index。
解码端的处理过程是:解码ibc_ref_type,如果ibc_ref_type的值为0,指示当前IBC块的参考块位于局部参考范围,否则当前IBC块的参考块位于全局参考范围。
解码bvp_mode,根据bvp_mode的值确认使用的块矢量预测模式:
若bvp_mode值为0表示使用skip模式,当前块的bv=bvp,跳过残差系数的解码;若bvp_mode的值为1表示使用NearMv模式,当前块的bv=bvp;若bvp_mode的值为2表示使用NewMV模式,采用基于类别(即joint_tpye)的方法解码得到bvd,当前块的bv=bvd+bvp。
解码bvp_index确认bvp在bvp_list中的位置。
在该实施例中,构建的bvp_list的最大长度为8,在构建时,仅使用与ibc_ref_type对应的候选构建预测块矢量候选列表。并且允许使用空域邻近或历史编码顺序邻近的候选bv,比如可以先向bvp_list中加入SBVP中的候选bv,如果bvp_list列表未填满,再加入HBVP中的候选bv。
在一些实施例中:码流中包括bvp_mode和bvp_index。
在该实施例中,块矢量预测模式有2种,包括NearMV模式和NewMV模式。可以根据bvp_index确认bvp在bvp_list的位置,然后确定出bvp。
在该实施例中,构建的bvp_list的最大长度为8,在具体构建时,可以只使用SBVP中的候选bv。
在一些实施例中:码流中包括bvp_index。
在该实施例中,块矢量预测模式只有一种预测模式NewMV模式。可以根据bvp_index确认bvp在bvp_list的位置,然后确定出bvp。
在该实施例中,构建的bvp_list的最大长度为8,在具体构建时,可以只使用SBVP中的候选bv。
在一些实施例中:码流中包含指示参考范围的标志、bvp_mode和bvp_idx。
在一些实施例中,指示参考范围的标志可以是allowed_global_intrabc和allowed_local_intrabc,这两个标志分别指示当前图像或者当前片中的块是否允许使用全局参考范围或局部参考范围。
比如,若allowed_global_intrabc的值为1,则指示允许使用全局参考范围;若allowed_global_intrabc的值为0,则指示不允许使用全局参考范围。若allowed_local_intrabc的值为1,则指示允许使用局部参考范围;若allowed_local_intrabc的值为0,则指示不允许使用局部参考范围。
解码端除了解码指示参考范围的标志之外,还包括:
解码bvp_mode确认使用的模式,比如可以包含两种模式,0表示是NewMV模式,1表示是NearMV模式。
解码bvp_index确认bvp在bvp_list中的位置。
在该实施例中,构建的bvp_list的最大长度为4,bvp_list由SBVP和HBVP构成,如果列表长度小于4,则根据参考范围填充bvp_list,具体如下:
A)如果允许使用全局参考范围和局部参考范围,则可以向预测矢量候选列表中添填充{(0,-sb_h)、(-sb_w-D,0)、(0,-h')、(-w',0)},其中,SB大小为128,D为256;
B)如果仅允许使用局部参考范围,则可以向预测矢量候选列表中添加{(0,-h')、(-w',0)、(-w',-h')、(0,-2×h')};
C)如果仅允许全局参考范围,则可以向预测矢量候选列表中添加{(0,-sb_h)、(-sb_w-D,0)、(-sb_w,-sb_h)、(-2×sb_w,-sb_h)},其中,SB大小为128,D为256;
D)填充预测矢量候选列表时可以进行查重操作,删除重复的预测矢量;
其中,w'=min(b_w,64);h'=min(b_h,64)。
综上,本申请实施例的技术方案可以根据参考范围类型选择合适的默认预测矢量导出方法,以针对不同的参考范围,选择对应的预测矢量,进而可以提高矢量预测的准确率,降低位移矢量的编码代价,提升编码性能。并且也可以根据参考帧为当前帧的已解码块的位移矢量构建更适合的预测矢量候选列表,以保证从中选择出更为准确的预测矢量,有利于提升编码性能。
以下介绍本申请的装置实施例,可以用于执行本申请上述实施例中的方法。对于本申请装置实施例中未披露的细节,请参照本申请上述的方法实施例。
图13示出了根据本申请的一个实施例的视频解码装置的框图,该视频解码装置可以设置在具有计算处理功能的设备内,比如可以设置在终端设备或服务器内。
参照图13所示,根据本申请的一个实施例的视频解码装置1300,包括:第一生成单元1302、第一选择单元1304和第一处理单元1306。
其中,第一生成单元1302配置为根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表;第一选择单元1304配置为从所述预测矢量候选列表中选择待解码的当前块的预测矢量;第一处理单元1306配置为基于所述当前块的预测矢量对所述当前块进行解码处理。
在一些实施例中,所述第一选择单元1304配置为:从码流中解码得到预测矢量索引信息,根据所述预测矢量索引信息从所述预测矢量候选列表中的相应位置处选择一个预测矢量作为所述当前块的预测矢量。
在一些实施例中,所述第一选择单元1304还用于:根据所述预测矢量候选列表的长度确定是否需要解码所述预测矢量索引信息;若确定需要解码所述预测矢量索引信息,则从所述码流中解码得到预测矢量索引信息。
在一些实施例中,所述预测矢量索引信息采用基于上下文的多符号算数编码。
在一些实施例中,所述码流中包含有所述预测矢量索引信息的最大值,所述最大值位于序列头、图像头或者片头中;其中,不同的位移矢量预测模式对应的所述最大值相同或者不同。
在一些实施例中,所述第一选择单元1304配置为:按照设定的选择策略,从所述预测矢量候选列表中选择一个预测矢量作为所述当前块的预测矢量。
在一些实施例中,所述第一生成单元1302配置为:从参考帧为当前帧的已解码块的位移矢量中,获取所述当前块相邻近的已解码块的位移矢量;按照设定顺序,对所述当前块相邻近的已解码块的位移矢量进行排序,以生成第一位移矢量列表;根据所述第一位移矢量列表,生成所述预测矢量候选列表。
在一些实施例中,所述相邻近的已解码块包括以下至少一个:处于所述当前块上方n 1行的已解码块、处于所述当前块左方n 2列的已解码块;其中,n 1和n 2为正整数。
在一些实施例中,所述第一生成单元1302配置为:从参考帧为当前帧的已解码块的位移矢量中,获取历史已解码块的位移矢量;按照设定顺序,将所述历史已解码块的位移矢量按照先入先出的方式添加至设定长度的队列中,以生成第二位移矢量列表;根据所述第二位移矢量列表,生成所述预测矢量候选列表。
在一些实施例中,所述第一生成单元1302还配置为:在将所述历史已解码块的位移矢量添加至所述队列中时,若所述队列中已存在相同的位移矢量,则删掉所述队列中已存在的相同的位移矢量。
在一些实施例中,一个所述第二位移矢量列表对应于至少一个待解码区域,所述待解码区域包括以下中的一个:所述当前块所在的最大编码块、所述当前块所在的最大编码块中的行、所述当前块所在的片。
在一些实施例中,所述第一生成单元1302还配置为:若目标待解码区域所对应的第二位移矢量列表中的位移矢量超过设定值,则停止向所述目标待解码区域所对应的第二位移矢量列表中添加位移矢量。
在一些实施例中,所述第一生成单元1302还配置为:若向目标待解码区域所对应的第二位移矢量列表中添加位移矢量的次数超过设定次数,则停止向所述目标待解码区域所对应的第二位移矢量列表中添加位移矢量。
在一些实施例中,所述第一生成单元1302配置为:从参考帧为当前帧的已解码块的位移矢量中获取所述当前块相邻近的已解码块的位移矢量,并按照设定顺序对所述当前块相邻近的已解码块的位移矢量进行排序,以生成第一位移矢量列表;
从参考帧为当前帧的已解码块的位移矢量中,获取历史已解码块的位移矢量,并按照设定顺序将所述历史已解码块的位移矢量按照先入先出的方式添加至设定长度的队列中,以生成第二位移矢量列表;
根据所述第一位移矢量列表和所述第二位移矢量列表,生成所述预测矢量候选列表。
在一些实施例中,所述第一生成单元1302配置为:将所述第一位移矢量列表和所述第二位移矢量列表进行合并,并删除重复的位移矢量,以生成所述预测矢量候选列表。
在一些实施例中,所述第一生成单元1302还配置为:检测所述第一位移矢量列表和所述第二位移矢量列表中是否存在未处于预设区域内的位移矢量,所述预设区域包括以下至少一个: 当前图像、当前片、当前的全局参考范围和当前的局部参考范围;在将所述第一位移矢量列表和所述第二位移矢量列表进行合并的过程中,删除未处于所述预设区域内的位移矢量。
在一些实施例中,所述设定顺序包括以下中的一个:已解码块的解码顺序、已解码块的扫描顺序、已解码块的类型、位移矢量所对应的权重;其中,所述权重与以下至少一个因素相关联:位移矢量的重复次数、位移矢量所对应的块大小、位移矢量所对应的块位置。
在一些实施例中,所述视频解码装置还包括:解码单元,配置为从码流中解码得到参考范围类别指示信息,所述参考范围类别指示信息用于指示帧内块复制模式所使用的目标参考范围,所述目标参考范围包括全局参考范围和局部参考范围中的至少一个;所述第一选择单元1304配置为:从所述预测矢量候选列表中选择与所述目标参考范围相对应的预测矢量。
在一些实施例中,所述第一生成单元1302配置为:从参考帧为当前帧的已解码块的位移矢量中,获取所对应的参考块处于所述目标参考范围内、且采用帧内块复制模式的目标已解码块;根据所述目标已解码块的位移矢量生成所述预测矢量候选列表。
在一些实施例中,所述第一生成单元1302配置为:根据参考帧为当前帧的已解码块的位移矢量,计算所述当前块的参考块;确定所述当前块的参考块中处于所述目标参考范围内的目标参考块;根据所述目标参考块所对应的已解码块的位移矢量,生成所述预测矢量候选列表。
在一些实施例中,所述参考范围类别指示信息为图像级的参考范围类别指示信息或者片级的参考范围类别指示信息;所述第一生成单元1302还配置为:若所述预测矢量候选列表中包含的位移矢量的数量未达到设定数量,则根据所述图像级的参考范围类别指示信息或者片级的参考范围类别指示信息,向所述预测矢量候选列表中填充预设的块矢量。
在一些实施例中,所述视频解码装置还包括:解码单元,配置为从码流中解码得到位移矢量预测模式指示信息;所述第一处理单元1306配置为:
若所述位移矢量预测模式指示信息指示所述当前块采用Skip预测模式,则将所述当前块的预测矢量作为所述当前块的位移矢量,且跳过对所述当前块的残差系数的解码过程,以对所述当前块进行解码处理;
若所述位移矢量预测模式指示信息指示所述当前块采用NearMV预测模式,则将所述当前块的预测矢量作为所述当前块的位移矢量,并对所述当前块的残差系数进行解码,以对所述当前块进行解码处理;
若所述位移矢量预测模式指示信息指示所述当前块采用NewMV预测模式,则从所述码流中解码得到所述当前块的位移矢量残差,根据所述位移矢量残差和所述当前块的预测矢量计算所述当前块的位移矢量,并对所述当前块的残差系数进行解码,以对所述当前块进行解码处理。
在一些实施例中,所述解码单元还配置为:根据所述预测矢量候选列表的长度确定是否需要解码所述位移矢量预测模式指示信息;若确定需要解码所述位移矢量预测模式指示信息,则从所述码流中解码得到所述位移矢量预测模式指示信息。
在一些实施例中,所述第一处理单元1306从所述码流中解码得到所述当前块的位移矢量残差的过程,包括:从所述码流中解码得到所述当前块的位移矢量的符号和数值;或者
从所述码流中解码得到联合类型指示信息,所述联合类型指示信息用于指示所述当前块的位移矢量残差与所述当前块的预测矢量之间的分量是否一致,根据所述联合类型指示信息解码得到所述当前块的位移矢量残差。
图14示出了根据本申请的一个实施例的视频编码装置的框图,该视频编码装置可以设置在具有计算处理功能的设备内,比如可以设置在终端设备或服务器内。
参照图14所示,根据本申请的一个实施例的视频编码装置1400,包括:第二生成单元1402、第二选择单元1404和第二处理单元1406。
其中,第二生成单元1402配置为根据参考帧为当前帧的已编码块的位移矢量,生成预测矢量候选列表;第二选择单元1404配置为从所述预测矢量候选列表中选择待编码的当前块的预测矢量;第二处理单元1406配置为基于所述当前块的预测矢量对所述当前块进行编码处理。
图15示出了适于用来实现本申请实施例的电子设备的计算机系统的结构示意图。
需要说明的是,图15示出的电子设备的计算机系统1500仅是一个示例,不应对本申请实 施例的功能和使用范围带来任何限制。
如图15所示,计算机系统1500包括中央处理单元(Central Processing Unit,CPU)1501,其可以根据存储在只读存储器(Read-Only Memory,ROM)1502中的程序或者从存储部分1508加载到随机访问存储器(Random Access Memory,RAM)1503中的程序而执行各种适当的动作和处理,例如执行上述实施例中所述的方法。在RAM 1503中,还存储有系统操作所需的各种程序和数据。CPU 1501、ROM 1502以及RAM 1503通过总线1504彼此相连。输入/输出(Input/Output,I/O)接口1505也连接至总线1504。
以下部件连接至I/O接口1505:包括键盘、鼠标等的输入部分1506;包括诸如阴极射线管(Cathode Ray Tube,CRT)、液晶显示器(Liquid Crystal Display,LCD)等以及扬声器等的输出部分1507;包括硬盘等的存储部分1508;以及包括诸如局域网(Local Area Network,LAN)卡、调制解调器等的网络接口卡的通信部分1509。通信部分1509经由诸如因特网的网络执行通信处理。驱动器1510也根据需要连接至I/O接口1505。可拆卸介质1511,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1510上,以便于从其上读出的计算机程序根据需要被安装入存储部分1508。
根据本申请的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读存储介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的计算机程序。在这样的实施例中,该计算机程序可以通过通信部分1509从网络上被下载和安装,和/或从可拆卸介质1511被安装。在该计算机程序被中央处理单元(CPU)1501执行时,执行本申请的系统中限定的各种功能。
需要说明的是,本申请实施例所示的计算机可读存储介质可以是只读存储器(Read-Only Memory,ROM)、随即存储器(Random Access Memory,RAM)、可擦写可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM)、电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、闪存、磁表面存储器、光盘、或CD-ROM等存储器;也可以是包括上述存储器之一或任意组合的各种设备。
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现,所描述的单元也可以设置在处理器中。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例中描述的电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读存储介质承载有一个或者多个程序,当上述一个或者多个程序被一个该电子设备执行时,使得该电子设备实现上述实施例中所述的方法。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元。反之,上文描述的一个模块或者单元的特征和功能可以划分为由多个模块或者单元来具体化。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本申请实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、触控终端、或者网络设备等)执行根据本申请实施方式的方法。
本领域技术人员在考虑说明书及实践这里公开的实施方式后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。

Claims (29)

  1. 一种视频解码方法,所述视频解码方法包括:
    根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表;
    从所述预测矢量候选列表中选择待解码的当前块的预测矢量;
    基于所述当前块的预测矢量对所述当前块进行解码处理。
  2. 根据权利要求1所述的视频解码方法,其中,所述从所述预测矢量候选列表中选择待解码的当前块的预测矢量,包括:
    从码流中解码得到预测矢量索引信息;
    根据所述预测矢量索引信息,从所述预测矢量候选列表中的相应位置处,选择一个预测矢量作为待解码的当前块的预测矢量。
  3. 根据权利要求2所述的视频解码方法,其中,所述从码流中解码得到预测矢量索引信息,包括:
    当根据所述预测矢量候选列表的长度,确定需要解码所述预测矢量索引信息时,则从所述码流中解码得到预测矢量索引信息。
  4. 根据权利要求2或3所述的视频解码方法,其中,所述预测矢量索引信息采用基于上下文的多符号算数编码。
  5. 根据权利要求2所述的视频解码方法,其中,所述码流中包含有所述预测矢量索引信息的最大值,所述最大值位于序列头、图像头或者片头中;
    其中,不同的位移矢量预测模式对应的所述最大值相同或者不同。
  6. 根据权利要求1所述的视频解码方法,其中,所述从所述预测矢量候选列表中选择待解码的当前块的预测矢量,包括:
    按照设定的选择策略,从所述预测矢量候选列表中选择一个预测矢量作为待解码的当前块的预测矢量。
  7. 根据权利要求1所述的视频解码方法,其中,所述根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表,包括:
    从参考帧为当前帧的已解码块的位移矢量中,获取所述当前块相邻近的已解码块的位移矢量;
    按照设定顺序,对所述当前块相邻近的已解码块的位移矢量进行排序,得到第一位移矢量列表;
    根据所述第一位移矢量列表,生成所述预测矢量候选列表。
  8. 根据权利要求7所述的视频解码方法,其中,所述相邻近的已解码块包括以下至少一个:处于所述当前块上方n 1行的已解码块、处于所述当前块左方n 2列的已解码块;
    其中,n 1和n 2为正整数。
  9. 根据权利要求1所述的视频解码方法,其中,所述根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表,包括:
    从参考帧为当前帧的已解码块的位移矢量中,获取历史已解码块的位移矢量;
    按照设定顺序,将所述历史已解码块的位移矢量按照先入先出的方式添加至设定长度的队列中,得到第二位移矢量列表;
    根据所述第二位移矢量列表,生成所述预测矢量候选列表。
  10. 根据权利要求9所述的视频解码方法,其中,所述视频解码方法还包括:
    在将所述历史已解码块的位移矢量添加至所述队列中时,若所述队列中已存在 相同的位移矢量,则删掉所述队列中已存在的相同的位移矢量。
  11. 根据权利要求9所述的视频解码方法,其中,一个所述第二位移矢量列表对应至少一个待解码区域,所述待解码区域包括以下中的一个:
    所述当前块所在的最大编码块、所述当前块所在的最大编码块中的行、所述当前块所在的片。
  12. 根据权利要求11所述的视频解码方法,其中,所述视频解码方法还包括:
    若目标待解码区域所对应的第二位移矢量列表中的位移矢量超过设定值,则停止向所述目标待解码区域所对应的第二位移矢量列表中添加位移矢量;或者,
    若向目标待解码区域所对应的第二位移矢量列表中添加位移矢量的次数超过设定次数,则停止向所述目标待解码区域所对应的第二位移矢量列表中添加位移矢量。
  13. 根据权利要求1所述的视频解码方法,其中,所述根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表,包括:
    从参考帧为当前帧的已解码块的位移矢量中,获取所述当前块相邻近的已解码块的位移矢量,并按照设定顺序对所述当前块相邻近的已解码块的位移矢量进行排序,得到第一位移矢量列表;
    从参考帧为当前帧的已解码块的位移矢量中,获取历史已解码块的位移矢量,并按照设定顺序将所述历史已解码块的位移矢量按照先入先出的方式添加至设定长度的队列中,得到第二位移矢量列表;
    根据所述第一位移矢量列表和所述第二位移矢量列表,生成所述预测矢量候选列表。
  14. 根据权利要求13所述的视频解码方法,其中,所述根据所述第一位移矢量列表和所述第二位移矢量列表,生成所述预测矢量候选列表,包括:
    将所述第一位移矢量列表和所述第二位移矢量列表进行合并,得到合并后的位移矢量列表;
    从合并后的位移矢量列表中删除重复的位移矢量,得到所述预测矢量候选列表。
  15. 根据权利要求14所述的视频解码方法,其中,所述视频解码方法还包括:
    检测所述第一位移矢量列表和所述第二位移矢量列表中的位移矢量;
    在将所述第一位移矢量列表和所述第二位移矢量列表进行合并的过程中,删除未处于预设区域内的位移矢量;
    其中,所述预设区域包括以下至少一个:当前图像、当前片、当前的全局参考范围和当前的局部参考范围。
  16. 根据权利要求7、8或13所述的视频解码方法,其中,所述设定顺序包括以下中的一个:已解码块的解码顺序、已解码块的扫描顺序、已解码块的类型、位移矢量的权重;
    其中,所述权重与以下至少一个因素相关联:位移矢量的重复次数、位移矢量所对应的块大小、位移矢量所对应的块位置。
  17. 根据权利要求1所述的视频解码方法,其中,所述视频解码方法还包括:
    从码流中解码得到参考范围类别指示信息,所述参考范围类别指示信息用于指示帧内块复制模式所使用的目标参考范围,所述目标参考范围包括全局参考范围和局部参考范围中的至少一个;
    所述从所述预测矢量候选列表中选择待解码的当前块的预测矢量,包括:
    从所述预测矢量候选列表中,选择与所述目标参考范围相对应的预测矢量作为所述待解码的当前块的预测矢量。
  18. 根据权利要求17所述的视频解码方法,其中,所述根据参考帧为当前帧的 已解码块的位移矢量,生成预测矢量候选列表,包括:
    从参考帧为当前帧的已解码块的位移矢量中,获取所对应的参考块处于所述目标参考范围内、且采用帧内块复制模式的目标已解码块;
    根据所述目标已解码块的位移矢量,生成所述预测矢量候选列表。
  19. 根据权利要求17所述的视频解码方法,其中,所述根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表,包括:
    根据参考帧为当前帧的已解码块的位移矢量,确定所述当前块的参考块;
    在所述当前块的参考块中,确定处于所述目标参考范围内的目标参考块;
    根据所述目标参考块所对应的已解码块的位移矢量,生成所述预测矢量候选列表。
  20. 根据权利要求17所述的视频解码方法,其中,所述参考范围类别指示信息为图像级的参考范围类别指示信息或者片级的参考范围类别指示信息;所述视频解码方法还包括:
    若所述预测矢量候选列表中位移矢量的数量未达到设定数量,则根据所述图像级的参考范围类别指示信息或者片级的参考范围类别指示信息,向所述预测矢量候选列表中填充预设的块矢量。
  21. 根据权利要求1至3、5至15、17至20中任一项所述的视频解码方法,其中,所述视频解码方法还包括:从码流中解码得到位移矢量预测模式指示信息;
    所述基于所述当前块的预测矢量对所述当前块进行解码处理,包括:
    若所述位移矢量预测模式指示信息指示所述当前块采用跳过预测模式,则将所述当前块的预测矢量作为所述当前块的位移矢量,且跳过对所述当前块的残差系数的解码过程;
    若所述位移矢量预测模式指示信息指示所述当前块采用近运动矢量预测模式,则将所述当前块的预测矢量作为所述当前块的位移矢量,并对所述当前块的残差系数进行解码;
    若所述位移矢量预测模式指示信息指示所述当前块采用新运动矢量预测模式,则从所述码流中解码得到所述当前块的位移矢量残差,根据所述位移矢量残差和所述当前块的预测矢量,确定所述当前块的位移矢量,并对所述当前块的残差系数进行解码。
  22. 根据权利要求21所述的视频解码方法,其中,所述从码流中解码得到位移矢量预测模式指示信息,包括:
    若根据所述预测矢量候选列表的长度,确定需要解码所述位移矢量预测模式指示信息,则从所述码流中解码得到所述位移矢量预测模式指示信息。
  23. 根据权利要求21所述的视频解码方法,其中,当所述位移矢量预测模式指示信息指示所述当前块采用新运动矢量预测模式时,所述从所述码流中解码得到所述当前块的位移矢量残差,包括:
    从所述码流中解码得到所述当前块的位移矢量的符号和数值;或者,
    从所述码流中解码得到联合类型指示信息,所述联合类型指示信息用于指示所述当前块的位移矢量残差与所述当前块的预测矢量之间的分量的一致性,根据所述联合类型指示信息,解码得到所述当前块的位移矢量残差。
  24. 一种视频编码方法,所述方法包括:
    根据参考帧为当前帧的已编码块的位移矢量,生成预测矢量候选列表;
    从所述预测矢量候选列表中选择待编码的当前块的预测矢量;
    基于所述当前块的预测矢量对所述当前块进行编码处理。
  25. 一种视频解码装置,所述装置包括:
    第一生成单元,配置为根据参考帧为当前帧的已解码块的位移矢量,生成预测矢量候选列表;
    第一选择单元,配置为从所述预测矢量候选列表中选择待解码的当前块的预测矢量;
    第一处理单元,配置为基于所述当前块的预测矢量对所述当前块进行解码处理。
  26. 一种视频编码装置,所述装置包括:
    第二生成单元,配置为根据参考帧为当前帧的已编码块的位移矢量,生成预测矢量候选列表;
    第二选择单元,配置为从所述预测矢量候选列表中选择待编码的当前块的预测矢量;
    第二处理单元,配置为基于所述当前块的预测矢量对所述当前块进行编码处理。
  27. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至23中任一项所述的视频解码方法,或实现如权利要求24所述的视频编码方法。
  28. 一种电子设备,所述电子设备包括:
    一个或多个处理器;
    存储器,配置为存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述电子设备实现如权利要求1至23中任一项所述的视频解码方法,或实现如权利要求24所述的视频编码方法。
  29. 一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中,电子设备的处理器从所述计算机可读存储介质读取并执行所述计算机指令,使得所述电子设备执行如权利要求1至23中任一项所述的视频解码方法,或实现如权利要求24所述的视频编码方法。
PCT/CN2022/135499 2022-03-16 2022-11-30 视频编解码方法、装置、存储介质、电子设备及计算机程序产品 WO2023173809A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020247009420A KR20240051197A (ko) 2022-03-16 2022-11-30 비디오 인코딩 및 디코딩 방법, 장치, 저장 매체, 전자 기기 및 컴퓨터 프로그램 제품
US18/516,013 US20240089494A1 (en) 2022-03-16 2023-11-21 Video encoding and decoding method and apparatus, storage medium, electronic device, and computer program product

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210260543.1A CN116805968A (zh) 2022-03-16 2022-03-16 视频编解码方法、装置、计算机可读介质及电子设备
CN202210260543.1 2022-03-16

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/516,013 Continuation US20240089494A1 (en) 2022-03-16 2023-11-21 Video encoding and decoding method and apparatus, storage medium, electronic device, and computer program product

Publications (1)

Publication Number Publication Date
WO2023173809A1 true WO2023173809A1 (zh) 2023-09-21

Family

ID=88022138

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135499 WO2023173809A1 (zh) 2022-03-16 2022-11-30 视频编解码方法、装置、存储介质、电子设备及计算机程序产品

Country Status (4)

Country Link
US (1) US20240089494A1 (zh)
KR (1) KR20240051197A (zh)
CN (1) CN116805968A (zh)
WO (1) WO2023173809A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117615129A (zh) * 2024-01-23 2024-02-27 腾讯科技(深圳)有限公司 帧间预测方法、装置、计算机设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106464896A (zh) * 2014-07-07 2017-02-22 寰发股份有限公司 帧内区块复制搜索和补偿范围的方法
CN107027038A (zh) * 2016-01-29 2017-08-08 谷歌公司 动态参考运动矢量编码模式
WO2019036080A1 (en) * 2017-08-15 2019-02-21 Google Llc ESTIMATION OF CONSTRAINED MOTION FIELD FOR INTERPRETING
CN113709458A (zh) * 2020-05-22 2021-11-26 腾讯科技(深圳)有限公司 视频编解码中的位移矢量预测方法、装置及设备
CN113767622A (zh) * 2019-06-20 2021-12-07 Jvc建伍株式会社 动图像编码装置、动图像编码方法及动图像编码程序、动图像解码装置、动图像解码方法及动图像解码程序

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106464896A (zh) * 2014-07-07 2017-02-22 寰发股份有限公司 帧内区块复制搜索和补偿范围的方法
CN107027038A (zh) * 2016-01-29 2017-08-08 谷歌公司 动态参考运动矢量编码模式
WO2019036080A1 (en) * 2017-08-15 2019-02-21 Google Llc ESTIMATION OF CONSTRAINED MOTION FIELD FOR INTERPRETING
CN113767622A (zh) * 2019-06-20 2021-12-07 Jvc建伍株式会社 动图像编码装置、动图像编码方法及动图像编码程序、动图像解码装置、动图像解码方法及动图像解码程序
CN113709458A (zh) * 2020-05-22 2021-11-26 腾讯科技(深圳)有限公司 视频编解码中的位移矢量预测方法、装置及设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117615129A (zh) * 2024-01-23 2024-02-27 腾讯科技(深圳)有限公司 帧间预测方法、装置、计算机设备及存储介质
CN117615129B (zh) * 2024-01-23 2024-04-26 腾讯科技(深圳)有限公司 帧间预测方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
KR20240051197A (ko) 2024-04-19
US20240089494A1 (en) 2024-03-14
CN116805968A (zh) 2023-09-26

Similar Documents

Publication Publication Date Title
US20230024834A1 (en) Video decoding method, video encoding method, and related apparatuses
CN112291571A (zh) 视频解码方法及装置以及计算机设备和存储介质
EP3720131A1 (en) Interframe prediction method and device for video data
US20230017193A1 (en) Video decoding method, video encoding method, electronic device, and storage medium
WO2022116836A1 (zh) 视频解码方法、视频编码方法、装置及设备
WO2023005709A1 (zh) 视频编码方法、装置、介质及电子设备
CN112543337B (zh) 视频解码方法、装置、计算机可读介质及电子设备
US20240089494A1 (en) Video encoding and decoding method and apparatus, storage medium, electronic device, and computer program product
US20220417550A1 (en) Method and apparatus for constructing motion information list in video encoding and decoding and device
WO2022078339A1 (zh) 参考像素候选列表构建方法、装置、设备及存储介质
WO2022193870A1 (zh) 视频编解码方法、装置、计算机可读介质及电子设备
WO2022037458A1 (zh) 视频编解码中的运动信息列表构建方法、装置及设备
CN116805969A (zh) 视频编解码方法、装置、计算机可读介质及电子设备
WO2024109099A1 (zh) 视频编解码方法、装置、计算机可读介质及电子设备
WO2022174637A1 (zh) 视频编解码方法、装置、计算机可读介质及电子设备
US20240064298A1 (en) Loop filtering, video encoding, and video decoding methods and apparatus, storage medium, and electronic device
WO2023065890A1 (zh) 多媒体数据处理方法、装置、计算机设备、计算机可读存储介质及计算机程序产品
WO2024082632A1 (zh) 视频编解码方法、装置、计算机可读介质及电子设备
US20240144439A1 (en) Filtering method and apparatus, computer-readable medium
WO2022037478A1 (zh) 视频解码方法、视频编码方法、装置、介质及电子设备
KR20240074789A (ko) 루프 필터링 방법, 비디오 인코딩/디코딩 방법 및 장치, 매체, 및 전자 디바이스
CN117560502A (zh) 视频编码方法、装置、计算机可读介质及电子设备
CN115209146A (zh) 视频编解码方法、装置、计算机可读介质及电子设备
JP2024512662A (ja) 算術符号化のためのブロック・レベルのウィンドウ・サイズ更新のための方法および装置
CN115086656A (zh) 视频编解码方法、装置、计算机可读介质及电子设备

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: 22931820

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 20247009420

Country of ref document: KR

Kind code of ref document: A