[go: up one dir, main page]

CN110300301A - Image coding/decoding method and device - Google Patents

Image coding/decoding method and device Download PDF

Info

Publication number
CN110300301A
CN110300301A CN201810242304.7A CN201810242304A CN110300301A CN 110300301 A CN110300301 A CN 110300301A CN 201810242304 A CN201810242304 A CN 201810242304A CN 110300301 A CN110300301 A CN 110300301A
Authority
CN
China
Prior art keywords
filter
upsampling
cnn
image block
upsampling filter
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201810242304.7A
Other languages
Chinese (zh)
Other versions
CN110300301B (en
Inventor
刘�东
李跃
杨海涛
傅佳莉
李厚强
吴枫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
University of Science and Technology of China USTC
Original Assignee
Huawei Technologies Co Ltd
University of Science and Technology of China USTC
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 Huawei Technologies Co Ltd, University of Science and Technology of China USTC filed Critical Huawei Technologies Co Ltd
Priority to CN201810242304.7A priority Critical patent/CN110300301B/en
Publication of CN110300301A publication Critical patent/CN110300301A/en
Application granted granted Critical
Publication of CN110300301B publication Critical patent/CN110300301B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/46Embedding additional information in the video signal during the compression process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop

Landscapes

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

Abstract

This application provides a kind of image coding/decoding method and devices.The image encoding method includes: to determine target up-sampling filter from pre-set up-sampling filter set according to the Coding cost of image block to be encoded, wherein, the up-sampling filter set includes at least finite impulse response FIR up-sampling filter and convolutional neural networks CNN up-sampling filter;It generates up-sampling filter corresponding with the target up-sampling filter and indicates information;Down-sampling is carried out to the image block to be encoded using pre-set FIR downsampling filter, obtains the first image block;The first image block is encoded, code stream is obtained;The code stream is written into up-sampling filter instruction information.The application can be improved encoding efficiency.

Description

图像编解码方法和装置Image encoding and decoding method and device

技术领域technical field

本申请涉及图像编解码技术领域,并且更具体地,涉及一种图像编解码方法和装置。The present application relates to the technical field of image encoding and decoding, and more specifically, relates to an image encoding and decoding method and device.

背景技术Background technique

在图像的存储和传输过程中,经常需要对图像进行压缩编码,以减少图像码流占用的存储容量和传输带宽。另外,考虑到图像编码过程中的软硬件实现的代价,在对图像进行编码时,通常会将待编码图像先划分成多个图像块,然后对每个图像块进行编码操作,典型的图像编码过程如图1所示。In the process of image storage and transmission, it is often necessary to compress and encode the image to reduce the storage capacity and transmission bandwidth occupied by the image code stream. In addition, considering the cost of hardware and software implementation in the image encoding process, when encoding an image, the image to be encoded is usually divided into multiple image blocks first, and then the encoding operation is performed on each image block. Typical image encoding The process is shown in Figure 1.

图1所示的编码过程主要包括以下步骤:The encoding process shown in Figure 1 mainly includes the following steps:

101、获取输入图像,将输入图像划分成图像块;101. Acquire an input image, and divide the input image into image blocks;

102、对图像块进行预测,得到预测信号;102. Predict the image block to obtain a prediction signal;

103、根据图像块和预测信号,得到原始残差信号;103. Obtain an original residual signal according to the image block and the prediction signal;

104、对原始残差信号进行变化和量化,得到量化系数;104. Change and quantize the original residual signal to obtain a quantization coefficient;

105、对量化系数进行反量化和反变换操作,得到重建残差信号;105. Perform inverse quantization and inverse transformation operations on the quantized coefficients to obtain a reconstructed residual signal;

106、根据重建残差信号和预测信号,得到图像块的重建信号;106. Obtain a reconstruction signal of the image block according to the reconstruction residual signal and the prediction signal;

107、对量化系数以及编码过程中的其它指示信息进行熵编码,得到压缩码流。107. Perform entropy coding on the quantization coefficients and other indication information in the coding process to obtain a compressed code stream.

与图1所示的编码过程相对应,图2示出了图像的解码过程。图2所示的解码过程主要包括以下步骤:Corresponding to the encoding process shown in FIG. 1 , FIG. 2 shows the decoding process of an image. The decoding process shown in Figure 2 mainly includes the following steps:

201、对压缩码流进行熵解码,得到量化系数;201. Perform entropy decoding on the compressed code stream to obtain quantized coefficients;

202、对量化系数进行反量化和反变换,得到当前图像块的重建残差信号;202. Perform inverse quantization and inverse transformation on the quantized coefficients to obtain a reconstruction residual signal of the current image block;

203、获取待解码图像块的预测信号;203. Acquire a prediction signal of an image block to be decoded;

204、根据重建残差信号和预测信号,得到当前图像块的重建信号;204. Obtain a reconstruction signal of the current image block according to the reconstruction residual signal and the prediction signal;

205、输出解码图像。205. Output the decoded image.

在某些应用场景下,例如,在视频会议,在线直播等场景中,为了提升图像的编码质量,降低压缩码流占用的带宽,可以在变分辨率模式下对图像块进行编码。In some application scenarios, for example, in video conferencing, online live broadcast and other scenarios, in order to improve the encoding quality of the image and reduce the bandwidth occupied by the compressed code stream, the image block can be encoded in the variable resolution mode.

具体地,编码端先根据下采样滤波器对图像块进行下采样操作,得到低分辨率的图像块,然后再对低分辨率的图像块进行预测、变换和量化得到量化系数,然后再对量化系数进行熵编码,得到压缩码流。另外,编码端还需要对量化系数进行反量化和反变换,得到重建残差信号,并根据重建残差信号以及当前待解码图像块的的预测信号得到初始重建图像块,最后再对初始重建图像块进行上采样操作,从而得到最终的重建图像,该重建图像可以用于对后续图像进行编码时的参考图像。Specifically, the encoder first performs downsampling operations on the image blocks according to the downsampling filter to obtain low-resolution image blocks, then predicts, transforms, and quantizes the low-resolution image blocks to obtain quantization coefficients, and then quantizes The coefficients are entropy coded to obtain a compressed code stream. In addition, the encoder also needs to perform inverse quantization and inverse transformation on the quantized coefficients to obtain the reconstructed residual signal, and obtain the initial reconstructed image block according to the reconstructed residual signal and the prediction signal of the current image block to be decoded, and finally the initial reconstructed image Blocks are up-sampled to obtain a final reconstructed image, which can be used as a reference image when encoding subsequent images.

相应的,解码端在对压缩码流进行解码操作后得到低分辨率的重建图像,然后根据上采样滤波器对该低分率的重建图像进行上采样,从而得到与图像块的原始分辨率相同的重建图像。Correspondingly, the decoder obtains a low-resolution reconstructed image after decoding the compressed code stream, and then upsamples the low-resolution reconstructed image according to the upsampling filter to obtain the same resolution as the original image block. reconstructed image.

但是,传统方案在对图像块进行变分辨率编码时采用的上采样滤波器和下采样滤波器均采用的是预先设置的固定有限冲击响应(Finite Impulse Response,FIR)滤波器,编码效果并不理想。However, the up-sampling filter and down-sampling filter used in the traditional solution for variable-resolution coding of image blocks both use a preset fixed finite impulse response (Finite Impulse Response, FIR) filter, and the coding effect is not good. ideal.

发明内容Contents of the invention

本申请提供一种图像编解码方法,以提高编解码效果。The present application provides an image encoding and decoding method to improve the encoding and decoding effect.

第一方面,提供了一种图像编码方法,该方法包括:从预先设置的上采样滤波器集合中确定出目标上采样滤波器;生成与目标上采样滤波器对应的上采样滤波器指示信息;对待编码图像块进行下采样,得到第一图像块;对第一图像块进行编码,得到码流;将上采样滤波器指示信息写入码流。In a first aspect, an image coding method is provided, the method comprising: determining a target upsampling filter from a preset set of upsampling filters; generating upsampling filter indication information corresponding to the target upsampling filter; Downsampling the image block to be coded to obtain a first image block; encoding the first image block to obtain a code stream; writing the upsampling filter instruction information into the code stream.

其中,上述上采样滤波器集合至少包括FIR上采样滤波器和卷积神经网络(Convolutional Neural Network,CNN)上采样滤波器,FIR下采样滤波器可以是双三次上采样滤波器,CNN上采样滤波器可以是由卷积神经网络构成的上采样滤波器。Wherein, the above-mentioned upsampling filter set includes at least FIR upsampling filter and convolutional neural network (Convolutional Neural Network, CNN) upsampling filter, FIR downsampling filter can be bicubic upsampling filter, CNN upsampling filter The filter can be an upsampling filter composed of a convolutional neural network.

上述上采样滤波器指示信息可以用于指示上采样滤波器集合中某个上采样滤波器为目标上采样滤波器。例如,上采样滤波器指示信息可以指示上采样滤波器集合中的FIR上采样滤波器作为目标上采样滤波器,或者,上采样滤波器指示信息还可以指示上采样滤波器集合中的CNN上采样滤波器作为目标上采样滤波器。The above upsampling filter indication information may be used to indicate that a certain upsampling filter in the upsampling filter set is a target upsampling filter. For example, the upsampling filter indication information may indicate the FIR upsampling filter in the upsampling filter set as the target upsampling filter, or the upsampling filter indication information may also indicate the CNN upsampling filter in the upsampling filter set filter as the target upsampling filter.

可选地,上采样滤波器指示信息具体为上采样滤波器选择标志Flag2,Flag2的取值用于指示目标上采样滤波器。Optionally, the upsampling filter indication information is specifically an upsampling filter selection flag Flag2, and a value of Flag2 is used to indicate a target upsampling filter.

例如,当确定FIR滤波器为目标上采样滤波器时,Flag2的取值为0;而当确定CNN滤波器为目标上采样滤波器时,Flag2的取值为1。或者,当确定FIR滤波器为目标上采样滤波器时,Flag2的取值为1;而当确定CNN滤波器为目标上采样滤波器时,Flag2的取值为0。For example, when the FIR filter is determined to be the target upsampling filter, the value of Flag2 is 0; and when the CNN filter is determined to be the target upsampling filter, the value of Flag2 is 1. Alternatively, when the FIR filter is determined to be the target upsampling filter, the value of Flag2 is 1; and when the CNN filter is determined to be the target upsampling filter, the value of Flag2 is 0.

应理解,从预先设置的上采样滤波器集合中确定出目标上采样滤波器与从下采样滤波器集合中确定出目标下采样滤波器是两个相互独立的过程。确定出目标上采样滤波器和确定出目标下采样滤波器在时间上没有先后之分,既可以先确定出目标上采样滤波器,也可以先确定出目标下采样滤波器,或者,也可以同时确定出目标上采样滤波器和目标下采样滤波器。It should be understood that determining the target up-sampling filter from the preset up-sampling filter set and determining the target down-sampling filter from the down-sampling filter set are two independent processes. Determining the target up-sampling filter and determining the target down-sampling filter have no priority in terms of time. The target up-sampling filter can be determined first, or the target down-sampling filter can be determined first, or at the same time A target up-sampling filter and a target down-sampling filter are determined.

可选地,对第一图像块进行编码,得到码流,包括:对第一图像块进行预测、变换、量化和熵编码,得到码流。Optionally, encoding the first image block to obtain a code stream includes: performing prediction, transformation, quantization, and entropy encoding on the first image block to obtain a code stream.

具体地,可以通过对第一图像块进行进行预测,得到预测号,在得到预测信号之后,可以通过第一图像块的原始信号减去预测信号,得到原始残差信号,接下来再对原始残差信号进行变换和量化,得到量化系数,最后再对量化系数进行熵编码就得到了码流。Specifically, the prediction number can be obtained by predicting the first image block. After obtaining the prediction signal, the original signal can be subtracted from the original signal of the first image block to obtain the original residual signal, and then the original residual signal can be obtained. Transform and quantize the difference signal to obtain quantized coefficients, and finally perform entropy coding on the quantized coefficients to obtain a code stream.

本申请中,可以从预先设置的多种上采样滤波器选择一个目标上采样滤波器,以进行后续的上采样操作,与直接采用固定参数值的上采样滤波器进行后续的上采样操作相比,本申请中的上采样滤波器的选择范围更大,能够根据情况选择合适的上采样滤波器作为目标上采样滤波器。In this application, a target upsampling filter can be selected from a variety of pre-set upsampling filters for subsequent upsampling operations, compared with directly using an upsampling filter with a fixed parameter value for subsequent upsampling operations , the selection range of the up-sampling filter in this application is wider, and an appropriate up-sampling filter can be selected as the target up-sampling filter according to the situation.

在一种可能的实现方式中,对待编码图像块进行下采样,得到第一图像块,具体包括:采用预先设置的FIR下采样滤波器对待编码图像块进行下采样,得到第一图像块。In a possible implementation manner, downsampling the image block to be encoded to obtain the first image block specifically includes: downsampling the image block to be encoded by using a preset FIR downsampling filter to obtain the first image block.

通过采用预先设置的FIR下采样滤波器直接进行下采样操作,不必再从多种下采样滤波器中选择目标下采样滤波器,能够降低编码运算的复杂度,提高编码效率。By using the preset FIR down-sampling filter to directly perform the down-sampling operation, it is no longer necessary to select a target down-sampling filter from various down-sampling filters, which can reduce the complexity of encoding operations and improve encoding efficiency.

在一种可能的实现方式中,上述方法还包括:对量化系数进行反变换和反量化,得到初始重建图像块;采用目标上采样滤波器对初始重建图像块进行上采样,得到目标重建图像块;对量化系数进行熵编码,得到码流;将上采样滤波器指示信息写入码流。In a possible implementation, the above method further includes: performing inverse transformation and inverse quantization on the quantized coefficients to obtain an initial reconstructed image block; using a target upsampling filter to upsample the initial reconstructed image block to obtain a target reconstructed image block ; Perform entropy coding on the quantized coefficients to obtain a code stream; write the upsampling filter indication information into the code stream.

由于对图像块进行了下采样操作,使得下采样得到的第一图像块的分辨率小于待编码图像块的原始分辨率。在图像块重建时,初始图像块的分辨率也小于待编码图像块的原始分辨率的,在对初始图像块进行上采样之后得到的目标重建图像块的分辨率才与待编码图像块的原始分辨率相同。Since the downsampling operation is performed on the image block, the resolution of the first image block obtained by downsampling is smaller than the original resolution of the image block to be encoded. When the image block is reconstructed, the resolution of the initial image block is also smaller than the original resolution of the image block to be encoded, and the resolution of the target reconstructed image block obtained after upsampling the initial image block is the same as the original The resolution is the same.

在一种可能的实现方式中,从上采样滤波器集合中确定出目标上采样滤波器,具体包括:根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器。In a possible implementation manner, determining the target upsampling filter from the upsampling filter set specifically includes: determining the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded filter.

可选地,根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,包括:将上采样滤波器集合中对应的编码代价满足预设要求的上采样滤波器确定为目标上采样滤波器。Optionally, determining the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded includes: upsampling the corresponding encoding cost in the upsampling filter set to meet the preset requirements The filter is determined to be the target upsampling filter.

在一种可能的实现方式中,将上采样滤波器集合中对应的编码代价满足预设要求的上采样滤波器确定为目标上采样滤波器,包括:确定上采样滤波器集合中的每种上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价;将上采样滤波器集合中的第一上采样滤波器确定为目标上采样滤波器,其中,在上采样滤波器集合中,第一上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价最小。In a possible implementation manner, determining an upsampling filter whose corresponding coding cost in the upsampling filter set satisfies a preset requirement as a target upsampling filter includes: determining each type of upsampling filter in the upsampling filter set The encoding cost of the image block to be encoded when the sampling filter is used as the target up-sampling filter; the first up-sampling filter in the up-sampling filter set is determined as the target up-sampling filter, wherein, in the up-sampling filter set, When the first upsampling filter is used as the target upsampling filter, the encoding cost of the image block to be encoded is the smallest.

通过比较上采样滤波器集合中各个上采样滤波器进行上采样操作时对应的待编码图像块的编码代价,能够从中选择对应编码代价最小的上采样滤波器作为目标上采样滤波器,能够尽可能的降低编码过程中产生的编码代价,取得更好的编码效果。By comparing the encoding costs of the corresponding image blocks to be encoded when each upsampling filter in the upsampling filter set performs an upsampling operation, the upsampling filter corresponding to the smallest encoding cost can be selected as the target upsampling filter. It reduces the encoding cost generated in the encoding process and achieves better encoding effect.

应理解,上述编码代价具体可以是编码过程中图像块的率失真代价,图像块的失真等等。It should be understood that the above encoding cost may specifically be a rate-distortion cost of an image block in an encoding process, a distortion of an image block, and the like.

在一种可能的实现方式中,从预先设置的上采样滤波器集合中确定出目标上采样滤波器,具体包括:根据待编码图像块的纹理特征从上采样滤波器确定出目标上采样滤波器。In a possible implementation manner, determining the target upsampling filter from a preset set of upsampling filters specifically includes: determining the target upsampling filter from the upsampling filter according to the texture feature of the image block to be encoded .

例如,当待编码图像块的纹理比较稀疏时可以选择FIR上采样滤波器作为目标上采样滤波器;当待编码图像块的纹理比较密集时,为了保证编码效果,可以选择CNN上采样滤波器作为目标上采样滤波器。For example, when the texture of the image block to be encoded is relatively sparse, the FIR upsampling filter can be selected as the target upsampling filter; when the texture of the image block to be encoded is relatively dense, in order to ensure the encoding effect, the CNN upsampling filter can be selected as the target upsampling filter. Target upsampling filter.

根据图像块的纹理特性能够灵活地选择与图像块比较匹配的上采样滤波器作为目标上采样滤波器,能够提高不同纹理特性的图像块的编码效果。According to the texture characteristics of the image block, an upsampling filter that matches the image block can be flexibly selected as the target upsampling filter, and the coding effect of image blocks with different texture characteristics can be improved.

在一种可能的实现方式中,从预先设置的上采样滤波器集合中确定出目标上采样滤波器,具体包括:根据待编码图像块的频谱特性从上采样滤波器确定出采样滤波器。In a possible implementation manner, determining the target upsampling filter from a preset set of upsampling filters specifically includes: determining the sampling filter from the upsampling filter according to the spectral characteristics of the image block to be encoded.

例如,当待编码图像块的高频分量较多时,可以选择CNN上采样滤波器作为目标上采样滤波器,而当待编码图像块的高频分量较少时,可以选择FIR滤波器作为上采样滤波器。For example, when there are many high-frequency components of the image block to be encoded, the CNN upsampling filter can be selected as the target upsampling filter, and when the high-frequency components of the image block to be encoded are small, the FIR filter can be selected as the upsampling filter filter.

根据图像块的频谱特性能够选择与图像块相匹配的上采样滤波器作为目标上采样滤波器,能够提高不同频谱特性的图像块的编码效果。According to the spectral characteristics of the image block, an upsampling filter matching the image block can be selected as a target upsampling filter, which can improve the coding effect of image blocks with different spectral characteristics.

在一种可能的实现方式中,CNN上采样滤波器的参数值为预设的,该CNN上采样滤波器的参数值是对预设图像训练集进行离线训练得到的。In a possible implementation manner, the parameter value of the CNN upsampling filter is preset, and the parameter value of the CNN upsampling filter is obtained by performing offline training on a preset image training set.

由于CNN上采样滤波器的参数值是通过离线训练得到的,因此,在编码过程中采用CNN上采样滤波器进行上采样的话,能够降低上采样过程中图像的信息损失,提升图像编码质量。Since the parameter values of the CNN upsampling filter are obtained through offline training, if the CNN upsampling filter is used for upsampling during the encoding process, the information loss of the image during the upsampling process can be reduced and the image encoding quality can be improved.

在一种可能的实现方式中,从预先设置的上采样滤波器集合中确定目标上采样滤波器之前,上述方法还包括:根据待编码图像块对CNN上采样滤波器进行在线训练,得到CNN上采样滤波器的更新参数值。In a possible implementation, before determining the target upsampling filter from the pre-set upsampling filter set, the above method further includes: performing online training on the CNN upsampling filter according to the image block to be coded to obtain the CNN upsampling filter The update parameter value for the sampling filter.

其中,上述CNN上采样滤波器的更新参数值用于替代CNN上采样滤波器预先设置的参数值。Wherein, the above updated parameter value of the CNN upsampling filter is used to replace the preset parameter value of the CNN upsampling filter.

可选地,上述方法还包括:将CNN上采样滤波器的更新参数值写入码流。Optionally, the above method further includes: writing the updated parameter value of the CNN upsampling filter into the code stream.

通过在线训练CNN上采样滤波器,能够根据图像纹理特征使用滤波器参数更加匹配的上采样滤波器做上采样操作,与采用预置的CNN上采样滤波器相比,可以进一步提升上采样输出的图像块的图像质量。By training the CNN upsampling filter online, an upsampling filter with more matching filter parameters can be used for the upsampling operation according to the image texture characteristics. Compared with the preset CNN upsampling filter, the upsampling output can be further improved. The image quality of the image block.

在一种可能的实现方式中,在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,上述方法还包括:根据待编码图像块的编码代价从原分辨率编码模式和变分辨率编码模式中确定出目标编码模式;生成与目标编码模式对应的编码模式指示信息;将编码模式指示信息写入码流。In a possible implementation manner, before determining the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded, the above method further includes: according to the encoding cost of the image block to be encoded Determine the target encoding mode from the original resolution encoding mode and the variable resolution encoding mode; generate encoding mode indication information corresponding to the target encoding mode; write the encoding mode indication information into the code stream.

可选地,根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,具体包括:确定原分辨率编码模式下待编码图像块的编码代价;确定变分辨率编码模式下待编码图像块的编码代价;从原分辨率编码模式和变分辨率编码模式中选择编码代价最小的编码模式作为目标编码模式。Optionally, the target upsampling filter is determined from the preset upsampling filter set according to the encoding cost of the image block to be encoded, which specifically includes: determining the encoding cost of the image block to be encoded in the original resolution encoding mode; determining the variable The encoding cost of the image block to be encoded in the resolution encoding mode; the encoding mode with the smallest encoding cost is selected from the original resolution encoding mode and the variable resolution encoding mode as the target encoding mode.

上述编码模式指示信息用于指示候选编码模式中的何种编码模式为目标编码模式。例如,上述编码模式指示信息可以指示原分辨率编码模式为目标编码模式,或者,上述编码模式指示信息也可以指示变分辨率编码模式为目标编码模式。The above coding mode indication information is used to indicate which coding mode among the candidate coding modes is the target coding mode. For example, the above encoding mode indication information may indicate that the original resolution encoding mode is the target encoding mode, or the above encoding mode indication information may also indicate the variable resolution encoding mode as the target encoding mode.

根据待编码图像块的编码代价能够选择编码代价较小的编码模式作为目标编码模式,可以减少编码过程中图像编码的损失。According to the encoding cost of the image block to be encoded, an encoding mode with a lower encoding cost can be selected as the target encoding mode, which can reduce the loss of image encoding in the encoding process.

应理解,当确定采用变分辨率编码模式对待编码图像块进行编码时才会根据图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器。而当确定采用变分辨率编码模式对待编码图像块进行编码时,直接采用原分辨率编码模式对待编码图像块进行编码,而不需要再确定目标上采样滤波器,因为在原分辨率编码模式下不需要进行上采样操作。It should be understood that the target upsampling filter is determined from the preset upsampling filter set according to the coding cost of the image block when it is determined to use the variable resolution coding mode to encode the image block to be coded. When it is determined to use the variable resolution coding mode to encode the image block to be coded, the original resolution coding mode is directly used to encode the image block to be coded, and there is no need to determine the target upsampling filter, because in the original resolution coding mode, there is no Upsampling is required.

第二方面,提供了一种图像编码方法,该方法包括:根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,上采样滤波器集合至少包括FIR上采样滤波器和CNN上采样滤波器;生成与目标上采样滤波器对应的上采样滤波器指示信息;将预先设置的下采样滤波器集合中与目标上采样滤波器类型相同的下采样滤波器确定为目标下采样滤波器,其中,下采样滤波器集合至少包括FIR下采样滤波器和CNN下采样滤波器;采用目标下采样滤波器对待编码图像块进行下采样,得到第一图像块;对第一图像块进行编码,得到码流;将上采样滤波器指示信息写入码流。In a second aspect, an image coding method is provided, which includes: determining a target upsampling filter from a preset set of upsampling filters according to the coding cost of an image block to be coded, wherein the set of upsampling filters is at least Including FIR upsampling filter and CNN upsampling filter; generating upsampling filter indication information corresponding to the target upsampling filter; downsampling the same type of downsampling filter as the target upsampling filter in the pre-set downsampling filter set The filter is determined as a target downsampling filter, wherein the downsampling filter set includes at least an FIR downsampling filter and a CNN downsampling filter; the target downsampling filter is used to downsample the image block to be coded to obtain the first image block ; Encoding the first image block to obtain a code stream; writing the upsampling filter indication information into the code stream.

例如,上采样滤波器指示信息可以指示上采样滤波器集合中的FIR上采样滤波器作为目标上采样滤波器,或者,该上采样滤波器指示信息还可以指示上采样滤波器集合中的CNN上采样滤波器作为目标上采样滤波器。For example, the upsampling filter indication information may indicate the FIR upsampling filter in the upsampling filter set as the target upsampling filter, or the upsampling filter indication information may also indicate the CNN upper sampling filter in the upsampling filter set The sampling filter acts as the target upsampling filter.

本申请中,可以根据编码代价从上采样滤波器集合中确定出目标上采样滤波器,与直接采用固定参数值的上采样滤波器进行上采样操作相比,本申请方案在选择目标上采样滤波器时充分考虑了待编码图像块的编码代价,能够取得更好的编码效果。In this application, the target upsampling filter can be determined from the set of upsampling filters according to the encoding cost. Compared with directly using the upsampling filter with fixed parameter values for the upsampling operation, this application scheme selects the target upsampling filter The encoding cost of the image block to be encoded is fully considered when the encoder is used, and better encoding effect can be achieved.

在一种可能的实现方式中,根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,包括:确定上采样滤波器集合中的每种上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价;将上采样滤波器集合中的第一上采样滤波器确定为目标上采样滤波器,其中,在上采样滤波器集合中,上采样滤波器集合中的第一上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价最小。In a possible implementation, determining the target upsampling filter from a preset upsampling filter set according to the encoding cost of the image block to be encoded includes: determining each type of upsampling filter in the upsampling filter set The encoding cost of the image block to be encoded when the filter is used as the target upsampling filter; the first upsampling filter in the upsampling filter set is determined as the target upsampling filter, wherein, in the upsampling filter set, the upsampling When the first upsampling filter in the filter set is used as the target upsampling filter, the encoding cost of the image block to be encoded is the smallest.

本申请中,通过选择编码代价最小的上采样滤波器作为目标上采样滤波器,能够尽可能的降低编码过程中产生的编码代价,可以取得更好的编码效果。In this application, by selecting the upsampling filter with the smallest coding cost as the target upsampling filter, the coding cost generated in the coding process can be reduced as much as possible, and better coding effect can be achieved.

在一种可能的实现方式中,CNN上采样滤波器的参数值为预设的,该CNN上采样滤波器的参数值是对预设图像训练集进行离线训练得到的。In a possible implementation manner, the parameter value of the CNN upsampling filter is preset, and the parameter value of the CNN upsampling filter is obtained by performing offline training on a preset image training set.

由于CNN上采样滤波器的参数值是通过离线训练得到的,因此,在编码过程中如果采用CNN上采样滤波器进行上采样,能够降低上采样过程中图像的信息损失,提升图像编码质量。Since the parameter values of the CNN upsampling filter are obtained through offline training, if the CNN upsampling filter is used for upsampling during the encoding process, the information loss of the image during the upsampling process can be reduced and the image encoding quality can be improved.

在一种可能的实现方式中,CNN下采样滤波器的参数值为预设的,CNN下采样滤波器的参数值是对预设图像训练集进行离线训练得到的。In a possible implementation manner, the parameter value of the CNN downsampling filter is preset, and the parameter value of the CNN downsampling filter is obtained by performing offline training on a preset image training set.

由于CNN下采样滤波器的参数值是通过离线训练得到的,因此,在编码过程中如果采用CNN下采样滤波器进行下采样,能够降低下采样过程中图像的信息损失,提升图像编码质量。Since the parameter values of the CNN downsampling filter are obtained through offline training, if the CNN downsampling filter is used for downsampling during the encoding process, the information loss of the image during the downsampling process can be reduced and the image encoding quality can be improved.

在一种可能的实现方式中,CNN上采样滤波器的参数值和CNN下采样滤波器的参数值均为预设的,CNN上采样滤波器的参数值和CNN下采样滤波器的参数值是在离线情况下对预设图像训练集进行联合训练得到的。In a possible implementation, the parameter values of the CNN upsampling filter and the CNN downsampling filter are preset, and the parameter values of the CNN upsampling filter and the CNN downsampling filter are It is obtained by joint training on the preset image training set offline.

由于CNN上、下采样滤波器是在离线情况下通过联合训练的方式获得的,因此,在编码过程中能够降低图像纹理在上、下采样过程中所带来的信息损失,提升编码图像质量。Since the CNN upsampling and downsampling filters are obtained through joint training offline, the information loss caused by the upsampling and downsampling of the image texture can be reduced during the encoding process and the quality of the encoded image can be improved.

在一种可能的实现方式中,在采用目标下采样滤波器对待编码图像块进行下采样之前,上述方法还包括:根据待编码图像块对CNN下采样滤波器进行在线训练,得到CNN下采样滤波器的更新参数值,其中,该CNN下采样滤波器的更新参数值用于替代CNN下采样滤波器预先设置的参数值。In a possible implementation, before using the target downsampling filter to downsample the to-be-coded image block, the above method further includes: performing online training on the CNN downsampling filter according to the to-be-coded image block to obtain the CNN downsampling filter The update parameter value of the CNN downsampling filter, wherein the update parameter value of the CNN downsampling filter is used to replace the preset parameter value of the CNN downsampling filter.

通过在线训练CNN下采样滤波器参数能够尽可能的减少下采样操作带来的信息损失,提升重建图像质量。另外,由于CNN下采样滤波器仅在编码器使用,因此无需将CNN下采样滤波器参数传递到解码器,因而不会带来编码开销的增加。Through online training of CNN downsampling filter parameters, the information loss caused by the downsampling operation can be reduced as much as possible, and the quality of the reconstructed image can be improved. In addition, since the CNN downsampling filter is only used in the encoder, there is no need to pass the CNN downsampling filter parameters to the decoder, which will not increase the encoding overhead.

在一种可能的实现方式中,在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,上述方法还包括:根据待编码图像块对CNN上采样滤波器进行在线训练,得到CNN上采样滤波器的更新参数值,其中,CNN上采样滤波器的更新参数值用于替代CNN上采样滤波器预先设置的参数值。In a possible implementation, before determining the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded, the above method further includes: The sampling filter is trained online to obtain an updated parameter value of the CNN upsampling filter, wherein the updated parameter value of the CNN upsampling filter is used to replace the preset parameter value of the CNN upsampling filter.

通过在线训练CNN上采样滤波器,能够根据图像纹理特征使用滤波器参数更加匹配的上采样滤波器做上采样操作,与采用预置的CNN上采样滤波器相比,可以进一步提升上采样输出的图像块的图像质量。By training the CNN upsampling filter online, an upsampling filter with more matching filter parameters can be used for the upsampling operation according to the image texture characteristics. Compared with the preset CNN upsampling filter, the upsampling output can be further improved. The image quality of the image block.

在一种可能的实现方式中,在采用目标下采样滤波器对待编码图像块进行下采样之前,方法还包括:根据待编码图像块对CNN下采样滤波器和CNN上采样滤波器进行联合在线训练,得到CNN下采样滤波器的更新参数值和CNN上采样滤波器的更新参数值;其中,CNN下采样滤波器的更新参数值用于替代CNN下采样滤波器预先设置的参数值,CNN上采样滤波器的更新参数值用于替代CNN上采样滤波器预先设置的参数值。In a possible implementation, before using the target downsampling filter to downsample the image block to be encoded, the method further includes: performing joint online training on the CNN downsampling filter and the CNN upsampling filter according to the image block to be encoded , get the update parameter value of the CNN downsampling filter and the update parameter value of the CNN upsampling filter; wherein, the update parameter value of the CNN downsampling filter is used to replace the preset parameter value of the CNN downsampling filter, and the CNN upsampling filter The updated parameter values of the filter are used to replace the preset parameter values of the CNN upsampling filter.

可选地,根据待编码图像块对CNN下采样滤波器和CNN上采样滤波器进行联合在线训练,包括:使用CNN下采样滤波器对待编码图像块进行下采样,得到低分辨率的待编码图像块;使用编码端仿真器对低分辨率的待编码图像块进行图像编码,得到低分率的重建图像块;使用CNN上采样滤波器对低分辨率的重建图像块进行上采样,得到目标重建图像块;将待编码图像块与所述目标重建图像块的差异最小时的上采样滤波器参数和下采样滤波器参数确定为CNN上采样滤波器的更新参数值和CNN下采样滤波器的更新参数值。Optionally, the CNN downsampling filter and the CNN upsampling filter are jointly trained online according to the image block to be encoded, including: using the CNN downsampling filter to downsample the image block to be encoded to obtain a low-resolution image to be encoded block; use the encoder emulator to encode the low-resolution image block to be encoded to obtain a low-resolution reconstructed image block; use the CNN upsampling filter to up-sample the low-resolution reconstructed image block to obtain the target reconstruction Image block; The upsampling filter parameter and the downsampling filter parameter when the difference between the image block to be encoded and the target reconstruction image block are the smallest are determined as the update parameter value of the CNN upsampling filter and the update of the CNN downsampling filter parameter value.

通过在线训练CNN上采样滤波器和CNN下采样滤波器,能够根据图像纹理特征使用滤波器参数更加匹配的上采样滤波器和下采样滤波器做上采样操作和下采样操作,与采用预置的CNN上采样滤波器和CNN下采样滤波器相比,可以进一步提升上采样输出的图像块的图像质量。Through online training of CNN upsampling filter and CNN downsampling filter, it is possible to use upsampling filter and downsampling filter with more matching filter parameters to perform upsampling and downsampling operations according to image texture characteristics, which is different from using preset Compared with the CNN downsampling filter, the CNN upsampling filter can further improve the image quality of the upsampling output image block.

在一种可能的实现方式中,上述方法还包括:将CNN上采样滤波器的更新参数值写入码流。In a possible implementation manner, the above method further includes: writing the updated parameter value of the CNN upsampling filter into the code stream.

在一种可能的实现方式中,在将上采样滤波器集合中对应的编码代价满足预设要求的上采样滤波器确定为目标上采样滤波器之前,上述方法还包括:In a possible implementation manner, before determining an upsampling filter whose corresponding encoding cost meets a preset requirement in the upsampling filter set as a target upsampling filter, the above method further includes:

根据待编码图像块对CNN上采样滤波器和CNN下采样滤波进行在线进行联合训练,得到CNN上采样滤波器的更新参数值和CNN下采样滤波器的更新参数值。According to the image block to be encoded, the CNN upsampling filter and the CNN downsampling filter are jointly trained online to obtain the updated parameter value of the CNN upsampling filter and the updated parameter value of the CNN downsampling filter.

在一种可能的实现方式中,在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,上述方法还包括:将候选编码模式中对应的编码代价满足预设要求的编码模式确定为目标编码模式,其中,候选编码模式包括原分辨率编码模式和变分辨率编码模式;生成编码模式指示信息,编码模式指示信息用于指示目标编码模式;将编码模式指示信息写入码流。In a possible implementation manner, before determining the target upsampling filter from the preset upsampling filter set according to the coding cost of the image block to be coded, the above method further includes: The encoding mode whose cost meets the preset requirements is determined as the target encoding mode, wherein the candidate encoding mode includes the original resolution encoding mode and the variable resolution encoding mode; encoding mode indication information is generated, and the encoding mode indication information is used to indicate the target encoding mode; The encoding mode instruction information is written into the code stream.

在一种可能的实现方式中,在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,上述方法还包括:根据待编码图像块的编码代价从原分辨率编码模式和变分辨率编码模式中确定出目标编码模式;生成与目标编码模式对应的编码模式指示信息;将编码模式指示信息写入码流。In a possible implementation manner, before determining the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded, the above method further includes: according to the encoding cost of the image block to be encoded Determine the target encoding mode from the original resolution encoding mode and the variable resolution encoding mode; generate encoding mode indication information corresponding to the target encoding mode; write the encoding mode indication information into the code stream.

可选地,根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,具体包括:确定原分辨率编码模式下待编码图像块的编码代价;确定变分辨率编码模式下待编码图像块的编码代价;从原分辨率编码模式和变分辨率编码模式中选择编码代价最小的编码模式作为目标编码模式。Optionally, the target upsampling filter is determined from the preset upsampling filter set according to the encoding cost of the image block to be encoded, which specifically includes: determining the encoding cost of the image block to be encoded in the original resolution encoding mode; determining the variable The encoding cost of the image block to be encoded in the resolution encoding mode; the encoding mode with the smallest encoding cost is selected from the original resolution encoding mode and the variable resolution encoding mode as the target encoding mode.

上述编码模式指示信息用于指示候选编码模式中的何种编码模式为目标编码模式。例如,上述编码模式指示信息可以指示原分辨率编码模式为目标编码模式,或者,上述编码模式指示信息也可以指示变分辨率编码模式为目标编码模式。The above coding mode indication information is used to indicate which coding mode among the candidate coding modes is the target coding mode. For example, the above encoding mode indication information may indicate that the original resolution encoding mode is the target encoding mode, or the above encoding mode indication information may also indicate the variable resolution encoding mode as the target encoding mode.

根据待编码图像块的编码代价能够选择编码代价较小的编码模式作为目标编码模式,可以减少编码过程中图像编码的损失。According to the encoding cost of the image block to be encoded, an encoding mode with a lower encoding cost can be selected as the target encoding mode, which can reduce the loss of image encoding in the encoding process.

应理解,当确定采用变分辨率编码模式对待编码图像块进行编码时才会根据图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器。而当确定采用变分辨率编码模式对待编码图像块进行编码时,直接采用原分辨率编码模式对待编码图像块进行编码,而不需要再确定目标上采样滤波器,因为在原分辨率编码模式下不需要进行上采样操作。It should be understood that the target upsampling filter is determined from the preset upsampling filter set according to the coding cost of the image block when it is determined to use the variable resolution coding mode to encode the image block to be coded. When it is determined to use the variable resolution coding mode to encode the image block to be coded, the original resolution coding mode is directly used to encode the image block to be coded, and there is no need to determine the target upsampling filter, because in the original resolution coding mode, there is no Upsampling is required.

第三方面,提供一种图像编码方法,该方法包括:根据待编码图像块的编码代价从预先设置的下采样滤波器集合中确定出目标下采样滤波器,其中,下采样滤波器集合至少包括有限冲击响应FIR下采样滤波器和卷积神经网络CNN下采样滤波器;采用目标下采样滤波器对待编码图像块进行下采样,得到第一图像块;对第一图像块进行编码,得到码流;将预先设置的上采样滤波器集合中与目标下采样滤波器类型相同的上采样滤波器确定为目标上采样滤波器,其中,上采样滤波器集合至少包括FIR上采样滤波器和CNN上采样滤波器;生成与目标上采样滤波器对应的上采样滤波器指示信息;将上采样滤波器指示信息写入码流。In a third aspect, an image coding method is provided, which includes: determining a target downsampling filter from a preset downsampling filter set according to the coding cost of the image block to be coded, wherein the downsampling filter set includes at least The finite impulse response FIR downsampling filter and the convolutional neural network CNN downsampling filter; the target downsampling filter is used to downsample the image block to be encoded to obtain the first image block; the first image block is encoded to obtain the code stream ;Determine the upsampling filter with the same type as the target downsampling filter in the preset upsampling filter set as the target upsampling filter, wherein the upsampling filter set includes at least an FIR upsampling filter and a CNN upsampling filter filter; generate upsampling filter indication information corresponding to the target upsampling filter; write the upsampling filter indication information into the code stream.

例如,上采样滤波器指示信息可以指示上采样滤波器集合中的FIR上采样滤波器作为目标上采样滤波器,或者,该上采样滤波器指示信息还可以指示上采样滤波器集合中的CNN上采样滤波器作为目标上采样滤波器。For example, the upsampling filter indication information may indicate the FIR upsampling filter in the upsampling filter set as the target upsampling filter, or the upsampling filter indication information may also indicate the CNN upper sampling filter in the upsampling filter set The sampling filter acts as the target upsampling filter.

本申请中,可以根据编码代价从下采样滤波器集合中确定出目标下采样滤波器,并根据下采样滤波器的滤波器类型确定上采样滤波器,与直接采用固定参数值的上采样滤波器进行上采样操作相比,本申请方案在选择目标上采样滤波器时充分考虑了待编码图像块的编码代价,能够取得更好的编码效果。In this application, the target downsampling filter can be determined from the downsampling filter set according to the encoding cost, and the upsampling filter can be determined according to the filter type of the downsampling filter, and the upsampling filter directly using fixed parameter values Compared with the upsampling operation, the scheme of the present application fully considers the coding cost of the image block to be coded when selecting the target upsampling filter, and can achieve better coding effect.

在一种可能的实现方式中,根据待编码图像块的编码代价从预先设置的下采样滤波器集合中确定出目标下采样滤波器,包括:确定下采样滤波器集合中的每种下采样滤波器作为目标下采样滤波器时待编码图像块的编码代价;将下采样滤波器集合中的第一下采样滤波器确定为目标下采样滤波器,其中,在下采样滤波器集合中,下采样滤波器集合中的第一下采样滤波器作为目标下采样滤波器时待编码图像块的编码代价最小。In a possible implementation manner, determining the target downsampling filter from a preset set of downsampling filters according to the encoding cost of the image block to be encoded includes: determining each downsampling filter in the set of downsampling filters The encoding cost of the image block to be encoded when the filter is used as the target downsampling filter; the first downsampling filter in the downsampling filter set is determined as the target downsampling filter, wherein, in the downsampling filter set, the downsampling filter When the first downsampling filter in the filter set is used as the target downsampling filter, the encoding cost of the image block to be encoded is the smallest.

本申请中,通过选择编码代价最小的下采样滤波器作为目标下采样滤波器,能够尽可能的降低编码过程中产生的编码代价,可以取得更好的编码效果。In this application, by selecting the down-sampling filter with the smallest coding cost as the target down-sampling filter, the coding cost generated in the coding process can be reduced as much as possible, and a better coding effect can be achieved.

第四方面,提供了一种图像解码方法,该方法包括:获取码流;对码流进行熵解码、反量化和反变换,得到待解码图像块的重建残差信号;获取待解码图像块的预测信号;将重建残差信号和预测信号相加,得到待解码图像块的初始重建图像块;解析码流,获取编码模式指示信息;根据编码模式指示信息从原分辨率解码模式和变分辨率解码模式中确定目标解码模式;在目标解码模式为变分辨率解码模式的情况下,解析待编码图像块的码流,获取上采样滤波器指示信息;根据上采样滤波器指示信息从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,上采样滤波器集合至少包括有限冲击响应FIR上采样滤波器和卷积神经网络CNN上采样滤波器;采用目标上采样滤波器对初始重建图像块块进行上采样,得到目标重建图像块。In a fourth aspect, an image decoding method is provided, the method comprising: obtaining a code stream; performing entropy decoding, inverse quantization, and inverse transformation on the code stream to obtain a reconstructed residual signal of an image block to be decoded; obtaining a code stream of the image block to be decoded Prediction signal; add the reconstructed residual signal and the prediction signal to obtain the initial reconstructed image block of the image block to be decoded; analyze the code stream to obtain the coding mode indication information; according to the coding mode indication information, decode the mode from the original resolution and the variable resolution Determine the target decoding mode in the decoding mode; in the case that the target decoding mode is the variable resolution decoding mode, analyze the code stream of the image block to be encoded to obtain the upsampling filter indication information; according to the upsampling filter indication information from the preset The target upsampling filter is determined in the upsampling filter set, wherein the upsampling filter set includes at least a finite impulse response FIR upsampling filter and a convolutional neural network CNN upsampling filter; the target upsampling filter is used for the initial The reconstructed image block is up-sampled to obtain the target reconstructed image block.

其中,上述编码模式可以包括原分辨率编码模式和变分辨率编码模式,编码模式指示信息用于指示编码端在编码时采用的是原分辨率编码模式还是变分辨率编码模式。也就是说,上述编码模式指示信息会指示出上述码流是在哪种编码模式下得到的。例如,上述编码模式指示信息会指示上述码流是在原分辨率编码模式下或者变分辨率编码模式下编码得到的。Wherein, the above encoding mode may include an original resolution encoding mode and a variable resolution encoding mode, and the encoding mode indication information is used to indicate whether the encoding end adopts the original resolution encoding mode or the variable resolution encoding mode during encoding. That is to say, the above coding mode indication information will indicate in which coding mode the above code stream is obtained. For example, the above coding mode indication information may indicate that the code stream is obtained by coding in the original resolution coding mode or the variable resolution coding mode.

可选地,根据编码模式指示信息从原分辨率解码模式和变分辨率解码模式中确定目标解码模式,包括:当编码模式为变分辨率编码模式时,确定目标解码方式为变分辨率解码模式;当编码模式为原分辨率编码模式时,确定目标解码方式为原分辨率解码模式。Optionally, determining the target decoding mode from the original resolution decoding mode and the variable resolution decoding mode according to the coding mode indication information includes: when the coding mode is the variable resolution coding mode, determining that the target decoding mode is the variable resolution decoding mode ; When the encoding mode is the original resolution encoding mode, determine that the target decoding mode is the original resolution decoding mode.

解码端选择与编码端的编码模式相对应的解码模式作为目标解码模式,能够保证解码端的解码效果。The decoding end selects the decoding mode corresponding to the encoding mode of the encoding end as the target decoding mode, which can ensure the decoding effect of the decoding end.

本申请中,当在变分辨率解码模式下对图像块进行解码时,解码端能够根据上采样滤波器指示信息从预先设置的上采样滤波器集合中选择相应的上采样滤波器作为目标上采样滤波器,进而进行上采样操作,与直接采用固定参数的上采样滤波器进行上采样操作的方式相比,能够根据图像块的情况选择匹配的上采样滤波器进行上采样操作,从而提高解码效果。In this application, when decoding an image block in the variable resolution decoding mode, the decoding end can select the corresponding upsampling filter from the preset upsampling filter set as the target upsampling filter according to the upsampling filter indication information Filter, and then perform upsampling operation, compared with the way of directly using fixed parameter upsampling filter for upsampling operation, the matching upsampling filter can be selected according to the situation of the image block for upsampling operation, thereby improving the decoding effect .

可选地,上述编码模式指示信息具体为编码模式标志Flag1的取值,Flag1的不同取值表示不同的编码模式。Optionally, the above coding mode indication information is specifically a value of a coding mode flag Flag1, and different values of Flag1 represent different coding modes.

例如,Flag1的取值为0时表示原分辨编码模式,Flag1的取值为1时表示变分辨率编码模式。For example, when the value of Flag1 is 0, it indicates the original resolution encoding mode, and when the value of Flag1 is 1, it indicates the variable resolution encoding mode.

在一种可能的实现方式中,CNN上采样滤波器的参数值为预设的,该CNN上采样滤波器的参数值是对预设图像训练集进行离线训练得到的。In a possible implementation manner, the parameter value of the CNN upsampling filter is preset, and the parameter value of the CNN upsampling filter is obtained by performing offline training on a preset image training set.

由于CNN上采样滤波器的参数值是通过离线训练得到的,因此,在解码过程中采用CNN上采样滤波器进行上采样可以能够降低上采样过程中图像的信息损失,提升图像解码质量。Since the parameter values of the CNN upsampling filter are obtained through offline training, using the CNN upsampling filter for upsampling during the decoding process can reduce the information loss of the image during the upsampling process and improve the image decoding quality.

在一种可能的实现方式中,上述方法还包括:解析码流,获取CNN上采样滤波器的更新参数值,该CNN上采样滤波器的更新参数值用于替代CNN上采样滤波器预先设置的参数值。In a possible implementation, the above method further includes: parsing the code stream to obtain an updated parameter value of the CNN upsampling filter, where the updated parameter value of the CNN upsampling filter is used to replace the preset value of the CNN upsampling filter parameter value.

通过对CNN上采样滤波器的参数值进行更新,能够获取与图像内容更加匹配的滤波器参数,从而在利用CNN上采样滤波器进行上采样操作时进一步减小图像的信息损失,提升图像解码质量。By updating the parameter values of the CNN upsampling filter, filter parameters that better match the image content can be obtained, thereby further reducing image information loss and improving image decoding quality when using the CNN upsampling filter for upsampling operations .

在一种可能的实现方式中,在解析码流,获取CNN上采样滤波器的更新参数值之前,方法还包括:解析码流,获取滤波器参数更新指示信息,滤波器参数更新指示信息用于指示是否对目标上采样滤波器的参数值进行更新;解析码流,获取CNN上采样滤波器的更新参数值,包括:在滤波器参数更新指示信息指示对目标上采样滤波器的参数进行更新的情况下,解析码流,获取CNN上采样滤波器的更新参数值。In a possible implementation, before parsing the code stream and obtaining the update parameter value of the CNN upsampling filter, the method further includes: parsing the code stream, obtaining filter parameter update indication information, and the filter parameter update indication information is used for Indicates whether to update the parameter value of the target upsampling filter; parse the code stream to obtain the updated parameter value of the CNN upsampling filter, including: indicating that the parameters of the target upsampling filter are updated in the filter parameter update instruction information In this case, parse the code stream to obtain the updated parameter value of the CNN upsampling filter.

通过滤波器参数更新指示信息指示需要对目标上采样滤波器进行更新的情况下,才从码流中获取CNN上采样滤波器的更新值,能够减少解码的负担,提高解码效率。The update value of the CNN upsampling filter is obtained from the code stream only when the filter parameter update indication information indicates that the target upsampling filter needs to be updated, which can reduce the decoding burden and improve decoding efficiency.

可选地,上述滤波器参数更新指示信息携带在序列参数集(Sequence ParamaterSet,SPS)或者图像参数集(Picture Paramater Set,PPS)中。Optionally, the above filter parameter update instruction information is carried in a sequence parameter set (Sequence ParamaterSet, SPS) or a picture parameter set (Picture Paramater Set, PPS).

可选地,CNN上采样滤波器的更新参数值是根据待编码图像块对CNN上采样网络进行在线训练得到的,其中,待解码图像块是对待编码图像块进行编码得到的。Optionally, the update parameter value of the CNN upsampling filter is obtained by online training of the CNN upsampling network according to the image block to be encoded, wherein the image block to be decoded is obtained by encoding the image block to be encoded.

通过在线训练CNN上采样滤波器,能够根据图像纹理特征使用滤波器参数更加匹配的上采样滤波器做上采样操作,与采用预置的CNN上采样滤波器相比,可以进一步提升上采样输出的图像块的图像质量。By training the CNN upsampling filter online, an upsampling filter with more matching filter parameters can be used for the upsampling operation according to the image texture characteristics. Compared with the preset CNN upsampling filter, the upsampling output can be further improved. The image quality of the image block.

第五方面,提供一种图像编码装置,上述图像编码装置包括用于执行上述第一方面、第二方面或者第三方面所述的方法的模块。In a fifth aspect, an image encoding device is provided, and the image encoding device includes a module for performing the method described in the first aspect, the second aspect, or the third aspect.

第六方面,提供一种图像解码装置,上述图像解码装置包括用于执行上述第四方面所述的方法的模块。According to a sixth aspect, an image decoding device is provided, and the image decoding device includes a module for performing the method described in the fourth aspect above.

第七方面,提供一种图像编码装置,上述图像编码装置包括:存储器,用于存储程序;处理器,用于执行上述存储器存储的程序,当上述程序被执行时,上述处理器用于执行上述第一方面、第二方面或者第三方面所述的方法。In a seventh aspect, there is provided an image coding device, the above image coding device includes: a memory for storing programs; a processor for executing the programs stored in the memory, and when the above programs are executed, the above processor is used for executing the above first The method described in one aspect, the second aspect or the third aspect.

第八方面,提供一种图像解码装置,上述图像解码装置包括:存储器,用于存储程序;处理器,用于执行上述存储器存储的程序,当上述程序被执行时,上述处理器用于执行上述第四方面所述的方法。In an eighth aspect, there is provided an image decoding device, the above-mentioned image decoding device includes: a memory for storing a program; a processor for executing the program stored in the memory, and when the above-mentioned program is executed, the above-mentioned processor is used for executing the above-mentioned first The method described in the four aspects.

第九方面,提供一种图像编码装置,包括非易失性存储介质,以及中央处理器,上述非易失性存储介质存储有可执行程序,上述中央处理器与上述非易失性存储介质连接,并执行上述可执行程序以实现上述第一方面、第二方面或者第三方面所述的方法。In a ninth aspect, an image encoding device is provided, including a non-volatile storage medium, and a central processing unit, the non-volatile storage medium stores an executable program, and the central processing unit is connected to the non-volatile storage medium , and execute the above-mentioned executable program to implement the method described in the above-mentioned first aspect, second aspect or third aspect.

第十方面,提供一种图像解码装置,包括非易失性存储介质,以及中央处理器,上述非易失性存储介质存储有可执行程序,上述中央处理器与上述非易失性存储介质连接,并执行上述可执行程序以实现上述第四方面所述的方法。In a tenth aspect, an image decoding device is provided, including a non-volatile storage medium, and a central processing unit, the non-volatile storage medium stores an executable program, and the central processing unit is connected to the non-volatile storage medium , and execute the above-mentioned executable program to implement the method described in the above-mentioned fourth aspect.

第十一方面,提供一种计算机可读介质,上述计算机可读介质存储用于设备执行的程序代码,上述程序代码包括用于执行上述第一方面、第二方面、第三方面或者第四方面所述的方法。In an eleventh aspect, a computer-readable medium is provided. The above-mentioned computer-readable medium stores program code for device execution, and the above-mentioned program code includes a program code for executing the above-mentioned first aspect, second aspect, third aspect or fourth aspect. the method described.

第十二方面,提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面、第二方面、第三方面或者第四方面所述的方法。In a twelfth aspect, there is provided a computer program product including instructions, which, when run on a computer, cause the computer to execute the method described in the first aspect, the second aspect, the third aspect or the fourth aspect.

第十三方面,提供一种电子设备,包括上述第五方面至第十方面中的图像编码装置,和/或上述第五方面至第十方面中的图像解码装置。In a thirteenth aspect, there is provided an electronic device, including the image encoding device in the fifth aspect to the tenth aspect above, and/or the image decoding device in the fifth aspect to the tenth aspect above.

附图说明Description of drawings

图1是图像编码过程的示意图;Fig. 1 is a schematic diagram of an image encoding process;

图2是图像解码过程的示意图;Fig. 2 is a schematic diagram of an image decoding process;

图3是数字图像的示意图;Fig. 3 is the schematic diagram of digital image;

图4是本申请实施例的图像编码方法的示意性流程图;FIG. 4 is a schematic flowchart of an image encoding method according to an embodiment of the present application;

图5是CNN滤波器的在线训练过程的示意图;Fig. 5 is the schematic diagram of the online training process of CNN filter;

图6是本申请实施例的图像编码方法的示意性流程图;FIG. 6 is a schematic flowchart of an image encoding method according to an embodiment of the present application;

图7是本申请实施例的图像编码方法的示意性流程图;FIG. 7 is a schematic flowchart of an image encoding method according to an embodiment of the present application;

图8是本申请实施例的图像解码方法的示意性流程图;FIG. 8 is a schematic flowchart of an image decoding method according to an embodiment of the present application;

图9是编码器的架构示意图;Figure 9 is a schematic diagram of the architecture of the encoder;

图10是本申请实施例的图像编码方法的流程图;FIG. 10 is a flowchart of an image encoding method according to an embodiment of the present application;

图11是CNN下采样网络的结构示意图;Figure 11 is a schematic structural diagram of a CNN downsampling network;

图12是本申请实施例的图像解码方法的流程图;FIG. 12 is a flowchart of an image decoding method according to an embodiment of the present application;

图13是CNN上采样网络的结构示意图;Fig. 13 is a schematic structural diagram of a CNN upsampling network;

图14是CNN滤波器的离线训练过程的示意图;Fig. 14 is a schematic diagram of the offline training process of the CNN filter;

图15是编码器的架构示意图;Figure 15 is a schematic diagram of the architecture of the encoder;

图16是编码器的架构示意图;Fig. 16 is a schematic diagram of the architecture of an encoder;

图17是本申请实施例的图像解码方法的流程图;FIG. 17 is a flowchart of an image decoding method according to an embodiment of the present application;

图18是本申请实施例的图像解码方法的流程图;FIG. 18 is a flowchart of an image decoding method according to an embodiment of the present application;

图19是本申请实施例的图像编码装置的示意性框图;FIG. 19 is a schematic block diagram of an image encoding device according to an embodiment of the present application;

图20是本申请实施例的图像编码装置的示意性框图;FIG. 20 is a schematic block diagram of an image encoding device according to an embodiment of the present application;

图21是本申请实施例的图像解码装置的示意性框图;FIG. 21 is a schematic block diagram of an image decoding device according to an embodiment of the present application;

图22是本申请实施例的编码器的示意性框图;Fig. 22 is a schematic block diagram of an encoder according to an embodiment of the present application;

图23是本申请实施例的解码器的示意性框图;Fig. 23 is a schematic block diagram of a decoder according to an embodiment of the present application;

图24是本申请实施例的编解码装置的示意性框图;Fig. 24 is a schematic block diagram of a codec device according to an embodiment of the present application;

图25是本申请实施例的视频编解码系统的示意性框图。Fig. 25 is a schematic block diagram of a video encoding and decoding system according to an embodiment of the present application.

具体实施方式Detailed ways

下面将结合附图,对本申请中的技术方案进行描述。The technical solution in this application will be described below with reference to the accompanying drawings.

本申请实施例的图像编解码方法可以对数字图像进行编解码。具体地,数字图像是以数字信号方式记录的图像信息。图3示出了一幅数字图像,该数字图像可以看作一个M×N的二维阵列,该数字图像一共包含MxN个采样(sample),每个采样的位置称为采样位置,每个采样的数值称为采样值。通常情况下,可以将MxN称为图像的分辨率,即图像中包含的采样的个数。例如,2K图像分辨率是1920*1080,4K视频的图像分辨率是3840*2160。习惯上,也可以将一个采样称为一个像素,一个像素通常包含像素位置与像素值两个信息。The image coding and decoding method in the embodiment of the present application can code and decode digital images. Specifically, a digital image is image information recorded as a digital signal. Figure 3 shows a digital image, which can be regarded as a two-dimensional array of M×N, the digital image contains MxN samples in total, and the position of each sample is called a sampling position, and each sample The value of is called the sampling value. In general, MxN can be called the resolution of the image, that is, the number of samples contained in the image. For example, the image resolution of 2K video is 1920*1080, and the image resolution of 4K video is 3840*2160. Customarily, a sample can also be referred to as a pixel, and a pixel usually contains two pieces of information: the pixel position and the pixel value.

一幅图像(具体可以是数字图像)通常包含一个或多个色彩分量。例如黑白图像仅包含亮度分量,彩色图像包含RGB三个色彩分量。一幅彩色图像由三个色彩分量的采样组成,这三个色彩分量可以直观的理解为三个色彩平面(plane),每个色彩平面为对相应的色彩分量做采样操作获得的如图3所示的采样阵列。彩色图像的三个色彩分量可以有不同的表示方式,常用的表示方式包括RGB、YCbCr、ICtCp等。An image (specifically, it may be a digital image) usually includes one or more color components. For example, a black and white image contains only brightness components, and a color image contains RGB three color components. A color image is composed of samples of three color components, which can be intuitively understood as three color planes (planes), and each color plane is obtained by sampling the corresponding color components, as shown in Figure 3 The sample array shown. The three color components of a color image can be expressed in different ways, commonly used ways include RGB, YCbCr, ICtCp, etc.

彩色图像的三个色彩平面可以有不同的分辨率。以YCbCr格式的彩色图像为例,由于亮度分量Y包含细节纹理信息,而Cb和Cr两个色度分量包含的高频信号较少,因此,通常对Cb和Cr这两个色度分量平面在水平和竖直方向上做2:1的下采样操作,将这两个色度分量的分辨率降为亮度分辨率的1/4,此时,一幅MxN的彩色图像由一个MxN的亮度分量平面和两个(M/2)x(N/2)的色度分量平面构成。The three color planes of a color image can have different resolutions. Taking the color image in YCbCr format as an example, since the luminance component Y contains detailed texture information, and the two chrominance components Cb and Cr contain less high-frequency signals, therefore, the two chrominance component planes of Cb and Cr are usually in the Perform a 2:1 downsampling operation in the horizontal and vertical directions to reduce the resolution of the two chroma components to 1/4 of the brightness resolution. At this time, an MxN color image is composed of an MxN brightness component plane and two (M/2)x(N/2) chrominance component planes.

应理解,本申请实施例的图像编解码方法可以对视频图像进行编码和解码。It should be understood that the image encoding and decoding method in the embodiment of the present application can encode and decode video images.

图4是本申请实施例的图像编码方法的示意性流程图。图4所示的方法可以由编码端设备执行,编码端设备具体可以是智能终端、个人数字助理(Personal DigitalAssistant,PAD)、视频播放器、物联网设备或者其它具有视频图像编码功能的设备。图4所示的方法包括步骤301至305,下面结合具体实例对步骤301至步骤305进行详细的说明。Fig. 4 is a schematic flowchart of an image encoding method according to an embodiment of the present application. The method shown in FIG. 4 can be executed by an encoding end device, and the encoding end device can specifically be a smart terminal, a personal digital assistant (Personal Digital Assistant, PAD), a video player, an Internet of Things device, or other devices with a video image encoding function. The method shown in FIG. 4 includes steps 301 to 305, and the steps 301 to 305 will be described in detail below with reference to specific examples.

301、根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器。301. Determine a target upsampling filter from a preset set of upsampling filters according to an encoding cost of an image block to be encoded.

其中,上采样滤波器集合至少包括FIR上采样滤波器和CNN上采样滤波器。FIR上采样滤波器具体可以为双三次上采样滤波器,CNN上采样滤波器是由卷积神经网络构成的滤波器。Wherein, the upsampling filter set includes at least an FIR upsampling filter and a CNN upsampling filter. The FIR upsampling filter may specifically be a bicubic upsampling filter, and the CNN upsampling filter is a filter composed of a convolutional neural network.

在本申请中,除了根据编码代价从上采样滤波器集合中确定出目标上采样滤波之外,还可以根据待编码图像块的纹理特征或者频谱特性上预先设置的上采样滤波器集合中确定出目标上采样滤波器。In this application, in addition to determining the target upsampling filter from the upsampling filter set according to the encoding cost, it can also be determined according to the texture characteristics or spectral characteristics of the image block to be coded. Target upsampling filter.

具体地,可以根据待编码图像块的纹理密集程度来选择上采样滤波器(纹理越密集包含的图像特征越丰富)。当图像块的纹理比较密集时,选择CNN滤波器作为上采样滤波器;当待编码图像块的纹理比较稀疏时,选择FIR滤波器作为上采样滤波器。Specifically, the upsampling filter may be selected according to the dense texture of the image block to be encoded (the denser the texture, the richer the image features contained). When the texture of the image block is relatively dense, the CNN filter is selected as the upsampling filter; when the texture of the image block to be encoded is relatively sparse, the FIR filter is selected as the upsampling filter.

另外,还可以对待编码图像块进行频谱分析,得到待编码的频谱特征。当待编码图像块的高频分量较多时,可以选择CNN滤波器作为上采样滤波器;而当待编码图像块的高频分量较少时,可以选择FIR滤波器作为上采样滤波器。In addition, frequency spectrum analysis may also be performed on the image block to be coded to obtain the frequency spectrum features to be coded. When there are many high-frequency components of the image block to be encoded, the CNN filter can be selected as the upsampling filter; and when the high-frequency component of the image block to be encoded is small, the FIR filter can be selected as the upsampling filter.

302、生成与目标上采样滤波器对应的上采样滤波器指示信息。302. Generate upsampling filter indication information corresponding to the target upsampling filter.

上述上采样滤波器指示信息可以用于指示上采样滤波器集合中某个上采样滤波器为目标上采样滤波器。The above upsampling filter indication information may be used to indicate that a certain upsampling filter in the upsampling filter set is a target upsampling filter.

例如,上采样滤波器指示信息可以指示上采样滤波器集合中的FIR上采样滤波器作为目标上采样滤波器,或者,上采样滤波器指示信息还可以指示上采样滤波器集合中的CNN上采样滤波器作为目标上采样滤波器。For example, the upsampling filter indication information may indicate the FIR upsampling filter in the upsampling filter set as the target upsampling filter, or the upsampling filter indication information may also indicate the CNN upsampling filter in the upsampling filter set filter as the target upsampling filter.

可选地,上采样滤波器指示信息具体为上采样滤波器选择标志Flag2,Flag2的取值用于指示目标上采样滤波器。Optionally, the upsampling filter indication information is specifically an upsampling filter selection flag Flag2, and a value of Flag2 is used to indicate a target upsampling filter.

例如,当确定FIR滤波器为目标上采样滤波器时,Flag2的取值为0;而当确定CNN滤波器为目标上采样滤波器时,Flag2的取值为1。或者,当确定FIR滤波器为目标上采样滤波器时,Flag2的取值为1;而当确定CNN滤波器为目标上采样滤波器时,Flag2的取值为0。For example, when the FIR filter is determined to be the target upsampling filter, the value of Flag2 is 0; and when the CNN filter is determined to be the target upsampling filter, the value of Flag2 is 1. Alternatively, when the FIR filter is determined to be the target upsampling filter, the value of Flag2 is 1; and when the CNN filter is determined to be the target upsampling filter, the value of Flag2 is 0.

总之,本申请对Flag2具体取什么数值来表示哪一种滤波器不做限定,只要Flag2的不同取值能够指示不同上采样滤波器即可。In short, the present application does not limit the specific value of Flag2 to indicate which filter, as long as different values of Flag2 can indicate different upsampling filters.

当解码端获取了上采样滤波器指示信息之后能够直接根据Flag2的取值与上采样滤波器之间的对应关系来直接确定目标上采样滤波器。After obtaining the upsampling filter indication information, the decoder can directly determine the target upsampling filter according to the corresponding relationship between the value of Flag2 and the upsampling filter.

303、采用预先设置的FIR下采样滤波器对待编码图像块进行下采样,得到第一图像块。303. Use a preset FIR downsampling filter to downsample the image block to be coded to obtain a first image block.

应理解,步骤301和步骤303是两个相互独立的过程,步骤301既可以先于步骤303发生,也可以晚于步骤303发生,或者,步骤301和步骤303也可以同时发生。It should be understood that step 301 and step 303 are two mutually independent processes, and step 301 may occur before or after step 303, or step 301 and step 303 may also occur simultaneously.

304、对第一图像块进行编码,得到码流。304. Encode the first image block to obtain a code stream.

对第一图像块进行编码可以包括:对第一图像块进行预测、变换、量化和熵编码,得到码流。Encoding the first image block may include: performing prediction, transformation, quantization, and entropy encoding on the first image block to obtain a code stream.

具体地,可以通过对第一图像块进行进行预测,得到预测号,在得到预测信号之后,可以通过第一图像块的原始信号减去预测信号,得到原始残差信号,接下来再对原始残差信号进行变换和量化,得到量化系数,最后再对量化系数进行熵编码就得到了码流。Specifically, the prediction number can be obtained by predicting the first image block. After obtaining the prediction signal, the original signal can be subtracted from the original signal of the first image block to obtain the original residual signal, and then the original residual signal can be obtained. Transform and quantize the difference signal to obtain quantized coefficients, and finally perform entropy coding on the quantized coefficients to obtain a code stream.

在对第一图像块进行预测时,可以使用与第一图像块处于同一图像内的已编码完成的重建信号对第一图像块进行预测,通常将这类预测操作称为帧内预测。典型的帧内预测包括直流分量预测、平面预测、水平预测、竖直预测等。When predicting the first image block, the first image block may be predicted by using the encoded reconstruction signal in the same image as the first image block, and this type of prediction operation is generally called intra-frame prediction. Typical intra prediction includes DC component prediction, planar prediction, horizontal prediction, vertical prediction, etc.

通过熵编码模块对量化系数进行熵编码,得到码流(也可以称为压缩码流),另外,在生成码流的过程中,熵编码模块同时还会对编码过程中生成的预测模式等各种指示信息做熵编码操作,以得到码流。The entropy encoding module performs entropy encoding on the quantized coefficients to obtain a code stream (also called a compressed code stream). In addition, in the process of generating the code stream, the entropy encoding module also performs entropy encoding on the prediction modes generated during the encoding process. Entropy coding operation is performed on the instruction information to obtain the code stream.

除对待编码图像块进行编码以生成码流外,编码端通常还需要获取待编码图像块的重建信号,作为对后续编码图像块做帧内预测操作的参考。因此,编码端还需要对待编码图像块编码过程中得到的量化系数进行反量化和反变换操作,得到重建残差信号,再将重建残差信号与预测信号相加得到图像块的重建信号。In addition to encoding the image block to be encoded to generate a code stream, the encoding end usually needs to obtain the reconstructed signal of the image block to be encoded as a reference for the intra prediction operation on the subsequent encoded image block. Therefore, the encoding end also needs to perform inverse quantization and inverse transformation operations on the quantized coefficients obtained during the encoding process of the image block to be encoded to obtain the reconstruction residual signal, and then add the reconstruction residual signal and the prediction signal to obtain the reconstruction signal of the image block.

而原始残差信号经过变换和量化操作后会有信息损失,该信息损失不可逆,因此经过反量化后反变换后的重建残差信号与原始残差信号不一致,进一步导致图像块的重建信号与原始信号不一致,因此称这种压缩编码方式为有损压缩。However, the original residual signal will have information loss after transformation and quantization, and the information loss is irreversible. Therefore, the reconstructed residual signal after dequantization and inverse transformation is inconsistent with the original residual signal, which further causes the reconstructed signal of the image block to be different from the original The signal is inconsistent, so this compression coding method is called lossy compression.

在基于块划分的图像编码方式中,获取的重建图像的图像块边界位置通常会产生信号不连续,表现为块效应。为了消除块效应,通常会对图像块边界像素做平滑滤波操作,称为去块效应滤波,以提高重建图像质量。除了对重建图像进行除去块效应滤波外,还可以采用维纳滤波、双边滤波等多种滤波操作对重建图像做质量提升。In the image coding method based on block division, signal discontinuity is usually generated at the image block boundary position of the acquired reconstructed image, which is manifested as block effect. In order to eliminate the block effect, smoothing and filtering operations are usually performed on the border pixels of the image block, which is called deblocking filtering to improve the quality of the reconstructed image. In addition to filtering the reconstructed image to remove block effects, various filtering operations such as Wiener filtering and bilateral filtering can also be used to improve the quality of the reconstructed image.

305、将上采样滤波器指示信息写入码流。305. Write the upsampling filter indication information into the code stream.

通过将上采样滤波器写入码流,使得解码端能够通过码流获取上采样滤波器的信息从预置的滤波器中选择相应的滤波器作为上采样滤波器,进而使得解码端可以采用相同的上采样滤波器进行上采样。By writing the upsampling filter into the code stream, the decoder can obtain the information of the upsampling filter through the code stream and select the corresponding filter as the upsampling filter from the preset filters, so that the decoder can use the same The upsampling filter performs upsampling.

本申请中,根据图像块的编码代价可以从多种候选的滤波器中选择一个滤波器作为上滤波器,与采用固定滤波器作为上采样滤波器的方式相比,能够取得更好的编码效果。In this application, according to the coding cost of the image block, one filter can be selected from various candidate filters as the up filter, which can achieve better coding effect compared with the way of using a fixed filter as the up sampling filter .

可选地,上采样滤波器集合中的FIR上采样滤波器和CNN上采样滤波器预先设置在编码器和解码器中,并且,FIR上采样滤波器和CNN上采样滤波器的滤波器参数可以是预先设置好或者计算好的。Optionally, the FIR upsampling filter and the CNN upsampling filter in the upsampling filter set are preset in the encoder and the decoder, and the filter parameters of the FIR upsampling filter and the CNN upsampling filter can be It is pre-set or calculated.

可选地,作为一个实施例,根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,包括:确定上采样滤波器集合中的每种上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价;将上采样滤波器集合中的第一上采样滤波器确定为目标上采样滤波器,其中,在上采样滤波器集合中,第一上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价最小。Optionally, as an embodiment, determining the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded includes: determining each type of upsampling filter in the upsampling filter set The encoding cost of the image block to be encoded when the filter is used as the target upsampling filter; the first upsampling filter in the upsampling filter set is determined as the target upsampling filter, wherein, in the upsampling filter set, the first When the upsampling filter is used as the target upsampling filter, the encoding cost of the image block to be encoded is the smallest.

通过比较上采样滤波器集合中各个上采样滤波器进行上采样操作时对应的待编码图像块的编码代价,能够从上采样滤波器集合中选择对应编码代价最小的上采样滤波器作为目标上采样滤波器,能够尽可能的降低编码过程中产生的编码代价,取得更好的编码效果。By comparing the encoding costs of the corresponding image blocks to be encoded when each upsampling filter in the upsampling filter set performs an upsampling operation, the upsampling filter corresponding to the smallest encoding cost can be selected from the upsampling filter set as the target upsampling The filter can reduce the encoding cost generated in the encoding process as much as possible and achieve better encoding effect.

应理解,上述编码代价具体可以是编码过程中图像块的率失真代价,图像块的失真等等。It should be understood that the above encoding cost may specifically be a rate-distortion cost of an image block in an encoding process, a distortion of an image block, and the like.

在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器时,首先要确定采用上采样滤波器集合中的每种滤波器作为目标上采样滤波器时图像块的编码代价,接下来,再从中选择对应的编码代价最小滤波器作为上采样滤波器。When determining the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded, it is first necessary to determine when each filter in the upsampling filter set is used as the target upsampling filter The encoding cost of the image block, and then select the corresponding minimum encoding cost filter as the up-sampling filter.

例如,FIR上采样滤波器作为目标上采样滤波器时图像块的编码代价小于CNN上采样滤波器作为目标上采样滤波器时图像块的编码代价,那么,就确定FIR上采样滤波器为上采样滤波器。For example, the encoding cost of an image block when the FIR upsampling filter is used as the target upsampling filter is less than the encoding cost of the image block when the CNN upsampling filter is used as the target upsampling filter, then the FIR upsampling filter is determined to be an upsampling filter.

上述编码代价具体可以是图像块的率失真代价,也可以是图像块的失真等等。The above encoding cost may specifically be a rate-distortion cost of an image block, or may be a distortion of an image block, and the like.

由于上采样滤波器集合中包含CNN上采样滤波器和FIR上采样滤波器,因此,在确定目标上采样滤波器时,可以先确定CNN上采样滤波器和FIR上采样滤波器分别作为目标上采样滤波器进行上采样操作时待编码图像块的编码代价,然后选择对应编码代价较小的滤波器作为目标上采样滤波器。Since the upsampling filter set includes the CNN upsampling filter and the FIR upsampling filter, when determining the target upsampling filter, the CNN upsampling filter and the FIR upsampling filter can be determined as the target upsampling filter respectively. When the filter performs an upsampling operation, the encoding cost of the image block to be encoded is selected, and then the filter corresponding to the smaller encoding cost is selected as the target upsampling filter.

其中,确定FIR上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价具体包含以下过程:Wherein, determining the encoding cost of the image block to be encoded when the FIR upsampling filter is used as the target upsampling filter specifically includes the following process:

(1)采用FIR下采样滤波器对待编码图像块进行下采样操作,得到低分辨率的图像块;(1) adopt FIR down-sampling filter to carry out down-sampling operation to the image block to be coded, obtain the image block of low resolution;

(2)对低分辨率的图像块进行编码操作,输出压缩码流;(2) Encoding the low-resolution image block and outputting the compressed code stream;

(3)获取待编码图像块的重建图像块;(3) Obtain the reconstructed image block of the image block to be encoded;

(4)确定重建图像块与待编码图像块的均方误差DFIR(4) Determine the mean square error D FIR of the reconstructed image block and the image block to be encoded;

(5)确定待编码图像块的压缩码流的大小RFIR(5) Determine the size R FIR of the compressed code stream of the image block to be encoded;

(6)根据DFIR和RFIR确定FIR上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价,并将该编码代价记为costFIR(6) Determine the encoding cost of the image block to be encoded when the FIR upsampling filter is used as the target upsampling filter according to D FIR and R FIR , and record the encoding cost as cost FIR .

确定CNN上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价具体包含以下过程:Determining the encoding cost of the image block to be encoded when the CNN upsampling filter is used as the target upsampling filter specifically includes the following process:

(7)采用CNN下采样滤波器对待编码图像块进行下采样操作,得到低分辨率的图像块;(7) adopt CNN downsampling filter to carry out downsampling operation to the image block to be coded, obtain the image block of low resolution;

(8)对低分辨率的图像块进行编码操作,输出压缩码流;(8) Encoding the low-resolution image block and outputting the compressed code stream;

(9)获取待编码图像块的重建图像块;(9) Obtain the reconstructed image block of the image block to be encoded;

(10)确定重建图像块与待编码图像块的均方误差DCNN(10) Determine the mean square error DCNN between the reconstructed image block and the image block to be encoded;

(11)确定待编码图像块的压缩码流的大小RCNN(11) Determine the size R CNN of the compressed code stream of the image block to be encoded;

(12)根据DCNN和RCNN确定CNN上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价,并将该编码代价记为costCNN(12) Determine the encoding cost of the image block to be encoded when the CNN upsampling filter is used as the target upsampling filter according to DCNN and R CNN , and record the encoding cost as cost CNN .

经过上述过程(1)至(6)确定了FIR上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价为costFIR,经过上述过程(7)至(12)确定了CNN上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价为costCNN。接下来,就可以根据costFIR和costCNN的大小关系从FIR上采样滤波器和CNN上采样滤波器选择出上采样滤波器。After the above process (1) to (6), it is determined that the encoding cost of the image block to be encoded is cost FIR when the FIR upsampling filter is used as the target upsampling filter, and the CNN upsampling is determined through the above process (7) to (12). When the filter is used as the target upsampling filter, the encoding cost of the image block to be encoded is cost CNN . Next, the upsampling filter can be selected from the FIR upsampling filter and the CNN upsampling filter according to the size relationship between the cost FIR and the cost CNN .

当costFIR<costCNN时,确定FIR上采样滤波器作为目标上采样滤波器;When cost FIR <cost CNN , determine the FIR upsampling filter as the target upsampling filter;

当costFIR>costCNN时,确定CNN上采样滤波器作为目标上采样滤波器;When cost FIR > cost CNN , determine the CNN upsampling filter as the target upsampling filter;

当costCNN=costFIR时,从FIR上采样滤波器和CNN上采样滤波器中选择任意一个滤波器作为目标上采样滤波器。When cost CNN = cost FIR , select any one filter from the FIR upsampling filter and the CNN upsampling filter as the target upsampling filter.

可选地,除了根据编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之外,还可以根据待编码图像块的纹理特征或者频谱特性从预先设置的上采样滤波器集合中确定出目标上采样滤波器。Optionally, in addition to determining the target upsampling filter from the preset upsampling filter set according to the coding cost, it can also be determined from the preset upsampling filter set according to the texture feature or spectral characteristic of the image block to be encoded Determine the target upsampling filter in .

例如,当待编码图像块的纹理比较稀疏时可以选择FIR上采样滤波器作为目标上采样滤波器;当待编码图像块的纹理比较密集时,为了保证编码效果,可以选择CNN上采样滤波器作为目标上采样滤波器。For example, when the texture of the image block to be encoded is relatively sparse, the FIR upsampling filter can be selected as the target upsampling filter; when the texture of the image block to be encoded is relatively dense, in order to ensure the encoding effect, the CNN upsampling filter can be selected as the target upsampling filter. Target upsampling filter.

根据图像块的纹理特性能够灵活地选择与图像块比较匹配的上采样滤波器作为目标上采样滤波器,能够提高不同纹理特性的图像块的编码效果。According to the texture characteristics of the image block, an upsampling filter that matches the image block can be flexibly selected as the target upsampling filter, and the coding effect of image blocks with different texture characteristics can be improved.

例如,对待编码图像块正式进行编码之前先进行频谱分析,得到待编码图像块的频谱特征,当待编码图像块的高频分量较多时,可以选择CNN上采样滤波器作为目标上采样滤波器;而当待编码图像块的高频分量较少时,可以选择FIR滤波器作为上采样滤波器。For example, spectral analysis is performed before the image block to be encoded is formally encoded to obtain the spectral characteristics of the image block to be encoded. When the image block to be encoded has many high-frequency components, the CNN upsampling filter can be selected as the target upsampling filter; And when the high-frequency components of the image block to be coded are few, the FIR filter can be selected as the up-sampling filter.

根据图像块的频谱特性能够选择与图像块相匹配的上采样滤波器作为目标上采样滤波器,能够提高不同频谱特性的图像块的编码效果。According to the spectral characteristics of the image block, an upsampling filter matching the image block can be selected as a target upsampling filter, which can improve the coding effect of image blocks with different spectral characteristics.

可选地,在本申请中,还可以根据编码代价、纹理特性以及频谱特征中的至少两个特征从上采样滤波器集合中确定出目标上采样滤波器。Optionally, in the present application, the target up-sampling filter may also be determined from the up-sampling filter set according to at least two features among the coding cost, the texture characteristic and the spectrum feature.

具体地,可以根据待编码图像块的编码代价和纹理特征从上采样滤波器集合中确定出目标上采样滤波器。Specifically, the target up-sampling filter may be determined from the up-sampling filter set according to the coding cost and the texture feature of the image block to be coded.

例如,当待编码图像块的纹理比较稀疏时可以选择FIR上采样滤波器作为目标上采样滤波器;当待编码图像块的纹理比较密集时,再确定FIR上采样滤波器和CNN上采样滤波器分别进行上采样时待编码图像块的编码代价,如果采用CNN上采样滤波器进行上采样时待编码图像块的编码代价较小,那么就选择CNN上采样滤波器作为目标上采样滤波器,否则,仍选择选择FIR上采样滤波器作为目标上采样滤波器。For example, when the texture of the image block to be encoded is relatively sparse, the FIR upsampling filter can be selected as the target upsampling filter; when the texture of the image block to be encoded is relatively dense, then the FIR upsampling filter and the CNN upsampling filter can be determined The encoding cost of the image block to be encoded when upsampling is carried out separately. If the encoding cost of the image block to be encoded is small when the CNN upsampling filter is used for upsampling, then the CNN upsampling filter is selected as the target upsampling filter, otherwise , still choose to select the FIR upsampling filter as the target upsampling filter.

具体地,可以根据待编码图像块的编码代价和频谱特征从上采样滤波器集合中确定出目标上采样滤波器。Specifically, the target up-sampling filter may be determined from the set of up-sampling filters according to the coding cost and frequency spectrum characteristics of the image block to be coded.

例如,当待编码图像块的高频分量较少时,可以选择FIR滤波器作为上采样滤波器;当待编码图像块的高频分量较多时,再确定FIR上采样滤波器和CNN上采样滤波器分别进行上采样时待编码图像块的编码代价,如果采用CNN上采样滤波器进行上采样时待编码图像块的编码代价较小,那么就选择CNN上采样滤波器作为目标上采样滤波器,否则,仍选择选择FIR上采样滤波器作为目标上采样滤波器。For example, when there are few high-frequency components of the image block to be encoded, the FIR filter can be selected as the upsampling filter; when there are many high-frequency components of the image block to be encoded, then the FIR upsampling filter and the CNN upsampling filter can be determined. The encoding cost of the image block to be encoded when the filter is upsampled respectively, if the encoding cost of the image block to be encoded is small when the CNN upsampling filter is used for upsampling, then the CNN upsampling filter is selected as the target upsampling filter, Otherwise, select the FIR upsampling filter as the target upsampling filter still.

可选地,作为一个实施例,CNN上采样滤波器的参数值是预设的,该CNN上采样滤波器的参数值(也可以称为初始参数值)是对预设图像训练集进行离线训练得到的。Optionally, as an embodiment, the parameter value of the CNN upsampling filter is preset, and the parameter value (also referred to as the initial parameter value) of the CNN upsampling filter is to perform offline training on the preset image training set owned.

具体地,对CNN上采样滤波器进行离线训练时可以先采用预置的FIR下采样滤波器对图像训练集中的原始图像xi进行下采样,然后将下采样得到的图像yi作为CNN上采样滤波器的输入,并将原始图像xi作为训练目标。Specifically, when training the CNN upsampling filter offline, the preset FIR downsampling filter can be used to downsample the original image x i in the image training set, and then the downsampled image y i can be used as the CNN upsampling The input of the filter, and the original image xi is used as the training target.

接下来,可以按照CNN网络的一般训练方法来训练CNN上采样滤波器(也可以称为CNN上采样网络),以获取CNN上采样滤波器的最优参数并将该最优参数作为该CNN上采样滤波器的参数值。Next, the CNN upsampling filter (also called CNN upsampling network) can be trained according to the general training method of the CNN network to obtain the optimal parameters of the CNN upsampling filter and the optimal parameter as the parameter value of the CNN upsampling filter.

具体而言,可以根据公式(1)来获取CNN上采样滤波器的最优参数 Specifically, the optimal parameters of the CNN upsampling filter can be obtained according to formula (1)

在公式(1)中,xi表示图像训练集中的原始图像,yi表示对原始图像进行下采样之后得到的低分辨率图像,n表示训练样本的数量,θg表示CNN上采样滤波器的所有参数,g(yi;θg)表示上采样网络对输入yi做上采样操作。In formula (1), xi represents the original image in the image training set, y i represents the low-resolution image obtained after downsampling the original image, n represents the number of training samples, and θ g represents the CNN upsampling filter All parameters, g(y i ; θ g ) indicate that the upsampling network performs an upsampling operation on the input y i .

此外,在上述训练过程中,除了将下采样图像yi作为网络输入进行训练之外。还可以先获取yi的重建图像y′i,然后再将y′i作为输入对CNN上采样滤波器进行训练。这样训练得到的上采样网络在恢复原分辨率图像细节的同时,还可以在一定程度上消除编码操作所引入的图像瑕疵,进一步提升上采样操作输出原分辨率图像块重建的质量。In addition, in the above training process, in addition to using the downsampled image yi as the network input for training. It is also possible to obtain the reconstructed image y′ i of y i first, and then use y′ i as input to train the CNN upsampling filter. The upsampling network trained in this way can not only restore the details of the original resolution image, but also eliminate the image defects introduced by the encoding operation to a certain extent, and further improve the reconstruction quality of the original resolution image block output by the upsampling operation.

可选地,作为一个实施例,在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,上述方法还包括:根据待编码图像块对CNN上采样滤波器进行在线训练,得到CNN上采样滤波器的更新参数值。Optionally, as an embodiment, before determining the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded, the above method further includes: The sampling filter is trained online to obtain the updated parameter values of the CNN upsampling filter.

其中,在线训练得到的CNN上采样滤波器的更新参数值用于替代CNN上采样滤波器预先设置的参数值。CNN上采样滤波器预先设置的参数值可以是CNN上采样滤波器通过对预设图像训练集进行训练得到的。Wherein, the updated parameter value of the CNN upsampling filter obtained by online training is used to replace the preset parameter value of the CNN upsampling filter. The preset parameter values of the CNN upsampling filter may be obtained by training the CNN upsampling filter on a preset image training set.

通过在线训练CNN上采样滤波器,能够根据图像纹理特征使用滤波器参数更加匹配的上采样滤波器做上采样操作,与采用预置的CNN上采样滤波器相比,可以进一步提升上采样输出的图像块的图像质量。By training the CNN upsampling filter online, an upsampling filter with more matching filter parameters can be used for the upsampling operation according to the image texture characteristics. Compared with the preset CNN upsampling filter, the upsampling output can be further improved. The image quality of the image block.

进一步地,在得到了CNN上采样滤波器的更新参数值之后,还可以将CNN上采样滤波器的更新参数值写入码流,使得解码端通过解析码流也能够获得CNN上采样滤波器的更新参数,并根据CNN上采样滤波器的更新参数对CNN上采样滤波器预先设置的参数值进行更新。Further, after obtaining the updated parameter value of the CNN upsampling filter, the updated parameter value of the CNN upsampling filter can also be written into the code stream, so that the decoder can also obtain the CNN upsampling filter by parsing the code stream. The parameters are updated, and the preset parameter values of the CNN upsampling filter are updated according to the update parameters of the CNN upsampling filter.

具体地,在可以采用图5所示的在线训练流程对CNN上采样滤波器(或者称为CNN上采样网络)进行在线训练。如图5所示,IO为当前待编码图像,IL表示使用CNN下采样滤波器对输入图像IO进行下采样之后得到的低分辨率待编码图像,编码端仿真器是模拟图像编码过程的一个CNN网络,可以模拟图像编码过程并输出低分辨率重建图像I′L和编码比特开销。其中,CNN下采样网络可以通过离线训练获得,并且预置于编码器中,用于对待编码的原始图像块进行下采样操作。Specifically, the online training process shown in FIG. 5 can be used to perform online training on the CNN upsampling filter (or called the CNN upsampling network). As shown in Figure 5, I O is the current image to be encoded, I L represents the low-resolution image to be encoded after downsampling the input image I O using the CNN downsampling filter, and the encoder emulator simulates the image encoding process A CNN network of , which can simulate the image encoding process and output low-resolution reconstructed image I′ L and encoding bit overhead. Among them, the CNN downsampling network can be obtained through offline training, and it is preset in the encoder for downsampling the original image block to be encoded.

在对CNN上采样滤波器进行在线训练时,具体可以根据公式(2)对CNN上采样网络进行训练,以获取CNN上采样滤波器的最优参数 When performing online training on the CNN upsampling filter, the CNN upsampling network can be trained according to the formula (2) to obtain the optimal parameters of the CNN upsampling filter

在公式(2)中,g表示上采样操作映射函数,θg表示上采样滤波器参数,g表示上采样滤波器的映射函数。In formula (2), g represents the upsampling operation mapping function, θ g represents the upsampling filter parameter, and g represents the mapping function of the upsampling filter.

在通过公式(2)获取到了CNN上采样滤波器的最优参数之后,可以将确定为该CNN上采样滤波器的更新参数值。The optimal parameters of the CNN upsampling filter are obtained through the formula (2) Afterwards, the Determines the updated parameter value for the upsampling filter of this CNN.

通过在线训练CNN上采样滤波器参数可以根据图像纹理特征使用匹配的参数做上采样操作,相比于采用预置参数的CNN上采样滤波器进行上采样操作,可以进一步提升上采样输出的图像块质量。此外,编码端可综合考虑更新上采样滤波器参数带来的图像质量提升与参数传递代价,例如,通过(Rate Distortion Optimation,RDO)的方式来提升该实施例编码方案的总体率失真性能。Through online training of CNN upsampling filter parameters, matching parameters can be used for upsampling operation according to image texture features. Compared with CNN upsampling filter with preset parameters for upsampling operation, the image block output by upsampling can be further improved. quality. In addition, the encoder can comprehensively consider the image quality improvement and parameter transfer cost brought about by updating the upsampling filter parameters, for example, improve the overall rate-distortion performance of the encoding scheme of this embodiment by means of (Rate Distortion Optimization, RDO).

可选地,作为一个实施例,在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,上述方法还包括:根据待编码图像块的编码代价从原分辨率编码模式和变分辨率编码模式中确定出目标编码模式;生成与目标编码模式对应的编码模式指示信息;将编码模式指示信息写入码流。Optionally, as an embodiment, before determining the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded, the above method further includes: according to the encoding cost of the image block to be encoded Determine the target encoding mode from the original resolution encoding mode and the variable resolution encoding mode; generate encoding mode indication information corresponding to the target encoding mode; write the encoding mode indication information into the code stream.

上述编码模式指示信息可以用于指示目标编码模式。具体地,该编码模式指示信息具体可以由变分辨率编码模式标志Flag1的取值来表示,Flag1的不同取值用于表示不同的编码模式。例如,当Flag1为0时表示目标编码模式为原分辨率编码模式,当Flag1为1时表示目标编码模式为变分辨率编码模式。The above coding mode indication information may be used to indicate a target coding mode. Specifically, the coding mode indication information may be represented by the value of the variable resolution coding mode flag Flag1, and different values of Flag1 are used to indicate different coding modes. For example, when Flag1 is 0, it indicates that the target encoding mode is the original resolution encoding mode, and when Flag1 is 1, it indicates that the target encoding mode is the variable resolution encoding mode.

此外,上述编码模式信息还可以由原分辨率编码模式标志Flag1的取值来表示,Flag1的不同取值用于表示不同的编码模式。例如,当Flag1为0时表示目标编码模式为变分辨率编码模式,当Flag1为1时表示目标编码模式为原分辨率编码模式。In addition, the above encoding mode information may also be represented by the value of the original resolution encoding mode flag Flag1, and different values of Flag1 are used to indicate different encoding modes. For example, when Flag1 is 0, it indicates that the target encoding mode is a variable resolution encoding mode, and when Flag1 is 1, it indicates that the target encoding mode is an original resolution encoding mode.

可选地,根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,具体包括:确定原分辨率编码模式下待编码图像块的编码代价;确定变分辨率编码模式下待编码图像块的编码代价;从原分辨率编码模式和变分辨率编码模式中选择编码代价最小的编码模式作为目标编码模式。Optionally, the target upsampling filter is determined from the preset upsampling filter set according to the encoding cost of the image block to be encoded, which specifically includes: determining the encoding cost of the image block to be encoded in the original resolution encoding mode; determining the variable The encoding cost of the image block to be encoded in the resolution encoding mode; the encoding mode with the smallest encoding cost is selected from the original resolution encoding mode and the variable resolution encoding mode as the target encoding mode.

根据待编码图像块的编码代价能够选择编码代价较小的编码模式作为目标编码模式,可以减少编码过程中图像编码的损失。According to the encoding cost of the image block to be encoded, an encoding mode with a lower encoding cost can be selected as the target encoding mode, which can reduce the loss of image encoding in the encoding process.

其中,确定原分辨率编码模式下的待编码图像块的编码代价具体包括以下过程:Wherein, determining the encoding cost of the image block to be encoded in the original resolution encoding mode specifically includes the following process:

首先,根据预设的编解码方案在原分辨率模式下对待编码图像块进行编码,得到图像块的压缩码流以及待编码图像块的重建图像块;Firstly, the image block to be encoded is encoded in the original resolution mode according to the preset codec scheme, and the compressed code stream of the image block and the reconstructed image block of the image block to be encoded are obtained;

其次,确定重建图像块与待编码图像块的均方误差为Dorg;Secondly, it is determined that the mean square error between the reconstructed image block and the image block to be encoded is Dorg;

再次,确定待编码图像块的压缩码流的大小为Rorg;Again, determine the size of the compressed code stream of the image block to be encoded as Rorg;

最后,根据Dorg和Rorg计算原分辨率编码模式下对待编码图像块进行编码的率失真代价costorg,并将该率失真代价costorg确定为待编码图像块在原分辨率编码模式的编码代价。Finally, the rate-distortion cost costorg for encoding the image block to be encoded in the original resolution encoding mode is calculated according to Dorg and Rorg, and the rate-distortion cost costorg is determined as the encoding cost of the image block to be encoded in the original resolution encoding mode.

确定变分辨率编码模式下的待编码图像块的编码代价的具体过程与确定原分辨率编码模式下的待编码图像块的编码代价的具体过程相同。The specific process of determining the encoding cost of the image block to be encoded in the variable resolution encoding mode is the same as the specific process of determining the encoding cost of the image block to be encoded in the original resolution encoding mode.

在变分辨率编码模式下的待编码图像块的编码代价时,由于上采样滤波器和下采样滤波器可以有不同的选择,因此,可以将上采样滤波器和下采样滤波器均为FIR滤波器时图像块的编码代价作为图像块在变分辨率编码模式下的编码代价,也可以将上采样滤波器和下采样滤波器均为CNN滤波器时图像块的编码代价作为图像块在变分辨率编码模式下的编码代价。或者,也可以从CNN上采样滤波器和FIR上采样滤波器中任意选择一个滤波器作为编码端中的上采样滤波器,从CNN下采样滤波器和FIR下采样滤波器中任意选择一个滤波器作为下采样滤波器,并计算待编码图像块的编码代价。In the encoding cost of the image block to be encoded in the variable-resolution encoding mode, since the up-sampling filter and the down-sampling filter can have different choices, the up-sampling filter and the down-sampling filter can be both FIR filters The coding cost of the image block at the time of the image block is used as the coding cost of the image block in the variable resolution coding mode, and the coding cost of the image block when both the upsampling filter and the downsampling filter are CNN filters can be used as the coding cost of the image block in the variable resolution coding mode. Encoding cost in rate encoding mode. Alternatively, a filter can be arbitrarily selected from the CNN upsampling filter and the FIR upsampling filter as the upsampling filter in the encoding end, and a filter can be arbitrarily selected from the CNN downsampling filter and the FIR downsampling filter As a downsampling filter, and calculate the encoding cost of the image block to be encoded.

应理解,当确定采用变分辨率编码模式对待编码图像块进行编码时才会根据图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器。而当确定采用变分辨率编码模式对待编码图像块进行编码时,直接采用原分辨率编码模式对待编码图像块进行编码,而不需要再确定目标上采样滤波器,因为在原分辨率编码模式下不需要进行上采样操作。It should be understood that the target upsampling filter is determined from the preset upsampling filter set according to the coding cost of the image block when it is determined to use the variable resolution coding mode to encode the image block to be coded. When it is determined to use the variable resolution coding mode to encode the image block to be coded, the original resolution coding mode is directly used to encode the image block to be coded, and there is no need to determine the target upsampling filter, because in the original resolution coding mode, there is no Upsampling is required.

图5是本申请实施例的图像编码方法的示意性流程图。图5所示的方法可以由编码端设备执行,编码端设备具体可以是智能终端、PAD、视频播放器、物联网设备或者其它具有视频图像编码功能的设备。图5所示的方法包括步骤401至406,下面结合具体实例对步骤401至步骤406进行详细的说明。Fig. 5 is a schematic flowchart of an image coding method according to an embodiment of the present application. The method shown in FIG. 5 may be executed by an encoding end device, which specifically may be a smart terminal, a PAD, a video player, an Internet of Things device, or other devices with a video image encoding function. The method shown in FIG. 5 includes steps 401 to 406, and the steps 401 to 406 will be described in detail below with reference to specific examples.

401、根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器。401. Determine a target upsampling filter from a preset set of upsampling filters according to an encoding cost of an image block to be encoded.

其中,上采样滤波器集合至少包括FIR上采样滤波器和CNN上采样滤波器。例如,FIR上采样滤波器具体为双三次上采样滤波器。Wherein, the upsampling filter set includes at least an FIR upsampling filter and a CNN upsampling filter. For example, the FIR upsampling filter is specifically a bicubic upsampling filter.

402、生成与目标上采样滤波器对应的上采样滤波器指示信息。402. Generate upsampling filter indication information corresponding to the target upsampling filter.

上采样滤波器指示信息可以上采样滤波器选择标志Flag2,Flag2的取值用于指示目标上采样滤波器。The upsampling filter indication information may be an upsampling filter selection flag Flag2, and the value of Flag2 is used to indicate a target upsampling filter.

例如,当确定FIR滤波器为目标上采样滤波器时,可以将Flag2的取值设置为0;而当确定CNN滤波器为目标上采样滤波器时,可以将Flag2的取值设置为1。For example, when the FIR filter is determined to be the target upsampling filter, the value of Flag2 may be set to 0; and when the CNN filter is determined to be the target upsampling filter, the value of Flag2 may be set to 1.

403、将预先设置的下采样滤波器集合中与目标上采样滤波器类型相同的下采样滤波器确定为目标下采样滤波器。403. Determine a downsampling filter of the same type as the target upsampling filter in the preset downsampling filter set as the target downsampling filter.

其中,下采样滤波器集合至少包括FIR下采样滤波器和CNN下采样滤波器。Wherein, the downsampling filter set includes at least an FIR downsampling filter and a CNN downsampling filter.

具体地,当FIR上采样滤波器为目标上采样滤波器时,将FIR下采样滤波器确定为目标下采样滤波器;当CNN上采样滤波器为目标上采样滤波器时,将CNN下采样滤波器确定为目标下采样滤波器。Specifically, when the FIR upsampling filter is the target upsampling filter, the FIR downsampling filter is determined as the target downsampling filter; when the CNN upsampling filter is the target upsampling filter, the CNN downsampling filter The filter is determined as the target downsampling filter.

404、采用目标下采样滤波器对待编码图像块进行下采样,得到第一图像块。404. Use a target downsampling filter to downsample the image block to be coded to obtain a first image block.

405、对第一图像块进行编码,得到码流。405. Encode the first image block to obtain a code stream.

406、将上采样滤波器指示信息写入码流。406. Write the upsampling filter indication information into the code stream.

本申请中,可以根据编码代价从上采样滤波器集合中确定出目标上采样滤波器,与直接采用固定参数值的上采样滤波器进行上采样操作相比,本申请方案在选择目标上采样滤波器时充分考虑了待编码图像块的编码代价,能够取得更好的编码效果。In this application, the target upsampling filter can be determined from the set of upsampling filters according to the encoding cost. Compared with directly using the upsampling filter with fixed parameter values for the upsampling operation, this application scheme selects the target upsampling filter The encoding cost of the image block to be encoded is fully considered when the encoder is used, and better encoding effect can be achieved.

应理解,图6所示方法中的步骤401和402与图4所示的方法中的步骤301和302的实质是相同的,上文中对步骤301和302的限定和解释也适用于步骤401和402。另外,图6所示的方法中的步骤405和406与图4所示的方法中的步骤304和305的实质是相同的,上文中对步骤405和406的限定和解释也适用于步骤304和305。It should be understood that steps 401 and 402 in the method shown in FIG. 6 are essentially the same as steps 301 and 302 in the method shown in FIG. 402. In addition, steps 405 and 406 in the method shown in FIG. 6 are essentially the same as steps 304 and 305 in the method shown in FIG. 305.

可选地,作为一个实施例,根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,包括:确定上采样滤波器集合中的每种上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价;将上采样滤波器集合中的第一上采样滤波器确定为目标上采样滤波器,其中,在上采样滤波器集合中,第一上采样滤波器作为目标上采样滤波器时待编码图像块的编码代价最小。Optionally, as an embodiment, determining the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded includes: determining each type of upsampling filter in the upsampling filter set The encoding cost of the image block to be encoded when the filter is used as the target upsampling filter; the first upsampling filter in the upsampling filter set is determined as the target upsampling filter, wherein, in the upsampling filter set, the first When the upsampling filter is used as the target upsampling filter, the encoding cost of the image block to be encoded is the smallest.

本申请中,通过选择编码代价最小的上采样滤波器作为目标上采样滤波器,能够尽可能的降低编码过程中产生的编码代价,可以取得更好的编码效果。In this application, by selecting the upsampling filter with the smallest coding cost as the target upsampling filter, the coding cost generated in the coding process can be reduced as much as possible, and better coding effect can be achieved.

上述编码代价具体可以是编码过程中图像块的率失真代价,图像块的失真等等。The above-mentioned encoding cost may specifically be the rate-distortion cost of the image block in the encoding process, the distortion of the image block, and the like.

可选地,除了根据编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之外,还可以根据待编码图像块的纹理特征或者频谱特性从预先设置的上采样滤波器集合中确定出目标上采样滤波器。Optionally, in addition to determining the target upsampling filter from the preset upsampling filter set according to the coding cost, it can also be determined from the preset upsampling filter set according to the texture feature or spectral characteristic of the image block to be encoded Determine the target upsampling filter in .

可选地,作为一个实施例,CNN上采样滤波器的参数值为预设的,该CNN上采样滤波器的参数值是对预设图像训练集进行离线训练得到的。Optionally, as an embodiment, the parameter value of the CNN upsampling filter is preset, and the parameter value of the CNN upsampling filter is obtained by performing offline training on a preset image training set.

由于CNN上采样滤波器的参数值是通过离线训练得到的,因此,在编码过程中如果采用CNN上采样滤波器进行上采样,能够降低上采样过程中图像的信息损失,提升图像编码质量。Since the parameter values of the CNN upsampling filter are obtained through offline training, if the CNN upsampling filter is used for upsampling during the encoding process, the information loss of the image during the upsampling process can be reduced and the image encoding quality can be improved.

应理解,这里通过离线训练得到CNN上采样滤波器的参数值的具体过程可以参见上文中对CNN上采样滤波器进行离线训练的相关描述。It should be understood that the specific process of obtaining the parameter values of the CNN upsampling filter through offline training can refer to the relevant description of offline training of the CNN upsampling filter above.

可选地,作为一个实施例,CNN下采样滤波器的参数值为预设的,该CNN下采样滤波器的参数值是对预设图像训练集进行离线训练得到的。Optionally, as an embodiment, the parameter value of the CNN downsampling filter is preset, and the parameter value of the CNN downsampling filter is obtained by performing offline training on a preset image training set.

由于CNN下采样滤波器的参数值是通过离线训练得到的,因此,在编码过程中如果采用CNN下采样滤波器进行下采样,能够降低下采样过程中图像的信息损失,提升图像编码质量。Since the parameter values of the CNN downsampling filter are obtained through offline training, if the CNN downsampling filter is used for downsampling during the encoding process, the information loss of the image during the downsampling process can be reduced and the image encoding quality can be improved.

应理解,在对CNN下采样滤波器进行离线训练时,需要采用上采样滤波进行上采样处理,在进行上采样处理时,既可以使用FIR上采样滤波器也可以使用CNN上采样滤波器,下面对采用FIR上采样滤波器时CNN下采样滤波器的离线训练过程进行详细的介绍(采用CNN上采样滤波器进行上采样处理时的训练过程与此类似)。It should be understood that when performing offline training on the CNN downsampling filter, upsampling filtering needs to be used for upsampling processing. When performing upsampling processing, either the FIR upsampling filter or the CNN upsampling filter can be used. The offline training process of the CNN downsampling filter when the FIR upsampling filter is used is described in detail (the training process when the CNN upsampling filter is used for upsampling processing is similar).

在对CNN下采样滤波器进行训练时,可以将训练集中的原始图像作为CNN下采样滤波器的输入,将CNN下采样滤波器的输出作为FIR上采样滤波器的输入,计算FIR上采样滤波器输出的图像与原始图像之间的均方误差作为损失函数,并将损失函数最小的滤波器参数作为CNN下采样滤波器的参数。When training the CNN downsampling filter, the original image in the training set can be used as the input of the CNN downsampling filter, and the output of the CNN downsampling filter can be used as the input of the FIR upsampling filter to calculate the FIR upsampling filter The mean square error between the output image and the original image is used as the loss function, and the filter parameter with the smallest loss function is used as the parameter of the CNN downsampling filter.

具体地,可以根据公式(3)得到CNN下采样滤波器的参数。Specifically, the parameters of the CNN downsampling filter can be obtained according to formula (3).

在公式(3)中,表示CNN下采样网络里的所有参数,f(xi;θf)表示下采样网络对输入xi做下采样操作,gFIR表示使用FIR滤波器进行上采样操作,表示CNN下采样网络初始参数。In formula (3), Indicates all parameters in the CNN downsampling network, f( xi ; θ f ) indicates that the downsampling network performs a downsampling operation on the input xi , g FIR indicates that the FIR filter is used for upsampling operation, Indicates the initial parameters of the CNN downsampling network.

可选地,作为一个实施例,CNN上采样滤波器的参数值和CNN下采样滤波器的参数值均为预设的,CNN上采样滤波器的参数值和CNN下采样滤波器的参数值是在离线情况下对预设图像训练集进行联合训练得到的。Optionally, as an embodiment, the parameter value of the CNN upsampling filter and the parameter value of the CNN downsampling filter are all preset, and the parameter value of the CNN upsampling filter and the parameter value of the CNN downsampling filter are It is obtained by joint training on the preset image training set offline.

由于CNN上、下采样滤波器是在离线情况下通过联合训练的方式获得的,因此,在编码过程中能够减少图像纹理在上、下采样过程中所带来的信息损失,提升编码图像质量。Since the CNN upsampling and downsampling filters are obtained through joint training offline, the information loss caused by the upsampling and downsampling of the image texture can be reduced during the encoding process and the quality of the encoded image can be improved.

在离线的情况下,对预设图像训练集进行联合训练得到CNN上采样滤波器和CNN下采样滤波器的参数值具体包括以下过程:In the case of offline, the joint training of the preset image training set to obtain the parameter values of the CNN upsampling filter and the CNN downsampling filter specifically includes the following process:

首先、对CNN上采样滤波器进行训练,得到CNN上采样滤波器的初始参数。First, the CNN upsampling filter is trained to obtain the initial parameters of the CNN upsampling filter.

对训练集里的图片进行下采样,并将得到的下采样图像作为CNN上采样网络的输入,将训练集中的原始图片作为训练目标,在训练过程中要使得重建图像尽可能的接近训练目标,以得到CNN上采样滤波器的参数。具体可以通过公式(4)对CNN上采样滤波器进行训练,进而获取CNN上采样滤波器的初始参数值。The pictures in the training set are down-sampled, and the obtained down-sampled images are used as the input of the CNN upsampling network, and the original pictures in the training set are used as the training target. During the training process, the reconstructed image should be as close as possible to the training target. To get the parameters of the CNN upsampling filter. Specifically, the CNN upsampling filter can be trained by formula (4), and then the initial parameter value of the CNN upsampling filter can be obtained.

在上述公式(4)中,xi表示训练集的原始图像,yi表示对原始图像进行下采样之后得到的低分辨率图像,n表示训练样本的数量,θg表示CNN上采样网络里的所有参数,g(yi;θg)表示上采样网络对输入yi做上采样操作,表示第步骤1训练结束后得到的CNN上采样网络初始参数。In the above formula (4), xi represents the original image of the training set, y i represents the low-resolution image obtained after downsampling the original image, n represents the number of training samples, θ g represents the CNN upsampling network All parameters, g(y i ; θ g ) means that the upsampling network performs an upsampling operation on the input y i , Indicates the initial parameters of the CNN upsampling network obtained after the training in step 1.

其次、基于训练得到的CNN上采样滤波器对CNN下采样滤波器进行训练,得到CNN下采样滤波器的初始参数值。Secondly, the CNN downsampling filter is trained based on the CNN upsampling filter obtained through training, and the initial parameter value of the CNN downsampling filter is obtained.

将训练集中的原始图像作为CNN下采样滤波器的输入,将CNN下采样滤波器的输出作为CNN上采样滤波器的输入,得到CNN上采样滤波器输出的图像,计算CNN上采样网路输出的图像与原始图像之间的均方误差作为损失函数,使得损失函数最小,从而得到CNN下采样滤波器的初始参数值。The original image in the training set is used as the input of the CNN downsampling filter, and the output of the CNN downsampling filter is used as the input of the CNN upsampling filter to obtain the image output by the CNN upsampling filter, and the output of the CNN upsampling network is calculated. The mean square error between the image and the original image is used as the loss function to minimize the loss function, thereby obtaining the initial parameter value of the CNN downsampling filter.

具体地,可以具体通过公式(5)对CNN下采样滤波器进行训练,进而获取CNN下采样滤波器的初始参数值。Specifically, the CNN down-sampling filter may be trained through formula (5), and then the initial parameter value of the CNN down-sampling filter may be obtained.

在公式(5)中,xi表示训练集的原始图像,θf表示CNN下采样滤波器的所有参数,表示第步骤1训练结束后得到的CNN上采样网络初始参数,f(xi;θf)表示下采样滤波器对输入xi做下采样操作,表示得到的CNN下采样滤波器的初始参数。In formula (5), xi represents the original image of the training set, θ f represents all the parameters of the CNN downsampling filter, Indicates the initial parameters of the CNN upsampling network obtained after the training in step 1, f( xi ; θ f ) indicates that the downsampling filter performs a downsampling operation on the input x i , Indicates the initial parameters of the resulting CNN downsampling filter.

再次、对上采样滤波器和下采样滤波器进行联合训练,得到更新网络参数。Again, jointly train the upsampling filter and the downsampling filter to obtain updated network parameters.

经过上述训练过程得到的参数分别为上采样滤波器和下采样滤波器的初始参数值。接下使用图像训练集中原分辨率图像作为输入和训练目标,同时训练上、下采样滤波器的参数。The parameters obtained through the above training process are the initial parameter values of the upsampling filter and the downsampling filter, respectively. Next, use the original resolution image in the image training set as the input and training target, and train the parameters of the upsampling and downsampling filters at the same time.

具体地,可以根据公式(6)对CNN上采样网络和下采样网络同时进行训练,以得到CNN上采样滤波器和CNN下采样滤波器的参数值。Specifically, CNN upsampling network and downsampling network can be trained simultaneously according to formula (6) to obtain parameter values of CNN upsampling filter and CNN downsampling filter.

在公式(6)中,为CNN下采样滤波器的最优参数,θ′g为CNN上采样滤波器在训练过程中的更新参数值(CNN上采样滤波器的初始参数值为),公式(6)中其它相关参数的含义参见公式(4)和公式(5)下方的解释。In formula (6), is the optimal parameter of the CNN downsampling filter, θ′ g is the update parameter value of the CNN upsampling filter during the training process (the initial parameter value of the CNN upsampling filter is ), and the meanings of other relevant parameters in formula (6) can be found in the explanations below formula (4) and formula (5).

公式(6)表示的损失函数由两项构成,第一项计算的是CNN下采样滤波器输出的图像和一个FIR滤波器下采样输出的图像之间的误差,第二项计算的是CNN上采样滤波器输出的图像和原始分辨率的图像之间的误差。根据公式(6)对上采样滤波器和下采样滤波器进行训练,可以得到CNN下采样滤波器最优参数 The loss function represented by formula (6) consists of two items, the first item The calculation is the error between the image output by the CNN downsampling filter and the image output by a FIR filter downsampling, the second item What is calculated is the error between the image output by the CNN upsampling filter and the original resolution image. According to the formula (6), the up-sampling filter and down-sampling filter are trained, and the optimal parameters of the CNN down-sampling filter can be obtained

可选地,作为一个实施例,在采用目标下采样滤波器对待编码图像块进行下采样之前,图6所示的方法还包括:根据待编码图像块对CNN下采样滤波器和/或CNN上采样滤波器进行在线训练,得到CNN下采样滤波器的更新参数值和/或CNN下采样滤波器的更新参数值,其中,CNN下采样滤波器的更新参数值用于替代CNN下采样滤波器预先设置的参数值,CNN上采样滤波器的更新参数值用于替代CNN上采样滤波器预先设置的参数值。Optionally, as an embodiment, before using the target downsampling filter to downsample the image block to be coded, the method shown in FIG. 6 further includes: according to the image block to be coded, the CNN downsampling filter and/or The sampling filter is trained online to obtain the updated parameter value of the CNN downsampling filter and/or the updated parameter value of the CNN downsampling filter, wherein the updated parameter value of the CNN downsampling filter is used to replace the CNN downsampling filter in advance The set parameter value, the updated parameter value of the CNN upsampling filter is used to replace the preset parameter value of the CNN upsampling filter.

通过在线训练CNN下采样滤波器参数能够尽可能的减少下采样操作带来的信息损失,提升重建图像质量。另外,由于CNN下采样滤波器仅在编码器使用,因此无需将CNN下采样滤波器参数传递到解码器,因而不会带来编码开销的增加。Through online training of CNN downsampling filter parameters, the information loss caused by the downsampling operation can be reduced as much as possible, and the quality of the reconstructed image can be improved. In addition, since the CNN downsampling filter is only used in the encoder, there is no need to pass the CNN downsampling filter parameters to the decoder, which will not increase the encoding overhead.

通过在线训练CNN上采样滤波器,能够根据图像纹理特征使用滤波器参数更加匹配的上采样滤波器做上采样操作,与采用预置的CNN上采样滤波器相比,可以进一步提升上采样输出的图像块的图像质量。By training the CNN upsampling filter online, an upsampling filter with more matching filter parameters can be used for the upsampling operation according to the image texture characteristics. Compared with the preset CNN upsampling filter, the upsampling output can be further improved. The image quality of the image block.

通过同时在线训练CNN上采样滤波器和CNN下采样滤波器,能够根据图像纹理特征使用滤波器参数更加匹配的上采样滤波器和下采样滤波器做上采样操作和下采样操作,与采用预置的CNN上采样滤波器和CNN下采样滤波器相比,可以进一步提升上采样输出的图像块的图像质量。By simultaneously training the CNN upsampling filter and the CNN downsampling filter online, it is possible to use the upsampling filter and downsampling filter with better matching filter parameters to perform upsampling and downsampling operations according to the image texture characteristics, which is different from using preset Compared with the CNN downsampling filter, the CNN upsampling filter can further improve the image quality of the upsampling output image block.

可选地,图6所示的方法还包括:将CNN上采样滤波器的更新参数值写入码流。Optionally, the method shown in FIG. 6 further includes: writing the updated parameter value of the CNN upsampling filter into the code stream.

在得到了CNN上采样滤波器的更新参数值之后,还可以将CNN上采样滤波器的更新参数值写入码流,使得解码端通过解析码流也能够获得CNN上采样滤波器的更新参数,并根据CNN上采样滤波器的更新参数对CNN上采样滤波器预先设置的参数值进行更新,使得解码端能够采用与编码端的CNN上采样滤波器采用更新后的参数值进行上采样操作。After obtaining the update parameter value of the CNN upsampling filter, the update parameter value of the CNN upsampling filter can also be written into the code stream, so that the decoder can also obtain the update parameter of the CNN upsampling filter by parsing the code stream. And according to the update parameters of the CNN upsampling filter, the preset parameter value of the CNN upsampling filter is updated, so that the decoding end can use the updated parameter value of the CNN upsampling filter at the encoding end to perform an upsampling operation.

可选地,作为一个实施例,在将上采样滤波器集合中对应的编码代价满足预设要求的上采样滤波器确定为目标上采样滤波器之前,图6所示的方法还包括:根据待编码图像块对CNN上采样滤波器和CNN下采样滤波在在线的情况下进行联合训练,得到CNN上采样滤波器的更新参数值和CNN下采样滤波器的更新参数值。Optionally, as an embodiment, before determining an upsampling filter whose corresponding encoding cost meets a preset requirement in the upsampling filter set as the target upsampling filter, the method shown in FIG. 6 further includes: according to the The coded image block jointly trains the CNN upsampling filter and the CNN downsampling filter online, and obtains the updated parameter value of the CNN upsampling filter and the updated parameter value of the CNN downsampling filter.

可选地,在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,图6所示的方法还包括:根据待编码图像块的编码代价从原分辨率编码模式和变分辨率编码模式中确定出目标编码模式;生成与目标编码模式对应的编码模式指示信息;将编码模式指示信息写入码流。Optionally, before determining the target upsampling filter from the preset upsampling filter set according to the coding cost of the image block to be coded, the method shown in FIG. 6 further includes: according to the coding cost of the image block to be coded, from Determine the target encoding mode from the original resolution encoding mode and the variable resolution encoding mode; generate encoding mode indication information corresponding to the target encoding mode; write the encoding mode indication information into the code stream.

可选地,根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,具体包括:确定原分辨率编码模式下待编码图像块的编码代价;确定变分辨率编码模式下待编码图像块的编码代价;从原分辨率编码模式和变分辨率编码模式中选择编码代价最小的编码模式作为目标编码模式。Optionally, the target upsampling filter is determined from the preset upsampling filter set according to the encoding cost of the image block to be encoded, which specifically includes: determining the encoding cost of the image block to be encoded in the original resolution encoding mode; determining the variable The encoding cost of the image block to be encoded in the resolution encoding mode; the encoding mode with the smallest encoding cost is selected from the original resolution encoding mode and the variable resolution encoding mode as the target encoding mode.

上述编码模式指示信息用于指示候选编码模式中的何种编码模式为目标编码模式。例如,上述编码模式指示信息可以指示原分辨率编码模式为目标编码模式,或者,上述编码模式指示信息也可以指示变分辨率编码模式为目标编码模式。The above coding mode indication information is used to indicate which coding mode among the candidate coding modes is the target coding mode. For example, the above encoding mode indication information may indicate that the original resolution encoding mode is the target encoding mode, or the above encoding mode indication information may also indicate the variable resolution encoding mode as the target encoding mode.

根据待编码图像块的编码代价能够选择编码代价较小的编码模式作为目标编码模式,可以减少编码过程中图像编码的损失。According to the encoding cost of the image block to be encoded, an encoding mode with a lower encoding cost can be selected as the target encoding mode, which can reduce the loss of image encoding in the encoding process.

应理解,当确定采用变分辨率编码模式对待编码图像块进行编码时才会根据图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器。而当确定采用变分辨率编码模式对待编码图像块进行编码时,直接采用原分辨率编码模式对待编码图像块进行编码,而不需要再确定目标上采样滤波器,因为在原分辨率编码模式下不需要进行上采样操作。It should be understood that the target upsampling filter is determined from the preset upsampling filter set according to the coding cost of the image block when it is determined to use the variable resolution coding mode to encode the image block to be coded. When it is determined to use the variable resolution coding mode to encode the image block to be coded, the original resolution coding mode is directly used to encode the image block to be coded, and there is no need to determine the target upsampling filter, because in the original resolution coding mode, there is no Upsampling is required.

图7是本申请实施例的图像编码方法的示意性流程图。图7所示的方法可以由编码端设备执行,编码端设备具体可以是智能终端、PAD、视频播放器、物联网设备或者其它具有视频图像编码功能的设备。图7所示的方法包括步骤501至506,下面结合具体实例对步骤501至步骤506进行详细的说明。Fig. 7 is a schematic flowchart of an image encoding method according to an embodiment of the present application. The method shown in FIG. 7 can be executed by an encoding end device, and the encoding end device can specifically be a smart terminal, a PAD, a video player, an Internet of Things device, or other devices with a video image encoding function. The method shown in FIG. 7 includes steps 501 to 506, and the steps 501 to 506 will be described in detail below in conjunction with specific examples.

501、根据待编码图像块的编码代价从预先设置的下采样滤波器集合中确定出目标下采样滤波器。501. Determine a target downsampling filter from a preset set of downsampling filters according to an encoding cost of an image block to be encoded.

其中,下采样滤波器集合至少包括FIR下采样滤波器和CNN下采样滤波器。Wherein, the downsampling filter set includes at least an FIR downsampling filter and a CNN downsampling filter.

根据待编码图像块的编码代价从预先设置的下采样滤波器集合中确定出目标下采样滤波器与上文中根据待编码图像块的编码代价从预先设置的下采样滤波器集合中确定出目标上采样滤波器的方式和具体过程实质上一致的,这里不再赘述。Determine the target downsampling filter from the preset downsampling filter set according to the encoding cost of the image block to be encoded The method of the sampling filter is substantially the same as the specific process, and will not be repeated here.

502、采用目标下采样滤波器对待编码图像块进行下采样,得到第一图像块。502. Use a target downsampling filter to downsample the image block to be coded to obtain a first image block.

503、对第一图像块进行编码,得到码流。503. Encode the first image block to obtain a code stream.

504、将预先设置的上采样滤波器集合中与目标下采样滤波器类型相同的上采样滤波器确定为目标上采样滤波器,其中,上采样滤波器集合至少包括有限冲击响应FIR上采样滤波器和卷积神经网络CNN上采样滤波器。504. Determine an upsampling filter of the same type as the target downsampling filter in the preset upsampling filter set as the target upsampling filter, wherein the upsampling filter set includes at least a finite impulse response FIR upsampling filter and convolutional neural network CNN upsampling filter.

505、生成与目标上采样滤波器对应的上采样滤波器指示信息。505. Generate upsampling filter indication information corresponding to the target upsampling filter.

506、将上采样滤波器指示信息写入码流。506. Write the upsampling filter indication information into the code stream.

应理解,图7所示的方法的步骤的具体限定和解释可以参见上文中对图4和图6所述的方法中的相应步骤的解释和限定,这里不再详细描述。It should be understood that, for specific definitions and explanations of the steps of the method shown in FIG. 7 , reference may be made to the above explanations and definitions of corresponding steps in the methods shown in FIGS. 4 and 6 , and will not be described in detail here.

可选地,在本申请中,目标上采样滤波器和目标下采样滤波器均可以根据待编码图像块的编码代价从预先设置的上采样滤波器集合和目标下采样滤波器集合中确定。并且,确定目标上采样滤波器和确定目标下采样滤波器的过程可以是相互独立的。Optionally, in this application, both the target up-sampling filter and the target down-sampling filter may be determined from a preset up-sampling filter set and target down-sampling filter set according to the encoding cost of the image block to be encoded. Also, the processes of determining the target up-sampling filter and determining the target down-sampling filter may be independent of each other.

本申请中,可以根据编码代价从下采样滤波器集合中确定出目标下采样滤波器,并根据下采样滤波器的滤波器类型确定上采样滤波器,与直接采用固定参数值的上采样滤波器进行上采样操作相比,本申请方案在选择目标上采样滤波器时充分考虑了待编码图像块的编码代价,能够取得更好的编码效果。In this application, the target downsampling filter can be determined from the downsampling filter set according to the encoding cost, and the upsampling filter can be determined according to the filter type of the downsampling filter, and the upsampling filter directly using fixed parameter values Compared with the upsampling operation, the scheme of the present application fully considers the coding cost of the image block to be coded when selecting the target upsampling filter, and can achieve better coding effect.

上文结合图4至图7从编码端的角度对本申请实施例的图像编码方法进行了详细介绍,下面结合图8对本申请实施例的图像解码方法进行详细的描述。应理解,图8所示的图像解码方法与上文中的图4、图6和图7所示的图像编码方法的过程是相对应或者说相逆的。The above describes the image encoding method of the embodiment of the present application in detail from the perspective of the encoding end with reference to FIGS. 4 to 7 . The image decoding method of the embodiment of the present application is described in detail below in conjunction with FIG. 8 . It should be understood that the process of the image decoding method shown in FIG. 8 corresponds to or is opposite to the process of the image coding method shown in FIG. 4 , FIG. 6 and FIG. 7 above.

图8是本申请实施例的图像解码方法的示意性流程图。图8所示的方法可以由解码端设备执行,解码端设备具体可以是智能终端、PAD、视频播放器、物联网设备或者其它具有视频图像解码功能的设备。图8所示的方法包括步骤401至408,下面结合具体实例对步骤401至步骤408进行详细的说明。Fig. 8 is a schematic flowchart of an image decoding method according to an embodiment of the present application. The method shown in FIG. 8 may be executed by a decoding end device, and the decoding end device may specifically be a smart terminal, a PAD, a video player, an Internet of Things device, or other devices with a video image decoding function. The method shown in FIG. 8 includes steps 401 to 408, and the steps 401 to 408 will be described in detail below with reference to specific examples.

601、获取码流。601. Obtain a code stream.

上述码流可以是经过本申请的图像编码方法得到的码流。具体地,上述码流可以是上文中图4、图6和图7所示的图像编码方法得到的。The above code stream may be a code stream obtained through the image coding method of the present application. Specifically, the above code stream may be obtained by the image coding method shown in FIG. 4 , FIG. 6 and FIG. 7 above.

602、对码流进行熵解码、反量化和反变换,得到待解码图像块的重建残差信号。602. Perform entropy decoding, inverse quantization, and inverse transformation on the code stream to obtain a reconstructed residual signal of the image block to be decoded.

603、获取待解码图像块的预测信号。603. Acquire a prediction signal of an image block to be decoded.

604、将重建残差信号和预测信号相加,得到待解码图像块的初始重建图像块。604. Add the reconstruction residual signal and the prediction signal to obtain an initial reconstructed image block of the image block to be decoded.

605、解析码流,获取编码模式指示信息。605. Parse the code stream to acquire coding mode indication information.

上述编码模式指示信息用于指示编码端在编码时采用的是原分辨率编码模式还是变分辨率编码模式。也就是说,上述编码模式指示信息会指示出上述码流是在哪种编码模式下得到的。例如,上述编码模式指示信息会指示上述码流是在原分辨率编码模式下或者变分辨率编码模式下编码得到的。The above encoding mode indication information is used to indicate whether the encoding end adopts the original resolution encoding mode or the variable resolution encoding mode during encoding. That is to say, the above coding mode indication information will indicate in which coding mode the above code stream is obtained. For example, the above coding mode indication information may indicate that the code stream is obtained by coding in the original resolution coding mode or the variable resolution coding mode.

606、根据编码模式指示信息从原分辨率解码模式和变分辨率解码模式中确定目标解码模式。606. Determine a target decoding mode from the original resolution decoding mode and the variable resolution decoding mode according to the encoding mode indication information.

可选地,根据编码模式指示信息从原分辨率解码模式和变分辨率解码模式中确定目标解码模式,包括:当编码模式为变分辨率编码模式时,确定目标解码方式为变分辨率解码模式;当编码模式为原分辨率编码模式时,确定目标解码方式为原分辨率解码模式。Optionally, determining the target decoding mode from the original resolution decoding mode and the variable resolution decoding mode according to the coding mode indication information includes: when the coding mode is the variable resolution coding mode, determining that the target decoding mode is the variable resolution decoding mode ; When the encoding mode is the original resolution encoding mode, determine that the target decoding mode is the original resolution decoding mode.

可选地,上述编码模式指示信息具体由变分辨率编码模式标志Flag1的取值来表示,Flag1的不同取值用于表示不同的编码模式。例如,当Flag1为0时表示上述码流是在原分辨率编码模式下得到的,当Flag1为1时表示上述码流是在变分辨率编码模式下得到的。Optionally, the above encoding mode indication information is specifically represented by the value of the variable resolution encoding mode flag Flag1, and different values of Flag1 are used to indicate different encoding modes. For example, when Flag1 is 0, it means that the above bit stream is obtained in the original resolution encoding mode, and when Flag1 is 1, it means that the above bit stream is obtained in the variable resolution encoding mode.

当上述编码模式指示信息是通过变分辨率编码模式标志Flag1的取值来表示时,解码端可以根据Flag1的取值来确定目标解码模式。例如,当Flag1为0时,解码端确定目标解码方式为变分辨率解码模式;当Flag1为1时,解码端确定目标解码方式为原分辨率解码模式。When the above coding mode indication information is represented by the value of the variable resolution coding mode flag Flag1, the decoder can determine the target decoding mode according to the value of Flag1. For example, when Flag1 is 0, the decoding end determines that the target decoding mode is the variable resolution decoding mode; when Flag1 is 1, the decoding end determines that the target decoding mode is the original resolution decoding mode.

此外,上述编码模式信息还可以由原分辨率编码模式标志Flag1的取值来表示,Flag1的不同取值用于表示不同的编码模式。例如,当Flag1为0时表示目标编码模式为变分辨率编码模式,当Flag1为1时表示目标编码模式为原分辨率编码模式。In addition, the above encoding mode information may also be represented by the value of the original resolution encoding mode flag Flag1, and different values of Flag1 are used to indicate different encoding modes. For example, when Flag1 is 0, it indicates that the target encoding mode is a variable resolution encoding mode, and when Flag1 is 1, it indicates that the target encoding mode is an original resolution encoding mode.

解码端选择与编码端的编码模式相对应的解码模式作为目标解码模式,能够保证解码端的解码效果。The decoding end selects the decoding mode corresponding to the encoding mode of the encoding end as the target decoding mode, which can ensure the decoding effect of the decoding end.

607、在目标解码模式为变分辨率解码模式的情况下,解析待编码图像块的码流,获取上采样滤波器指示信息。607. When the target decoding mode is the variable resolution decoding mode, analyze the code stream of the image block to be encoded, and acquire upsampling filter indication information.

当解码端确定目标解码模式为变分辨率解码模式时,说明上述码流也是在变分辨率编码模式下编码得到的,编码端会将上采样滤波器指示写入码流,使得解码端通过解析码流得到上采样滤波器指示信息。When the decoding end determines that the target decoding mode is the variable resolution decoding mode, it means that the above bit stream is also encoded in the variable resolution encoding mode, and the encoding end will write the upsampling filter indication into the bit stream, so that the decoding end can pass the analysis Code stream gets upsampling filter indication information.

上述上采样滤波器指示信息可以用于指示上采样滤波器集合中某个上采样滤波器为目标上采样滤波器。The above upsampling filter indication information may be used to indicate that a certain upsampling filter in the upsampling filter set is a target upsampling filter.

例如,上采样滤波器指示信息可以指示上采样滤波器集合中的FIR上采样滤波器作为目标上采样滤波器,或者,上采样滤波器指示信息还可以指示上采样滤波器集合中的CNN上采样滤波器作为目标上采样滤波器。For example, the upsampling filter indication information may indicate the FIR upsampling filter in the upsampling filter set as the target upsampling filter, or the upsampling filter indication information may also indicate the CNN upsampling filter in the upsampling filter set filter as the target upsampling filter.

608、根据上采样滤波器指示信息从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,上采样滤波器集合至少包括FIR上采样滤波器和CNN上采样滤波器。608. Determine a target upsampling filter from a preset upsampling filter set according to the upsampling filter indication information, where the upsampling filter set includes at least an FIR upsampling filter and a CNN upsampling filter.

可选地,上采样滤波器指示信息可以为上采样滤波器选择标志Flag2,Flag2的取值用于指示目标上采样滤波器。Optionally, the upsampling filter indication information may be an upsampling filter selection flag Flag2, and a value of Flag2 is used to indicate a target upsampling filter.

例如,Flag2的取值为0时,FIR滤波器为目标上采样滤波器,Flag2的取值为1时,CNN滤波器为目标上采样滤波器1。For example, when the value of Flag2 is 0, the FIR filter is the target upsampling filter, and when the value of Flag2 is 1, the CNN filter is the target upsampling filter 1.

或者,当Flag2的取值为0时,CNN滤波器为目标上采样滤波器,Flag2的取值为1时,FIR滤波器为目标上采样滤波器1。Alternatively, when the value of Flag2 is 0, the CNN filter is the target upsampling filter, and when the value of Flag2 is 1, the FIR filter is the target upsampling filter 1.

解码端通过解析码流获取Flag2的取值,并且可以根据Flag2的取值来直接确定目标上采样滤波器。The decoding end obtains the value of Flag2 by analyzing the code stream, and can directly determine the target upsampling filter according to the value of Flag2.

609、采用目标上采样滤波器对初始重建图像块块进行上采样,得到目标重建图像块。609. Upsample the initial reconstructed image block by using the target upsampling filter to obtain the target reconstructed image block.

本申请中,当在变分辨率解码模式下对图像块进行解码时,解码端能够根据上采样滤波器指示信息从预先设置的上采样滤波器集合中选择相应的上采样滤波器作为目标上采样滤波器,进而进行上采样操作,与直接采用固定参数的上采样滤波器进行上采样操作的方式相比,能够根据图像块的情况选择匹配的上采样滤波器进行上采样操作,从而提高解码效果。In this application, when decoding an image block in the variable resolution decoding mode, the decoding end can select the corresponding upsampling filter from the preset upsampling filter set as the target upsampling filter according to the upsampling filter indication information Filter, and then perform upsampling operation. Compared with the way of directly using fixed parameter upsampling filter for upsampling operation, the matching upsampling filter can be selected according to the situation of the image block for upsampling operation, thereby improving the decoding effect .

可选地,作为一个实施例,上述CNN上采样滤波器的参数值为预设的,该CNN上采样滤波器的参数值是对预设图像训练集进行离线训练得到的。Optionally, as an embodiment, the parameter value of the CNN upsampling filter is preset, and the parameter value of the CNN upsampling filter is obtained by performing offline training on a preset image training set.

对CNN上采样滤波器进行离线训练的过程可以参见图4、图6和图7所示的图像编码方法中所描述的具体过程,为了简洁,这里不再重复描述。For the offline training process of the CNN upsampling filter, refer to the specific process described in the image encoding method shown in Fig. 4, Fig. 6 and Fig. 7. For the sake of brevity, the description will not be repeated here.

由于CNN上采样滤波器的参数值是通过离线训练得到的,因此,在解码过程中采用CNN上采样滤波器进行上采样可以能够降低上采样过程中图像的信息损失,提升图像解码质量。Since the parameter values of the CNN upsampling filter are obtained through offline training, using the CNN upsampling filter for upsampling during the decoding process can reduce the information loss of the image during the upsampling process and improve the image decoding quality.

在一种可能的实现方式中,上述方法还包括:解析码流,获取CNN上采样滤波器的更新参数值,该CNN上采样滤波器的更新参数值用于替代CNN上采样滤波器预先设置的参数值。In a possible implementation, the above method further includes: parsing the code stream to obtain an updated parameter value of the CNN upsampling filter, where the updated parameter value of the CNN upsampling filter is used to replace the preset value of the CNN upsampling filter parameter value.

编码端可以对CNN上采样滤波器进行定期或者不定期的更新,并将获取的CNN上采样滤波器的参数值写入到码流,使得解码端也能够根据该CNN上采样滤波器的参数值对CNN上采样滤波器的初始参数值进行更新。The encoding end can update the CNN upsampling filter regularly or irregularly, and write the obtained parameter value of the CNN upsampling filter into the code stream, so that the decoding end can also use the parameter value of the CNN upsampling filter Update the initial parameter values of the CNN upsampling filter.

通过对CNN上采样滤波器的参数值进行更新,能够获取与图像内容更加匹配的滤波器参数,从而在利用CNN上采样滤波器进行上采样操作时进一步减小图像的信息损失,提升图像解码质量。By updating the parameter values of the CNN upsampling filter, filter parameters that better match the image content can be obtained, thereby further reducing image information loss and improving image decoding quality when using the CNN upsampling filter for upsampling operations .

可选地,CNN上采样滤波器的更新参数值是编码端根据待编码图像块对CNN上采样网络进行在线训练得到的,其中,待解码图像块是对待编码图像块进行编码得到的。Optionally, the updated parameter value of the CNN upsampling filter is obtained by the encoder through online training of the CNN upsampling network according to the image block to be encoded, wherein the image block to be decoded is obtained by encoding the image block to be encoded.

应理解,上述待编码图像块和上述待解码图像块是对应的,也就是说,对待编码图像块进行编码得到待解码图像块的码流。It should be understood that the image block to be encoded corresponds to the image block to be decoded, that is, the image block to be encoded is encoded to obtain a code stream of the image block to be decoded.

通过在线训练CNN上采样滤波器,能够根据图像纹理特征使用滤波器参数更加匹配的上采样滤波器做上采样操作,与采用预置的CNN上采样滤波器相比,可以进一步提升上采样输出的图像块的图像质量。By training the CNN upsampling filter online, an upsampling filter with more matching filter parameters can be used for the upsampling operation according to the image texture characteristics. Compared with the preset CNN upsampling filter, the upsampling output can be further improved. The image quality of the image block.

可选地,上述CNN上采样滤波器的更新参数值是对预设图像训练集进行离线训练得到的。Optionally, the updated parameter values of the above-mentioned CNN upsampling filter are obtained by performing offline training on a preset image training set.

通过离线训练获取CNN上采样滤波器的更新参数值,可以对CNN上采样滤波器的参数值进行更新,从而提高编码质量。The updated parameter value of the CNN upsampling filter is obtained through offline training, and the parameter value of the CNN upsampling filter can be updated, thereby improving the encoding quality.

在一种可能的实现方式中,在解析码流,获取CNN上采样滤波器的更新参数值之前,方法还包括:解析码流,获取滤波器参数更新指示信息,滤波器参数更新指示信息用于指示是否对目标上采样滤波器的参数值进行更新;解析码流,获取CNN上采样滤波器的更新参数值,包括:在滤波器参数更新指示信息指示对目标上采样滤波器的参数进行更新的情况下,解析码流,获取CNN上采样滤波器的更新参数值。In a possible implementation, before parsing the code stream and obtaining the update parameter value of the CNN upsampling filter, the method further includes: parsing the code stream, obtaining filter parameter update indication information, and the filter parameter update indication information is used for Indicates whether to update the parameter value of the target upsampling filter; parse the code stream to obtain the updated parameter value of the CNN upsampling filter, including: indicating that the parameters of the target upsampling filter are updated in the filter parameter update instruction information In this case, parse the code stream to obtain the updated parameter value of the CNN upsampling filter.

可选地,上述滤波器更新指示信息具体为Flag3的取值,Flag3的不同取值用于指示是否对目标上采样滤波器的参数值进行更新。Optionally, the above filter update instruction information is specifically the value of Flag3, and different values of Flag3 are used to indicate whether to update the parameter value of the target upsampling filter.

例如,当Flag3的取值为0时,表示不需要对CNN上采样滤波器的参数值进行更新;当Flag3的取值为1时,表示不需要对CNN上采样滤波器的参数值进行更新;For example, when the value of Flag3 is 0, it means that the parameter value of the CNN upsampling filter does not need to be updated; when the value of Flag3 is 1, it means that the parameter value of the CNN upsampling filter does not need to be updated;

可选地,上述滤波器参数更新指示信息携带在SPS或者PPS中。Optionally, the above filter parameter update instruction information is carried in the SPS or the PPS.

通过滤波器参数更新指示信息指示需要对目标上采样滤波器进行更新的情况下,才从码流中获取CNN上采样滤波器的更新值,能够减少解码的负担,提高解码效率。The update value of the CNN upsampling filter is obtained from the code stream only when the filter parameter update indication information indicates that the target upsampling filter needs to be updated, which can reduce the decoding burden and improve decoding efficiency.

在本申请中,滤波器参数更新指示信息和可以是定期发送的,这样就可以根据CNN上采样滤波器的更新参数值对CNN上采样滤波器的参数值进行更新,以尽可能的提高编码效果。In this application, the filter parameter update indication information can be sent periodically, so that the parameter value of the CNN upsampling filter can be updated according to the update parameter value of the CNN upsampling filter, so as to improve the coding effect as much as possible .

上文结合图4至图8从编码端和解码端的角度对本申请实施例的图像编码方法和图像解码方法进行了详细介绍。为了更好地理解本申请实施例的图像编解码方法,下面结合具体的实施例对本申请实施例的图像编解码方法的具体过程进行详细的介绍。The image encoding method and the image decoding method according to the embodiments of the present application are described in detail from the perspectives of the encoding end and the decoding end with reference to FIGS. 4 to 8 . In order to better understand the image encoding and decoding method of the embodiment of the present application, the specific process of the image encoding and decoding method of the embodiment of the present application will be described in detail below in conjunction with specific embodiments.

实施例一:上采样滤波器和下采样滤波器均为CNN滤波器或者FIR滤波器。Embodiment 1: Both the up-sampling filter and the down-sampling filter are CNN filters or FIR filters.

在实施例一中,上采样滤波器和下采样滤波器采用相同类型的滤波器,而上采样滤波器和下采样滤波器具体采用何种类型的滤波器可以根据图像块的编码代价从CNN滤波器和FIR滤波器中来选择。In the first embodiment, the upsampling filter and the downsampling filter use the same type of filter, and the specific type of filter used by the upsampling filter and the downsampling filter can be filtered from the CNN according to the encoding cost of the image block filter and FIR filter to choose from.

在实施例一中,编码器的具体架构可以如图9所示。在对图像块进行编码时有原分辨率编模式和变分辨率编码模式可供选择,在选择编码模式时具体可以根据图像块的编码代价从原分辨率编模式和变分辨率编码模式中选择一种编码模式对图像块进行编码。当确定在原分辨率编码模式下对图像块进行编码时,直接采用图9中所示的原分辨率编码模块对图像块进行编码;而当确定在变分辨率模式下对图像块进行编码时,需要从CNN上采样滤波器和FIR上采样滤波器中选择上采样滤波器,从CNN下采样滤波器和FIR下采样滤波器中选择下采样滤波器。为了保证图像块的编码效果,下采样滤波器与上采样滤波器采用相同类型的滤波器,如图9所示,当上采样滤波器为CNN上采样滤波器时,下采样滤波器为CNN下采样滤波器,当上采样滤波器为FIR上采样滤波器时,下采样滤波器为FIR下采样滤波器。In Embodiment 1, the specific architecture of the encoder may be as shown in FIG. 9 . When encoding the image block, there are original resolution encoding mode and variable resolution encoding mode to choose from. When selecting the encoding mode, you can choose from the original resolution encoding mode and variable resolution encoding mode according to the encoding cost of the image block. One encoding mode encodes image blocks. When it is determined to encode the image block in the original resolution encoding mode, directly use the original resolution encoding module shown in Figure 9 to encode the image block; and when it is determined to encode the image block in the variable resolution mode, The upsampling filter needs to be selected from the CNN upsampling filter and the FIR upsampling filter, and the downsampling filter is selected from the CNN downsampling filter and the FIR downsampling filter. In order to ensure the encoding effect of the image block, the downsampling filter and the upsampling filter use the same type of filter, as shown in Figure 9, when the upsampling filter is a CNN upsampling filter, the downsampling filter is a CNN downsampling filter A sampling filter, when the up-sampling filter is an FIR up-sampling filter, the down-sampling filter is an FIR down-sampling filter.

其中,CNN上采样滤波器、CNN下采样滤波器以及FIR上采样滤波器和FIR下采样滤波器可以预先设计好(滤波器参数值已经确定)并且内置于编码器中。Wherein, the CNN upsampling filter, the CNN downsampling filter, the FIR upsampling filter and the FIR downsampling filter can be pre-designed (filter parameter values have been determined) and built into the encoder.

在实施例一中,编码端需要对编码模式和滤波器进行选择,因此,编码端在编码图像块时会产生两个特有的选择信息,即原分辨率或低分辨率编码模式选择信息和CNN或FIR滤波器选择信息,并将这两个选择信息写入码流中。使得解码器能够识别一个图像块是否采用变分辨率解码模式,并在采用变分辨率解码模式的情况下,选择相应的上采样滤波器对解码得到的低分辨率重建图像块进行上采样操作,从而得到原分辨率的重建图像块。In Embodiment 1, the encoding end needs to select the encoding mode and filter. Therefore, the encoding end will generate two unique selection information when encoding the image block, that is, the original resolution or low resolution encoding mode selection information and the CNN or FIR filter selection information, and write the two selection information into the code stream. The decoder can identify whether an image block adopts the variable resolution decoding mode, and in the case of adopting the variable resolution decoding mode, select the corresponding upsampling filter to perform an upsampling operation on the decoded low resolution reconstructed image block, In this way, the reconstructed image block with the original resolution is obtained.

如图10所示,在实施例一中,编码器的编码过程具体如下:As shown in Figure 10, in Embodiment 1, the encoding process of the encoder is specifically as follows:

701、获取图像块。701. Acquire an image block.

具体地,上述图像块既可以是一帧完整的图像,也可以是一帧图像的一部分。当上述图像块为一帧图像中的一部分时,在步骤701之前可以先对图像进行划分,得到多个图像块,然后在步骤701中再获取需要编码的图像块。Specifically, the above-mentioned image block may be a complete frame of image, or a part of a frame of image. When the above image block is part of a frame of image, the image may be divided before step 701 to obtain multiple image blocks, and then in step 701 the image block to be coded is obtained.

702、确定原分辨率编码模式下当前图像块的编码代价。702. Determine the encoding cost of the current image block in the original resolution encoding mode.

具体而言,步骤702中是需要计算当前图像块在原分辨率编码模式下进行编码的编码代价。Specifically, in step 702, it is necessary to calculate the encoding cost of encoding the current image block in the original resolution encoding mode.

可以通过以下过程计算当前图像块在原分辨率编码模式下的编码代价。The encoding cost of the current image block in the original resolution encoding mode can be calculated through the following process.

首先,根据预设的编解码方案在原分辨率模式下对当前图像块进行编码,得到当前图像块的压缩码流以及当前图像块的重建图像块;Firstly, the current image block is encoded in the original resolution mode according to the preset codec scheme to obtain the compressed code stream of the current image block and the reconstructed image block of the current image block;

其次,计算重建图像块与当前图像块的均方误差Dorg,确定当前图像块的压缩码流的大小RorgSecondly, calculate the mean square error D org between the reconstructed image block and the current image block, and determine the size R org of the compressed code stream of the current image block;

最后,根据Dorg和Rorg计算原分辨率编码模式下对当前图像块进行编码的率失真代价costorg,并将该率失真代价costorg确定为当前图像块在原分辨率编码模式的编码代价。Finally, calculate the rate-distortion cost cost org for encoding the current image block in the original resolution encoding mode according to D org and R org , and determine the rate-distortion cost cost org as the encoding cost of the current image block in the original resolution encoding mode.

应理解,编码代价有多种具体表现形式,例如,编码代价具体可以是率失真代价,也可以是失真等等,本申请中对编码代价的具体形式不做限制。It should be understood that the encoding cost has many specific forms. For example, the encoding cost may specifically be a rate-distortion cost or distortion, etc. The specific form of the encoding cost is not limited in this application.

703、确定FIR上采样滤波器作为目标上采样滤波器时当前图像块的编码代价。703. Determine the encoding cost of the current image block when the FIR upsampling filter is used as the target upsampling filter.

步骤703实质上是要计算在当前图像块在变分辨率编码模式(FIR上采样滤波器作为上采样滤波器)下进行编码的编码代价。Step 703 is essentially to calculate the encoding cost of encoding the current image block in the variable resolution encoding mode (the FIR upsampling filter is used as the upsampling filter).

具体地,可以通过以下过程来计算FIR上采样滤波器作为目标上采样滤波器时当前图像块的编码代价。Specifically, the encoding cost of the current image block when the FIR upsampling filter is used as the target upsampling filter may be calculated through the following process.

(1)采用FIR下采样滤波器(典型的FIR下采样滤波器为双三次下采样滤波器)对当前图像块进行下采样操作,得到低分辨率的图像块;(1) adopt FIR down-sampling filter (typical FIR down-sampling filter is bicubic down-sampling filter) to carry out down-sampling operation to current image block, obtain the image block of low resolution;

(2)根据选择的编解码方案对该低分辨率的图像块进行编码操作,输出压缩码流;(2) Encoding the low-resolution image block according to the selected encoding and decoding scheme, and outputting a compressed code stream;

(3)对低分辨率图像块进行重建,得到低分辨率的重建图像块;(3) Reconstructing the low-resolution image block to obtain a low-resolution reconstructed image block;

(4)采用FIR上采样滤波器对低分辨率的重建图像块进行上采样,得到与当前图像块的原始分辨率相同的重建图像块;(4) Upsampling the low-resolution reconstructed image block by using an FIR upsampling filter to obtain a reconstructed image block identical to the original resolution of the current image block;

(4)计算重建图像块与当前图像块的均方误差DFIR,确定当前图像块的压缩码流的大小RFIR(4) Calculate the mean square error D FIR between the reconstructed image block and the current image block, and determine the size R FIR of the compressed code stream of the current image block;

(5)根据DFIR和RFIR计算率失真代价costFIR,并将该率失真代价costFIR确定为FIR滤波器作为目标上采样滤波器时当前图像块的编码代价。(5) Calculate the rate-distortion cost cost FIR according to D FIR and R FIR , and determine the rate-distortion cost cost FIR as the encoding cost of the current image block when the FIR filter is used as the target upsampling filter.

在上述计算FIR上采样滤波器作为目标上采样滤波器时当前图像块的编码代价的过程中,为了与解码端获取相同的重建图像块,这里所采用的FIR上采样滤波器与解码端所采用的FIR上采样滤波器必须为同一个滤波器(滤波器参数相同)。In the above process of calculating the encoding cost of the current image block when the FIR upsampling filter is used as the target upsampling filter, in order to obtain the same reconstructed image block as the decoding end, the FIR upsampling filter used here is the same as that used by the decoding end. The FIR upsampling filter must be the same filter (same filter parameters).

704、确定CNN滤波器作为目标上采样滤波器时当前图像块的编码代价。704. Determine the coding cost of the current image block when the CNN filter is used as the target upsampling filter.

步骤704实质上是要计算在当前图像块在变分辨率编码模式(CNN上采样滤波器作为上采样滤波器)下进行编码的编码代价。Step 704 is essentially to calculate the encoding cost of encoding the current image block in the variable resolution encoding mode (the CNN upsampling filter is used as the upsampling filter).

具体地,可以通过以下过程来计算CNN滤波器作为目标上采样滤波器时当前图像块的编码代价。Specifically, the encoding cost of the current image block when the CNN filter is used as the target upsampling filter can be calculated through the following process.

(1)采用CNN下采样滤波器对当前图像块进行下采样操作,得到低分辨率的图像块;(1) Use the CNN downsampling filter to perform a downsampling operation on the current image block to obtain a low-resolution image block;

(2)根据选择的编解码方案对该低分辨率的图像块进行编码操作,输出压缩码流;(2) Encoding the low-resolution image block according to the selected encoding and decoding scheme, and outputting a compressed code stream;

(3)对低分辨率图像块进行重建,得到低分辨率的重建图像块;(3) Reconstructing the low-resolution image block to obtain a low-resolution reconstructed image block;

(4)采用CNN上采样滤波器对低分辨率的重建图像块进行上采样,得到与当前图像块的原始分辨率相同的重建图像块;(4) Upsampling the low-resolution reconstructed image block by using a CNN upsampling filter to obtain a reconstructed image block with the same original resolution as the current image block;

(5)计算重建图像块与当前图像块的均方误差DCNN,确定当前图像块的压缩码流的大小RCNN(5) Calculate the mean square error D CNN between the reconstructed image block and the current image block, and determine the size R CNN of the compressed code stream of the current image block;

(6)根据DCNN和RCNN计算率失真代价costCNN,并将该率失真代价costCNN确定为CNN滤波器作为目标上采样滤波器时当前图像块的编码代价。(6) Calculate the rate-distortion cost cost CNN according to DCNN and R- CNN , and determine the rate-distortion cost cost CNN as the coding cost of the current image block when the CNN filter is used as the target upsampling filter.

在上述计算CNN上采样滤波器作为目标上采样滤波器时当前图像块的编码代价的过程中,为了与解码端获取相同的重建图像块,这里所采用的CNN上采样滤波器与解码端所采用的CNN上采样滤波器必须为同一个滤波器(滤波器参数相同)。In the above process of calculating the encoding cost of the current image block when the CNN upsampling filter is used as the target upsampling filter, in order to obtain the same reconstructed image block as the decoder, the CNN upsampling filter used here is the same as that used by the decoder. The CNN upsampling filter must be the same filter (the filter parameters are the same).

图11示出了CNN下采样滤波器的一种具体结构。该CNN下采样滤波器的网络结构由10个卷积层组成,每个卷积层的卷积核大小都是3x3,除了最后一个卷积层之外,其它的卷积层后面均使用了线性整流函数(Rectified Linear Unit,ReLU),其中,卷积层1至卷积层9使用的线性整流函数为ReLU.1至ReLU.9,并且第一层卷积的步长(Stride)设置为2。此外,该网络结构将输入的图像块经过一个FIR滤波器下采样之后得到的低分辨率图像添加到网络最后一层的输出,使得该网络具有残差学习特性。Fig. 11 shows a specific structure of the CNN downsampling filter. The network structure of the CNN downsampling filter consists of 10 convolutional layers. The convolution kernel size of each convolutional layer is 3x3. Except for the last convolutional layer, the other convolutional layers are followed by linear Rectified Linear Unit (ReLU), where the linear rectification functions used in convolutional layer 1 to convolutional layer 9 are ReLU.1 to ReLU.9, and the step size (Stride) of the first layer of convolution is set to 2 . In addition, the network structure adds the low-resolution image obtained after the input image block is down-sampled by a FIR filter to the output of the last layer of the network, so that the network has residual learning characteristics.

另外,图11所示的网络结构中的FIR滤波器具体可以是双三次滤波器、基于离散余弦变换的插值滤波器(Discrete Cosine Transform Based Interpolation Filter,DCTIF)等,其中,基于离散余弦变换的插值滤波器可以直接简称为DCTIF滤波器。In addition, the FIR filter in the network structure shown in Figure 11 can specifically be a bicubic filter, an interpolation filter based on discrete cosine transform (Discrete Cosine Transform Based Interpolation Filter, DCTIF), etc., wherein, the interpolation filter based on discrete cosine transform The filter can be directly referred to as a DCTIF filter for short.

上述步骤703和步骤704实质上是要确定当前图像块在变分辨率编码模式下进行编码的代价,由于在进行变分辨率编码时可以采用不同的上采样滤波器进行上采样,因此,需要分别计算不同滤波器(FIR上采样滤波器和CNN上采样滤波器)作为目标上采样滤波器时当前图像块的编码代价。The above step 703 and step 704 are essentially to determine the cost of encoding the current image block in the variable resolution encoding mode. Since different upsampling filters can be used for upsampling during variable resolution encoding, it is necessary to separately Calculate the encoding cost of the current image block when different filters (FIR upsampling filter and CNN upsampling filter) are used as the target upsampling filter.

705、在编码代价最小的编码模式下对当前图像块进行编码操作,生成码流。705. Perform an encoding operation on the current image block in an encoding mode with the smallest encoding cost to generate a code stream.

具体地,在步骤705中,可以根据步骤702至步骤704中计算出来的编码代价的大小来选择编码模式,并生成编码信息。该编码信息可以具体包括变分辨率编码模式指示标志Flag1和上采样滤波器选择标志Flag2。Specifically, in step 705, a coding mode may be selected according to the size of the coding cost calculated in steps 702 to 704, and coding information may be generated. The encoding information may specifically include a variable resolution encoding mode indication flag Flag1 and an upsampling filter selection flag Flag2.

上述根据编码代价来设置Flag1和Flag2具体包含以下三种情况。The above-mentioned setting of Flag1 and Flag2 according to the encoding cost specifically includes the following three situations.

(1)、当costorg<costFIR且costorg<costCNN时,确定在原分辨率模式下对当前图像块进行编码,此时将Flag1设置为0,Flag2无意义因此无需设置;(1) When cost org <cost FIR and cost org <cost CNN , it is determined to encode the current image block in the original resolution mode. At this time, Flag1 is set to 0, and Flag2 is meaningless, so there is no need to set it;

(2)、当costFIR<costorg且costFIR<costCNN时,确定在变分辨率模式对当前图像块进行编码,并采用FIR滤波器做上采样操作与下采样操作,此时将Flag1设置为1,将Flag2设置为0;(2) When cost FIR <cost org and cost FIR <cost CNN , it is determined to encode the current image block in the variable resolution mode, and use the FIR filter to perform up-sampling and down-sampling operations, and set Flag1 at this time is 1, set Flag2 to 0;

(3)、当costCNN<costorg且costCNN<costFIR时,确定在变分辨率模式对当前图像块进行编码,并采用CNN滤波器做上采样操作和下采样操作,此时将Flag1设置为1,将Flag2设置为1。(3) When cost CNN <cost org and cost CNN <cost FIR , determine to encode the current image block in the variable resolution mode, and use the CNN filter to perform up-sampling and down-sampling operations, and set Flag1 at this time is 1, set Flag2 to 1.

706、将当前图像块的编码信息写入码流。706. Write the encoding information of the current image block into the code stream.

在步骤706中,编码信息除了包含步骤705中确定的变分辨率编码模式标志Flag1和上采样滤波器选择标志Flag2之外,还可以包含对当前图像块进行编码时的预测模式以及量化后的编码系数等等。In step 706, in addition to the variable resolution coding mode flag Flag1 and upsampling filter selection flag Flag2 determined in step 705, the coding information may also include the prediction mode when coding the current image block and the quantized coding coefficients and so on.

实施例一中的解码端的解码过程如图12所示,图12所示的解码过程与图10所示的编码过程是相对应的,图12具体包含以下步骤。The decoding process of the decoding end in Embodiment 1 is shown in FIG. 12 . The decoding process shown in FIG. 12 corresponds to the encoding process shown in FIG. 10 , and FIG. 12 specifically includes the following steps.

801、获取压缩码流。801. Acquire a compressed code stream.

步骤801中获取的压缩码流可以是图10所示的编码方法最终生成的码流。在获取该压缩码流时,解码端可以直接从编码端获取,也可以从服务器中获取。The compressed code stream acquired in step 801 may be a code stream finally generated by the encoding method shown in FIG. 10 . When obtaining the compressed code stream, the decoder can obtain it directly from the coder or from the server.

802、解析当前图像块的变分辨率编码模式指示标志Flag1。802. Analyze the variable resolution coding mode indicator Flag1 of the current image block.

当前图像块可以是当前待解码的图像块,步骤801中获取的压缩码流可以是当前图像块的码流,在获取了当前图像块的码流之后,可以从当前图像块的码流中解析变分辨率编码模式指示标志Flag1,并获取Flag1的取值。The current image block may be the image block currently to be decoded, the compressed code stream obtained in step 801 may be the code stream of the current image block, and after the code stream of the current image block is acquired, it may be parsed from the code stream of the current image block The variable resolution encoding mode indicates Flag1, and obtains the value of Flag1.

803、根据Flag1确定是否采用变分辨率解码模式。803. Determine whether to adopt a variable resolution decoding mode according to Flag1.

Flag1的取值可以用于指示生成当前图像块的码流时采用的是变分辨率编码模式还是原分辨率编码模式。因此,可以根据Flag1的取值来确定是否在变分辨率解码模式下对当前图像块进行解码。The value of Flag1 can be used to indicate whether the variable resolution coding mode or the original resolution coding mode is adopted when generating the code stream of the current image block. Therefore, whether to decode the current image block in the variable resolution decoding mode can be determined according to the value of Flag1.

例如,Flag1的取值为0时表示生成当前图像块的码流时采用的是原分辨率编码模式;Flag1的取值为1时表示生成当前图像块的码流时采用的是变分辨率编码模式。For example, when the value of Flag1 is 0, it means that the original resolution coding mode is used when generating the code stream of the current image block; when the value of Flag1 is 1, it means that the variable resolution coding is used when generating the code stream of the current image block model.

因此,当Flag1的取值为0时可以确定采用原分辨率编码模式对当前图像块进行解码;当Flag1的取值为1时可以确定采用变分辨率编码模式对当前图像块进行解码。Therefore, when the value of Flag1 is 0, it can be determined that the current image block is decoded in the original resolution coding mode; when the value of Flag1 is 1, it can be determined that the current image block is decoded in the variable resolution coding mode.

804、解析当前图像块的上采样滤波器选择标志Flag2。804. Analyze the upsampling filter selection flag Flag2 of the current image block.

Flag2的取值可以用于指示在编码过程中是采用FIR上采样滤波器还是CNN上采样滤波器作为上采样滤波器进行上采样。The value of Flag2 can be used to indicate whether to use the FIR upsampling filter or the CNN upsampling filter as the upsampling filter for upsampling during the encoding process.

805、解析低分辨率编码块的编码信息,获取低分辨率的重建图像块。805. Analyze the coding information of the low-resolution coding block, and obtain a low-resolution reconstructed image block.

由于编码端可以选用不同的编码方案对图像块进行编码,因此,在解析解码信息获取重建图像块是也要选择与编码方案相对应的解码方案进行解码。Since the encoding end can select different encoding schemes to encode image blocks, it is also necessary to select a decoding scheme corresponding to the encoding scheme for decoding when analyzing and decoding information to obtain reconstructed image blocks.

例如,如果选用类似联合图像专家小组(Joint Photographic Experts Group,JPEG)(一种国际图像压缩标准)的方式编码一个图像块,那么在解码时仅需要从码流中解析图像块的量化后变换系数信息,并对系数做反量化和反变换操作即可得到原分辨率图像块重建。For example, if an image block is encoded in a manner similar to the Joint Photographic Experts Group (JPEG) (an international image compression standard), then only the quantized transform coefficients of the image block need to be parsed from the code stream during decoding information, and perform inverse quantization and inverse transformation operations on the coefficients to obtain the original resolution image block reconstruction.

另外,如果选用类似H.264或H.265帧内编码的方式编码一个图像块,那么在解码时需要从码流中解码当前块的编码模式、预测模式、量化后变换系数等编码信息。并且在对量化后变换系数进行反量化反变换得到重建残差信号之后,还需根据预测模式做预测操作获得预测信号,最终将两者相加得到原分辨率图像块重建。In addition, if an image block is encoded in a manner similar to H.264 or H.265 intra-frame encoding, then encoding information such as the encoding mode, prediction mode, and quantized transform coefficient of the current block needs to be decoded from the code stream during decoding. And after inverse quantization and inverse transformation of the quantized transform coefficients to obtain the reconstructed residual signal, it is necessary to perform a prediction operation according to the prediction mode to obtain the prediction signal, and finally add the two to obtain the reconstruction of the original resolution image block.

具体地,作为一种可选的实现方式,获取低分辨率的重建块主要包括以下过程:Specifically, as an optional implementation, obtaining low-resolution reconstruction blocks mainly includes the following processes:

首先,对当前图像块的压缩码流进行熵解码,得到量化系数;First, entropy decoding is performed on the compressed code stream of the current image block to obtain quantized coefficients;

其次,对量化系数进行反量化和变换,得到当前图像块的重建残差信号;Secondly, dequantize and transform the quantization coefficients to obtain the reconstruction residual signal of the current image block;

再次,获取当前图像块的预测信号(或者称为预测图像块);Again, obtain the prediction signal of the current image block (or called the prediction image block);

最后,根据当前图像块的残差信号和预测信号,得到当前图像块的低分辨率的重建图像块。Finally, according to the residual signal and the prediction signal of the current image block, a low-resolution reconstructed image block of the current image block is obtained.

806、解析原分辨率编码块的编码信息,获取原分辨率的重建图像块。806. Analyze the coding information of the coding block with the original resolution, and obtain the reconstructed image block with the original resolution.

步骤806中获取原分辨率的重建图像块的过程与步骤805中获取低分辨率的重建图像块的具体过程相同,只是步骤805的输入信号是低分辨率编码模式下获取的码流,而步骤806中的输入信号是原分辨率编码模式下获取的码流。The process of obtaining the reconstructed image block with original resolution in step 806 is the same as the specific process of obtaining the reconstructed image block with low resolution in step 805, except that the input signal in step 805 is the code stream obtained in low-resolution encoding mode, and the step The input signal in 806 is the code stream acquired in the original resolution encoding mode.

807、根据Flag2确定是否采用CNN上采样滤波器。807. Determine whether to use a CNN upsampling filter according to Flag2.

具体地,可以根据Flag2的取值来具体确定采用CNN上采样滤波器还是FIR上采样滤波器进行上采样。Specifically, it may be specifically determined to use the CNN upsampling filter or the FIR upsampling filter for upsampling according to the value of Flag2.

例如,Flag2的取值为0时表示采用CNN上采样滤波器进行上采样,Flag2的取值为1时表示采用FIR上采样滤波器进行上采样。因此,当Flag2的取值为1时确定采用CNN上采样滤波器,当Flag2的取值为0时确定不采用CNN上采样滤波器(采用FIR上采样滤波器)。For example, when the value of Flag2 is 0, it means that the CNN upsampling filter is used for upsampling, and when the value of Flag2 is 1, it means that the FIR upsampling filter is used for upsampling. Therefore, when the value of Flag2 is 1, it is determined to use the CNN upsampling filter, and when the value of Flag2 is 0, it is determined not to use the CNN upsampling filter (the FIR upsampling filter is used).

808、使用CNN上采样滤波器对低分辨率的重建块进行上采样,得到原分辨率的重建图像块。808. Use the CNN upsampling filter to upsample the low-resolution reconstruction block to obtain the original resolution reconstruction image block.

步骤808中采用的CNN上采样滤波器可以如图13所示,图13给出一种CNN上采样滤波器的网络结构,该网络分为五层,前两层是卷积层,执行多尺度特征提取操作,第三层是反卷积层,执行多尺度特征的上采样操作,最后两层是卷积层,完成多尺度重建。第一层卷积层卷积核大小是5x5,特征图数量是64;第二层同时使用5x5和3x3两种大小的卷积核,特征图数量分别是16和32;第三层的反卷积核大小是12x12,特征图数量是48;第四层同时使用3x3和1x1两种大小的卷积核,对应的特征图数量分别是16和32;第五层的卷积核大小是3x3,特征图数量是1,也就是输出的原分辨率图像块。前4层卷积层的每层后面添加ReLU层作为激活函数,对卷积输出信号做激活操作。The CNN upsampling filter used in step 808 can be shown in Figure 13. Figure 13 shows a network structure of a CNN upsampling filter. The network is divided into five layers, the first two layers are convolutional layers, and multi-scale The feature extraction operation, the third layer is the deconvolution layer, which performs the upsampling operation of multi-scale features, and the last two layers are convolution layers, which complete the multi-scale reconstruction. The size of the convolution kernel of the first convolutional layer is 5x5, and the number of feature maps is 64; the second layer uses both 5x5 and 3x3 convolution kernels, and the number of feature maps is 16 and 32 respectively; the deconvolution of the third layer The size of the product kernel is 12x12, and the number of feature maps is 48; the fourth layer uses both 3x3 and 1x1 convolution kernels, and the corresponding number of feature maps are 16 and 32 respectively; the size of the convolution kernel of the fifth layer is 3x3, The number of feature maps is 1, which is the output original resolution image block. After each layer of the first 4 convolutional layers, a ReLU layer is added as an activation function to activate the convolutional output signal.

809、使用FIR上采样滤波器对低分辨率的重建块进行上采样,得到原分辨率的重建图像块。809. Use an FIR upsampling filter to upsample the low-resolution reconstruction block to obtain a reconstruction image block with the original resolution.

在步骤809中,具体可选用H.265标准方案中的DCTIF插值滤波器对低分辨率重建做插值操作获得原分辨率重建。In step 809, the DCTIF interpolation filter in the H.265 standard solution may be used to interpolate the low-resolution reconstruction to obtain the original-resolution reconstruction.

在步骤808和步骤809中,原始分辨率是指在编码端与该重建图像块对应的待编码图像块的分辨率,通过进行上采样能够得到与原始待编码图像分辨率相同的重建图像块。In steps 808 and 809, the original resolution refers to the resolution of the image block to be encoded corresponding to the reconstructed image block at the encoding end, and the reconstructed image block with the same resolution as the original image to be encoded can be obtained through upsampling.

810、确定当前图像块是否为最后一个图像块。810. Determine whether the current image block is the last image block.

具体可以根据码流中携带的其它编码信息来确定当前图像块是否为最后一个待解码的图像块。Specifically, it may be determined whether the current image block is the last image block to be decoded according to other encoding information carried in the code stream.

在当前图像块不是最后一个待解码的图像块的情况下,继续执行步骤802,以继续对下一个图像块进行解码;在当前图像块是最后一个待解码的图像块的情况下,执行步骤811,当前图像的解码过程结束。In the case that the current image block is not the last image block to be decoded, continue to execute step 802 to continue decoding the next image block; in the case that the current image block is the last image block to be decoded, execute step 811 , the decoding process of the current image ends.

811、当前图像解码结束。811. The decoding of the current image ends.

在实施例一中,CNN上采样滤波器和CNN下采样滤波器可以预先训练得到,并且预置于编码器和解码器中。编码器与解码器在编解码过程中直接使用预置的CNN上采样滤波器与CNN上采样滤波器。In Embodiment 1, the CNN up-sampling filter and the CNN down-sampling filter can be obtained through pre-training and pre-installed in the encoder and the decoder. The encoder and decoder directly use the preset CNN upsampling filter and CNN upsampling filter in the process of encoding and decoding.

具体地,CNN上采样滤波器和CNN下采样滤波器的参数值可以是预设的参数值,并且该预设的参数值可以基于图像训练集进行离线训练得到。Specifically, the parameter values of the CNN up-sampling filter and the CNN down-sampling filter may be preset parameter values, and the preset parameter values may be obtained through offline training based on the image training set.

在实施例一中,由于上采样滤波器和下采样滤波器有可能分别采用CNN上采样滤波器和CNN下采样滤波器,因此,可以通过联合训练的方式来得到CNN上采样滤波器和CNN下采样滤波器的参数值。In the first embodiment, since the up-sampling filter and the down-sampling filter may respectively adopt the CNN up-sampling filter and the CNN down-sampling filter, the CNN up-sampling filter and the CNN down-sampling filter can be obtained through joint training. The parameter value of the sampling filter.

对CNN上采样滤波器和CNN下采样滤波器进行联合训练包括以下具体步骤:The joint training of CNN upsampling filter and CNN downsampling filter includes the following specific steps:

步骤1、单独训练CNN上采样网络获得上采样网络初始参数。Step 1. Separately train the CNN upsampling network to obtain the initial parameters of the upsampling network.

对训练集里的图片进行下采样,并将得到的下采样图像作为CNN上采样网络的输入,将训练集中的原始图片作为训练目标。具体可以通过公式(7)对CNN上采样网络进行训练,进而获取上采样网络初始参数。The pictures in the training set are down-sampled, and the obtained down-sampled images are used as the input of the CNN upsampling network, and the original pictures in the training set are used as the training target. Specifically, the CNN upsampling network can be trained by formula (7), and then the initial parameters of the upsampling network can be obtained.

在上述公式(7)中,xi表示训练集的原始图像,yi表示对原始图像进行下采样之后得到的低分辨率图像,n表示训练样本的数量,θg表示CNN上采样网络里的所有参数,g(yi;θg)表示上采样网络对输入yi做上采样操作,表示第步骤1训练结束后得到的CNN上采样网络初始参数。In the above formula (7), xi represents the original image of the training set, y i represents the low-resolution image obtained after downsampling the original image, n represents the number of training samples, and θ g represents the CNN upsampling network. All parameters, g(y i ; θ g ) means that the upsampling network performs an upsampling operation on the input y i , Indicates the initial parameters of the CNN upsampling network obtained after the training in step 1.

步骤2、基于步骤1训练得到的CNN上采样网络对CNN下采样网络进行训练,得到CNN下采样网络初始参数。Step 2: Train the CNN downsampling network based on the CNN upsampling network trained in step 1 to obtain initial parameters of the CNN downsampling network.

将训练集中的原始图像作为CNN下采样网络的输入,将CNN下采样网络的输出作为上述步骤1得到的CNN上采样网络的输入,得到CNN上采样网路输出的图像,计算CNN上采样网路输出的图像与原始图像之间的均方误差作为损失函数,使得损失函数最小,从而得到CNN下采样网络初始参数。The original image in the training set is used as the input of the CNN downsampling network, the output of the CNN downsampling network is used as the input of the CNN upsampling network obtained in the above step 1, and the image output by the CNN upsampling network is obtained, and the CNN upsampling network is calculated. The mean square error between the output image and the original image is used as the loss function to minimize the loss function, thereby obtaining the initial parameters of the CNN downsampling network.

具体地,可以具体通过公式(8)对CNN上采样网络进行训练,进而获取上采样网络初始参数。Specifically, the CNN upsampling network may be trained through formula (8), and then initial parameters of the upsampling network may be obtained.

在公式(8)中,θf表示CNN下采样网络里的所有参数,f(xi;θf)表示下采样网络对输入xi做下采样操作,表示步骤2训练结束后得到的CNN下采样网络初始参数。In formula (8), θ f represents all the parameters in the CNN downsampling network, f( xi ; θ f ) represents the downsampling network performs downsampling operation on the input xi , Indicates the initial parameters of the CNN downsampling network obtained after the training in step 2.

步骤3、对上采样网络和下采样网络进行联合训练,得到更新网络参数。Step 3. Jointly train the up-sampling network and the down-sampling network to obtain updated network parameters.

步骤1和步骤2训练得到的参数分别为上采样网络和下采样网络的初始参数。接下使用训练集中原分辨率图像作为输入和输,同时训练上、下采样网络的参数。Parameters trained in step 1 and step 2 are the initial parameters of the upsampling network and the downsampling network, respectively. Next, use the original resolution images in the training set as input and output, and train the parameters of the upsampling and downsampling networks at the same time.

具体地,可以根据公式(9)对CNN上采样网络和下采样网络同时进行训练。Specifically, CNN upsampling network and downsampling network can be trained simultaneously according to formula (9).

在公式(9)中,损失函数由两项构成,第一项计算的是CNN下采样网络输出的图像和一个FIR滤波器下采样输出的图像之间的误差,第二项计算的是CNN上采样网络输出的图像和原始分辨率的图像之间的误差。根据公式(9)对上采样网络和下采样网络进行训练,可以得到CNN下采样网络最优参数具有该最优参数的CNN下采样网络即为本实施例编码流程中所使用的CNN下采样滤波器。In formula (9), the loss function consists of two terms, the first term The calculation is the error between the image output by the CNN downsampling network and the image output by a FIR filter downsampling, the second item The calculation is the error between the image output by the CNN upsampling network and the original resolution image. According to formula (9), the up-sampling network and down-sampling network are trained, and the optimal parameters of the CNN down-sampling network can be obtained The CNN downsampling network with the optimal parameters is the CNN downsampling filter used in the encoding process of this embodiment.

步骤4、根据训练集中的图像微调上采样网络Step 4. Fine-tune the upsampling network based on the images in the training set

使用步骤3训练结束之后得到的最优下采样网络对训练集里的所有图像进行下采样,然后使用对这些低分辨率图像进行压缩编码得到低分辨率重建图像。将低分辨率压缩重建图像作为输入,将训练集中对应的原分辨率图像作为训练目标,按照步骤1的方法重新训练上采样网络得到CNN上采样网络最优参数具有该最优参数的CNN上采样网络即为本实施例编码与解码流程中所使用的CNN上采样滤波器。应理解,在步骤4中仍然是使用图像训练集对上采样网络进行训练。Use the optimal downsampling network obtained after the training in step 3 to downsample all the images in the training set, and then compress and encode these low-resolution images to obtain low-resolution reconstructed images. The low-resolution compressed and reconstructed image is used as input, and the corresponding original resolution image in the training set is used as the training target, and the upsampling network is retrained according to the method of step 1 to obtain the optimal parameters of the CNN upsampling network The CNN upsampling network with the optimal parameters is the CNN upsampling filter used in the encoding and decoding process of this embodiment. It should be understood that in step 4, the image training set is still used to train the upsampling network.

上述步骤1至步骤4中对CNN下采样滤波器和CNN上采样滤波器进行训练时,可以采用如图14所示的流程进行联合训练,在构建重建损失函数之外,再构建正则化损失函数通过预设图像训练集对CNN上采样滤波器和CNN上采样滤波器,使得重建损失函数和正则化损失函数最小,并将重建损失函数和正则化损失函数最小时对应的参数值作为CNN下采样滤波器和CNN上采样滤波器的参数值。When training the CNN downsampling filter and CNN upsampling filter in the above steps 1 to 4, the process shown in Figure 14 can be used for joint training. When constructing the reconstruction loss function In addition, construct a regularization loss function The CNN upsampling filter and the CNN upsampling filter are preset through the image training set, so that the reconstruction loss function and the regularization loss function are minimized, and the corresponding parameter values when the reconstruction loss function and the regularization loss function are minimized are used as CNN downsampling Parameter values for filters and CNN upsampling filters.

在实施例一中,在对每个图像块进行编码时,有原分辨率编码模式和低分辨率编码模式这两种编码模式可供选择。并且在原分辨率编码模式下对图像块进行编码时,上采样滤波器和下采样滤波器可以有两种选择,一种是上采样滤波器和下采样滤波器都采用CNN滤波器,另一种是上采样滤波器和下采样滤波器都采用FIR滤波器。在实施例一中,通过自适应的选择上采样滤波器和下采样滤波器,可以显著增强已有块级的变分辨率编码方案的压缩编码效率。另外,在实施例一种,CNN上采样滤波器和CNN下采样滤波器的参数值通过联合离线训练的方式获得,预置于编码器和解码器中,能够降低图像纹理在上、下采样过程中所带来的信息损失,提升编码图像质量。In the first embodiment, when encoding each image block, there are two encoding modes for selection: the original resolution encoding mode and the low resolution encoding mode. And when the image block is encoded in the original resolution encoding mode, there are two options for the up-sampling filter and the down-sampling filter, one is that the up-sampling filter and the down-sampling filter both use CNN filters, and the other Both the up-sampling filter and the down-sampling filter use FIR filters. In the first embodiment, by adaptively selecting the up-sampling filter and the down-sampling filter, the compression coding efficiency of the existing block-level variable resolution coding scheme can be significantly enhanced. In addition, in Embodiment 1, the parameter values of the CNN upsampling filter and the CNN downsampling filter are obtained through joint offline training, and are preset in the encoder and decoder, which can reduce the image texture in the upsampling and downsampling processes. The loss of information brought about in the process improves the quality of the encoded image.

实施例二:下采样滤波器为预先设置的FIR下采样滤波器。Embodiment 2: the downsampling filter is a preset FIR downsampling filter.

在实施例二中,下采样滤波器的滤波器参数是固定的,而上采样滤波器并不是固定的,可以根据图像块的图像内容从CNN滤波器和FIR滤波器中来确定上采样滤波器,并且将上采样滤波器参数写入到码流中,使得解码端能够得知上采样滤波器的参数。In the second embodiment, the filter parameters of the downsampling filter are fixed, but the upsampling filter is not fixed, and the upsampling filter can be determined from the CNN filter and the FIR filter according to the image content of the image block , and write the upsampling filter parameters into the code stream, so that the decoding end can know the parameters of the upsampling filter.

实施例二中的编码器的系统架构可以如图15所示。当编码器使用变分辨率编码模式编码一个图像块时,固定使用一个预先设置的FIR下采样滤波对原分辨率图像块做下采样操作,以获得低分辨率的图像块。编码器在对低分辨率图像块重建做上采样操作时,可以从预置的CNN上采样滤波器和预置的FIR上采样滤波器中灵活选择一个作为上采样滤波器。此外,编码器需要将变分辨率模式指示信息和上采样滤波器选择标志信息写入压缩码流,使得解码器能够在相应的解码模式下利用相应的上采样滤波器进行解码操作。The system architecture of the encoder in Embodiment 2 may be shown in FIG. 15 . When the encoder uses the variable resolution coding mode to encode an image block, a preset FIR downsampling filter is used to downsample the original resolution image block to obtain a low resolution image block. When the encoder performs an upsampling operation on low-resolution image block reconstruction, one of the preset CNN upsampling filters and the preset FIR upsampling filters can be flexibly selected as an upsampling filter. In addition, the encoder needs to write variable resolution mode indication information and upsampling filter selection flag information into the compressed code stream, so that the decoder can use the corresponding upsampling filter to perform decoding operations in the corresponding decoding mode.

应理解,在实施二中,编码器的编码过程与实施例一中的编码器的编码过程基本相同,在实施例二中,可以采用实施例一中确定上采样滤波器的方式从FIR上采样滤波器和CNN上采样滤波器中选择出上采样滤波器,所不同的是,在实施例二中由于下采样滤波器是固定的,因此,实施例二中不必再确定下采样滤波器。It should be understood that in Embodiment 2, the encoding process of the encoder is basically the same as that of the encoder in Embodiment 1. In Embodiment 2, the method of determining the upsampling filter in Embodiment 1 can be used to upsample from FIR The up-sampling filter is selected from the CNN up-sampling filter and the CNN up-sampling filter. The difference is that in the second embodiment, the down-sampling filter is fixed, so it is not necessary to determine the down-sampling filter in the second embodiment.

实施例二中的解码器的解码过程与实施例一中的解码器的解码过程相同,为了简洁,这里不再进行重复的描述。The decoding process of the decoder in the second embodiment is the same as the decoding process of the decoder in the first embodiment, and for the sake of brevity, no repeated description is given here.

在实施例二中,通过自适应选择CNN上采样滤波器或FIR上采样滤波器,可以显著增强已有块级的变分辨率编码方案的压缩编码效率。此外,固定使用FIR上采样滤波器,编码器无需在多个下采样滤波器之间做计算比较,从而可降低编码运算复杂度,加快编码速度。In the second embodiment, by adaptively selecting the CNN upsampling filter or the FIR upsampling filter, the compression coding efficiency of the existing block-level variable resolution coding scheme can be significantly enhanced. In addition, the FIR upsampling filter is fixed, and the encoder does not need to perform calculation and comparison between multiple downsampling filters, thereby reducing the complexity of encoding operations and speeding up encoding.

在实施例二中,CNN上采样滤波器可以预先训练得到,并且预置于编码器和解码器中。编码器与解码器在编解码过程中直接使用预置的CNN上采样滤波器。In the second embodiment, the CNN upsampling filter can be obtained through pre-training and pre-installed in the encoder and decoder. The encoder and decoder directly use the preset CNN upsampling filter in the process of encoding and decoding.

具体地,CNN上采样滤波器参数值可以是预设的参数值,并且该预设的参数值可以基于图像训练集进行离线训练得到。Specifically, the CNN upsampling filter parameter value may be a preset parameter value, and the preset parameter value may be obtained through offline training based on an image training set.

在实施例二中,对CNN上采样滤波器进行离线训练时可以先采用预置的FIR下采样滤波器对训练集里的原始图像xi进行下采样,然后将下采样得到的图像yi作为CNN上采样滤波器的输入,并将原始图像xi作为训练目标。In the second embodiment, when the CNN upsampling filter is trained offline, the preset FIR downsampling filter can be used to downsample the original image x i in the training set, and then the image y i obtained by downsampling can be used as The CNN upsamples the input of the filter and takes the original image xi as the training target.

接下来,就可以按照CNN网络的一般训练方法来训练CNN上采样网络,从而获得上采样滤波器的最优参数具体地,可以根据公式(10)对CNN上采样网络进行训练,进而获取上采样滤波器的最优参数 Next, the CNN upsampling network can be trained according to the general training method of the CNN network, so as to obtain the optimal parameters of the upsampling filter Specifically, the CNN upsampling network can be trained according to formula (10), and then the optimal parameters of the upsampling filter can be obtained

在公式(10)中,xi表示训练集中的原始图像,yi表示原始图像下采样之后得到的低分辨率图像,n表示训练样本数量,θg表示CNN上采样网络里的所有参数,g(yi;θg)表示上采样网络对输入yi做上采样操作。In formula (10), xi represents the original image in the training set, y i represents the low-resolution image obtained after downsampling the original image, n represents the number of training samples, θ g represents all parameters in the CNN upsampling network, g (y i ; θ g ) means that the upsampling network performs an upsampling operation on the input y i .

此外,在上述训练过程中,除了将下采样图像yi作为网络输入进行训练之外。还可以先对yi做编码操作获得下采样图像重建y′i,然后再将y′i作为网络输入进行训练。这样训练得到的上采样网络在恢复原分辨率图像细节的同时,还可在一定程度上消除编码操作所引入的图像瑕疵,进一步提升上采样操作输出原分辨率图像块重建的质量。In addition, in the above training process, in addition to using the downsampled image yi as the network input for training. It is also possible to encode y i first to obtain the downsampled image reconstruction y′ i , and then use y′ i as network input for training. The upsampling network trained in this way can not only restore the details of the original resolution image, but also eliminate the image defects introduced by the encoding operation to a certain extent, and further improve the reconstruction quality of the original resolution image block output by the upsampling operation.

实施例三:上采样滤波器为预先设置的FIR滤波器。Embodiment 3: The upsampling filter is a preset FIR filter.

在实施例三中,上采样滤波器的滤波器参数是固定的,而下采样滤波器并不是固定的,可以根据图像块的图像内容从CNN下采样滤波器和FIR下采样滤波器中来确定下采样滤波器,由于上采样滤波器参数是固定的,也就是上采样滤波器参数对于编码端和解码端来说都是已知的,因此,编码端不必再将上采样滤波器参数信息写入到码流,节省了码流。In the third embodiment, the filter parameters of the upsampling filter are fixed, but the downsampling filter is not fixed, and can be determined from the CNN downsampling filter and the FIR downsampling filter according to the image content of the image block For the downsampling filter, since the parameters of the upsampling filter are fixed, that is, the parameters of the upsampling filter are known to both the encoding end and the decoding end. Therefore, the encoding end does not need to write the parameter information of the upsampling filter Into the code stream, saving the code stream.

实施例三中的编码器的系统架构可以如图16所示。在实施例三中,当编码器对图像块进行编码时,可以固定使用一个预置的FIR上采样滤波器进行上采样,并可以从预置的CNN下采样滤波器和FIR下采样滤波器中灵活选择一个滤波器作为下采样滤波器。在实施例三中,由于解码器仅需进行上采样操作,因此,编码器可以灵活选用任一下采样滤波器而无需将该下采样滤波器的选择信息传递到解码器。The system architecture of the encoder in Embodiment 3 may be shown in FIG. 16 . In the third embodiment, when the encoder encodes the image block, it can fixedly use a preset FIR upsampling filter for upsampling, and can select from the preset CNN downsampling filter and FIR downsampling filter Flexible choice of a filter as downsampling filter. In the third embodiment, since the decoder only needs to perform an upsampling operation, the encoder can flexibly select any downsampling filter without transmitting the selection information of the downsampling filter to the decoder.

实施例三中编码器的编码过程具体包含以下过程。The encoding process of the encoder in Embodiment 3 specifically includes the following processes.

首先,确定待编码图像块分别在原分辨率编码模式和变分辨率编码模式下进行编码的编码代价。Firstly, the encoding cost of encoding the image block to be encoded in the original resolution encoding mode and the variable resolution encoding mode is determined respectively.

具体地,确定待编码图像块分别在不同编码模式下的编码代价可以包括步骤1、步骤2和步骤3。Specifically, determining the encoding costs of the image blocks to be encoded in different encoding modes may include Step 1, Step 2 and Step 3.

步骤1、确定待编码图像块在原分辨率编码模式下的编码代价。Step 1. Determine the encoding cost of the image block to be encoded in the original resolution encoding mode.

应理解,在步骤1中确定原分辨率编码的编码代价时,可以参照步骤702中的具体过程,并可以将当前图像块的率失真代价costorg确定为当前图像块在原分辨率编码模式的编码代价。It should be understood that when determining the encoding cost of the original resolution encoding in step 1, the specific process in step 702 can be referred to, and the rate-distortion cost cost org of the current image block can be determined as the encoding cost of the current image block in the original resolution encoding mode cost.

在确定低分率编码的编码代价时,需要分别确定CNN下采样滤波器作为下采样滤波器时的编码代价以及FIR下采样滤波器作为下采样滤波器时的编码代价,具体如下面的步骤2和步骤3所示。When determining the encoding cost of low-resolution encoding, it is necessary to determine the encoding cost when the CNN downsampling filter is used as the downsampling filter and the encoding cost when the FIR downsampling filter is used as the downsampling filter, as shown in step 2 below and step 3.

步骤2、计算使用FIR下采样滤波器进行下采样时待编码图像块的编码代价。Step 2. Calculating the coding cost of the image block to be coded when the FIR downsampling filter is used for downsampling.

计算使用FIR下采样滤波器进行下采样时待编码图像块的编码代价具体以下过程:The specific process of calculating the encoding cost of the image block to be encoded when using the FIR downsampling filter for downsampling is as follows:

(1)使用FIR下采样滤波器对当前图像块做下采样操作,获得低分辨率的图像块;(1) Use the FIR downsampling filter to perform a downsampling operation on the current image block to obtain a low-resolution image block;

(2)对低分辨率图像块做编码操作输出压缩码流;(2) performing an encoding operation on the low-resolution image block to output a compressed code stream;

(3)获取低分辨率重建图像块;(3) Obtaining low-resolution reconstruction image blocks;

(4)对低分辨率图像块重建做FIR上采样滤波操作获得原分辨率的重建图像块;(4) performing an FIR upsampling filter operation on the reconstruction of the low-resolution image block to obtain a reconstructed image block of the original resolution;

(5)计算重建图像块与当前图像块的均方误差DFIR,确定当前图像块的压缩码流的大小RFIR(5) Calculate the mean square error D FIR between the reconstructed image block and the current image block, and determine the size R FIR of the compressed code stream of the current image block;

(6)根据DFIR和RFIR计算率失真代价costdownFIR,并将该率失真代价costdownFIR确定为FIR滤波器作为目标上采样滤波器时当前图像块的编码代价。(6) Calculate the rate-distortion cost cost downFIR according to D FIR and R FIR , and determine the rate-distortion cost cost downFIR as the encoding cost of the current image block when the FIR filter is used as the target upsampling filter.

步骤3、计算使用CNN下采样滤波器进行下采样时待编码图像块的编码代价。Step 3. Calculate the encoding cost of the image block to be encoded when the CNN downsampling filter is used for downsampling.

计算使用CNN下采样滤波器时的变分辨率编码代价具体以下过程:The specific process of calculating the variable resolution encoding cost when using the CNN downsampling filter is as follows:

(1)使用CNN下采样滤波器对当前图像块做下采样操作,获得低分辨率的待编码图像块;(1) Use the CNN downsampling filter to perform a downsampling operation on the current image block to obtain a low-resolution image block to be encoded;

(2)对低分辨率图像块做编码操作输出压缩码流以及低分辨率重建图像块;(2) performing an encoding operation on the low-resolution image block to output a compressed code stream and a low-resolution reconstructed image block;

(3)对低分辨率图像块重建做CNN上采样滤波操作获得原分辨率的重建图像块;(3) Perform a CNN upsampling filter operation on the reconstruction of the low-resolution image block to obtain the reconstructed image block of the original resolution;

(4)计算重建图像块与当前图像块的均方误差DCNN,确定当前图像块的压缩码流的大小RCNN(4) Calculate the mean square error D CNN between the reconstructed image block and the current image block, and determine the size R CNN of the compressed code stream of the current image block;

(5)根据DCNN和RCNN计算率失真代价costdownCNN,并将该率失真代价costdownCNN确定为CNN滤波器作为目标上采样滤波器时当前图像块的编码代价。(5) Calculate the rate-distortion cost cost downCNN according to DCNN and R-CNN , and determine the rate-distortion cost cost downCNN as the encoding cost of the current image block when the CNN filter is used as the target upsampling filter.

其次,选择编码代价低的模式作为优选模式来对当前图像块做编操作。Secondly, select the mode with low encoding cost as the preferred mode to perform encoding operation on the current image block.

具体地,在步骤902中,可以根据步骤901中计算出来的编码代价的大小来选择编码模式,并生成编码信息。该编码信息可以具体包括变分辨率编码模式指示标志Flag1。Specifically, in step 902, a coding mode may be selected according to the magnitude of the coding cost calculated in step 901, and coding information may be generated. The encoding information may specifically include a variable resolution encoding mode indication flag Flag1.

上述根据编码代价来设置Flag1具体包含以下三种情况。The above-mentioned setting of Flag1 according to the encoding cost specifically includes the following three situations.

(1)当costorg<costdownFIR且costorg<costdownCNN时,确定在原分辨率模式下对当前图像块进行编码,此时将Flag1设置为0;(1) When cost org <cost downFIR and cost org <cost downCNN , it is determined to encode the current image block in the original resolution mode, and Flag1 is set to 0 at this time;

(2)当costdownFIR<costorg且costdownFIR<costdownCNN时,确定在变分辨率模式对当前图像块进行编码,并采用FIR下采样滤波器做下采样操作,此时将Flag1设置为1;(2) When cost downFIR <cost org and cost downFIR <cost downCNN , it is determined that the current image block is encoded in variable resolution mode, and the FIR downsampling filter is used for downsampling operation, and Flag1 is set to 1 at this time;

(3)当costdownCNN<costorg且costdownCNN<costdownFIR时,确定在变分辨率模式对当前图像块进行编码,并采用CNN下采样滤波器做下采样操作,此时将Flag1设置为1。(3) When cost downCNN <cost org and cost downCNN <cost downFIR , it is determined to encode the current image block in the variable resolution mode, and the CNN downsampling filter is used for downsampling operation, and Flag1 is set to 1 at this time.

最后,确定当前图像块的编码信息,并将该编码信息写入码流。Finally, the encoding information of the current image block is determined, and the encoding information is written into the code stream.

在步骤903中,编码信息除了包含步骤902中确定的变分辨率编码模式标志Flag1之外,还可以包含对当前图像块进行编码时的预测模式以及量化后的编码系数等等。In step 903, besides the variable resolution encoding mode flag Flag1 determined in step 902, the encoding information may also include the prediction mode when encoding the current image block, the quantized encoding coefficient, and so on.

实施例三中的解码端的解码过程如图17所示,图17所示的解码过程与图上述步骤901至903所示的编码过程是相对应的,图17具体包含以下步骤。The decoding process of the decoding end in Embodiment 3 is shown in FIG. 17 . The decoding process shown in FIG. 17 corresponds to the encoding process shown in steps 901 to 903 above. FIG. 17 specifically includes the following steps.

1001、获取压缩码流。1001. Acquire a compressed code stream.

1002、解析当前图像块的变分辨率编码模式指示标志Flag1。1002. Analyze the variable resolution coding mode indicator Flag1 of the current image block.

当前图像块可以是当前待解码的图像块,步骤1001中获取的压缩码流可以是当前图像块的码流,在获取了当前图像块的码流之后,可以从当前图像块的码流中解析变分辨率编码模式指示标志Flag1,并获取Flag1的取值。The current image block may be the image block currently to be decoded, the compressed code stream obtained in step 1001 may be the code stream of the current image block, and after obtaining the code stream of the current image block, it may be parsed from the code stream of the current image block The variable resolution encoding mode indicates Flag1, and obtains the value of Flag1.

1003、根据Flag1确定是否采用变分辨率解码模式。1003. Determine whether to adopt a variable resolution decoding mode according to Flag1.

Flag1的取值可以用于指示生成当前图像块的码流时采用的是变分辨率编码模式还是原分辨率编码模式。因此,可以根据Flag1的取值来确定是否在变分辨率解码模式下对当前图像块进行解码。The value of Flag1 can be used to indicate whether the variable resolution coding mode or the original resolution coding mode is adopted when generating the code stream of the current image block. Therefore, whether to decode the current image block in the variable resolution decoding mode can be determined according to the value of Flag1.

例如,Flag1的取值为0时表示生成当前图像块的码流时采用的是原分辨率编码模式;Flag1的取值为1时表示生成当前图像块的码流时采用的是变分辨率编码模式。For example, when the value of Flag1 is 0, it means that the original resolution coding mode is used when generating the code stream of the current image block; when the value of Flag1 is 1, it means that the variable resolution coding is used when generating the code stream of the current image block model.

因此,当Flag1的取值为0时可以确定采用原分辨率编码模式对当前图像块进行解码;当Flag1的取值为1时可以确定采用变分辨率编码模式对当前图像块进行解码。Therefore, when the value of Flag1 is 0, it can be determined that the current image block is decoded in the original resolution coding mode; when the value of Flag1 is 1, it can be determined that the current image block is decoded in the variable resolution coding mode.

1004、解析低分辨率编码块的编码信息,获取低分辨率的重建图像块。1004. Analyze the coding information of the low-resolution coding block, and obtain a low-resolution reconstruction image block.

由于编码端可以选用不同的编码方案对图像块进行编码,因此,在解析解码信息获取重建图像块是也要选择与编码方案相对应的解码方案进行解码。Since the encoding end can select different encoding schemes to encode image blocks, it is also necessary to select a decoding scheme corresponding to the encoding scheme for decoding when analyzing and decoding information to obtain reconstructed image blocks.

例如,如果选用类似JPEG的方式编码一个图像块,那么在解码时仅需要从码流中解析图像块的量化后变换系数信息,并对系数做反量化和反变换操作即可得到原分辨率图像块重建。For example, if you choose a method similar to JPEG to encode an image block, you only need to parse the quantized transformation coefficient information of the image block from the code stream during decoding, and perform inverse quantization and inverse transformation operations on the coefficients to obtain the original resolution image block rebuild.

另外,如果选用类似H.264或H.265帧内编码的方式编码一个图像块,那么在解码时需要从码流中解码当前块的编码模式、预测模式、量化后变换系数等编码信息。并且在对量化后变换系数进行反量化反变换得到重建残差信号之后,还需根据预测模式做预测操作获得预测信号,最终将两者相加得到原分辨率图像块重建。In addition, if an image block is encoded in a manner similar to H.264 or H.265 intra-frame encoding, then encoding information such as the encoding mode, prediction mode, and quantized transform coefficient of the current block needs to be decoded from the code stream during decoding. And after inverse quantization and inverse transformation of the quantized transform coefficients to obtain the reconstructed residual signal, it is necessary to perform a prediction operation according to the prediction mode to obtain the prediction signal, and finally add the two to obtain the reconstruction of the original resolution image block.

具体地,作为一种可选的实现方式,获取低分辨率的重建块主要包括以下过程:Specifically, as an optional implementation, obtaining low-resolution reconstruction blocks mainly includes the following processes:

首先,对当前图像块的压缩码流进行熵解码,得到量化系数;First, entropy decoding is performed on the compressed code stream of the current image block to obtain quantized coefficients;

其次,对量化系数进行反量化和变换,得到当前图像块的重建残差信号;Secondly, dequantize and transform the quantization coefficients to obtain the reconstruction residual signal of the current image block;

再次,获取当前图像块的预测信号(或者称为预测图像块);Again, obtain the prediction signal of the current image block (or called the prediction image block);

最后,根据当前图像块的残差信号和预测信号,得到当前图像块的低分辨率的重建图像块。Finally, according to the residual signal and the prediction signal of the current image block, a low-resolution reconstructed image block of the current image block is obtained.

1005、使用FIR上采样滤波器对低分辨率的重建块进行上采样,得到原分辨率的重建图像块。1005. Use an FIR upsampling filter to upsample the low-resolution reconstruction block to obtain a reconstruction image block with the original resolution.

在步骤1005中,原始分辨率是指在编码端与该重建图像块对应的待编码图像块的分辨率,通过进行上采样能够得到与原始待编码图像分辨率相同的重建图像块。In step 1005, the original resolution refers to the resolution of the image block to be encoded corresponding to the reconstructed image block at the encoding end, and the reconstructed image block with the same resolution as the original image to be encoded can be obtained by performing upsampling.

1006、解析原分辨率编码块的编码信息,获取原分辨率的重建图像块。1006. Analyze the coding information of the coding block with the original resolution, and obtain the reconstructed image block with the original resolution.

步骤1006中获取原分辨率的重建图像块的过程与步骤1005中获取低分辨率的重建图像块的具体过程相同,只是步骤1005的输入信号是低分辨率编码模式下获取的码流,而步骤1006中的输入信号是原分辨率编码模式下获取的码流。The process of obtaining the original resolution reconstructed image block in step 1006 is the same as the specific process of obtaining the low-resolution reconstructed image block in step 1005, except that the input signal in step 1005 is the code stream obtained in the low-resolution encoding mode, and the step The input signal in 1006 is the code stream acquired in the original resolution encoding mode.

1007、确定当前图像块是否为最后一个图像块。1007. Determine whether the current image block is the last image block.

具体可以根据码流中携带的其它编码信息来确定当前图像块是否为最后一个待解码的图像块。Specifically, it may be determined whether the current image block is the last image block to be decoded according to other encoding information carried in the code stream.

在当前图像块不是最后一个待解码的图像块的情况下,继续执行步骤1002,以继续对下一个图像块进行解码;在当前图像块是最后一个待解码的图像块的情况下,执行步骤1008,当前图像的解码过程结束。In the case that the current image block is not the last image block to be decoded, continue to execute step 1002 to continue decoding the next image block; in the case that the current image block is the last image block to be decoded, execute step 1008 , the decoding process of the current image ends.

1008、当前图像解码结束。1008. The decoding of the current image ends.

在实施例三中,CNN下采样滤波器可以预先训练得到,并且预置于编码器中。编码器在编码过程中直接使用预置的CNN下采样滤波器。In the third embodiment, the CNN downsampling filter can be obtained through pre-training and pre-installed in the encoder. The encoder directly uses the preset CNN downsampling filters during encoding.

具体地,CNN下采样滤波器参数值可以是预设的参数值,并且该预设的参数值可以基于图像训练集进行离线训练得到。Specifically, the CNN downsampling filter parameter value may be a preset parameter value, and the preset parameter value may be obtained through offline training based on an image training set.

在实施例三中,对CNN下采样滤波器进行离线训练包括以下具体步骤:In the third embodiment, the offline training of the CNN downsampling filter includes the following specific steps:

CNN下采样滤波器的离线训练可以包括初始参数训练和参数微调两个步骤。Offline training of CNN downsampling filters can include two steps of initial parameter training and parameter fine-tuning.

步骤1、对CNN下采样滤波器进行训练,得到CNN下采样网络初始参数。Step 1. Train the CNN downsampling filter to obtain the initial parameters of the CNN downsampling network.

把训练集中的原始图像作为CNN下采样滤波器的输入,把CNN下采样滤波器的输出作为FIR上采样滤波器的输入,计算FIR上采样滤波器输出的图像与原始图像之间的均方误差作为损失函数,将损失函数最小的滤波器参数作为CNN下采样网络初始参数。具体地,可以根据公式(11)进行离线训练,得到CNN下采样网络初始参数。The original image in the training set is used as the input of the CNN downsampling filter, the output of the CNN downsampling filter is used as the input of the FIR upsampling filter, and the mean square error between the image output by the FIR upsampling filter and the original image is calculated As a loss function, the filter parameter with the smallest loss function is used as the initial parameter of the CNN downsampling network. Specifically, offline training can be performed according to formula (11) to obtain the initial parameters of the CNN downsampling network.

在公式(11)中,表示CNN下采样网络里的所有参数,f(xi;θf)表示下采样网络对输入xi做下采样操作,gFIR表示使用FIR滤波器进行上采样操作,表示CNN下采样网络初始参数。In formula (11), Indicates all parameters in the CNN downsampling network, f( xi ; θ f ) indicates that the downsampling network performs a downsampling operation on the input xi , g FIR indicates that the FIR filter is used for upsampling operation, Indicates the initial parameters of the CNN downsampling network.

步骤2、对CNN下采样网络初始参数进行微调。Step 2. Fine-tune the initial parameters of the CNN downsampling network.

使用训练集中原分辨率图像作为输入input和,训练上、下采样网络的参数。具体地,可以根据公式(12)对CNN上采样网络和下采样网络同时进行训练。Use the original resolution image in the training set as the input input and train the parameters of the upsampling and downsampling networks. Specifically, CNN upsampling network and downsampling network can be trained simultaneously according to formula (12).

在公式(12)中,损失函数由两项构成,第一项计算的是CNN上采样网络输出的图像原始图像之间的误差,第二项计算的是CNN下采样网络输出的图像和双三次下采样输出图像之间的误差。根据公式(12)对上采样网络和下采样网络进行训练,可以得到CNN下采样网络最优参数具有该最优参数的CNN下采样网络即为本实施例编码流程中所使用的CNN下采样滤波器。In formula (12), the loss function consists of two terms, the first term The calculation is the error between the original image of the image output by the CNN upsampling network, the second item The calculation is the error between the image output by the CNN downsampling network and the bicubic downsampling output image. According to the formula (12), the up-sampling network and down-sampling network are trained, and the optimal parameters of the CNN down-sampling network can be obtained The CNN downsampling network with the optimal parameters is the CNN downsampling filter used in the encoding process of this embodiment.

应理解,如果考虑节约编码器计算量,可以跳过后面步骤2,直接使用步骤1得到的设置CNN下采样滤波器。It should be understood that if you consider saving the computation of the encoder, you can skip step 2 and directly use the result obtained in step 1 Set the CNN downsampling filter.

在上述实施例一至实施例三中,是通过离线训练的方式来获取CNN上采样滤波器和CNN下采样滤波器的参数,为了取得更好的编码效果,还可以通过在线训练的方式来获取CNN上采样滤波器和CNN下采样滤波器的参数。In the first to third embodiments above, the parameters of CNN upsampling filter and CNN downsampling filter are obtained through offline training. In order to obtain better encoding effect, CNN can also be obtained through online training. Parameters for upsampling filter and CNN downsampling filter.

下面结合实施例四至实施例六对在线训练获得CNN滤波器的参数的过程进行详细的说明。应理解,可以采用实施例四至实施例六中在线训练方法对CNN上采样滤波器、CNN下采样滤波器的参数进行更新,也就是说,实施例四至实施例六中的在线训练方法可以应用到上述实施例一至实施例六中,用于对CNN上采样滤波器或者CNN下采样滤波器的参数进行更新。The process of obtaining the parameters of the CNN filter through online training will be described in detail below in conjunction with Embodiment 4 to Embodiment 6. It should be understood that the online training method in Embodiment 4 to Embodiment 6 can be used to update the parameters of the CNN upsampling filter and the CNN downsampling filter, that is to say, the online training method in Embodiment 4 to Embodiment 6 can be applied to In the first to sixth embodiments above, it is used to update the parameters of the CNN upsampling filter or the CNN downsampling filter.

实施例四:对CNN下采样滤波器进行在线训练。Embodiment 4: Online training is performed on the CNN downsampling filter.

在实施例四中,编码器可以根据待编码的图像块在线训练CNN下采样滤波器参数,并使用训练得到的CNN下采样滤波器对待编码图像块做下采样操作。显然,当编码器技术方案中采用CNN下采样滤波器对待编码图像块做下采样操作时,均可采用本实施例中方案更新其CNN下采样滤波器参数。In Embodiment 4, the encoder can train CNN downsampling filter parameters online according to the image block to be encoded, and use the trained CNN downsampling filter to perform downsampling operation on the image block to be encoded. Apparently, when the CNN downsampling filter is used in the technical solution of the encoder to perform the downsampling operation on the image block to be coded, the solution in this embodiment can be used to update the parameters of the CNN downsampling filter.

在实施例四中,可以采用图5所示的在线训练流程来更新CNN下采样网络参数。如图5所示,IO为当前待编码图像,IL表示使用CNN下采样滤波器对输入图像IO进行下采样之后得到的低分辨率待编码图像,编码端仿真器是模拟图像编码过程的一个CNN网络,可以模拟图像编码过程并输出低分辨率重建图像I′L和编码比特开销。其中,CNN上采样网络通过离线训练获得,同时预置于编码器和解码器中用于对低分辨率图像块重建做上采样操作。CNN下采样网络结构可以如上文的图11,CNN上采样网络结构可以如上文的图13。In Embodiment 4, the online training process shown in FIG. 5 can be used to update the CNN downsampling network parameters. As shown in Figure 5, I O is the current image to be encoded, I L represents the low-resolution image to be encoded after downsampling the input image I O using the CNN downsampling filter, and the encoder emulator simulates the image encoding process A CNN network of , which can simulate the image encoding process and output low-resolution reconstructed image I′ L and encoding bit overhead. Among them, the CNN upsampling network is obtained through offline training, and is preset in the encoder and decoder for upsampling operations on low-resolution image block reconstruction. The CNN downsampling network structure can be as shown in Figure 11 above, and the CNN upsampling network structure can be as shown in Figure 13 above.

根据公式(13)对CNN下采样网络进行训练,可以得到CNN下采样网络的最优参数 According to the formula (13) to train the CNN downsampling network, the optimal parameters of the CNN downsampling network can be obtained

在公式(13)中,f表示下采样操作映射函数,θf表示下采样网络参数,h表示编码仿真器映射函数输出编码重建图像,g表示上采样网络的映射函数,表示预置的上采样滤波器参数,r表示编码仿真器输出的编码比特开销,λ是加权系数。In Equation (13), f represents the downsampling operation mapping function, θ f represents the downsampling network parameters, h represents the encoding emulator mapping function output encoding reconstructed image, g represents the mapping function of the upsampling network, Represents the preset upsampling filter parameters, r represents the encoding bit overhead output by the encoding simulator, and λ is the weighting coefficient.

在实施例四中,通过在线训练CNN下采样滤波器参数可以在最大程度上减少下采样带来的信息损失,提升重建图像质量。另外,由于CNN下采样滤波器仅在编码器使用,所以无需将其传递到解码器而不会带来编码开销的增加,使得该方案的总体率失真性较小。In Embodiment 4, the information loss caused by downsampling can be reduced to the greatest extent by online training of CNN downsampling filter parameters, and the quality of the reconstructed image can be improved. In addition, since the CNN downsampling filter is only used in the encoder, there is no need to pass it to the decoder without increasing the encoding overhead, making the overall rate-distortion of the scheme less.

实施例五:对CNN上采样滤波器进行在线训练。Embodiment 5: Online training is performed on the CNN upsampling filter.

在实施例五中,编码器可以根据待编码的图像块在线训练CNN上采样滤波器参数,并使用训练得到的CNN上采样滤波器对低分辨率图像块重建做上采样操作。应理解,在本申请中,当编码器采用CNN上采样滤波器对低分辨率重建图像块做上采样操作时,均可采用实施例五中的方案更新其CNN上采样滤波器参数。并且,由于解码端需要使用相同的CNN上采样滤波器对低分辨率图像块重建做上采样操作,因此,编码端需要将更新的CNN上采样滤波器的参数写入到码流中,使得解码端也能够获取CNN上采样滤波器的参数。In Embodiment 5, the encoder can train CNN upsampling filter parameters online according to the image block to be encoded, and use the trained CNN upsampling filter to perform an upsampling operation on low-resolution image block reconstruction. It should be understood that, in this application, when the encoder uses a CNN upsampling filter to perform an upsampling operation on a low-resolution reconstructed image block, the solution in Embodiment 5 may be used to update its CNN upsampling filter parameters. Moreover, since the decoding end needs to use the same CNN upsampling filter to perform upsampling operations on low-resolution image block reconstruction, the encoding end needs to write the parameters of the updated CNN upsampling filter into the code stream, so that the decoding The terminal can also obtain the parameters of the CNN upsampling filter.

在实施例五中,可以采用图5所示的在线训练流程来更新CNN上采样滤波器参数。如图5所示,IO为当前待编码图像,IL表示使用CNN下采样滤波器对输入图像IO进行下采样之后得到的低分辨率待编码图像,编码端仿真器是模拟图像编码过程的一个CNN网络,可以模拟图像编码过程并输出低分辨率重建图像I′L和编码比特开销。CNN下采样网络结构可以如上文的图11,CNN上采样网络结构可以如上文的图13。其中,CNN下采样网络通过离线训练获得,并且预置于编码器中,用于对待编码的原始图像块进行下采样操作。In Embodiment 5, the online training process shown in FIG. 5 can be used to update the CNN upsampling filter parameters. As shown in Figure 5, I O is the current image to be encoded, I L represents the low-resolution image to be encoded after downsampling the input image I O using the CNN downsampling filter, and the encoder emulator simulates the image encoding process A CNN network of , which can simulate the image encoding process and output low-resolution reconstructed image I′ L and encoding bit overhead. The CNN downsampling network structure can be as shown in Figure 11 above, and the CNN upsampling network structure can be as shown in Figure 13 above. Among them, the CNN downsampling network is obtained through offline training, and is preset in the encoder for downsampling the original image block to be encoded.

通过公式(14)对CNN上采样网络进行训练,可以得到CNN上采样网络的最优参数 The CNN upsampling network is trained by formula (14), and the optimal parameters of the CNN upsampling network can be obtained

在公式(14)中,g表示上采样操作映射函数,θg表示上采样滤波器参数,g表示上采样滤波器的映射函数。In formula (14), g represents the upsampling operation mapping function, θ g represents the upsampling filter parameter, and g represents the mapping function of the upsampling filter.

实施例五中,通过在线训练CNN上采样滤波器参数可以根据图像纹理特征使用匹配的参数做上采样操作,相比于预置CNN上采样滤波器参数可以进一步提升上采样输出的图像块质量。另外,编码端也可以综合考虑更新上采样滤波器参数带来的图像质量提升与参数传递代价,例如通过RDO的方式来提升该实施例编码方案的总体率失真性能。In Embodiment 5, through online training of CNN upsampling filter parameters, matching parameters can be used for upsampling operations according to image texture features, and compared with preset CNN upsampling filter parameters, the quality of upsampled output image blocks can be further improved. In addition, the encoder can also comprehensively consider the image quality improvement and parameter transfer cost brought about by updating the upsampling filter parameters, for example, by using RDO to improve the overall rate-distortion performance of the encoding scheme of this embodiment.

应理解,上述实施例五中在线训练CNN上采样滤波器参数的方法还可以应用到上述实施例一中,当实施例五中的方案应用到实施例一时,CNN上采样滤波器除了使用预置的滤波参数外,还可以通过在线训练的方式得到滤波器参数。具体地,可以设置仅使用在线训练得到的CNN上采样滤波器。也可以设置为一个编码图像或一个编码块从预置滤波器和在线训练滤波器两者间择一使用。It should be understood that the method for online training CNN upsampling filter parameters in the fifth embodiment above can also be applied to the first embodiment above. When the solution in the fifth embodiment is applied to the first embodiment, the CNN upsampling filter uses the preset In addition to the filter parameters, the filter parameters can also be obtained through online training. Specifically, it can be set to only use CNN upsampling filters obtained from online training. It can also be set as a coded image or a coded block to choose between the preset filter and the online training filter.

由于解码端需要使用相同的CNN上采样滤波器对低分辨率图像块重建做上采样操作,编码端需要将训练得到的CNN上采样滤波器参数传递到解码器。具体地,编码端可以将滤波器参数写入视频压缩码流中的SPS和PPS等参数集中,或者写入条带头(slice header)中。该滤波器参数的数量由CNN上采样滤波器结构决定,包括CNN上采样滤波器里所有卷积层的权重(weights)和偏置(bias)。为节约参数传递开销,可以从已有的各种无损数据压缩方法中选择一个对这组参数做压缩编码,例如,差分脉冲编码调制(Differential PulseCode Modulation,DPCM)编码、哈夫曼编码(Huffman Coding)、算数编码等。Since the decoding end needs to use the same CNN upsampling filter to perform upsampling operations on low-resolution image block reconstruction, the encoding end needs to pass the trained CNN upsampling filter parameters to the decoder. Specifically, the encoder can write the filter parameters into parameter sets such as SPS and PPS in the video compression code stream, or write them into a slice header. The number of filter parameters is determined by the CNN upsampling filter structure, including the weights and biases of all convolutional layers in the CNN upsampling filter. In order to save the cost of parameter transmission, one of the existing lossless data compression methods can be selected to compress and encode this group of parameters, for example, Differential Pulse Code Modulation (DPCM) encoding, Huffman Coding (Huffman Coding) ), arithmetic coding, etc.

