WO2016015198A1 - 一种视频编、解码方法和装置 - Google Patents

一种视频编、解码方法和装置 Download PDF

Info

Publication number
WO2016015198A1
WO2016015198A1 PCT/CN2014/083137 CN2014083137W WO2016015198A1 WO 2016015198 A1 WO2016015198 A1 WO 2016015198A1 CN 2014083137 W CN2014083137 W CN 2014083137W WO 2016015198 A1 WO2016015198 A1 WO 2016015198A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
boundary
current image
adjacent
image block
Prior art date
Application number
PCT/CN2014/083137
Other languages
English (en)
French (fr)
Inventor
李旭峰
王荣刚
王振宇
董胜富
王文敏
黄铁军
高文
Original Assignee
北京大学深圳研究生院
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京大学深圳研究生院 filed Critical 北京大学深圳研究生院
Priority to PCT/CN2014/083137 priority Critical patent/WO2016015198A1/zh
Publication of WO2016015198A1 publication Critical patent/WO2016015198A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/86Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving reduction of coding artifacts, e.g. of blockiness

Definitions

  • Video coding and decoding method and device
  • the present application relates to the field of video coding and decoding, and in particular, to a video encoding and decoding method and apparatus.
  • the quantization process of transform coefficients is relatively coarse, and the transform coefficients recovered by the inverse quantization process have errors, thereby The visual discontinuity on the boundary of the image block.
  • the motion compensation block may be copied from the interpolated sample data at different positions of different frames. Therefore, the matching of the motion compensation block may not be absolutely accurate, so A discontinuity in the data is produced on the boundary of the copy block.
  • the present application provides a video encoding and decoding method and apparatus to improve blockiness in video codec.
  • the present application further provides a video encoding method, including: acquiring a reconstructed block of a current image block;
  • the filtering conditions include:
  • the difference between the reconstructed block boundary of the current image block and the adjacent two pixel points on the boundary of the adjacent decoded block is greater than the difference between two adjacent pixels on the reconstructed block boundary of the current image block, and/or the current image
  • the difference between the reconstructed block boundary of the block and the adjacent two pixel points on the boundary of the adjacent decoding block is greater than the difference between the adjacent two pixel points on the boundary of the adjacent decoding block of the current image block;
  • the present application further provides a video encoding apparatus, including: a reconstruction unit, configured to acquire a reconstructed block of a current image block;
  • a threshold value obtaining unit configured to acquire a coded quantization parameter of a current image block, and obtain a first threshold value and a second threshold value in the filter condition according to the quantization parameter;
  • a determining unit configured to determine whether a reconstructed block boundary of the current image block and a boundary of the adjacent decoded block satisfy a filtering condition; the filtering condition includes:
  • the difference between the reconstructed block boundary of the current image block and the adjacent two pixel points on the boundary of the adjacent decoded block is greater than the difference between two adjacent pixels on the reconstructed block boundary of the current image block, and/or the current image
  • the difference between the reconstructed block boundary of the block and the adjacent two pixel points on the boundary of the adjacent decoding block is greater than the difference between the adjacent two pixel points on the boundary of the adjacent decoding block of the current image block;
  • a filtering unit configured to: when the determining unit determines that the reconstructed block boundary of the current image block satisfies the filtering condition, filtering the reconstructed block boundary of the current image block and the boundary of the adjacent decoding block, and reconstructing the filtered current image block
  • the block is used as a decoding block of the current image block; when the determining unit determines that the reconstructed block boundary of the current image block does not satisfy the filtering condition, the reconstruction boundary of the current image block and the boundary of the adjacent decoding block are not filtered, and the current image block is Rebuilding the block as its decoded block;
  • the present application further provides a video decoding method, including: acquiring an encoded code stream of a current image block, processing the encoded code stream to obtain a residual value, and from the encoded code stream Extracting the first threshold and the second threshold;
  • the filtering conditions include:
  • the present application further provides a video decoding apparatus, including: a decoding unit, configured to acquire an encoded code stream of a current image block, process the encoded code stream to obtain a residual value, and Extracting a first threshold and a second threshold in the encoded code stream;
  • a prediction unit configured to obtain a prediction block of the current image block according to the adjacent decoding block of the current image block
  • a reconstruction unit configured to add the prediction block and the residual value to obtain a reconstructed block of the current image block
  • a determining unit configured to determine whether a reconstructed block boundary of the current image block and a boundary of the adjacent decoded block satisfy a filtering condition
  • the filtering conditions include:
  • the difference between the reconstructed block boundary of the current image block and the adjacent two pixel points on the boundary of the adjacent decoded block is greater than the difference between two adjacent pixels on the reconstructed block boundary of the current image block, and/or the current image
  • the difference between the reconstructed block boundary of the block and the adjacent two pixel points on the boundary of the adjacent decoding block is greater than the difference between the adjacent two pixel points on the boundary of the adjacent decoding block of the current image block;
  • a filtering unit configured to: when the determining unit determines that the reconstructed block boundary of the current image block satisfies the filtering condition, filtering the reconstructed block boundary of the current image block and the boundary of the adjacent decoding block, and reconstructing the filtered current image block
  • the block is used as a decoding block of the current image block; when the determining unit determines that the reconstructed block boundary of the current image block does not satisfy the filtering condition, the reconstruction boundary of the current image block and the boundary of the adjacent decoding block are not filtered, and the current image block is Rebuild the block as its decoded block.
  • the filtering condition by determining whether the reconstructed block boundary of the current image block satisfies the filtering condition, if it is satisfied, filtering the reconstructed block boundary of the current image block; if not, the fault is not correct.
  • the reconstructed block boundary of the current image block is filtered.
  • the first threshold and the second threshold in the filtering condition are obtained according to the encoding quantization parameter of the current image block, so that the first threshold and the second threshold may be changed according to dynamic changes of the quantization parameter. Therefore, it is possible to accurately determine whether the reconstructed block boundary of the current image block is a real boundary or a pseudo boundary by filtering conditions, and filtering the pseudo boundary to improve the block effect in the video codec.
  • first threshold and the second threshold are programmed into the coded stream to reduce the coding rate.
  • the first threshold and the second threshold are directly extracted from the code stream, and the decoding device is reduced. The amount of calculation increases the decoding efficiency.
  • FIG. 1 is a schematic diagram of dividing an image frame into macroblocks in a video codec
  • FIG. 2 is a schematic diagram of a frame of a video encoding end in an embodiment of the present application
  • FIG. 3 is a schematic flowchart of video coding in an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a location of a reconstructed block of a current image block and an adjacent decoded block in video coding deblocking filtering according to an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of comparison between pre-filtering and filtering of reconstructed block boundary pixel points of the current image block and its adjacent decoding block boundary pixel points in the horizontal direction;
  • FIG. 7 is a schematic structural diagram of a video encoding apparatus according to an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of video decoding in another embodiment of the present application.
  • FIG. 9 is a schematic diagram of a frame of a video decoding end in another embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a video decoding apparatus according to another embodiment of the present application. detailed description
  • each frame image is divided into macroblocks, each macroblock having a fixed size, starting from the first image block in the upper left, from left to right,
  • Each image block in one frame of image is processed in order from top to bottom.
  • FIG. 1 For example, a frame of 16*16 pixels is divided into 4*4 pixel macroblocks (image blocks), and each macroblock has a size of 4*4 pixels, and the processing order of the images is first.
  • the image block of the first line is processed from left to right, and then the second line is processed in sequence until the entire frame image is processed.
  • each image block is also separately filtered.
  • the present invention provides a video encoding and decoding method and apparatus, and the inventive concept thereof is: determining whether a reconstructed block boundary of a current image block and a boundary of a neighboring decoding block satisfy a filtering condition, and if satisfied, a reconstructed block of the current image block
  • the boundary and its adjacent decoding block boundaries are filtered; if not, the reconstructed block boundary of the current image block and its adjacent decoding block boundaries are not filtered.
  • the first threshold and the second threshold in the filtering condition are obtained according to the encoding quantization parameter of the current image block, so that the first threshold and the second threshold may be changed according to the dynamic change of the quantization parameter.
  • the first threshold and the second threshold are programmed into the coded stream to reduce the coding rate.
  • the first threshold and the second threshold are directly extracted from the code stream, and the decoding device is reduced. The amount of calculation increases the decoding efficiency.
  • Figure 2 Please refer to Figure 2 for a schematic diagram of the video encoding end.
  • the encoded code stream of the current image block is obtained by entropy coding.
  • the encoder continues to encode the next image block (referred to as the coded block in this application).
  • the coded block When encoding the coding block, the coding end often needs to decode and reconstruct the transformed/quantized residual value of the current image block to obtain a reconstructed block of the current image block, and the reconstructed block of the current image block is used to obtain the coding by processing.
  • the prediction block of the block The coded block is deviated from its prediction block to obtain a residual value, and the residual value is transformed/quantized and entropy encoded to obtain an encoded code stream of the coded block, and the coding block is coded.
  • the filtering refers to deblocking filtering, and the deblocking filtering is used to smooth the boundary of the decoding block to improve the quality of the decoding block.
  • the filtered decoded block is used for motion compensated prediction of future frames, which can improve the compression performance of the code, because the filtered decoded block is closer to the original image block than an unfiltered decoded block with block effect, thus, The residual value will be smaller.
  • this embodiment provides a video encoding method, including the following steps: Step 101: Obtain a reconstructed block of the current image block.
  • the current image block is an already-encoded image block.
  • the encoded current image block needs to be decoded and reconstructed, that is, a reconstructed block of the current image block is obtained, and the reconstructed block is used to obtain the predicted block of the encoded block.
  • the coding block is the next image block to be encoded in the current image block according to the coding order of the image blocks in the image frame.
  • Step 102 Acquire a coded quantization parameter QP of the current image block, and obtain a first threshold and a second threshold in the filter condition according to the quantization parameter.
  • the quantization parameter and the first threshold and the second threshold may correspond in the form of a correspondence table.
  • Table 1 the correspondence table that maintains the correspondence between the quantization parameter and the first threshold and the second threshold is saved in In the configuration file, after obtaining the encoding quantization parameter of the current image block, the corresponding table is queried to obtain the corresponding first threshold and the second threshold.
  • the first threshold and the second threshold change according to the dynamic change of the quantization parameter, and the real boundary and the pseudo boundary can be more effectively judged, thereby improving the block effect problem and enhancing the subjective quality of the image.
  • Step 103 Determine whether the boundary of the reconstructed block of the current image block and the boundary of the adjacent decoded block are The filtering conditions are met.
  • the adjacent decoded block of the current image block refers to a decoded block of the image block adjacent to the current image block.
  • the adjacent decoding blocks of the current image block are the decoding blocks on the left and upper sides of the current image block.
  • FIG. 4 ( a ) is the position of the reconstructed block of the current image block (including pixel points p0, pl, p2 ) and its adjacent decoded block (including pixel points q0, ql, q2 ) in the horizontal direction.
  • FIG. 4(b) is a schematic diagram showing the positions of reconstructed blocks (including pixel points p0, pl, p2) of the current image block and their adjacent decoded blocks (including pixel points q0, ql, q2) in the vertical direction.
  • the filtering condition may include: the difference between the reconstructed block boundary of the current image block and the adjacent two pixel points ⁇ and qO on the boundary of the adjacent decoded block is smaller than the first threshold ⁇ .
  • the filtering condition further includes: a difference between adjacent two pixel points ⁇ and pi on the reconstructed block boundary of the current image block Less than the second threshold ⁇ , and/or the difference between adjacent two pixel points qO and ql on the boundary of the adjacent decoding block of the current image block is less than the second threshold ⁇ .
  • the reconstructed block boundary of the current image block and the difference between two adjacent pixel points ⁇ and qO on the boundary of the adjacent decoding block are greater than the difference between the adjacent two pixel points ⁇ and pi on the reconstructed block boundary of the current image block
  • the reconstructed block boundary of the current image block and the difference between adjacent two pixel points ⁇ and qO on the boundary of the adjacent decoded block are greater than the adjacent two pixel points qO and ql on the boundary of the adjacent decoded block of the current image block.
  • the filtering condition further includes: the difference between the reconstructed block boundary of the current image block and the adjacent two pixel points ⁇ and qO on the boundary of the adjacent decoded block is greater than the current image
  • the difference between two adjacent pixel points ⁇ and pi on the reconstructed block boundary of the block, and/or the difference between the reconstructed block boundary of the current image block and the adjacent two pixel points ⁇ and qO on the boundary of the adjacent decoded block is greater than the current The difference between adjacent two pixel points qO and ql on the boundary of the adjacent decoded block of the image block.
  • Step 104 In step 103, if it is determined that the reconstructed block boundary of the current image block is The neighboring decoding block boundary satisfies the filtering condition, and then the reconstructed block boundary of the current image block and its adjacent decoding block boundary are filtered.
  • p0 and q0 are the pixel values of the reconstructed block boundary pixel of the current image block and the boundary pixel of the adjacent decoding block, respectively, and P0 and Q0 are respectively reconstructed block boundary pixel points of the current image block and their adjacent decoding block boundaries.
  • the pixel value after pixel filtering, k is a preset parameter. Specifically, the value of k can be taken as 4. It should be understood that only one feasible filtering formula is provided in the embodiment. In other embodiments, the person skilled in the art can change the filtering formula according to actual needs, for example, changing the value of k.
  • the left and upper boundaries of the current image block may be filtered when encoding the current image block, and the right boundary of the current image block is When the current image block is filtered by the right adjacent image block, the lower boundary of the current image block is filtered when the adjacent image block is encoded under the current image block. Therefore, a buffer area is usually set at the encoding end to ensure that the four boundaries of the decoding block of each image block are filtered and used as reference blocks for other image blocks.
  • the two sides of the dotted line are respectively a schematic diagram of the reconstructed block boundary pixel points p0 and pi of the current image block in the horizontal direction and the adjacent decoded block boundary pixel points q0 and q1 , and the original pixel points ⁇ and q0 are due to the block effect.
  • the values of the two have a large difference.
  • the filtered values of the original pixel points ⁇ and q0 are P0 and Q0, respectively.
  • the values of P0 and Q0 are small.
  • the effect on the image is that the boundary transition of the two image blocks is more gradual, that is, the blockiness of the image is improved.
  • the image block may be a macroblock that is divided when the image frame is encoded, or may be a sub-macroblock that continues to be divided under the macroblock.
  • the image frame is divided into a number of 16*16 macroblocks, and when deblocking filtering is performed, the used image block is an 8*8 sub-macroblock that continues to be divided under the 16*16 macroblock.
  • Figure 6 shows the filtering order for the image block boundaries when performing block filtering.
  • Figure 6 (a) is the filtering of the luma block
  • Figure 6 (b) is the filtering of the chroma block, which is filtered from 1 to 6.
  • Step 105 If it is determined that the reconstructed block boundary of the current image block and its adjacent decoding block boundary satisfy the filtering condition, the reconstructed block of the filtered current image block is used as the decoding block of the current image block; if it is determined that the current image block is reconstructed If the block boundary and its adjacent decoding block boundary do not satisfy the filtering condition, the reconstructed block of the current image block is directly used as its decoding block.
  • Step 106 Obtain a prediction block of the coding block according to the decoding block of the current image block.
  • a prediction block of a coding block is predicted based on related information of its neighboring decoding blocks, for example, Obtained from the left adjacent decoded block, the upper adjacent decoded block, and/or the upper left adjacent decoded block of the coded block.
  • Step 107 The prediction block is compared with the coding block to obtain a residual value.
  • Step 108 Process the residual value to obtain an encoded code stream of the encoded block.
  • the processing of the residual values may include transform, quantization, entropy coding, and the like.
  • Step 109 The first threshold and the second threshold corresponding to the coding block are coded into the code stream, so that the decoding end can directly obtain the first threshold and the second threshold from the code stream when performing filtering.
  • the first threshold and the second threshold corresponding to the code block can be obtained according to Table 1 above.
  • the embodiment further provides a video coding apparatus, including: a reconstruction unit 201, a determination unit 202, a filtering unit 203, a prediction unit 204, an encoding unit 205, and Threshold acquisition unit 206.
  • the reconstruction unit 201 is configured to acquire a reconstructed block of the current image block.
  • the threshold value obtaining unit 206 is configured to acquire a coded quantization parameter of the current image block, and obtain a first threshold value and a second threshold value in the filter condition according to the quantization parameter.
  • the determining unit 202 is configured to determine whether the reconstructed block boundary of the current image block and its adjacent decoded block boundary satisfy the filtering condition.
  • Filtering conditions include:
  • the difference between the reconstructed block boundary of the current image block and the adjacent two pixels on the boundary of the adjacent decoded block is less than the first threshold.
  • the difference between two adjacent pixels on the boundary of the reconstructed block of the current image block is smaller than the second threshold, and/or the difference between two adjacent pixels on the boundary of the adjacent decoded block of the current image block is smaller than the second Two values.
  • the difference between the reconstructed block boundary of the current image block and the adjacent two pixel points on the boundary of the adjacent decoded block is greater than the difference between two adjacent pixels on the reconstructed block boundary of the current image block, and/or the current image
  • the difference between the reconstructed block boundary of the block and the adjacent two pixels on the boundary of the adjacent decoded block is greater than the difference between two adjacent pixels on the boundary of the adjacent decoded block of the current image block.
  • the filtering unit 203 is configured to: when the determining unit 202 determines that the reconstructed block boundary of the current image block satisfies the filtering condition, filtering the reconstructed block boundary of the current image block and its adjacent decoding block boundary, and filtering the filtered current image block. Reconstructing the block as a decoding block of the current image block; when the determining unit 202 determines that the reconstructed block boundary of the current image block does not satisfy the filtering condition, does not filter the reconstructed boundary of the current image block and its adjacent decoding block boundary, and filters the current image The reconstructed block of the block acts as its decoding block.
  • the prediction unit 204 is configured to obtain a prediction block of the coding block according to the decoding block of the current image block.
  • the coding unit 205 is configured to compare the prediction block with the coding block to obtain a residual value, process the residual value to obtain an encoded code stream, and encode the first threshold and the second threshold into the coded stream.
  • the filtering unit 203 filters the reconstructed block boundary of the current image block and its adjacent decoding block boundary, the following filtering formula is used:
  • video decoding is the inverse of video coding, and the video decoding end has a corresponding relationship with the video coding end.
  • this embodiment provides a video decoding method, which includes the following steps:
  • Step 301 Acquire an encoded code stream of a current image block, where the current image block refers to an image block to be currently decoded.
  • Step 302 Process the encoded code stream to obtain a residual value, and extract a first threshold and a second threshold from the encoded code stream.
  • Processing the encoded code stream may include entropy decoding, inverse quantization, inverse transform, and the like.
  • Step 303 Obtain a prediction block of the current image block according to the adjacent decoding block of the current image block, and add the prediction block and the residual difference to obtain a reconstruction block of the current image block.
  • the prediction block of the current image block is predicted according to the related information of its neighboring decoding blocks. Therefore, in a specific embodiment, the prediction block of the current image block may be obtained not only according to its neighboring decoding block, for example, Obtained from the left adjacent decoded block, the upper adjacent decoded block, and/or the upper left adjacent decoded block of the current image block.
  • the first encoded image block Since the video encoding process is sequentially encoded in units of image blocks, at the decoding end, the first encoded image block will be decoded.
  • the adjacent decoded block of the current image block is the decoding of the left and upper sides of the current image block. Piece.
  • the positional relationship between the reconstructed block of the current image block and its adjacent decoded block can be referred to the first embodiment (FIG. 4).
  • Step 304 Determine whether the reconstructed block boundary of the current image block and the boundary of the adjacent decoded block satisfy the filtering condition.
  • Filtering conditions include:
  • the difference between the reconstructed block boundary of the current image block and the adjacent two pixels on the boundary of the adjacent decoded block is less than the first threshold.
  • the difference between two adjacent pixels on the boundary of the reconstructed block of the current image block is smaller than the second threshold, and/or the difference between two adjacent pixels on the boundary of the adjacent decoded block of the current image block is smaller than the second Two values.
  • the difference between the reconstructed block boundary of the current image block and the adjacent two pixel points on the boundary of the adjacent decoded block is greater than the difference between two adjacent pixels on the reconstructed block boundary of the current image block, and/or the current image
  • the difference between the reconstructed block boundary of the block and the adjacent two pixels on the boundary of the adjacent decoded block is greater than the difference between two adjacent pixels on the boundary of the adjacent decoded block of the current image block.
  • Step 305 In step 304, if it is determined that the reconstructed block boundary of the current image block is The neighboring decoding block boundary satisfies the filtering condition, and then the reconstructed block boundary of the current image block and its adjacent decoding block boundary are filtered.
  • p0 and q0 are the pixel values of the reconstructed block boundary pixel of the current image block and the boundary pixel of the adjacent decoding block, respectively, and P0 and Q0 are respectively reconstructed block boundary pixel points of the current image block and their adjacent decoded block boundaries.
  • the pixel value after pixel filtering, k is a preset parameter. Specifically, the value of k can be taken as 4.
  • Step 306 If it is determined that the reconstructed block boundary of the current image block and its adjacent decoding block boundary satisfy the filtering condition, the reconstructed block of the filtered current image block is used as the decoding block of the current image block; if it is determined that the current image block is reconstructed If the block boundary and its adjacent decoding block boundary do not satisfy the filtering condition, the reconstructed block of the current image block is directly used as its decoding block.
  • the coded code stream carries a first threshold value and a second threshold value corresponding to the current image block, and the first threshold value and the second threshold value in the filter condition are directly extracted from the coded code stream, thereby being The amount of calculation at the small decoding end improves the decoding efficiency.
  • the decoded decoding block is buffered at the encoding end as a reference block of other image blocks, and the decoded image is output after the entire frame image is decoded and filtered.
  • the present embodiment further provides a video decoding apparatus, including a decoding unit 401, a prediction unit 402, a reconstruction unit 403, a determination unit 404, and a filtering unit 405.
  • the decoding unit 401 is configured to obtain an encoded code stream of the current image block, process the encoded code stream to obtain a residual value, and extract the first threshold and the second threshold from the encoded code stream.
  • the prediction unit 402 is configured to obtain a prediction block of the current image block according to the adjacent decoding block of the current image block.
  • the reconstruction unit 403 is for adding the prediction block and the residual value to obtain a reconstructed block of the current image block.
  • the determining unit 404 is configured to determine whether the reconstructed block boundary of the current image block and its adjacent decoded block boundary satisfy the filtering condition.
  • Filtering conditions include:
  • the difference between the reconstructed block boundary of the current image block and the adjacent two pixels on the boundary of the adjacent decoded block is less than the first threshold.
  • the difference between two adjacent pixels on the boundary of the reconstructed block of the current image block is smaller than the second threshold, and/or the difference between two adjacent pixels on the boundary of the adjacent decoded block of the current image block is smaller than the second Two values.
  • the difference between the reconstructed block boundary of the current image block and the adjacent two pixel points on the boundary of the adjacent decoded block is greater than the difference between two adjacent pixels on the reconstructed block boundary of the current image block, and/or the current image
  • the difference between the reconstructed block boundary of the block and the adjacent two pixels on the boundary of the adjacent decoded block is greater than the difference between two adjacent pixels on the boundary of the adjacent decoded block of the current image block.
  • the filtering unit 405 is configured to filter the reconstructed block boundary of the current image block and its adjacent decoding block boundary when the determining unit 404 determines that the reconstructed block boundary of the current image block satisfies the filtering condition, and filters the filtered current image block. Reconstructing the block as a decoding block of the current image block; when the determining unit 404 determines that the reconstructed block boundary of the current image block does not satisfy the filtering condition, does not filter the reconstructed boundary of the current image block and its adjacent decoding block boundary, and filters the current image The reconstructed block of the block acts as its decoding block.
  • the filtering unit 405 filters the reconstructed block boundary of the current image block and its adjacent decoding block boundary, the following filtering formula is used:
  • Pixel filtered pixel value, k is the preset parameter.
  • the filtering condition by determining whether the reconstructed block boundary of the current image block satisfies the filtering condition, if it is satisfied, filtering the reconstructed block boundary of the current image block; if not, the fault is not correct.
  • the reconstructed block boundary of the current image block is filtered.
  • the first threshold and the second threshold in the filtering condition are obtained according to the encoding quantization parameter of the current image block, so that the first threshold and the second threshold may be changed according to dynamic changes of the quantization parameter.
  • the first threshold and the second threshold are programmed into the coded stream to reduce the coding rate.
  • the first threshold and the second threshold are directly extracted from the code stream, and the decoding device is reduced. The amount of calculation increases the decoding efficiency.

