Video processing method and apparatus, and medium and electronic device
By determining the filter processing of reference blocks and adjacent areas in video coding and decoding, the image discontinuity problem caused by intra-frame block copy prediction is solved, and the image coding and decoding quality is improved.
Patent Information
- Application Number
- PCT/CN2025/082105
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-19
- Filing Date
- 2025-03-12
- Publication Date
- 2025-09-25
AI Technical Summary
In traditional video coding and decoding schemes, intra-block copy prediction technology leads to poor decoded image quality, especially due to the discontinuity problem between the current block and the surrounding pixels.
By determining the reference block of the current block and its adjacent area and the adjacent area of the current block, a filter is used to filter the intra block copy prediction value to eliminate spatial discontinuity.
It improves the image encoding and decoding quality, reduces the discontinuity problem between image blocks and surrounding pixels, and improves the image reconstruction quality.
Smart Images

Figure CN2025082105_25092025_PF_FP_ABST
Abstract
Description
Video processing method, device, medium and electronic equipment
[0001] This application claims priority to the Chinese patent application with application number 202410334152.9 filed on March 19, 2024, and invention name “Video processing method, device, medium and electronic device”. Technical Field
[0002] The present application belongs to the field of video coding and decoding technology, and specifically relates to a video processing method, a video processing device, a computer-readable medium, an electronic device, and a computer program product. Background Art
[0003] To accommodate large-scale data transmission of audio and video data, the original audio and video data is typically encoded at the data transmitter to form a compressed data stream. After the data stream is transmitted to the data receiver, it is decoded and restored to obtain the predicted and reconstructed audio and video data.
[0004] Traditional video codecs include various predictive coding and decoding techniques, such as intra-frame prediction, inter-frame prediction, and intra-block copy (IBC) prediction. IBC uses the reconstructed area of the current video frame as a reference to derive a predicted value (prediction block) for the current block in the current video frame. However, in IBC, the current block reconstructed based on the prediction block is prone to discontinuous boundaries with surrounding pixels, potentially resulting in poor decoded image quality. Summary of the Invention
[0005] The present application provides a video processing method, a video processing device, a computer-readable medium, an electronic device, and a computer program product, the purpose of which is to improve the encoding and decoding quality of audio and video data.
[0006] According to one aspect of an embodiment of the present application, a video processing method is provided, the method comprising:
[0007] performing intra-block copy prediction on the current block according to a reference block of the current block to obtain a first prediction value of the current block, wherein the current block is an image block to be processed in a current video frame, and the reference block is a reconstructed image block in the current video frame;
[0008] Determine a first template area of the reference block and a second template area of the current block, wherein the first template area includes one or more reconstructed image areas adjacent to the reference block, and the second template area includes one or more reconstructed image areas adjacent to the current block;
[0009] A filter is determined according to the first template area and the second template area, and a first prediction value of the current block is filtered according to the filter to obtain a second prediction value of the current block.
[0010] According to one aspect of an embodiment of the present application, a video processing device is provided, the device comprising:
[0011] a prediction module configured to perform intra-block copy prediction on the current block based on a reference block of the current block to obtain a first prediction value of the current block, wherein the current block is an image block to be processed in a current video frame and the reference block is a reconstructed image block in the current video frame;
[0012] a determining module configured to determine a first template region of the reference block and a second template region of the current block, wherein the first template region includes one or more reconstructed image regions adjacent to the reference block, and the second template region includes one or more reconstructed image regions adjacent to the current block;
[0013] The filtering module is configured to determine a filter according to the first template area and the second template area, and perform filtering processing on the first prediction value of the current block according to the filter to obtain a second prediction value of the current block.
[0014] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the video processing method in the above technical solution is implemented.
[0015] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to implement the video processing method in the above technical solution.
[0016] According to one aspect of an embodiment of the present application, a computer program product is provided, including a computer program, which implements the video processing method in the above technical solution when executed by a processor.
[0017] A method for storing or sending a video code stream, wherein the video code stream can be generated or decoded according to the aforementioned video processing method.
[0018] In the technical solution provided in the embodiments of the present application, a first prediction value of the current block is obtained by performing intra-block copy prediction on the current block based on a reference block of the current block. A filter is then determined based on a first template area of the reference block and a second template area of the current block, and the first prediction value of the current block is filtered using the filter to obtain a second prediction value of the current block. By determining the filter and filtering the first prediction value of the current block, the spatial discontinuity problem between the prediction block (first prediction value) of the current block and surrounding pixels can be eliminated, thereby improving image encoding and decoding quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0020] FIG1 shows a schematic diagram of a system architecture to which the technical solution of an embodiment of the present application can be applied.
[0021] FIG2 shows the placement of a video encoding device and a video decoding device in a streaming environment according to an embodiment of the present application.
[0022] FIG3 shows a basic flow chart of the encoding process performed by the video encoder in an embodiment of the present application.
[0023] FIG4 is a schematic diagram showing the principle of the inter-frame prediction mode in an embodiment of the present application.
[0024] FIG5 is a schematic diagram showing the principle of the intra block copy prediction mode in an embodiment of the present application.
[0025] FIG6A shows a flow chart of a video processing method in an embodiment of the present application.
[0026] FIG6B shows a schematic diagram of a video processing method in an embodiment of the present application.
[0027] FIG. 7A shows a schematic diagram of corresponding forms of filter-related samples in an embodiment of the present application.
[0028] FIG7B shows a schematic diagram of determining filter parameters in an embodiment of the present application.
[0029] FIG7C shows a schematic diagram of a filter used in an embodiment of the present application.
[0030] FIG8 shows a schematic diagram of filter shapes used in some application scenarios according to an embodiment of the present application.
[0031] FIG9 is a schematic diagram showing a method of selecting a sampling position based on the position coordinates of a pixel point in an embodiment of the present application.
[0032] FIG10 is a schematic diagram showing a method of selecting sampling positions based on a round-trip scanning method in an embodiment of the present application.
[0033] FIG11 shows a schematic diagram of selecting sampling positions based on the ZigZag scanning method in an embodiment of the present application.
[0034] FIG12 is a schematic diagram showing the distribution of template areas corresponding to image blocks in an embodiment of the present application.
[0035] FIG13 shows a schematic diagram of a type of forming different template regions with some sub-regions and image blocks in an embodiment of the present application.
[0036] FIG14 shows a schematic diagram of a template region selected for an image block in an embodiment of the present application.
[0037] FIG15 shows a schematic diagram of the distribution of template areas used in an application scenario according to an embodiment of the present application.
[0038] FIG16 is a schematic diagram showing the effect of extending the template area in an application scenario according to an embodiment of the present application.
[0039] FIG17 schematically shows a structural block diagram of a video processing device provided in an embodiment of the present application.
[0040] FIG18 schematically shows a block diagram of a computer system structure of an electronic device suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION
[0041] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.
[0042] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0043] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0044] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0045] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0046] Video coding generally refers to encoding a sequence of pictures that form a video or a video sequence. In the field of video coding, the terms "picture", "frame" or "image" can be used as synonyms. The video coding used in the embodiments of the present application represents video encoding or video decoding. Video encoding is performed on the video source side and generally includes processing (for example, by compression) the original video image to reduce the amount of data required to represent the video image, thereby more efficiently storing and / or transmitting. Video decoding is performed on the destination side and generally includes inverse processing relative to the encoder to reconstruct the video image. The "encoding" of the video frames involved in the embodiments should be understood as "encoding" or "decoding" involving a sequence of video images. The combination of the encoding part and the decoding part is also called codec (encoding and decoding).
[0047] Each image in a video image sequence is typically divided into a set of non-overlapping blocks, which are typically encoded at the block level. In other words, the encoder side typically processes / encodes the video at the block (also called image block, or video block) level. For example, by performing spatial (intra-image) prediction and / or temporal (inter-image) prediction on the current block (the block currently being processed or to be processed), a prediction block for the current block is generated, the prediction block is subtracted from the current block to obtain a residual block, the residual block is transformed in the transform domain, and the residual block is quantized to reduce the amount of data to be transmitted (compressed). The decoder side applies the inverse process relative to the encoder to the encoded or compressed current block to reconstruct the current block. In addition, the encoder replicates the decoder processing loop so that the encoder and decoder generate the same prediction (e.g., intra-frame prediction and inter-frame prediction) and / or reconstruction for the same block for processing / encoding subsequent blocks.
[0048] The term "block" refers to a portion of an image or frame. In the embodiments of the present application, the current block refers to the block currently being processed. For example, in encoding, it refers to the block currently being encoded; in decoding, it refers to the block currently being decoded.
[0049] FIG1 shows a schematic diagram of a system architecture to which the technical solution of an embodiment of the present application can be applied.
[0050] 1 , a system architecture 100 includes a plurality of terminal devices that can communicate with each other via, for example, a network 150. For example, the system architecture 100 may include a first terminal device 110 and a second terminal device 120 interconnected via the network 150. In the embodiment of FIG1 , the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.
[0051] For example, the first terminal device 110 can encode video data (such as a video picture stream captured by the terminal device 110) for transmission to the second terminal device 120 via the network 150. The encoded video data is transmitted in the form of one or more encoded video streams. 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 the video picture based on the restored video data.
[0052] In all embodiments of the present application, 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, such as during a video conference. For bidirectional data transmission, each of the third terminal device 130 and the fourth terminal device 140 may encode video data (e.g., a video picture stream captured by the terminal device) for transmission to the other of the third terminal device 130 and the fourth terminal device 140 via the network 150. Each of the third terminal device 130 and the fourth terminal device 140 may also receive the encoded video data transmitted by the other of the third terminal device 130 and the fourth terminal device 140, decode the encoded video data to recover the video data, and display the video pictures on an accessible display device based on the recovered video data.
[0053] In Figure 1 , the first terminal device 110, the second terminal device 120, the third terminal device 130, and the fourth terminal device 140 may be servers, personal computers, and smartphones, but the principles disclosed herein are not limited thereto. The embodiments disclosed herein are applicable to laptop computers, tablet computers, media players, and / or dedicated video conferencing equipment. Network 150 represents any number of networks, including, for example, wired and / or wireless communication 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. The communication network 150 may exchange data using circuit-switched and / or packet-switched channels. The network may include a telecommunications network, a local area network, a wide area network, and / or the Internet. For the purposes of this application, unless otherwise explained below, the architecture and topology of network 150 may be immaterial to the operations disclosed herein.
[0054] FIG2 illustrates the placement of a video encoding device and a video decoding device in a streaming environment according to an embodiment of the present invention. The subject matter disclosed herein is equally applicable to other video-enabled applications, including, for example, video conferencing, digital television, and storing compressed video on digital media such as CDs, DVDs, and memory sticks.
[0055] The streaming system may include an acquisition subsystem 213, which may include a video source 201, such as a digital camera, that creates an uncompressed video picture stream 202. In one embodiment, the video picture stream 202 includes samples captured by the digital camera. The video picture stream 202 is depicted as a thicker line to emphasize the higher data volume of the video picture stream compared to the encoded video data 204 (or the encoded video stream 204). The video picture stream 202 may be processed by an electronic device 220, which includes a video encoding device 203 coupled to the video source 201. The video encoding device 203 may include hardware, software, or a combination of hardware and software to implement or embody various aspects of the disclosed subject matter, as described in greater detail below. The encoded video data 204 (or the encoded video stream 204) is depicted as a thinner line to emphasize the lower data volume of the encoded video data 204 (or the encoded video stream 204), which may be stored on a streaming server 205 for future use. One or more streaming client subsystems, such as client subsystem 206 and client subsystem 208 in FIG2 , can access streaming server 205 to retrieve copies 207 and 209 of encoded video data 204. Client subsystem 206 can include, for example, a video decoding device 210 in electronic device 230. Video decoding device 210 decodes the incoming copy 207 of the encoded video data and generates an output video picture stream 211 that can be presented on a display 212 (e.g., a screen) or another presentation device. In some streaming systems, the encoded video data 204, video data 207, and video data 209 (e.g., video code streams) can be encoded according to certain video encoding / compression standards.
[0056] It should be noted that the electronic device 220 and the electronic device 230 may include other components not shown in the figure. For example, the electronic device 220 may include a video decoding device, and the electronic device 230 may also include a video encoding device.
[0057] In all embodiments of the present application, taking the international video coding standards HEVC (High Efficiency Video Coding, H.265), VVC (Versatile Video Coding, H.266), and China's national video coding standard AVS (Audio Video Coding Standard) as examples, after a video frame image is input, 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 CTU (Coding Tree Unit), or LCU (Largest Coding Unit). The CTU can continue to be divided more finely to obtain one or more basic coding units (CU). CU is the most basic element in a coding link.
[0058] FIG3 shows a basic flow chart of the encoding process performed by the video encoder in an embodiment of the present application, in which intra-frame prediction is used as an example for explanation.
[0059] Among them, the original image signal s k [x,y] and predicted image signal Perform difference operation to obtain the residual signal u k [x,y] residual signal u k [x,y] is transformed and quantized to obtain the quantized coefficients. The quantized coefficients are entropy coded to obtain the encoded bit stream, and the reconstructed residual signal u′ is obtained through inverse quantization and inverse transformation. k [x,y]. Predicted image signal and reconstructed residual signal u′ k [x,y] superposition to generate image signal Image signal On the one hand, it is input to the intra-frame mode decision module and the intra-frame prediction module for intra-frame prediction processing, and on the other hand, the reconstructed image signal s′ is output through loop filtering. k [x,y]. Reconstructed image signal s′ k [x,y] can be used as the reference image for the next frame to perform motion estimation and motion compensation prediction. Then, based on the result of motion compensation prediction s′ r [x+mx,y+m y ] and intra prediction results Get the predicted image signal of the next frame And continue to repeat the above process until the encoding is completed.
[0060] The encoding operations for each CU involved in the above video encoding process are described in detail as follows.
[0061] Predictive Coding: Predictive coding includes intra-frame prediction and inter-frame prediction. The original image signal is predicted by using the selected reconstructed image signal to obtain a predicted image signal. The encoder decides which predictive coding mode to select for the current CU and informs the decoder. Intra-frame prediction means that the signal used to predict the current CU comes from the already encoded area in the same image as the current CU. Inter-frame prediction means that the signal used to predict the current CU comes from other images (called reference images or reference frames) that have been encoded and are different from the current image (current video frame) where the current CU is located.
[0062] Transform & Quantization: After undergoing transform operations such as the Discrete Fourier Transform (DFT) and Discrete Cosine Transform (DCT), the residual video signal is converted to the transform domain, resulting in a transform domain signal known as the transform coefficients. These transform coefficients are then subjected to a lossy quantization operation, which removes some information and makes the quantized signal more suitable for compression. In some video coding standards, more than one transform scheme may be available. The encoder can select one for the current CU and inform the decoder of this choice. The level of quantization is typically determined by the Quantization Parameter (QP). A larger QP value means that coefficients with a larger value range will be quantized to the same output, which typically results in greater distortion and a lower bitrate. Conversely, a smaller QP value means that coefficients with a smaller value range will be quantized to the same output, which typically results in less distortion and a higher bitrate.
[0063] Entropy Coding or Statistical Coding: Based on the frequency of occurrence of each value in the quantized transform domain signal, the quantized transform domain signal is statistically compressed and encoded, and finally a binary (0 and 1) compressed code stream is output. At the same time, the encoding generates other information, such as the selected coding mode, motion vector data, etc., which also need to be entropy coded to reduce the bit 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 (CABAC).
[0064] The context-based adaptive binary arithmetic coding (CABAC) process consists of three main steps: binarization, context modeling, and binary arithmetic coding. After binarization, the input syntax elements can be encoded using both the normal coding mode and the bypass coding mode. In bypass coding mode, instead of assigning a specific probability model to each binary bit, the input binary bit values are directly encoded using a simple bypass encoder, speeding up both encoding and decoding. Generally, different syntax elements are not completely independent, and even the same syntax element has some memory. Therefore, based on conditional entropy theory, conditional coding using other coded syntax elements can further improve coding performance compared to independent or memoryless coding. This coded symbol information used as a condition is called context. In normal coding mode, the binary bits of the syntax elements are sequentially fed into the context modeler. The encoder assigns an appropriate probability model to each input binary bit based on the values of previously coded syntax elements or binary bits. This process is known as context modeling. The context model corresponding to the syntax element is located using ctxIdxInc (context index increment) and ctxIdxStart (context index Start). The bin value and the assigned probability model are fed into the binary arithmetic encoder for encoding. The context model is then updated based on the bin value, a process known as adaptive coding.
[0065] Loop Filtering: The transformed and quantized signal will be reconstructed through inverse quantization, inverse transformation and prediction compensation operations to obtain a reconstructed image. Compared with the original image, the reconstructed image has some information that is different from the original image due to the influence of quantization, that is, the reconstructed image will produce distortion. Therefore, the reconstructed image can be filtered. For example, filters such as deblocking filter (DB), SAO (Sample Adaptive Offset) or ALF (Adaptive Loop Filter) can effectively reduce the degree of distortion caused by quantization. Since these filtered reconstructed images will be used as a reference for subsequent encoded images to predict future image signals, the above filtering operation is also called loop filtering, that is, filtering operation within the encoding loop.
[0066] Based on the above encoding process, at the decoding end, after obtaining the compressed code stream (i.e., bitstream), entropy decoding is performed on each CU to obtain various mode information and quantization coefficients. The quantization coefficients are then dequantized and inversely transformed to obtain the residual signal corresponding to the CU. On the other hand, based on the known coding mode information, the prediction signal corresponding to the CU can be obtained. The residual signal is then added to the prediction signal to obtain the reconstructed signal, which is then subjected to loop filtering and other operations to produce the final output signal.
[0067] Current mainstream video coding standards, such as HEVC, VVC, AVS3, AV1, and AV2, all use a block-based hybrid coding framework. They divide the original video data into a series of coding blocks and combine video coding methods such as prediction, transform, and entropy coding to achieve video data compression.
[0068] Among them, motion compensation is a commonly used prediction method in video coding. Motion compensation is based on the redundant characteristics of video content in the time domain or spatial domain, and derives the predicted value of the current coding block from the coded area. This type of prediction method includes: inter-frame prediction, intra-frame block copy prediction, intra-frame string copy prediction, etc. In specific coding implementations, these prediction methods may be used alone or in combination. For coding blocks using these prediction methods, one or more two-dimensional displacement vectors can usually be explicitly or implicitly encoded in the code stream to indicate the displacement of the current block (or the same-position block of the current block) relative to one or more reference blocks.
[0069] Displacement vectors may have different names in different prediction modes and implementations. This article uniformly describes them as follows: 1) Displacement vectors in inter-frame prediction are called motion vectors (MVs); 2) Displacement vectors in intra-frame block copy prediction are called block vectors (BVs); and 3) Displacement vectors in intra-frame string copy prediction are called string vectors (SVs). The following describes the relevant technologies for inter-frame prediction and intra-frame block copy prediction.
[0070] Figure 4 shows a schematic diagram of the principle of the inter-frame prediction mode in an embodiment of the present application. As shown in Figure 4, the inter-frame prediction mode uses the correlation in the video time domain and uses the pixels of the adjacent encoded images to predict the pixels of the current image, so as to effectively remove the redundancy of the video time domain and effectively save the bits for encoding the residual data. Wherein, P is the current video frame, Pr is the reference frame, B is the current block to be encoded, and Br is the reference block of B. The coordinate position of B' in the reference frame Pr is the same as the coordinate position in B and the current video frame P. The coordinates of Br are (xr, yr) and the coordinates of B' are (x, y). The displacement between the current coding block and its reference block is called a motion vector (MV), that is: MV = (xr-x, yr-y).
[0071] Considering the strong correlation between adjacent blocks in the temporal or spatial domain, MV prediction technology can be used to further reduce the bits required to encode MV. In H.265 / HEVC, inter-frame prediction technology includes two MV prediction technologies: Merge and AMVP.
[0072] Figure 5 shows a schematic diagram of the principle of the intra-frame block copy prediction mode in an embodiment of the present application. As shown in Figure 5, the intra-frame block copy prediction (IBC) mode can be regarded as a special inter-frame prediction mode. The implementation principle of the intra-frame block copy prediction mode is similar to the principle of the motion compensation scheme in the inter-frame prediction mode. The difference is that inter-frame prediction selects a reference block for motion compensation in a reference frame different from the current video frame, while the intra-frame block copy prediction mode selects a reference block for motion compensation within the current video frame. In the intra-frame block copy prediction mode, the block vector represents the relative displacement from the position of the current block to the position of the reference block in the current video frame.
[0073] Intra-block copying (IBC) is an intra-frame coding tool adopted in the HEVC Screen Content Coding (SCC) extension, significantly improving the coding efficiency of screen content. IBC is also adopted in AVS3, VVC, and AV1 to improve the performance of screen content coding. IBC exploits the spatial correlation of screen content video and uses the pixels of the previously encoded image in the current image to predict the pixels of the current block to be coded, effectively saving the bits required to encode the pixels.
[0074] FIG6A shows a flow chart of a video processing method according to an embodiment of the present application. The video processing method can be executed by a terminal device or a server that sends or receives video encoding data. The present embodiment of the application uses the method executed by a terminal device as an example. The terminal device can be, for example, the video decoding device 210 or the video encoding device 220 shown in FIG2 .
[0075] As shown in FIG6A , the video processing method in the embodiment of the present application includes the following steps S610 to S630 .
[0076] S610: Perform intra-block copy prediction on the current block based on a reference block of the current block to obtain a first prediction value of the current block, where the current block is an image block to be processed in the current video frame, and the reference block is a reconstructed image block in the current video frame. In all embodiments of the present application, the image block to be processed may refer to an image block to be encoded or an image block to be decoded.
[0077] S620: Determine a first template area of the reference block and a second template area of the current block, where the first template area includes one or more reconstructed image areas adjacent to the reference block, and the second template area includes one or more reconstructed image areas adjacent to the current block.
[0078] S630: Determine a filter according to the first template area and the second template area, and perform filtering processing on the first prediction value of the current block according to the filter to obtain a second prediction value of the current block.
[0079] Figure 6B shows a schematic diagram of a video processing method in an embodiment of the present application. Figure 6B is a schematic diagram of the method in Figure 6A.
[0080] The image block in the embodiment of the present application refers to the basic unit for encoding or decoding processing, and may include, for example: a coding unit, a luminance coding unit, a chrominance coding unit, a coding block, a luminance coding block, a chrominance coding block, a prediction unit, a luminance prediction unit, a chrominance prediction unit, a luminance prediction block, a chrominance prediction block, and the like.
[0081] In the embodiments of the present application, the reference block can be an image block determined by shifting the current block according to the block vector in intra-block copy prediction mode. Based on this, the reconstructed values of pixels within the reference block are equivalent to the predicted values of pixels within the current block. Correspondingly, the reconstructed values of pixels within the first template area are equivalent to the predicted values of pixels within the second template area.
[0082] In the video processing method provided in the embodiment of the present application, based on the reference block of the current block, after performing intra-block copy prediction on the current block, a first prediction value of the current block can be obtained, and then a filter is determined based on the first template area corresponding to the reference block and the second template area corresponding to the current block, and the first prediction value of the current block is filtered according to the filter to obtain the second prediction value of the current block. By filtering the first prediction value of the current block with a filter, the problem of spatial discontinuity between the prediction block (first prediction value) of the current block and the surrounding pixels can be eliminated, thereby improving the image encoding and decoding quality. The video processing method can be applied to video codecs or video compression products that use IBC technology.
[0083] In all embodiments of the present application, the reference block of the current block may be located in a sub-pixel region. Images in natural scenes are generally analog and continuous, and the motion of objects in the image is also continuous, so the motion offset will not be a jump-like motion of integer pixels. In order to improve the accuracy of the prediction, motion estimation with sub-pixel accuracy is introduced into the video compression coding technology. The sub-pixel region can only be obtained by a certain interpolation calculation of the integer pixel region. Between the integer pixel motion estimation and the sub-pixel motion estimation, the interpolation calculation of the sub-pixel points can be performed within the search range of the reference frame image. On this basis, the reference block of the current block may be located in an integer pixel region, or it may be located in a sub-pixel region.
[0084] In all embodiments of the present application, the method of filtering the first prediction value of the current block according to the filter may further include: determining whether the current block meets the filtering condition, the filtering condition is used to determine whether to filter the current block; when the filtering condition is met, filtering the first prediction value of the current block according to the filter.
[0085] In all embodiments of the present application, the filtering condition includes at least one of the following conditions:
[0086] (1) The code stream parameters related to the current block have specified values.
[0087] (2) The image feature of the current block (or the current block) meets the preset first feature condition.
[0088] (3) The image feature of the reference block (or the reference block) meets the preset second feature condition.
[0089] (4) The image features of the template area (or the template area) meet the preset third feature condition.
[0090] The specific implementation methods of the above four conditions are explained below.
[0091] In some embodiments of the present application, the filtering condition may include condition (1): a code stream parameter related to the current block has a specified value.
[0092] For example, the video code stream where the current block is located contains syntax elements related to video coding and decoding. These syntax elements can be used as code stream parameters to guide related operations of video coding and decoding.
[0093] The codestream syntax description method is similar to that of C language. Codestream syntax elements are represented in bold. Each syntax element is described by its name (underscore-separated English letters, all letters can be lowercase), syntax, and semantics. Syntax element values in syntax tables and the main text are represented in regular font. In some cases, syntax tables may use other variable values derived from syntax elements. Such variables are named in syntax tables or the main text using a mix of lowercase and uppercase letters without underscores. Variables beginning with an uppercase letter are used to decode the current and related syntax structures and can also be used to decode subsequent syntax structures. Variables beginning with a lowercase letter are used only within the section in which they appear. The relationship between mnemonics for syntax element values and variable values and their values is explained in the main text. In some cases, the two are used equivalently. Mnemonics are represented by one or more underscore-separated letter groups, each beginning with an uppercase letter and can include multiple uppercase letters. Hexadecimal notation may be used when the length of a bit string is an integer multiple of 4. The prefix of hexadecimal is "0x", for example "0x1a" represents the bit string "0001 1010".
[0094] In some embodiments of the present application, the code stream parameters include a filtering flag, which is used to indicate whether to perform filtering on the image block. The filtering flag may include one or more of the following flags:
[0095] Sequence header filter flag, used to indicate whether the image blocks in the video frame sequence are to be filtered;
[0096] Image header filtering flag, used to indicate whether the image block in the video frame is filtered;
[0097] The slice header filter flag is used to indicate whether the image blocks in the image slice are filtered;
[0098] Block-level filtering flag, used to indicate whether the current block is filtered.
[0099] In some embodiments of the present application, when the block-level filtering flag exists in the code stream parameters, the block-level filtering flag is decoded when a preset decoding condition is met, and decoding of the block-level filtering flag is prohibited when the preset decoding condition is not met.
[0100] For example, the decoding conditions include one or more of the following conditions:
[0101] (1) The high-level syntax element in the code stream parameter indicates that filtering processing is performed on the image block. The high-level syntax element includes at least one of a sequence header filter flag, a picture header filter flag, and a slice header filter flag.
[0102] (2) The area of the current block is within a preset value range; for example, the area of the current block is greater than 32.
[0103] (3) The position coordinates of the current block are within a preset coordinate range. For example, the position coordinates (horizontal coordinates and / or vertical coordinates) of the current block are greater than or equal to a specific threshold.
[0104] (4) The area range occupied by the reference area of the current block in the current video frame meets the preset range restriction, and the reference area includes one or more of the current block, the template area of the current block, and the extended area of the template area.
[0105] In one example, the current video frame is divided into multiple image regions, for example, M*N image regions. The number of image regions occupied by sample points in the reference region in the current video frame is K. In this case, this number K can be used as the region range occupied by the reference region in the current video frame. The preset range limit can be determined based on the block size of the current block.
[0106] For example, the preset range limit may be that the region range (i.e., the number K) is less than or equal to a number threshold. The number threshold may be expressed as W*H*TH, where W is the width of the current block, H is the height of the current block, and TH is a preset scale factor.
[0107] (5) The reference area of the current block meets the reference range restriction of intra block copy prediction.
[0108] In all embodiments of the present application, the preset coordinate range includes a value greater than or equal to a coordinate threshold; and the method for determining the coordinate threshold includes at least one of the following methods:
[0109] (1) Determine the coordinate threshold according to a preset fixed value.
[0110] (2) Determine the coordinate threshold according to the template size of the template area; when the template area is the image area located above the current block, the template size is the height of the template area; when the template area is the image area located to the left of the current block, the template size is the width of the template area.
[0111] In all embodiments of the present application, when the current block does not include a chrominance component, for example, the current block is a luminance block including only a luminance component, the template size of the template area is used as the coordinate threshold;
[0112] When the current block contains chroma components, for example, a chroma block containing only chroma components or an image block containing both luma and chroma components, a weighting coefficient is determined based on the sampling ratio of the luma and chroma components, and the product of the weighting coefficient and the template size of the template area is used as the coordinate threshold. For example, for a YUV420 image, the length and width of the luma component are twice that of the color components, so the weighting coefficient can be determined as 2.
[0113] In an example embodiment, the code stream includes a high-level syntax element indicating whether to use the intra block copy adaptive prediction filter (IBC-APF) provided in the embodiment of the present application, and whether the current block is allowed to use the IBC-APF-based filtering method is determined according to the high-level syntax element.
[0114] High-level syntax elements may include, for example, one or more of the following: sequence header syntax element (seq_ibc_apf_flag), picture header syntax element (pic_ibc_apf_flag), and slice header syntax element (slice_ibc_apf_flag). The decoding priority is sequence header syntax element > picture header syntax element > slice header syntax element > block-level syntax element. If a high-priority syntax element indicates that IBC-APF is not allowed, the lower-level syntax elements do not need to be decoded.
[0115] A video sequence is the highest-level syntactic structure of a bitstream. A video sequence begins with the first sequence header. A sequence end code or video editing code indicates the end of the video sequence. The sequence headers between the first sequence header and the first occurrence of the sequence end code or video editing code are repeated. Each sequence header is followed by one or more coded pictures, each preceded by a picture header. Coded pictures are arranged in the bitstream in bitstream order, which should be the same as the decoding order. The decoding order may differ from the display order.
[0116] A picture can be a frame or a field. Its coded data begins with a picture start code and ends with a sequence start code, a sequence end code, or the next picture start code. In the bitstream, the coded data for the two fields of an interlaced picture can appear sequentially or interleaved. The decoding and display order of the two fields is specified in the picture header. Picture types include I-pictures, P-pictures, and B-pictures.
[0117] A slice is a rectangular area in an image, which contains the parts of several maximum coding units in the image, and slices should not overlap.
[0118] In another exemplary embodiment, a high-level syntax element exists in the bitstream, indicating whether to use any intra block copy prediction filter (IBC-PF), wherein the IBC-PF filter may include multiple different filtering modes.
[0119] In another exemplary embodiment, a block-level filtering flag cu_ibc_apf_flag exists in the bitstream, which is used to indicate whether the current block is filtered using the IBC-APF mode.
[0120] In an embodiment of the present application, the code stream parameters may further include a filtering index. The filtering index is used to indicate a filtering mode for filtering the image block, and the filtering mode includes one or more different filtering methods.
[0121] For example, the bitstream contains a block-level flag cu_ibc_pf_flag, which indicates whether the current block uses the IBC-PF mode for filtering. If cu_ibc_pf_flag indicates that the current block can use the IBC-PF mode for filtering, the bitstream contains a block-level index cu_ibc_pf_index, which indicates the IBC-PF method used by the current block. The decoding of cu_ibc_pf_index depends on cu_ibc_pf_flag.
[0122] Table 1 shows the syntax structure of code stream parameters related to the IBC-PF filter in an application scenario of an embodiment of the present application.
[0123] Table 1
[0124] The block-level intra block copy prediction filter flag, cu_ibc_pf_flag, is a binary variable. A value of '1' indicates that the IBCPF mode can be used; a value of '0' indicates that the IBCPF mode should not be used. The value of cuIbcPfFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag does not exist in the bitstream, the value of cuIbcPfFlag is 0.
[0125] The block-level intra block copy prediction filter index cu_ibc_pf_index indicates the IBCPF mode used. The value of CuIbcPfIndex is equal to the value of cu_ibc_pf_index. If cu_ibc_pf_index does not exist in the codestream, the value of CuIbcPfIndex is 0.
[0126] Taking three filtering methods as examples, Table 2 shows the values of the above code stream parameters and their corresponding semantics.
[0127] Table 2
[0128] When cu_ibc_pf_flag is set to 0, it indicates that the current block does not use IBCPF filtering, so there is no need to decode cu_ibc_pf_index. Alternatively, the cu_ibc_pf_index of the current block may not be signaled.
[0129] When cu_ibc_pf_flag is set to 1, it indicates that the current block is filtered using the IBCPF mode. At this time, cu_ibc_pf_index can be decoded to determine which filtering mode is used for the current block. IBCPF mode 3 represents the intra-frame block copy adaptive prediction filtering mode IBC-APF provided in the embodiment of the present application. IBCPF mode 1 and IBCPF mode 2 are other filtering methods other than the IBC-APF filtering mode provided in the embodiment of the present application, such as mean filtering, median filtering, Gaussian filtering, etc.
[0130] In some embodiments of the present application, in addition to indicating that filtering is performed on an image block, the filter flag is also used to indicate the filtering mode used for filtering the image block. The filtering mode includes one or more different filtering methods. Taking block-level code stream parameters as an example, only the filter flag cu_ibc_pf_flag can be used to indicate the IBC mode used by the current block.
[0131] Table 3 shows the value and semantics of the embodiment of the present application when only the filtering flag cu_ibc_pf_flag is used.
[0132] Table 3
[0133] As shown in Table 3 above, when cu_ibc_pf_flag of the current block is equal to 3, it means that the current block uses the IBC-APF mode for filtering.
[0134] In some embodiments of the present application, the code stream parameters further include a filter type field for indicating a filter type.
[0135] When the filter type field takes the first value, the filter flag is used to indicate whether to perform filtering on the image block, and the filtering mode for performing filtering on the image block is the preset first mode;
[0136] When the filter type field takes the second value, the filter flag is used to indicate whether to perform filtering on the image block, and the filtering mode for filtering the image block is the preset second mode, which is a filtering mode different from the first mode.
[0137] For example, the bitstream contains a type field ibc_type indicating the IBC type (which can be a flag at the sequence level, picture level, slice level, or block level). When ibc_type has different values, it indicates that different filtering methods are used.
[0138] Table 4 shows the values and semantics of the filter type field and filter flag in an application scenario of an embodiment of the present application.
[0139] Table 4
[0140] In some embodiments of the present application, the binarization / debinarization method of the filter flag cu_ibc_pf_flag and / or the filter index cu_ibc_pf_index described above may use variable-length code or fixed-length code, and the variable-length code includes truncated unary code, truncated binary code, K-order exponential Golomb code, etc.
[0141] In some embodiments of the present application, the value of the filtering flag may be determined according to the coding loss, which is calculated by a preset cost function;
[0142] If the coding loss after filtering the template region of the image block is less than the coding loss before filtering the template region of the image block, assigning a filtering flag to a first value, the first value being used to indicate that filtering is to be performed on the image block;
[0143] If the coding loss after filtering the template area of the image block is greater than the coding loss before filtering the template area of the image block, the filtering flag is assigned a second value, which is used to indicate that filtering of the image block is prohibited.
[0144] For example, embodiments of the present application may use the Sum of Absolute Difference (SAD) as a cost function to calculate the coding loss of the current block before and after filtering. If the coding loss is smaller when filtering using IBCPF and IBC-APF, then the IBCPF and IBC-APF modes are used for the current block; otherwise, the IBCPF and IBC-APF modes are prohibited for the current block.
[0145] In some embodiments of the present application, the value of the filter flag is determined according to the number of transform coefficients in the image block;
[0146] If the transform coefficients in the image block meet a preset first quantity condition, assigning a filtering flag to a first value, the first value being used to indicate that filtering processing is to be performed on the image block;
[0147] If the transform coefficients in the image block meet a preset second quantity condition, the filtering flag is assigned a second value, and the second value is used to indicate that filtering processing on the image block is prohibited.
[0148] For example, embodiments of the present application may count the number of coefficients in the current block whose transform coefficients are even, and then determine whether to use the IBCPF or IBC-APF based on the parity of this number of coefficients. For example, if the number of coefficients in the previous block whose transform coefficients are even is m, the first number condition may be that m is an odd number, and the second number condition may be that m is an even number.
[0149] In some other exemplary embodiments, other implicit coefficients may also be used to derive parameter values of the filtering flag.
[0150] In some embodiments of the present application, determining the filtering conditions for filtering the current block may include condition (2): the image feature of the current block satisfies a preset first feature condition.
[0151] For example, the first characteristic condition includes one or more of the following conditions:
[0152] (2.1) The current video frame where the current block is located has a specified image type.
[0153] If the current video frame does not have the specified picture type, it is determined that the current video frame does not allow the use of IBC-APF, and there is no need to decode the picture header and syntax elements below the picture level of the current video frame to determine the syntax elements related to IBC-APF. For example, if the IBC-APF mode is only allowed for I-type pictures, then for non-I-type pictures, there is no need to decode the syntax elements related to IBC-APF in the block level, slice header, and picture header.
[0154] (2.2) The current block has a specified distribution position in the current video frame.
[0155] For example, it is only applicable when the horizontal and vertical coordinates of the current block are larger than the size of the filter template, avoiding filtering with samples outside the boundaries of, for example, an independently decodable image, such as a maximum coding unit (LCU) or a slice.
[0156] (2.3) The image size of the current block is within a preset size range, where the image size includes one or more of width, height, or area.
[0157] IBC-APF is only allowed to be used when the image size (block size) of the current block meets the preset conditions. If the image size of the current block does not meet the conditions, there is no need to decode the block-level IBC-APF related syntax elements of the current block. The image size may include one or more of the width, height or area of the current block. The preset conditions are, for example, that the image size of the current block is greater than, greater than or equal to, less than, or less than or equal to a specific threshold. The conditions related to the image size of the current block may include multiple conditions, each corresponding to a different threshold. For example, IBCPF and IBC-APF are used only when the image size of the current block meets the following conditions at the same time: the area of the current block (width * height) is greater than 64, the width of the current block is less than or equal to 64, and the height of the current block is less than or equal to 64.
[0158] For another example, filtering is allowed to be performed on the current block only when the width*height of the current block is greater than 32.
[0159] (2.4) The block vector resolution of the current block is within the preset resolution range.
[0160] If the block vector resolution of the current block is one of the Adaptive Block Vector Resolutions (ABVR), IBC-APF is only allowed to be used if the block vector resolution of the current block meets a specific condition. If the block vector resolution of the current block does not meet the specific condition, then the block-level IBC-APF-related syntax elements of the current block do not need to be decoded. The specific condition can be that the block vector resolution of the current block is within a preset resolution range. For example, the block vector resolution of the current block is a specific subset of the available ABVR list.
[0161] For example, currently ABVR allows {1-pel, 4pel} and uses IBC-APF only when the block vector resolution of the current block is 1-pel.
[0162] For example, currently ABVR allows {1-pel, 4pel} and uses IBC-APF only when the block vector resolution of the current block is 4-pel.
[0163] For example, currently ABVR allows {1 / 4pel, 1-pel, 4pel}, and IBC-APF is used only when the block vector resolution of the current block is 1-pel.
[0164] For example, currently ABVR allows {1 / 4 pel, 1-pel, 4pel}, and IBC-APF is used only when the block vector resolution of the current block is 1-pel or 4-pel.
[0165] (2.5) The block vector residual of the current block is within a preset residual range. The block vector residual includes one or more of the horizontal block vector residual and the vertical block vector residual. Block vector residual (BVD) = BV (block vector) - BVP (prediction block vector). The absolute residual (BVD) = ABS (BV - BVP) can also be used here.
[0166] IBC-APF is only allowed when the block vector difference (BVD) of the current block meets the conditions. If the BVD size of the current block does not meet the conditions, the block-level IBC-APF-related syntax elements of the current block do not need to be decoded. For example, the condition is that the absolute value of the horizontal BVD or (and) the vertical BVD of the current block is less than (or equal to, less than or equal to, greater than or equal to, or greater than) a specific threshold.
[0167] For example, IBCPF and IBC-APF are allowed to be used only when both the horizontal BVD and the vertical BVD of the current block are equal to 0.
[0168] (2.6) The block vector index of the current block is within the preset index range.
[0169] The block vector index refers to the "prediction block vector index." When deriving a block vector, the decoder must first decode the prediction block vector BVP and the block vector residual BVD, resulting in a block vector BV = BVP + BVD. The prediction block vector index indicates which prediction block vector to use.
[0170] IBC-APF is only allowed if the block vector index of the current block meets the conditions. If the block vector index of the current block does not meet the conditions, the block-level IBC-APF-related syntax elements do not need to be decoded. The condition is that the block vector index of the current block is within a preset index range. More specifically, for example, the absolute value of the block vector index bvp_idx of the current block can be less than (or equal to, less than or equal to, greater than or equal to, or greater than) a specific threshold.
[0171] (2.7) The current block is an image block with a specified color component.
[0172] IBC-APF is only allowed to be used when the current block is a specific color component. For example, IBCPF and IBC-APF can be used only for the luma component Y, or only for the chroma component U or V, or both.
[0173] In some embodiments of the present application, determining the filtering conditions for filtering the current block may include condition (3): the image feature of the reference block satisfies a preset second feature condition.
[0174] For example, the second characteristic condition includes
[0175] (3.1) The sample points of the reference block meet a preset sample point availability condition. The sample point availability condition includes that the sample point is within the boundary of an independently decodable image or that the sample point has been decoded and reconstructed. An "independently decodable image" is, for example, a maximum coding unit. The sample point availability condition here may mean that the sample point does not exceed the boundary of the maximum coding unit (or slice, or picture).
[0176] The location of the reference block sample points is determined based on the predicted block vector. IBC-APF is only used when the block vector of the current prediction block meets the validity conditions. The availability of the reference block and template area is determined. This availability condition includes: the sample point is within the boundaries of an independently decodable image, or the sample point has been decoded and reconstructed. Other restrictions may also be included, such as meeting hardware implementation limitations.
[0177] In some embodiments of the present application, determining the filtering conditions for performing filtering processing on the current block may include condition (4): the image features of the template area meet a preset third feature condition.
[0178] For example, the third characteristic condition may include one or more of the following conditions:
[0179] (4.1) The area of the template region is within the preset area range.
[0180] (4.2) The sample points in the template area meet the preset sample point availability conditions, which include that the sample points are located within the boundary of the independently decodable image or the sample points have been decoded and reconstructed.
[0181] (4.3) The number of sample pairs collected in the template area is greater than the number of model parameters of the filter.
[0182] Since the model parameters of the filter are solved using the least squares method, the number of sample pairs needs to be greater than the number of model parameters in order to be able to solve it.
[0183] The above embodiments provide a variety of filtering conditions for whether to filter the current block. The embodiments of the present application may use one or more of the above filtering conditions. Different filtering methods may correspond to different filtering conditions, and the embodiments of the present application do not impose any special restrictions on this.
[0184] In some embodiments of the present application, a method for determining a filter based on a first template area and a second template area may include: selecting a first sample point from the first template area, and selecting a second sample point corresponding to the first sample point from the second template area; determining a filter based on a sample pair consisting of the first sample point and the second sample point, wherein the filter input includes the pixel value of the first sample point, and the filter output includes the pixel value of the second sample point, and the pixel value includes a predicted value or a reconstructed value. For example, after selecting the first sample point and the second sample point, the first pixel value of the first sample point is used as the input of the filter, and the second pixel value of the second sample point is used as the output of the filter; and the filter parameters are determined based on the first pixel value of the first sample point and the second pixel value of the second sample point.
[0185] In some embodiments of the present application, the filter input further includes pixel values of one or more neighboring pixel points, where the neighboring pixel points are the nearest or next nearest neighbor pixels of the first sample point.
[0186] For example, the filter model can be expressed as: y=p0*x0+p1*x1+p2*x2+…+pn*xn.
[0187] Where {p0, p1, …, pn} are the filter parameters, {x0, x1, …, xn} are the input values, and y is the output value. xi is derived based on the reference sample corresponding to the current sample to be filtered and its adjacent samples.
[0188] Figure 7A shows a schematic diagram of the corresponding forms of filter-related sample points in all embodiments of the present application. As shown in Figure 7A, the first sample point C is selected from the first template area where the reference block is located, and the second sample point C' is selected from the second template area where the current block is located.
[0189] The position of the first sample point C is the filter center, which is determined by the position of the second sample point C′ after displacement according to the block vector.
[0190] The neighboring pixels of the first sample point C may include multiple nearest neighboring pixels, such as the multiple pixels N, S, W, and E located above, below, to the left, and to the right of the first sample point C as shown in FIG7A .
[0191] The neighboring pixels of the first sample point C may include multiple next-nearest neighboring pixels, such as the multiple pixels NW, NE, SW, and SE located at the upper left, upper right, lower left, and lower right positions of the first sample point C as shown in FIG7A .
[0192] Each time a correspondence between a first sample point C and a second sample point C' is established, a sample pair is formed, and a correspondence equation is generated. Multiple such correspondence equations can be used to solve the weighting parameters of the filter model.
[0193] When the first sample point C and the second sample point C' are placed in the current frame, as shown in Figure 7B , Figure 7B shows a schematic diagram of determining filter parameters in an embodiment of the present application.
[0194] In all embodiments of the present application, the shape of the filter can be of various types. FIG8 shows a schematic diagram of the shape of the filter used in some application scenarios of the embodiment of the present application.
[0195] As shown in FIG8 , shape 1 indicates that the input items of the first type of filter include: a first sample point C and four nearest neighboring pixel points located above, below, to the left, and to the right of the first sample point C.
[0196] Shape 2 indicates that the input items of the second type of filter include: the first sample point C, the four nearest neighboring pixel points located above, below, left, and right of the first sample point C, and the four next nearest neighboring pixel points located at the upper left, upper right, lower left, and lower right positions of the first sample point C.
[0197] Shape three indicates that the input items of the third type of filter include: the first sample point C, and the four next-nearest neighboring pixel points located at the upper left, upper right, lower left and lower right positions of the first sample point C.
[0198] Shape four indicates that the input items of the fourth type of filter include: the first sample point C, the four nearest neighboring pixel points located above, below, left, and right of the first sample point C, the four next nearest neighboring pixel points located at the upper left, upper right, lower left, and lower right positions of the first sample point C, and the four next nearest neighboring pixel points located above, below, left, and right of the first sample point C (that is, the outer pixel points adjacent to the nearest neighbor pixel points in the corresponding directions).
[0199] In all embodiments of the present application, the pixel boundaries of the template area can be expanded according to the shape of the filter. For example, for the second type of filter with shape two as shown in Figure 8, the pixels at the edge of the template area need to be expanded outward by one unit. For another example, for the fourth type of filter with shape four as shown in Figure 8, the pixels at the edge of the template area need to be expanded outward by two units. The extended area can also refer to Figure 7B, and the samples in the extended area are extended samples. The extended samples can also be used when determining the filter.
[0200] In all embodiments of the present application, the filter includes one or more combination items with independent weighting parameters, and the combination item takes the pixel value of one or more pixel points as an input item.
[0201] The filter in the embodiment of the present application may be composed of at least one monomial, wherein each monomial may have an independent weighting parameter. When a monomial has at least two pixel values as input items, the monomial is called a combination item.
[0202] In all embodiments of the present application, the filter includes at least two combinations of terms with different orders, where the order is the highest power of the input terms in the combination. The power operation can introduce nonlinear factors to improve the filter's fitting effect on the correspondence between sample points.
[0203] Assume that Rj represents the input of the filter, and xi can be any combination of Rj, such as Rj, m*Rj, Rj k and at least one of the constant bias term B, or a combination of any of these terms multiplied or added together. Here, m and k are non-zero integers, and k is an integer greater than 1.
[0204] In all embodiments of the present application, the filter may include one or more of the following multiple candidate models.
[0205] (1)y=p0C+p1N+p2S+p3W+p4E+p5C 2 +p6B.
[0206] (2)y=p0C+p1N+p2S+p3W+p4E+p5B.
[0207] (3)y=p0C+p1B.
[0208] (4)
[0209] (5)
[0210] (6)
[0211] (7)
[0212] (8)
[0213] (9)
[0214] (10)
[0215] (11)
[0216] (12)y=p0C+p1S+p2W+p3E+p4SW+p5SE+p6C 2 +p7B.
[0217] In all embodiments of the present application, the sample points used to determine the filter can be all or part of the pixels selected from the first template area and the second template area. When a part of the pixels are selected to determine the filter, pixel sampling can be performed in the corresponding template area according to a preset sampling rule.
[0218] In all embodiments of the present application, the method for selecting sample points in a template area may further include: obtaining a pixel sampling mode of a current block, the pixel sampling mode including full pixel sampling or partial pixel sampling; when the pixel sampling mode of the current block is full pixel sampling, all pixels in the template area may be selected as sample points; when the pixel sampling mode of the current block is partial pixel sampling, some pixels with designated sampling positions in the template area may be selected as sample points. When the pixel sampling mode of the current block is full pixel sampling, pixels are selected from all pixels in the first template area as the first sample points, and pixels are selected from all pixels in the second template area as the second sample points; when the pixel sampling mode of the current block is partial pixel sampling, pixels are selected from some pixels at a first designated sampling position in the first template area as the first sample points, and pixels are selected from some pixels at a second designated sampling position in the second template area as the second sample points.
[0219] In all embodiments of the present application, the designated sampling position includes at least one of the following three sampling positions.
[0220] The first sampling position: a designated sampling position where the position coordinates of the pixel point meet the preset coordinate value conditions.
[0221] In all embodiments of the present application, the coordinate numerical conditions include: at least one of the horizontal position coordinates or vertical position coordinates of the pixel point is an even number; or, at least one of the horizontal position coordinates or vertical position coordinates of the pixel point is an odd number.
[0222] FIG9 is a schematic diagram showing the selection of sampling positions based on the position coordinates of pixel points in all embodiments of the present application.
[0223] As shown in Figure 9, in the template area, a coordinate system is established with the upper left corner as the coordinate origin (0, 0). The horizontal position coordinate x represents the sequential position of the pixel points arranged from left to right in the horizontal direction, and the vertical position coordinate y represents the sequential position of the pixel points arranged from top to bottom in the horizontal direction.
[0224] According to the preset coordinate value conditions, even positions, odd positions or all positions can be selected as designated sampling positions in the horizontal direction, and even positions, odd positions or all positions can be selected as designated sampling positions in the vertical direction.
[0225] For example, in the embodiment shown in FIG9 , pixel positions that are even positions in the horizontal direction and all positions in the vertical direction are selected as designated sampling positions, that is, pixel positions in the shaded portion of the figure are selected as designated sampling positions.
[0226] The second sampling position: a specified sampling position selected along the preset pixel scanning direction.
[0227] In all embodiments of the present application, pixels can be scanned in the template area using any scanning method, such as a round-trip scan or a ZigZag scan, so that designated sampling positions are selected along a preset pixel scanning direction in accordance with a sequence and a preset sampling rule. The preset sampling rule may be, for example, interval sampling, where a designated sampling position is selected after one or more scanned pixels have passed.
[0228] FIG10 is a schematic diagram showing the selection of sampling positions based on a round-trip scanning method in all embodiments of the present application.
[0229] As shown in Figure 10, a row of pixels is scanned from left to right within the template area. After reaching the boundary, the next row of pixels is scanned from right to left. During the pixel scanning process, a designated sampling position is selected for every other pixel along the scanning direction. For example, the arrow in the figure indicates the scanning direction, and the pixel positions in the shaded area are the selected designated sampling positions.
[0230] FIG11 shows a schematic diagram of selecting sampling positions based on the ZigZag scanning method in all embodiments of the present application.
[0231] As shown in Figure 11, pixels are scanned from the upper left corner to the lower right corner of the template area using a ZigZag scanning method. During the pixel scanning process, a designated sampling position is selected for every scanned pixel along the scanning direction. For example, the arrow in the figure indicates the scanning direction, and the shaded pixel positions are the selected designated sampling positions.
[0232] The third sampling position: a specified sampling position where the pixel value falls within a preset value range.
[0233] Taking the decoded and reconstructed pixels in the template area as an example, only when the reconstructed value of the pixel is greater than / less than a certain threshold value, it is used for filter fitting.
[0234] For example, pixels in the template region whose reconstructed values are greater than a preset threshold can be fitted with one filter, while pixels in the template region whose reconstructed values are less than or equal to the preset threshold can be fitted with another filter. When filtering the first predicted value of a pixel in the current block, different filters can be selected for filtering based on the numerical relationship between the first predicted value and the preset threshold.
[0235] In all embodiments of the present application, the template area is composed of one or more nearest neighbor areas or second nearest neighbor areas, the nearest neighbor area includes an image area with a specified image size located above or to the left of the image block, and the second nearest neighbor area includes an image area with a specified image size located above, below, or above the right of the image block.
[0236] FIG12 is a schematic diagram showing the distribution of template areas corresponding to image blocks in all embodiments of the present application.
[0237] As shown in FIG12 , the template region corresponding to the image block 1201 may be composed of multiple sub-regions 1202, wherein each sub-region 1202 may be the nearest neighbor region or the next nearest neighbor region of the image block. The nearest neighbor region may, for example, include image region B located above the image block 1201 or image region D located to the left of the image block 1201, and the next nearest neighbor region may, for example, include image region A located to the upper left of the image block 1201, image region E located to the lower left of the image block 1201, or image region C located to the upper right of the image block 1201.
[0238] The template area of the image block 1201 can be formed by combining one or more of the image areas AE.
[0239] In all embodiments of the present application, the image sizes of the sub-regions constituting the template region are specified as follows.
[0240] The nearest neighbor region B above the image block 1201 has the same image size as the image block 1201 in the horizontal direction, and the nearest neighbor region B above the image block 1201 has a specified image size in the vertical direction.
[0241] The nearest neighbor region D on the left side of the image block 1201 has the same image size as the image block 1201 in the vertical direction, and has a specified image size in the horizontal direction.
[0242] The next neighboring region C to the upper right of the image block 1201 has the same image size as the image block 1201 in the horizontal direction, and has a specified image size in the vertical direction.
[0243] The next neighboring region E below the left of the image block 1201 has the same image size as the image block 1201 in the vertical direction, and the next neighboring region below the left of the image block 1201 has a specified image size in the horizontal direction.
[0244] The next neighboring area A at the upper left of the image block 1201 has a specified image size in both the horizontal and vertical directions.
[0245] The designated image size may be a preset value greater than or equal to one, for example, the designated image size may be set to 6. When the designated image size is greater than one, filtering may be performed using multiple layers of neighboring pixels, thereby improving the continuity between pixels in the current block and neighboring pixels.
[0246] In all embodiments of the present application, the sub-regions of the template region constituting the image block may have the same specified image size or different specified image sizes. For example, the vertical size of image region C may be the same as or different from the horizontal size of image region E.
[0247] In all embodiments of the present application, for image blocks with different color components, the template sizes of the corresponding template areas may also be different. For example, the template size of the template area of the luminance block is different from the template size of the template area of the chrominance block.
[0248] In all embodiments of the present application, pixels that have been decoded and reconstructed or are allowed to be available can be selected from the sub-region as sample points for filter fitting of the current block. For example, when some pixels in image region C have been decoded and reconstructed, while other pixels have not been decoded and reconstructed, the pixels that have been decoded and reconstructed can be selected from image region C as sample points for filter fitting of the current block.
[0249] In all embodiments of the present application, when the decoded and reconstructed pixels in a sub-region do not meet the aforementioned size requirements, the sub-neighboring region may be configured as unavailable. For example, when the lower right corner of image region C is not reconstructed or exceeds the image boundary, image region C may be configured as unavailable; for another example, when the lower right corner of image region E is not reconstructed or exceeds the image boundary, image region E may be configured as unavailable.
[0250] In all embodiments of the present application, all of the sub-regions shown in FIG. 12 may be combined to form a template region, or a portion of the sub-regions may be combined to form a template region.
[0251] Figure 13 shows a schematic diagram of how different template regions are formed by combining certain sub-regions with image blocks in all embodiments of the present application. As shown in Figure 13, based on the combination of different sub-regions, ten types of selectable template regions can be formed, and embodiments of the present application can specify one or more candidate template regions for an image block.
[0252] Figure 14 shows a schematic diagram of the template region selected for the image block in all embodiments of the present application. As shown in Figure 14, in the embodiment of the present application, the template region corresponding to the image block includes at least one of the full region combination, the left region combination, or the upper region combination.
[0253] The full region combination includes the nearest neighbor regions located on the left and above the image block and the next nearest neighbor regions located on the upper left, lower left and upper right of the image block.
[0254] The left region combination includes the nearest neighbor region located on the left side of the image block and the next nearest neighbor region located on the lower left side of the image block.
[0255] The upper region combination includes the nearest neighbor region located above the image block and the next nearest neighbor region located to the upper right of the image block.
[0256] In all embodiments of the present application, the region type field can be used in the video bitstream to identify the region type of the template region used by the image block. For example, when the region type field value is 1, it indicates that the template region selected for the image block is the full region combination shown in Figure 10; when the region type field value is 01, it indicates that the template region selected for the image block is the left region combination shown in Figure 10; when the region type field value is 00, it indicates that the template region selected for the image block is the upper region combination shown in Figure 10.
[0257] In all embodiments of the present application, after determining the template area used when performing filter fitting on an image block, availability information of one or more sub-areas constituting the reference area can be obtained, and then the area range of the template area can be adjusted based on the availability information of the one or more sub-areas.
[0258] In all embodiments of the present application, adjusting the area range of the template area according to the availability information of one or more sub-areas may further include: removing sub-areas in an unavailable state from the template area; and configuring the template area to an unavailable state when all sub-areas in the template area are in an unavailable state.
[0259] For example, the value of the indication field corresponding to the image block obtained by parsing the video code stream is 1, indicating that the template area used for color component prediction of the image block is the full area combination including the five sub-areas of AE shown in FIG. 10 .
[0260] When filtering the image block, availability information of each sub-region in the template region may be obtained, and the region range of the template region may be adjusted according to the availability information.
[0261] For example, sub-regions A, B, and C are image regions located above the image block. If sub-regions A, B, and C have not yet completed encoding and reconstruction, sub-regions A, B, and C are in an unavailable state. At this time, the area range of the template area can be adjusted from A+B+C+D+E to D+E.
[0262] For another example, sub-regions D and E are image regions located to the left of the image block. If encoding and reconstruction of sub-regions D and E have not yet been completed, sub-regions D and E are also in an unusable state. In this case, all five sub-regions A to E are in an unusable state, so the entire template region based on this full region combination can be configured as unusable.
[0263] In all embodiments of the present application, a current block may be filtered using multiple different filters, and then the filtering results of the multiple filters may be weighted to obtain a final prediction value for the current block. In all embodiments of the present application, a final predicted image may be obtained by weighting a first prediction value obtained by intra block copy prediction and a second prediction value obtained by filtering the first prediction value.
[0264] In all embodiments of the present application, after obtaining the second prediction value of the current block, a weighted operation is performed on the first prediction value and the second prediction value according to a preset weight coefficient to obtain a third prediction value of the current block.
[0265] For example, the embodiment of the present application may determine the third prediction value pred of the current block according to the following formula: pred=w*pred1+(1-w)*pred2
[0266] Among them, pred1 represents the first prediction value obtained by intra-frame block copy prediction, pred2 represents the second prediction value obtained after predicting the first prediction value based on the adaptive filtering scheme provided by the above embodiment, and w represents the weight coefficient for weighted operation of the two prediction values.
[0267] The following describes in detail the specific implementation of the video processing method in some application scenarios of the embodiment of the present application, taking the decoding process performed by the video decoding end as an example.
[0268] In one application scenario, a video decoder can decode a video stream and, based on the decoding result, determine whether the image block to be reconstructed (using a coding block as an example) uses the IBC filtering method provided in the above embodiments of this application. Determining whether to use the IBC filtering method can be implemented in the following three ways.
[0269] In the first implementation, the codestream includes a high-level syntax element indicating whether to use IBC-APF. Based on this high-level syntax element, it can be determined whether the current block is allowed to use IBC-APF. The syntax structure of the relevant syntax elements is shown in Table 5.
[0270] Table 5
[0271] pic_ibc_flag represents the picture-level intra block copy prediction flag. This flag is a binary variable. A value of '1' indicates that IBC mode can be used; a value of '0' indicates that IBC mode should not be used. The value of PicIbcFlag is equal to the value of pic_ibc_flag. If pic_ibc_flag is not present in the bitstream, the value of PicIbcFlag is 0.
[0272] pic_ibc_type indicates the picture-level intra block copy prediction mode type index. A value of '0' indicates that the first type of IBC mode can be used; a value of '1' indicates that the second type of IBC mode can be used. The value of PicIbcType is equal to the value of pic_ibc_type. If pic_ibc_type does not exist in the codestream, the value of PicIbcType is 0.
[0273] pic_ibc_apf_flag represents the picture-level intra block copy prediction adaptive filtering flag. This flag is a binary variable. A value of '1' indicates that the IBC adaptive filtering mode can be used; a value of '0' indicates that the IBC adaptive filtering mode should not be used. The value of PicIbcApfFlag is equal to the value of pic_ibc_apf_flag. If pic_ibc_apf_flag is not present in the bitstream, the value of PicIbcApfFlag is 0.
[0274] In the second implementation, a high-level syntax element in the bitstream indicates whether to use IBC-PF (IBC filtering method, which can include multiple filtering methods). The use of IBC-PF is determined based on this syntax element. The syntax structure of the relevant syntax elements is shown in Table 6.
[0275] Table 6
[0276] pic_ibc_flag represents the picture-level intra block copy prediction flag, a binary variable. A value of '1' indicates that IBC mode can be used; a value of '0' indicates that IBC mode should not be used. The value of PicIbcFlag is equal to the value of pic_ibc_flag. If pic_ibc_flag is not present in the bitstream, the value of PicIbcFlag is 0.
[0277] pic_ibc_pf_index represents the picture-level intra block copy prediction filter index. This index is a binary variable. A value of '0' indicates that the first IBC filter mode can be used; a value of '1' indicates that the second IBC filter mode can be used. The value of PicIbcPfFlag is equal to the value of pic_ibc_pf_flag. If pic_ibc_pf_flag is not present in the bitstream, the value of PicIbcPfFlag is 0.
[0278] In a third implementation, a block-level flag included in the code stream is obtained by decoding the code stream, and the block-level flag is used to indicate whether to perform filtering processing on the current block.
[0279] In some application scenarios, the block-level flag is decoded only when a preset decoding condition is met. The decoding condition may include one or more of the following conditions.
[0280] (1) According to the high-level syntax information of the image header, the current image is allowed to use the IBC-APF mode.
[0281] (2) The area of the current block (width * height) is greater than 32.
[0282] (3) The position (horizontal coordinate and / or vertical coordinate) of the current block is greater than or equal to a specific threshold.
[0283] The specific threshold can be determined according to the template size. Assume that the template size is tpl_size (for example, a value of 4). The template size represents the height of the template above the image block, or the width of the template on the left.
[0284] The threshold is determined based on the partition tree type of the current block (including luma, chroma, and luminance-chroma trees). If the partition tree type is luma only, the threshold is tpl_size. If the current block includes a chroma tree, the threshold is tpl_size * scale_ratio. The scale_ratio is determined by the image color format. For example, for a YUV420 image, the length and width of the luma component are twice that of the chroma components. In this case, the scale_ratio is 2, meaning the threshold is tpl_size * 2.
[0285] In some application scenarios, only the flag cu_ibc_pf_flag may be used to indicate the IBC-APF mode used by the current block. The semantic information corresponding to different values of the flag cu_ibc_pf_flag is shown in Table 7.
[0286] Table 7
[0287] In some application scenarios, the bitstream also contains a flag, ibc_type, that indicates the filter type (which can be a sequence-level, picture-level, slice-level, or block-level flag). Different values of ibc_type indicate different filtering methods. Table 8 shows the semantic information corresponding to different values of the ibc_type and cu_ibc_pf_flag flags.
[0288] Table 8
[0289] The binarization / debinarization method of the above flags may use truncated unary codes.
[0290] If it is determined that the current block uses IBC-APF, a filter is determined according to the following method, and the IBC prediction value of the current block is filtered based on the filter.
[0291] The filter model of IBC-APF can be expressed as: y = p0*x0+p1*x1+p2*x2+…+pn*xn.
[0292] Among them, {p0, p1, …, pn} are filter parameters, {x0, x1, …, xn} are input values, and y is the output value.
[0293] xi is derived based on the reference sample corresponding to the current sample to be filtered and its adjacent samples.
[0294] Taking the sample points shown in Figure 7A as an example, the filter center C is the reference sample point for the current sample point C' to be filtered, determined based on the block vector. N, S, W, E, NW, NE, SW, and SE represent the sample points above, below, left, right, upper left, upper right, lower left, and lower right of the spatial position of sample point C, respectively.
[0295] The filter shape can be extended to other shapes (including but not limited to the various shapes shown in FIG8 ), and the filter center is located at the reference sample point determined by the current sample point to be filtered according to the block vector.
[0296] Let Rj represent the input of the filter, and xi can be any combination of Rj, such as Rj, m*Rj, Rj k , and at least one of the constant bias term B, or a combination of any of these terms multiplied or added together. Here, m and k are non-zero integers, and k is an integer greater than 1.
[0297] In some application scenarios, the filter may select one or more of the following candidate models.
[0298] a) y = p0C + p1N + p2S + p3W + p4E + p5C 2 +p6B
[0299] b) y = p0C + p1N + p2S + p3W + p4E + p5B
[0300] c)y=p0C+p1(N+S)+p2(W+E)+p3B
[0301] d)y=p0C+p1(N+W)+p2(S+E)+p3B
[0302] e)y=p0C+p1N+p2S+p3B
[0303] f)y=p0C+p1E+p2W+p3B
[0304] g)y=p0C+p1B
[0305] h)
[0306] i)
[0307] j)
[0308] k)
[0309] l)
[0310] m)
[0311] n)
[0312] o)
[0313] p)
[0314] Based on the above filter model, let y be the sample points in the current block template area and the input be the sample points in the corresponding reference block template area. This generates an equation. Multiple such equations are constructed using the sample points in the template area to solve for the model parameters pi. The model parameter solution process can be coupled with the encoding and decoding process, that is, the model parameters are calculated online for each encoded block using adjacent templates.
[0315] Figure 15 shows a schematic diagram of the distribution of template regions used in an application scenario according to an embodiment of the present application. The template regions may be all adjacent regions of an image block shown in the figure.
[0316] For example, the top+left template indicates that the template area includes the adjacent areas A, B, and D above and to the left of the image block.
[0317] The upper template indicates that the template area includes the adjacent area B above the image block.
[0318] The left template indicates that the template area includes the adjacent area D to the left of the image block.
[0319] The size of region B is (blk_w, 2), and the size of region D is (2, blk_h). blk_w represents the width of the image block, and blk_h represents the height of the image block.
[0320] In some application scenarios, multiple templates may exist at the same time, and the specific template to be used is determined based on the code stream parsing results. For example, there are multiple templates as shown in Figure 14 at the same time. When the value of the first syntax element in the code stream is 1, it means that the full area combination (LT type) template is used. When the value of the first syntax element is 0, it means that the LT type is not used. When the first syntax element is 0, continue decoding the code stream to determine whether other templates are used. When the value of the second syntax element in the code stream is 01, it means that the left area combination template (L type) is used. When the value of the second syntax element in the code stream is 00, it means that the upper area combination template (T type) is used.
[0321] After the filter is determined, the boundary of the template as input is expanded according to the shape of the filter.
[0322] For example, when the filter uses the shape 1 shown in FIG8 , the four neighboring pixel points N, S, W, and E around the central sample point C are needed. At this time, the template can be expanded outward by 1 unit.
[0323] FIG16 shows a schematic diagram of template area expansion in an application scenario according to an embodiment of the present application.
[0324] As shown in Figure 16, the original template region includes adjacent regions A, B, and D located above and to the left of the image block. After the template region is expanded outward, corresponding expanded regions PT, PL, PB, and PR can be determined.
[0325] The width of PT and PB is equal to the width of the image block + the width of region D / region A. The height of PL and PR is equal to the height of the image block + the height of region B / region A.
[0326] The height of PT and PB is pad_size, and the width of PL and PR is pad_size. pad_size is determined by the filter shape. For example, if the filter needs to use pixels 1 unit away from the center, the pad_size value is 1.
[0327] For a portion of {PT, PB, PR, PL} (e.g., PT and PL), first determine whether the region is within a usable reconstructed area (e.g., within the image boundary). If so, use the value of that region; otherwise, set its value to the value of the adjacent reconstructed sample. For example, PT is set to the value of the sample below, and PL is set to the value to the right.
[0328] For some regions in {PT, PB, PR, PL} (such as PR and PB), their values are set to the values of their adjacent reconstructed samples. For example, PR is set to the value of the sample to the left, and PB is set to the value of the sample above.
[0329] The model parameters of the filter model are calculated using all sample points in the template area.
[0330] Based on the available sample points in the template area, multiple equations can be established for the filter model, for example, Ax = b. By solving for x, the values of all model parameters pi can be obtained. Where A is a matrix with M rows and N columns, where M and N represent the number of equations established based on the template and the number of model parameters, respectively. There are many methods for solving this equation, such as LDL decomposition or Gaussian elimination. Here, the LDL decomposition method is used as an example:
[0331] (1)A T Ax=A T b. A T is the transposed matrix of matrix A.
[0332] (2) To A T A decomposes into LDL T x=A T b. L is the unit lower triangular matrix, D is the diagonal matrix, L T is the transposed matrix of L.
[0333] (3) Solve LY = A Tb gets Y.
[0334] (4) Solving DL Y x=Y to get x, which is the model parameter p i .
[0335] After solving the model parameters, the IBC prediction value (or the modified intermediate value of the IBC prediction value) can be filtered according to the filter model. The IBC prediction value of the current block (the value of the reference block) is used as input. The reference block boundary is expanded according to the filter shape to filter the reference block boundary samples. Boundary pixels can be directly copied, and if boundary samples are available, they can be used directly. Filtering is then performed using the derived model parameters.
[0336] As shown in Figure 7C, the sample point in the reference block is C, and the sample point in the current block is C'. In the current block, the IBC prediction value corresponding to the sample point C' is the value of C. According to the method of the embodiment of the present application, the value of C' is filtered using a filter.
[0337] Based on the introduction of the above embodiments and application scenarios, it can be seen that the embodiments of the present application can adaptively calculate the filtering parameters based on the reconstructed area adjacent to the current block and the reference block, and filter the IBC prediction block, which can eliminate the spatial discontinuity between the prediction block and the surrounding pixels, and is conducive to improving the coding performance.
[0338] It should be noted that although the steps of the method of the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0339] The following describes an embodiment of the device of the present application, which can be used to execute the video processing method in the above-mentioned embodiment of the present application. FIG17 schematically shows a block diagram of the structure of the video processing device provided in the embodiment of the present application. As shown in FIG17 , the video processing device 1700 includes:
[0340] A prediction module 1710 is configured to perform intra block copy prediction based on a reference block of a current block to obtain a first prediction value of the current block, where the current block is an image block to be reconstructed in a current video frame and the reference block is an image block that has been reconstructed in the current video frame;
[0341] a determining module 1720 configured to determine a first template region corresponding to the reference block and a second template region corresponding to the current block, wherein the first template region includes one or more reconstructed image regions adjacent to the reference block, and the second template region includes one or more reconstructed image regions adjacent to the current block;
[0342] The filtering module 1730 is configured to determine a filter according to the first template area and the second template area, and perform filtering processing on the first prediction value of the current block according to the filter to obtain a second prediction value of the current block.
[0343] In all embodiments of the present application, based on the above embodiments, the filtering module 1730 can be further configured to: obtain the filtering condition of the current block, and the filtering condition is used to determine whether to filter the current block; when the filtering condition is met, filter the first prediction value of the current block according to the filter.
[0344] In all embodiments of the present application, based on the above embodiments, the filtering condition includes at least one of the following conditions:
[0345] The code stream parameter corresponding to the current block has a specified value;
[0346] The image feature of the current block satisfies a preset first feature condition;
[0347] The image feature of the reference block satisfies a preset second feature condition;
[0348] The image feature of the template area meets a preset third feature condition, and the template area includes a first template area and a second template area.
[0349] In all embodiments of the present application, based on the above embodiments, the code stream parameters include a filtering flag, which is used to indicate whether to perform filtering processing on the image block. The filtering flag includes one or more of the following flags:
[0350] Sequence header filter flag, used to indicate whether the image blocks in the video frame sequence are to be filtered;
[0351] Image header filtering flag, used to indicate whether the image block in the video frame is filtered;
[0352] Slice header filter flag, used to indicate whether the image blocks in the image slice are to be filtered;
[0353] Block-level filtering flag, used to indicate whether the current block is filtered.
[0354] In all embodiments of the present application, based on the above embodiments, when the block-level filtering flag exists in the code stream parameters, the block-level filtering flag is decoded when a preset decoding condition is met, and decoding of the block-level filtering flag is prohibited when the decoding condition is not met.
[0355] In all embodiments of the present application, based on the above embodiments, the code stream parameters further include a filtering index, which is used to indicate a filtering mode for filtering the image block, and the filtering mode includes one or more different filtering methods.
[0356] In all embodiments of the present application, based on the above embodiments, the filtering flag is further used to indicate a filtering mode for filtering the image block, and the filtering mode includes one or more different filtering methods.
[0357] In all embodiments of the present application, based on the above embodiments, the code stream parameter further includes a filter type field for indicating a filter type;
[0358] When the value of the filter type field is the first value, the filter flag is used to indicate whether to perform filtering processing on the image block, and the filtering mode for performing filtering processing on the image block is the preset first mode;
[0359] When the filter type field takes the second value, the filter flag is used to indicate whether to perform filtering on the image block, and the filtering mode for filtering the image block is a preset second mode, which is a filtering mode different from the first mode.
[0360] In all embodiments of the present application, based on the above embodiments, the value of the filtering flag is determined according to the coding loss, and the coding loss is calculated by a preset cost function;
[0361] If the coding loss after filtering the template region of the image block is less than the coding loss before filtering the template region of the image block, assigning the filtering flag to a first value, where the first value is used to indicate that filtering is to be performed on the image block;
[0362] If the coding loss after filtering the template area of the image block is greater than the coding loss before filtering the template area of the image block, the filtering flag is assigned a second value, which is used to indicate that filtering of the image block is prohibited.
[0363] In all embodiments of the present application, based on the above embodiments, the value of the filtering flag is determined according to the number of transform coefficients in the image block;
[0364] If the transform coefficients in the image block meet a preset first quantity condition, assigning the filter flag a first value, where the first value is used to indicate that filtering processing is to be performed on the image block;
[0365] If the transformation coefficients in the image block meet a preset second quantity condition, the filtering flag is assigned a second value, and the second value is used to indicate that filtering processing on the image block is prohibited.
[0366] In all embodiments of the present application, based on the above embodiments, the first characteristic condition includes one or more of the following conditions:
[0367] The current video frame where the current block is located has a specified image type;
[0368] The current block has a specified distribution position in the current video frame;
[0369] The image size of the current block is within a preset size range, where the image size includes one or more of width, height, or area;
[0370] The block vector resolution of the current block is within a preset resolution range;
[0371] The block vector residual of the current block is within a preset residual range, and the block vector residual includes one or more of a horizontal block vector residual and a vertical block vector residual;
[0372] The block vector index of the current block is within a preset index range;
[0373] The current block is an image block having a specified color component.
[0374] In all embodiments of the present application, based on the above embodiments, the second characteristic condition includes: the sample points of the reference block meet a preset sample point availability condition, and the sample point availability condition includes that the sample point is located within the boundary of an independently decodable image or the sample point has completed decoding and reconstruction.
[0375] In all embodiments of the present application, based on the above embodiments, the third characteristic condition includes one or more of the following conditions:
[0376] The area of the template region is within a preset area range;
[0377] The sample points of the template area meet a preset sample point availability condition, where the sample point availability condition includes that the sample point is within the boundary of an independently decodable image or the sample point has been decoded and reconstructed;
[0378] The number of sample pairs collected in the template area is greater than the number of model parameters of the filter.
[0379] In all embodiments of the present application, based on the above embodiments, the filtering module 1730 is further configured to: select a first sample point from the first template area, and select a second sample point corresponding to the first sample point from the second template area; determine a filter based on a sample pair consisting of the first sample point and the second sample point, the input item of the filter includes the pixel value of the first sample point, the output item of the filter includes the pixel value of the second sample point, and the pixel value includes a predicted value or a reconstructed value.
[0380] In all embodiments of the present application, based on the above embodiments, the input item of the filter also includes pixel values of one or more neighborhood pixels, and the neighborhood pixels are the nearest or next-nearest neighbors of the first sample point.
[0381] In all embodiments of the present application, based on the above embodiments, the filter includes one or more combination items with independent weighting parameters, and the combination item takes the pixel value of one or more pixel points as an input item.
[0382] In all embodiments of the present application, based on the above embodiments, the filter includes at least two combination terms with different orders, and the order is the highest power of the input terms in the combination terms.
[0383] In all embodiments of the present application, based on the above embodiments, a method for selecting sample points in a template area includes: obtaining a pixel sampling mode of the current block, the pixel sampling mode including full pixel sampling or partial pixel sampling; when the pixel sampling mode of the current block is full pixel sampling, all pixels in the template area can be selected as sample points; when the pixel sampling mode of the current block is partial pixel sampling, some pixels with designated sampling positions in the template area can be selected as sample points. When the pixel sampling mode of the current block is full pixel sampling, pixels are selected from all pixels in the first template area as first sample points, and pixels are selected from all pixels in the second template area as second sample points; when the pixel sampling mode of the current block is partial pixel sampling, pixels are selected from some pixels at a first designated sampling position in the first template area as first sample points, and pixels are selected from some pixels at a second designated sampling position in the second template area as second sample points.
[0384] In all embodiments of the present application, based on the above embodiments, the designated sampling position includes at least one of the following sampling positions:
[0385] The pixel point's position coordinates meet the specified sampling position of the preset coordinate value conditions;
[0386] A designated sampling position is selected along a preset pixel scanning direction;
[0387] The pixel value falls within the specified sampling position within the preset value range.
[0388] In all embodiments of the present application, based on the above embodiments, the coordinate numerical conditions include:
[0389] At least one of the horizontal position coordinate and the vertical position coordinate of the pixel point is an even number;
[0390] Alternatively, at least one of the horizontal position coordinate and the vertical position coordinate of the pixel point is an odd number.
[0391] In all embodiments of the present application, based on the above embodiments, the template area is composed of one or more nearest neighbor areas or second-nearest neighbor areas, the nearest neighbor area includes an image area with a specified image size located above or to the left of the image block, and the second-nearest neighbor area includes an image area with a specified image size located in the upper left, lower left or upper right of the image block.
[0392] In all embodiments of the present application, based on the above embodiments, the next-nearest neighboring region to the upper right of the image block has the same image size as the image block in the horizontal direction, and the next-nearest neighboring region to the upper right of the image block has a specified image size in the vertical direction, and the specified image size is greater than or equal to one;
[0393] The next nearest neighboring area at the lower left of the image block has the same image size as the image block in the vertical direction, and the next nearest neighboring area at the upper right of the image block has the specified image size in the horizontal direction;
[0394] The next-nearest neighboring area at the upper left of the image block has the specified image size in both the horizontal direction and the vertical direction.
[0395] In all embodiments of the present application, based on the above embodiments, the template area includes at least one of a full area combination, a left area combination, and an upper area combination;
[0396] The full region combination includes the nearest neighbor regions located on the left and above the image block and the next nearest neighbor regions located on the upper left, lower left and upper right of the image block;
[0397] The left region combination includes a nearest neighbor region located on the left side of the image block and a next nearest neighbor region located on the lower left side of the image block;
[0398] The upper region combination includes a nearest neighbor region located above the image block and a next nearest neighbor region located to the upper right of the image block.
[0399] In all embodiments of the present application, based on the above embodiments, the code stream parameter corresponding to the current block includes a region type field, and the region type field is used to indicate the region type of the template region corresponding to the current block.
[0400] In all embodiments of the present application, based on the above embodiments, the fitting module 1730 is further configured to: perform a weighted operation on the first prediction value and the second prediction value according to a preset weight coefficient to obtain a third prediction value of the current block.
[0401] The specific details of the video processing device provided in each embodiment of the present application have been described in detail in the corresponding method embodiments and will not be repeated here.
[0402] FIG18 schematically shows a block diagram of a computer system structure of an electronic device for implementing an embodiment of the present application.
[0403] The computer system 1800 of the electronic device shown in FIG18 is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0404] As shown in Figure 18, the computer system 1800 includes a central processing unit (CPU) 1801, which can perform various appropriate actions and processes according to the program stored in the read-only memory 1802 (ROM) or the program loaded from the storage part 1808 into the random access memory 1803 (RAM). Various programs and data required for system operation are also stored in the random access memory 1803. The CPU 1801, the read-only memory 1802, and the random access memory 1803 are connected to each other via a bus 1804. An input / output interface 1805 (i.e., an I / O interface) is also connected to the bus 1804.
[0405] The following components are connected to the input / output interface 1805: an input section 1806 including a keyboard, a mouse, and the like; an output section 1807 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 1808 including a hard disk; and a communication section 1809 including a network interface card such as a local area network card or a modem. The communication section 1809 performs communication processing via a network such as the Internet. A drive 1810 is also connected to the input / output interface 1805 as needed. Removable media 1811, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1810 as needed, so that computer programs read therefrom can be installed into the storage section 1808 as needed.
[0406] In particular, according to an embodiment of the present application, the processes described in the various method flow charts can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the methods shown in the flow charts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1809 and / or installed from a removable medium 1811. When the computer program is executed by the central processing unit 1801, the various functions defined in the system of the present application are performed.
[0407] The computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0408] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0409] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0410] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments 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, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
[0411] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.
[0412] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A video processing method, characterized in that: include: performing intra-block copy prediction on the current block according to a reference block of the current block to obtain a first prediction value of the current block, wherein the current block is an image block to be processed in a current video frame, and the reference block is a reconstructed image block in the current video frame; Determining a first template region of the reference block and a second template region of the current block, wherein the first template region includes one or more reconstructed image regions adjacent to the reference block, and the second template region includes one or more reconstructed image regions adjacent to the current block; A filter is determined according to the first template area and the second template area, and a first prediction value of the current block is filtered according to the filter to obtain a second prediction value of the current block.
2. The method according to claim 1, characterized in that Performing filtering processing on the first prediction value of the current block according to the filter, comprising: Determining whether the current block meets a filtering condition; When the filtering condition is met, filtering the first prediction value of the current block according to the filter, The filtering condition includes at least one of the following conditions: A code stream parameter associated with the current block has a specified value; The image feature of the current block satisfies a preset first feature condition; The image feature of the reference block satisfies a preset second feature condition; The image features of the template area meet a preset third feature condition, and the template area includes the first template area and the second template area.
3. The method according to claim 2, characterized in that The code stream parameters include a filtering flag, which is used to indicate whether to perform filtering processing on the image block. The filtering flag includes one or more of the following flags: Sequence header filter flag, used to indicate whether the image blocks in the video frame sequence are to be filtered; Image header filtering flag, used to indicate whether the image block in the video frame is filtered; Slice header filter flag, used to indicate whether the image blocks in the image slice are to be filtered; The block-level filtering flag is used to indicate whether filtering is performed on the current block.
4. The method according to claim 3, characterized in that When the block-level filter flag exists in the code stream parameters, the block-level filter flag is decoded when a preset decoding condition is met, and the decoding of the block-level filter flag is prohibited when the preset decoding condition is not met.
5. The method according to claim 4, characterized in that The preset decoding conditions include one or more of the following conditions: A high-level syntax element in the code stream parameter indicates that filtering processing is performed on the image block, and the high-level syntax element includes at least one of a sequence header filter flag, a picture header filter flag, and a slice header filter flag; The area of the current block is within a preset value range; The position coordinates of the current block are within a preset coordinate range; The reference area of the current block in the current video frame satisfies a preset range restriction, and the reference area includes one or more of the current block, a template area of the current block, and an extended area of the template area; The reference area of the current block meets the reference range restriction of intra block copy prediction.
6. The method according to claim 5, characterized in that The preset coordinate range includes a range greater than or equal to a coordinate threshold; and the method for determining the coordinate threshold includes at least one of the following methods: Determining the coordinate threshold according to a preset fixed value; Determining the coordinate threshold according to the template size of the template area; When the template area is an image area located above the current block, the template size is the height of the template area; when the template area is an image area located to the left of the current block, the template size is the width of the template area.
7. The method according to claim 6, characterized in that Determining the coordinate threshold according to the template size of the template area includes: When the current block does not include a chroma component, using a template size of the template area as the coordinate threshold; When the current block includes a chroma component, a weighting coefficient is determined according to a sampling ratio of a luminance component to a chroma component, and a product of the weighting coefficient and a template size of the template area is used as the coordinate threshold.
8. The method according to any one of claims 3 to 7, characterized in that The code stream parameters further include a filtering index, where the filtering index is used to indicate a filtering mode for filtering the image block, and the filtering mode includes one or more different filtering methods.
9. The method according to any one of claims 3 to 7, characterized in that The filtering flag is also used to indicate a filtering mode for filtering the image block, and the filtering mode includes one or more different filtering methods.
10. The method according to any one of claims 3 to 9, characterized in that The code stream parameters further include a filter type field for indicating a filter type; When the value of the filter type field is the first value, the filter flag is used to indicate whether to perform filtering processing on the image block, and the filtering mode for performing filtering processing on the image block is the preset first mode; When the filtering type field takes a second value, the filtering flag is used to indicate whether the image block is filtered, and the filtering mode for filtering the image block is a preset second mode, which is a filtering mode different from the first mode.
11. The method according to any one of claims 3 to 10, characterized in that The value of the filtering flag is determined according to the coding loss, and the coding loss is calculated by a preset cost function; If the coding loss after filtering the template region of the image block is less than the coding loss before filtering the template region of the image block, assigning the filtering flag to a first value, where the first value is used to indicate that filtering is to be performed on the image block; If the coding loss after filtering the template area of the image block is greater than the coding loss before filtering the template area of the image block, the filtering flag is assigned a second value, which is used to indicate that filtering of the image block is prohibited.
12. The method according to any one of claims 3 to 10, characterized in that The value of the filtering flag is determined according to the number of transform coefficients in the image block; If the transform coefficients in the image block meet a preset first quantity condition, assigning the filter flag a first value, where the first value is used to indicate that filtering processing is to be performed on the image block; If the transformation coefficients in the image block meet a preset second quantity condition, the filtering flag is assigned a second value, and the second value is used to indicate that filtering processing on the image block is prohibited.
13. The method according to any one of claims 2 to 12, characterized in that The first characteristic condition includes one or more of the following conditions: The current video frame where the current block is located has a specified image type; The current block has a specified distribution position in the current video frame; The image size of the current block is within a preset size range, where the image size includes one or more of width, height, or area; The block vector resolution of the current block is within a preset resolution range; The block vector residual of the current block is within a preset residual range, and the block vector residual includes one or more of a horizontal block vector residual and a vertical block vector residual; The block vector index of the current block is within a preset index range; The current block is an image block having a specified color component.
14. The method according to any one of claims 2 to 13, characterized in that The second characteristic condition includes: the sample points of the reference block meet a preset sample point availability condition, and the sample point availability condition includes that the sample points are located within the boundary of an independently decodable image or the sample points have completed decoding and reconstruction.
15. The method according to any one of claims 2 to 14, characterized in that The third characteristic condition includes one or more of the following conditions: The area of the template region is within a preset area range; The sample points of the template area meet a preset sample point availability condition, where the sample point availability condition includes that the sample point is within the boundary of an independently decodable image or the sample point has been decoded and reconstructed; The number of sample pairs collected in the template area is greater than a preset number threshold.
16. The method according to claim 15, characterized in that The number threshold comprises the number of model parameters in the filter.
17. The method according to any one of claims 1 to 16, characterized in that Determining a filter according to the first template area and the second template area includes: Selecting a first sample point from the first template area, and selecting a second sample point corresponding to the first sample point from the second template area; Using the first pixel value of the first sample point as an input item of the filter, and using the second pixel value of the second sample point as an output item of the filter; The parameters of the filter are determined according to a first pixel value of the first sample point and a second pixel value of the second sample point, where the first pixel value and the second pixel value include predicted values or reconstructed values.
18. The method according to claim 17, characterized in that The input item of the filter further includes pixel values of one or more neighboring pixel points, where the neighboring pixel points are the nearest neighbor or the second nearest neighbor of the first sample point.
19. The method according to claim 17 or 18, characterized in that The filter includes one or more combination items with independent weighting parameters, and the combination item takes the pixel value of one or more pixel points as an input item.
20. The method according to any one of claims 17 to 19, characterized in that The filter includes at least two combination terms with different orders, the order being the highest power of input terms in the combination terms.
21. The method according to any one of claims 17 to 20, characterized in that Selecting the first sample point in the first template area and selecting the second sample point in the second template area includes: Obtaining a pixel sampling mode of the current block, where the pixel sampling mode includes full pixel sampling or partial pixel sampling; When the pixel sampling mode of the current block is full pixel sampling, a pixel is selected from all the pixels in the first template area as the first sample point, and a pixel is selected from all the pixels in the second template area as the second sample point; When the pixel sampling mode of the current block is partial pixel sampling, pixel points are selected from some pixel points at a first specified sampling position in the first template area as the first sample points, and pixel points are selected from some pixel points at a second specified sampling position in the second template area as the second sample points.
22. The method according to claim 21, characterized in that The first designated sampling position and the second designated sampling position include at least one of the following: The pixel point's position coordinates meet the specified sampling position of the preset coordinate value conditions; A designated sampling position is selected along a preset pixel scanning direction; The pixel value falls within the specified sampling position within the preset value range.
23. The video decoding method according to claim 22, wherein: The coordinate numerical conditions include: At least one of the horizontal position coordinate and the vertical position coordinate of the pixel point is an even number; Alternatively, at least one of the horizontal position coordinate and the vertical position coordinate of the pixel point is an odd number.
24. The method according to any one of claims 1 to 23, characterized in that The template area is composed of one or more nearest neighbor areas or second nearest neighbor areas, the nearest neighbor area includes an image area with a specified image size located above or to the left of the image block, the second nearest neighbor area includes an image area with a specified image size located above, below, or above the right of the image block, the template area includes at least one of the first template area and the second template area, and the image block includes at least one of the current block and the reference block.
25. The method according to claim 24, characterized in that The next-nearest neighboring region to the upper right of the image block has the same image size as the image block in the horizontal direction, and the next-nearest neighboring region to the upper right of the image block has a specified image size in the vertical direction, and the specified image size is greater than or equal to one; The next nearest neighboring area at the lower left of the image block has the same image size as the image block in the vertical direction, and the next nearest neighboring area at the upper right of the image block has the specified image size in the horizontal direction; The next-nearest neighboring area at the upper left of the image block has the specified image size in both the horizontal direction and the vertical direction.
26. The method according to claim 24 or 25, characterized in that The template area includes at least one of a full area combination, a left area combination and an upper area combination; The full region combination includes the nearest neighbor regions located on the left and above the image block and the next nearest neighbor regions located on the upper left, lower left and upper right of the image block; The left region combination includes a nearest neighbor region located on the left side of the image block and a next nearest neighbor region located on the lower left side of the image block; The upper region combination includes a nearest neighbor region located above the image block and a next nearest neighbor region located to the upper right of the image block.
27. The method according to claims 2 to 26, characterized in that The code stream parameters related to the current block include a region type field, where the region type field is used to indicate a region type of a template region corresponding to the current block.
28. The method according to any one of claims 1 to 16, characterized in that After obtaining the second prediction value of the current block, the method further includes: A weighted operation is performed on the first prediction value and the second prediction value according to a preset weight coefficient to obtain a third prediction value of the current block.
29. A video processing device, characterized in that: include: a prediction module configured to perform intra-block copy prediction on a current block based on a reference block of the current block to obtain a first prediction value of the current block, wherein the current block is an image block to be processed in a current video frame and the reference block is a reconstructed image block in the current video frame; a determining module configured to determine a first template region corresponding to the reference block and a second template region corresponding to the current block, wherein the first template region includes one or more reconstructed image regions adjacent to the reference block, and the second template region includes one or more reconstructed image regions adjacent to the current block; The filtering module is configured to determine a filter according to the first template area and the second template area, and perform filtering processing on the first prediction value of the current block according to the filter to obtain a second prediction value of the current block.
30. A computer-readable medium, characterized in that The computer-readable medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 28 is implemented.
31. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the executable instructions to implement the method according to any one of claims 1 to 28.
32. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 28 is implemented.
33. A method for storing a video stream, characterized in that: The video code stream can be generated according to the video processing method according to claims 1-28.
Citation Information
Patent Citations
Method and apparatus for video coding
CN113661703A
Method and apparatus of local illumination compensation for inter prediction
CN113841405A
Video coding and decoding method and device
CN115486075A
System and method for anomaly detection of submarines
KR1020250061043A