当实施例五应用到实施例一时,解码器的解码过程与实施例一的解码过程基本一致,所不同的是,解码器还需要解析码流获取CNN上采样滤波器参数。具体的解码过程参见图18,如图18所示,解码器的解码过程具体包括:When Embodiment 5 is applied to Embodiment 1, the decoding process of the decoder is basically the same as that of Embodiment 1. The difference is that the decoder also needs to parse the code stream to obtain CNN upsampling filter parameters. Refer to Figure 18 for the specific decoding process. As shown in Figure 18, the decoding process of the decoder specifically includes:

1101、获取压缩码流。1101. Acquire a compressed code stream.

1102、解析获取CNN上采样滤波器参数。1102. Analyze and acquire CNN upsampling filter parameters.

该CNN上采样滤波器参数可以是编码器根据对CNN上采样滤波器进行在线训练得到的。The CNN upsampling filter parameters may be obtained by the encoder based on online training of the CNN upsampling filter.

1103、解析当前图像块的变分辨率编码模式指示标志Flag1。1103. Analyze the variable resolution coding mode indicator Flag1 of the current image block.

当前图像块可以是当前待解码的图像块,步骤1101中获取的压缩码流可以是当前图像块的码流,在获取了当前图像块的码流之后,可以从当前图像块的码流中解析变分辨率编码模式指示标志Flag1,并获取Flag1的取值。The current image block may be the image block currently to be decoded, the compressed code stream obtained in step 1101 may be the code stream of the current image block, and after the code stream of the current image block is acquired, it may be parsed from the code stream of the current image block The variable resolution encoding mode indicates Flag1, and obtains the value of Flag1.

