Video decoding method, video coding method, decoder, encoder, device and medium
By combining the adjacent area reconstruction information of the target block and the original prediction information in the video decoding method, the target prediction information of the target block is determined, and the problem of spatial discontinuity between the image block and the surrounding pixels in the intra-block replication IBC prediction is solved, and the image quality and encoding and decoding performance are improved.
Patent Information
- Application Number
- PCT/CN2024/131397
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-10
- Filing Date
- 2024-11-11
- Publication Date
- 2025-06-19
AI Technical Summary
In the prior art, the video encoding method based on intra-block replication IBC prediction has the problem of spatial discontinuity between the reconstruction image block and surrounding pixels, which affects image quality and encoding and codec performance.
In the video decoding method, the target prediction information of the target block is determined by using the reconstruction information and original prediction information of the adjacent areas of the target block, thereby reducing the spatial discontinuity between the target block and the surrounding area.
This method effectively improves image quality and codec performance, and improves the smooth transition of the image by reducing the spatial discontinuity between the target block and the surrounding area.
Smart Images

Figure CN2024131397_19062025_PF_FP_ABST
Abstract
Description
Video decoding method, video encoding method, codec, device and medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on December 10, 2023, with application number 202311702301.4 and invention name “Video decoding method, video encoding method, codec, device and medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of video coding and decoding technology, and in particular to a video decoding method, a video encoding method, a decoder, an encoder, an electronic device, and a computer-readable storage medium. Background Art
[0003] In related technologies, video coding standards such as High Efficiency Video Coding (HEVC), Versatile Video Coding (VVC), and Audio Video Coding Standard (AVS)3 all adopt a hybrid coding framework based on image blocks. They divide the original frame of an image into a series of image blocks and combine video coding methods such as prediction, transform, and entropy coding to achieve video data compression. Among them, motion compensation is a commonly used prediction method for video coding and decoding. Motion compensation is based on the redundant characteristics of video content in the time domain or spatial domain, and determines the predicted value of the current block to be encoded based on the reference block. Such prediction methods based on motion compensation include: inter-frame prediction, intra-frame block copy (IBC), intra-frame string copy, etc.
[0004] IBC is an intra-frame coding tool adopted by the HEVC Screen Content Coding (SCC) extension. Related technologies using IBC suffer from poor spatial continuity between reconstructed image blocks and surrounding pixels, impacting image quality and hindering codec performance.
[0005] Summary of the Invention
[0006] The present application provides a video decoding method, a video encoding method, a decoder, an encoder and a computer-readable storage medium, which can reduce the spatial discontinuity between the prediction block and the surrounding pixels at least to a certain extent, thereby improving image quality and encoding and decoding performance.
[0007] In a first aspect, the present application provides a video decoding method, applied to a processor, the method comprising: parsing a code stream to determine a target block, wherein the prediction mode of the target block is intra-block copy (IBC) prediction; determining target prediction information of the target block based on reconstruction information of an adjacent area of the target block and original prediction information of the target block; and determining reconstruction information of the target block based on the target prediction information.
[0008] In a second aspect, the present application provides a video encoding method, applied to a processor, the method comprising: determining a target block, the prediction mode of the target block being intra-block copy (IBC) prediction; determining target prediction information of the target block based on reconstruction information of adjacent areas of the target block and original prediction information of the target block; and determining reconstruction information of the target block based on the target prediction information.
[0009] In a third aspect, the present application provides a decoder, comprising: a first determination module, a second determination module, and the first determination module;
[0010] Among them, the above-mentioned first determination module is used to parse the code stream and determine the target block, and the prediction mode of the target block is intra-frame block copy (IBC) prediction; the above-mentioned second determination module is used to determine the target prediction information of the target block based on the reconstruction information of the adjacent area of the target block and the original prediction information of the target block; and the above-mentioned third determination module is used to determine the reconstruction information of the target block based on the target prediction information.
[0011] In a fourth aspect, the present application provides an encoder, comprising: a first determination module, a second determination module, and a third determination module;
[0012] Among them, the above-mentioned first determination module is used to: determine the target block, the prediction mode of the target block is intra-frame block copy IBC prediction; the above-mentioned second determination module is used to: determine the target prediction information of the target block based on the reconstruction information of the adjacent area of the target block and the original prediction information of the target block; the above-mentioned third determination module is used to: determine the reconstruction information of the target block based on the target prediction information.
[0013] In a fifth aspect, an electronic device is provided, comprising a processor and a memory, wherein the memory is configured to store a computer program, and the processor is configured to call and execute the computer program stored in the memory to execute the method of the first aspect or the second aspect and its respective implementations.
[0014] In a sixth aspect, a chip is provided for implementing the method of any aspect of the first aspect or its respective implementations. Specifically, the chip includes a processor for calling and executing a computer program from a memory, causing a device equipped with the chip to perform the method of the first or second aspect and its respective implementations.
[0015] In a seventh aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method in the above-mentioned first aspect or second aspect and its various implementations.
[0016] In an eighth aspect, a computer program product is provided, comprising computer program instructions, wherein the computer program instructions enable a computer to execute the method in the above-mentioned first aspect or second aspect and its various implementations.
[0017] In a ninth aspect, a computer program is provided, which, when executed on a computer, enables the computer to execute the method in the first aspect or the second aspect and its respective implementations.
[0018] In summary, for a target block whose prediction mode is intra-block copy (IBC) prediction, if a reconstructed block is obtained based on the original prediction information of the target block, the reconstructed block may have a discontinuous boundary, and thus there may be poor spatial continuity between the block and its surrounding pixels. In an embodiment of the present application, the target prediction information of the target block is determined based on the reconstruction information of the adjacent areas of the target block and the original prediction information of the target block. Since the reconstruction information of the areas surrounding the block is added to the target prediction information, it is beneficial to a smooth transition between the target block and its surrounding areas, thereby helping to reduce the spatial continuity between the target block and its surrounding areas, thereby improving image quality and improving encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] FIG1 is a structural diagram illustrating an example of a video encoder to which an embodiment of the present application may be applied;
[0020] FIG2 is a structural diagram of a video decoder to which embodiments of the present application may be applied;
[0021] FIG3 is an example diagram of an IBC prediction model to which embodiments of the present application may be applied;
[0022] FIG4 is a schematic diagram of a slice-level syntax structure in a code stream applicable to an embodiment of the present application;
[0023] FIG5 is a schematic diagram of a flow chart of a video decoding method provided in an embodiment of the present application;
[0024] FIG6 is a schematic diagram of a flow chart of a method for determining a target block according to an embodiment of the present application;
[0025] FIG7 is a schematic diagram of a flow chart of a method for determining a target block according to another embodiment of the present application;
[0026] FIG8 is a flowchart of a method for determining a target block according to another embodiment of the present application;
[0027] FIG9 is a schematic diagram of a flow chart of a method for determining a target block according to another embodiment of the present application;
[0028] FIG10 is a flow chart of a method for determining a target block according to another embodiment of the present application;
[0029] FIG11 is a schematic diagram of a process for determining target prediction information according to an embodiment of the present application;
[0030] FIG12 is a schematic diagram of the structure of a target block and its adjacent areas according to an embodiment of the present application;
[0031] FIG13 is a schematic diagram of a process for determining target prediction information according to another embodiment of the present application;
[0032] FIG14 is a schematic diagram of a flow chart of a video encoding method provided in an embodiment of the present application;
[0033] FIG15 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application;
[0034] FIG16 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application;
[0035] FIG17 is a schematic diagram of the structure of the encoding and decoding system provided in an embodiment of the present application;
[0036] FIG18 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0038] FIG1 illustrates an exemplary structure of a video encoder 100 applicable to embodiments of the present disclosure. The video encoder 100 can be used to perform lossy compression or lossless compression on an image. The lossless compression can be visually lossless or mathematically lossless.
[0039] The video encoder 100 can be applied to image data in a luminance and chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents brightness (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) used to describe color and saturation. For example, in terms of color format, 4:2:0 means that every 4 pixels have 4 luminance components and 2 chrominance components (YYYYCbCr), 4:2:2 means that every 4 pixels have 4 luminance components and 4 chrominance components (YYYYCbCrCbCr), and 4:4:4 represents full pixel display (YYYYCbCrCbCrCbCrCbCr).
[0040] For example, the video encoder 100 reads video data and, for each image in the video data, divides the image into a number of coding tree units (CTUs). In some examples, a CTU may be referred to as a "tree block," "largest coding unit" (LCU), or "coding tree block" (CTB). Each CTU may be associated with a pixel block of equal size within the image. Each pixel may correspond to one luminance (luma) sample and two chrominance (chroma) samples. Therefore, each CTU may be associated with one luminance sample block and two chrominance sample blocks. The size of a CTU is, for example, 128×128, 64×64, 32×32, etc. A CTU may be further divided into a number of coding units (CUs) for encoding. A CU may be a rectangular block or a square block. A CU may correspond to a prediction unit (PU) and a transform unit (TU).
[0041] 1 , a video encoder 100 may include a prediction module 110, a residual module 120, a transform / quantization module 130, an inverse transform / quantization module 140, a reconstruction module 150, a loop filter module 160, a decoded image buffer 170, and an entropy coding module 180. It should be noted that the video encoder 100 may include more, fewer, or different functional components.
[0042] Optionally, in this application, the current block may be referred to as the current coding unit (CU). The prediction block may also be referred to as a predicted image block or an image prediction block, and the reconstructed image block may also be referred to as a reconstructed block or an image reconstruction block. Due to the need for parallel processing, an image may be divided into slices. Slices in the same image may be processed in parallel, meaning that there is no data dependency between them. The term "frame" is commonly used, and it can generally be understood that a frame is an image. The term "frame" herein may also be replaced by "image" or "slice," etc.
[0043] In some embodiments, the prediction module 110 includes an inter-frame prediction module 111 and an intra-frame prediction module 112. Because there is a strong correlation between adjacent pixels in a video image, intra-frame prediction is used in video coding and decoding technologies to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent images in a video, inter-frame prediction is used in video coding and decoding technologies to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.
[0044] The inter-frame prediction module 111 can be used for inter-frame prediction. Inter-frame prediction can include motion estimation and motion compensation. It can refer to image information from different images. Inter-frame prediction uses motion information to find a reference block from a reference image and generate a prediction block based on the reference block to eliminate temporal redundancy. Inter-frame prediction uses motion information to find a reference block from a reference image and generate a prediction block based on the reference block. Motion information includes the reference image list in which the reference image is located, the reference image index, and the motion vector. The motion vector can be integer pixel or fractional pixel. If the motion vector is fractional pixel, interpolation filtering is required to generate the required fractional pixel block in the reference image. Here, the integer pixel or fractional pixel block in the reference image found based on the motion vector is called a reference block. Some technologies directly use the reference block as the prediction block, while others further process the reference block to generate a prediction block. Reprocessing the reference block to generate a prediction block can also be understood as using the reference block as the prediction block and then processing the prediction block to generate a new prediction block.
[0045] The intra-frame prediction module 112 only refers to information of the same image to predict pixel information within the current code image block to eliminate spatial redundancy.
[0046] Intra-frame prediction has multiple prediction modes. For example, the H-series international digital video coding standard H.264 / AVC has eight angular prediction modes and one non-angular prediction mode. H.265 / HEVC expands this to 33 angular prediction modes and two non-angular prediction modes. HEVC uses planar, direct current (DC), and 33 angular modes for a total of 35 intra-frame prediction modes. Versatile video coding (VVC) uses planar, DC, and 65 angular modes for a total of 67 intra-frame prediction modes.
[0047] It should be noted that with the increase of angle modes, intra-frame prediction will be more accurate and more in line with the needs of high-definition and ultra-high-definition digital video development.
[0048] Residual module 120 may generate a residual block for a CU based on the pixel block of the CU and the prediction block of the CU. For example, residual module 120 may generate a residual block for the CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel block of the CU and the corresponding sample in the prediction block of the CU.
[0049] The transform / quantization module 130 may quantize the transform coefficients. The transform / quantization module 130 may quantize the transform coefficients associated with the CU based on a quantization parameter (QP) value associated with the CU. The video encoder 100 may adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.
[0050] The inverse transform / quantization module 140 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficients to reconstruct a residual block from the quantized transform coefficients.
[0051] Reconstruction module 150 can add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by prediction module 110 to generate a reconstructed image block associated with the CU. By reconstructing each sample block of the CU in this manner, video encoder 100 can reconstruct the pixel blocks of the CU.
[0052] The loop filter module 160 is used to process the inverse transformed and inverse quantized pixels to compensate for distortion information and provide a better reference for subsequent pixel encoding. For example, it can perform a deblocking filtering operation to reduce the blocking effect of pixel blocks associated with the CU.
[0053] In some embodiments, the loop filtering module 160 includes a deblocking filtering module and a sample adaptive offset / adaptive loop filtering (SAO / ALF) module, wherein the deblocking filtering module is used to remove blocking effects, and the SAO / ALF module is used to remove ringing effects.
[0054] The decoded image buffer 170 may store the reconstructed pixel blocks. The inter prediction module 111 may use a reference image containing the reconstructed pixel blocks to perform inter prediction on PUs of other images. In addition, the intra prediction module 112 may use the reconstructed pixel blocks in the decoded image buffer 170 to perform intra prediction on other PUs in the same image as the CU.
[0055] The entropy encoding module 180 may receive the quantized transform coefficients from the transform / quantization module 130. The entropy encoding module 180 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy-encoded data.
[0056] FIG2 is a schematic diagram of the structure of a video decoder 200 according to an embodiment of the present application. Referring to FIG2 , video decoder 200 includes an entropy decoding module 210, a prediction module 220, an inverse quantization / transformation module 230, a reconstruction module 240, a loop filtering module 250, and a decoded image buffer 260. It should be noted that video decoder 200 may include more, fewer, or different functional components.
[0057] The video decoder 200 may receive a bitstream. The entropy decoding module 210 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding module 210 may parse the entropy-encoded syntax elements in the bitstream. The prediction module 220, the inverse quantization / transformation module 230, the reconstruction module 240, and the loop filter module 250 may decode the video data based on the syntax elements extracted from the bitstream, thereby generating decoded video data.
[0058] In some embodiments, the prediction module 220 includes an intra-frame prediction module 222 and an inter-frame prediction module 221 .
[0059] The intra prediction module 222 may perform intra prediction to generate a prediction block for a PU. The intra prediction module 222 may use an intra prediction mode to generate a prediction block for the PU based on pixel blocks of spatially neighboring PUs. The intra prediction module 222 may also determine the intra prediction mode for the PU based on one or more syntax elements parsed from the codestream.
[0060] The inter-frame prediction module 221 may construct a first reference picture list (List 0) and a second reference picture list (List 1) based on syntax elements parsed from the codestream. Furthermore, if a PU is encoded using inter-frame prediction, the entropy decoding module 210 may parse the motion information of the PU. The inter-frame prediction module 221 may determine one or more reference blocks for the PU based on the motion information of the PU. The inter-frame prediction module 221 may generate a prediction block for the PU based on the one or more reference blocks of the PU.
[0061] The inverse quantization / transform module 230 may inversely quantize (ie, dequantize) the transform coefficients associated with the TU. The inverse quantization / transform module 230 may use the QP value associated with the CU of the TU to determine the degree of quantization.
[0062] After inverse quantizing the transform coefficients, inverse quantization / transform module 230 may apply one or more inverse transforms to the inverse quantized transform coefficients in order to generate a residual block associated with the TU.
[0063] Reconstruction module 240 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the pixel block of the CU. For example, reconstruction module 240 can add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block.
[0064] The loop filtering module 250 may perform a deblocking filtering operation to reduce blocking artifacts of pixel blocks associated with a CU.
[0065] The video decoder 200 may store the reconstructed image of the CU in the decoded image buffer 260. The video decoder 200 may use the reconstructed image in the decoded image buffer 260 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
[0066] The basic process of video encoding and decoding is as follows: At the encoder end, an image is divided into blocks. For the current block, the prediction module 110 uses intra-frame prediction or inter-frame prediction to generate a prediction block for the current block. The residual module 120 calculates a residual block based on the predicted block and the original block of the current block. This residual block is the difference between the predicted block and the original block of the current block. This residual block can also be referred to as residual information. This residual block undergoes transformation and quantization by the transform / quantization module 130, removing information that is insensitive to the human eye and eliminating visual redundancy. Optionally, the residual block before transformation and quantization by the transform / quantization module 130 can be referred to as a time-domain residual block, and the time-domain residual block after transformation and quantization by the transform / quantization module 130 can be referred to as a frequency residual block or a frequency-domain residual block. The entropy coding module 180 receives the quantized change coefficients output by the transform and quantization module 130 and performs entropy coding on these quantized change coefficients to output a bitstream. For example, the entropy coding module 180 can eliminate character redundancy based on the target context model and the probability information of the binary bitstream.
[0067] At the decoding end, the entropy decoding module 210 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block. The prediction module 220 uses intra-frame prediction or inter-frame prediction on the current block based on the prediction information to generate a prediction block for the current block. The inverse quantization / transformation module 230 uses the quantization coefficient matrix obtained from the code stream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block. The reconstruction module 240 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed blocks constitute a reconstructed image, and the loop filtering module 250 performs loop filtering on the reconstructed image based on the image or block to obtain a decoded image. The encoding end also requires similar operations as the decoding end to obtain a decoded image. The decoded image can also be called a reconstructed image, and the reconstructed image can be used as a reference image for inter-frame prediction of subsequent images.
[0068] It should be noted that the block division information determined by the encoder, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, etc., are carried in the bitstream when necessary. The decoder parses the bitstream and analyzes the existing information to determine the same block division information, prediction, transform, quantization, entropy coding, loop filtering, etc. mode information or parameter information as the encoder, thereby ensuring that the decoded image obtained by the encoder and the decoder are identical.
[0069] It is understandable that the "inverse transformation" of the transform coefficients at the decoding end may also be referred to as "transformation" in the standard text. The "transformation" and "inverse transformation" in the embodiments of the present application correspond to two opposite processes. For example, if the "transformation" converts the numerical values in the spatial domain to the coefficients in the frequency domain, then the "inverse transformation" converts the coefficients in the frequency domain to the numerical values in the spatial domain. If the standard only stipulates decoding, then the "transformation" in the standard text is the decoding part, which refers to the "inverse transformation" in this article. The "inverse transformation" of the transform coefficients at the decoding end may also be referred to as "transformation" in the standard text.
[0070] Video coding standards such as HEVC, VVC, AVS3, the second-generation video coding standard developed by the Alliance for Open Media Video 2 (AV2), and the first-generation video coding standard developed by the Alliance for Open Media Video 1 (AV1) all adopt the above-mentioned block-based hybrid coding framework. As technology develops, some modules or steps of this framework or process may be optimized. This application is applicable to the basic process of the video codec under this block-based hybrid coding framework, but is not limited to this framework and process.
[0071] As mentioned above, motion compensation is a type of prediction mode commonly used in video coding, which may include: inter-frame prediction mode, intra-frame block copy (IBC) prediction mode, intra-frame string copy prediction mode, etc. In specific coding implementations, these prediction modes may be used alone or in combination. For coding blocks that use these prediction modes, it is usually necessary to explicitly or implicitly encode one or more two-dimensional displacement vectors in the bitstream to indicate the displacement of the current block (or the co-located block of the current block) relative to one or more reference blocks. It should be noted that in different prediction modes and different implementations, the displacement vector may have different names, such as: 1) The displacement vector in inter-frame prediction is called motion vector (MV); 2) The displacement vector in intra-frame block copy is called block vector (BV); 3) The displacement vector in intra-frame string copy is called string vector (SV).
[0072] This application relates to an IBC prediction model. The following introduces related technologies of the IBC prediction model.
[0073] Figure 3 is an example diagram of the IBC prediction mode that can be applied to the embodiments of the present application. In the IBC prediction mode, the predicted value of the current block is derived with reference to the area of the current frame that has been reconstructed. Referring to Figure 3, the shaded area is the area that has been encoded and reconstructed. The current coding block to be encoded determines its reference block in the encoded area. Specifically, the displacement between the current block and its reference block is the block vector BV of the current block. The IBC prediction mode utilizes the spatial correlation of the screen content video and uses the encoded image pixels on the current image to predict the pixels of the current block to be encoded, which can effectively save the bits required for encoding pixels. In AVS3, VVC and AV1, IBC technology is also adopted to improve the performance of screen content encoding.
[0074] The prediction blocks obtained using the IBC mode in related technologies are prone to discontinuous boundaries, that is, the transition between the reconstructed blocks and the surrounding pixels is unnatural, and there is a problem of poor spatial continuity, which affects the image quality and is not conducive to improving the encoding and decoding performance.
[0075] In response to the above-mentioned problems existing in the related art, a technical solution is provided in an embodiment of the present application. In an embodiment of the present application, for a target block whose prediction mode is intra-block copy (IBC) prediction, the target prediction information of the target block is determined based on the reconstruction information of the adjacent areas of the target block and the original prediction information of the target block. Since the reconstruction information of the area surrounding the block is added to the target prediction information, it is beneficial to achieve a smooth transition between the target block and its surrounding areas, thereby reducing the spatial continuity between the target block and its surrounding areas, thereby improving image quality and improving encoding and decoding performance.
[0076] The terms involved in the IBC toolset are as follows:
[0077] SIBC: Symmetric Intra Block Copy, mirror block copy intra prediction mode
[0078] RRIBC: Reconstruction-Reordered IBC, block copy intra prediction mode based on reconstructed value flipping
[0079] FIBC: Filtered Intra Block Copy:, block copy intra prediction filter
[0080] IBC-PC: IBC-Prediction Correction, inter-frame prediction correction
[0081] IBC-LIC: IBC with Local Illumination Compensation, block copy intra prediction with local illumination compensation
[0082] IBC-MBVD: IBC merge mode with block vector differences, IBC merge mode with block vector residuals
[0083] IBC-TM: IBC with Template Matching, IBC mode with template matching
[0084] IBC-TM-AMVP: IBC with Template Matching, IBC with AMVP mode of template matching
[0085] IBC-TM-MRG: IBC with Template Matching, merge mode IBC with template matching
[0086] IBC-CIIP: Combined intra block copy and intra prediction, IBC and intra prediction merge mode
[0087] IBC-GPM: IBC with Geometry Partitioning, IBC mode with geometric partitioning
[0088] Before formally introducing the embodiments of the present application, the syntax level of the coded bit stream is introduced.
[0089] 1. Video Sequence
[0090] 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 sequence headers. Each sequence header is followed by one or more coded pictures, each preceded by a picture header. Coded pictures are arranged in bitstream order within the bitstream, which should be the same as the decoding order. The decoding order may differ from the display order.
[0091] 2. Image frame
[0092] 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.
[0093] 3. Film
[0094] A slice is a rectangular area in an image that contains the portion of several LCUs within the image. Slices should not overlap. The slice structure can be seen in Figure 4, which includes slice structure A and partial structure F.
[0095] 4. Largest Coding Unit (LCU), Coding Tree and Coding Unit (CU)
[0096] The image is divided into maximum coding units. The maximum coding units should not overlap. The sample in the upper left corner of the maximum coding unit should not exceed the image boundary, and the sample in the lower right corner of the maximum coding unit can exceed the image boundary.
[0097] The maximum coding unit is divided into one or more coding units, which are determined by the coding tree. The coding unit is divided into one or more transform blocks.
[0098] Before formally introducing the embodiments of the present application, descriptions related to bitstream description are introduced.
[0099] 1. Description method
[0100] The bitstream syntax is described in a similar way to C. Bitstream syntax elements are in bold. Each syntax element is described by its name (a group of lowercase letters separated by underscores), syntax, and semantics. The values of syntax elements in syntax tables and text are in regular font.
[0101] In some cases, syntax tables may use other variable values derived from syntax elements. Such variables are named using a mix of lowercase and uppercase letters without underscores in syntax tables and the text. Variables beginning with an uppercase letter are used to decode the current and related syntax structures, as well as subsequent syntax structures. Variables beginning with a lowercase letter are used only within the subsection in which they appear.
[0102] The relationship between syntax element value mnemonics and variable value mnemonics and their values is described in the text. In some cases, the two are used equivalently. Mnemonics are represented by one or more letter groups separated by underscores. Each letter group begins with a capital letter and may contain multiple capital letters.
[0103] 2. Descriptors
[0104] Descriptors represent the parsing process of different syntax elements, see the following table:
[0105] The following describes the technical solutions of the embodiments of the present application in detail through some embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0106] FIG5 is a flow chart of a video decoding method P500 according to an embodiment of the present application. Method P500 is performed by a decoder capable of decoding a bitstream, such as an electronic device with decoding functionality. Referring to FIG5 , method P500 includes steps S510 to S530.
[0107] In S510 , the code stream is parsed to determine a target block, wherein the prediction mode of the target block is intra block copy (IBC) prediction.
[0108] The target block is the current coding unit (CU). In the embodiment of the present application, the target block is a CU predicted by the IBC prediction mode. Furthermore, since the embodiment of the present application will filter the original prediction information of the target block, the target block in the embodiment of the present application should also support the use of intra block copy prediction filter (IBCPF).
[0109] In the embodiment of the present application, whether the current block is the target block can be explicitly determined based on the flags of the IBC mode and / or IBCPF mode. The following describes how to determine the target block based on the flags in conjunction with the embodiments provided in Figures 6 to 10:
[0110] FIG6 is a flow chart of a method P600 for determining a target block according to an embodiment of the present application. The embodiment shown in this figure can be used as a specific implementation of S510. Referring to FIG6, the embodiment shown in this figure includes S610-S660.
[0111] In S610, the bitstream is parsed to obtain a first IBC flag of the first-level syntax structure, where the first IBC flag is used to indicate whether the encoding information of the first-level syntax structure of the bitstream adopts the IBC mode, or to indicate whether the intra block copy prediction filtering (IBCPF) mode is supported when the IBC mode is adopted.
[0112] As mentioned above, the syntax levels of the coded bitstream include: sequence level, frame level, slice level, block level, etc. In the embodiment of the present application, the first-level syntax structure can be any one of sequence level, frame level, slice level, and block level.
[0113] In S620, it is determined whether the first IBC flag indicates that the coding information of the first-level syntax structure adopts the IBC mode and supports the IBCPF mode.
[0114] When the first IBC flag indicates that the encoding information of the first-level syntax structure does not adopt the IBC mode, or when the first IBC flag indicates that the encoding information of the first-level syntax structure adopts the IBC mode and does not support the IBCPF mode, execute S630: determine that the target block is not included in the encoding information of the first-level syntax structure.
[0115] When the first IBC flag indicates that the encoding information of the first-level syntax structure adopts the IBC mode and supports the IBCPF mode, S640 is executed: determining whether the first-level syntax structure is block-level.
[0116] In the case where the first-level syntax structure is a block level, executing S650: determining the current block as the target block;
[0117] In the case that the first-level syntax structure is not at the block level, executing S660: parsing the code stream to obtain a flag of the next-level syntax structure, and determining the target block according to the flag of the next-level syntax structure.
[0118] Regarding Example 1 of method P600: the first-level syntax structure is the sequence level. If the first IBC flag can be represented as seq_ibc_flag, the semantic information represented by different values of seq_ibc_flag is shown in Table 1.
[0119] Table 1
[0120] The grammatical structure of Table 1 is:
[0121] or,
[0122] Among them, seq_ibc_flag is the sequence header block copy mode flag;
[0123] Indicates the mode type of the block copy intra prediction mode. A value of '0' indicates that IBC should not be used. A value greater than '0' indicates that IBC can be used and indicates whether IBCPF is allowed. The value of SeqIbcFlag is equal to the value of seq_ibc_flag. If seq_ibc_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0124] In S620, it is determined whether the value of seq_ibc_flag is 2. If the value is not 2, it indicates that the current sequence does not allow IBC mode, or that the current sequence allows IBC mode but not IBCPF mode. In other words, there is no target block in the current sequence that meets the above conditions of this application. Therefore, there is no need to further analyze the sequence for IB or IBCPF (such as frame-level flags, slice-level flags, etc.). S630 can be directly executed: determining that the current sequence does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0125] In S620, it is determined whether the value of seq_ibc_flag is 2. If the value is 2, it indicates that the current sequence is allowed to use the IBC mode and the IBCPF mode, that is, the current sequence contains a target block that meets the above conditions of this application. Therefore, it is necessary to further determine which frame contains the target block, so the operation of S660 is performed: the frame-level flag is parsed to determine the target block based on the flag of the next-level syntax structure. The specific implementation of S660 in this embodiment can refer to Example 2 of Method P600. Of course, it is not limited to Example 2 of Method P600, and other embodiments based on frame-level flags can also be used.
[0126] Regarding embodiment 2 of method P600: the first-level syntax structure is at the frame level. If the first IBC flag can be represented as: pic_ibc_flag, the semantic information represented by different values of pic_ibc_flag is shown in Table 2.
[0127] Table 2
[0128] The grammatical structure of Table 2 is:
[0129] or,
[0130] Among them, pic_ibc_flag is the picture header block copy mode flag;
[0131] Indicates the mode type of the block copy intra prediction mode. A value of '0' indicates that IBC should not be used. A value greater than '0' indicates that IBC can be used and indicates whether IBCPF is allowed. 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.
[0132] In S620, it is determined whether the value of pic_ibc_flag is 2. If the value is not 2, it indicates that the current frame is not allowed to use the IBC mode, or that the current frame allows the use of the IBC mode but not the IBCPF mode. In other words, there is no target block in the current frame that meets the above conditions of this application. Therefore, there is no need to further parse the frame with respect to IB or IBCPF (such as slice-level flags, block-level flags, etc.). S630 can be directly executed: determining that the current frame does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0133] In S620, it is determined whether the value of pic_ibc_flag is 2. If it is 2, it indicates that the current frame is enabled for IBC mode and allows the use of IBCPF mode. In other words, the current frame contains a target block that meets the above-mentioned conditions of this application. Therefore, it is necessary to further determine which slice contains the target block. Therefore, the operation of S660 is performed: the slice-level flag is parsed to determine the target block based on the flag of the next-level syntax structure. The specific implementation of S660 in this embodiment can be referred to Example 3 of Method P600. Of course, it is not limited to Example 3 of Method P600 and can also be other embodiments that determine based on slice-level flags.
[0134] Regarding embodiment 3 of method P600: the first-level syntax structure is at the slice level. If the first IBC flag can be represented as slice_ibc_flag, the semantic information represented by different values of slice_ibc_flag is shown in Table 3.
[0135] Table 3
[0136] The grammatical structure of Table 3 is:
[0137] or,
[0138] Among them, slice_ibc_flag is the slice header block copy mode flag;
[0139] Indicates the mode type of the block copy intra prediction mode. A value of '0' indicates that IBC should not be used. A value greater than '0' indicates that IBC can be used and indicates whether IBCPF is allowed. The value of SliceIbcFlag is equal to the value of slice_ibc_flag. If slice_ibc_flag is not present in the bitstream, the value of SliceIbcFlag is 0.
[0140] In S620, it is determined whether the value of slice_ibc_flag is 2. If the value is not 2, it indicates that the current slice is not allowed to use the IBC mode, or that the current slice is allowed to use the IBC mode but not the IBCPF mode. In other words, there is no target block in the current slice that meets the above conditions of this application. Therefore, there is no need to further analyze the slice for IB or IBCPF (such as block-level flags). S630 can be directly executed: determining that the current slice does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0141] In S620, it is determined whether the value of slice_ibc_flag is 2. If it is, it indicates that the current slice is enabled for IBC mode and that IBCPF mode is permitted. This means that a target block that meets the aforementioned conditions of this application exists in the current slice. Therefore, it is necessary to further determine which block is the target block. Therefore, the operation in S660 is performed: block-level flags are parsed to determine the target block based on the flags of the next-level syntax structure. The specific implementation of S660 in this embodiment can be referenced to Example 4 regarding method P600. Of course, this is not limited to Example 4 of method P600 and can also be implemented in other embodiments that utilize block-level flags for determination.
[0142] Regarding Example 4 of method P600: the first-level syntax structure is block-level, and if the first IBC flag can be represented as cu_ibc_flag, the semantic information represented by different values of cu_ibc_flag is shown in Table 4.
[0143] Table 4
[0144] The grammatical structure of Table 4 is:
[0145] Among them, cu_ibc_flag is the block-level block copy mode flag;
[0146] Indicates the mode type of the block copy intra prediction mode. A value of '0' indicates that IBC should not be used. A value greater than '0' indicates that IBC can be used and indicates whether IBCPF is allowed. The value of CuIbcFlag is equal to the value of cu_ibc_flag. If cu_ibc_flag is not present in the bitstream, the value of CuIbcFlag is 0.
[0147] In step S620 , it is determined whether the value of cu_ibc_flag is 2. If the value is not 2, it indicates that the current block is not allowed to use the IBC mode, or that the current block is allowed to use the IBC mode but not the IBCPF mode. In other words, there is no target block that meets the above conditions of this application in the current block, so it is determined that the current block is not the target block.
[0148] In step S620 , it is determined whether the value of cu_ibc_flag is 2. If the value is 2, it indicates that the current block is allowed to operate in IBC mode and is allowed to use IBCPF mode, which means that the current block is a target block that meets the above conditions of this application. Therefore, the process proceeds to step S650 : determining that the current block is the above target block.
[0149] In the above embodiment of method P600, the target block is identified by encoding a flag at each level of the bitstream, which helps to save decoding time and improve decoding efficiency and performance.
[0150] FIG7 is a flow chart of a method P700 for determining a target block according to another embodiment of the present application. The embodiment shown in this figure can be used as another specific implementation of S510. Referring to FIG7, the embodiment shown in this figure includes S710-S780.
[0151] In S710 , the bitstream is parsed to obtain a first IBC flag of the first-level syntax structure, where the first IBC flag is used to indicate whether encoding information of the first-level syntax structure in the bitstream adopts the IBC mode.
[0152] In S720, it is determined whether the first IBC flag indicates that the encoding information of the first-level syntax structure adopts the IBC mode.
[0153] If the first IBC flag indicates that the encoding information of the first-level syntax structure does not adopt the IBC mode, executing S730: determining that the encoding information of the first-level syntax structure does not include the target block;
[0154] If the first IBC flag indicates that the coding information of the first-level syntax structure adopts the IBC mode, executing S740: parsing the bitstream to obtain a second IBC flag of the first-level syntax structure, the second IBC flag being used to indicate whether the coding information of the first-level syntax structure in the bitstream supports an intra block copy prediction filtering (IBCPF) mode;
[0155] In S750, it is determined whether the second IBC flag indicates that the coding information of the first-level syntax structure supports the IBCPF mode.
[0156] If the second IBC flag indicates that the encoding information of the first-level syntax structure does not support the IBCPF mode, executing S730: determining that the encoding information of the first-level syntax structure does not include the target block;
[0157] If the second IBC flag indicates that the encoding information of the first-level syntax structure supports the IBCPF mode, executing S760: determining whether the first-level syntax structure is block-level;
[0158] In the case where the first-level syntax structure is a block level, executing S770: determining the current block as the target block;
[0159] In a case where the first-level syntax structure is not at the block level, executing S780: parsing the code stream to obtain a flag of a next-level syntax structure, and determining the target block according to the flag of the next-level syntax structure.
[0160] Regarding Example 1 of method P700: The first-level syntax structure is the sequence level. If the first IBC flag can be represented as seq_ibc_flag and the second IBC flag can be represented as seq_ibc_pf_flag, the semantic information represented by different values of seq_ibc_flag and seq_ibc_pf_flag is shown in Table 5.
[0161] Table 5
[0162] The grammatical structure of Table 5 is as follows:
[0163] Among them, seq_ibc_flag is the sequence header block copy intra-frame prediction flag;
[0164] This 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 SeqIbcFlag is equal to the value of seq_ibc_flag. If seq_ibc_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0165] seq_ibc_pf_flag is the sequence header block copy intra-frame prediction filter mode flag;
[0166] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of seq_ibc_pf_flag. If seq_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0167] When the value of seq_ibc_flag is 0, it means that the current sequence does not use the IBC mode for coding prediction, so there is no need to perform decoding on seq_ibc_pf_flag, which can save decoding time and improve decoding efficiency. That is to say, when the value of seq_ibc_flag is 0, no matter what the value of seq_ibc_pf_flag is, the above-mentioned target block does not exist in the sequence. Referring to Table 5, when the value of seq_ibc_flag is 0, the value of seq_ibc_pf_flag is represented as "X". In this case, S730 can be directly executed: determine that the current sequence does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0168] When the value of seq_ibc_flag is 1, it indicates that the current sequence allows the IBC mode for coding prediction, and it is necessary to further decode the value of seq_ibc_pf_flag (i.e., execute S740). There are two situations:
[0169] Case 1: seq_ibc_flag is 1 and seq_ibc_pf_flag is 0, indicating that the current sequence allows IBC mode but does not support IBCPF mode. This means that there is no target block in the current sequence that meets the above conditions of this application. Therefore, there is no need to further analyze the sequence for IB or IBCPF (e.g., frame-level flags, slice-level flags, etc.). S730 can be directly executed: Determine that the current sequence does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0170] Case 2: The value of seq_ibc_flag is 1 and the value of seq_ibc_pf_flag is 1, indicating that the current sequence is allowed to use the IBC mode and the IBCPF mode, that is, there is a target block in the current sequence that meets the above conditions of this application. Therefore, it is necessary to further determine in which frame the above target block exists, so the operation of S780 is performed: parse the frame-level flag to determine the above target block according to the flag of the next-level grammatical structure. For the specific implementation of S780 in this embodiment, reference can be made to Example 2 of Method P700. Of course, it is not limited to Example 2 of Method P700, and can also be other embodiments for judgment based on frame-level flags.
[0171] Regarding Example 2 of method P700: The first-level syntax structure is at the frame level. If the first IBC flag can be represented as pic_ibc_flag and the second IBC flag can be represented as pic_ibc_pf_flag, the semantic information represented by different values of pic_ibc_flag and pic_ibc_pf_flag is shown in Table 6.
[0172] Table 6
[0173] The grammatical structure of Table 6 is as follows:
[0174] Among them, pic_ibc_flag is the picture header block copy intra prediction flag;
[0175] 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.
[0176] pic_ibc_pf_flag is the image header block copy intra prediction filter mode flag;
[0177] A binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not 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.
[0178] When the value of pic_ibc_flag is 0, it means that the current frame does not use the IBC mode for coding prediction. Therefore, there is no need to perform decoding on pic_ibc_pf_flag, which can save decoding time and improve decoding efficiency. In other words, when the value of pic_ibc_flag is 0, no matter what the value of pic_ibc_pf_flag is, the above-mentioned target block does not exist in the frame. Referring to Table 6, when the value of pic_ibc_flag is 0, the value of pic_ibc_pf_flag is represented as "X". In this case, S730 can be directly executed: determine that the current frame does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0179] When the value of pic_ibc_flag is 1, it indicates that the current frame allows IBC mode for coding prediction, and it is necessary to further decode the value of pic_ibc_pf_flag (i.e., execute S740). There are two situations:
[0180] Case 1: pic_ibc_flag is 1 and pic_ibc_pf_flag is 0, indicating that the current frame allows IBC mode but does not support IBCPF mode. In other words, there is no target block in the current frame that meets the above conditions of this application. Therefore, there is no need to further parse the frame for IB or IBCPF (e.g., slice-level flags, block-level flags, etc.). S730 can be directly executed: Determine that the current frame does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0181] Case 2: pic_ibc_flag is set to 1 and pic_ibc_pf_flag is set to 1, indicating that the current frame is permitted to use IBC mode and IBCPF mode. This means that the current frame contains a target block that meets the aforementioned conditions of this application. Therefore, it is necessary to further determine which slice contains the target block. Therefore, an operation such as S780 is performed: parsing the slice-level flag to determine the target block based on the flag of the next-level syntax structure. The specific implementation of S780 in this embodiment can be referenced to Example 3 of Method P700. This is of course not limited to Example 3 of Method P700 and may also be other embodiments that make determinations based on slice-level flags.
[0182] Regarding Example 3 of method P700: The first-level syntax structure is at the slice level. If the first IBC flag can be represented as slice_ibc_flag and the second IBC flag can be represented as slice_ibc_pf_flag, the semantic information represented by slice_ibc_flag and slice_ibc_pf_flag when they take different values is shown in Table 7.
[0183] Table 7
[0184] The grammatical structure of Table 7 is as follows:
[0185] Among them, slice_ibc_flag is the slice header block copy intra prediction flag;
[0186] This variable 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 SliceIbcFlag is equal to the value of slice_ibc_flag. If slice_ibc_flag is not present in the bitstream, the value of SliceIbcFlag is 0.
[0187] slice_ibc_pf_flag is the slice header block copy intra prediction filter mode flag;
[0188] This variable is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SliceIbcPfFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of SliceIbcPfFlag is 0.
[0189] When the value of slice_ibc_flag is 0, it means that the current slice does not use the IBC mode for coding prediction, so there is no need to perform decoding on slice_ibc_pf_flag, which can save decoding time and improve decoding efficiency. That is to say, when the value of slice_ibc_flag is 0, no matter what the value of slice_ibc_pf_flag is, the above-mentioned target block does not exist in the slice. Referring to Table 7, when the value of slice_ibc_flag is 0, the value of slice_ibc_pf_flag is expressed as "X". In this case, S730 can be directly executed: determine that the current slice does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0190] When the value of slice_ibc_flag is 1, it indicates that the current slice allows IBC mode for coding prediction, and it is necessary to further decode the value of slice_ibc_pf_flag (i.e., execute S740). There are two situations:
[0191] Case 1: slice_ibc_flag is 1 and slice_ibc_pf_flag is 0, indicating that the current slice allows IBC mode but does not support IBCPF mode. In other words, there is no target block in the current slice that meets the above conditions of this application. Therefore, there is no need to further analyze the slice for IB or IBCPF (such as block-level flags). S730 can be directly executed: Determine that the current slice does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0192] Case 2: The value of slice_ibc_flag is 1 and the value of slice_ibc_pf_flag is 1, indicating that the current slice is allowed to use IBC mode and the IBCPF mode, that is, there is a target block in the current slice that meets the above conditions of this application. Therefore, it is necessary to further determine which block belongs to the above target block, so the operation of S780 is performed: parse the block-level flag to determine the above target block according to the flag of the next-level grammatical structure. For the specific implementation of S780 in this embodiment, reference can be made to Example 4 of Method P700. Of course, it is not limited to Example 4 of Method P700, and it can also be other embodiments for judgment based on block-level flags.
[0193] Regarding Example 4 of method P700: The first-level syntax structure is block-level. If the first IBC flag can be represented as cu_ibc_flag and the second IBC flag can be represented as cu_ibc_pf_flag, the semantic information represented by different values of cu_ibc_flag and cu_ibc_pf_flag is shown in Table 8.
[0194] Table 8
[0195] The grammatical structure of Table 8 is as follows:
[0196] Among them, cu_ibc_flag is the block-level block copy intra prediction flag;
[0197] 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 CuIbcFlag is equal to the value of cu_ibc_flag. If cu_ibc_flag is not present in the bitstream, the value of CuIbcFlag is 0.
[0198] cu_ibc_pf_flag is the block-level block copy intra prediction filter mode flag;
[0199] A binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that 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 is not present in the bitstream, the value of CuIbcPfFlag is 0.
[0200] When the value of cu_ibc_flag is 0, it means that the current block does not use the IBC mode for coding prediction, so there is no need to perform decoding on cu_ibc_pf_flag, which can save decoding time and improve decoding efficiency. That is to say, when the value of cu_ibc_flag is 0, no matter what the value of cu_ibc_pf_flag is, the above-mentioned target block does not exist in the block. Referring to Table 8, when the value of cu_ibc_flag is 0, the value of cu_ibc_pf_flag is expressed as "X". In this case, S730 can be directly executed: determine whether the current block does not belong to the target block, thereby saving decoding time and improving decoding efficiency.
[0201] When the value of cu_ibc_flag is 1, it indicates that the current block allows IBC mode for coding prediction, and it is necessary to further decode the value of cu_ibc_pf_flag (i.e., execute S740). There are two situations:
[0202] Case 1: cu_ibc_flag is 1 and cu_ibc_pf_flag is 0, indicating that the current block allows IBC mode but does not support IBCPF mode. In other words, the current block does not meet the above-mentioned target block conditions of this application, and S730 is executed: determining that the current block does not belong to the target block.
[0203] Case 2: cu_ibc_flag is 1 and cu_ibc_pf_flag is 1, indicating that the current block is allowed to use IBC mode and IBCPF mode, that is, the current block meets the target block conditions of the above application, that is, execute S770: determine that the current block is the above target block.
[0204] In the embodiment of method P700 described above, the target block is identified by encoding two flags at each level of the bitstream, with the second IBC flag being dependent on the value of the first IBC flag at the same level. Specifically, if the value of the first IBC flag at the same level indicates that the current level does not support IBC mode, there is no need to decode the second IBC flag at the current level, which helps save decoding time and improve decoding efficiency and performance.
[0205] FIG8 is a flow chart of a method P800 for determining a target block according to another embodiment of the present application. The embodiment shown in this figure can serve as another specific implementation of S510. Specifically, the embodiment shown in FIG8 can serve as a specific implementation of S660 in FIG6 or a specific implementation of S780 in FIG7. Referring to FIG8, the embodiment shown in this figure includes S810-S860.
[0206] In S810, when the first-level syntax structure is not block-level, the codestream is parsed to obtain a third IBC flag of the second-level syntax structure, where the third IBC flag is used to indicate whether the coding information of the second-level syntax structure in the codestream adopts the IBC mode, or whether the IBCPF mode is supported when the IBC mode is adopted.
[0207] As mentioned above, the syntax levels of the coded bitstream include: sequence level, frame level, slice level, block level, etc.
[0208] In the embodiment of the present application, the second-level syntax structure can be a frame level, a slice level, or a block level. Specifically, when the first-level syntax structure is a sequence level, the second-level syntax structure is a frame level; or, when the first-level syntax structure is a frame column level or a sequence level, the second-level syntax structure is a slice level; or, when the first level is a slice level, a frame level, or a sequence level, the second-level syntax structure is a block level.
[0209] In S820, it is determined that the third IBC flag indicates that the coding information of the second-level syntax structure adopts the IBC mode and supports the IBCPF mode.
[0210] When the third IBC flag indicates that the encoding information of the second-level syntax structure does not adopt the IBC mode, or when the third IBC flag indicates that the encoding information of the second-level syntax structure adopts the IBC mode and does not support the IBCPF mode, executing S830: determining that the encoding information of the second-level syntax structure does not include the target block;
[0211] When the third IBC flag indicates that the encoding information of the second-level syntax structure adopts the IBC mode and supports the IBCPF mode, executing S840: determining whether the second-level syntax structure is block-level.
[0212] When the second-level syntax structure is a block level, executing S850: determining the current block as the target block;
[0213] In the case that the second-level syntax structure is not at the block level, executing S860: parsing the code stream to obtain a flag of the next-level syntax structure, and determining the target block according to the flag of the next-level syntax structure.
[0214] It should be noted that, in the embodiment shown in FIG6 or FIG7 , if the first-level syntax structure is at the block level, it is possible to directly determine whether the current block is the target block without executing the embodiment shown in FIG8 . In the embodiment shown in FIG6 or FIG7 , if the first-level syntax structure is not at the block level, it is not possible to directly determine whether the current block is the target block, and therefore it is necessary to execute the embodiment shown in FIG8 .
[0215] Among them, the specific implementation of the embodiment shown in Figure 8 is similar to the specific implementation of the embodiment shown in Figure 6, except that the embodiment shown in Figure 6 is applicable to an embodiment in which the target block is determined based on a sequence-level flag, and the embodiment shown in Figure 8 is applicable to an embodiment in which the target block is determined based on flags such as a frame level, slice level, and block level in addition to the sequence level.
[0216] That is, in the embodiment provided by method P800, if the presence of a target block cannot be determined based on the flag of the first-level syntax structure, the target block is determined based on the flag of the next-level syntax structure, based on the embodiment provided by method P800. Specifically, identifying the target block using a flag at each level of the coded bitstream helps save decoding time and improve decoding efficiency and performance.
[0217] FIG9 is a flow chart illustrating a method P900 for determining a target block according to another embodiment of the present application. The embodiment illustrated in this figure can serve as another specific implementation of S510. Specifically, the embodiment illustrated in FIG9 can serve as a specific implementation of S660 in FIG6 or as a specific implementation of S780 in FIG7. Referring to FIG9, the embodiment illustrated in this figure includes S910-S980.
[0218] In S910, when the first-level syntax structure is not block-level, the code stream is parsed to obtain a third IBC flag of the second-level syntax structure, where the third IBC flag is used to indicate whether encoding information of the second-level syntax structure in the code stream adopts the IBC mode.
[0219] As mentioned above, the syntax levels of the coded bitstream include: sequence level, frame level, slice level, block level, etc.
[0220] In the embodiment of the present application, the second-level syntax structure can be a frame level, a slice level, or a block level. Specifically, when the first-level syntax structure is a sequence level, the second-level syntax structure is a frame level; or, when the first-level syntax structure is a frame column level or a sequence level, the second-level syntax structure is a slice level; or, when the first level is a slice level, a frame level, or a sequence level, the second-level syntax structure is a block level.
[0221] In S920 , it is determined whether the third IBC flag indicates that the encoding information of the second-level syntax structure adopts the IBC mode.
[0222] If the fourth IBC flag indicates that the encoding information of the second-level syntax structure does not support the IBCPF mode, executing S930: determining that the encoding information of the second-level syntax structure does not include the target block;
[0223] If the third IBC flag indicates that the coding information of the second-level syntax structure adopts the IBC mode, executing S940: parsing the bitstream to obtain a fourth IBC flag of the second-level syntax structure, where the fourth IBC flag is used to indicate whether the coding information of the second-level syntax structure supports the IBCPF mode;
[0224] In S950 , it is determined whether the fourth IBC flag indicates that the encoding information of the second-level syntax structure supports the IBCPF mode.
[0225] If the fourth IBC flag indicates that the encoding information of the second-level syntax structure supports the IBCPF mode, executing S960: determining whether the second-level syntax structure is block level;
[0226] When the second-level syntax structure is a block level, executing S970: determining the current block as the target block;
[0227] In the case that the second-level syntax structure is not at the block level, executing S980: parsing the code stream to obtain a flag of the next-level syntax structure, and determining the target block according to the flag of the next-level syntax structure.
[0228] It should be noted that in the embodiment shown in FIG6 or FIG7 , if the first-level syntax structure is at the block level, it is possible to directly determine whether the current block is the target block without executing the embodiment shown in FIG9 . In the embodiment shown in FIG6 or FIG7 , if the first-level syntax structure is not at the block level, it is not possible to directly determine whether the current block is the target block, and therefore it is necessary to execute the embodiment shown in FIG9 .
[0229] Among them, the specific implementation of the embodiment shown in Figure 9 is similar to the specific implementation of the embodiment shown in Figure 7, except that the embodiment shown in Figure 7 is applicable to an embodiment in which the target block is determined based on a sequence-level flag, and the embodiment shown in Figure 9 is applicable to an embodiment in which the target block is determined based on flags such as a frame level, slice level, and block level in addition to the sequence level.
[0230] That is to say, in the embodiment provided by method P900, when it is impossible to determine whether a target block exists based on the flag of the first-level syntax structure, the target block is determined based on the flag of the syntax structure of the next level based on the embodiment provided by method P900. Specifically. The above-mentioned target block is identified by encoding two flags at the same level of the bit stream, and the second IBC flag depends on the value of the first IBC flag at the same level. At the same time, when the value of the first IBC flag at the same level determines that the current level does not support the IBC mode, there is no need to decode the second IBC flag of the current level, which is beneficial to saving decoding time and improving decoding efficiency and performance.
[0231] Figure 10 is a flow chart of a method P1000 for determining a target block provided by an embodiment of the present application. The embodiment shown in the figure can be used as a specific implementation of S510. Specifically, the embodiment shown in Figure 10 can be used as a specific implementation of S660 in Figure 6, or can be used as a specific implementation of S780 in Figure 7. Referring to Figure 10, the embodiment shown in the figure includes S1010-S1050. In 1010, when the first-level syntax structure is not block-level, the code stream is parsed to obtain the fourth IBC flag of the second-level syntax structure, and the fourth IBC flag is used to indicate whether the encoding information of the second-level syntax structure supports the IBCPF mode;
[0232] In 1020, it is determined whether the fourth IBC flag indicates that the coding information of the second-level syntax structure supports the use of the IBCPF mode.
[0233] If the fourth IBC flag indicates that the encoding information of the second-level syntax structure does not support the IBC mode, executing 1030: determining that the encoding information of the second-level syntax structure does not include the target block;
[0234] If the fourth IBC flag indicates that the encoding information of the second-level syntax structure supports the IBCPF mode, executing 1040: determining whether the second-level syntax structure is block level;
[0235] When the second-level syntax structure is a block level, executing 1050: determining the current block as the target block;
[0236] In a case where the second-level syntax structure is not at the block level, execute 1060 : parse the code stream to obtain a flag of the next-level syntax structure, and determine the target block according to the flag of the next-level syntax structure.
[0237] In this embodiment, the target block cannot be directly determined based on the fourth IBC flag alone, and it is necessary to rely on the flag of the upper-level syntax structure to jointly determine whether the current block meets the conditions of the target block.
[0238] Regarding Example 1 of method P1000: In this embodiment, the second-level syntax structure is at the frame level, and the first-level syntax structure is at the sequence level. Specifically, if the fourth IBC flag is the frame-level fourth IBC flag pic_ibc_pf_flag, the relevant information can be determined by relying on the flag at the sequence level (the higher-level syntax structure).
[0239] Example 1.1: As shown in Table 9, the fourth IBC flag pic_ibc_pf_flag at the frame level may be dependent on the flag seq_ibc_flag at the sequence level (superior syntax structure) to determine the correlation.
[0240] Table 9
[0241] Regarding the syntax structure in Table 9, in the sequence header:
[0242] seq_ibc_flag is the sequence header block copy intra prediction flag;
[0243] This 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 SeqIbcFlag is equal to the value of seq_ibc_flag. If seq_ibc_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0244] In the image header:
[0245] pic_ibc_pf_flag is the intra-frame prediction filter flag for the picture header block copy;
[0246] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcFlag is equal to the value of pic_ibc_pf_flag. If pic_ibc_pf_flag is not present in the bitstream, the value of PicIbcFlag is 0.
[0247] When the value of seq_ibc_flag is 0, it means that the current sequence does not use the IBC mode for coding prediction. Therefore, there is no need to perform decoding of the fourth IBC flag pic_ibc_pf_flag at the frame level, thereby saving decoding time and improving decoding efficiency. That is to say, when the value of seq_ibc_flag is 0, no matter what the value of pic_ibc_pf_flag is, the above-mentioned target block does not exist in the frame. Referring to Table 9, when the value of seq_ibc_flag is 0, the value of the fourth IBC flag pic_ibc_pf_flag is represented as "X". In this case, S830 can be directly executed: determine that the current frame does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0248] When the value of seq_ibc_flag is 1, it indicates that the current sequence allows the IBC mode for coding prediction, and the value of the fourth IBC flag pic_ibc_pf_flag at the frame level needs to be further decoded (i.e., executing S840). There are two situations:
[0249] Case 1: seq_ibc_flag is 1 and the fourth frame-level IBC flag, pic_ibc_pf_flag, is 0. This indicates that although the current sequence allows IBC mode, the current frame does not support IBCPF mode. In other words, there is no target block in the current frame that meets the above conditions of this application. Therefore, there is no need to further analyze the sequence for IB or IBCPF (e.g., slice-level flags). S830 can be directly executed: Determine that the current frame does not contain a target block, thereby saving decoding time and improving decoding efficiency.
[0250] Case 2: seq_ibc_flag is 1 and the fourth IBC flag at the frame level, pic_ibc_pf_flag, is 1, indicating that the current sequence is permitted in IBC mode and the current frame is permitted in IBCPF mode. This means that a target block meeting the aforementioned conditions of this application exists within the current frame. Therefore, it is necessary to further determine which frame contains the target block. Therefore, the operation at S860 is performed: parsing the slice-level flags to determine the target block based on the flags of the next-level syntax structure.
[0251] Example 1.2: As shown in Table 10, the fourth IBC flag pic_ibc_pf_flag at the frame level may be dependent on the flag seq_ibc_pf_flag at the sequence level (the upper syntax structure) to determine the correlation.
[0252] Table 10
[0253] Regarding the syntax structure in Table 10, in the sequence header:
[0254] seq_ibc_pf_flag is the sequence header block copy intra-frame prediction filter flag;
[0255] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of seq_ibc_pf_flag. If seq_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0256] In the image header:
[0257] pic_ibc_pf_flag is the intra-frame prediction filter flag for the picture header block copy;
[0258] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcPfFlag is equal to the value of pic_ibc_fp_flag. If pic_ibc_pf_flag is not present in the bitstream, the value of PicIbcPfFlag is 0.
[0259] When the value of seq_ibc_pf_flag is 0, it means that the current sequence does not support the IBCPF mode, so there is no need to perform decoding of the fourth IBC flag pic_ibc_pf_flag at the frame level, thereby saving decoding time and improving decoding efficiency. That is to say, when the value of seq_ibc_pf_flag is 0, no matter what the value of pic_ibc_pf_flag is, the above-mentioned target block does not exist in the frame. Referring to Table 9, when the value of seq_ibc_flag is 0, the value of the fourth IBC flag pic_ibc_pf_flag is represented as "X". In this case, S830 can be directly executed: determine that the current frame does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0260] When the value of seq_ibc_pf_flag is 1, it indicates that the current sequence supports predictive filtering using the IBCPF mode, and the value of the fourth IBC flag pic_ibc_pf_flag at the frame level needs to be further decoded (i.e., executing S840). There are two situations:
[0261] Case 1: seq_ibc_pf_flag is 1 and the fourth IBC flag at the frame level, pic_ibc_pf_flag, is 0. This indicates that although the current sequence supports the IBCPF mode, the current frame does not support it. In other words, there is no target block in the current frame that meets the above conditions of this application. Therefore, there is no need to further analyze the sequence for IB or IBCPF (e.g., slice-level flags). S830 can be directly executed: Determine that the current frame does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0262] Case 2: seq_ibc_pf_flag is 1 and the fourth IBC flag at the frame level, pic_ibc_pf_flag, is 1, indicating that both the current sequence and the current frame support IBCPF mode. This means that a target block meeting the aforementioned conditions exists within the current frame. Therefore, it is necessary to further determine which frame contains the target block. Therefore, the operation at S860 is performed: parsing the slice-level flags to determine the target block based on the flags of the next-level syntax structure.
[0263] Regarding Example 2 of Method P1000: The above-mentioned second-level syntax structure is at the slice level. As mentioned above, in this embodiment, the above-mentioned first-level syntax structure can be at the sequence level or the frame level. In Examples 2.1 and 2.2, the first syntax structure is taken as the frame level as an example. Specifically, when it is not possible to exclude the frame from not adopting the IBC mode or the IBCPF mode based on the frame level flag, this embodiment is executed. If the above-mentioned fourth IBC flag can be expressed as: slice_ibc_pf_flag. The fourth IBC flag slice_ibc_pf_flag at the slice level can rely on the flag at the frame level (the upper syntax structure) to determine the relevant information.
[0264] Example 2.1: As shown in Table 11, the fourth IBC flag slice_ibc_pf_flag at the slice level may be dependent on the flag pic_ibc_flag at the frame level (superior syntax structure) to determine the correlation.
[0265] Table 11
[0266] Regarding the syntax structure in Table 11, in the image header:
[0267] pic_ibc_flag is the intra prediction flag for the picture header block copy;
[0268] 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.
[0269] In the opening credits:
[0270] slice_ibc_pf_flag is the slice header block copy intra prediction filter flag;
[0271] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of PicIbcFlag is 0.
[0272] When the value of pic_ibc_flag is 0, it means that the current frame does not use the IBC mode for coding prediction. Therefore, there is no need to perform decoding of the fourth IBC flag slice_ibc_pf_flag at the slice level, thereby saving decoding time and improving decoding efficiency. In other words, when the value of pic_ibc_flag is 0, no matter what the value of slice_ibc_pf_flag is, the above-mentioned target block does not exist in the slice. Referring to Table 11, when the value of pic_ibc_flag is 0, the value of the fourth IBC flag slice_ibc_pf_flag is represented as "X". In this case, S830 can be directly executed: determine that the current slice does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0273] When the value of pic_ibc_flag is 1, it indicates that the current frame allows IBC mode for coding prediction, and it is necessary to further decode the value of the fourth IBC flag slice_ibc_pf_flag at the slice level (i.e., execute S840). There are two situations:
[0274] Case 1: pic_ibc_flag is 1 and the slice-level fourth IBC flag, slice_ibc_pf_flag, is 0, indicating that although the current frame allows IBC mode, the current slice does not support IBCPF mode. In other words, there is no target block in the current slice that meets the above conditions of this application. Therefore, there is no need to further analyze the frame for IB or IBCPF (e.g., slice-level flags). S830 can be directly executed: Determine that the current slice does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0275] Case 2: pic_ibc_flag is 1 and the fourth slice-level IBC flag, slice_ibc_pf_flag, is 1, indicating that IBC mode is enabled for the current frame and IBCPF mode is enabled for the current slice. This means that a target block meeting the aforementioned conditions of this application exists within the current slice. Therefore, it is necessary to further determine which slice contains the target block. Therefore, the operation in S860 is performed: the slice-level flags are parsed to determine the target block based on the flags of the next-level syntax structure.
[0276] Example 2.2: As shown in Table 12, the fourth IBC flag slice_ibc_pf_flag at the slice level may be dependent on the flag pic_ibc_pf_flag at the frame level (superior syntax structure) to determine the correlation.
[0277] Table 12
[0278] Regarding the syntax structure in Table 12, in the image header:
[0279] pic_ibc_pf_flag is the intra-frame prediction filter flag for the picture header block copy;
[0280] This variable is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not 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.
[0281] In the opening credits:
[0282] slice_ibc_pf_flag is the slice header block copy intra prediction filter flag;
[0283] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcPfFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of PicIbcPfFlag is 0.
[0284] When the value of pic_ibc_pf_flag is 0, it means that the current frame does not support the IBCPF mode. Therefore, there is no need to perform decoding of the fourth IBC flag slice_ibc_pf_flag at the slice level, thereby saving decoding time and improving decoding efficiency. In other words, when the value of pic_ibc_pf_flag is 0, no matter what the value of slice_ibc_pf_flag is, the above-mentioned target block does not exist in the slice. Referring to Table 9, when the value of pic_ibc_flag is 0, the value of the fourth IBC flag slice_ibc_pf_flag is represented as "X". In this case, S830 can be directly executed: determine that the current slice does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0285] When the value of pic_ibc_pf_flag is 1, it indicates that the current frame supports predictive filtering using the IBCPF mode, and it is necessary to further decode the value of the fourth IBC flag slice_ibc_pf_flag at the slice level (i.e., execute S840). There are two situations:
[0286] Case 1: pic_ibc_pf_flag is 1 and the fourth slice-level IBC flag, slice_ibc_pf_flag, is 0, indicating that although the current frame supports IBCPF mode, the current slice does not support it. In other words, there is no target block in the current slice that meets the above conditions of this application. Therefore, there is no need to further analyze the frame for IB or IBCPF (e.g., slice-level flags). S830 can be directly executed: Determine that the current slice does not contain the target block, thereby saving decoding time and improving decoding efficiency.
[0287] Case 2: pic_ibc_pf_flag is 1 and the fourth slice-level IBC flag, slice_ibc_pf_flag, is 1, indicating that both the current frame and the current slice support IBCPF mode. This means that a target block meeting the aforementioned conditions exists within the current slice. Therefore, it is necessary to further determine which slice contains the target block. Therefore, the operation in S860 is performed: the slice-level flag is parsed to determine the target block based on the flag of the next-level syntax structure.
[0288] When the second-level syntax structure is at the slice level, the first-level syntax structure can also be at the sequence level in this embodiment. In Examples 2.3 and 2.4, the first syntax structure is at the sequence level as an example. The fourth slice-level IBC flag, slice_ibc_pf_flag, can rely on flags at the sequence level (the higher-level syntax structure) to determine relevant information.
[0289] Example 2.3: As shown in Table 13, the fourth IBC flag slice_ibc_pf_flag at the slice level may be dependent on the flag seq_ibc_flag at the sequence level (the upper syntax structure) to determine the correlation.
[0290] Table 13
[0291] Regarding the syntax structure in Table 13, in the sequence header:
[0292] seq_ibc_flag is the sequence header block copy intra prediction flag;
[0293] This 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 SeqIbcFlag is equal to the value of seq_ibc_flag. If seq_ibc_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0294] In the opening credits:
[0295] slice_ibc_pf_flag is the slice header block copy intra prediction filter flag;
[0296] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0297] The embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 13. For a detailed description, please refer to embodiment 2.1, which illustrates that the embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 11.
[0298] Example 2.4: As shown in Table 14, the fourth IBC flag slice_ibc_pf_flag at the slice level may be dependent on the flag seq_ibc_pf_flag at the sequence level (the upper syntax structure) to determine the correlation.
[0299] Table 14
[0300] Regarding the syntax structure in Table 14, in the sequence header:
[0301] seq_ibc_pf_flag is the sequence header block copy intra-frame prediction filter flag;
[0302] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of seq_ibc_pf_flag. If seq_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0303] In the opening credits:
[0304] slice_ibc_pf_flag is the slice header block copy intra prediction filter flag;
[0305] A binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0306] The embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 14. For a detailed description, please refer to embodiment 2.2, which illustrates that the embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 12.
[0307] Regarding Example 3 of Method P1000: The above-mentioned second-level syntax structure is at the block level. As mentioned above, in this embodiment, the above-mentioned first-level syntax structure can be at the sequence level, frame level, or slice level. In Examples 3.1 and 3.2, the first syntax structure is at the slice level as an example. Specifically, when it is impossible to exclude the frame from adopting the IBC mode or IBCPF mode based on the slice-level flag, this embodiment is executed. If the above-mentioned fourth IBC flag can be expressed as: cu_ibc_pf_flag. The fourth IBC flag cu_ibc_pf_flag at the block level can rely on the flag at the slice level (the upper syntax structure) to determine the relevant information.
[0308] Example 3.1: As shown in Table 15, the fourth IBC flag cu_ibc_pf_flag at the block level may be correlated with the flag slice_ibc_flag at the slice level (the upper syntax structure).
[0309] Table 15
[0310] Regarding the grammatical structure in Table 15, in the title:
[0311] slice_ibc_flag is the slice header block copy intra prediction flag;
[0312] This variable 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 SliceIbcFlag is equal to the value of slice_ibc_flag. If slice_ibc_flag is not present in the bitstream, the value of SliceIbcFlag is 0.
[0313] In the encoding block:
[0314] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0315] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SliceIbcFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of SliceIbcFlag is 0.
[0316] The embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 15. For a detailed description, please refer to embodiment 2.1, which illustrates that the embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 11.
[0317] Example 3.2: As shown in Table 16, the fourth IBC flag cu_ibc_pf_flag at the block level may be correlated with the flag slice_ibc_pf_flag at the slice level (the upper syntax structure).
[0318] Table 16
[0319] Regarding the grammatical structure in Table 16, in the header:
[0320] slice_ibc_pf_flag is the slice header block copy intra prediction filter flag;
[0321] This variable is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SliceIbcPfFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of SliceIbcPfFlag is 0.
[0322] In the encoding block:
[0323] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0324] This variable is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SliceIbcPfFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of SliceIbcPfFlag is 0.
[0325] The embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 16. For a detailed description, please refer to embodiment 2.2, which illustrates that the embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 12.
[0326] When the second-level syntax structure is at the block level, the first-level syntax structure can also be at the frame level in this embodiment. In Examples 3.3 and 3.4, the first syntax structure is at the frame level as an example. The fourth IBC flag cu_ibc_pf_flag at the block level can rely on the flag at the frame level (the upper-level syntax structure) to determine relevant information.
[0327] Example 3.3: As shown in Table 17, the fourth IBC flag cu_ibc_pf_flag at the block level may be dependent on the flag pic_ibc_flag at the frame level (superior syntax structure) to determine the correlation.
[0328] Table 17
[0329] Regarding the syntax structure in Table 17, in the image header:
[0330] pic_ibc_flag is the intra prediction flag for the picture header block copy;
[0331] 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.
[0332] In the encoding block:
[0333] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0334] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of PicIbcFlag is 0.
[0335] The embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 17. For a detailed description, please refer to embodiment 2.3, which illustrates that the embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 13.
[0336] Example 3.4: As shown in Table 18, the fourth IBC flag cu_ibc_pf_flag at the block level may depend on the flag pic_ibc_pf_flag at the frame level (superior syntax structure) to determine the correlation.
[0337] Table 18
[0338] Regarding the syntax structure in Table 18, in the image header:
[0339] pic_ibc_pf_flag is the intra-frame prediction filter flag for the picture header block copy;
[0340] This variable is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not 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.
[0341] In the encoding block:
[0342] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0343] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcPfFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of PicIbcPfFlag is 0.
[0344] The embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 14. For a detailed description, please refer to Example 2.4, which illustrates that the embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 14.
[0345] When the second-level syntax structure is block-level, the first-level syntax structure can also be sequence-level in this embodiment. In Examples 3.5 and 3.6, the first syntax structure is sequence-level as an example. The fourth IBC flag cu_ibc_pf_flag at the block level can rely on the flag at the sequence level (the higher-level syntax structure) to determine relevant information.
[0346] Example 3.5: As shown in Table 19, the fourth IBC flag cu_ibc_pf_flag at the block level may be dependent on the flag seq_ibc_flag at the sequence level (the upper syntax structure) to determine the correlation.
[0347] Table 19
[0348] Regarding the syntax structure in Table 19, in the sequence header:
[0349] seq_ibc_flag is the sequence header block copy intra prediction flag;
[0350] This 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 SeqIbcFlag is equal to the value of seq_ibc_flag. If seq_ibc_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0351] In the encoding block:
[0352] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0353] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0354] The embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 19. For a detailed description, please refer to embodiment 2.3, which illustrates that the embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 13.
[0355] Example 3.6: As shown in Table 20, the fourth IBC flag cu_ibc_pf_flag at the block level may depend on the flag seq_ibc_pf_flag at the sequence level (the upper syntax structure) to determine the correlation.
[0356] Table 20
[0357] Regarding the syntax structure in Table 20, in the sequence header:
[0358] seq_ibc_pf_flag is the sequence header block copy intra-frame prediction filter flag;
[0359] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of seq_ibc_pf_flag. If seq_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0360] In the encoding block:
[0361] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0362] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0363] The embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 20. For a detailed description, please refer to embodiment 2.4, which illustrates that the embodiment provided by method P1000 can be implemented by combining the various semantics shown in Table 14.
[0364] In the embodiment of method P1000 described above, when a flag is included in a lower level of the coded bitstream, the target block can be determined by relying on a flag at a higher level. Combining the relevant flags at both levels to determine the target block provides a flexible determination method, which helps save encoding and decoding time and improves encoding and decoding performance.
[0365] As another implementation of S510:
[0366] S510 - 1 : Parse the code stream to obtain the fifth IBC flag at the block level. The fifth IBC flag is used to indicate whether the current block supports the IBCPF mode and the different types of supported IBCPF modes.
[0367] The fifth IBC flag can be used to determine not only the target block but also the filtering method for the target block. For example, the fifth IBC flag can be represented as: cu_ibc_pf_index. Table 21 shows the relevant semantics of cu_ibc_pf_index.
[0368] Table 21
[0369] Regarding the grammatical structure in Table 21, in the encoding block:
[0370] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0371] A binary variable. A value greater than '0' indicates that IBCPF mode is used; a value of '0' indicates that 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 is not present in the bitstream, the value of CuIbcPfFlag is 0.
[0372] S510-2: If the fifth IBC flag indicates that the current block does not support the IBCPF mode, determine that the current block is not the target block. Referring to Table 21, if the value of cu_ibc_pf_index is 0, it means that the current block does not support the IBCPF mode, and it is determined that the current block is not the target block.
[0373] S510-3: If the fifth IBC flag indicates that the current block supports any type of IBCPF mode, determine the current block as the target block. Referring to Table 21, if cu_ibc_pf_index is 1 or 2, it means that the current block supports IBCPF mode, and the current block is determined as the target block.
[0374] In an exemplary embodiment, different IBCPF modes obtained by decoding may also indicate the use of different filtering methods (different filtering methods will be described in detail in subsequent embodiments). For example, if the decoded cu_ibc_pf_index value is 1, it indicates that the cu_ibc_pf_index value is 1, in which case filtering method A can be used; if the decoded cu_ibc_pf_index value is 2, it indicates that the cu_ibc_pf_index value is 2, in which case filtering method B can be used.
[0375] As another implementation of S510:
[0376] S510-1': Parse the code stream to obtain a fourth IBC flag and a fifth IBC flag at the block level. The fourth IBC flag is used to indicate whether the current block supports the IBCPF mode, and the fifth IBC flag is used to indicate different types of supported IBCPF modes.
[0377] Combining the fourth and fifth IBC flags not only determines the target block but also determines the filtering method for the target block. For example, the fourth IBC flag can be represented as cu_ibc_pf_flag, and the fifth IBC flag can be represented as cu_ibc_pf_index. Table 22 shows the semantics of cu_ibc_pf_flag and cu_ibc_pf_index.
[0378] Table 22
[0379] Regarding the grammatical structure in Table 22, in the encoding block:
[0380] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0381] A binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that 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 is not present in the bitstream, the value of CuIbcPfFlag is 0.
[0382] cu_ibc_pf_index is the block-level block copy intra prediction filter index;
[0383] 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 bitstream, the value of CuIbcPfIndex is 0.
[0384] S510-2': If the fourth IBC flag indicates that the current block does not support the IBCPF mode, determine that the current block is not the target block. Referring to Table 22, if the value of cu_ibc_pf_flag is 0, indicating that the current block does not support the IBCPF mode, to save decoding time, the fifth IBC flag may not be parsed, and the current block may be directly determined to be not the target block.
[0385] S510-3': If the fourth IBC flag indicates that the current block supports the IBCPF mode, the current block is determined as the target block. The IBCPF mode can be determined based on the fifth IBC flag indication information. Referring to Table 22, if the value of cu_ibc_pf_index is 0, it indicates that the current block supports IBCPF mode 1; if the value of cu_ibc_pf_index is 1, it indicates that the current block supports IBCPF mode 2. The applicable filtering method can be determined based on the IBCPF mode supported by the target block.
[0386] In an exemplary embodiment, in addition to decoding and determining the above flag, it can also be obtained in the following manner:
[0387] In embodiment 1, block-level indication information (e.g., cu_ibc_pf_flag, cu_ibc_pf_index) for indicating IBCPF can be derived based on the template matching result. For example, by applying IBCPF to the template, the cost (e.g., SAD) of the template before and after application is compared with the current block template. If the cost of applying IBCPF is lower, then IBCPF is determined to be used; otherwise, if the cost of applying IBCPF becomes higher, then IBCPF is determined not to be used.
[0388] In embodiment 2, block-level indication information (e.g., cu_ibc_pf_flag, cu_ibc_pf_index) for indicating IBCPF can be derived based on implicit coefficients (based on whether the transform coefficients meet certain conditions). Whether to use IBCPF can be determined based on the parity of the number of even-numbered transform coefficients, for example, using IBCPF for odd numbers and not for even numbers.
[0389] In the embodiment of the present application, in addition to the embodiments of how to determine the target block according to the flag shown in Figures 6 to 10, it is also possible to implicitly determine whether the current block is the target block. Specifically:
[0390] S1: parsing a code stream to obtain target information, and determining whether the target current block supports the IBCPF mode according to the target information; and, S2: if it is determined that the current block supports the IBCPF mode, determining the current block as the target block.
[0391] Example 1: The target information is the type of the image where the current block is located:
[0392] Specifically, if the ibc_pf_flag is not allowed based on the picture type, then there is no need to decode the syntax elements at the picture header and below, saving decoding time. For example, the IBCPF mode is only allowed in type I pictures, and for non-type I pictures, there is no need to decode the IBCPF-related syntax elements in their block level, slice header, and picture header.
[0393] Example 2: The target information is the color component of the current block:
[0394] For example, IBCPF is only allowed to be used on the luma component, or IBCPF is only allowed to be used on the chroma components.
[0395] IBCPF is allowed to be used when the current block is a specific color component, such as using IBCPF only for the luminance component Y, or using IBCPF only for the chrominance component U or V, or allowing IBCPF to be used for the luminance components Y, U and V.
[0396] Example 3: The target information is the size of the current block:
[0397] Specifically, IBCPF is permitted when the block size meets certain conditions. If the current block size does not meet these conditions, decoding of block-level IBCPF-related syntax elements is not required. Block size includes one or more of width, height, or area. These conditions may include being greater than a first threshold, greater than or equal to a second threshold, less than a third threshold, or less than or equal to a fourth threshold. These multiple thresholds are not limited and can be determined based on actual circumstances.
[0398] For example, IBCPF is only used when the current block area (width × height) is greater than 64; or, IBCPF is allowed to be used when the current block width is less than or equal to 64; or, IBCPF is allowed to be used when the current block height is less than or equal to 64; and so on.
[0399] In embodiment 4, the target information is the type of the image where the current block is located;
[0400] One or more of the above-mentioned high-level syntax elements are decoded in non-specific picture types (such as non-I pictures). For example, ibc_pf_flag only needs to be decoded in non-I pictures.
[0401] Embodiment 5: The target information is the adaptive block vector resolution (ABVR) of the current block;
[0402] Specifically, IBCPF is allowed to be used when the ABVR size of the current block meets certain conditions. If the ABVR size of the current block does not meet the conditions, there is no need to decode the block-level IBCPF related syntax elements to save decoding time.
[0403] Exemplarily, the use of IBCPF is permitted under the condition that the ABVR of the current block is a subset of the available ABVR list. For example, if the available ABVR list is {1-pel, 4pel}, the block-level IBCPF is decoded only when the current block vector resolution is 1-pel; or, the use of IBCPF is permitted only when the current block vector resolution is 4-pel. For another example, if the available ABVR list is {1 / 4pel, 1-pel, 4pel}, the use of IBCPF is permitted only when the current block vector resolution is 1-pel; or, the use of IBCPF is permitted only when the current block vector resolution is 1-pel, 4-pel, etc.
[0404] In embodiment 6, the target information is the vector residual of the current block;
[0405] Exemplarily, IBCPF is allowed to be used when the current block vector difference (BVD) meets the conditions; if the block vector difference size of the current block does not meet the conditions, there is no need to decode the block-level IBCPF-related syntax elements to improve decoding efficiency. For example. The above conditions are that the absolute value of the horizontal BVD and / or vertical BVD of the current block meets a specific threshold. For example, greater than the first threshold, greater than or equal to the second threshold, less than the third threshold, less than or equal to the fourth threshold, etc. The above multiple thresholds are not limited and can be determined according to actual conditions. For another example, IBCPF is only allowed to be used when the horizontal BVD and vertical BVD of the current block are both equal to 0.
[0406] Embodiment 7: The target information is a vector index of the current block;
[0407] Exemplarily, IBCPF is allowed when the vector index of the current block meets the conditions; if the predicted block vector index of the current block does not meet the conditions, there is no need to decode the block-level IBCPF-related syntax elements to save decoding time. For example, the above condition is that the absolute value of the block vector prediction index (bvp_idx) meets a specific threshold. For example, it is greater than a first threshold, greater than or equal to a second threshold, less than a third threshold, less than or equal to a fourth threshold, etc. The above multiple thresholds are not limited and can be determined according to actual conditions.
[0408] In embodiment 8, the target information is an IBC tool corresponding to the IBC prediction mode of the current block;
[0409] In an exemplary embodiment, the use of IBCPF is permitted when the IBC tool level of the current block satisfies one or more of the following conditions:
[0410] 1) The prediction block vector index is less than or equal to a first preset value, for example, the first preset value is 2;
[0411] 2) The block vector residual is less than or equal to a second preset value, for example, the second preset value is 0;
[0412] 3) The accuracy of ABVR meets the preset accuracy set, for example, the preset accuracy set is less than or equal to 1pel accuracy;
[0413] In another exemplary embodiment, the use of IBCPF is permitted when one or more of the IBC tools in Table 23 are not used.
[0414] Table 23
[0415] In Table 23, when the value of IBCPF is 1, it means that the current block under the corresponding IBC tool allows the use of IBCPF, that is, the current block can be used as the above-mentioned target block; when the value of IBCPF is 0, it means that the current block under the corresponding IBC tool does not allow the use of IBCPF, that is, the current block is not the target block.
[0416] In an exemplary embodiment, the above embodiment can be used to obtain a target block, i.e., the prediction mode is intra block copy (IBC), and IBCPF is also supported. Furthermore, S520 and S530 are performed. Referring to FIG5 , in S520, target prediction information for the target block is determined based on the reconstructed information of the neighboring regions of the target block and the original prediction information of the target block.
[0417] In this embodiment, a reference sample set in an adjacent area of the target block is obtained. For a target pixel in the target block, a reference sample related to the target pixel is determined in the reference sample set, and the predicted value of the target pixel is further filtered based on the reconstruction information of the related reference sample.
[0418] In an exemplary embodiment, the adjacent region includes the upper reference sample set in the TR rows and TC columns above the target block, and the left reference sample set in the LR rows and LC columns to the left of the target block. For example, referring to FIG11 , the size information of the target block 110 is M×N, and the upper reference sample set is obtained as the upper reference sample set, and the left reference sample set is obtained as the left reference sample set, 2N rows and 1 column. The reference samples in the upper reference sample set of the target block 110 are denoted as r[i], and the reference samples in the left reference sample set are denoted as c[j], where r[0] is equal to c[0].
[0419] In an exemplary embodiment, the reconstructed value topPel[i] of the reference sample r[i] in the upper reference sample set of the target block 110 can be expressed as follows: for(i=0; i<2M; i++){ topPel[i]=r[i]}.
[0420] The reconstructed value leftPel[j] of the reference sample c[j] in the left reference sample set of the target block 110 can be expressed as follows: for(j=0; i<2N; i++){ leftPel[j]=c[j]}.
[0421] As described above, after determining the reference sample set of the target block, the original prediction value of the target block can be filtered based on the reconstruction information of the pixel samples in the reference sample set. Exemplarily, for any pixel in the target block (denoted as the target pixel), based on the position information of the target pixel in the target block, a reference sample is determined in the adjacent area of the target block (i.e., in the above-mentioned reference sample set); then, based on the reconstruction information of the reference sample and the original prediction information of the target pixel, the target prediction information of the target pixel is determined. In this way, filtering of the original prediction information of the target block is achieved. Exemplarily, Figures 12 and 13 provide two filtering methods respectively.
[0422] FIG12 is a flow chart of a method P1200 for determining target prediction information according to an embodiment of the present application, which can be used as a specific implementation of S520 and can be recorded as filtering method A.
[0423] In S1210 , according to the position information of the target pixel in the target block, a first reference sample is determined in a left adjacent area of the target block, and a second reference sample is determined in an upper adjacent area of the target block.
[0424] Referring to Figure 11, the size information of the target block 110 is M×N, and the position information of the target pixel (any pixel in the target block) in the target block 110 is (x, y), where x is a positive integer not greater than M, y is a positive integer not greater than N, and M and N are positive integers.
[0425] Example of determining reference samples for a target pixel:
[0426] In embodiment 1, reference samples (first reference samples and second reference samples) of the target pixel are determined by combining the position information (x, y) of the target pixel and the size information of the target block 110. For example, the first reference sample includes: a first pixel c[N+1] associated with the horizontal size N of the target block 110, and a second pixel c[y+1] associated with the vertical position y of the target pixel; the second reference sample includes: a third pixel r[M+1] associated with the vertical size M of the target block, and a fourth pixel r[x+1] associated with the horizontal position x of the target pixel.
[0427] Embodiment 2: Determine a reference sample for a target pixel based on the position information (x, y) of the target pixel. For example, a reference sample may be: a second pixel c[y+1] (a first reference sample) associated with the vertical position y of the target pixel, and a fourth pixel r[x+1] (a second reference sample) associated with the horizontal position x of the target pixel.
[0428] In S1220 , an intra-frame prediction intermediate value of the target pixel is determined according to the first reconstruction information of the first reference sample and the second reconstruction information of the second reference sample.
[0429] Here, the specific implementation of S1220 is described using the above-mentioned “Example 1” as an example:
[0430] The first reconstruction information includes: the reconstructed value leftPel[N+1] of the first pixel c[N+1], and the reconstructed value leftPel[y+1] of the second pixel c[y+1]. The second reconstruction information includes: the reconstructed value topPel[M+1] of the third pixel r[M+1], and the reconstructed value topPel[x+1] of the fourth pixel r[x+1].
[0431] S1220-1: Determine an intra-frame prediction vertical component of the target pixel according to the reconstruction information of the first pixel, the reconstruction information of the fourth pixel, the horizontal size N of the target block, and the vertical position y of the target pixel.
[0432] Exemplarily, the intra-frame predicted vertical component predV of the target pixel is determined according to formula (1). predV=((N–1–y)×topPel[x+1]+(y+1)×leftPel[N+1]+(N>>1))>>Log(N) (1)
[0433] S1220-2: Determine an intra-prediction horizontal component of the target pixel according to the reconstruction information of the second pixel, the reconstruction information of the third pixel, the vertical size M of the target block, and the horizontal position x of the target pixel;
[0434] Exemplarily, the intra-frame prediction horizontal component predH of the target pixel is determined according to formula (2). predH=((M–1–x)×leftPel[y+1]+(x+1)×topPel[M+1]+(M>>1))>>Log(M) (2)
[0435] S1220-3: Determine an intra-prediction intermediate value of the target pixel according to the intra-prediction vertical component and the intra-prediction horizontal component.
[0436] Exemplarily, the intra-frame prediction intermediate value predPlane[x][y] of the target pixel is determined according to formula (3): predPlane[x][y]=(predV+predH+1)>>1 (3)
[0437] In other embodiments, the intra-frame prediction intermediate value of the target pixel may be determined in other ways, which is not limited in the embodiments of the present application.
[0438] In S1230 , target prediction information of the target pixel is determined according to the intra-frame prediction intermediate value of the target pixel and the original prediction information of the target pixel.
[0439] For example, the target prediction information amount predMatrixTmp[x][y] of the target pixel is determined according to formula (4): predMatrixTmp[x][y]=((predIBC[x][y]×5+predPlane[x][y]×3+4)>>3) (4)
[0440] In S1230 ′, target prediction information of the target pixel is determined according to the intra-frame prediction intermediate value of the target pixel, the original prediction information of the target pixel, and the filter coefficient.
[0441] For example, the target prediction information amount predMatrixTmp[x][y] of the target pixel is determined according to formula (5): predMatrixTmp[x][y]=((predIBC[x][y]×5+predPlane[x][y]×3+f[x]×f[y])>>3) (5)
[0442] Wherein, predIBC[x][y] indicates the original prediction information of the target pixel; the filtering parameters f[x] and f[y] are related to the position information of the target pixel in the target block. Alternatively, the filtering parameters f[x] and f[y] are related to the size information of the target block. Alternatively, the filtering parameters f[x] and f[y] are related to the position information in the target block and the size information of the target block. For example, the filtering parameters can be determined according to Table 24.
[0443] Table 24
[0444] FIG13 is a flow chart of a method P1300 for determining target prediction information according to another embodiment of the present application, which can be used as another specific implementation of S520 and can be recorded as filtering method B.
[0445] In S1310 , according to the position information of the target pixel in the target block, a third reference sample is determined in a left adjacent area of the target block, and a fourth reference sample is determined in an upper adjacent area of the target block.
[0446] Referring to Figure 11, the size information of the target block 110 is M×N, and the position information of the target pixel (any pixel in the target block) in the target block 110 is (x, y), where x is a positive integer not greater than M, y is a positive integer not greater than N, and M and N are positive integers.
[0447] Example of determining reference samples for a target pixel:
[0448] In embodiment 1, reference samples (third reference samples and fourth reference samples) of the target pixel are determined by combining the position information (x, y) of the target pixel and the size information of the target block 110. For example, the third reference sample includes: a first pixel c[N+1] associated with the horizontal size N of the target block 110, and a second pixel c[y+1] associated with the vertical position y of the target pixel; the fourth reference sample includes: a third pixel r[M+1] associated with the vertical size M of the target block, and a fourth pixel r[x+1] associated with the horizontal position x of the target pixel.
[0449] Embodiment 2: Determine a reference sample for a target pixel based on the position information (x, y) of the target pixel. For example, a reference sample may be: a second pixel c[y+1] (third reference sample) associated with the vertical position y of the target pixel, and a fourth pixel r[x+1] (fourth reference sample) associated with the horizontal position x of the target pixel.
[0450] In S1320, target prediction information of the target pixel is determined according to the third reconstruction information of the third reference sample, the fourth reconstruction information of the fourth reference sample, and the original prediction information of the target pixel;
[0451] Here, the specific implementation of S1320 is described using the above-mentioned "Example 2" as an example:
[0452] Exemplarily, the target prediction information amount predMatrixTmp[x][y] of the target pixel is determined according to formula (6). predMatrixTmp[x][y]=Clip1((leftPel[y+1]+topPel[x+1]+(64−f[x]−f[y])×predIBC[x][y]+32)>>6) (6)
[0453] In S1320′, the target prediction information of the target pixel is determined based on the third reconstruction information of the third reference sample, the fourth reconstruction information of the fourth reference sample, the original prediction information of the target pixel, and the filtering parameters.
[0454] Here, the specific implementation of S1320' is described using the above-mentioned "Example 2" as an example:
[0455] For example, the target prediction information amount predMatrixTmp[x][y] of the target pixel is determined according to formula (7): predMatrixTmp[x][y]=Clip1((f[x]×leftPel[y+1]+f[y]×topPel[x+1]+(64–f[x]–f[y])×predIBC[x][y]+32) >> 6) (7)
[0456] Wherein, predIBC[x][y] indicates the original prediction information of the target pixel; the filtering parameter f[x]×f[y] is related to the position information of the target pixel in the target block and the size information of the target block. For example, the filtering parameter can be determined according to Table 24.
[0457] In addition to the filtering methods for the prediction value of the target block shown in Figures 12 and 13, other methods can also be used to filter the prediction information of the target block, for example, by building a mathematical model to filter the target quantity prediction information.
[0458] The mathematical model may be a linear model, a polynomial model, a convolution model, etc. For example, the mathematical model may be: f(x) = a×x + b; or, f(x) = a0 + a1 × x + a2 × x^2 + … + an × x^n; or, f(C, N, S, E, W, B) = c0 × C + c1 × N + c2 × S + c3 × E + c4 × W + c5 × P + c6 × B;
[0459] Where C represents the sample at the current position, N, S, E, and W represent the samples of the north, south, east, and west, respectively. The nonlinear term P = (C × C + midVal) >> bitDepth; the bias term B represents the scalar offset between the input and output and is set to the mid-brightness value. a0-a n And c0-c6 are constants, and their specific values can be determined according to actual needs.
[0460] It can be understood that the template parameters can be used to derive model parameters through the templates of the current block and the reference block.
[0461] It is understandable that the different filtering methods shown above can be used in combination. For example, the prediction values derived from different filtering methods can be weighted and combined, which is not limited in the present embodiment.
[0462] Continuing to refer to FIG. 5 , in S530 , reconstruction information of the target block is determined according to the target prediction information.
[0463] Exemplarily, the prediction information of the target block is filtered as shown in S520 to obtain target prediction information of the target block. Furthermore, the target prediction information is added to the corresponding residual information to obtain the reconstructed information of the target block.
[0464] In the solution provided by the embodiment of the present application, for a target block whose prediction mode is intra-block copy (IBC) prediction, if a reconstructed block is obtained based on the original prediction information of the target block, the reconstructed block may have a discontinuous boundary, and thus there may be poor spatial continuity between the block and its surrounding pixels. In the embodiment of the present application, the target prediction information of the target block is determined based on the reconstruction information of the adjacent areas of the target block and the original prediction information of the target block. Since the reconstruction information of the areas surrounding the block is added to the target prediction information, it is beneficial to a smooth transition between the target block and its surrounding areas, thereby helping to reduce the spatial continuity between the target block and its surrounding areas, thereby improving image quality and improving encoding and decoding performance.
[0465] The above describes in detail an embodiment of the video decoding method of the present application in conjunction with Figures 5 to 13. The following describes an embodiment of the video encoding method of the present application in conjunction with Figure 14.
[0466] FIG14 is a flow chart of a video decoding method P1400 provided in an embodiment of the present application. Method P1400 is performed by an encoder, such as an electronic device with encoding functionality. Referring to FIG14 , method P1400 includes steps S1410 to S1430.
[0467] In S1410 , a target block is determined, where the prediction mode of the target block is intra block copy (IBC) prediction.
[0468] The target block is the current coding unit (CU). In the embodiment of the present application, the target block is a CU predicted by the IBC prediction mode. Furthermore, since the embodiment of the present application will filter the original prediction information of the target block, the target block in the embodiment of the present application should also support the use of intra block copy prediction filter (IBCPF).
[0469] In the embodiment of the present application, whether the current block is the target block can be explicitly determined based on a flag related to the IBC mode and / or the IBCPF mode. Specifically, the relevant flag is written into the bitstream at the encoder end.
[0470] Example A:
[0471] In an exemplary embodiment, a first IBC flag of the first-level syntax structure is written into the bitstream, where the first IBC flag is used to indicate whether the encoding information of the first-level syntax structure adopts the IBC mode, or to indicate whether the intra-frame block copy prediction filtering IBCPF mode is supported when the IBC mode is adopted.
[0472] As mentioned above, the syntax levels of the coded bitstream include sequence level, frame level, slice level, block level, etc. In the embodiment of the present application, the first-level syntax structure can be any one of sequence level, frame level, slice level, and block level.
[0473] Regarding implementation method 1 of embodiment A: the first-level syntax structure is the sequence level. If the first IBC flag can be represented as seq_ibc_flag, the semantic information represented by different values of seq_ibc_flag is shown in Table 25.
[0474] Table 25
[0475] The grammatical structure of Table 25 is:
[0476] or,
[0477] Among them, seq_ibc_flag is the sequence header block copy mode flag;
[0478] Indicates the mode type of the block copy intra prediction mode. A value of '0' indicates that IBC should not be used. A value greater than '0' indicates that IBC can be used and indicates whether IBCPF is allowed. The value of SeqIbcFlag is equal to the value of seq_ibc_flag. If seq_ibc_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0479] Regarding implementation method 2 of embodiment A: the first-level syntax structure is at the frame level. If the first IBC flag can be represented as: pic_ibc_flag, the semantic information represented by different values of pic_ibc_flag is shown in Table 26.
[0480] Table 26
[0481] The grammatical structure of Table 26 is:
[0482] or,
[0483] Among them, pic_ibc_flag is the picture header block copy mode flag;
[0484] Indicates the mode type of the block copy intra prediction mode. A value of '0' indicates that IBC should not be used. A value greater than '0' indicates that IBC can be used and indicates whether IBCPF is allowed. 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.
[0485] Regarding implementation method 3 of embodiment A: the first-level syntax structure is at the slice level. If the first IBC flag can be represented as slice_ibc_flag, the semantic information represented by different values of slice_ibc_flag is shown in Table 27.
[0486] Table 27
[0487] The grammatical structure of Table 27 is:
[0488] or,
[0489] Among them, slice_ibc_flag is the slice header block copy mode flag;
[0490] Indicates the mode type of the block copy intra prediction mode. A value of '0' indicates that IBC should not be used. A value greater than '0' indicates that IBC can be used and indicates whether IBCPF is allowed. The value of SliceIbcFlag is equal to the value of slice_ibc_flag. If slice_ibc_flag is not present in the bitstream, the value of SliceIbcFlag is 0.
[0491] Regarding implementation mode 4 of method embodiment A: the first-level syntax structure is block-level. If the first IBC flag can be represented as cu_ibc_flag, the semantic information represented by different values of cu_ibc_flag is shown in Table 28.
[0492] Table 28
[0493] The grammatical structure of Table 28 is:
[0494] Among them, cu_ibc_flag is the block-level block copy mode flag;
[0495] Indicates the mode type of the block copy intra prediction mode. A value of '0' indicates that IBC should not be used. A value greater than '0' indicates that IBC can be used and indicates whether IBCPF is allowed. The value of CuIbcFlag is equal to the value of cu_ibc_flag. If cu_ibc_flag is not present in the bitstream, the value of CuIbcFlag is 0.
[0496] In embodiment A, a flag is encoded into the code stream of each layer, and the target block is marked by a flag, which is beneficial to saving decoding time and improving decoding efficiency and performance.
[0497] Example B:
[0498] In an exemplary embodiment, a first IBC flag and a second IBC flag of the first-level syntax structure are written into the bitstream, where the first IBC flag is used to indicate whether the encoding information of the first-level syntax structure adopts the IBC mode, and the second IBC flag is used to indicate whether the encoding information of the first-level syntax structure supports the intra-frame block copy prediction filtering IBCPF mode.
[0499] As mentioned above, the syntax levels of the coded bitstream include sequence level, frame level, slice level, block level, etc. In the embodiment of the present application, the first-level syntax structure can be any one of sequence level, frame level, slice level, and block level.
[0500] Regarding implementation method 1 of embodiment B: the first-level syntax structure is the sequence level. If the first IBC flag can be represented as seq_ibc_flag and the second IBC flag can be represented as seq_ibc_pf_flag, the semantic information represented by seq_ibc_flag and seq_ibc_pf_flag when they take different values is shown in Table 29.
[0501] Table 29
[0502] The syntax of Table 29 is as follows:
[0503] Among them, seq_ibc_flag is the sequence header block copy intra-frame prediction flag;
[0504] This 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 SeqIbcFlag is equal to the value of seq_ibc_flag. If seq_ibc_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0505] seq_ibc_pf_flag is the sequence header block copy intra-frame prediction filter mode flag;
[0506] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of seq_ibc_pf_flag. If seq_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0507] Regarding implementation method 2 of embodiment B: the first-level syntax structure is at the frame level. If the first IBC flag can be represented as pic_ibc_flag and the second IBC flag can be represented as pic_ibc_pf_flag, the semantic information represented by pic_ibc_flag and pic_ibc_pf_flag when they take different values is shown in Table 30.
[0508] Table 30
[0509] The syntax of Table 30 is as follows:
[0510] Among them, pic_ibc_flag is the picture header block copy intra prediction flag;
[0511] 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.
[0512] pic_ibc_pf_flag is the image header block copy intra prediction filter mode flag;
[0513] This variable is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not 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.
[0514] Regarding implementation method 3 of embodiment B: the first-level syntax structure is at the slice level. If the first IBC flag can be represented as slice_ibc_flag, the second IBC flag can be represented as slice_ibc_pf_flag. The semantic information represented by slice_ibc_flag and slice_ibc_pf_flag when they take different values is shown in Table 31.
[0515] Table 31
[0516] The syntax of Table 31 is as follows:
[0517] Among them, slice_ibc_flag is the slice header block copy intra prediction flag;
[0518] This variable 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 SliceIbcFlag is equal to the value of slice_ibc_flag. If slice_ibc_flag is not present in the bitstream, the value of SliceIbcFlag is 0.
[0519] slice_ibc_pf_flag is the slice header block copy intra prediction filter mode flag;
[0520] This variable is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SliceIbcPfFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of SliceIbcPfFlag is 0.
[0521] Regarding implementation method 4 of embodiment B: the first-level syntax structure is block-level. If the first IBC flag can be represented as cu_ibc_flag and the second IBC flag can be represented as cu_ibc_pf_flag, the semantic information represented by different values of cu_ibc_flag and cu_ibc_pf_flag is shown in Table 32.
[0522] Table 32
[0523] The syntax structure of Table 32 is as follows:
[0524] Among them, cu_ibc_flag is the block-level block copy intra prediction flag;
[0525] 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 CuIbcFlag is equal to the value of cu_ibc_flag. If cu_ibc_flag is not present in the bitstream, the value of CuIbcFlag is 0.
[0526] cu_ibc_pf_flag is the block-level block copy intra prediction filter mode flag;
[0527] A binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that 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 is not present in the bitstream, the value of CuIbcPfFlag is 0.
[0528] In Example B above, two flags are written into the bitstream for each layer. Each layer uses two flags to identify the target block, and the second IBC flag depends on the value of the first IBC flag at the same layer. Specifically, if the value of the first IBC flag at the same layer indicates that the current layer does not support IBC mode, there is no need to write the second IBC flag into the bitstream for the current layer, which helps save decoding time and improve decoding efficiency and performance.
[0529] Example C:
[0530] A third IBC flag of the second-level syntax structure is written into the code stream, where the third IBC flag is used to indicate whether the coding information of the second-level syntax structure adopts the IBC mode, or to indicate whether the IBCPF mode is supported when the IBC mode is adopted.
[0531] As mentioned above, the syntax levels of the coded bitstream include: sequence level, frame level, slice level, block level, etc.
[0532] In the embodiment of the present application, the second-level syntax structure can be a frame level, a slice level, or a block level. Specifically, when the first-level syntax structure is a sequence level, the second-level syntax structure is a frame level; or, when the first-level syntax structure is a frame column level or a sequence level, the second-level syntax structure is a slice level; or, when the first level is a slice level, a frame level, or a sequence level, the second-level syntax structure is a block level.
[0533] The specific implementation of Example C is similar to the specific implementation of Example A, except that the second-level grammatical structure in Example C cannot be a sequence level.
[0534] Example D:
[0535] A third IBC flag and a fourth IBC flag of the second-level syntax structure are written into the bitstream, wherein the third IBC flag is used to indicate whether the encoding information of the second-level syntax structure adopts the IBC mode, and the fourth IBC flag is used to indicate whether the encoding information of the second-level syntax structure supports the IBCPF mode.
[0536] As mentioned above, the syntax levels of the coded bitstream include: sequence level, frame level, slice level, block level, etc.
[0537] In the embodiment of the present application, the second-level syntax structure can be a frame level, a slice level, or a block level. Specifically, when the first-level syntax structure is a sequence level, the second-level syntax structure is a frame level; or, when the first-level syntax structure is a frame column level or a sequence level, the second-level syntax structure is a slice level; or, when the first level is a slice level, a frame level, or a sequence level, the second-level syntax structure is a block level.
[0538] The specific implementation of Example D is similar to that of Example B, except that the second-level grammatical structure in Example D cannot be a sequence level.
[0539] Example E:
[0540] The fourth IBC flag of the second-level syntax structure is written into the bitstream, and the fourth IBC flag is used to indicate whether the coding information of the second-level syntax structure supports the IBCPF mode. In the embodiment of the present application, the second-level syntax structure can be frame level, slice level, or block level.
[0541] Regarding Implementation 1 of Example E: In this embodiment, the second-level syntax structure is at the frame level, and the first-level syntax structure is at the sequence level. Specifically, if the fourth IBC flag is the frame-level fourth IBC flag pic_ibc_pf_flag, the relevant information can be determined based on the flag at the sequence level (the higher-level syntax structure).
[0542] Embodiment 1.1: As shown in Table 33, the fourth IBC flag pic_ibc_pf_flag at the frame level may be dependent on the flag seq_ibc_flag at the sequence level (higher syntax structure) to determine correlation.
[0543] Table 33
[0544] Regarding the syntax structure in Table 33, in the sequence header:
[0545] seq_ibc_flag is the sequence header block copy intra prediction flag;
[0546] This 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 SeqIbcFlag is equal to the value of seq_ibc_flag. If seq_ibc_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0547] In the image header:
[0548] pic_ibc_pf_flag is the intra-frame prediction filter flag for the picture header block copy;
[0549] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcFlag is equal to the value of pic_ibc_pf_flag. If pic_ibc_pf_flag is not present in the bitstream, the value of PicIbcFlag is 0.
[0550] Embodiment 1.2: As shown in Table 34, the fourth IBC flag pic_ibc_pf_flag at the frame level may depend on the flag seq_ibc_pf_flag at the sequence level (the upper syntax structure) to determine the correlation.
[0551] Table 34
[0552] Regarding the syntax structure in Table 34, in the sequence header:
[0553] seq_ibc_pf_flag is the sequence header block copy intra-frame prediction filter flag;
[0554] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of seq_ibc_pf_flag. If seq_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0555] In the image header:
[0556] pic_ibc_pf_flag is the intra-frame prediction filter flag for the picture header block copy;
[0557] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcPfFlag is equal to the value of pic_ibc_fp_flag. If pic_ibc_pf_flag is not present in the bitstream, the value of PicIbcPfFlag is 0.
[0558] Regarding Implementation 2 of Example E: The above-mentioned second-level syntax structure is at the slice level. As mentioned above, the above-mentioned first-level syntax structure in this embodiment can be at the sequence level or the frame level. Implementation 2.1 and Implementation 2.2 take the first syntax structure at the frame level as an example. Specifically, when it is impossible to exclude the frame from adopting the IBC mode or the IBCPF mode based on the frame-level flag, this embodiment is executed. If the above-mentioned fourth IBC flag can be expressed as: slice_ibc_pf_flag. The fourth IBC flag slice_ibc_pf_flag at the slice level can rely on the flag at the frame level (the upper-level syntax structure) to determine the relevant information.
[0559] Embodiment 2.1: As shown in Table 35, the fourth IBC flag slice_ibc_pf_flag at the slice level may depend on the flag pic_ibc_flag at the frame level (superior syntax structure) to determine the correlation.
[0560] Table 35
[0561] Regarding the syntax structure in Table 35, in the image header:
[0562] pic_ibc_flag is the intra prediction flag for the picture header block copy;
[0563] 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.
[0564] In the opening credits:
[0565] slice_ibc_pf_flag is the slice header block copy intra prediction filter flag;
[0566] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of PicIbcFlag is 0.
[0567] Embodiment 2.2: As shown in Table 36, the fourth IBC flag slice_ibc_pf_flag at the slice level may depend on the flag pic_ibc_pf_flag at the frame level (the upper syntax structure) to determine the correlation.
[0568] Table 36
[0569] Regarding the syntax structure in Table 36, in the image header:
[0570] pic_ibc_pf_flag is the intra-frame prediction filter flag for the picture header block copy;
[0571] This variable is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not 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.
[0572] In the opening credits:
[0573] slice_ibc_pf_flag is the slice header block copy intra prediction filter flag;
[0574] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcPfFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of PicIbcPfFlag is 0.
[0575] When the second-level syntax structure is at the slice level, the first-level syntax structure can also be at the sequence level in this embodiment. Implementation 2.3 and Implementation 2.4 take the first syntax structure at the sequence level as an example. The fourth slice-level IBC flag, slice_ibc_pf_flag, can rely on the flag at the sequence level (the higher-level syntax structure) to determine relevant information.
[0576] Embodiment 2.3: As shown in Table 37, the fourth IBC flag slice_ibc_pf_flag at the slice level may be dependent on the flag seq_ibc_flag at the sequence level (the upper syntax structure) to determine the correlation.
[0577] Table 37
[0578] Regarding the syntax structure in Table 37, in the sequence header:
[0579] seq_ibc_flag is the sequence header block copy intra prediction flag;
[0580] This 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 SeqIbcFlag is equal to the value of seq_ibc_flag. If seq_ibc_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0581] In the opening credits:
[0582] slice_ibc_pf_flag is the slice header block copy intra prediction filter flag;
[0583] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0584] Embodiment 2.4: As shown in Table 38, the fourth IBC flag slice_ibc_pf_flag at the slice level may be dependent on the flag seq_ibc_pf_flag at the sequence level (the upper syntax structure) to determine the correlation.
[0585] Table 38
[0586] Regarding the syntax structure in Table 38, in the sequence header:
[0587] seq_ibc_pf_flag is the sequence header block copy intra-frame prediction filter flag;
[0588] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of seq_ibc_pf_flag. If seq_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0589] In the opening credits:
[0590] slice_ibc_pf_flag is the slice header block copy intra prediction filter flag;
[0591] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0592] Regarding Implementation 3 of Example E: The above-mentioned second-level syntax structure is block-level. As mentioned above, the above-mentioned first-level syntax structure in this embodiment can be sequence-level, frame-level, or slice-level. Implementation 3.1 and Implementation 3.2 take the slice-level as an example of the first syntax structure. Specifically, when it is impossible to exclude the frame from not adopting the IBC mode or the IBCPF mode based on the slice-level flag, this embodiment is executed. If the above-mentioned fourth IBC flag can be expressed as: cu_ibc_pf_flag. The fourth IBC flag cu_ibc_pf_flag at the block level can rely on the flag at the slice level (the upper syntax structure) to determine the relevant information.
[0593] Embodiment 3.1: As shown in Table 39, the fourth IBC flag cu_ibc_pf_flag at the block level may be correlated with the flag slice_ibc_flag at the slice level (the upper syntax structure).
[0594] Table 39
[0595] Regarding the grammatical structure in Table 39, in the header:
[0596] slice_ibc_flag is the slice header block copy intra prediction flag;
[0597] This variable 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 SliceIbcFlag is equal to the value of slice_ibc_flag. If slice_ibc_flag is not present in the bitstream, the value of SliceIbcFlag is 0.
[0598] In the encoding block:
[0599] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0600] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SliceIbcFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of SliceIbcFlag is 0.
[0601] Embodiment 3.2: As shown in Table 40, the fourth IBC flag cu_ibc_pf_flag at the block level may be correlated with the flag slice_ibc_pf_flag at the slice level (the upper syntax structure).
[0602] Table 40
[0603] Regarding the grammatical structure in Table 40, in the header:
[0604] slice_ibc_pf_flag is the slice header block copy intra prediction filter flag;
[0605] This variable is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SliceIbcPfFlag is equal to the value of slice_ibc_pf_flag. If slice_ibc_pf_flag is not present in the bitstream, the value of SliceIbcPfFlag is 0.
[0606] In the encoding block:
[0607] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0608] This variable is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SliceIbcPfFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of SliceIbcPfFlag is 0.
[0609] When the second-level syntax structure is at the block level, the first-level syntax structure can also be at the frame level in this embodiment. Implementation 3.3 and Implementation 3.4 take the first syntax structure at the frame level as an example. The fourth IBC flag cu_ibc_pf_flag at the block level can rely on the flag at the frame level (the higher-level syntax structure) to determine relevant information.
[0610] Embodiment 3.3: As shown in Table 41, the fourth IBC flag cu_ibc_pf_flag at the block level may depend on the flag pic_ibc_flag at the frame level (the upper syntax structure) to determine the correlation.
[0611] Table 41
[0612] Regarding the syntax structure in Table 41, in the image header:
[0613] pic_ibc_flag is the intra prediction flag for the picture header block copy;
[0614] 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.
[0615] In the encoding block:
[0616] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0617] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of PicIbcFlag is 0.
[0618] Embodiment 3.4: As shown in Table 42, the fourth IBC flag cu_ibc_pf_flag at the block level may depend on the flag pic_ibc_pf_flag at the frame level (the upper syntax structure) to determine the correlation.
[0619] Table 42
[0620] Regarding the syntax structure in Table 42, in the image header:
[0621] pic_ibc_pf_flag is the intra-frame prediction filter flag for the picture header block copy;
[0622] This variable is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not 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.
[0623] In the encoding block:
[0624] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0625] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of PicIbcPfFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of PicIbcPfFlag is 0.
[0626] When the second-level syntax structure is block-level, the first-level syntax structure can also be sequence-level in this embodiment. Implementation 3.5 and Implementation 3.6 take the first syntax structure as sequence-level as an example. The fourth IBC flag cu_ibc_pf_flag at the block level can rely on the flag at the sequence level (the higher-level syntax structure) to determine relevant information.
[0627] Embodiment 3.5: As shown in Table 43, the fourth IBC flag cu_ibc_pf_flag at the block level may be dependent on the flag seq_ibc_flag at the sequence level (the upper syntax structure) to determine the correlation.
[0628] Table 43
[0629] Regarding the syntax structure in Table 43, in the sequence header:
[0630] seq_ibc_flag is the sequence header block copy intra prediction flag;
[0631] This 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 SeqIbcFlag is equal to the value of seq_ibc_flag. If seq_ibc_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0632] In the encoding block:
[0633] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0634] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of SeqIbcFlag is 0.
[0635] Embodiment 3.6: As shown in Table 44, the fourth IBC flag cu_ibc_pf_flag at the block level may depend on the flag seq_ibc_pf_flag at the sequence level (the upper syntax structure) to determine the correlation.
[0636] Table 44
[0637] Regarding the syntax structure in Table 44, in the sequence header:
[0638] seq_ibc_pf_flag is the sequence header block copy intra-frame prediction filter flag;
[0639] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of seq_ibc_pf_flag. If seq_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0640] In the encoding block:
[0641] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0642] This is a binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that IBCPF mode should not be used. The value of SeqIbcPfFlag is equal to the value of cu_ibc_pf_flag. If cu_ibc_pf_flag is not present in the bitstream, the value of SeqIbcPfFlag is 0.
[0643] In Example E above, when a flag is written into the bitstream at the lower level, it can rely on the flag at the upper level to identify the target block. Combining the relevant flags at the two levels to determine the target block provides a flexible determination method, which helps save encoding and decoding time and improve encoding and decoding performance.
[0644] Example F:
[0645] A fifth IBC flag at the block level is written into the codestream, where the fifth IBC flag is used to indicate whether the current block supports the IBCPF mode and the different types of supported IBCPF modes.
[0646] For example, the fifth IBC flag may be represented as: cu_ibc_pf_index. Table 45 shows the relevant semantics of cu_ibc_pf_index.
[0647] Table 45
[0648] Regarding the grammatical structure in Table 45, in the coding block:
[0649] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0650] A binary variable. A value greater than '0' indicates that IBCPF mode is used; a value of '0' indicates that 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 is not present in the bitstream, the value of CuIbcPfFlag is 0.
[0651] Example G:
[0652] The fourth IBC flag and the fifth IBC flag at the block level are written into the codestream, wherein the fourth IBC flag is used to indicate whether the current block supports the IBCPF mode, and the fifth IBC flag is used to indicate different types of supported IBCPF modes.
[0653] For example, the fourth IBC flag may be represented as cu_ibc_pf_flag, and the fifth IBC flag may be represented as cu_ibc_pf_index. Table 46 shows the semantics of cu_ibc_pf_flag and cu_ibc_pf_index.
[0654] Table 46
[0655] Regarding the grammatical structure in Table 46, in the coding block:
[0656] cu_ibc_pf_flag is the block-level block copy intra prediction filter flag;
[0657] A binary variable. A value of '1' indicates that IBCPF mode can be used; a value of '0' indicates that 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 is not present in the bitstream, the value of CuIbcPfFlag is 0.
[0658] cu_ibc_pf_index is the block-level block copy intra prediction filter index;
[0659] 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 bitstream, the value of CuIbcPfIndex is 0.
[0660] In an exemplary embodiment, in addition to marking the target block by writing the above flag into the codestream, the target block may also be marked in the following manner: writing target information into the codestream, wherein the target information is used to determine whether the current block supports the IBCPF mode.
[0661] Example 1: The target information is the type of the image where the current block is located:
[0662] Specifically, the IBCPF mode is only allowed to be used in I-type images; for non-I-type images, the IBCPF mode is not used, and there is no need to write IBCPF-related syntax elements into the bitstream to improve coding efficiency.
[0663] Example 2: The target information is the color component of the current block:
[0664] For example, IBCPF is only allowed to be used on the luma component, or IBCPF is only allowed to be used on the chroma components.
[0665] IBCPF is only allowed to be used when the current block is a specific color component, such as using IBCPF only for the luminance component Y, or using IBCPF only for the chrominance component U or V, or allowing IBCPF to be used for the luminance components Y, U and V.
[0666] Example 3: The target information is the size of the current block:
[0667] Specifically, IBCPF is permitted when the block size meets certain conditions. If the current block size does not meet these conditions, IBCPF is not permitted. Block size includes one or more of width, height, or area. These conditions may include being greater than a first threshold, greater than or equal to a second threshold, less than a third threshold, or less than or equal to a fourth threshold. These multiple thresholds are not limited and can be determined based on actual circumstances.
[0668] For example, IBCPF is only used when the current block area (width × height) is greater than 64; or, IBCPF is allowed to be used when the current block width is less than or equal to 64; or, IBCPF is allowed to be used when the current block height is less than or equal to 64; and so on.
[0669] In embodiment 4, the target information is the type of the image where the current block is located;
[0670] If IBCPF is allowed to be used for non-specific picture types (such as non-I pictures), the IBCPF flag is written into the code stream for non-specific picture types.
[0671] Embodiment 5: The target information is the adaptive block vector resolution (ABVR) of the current block;
[0672] Specifically, IBCPF is allowed to be used when the ABVR size of the current block meets certain conditions. If the ABVR size of the current block does not meet the conditions, IBCP is not allowed to be used.
[0673] Exemplarily, the use of IBCPF is permitted under the condition that the ABVR of the current block is a subset of the available ABVR list. For example, if the available ABVR list is {1-pel, 4pel}, the block-level IBCPF is written into the bitstream only when the current block vector resolution is 1-pel; or, the use of IBCPF is permitted only when the current block vector resolution is 4-pel. For another example, if the available ABVR list is {1 / 4pel, 1-pel, 4pel}, the use of IBCPF is permitted only when the current block vector resolution is 1-pel; or, the use of IBCPF is permitted only when the current block vector resolution is 1-pel, 4-pel, etc.
[0674] In embodiment 6, the target information is the vector residual of the current block;
[0675] Exemplarily, IBCPF is only allowed to be used when the current block vector difference (BVD) meets the conditions; if the block vector difference size of the current block does not meet the conditions, there is no need to write the block-level IBCPF-related syntax elements into the bitstream to improve coding efficiency. For example. The above conditions are that the absolute value of the horizontal BVD and / or vertical BVD of the current block meets a specific threshold. For example, greater than the first threshold, greater than or equal to the second threshold, less than the third threshold, less than or equal to the fourth threshold, etc. The above multiple thresholds are not limited and can be determined according to actual conditions. For another example, IBCPF is only allowed to be used when the horizontal BVD and vertical BVD of the current block are both equal to 0.
[0676] Embodiment 7: The target information is a vector index of the current block;
[0677] For example, IBCPF is permitted when the vector index of the current block meets certain conditions. If the predicted block vector index of the current block does not meet these conditions, block-level IBCPF-related syntax elements do not need to be written into the bitstream to improve coding efficiency. For example, the above condition is that the absolute value of the block vector prediction index (bvp_idx) meets a specific threshold. For example, it is greater than a first threshold, greater than or equal to a second threshold, less than a third threshold, less than or equal to a fourth threshold, etc. These multiple thresholds are not limited and can be determined based on actual conditions.
[0678] In embodiment 8, the target information is an IBC tool corresponding to the IBC prediction mode of the current block;
[0679] In an exemplary embodiment, the use of IBCPF is permitted when the IBC tool level of the current block satisfies one or more of the following conditions:
[0680] 1) The prediction block vector index is less than or equal to a first preset value, for example, the first preset value is 2;
[0681] 2) The block vector residual is less than or equal to a second preset value, for example, the second preset value is 0;
[0682] 3) The accuracy of ABVR meets the preset accuracy set, for example, the preset accuracy set is less than or equal to 1pel accuracy;
[0683] In another exemplary embodiment, the use of IBCPF is permitted when one or more of the IBC tools in Table 47 are not used.
[0684] Table 47
[0685] In Table 46, when the value of IBCPF is 1, it means that the current block under the corresponding IBC tool allows the use of IBCPF, that is, the current block can be used as the above-mentioned target block; when the value of IBCPF is 0, it means that the current block under the corresponding IBC tool does not allow the use of IBCPF, that is, the current block is not the target block.
[0686] In an exemplary embodiment, the target block can be determined by the above embodiment, that is, the prediction mode is intra block copy (IBC), and IBCPF is also supported. Further, S1420 and S1430 are executed.
[0687] In S1420 , target prediction information of the target block is determined according to the reconstruction information of the neighboring area of the target block and the original prediction information of the target block.
[0688] In this embodiment, a reference sample set in an adjacent area of the target block is obtained. For a target pixel in the target block, a reference sample related to the target pixel is determined in the reference sample set, and the predicted value of the target pixel is further filtered based on the reconstruction information of the related reference sample.
[0689] In an exemplary embodiment, the adjacent region includes the upper reference sample set in the TR rows and TC columns above the target block, and the left reference sample set in the LR rows and LC columns to the left of the target block. For example, referring to FIG11 , the size information of the target block 110 is M×N, and the upper reference sample set is obtained as the upper reference sample set, and the left reference sample set is obtained as the left reference sample set, 2N rows and 1 column. The reference samples in the upper reference sample set of the target block 110 are denoted as r[i], and the reference samples in the left reference sample set are denoted as c[j], where r[0] is equal to c[0].
[0690] In an exemplary embodiment, the reconstructed value topPel[i] of the reference sample r[i] in the upper reference sample set of the target block 110 can be expressed as follows: for(i=0; i<2M; i++){ topPel[i]=r[i]}.
[0691] The reconstructed value leftPel[j] of the reference sample c[j] in the left reference sample set of the target block 110 can be expressed as follows: for(j=0; i<2N; i++){ leftPel[j]=c[j]}.
[0692] As described above, after determining the reference sample set of the target block, the original prediction value of the target block can be filtered according to the reconstructed values of the pixel samples in the reference sample set. Figures 12 and 13 provide two filtering methods.
[0693] FIG12 is a flow chart of a method P1200 for determining target prediction information according to an embodiment of the present application, which can be used as a specific implementation of S520 and can be recorded as filtering method A.
[0694] In S1210 , according to the position information of the target pixel in the target block, a first reference sample is determined in a left adjacent area of the target block, and a second reference sample is determined in an upper adjacent area of the target block.
[0695] Referring to Figure 11, the size information of the target block 110 is M×N, and the position information of the target pixel (any pixel in the target block) in the target block 110 is (x, y), where x is a positive integer not greater than M, y is a positive integer not greater than N, and M and N are positive integers.
[0696] Example of determining reference samples for a target pixel:
[0697] In embodiment 1, reference samples (first reference samples and second reference samples) of the target pixel are determined by combining the position information (x, y) of the target pixel and the size information of the target block 110. For example, the first reference sample includes: a first pixel c[N+1] associated with the horizontal size N of the target block 110, and a second pixel c[y+1] associated with the vertical position y of the target pixel; the second reference sample includes: a third pixel r[M+1] associated with the vertical size M of the target block, and a fourth pixel r[x+1] associated with the horizontal position x of the target pixel.
[0698] Embodiment 2: Determine a reference sample for a target pixel based on the position information (x, y) of the target pixel. For example, a reference sample may be: a second pixel c[y+1] (a first reference sample) associated with the vertical position y of the target pixel, and a fourth pixel r[x+1] (a second reference sample) associated with the horizontal position x of the target pixel.
[0699] In S1220 , an intra-frame prediction intermediate value of the target pixel is determined according to the first reconstruction information of the first reference sample and the second reconstruction information of the second reference sample.
[0700] Here, the specific implementation of S1220 is described using the above-mentioned “Example 1” as an example:
[0701] The first reconstruction information includes: the reconstructed value leftPel[N+1] of the first pixel c[N+1], and the reconstructed value leftPel[y+1] of the second pixel c[y+1]. The second reconstruction information includes: the reconstructed value topPel[M+1] of the third pixel r[M+1], and the reconstructed value topPel[x+1] of the fourth pixel r[x+1].
[0702] S1220-1: Determine an intra-frame prediction vertical component of the target pixel according to the reconstruction information of the first pixel, the reconstruction information of the fourth pixel, the horizontal size N of the target block, and the vertical position y of the target pixel.
[0703] Exemplarily, the intra-frame predicted vertical component predV of the target pixel is determined according to formula (1). predV=((N–1–y)×topPel[x+1]+(y+1)×leftPel[N+1]+(N>>1))>>Log(N) (1)
[0704] S1220-2: Determine an intra-prediction horizontal component of the target pixel according to the reconstruction information of the second pixel, the reconstruction information of the third pixel, the vertical size M of the target block, and the horizontal position x of the target pixel;
[0705] Exemplarily, the intra-frame prediction horizontal component predH of the target pixel is determined according to formula (2). predH=((M–1–x)×leftPel[y+1]+(x+1)×topPel[M+1]+(M>>1))>>Log(M) (2)
[0706] S1220-3: Determine an intra-prediction intermediate value of the target pixel according to the intra-prediction vertical component and the intra-prediction horizontal component.
[0707] Exemplarily, the intra-frame prediction intermediate value predPlane[x][y] of the target pixel is determined according to formula (3): predPlane[x][y]=(predV+predH+1)>>1 (3)
[0708] In other embodiments, the intra-frame prediction intermediate value of the target pixel may be determined in other ways, which is not limited in the embodiments of the present application.
[0709] In S1230 , target prediction information of the target block is determined according to the intra-frame prediction intermediate value of the target pixel and the original prediction information of the target block.
[0710] For example, the target prediction information amount predMatrixTmp[x][y] of the target pixel is determined according to formula (4): predMatrixTmp[x][y]=((predIBC[x][y]×5+predPlane[x][y]×3+4)>>3) (4)
[0711] In S1230 ′, target prediction information of the target block is determined according to the intra-frame prediction median value of the target pixel, the original prediction information of the target block, and the filter coefficient.
[0712] For example, the target prediction information amount predMatrixTmp[x][y] of the target pixel is determined according to formula (5): predMatrixTmp[x][y]=((predIBC[x][y]×5+predPlane[x][y]×3+f[x]×f[y])>>3) (5)
[0713] Wherein, predIBC[x][y] indicates the original prediction information of the target pixel; the filtering parameters f[x] and f[y] are related to the position information of the target pixel in the target block. Alternatively, the filtering parameters f[x] and f[y] are related to the size information of the target block. Alternatively, the filtering parameters f[x] and f[y] are related to the position information in the target block and the size information of the target block. For example, the filtering parameters can be determined according to Table 48.
[0714] Table 48
[0715] FIG13 is a flow chart of a method P1300 for determining target prediction information according to another embodiment of the present application, which can be used as another specific implementation of S520 and can be recorded as filtering method B.
[0716] In S1310 , according to the position information of the target pixel in the target block, a third reference sample is determined in a left adjacent area of the target block, and a fourth reference sample is determined in an upper adjacent area of the target block.
[0717] Referring to Figure 11, the size information of the target block 110 is M×N, and the position information of the target pixel (any pixel in the target block) in the target block 110 is (x, y), where x is a positive integer not greater than M, y is a positive integer not greater than N, and M and N are positive integers.
[0718] Example of determining reference samples for a target pixel:
[0719] In embodiment 1, reference samples (third reference samples and fourth reference samples) of the target pixel are determined by combining the position information (x, y) of the target pixel and the size information of the target block 110. For example, the third reference sample includes: a first pixel c[N+1] associated with the horizontal size N of the target block 110, and a second pixel c[y+1] associated with the vertical position y of the target pixel; the fourth reference sample includes: a third pixel r[M+1] associated with the vertical size M of the target block, and a fourth pixel r[x+1] associated with the horizontal position x of the target pixel.
[0720] Embodiment 2: Determine a reference sample for a target pixel based on the position information (x, y) of the target pixel. For example, a reference sample may be: a second pixel c[y+1] (third reference sample) associated with the vertical position y of the target pixel, and a fourth pixel r[x+1] (fourth reference sample) associated with the horizontal position x of the target pixel.
[0721] In S1320, target prediction information of the target block is determined according to the third reconstruction information of the third reference sample, the fourth reconstruction information of the fourth reference sample, and the original prediction information of the target block;
[0722] Here, the specific implementation of S1320 is described using the above-mentioned "Example 2" as an example:
[0723] Exemplarily, the target prediction information amount predMatrixTmp[x][y]] of the target pixel is determined according to formula (6).
[0724] predMatrixTmp[x][y]=Clip1((leftPel[y+1]+topPel[x+1]+(64–f[x]–f[y])×predIBC[x][y]+32)>>6) (6)
[0725] In S1320′, target prediction information of the target block is determined based on the third reconstruction information of the third reference sample, the fourth reconstruction information of the fourth reference sample, the original prediction information of the target block, and the filtering parameters.
[0726] Here, the specific implementation of S1320' is described using the above-mentioned "Example 2" as an example:
[0727] For example, the target prediction information amount predMatrixTmp[x][y] of the target pixel is determined according to formula (7). predMatrixTmp[x][y]=Clip1((f[x]×leftPel[y+1]+f[y]×topPel[x+1]+(64–f[x]–f[y])×predIBC[x][y]+32)>>6) (7)
[0728] Wherein, predIBC[x][y] indicates the original prediction information of the target pixel; the filtering parameter f[x]×f[y] is related to the position information of the target pixel in the target block and the size information of the target block. For example, the filtering parameter can be determined according to Table 24.
[0729] In addition to the filtering methods for the prediction value of the target block shown in Figures 12 and 13, other methods can also be used to filter the prediction information of the target block, for example, by building a mathematical model to filter the target quantity prediction information.
[0730] The mathematical model can be a linear model, a polynomial model, a convolution model, etc. For example, the mathematical model can be: f(x) = a×x+b; or, f(x) = a0+a1×x+a2×x^2+…+a n ×x^n; or, f(C,N,S,E,W,B)=c0×C+c1×N+c2×S+c3×E+c4×W+c5×P+c6×B;
[0731] Where C represents the sample at the current position, N, S, E, and W represent the samples of the north, south, east, and west, respectively. The nonlinear term P = (C × C + midVal) >> bitDepth; the bias term B represents the scalar offset between the input and output and is set to the mid-brightness value. a0-a n And c0-c6 are constants, and their specific values can be determined according to actual needs.
[0732] It can be understood that the template parameters can be used to derive model parameters through the templates of the current block and the reference block.
[0733] It is understandable that the different filtering methods shown above can be used in combination. For example, the prediction values derived from different filtering methods can be weighted and combined, which is not limited in the present embodiment.
[0734] In S1430 , reconstruction information of the target block is determined according to the target prediction information.
[0735] Exemplarily, the prediction information of the target block is filtered as shown in S1420 to obtain target prediction information of the target block. Furthermore, the target prediction information is added to the corresponding residual information to obtain the reconstructed information of the target block.
[0736] In the solution provided by the embodiment of the present application, for a target block whose prediction mode is intra-block copy (IBC) prediction, if a reconstructed block is obtained based on the original prediction information of the target block, the reconstructed block may have a discontinuous boundary, and thus there may be poor spatial continuity between the block and its surrounding pixels. In the embodiment of the present application, the target prediction information of the target block is determined based on the reconstruction information of the adjacent areas of the target block and the original prediction information of the target block. Since the reconstruction information of the areas surrounding the block is added to the target prediction information, it is beneficial to a smooth transition between the target block and its surrounding areas, thereby helping to reduce the spatial continuity between the target block and its surrounding areas, thereby improving image quality and improving encoding and decoding performance.
[0737] The above describes in detail an embodiment of the encoding method of the present application in conjunction with Figure 14. The following describes in detail an embodiment of the device of the present application.
[0738] FIG15 is a schematic diagram of the structure of a decoder 1500 provided in an embodiment of the present application. The decoder 1500 includes: a first determination module 1510, a second determination module 1520, and a first determination module 1530;
[0739] Among them, the above-mentioned first determination module 1510 is used to parse the code stream and determine the target block, and the prediction mode of the target block is intra-frame block copy IBC prediction; the above-mentioned second determination module 1520 is used to determine the target prediction information of the target block based on the reconstruction information of the adjacent area of the target block and the original prediction information of the target block; and the above-mentioned third determination module 1530 is used to determine the reconstruction information of the target block based on the target prediction information.
[0740] In an exemplary embodiment, based on the above solution, the second determining module 1520 includes: a determining unit and a filtering unit;
[0741] The above-mentioned determination unit is used to: determine a reference sample in an adjacent area of the target block according to the position information of the target pixel in the target block, and the target pixel is any pixel in the target block; the above-mentioned filtering unit is used to: determine the target prediction information of the target pixel according to the reconstruction information of the reference sample and the original prediction information of the target pixel, and the prediction information of the target block includes the target prediction information of the target pixel.
[0742] In an exemplary embodiment, based on the above scheme, the above-mentioned determination unit is specifically used to: determine a first reference sample in the left adjacent area of the target block according to the position information of the target pixel in the target block, and determine a second reference sample in the upper adjacent area of the target block; the above-mentioned filtering unit is specifically used to: determine the intra-frame prediction intermediate value of the target pixel according to the first reconstruction information of the first reference sample and the second reconstruction information of the second reference sample; and determine the target prediction information of the target pixel according to the intra-frame prediction intermediate value of the target pixel and the original prediction information of the target pixel; or determine the target prediction information of the target pixel according to the intra-frame prediction intermediate value of the target pixel, the original prediction information of the target pixel and the filtering coefficient.
[0743] In an exemplary embodiment, based on the above solution, the size information of the target block is M×N, the position information of the target pixel in the target block is (x, y), where x is a positive integer not greater than M, y is a positive integer not greater than N, and M and N are positive integers;
[0744] The first reference sample includes: a first pixel associated with the horizontal size N of the target block, and a second pixel associated with the vertical position y of the target pixel; the second reference sample includes: a third pixel associated with the vertical size M of the target block, and a fourth pixel associated with the horizontal position x of the target pixel;
[0745] The filtering unit is further specifically used to: determine the intra-frame predicted vertical component of the target pixel based on the reconstruction information of the first pixel, the reconstruction information of the fourth pixel, the horizontal size N of the target block and the vertical position y of the target pixel; determine the intra-frame predicted horizontal component of the target pixel based on the reconstruction information of the second pixel, the reconstruction information of the third pixel, the vertical size M of the target block and the horizontal position x of the target pixel; determine the intra-frame predicted intermediate value of the target pixel based on the intra-frame predicted vertical component and the intra-frame predicted horizontal component.
[0746] In an exemplary embodiment, based on the above scheme, the above-mentioned determination unit is specifically used to: determine a third reference sample in the left adjacent area of the target block according to the position information of the target pixel in the target block, and determine a fourth reference sample in the upper adjacent area of the target block; the above-mentioned filtering unit is specifically used to: determine the target prediction information of the target pixel according to the third reconstruction information of the third reference sample, the fourth reconstruction information of the fourth reference sample, and the original prediction information of the target pixel; or, determine the target prediction information of the target pixel according to the third reconstruction information of the third reference sample, the fourth reconstruction information of the fourth reference sample, the original prediction information of the target pixel and the filtering parameters.
[0747] In an exemplary embodiment, based on the above solution, the filtering parameter is related to at least one of position information of the target pixel in the target block and size information of the target block.
[0748] In an exemplary embodiment, based on the above solution, the first determining module 1510 is specifically configured to: parse a bitstream to obtain a first IBC flag of a first-level syntax structure, the first IBC flag being used to indicate whether encoding information of the first-level syntax structure of the bitstream adopts the IBC mode, or whether the intra block copy prediction filter (IBCPF) mode is supported when the IBC mode is adopted; if the first IBC flag indicates that the encoding information of the first-level syntax structure does not adopt the IBC mode, or if the first IBC flag indicates that the encoding information of the first-level syntax structure adopts the IBC mode and does not support the IBCPF mode, determine that the encoding information of the first-level syntax structure does not include the target block; if the first IBC flag indicates that the encoding information of the first-level syntax structure adopts the IBC mode and supports the IBCPF mode, determine whether the first-level syntax structure is block-level; if the first-level syntax structure is block-level, determine a current block as the target block; if the first-level syntax structure is not block-level, parse the bitstream to obtain a flag of a next-level syntax structure, and determine the target block based on the flag of the next-level syntax structure.
[0749] In an exemplary embodiment, based on the above solution, the first determining module 1510 is specifically configured to: parse the bitstream to obtain a first IBC flag of the first-level syntax structure, where the first IBC flag is used to indicate whether the encoding information of the first-level syntax structure in the bitstream adopts the IBC mode; if the first IBC flag indicates that the encoding information of the first-level syntax structure does not adopt the IBC mode, determine that the encoding information of the first-level syntax structure does not include the target block; and if the first IBC flag indicates that the encoding information of the first-level syntax structure adopts the IBC mode, parse the bitstream to obtain a second IBC flag of the first-level syntax structure, where the second IBC flag is used to indicate whether the encoding information of the first-level syntax structure in the bitstream adopts the IBC mode. determining whether the encoding information of the first-level syntax structure supports the intra block copy prediction filtering IBCPF mode; when the second IBC flag indicates that the encoding information of the first-level syntax structure does not support the IBCPF mode, determining that the encoding information of the first-level syntax structure does not include the target block; when the second IBC flag indicates that the encoding information of the first-level syntax structure supports the IBCPF mode, determining whether the first-level syntax structure is block-level; when the first-level syntax structure is block-level, determining the current block as the target block; when the first-level syntax structure is not block-level, parsing the code stream to obtain the flag of the next-level syntax structure, so as to determine the target block according to the flag of the next-level syntax structure.
[0750] In an exemplary embodiment, based on the above solution, the first determining module 1510 is further specifically configured to: if the first-level syntax structure is not block-level, parse the bitstream to obtain a third IBC flag of the second-level syntax structure, the third IBC flag being used to indicate whether the coding information of the second-level syntax structure in the bitstream adopts the IBC mode, or whether the IBCPF mode is supported if the IBC mode is adopted; if the third IBC flag indicates that the coding information of the second-level syntax structure does not adopt the IBC mode, or if the third IBC flag indicates that the coding information of the second-level syntax structure adopts the IBC mode and does not support the IBCPF mode, determine that the coding information of the second-level syntax structure does not include the target block; if the third IBC flag indicates that the coding information of the second-level syntax structure adopts the IBC mode and supports the IBCPF mode, determine whether the second-level syntax structure is block-level; if the second-level syntax structure is block-level, determine the current block as the target block; if the second-level syntax structure is not block-level, parse the bitstream to obtain a flag of a next-level syntax structure, and determine the target block based on the flag of the next-level syntax structure.
[0751] In an exemplary embodiment, based on the above solution, the first determining module 1510 is further specifically configured to: if the first-level syntax structure is not block-level, parse the bitstream to obtain a third IBC flag of the second-level syntax structure, the third IBC flag being used to indicate whether the coding information of the second-level syntax structure in the bitstream adopts the IBC mode; if the third IBC flag indicates that the coding information of the second-level syntax structure adopts the IBC mode, parse the bitstream to obtain a fourth IBC flag of the second-level syntax structure, the fourth IBC flag being used to indicate whether the coding information of the second-level syntax structure supports the IBCPF mode; if the fourth IBC flag indicates that the coding information of the second-level syntax structure does not support the IBCPF mode, determine that the coding information of the second-level syntax structure does not include the target block; if the fourth IBC flag indicates that the coding information of the second-level syntax structure supports the IBCPF mode, determine whether the second-level syntax structure is block-level; if the second-level syntax structure is block-level, determine the current block as the target block; if the second-level syntax structure is block-level, parse the bitstream to obtain a flag of a next-level syntax structure, and determine the target block based on the flag of the next-level syntax structure.
[0752] In an exemplary embodiment, based on the above solution, the first determination module 1510 is further specifically configured to: if the first-level syntax structure is not block-level, parse the bitstream to obtain a fourth IBC flag of the second-level syntax structure, where the fourth IBC flag is used to indicate whether the encoding information of the second-level syntax structure supports the IBCPF mode; if the fourth IBC flag indicates that the encoding information of the second-level syntax structure does not support the IBCPF mode, determine that the encoding information of the second-level syntax structure does not include the target block; if the fourth IBC flag indicates that the encoding information of the second-level syntax structure supports the IBCPF mode, determine whether the second-level syntax structure is block-level; if the second-level syntax structure is block-level, determine the current block as the target block; and if the second-level syntax structure is not block-level, parse the bitstream to obtain a flag of a next-level syntax structure, and determine the target block based on the flag of the next-level syntax structure.
[0753] In an exemplary embodiment, based on the above scheme, the second-level grammatical structure is a frame level, and the first-level grammatical structure is a sequence level; or, the second-level grammatical structure is a slice level, and the first level is a frame level or a sequence level; or, the second-level grammatical structure is a block level, and the first level is a slice level, a frame level, or a sequence level; or, the first-level grammatical structure is a block level.
[0754] In an exemplary embodiment, based on the above scheme, the first determination module 1510 is further specifically used to: parse the code stream to obtain a fifth IBC flag at the block level, where the fifth IBC flag is used to indicate whether the current block supports the IBCPF mode and the different types of supported IBCPF modes; if the fifth IBC flag indicates that the current block does not support the IBCPF mode, determine that the current block is not the target block; if the fifth IBC flag indicates that the current block supports any type of IBCPF mode, determine the current block as the target block.
[0755] In an exemplary embodiment, based on the above solution, the first determining module 1510 is further specifically configured to: parse the bitstream to obtain target information, and determine whether the current block supports the IBCPF mode according to the target information; if it is determined that the current block supports the IBCPF mode, determine the current block as the target block;
[0756] The target information includes one or more of the following information:
[0757] The type of the image where the current block is located;
[0758] The color component of the current block;
[0759] The size of the current block;
[0760] the current block vector resolution;
[0761] the current block vector residual;
[0762] the current block vector index;
[0763] The IBC tool corresponding to the IBC prediction mode of the current block.
[0764] It should be understood that the decoder embodiment and the decoding method embodiment may correspond to each other, and similar descriptions can refer to the method embodiment. To avoid repetition, they are not described here in detail. Specifically, the decoder shown in Figure 15 can perform the above-mentioned decoding method embodiment, and the aforementioned and other operations and / or functions of each module in the decoder are respectively for implementing the decoding method embodiment. For the sake of brevity, they are not described here in detail.
[0765] FIG16 is a schematic diagram of the structure of an encoder 1600 provided in an embodiment of the present application. The encoder 1600 includes: a first determination module 1610, a second determination module 1620, and a third determination module 1630;
[0766] Among them, the above-mentioned first determination module 1610 is used to: determine the target block, the prediction mode of the target block is intra-frame block copy IBC prediction; the above-mentioned second determination module 1620 is used to: determine the target prediction information of the target block based on the reconstruction information of the adjacent area of the target block and the original prediction information of the target block; the above-mentioned third determination module 1630 is used to: determine the reconstruction information of the target block based on the target prediction information.
[0767] In an exemplary embodiment, based on the above solution, the second determining module 1620 includes: a determining unit and a filtering unit;
[0768] The above-mentioned determination unit is used to: determine a reference sample in an adjacent area of the target block according to the position information of the target pixel in the target block, and the target pixel is any pixel in the target block; the above-mentioned filtering unit is used to: determine the target prediction information of the target pixel according to the reconstruction information of the reference sample and the original prediction information of the target pixel, and the prediction information of the target block includes the target prediction information of the target pixel.
[0769] In an exemplary embodiment, based on the above scheme, the above-mentioned determination unit is specifically used to: determine a first reference sample in the left adjacent area of the target block according to the position information of the target pixel in the target block, and determine a second reference sample in the upper adjacent area of the target block; the above-mentioned filtering unit is specifically used to: determine the intra-frame prediction intermediate value of the target pixel according to the first reconstruction information of the first reference sample and the second reconstruction information of the second reference sample; and determine the target prediction information of the target pixel according to the intra-frame prediction intermediate value of the target pixel and the original prediction information of the target pixel; or, determine the target prediction information of the target pixel according to the intra-frame prediction intermediate value of the target pixel, the original prediction information of the target pixel and the filtering coefficient.
[0770] In an exemplary embodiment, based on the above solution, the size information of the target block is M×N, and the position information of the target pixel in the target block is (x, y), where x is a positive integer not greater than M, and y is a positive integer not greater than N;
[0771] The first reference sample includes: a first pixel associated with the horizontal size N of the target block, and a second pixel associated with the vertical position y of the target pixel; the second reference sample includes: a third pixel associated with the vertical size M of the target block, and a fourth pixel associated with the horizontal position x of the target pixel;
[0772] The filtering unit is further specifically used to: determine the intra-frame predicted vertical component of the target pixel based on the reconstruction information of the first pixel, the reconstruction information of the fourth pixel, the horizontal size N of the target block and the vertical position y of the target pixel; determine the intra-frame predicted horizontal component of the target pixel based on the reconstruction information of the second pixel, the reconstruction information of the third pixel, the vertical size M of the target block and the horizontal position x of the target pixel; and determine the intra-frame predicted intermediate value of the target pixel based on the intra-frame predicted vertical component and the intra-frame predicted horizontal component.
[0773] In an exemplary embodiment, based on the above scheme, the determination unit is specifically used to: determine a third reference sample in the left adjacent area of the target block according to the position information of the target pixel in the target block, and determine a fourth reference sample in the upper adjacent area of the target block; the above filtering unit is specifically used to: determine the target prediction information of the target pixel according to the third reconstruction information of the third reference sample, the fourth reconstruction information of the fourth reference sample, and the original prediction information of the target pixel; or, determine the target prediction information of the target pixel according to the third reconstruction information of the third reference sample, the fourth reconstruction information of the fourth reference sample, the original prediction information of the target pixel and the filtering parameters.
[0774] In an exemplary embodiment, based on the above solution, the filtering parameter is related to at least one of position information of the target pixel in the target block and size information of the target block.
[0775] In an exemplary embodiment, based on the above scheme, the encoder further includes: a writing module; the writing module is used to write a first IBC flag of the first-level syntax structure into the bitstream, where the first IBC flag is used to indicate whether the encoding information of the first-level syntax structure adopts the IBC mode, or to indicate whether the intra-frame block copy prediction filtering IBCPF mode is supported when the IBC mode is adopted.
[0776] In an exemplary embodiment, based on the above scheme, the encoder further includes: a writing module; the writing module is used to write a first IBC flag and a second IBC flag of the first-level syntax structure into the bitstream, wherein the first IBC flag is used to indicate whether the encoding information of the first-level syntax structure adopts the IBC mode, and the second IBC flag is used to indicate whether the encoding information of the first-level syntax structure supports the intra-frame block copy prediction filtering IBCPF mode.
[0777] In an exemplary embodiment, based on the above scheme, the encoder further includes: a writing module; the writing module is used to write a third IBC flag of the second-level syntax structure into the bitstream, where the third IBC flag is used to indicate whether the encoding information of the second-level syntax structure adopts the IBC mode, or to indicate whether the IBCPF mode is supported when the IBC mode is adopted.
[0778] In an exemplary embodiment, based on the above solution, the encoder further includes a writing module; the writing module is configured to write a third IBC flag and a fourth IBC flag of the second-level syntax structure into a bitstream, wherein the third IBC flag is configured to indicate whether the encoding information of the second-level syntax structure adopts the IBC mode, and the fourth IBC flag is configured to indicate whether the encoding information of the second-level syntax structure supports the IBCPF mode.
[0779] In an exemplary embodiment, based on the above scheme, the encoder further includes: a writing module; the writing module is used to write a fourth IBC flag of the second-level syntax structure into the bitstream, where the fourth IBC flag is used to indicate whether the encoding information of the second-level syntax structure supports the IBCPF mode.
[0780] In an exemplary embodiment, based on the above scheme, the second-level grammatical structure is a frame level, and the first-level grammatical structure is a sequence level; or, the second-level grammatical structure is a slice level, and the first level is a frame level or a sequence level; or, the second-level grammatical structure is a block level, and the first level is a slice level, a frame level, or a sequence level; or, the first-level grammatical structure is a block level.
[0781] In an exemplary embodiment, based on the above scheme, the encoder further includes: a writing module; the writing module is used to write the fifth IBC flag at the block level into the code stream, wherein the fifth IBC flag is used to indicate whether the current block supports the IBCPF mode, and the different types of supported IBCPF modes.
[0782] In an exemplary embodiment, based on the above solution, the encoder further includes a writing module; the writing module is configured to write target information into a bitstream, the target information being used to determine whether the current block supports the IBCPF mode; wherein the target information includes one or more of the following information:
[0783] The type of the image where the current block is located;
[0784] The color component of the current block;
[0785] The size of the current block;
[0786] the current block vector resolution;
[0787] the current block vector residual;
[0788] the current block vector index;
[0789] The IBC tool corresponding to the IBC prediction mode of the current block.
[0790] It should be understood that the encoder embodiment and the encoding method embodiment can correspond to each other, and similar descriptions can refer to the method embodiment. To avoid repetition, they are not described here. Specifically, the encoder shown in Figure 16 can execute the above-mentioned encoding method embodiment, and the aforementioned and other operations and / or functions of each module in the encoder are respectively for implementing the encoding method embodiment, and for the sake of brevity, they are not described here.
[0791] FIG17 is a schematic diagram of the structure of a coding and decoding system 1700 provided in an embodiment of the present application. As shown in FIG17 , the coding and decoding system 1700 may include an encoder 1600 and a decoder 1500 .
[0792] In the embodiment of the present application, the encoder 1600 may be the encoder described in any one of the aforementioned embodiments, and the decoder 1500 may be the decoder described in any one of the aforementioned embodiments.
[0793] The apparatus of the embodiment of the present application is described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, or can be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in conjunction with its hardware.
[0794] FIG18 is a schematic structural diagram of an electronic device 1800 provided in an embodiment of the present application. The electronic device of FIG18 can be used to execute the above-mentioned decoding method, and can also be used to execute the above-mentioned encoding method.
[0795] As shown in FIG18 , the electronic device 1800 may include:
[0796] The memory 1810 and the processor 1820 are configured to store a computer program 1830 and transmit the program code 1830 to the processor 1820. In other words, the processor 1820 can call and execute the computer program 1830 from the memory 1810 to implement the method in the embodiment of the present application.
[0797] For example, the processor 1820 may be configured to execute the steps in the above method according to the instructions in the computer program 1830 .
[0798] In some embodiments of the present application, the processor 1820 may include but is not limited to:
[0799] General-purpose processor, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
[0800] In some embodiments of the present application, the memory 1810 includes but is not limited to:
[0801] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0802] In some embodiments of the present application, the computer program 1830 may be divided into one or more modules, which are stored in the memory 1810 and executed by the processor 1820 to implement the decoding method or encoding method of the present application. The one or more modules may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 1830 in the electronic device.
[0803] As shown in FIG18 , the electronic device 30 may further include:
[0804] The transceiver 1840 may be connected to the processor 1820 or the memory 1810 .
[0805] The processor 1820 may control the transceiver 1840 to communicate with other devices. Specifically, it may send information or data to other devices or receive information or data sent by other devices. The transceiver 1840 may include a transmitter and a receiver. The transceiver 1840 may further include an antenna, which may be one or more.
[0806] It should be understood that the various components in the electronic device 30 are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0807] According to one aspect of the present application, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a computer, the computer is enabled to perform the method of the above-mentioned method embodiment. Alternatively, the present application also provides a computer program product containing instructions. When the computer is executed by the instructions, the computer is enabled to perform the method of the above-mentioned method embodiment.
[0808] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method of the above-described method embodiment.
[0809] In other words, when implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0810] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0811] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0812] Modules described as separate components may or may not be physically separate, and components displayed as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected based on actual needs to achieve the purpose of the present embodiment. For example, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module.
[0813] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A video decoding method, characterized in that: Applied to a processor, the method comprises: Parse the bitstream and determine the target block, wherein the prediction mode of the target block is intra block copy (IBC) prediction; Determining target prediction information of the target block according to reconstruction information of an adjacent area of the target block and original prediction information of the target block; Reconstruction information of the target block is determined according to the target prediction information.
2. The method according to claim 1, characterized in that The step of determining target prediction information of the target block according to reconstruction information of an adjacent area of the target block and original prediction information of the target block comprises: Determine a reference sample in an adjacent area of the target block according to position information of a target pixel in the target block, the target pixel being any pixel in the target block; According to the reconstruction information of the reference sample and the original prediction information of the target pixel, the target prediction information of the target pixel is determined, and the prediction information of the target block includes the target prediction information of the target pixel.
3. The method according to claim 2, characterized in that The step of determining a reference sample in an adjacent area of the target block according to position information of the target pixel in the target block comprises: According to the position information of the target pixel in the target block, a first reference sample is determined in a left adjacent area of the target block, and a second reference sample is determined in an upper adjacent area of the target block; The step of determining the target prediction information of the target pixel according to the reconstruction information of the reference sample and the original prediction information of the target pixel includes: Determining an intra-frame prediction intermediate value of the target pixel according to first reconstruction information of the first reference sample and second reconstruction information of the second reference sample; The target prediction information of the target pixel is determined according to the intra-frame prediction intermediate value of the target pixel and the original prediction information of the target pixel; or the target prediction information of the target pixel is determined according to the intra-frame prediction intermediate value of the target pixel, the original prediction information of the target pixel and the filter coefficient.
4. The method according to claim 3, characterized in that The size information of the target block is M×N, the position information of the target pixel in the target block is (x, y), x is a positive integer not greater than M, y is a positive integer not greater than N, and M and N are positive integers; The first reference sample includes: a first pixel associated with a horizontal size N of the target block, and a second pixel associated with a vertical position y of the target pixel; The second reference sample includes: a third pixel associated with the vertical size M of the target block, and a fourth pixel associated with the horizontal position x of the target pixel; The determining, according to the first reconstruction information of the first reference sample and the second reconstruction information of the second reference sample, the intra-frame prediction intermediate value of the target pixel comprises: Determine an intra-frame prediction vertical component of the target pixel according to the reconstruction information of the first pixel, the reconstruction information of the fourth pixel, the horizontal size N of the target block, and the vertical position y of the target pixel; Determine the intra-frame prediction horizontal component of the target pixel according to the reconstruction information of the second pixel, the reconstruction information of the third pixel, the vertical size M of the target block, and the horizontal position x of the target pixel; An intra-prediction intermediate value of the target pixel is determined according to the intra-prediction vertical component and the intra-prediction horizontal component.
5. The method according to claim 2, characterized in that: The step of determining a reference sample in an adjacent area of the target block according to position information of the target pixel in the target block comprises: Determine a third reference sample in a left adjacent area of the target block according to position information of the target pixel in the target block, and determine a fourth reference sample in an upper adjacent area of the target block; The step of determining the target prediction information of the target pixel according to the reconstruction information of the reference sample and the original prediction information of the target pixel includes: Determine the target prediction information of the target pixel according to the third reconstruction information of the third reference sample, the fourth reconstruction information of the fourth reference sample, and the original prediction information of the target pixel; or determine the target prediction information of the target pixel according to the third reconstruction information of the third reference sample, the fourth reconstruction information of the fourth reference sample, the original prediction information of the target pixel and filtering parameters.
6. The method according to claim 3 or 5, characterized in that: The filtering parameter is related to at least one of position information of the target pixel in the target block and size information of the target block.
7. The method according to any one of claims 1 to 6, characterized in that The parsing of the code stream and determining the target block includes: Parsing the bitstream to obtain a first IBC flag of the first-level syntax structure, where the first IBC flag is used to indicate whether the encoding information of the first-level syntax structure of the bitstream adopts the IBC mode, or is used to indicate whether the intra-block copy prediction filtering IBCPF mode is supported when the IBC mode is adopted; When the first IBC flag indicates that the encoding information of the first-level syntax structure does not adopt the IBC mode, or when the first IBC flag indicates that the encoding information of the first-level syntax structure adopts the IBC mode and does not support the IBCPF mode, determining that the encoding information of the first-level syntax structure does not include the target block; When the first IBC flag indicates that the encoding information of the first-level syntax structure adopts the IBC mode and supports the IBCPF mode, determine whether the first-level syntax structure is block-level; when the first-level syntax structure is block-level, determine the current block as the target block; when the first-level syntax structure is not block-level, parse the code stream to obtain the flag of the next-level syntax structure, so as to determine the target block according to the flag of the next-level syntax structure.
8. The method according to any one of claims 1 to 6, characterized in that The parsing of the code stream and determining the target block includes: Parsing the bitstream to obtain a first IBC flag of the first-level syntax structure, where the first IBC flag is used to indicate whether the encoding information of the first-level syntax structure in the bitstream adopts the IBC mode; When the first IBC flag indicates that the encoding information of the first-level syntax structure does not adopt the IBC mode, determining that the encoding information of the first-level syntax structure does not include the target block; When the first IBC flag indicates that the coding information of the first-level syntax structure adopts the IBC mode, parsing the bitstream to obtain a second IBC flag of the first-level syntax structure, wherein the second IBC flag is used to indicate whether the coding information of the first-level syntax structure in the bitstream supports an intra block copy prediction filtering IBCPF mode; When the second IBC flag indicates that the encoding information of the first-level syntax structure does not support the IBCPF mode, determining that the encoding information of the first-level syntax structure does not include the target block; When the second IBC flag indicates that the encoding information of the first-level syntax structure supports the IBCPF mode, determine whether the first-level syntax structure is block-level; when the first-level syntax structure is block-level, determine the current block as the target block; when the first-level syntax structure is not block-level, parse the code stream to obtain the flag of the next-level syntax structure, so as to determine the target block according to the flag of the next-level syntax structure.
9. The method according to claim 7 or 8, characterized in that: The step of parsing the bitstream to obtain a flag of a next-level syntax structure when the first-level syntax structure is not a block-level syntax structure, and determining the target block according to the flag of the next-level syntax structure, comprises: When the first-level syntax structure is not a block level, parsing the code stream to obtain a third IBC flag of the second-level syntax structure, the third IBC flag is used to indicate whether the encoding information of the second-level syntax structure in the code stream adopts the IBC mode, or is used to indicate whether the IBCPF mode is supported when the IBC mode is adopted; When the third IBC flag indicates that the encoding information of the second-level syntax structure does not adopt the IBC mode, or when the third IBC flag indicates that the encoding information of the second-level syntax structure adopts the IBC mode and does not support the IBCPF mode, determining that the encoding information of the second-level syntax structure does not include the target block; When the third IBC flag indicates that the encoding information of the second-level syntax structure adopts the IBC mode and supports the IBCPF mode, determine whether the second-level syntax structure is block-level; when the second-level syntax structure is block-level, determine the current block as the target block; when the second-level syntax structure is not block-level, parse the code stream to obtain the flag of the next-level syntax structure, so as to determine the target block according to the flag of the next-level syntax structure.
10. The method according to claim 7 or 8, characterized in that: The step of parsing the bitstream to obtain a flag of a next-level syntax structure when the first-level syntax structure is not a block-level syntax structure, and determining the target block according to the flag of the next-level syntax structure, comprises: When the first-level syntax structure is not a block-level structure, parsing the code stream to obtain a third IBC flag of the second-level syntax structure, the third IBC flag being used to indicate whether the encoding information of the second-level syntax structure in the code stream adopts the IBC mode; When the third IBC flag indicates that the coding information of the second-level syntax structure adopts the IBC mode, parsing the bitstream to obtain a fourth IBC flag of the second-level syntax structure, where the fourth IBC flag is used to indicate whether the coding information of the second-level syntax structure supports the IBCPF mode; When the fourth IBC flag indicates that the encoding information of the second-level syntax structure does not support the IBCPF mode, determining that the encoding information of the second-level syntax structure does not include the target block; When the fourth IBC flag indicates that the encoding information of the second-level syntax structure supports the IBCPF mode, determine whether the second-level syntax structure is block-level; when the second-level syntax structure is block-level, determine the current block as the target block; when the second-level syntax structure is not block-level, parse the code stream to obtain the flag of the next-level syntax structure, so as to determine the target block according to the flag of the next-level syntax structure.
11. The method according to claim 7 or 8, characterized in that: The step of parsing the bitstream to obtain a flag of a next-level syntax structure when the first-level syntax structure is not a block-level syntax structure, and determining the target block according to the flag of the next-level syntax structure, comprises: When the first-level syntax structure is not a block level, parsing the bitstream to obtain a fourth IBC flag of a second-level syntax structure, the fourth IBC flag being used to indicate whether the encoding information of the second-level syntax structure supports an IBCPF mode; When the fourth IBC flag indicates that the encoding information of the second-level syntax structure does not support the IBCPF mode, determining that the encoding information of the second-level syntax structure does not include the target block; When the fourth IBC flag indicates that the encoding information of the second-level syntax structure supports the IBCPF mode, determine whether the second-level syntax structure is block-level; when the second-level syntax structure is block-level, determine the current block as the target block; when the second-level syntax structure is not block-level, parse the code stream to obtain the flag of the next-level syntax structure, so as to determine the target block according to the flag of the next-level syntax structure.
12. The method according to claim 9 or 10, characterized in that: The second-level syntax structure is a frame level, and the first-level syntax structure is a sequence level; or, The second level syntax structure is slice level, and the first level is frame level or sequence level; or, The second level syntax structure is block level, and the first level is slice level, frame level, or sequence level; or, The first-level syntax structure is block-level.
13. The method according to any one of claims 1 to 6, characterized in that The parsing of the code stream to obtain the target block includes: Parse the code stream to obtain a fifth IBC flag at the block level, where the fifth IBC flag is used to indicate whether the current block supports the IBCPF mode and different types of supported IBCPF modes; In a case where the fifth IBC flag indicates that the current block does not support the IBCPF mode, determining that the current block is not the target block; In a case where the fifth IBC flag indicates that the current block supports any type of IBCPF mode, the current block is determined as the target block.
14. The method according to any one of claims 1 to 6, characterized in that The parsing of the code stream to obtain the target block includes: Parse the code stream to obtain target information, and determine whether the current block supports the IBCPF mode based on the target information; In a case where it is determined that the current block supports the IBCPF mode, determining the current block as the target block; The target information includes one or more of the following information: The type of the image where the current block is located; The color component of the current block; The size of the current block; the current block vector resolution; The current block vector residual; The current block vector index; The IBC tool corresponding to the IBC prediction mode of the current block.
15. A video encoding method, characterized in that: Applied to a processor, the method comprises: Determine a target block, wherein a prediction mode of the target block is an intra block copy (IBC) prediction; Determining target prediction information of the target block according to reconstruction information of an adjacent area of the target block and original prediction information of the target block; Reconstruction information of the target block is determined according to the target prediction information.
16. A decoder, characterized in that: include: A first determination module is used to parse the bitstream and determine a target block, wherein the prediction mode of the target block is an intra block copy (IBC) prediction; A second determination module, configured to determine target prediction information of the target block according to reconstruction information of an adjacent area of the target block and original prediction information of the target block; The third determination module is used to determine the reconstruction information of the target block according to the target prediction information.
17. An encoder, characterized in that: include: A first determination module is used to determine a target block, wherein the prediction mode of the target block is intra block copy (IBC) prediction; A second determination module, configured to determine target prediction information of the target block according to reconstruction information of an adjacent area of the target block and original prediction information of the target block; The third determination module is used to determine the reconstruction information of the target block according to the target prediction information.
18. An electronic device comprising a processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer program to implement the video decoding method as described in any one of claims 1 to 14 above, or to implement the video encoding method as described in claim 15 above.
19. A computer-readable storage medium, characterized in that: For storing computer programs; The computer program enables a computer to execute the video decoding method as described in any one of claims 1 to 14, The video encoding method as claimed in claim 15.
20. A method for processing a code stream, characterized in that: A video code stream is stored on a non-transitory computer-readable medium, wherein the video code stream is decoded based on the video decoding method according to any one of claims 1 to 14, or generated according to the video encoding method according to claim 15.
Citation Information
Patent Citations
Chroma deblock filters for intra picture block compensation
CN113170208A
Method and apparatus for neighboring block availability in video coding
CN113396590A
Video encoding / decoding method and apparatus, and recording medium storing bitstream
CN113841404A
Video coding and decoding method and device, computer readable medium and electronic equipment
CN116805969A
Method and device for effective video encoding / decoding via local lighting compensation
US20210289201A1