Landscapes

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

Abstract

一种视频编、解码方法和装置,通过判断当前图像块的重建块边界是否满足滤波条件,如果满足,则对当前图像块的重建块边界进行滤波;如果不满足,则不对当前图像块的重建块边界进行滤波。其中,滤波条件中的第一阈值和第二阈值根据当前图像块的编码量化参数来获取,使得第一阈值和第二阈值可以根据量化参数的动态变化而变化。因此,能够通过滤波条件准确判断出当前图像块的重建块边界为真实边界还是伪边界,对伪边界进行滤波,从而改善视频编解码中的块效应。另外,将第一阈值和第二阈值编入编码码流中,降低编码码率,在解码装置中,直接从码流中提取该第一阈值和第二阈值,降低了解码装置的运算量,提高解码效率。

Description

一种视频编、 解码方法和装置 技术领域
本申请涉及视频编解码领域, 具体涉及一种视频编、 解码方法和装 置。
背景技术
在视频编解码领域, 由于基于块的压缩方法的高效性, 大多数编解 码标准都釆用基于块的压缩方法。 然而基于块的压缩方法, 在编解码器 反变换、 反量化后, 图像会出现块效应。 块效应的产生原因主要包括下 面两个:
1、 在基于块的帧内和帧间预测残差的 DCT ( Discrete Cosine Transform, 离散余弦变换)变换过程中, 变换系数的量化过程相对粗糙, 反量化过程恢复的变换系数带有误差, 从而在图像块边界上的视觉不连 续。
2、 在运动补偿预测过程中, 运动补偿块可能是从不同帧的不同位置 上的内插样点数据复制而来的, 因此, 运动补偿块的匹配不可能是绝对 准确的, 所以就会在复制块的边界上产生数据的不连续。
例如, 当以 8*8的块进行 DCT变换来压缩时, 解码出来的图像, 垂 直方向或者水平方向的每 8个像素点就会出现一条很明显的直线 (块效 应) , 这将对图像的主观质量产生很大的影响。 因此, 需要釆取适当的 方法来去除块效应。
发明内容
本申请提供一种视频编、 解码方法和装置, 以改善视频编解码中的 块效应。 根据本申请的第一方面,本申请还提供了一种视频编码方法, 包括: 获取当前图像块的重建块;
获取当前图像块的编码量化参数, 根据所述量化参数获取滤波条件 中的第一阔值和第二阔值;
判断当前图像块的重建块边界与其相邻解码块边界是否满足滤波条 件, 如果满足, 则对当前图像块的重建块边界及其相邻解码块边界进行 滤波, 并将滤波后的当前图像块的重建块作为当前图像块的解码块; 如 果不满足,则不对当前图像块的重建边界及其相邻解码块边界进行滤波, 并将当前图像块的重建块作为其解码块;
所述滤波条件包括:
( 1 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值小于第一阔值;
( 2 )当前图像块的重建块边界上相邻两个像素点的差值小于第二阔 值,和 /或当前图像块的相邻解码块边界上相邻两个像素点的差值小于第 二阔值;
( 3 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值大于当前图像块的重建块边界上相邻两个像素点的差值, 和 / 或当前图像块的重建块边界与其相邻解码块边界上相邻两个像素点的差 值大于当前图像块的相邻解码块边界上相邻两个像素点的差值;
根据当前图像块的解码块得到编码块的预测块;
将所述预测块与编码块相差得到残差值, 对所述残差值进行处理得 到编码块的编码码流;
将所述第一阔值和第二阔值编入所述编码码流。 根据本申请的第二方面,本申请还提供了一种视频编码装置, 包括: 重建单元, 用于获取当前图像块的重建块;
阔值获取单元, 用于获取当前图像块的编码量化参数, 根据所述量 化参数获取滤波条件中的第一阈值和第二阔值;
判断单元, 用于判断当前图像块的重建块边界与其相邻解码块边界 是否满足滤波条件; 所述滤波条件包括:
( 1 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值小于第一阔值;
( 2 )当前图像块的重建块边界上相邻两个像素点的差值小于第二阔 值,和 /或当前图像块的相邻解码块边界上相邻两个像素点的差值小于第 二阔值;
( 3 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值大于当前图像块的重建块边界上相邻两个像素点的差值, 和 / 或当前图像块的重建块边界与其相邻解码块边界上相邻两个像素点的差 值大于当前图像块的相邻解码块边界上相邻两个像素点的差值;
滤波单元, 用于在判断单元判断到当前图像块的重建块边界满足滤 波条件时, 对当前图像块的重建块边界及其相邻解码块边界进行滤波, 并将滤波后的当前图像块的重建块作为当前图像块的解码块; 在判断单 元判断到当前图像块的重建块边界不满足滤波条件时, 不对当前图像块 的重建边界及其相邻解码块边界进行滤波, 并将当前图像块的重建块作 为其解码块;
预测单元, 用于根据当前图像块的解码块得到编码块的预 'J块; 编码单元, 用于将所述预测块与编码块相差得到残差值, 对所述残 差值进行处理得到编码码流, 并将所述第一阔值和第二阔值编入所述编 码码流。 根据本申请的第三方面,本申请还提供了一种视频解码方法, 包括: 获取当前图像块的编码码流,对所述编码码流进行处理得到残差值, 并从所述编码码流中提取第一阔值和第二阔值;
根据当前图像块的相邻解码块得到当前图像块的预测块;
将所述预测块和残差值相加得到当前图像块的重建块;
判断当前图像块的重建块边界与其相邻解码块边界是否满足滤波条 件, 如果满足, 则对当前图像块的重建块边界及其相邻解码块边界进行 滤波, 并将滤波后的当前图像块的重建块作为当前图像块的解码块; 如 果不满足,则不对当前图像块的重建边界及其相邻解码块边界进行滤波, 并将当前图像块的重建块作为其解码块;
所述滤波条件包括:
( 1 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值小于第一阔值;
( 2 )当前图像块的重建块边界上相邻两个像素点的差值小于第二阔 值,和 /或当前图像块的相邻解码块边界上相邻两个像素点的差值小于第 二阔值;
( 3 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值大于当前图像块的重建块边界上相邻两个像素点的差值, 和 / 或当前图像块的重建块边界与其相邻解码块边界上相邻两个像素点的差 值大于当前图像块的相邻解码块边界上相邻两个像素点的差值。 根据本申请的第四方面,本申请还提供了一种视频解码装置, 包括: 解码单元, 用于获取当前图像块的编码码流, 对所述编码码流进行 处理得到残差值, 并从所述编码码流中提取第一阔值和第二阔值;
预测单元, 用于根据当前图像块的相邻解码块得到当前图像块的预 测块;
重建单元, 用于将所述预测块和残差值相加得到当前图像块的重建 块;
判断单元, 用于判断当前图像块的重建块边界与其相邻解码块边界 是否满足滤波条件;
所述滤波条件包括:
( 1 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值小于第一阔值;
( 2 )当前图像块的重建块边界上相邻两个像素点的差值小于第二阔 值,和 /或当前图像块的相邻解码块边界上相邻两个像素点的差值小于第 二阔值;
( 3 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值大于当前图像块的重建块边界上相邻两个像素点的差值, 和 / 或当前图像块的重建块边界与其相邻解码块边界上相邻两个像素点的差 值大于当前图像块的相邻解码块边界上相邻两个像素点的差值;
滤波单元, 用于在判断单元判断到当前图像块的重建块边界满足滤 波条件时, 对当前图像块的重建块边界及其相邻解码块边界进行滤波, 并将滤波后的当前图像块的重建块作为当前图像块的解码块; 在判断单 元判断到当前图像块的重建块边界不满足滤波条件时, 不对当前图像块 的重建边界及其相邻解码块边界进行滤波, 并将当前图像块的重建块作 为其解码块。 本申请提供的一种视频编、 解码方法和装置中, 通过判断当前图像 块的重建块边界是否满足滤波条件, 如果满足, 则对当前图像块的重建 块边界进行滤波; 如果不满足, 则不对当前图像块的重建块边界进行滤 波。 其中, 滤波条件中的第一阔值和第二阔值根据当前图像块的编码量 化参数来获取, 使得第一阈值和第二阈值可以根据量化参数的动态变化 而变化。 因此, 能够通过滤波条件准确判断出当前图像块的重建块边界 为真实边界还是伪边界, 对伪边界进行滤波, 从而改善视频编解码中的 块效应。 另外, 将第一阔值和第二阔值编入编码码流中, 降低编码码率, 在解码装置中, 直接从码流中提取该第一阔值和第二阔值, 降低了解码 装置的运算量, 提高解码效率。
附图说明
下面结合附图和具体实施方式作进一步详细的说明。
图 1为视频编解码中将图像帧划分宏块的示意图;
图 2为本申请一种实施例中视频编码端的框架示意图;
图 3为本申请一种实施例中视频编码的流程示意图;
图 4为本申请一种实施例视频编码去块效应滤波中当前图像块的重 建块与其相邻解码块的位置示意图;
图 5为在水平方向上当前图像块的重建块边界像素点与其相邻解码 块边界像素点在滤波前与滤波后的对比示意图; 图;
图 7为本申请一种实施例中视频编码装置的结构示意图;
图 8为本申请另一种实施例中视频解码的流程示意图;
图 9为本申请另一种实施例中视频解码端的框架示意图;
图 10为本申请另一种实施例中视频解码装置的结构示意图。 具体实施方式
根据用于对视频编解码的标准, 在对视频进行编码时, 将每一帧图 像划分宏块, 每个宏块具有固定大小, 从左上方的第一图像块开始依次 按照从左往右、 从上往下的顺序依次对一帧图像中的每一个图像块进行 处理。 请参考图 1 , 例如将一帧 16* 16像素的图像帧划分为 4*4像素的 宏块 (图像块) , 每一宏块的大小为 4*4像素, 对图像的处理顺序为, 先从左到右处理第一行的图像块, 然后再依次处理第二行, 直到整帧图 像被处理完毕。 相应的, 在对于图像帧进行去块效应滤波时, 也是分别 对每个图像块进行滤波。
本申请提供的一种视频编、 解码方法和装置, 其发明构思在于: 通 过判断当前图像块的重建块边界与其相邻解码块边界是否满足滤波条 件, 如果满足, 则对当前图像块的重建块边界及其相邻解码块边界进行 滤波; 如果不满足, 则不对当前图像块的重建块边界及其相邻解码块边 界进行滤波。 其中, 滤波条件中的第一阔值和第二阔值根据当前图像块 的编码量化参数来获取, 使得第一阈值和第二阈值可以根据量化参数的 动态变化而变化。 因此, 能够通过滤波条件准确判断出当前图像块的重 建块边界为真实边界还是伪边界, 对伪边界进行滤波, 从而改善视频编 解码中的块效应。 另外, 将第一阔值和第二阔值编入编码码流中, 降低 编码码率, 在解码装置中, 直接从码流中提取该第一阔值和第二阔值, 降低了解码装置的运算量, 提高解码效率。
实施例一
请参考图 2 , 为视频编码端的框架示意图。 当前图像块的残差值经 过变换 /量化后, 再经熵编码得到当前图像块的编码码流。 接下来, 编码 端继续对下一个图像块 (本申请中称为编码块) 进行编码。 在对编码块 进行编码时,编码端往往需要先将当前图像块经变换 /量化后的残差值进 行解码重建, 得到当前图像块的重建块, 当前图像块的重建块用于通过 处理得到编码块的预测块。 编码块与其预测块相差得到残差值, 将残差 值经变换 /量化、熵编码后得到编码块的编码码流,完成对编码块的编码。
然而, 在通过当前图像块的重建块来得到编码块的预测块过程中, 为了使得到的预测块更加准确, 以减小残差值, 需要对当前图像块的重 建块进行滤波, 以得到当前图像块最终的解码块, 并以当前图像块的解 码块作为参考块, 来得到编码块的预测块。 本实施例中, 滤波是指去块 效应滤波, 去块效应滤波用于平滑解码块的边界, 改善解码块的质量。 经过滤波处理的解码块被用于将来帧的运动补偿预测, 能够提高编码的 压缩性能, 因为经过滤波处理的解码块比一个存在块效应的未滤波的解 码块更接近原始图像块, 因此, 得到的残差值会更小。
请参考图 2-4 , 本实施例提供了一种视频编码方法, 包括下面步骤: 步骤 101 : 获取当前图像块的重建块。 当前图像块为已经编码完毕 的图像块, 在编码端, 需要对编码后的当前图像块进行解码重建, 即得 到当前图像块的重建块, 该重建块用于获取编码块的预测块。 编码块为 按照图像帧中对图像块的编码顺序,当前图像块下一个待编码的图像块。
步骤 102: 获取当前图像块的编码量化参数 QP, 根据量化参数获取 滤波条件中的第一阔值和第二阔值。
具体的,量化参数与第一阔值、第二阔值可以以对应表的形式对应, 如表 1所示, 维护有量化参数与第一阔值、 第二阔值对应关系的对应表 保存在配置文件中, 在编码时, 获取到当前图像块的编码量化参数后, 查询该对应表来得到相应的第一阔值和第二阔值。
表 1.量化参数与第阔值、 第二阔值的对应表
Figure imgf000008_0001
第一阔值和第二阔值跟随着量化参数的动态变化而变化, 可以更加 有效地判断出真实边界和伪边界, 从而改善块效应问题, 增强图像的主 观质量。
步骤 103 : 判断当前图像块的重建块边界与其相邻解码块边界是否 满足滤波条件。 当前图像块的相邻解码块是指与当前图像块相邻的图像 块的解码块。
需要说明的是, 由于视频编码过程中, 是以图像块为单位顺序编码 的, 因此, 通常当前图像块的相邻解码块为当前图像块左边和上边的解 码块。
请参考图 4 , 其中, 图 4 ( a ) 为在水平方向上当前图像块的重建块 (包括像素点 p0、 pl、 p2 ) 与其相邻解码块(包括像素点 q0、 ql、 q2 ) 的位置示意图, 图 4 ( b )为在垂直方向上当前图像块的重建块(包括像 素点 p0、 pl、 p2 )与其相邻解码块(包括像素点 q0、 ql、 q2 )的位置示 意图。
滤波条件可以包括: 当前图像块的重建块边界与其相邻解码块边界 上相邻两个像素点 ρθ和 qO的差值小于第一阔值 α。
为了更加准确地判断当前图像块的重建块边界与其相邻解码块边界 为真实边界还是伪边界, 滤波条件还包括: 当前图像块的重建块边界上 相邻两个像素点 ρθ和 pi的差值小于第二阔值 β , 和 /或当前图像块的相 邻解码块边界上相邻两个像素点 qO和 ql的差值小于第二阔值 β。
通常, 当当前图像块的重建块边界与其相邻解码块边界上相邻两个 像素点 ρθ和 qO的差值大于当前图像块的重建块边界上相邻两个像素点 ρθ和 pi的差值, 和 /或当前图像块的重建块边界与其相邻解码块边界上 相邻两个像素点 ρθ和 qO的差值大于当前图像块的相邻解码块边界上相 邻两个像素点 qO和 ql的差值时,重建块容易出现明显的块效应, 因此, 滤波条件还包括: 当前图像块的重建块边界与其相邻解码块边界上相邻 两个像素点 ρθ和 qO的差值大于当前图像块的重建块边界上相邻两个像 素点 ρθ和 pi的差值,和 /或当前图像块的重建块边界与其相邻解码块边 界上相邻两个像素点 ρθ和 qO的差值大于当前图像块的相邻解码块边界 上相邻两个像素点 qO和 ql的差值。
上述滤波条件可以总结如下 (滤波条件中, 两个像素点的差值取绝 对值) :
( 1 ) |p0 - q0| <α
( 2 ) |P0 - pl| <P ^/il|qO - ql| <P
( 3 ) |p0 - q0| > |p0 - pl |和 /或 |p0 - q0| > |q0 - ql |
根据滤波条件来判断当前图像块的重建块边界与其相邻解码块边界 时, 均是根据同一行或同一列像素点来判断的。 当滤波条件同时包括上 述三个方面时, 可以较准确地判断出当前图像块的重建块边界与其相邻 解码块边界为真实边界还是伪边界。 步骤 104: 在步骤 103 中, 如果判断到当前图像块的重建块边界与 其相邻解码块边界满足滤波条件, 则对当前图像块的重建块边界及其相 邻解码块边界进行滤波。
在具体实施例中, 对当前图像块的重建块边界及其相邻解码块边界 进行滤波时, 采用下面滤波公式:
P0=q0-(q0-p0)/k;
Q0= p0-(p0-q0)/k;
其中, p0、 q0分别为当前图像块的重建块边界像素点及其相邻解码 块边界像素点的像素值, P0、 Q0分别为当前图像块的重建块边界像素 点及其相邻解码块边界像素点滤波后的像素值, k为预设参数, 具体的, k的值可以取 4。应当理解,可实施例中仅是提供了一种可行的滤波公式, 在其他实施例中, 本领域技术人员可以根据实际需求改变滤波公式, 例 如改变 k的取值。
需要说明的是, 在对当前图像块的进行去块效应滤波时, 当前图像 块的左边界和上边界, 可以是在对当前图像块编码时进行滤波的, 而当 前图像块的右边界是在当前图像块右相邻图像块编码时进行滤波的, 当 前图像块的下边界是在当前图像块下相邻图像块编码时进行滤波的。 因 此, 通常在编码端会设置緩存区, 以保证各个图像块的解码块的四个边 界完成滤波后, 作为其它图像块的参考块。
请参考图 5 , 虚线两侧分别为在水平方向上当前图像块的重建块边 界像素点 p0、 pi与其相邻解码块边界像素点 q0、 ql的示意图, 原始像 素点 ρθ和 q0由于块效应, 两者的值相差较大, 经过去块效应滤波后, 原始像素点 ρθ和 q0滤波后的值分别为 P0和 Q0 , 从图 5中可以看出, P0和 Q0两者的值相差较小, 因而在图像上表现出来的效果为, 两个图 像块的边界过渡更加平緩, 即, 改善了图像的块效应。
本实施例中, 图像块可以是图像帧编码时划分的宏块, 也可以是宏 块下面继续划分的子宏块。 如图 6所示, 图像帧划分为若干个 16*16的 宏块, 而进行去块效应滤波时, 釆用的图像块为 16*16宏块下面继续划 分的 8*8子宏块。 图 6表示的是进行块效应滤波时, 对图像块边界的滤 波顺序。 图 6 ( a )为对亮度块的滤波, 图 6 ( b )为对色度块的滤波, 其 滤波先后顺序为 1至 6。 步骤 105: 如果判断到当前图像块的重建块边界与其相邻解码块边 界满足滤波条件, 则将滤波后的当前图像块的重建块作为当前图像块的 解码块; 如果判断到当前图像块的重建块边界与其相邻解码块边界不满 足滤波条件, 则直接将当前图像块的重建块作为其解码块。
步骤 106: 根据当前图像块的解码块得到编码块的预测块。 通常, 编码块的预测块是根据其相邻解码块的相关信息进行预测得到的,例如, 根据编码块的左相邻解码块、 上相邻解码块和 /或左上相邻解码块得到。 步骤 107 : 将预测块与编码块相差得到残差值。
步骤 108: 对残差值进行处理得到编码块的编码码流。 对残差值的 处理可以包括变换、 量化、 熵编码等。
步骤 109: 将编码块对应的第一阔值和第二阔值编入码流中, 以便 于解码端在进行滤波时可以直接从码流中获取第一阔值和第二阔值。 编 码块对应的第一阔值和第二阔值可以根据上述表 1获得。 请参考图 7 , 对应于本实施提供的视频编码方法, 本实施例还相应 提供了一种视频编码装置, 包括: 重建单元 201、 判断单元 202、 滤波单 元 203、 预测单元 204、 编码单元 205和阈值获取单元 206。
重建单元 201用于获取当前图像块的重建块。
阔值获取单元 206用于获取当前图像块的编码量化参数, 根据量化 参数获取滤波条件中的第一阈值和第二阔值。
判断单元 202用于判断当前图像块的重建块边界与其相邻解码块边 界是否满足滤波条件。 滤波条件包括:
( 1 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值小于第一阔值。
( 2 )当前图像块的重建块边界上相邻两个像素点的差值小于第二阔 值,和 /或当前图像块的相邻解码块边界上相邻两个像素点的差值小于第 二阔值。
( 3 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值大于当前图像块的重建块边界上相邻两个像素点的差值, 和 / 或当前图像块的重建块边界与其相邻解码块边界上相邻两个像素点的差 值大于当前图像块的相邻解码块边界上相邻两个像素点的差值。
滤波单元 203用于在判断单元 202判断到当前图像块的重建块边界 满足滤波条件时, 对当前图像块的重建块边界及其相邻解码块边界进行 滤波, 并将滤波后的当前图像块的重建块作为当前图像块的解码块; 在 判断单元 202判断到当前图像块的重建块边界不满足滤波条件时, 不对 当前图像块的重建边界及其相邻解码块边界进行滤波, 并将当前图像块 的重建块作为其解码块。
预测单元 204用于根据当前图像块的解码块得到编码块的预测块。 编码单元 205用于将预测块与编码块相差得到残差值, 对残差值进 行处理得到编码码流, 并将第一阔值和第二阔值编入编码码流。
具体的, 滤波单元 203对当前图像块的重建块边界及其相邻解码块 边界进行滤波时, 釆用下面滤波公式:
P0=q0-(q0-p0)/k; Q0= p0-(p0-q0)/k;
其中, p0、 qO分别为当前图像块的重建块边界像素点及其相邻解码 块边界像素点的像素值, P0、 Q0 分别为当前图像块的重建块边界像素 点及其相邻解码块边界像素点滤波后的像素值, k为预设参数。 实施例二
在视频编解码领域, 视频解码作为视频编码的逆操作, 视频解码端 与视频编码端具有对应的关系。 请参考图 8和 9 , 本实施例提供了一种 视频解码方法, 包括下面步骤:
步骤 301 : 获取当前图像块的编码码流, 当前图像块是指当前待解 码的图像块。
步骤 302: 对编码码流进行处理得到残差值, 并从编码码流中提取 第一阈值和第二阈值。 对编码码流进行处理可以包括熵解码、 反量化、 反变换等。
步骤 303: 根据当前图像块的相邻解码块得到当前图像块的预测块 , 将预测块和残差值相加得到当前图像块的重建块。 通常, 当前图像块的 预测块是根据其相邻解码块的相关信息进行预测得到的, 因此, 在具体 实施例中, 当前图像块的预测块可以不仅是根据其相邻解码块得到, 例 如, 根据当前图像块块的左相邻解码块、 上相邻解码块和 /或左上相邻解 码块得到。
由于视频编码过程中, 是以图像块为单位顺序编码的, 因此, 在解 码端, 将会将先编码的图像块解码出来, 通常当前图像块相邻解码块为 当前图像块左边和上边的解码块。 本实施例中, 当前图像块的重建块与 其相邻解码块的位置关系可参考实施例一 (图 4 ) 。
步骤 304: 判断当前图像块的重建块边界与其相邻解码块边界是否 满足滤波条件。
滤波条件包括:
( 1 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值小于第一阔值。
( 2 )当前图像块的重建块边界上相邻两个像素点的差值小于第二阔 值,和 /或当前图像块的相邻解码块边界上相邻两个像素点的差值小于第 二阔值。
( 3 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值大于当前图像块的重建块边界上相邻两个像素点的差值, 和 / 或当前图像块的重建块边界与其相邻解码块边界上相邻两个像素点的差 值大于当前图像块的相邻解码块边界上相邻两个像素点的差值。
步骤 305 : 在步骤 304 中, 如果判断到当前图像块的重建块边界与 其相邻解码块边界满足滤波条件, 则对当前图像块的重建块边界及其相 邻解码块边界进行滤波。
在具体实施例中, 对当前图像块的重建块边界及其相邻解码块边界 进行滤波时, 采用下面滤波公式:
P0=q0-(q0-p0)/k;
Q0= p0-(p0-q0)/k;
其中, p0、 q0分别为当前图像块的重建块边界像素点及其相邻解码 块边界像素点的像素值, P0、 Q0 分别为当前图像块的重建块边界像素 点及其相邻解码块边界像素点滤波后的像素值, k为预设参数, 具体的, k的值可以取 4。
步骤 306: 如果判断到当前图像块的重建块边界与其相邻解码块边 界满足滤波条件, 则将滤波后的当前图像块的重建块作为当前图像块的 解码块; 如果判断到当前图像块的重建块边界与其相邻解码块边界不满 足滤波条件, 则直接将当前图像块的重建块作为其解码块。
本实施例中, 编码码流携带有与当前图像块对应的第一阔值和第二 阔值, 滤波条件中的第一阔值和第二阔值直接从编码码流中提取, 从而 可以减小解码端的运算量, 提高解码效率。
通常, 在编码端会对解码得到的解码块进行緩存, 以作为其它图像 块的参考块, 并在对整帧图像解码和滤波完毕后输出解码图像。 请参考图 10 , 对应于本实施提供的视频解码方法, 本实施例还相应 提供了一种视频解码装置, 包括解码单元 401、预测单元 402、 重建单元 403、 判断单元 404和滤波单元 405。
解码单元 401用于获取当前图像块的编码码流, 对编码码流进行处 理得到残差值, 并从编码码流中提取第一阔值和第二阔值。
预测单元 402用于根据当前图像块的相邻解码块得到当前图像块的 预测块。
重建单元 403 用于将预测块和残差值相加得到当前图像块的重建 块。
判断单元 404用于判断当前图像块的重建块边界与其相邻解码块边 界是否满足滤波条件。
滤波条件包括:
( 1 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值小于第一阔值。
( 2 )当前图像块的重建块边界上相邻两个像素点的差值小于第二阔 值,和 /或当前图像块的相邻解码块边界上相邻两个像素点的差值小于第 二阔值。 ( 3 )当前图像块的重建块边界与其相邻解码块边界上相邻两个像素 点的差值大于当前图像块的重建块边界上相邻两个像素点的差值, 和 / 或当前图像块的重建块边界与其相邻解码块边界上相邻两个像素点的差 值大于当前图像块的相邻解码块边界上相邻两个像素点的差值。
滤波单元 405用于在判断单元 404判断到当前图像块的重建块边界 满足滤波条件时, 对当前图像块的重建块边界及其相邻解码块边界进行 滤波, 并将滤波后的当前图像块的重建块作为当前图像块的解码块; 在 判断单元 404判断到当前图像块的重建块边界不满足滤波条件时, 不对 当前图像块的重建边界及其相邻解码块边界进行滤波, 并将当前图像块 的重建块作为其解码块。
具体的, 滤波单元 405对当前图像块的重建块边界及其相邻解码块 边界进行滤波时, 釆用下面滤波公式:
P0=q0-(q0-p0)/k;
Q0= p0-(p0-q0)/k;
其中, p0、 q0分别为当前图像块的重建块边界像素点及其相邻解码 块边界像素点的像素值, P0、 Q0 分别为当前图像块的重建块边界像素 点及其相邻解码块边界像素点滤波后的像素值, k为预设参数。
本申请实施例提供的视频编、 解码方法和装置中, 通过判断当前图 像块的重建块边界是否满足滤波条件, 如果满足, 则对当前图像块的重 建块边界进行滤波; 如果不满足, 则不对当前图像块的重建块边界进行 滤波。 其中, 滤波条件中的第一阔值和第二阔值根据当前图像块的编码 量化参数来获取, 使得第一阈值和第二阈值可以根据量化参数的动态变 化而变化。 因此, 能够通过滤波条件准确判断出当前图像块的重建块边 界为真实边界还是伪边界, 对伪边界进行滤波, 从而改善视频编解码中 的块效应。 另外, 将第一阔值和第二阔值编入编码码流中, 降低编码码 率, 在解码装置中, 直接从码流中提取该第一阔值和第二阔值, 降低了 解码装置的运算量, 提高解码效率。
本实施例中,对部分未涉及本申请发明内容的知识未进行——阐述, 其解释与实现可参照本领域的公知技术。
本领域技术人员可以理解, 上述实施方式中各种方法的全部或部分 步骤可以通过程序来指令相关硬件完成, 该程序可以存储于一计算机可 读存储介质中, 存储介质可以包括: 只读存储器、 随机存储器、 磁盘或 光盘等。
以上内容是结合具体的实施方式对本申请所作的进一步详细说明, 不能认定本申请的具体实施只局限于这些说明。 对于本申请所属技术领 域的普通技术人员来说, 在不脱离本申请发明构思的前提下, 还可以做 出若干简单推演或替换。

Claims

权 利 要 求
1. 一种视频编码方法, 其特征在于, 包括:
获取当前图像块的重建块;
获取当前图像块的编码量化参数, 根据所述量化参数获取滤波条件 中的第一阔值和第二阔值;
判断当前图像块的重建块边界与其相邻解码块边界是否满足滤波 条件, 如果满足, 则对当前图像块的重建块边界及其相邻解码块边界进 行滤波, 并将滤波后的当前图像块的重建块作为当前图像块的解码块; 如果不满足, 则不对当前图像块的重建边界及其相邻解码块边界进行滤 波, 并将当前图像块的重建块作为其解码块;
所述滤波条件包括:
( 1 ) 当前图像块的重建块边界与其相邻解码块边界上相邻两个像 素点的差值小于第一阔值;
( 2 ) 当前图像块的重建块边界上相邻两个像素点的差值小于第二 阔值,和 /或当前图像块的相邻解码块边界上相邻两个像素点的差值小于 第二阔值;
( 3 ) 当前图像块的重建块边界与其相邻解码块边界上相邻两个像 素点的差值大于当前图像块的重建块边界上相邻两个像素点的差值,和 / 或当前图像块的重建块边界与其相邻解码块边界上相邻两个像素点的差 值大于当前图像块的相邻解码块边界上相邻两个像素点的差值;
根据当前图像块的解码块得到编码块的预测块;
将所述预测块与编码块相差得到残差值, 对所述残差值进行处理得 到编码块的编码码流;
将所述第一阈值和第二阔值编入所述编码码流。
2、 如权利要求 1所述的方法, 其特征在于, 获取当前图像块的编码 量化参数, 根据所述量化参数获取滤波条件中的第一阈值和第二阔值, 具体为:
获取当前图像块的编码量化参数, 根据表 1的对应关系获取与所述 量化参数对应的第一阈值和第二阔值;
表 1.量化参数与第阔值、 第二阔值的对应表 里 第 第 里 第 第 里 第 第 里 第 第 化 一 二 化 一 二 化 一 二 化 一 二 参 阔 阔 参 阈 阔 参 阔 阔 参 阔 阔 数 值 值 数 值 值 数 值 值 数 值 值
QP α β QP α β QP α β QP α β
0 0 0 16 4 2 32 22 6 48 46 15
1 0 0 17 4 2 33 24 7 49 48 16
2 0 0 18 5 3 34 26 7 50 50 17
3 0 0 19 5 3 35 28 7 51 52 18
4 0 0 20 6 3 36 30 8 52 53 19
5 0 0 21 7 3 37 33 8 53 54 20
6 1 1 22 8 4 38 33 8 54 55 21
7 1 1 23 9 4 39 35 9 55 56 22
8 1 1 24 10 4 40 35 9 56 57 23
9 1 1 25 11 4 41 36 10 57 58 23
10 1 1 26 12 5 42 37 10 58 59 24
11 2 1 27 13 5 43 37 11 59 60 24
12 2 1 28 15 5 44 39 11 60 61 25
13 2 2 29 16 5 45 39 12 61 62 25
14 3 2 30 18 6 46 42 13 62 63 26
15 3 2 31 20 6 47 44 14 63 64 27
3、 如权利要求 1或 2所述的方法, 其特征在于, 对当前图像块的重 建块边界及其相邻解码块边界进行滤波时, 釆用下面滤波公式:
P0=q0-(q0-p0)/k;
Q0= p0-(p0-q0)/k;
其中, p0、 q0分别为当前图像块的重建块边界像素点及其相邻解码 块边界像素点的像素值, P0、 Q0 分别为当前图像块的重建块边界像素 点及其相邻解码块边界像素点滤波后的像素值, k为预设参数。
4、 一种视频编码装置, 其特征在于, 包括:
重建单元, 用于获取当前图像块的重建块;
阔值获取单元, 用于获取当前图像块的编码量化参数, 根据所述量 化参数获取滤波条件中的第一阔值和第二阔值;
判断单元, 用于判断当前图像块的重建块边界与其相邻解码块边界 是否满足滤波条件; 所述滤波条件包括: ( 1 ) 当前图像块的重建块边界与其相邻解码块边界上相邻两个像 素点的差值小于第一阔值;
( 2 ) 当前图像块的重建块边界上相邻两个像素点的差值小于第二 阔值,和 /或当前图像块的相邻解码块边界上相邻两个像素点的差值小于 第二阔值;
( 3 ) 当前图像块的重建块边界与其相邻解码块边界上相邻两个像 素点的差值大于当前图像块的重建块边界上相邻两个像素点的差值,和 / 或当前图像块的重建块边界与其相邻解码块边界上相邻两个像素点的差 值大于当前图像块的相邻解码块边界上相邻两个像素点的差值;
滤波单元, 用于在判断单元判断到当前图像块的重建块边界满足滤 波条件时, 对当前图像块的重建块边界及其相邻解码块边界进行滤波, 并将滤波后的当前图像块的重建块作为当前图像块的解码块; 在判断单 元判断到当前图像块的重建块边界不满足滤波条件时, 不对当前图像块 的重建边界及其相邻解码块边界进行滤波, 并将当前图像块的重建块作 为其解码块;
预测单元, 用于根据当前图像块的解码块得到编码块的预 'J块; 编码单元, 用于将所述预测块与编码块相差得到残差值, 对所述残 差值进行处理得到编码码流, 并将所述第一阔值和第二阔值编入所述编 码码流。
5、 如权利要求 4所述的装置, 其特征在于, 阔值获取单元用于获取 当前图像块的编码量化参数, 根据所述量化参数获取滤波条件中的第一 阔值和第二阈值时: 获取当前图像块的编码量化参数, 根据表 1的对应 关系获取与所述量化参数对应的第一阔值和第二阔值;
表 1.量化参数与第阔值、 第二阔值的对应表
里 第 第 里 第 第 里 第 第 里 第 第 化 一 二 化 一 二 化 一 二 化 一 二 参 阔 阔 参 阈 阔 参 阔 阔 参 阔 阔 数 值 值 数 值 值 数 值 值 数 值 值
QP α β QP α β QP α β QP α β
0 0 0 16 4 2 32 22 6 48 46 15
1 0 0 17 4 2 33 24 7 49 48 16
2 0 0 18 5 3 34 26 7 50 50 17
3 0 0 19 5 3 35 28 7 51 52 18
4 0 0 20 6 3 36 30 8 52 53 19
5 0 0 21 7 3 37 33 8 53 54 20
6 1 1 22 8 4 38 33 8 54 55 21
7 1 1 23 9 4 39 35 9 55 56 22
8 1 1 24 10 4 40 35 9 56 57 23
9 1 1 25 11 4 41 36 10 57 58 23
10 1 1 26 12 5 42 37 10 58 59 24
11 2 1 27 13 5 43 37 11 59 60 24
12 2 1 28 15 5 44 39 11 60 61 25
13 2 2 29 16 5 45 39 12 61 62 25
14 3 2 30 18 6 46 42 13 62 63 26
15 3 2 31 20 6 47 44 14 63 64 27
6、 如权利要求 4或 5所述的装置, 其特征在于, 滤波单元用于对当 前图像块的重建块边界及其相邻解码块边界进行滤波时, 釆用下面滤波 公式:
P0=q0-(q0-p0)/k;
Q0= p0-(p0-q0)/k;
其中, p0、 q0分别为当前图像块的重建块边界像素点及其相邻解码 块边界像素点的像素值, P0、 Q0 分别为当前图像块的重建块边界像素 点及其相邻解码块边界像素点滤波后的像素值, k为预设参数。
7、 一种视频解码方法, 其特征在于, 包括:
获取当前图像块的编码码流, 对所述编码码流进行处理得 )J残差 值, 并从所述编码码流中提取第一阔值和第二阔值;
根据当前图像块的相邻解码块得到当前图像块的预测块;
将所述预测块和残差值相加得到当前图像块的重建块; 判断当前图像块的重建块边界与其相邻解码块边界是否满足滤波 条件, 如果满足, 则对当前图像块的重建块边界及其相邻解码块边界进 行滤波, 并将滤波后的当前图像块的重建块作为当前图像块的解码块; 如果不满足, 则不对当前图像块的重建边界及其相邻解码块边界进行滤 波, 并将当前图像块的重建块作为其解码块;
所述滤波条件包括:
( 1 ) 当前图像块的重建块边界与其相邻解码块边界上相邻两个像 素点的差值小于第一阔值;
( 2 ) 当前图像块的重建块边界上相邻两个像素点的差值小于第二 阔值,和 /或当前图像块的相邻解码块边界上相邻两个像素点的差值小于 第二阔值;
( 3 ) 当前图像块的重建块边界与其相邻解码块边界上相邻两个像 素点的差值大于当前图像块的重建块边界上相邻两个像素点的差值,和 / 或当前图像块的重建块边界与其相邻解码块边界上相邻两个像素点的差 值大于当前图像块的相邻解码块边界上相邻两个像素点的差值。
8、 如权利要求 7所述的方法, 其特征在于, 对当前图像块的重建块 边界及其相邻解码块边界进行滤波时, 釆用下面滤波公式:
P0=q0-(q0-p0)/k;
Q0= p0-(p0-q0)/k;
其中, p0、 q0分别为当前图像块的重建块边界像素点及其相邻解码 块边界像素点的像素值, P0、 Q0 分别为当前图像块的重建块边界像素 点及其相邻解码块边界像素点滤波后的像素值, k为预设参数。
9、 一种视频解码装置, 其特征在于, 包括:
解码单元, 用于获取当前图像块的编码码流, 对所述编码码流进行 处理得到残差值, 并从所述编码码流中提取第一阈值和第二阔值;
预测单元, 用于根据当前图像块的相邻解码块得到当前图像块的预 测块;
重建单元, 用于将所述预测块和残差值相加得到当前图像块的重建 块;
判断单元, 用于判断当前图像块的重建块边界与其相邻解码块边界 是否满足滤波条件;
所述滤波条件包括:
( 1 ) 当前图像块的重建块边界与其相邻解码块边界上相邻两个像 素点的差值小于第一阔值;
( 2 ) 当前图像块的重建块边界上相邻两个像素点的差值小于第二 阔值,和 /或当前图像块的相邻解码块边界上相邻两个像素点的差值小于 第二阔值; ( 3 ) 当前图像块的重建块边界与其相邻解码块边界上相邻两个像 素点的差值大于当前图像块的重建块边界上相邻两个像素点的差值,和 / 或当前图像块的重建块边界与其相邻解码块边界上相邻两个像素点的差 值大于当前图像块的相邻解码块边界上相邻两个像素点的差值;
滤波单元, 用于在判断单元判断到当前图像块的重建块边界满足滤 波条件时, 对当前图像块的重建块边界及其相邻解码块边界进行滤波, 并将滤波后的当前图像块的重建块作为当前图像块的解码块; 在判断单 元判断到当前图像块的重建块边界不满足滤波条件时, 不对当前图像块 的重建边界及其相邻解码块边界进行滤波, 并将当前图像块的重建块作 为其解码块。
10、 如权利要求 9所述的装置, 其特征在于, 滤波单元用于对当前 图像块的重建块边界及其相邻解码块边界进行滤波时, 釆用下面滤波公 式:
P0=q0-(q0-p0)/k;
Q0= p0-(p0-q0)/k;
其中, p0、 q0分别为当前图像块的重建块边界像素点及其相邻解码 块边界像素点的像素值, P0、 Q0 分别为当前图像块的重建块边界像素 点及其相邻解码块边界像素点滤波后的像素值, k为预设参数。
PCT/CN2014/083137 2014-07-28 2014-07-28 一种视频编、解码方法和装置 WO2016015198A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/083137 WO2016015198A1 (zh) 2014-07-28 2014-07-28 一种视频编、解码方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/083137 WO2016015198A1 (zh) 2014-07-28 2014-07-28 一种视频编、解码方法和装置

Publications (1)

Publication Number Publication Date
WO2016015198A1 true WO2016015198A1 (zh) 2016-02-04

Family

ID=55216567

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/083137 WO2016015198A1 (zh) 2014-07-28 2014-07-28 一种视频编、解码方法和装置

Country Status (1)

Country Link
WO (1) WO2016015198A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050243912A1 (en) * 2004-04-29 2005-11-03 Do-Kyoung Kwon Adaptive de-blocking filtering apparatus and method for mpeg video decoder
CN1867075A (zh) * 2005-09-19 2006-11-22 华为技术有限公司 图像编码处理中的环路滤波方法
CN101076124A (zh) * 2006-05-18 2007-11-21 北京大学深圳研究生院 去块滤波器
CN101267560A (zh) * 2008-03-19 2008-09-17 浙江大学 去块滤波方法及装置
CN103220529A (zh) * 2013-04-15 2013-07-24 北京大学 一种视频编解码环路滤波的实现方法
CN104113765A (zh) * 2014-07-28 2014-10-22 北京大学深圳研究生院 一种视频编、解码方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050243912A1 (en) * 2004-04-29 2005-11-03 Do-Kyoung Kwon Adaptive de-blocking filtering apparatus and method for mpeg video decoder
CN1867075A (zh) * 2005-09-19 2006-11-22 华为技术有限公司 图像编码处理中的环路滤波方法
CN101076124A (zh) * 2006-05-18 2007-11-21 北京大学深圳研究生院 去块滤波器
CN101267560A (zh) * 2008-03-19 2008-09-17 浙江大学 去块滤波方法及装置
CN103220529A (zh) * 2013-04-15 2013-07-24 北京大学 一种视频编解码环路滤波的实现方法
CN104113765A (zh) * 2014-07-28 2014-10-22 北京大学深圳研究生院 一种视频编、解码方法和装置

Similar Documents

Publication Publication Date Title
KR102296826B1 (ko) 영상 부호화 및 복호화 장치 및 그 방법
US20200296426A1 (en) In loop chroma deblocking filter
CN104113765A (zh) 一种视频编、解码方法和装置
JP7005854B2 (ja) ビデオ符号化のためのインター予測装置の補間フィルタ及び方法
JP6646029B2 (ja) アーティファクト除去フィルタリングのための領域ベースのフィルタ・パラメータの選択を行う方法および装置
US20120134424A1 (en) Method and System for a Parameterized Multi-Standard Deblocking Filter for Video Compression Systems
JP5800396B2 (ja) スパース性ベースのアーティファクト除去フィルタリングにおける可変変換に応じてフィルタ・パラメータの決定および選択を行う方法および装置
JP5043874B2 (ja) 画像データのイントラ予測符号化方法
BRPI0717936B1 (pt) Método e aparelhos para a filtragem de remoção de artefato em laço
JP6029984B2 (ja) 分類ベースのループ・フィルタのための方法と装置
JP2022130647A (ja) 双方向オプティカル・フローに対するビット幅制御方法およびデバイス
WO2022078163A1 (zh) 视频解码方法、视频编码方法及相关装置
KR20110089369A (ko) 비디오 인코딩 및 디코딩을 위한 희소성-기반 아티팩트 제거 필터링 방법 및 장치
WO2007033551A1 (en) A loop filtering method for use in image encoding process
JP2010510748A (ja) デブロッキング・フィルタリング方法及び装置
TW201933868A (zh) 視訊編解碼方法/裝置和相應地非易失性計算機可讀介質
WO2021203394A1 (zh) 环路滤波的方法与装置
KR20110014000A (ko) 영상 데이터의 디블록킹 필터링 장치 및 방법과 이를 이용한 영상 복호화 장치 및 방법
WO2006133613A1 (en) Method for reducing image block effects
CN105791865B (zh) 帧内预测及去块滤波方法
US20110080957A1 (en) Encoding adaptive deblocking filter methods for use therewith
WO2022116246A1 (zh) 帧间预测方法、视频编解码方法、装置及介质
KR20100136883A (ko) 의사 난수 필터를 이용한 영상 필터링 방법 및 장치
WO2016015198A1 (zh) 一种视频编、解码方法和装置
CN104796725A (zh) 具有帧内预测预处理的视频编码器及与其一起使用的方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14898650

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14898650

Country of ref document: EP

Kind code of ref document: A1