1104、根据Flag1确定是否采用变分辨率解码模式。1104. Determine whether to adopt a variable resolution decoding mode according to Flag1.

Flag1的取值可以用于指示生成当前图像块的码流时采用的是变分辨率编码模式还是原分辨率编码模式。因此,可以根据Flag1的取值来确定是否在变分辨率解码模式下对当前图像块进行解码。The value of Flag1 can be used to indicate whether the variable resolution coding mode or the original resolution coding mode is adopted when generating the code stream of the current image block. Therefore, whether to decode the current image block in the variable resolution decoding mode can be determined according to the value of Flag1.

例如,Flag1的取值为0时表示生成当前图像块的码流时采用的是原分辨率编码模式;Flag1的取值为1时表示生成当前图像块的码流时采用的是变分辨率编码模式。For example, when the value of Flag1 is 0, it means that the original resolution coding mode is used when generating the code stream of the current image block; when the value of Flag1 is 1, it means that the variable resolution coding is used when generating the code stream of the current image block model.

因此,当Flag1的取值为0时可以确定采用原分辨率编码模式对当前图像块进行解码;当Flag1的取值为1时可以确定采用变分辨率编码模式对当前图像块进行解码。Therefore, when the value of Flag1 is 0, it can be determined that the current image block is decoded in the original resolution coding mode; when the value of Flag1 is 1, it can be determined that the current image block is decoded in the variable resolution coding mode.

1105、解析当前图像块的上采样滤波器选择标志Flag2。1105. Analyze the upsampling filter selection flag Flag2 of the current image block.

Flag2的取值可以用于指示在编码过程中是采用FIR上采样滤波器还是CNN上采样滤波器作为上采样滤波器进行上采样。The value of Flag2 can be used to indicate whether to use the FIR upsampling filter or the CNN upsampling filter as the upsampling filter for upsampling during the encoding process.

1106、解析低分辨率编码块的编码信息,获取低分辨率的重建图像块。1106. Analyze the coding information of the low-resolution coding block, and obtain a low-resolution reconstruction image block.

由于编码端可以选用不同的编码方案对图像块进行编码,因此,在解析解码信息获取重建图像块是也要选择与编码方案相对应的解码方案进行解码。Since the encoding end can select different encoding schemes to encode image blocks, it is also necessary to select a decoding scheme corresponding to the encoding scheme for decoding when analyzing and decoding information to obtain reconstructed image blocks.

1107、解析原分辨率编码块的编码信息,获取原分辨率的重建图像块。1107. Analyze the coding information of the coding block with the original resolution, and obtain the reconstructed image block with the original resolution.

1108、根据Flag2确定是否采用CNN上采样滤波器。1108. Determine whether to use a CNN upsampling filter according to Flag2.

具体地,可以根据Flag2的取值来具体确定采用CNN上采样滤波器还是FIR上采样滤波器进行上采样。Specifically, it may be specifically determined to use the CNN upsampling filter or the FIR upsampling filter for upsampling according to the value of Flag2.

例如,Flag2的取值为0时表示采用CNN上采样滤波器进行上采样,Flag2的取值为1时表示采用FIR上采样滤波器进行上采样。因此,当Flag2的取值为1时确定采用CNN上采样滤波器,当Flag2的取值为0时确定不采用CNN上采样滤波器(采用FIR上采样滤波器)。For example, when the value of Flag2 is 0, it means that the CNN upsampling filter is used for upsampling, and when the value of Flag2 is 1, it means that the FIR upsampling filter is used for upsampling. Therefore, when the value of Flag2 is 1, it is determined to use the CNN upsampling filter, and when the value of Flag2 is 0, it is determined not to use the CNN upsampling filter (the FIR upsampling filter is used).

1109、使用CNN上采样滤波器对低分辨率的重建块进行上采样,得到原分辨率的重建图像块。1109. Use the CNN upsampling filter to upsample the low-resolution reconstruction block to obtain the original resolution reconstruction image block.

1110、使用FIR上采样滤波器对低分辨率的重建块进行上采样,得到原分辨率的重建图像块。1110. Use an FIR upsampling filter to upsample the low-resolution reconstruction block to obtain a reconstruction image block with the original resolution.

在步骤1108和步骤1109中,原始分辨率是指在编码端与该重建图像块对应的待编码图像块的分辨率,通过进行上采样能够得到与原始待编码图像分辨率相同的重建图像块。In steps 1108 and 1109, the original resolution refers to the resolution of the image block to be encoded corresponding to the reconstructed image block at the encoding end, and the reconstructed image block with the same resolution as the original image to be encoded can be obtained through upsampling.

1111、确定当前图像块是否为最后一个图像块。1111. Determine whether the current image block is the last image block.

具体可以根据码流中携带的其它编码信息来确定当前图像块是否为最后一个待解码的图像块。Specifically, it may be determined whether the current image block is the last image block to be decoded according to other encoding information carried in the code stream.

在当前图像块不是最后一个待解码的图像块的情况下,继续执行步骤1103,以继续对下一个图像块进行解码;在当前图像块是最后一个待解码的图像块的情况下,执行步骤1112,当前图像的解码过程结束。When the current image block is not the last image block to be decoded, continue to execute step 1103 to continue decoding the next image block; when the current image block is the last image block to be decoded, execute step 1112 , the decoding process of the current image ends.

1112、当前图像解码结束。1112. The decoding of the current image ends.

实施例六:对CNN下采样滤波器和CNN上采样滤波器进行联合在线训练。Embodiment 6: Carry out joint online training on the CNN downsampling filter and the CNN upsampling filter.

具体地,可以采用图5中的CNN网络在线训练流程来同时更新CNN上、下采样网络参数。如图5所示,IO为当前待编码图像,IL表示使用CNN下采样滤波器对输入图像IO进行下采样之后得到的低分辨率待编码图像,编码端仿真器是模拟图像编码过程的一个CNN网络,可以模拟图像编码过程并输出低分辨率重建图像I′L和编码比特开销。CNN下采样网络结构可以如上文的图11所示,CNN上采样网络结构可以如上文的图13所示。Specifically, the CNN network online training process in FIG. 5 can be used to simultaneously update CNN upsampling and downsampling network parameters. As shown in Figure 5, I O is the current image to be encoded, I L represents the low-resolution image to be encoded after downsampling the input image I O using the CNN downsampling filter, and the encoder emulator simulates the image encoding process A CNN network of , which can simulate the image encoding process and output low-resolution reconstructed image I′ L and encoding bit overhead. The CNN downsampling network structure may be as shown in FIG. 11 above, and the CNN upsampling network structure may be as shown in FIG. 13 above.

在线情况下对CNN下采样滤波器和CNN上采样滤波器进行联合训练,具体可以根据公式(15)对CNN上采样网络和CNN下采样网络进行训练,以得到CNN上采样网络的最优参数和CNN下采样网络的最优参数 The CNN downsampling filter and the CNN upsampling filter are jointly trained online. Specifically, the CNN upsampling network and the CNN downsampling network can be trained according to formula (15) to obtain the optimal parameters of the CNN upsampling network and the optimal parameters of the CNN downsampling network

在公式(15)中,f表示下采样操作映射函数,g表示上采样网络的映射函数,h表示编码仿真器映射函数输出编码重建图像,θf表示下采样网络参数,θg表示上采样滤波器参数,r表示编码仿真器输出的编码比特开销,λ是加权系数。In formula (15), f represents the downsampling operation mapping function, g represents the mapping function of the upsampling network, h represents the encoding emulator mapping function output code reconstruction image, θ f represents the downsampling network parameters, θ g represents the upsampling filter parameter, r represents the encoding bit overhead output by the encoding simulator, and λ is the weighting coefficient.

在实施例六中,CNN上采样滤波器和CNN下采样滤波器的参数是在线的情况下进行联合训练得到的,与单独训练滤波器参数的方式相比,能够更准确地获取与待编码图像块相匹配的CNN上采样滤波器和CNN下采样滤波器的参数值,可以在编码时降低图像纹理在上、下采样过程中所带来的信息损失,提升编码图像质量。In Embodiment 6, the parameters of the CNN upsampling filter and the CNN downsampling filter are jointly trained online, and compared with the method of training filter parameters alone, the image to be encoded can be obtained more accurately The parameter values of the CNN upsampling filter and CNN downsampling filter that match the block can reduce the information loss caused by the upsampling and downsampling process of the image texture during encoding, and improve the quality of the encoded image.

上文结合图2至图18对本申请实施例的图像编码方法和图像解码方法进行了详细的描述,下面结合图19至图21对本申请实施例的图像编码装置和图像解码装置进行介绍,应理解,图19和图20所示的图像编码装置能够执行图2至图18中所示的本申请实施例的图像编码方法的各个步骤,图21所示的图像解码装置能够执行图19至图21中所示的本申请实施例的图像解码方法的各个步骤。为了简洁,下面适当省略重复的描述。The image encoding method and the image decoding method of the embodiment of the present application are described in detail above in conjunction with FIGS. , the image coding device shown in FIG. 19 and FIG. 20 can execute each step of the image coding method of the embodiment of the application shown in FIG. 2 to FIG. 18, and the image decoding device shown in FIG. 21 can execute the steps in FIG. Each step of the image decoding method in the embodiment of the present application shown in . For the sake of brevity, repeated descriptions are appropriately omitted below.

另外,图19至图21所示的图像编码装置和图像解码装置具体可以是智能终端、PAD、视频播放器、物联网设备或者其它具有视频图像编码或者解码功能的设备。In addition, the image encoding device and the image decoding device shown in Fig. 19 to Fig. 21 may specifically be a smart terminal, a PAD, a video player, an Internet of Things device or other devices having a video image encoding or decoding function.

图19是本申请实施例的图像编码装置的示意性框图。图19所示的图像编码装置1200具体包括:Fig. 19 is a schematic block diagram of an image encoding device according to an embodiment of the present application. The image encoding device 1200 shown in FIG. 19 specifically includes:

确定模块1201,用于根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,所述上采样滤波器集合至少包括有限冲击响应FIR上采样滤波器和卷积神经网络CNN上采样滤波器;A determining module 1201, configured to determine a target upsampling filter from a preset upsampling filter set according to the encoding cost of the image block to be encoded, wherein the upsampling filter set includes at least a finite impulse response FIR upsampling filter filter and convolutional neural network CNN upsampling filter;

处理模块1202,所述处理模块1202具体用于:生成与所述目标上采样滤波器对应的上采样滤波器指示信息;采用预先设置的FIR下采样滤波器对所述待编码图像块进行下采样,得到第一图像块;对所述第一图像块进行编码,得到码流;将所述上采样滤波器指示信息写入所述码流。A processing module 1202, the processing module 1202 is specifically configured to: generate upsampling filter indication information corresponding to the target upsampling filter; use a preset FIR downsampling filter to downsample the image block to be encoded , to obtain a first image block; encode the first image block to obtain a code stream; write the upsampling filter indication information into the code stream.

本申请中,根据图像块的编码代价可以从多种候选的滤波器中选择一个滤波器作为上滤波器,与采用固定滤波器作为上采样滤波器的方式相比,能够取得更好的编码效果。In this application, according to the coding cost of the image block, one filter can be selected from various candidate filters as the up filter, which can achieve better coding effect compared with the way of using a fixed filter as the up sampling filter .

图20是本申请实施例的图像编码装置的示意性框图。图20所示的图像编码装置1300具体包括:Fig. 20 is a schematic block diagram of an image encoding device according to an embodiment of the present application. The image encoding device 1300 shown in FIG. 20 specifically includes:

获取模块1301,用于获取码流;An acquisition module 1301, configured to acquire a code stream;

处理模块1302,所述处理模块具体用于:对所述码流进行熵解码、反量化和反变换,得到待解码图像块的重建残差信号;获取所述待解码图像块的预测信号;将所述重建残差信号和所述预测信号相加,得到所述待解码图像块的初始重建图像块;解析所述码流,获取编码模式指示信息;根据所述编码模式指示信息从原分辨率解码模式和变分辨率解码模式中确定目标解码模式;在所述目标解码模式为变分辨率解码模式的情况下,解析所述待编码图像块的码流,获取上采样滤波器指示信息;根据所述上采样滤波器指示信息从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,所述上采样滤波器集合至少包括有限冲击响应FIR上采样滤波器和卷积神经网络CNN上采样滤波器;A processing module 1302, the processing module is specifically configured to: perform entropy decoding, inverse quantization, and inverse transformation on the code stream to obtain a reconstructed residual signal of the image block to be decoded; obtain a prediction signal of the image block to be decoded; Adding the reconstruction residual signal and the prediction signal to obtain the initial reconstructed image block of the image block to be decoded; parsing the code stream to obtain coding mode indication information; according to the coding mode indication information from the original resolution Determining the target decoding mode in the decoding mode and the variable resolution decoding mode; in the case where the target decoding mode is the variable resolution decoding mode, parsing the code stream of the image block to be encoded, and obtaining the upsampling filter indication information; according to The upsampling filter indication information determines a target upsampling filter from a preset upsampling filter set, wherein the upsampling filter set includes at least a finite impulse response FIR upsampling filter and a convolutional neural network CNN upsampling filter;

本申请中,可以根据编码代价从上采样滤波器集合中确定出目标上采样滤波器,与直接采用固定参数值的上采样滤波器进行上采样操作相比,本申请方案在选择目标上采样滤波器时充分考虑了待编码图像块的编码代价,能够取得更好的编码效果。In this application, the target upsampling filter can be determined from the set of upsampling filters according to the encoding cost. Compared with directly using the upsampling filter with fixed parameter values for the upsampling operation, this application scheme selects the target upsampling filter The encoding cost of the image block to be encoded is fully considered when the encoder is used, and better encoding effect can be achieved.

图21是本申请实施例的图像解码装置的示意性框图。图21所示的图像编码装置1400具体包括:Fig. 21 is a schematic block diagram of an image decoding device according to an embodiment of the present application. The image encoding device 1400 shown in FIG. 21 specifically includes:

获取模块1401,用于获取码流;An acquisition module 1401, configured to acquire a code stream;

处理模块1402,所述处理模块具体用于:对所述码流进行熵解码、反量化和反变换,得到待解码图像块的重建残差信号;获取所述待解码图像块的预测信号;将所述重建残差信号和所述预测信号相加,得到所述待解码图像块的初始重建图像块;解析所述码流,获取编码模式指示信息;根据所述编码模式指示信息从原分辨率解码模式和变分辨率解码模式中确定目标解码模式;在所述目标解码模式为变分辨率解码模式的情况下,解析所述待编码图像块的码流,获取上采样滤波器指示信息;根据所述上采样滤波器指示信息从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,所述上采样滤波器集合至少包括有限冲击响应FIR上采样滤波器和卷积神经网络CNN上采样滤波器;采用所述目标上采样滤波器对所述初始重建图像块块进行上采样,得到目标重建图像块。The processing module 1402 is specifically configured to: perform entropy decoding, inverse quantization, and inverse transformation on the code stream to obtain a reconstructed residual signal of the image block to be decoded; obtain a prediction signal of the image block to be decoded; Adding the reconstruction residual signal and the prediction signal to obtain the initial reconstructed image block of the image block to be decoded; parsing the code stream to obtain coding mode indication information; according to the coding mode indication information from the original resolution Determining the target decoding mode in the decoding mode and the variable resolution decoding mode; in the case where the target decoding mode is the variable resolution decoding mode, parsing the code stream of the image block to be encoded, and obtaining the upsampling filter indication information; according to The upsampling filter indication information determines a target upsampling filter from a preset upsampling filter set, wherein the upsampling filter set includes at least a finite impulse response FIR upsampling filter and a convolutional neural network A CNN upsampling filter; using the target upsampling filter to upsample the initial reconstructed image block to obtain a target reconstructed image block.

本申请中,当在变分辨率解码模式下对图像块进行解码时,解码端能够根据上采样滤波器指示信息从预先设置的上采样滤波器集合中选择相应的上采样滤波器作为目标上采样滤波器,进而进行上采样操作,与直接采用固定参数的上采样滤波器进行上采样操作的方式相比,能够根据图像块的情况选择匹配的上采样滤波器进行上采样操作,从而提高解码效果。In this application, when decoding an image block in the variable resolution decoding mode, the decoding end can select the corresponding upsampling filter from the preset upsampling filter set as the target upsampling filter according to the upsampling filter indication information Filter, and then perform upsampling operation. Compared with the way of directly using fixed parameter upsampling filter for upsampling operation, the matching upsampling filter can be selected according to the situation of the image block for upsampling operation, thereby improving the decoding effect .

上述图像编码装置1200、图像编码装置1300和图像解码装置1400的具体实现形式可以是如下设备中的任意一种:台式计算机、移动计算装置、笔记本(例如,膝上型)计算机、平板计算机、机顶盒、智能电话、手持机、电视、相机、显示装置、数字媒体播放器、视频游戏控制台、车载计算机,或者其它类似的设备。The specific implementation form of the above image encoding device 1200, image encoding device 1300 and image decoding device 1400 may be any of the following devices: desktop computer, mobile computing device, notebook (for example, laptop) computer, tablet computer, set-top box , smartphones, handhelds, televisions, cameras, display devices, digital media players, video game consoles, vehicle computers, or other similar devices.

图22是本申请实施例的编码器的示意性框图。图22所示的编码器2000包括:编码端预测模块2001、变换量化模块2002、熵编码模块2003、编码重建模块2004和编码端滤波模块。Fig. 22 is a schematic block diagram of an encoder according to an embodiment of the present application. The encoder 2000 shown in FIG. 22 includes: an encoding end prediction module 2001 , a transform and quantization module 2002 , an entropy encoding module 2003 , an encoding reconstruction module 2004 and an encoding end filtering module.

上述图像编码装置1200和图像编码装置1300的具体结构可以如上述编码器2000所示,该编码器2000能够执行本申请实施例的图像编码方法的各个步骤。The specific structures of the above-mentioned image coding device 1200 and the image coding device 1300 can be shown as the above-mentioned coder 2000, and the coder 2000 can execute various steps of the image coding method in the embodiment of the present application.

图23是本申请实施例的解码器的示意性框图。图23所示的解码器3000包括:熵解码模块3001、反变换反量化模块3002、解码端预测模块3003、解码重建模块3004和解码端滤波模块3005。Fig. 23 is a schematic block diagram of a decoder according to an embodiment of the present application. The decoder 3000 shown in FIG. 23 includes: an entropy decoding module 3001 , an inverse transform and inverse quantization module 3002 , a decoding end prediction module 3003 , a decoding reconstruction module 3004 and a decoding end filtering module 3005 .

上述图像解码装置1400的具体结构可以如上述解码器3000所示,该解码器3000能够执行本申请实施例的图像解码方法的各个步骤。The specific structure of the above-mentioned image decoding apparatus 1400 can be shown as the above-mentioned decoder 3000, and the decoder 3000 can execute various steps of the image decoding method in the embodiment of the present application.

图24是本申请实施例的编解码装置的示意性框图。该编解码装置50可以是专门用于对视频图像进行编码和/或解码的装置,也可以是具有视频编解码功能的电子设备,进一步地,该编解码装置50可以是无线通信系统的移动终端或者用户设备。Fig. 24 is a schematic block diagram of a codec device according to an embodiment of the present application. The codec device 50 may be a device dedicated to encoding and/or decoding video images, or an electronic device with a video codec function, and further, the codec device 50 may be a mobile terminal of a wireless communication system or user equipment.

应理解,图24所示的编解码装置可以看成是上文中的图像编码装置1200、图像编码装置1300和图像解码装置1400的具体结构。图24能够执行本申请实施例的图像编解码方法的各个步骤。It should be understood that the codec device shown in FIG. 24 can be regarded as the specific structure of the above-mentioned image coding device 1200 , image coding device 1300 and image decoding device 1400 . FIG. 24 can execute various steps of the image encoding and decoding method of the embodiment of the present application.

编解码装置50可以包括下列模块或者单元:控制器56、编解码器54、无线电接口52、天线44、智能卡46、读卡器48、存储器58、红外线端口42、显示器32。除了图24中所示的模块和单元之外,编解码装置50还可以包括麦克风或者任何适当的音频输入模块,该音频输入模块可以是数字或者模拟信号输入,编解码装置50还可以包括音频输出模块,该音频输出模块可以是耳机、扬声器或者模拟音频或者数字音频输出连接。编解码装置50也可以包括电池,该电池可以是太阳能电池、燃料电池等等。编解码装置50还可以包括用于与其它设备进行近程视线通信的红外线端口,该编解码装置50还可以采用包括任何适当的近程通信方式与其它设备进行通信,例如,蓝牙无线连接、USB/火线有线连接。Codec device 50 may include the following modules or units: controller 56 , codec 54 , radio interface 52 , antenna 44 , smart card 46 , card reader 48 , memory 58 , infrared port 42 , display 32 . In addition to the modules and units shown in Figure 24, the codec device 50 may also include a microphone or any suitable audio input module, which may be a digital or analog signal input, and the codec device 50 may also include an audio output module, the audio output module can be a headphone, a speaker, or an analog audio or digital audio output connection. The codec device 50 may also include a battery, which may be a solar cell, a fuel cell, or the like. The codec device 50 may also include an infrared port for short-range line-of-sight communication with other devices, and the codec device 50 may also communicate with other devices using any suitable short-range communication methods, such as Bluetooth wireless connection, USB /FireWire wired connection.

存储器58可以存储形式为图像的数据和音频的数据,也可以存储用于在控制器56上执行的指令。The memory 58 may store data in the form of images and audio, as well as instructions for execution on the controller 56 .

编解码器54可以实现对音频和/或视频数据的编码和解码或者在控制器56的控制下实现对音频和/或视频数据的辅助编码和辅助解码。The codec 54 can implement encoding and decoding of audio and/or video data or implement auxiliary encoding and auxiliary decoding of audio and/or video data under the control of the controller 56 .

智能卡46和读卡器48可以提供用户信息,也可以提供网络认证和授权用户的认证信息。智能卡46和读卡器48的具体实现形式可以是集成电路卡(Universal IntegratedCircuit Card,UICC)和UICC读取器。Smart card 46 and card reader 48 can provide user information, and can also provide authentication information for network authentication and authorized users. The specific implementation forms of the smart card 46 and the card reader 48 may be an integrated circuit card (Universal Integrated Circuit Card, UICC) and a UICC reader.

无线电接口电路52可以生成无线通信信号,该无线通信信号可以是在进行蜂窝通信网络、无线通信系统或者无线局域网通信产生的通信信号。The radio interface circuit 52 can generate wireless communication signals, which can be communication signals generated during cellular communication network, wireless communication system or wireless local area network communication.

天线44用于向其它装置(装置的数目可以为一个也可以为多个)发送在无线电接口电路52生成的射频信号,并且还可以用于从其它装置(装置的数目可以为一个也可以为多个)接收射频信号。Antenna 44 is used to send the radio frequency signal generated in radio interface circuit 52 to other devices (the number of devices can be one or more), and can also be used to receive signals from other devices (the number of devices can be one or more). ) to receive radio frequency signals.

在本申请的一些实施例中,编解码装置50可以在传输和/或存储之前从另一设备接收待处理的视频图像数据。在本申请的另一些实施例中,编解码装置50可以通过无线或者有线连接接收图像并对接收到的图像进行编码/解码。In some embodiments of the present application, the codec device 50 may receive video image data to be processed from another device before transmission and/or storage. In some other embodiments of the present application, the codec device 50 may receive images through a wireless or wired connection and encode/decode the received images.

应理解,本申请实施例的图像编解码方法的处理对象可以是视频图像,也就是说,本申请的图像编解码方法可以对视频图像进行编解码。因此,视频编解码系统也可以执行本申请实施例的图像编解码方法,下面结合图17对本申请实施例的视频编解码系统进行详细的介绍。It should be understood that the processing object of the image encoding and decoding method in the embodiment of the present application may be a video image, that is, the image encoding and decoding method of the present application may perform encoding and decoding on a video image. Therefore, the video codec system can also execute the image codec method of the embodiment of the present application. The video codec system of the embodiment of the present application will be described in detail below with reference to FIG. 17 .

图25是本申请实施例的视频编解码系统的示意性框图。Fig. 25 is a schematic block diagram of a video encoding and decoding system according to an embodiment of the present application.

如图25所示,视频编解码系统7000包含源装置4000及目的地装置5000。源装置4000产生经过编码后的视频数据,源装置4000也可以被称为视频编码装置或视频编码设备,目的地装置5000可以对源装置4000产生的经过编码后的视频数据进行解码,目的地装置5000也可以被称为视频解码装置或视频解码设备。As shown in FIG. 25 , the video codec system 7000 includes a source device 4000 and a destination device 5000 . The source device 4000 generates encoded video data. The source device 4000 may also be called a video encoding device or a video encoding device. The destination device 5000 can decode the encoded video data generated by the source device 4000. The destination device 5000 may also be called a video decoding device or a video decoding device.

上文中的源装置4000相当于上文中的图像编码装置1200和图像编码装置1300,目的地装置5000相当于上文中的图像解码装置1400。The above source device 4000 is equivalent to the above image encoding device 1200 and the above image encoding device 1300 , and the destination device 5000 is equivalent to the above image decoding device 1400 .

源装置4000和目的地装置5000的具体实现形式可以是如下设备中的任意一种:台式计算机、移动计算装置、笔记本(例如,膝上型)计算机、平板计算机、机顶盒、智能电话、手持机、电视、相机、显示装置、数字媒体播放器、视频游戏控制台、车载计算机,或者其它类似的设备。Specific implementations of source device 4000 and destination device 5000 may be any of the following devices: desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, smartphones, handsets, Television, camera, display device, digital media player, video game console, vehicle computer, or other similar devices.

目的地装置5000可以经由信道6000接收来自源装置4000编码后的视频数据。信道6000可包括能够将编码后的视频数据从源装置4000移动到目的地装置5000的一个或多个媒体及/或装置。在一个实例中,信道6000可以包括使源装置4000能够实时地将编码后的视频数据直接发射到目的地装置5000的一个或多个通信媒体,在此实例中,源装置4000可以根据通信标准(例如,无线通信协议)来调制编码后的视频数据,并且可以将调制后的视频数据发射到目的地装置5000。上述一个或多个通信媒体可以包含无线及/或有线通信媒体,例如射频(Radio Frequency,RF)频谱或一根或多根物理传输线。上述一个或多个通信媒体可以形成基于包的网络(例如,局域网、广域网或全球网络(例如,因特网))的部分。上述一个或多个通信媒体可以包含路由器、交换器、基站,或者实现从源装置4000到目的地装置5000的通信的其它设备。The destination device 5000 may receive encoded video data from the source device 4000 via the channel 6000 . Channel 6000 may include one or more media and/or devices capable of moving encoded video data from source device 4000 to destination device 5000 . In one example, channel 6000 may include one or more communication media that enable source device 4000 to transmit encoded video data directly to destination device 5000 in real time, in which case source device 4000 may transmit encoded video data according to a communication standard ( For example, a wireless communication protocol) to modulate the encoded video data, and the modulated video data may be transmitted to the destination device 5000. The aforementioned one or more communication media may include wireless and/or wired communication media, such as radio frequency (Radio Frequency, RF) spectrum or one or more physical transmission lines. One or more of the communication media described above may form part of a packet-based network such as a local area network, a wide area network, or a global network such as the Internet. The one or more communication media described above may include routers, switches, base stations, or other devices that enable communication from the source device 4000 to the destination device 5000 .

在另一实例中,信道6000可包含存储由源装置4000产生的编码后的视频数据的存储媒体。在此实例中,目的地装置5000可经由磁盘存取或卡存取来存取存储媒体。存储媒体可包含多种本地存取式数据存储媒体,例如蓝光光盘、高密度数字视频光盘(DigitalVideo Disc,DVD)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)、快闪存储器,或用于存储经编码视频数据的其它合适数字存储媒体。In another example, channel 6000 may include a storage medium that stores encoded video data generated by source device 4000 . In this example, destination device 5000 may access the storage medium via disk access or card access. The storage medium may include a variety of local access data storage media, such as Blu-ray discs, high-density digital video discs (Digital Video Disc, DVD), read-only discs (Compact Disc Read-Only Memory, CD-ROM), flash memory, or other suitable digital storage media for storing encoded video data.

在另一实例中,信道6000可包含文件服务器或存储由源装置4000产生的编码后的视频数据的另一中间存储装置。在此实例中,目的地装置5000可经由流式传输或下载来存取存储于文件服务器或其它中间存储装置处的编码后的视频数据。文件服务器可以是能够存储编码后的视频数据且将所述编码后的视频数据发射到目的地装置5000的服务器类型。例如,文件服务器可以包含全球广域网(World Wide Web,Web)服务器(例如,用于网站)、文件传送协议(File Transfer Protocol,FTP)服务器、网络附加存储(Network AttachedStorage,NAS)装置以及本地磁盘驱动器。In another example, channel 6000 may include a file server or another intermediate storage device that stores encoded video data generated by source device 4000 . In this example, destination device 5000 may access encoded video data stored at a file server or other intermediate storage device via streaming or download. The file server may be a type of server capable of storing encoded video data and transmitting the encoded video data to the destination device 5000 . For example, a file server may include a World Wide Web (Web) server (e.g., for a website), a File Transfer Protocol (File Transfer Protocol, FTP) server, a Network Attached Storage (NAS) device, and a local disk drive .

目的地装置5000可经由标准数据连接(例如,因特网连接)来存取编码后的视频数据。数据连接的实例类型包含适合于存取存储于文件服务器上的编码后的视频数据的无线信道、有线连接(例如,缆线调制解调器等),或两者的组合。编码后的视频数据从文件服务器的发射可为流式传输、下载传输或两者的组合。Destination device 5000 may access the encoded video data via a standard data connection (eg, an Internet connection). Example types of data connections include wireless channels suitable for accessing encoded video data stored on a file server, wired connections (eg, cable modem, etc.), or a combination of both. The transmission of encoded video data from the file server can be a streaming transmission, a download transmission, or a combination of both.

本申请实施例的图像编解码方法不限于无线应用场景,示例性的,本申请实施例的图像编解码方法可以应用于支持以下应用等多种多媒体应用的视频编解码:空中电视广播、有线电视发射、卫星电视发射、流式传输视频发射(例如,经由因特网)、存储于数据存储媒体上的视频数据的编码、存储于数据存储媒体上的视频数据的解码,或其它应用。在一些实例中,视频编解码系统7000可经配置以支持单向或双向视频发射,以支持例如视频流式传输、视频播放、视频广播及/或视频电话等应用。The image encoding and decoding method of the embodiment of the present application is not limited to the wireless application scenario. Exemplarily, the image encoding and decoding method of the embodiment of the present application can be applied to the video encoding and decoding of various multimedia applications such as the following applications: air TV broadcasting, cable TV transmission, satellite television transmission, streaming video transmission (eg, via the Internet), encoding of video data stored on a data storage medium, decoding of video data stored on a data storage medium, or other applications. In some examples, video codec system 7000 can be configured to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting, and/or video telephony.

在图25中,源装置4000包含视频源4001、视频编码器4002及输出接口4003。在一些实例中,输出接口4003可包含调制器/解调器(调制解调器)及/或发射器。视频源4001可包含视频俘获装置(例如,视频相机)、含有先前俘获的视频数据的视频存档、用以从视频内容提供者接收视频数据的视频输入接口,及/或用于产生视频数据的计算机图形系统,或上述视频数据源的组合。In FIG. 25 , a source device 4000 includes a video source 4001 , a video encoder 4002 and an output interface 4003 . In some examples, output interface 4003 may include a modulator/demodulator (modem) and/or a transmitter. Video source 4001 may include a video capture device (e.g., a video camera), a video archive containing previously captured video data, a video input interface for receiving video data from a video content provider, and/or a computer for generating video data Graphics system, or a combination of the above video data sources.

视频编码器4002可编码来自视频源4001的视频数据。在一些实例中,源装置4000经由输出接口4003将编码后的视频数据直接发射到目的地装置5000。编码后的视频数据还可存储于存储媒体或文件服务器上以供目的地装置5000稍后存取以用于解码及/或播放。Video encoder 4002 may encode video data from video source 4001 . In some examples, source device 4000 transmits the encoded video data directly to destination device 5000 via output interface 4003 . The encoded video data may also be stored on a storage medium or file server for later access by the destination device 5000 for decoding and/or playback.

在图25的实例中,目的地装置5000包含输入接口5003、视频解码器5002及显示装置5001。在一些实例中,输入接口5003包含接收器及/或调制解调器。输入接口5003可经由信道6000接收编码后的视频数据。显示装置5001可与目的地装置5000整合或可在目的地装置5000外部。一般来说,显示装置5001显示解码后的视频数据。显示装置5001可包括多种显示装置,例如液晶显示器、等离子体显示器、有机发光二极管显示器或其它类型的显示装置。In the example of FIG. 25 , destination device 5000 includes input interface 5003 , video decoder 5002 and display device 5001 . In some examples, input interface 5003 includes a receiver and/or a modem. The input interface 5003 can receive encoded video data via the channel 6000 . The display device 5001 may be integrated with the destination device 5000 or may be external to the destination device 5000 . In general, the display device 5001 displays decoded video data. The display device 5001 may include various display devices, such as a liquid crystal display, a plasma display, an organic light emitting diode display, or other types of display devices.

视频编码器4002及视频解码器5002可根据视频压缩标准(例如,高效率视频编解码H.265标准))而操作,并且可以可遵照高效视频编码(High Efficiency Video Coding,HEVC)测试模型(HM)。H.265标准的文本描述ITU-TH.265(V3)(04/2015)于2015年4月29号发布,可从http://handle.itu.int/11.1002/7000/12455下载,所述文件的全部内容以引用的方式并入本文中。The video encoder 4002 and the video decoder 5002 may operate according to a video compression standard (for example, the High Efficiency Video Coding (H.265) standard), and may comply with the High Efficiency Video Coding (HEVC) test model (HM ). The text description of the H.265 standard ITU-TH.265(V3)(04/2015) was released on April 29, 2015 and can be downloaded from http://handle.itu.int/11.1002/7000/12455, the The entire content of the document is incorporated herein by reference.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other various media that can store program codes. .

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the application, but the scope of protection of the application is not limited thereto. Anyone familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the application. Should be covered within the protection scope of this application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (42)

1.一种图像编码方法,其特征在于,包括:1. An image coding method, characterized in that, comprising: 根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,所述上采样滤波器集合至少包括有限冲击响应FIR上采样滤波器和卷积神经网络CNN上采样滤波器;Determine the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded, wherein the upsampling filter set includes at least a finite impulse response FIR upsampling filter and a convolutional neural network CNN upsampling filter; 生成与所述目标上采样滤波器对应的上采样滤波器指示信息;generating upsampling filter indication information corresponding to the target upsampling filter; 采用预先设置的FIR下采样滤波器对所述待编码图像块进行下采样,得到第一图像块;Using a preset FIR downsampling filter to downsample the image block to be encoded to obtain a first image block; 对所述第一图像块进行编码,得到码流;Encoding the first image block to obtain a code stream; 将所述上采样滤波器指示信息写入所述码流。Writing the upsampling filter indication information into the code stream. 2.如权利要求1所述的方法,其特征在于,所述根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,包括:2. The method according to claim 1, wherein said determining a target upsampling filter from a preset set of upsampling filters according to the encoding cost of the image block to be encoded comprises: 确定所述上采样滤波器集合中的每种上采样滤波器作为所述目标上采样滤波器时所述待编码图像块的编码代价;determining the encoding cost of the image block to be encoded when each type of upsampling filter in the set of upsampling filters is used as the target upsampling filter; 将所述上采样滤波器集合中的第一上采样滤波器确定为所述目标上采样滤波器,其中,在所述上采样滤波器集合中,所述第一上采样滤波器作为所述目标上采样滤波器时所述待编码图像块的编码代价最小。determining a first upsampling filter in the set of upsampling filters as the target upsampling filter, wherein, in the set of upsampling filters, the first upsampling filter serves as the target When the upsampling filter is used, the encoding cost of the image block to be encoded is the smallest. 3.如权利要求1或2所述的方法,其特征在于,所述CNN上采样滤波器的参数值为预设的,所述CNN上采样滤波器的参数值是对预设图像训练集进行离线训练得到的。3. the method as claimed in claim 1 or 2, is characterized in that, the parameter value of described CNN upsampling filter is preset, and the parameter value of described CNN upsampling filter is to preset image training set obtained from offline training. 4.如权利要求1-3中任一项所述的方法,其特征在于,在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,所述方法还包括:4. The method according to any one of claims 1-3, wherein before the target upsampling filter is determined from a preset set of upsampling filters according to the encoding cost of the image block to be encoded, the The method also includes: 根据所述待编码图像块对所述CNN上采样滤波器进行在线训练,得到所述CNN上采样滤波器的更新参数值,所述CNN上采样滤波器的更新参数值用于替代所述CNN上采样滤波器预先设置的参数值。Perform online training on the CNN upsampling filter according to the image block to be encoded to obtain an update parameter value of the CNN upsampling filter, and the update parameter value of the CNN upsampling filter is used to replace the CNN Sample filter preset parameter values. 5.如权利要求4所述的方法,其特征在于,所述方法还包括:5. The method of claim 4, further comprising: 将所述CNN上采样滤波器的更新参数值写入所述码流。Write the updated parameter value of the CNN upsampling filter into the code stream. 6.如权利要求1-5中任一项所述的方法,其特征在于,在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,所述方法还包括:6. The method according to any one of claims 1-5, wherein before the target upsampling filter is determined from the preset upsampling filter set according to the encoding cost of the image block to be encoded, the The method also includes: 根据所述待编码图像块的编码代价从原分辨率编码模式和变分辨率编码模式中确定出目标编码模式;determining a target coding mode from the original resolution coding mode and the variable resolution coding mode according to the coding cost of the image block to be coded; 生成与所述目标编码模式对应的编码模式指示信息;generating coding mode indication information corresponding to the target coding mode; 将所述编码模式指示信息写入码流。Writing the coding mode indication information into a code stream. 7.一种图像编码方法,其特征在于,包括:7. An image coding method, characterized in that, comprising: 根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,所述上采样滤波器集合至少包括有限冲击响应FIR上采样滤波器和卷积神经网络CNN上采样滤波器;Determine the target upsampling filter from the preset upsampling filter set according to the encoding cost of the image block to be encoded, wherein the upsampling filter set includes at least a finite impulse response FIR upsampling filter and a convolutional neural network CNN upsampling filter; 生成与所述目标上采样滤波器对应的上采样滤波器指示信息;generating upsampling filter indication information corresponding to the target upsampling filter; 将预先设置的下采样滤波器集合中与所述目标上采样滤波器类型相同的下采样滤波器确定为目标下采样滤波器,其中,所述下采样滤波器集合至少包括有限冲击响应FIR下采样滤波器和卷积神经网络CNN下采样滤波器;Determining a downsampling filter of the same type as the target upsampling filter in the preset downsampling filter set as the target downsampling filter, wherein the downsampling filter set includes at least finite impulse response FIR downsampling Filters and CNN downsampling filters; 采用所述目标下采样滤波器对所述待编码图像块进行下采样,得到第一图像块;Using the target downsampling filter to downsample the image block to be encoded to obtain a first image block; 对所述第一图像块进行编码,得到码流;Encoding the first image block to obtain a code stream; 将所述上采样滤波器指示信息写入所述码流。Writing the upsampling filter indication information into the code stream. 8.如权利要求7所述的方法,其特征在于,所述根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,包括:8. The method according to claim 7, wherein said determining a target upsampling filter from a preset set of upsampling filters according to the encoding cost of the image block to be encoded comprises: 确定所述上采样滤波器集合中的每种上采样滤波器作为所述目标上采样滤波器时所述待编码图像块的编码代价;determining the encoding cost of the image block to be encoded when each type of upsampling filter in the set of upsampling filters is used as the target upsampling filter; 将所述上采样滤波器集合中的第一上采样滤波器确定为所述目标上采样滤波器,其中,在所述上采样滤波器集合中,所述上采样滤波器集合中的第一上采样滤波器作为所述目标上采样滤波器时所述待编码图像块的编码代价最小。determining a first upsampling filter in the set of upsampling filters as the target upsampling filter, wherein, in the set of upsampling filters, the first upsampling filter in the set of upsampling filters When the sampling filter is used as the target up-sampling filter, the encoding cost of the image block to be encoded is the smallest. 9.如权利要求7或8所述的方法,其特征在于,所述CNN上采样滤波器的参数值为预设的,所述CNN上采样滤波器的参数值是对预设图像训练集进行离线训练得到的。9. the method as claimed in claim 7 or 8, is characterized in that, the parameter value of described CNN upsampling filter is preset, and the parameter value of described CNN upsampling filter is to preset image training set obtained from offline training. 10.如权利要求7-9中任一项所述的方法,其特征在于,所述CNN下采样滤波器的参数值为预设的,所述CNN下采样滤波器的参数值是对预设图像训练集进行离线训练得到的。10. The method according to any one of claims 7-9, wherein the parameter value of the CNN downsampling filter is preset, and the parameter value of the CNN downsampling filter is preset The image training set is obtained by offline training. 11.如权利要求7或8所述的方法,其特征在于,所述CNN上采样滤波器的参数值和所述CNN下采样滤波器的参数值均为预设的,所述CNN上采样滤波器的参数值和所述CNN下采样滤波器的参数值是在离线情况下对预设图像训练集进行联合训练得到的。11. The method according to claim 7 or 8, characterized in that, the parameter values of the CNN upsampling filter and the CNN downsampling filter are preset, and the CNN upsampling filter The parameter value of the filter and the parameter value of the CNN downsampling filter are obtained through joint training on a preset image training set in an offline situation. 12.如权利要求7-11中任一项所述的方法,其特征在于,在采用所述目标下采样滤波器对所述待编码图像块进行下采样之前,所述方法还包括:12. The method according to any one of claims 7-11, wherein before using the target downsampling filter to downsample the image block to be encoded, the method further comprises: 根据所述待编码图像块对所述CNN下采样滤波器进行在线训练,得到所述CNN下采样滤波器的更新参数值,所述CNN下采样滤波器的更新参数值用于替代所述CNN下采样滤波器预先设置的参数值。Perform online training on the CNN downsampling filter according to the image block to be encoded to obtain an update parameter value of the CNN downsampling filter, and the update parameter value of the CNN downsampling filter is used to replace the CNN downsampling filter Sample filter preset parameter values. 13.如权利要求7-12中任一项所述的方法,其特征在于,在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,所述方法还包括:13. The method according to any one of claims 7-12, wherein before the target upsampling filter is determined from a preset set of upsampling filters according to the encoding cost of the image block to be encoded, the The method also includes: 根据所述待编码图像块对所述CNN上采样滤波器进行在线训练,得到所述CNN上采样滤波器的更新参数值,所述CNN上采样滤波器的更新参数值用于替代所述CNN上采样滤波器预先设置的参数值。Perform online training on the CNN upsampling filter according to the image block to be encoded to obtain an update parameter value of the CNN upsampling filter, and the update parameter value of the CNN upsampling filter is used to replace the CNN Sample filter preset parameter values. 14.如权利要求7-11中任一项所述的方法,其特征在于,在采用所述目标下采样滤波器对所述待编码图像块进行下采样之前,所述方法还包括:14. The method according to any one of claims 7-11, wherein before using the target downsampling filter to downsample the image block to be encoded, the method further comprises: 根据所述待编码图像块对所述CNN下采样滤波器和所述CNN上采样滤波器进行联合在线训练,得到所述CNN下采样滤波器的更新参数值和所述CNN上采样滤波器的更新参数值;Carry out joint online training on the CNN downsampling filter and the CNN upsampling filter according to the image block to be encoded, to obtain an update parameter value of the CNN downsampling filter and an update of the CNN upsampling filter parameter value; 其中,所述CNN下采样滤波器的更新参数值用于替代所述CNN下采样滤波器预先设置的参数值,所述CNN上采样滤波器的更新参数值用于替代所述CNN上采样滤波器预先设置的参数值。Wherein, the update parameter value of the CNN downsampling filter is used to replace the preset parameter value of the CNN downsampling filter, and the update parameter value of the CNN upsampling filter is used to replace the CNN upsampling filter Preset parameter values. 15.如权利要求13或14所述的方法,其特征在于,所述方法还包括:15. The method of claim 13 or 14, further comprising: 将所述CNN上采样滤波器的更新参数值写入所述码流。Write the updated parameter value of the CNN upsampling filter into the code stream. 16.如权利要求7-15中任一项所述的方法,其特征在于,在根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,所述方法还包括:16. The method according to any one of claims 7-15, wherein before the target upsampling filter is determined from a preset set of upsampling filters according to the encoding cost of the image block to be encoded, the The method also includes: 根据所述待编码图像块的编码代价从原分辨率编码模式和变分辨率编码模式中确定出目标编码模式;determining a target coding mode from the original resolution coding mode and the variable resolution coding mode according to the coding cost of the image block to be coded; 生成与所述目标编码模式对应的编码模式指示信息;generating coding mode indication information corresponding to the target coding mode; 将所述编码模式指示信息写入码流。Writing the coding mode indication information into a code stream. 17.一种图像解码方法,其特征在于,包括:17. An image decoding method, characterized in that, comprising: 获取码流;Get code stream; 对所述码流进行熵解码、反量化和反变换,得到待解码图像块的重建残差信号;performing entropy decoding, inverse quantization and inverse transformation on the code stream to obtain a reconstructed residual signal of the image block to be decoded; 获取所述待解码图像块的预测信号;Acquiring a prediction signal of the image block to be decoded; 将所述重建残差信号和所述预测信号相加,得到所述待解码图像块的初始重建图像块;adding the reconstruction residual signal and the prediction signal to obtain an initial reconstructed image block of the image block to be decoded; 解析所述码流,获取编码模式指示信息;Analyzing the code stream to obtain coding mode indication information; 根据所述编码模式指示信息从原分辨率解码模式和变分辨率解码模式中确定目标解码模式;determining a target decoding mode from an original resolution decoding mode and a variable resolution decoding mode according to the encoding mode indication information; 在所述目标解码模式为变分辨率解码模式的情况下,解析所述待编码图像块的码流,获取上采样滤波器指示信息;If the target decoding mode is a variable resolution decoding mode, analyze the code stream of the image block to be encoded, and acquire upsampling filter indication information; 根据所述上采样滤波器指示信息从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,所述上采样滤波器集合至少包括有限冲击响应FIR上采样滤波器和卷积神经网络CNN上采样滤波器;Determine the target upsampling filter from the preset upsampling filter set according to the upsampling filter indication information, wherein the upsampling filter set includes at least a finite impulse response FIR upsampling filter and a convolution neural network Network CNN upsampling filter; 采用所述目标上采样滤波器对所述初始重建图像块块进行上采样,得到目标重建图像块。Upsampling the initial reconstructed image block by using the target upsampling filter to obtain a target reconstructed image block. 18.如权利要求17所述的方法,其特征在于,所述CNN上采样滤波器的参数值为预设的,所述CNN上采样滤波器的参数值是对预设图像训练集进行离线训练得到的。18. The method according to claim 17, wherein the parameter value of the CNN upsampling filter is preset, and the parameter value of the CNN upsampling filter is to carry out offline training to a preset image training set owned. 19.如权利要求17或18所述的方法,其特征在于,所述方法还包括:19. The method of claim 17 or 18, further comprising: 解析所述码流,获取所述CNN上采样滤波器的更新参数值,所述CNN上采样滤波器的更新参数值用于替代所述CNN上采样滤波器预先设置的参数值。Parsing the code stream to obtain an updated parameter value of the CNN upsampling filter, where the updated parameter value of the CNN upsampling filter is used to replace the preset parameter value of the CNN upsampling filter. 20.如权利要求19所述的方法,其特征在于,在解析所述码流,获取所述CNN上采样滤波器的更新参数值之前,所述方法还包括:20. The method according to claim 19, wherein, before parsing the code stream and obtaining the update parameter value of the CNN upsampling filter, the method further comprises: 解析所述码流,获取滤波器参数更新指示信息,所述滤波器参数更新指示信息用于指示是否对所述目标上采样滤波器的参数值进行更新;Parsing the code stream to obtain filter parameter update indication information, where the filter parameter update indication information is used to indicate whether to update the parameter value of the target upsampling filter; 所述解析所述码流,获取所述CNN上采样滤波器的更新参数值,包括:The parsing of the code stream to obtain the update parameter value of the CNN upsampling filter includes: 在所述滤波器参数更新指示信息指示对所述目标上采样滤波器的参数进行更新的情况下,解析所述码流,获取所述CNN上采样滤波器的更新参数值。If the filter parameter update instruction information indicates to update the parameters of the target upsampling filter, parse the code stream to acquire the update parameter value of the CNN upsampling filter. 21.如权利要求19或20所述的方法,其特征在于,所述CNN上采样滤波器的更新参数值是根据待编码图像块对CNN上采样网络进行在线训练得到的,其中,所述待解码图像块是对所述待编码图像块进行编码得到的。21. The method according to claim 19 or 20, wherein the update parameter value of the CNN upsampling filter is obtained by performing online training on the CNN upsampling network according to the image block to be encoded, wherein the to-be-coded The decoded image block is obtained by encoding the image block to be encoded. 22.一种图像编码装置,其特征在于,包括:22. An image encoding device, comprising: 确定模块,用于根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,所述上采样滤波器集合至少包括有限冲击响应FIR上采样滤波器和卷积神经网络CNN上采样滤波器;A determination module, configured to determine a target upsampling filter from a preset set of upsampling filters according to the encoding cost of the image block to be encoded, wherein the set of upsampling filters at least includes a finite impulse response FIR upsampling filter and convolutional neural network CNN upsampling filter; 处理模块,所述处理模块具体用于:A processing module, the processing module is specifically used for: 生成与所述目标上采样滤波器对应的上采样滤波器指示信息;generating upsampling filter indication information corresponding to the target upsampling filter; 采用预先设置的FIR下采样滤波器对所述待编码图像块进行下采样,得到第一图像块;Using a preset FIR downsampling filter to downsample the image block to be encoded to obtain a first image block; 对所述第一图像块进行编码,得到码流;Encoding the first image block to obtain a code stream; 将所述上采样滤波器指示信息写入所述码流。Writing the upsampling filter indication information into the code stream. 23.如权利要求22所述的装置,其特征在于,所述确定模块具体用于:23. The device according to claim 22, wherein the determining module is specifically configured to: 确定所述上采样滤波器集合中的每种上采样滤波器作为所述目标上采样滤波器时所述待编码图像块的编码代价;determining the encoding cost of the image block to be encoded when each type of upsampling filter in the set of upsampling filters is used as the target upsampling filter; 将所述上采样滤波器集合中的第一上采样滤波器确定为所述目标上采样滤波器,其中,在所述上采样滤波器集合中,所述第一上采样滤波器作为所述目标上采样滤波器时所述待编码图像块的编码代价最小。determining a first upsampling filter in the set of upsampling filters as the target upsampling filter, wherein, in the set of upsampling filters, the first upsampling filter serves as the target When the upsampling filter is used, the encoding cost of the image block to be encoded is the smallest. 24.如权利要求22或23所述的装置,其特征在于,所述CNN上采样滤波器的参数值为预设的,所述CNN上采样滤波器的参数值是对预设图像训练集进行离线训练得到的。24. The device according to claim 22 or 23, wherein the parameter value of the CNN upsampling filter is preset, and the parameter value of the CNN upsampling filter is performed on a preset image training set obtained from offline training. 25.如权利要求22-24中任一项所述的装置,其特征在于,在所述确定模块根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,所述确定模块还用于:25. The device according to any one of claims 22-24, wherein, in the determination module, the target upsampling filter is determined from the preset upsampling filter set according to the encoding cost of the image block to be encoded. Before the device, the determination module is also used to: 根据所述待编码图像块对所述CNN上采样滤波器进行在线训练,得到所述CNN上采样滤波器的更新参数值,所述CNN上采样滤波器的更新参数值用于替代所述CNN上采样滤波器预先设置的参数值。Perform online training on the CNN upsampling filter according to the image block to be encoded to obtain an update parameter value of the CNN upsampling filter, and the update parameter value of the CNN upsampling filter is used to replace the CNN Sample filter preset parameter values. 26.如权利要求25所述的装置,其特征在于,所述处理模块还用于:26. The device according to claim 25, wherein the processing module is further used for: 将所述CNN上采样滤波器的更新参数值写入所述码流。Write the updated parameter value of the CNN upsampling filter into the code stream. 27.如权利要求22-26中任一项所述的装置,其特征在于,在所述确定模块根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,所述确定模块还用于:27. The device according to any one of claims 22-26, wherein, in the determination module, the target upsampling filter is determined from the preset upsampling filter set according to the encoding cost of the image block to be encoded. Before the device, the determination module is also used to: 根据所述待编码图像块的编码代价从原分辨率编码模式和变分辨率编码模式中确定出目标编码模式;determining a target coding mode from the original resolution coding mode and the variable resolution coding mode according to the coding cost of the image block to be coded; 生成与所述目标编码模式对应的编码模式指示信息;generating coding mode indication information corresponding to the target coding mode; 将所述编码模式指示信息写入码流。Writing the coding mode indication information into a code stream. 28.一种图像编码装置,其特征在于,包括:28. An image encoding device, comprising: 确定模块,用于根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,所述上采样滤波器集合至少包括有限冲击响应FIR上采样滤波器和卷积神经网络CNN上采样滤波器;A determination module, configured to determine a target upsampling filter from a preset set of upsampling filters according to the encoding cost of the image block to be encoded, wherein the set of upsampling filters at least includes a finite impulse response FIR upsampling filter and convolutional neural network CNN upsampling filter; 处理模块,所述处理模块具体用于:A processing module, the processing module is specifically used for: 生成与所述目标上采样滤波器对应的上采样滤波器指示信息;generating upsampling filter indication information corresponding to the target upsampling filter; 将预先设置的下采样滤波器集合中与所述目标上采样滤波器类型相同的下采样滤波器确定为目标下采样滤波器,其中,所述下采样滤波器集合至少包括有限冲击响应FIR下采样滤波器和卷积神经网络CNN下采样滤波器;Determining a downsampling filter of the same type as the target upsampling filter in the preset downsampling filter set as the target downsampling filter, wherein the downsampling filter set includes at least finite impulse response FIR downsampling Filters and CNN downsampling filters; 采用所述目标下采样滤波器对所述待编码图像块进行下采样,得到第一图像块;Using the target downsampling filter to downsample the image block to be encoded to obtain a first image block; 对所述第一图像块进行编码,得到码流;Encoding the first image block to obtain a code stream; 将所述上采样滤波器指示信息写入所述码流。Writing the upsampling filter indication information into the code stream. 29.如权利要求28所述的装置,其特征在于,所述确定模块具体用于:29. The device according to claim 28, wherein the determining module is specifically configured to: 确定所述上采样滤波器集合中的每种上采样滤波器作为所述目标上采样滤波器时所述待编码图像块的编码代价;determining the encoding cost of the image block to be encoded when each type of upsampling filter in the set of upsampling filters is used as the target upsampling filter; 将所述上采样滤波器集合中的第一上采样滤波器确定为所述目标上采样滤波器,其中,在所述上采样滤波器集合中,所述上采样滤波器集合中的第一上采样滤波器作为所述目标上采样滤波器时所述待编码图像块的编码代价最小。determining a first upsampling filter in the set of upsampling filters as the target upsampling filter, wherein, in the set of upsampling filters, the first upsampling filter in the set of upsampling filters When the sampling filter is used as the target up-sampling filter, the encoding cost of the image block to be encoded is the smallest. 30.如权利要求28或29所述的装置,其特征在于,所述CNN上采样滤波器的参数值为预设的,所述CNN上采样滤波器的参数值是对预设图像训练集进行离线训练得到的。30. The device according to claim 28 or 29, wherein the parameter value of the CNN upsampling filter is preset, and the parameter value of the CNN upsampling filter is performed on a preset image training set obtained from offline training. 31.如权利要求28-30中任一项所述的装置,其特征在于,所述CNN下采样滤波器的参数值为预设的,所述CNN下采样滤波器的参数值是对预设图像训练集进行离线训练得到的。31. The device according to any one of claims 28-30, wherein the parameter value of the CNN downsampling filter is preset, and the parameter value of the CNN downsampling filter is preset The image training set is obtained by offline training. 32.如权利要求28或29所述的装置,其特征在于,所述CNN上采样滤波器的参数值和所述CNN下采样滤波器的参数值均为预设的,所述CNN上采样滤波器的参数值和所述CNN下采样滤波器的参数值是在离线情况下对预设图像训练集进行联合训练得到的。32. The device according to claim 28 or 29, wherein the parameter values of the CNN upsampling filter and the CNN downsampling filter are preset, and the CNN upsampling filter The parameter value of the filter and the parameter value of the CNN downsampling filter are obtained through joint training on a preset image training set in an offline situation. 33.如权利要求28-32中任一项所述的装置,其特征在于,在所述处理模块采用所述目标下采样滤波器对所述待编码图像块进行下采样之前,所述处理模块还用于:33. The device according to any one of claims 28-32, wherein before the processing module uses the target downsampling filter to downsample the image block to be encoded, the processing module Also used for: 根据所述待编码图像块对所述CNN下采样滤波器进行在线训练,得到所述CNN下采样滤波器的更新参数值,所述CNN下采样滤波器的更新参数值用于替代所述CNN下采样滤波器预先设置的参数值。Perform online training on the CNN downsampling filter according to the image block to be encoded to obtain an update parameter value of the CNN downsampling filter, and the update parameter value of the CNN downsampling filter is used to replace the CNN downsampling filter Sample filter preset parameter values. 34.如权利要求28-33中任一项所述的装置,其特征在于,在所述确定模块根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,所述确定模块还用于:34. The device according to any one of claims 28-33, wherein, in the determination module, the target upsampling filter is determined from the preset upsampling filter set according to the encoding cost of the image block to be encoded. Before the device, the determination module is also used to: 根据所述待编码图像块对所述CNN上采样滤波器进行在线训练,得到所述CNN上采样滤波器的更新参数值,所述CNN上采样滤波器的更新参数值用于替代所述CNN上采样滤波器预先设置的参数值。Perform online training on the CNN upsampling filter according to the image block to be encoded to obtain an update parameter value of the CNN upsampling filter, and the update parameter value of the CNN upsampling filter is used to replace the CNN Sample filter preset parameter values. 35.如权利要求28-32中任一项所述的装置,其特征在于,在所述处理模块采用所述目标下采样滤波器对所述待编码图像块进行下采样之前,所述处理模块还用于:35. The device according to any one of claims 28-32, wherein, before the processing module uses the target downsampling filter to downsample the image block to be encoded, the processing module Also used for: 根据所述待编码图像块对所述CNN下采样滤波器和所述CNN上采样滤波器进行联合在线训练,得到所述CNN下采样滤波器的更新参数值和所述CNN上采样滤波器的更新参数值;Carry out joint online training on the CNN downsampling filter and the CNN upsampling filter according to the image block to be encoded, to obtain an update parameter value of the CNN downsampling filter and an update of the CNN upsampling filter parameter value; 其中,所述CNN下采样滤波器的更新参数值用于替代所述CNN下采样滤波器预先设置的参数值,所述CNN上采样滤波器的更新参数值用于替代所述CNN上采样滤波器预先设置的参数值。Wherein, the update parameter value of the CNN downsampling filter is used to replace the preset parameter value of the CNN downsampling filter, and the update parameter value of the CNN upsampling filter is used to replace the CNN upsampling filter Preset parameter values. 36.如权利要求34或35所述的装置,其特征在于,所述处理模块还用于:36. The device according to claim 34 or 35, wherein the processing module is further used for: 将所述CNN上采样滤波器的更新参数值写入所述码流。Write the updated parameter value of the CNN upsampling filter into the code stream. 37.如权利要求28-36中任一项所述的装置,其特征在于,在所述确定模块根据待编码图像块的编码代价从预先设置的上采样滤波器集合中确定出目标上采样滤波器之前,所述确定模块还用于:37. The device according to any one of claims 28-36, wherein, in the determination module, the target upsampling filter is determined from the preset upsampling filter set according to the encoding cost of the image block to be encoded. Before the device, the determination module is also used to: 根据所述待编码图像块的编码代价从原分辨率编码模式和变分辨率编码模式中确定出目标编码模式;determining a target coding mode from the original resolution coding mode and the variable resolution coding mode according to the coding cost of the image block to be coded; 生成与所述目标编码模式对应的编码模式指示信息;generating coding mode indication information corresponding to the target coding mode; 将所述编码模式指示信息写入码流。Writing the coding mode indication information into a code stream. 38.一种图像解码装置,其特征在于,包括:38. An image decoding device, comprising: 获取模块,用于获取码流;The acquisition module is used to acquire the code stream; 处理模块,所述处理模块具体用于:A processing module, the processing module is specifically used for: 对所述码流进行熵解码、反量化和反变换,得到待解码图像块的重建残差信号;performing entropy decoding, inverse quantization and inverse transformation on the code stream to obtain a reconstructed residual signal of the image block to be decoded; 获取所述待解码图像块的预测信号;Acquiring a prediction signal of the image block to be decoded; 将所述重建残差信号和所述预测信号相加,得到所述待解码图像块的初始重建图像块;adding the reconstruction residual signal and the prediction signal to obtain an initial reconstructed image block of the image block to be decoded; 解析所述码流,获取编码模式指示信息;Analyzing the code stream to obtain coding mode indication information; 根据所述编码模式指示信息从原分辨率解码模式和变分辨率解码模式中确定目标解码模式;determining a target decoding mode from an original resolution decoding mode and a variable resolution decoding mode according to the encoding mode indication information; 在所述目标解码模式为变分辨率解码模式的情况下,解析所述待编码图像块的码流,获取上采样滤波器指示信息;If the target decoding mode is a variable resolution decoding mode, analyze the code stream of the image block to be encoded, and acquire upsampling filter indication information; 根据所述上采样滤波器指示信息从预先设置的上采样滤波器集合中确定出目标上采样滤波器,其中,所述上采样滤波器集合至少包括有限冲击响应FIR上采样滤波器和卷积神经网络CNN上采样滤波器;Determine the target upsampling filter from the preset upsampling filter set according to the upsampling filter indication information, wherein the upsampling filter set includes at least a finite impulse response FIR upsampling filter and a convolution neural network Network CNN upsampling filter; 采用所述目标上采样滤波器对所述初始重建图像块块进行上采样,得到目标重建图像块。Upsampling the initial reconstructed image block by using the target upsampling filter to obtain a target reconstructed image block. 39.如权利要求38所述的装置,其特征在于,所述CNN上采样滤波器的参数值为预设的,所述CNN上采样滤波器的参数值是对预设图像训练集进行离线训练得到的。39. The device according to claim 38, wherein the parameter value of the CNN upsampling filter is preset, and the parameter value of the CNN upsampling filter is to carry out offline training to a preset image training set owned. 40.如权利要求38或39所述的装置,其特征在于,所述处理模块还用于:40. The device according to claim 38 or 39, wherein the processing module is further used for: 解析所述码流,获取所述CNN上采样滤波器的更新参数值,所述CNN上采样滤波器的更新参数值用于替代所述CNN上采样滤波器预先设置的参数值。Parsing the code stream to obtain an updated parameter value of the CNN upsampling filter, where the updated parameter value of the CNN upsampling filter is used to replace the preset parameter value of the CNN upsampling filter. 41.如权利要求40所述的装置,其特征在于,在所述处理模块解析所述码流,获取所述CNN上采样滤波器的更新参数值之前,所述处理模块还用于:41. The device according to claim 40, wherein the processing module is further configured to: 解析所述码流,获取滤波器参数更新指示信息,所述滤波器参数更新指示信息用于指示是否对所述目标上采样滤波器的参数值进行更新;Parsing the code stream to obtain filter parameter update indication information, where the filter parameter update indication information is used to indicate whether to update the parameter value of the target upsampling filter; 所述解析所述码流,获取所述CNN上采样滤波器的更新参数值,包括:The parsing of the code stream to obtain the update parameter value of the CNN upsampling filter includes: 在所述滤波器参数更新指示信息指示对所述目标上采样滤波器的参数进行更新的情况下,解析所述码流,获取所述CNN上采样滤波器的更新参数值。If the filter parameter update instruction information indicates to update the parameters of the target upsampling filter, parse the code stream to acquire the update parameter value of the CNN upsampling filter. 42.如权利要求40或41所述的装置,其特征在于,所述CNN上采样滤波器的更新参数值是根据待编码图像块对CNN上采样网络进行在线训练得到的,其中,所述待解码图像块是对所述待编码图像块进行编码得到的。42. The device according to claim 40 or 41, wherein the update parameter value of the CNN upsampling filter is obtained by performing online training on the CNN upsampling network according to the image block to be encoded, wherein the to-be-coded The decoded image block is obtained by encoding the image block to be encoded.
CN201810242304.7A 2018-03-22 2018-03-22 Image coding and decoding method and device Active CN110300301B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810242304.7A CN110300301B (en) 2018-03-22 2018-03-22 Image coding and decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810242304.7A CN110300301B (en) 2018-03-22 2018-03-22 Image coding and decoding method and device

Publications (2)

Publication Number Publication Date
CN110300301A true CN110300301A (en) 2019-10-01
CN110300301B CN110300301B (en) 2023-01-13

Family

ID=68025753

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810242304.7A Active CN110300301B (en) 2018-03-22 2018-03-22 Image coding and decoding method and device

Country Status (1)

Country Link
CN (1) CN110300301B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971784A (en) * 2019-11-14 2020-04-07 北京达佳互联信息技术有限公司 Video processing method and device, electronic equipment and storage medium
CN111064958A (en) * 2019-12-28 2020-04-24 复旦大学 A Low-Complexity Neural Network Filtering Algorithm for B-Frame and P-Frame
WO2021086016A2 (en) 2019-10-28 2021-05-06 Samsung Electronics Co., Ltd. Apparatus and method for performing artificial intelligence (ai) encoding and ai decoding on image
WO2021086032A1 (en) 2019-10-29 2021-05-06 Samsung Electronics Co., Ltd. Image encoding method and apparatus and image decoding method and apparatus
CN114050987A (en) * 2021-11-03 2022-02-15 猫岐智能科技(上海)有限公司 Contactless debugging system and method for Internet of things equipment
WO2023010981A1 (en) * 2021-07-31 2023-02-09 华为技术有限公司 Encoding and decoding methods and apparatus
US11647210B2 (en) 2018-10-19 2023-05-09 Samsung Electronics Co., Ltd. Methods and apparatuses for performing encoding and decoding on image
CN116648716A (en) * 2020-12-24 2023-08-25 华为技术有限公司 Decoding by indicating feature map data
WO2024061136A1 (en) * 2022-09-19 2024-03-28 Douyin Vision Co., Ltd. Method, apparatus, and medium for video processing
WO2024174071A1 (en) * 2023-02-20 2024-08-29 Rwth Aachen University Video coding using signal enhancement filtering

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118235394A (en) * 2021-11-29 2024-06-21 北京达佳互联信息技术有限公司 Reversible filtering for video codecs

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060095471A1 (en) * 2004-06-07 2006-05-04 Jason Krikorian Personal media broadcasting system
CN103716630A (en) * 2012-09-29 2014-04-09 华为技术有限公司 Upsampling filter generation method and device
CN104811276A (en) * 2015-05-04 2015-07-29 东南大学 DL-CNN (deep leaning-convolutional neutral network) demodulator for super-Nyquist rate communication
CN107016642A (en) * 2015-11-09 2017-08-04 汤姆逊许可公司 For to there is image of making an uproar to carry out the method for resolution ratio up-regulation and for there is image of making an uproar to carry out the device of resolution ratio up-regulation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060095471A1 (en) * 2004-06-07 2006-05-04 Jason Krikorian Personal media broadcasting system
CN103716630A (en) * 2012-09-29 2014-04-09 华为技术有限公司 Upsampling filter generation method and device
CN104811276A (en) * 2015-05-04 2015-07-29 东南大学 DL-CNN (deep leaning-convolutional neutral network) demodulator for super-Nyquist rate communication
CN107016642A (en) * 2015-11-09 2017-08-04 汤姆逊许可公司 For to there is image of making an uproar to carry out the method for resolution ratio up-regulation and for there is image of making an uproar to carry out the device of resolution ratio up-regulation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HAN ZHANG等: "Learning a Convolutional Neural Network for", 《VCIP》 *

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11647210B2 (en) 2018-10-19 2023-05-09 Samsung Electronics Co., Ltd. Methods and apparatuses for performing encoding and decoding on image
US11610341B2 (en) 2019-10-28 2023-03-21 Samsung Electronics Co., Ltd. Apparatus and method for performing artificial intelligence (AI) encoding and AI decoding on image
WO2021086016A2 (en) 2019-10-28 2021-05-06 Samsung Electronics Co., Ltd. Apparatus and method for performing artificial intelligence (ai) encoding and ai decoding on image
US11810332B2 (en) 2019-10-28 2023-11-07 Samsung Electronics Co., Ltd. Apparatus and method for performing artificial intelligence (AI) encoding and AI decoding on image
EP4014173A4 (en) * 2019-10-28 2022-09-28 Samsung Electronics Co., Ltd. Apparatus and method for performing artificial intelligence (ai) encoding and ai decoding on image
CN114631315B (en) * 2019-10-29 2025-04-18 三星电子株式会社 Image encoding method and device, and image decoding method and device
WO2021086032A1 (en) 2019-10-29 2021-05-06 Samsung Electronics Co., Ltd. Image encoding method and apparatus and image decoding method and apparatus
US12132931B2 (en) 2019-10-29 2024-10-29 Samsung Electronics Co., Ltd. Image encoding method and apparatus and image decoding method and apparatus using deep neural networks
CN114631315A (en) * 2019-10-29 2022-06-14 三星电子株式会社 Image encoding method and apparatus and image decoding method and apparatus
EP4011074A4 (en) * 2019-10-29 2022-09-28 Samsung Electronics Co., Ltd. Image encoding method and apparatus and image decoding method and apparatus
CN110971784B (en) * 2019-11-14 2022-03-25 北京达佳互联信息技术有限公司 Video processing method and device, electronic equipment and storage medium
CN110971784A (en) * 2019-11-14 2020-04-07 北京达佳互联信息技术有限公司 Video processing method and device, electronic equipment and storage medium
CN111064958A (en) * 2019-12-28 2020-04-24 复旦大学 A Low-Complexity Neural Network Filtering Algorithm for B-Frame and P-Frame
CN116648716A (en) * 2020-12-24 2023-08-25 华为技术有限公司 Decoding by indicating feature map data
CN116648716B (en) * 2020-12-24 2025-05-02 华为技术有限公司 Decoding by indicating feature map data
WO2023010981A1 (en) * 2021-07-31 2023-02-09 华为技术有限公司 Encoding and decoding methods and apparatus
CN114050987B (en) * 2021-11-03 2023-08-22 猫岐智能科技(上海)有限公司 Non-contact debugging system and method for Internet of things equipment
CN114050987A (en) * 2021-11-03 2022-02-15 猫岐智能科技(上海)有限公司 Contactless debugging system and method for Internet of things equipment
WO2024061136A1 (en) * 2022-09-19 2024-03-28 Douyin Vision Co., Ltd. Method, apparatus, and medium for video processing
WO2024174071A1 (en) * 2023-02-20 2024-08-29 Rwth Aachen University Video coding using signal enhancement filtering

Also Published As

Publication number Publication date
CN110300301B (en) 2023-01-13

Similar Documents

Publication Publication Date Title
CN110300301B (en) Image coding and decoding method and device
JP7461974B2 (en) Chroma prediction method and device
CN113766249B (en) Loop filtering method, device, equipment and storage medium in video coding and decoding
CN111491168A (en) Video coding and decoding method, decoder, encoder and related equipment
WO2018001208A1 (en) Encoding and decoding method and device
TW201415897A (en) Decoder and method
CN109905714B (en) Inter-frame prediction method and device and terminal equipment
CN107431805A (en) Coding method and device and coding/decoding method and device
CN111800629A (en) Video decoding method, encoding method, and video decoder and encoder
CN113574887A (en) Deep neural network compression based on low displacement rank
JP2024507791A (en) Method and apparatus for encoding/decoding video
CN109756737B (en) Image prediction method and device
CN112911311B (en) Encoding method, encoding device, storage medium, and electronic apparatus
US20240195959A1 (en) Subblock-based adaptive interpolation filter in digital video coding
EP4539457A1 (en) Subblock-based adaptive interpolation filter in digital video coding
EP4542987A1 (en) Separable motion vector predictor components in video encoding
RU2787217C1 (en) Method and device for interpolation filtration for encoding with prediction
WO2024163488A1 (en) A method and an apparatus for encoding/decoding at least one part of an image using one or more multi-resolution transform blocks
WO2023246655A1 (en) Image encoding method and apparatus, and image decoding method and apparatus
CN117280683A (en) Method and apparatus for encoding/decoding video
WO2025114337A1 (en) Downscaling ratio prediction for reference picture resampling
CN119999196A (en) Method or apparatus for rescaling a tensor of feature data using an interpolation filter
CN118318439A (en) Video encoding and decoding method, device, system, and storage medium
CN117813817A (en) Method and apparatus for encoding/decoding video
CN120323017A (en) AI-based video conferencing with adaptive quality control using robust face restoration

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant