WO2019174389A1 - 一种图像块的帧内预测方法及装置 - Google Patents

一种图像块的帧内预测方法及装置 Download PDF

Info

Publication number
WO2019174389A1
WO2019174389A1 PCT/CN2019/071209 CN2019071209W WO2019174389A1 WO 2019174389 A1 WO2019174389 A1 WO 2019174389A1 CN 2019071209 W CN2019071209 W CN 2019071209W WO 2019174389 A1 WO2019174389 A1 WO 2019174389A1
Authority
WO
WIPO (PCT)
Prior art keywords
mode
current block
lma
lml
value
Prior art date
Application number
PCT/CN2019/071209
Other languages
English (en)
French (fr)
Inventor
马祥
杨海涛
陈建乐
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2019174389A1 publication Critical patent/WO2019174389A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods 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 a colour or a chrominance component

Definitions

  • the present application relates to the field of image processing technologies, and in particular, to an intra prediction method and apparatus for an image block.
  • Intra-prediction techniques are employed in existing video image coding and decoding techniques. Intra prediction refers to predicting the current block using reference pixels in the reconstructed block within the image in which the current block is located. The pixels of the neighboring blocks that have been reconstructed around the current block are generally used to obtain the predicted values of the pixels within the current block.
  • a multi-direction linear model (MDLM) mode is added when intra prediction is performed on chrominance components of an image.
  • the MDLM mode differs from the linear model (LM) in that the LM mode is based on the correlation model to calculate the predicted value of the chrominance component from the reconstructed value of the luminance component of the current block, and the parameters of the correlation model are based on the upper side of the current block. Calculated with the reference pixel on the left.
  • the MDLM mode may be a linear model with above template (LMA) mode or a linear model with left template (LML) mode.
  • the parameters of the correlation model corresponding to the LMA mode are calculated based only on the upper reference pixel of the current block, and the parameters of the correlation model corresponding to the LMA mode are calculated based only on the left reference pixel of the current block.
  • the LMA mode and the LML mode have been added to the list of chroma prediction modes.
  • the chroma mode list length is lengthened, and the codec bit length corresponding to some other prediction modes in the chroma prediction mode list is lengthened, and the codec is added. Overhead.
  • the present application provides an intra prediction method and apparatus for image blocks, which are used to solve the problem of large coding and decoding overhead.
  • an embodiment of the present application provides an intra prediction method for an image block, including:
  • the MDLM includes an upper template linear model LMA mode and a left template linear model LML mode; determining a prediction mode adopted by the chroma component of the current block according to a pre-configuration policy Is an LMA mode or an LML mode, wherein the LMA mode is a mode of calculating a chrominance component prediction value of the current block based on an upper reference pixel of the current block, the LML mode being based on a left of the current block And calculating, by the side reference pixel, a mode of the chrominance component prediction value of the current block; and obtaining a chrominance component prediction value of the current block according to the determined prediction mode adopted by the chrominance component of the current block.
  • a pre-configuration policy Is an LMA mode or an LML mode
  • the LMA mode is a mode of calculating a chrominance component prediction value of the current block based on an upper reference pixel of the current block, the LML mode being based on a left of the current block
  • determining, according to the pre-configuration policy, that the prediction mode adopted by the chroma component of the current block is the LMA mode or the LML mode may be implemented in any of the following manners:
  • the mode is the LMA mode or the LML mode; or,
  • a prediction mode adopted by the chroma component of the current block as the LMA mode or the LML mode.
  • the prediction mode adopted by the luminance component of the current block is used as a reference, and the prediction mode adopted by the chrominance component of the current block is determined to be the LMA mode or the LML mode, which may be as follows Way to achieve:
  • determining that the first parameter value is located in the first range determining that the prediction mode adopted by the chroma component of the current block is an LMA mode
  • the pre-configuration mode is an LMA mode or an LML mode
  • the first range [VER-A, VER+B], VER represents the second parameter value corresponding to the vertical mode, and A and B are positive integers;
  • the second range [HOR-C, HOR+D], HOR Indicates the third parameter value corresponding to the horizontal mode, and C and D are both positive integers.
  • the encoding mode corresponding to the luma component of the current block has been determined.
  • the prediction mode of the luminance component adopts the direction prediction mode and the direction is the vertical direction
  • the prediction mode of the chrominance component is more inclined to the vertical mode, that is, the LMA mode of the upper template is more inclined. Therefore, the prediction mode of the chrominance component is determined by the prediction mode of the luminance component, and the LML mode and the LML mode can be effectively encoded without adding the LMA mode and the LML mode to the chrominance prediction mode list, thereby avoiding an increase in coding.
  • the bit length reduces the coding overhead.
  • determining the current by using an average gradient value of a luminance component of a left reference pixel of the current block and an average gradient value of a luminance component of an upper reference pixel of the current block.
  • the prediction mode adopted by the chrominance component of the block is the LMA mode or the LML mode, which can be implemented as follows:
  • the prediction mode adopted by the chroma component of the current block is The LML mode
  • the prediction mode adopted by the chroma component of the current block is A pre-configuration mode, the pre-configuration mode being the LMA mode or the LML mode.
  • a way of selecting the LML mode or selecting the LMA mode is provided, which is specifically determined by comparing the average gradient values of the left template and the upper template, and does not need to add the LMA mode and the LML mode in the chroma prediction mode list. Therefore, the LML mode and the LML mode can be effectively coded, which avoids increasing the coding bit length and reduces the coding overhead.
  • the prediction mode adopted by the chrominance component of the current block is determined by using the width value and the height value of the current block as the LMA mode or the LML mode.
  • determining a prediction mode adopted by the chroma component of the current block is a pre-configuration mode, and the pre-configuration mode is the LMA mode or the LML mode.
  • the height of the divided image block is greater than the width. Therefore, most of the images are also divided into image blocks whose height is greater than the width. Therefore, in the above design, when the height value of the current block is greater than the width value, the LMA mode of the upper template is determined to ensure the coding accuracy. Therefore, it is not necessary to add the LMA mode and the LML mode in the chroma prediction mode list, thereby avoiding an increase in the coding length and reducing the coding overhead.
  • an embodiment of the present application provides an intra prediction method for an image block, including:
  • Determining an index value of a prediction mode of a chroma component of the current block determining an order of the LMA mode and the LML mode in the chroma prediction mode list according to a pre-configuration policy; the LMA mode is calculated based on an upper reference pixel of the current block a mode of a chrominance component prediction value of the current block, the LML mode being a mode of calculating a chrominance component prediction value of the current block based on a left reference pixel of the current block; Determining a prediction mode adopted by the chroma component of the current block in determining the LMA mode and the LML mode of the sequence; obtaining a chroma component of the current block according to the determined prediction mode adopted by the chroma component of the current block Predictive value.
  • the order of the LMA mode and the LML mode in the chroma prediction mode list is adaptively adjusted, and the coding bit length corresponding to the mode with higher selection probability is shorter, thereby improving the coding efficiency of LMA and LML.
  • determining the order of the LMA mode and the LML mode in the chroma prediction mode list according to a pre-configuration policy includes:
  • the LMA mode and the LML mode are in color with reference to an average gradient value of a luminance component of a left reference pixel of the current block and an average gradient value of a luminance component of an upper reference pixel of the current block.
  • the order in the prediction mode list or,
  • the order of the LMA mode and the LML mode in the chroma prediction mode list is determined with reference to the width value and the height value of the current block.
  • determining the order of the LMA mode and the LML mode in the chroma prediction mode list, with reference to a prediction mode adopted by a luminance component of the current block includes:
  • the order of the LMA mode and the LML mode in the chroma prediction mode list is a first sequence when the first parameter value is determined to be within the first range, the first sequence characterizing the LMA mode
  • the corresponding index value in the chroma prediction mode list is smaller than the index value of the LML mode
  • the second sequence characterizing the LMA mode The corresponding index value in the chromaticity prediction mode list is greater than the index value corresponding to the LML mode;
  • the order is a pre-configuration sequence, and the pre-configuration sequence is the first sequence or the second sequence;
  • the first range [VER-A, VER+B], VER represents the second parameter value corresponding to the vertical mode, and A and B are positive integers;
  • the second range [HOR-C, HOR+D], HOR Indicates the third parameter value corresponding to the horizontal mode, and C and D are both positive integers.
  • the encoding mode corresponding to the luma component of the current block has been determined.
  • the prediction mode of the luminance component adopts the direction prediction mode and the direction is the vertical direction
  • the prediction mode of the chrominance component is more inclined to the vertical mode, that is, the LMA mode of the upper template is more inclined. Therefore, the order of the LML mode and the LMA mode is determined by the prediction mode of the luminance component, and the coding bit length corresponding to the prediction mode with a larger probability of selection is shorter, which reduces the coding bit length to a certain extent and reduces the coding overhead.
  • determining the LMA with reference to an average gradient value of a luminance component of a left reference pixel of the current block and an average gradient value of a luminance component of an upper reference pixel of the current block can be implemented as follows:
  • the order in the mode list is a first sequence, the first sequence characterizing that the index value corresponding to the LMA mode in the chroma prediction mode list is smaller than an index value of the LML mode; or
  • the LMA mode and the LML mode are in a chroma prediction mode when a gradient value of a luminance component of an upper reference pixel of the current block is smaller than an average gradient value of a luminance component of a left reference pixel of the current block
  • the order in the list is a second sequence, and the second sequence indicates that the index value corresponding to the LMA mode in the chromaticity prediction mode list is greater than the index value corresponding to the LML mode;
  • the order in the mode list is a pre-configuration sequence, which is the first order or the second order.
  • a method for determining the LML mode and the LMA mode is provided, which is specifically determined by comparing the average gradient values of the left template and the upper template, and does not need to add the LMA mode and the LML mode in the chroma prediction mode list.
  • the LML mode and the LML mode can be effectively coded, which avoids increasing the coding bit length and reduces the coding overhead.
  • determining the order of the LMA mode and the LML mode in the chroma prediction mode list, with reference to the width value and the height value of the current block includes:
  • the order of the LMA mode and the LML mode in the chroma prediction mode list is a second sequence when the width value of the current block is greater than a height value, the second sequence characterizing the LMA mode in the The corresponding index value in the chroma prediction mode list is greater than the index value corresponding to the LML mode; or
  • the height of the divided image block is greater than the width. Therefore, most of the images are also divided into image blocks whose height is greater than the width. Therefore, in the above design, when the height value of the current block is greater than the width value, it is determined that the index value of the LMA mode using the upper template is smaller than the index value of the LML mode using the left template, which reduces the coding length to a certain extent, and reduces Encoding overhead.
  • an embodiment of the present application provides an intra prediction device for an image block, where the device may be an encoder or a decoder, or a chip, or a processor, or configured in an encoder or a decoder. Intra prediction module, etc.
  • the device has the function of implementing the various designs of the first aspect described above. This function can be implemented in hardware or in hardware by executing the corresponding software.
  • the hardware or software includes one or more units corresponding to the functions described above.
  • the apparatus can include:
  • a determining unit configured to determine that a prediction mode adopted by a chroma component of the current block is a multi-directional linear model MDLM mode, where the MDLM includes an upper template linear model LMA mode and a left template linear model LML mode;
  • a selecting unit configured to determine, according to a pre-configuration policy, a prediction mode adopted by a chroma component of the current block as an LMA mode or an LML mode, where the LMA mode is to calculate the current based on an upper reference pixel of the current block a mode of a chrominance component prediction value of a block, the LML mode being a mode of calculating a chrominance component prediction value of the current block based on a left reference pixel of the current block;
  • a calculating unit configured to obtain a chrominance component prediction value of the current block according to the determined prediction mode adopted by the chrominance component of the current block.
  • the selection unit is specifically configured to:
  • a prediction mode adopted by the chroma component of the current block as the LMA mode or the LML mode.
  • the selection unit is specifically configured to:
  • determining that the first parameter value is located in the first range determining that the prediction mode adopted by the chroma component of the current block is an LMA mode
  • the pre-configuration mode is an LMA mode or an LML mode
  • the first range [VER-A, VER+B], VER represents the second parameter value corresponding to the vertical mode, and A and B are positive integers;
  • the second range [HOR-C, HOR+D], HOR Indicates the third parameter value corresponding to the horizontal mode, and C and D are both positive integers.
  • the selection unit is specifically configured to:
  • the prediction mode adopted by the chroma component of the current block is The LML mode
  • the prediction mode adopted by the chroma component of the current block is The LMA mode
  • the prediction mode adopted by the chroma component of the current block is A pre-configuration mode, the pre-configuration mode being the LMA mode or the LML mode.
  • the selection unit is specifically configured to:
  • determining a prediction mode adopted by the chroma component of the current block is a pre-configuration mode, and the pre-configuration mode is the LMA mode or the LML mode.
  • an embodiment of the present application provides an intra prediction device for an image block, where the device may be an encoder or a decoder, or a chip, or a processor, or configured in an encoder or a decoder. Intra prediction module, etc.
  • the device has the function of implementing the various designs of the first aspect described above. This function can be implemented in hardware or in hardware by executing the corresponding software.
  • the hardware or software includes one or more units corresponding to the functions described above.
  • the device comprises:
  • a determining unit configured to determine that an index value of a prediction mode of the current block satisfies a preset condition; and configured to determine an order of the LMA mode and the LML mode in the chroma prediction mode list according to the pre-configuration policy, where the LMA mode is based on the current Calculating a mode of a chroma component prediction value of the current block, the LML mode being a mode of calculating a chroma component prediction value of the current block based on a left reference pixel of the current block; Determining, by the index value from the LMA mode and the LML mode of the determining order, a prediction mode adopted by a chroma component of the current block;
  • a calculating unit configured to obtain, according to the determined prediction mode adopted by the chroma component of the current block, a predicted value of a chroma component of the current block.
  • the determining unit is specifically configured to:
  • the order of the LMA mode and the LML mode in the chroma prediction mode list is determined with reference to the width value and the height value of the current block.
  • the determining unit is specifically configured to:
  • the order of the LMA mode and the LML mode in the chroma prediction mode list is a first sequence when the first parameter value is determined to be within the first range, the first sequence characterizing the LMA mode
  • the corresponding index value in the chroma prediction mode list is smaller than the index value of the LML mode
  • the second sequence characterizing the LMA mode The corresponding index value in the chromaticity prediction mode list is greater than the index value corresponding to the LML mode;
  • the order in is a pre-configuration sequence, the pre-configuration sequence being the first order or the second order;
  • the first range [VER-A, VER+B], VER represents the second parameter value corresponding to the vertical mode, and A and B are positive integers;
  • the second range [HOR-C, HOR+D], HOR Indicates the third parameter value corresponding to the horizontal mode, and C and D are both positive integers.
  • the determining unit is specifically configured to:
  • the order in the degree prediction mode list is a first sequence, and the first sequence characterizes that the corresponding index value of the LMA mode in the chroma prediction mode list is smaller than an index value of the LML mode; or
  • the order of the degree prediction mode list is a second sequence, and the second sequence characterizes that the index value corresponding to the LMA mode in the chromaticity prediction mode list is greater than the index value corresponding to the LML mode; or
  • the order in the mode list is a pre-configuration sequence, which is the first order or the second order.
  • the determining unit is specifically configured to:
  • the order of the LMA mode and the LML mode in the chroma prediction mode list is a first sequence when the width value of the current block is less than a height value, the first sequence characterizing the LMA mode The corresponding index value in the chroma prediction mode list is smaller than the index value of the LML mode; or
  • the width value of the current block is greater than a height value, determining that the order of the LMA mode and the LML mode in the chroma prediction mode list is a second sequence, the second sequence characterizing the LMA mode The corresponding index value in the chromaticity prediction mode list is greater than the index value corresponding to the LML mode; or
  • the width value of the current block is equal to the height value, determining that the order of the LMA mode and the LML mode in the chroma prediction mode list is a pre-configuration sequence, and the pre-configuration sequence is the first sequence Or for the second order.
  • an embodiment of the present application provides an apparatus, where the apparatus may be an encoder, including: a processor and a memory; the memory is configured to store an instruction, when the apparatus is running, the processor executes the instruction stored by the memory To cause the apparatus to perform the method provided by any of the above first aspect or the first aspect.
  • the memory may be integrated in the processor or may be independent of the processor.
  • an embodiment of the present application provides an apparatus, where the apparatus may be a decoder, including: a processor and a memory; the memory is configured to store an instruction, when the apparatus is running, the processor executes the instruction stored by the memory To cause the apparatus to perform the method provided by either of the second aspect or the second aspect.
  • the memory may be integrated in the processor or may be independent of the processor.
  • the embodiment of the present application further provides a readable storage medium, where the readable storage medium stores a program or an instruction, and when it runs on a computer, causes any one of the methods described above to be executed. .
  • the embodiment of the present application further provides a computer program product comprising instructions, when executed on a computer, causing the computer to perform any of the methods described in the above aspects.
  • the present application provides a chip coupled to a memory for reading and executing a software program stored in the memory to implement the method of any of any of the aspects.
  • FIG. 1 is a schematic structural diagram of a video codec system according to an embodiment of the present application
  • FIG. 2A is a schematic structural diagram of a video encoder according to an embodiment of the present application.
  • 2B is a schematic structural diagram of a video decoder according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of sampling points provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a reference pixel provided by an embodiment of the present application.
  • 5A to 5C are schematic diagrams of a YUV format provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of an intra prediction mode according to an embodiment of the present application.
  • FIGS. 7A to 7C are schematic diagrams of an LM mode according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of an upper template and a left template according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of an enlarged upper template and a left template according to an embodiment of the present application.
  • FIG. 10 is a flowchart of an intra prediction method according to an embodiment of the present application.
  • FIG. 11A is a schematic flowchart of an intra prediction method for an image block according to Embodiment 1 of the present application.
  • FIG. 11B is a schematic vertical view of a PML according to Embodiment 1 of the present application.
  • FIG. 12 is a schematic flowchart of an intra prediction method according to Embodiment 2 of the present application.
  • FIG. 13 is a schematic flowchart of an intra prediction method according to Embodiment 3 of the present application.
  • FIG. 14 is a schematic flowchart of another method for intra prediction of an image block according to an embodiment of the present disclosure.
  • FIG. 16 is a schematic flowchart of an intra prediction method according to Embodiment 5 of the present application.
  • FIG. 17 is a schematic flowchart of an intra prediction method according to Embodiment 6 of the present application.
  • FIG. 18 is a schematic diagram of a device 1800 according to an embodiment of the present application.
  • FIG. 19 is a schematic diagram of a device 1900 according to an embodiment of the present application.
  • FIG. 20 is a schematic diagram of an apparatus 2000 according to an embodiment of the present application.
  • FIG. 21 is a schematic diagram of a device 2100 according to an embodiment of the present application.
  • FIG. 1 is a schematic block diagram of a video encoding and decoding system 10 in an embodiment of the present application.
  • the system 10 includes a source device 11 that generates encoded video data and transmits it to a destination device 12, and a destination device 12 for receiving encoded video data and decoding and displaying the encoded video data. .
  • Source device 11 and destination device 12 may comprise any of a wide range of devices, including desktop computers, notebook computers, tablet computers, set top boxes, telephone handsets such as so-called “smart” phones, so-called “smart” Touchpads, televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, and the like.
  • Link 16 may include any type of media or device capable of communicating encoded video data from source device 11 to destination device 12.
  • link 16 may include a communication medium that enables source device 11 to transmit encoded video data directly to destination device 12 in real time.
  • the encoded video data can be modulated and transmitted to the destination device 12 in accordance with a communication standard (e.g., a wireless communication protocol).
  • Communication media can include any wireless or wired communication medium, such as a radio frequency spectrum or one or more physical transmission lines.
  • the communication medium can form part of a packet-based network (eg, a global network of local area networks, wide area networks, or the Internet).
  • the communication medium can include a router, a switch, a base station, or any other device that can be used to facilitate communication from the source device 11 to the destination device 12.
  • system 10 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.
  • source device 11 may include video source 13, video encoder 20, and output interface 14.
  • output interface 14 may include a modulator/demodulator (modem) and/or a transmitter.
  • video source 13 may include various source devices such as video capture devices (eg, video cameras), archives containing previously captured video, video feed interfaces to receive video from video content providers. And/or a computer graphics system for generating computer graphics data as source video, or a combination of these sources.
  • video capture devices eg, video cameras
  • archives containing previously captured video containing previously captured video
  • video feed interfaces to receive video from video content providers.
  • a computer graphics system for generating computer graphics data as source video, or a combination of these sources.
  • the source device 11 and the destination device 12 may form a so-called camera phone or video phone.
  • the techniques described in this application are illustratively applicable to video decoding and are applicable to wireless and/or wired applications.
  • the captured, pre-captured or calculated video can be encoded by video encoder 20.
  • the encoded video data can be transmitted directly to the destination device 12 via the output interface 14 of the source device 11.
  • the encoded video data may also (or alternatively) be stored on a storage device for later access by the destination device 12 or other device for decoding and/or playback.
  • the destination device 12 includes an input interface 15, a video decoder 30, and a display device 17.
  • input interface 15 can include a receiver and/or a modem.
  • the input interface 15 of the destination device 12 receives the encoded video data via the link 16.
  • the encoded video data communicated or provided on the storage device via link 16 may include various syntax elements generated by video encoder 20 for use by the video decoder of video decoder 30 to decode the video data. These syntax elements can be included with encoded video data that is transmitted over a communication medium, stored on a storage medium, or stored on a file server.
  • the display device 17 can be integrated with or external to the destination device 12.
  • the destination device 12 can include an integrated display device and is also configured to interface with an external display device.
  • the destination device 12 can be a display device.
  • display device 17 displays decoded video data to a user and may include any of a variety of display devices, such as a liquid crystal display, a plasma display, an organic light emitting diode display, or another type of display device.
  • Video encoder 20 and video decoder 30 may operate in accordance with, for example, the next generation video codec compression standard (H.266) currently under development and may conform to the H.266 Test Model (JEM).
  • video encoder 20 and video decoder 30 may be according to, for example, the ITU-TH.265 standard, also referred to as a high efficiency video decoding standard, or other proprietary or industry standard of the ITU-TH.264 standard or an extension of these standards.
  • the ITU-TH.264 standard is alternatively referred to as MPEG-4 Part 10, also known as advanced video coding (AVC).
  • AVC advanced video coding
  • the techniques of this application are not limited to any particular decoding standard.
  • Other possible implementations of the video compression standard include MPEG-2 and ITU-TH.263.
  • Video encoder 20 and video decoder 30 in system 10 are for predicting pixel values of image blocks in accordance with intra-prediction method embodiments of various image blocks as set forth herein.
  • Video encoder 20 and video decoder 30 may each be implemented as any of a variety of suitable encoder circuits, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), Programmable Gate Array (FPGA), discrete logic, software, hardware, firmware, or any combination thereof.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGA Programmable Gate Array
  • the apparatus may store the instructions of the software in a suitable non-transitory computer readable medium and execute the instructions in hardware using one or more processors to perform the techniques of the present application.
  • Each of video encoder 20 and video decoder 30 may be included in one or more encoders or decoders, any of which may be integrated into a combined encoder/decoder (CODEC) in a respective
  • FIG. 2A is a schematic block diagram of a video encoder 20 in the embodiment of the present application.
  • video encoder 20 may include a prediction module 21, a summer 22, a transform module 23, a quantization module 24, and an entropy encoding module 25.
  • the prediction module 21 may include an inter prediction module 211 and an intra prediction module 212.
  • the internal structure of the prediction module 21 is not limited in this embodiment of the present application.
  • video encoder 20 may also include inverse quantization module 26, inverse transform module 27, and summer 28.
  • video encoder 20 may also include a memory module 29, it being understood that memory module 29 may also be disposed external to video encoder 20.
  • video encoder 20 may also include a filter (not illustrated in FIG. 2A) to filter the boundaries of the image block to remove artifacts from the reconstructed video image.
  • the filter filters the output of summer 28 as needed.
  • video encoder 20 may also include a splitting unit (not illustrated in Figure 2A).
  • the video encoder 20 receives the video data, and the dividing unit divides the video data into image blocks. This segmentation may also include segmentation into strips, image blocks, or other larger units. In general, a strip can be divided into multiple image blocks.
  • the prediction module 21 is configured to perform intra or inter prediction on the current coded image block (referred to as the current block for short) to obtain a predicted value of the current block.
  • the inter prediction module 211 included in the prediction module 21 performs inter prediction on the current block to obtain an inter prediction value.
  • the intra prediction module 212 performs intra prediction on the current block to obtain an intra prediction value.
  • the inter prediction module 211 needs to determine a plurality of reference blocks in the reference picture for the current block, and which one or which reference blocks are ultimately used for prediction, or rate-distortion optimization (RDO) or other methods.
  • RDO rate-distortion optimization
  • the video encoder 20 forms the residual information by subtracting the predicted value from the current block.
  • the transform module 23 is configured to transform the residual information. Transform module 23 transforms the residual information into residual transform coefficients using, for example, a discrete cosine transform (DCT) or a conceptually similar transform (eg, a discrete sinusoidal transform DST). Transform module 23 may send the resulting residual transform coefficients to quantization module 24. Quantization module 24 quantizes the residual transform coefficients to further reduce the code rate. In some possible implementations, quantization module 24 may then perform a scan of the matrix comprising the quantized transform coefficients. Alternatively, entropy encoding module 25 may perform a scan.
  • DCT discrete cosine transform
  • DST conceptually similar transform
  • entropy encoding module 25 may entropy encode the quantized residual transform coefficients to obtain a code stream.
  • entropy encoding module 25 may perform context adaptive variable length decoding (CAVLC), context adaptive binary arithmetic decoding (CABAC), syntax based context adaptive binary arithmetic decoding (SBAC), probability interval partition entropy (PIPE) decoding or another entropy coding method or technique.
  • CAVLC context adaptive variable length decoding
  • CABAC context adaptive binary arithmetic decoding
  • SBAC syntax based context adaptive binary arithmetic decoding
  • PIPE probability interval partition entropy coding
  • the inverse quantization module 26 and the inverse transform module 27 apply inverse quantization and inverse transform, respectively, to reconstruct the residual block in the pixel domain for later use as a reference block for the reference image.
  • the summer 28 adds the reconstructed residual information to the predicted values generated by the prediction module 21 to produce a reconstructed block, and uses the reconstructed block as a reference block for storage in the storage module 29.
  • These reference blocks may be used by the prediction module 21 as reference blocks to predict blocks in subsequent video frames or images either interframe or intra.
  • video encoder 20 may directly quantize the residual information without the need for processing by transform module 23, and accordingly need not be processed by inverse transform module 27; or, for some image blocks Or the image frame, the video encoder 20 does not generate residual information, and accordingly does not need to be processed by the transform module 23, the quantization module 24, the inverse quantization module 26, and the inverse transform module 27; or, the video encoder 20 can reconstruct the reconstructed image.
  • the block is stored directly as a reference block without being processed by the filter unit; alternatively, the quantization module 24 and the inverse quantization module 26 in the video encoder 20 may be merged together; or the transform module 23 and the inverse transform in the video encoder 20 Modules 27 can be merged together; alternatively, summer 22 and summer 28 can be combined.
  • FIG. 2B is a schematic block diagram of a video decoder 30 in the embodiment of the present application.
  • video decoder 30 may include an entropy decoding module 31, a prediction module 32, an inverse quantization module 34, an inverse transform module 35, and a reconstruction module 36.
  • the prediction module 32 may include an inter prediction module 322 and an intra prediction module 321 , which are not limited in this embodiment of the present application.
  • video decoder 30 may also include a storage module 33. It should be understood that the storage module 33 can also be disposed outside of the video decoder 30. In some possible implementations, video decoder 30 may perform an exemplary reciprocal decoding process with respect to the encoding flow described by video encoder 20 from FIG. 2A.
  • Video decoder 30 receives the code stream from video encoder 20 during the decoding process.
  • the code stream received by the video decoder 30 is continuously subjected to entropy decoding, inverse quantization, and inverse transform by the entropy decoding module 31, the inverse quantization module 34, and the inverse transform module 35, respectively, to obtain residual information.
  • Whether intra prediction or inter prediction for the current block is used is determined according to the code stream.
  • the intra prediction module 321 in the prediction module 32 constructs the prediction information according to the used intra prediction method using the pixel values of the reference pixels of the reconstructed block around the current block.
  • the motion information needs to be parsed, and the reference block is determined in the reconstructed image block using the parsed motion information, and the pixel value of the pixel in the reference block is used as prediction information (this process is called Motion compensation (MC)).
  • the reconstruction module 36 can use the prediction information plus the residual information to obtain the reconstruction information.
  • image block refers to a two-dimensional sampling point array, which can be a square array or a rectangular array.
  • a 4x4 image block can be regarded as a square sampling point array composed of 4 ⁇ 4 total 16 sampling points. 3 is shown.
  • the signal within the image block refers to the sampled value of the sample point within the image block.
  • the sampling points may also be referred to as pixels or pixels, and will be used indiscriminately in this application.
  • the value of the sample point can also be referred to as a pixel value, which will be used without distinction in this application.
  • the image can also be represented as a two-dimensional array of sample points, labeled in a similar way to the image block.
  • the current block refers to the block currently being processed. For example, in encoding, it refers to the one currently being encoded; in decoding, it refers to the block currently being decoded.
  • Reference block refers to a block that provides a reference signal for the current block.
  • the reference pixel refers to a pixel in the reference block that provides a reference signal for the current block, as shown in FIG.
  • the image signal typically includes one luminance component and two chrominance components.
  • Luminance components are typically represented by the symbol Y, which is typically represented by the symbols U, V.
  • YUV4:4:4, YUV4:2:2, and YUV4:2:0 According to the sampling method of the luminance component and the chrominance component in the image signal, there are generally YUV4:4:4, YUV4:2:2, and YUV4:2:0.
  • the commonly used YUV format includes the following format:
  • the cross indicates the luminance component sampling point
  • the circle indicates the sampling point per chrominance component:
  • the 4:4:4 format indicates that the chroma component has no downsampling
  • the 4:2:2 format indicates that the chroma component is downsampled horizontally with respect to the luminance component by 2:1, but vertical downsampling is not performed. For every two U or V samples, each row contains four Y samples;
  • the 4:2:0 format indicates that the chroma component is horizontally downsampled with respect to the luminance component by 2:1, and the vertical downsampling of 2:1.
  • the chrominance component of the image block is an image block of NxN size.
  • the chrominance component of the image block is referred to as a chrominance block.
  • the embodiment of the present application will explain the technical solution of the present application by taking the 4:2:0 format as an example. However, it can be understood that the technical solution of the present application can be used for other formats of YUV, or mutual prediction between different components in other video image formats, such as RGB format, in addition to the YUV 4:2:0 format.
  • the current block may be a square block, or a non-square rectangular block or other shape area. The technical solutions provided by the embodiments of the present application are also applicable.
  • Intra prediction refers to using the reference pixels in the reconstructed block in the image of the current block to predict the current block.
  • the boundary pixels of the neighboring blocks that have been reconstructed around the current block are generally used to obtain the predicted values of the pixels within the current block.
  • Intra prediction generally maps reference pixels to respective pixel positions in the current block in a certain direction to obtain predicted values of pixels at corresponding positions.
  • intra prediction generally has multiple mapping directions or mapping modes.
  • the mapping direction or mapping mode is an intra prediction mode.
  • intra prediction modes for luminance components as shown in FIG. 6, including 33 directional prediction modes (2 to 34 in FIG. 6) and DC prediction mode (represented by 1 in FIG. 6). ), and the Planar prediction mode (indicated by 0 in Figure 6).
  • the direction prediction mode refers to mapping a reference pixel to a pixel position in a current block in a certain direction (using an intra mode index mark) to obtain a predicted value of the current pixel point, or for each pixel in the current block. Point, its position is reversely mapped to the reference pixel in a certain direction (using the intra mode index mark), and the pixel value of the corresponding reference pixel is the predicted value of the current pixel.
  • the DC prediction mode uses the average value of the reference pixels as the predicted value of the pixels in the current block
  • the Planar mode uses the pixel values of the reference pixels on the upper and the right side of the current pixel and the current block.
  • the pixel values of the right upper and lower left reference pixels are used to calculate the predicted value of the current pixel.
  • the intra prediction of the chroma component is also using the boundary pixel of the adjacent reconstructed block around the current chroma block as the reference pixel of the current block, and mapping the reference pixel into the current chroma block according to a certain prediction mode.
  • the pixel is used as the predicted value of the pixel in the current chroma block.
  • the intra prediction mode of the chroma component includes only five types, namely, Planar mode, vertical mode, horizontal mode, DC mode, and derived mode.
  • DM mode predicting using a prediction mode of a current block luminance component as a prediction mode of a current block chrominance component
  • the predicted value of the chrominance component of the pixel is calculated from the reconstructed value of the luminance component of the pixel, and the parameters of the correlation model are the luminance component and the chrominance component of the reference pixel on the upper side and the left side of the current block.
  • the reconstructed value is calculated.
  • DC mode using the average value of the reconstructed values of the chroma components of the reference pixels on the upper side and the left side of the current block as the predicted values of the chroma components of the current block;
  • Planar mode calculating a predicted value of a chroma component of a current block based on assuming that the value of the chroma component of the current block changes linearly in a spatially smooth manner;
  • Horizontal (HOR) mode using the reconstructed value of the chroma component of the left reference pixel of the current block as the predicted value of the chroma component of all pixels in the same row of the current block;
  • VER Vertical
  • the reconstructed value of the chroma component of the upper reference pixel of the current block is used as the predicted value of the chroma component of all pixels in the same column of the current block.
  • the technical solution of the embodiment of the present application can be described by using L as the luminance component and C as the chrominance component.
  • the predicted value of the chrominance component of any pixel in the current block can be obtained by mapping the reconstructed value of the luminance component of the co-located pixel through a correlation function relationship f(x).
  • the luminance component may be first Resample to the position of the chroma component sample point, get L', and then predict, as in formula (1.1). At this time, each sampling point of the chrominance component has a luminance component value and a chrominance component value.
  • pred c (i, j) represents the chrominance component prediction value of the pixel at the (i, j) position.
  • Rec' L (i, j) represents the luminance component reconstruction value of the pixel corresponding to the (i, j) position after the current chroma block corresponds to the resolution of the reconstructed block after the reconstructed block of the luma block is downsampled to the chroma component.
  • the resolution of the luminance component is 4 times the resolution of the chroma component (twice the width and height), in order to obtain the luminance block with the same resolution as the chroma block.
  • the luminance component needs to be downsampled to the chroma component resolution according to the same down sampling method of the chroma component, and then used.
  • the correlation function mapping relationship f(x) is used to represent the correlation model from the luminance component to the chrominance component of one pixel, which may be a linear function or a quadratic polynomial.
  • the linear correlation model shown by the formula (1.2) will be taken as an example for description.
  • the prediction mode corresponding to the linear correlation model is a cross component prediction mode.
  • the CCP mode may also be referred to as a cross-comp. intra prediction (CCIP) mode, or a cross component linear model (CCLM), or simply a linear model (LM).
  • the parameters ⁇ and ⁇ of the linear correlation model can be calculated from the reconstructed values of a set of luminance component pixels and the reconstructed values of the chroma component pixels.
  • ⁇ , ⁇ are linear correlation model coefficients.
  • the linear correlation model coefficients do not require coded transmission, but use edge pixels (ie, reference pixels) of adjacent reconstructed blocks of the current chroma block and luminance component pixels of corresponding positions of the edge pixels (the same downsampling is also required) Operation), construct a set of linear equations, and obtain the linear correlation model coefficients ⁇ , ⁇ according to the least squares method.
  • rec L is a reconstructed luma block (the current chroma block corresponds to the luma block and adjacent reference pixels), rec′ L is the downsampled luma block, and rec′ C is the current chroma.
  • the size of the current chroma block is MxM, and the adjacent reconstructed pixels on the adjacent upper side and the left side are used as reference pixels, and the size of the corresponding luma block is 2Mx2M, and the reference pixels of the luma block and the luma block are performed.
  • Downsampling to chroma component resolution yields the pixel block shown in Figure 7B.
  • a linear system of equations is constructed using the reference pixels in Figures 7B and 7C.
  • the number of reference pixels is N
  • L(n) is the value of the luminance component of the nth pixel in the sampled pixel block of the reconstructed luminance block in FIG. 7B
  • C(n) is the reconstructed chroma block.
  • the selected reference pixels for calculating the parameters ⁇ and ⁇ may be referred to as templates in the embodiment of the present application.
  • the upper template and the left template are used simultaneously for the LM mode.
  • the upper template is the reference pixel on the upper side of the current block
  • the left template is the reference pixel on the left side of the current block.
  • the LM mode uses both the upper template and the left template, but if there are some pixels in the template, the linear correlation model relationship is different from the linear correlation model relationship of the pixels in the image block, for example, the left template and the current block belong to different objects, etc. Will affect the accuracy of the linear correlation model coefficients.
  • the multi-direction linear model (MDLM) mode can use only the upper template or only the left template for calculating the linear correlation model coefficients. .
  • a mode in which the linear correlation model coefficient calculation is performed using only the upper template is referred to as an LMA mode
  • a mode in which the linear correlation model coefficient calculation is performed using only the left template is an LML mode.
  • the LMA mode determines a linear correlation model by using reference pixels above the current block, and calculates a mode of the current block chroma component prediction value based on the determined correlation model and the luminance component reconstruction value of the current block.
  • the LML mode determines a linear correlation model using reference pixels on the left side of the current block, and calculates a mode of the current block chroma component prediction value based on the determined correlation model and the luminance component reconstruction value of the current block.
  • the size of the upper template and the left template generally expands and expands. See, for example, Figure 9.
  • the index values and binary bit representations of the various modes in the chroma prediction mode list before the MDLM mode are not used are as shown in Table 1.
  • the index values and binary bit representations of the various modes in the chroma prediction mode list are as shown in Table 2. Due to the addition of LML and LMA modes, the coding bit lengths of other modes are correspondingly longer, which increases the coding overhead.
  • the embodiment of the present invention provides an intra prediction method and device for an image block, which is used to solve the problem that the length of the existing coding bit is long and the coding overhead is large.
  • the LMA mode and the LML mode are replaced by the MDLM in the chroma prediction mode list by selecting the LMA mode or the LML mode, thereby avoiding increasing the coding bit length and reducing the coding overhead.
  • the embodiment of the present application determines the order of the LMA mode and the LML mode in the chroma prediction mode list, and the different order indicates that the LMA mode and the LML mode respectively have different coding bit lengths.
  • the method and the device are based on the same inventive concept. Since the principles of the method and the device for solving the problem are similar, the implementation of the device and the method can be referred to each other, and the repeated description is not repeated.
  • the LMA mode and the LML mode are replaced by the MDLM mode in the chroma prediction mode list.
  • the list of chroma prediction modes can be seen in Table 3.
  • an intra prediction method for an image block provided by an embodiment of the present application is shown.
  • the method may be performed by the video encoder 20, or by a processor provided inside the video encoder 20, or by the prediction module 21, or by a chip for performing an encoding function.
  • the method may also be performed by video decoder 30, or by a processor disposed within video decoder 30, or by prediction module 32, or by a chip for performing decoding functions.
  • S1001 Determine a prediction mode adopted by a chroma component of the current block as an MDLM mode, where the MDLM includes an upper template linear model LMA mode and a left template linear model LML mode.
  • the prediction mode of selecting the chroma component in the chroma prediction mode list by the existing provided prediction prediction mode is MDLM.
  • the index value of the current chroma component prediction mode is obtained by parsing the code stream, and the prediction mode of the current chroma block is determined from the chroma chroma prediction mode list according to the index value. For example, in Table 3, if the index value is 2, it can be determined that the prediction mode of the current chroma component is the MDLM mode.
  • the best mode is generally selected by traversing each possible prediction mode and then using rate-distortion optimazation (RDO) criteria. For example, from the preset chroma prediction mode, the optimal prediction mode is selected as the prediction mode adopted by the chroma component of the current block, and if the currently traversed mode is the MDLM mode, the prediction of the current chroma component may be determined.
  • the mode is MDLM mode.
  • the LMA mode is a mode for calculating a chrominance component prediction value of the current block based on an upper reference pixel of the current block, where the LML mode is to calculate the current based on a left reference pixel of the current block.
  • the mode of the chrominance component prediction of the block is a mode for calculating a chrominance component prediction value of the current block based on an upper reference pixel of the current block, where the LML mode is to calculate the current based on a left reference pixel of the current block.
  • the upper reference pixel of the current block may be the reference pixel adjacent to the upper side of the current block; the left reference pixel of the current block may be the reference pixel adjacent to the left side of the current block.
  • the LMA mode and the LML mode can be effectively encoded without adding the LMA mode and the LML mode to the chroma prediction mode list, thereby avoiding increasing the coding bit length and reducing the coding overhead.
  • step S1002 when the prediction mode adopted by the chrominance component of the current block is determined to be an LMA mode or an LML mode according to the pre-configuration policy, the LMA mode is selected according to the pre-configuration policy or LML is selected.
  • the mode can be divided into the following ways:
  • the first selection manner is: determining, by using a prediction mode adopted by the luminance component of the current block, a prediction mode adopted by the chrominance component of the current block as the LMA mode or the LML mode.
  • the second selection manner is: determining the current block by using an average gradient value of a luminance component of a left reference pixel of the current block and an average gradient value of a luminance component of an upper reference pixel of the current block.
  • the prediction mode adopted by the chroma component is the LMA mode or the LML mode.
  • the third selection manner is: determining, according to the width value and the height value of the current block, that the prediction mode adopted by the chroma component of the current block is the LMA mode or the LML mode.
  • Embodiment 1 as shown in FIG. 11A, the first selection manner will be described in detail.
  • S1101 Obtain a prediction mode adopted by a chroma component of the current block.
  • the code stream information may be parsed to obtain an index value of the coding mode of the chroma component of the current block, and the prediction mode of the chroma component coding of the current block is obtained by using the index value.
  • the binary code stream of the prediction mode encoded by the chrominance component of the current block is parsed to be 1110, then according to Table 3, the prediction mode of the current block chrominance component is Planar mode; if the prediction mode of the chrominance component of the current block is The binary code stream is 110, and according to Table 3, the prediction mode of the current block chrominance component is the MDLM mode.
  • the mode prediction mode can be predicted based on the chrominance, and the adopted prediction mode of the chrominance component of the current block is obtained by the RDO criterion.
  • S1102 Determine whether the prediction mode adopted by the chroma component of the current block is the MDLM mode. If yes, execute S1103. Otherwise, execute S1104.
  • S1103 Determine a prediction mode adopted by a chroma component of the current block according to a prediction mode adopted by a luminance component of the current block.
  • the encoding mode corresponding to the luma component of the current block has been determined.
  • a first parameter value PML corresponding to a prediction mode of a luminance component of the current block if the PML is vertical (see (a) of FIG. 11B), the prediction mode of the chroma component of the current block uses the LMA mode (see In (b) of FIG. 11B, if the PML is horizontal, the prediction mode of the chrominance component of the current block uses the LML mode.
  • the PML may be determined to be vertical or horizontal by setting a range of intervals.
  • the first range [VER-A, VER + B], VER represents the second parameter value corresponding to the vertical mode, A and B are positive integers;
  • the second range [HOR-C, HOR + D], HOR Indicates the third parameter value corresponding to the horizontal mode, and C and D are both positive integers.
  • the chrominance component of the current block uses the LMA mode; if the PML is in the second range, ie HOR-C ⁇ PML ⁇ HOR+D, then PML is horizontal, then the chrominance component of the current block uses LML mode.
  • A can be equal to B or not equal to B; C can be equal to D or not equal to D.
  • C can be equal to D or not equal to D.
  • VER corresponds to 26
  • the PML does not belong to the above two ranges.
  • the PML is 0 (Planar), or 1 (DC), or 18, etc., it does not belong to any of the above ranges.
  • a default condition can be set.
  • the LML mode is used by default, or the LMA mode is used by default, that is, a pre-configuration mode is configured, and the pre-configuration mode can be LMA mode or LML mode.
  • the PML is 0, and the prediction mode adopted by the chrominance component of the current block is determined to be a pre-configured mode.
  • S1104 Obtain a chrominance component prediction value of the current block according to the determined prediction mode adopted by the chrominance component of the current block.
  • the prediction mode of the chrominance component of the current block is known, and the chrominance component prediction value of the current block is obtained according to the prediction mode of the chrominance component of the current block.
  • the prediction mode of the chroma component of the current block is known to be the directional prediction mode
  • the predicted value is obtained based on the reference pixel according to the direction corresponding to the mode.
  • the linear correlation model coefficients are calculated using the upper template and the left template (formula (2.1) and equation (2.2)), and the chrominance component prediction values of the current block are obtained according to the formula (1.2). If it is LMA, according to formula (1.2), formula (2.1) and formula (2.2), only the upper template is used to calculate the linear model coefficients, and the predicted value of the current block chrominance component is obtained.
  • Embodiment 2 as shown in FIG. 12, the second selection method is described in detail.
  • the difference between the second embodiment and the first embodiment is that the luminance component prediction mode is not used for determining in the second embodiment, but the current gradient value in the upper template and the left template in the luminance block is compared, and the current state is adaptively determined.
  • the block chrominance component uses the LMA mode or the LML mode in the MDLM mode.
  • S1203. Determine, according to an average gradient value of a luminance component of a left reference pixel of the current block, and an average gradient value of a luminance component of an upper reference pixel of the current block, a prediction used by a chroma component of the current block.
  • the mode is the LMA mode or the LML mode.
  • the average gradient value MGA of the upper template and the average gradient value MGL of the left template in the luminance block rec' L after the current block downsampling can be calculated. If the MGA is greater than the MGL, it is determined that the current block chrominance component uses the LMA mode in the MDLM mode, and if the MGA is greater than the MGL, it is determined that the current block chrominance component uses the LML mode in the MDLM mode. If the MGA is equal to the MGL, a default condition can be set. For example, the LML mode is used by default, or the LMA mode is used by default, that is, a pre-configured mode is pre-configured, and the pre-configured mode can be the LMA mode or the LML mode. When the MGA is equal to the MGL, it is determined that the current block chroma component uses the pre-configured mode.
  • the calculation can be performed using the [1, 0, -1] operator, that is, every three reference pixels. For example, suppose the number of pixels in the upper template is NA, and the number of pixels in the left template is NL.
  • A(n) represents the pixel value of the nth reference pixel in the upper template
  • L(n) represents the pixel value of the nth reference pixel in the left template.
  • the calculation method of the gradient value in the embodiment of the present application is not limited.
  • the [1, -1] operator can also be used, see equations (3.3) and (3.4), or other operators, etc., which are not used in this embodiment of the present application. Specifically limited.
  • step S1204 refer to step S1104, and details are not described herein again.
  • the third embodiment describes the third option in detail.
  • the third embodiment differs from the first embodiment and the second embodiment in that, in the third embodiment, by comparing the width value and the height value of the current block, it is adaptively determined whether the current block chrominance component uses the LMA mode in the MDLM mode or the LML. mode.
  • S1303. Determine, according to the width value and the height value of the current block, a prediction mode adopted by the chroma component of the current block as the LMA mode or the LML mode.
  • the prediction mode adopted by the chroma component of the current block is the LML mode. If the height value of the current block is greater than the width value, it is determined that the prediction mode adopted by the chroma component of the current block is the LMA mode. If the height value of the current block is equal to the width value, a default condition can be set at this time. For example, the LML mode is used by default, or the LMA mode is used by default, that is, a pre-configuration mode is pre-configured, and the pre-configuration mode can be LMA mode. Or LML mode. When the height value of the current block is equal to the width value, it is determined that the current block chrominance component uses the pre-configured mode.
  • step S1304 refer to step S1104, and details are not described herein again.
  • the height of the divided image block is greater than the width. Therefore, most of the images are also divided into image blocks whose height is greater than the width. Therefore, with the solution provided in the third embodiment of the present application, when the height value of the current block is greater than the width value, the LMA mode of the upper template is determined to ensure the coding accuracy. Therefore, it is not necessary to add the LMA mode and the LML mode in the chroma prediction mode list, thereby avoiding an increase in the coding length and reducing the coding overhead.
  • the selection of the LMA mode and the LML mode can be made more accurate.
  • the order of the LMA mode and the LML mode in the chroma prediction mode list is adaptively adjusted, and the different order affects the length of the coded bits.
  • the order of the LMA mode and the LML mode in the chroma prediction mode list is re-determined. Specifically, a list of chroma prediction modes corresponding to different orders can be found in Table 4.
  • Mode 1 Mode (sequence 2) Index value Coded bit (TU) DM DM 0 0 LM LM 1 10 LMA LML 2 110 LML LMA 3 1110 Planar Planar 4 11110 VER VER 5 111110 HOR HOR 6 1111110 DC DC 7 1111111
  • an intra prediction method for an image block provided by an embodiment of the present application is shown.
  • the method may be performed by the video encoder 20, or by a processor provided inside the video encoder 20, or by the prediction module 21, or by a chip for performing an encoding function.
  • the method may also be performed by video decoder 30, or by a processor disposed within video decoder 30, or by prediction module 32, or by a chip for performing decoding functions.
  • the chrominance preset mode list is taken as an example in Table 4.
  • the index value is 3 or 4
  • the LMA mode is a mode for calculating a chrominance component prediction value of the current block based on an upper reference pixel of the current block, the LML mode being calculating the current block based on a left reference pixel of the current block
  • the mode of the chrominance component prediction is a mode for calculating a chrominance component prediction value of the current block based on an upper reference pixel of the current block, the LML mode being calculating the current block based on a left reference pixel of the current block.
  • S1403 Determine, according to the index value, a prediction mode adopted by a chroma component of the current block from the LMA mode and the LML mode in the determining order.
  • S1404 Obtain a predicted value of a chroma component of the current block according to the determined prediction mode adopted by the chroma component of the current block.
  • the order of the LMA mode and the LML mode in the chroma prediction mode list is adaptively adjusted, and the coding bit length corresponding to the mode with higher probability of selection is shorter, thereby improving the LMA and LML. Coding efficiency.
  • determining the order of the LMA mode and the LML mode in the chroma prediction mode list according to the pre-configuration policy may include the following determination manners:
  • the first determining order is to determine the order of the LMA mode and the LML mode in the chroma prediction mode list with reference to a prediction mode adopted by a luminance component of the current block.
  • the second determining order is: determining the LMA with reference to an average gradient value of a luminance component of a left reference pixel of the current block and an average gradient value of a luminance component of an upper reference pixel of the current block.
  • the mode and the order of the LML modes in the chroma prediction mode list are: determining the LMA with reference to an average gradient value of a luminance component of a left reference pixel of the current block and an average gradient value of a luminance component of an upper reference pixel of the current block.
  • the third determining order is to determine the order of the LMA mode and the LML mode in the chroma prediction mode list with reference to the width value and the height value of the current block.
  • Embodiment 4 as shown in FIG. 15, the first manner of determining the order is described in detail.
  • S1501 Obtain a prediction mode adopted by a chroma component of the current block.
  • the code stream information may be parsed to obtain an index value of the coding mode of the chroma component of the current block, and the prediction mode of the chroma component coding of the current block is obtained by using the index value.
  • the binary code stream of the prediction mode encoded by the chrominance component of the current block is parsed to be 1110, then according to Table 3, the prediction mode of the current block chrominance component is Planar mode; if the prediction mode of the chrominance component of the current block is The binary code stream is 110 (1110), and according to Table 4, the prediction mode of the current block chrominance component is one of the LMA mode and the LML mode.
  • the mode prediction mode can be predicted based on the chrominance, and the adopted prediction mode of the chrominance component of the current block is obtained by the RDO criterion.
  • S1502 Determine whether the index value of the prediction mode adopted by the chroma component of the current block satisfies a preset condition, and if yes, execute S1503; otherwise, execute S1505.
  • S1503 Determine an order of the LMA mode and the LML mode in the chroma prediction mode list according to a prediction mode adopted by a luminance component of the current block.
  • the encoding mode corresponding to the luma component of the current block has been determined.
  • the first sequence characterizes that the LMA mode has a corresponding index value in the chroma prediction mode list that is smaller than an index value of the LML mode.
  • the order of the LMA mode and the LML mode in the chroma prediction mode list is determined to be the second order.
  • the second sequence characterizes that the LMA mode has a corresponding index value in the chroma prediction mode list that is greater than an index value corresponding to the LML mode.
  • the PML may be determined to be vertical or horizontal by setting a range of intervals.
  • the first range [VER-A, VER + B], VER represents the second parameter value corresponding to the vertical mode, A and B are positive integers;
  • the second range [HOR-C, HOR + D], HOR Indicates the third parameter value corresponding to the horizontal mode, and C and D are both positive integers.
  • the PML is in the first range, that is, VER-A ⁇ PML ⁇ VER + B, then the PML is vertical, as shown in Table 3, determining the LMA mode and the LML mode in the chroma prediction mode list.
  • the order is sequence 1; if the PML is in the second range, ie HOR-C ⁇ PML ⁇ HOR + D, the PML is biased horizontally, and the order of determining the LMA mode and the LML mode in the chromaticity prediction mode list is order 2 .
  • A can be equal to B or not equal to B; C can be equal to D or not equal to D.
  • C can be equal to D or not equal to D.
  • VER corresponds to 26
  • the PML does not belong to the above two ranges.
  • the PML does not belong to any of the above ranges.
  • a default condition may be set, for example, the first order is adopted by default, or the second order is adopted by default, that is, a pre-configuration sequence is configured, and the pre-configuration mode may be the first order or the second order.
  • PML is 0, and the order of the LMA mode and the LML mode in the chroma prediction mode list is determined to be a pre-configuration order.
  • S1504 Determine, according to the index value, a prediction mode adopted by a chroma component of the current block from the LMA mode and the LML mode in the determining order.
  • the determined order is sequence 1, and the binary code stream of the prediction mode of the chroma component of the current block is parsed from the received code stream to be 110, and then the prediction mode adopted by the current chroma component is determined to be the LMA mode.
  • S1505 Obtain a predicted value of a chroma component of the current block according to the determined prediction mode adopted by the chroma component of the current block. For the manner of obtaining the predicted value, refer to step S1504 in the first embodiment, and details are not described herein again.
  • Embodiment 5 as shown in FIG. 16, the second way of determining the order is explained in detail.
  • S1601 to S1602 participate in steps S1501 to S1502 in the fourth embodiment, and details are not described herein again.
  • S1603 Determine, according to an average gradient value of a luminance component of a left reference pixel of the current block, and an average gradient value of a luminance component of an upper reference pixel of the current block, the LMA mode and the LML mode in color. The order in the prediction mode list.
  • the average gradient value MGA of the upper template and the average gradient value MGL of the left template in the luminance block rec' L after the current block downsampling can be calculated. If the MGA is greater than the MGL, it is determined that the order of the LMA mode and the LML mode in the chroma prediction mode list is the first order. If the MGA is greater than the MGL, it is determined that the order of the LMA mode and the LML mode in the chroma prediction mode list is the second order. If the MGA is equal to the MGL, a default condition can be set.
  • the first order is adopted by default, or the second order is used by default, that is, a pre-configuration sequence is configured, and the pre-configuration mode can be the first order or the second. order.
  • PML is 0, and the order of the LMA mode and the LML mode in the chroma prediction mode list is determined to be a pre-configuration order.
  • Embodiment 6 as shown in FIG. 17, the manner of determining the third determination sequence will be described in detail.
  • the sixth embodiment is different from the fourth embodiment and the fifth embodiment.
  • the LMA mode and the LML mode are determined in the chroma prediction mode list by comparing the width value and the height value of the current block. order.
  • S1703. Determine an order of the LMA mode and the LML mode in the chroma prediction mode list according to the width value and the height value of the current block.
  • the width value of the current block is less than a height value
  • determining that the order of the LMA mode and the LML mode in the chroma prediction mode list is a first sequence the first sequence characterizing the LMA mode
  • the corresponding index value in the chroma prediction mode list is smaller than the index value of the LML mode.
  • Determining that the order of the LMA mode and the LML mode in the chroma prediction mode list is a second sequence when the width value of the current block is greater than a height value the second sequence characterizing the LMA mode in the The corresponding index value in the chroma prediction mode list is larger than the index value corresponding to the LML mode.
  • a default condition may be set at this time, for example, the first order is adopted by default, or the second order is adopted by default, that is, a pre-configuration sequence is pre-configured, and the pre-configuration sequence is pre-configured. It can be the first order or the second order.
  • the height value of the current block is equal to the width value, it is determined that the current block chrominance component uses the pre-configured mode.
  • the embodiment of the present application further provides a device, which may be a processor in a video encoder, a chip or a chip system, or a module in a video encoder.
  • the intra prediction module 211 may be a processor in a video decoder, or a chip or chip system, or a module in a video decoder, such as an intra prediction module 321 .
  • the apparatus may include a determining unit 1801, a selecting unit 1802, and a calculating unit 1803. The determining unit 1801, the selecting unit 1802, and the calculating unit 1803 are for performing the method steps shown in the embodiments corresponding to FIGS. 10 to 13.
  • the determining unit 1801 may be configured to determine that the prediction mode adopted by the chroma component of the current block is an MDLM mode, and the MDLM includes an LMA mode and an LML mode.
  • the selecting unit 1802 may be configured to determine, according to the pre-configuration policy, that the prediction mode adopted by the chroma component of the current block is an LMA mode or an LML mode, where the LMA mode is calculated based on an upper reference pixel of the current block.
  • a mode of a chroma component prediction value of a current block, the LML mode being a mode of calculating a chroma component prediction value of the current block based on a left reference pixel of the current block.
  • the calculating unit 1803 may be configured to obtain a chrominance component prediction value of the current block according to the determined prediction mode adopted by the chrominance component of the current block.
  • the device 1900 may include a communication interface 1910 and a processor 1920.
  • the device 1900 may further include a memory 1930.
  • the memory 1930 may be disposed inside the device or may be disposed outside the device.
  • the determining unit 1801, the selecting unit 1802, and the calculating unit 1803 shown in FIG. 18 described above may each be implemented by the processor 1920.
  • the processor 1920 transmits or receives a video stream or a code stream through the communication interface 1910 and is used to implement the methods described in FIGS. 10-13. In the implementation process, each step of the processing flow may complete the methods described in FIG. 10 to FIG. 13 through the integrated logic circuit of the hardware in the processor 1920 or the instruction in the form of software.
  • the communication interface 1910 in the embodiment of the present application may be a circuit, a bus, a transceiver, or any other device that can be used for information interaction.
  • the other device may be a device connected to the device 1900.
  • the device when the device is a video encoder, the other device may be a video decoder.
  • the processor 1920 in the embodiment of the present application may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or a transistor logic device, and a discrete hardware component, which may be implemented or executed.
  • a general purpose processor can be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software units in the processor.
  • Program code for execution by processor 1920 to implement the above methods may be stored in memory 1930.
  • Memory 1930 is coupled to processor 1920.
  • the coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units or modules, and may be in an electrical, mechanical or other form for information interaction between devices, units or modules.
  • Processor 1920 may operate in conjunction with memory 1930.
  • the memory 1930 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), or a volatile memory such as a random access memory (random). -access memory, RAM).
  • Memory 1930 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
  • connection medium between the communication interface 1910, the processor 1920, and the memory 1930 is not limited in the embodiment of the present application.
  • the embodiment of the present application is connected by a bus between the memory 1930, the processor 1920, and the communication interface 1910 in FIG. 19, and the bus is indicated by a thick line in FIG. 19, and the connection manner between other components is only schematically illustrated. Not limited to limits.
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 19, but it does not mean that there is only one bus or one type of bus.
  • the embodiment of the present application further provides a device, which may be a processor in a video encoder, a chip or a chip system, or a module in a video encoder.
  • the intra prediction module 211 may be a processor in a video decoder, or a chip or chip system, or a module in a video decoder, such as an intra prediction module 321 .
  • the apparatus can include a determination unit 2001 and a calculation unit 2005.
  • the determining unit 2001 may specifically include a first determining unit 2002, a second determining unit 2003, and a third determining unit 2004.
  • the first determining unit 2002, the second determining unit 2003, the third determining unit 2004, and the calculating unit 2005 are for performing the method steps shown in the embodiments corresponding to FIGS. 14-17.
  • the first determining unit 2002 may be configured to determine that an index value of a prediction mode of the current block satisfies a preset condition.
  • the second determining unit 2003 may be configured to determine an order of the upper template linear model LMA mode and the left template linear model LML mode in the chroma prediction mode list according to the pre-configuration policy, the LMA mode being an upper side reference based on the current block
  • a pixel calculates a mode of a chroma component prediction value of the current block, the LML mode being a mode of calculating a chroma component prediction value of the current block based on a left reference pixel of the current block.
  • the third determining unit 2004 may be configured to determine, according to the index value, the prediction mode adopted by the chroma component of the current block from the LMA mode and the LML mode of the determining order.
  • the calculating unit 2005 may be configured to obtain a predicted value of a chroma component of the current block according to the determined prediction mode adopted by the chroma component of the current block.
  • the device 2100 may include a communication interface 2110 and a processor 2120.
  • the device 2100 may further include a memory 2130.
  • the memory 2130 may be disposed inside the device or may be disposed outside the device.
  • the determination unit 2001 and the calculation unit 2004 shown in FIG. 20 described above may each be implemented by the processor 2120.
  • the processor 2120 transmits or receives a video stream or a code stream through the communication interface 2110 and is used to implement the methods described in FIGS. 14-17. In the implementation process, each step of the processing flow may be completed by the integrated logic circuit of the hardware in the processor 2120 or the instruction in the form of software to complete the methods described in FIGS. 14-17.
  • the communication interface 2110 in the embodiment of the present application may be a circuit, a bus, a transceiver, or any other device that can be used for information interaction.
  • the other device may be a device connected to the device 2100.
  • the device when the device is a video encoder, the other device may be a video decoder.
  • the processor 2120 in the embodiment of the present application may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or a transistor logic device, and a discrete hardware component, which may be implemented or executed.
  • a general purpose processor can be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software units in the processor.
  • the program code executed by the processor 2120 to implement the above method may be stored in the memory 2130. Memory 2130 is coupled to processor 2120.
  • the coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units or modules, and may be in an electrical, mechanical or other form for information interaction between devices, units or modules.
  • the processor 2120 may operate in conjunction with the memory 2130.
  • the memory 2130 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), or a volatile memory such as a random access memory (random). -access memory, RAM).
  • Memory 2130 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
  • connection medium between the communication interface 2110, the processor 2120, and the memory 2130 is not limited in the embodiment of the present application.
  • the memory 2130, the processor 2120, and the communication interface 2110 are connected by a bus in FIG. 21, and the bus is indicated by a thick line in FIG. 21, and the connection manner between other components is only schematically illustrated. Not limited to limits.
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in FIG. 21, but it does not mean that there is only one bus or one type of bus.
  • the embodiment of the present application further provides a computer storage medium, where the software program stores a software program, and the software program can implement any one or more of the foregoing when being read and executed by one or more processors.
  • the computer storage medium may include various media that can store program codes, such as a USB flash drive, a removable hard disk, a read only memory, a random access memory, a magnetic disk, or an optical disk.
  • the embodiment of the present application further provides a chip, where the chip includes a processor, for implementing functions related to any one or more of the foregoing embodiments, for example, acquiring or processing information involved in the foregoing method or Message.
  • the chip further includes a memory for the processor to execute necessary program instructions and data.
  • the chip can be composed of a chip, and can also include a chip and other discrete devices.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

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

Abstract

本申请公开了一种图像块的帧内预测方法及装置,用以解决编解码开销较大的问题。该方法包括:确定当前块的色度分量采用的预测模式为MDLM模式,所述MDLM包括上模板线性模型LMA模式和左模板线性模型LML模式;根据预配置策略确定所述当前块的色度分量采用的预测模式为LMA模式或者LML模式,其中,所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式;根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量预测值。

Description

一种图像块的帧内预测方法及装置
本申请要求在2018年3月16日提交中国专利局、申请号为201810219434.9、发明名称为“一种图像块的帧内预测方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理技术领域,尤其涉及一种图像块的帧内预测方法及装置。
背景技术
现有视频图像编解码技术中采用帧内预测技术。帧内预测是指使用当前块所在图像内的已重建块中参考像素去预测当前块。一般采用当前块的周围已重建的相邻块的像素来获得当前块内像素的预测值。
目前,在针对图像的色度分量进行帧内预测时,增加了多方向线性模型(multi-direction linear model,MDLM)模式。MDLM模式与线性模型(linear model,LM)不同在于:LM模式是基于相关性模型用当前块的亮度分量的重建值计算色度分量的预测值,相关性模型的参数是基于当前块的上侧与左侧参考像素计算得到。而MDLM模式可以是上模板线性模型(linear model with above template,LMA)模式或者左模板线性模型(linear model with left template,LML)模式。LMA模式对应的相关性模型的参数是仅基于当前块的上侧参考像素计算得到,LMA模式对应的相关性模型的参数是仅基于当前块的左侧参考像素计算得到。为了增加MDLM模式,现有在色度预测模式列表中增加了LMA模式以及LML模式。但是由于在色度预测模式列表中增加了两种模式,使得色度模式列表长度变长,进而导致色度预测模式列表中的其它有些预测模式对应的编解码比特长度变长,增加了编解码开销。
发明内容
本申请提供一种图像块的帧内预测方法及装置,用以解决编解码开销较大的问题。
第一方面,本申请实施例提供了一种图像块的帧内预测方法,包括:
确定当前块的色度分量采用的预测模式为MDLM模式,所述MDLM包括上模板线性模型LMA模式和左模板线性模型LML模式;根据预配置策略确定所述当前块的色度分量采用的预测模式为LMA模式或者LML模式,其中,所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式;根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量预测值。
通过上述方案,不需要在色度预测模式列表中增加LMA模式和LML模式,根据预配置策略来确定预测模式是LMA模式和LML模式中的哪一种,能够对LML模式以及LML模式进行有效的编码,避免了增加编码比特长度,降低了编码开销。
在一种可能的设计中,根据所述预配置策略确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式,可以通过如下任一方式实现:
以所述当前块的亮度分量采用的预测模式为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式;或者,
以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式;或者,
以所述当前块的宽度值和高度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式。
上述设计中,提供了几种有效的选择LML模式或者选择LMA模式的方式。
在一种可能的设计中,以所述当前块的亮度分量采用的预测模式为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式,可以通过如下方式实现:
确定所述当前块的亮度分量采用的预测模式对应的第一参数值;
在确定所述第一参数值位于第一范围内时,确定所述当前块的色度分量采用的预测模式为LMA模式;或者,
在确定所述第一参数值位于第二范围内时,确定所述当前块的色度分量采用的预测模式为LML模式;或者,
在确定所述第一参数值位于所述第一范围外,且所述第一参数值位于所述第二范围外时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为LMA模式或者LML模式;
其中,第一范围=[VER-A,VER+B],VER表示垂直模式对应的第二参数值,A和B均为正整数;第二范围=[HOR-C,HOR+D],HOR表示水平模式对应的第三参数值,C和D均为正整数。
由于当前块的亮度分量先于色度分量进行编码或者解码,在编码当前块的色度分量时,对应当前块的亮度分量的编码模式已确定。而亮度分量的预测模式采用方向预测模式,且方向为偏向竖直方向时,则色度分量的预测模式更倾向于竖直方向的模式,即更倾向于采用上模板的LMA模式。从而,通过亮度分量的预测模式来确定色度分量的预测模式,不需要在色度预测模式列表中增加LMA模式和LML模式,便能够对LML模式以及LML模式进行有效的编码,避免了增加编码比特长度,降低了编码开销。
在一种可能的设计中,以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式,可以通过如下方式实现:
在所述当前块的左侧参考像素的亮度分量的平均梯度值大于所述当前块的上侧参考像素的亮度分量的平均梯度值时,确定所述当前块的色度分量采用的预测模式为所述LML模式;或者,
在所述当前块的左侧参考像素的亮度分量平均梯度值小于所述当前块的上侧参考像素的亮度分量的平均梯度值时,确定所述当前块的色度分量采用的预测模式为所述LMA模式;或者,
在所述当前块的左侧参考像素的亮度分量的平均梯度值等于所述当前块的上侧参考像素的亮度分量的平均梯度值时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为所述LMA模式或者所述LML模式。
上述设计中,提供了一种选择LML模式或者选择LMA模式的一种方式,具体通过比较左模板和上模板的平均梯度值来确定,不需要在色度预测模式列表中增加LMA模式和LML模式,便能够对LML模式以及LML模式进行有效的编码,避免了增加编码比特长度,降低了编码开销。
在一种可能的设计中,以所述当前块的宽度值和高度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式,可以通过如下方式实现:
在所述当前块的宽度值大于高度值时,确定所述当前块的色度分量采用的预测模式为所述LML模式;或者,
在所述当前块的宽度值小于高度值时,确定所述当前块的色度分量采用的预测模式为所述LMA模式;或者,
在所述当前块的宽度值等于高度值时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为所述LMA模式或者所述LML模式。
基于已有编码经验,如果某一区域偏竖直的纹理比较多,则相对而言,在划分图像块时,一般更倾向于划分的图像块的高度大于宽度。因此,大多数的图像也被划分成高度大于宽度的图像块。因此,上述设计中,在当前块的高度值大于宽度值时,则确定采用上模板的LMA模式,保证了编码准确度。从而不需要在色度预测模式列表中增加LMA模式和LML模式,避免编码长度的增加,降低了编码开销。
第二方面,本申请实施例提供了一种图像块的帧内预测方法,包括:
确定当前块的色度分量的预测模式的索引值;根据预配置策略确定LMA模式以及LML模式在色度预测模式列表中的顺序;所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式;根据所述索引值从所述确定顺序的LMA模式和LML模式中,确定所述当前块的色度分量采用的预测模式;根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量的预测值。
通过上述方案,自适应的对LMA模式和LML模式在色度预测模式列表中的顺序进行调整,将选择概率较高的模式对应的编码比特长度较短,进而提高LMA和LML的编码效率。
在一种可能的设计中,根据预配置策略确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序,包括:
以所述当前块的亮度分量采用的预测模式为参考,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序;或者,
以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序;或者,
以所述当前块的宽度值和高度值为参考,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序。
上述设计中,提供了几种确定LMA模式和LML模式在色度预测模式列表中顺序的方式。
在一种可能的设计中,以所述当前块的亮度分量采用的预测模式为参考,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序,包括:
确定所述当前块的亮度分量采用的预测模式对应的第一参数值;
在确定所述第一参数值位于第一范围内时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
在确定所述第一参数值位于第二范围内时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
在确定所述第一参数值位于所述第一范围外,且所述第一参数值位于所述第二范围外时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序;
其中,第一范围=[VER-A,VER+B],VER表示垂直模式对应的第二参数值,A和B均为正整数;第二范围=[HOR-C,HOR+D],HOR表示水平模式对应的第三参数值,C和D均为正整数。
由于当前块的亮度分量先于色度分量进行编码或者解码,在编码当前块的色度分量时,对应当前块的亮度分量的编码模式已确定。而亮度分量的预测模式采用方向预测模式,且方向为偏向竖直方向时,则色度分量的预测模式更倾向于竖直方向的模式,即更倾向于采用上模板的LMA模式。从而,通过亮度分量的预测模式来确定LML模式和LMA模式的顺序,选择概率较大的预测模式对应的编码比特长度较短,在一定程度降低了编码比特长度,降低了编码开销。
在一种可能的设计中,以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序,可以通过如下方式实现:
在所述当前块的上侧参考像素的亮度分量的平均梯度值大于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
在所述当前块的上侧参考像素的亮度分量的梯度值小于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
在所述当前块的上侧参考像素的亮度分量的平均梯度值等于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序。
上述设计中,提供了一种确定LML模式和LMA模式的一种方式,具体通过比较左模板和上模板的平均梯度值来确定,不需要在色度预测模式列表中增加LMA模式和LML模式,便能够对LML模式以及LML模式进行有效的编码,避免了增加编码比特长度,降低了编码开销。
在一种可能的设计中,以所述当前块的宽度值和高度值为参考,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序,包括:
在所述当前块的宽度值小于高度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
在所述当前块的宽度值大于高度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
在所述当前块的宽度值等于高度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序。
基于已有编码经验,如果某一区域偏竖直的纹理比较多,则相对而言,在划分图像块时,一般更倾向于划分的图像块的高度大于宽度。因此,大多数的图像也被划分成高度大于宽度的图像块。因此,上述设计中,在当前块的高度值大于宽度值时,则确定采用上模板的LMA模式的索引值小于采用左模板的LML模式的索引值,在一定程度上降低了编码长度,降低了编码开销。
第三方面,本申请实施例提供了一种图像块的帧内预测装置,该装置可以是编码器或者解码器,或者是芯片,或是处理器,或者是配置于编码器或者解码器中的帧内预测模块等。该装置具有实现上述第一方面的各设计的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的单元。
示例性的,该装置可以包括:
确定单元,用于确定当前块的色度分量采用的预测模式为多方向线性模型MDLM模式,所述MDLM包括上模板线性模型LMA模式和左模板线性模型LML模式;
选择单元,用于根据预配置策略确定所述当前块的色度分量采用的预测模式为LMA模式或者LML模式,其中,所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式;
计算单元,用于根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量预测值。
在一种可能的设计中,所述选择单元,具体用于:
以所述当前块的亮度分量采用的预测模式为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式;或者,
以所述当前块的左侧参考像素的平均梯度值、和所述当前块的上侧参考像素的平均梯度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式;或者,
以所述当前块的宽度值和高度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式。
在一种可能的设计中,所述选择单元,具体用于:
确定所述当前块的亮度分量采用的预测模式对应的第一参数值;
在确定所述第一参数值位于第一范围内时,确定所述当前块的色度分量采用的预测模式为LMA模式;或者,
在确定所述第一参数值位于第二范围内时,确定所述当前块的色度分量采用的预测模式为LML模式;或者,
在确定所述第一参数值位于所述第一范围外,且所述第一参数值位于所述第二范围外时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为LMA模式或者LML模式;
其中,第一范围=[VER-A,VER+B],VER表示垂直模式对应的第二参数值,A和B均为正整数;第二范围=[HOR-C,HOR+D],HOR表示水平模式对应的第三参数值,C和D均为正整数。
在一种可能的设计中,所述选择单元,具体用于:
在所述当前块的左侧参考像素的亮度分量的平均梯度值大于所述当前块的上侧参考像素的亮度分量的平均梯度值时,确定所述当前块的色度分量采用的预测模式为所述LML模式;或者,
在所述当前块的左侧参考像素的亮度分量的平均梯度值小于所述当前块的上侧参考像素的亮度分量的平均梯度值时,确定所述当前块的色度分量采用的预测模式为所述LMA模式;或者,
在所述当前块的左侧参考像素的亮度分量的平均梯度值等于所述当前块的上侧参考像素的亮度分量的平均梯度值时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为所述LMA模式或者所述LML模式。
在一种可能的设计中,所述选择单元,具体用于:
在所述当前块的宽度值大于高度值时,确定所述当前块的色度分量采用的预测模式为所述LML模式;或者,
在所述当前块的宽度值小于高度值时,确定所述当前块的色度分量采用的预测模式为所述LMA模式;或者,
在所述当前块的宽度值等于高度值时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为所述LMA模式或者所述LML模式。
第四方面,本申请实施例提供了一种图像块的帧内预测装置,该装置可以是编码器或者解码器,或者是芯片,或是处理器,或者是配置于编码器或者解码器中的帧内预测模块等。该装置具有实现上述第一方面的各设计的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的单元。
示例性的,该装置包括:
确定单元,用于确定当前块的预测模式的索引值满足预设条件;用于根据预配置策略确定LMA模式以及LML模式在色度预测模式列表中的顺序,所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式;以及用于根据所述索引值从所述确定顺序的LMA模式和LML模式中,确定所述当前块的色度分量采用的预测模式;
计算单元,用于根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量的预测值。
在一种可能的设计中,所述确定单元,具体用于:
以所述当前块的亮度分量采用的预测模式为参考,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序;或者,
以所述当前块的左侧参考像素的平均梯度值、和所述当前块的上侧参考像素的平均梯度值为参考,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序;或者,
以所述当前块的宽度值和高度值为参考,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序。
在一种可能的设计中,所述确定单元具体用于:
确定所述当前块的亮度分量采用的预测模式对应的第一参数值;
在确定所述第一参数值位于第一范围内时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
在确定所述第一参数值位于第二范围内时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
在确定所述第一参数值位于所述第一范围外,且所述第一参数值位于所述第二范围外时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序;
其中,第一范围=[VER-A,VER+B],VER表示垂直模式对应的第二参数值,A和B均为正整数;第二范围=[HOR-C,HOR+D],HOR表示水平模式对应的第三参数值,C和D均为正整数。
在一种可能的设计中,所述确定单元,具体用于:
在所述当前块的上侧参考像素的亮度分量的平均梯度值大于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
在所述当前块的上侧参考像素的亮度分量的平均梯度值小于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
在所述当前块的上侧参考像素的亮度分量的平均梯度值等于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序。
在一种可能的设计中,所述确定单元,具体用于:
在所述当前块的宽度值小于高度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
在所述当前块的宽度值大于高度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
在所述当前块的宽度值等于高度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序。
第五方面,本申请实施例提供一种装置,该装置可以是编码器,包括:处理器和存储器;该存储器用于存储指令,当该装置运行时,该处理器执行该存储器存储的该指令,以使该装置执行上述第一方面或第一方面的任一设计提供的方法。需要说明的是,该存储器可以集成于处理器中,也可以是独立于处理器之外。
第六方面,本申请实施例提供一种装置,该装置可以是解码器,包括:处理器和存储器;该存储器用于存储指令,当该装置运行时,该处理器执行该存储器存储的该指令,以使该装置执行第二方面或者第二方面的任一设计提供的方法。需要说明的是,该存储器可以集成于处理器中,也可以是独立于处理器之外。
第七方面,本申请实施例还提供一种可读存储介质,所述可读存储介质中存储有程序或指令,当其在计算机上运行时,使得上述各方面所述的任一方法被执行。
第八方面,本申请实施例还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面所述的任一方法。
第九方面,本申请提供了一种芯片,所述芯片与存储器相连,用于读取并执行所述存储器中存储的软件程序,以实现任一方面的任一设计所述的方法。
另外,第三方面至第九方面中任一种设计方式所带来的技术效果可参见第一方面至第二方面中不同实现方式所带来的技术效果,此处不再赘述。
附图说明
图1为本申请实施例提供的视频编解码系统结构示意图;
图2A为本申请实施例提供的视频编码器结构示意图;
图2B为本申请实施例提供的视频解码器结构示意图;
图3为本申请实施例提供的采样点示意图;
图4为本申请实施例提供的参考像素示意图;
图5A~图5C为本申请实施例提供的YUV格式示意图;
图6为本申请实施例提供的帧内预测模式示意图;
图7A~图7C为本申请实施例提供的LM模式示意图;
图8为本申请实施例提供的上模板和左模板示意图;
图9为本申请实施例提供的扩大尺寸的上模板和左模板示意图;
图10为本申请实施例提供的一种帧内预测方法流程图;
图11A为本申请实施例一提供的图像块的帧内预测方法流程示意图;
图11B为本申请实施例一提供的PML偏竖直示意图;
图12为本申请实施例二提供的帧内预测方法流程示意图;
图13为本申请实施例三提供的帧内预测方法流程示意图;
图14为本申请实施例提供的另一种图像块的帧内预测方法流程示意图;
图15为本申请实施例四提供的帧内预测方法流程示意图;
图16为本申请实施例五提供的帧内预测方法流程示意图;
图17为本申请实施例六提供的帧内预测方法流程示意图;
图18为本申请实施例提供的装置1800示意图;
图19为本申请实施例提供的装置1900示意图;
图20为本申请实施例提供的装置2000示意图;
图21为本申请实施例提供的装置2100示意图。
具体实施方式
本申请实施例提供的图像块的帧内预测方案可以应用于视频图像的编码或者解码中。图1为本申请实施例中视频编码及解码系统10的一种示意性框图。如图1所示,系统10包含源装置11和目的装置12,源装置11产生编码视频数据并发送给目的装置12,目的装置12用于接收编码视频数据,并对编码视频数据进行解码并显示。源装置11及目的装置12可包括广泛范围的装置中的任一种,包含桌上型计算机、笔记型计算机、平板计算机、机顶盒、例如所谓的“智能”电话的电话手机、所谓的“智能”触控板、电视、摄影机、显示装置、数字媒体播放器、视频游戏控制台、视频流式传输装置等。
目的装置12可经由链路16接收待解码的经编码视频数据。链路16可包括能够将经编码视频数据从源装置11传递到目的装置12的任何类型的媒体或装置。在一个可能的实现方式中,链路16可包括使源装置11能够实时将经编码视频数据直接传输到目的装置12的通信媒体。可根据通信标准(例如,无线通信协议)调制经编码视频数据且将其传输到目的装置12。通信媒体可包括任何无线或有线通信媒体,例如射频频谱或一个或多个物理传输线。通信媒体可形成基于包的网络(例如,局域网、广域网或因特网的全球网络)的部分。通信媒体可包含路由器、交换器、基站或可有用于促进从源装置11到目的装置12的通信的任何其它设备。
本申请的技术不必限于无线应用或设定。技术可应用于视频解码以支持多种多媒体应用中的任一个,例如,空中电视广播、有线电视传输、卫星电视传输、流式传输视频传输(例如,经由因特网)、编码数字视频以用于存储于数据存储媒体上、解码存储于数据存储媒体上的数字视频或其它应用。在一些可能的实现方式中,系统10可经配置以支持单向或双向视频传输以支持例如视频流式传输、视频播放、视频广播和/或视频电话的应用。
在图1的可能的实现方式中,源装置11可以包括视频源13、视频编码器20及输出接口14。在一些应用中,输出接口14可包括调制器/解调制器(调制解调器)和/或传输器。在源装置11中,视频源13可包括例如以下各种的源设备:视频捕获装置(例如,摄像机)、含有先前捕获的视频的存档、用以从视频内容提供者接收视频的视频馈入接口,和/或用于产生计算机图形数据作为源视频的计算机图形系统,或这些源的组合。作为一种可能的实现方式,如果视频源13为摄像机,那么源装置11及目的装置12可形成所谓的摄影机电话或视频电话。本申请中所描述的技术可示例性地适用于视频解码,且可适用于无线和/或有线应用。
可由视频编码器20来编码捕获、预捕获或计算产生的视频。经编码视频数据可经由源装置11的输出接口14直接传输到目的装置12。经编码视频数据也可(或替代地)存储到存储装置上以供稍后由目的装置12或其它装置存取以用于解码和/或播放。
目的装置12包含输入接口15、视频解码器30及显示装置17。在一些应用中,输入接口15可包含接收器和/或调制解调器。目的装置12的输入接口15经由链路16接收经编码视频数据。经由链路16传达或提供于存储装置上的经编码视频数据可包含由视频编码 器20产生以供视频解码器30的视频解码器使用以解码视频数据的多种语法元素。这些语法元素可与在通信媒体上传输、存储于存储媒体上或存储于文件服务器上的经编码视频数据包含在一起。
显示装置17可与目的装置12集成或在目的装置12外部。在一些可能的实现方式中,目的装置12可包含集成显示装置且也经配置以与外部显示装置接口连接。在其它可能的实现方式中,目的装置12可为显示装置。一般来说,显示装置17向用户显示经解码视频数据,且可包括多种显示装置中的任一个,例如液晶显示器、等离子显示器、有机发光二极管显示器或另一类型的显示装置。
视频编码器20及视频解码器30可根据例如目前在开发中的下一代视频编解码压缩标准(H.266)操作且可遵照H.266测试模型(JEM)。替代地,视频编码器20及视频解码器30可根据例如ITU-TH.265标准,也称为高效率视频解码标准,或者,ITU-TH.264标准的其它专属或工业标准或这些标准的扩展而操作,ITU-TH.264标准替代地被称为MPEG-4第10部分,也称高级视频编码(advanced video coding,AVC)。然而,本申请的技术不限于任何特定解码标准。视频压缩标准的其它可能的实现方式包含MPEG-2和ITU-TH.263。
系统10中视频编码器20和视频解码器30用于根据本申请提出的各种图像块的帧内预测方法实施例来预测图像块的像素值。视频编码器20及视频解码器30各自可实施为多种合适编码器电路中的任一个,例如,一个或多个微处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)、离散逻辑、软件、硬件、固件或其任何组合。在技术部分地以软件实施时,装置可将软件的指令存储于合适的非暂时性计算机可读媒体中且使用一个或多个处理器以硬件执行指令,以执行本申请的技术。视频编码器20及视频解码器30中的每一者可包含于一个或多个编码器或解码器中,其中的任一个可在相应装置中集成为组合式编码器/解码器(CODEC)的部分。
图2A为本申请实施例中视频编码器20的一种示意性框图。
如图2A所示,视频编码器20可以包括:预测模块21、求和器22、变换模块23、量化模块24和熵编码模块25。在一种示例下,预测模块21可以包括帧间预测模块211和帧内预测模块212,本申请实施例对预测模块21的内部结构不作限定。可选的,对于混合架构的视频编码器,视频编码器20也可以包括反量化模块26、反变换模块27和求和器28。
在图2A的一种可行的实施方式下,视频编码器20还可以包括存储模块29,应当理解的是,存储模块29也可以设置在视频编码器20之外。
在另一种可行的实施方式下,视频编码器20还可以包括滤波器(图2A中未示意)以对图像块的边界进行滤波从而从经重建的视频图像中去除伪影。在需要时,滤波器对求和器28的输出进行滤波。
可选地,视频编码器20还可以包括分割单元(图2A中未示意)。视频编码器20接收视频数据,且分割单元将视频数据分割成图像块。此分割也可包含分割成条带、图像块或其它较大单元。一般来说,条带可划分成多个图像块。
预测模块21用于对当前编码图像块(简称为当前块)进行帧内或者帧间预测得到当前块的预测值。具体的,预测模块21包括的帧间预测模块211针对当前块进行帧间预测得到帧间预测值。帧内预测模块212针对当前块进行帧内预测得到帧内预测值。帧间预测模块211需要为当前块在参考图像中尝试多个参考块,最终使用哪一个或者哪几个参考块用作预测则使用率失真优化(rate-distortion optimization,RDO)或者其他方法确定。
在预测模块21经由帧间预测或帧内预测产生当前块的预测值之后,视频编码器20通过从当前块减去预测值而形成残差信息。变换模块23用于对残差信息进行变换。变换模块23使用例如离散余弦变换(DCT)或概念上类似的变换(例如,离散正弦变换DST)将残差信息变换成残差变换系数。变换模块23可将所得残差变换系数发送到量化模块24。量化模块24对残差变换系数进行量化以进一步减小码率。在一些可行的实施方式中,量化模块24可接着执行包含经量化变换系数的矩阵的扫描。替代地,熵编码模块25可执行扫描。
在量化之后,熵编码模块25可熵编码经量化的残差变换系数得到码流。例如,熵编码模块25可执行上下文自适应性可变长度解码(CAVLC)、上下文自适应性二进制算术解码(CABAC)、基于语法的上下文自适应性二进制算术解码(SBAC)、概率区间分割熵(PIPE)解码或另一熵编码方法或技术。在通过熵编码模块25进行熵编码之后,可将经编码码流传输到视频解码器30或存档以供稍后传输或由视频解码器30检索。
反量化模块26及反变换模块27分别应用反量化及反变换,以在像素域中重构建残差块以供稍后用作参考图像的参考块。求和器28将经重构建得到的残差信息与通过预测模块21所产生的预测值相加以产生重建块,并将重建块作为参考块以供存储于存储模块29中。这些参考块可由预测模块21用作参考块以帧间或者帧内预测后续视频帧或图像中的块。
应当理解的是,视频编码器20的其它的结构变化可用于编码视频流。例如,对于某些图像块或者图像帧,视频编码器20可以直接地量化残差信息而不需要经变换模块23处理,相应地也不需要经反变换模块27处理;或者,对于某些图像块或者图像帧,视频编码器20没有产生残差信息,相应地不需要经变换模块23、量化模块24、反量化模块26和反变换模块27处理;或者,视频编码器20可以将经重构图像块作为参考块直接地进行存储而不需要经滤波器单元处理;或者,视频编码器20中量化模块24和反量化模块26可以合并在一起;或者,视频编码器20中变换模块23和反变换模块27可以合并在一起;或者,求和器22和求和器28可以合并在一起。
图2B为本申请实施例中视频解码器30的一种示意性框图。
如图2B所示,视频解码器30可以包括熵解码模块31、预测模块32、反量化模块34、反变换模块35和重建模块36。在一种示例下,预测模块32可以包括帧间预测模块322和帧内预测模块321,本申请实施例对此不作限定。
在一种可行的实施方式中,视频解码器30还可以包括存储模块33。应当理解的是,存储模块33也可以设置在视频解码器30之外。在一些可行的实施方式中,视频解码器30可执行与关于来自图2A的视频编码器20描述的编码流程的示例性地互逆的解码流程。
在解码过程期间,视频解码器30从视频编码器20接收码流。视频解码器30接收到的码流连续通过熵解码模块31、反量化模块34以及反变换模块35分别进行熵解码、反量化、反变换之后得到残差信息。根据码流确定针对当前块使用的帧内预测还是帧间预测。若是帧内预测,则预测模块32中的帧内预测模块321利用当前块周围已重建块的参考像素的像素值按照所使用的帧内预测方法构建预测信息。如果是帧间预测,则需要解析出运动信息,并使用所解析出的运动信息在已重建的图像块中确定参考块,并将参考块内像素点的像素值作为预测信息(此过程称为运动补偿(Motion compensation,MC))。重建模块36使用预测信息加上残差信息便可以得到重建信息。
以下,对本申请中的部分用语进行解释说明,以便于本领域技术人员理解。
1)、图像块是指一个二维采样点阵列,可以是正方形阵列,也可以是矩形阵列,例如一个4x4大小的图像块可看做4x4共16个采样点构成的方形采样点阵列,参见图3所示。图像块内信号指图像块内采样点的采样值。此外,采样点还可以称为像素点或者像素,在本申请文件中将不加区分的使用。相应的,采样点的值也可以称为像素值,在本申请文件中将不加区分的使用。图像也可以表示为一个二维采样点阵列,采用与图像块类似的方法标记。
2)、当前块,是指当前正在处理的块。例如,在编码中,指当前正在编码的;在解码中,指当前正在解码的块。
3)、参考块,是指为当前块提供参考信号的块。参考像素,是指参考块中为当前块提供参考信号的像素点,参见图4所示。
4)、本申请应用于图像信号。图像信号通常包括一个亮度分量与两个色度分量。亮度分量通常使用符号Y表示,色度分量通常使用符号U、V表示。按照图像信号中亮度分量和色度分量的采样方法的不同,一般存在YUV4:4:4,YUV4:2:2,YUV4:2:0。
如图5A~图5C所示,常用的YUV格式包括如下格式:
图5A~图5C中叉表示亮度分量采样点,圈表示每色度分量采样点:
参见图5A所示,4:4:4格式:表示色度分量没有下采样;
参见图5B所示,4:2:2格式:表示色度分量相对于亮度分量进行2:1的水平下采样,但没有进行竖直下采样。对于每两个U采样点或V采样点,每行都包含四个Y采样点;
参见图5C所示,4:2:0格式:表示色度分量相对于亮度分量分别进行2:1的水平下采样,和2:1的竖直下采样。
在图像采用YUV4:2:0格式的情况下,若图像块的亮度分量为2Nx2N大小的图像块,则图像块的色度分量为NxN大小的图像块。后续为了描述方便,将图像块的色度分量称为色度块。本申请实施例将以4:2:0格式为例解释本申请方案技术。但可以理解的,本申请技术方案除了用于YUV4:2:0格式外,还可以用于YUV其它格式,或者其它视频图像格式中不同分量间的相互预测,如RGB格式等。另一方面,当前块可以是方形块,也可以是非方形的矩形块或其它形状区域,本申请实施例提供的技术方案同样适用。
4)、帧内预测,是指使用当前块所在图像内的已重建块中参考像素去预测当前块。一般采用当前块的周围已重建的相邻块的边界像素(靠近当前块一侧的边界)来获得当前块内像素的预测值。
帧内预测一般按照一定的方向将参考像素映射到当前块内的各个像素点位置上,得到对应位置上像素的预测值。为了覆盖各种不同的纹理或者结构特性,帧内预测一般会存在多个映射方向或者映射方式,一般称映射方向或者映射方式为帧内预测模式。例如,H.265中,对于亮度分量共有35种帧内预测模式,参见图6所示,其中包括33种方向预测模式(图6中2~34),DC预测模式(图6中由1表示),和平面(Planar)预测模式(图6中由0表示)。方向预测模式是指将参考像素按照一定的方向(使用intra mode index标记)将参考像素映射到当前块内的像素点位置上得到当前像素点的预测值,或者,对于每一个当前块内的像素点,将其位置按照一定的方向(使用intra mode index标记)反向映射到参考像素上,对应的参考像素的像素值即为当前像素的预测值。
不同于方向预测模式,DC预测模式是将参考像素的平均值作为当前块内像素的预测 值,而Planar模式则是利用当前像素点的正上侧和正左侧的参考像素的像素值以及当前块的右上侧和左下侧参考像素点的像素值计算当前像素点的预测值。
与亮度分量类似,色度分量的帧内预测也是利用当前色度块周围相邻已重建块的边界像素作为当前块的参考像素,按照一定的预测模式将参考像素映射到当前色度块内的像素点,作为当前色度块内像素的预测值。所不同的是,由于色度分量的纹理一般较为简单,所以色度分量的帧内预测模式的数量一般少于亮度分量。例如,在H.265中,色度分量的帧内预测模式仅包含5种,即Planar模式,垂直模式,水平模式,DC模式,和导出模式(derived mode)。
DM模式:使用当前块亮度分量的预测模式作为当前块色度分量的预测模式进行预测;
LM模式:基于相关性模型用像素的亮度分量的重建值计算该像素的色度分量的预测值,相关性模型的参数由当前块的上侧与左侧的参考像素的亮度分量与色度分量的重建值计算得到。
DC模式:使用当前块的上侧和左侧的参考像素的色度分量的重建值的平均值作为当前块的色度分量的预测值;
平面(Planar)模式:基于当前块的色度分量的值在空间线性平滑变化的假设计算当前块的色度分量的预测值;
水平(HOR)模式:使用当前块的左侧参考像素的色度分量的重建值作为当前块的同一行内所有像素的色度分量的预测值;
竖直(VER)模式:使用当前块的上侧参考像素的色度分量的重建值作为当前块同一列内所有像素的色度分量的预测值。
本申请实施例中,因为可使用相同的方法从亮度分量分别预测两个色度分量,所以下面可以用L表示亮度分量,用C表示任意一个色度分量来说明本申请实施例的技术方案。当前块中任意像素的色度分量的预测值可由同位置像素的亮度分量的重建值通过一个相关性函数关系f(x)映射得到。当某像素有色度分量但没有亮度分量与之对应时,(如图5C所示YUV 4:2:0格式下亮度分量采样点与色度分量采样点的位置关系),则可以先将亮度分量重采样至色度分量采样点的位置,得到L’,再进行预测,如公式(1.1)。此时,每一个色度分量的采样点都有一个亮度分量值和一个色度分量值。
pred c(i,j)=f(rec′ L(i,j))      (1.1)
其中,pred c(i,j)表示(i,j)位置上的像素的色度分量预测值。rec′ L(i,j)表示当前色度块对应亮度块重建后的重建块下采样至色度分量的分辨率后,对应(i,j)位置上的像素的亮度分量重建值。
需要注意的是,对于YUV4:2:0格式的视频图像,亮度分量的分辨率是色度分量分辨率的4倍(宽高各两倍),为了得到与色度块同分辨率的亮度块,需要将亮度分量按照色度分量相同的下采样方法下采样至色度分量分辨率后,再使用。
使用相关性函数映射关系f(x)表示从一个像素的亮度分量到色度分量的相关性模型,它可以是一次线性函数,也可以是二次多项式等其他函数。本申请实施例中将以公式(1.2)所示的线性相关性模型为例进行说明。采用该线性相关性模型对应的预测模式为跨分量预测(cross component prediction)模式(mode)。CCP模式又可以称为跨分量帧内预测(cross componen intra prediction,CCIP)模式,或者称为跨分量线性预测(cross component linear model,CCLM),或者简称为线性模型(linear model,LM)。
所述线性相关性模型的参数α和β可由一组亮度分量像素的重建值与色度分量像素的重建值计算得到。
pred c(i,j)=α*rec′ L(i,j)+β      (1.2)
其中,α,β为线性相关性模型系数。
线性相关性模型系数并不需要编码传输,而是使用当前色度块的相邻已重建块的边缘像素(即参考像素)以及所述边缘像素对应位置的亮度分量像素(同样需要所述下采样操作),构建出一组线性方程组,按照最小二乘法得到线性相关性模型系数α,β。
参见图7A~图7C所示,rec L为重建的亮度块(当前色度块对应亮度块以及相邻参考像素),rec′ L为经过下采样后的亮度块,rec′ C为当前色度块的相邻已重建的参考像素。当前色度块的尺寸为MxM,以其相邻上侧和左侧的相邻已重建像素作为参考像素,对应的亮度(luma)块的尺寸为2Mx2M,将luma块以及luma块的参考像素进行下采样至色度分量分辨率,得到图7B所示像素块。使用图7B和图7C中的参考像素构建线性方程组。记参考像素的个数为N,L(n)为图7B中重建的亮度块经过采样后的像素块中第n个像素的亮度分量的值,C(n)为重建的色度块中第n个像素的色度分量的值。则线性相关性模型的系数:
Figure PCTCN2019071209-appb-000001
Figure PCTCN2019071209-appb-000002
所选取的用于计算参数α和β的参考像素在本申请实施例中可以称作模板。本申请实施例中,如图8所示,对于LM模式同时使用上模板和左模板。上模板是当前块的上侧的参考像素,左模板是当前块的左侧的参考像素。
LM模式同时使用了上模板和左模板,但是如果模板中存在一些像素的线性相关性模型关系不同于图像块内像素的线性相关性模型关系,例如左模板和当前块属于不同的物体等,则会影响线性相关性模型系数的准确性。不同于LM模式同时使用了上模板和左模板(L型模板),多方向线性模型(multi-direction linear model,MDLM)模式可以仅使用上模板或者仅使用左模板用于计算线性相关性模型系数。
本申请实施例中,将仅使用上模板进行线性相关性模型系数计算的模式称为LMA模式,而将仅使用左模板进行线性相关性模型系数计算的模式为LML模式。
其中,所述LMA模式为采用所述当前块上方的参考像素确定线性相关性模型,并基于确定的相关性模型以及当前块的亮度分量重建值计算当前块色度分量预测值的模式。所述LML模式为采用所述当前块的左侧的参考像素确定线性相关性模型,并基于确定的相关性模型以及当前块的亮度分量重建值计算当前块色度分量预测值的模式。
另外,为了提供更大的模板(更多的参考像素用于计算线性相关性模型系数)得到更加稳定的线性相关性模型系数,在MDLM模式下,上模板和左模板的尺寸一般会延长扩大,例如参见图9所示。
现有的MDLM方法中,需要另外增加LMA和LML两种模式,相当于扩展了色度编码模式列表的长度,其他色度编码模式的索引值也会相应变长。以截断一元玛(Truncated Unary,TU)编码方式(二进制化方法)为例,没有使用MDLM模式之前的色度预测模式列表中的各种模式的索引值以及二进制比特表示如表1所示。而使用MDLM模式以后, 色度预测模式列表中各种模式的索引值以及二进制比特表示如表2所示。由于增加了LML,LMA两种模式,其他模式的编码比特长度相应变长,增加了编码开销。
表1
模式 索引值 编码比特(TU)
DM 0 0
LM 1 10
Planar 2 110
VER 3 1110
HOR 4 11110
DC 5 11111
表2
模式 索引值 编码比特(TU)
DM 0 0
LM 1 10
LMA 2 110
LML 3 1110
Planar 4 11110
VER 5 111110
HOR 6 1111110
DC 7 1111111
基于此,本申请实施例提供一种图像块的帧内预测方法及装置,用以解决现有编码比特长度变长,编码开销大的问题。第一方面,本申请实施例通过选择LMA模式或者LML模式,在色度预测模式列表中将LMA模式和LML模式通过MDLM替代,尽量避免增加编码比特长度,降低了编码开销。第二方面,本申请实施例确定LMA模式和LML模式在色度预测模式列表中的顺序,不同的顺序表示LMA模式和LML模式分别对应的编码比特长度不同。编码比特长度越短表示被选择的概率越大,尽量降低编码比特长度,降低编码开销。其中,方法和装置是基于同一发明构思的,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不予赘述。
下面,首先针对第一方面的方案进行详细说明。本申请实施例中通过将色度预测模式列表中MDLM模式来替代LMA模式和LML模式。具体的,色度预测模式列表可以参见表3所示。
表3
模式 索引值 编码比特(TU)
DM 0 0
LM 1 10
MDLM 2 110
Planar 3 1110
VER 4 11110
HOR 5 111110
DC 6 111111
参见图10所示,为本申请实施例提供的图像块的帧内预测方法。其中,该方法可以由视频编码器20执行,或者由设置在视频编码器20内部的处理器实现,或者由预测模块21执行,或者由用于执行编码功能的芯片执行。该方法还可以由视频解码器30执行,或者由设置在视频解码器30内部的处理器实现,或者由预测模块32执行,或者由用于执行解码功能的芯片执行。
S1001,确定当前块的色度分量采用的预测模式为MDLM模式,所述MDLM包括上模板线性模型LMA模式和左模板线性模型LML模式。
具体的,通过现有提供的选择预测模式的方式在色度预测模式列表中选择色度分量的预测模式为MDLM。
例如,在解码端,通过解析码流得到当前色度分量预测模式的索引值,按照索引值从色度色度预测模式列表中确定当前色度块的预测模式。例如表3中,如果索引值为2,则可确定当前色度分量的预测模式为MDLM模式。
在编码端,一般通过遍历各个可能的预测模式,然后通过率失真优化(rate-distortion optimazation,RDO)准则选择最佳模式。比如从预设的色度预测模式中,将最优的预测模式选择作为当前块的色度分量所采用的预测模式,如果当前遍历到的模式为MDLM模式,则可确定当前色度分量的预测模式为MDLM模式。
S1002,根据预配置策略确定所述当前块的色度分量采用的预测模式为LMA模式或者LML模式。其中,所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式。
可选地,所述当前块的上侧参考像素,可以是当前块的上侧相邻的参考像素;所述当前块的左侧参考像素,可以是当前块的左侧相邻的参考像素。
S1003,根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量预测值。
通过第一方面提供的方法,不需要在色度预测模式列表中增加LMA模式以及LML模式,便能够对LMA模式以及LML模式进行有效的编码,避免了增加编码比特长度,降低了编码开销。
本申请实施例的第一方面中,在步骤S1002,根据预配置策略确定所述当前块的色度分量采用的预测模式为LMA模式或者LML模式时,具体根据预配置策略选择LMA模式或者选择LML模式的方式可以包括如下几种方式:
第一选择方式是:以所述当前块的亮度分量采用的预测模式为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式。
第二种选择方式是:以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式。
第三选择方式是:以所述当前块的宽度值和高度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式。
下面通过实施例一~实施例三对以上第一种~第三种选择方式进行详细说明。
实施例一,参见图11A所示,对第一种选择方式详细说明。
S1101,获得当前块的色度分量采用的预测模式。
具体的,如果在解码流程中,则可以解析码流信息获得当前块的色度分量的编码模式的索引值,通过索引值得到当前块的色度分量编码的预测模式。例如,如果解析得到当前块的色度分量编码的预测模式的二进制码流为1110,则按照表3可知当前块色度分量的预测模式为Planar模式;如果当前块的色度分量的预测模式的二进制码流为110,则按照表3可知当前块色度分量的预测模式为MDLM模式。
如果在编码流程中,则可以基于色度预测模式列表,并通过RDO准则获得当前块的色度分量的采用的预测模式。
S1102,判断当前块的色度分量采用的预测模式是否为MDLM模式,如果是,则执行S1103,否则,执行S1104。
S1103,根据当前块的亮度分量采用的预测模式确定当前块的色度分量采用的预测模式。
由于当前块的亮度分量先于色度分量进行编码或者解码,在编码当前块的色度分量时,对应当前块的亮度分量的编码模式已确定。获取对应当前块的亮度分量的预测模式对应的第一参数值PML,如果PML偏竖直(参见图11B中(a)所示),则当前块的色度分量的预测模式使用LMA模式(参见图11B中(b)所示),如果PML偏水平,则当前块的色度分量的预测模式使用LML模式。
具体的,可以通过设置区间范围来判定PML偏竖直或者偏水平。
例如,第一范围=[VER-A,VER+B],VER表示垂直模式对应的第二参数值,A和B均为正整数;第二范围=[HOR-C,HOR+D],HOR表示水平模式对应的第三参数值,C和D均为正整数。
如果PML位于第一范围内,即VER-A≤PML≤VER+B,则PML偏竖直,则当前块的色度分量使用LMA模式;如果PML位于第二范围,即HOR-C≤PML≤HOR+D,则PML偏水平,则当前块的色度分量使用LML模式。
其中,A可以等于B,也可以不等于B;C可以等于D,也可以不等于D。例如,对于H.265中,共有33种方向性预测模式,其中VER对应26,HOR对应10。则可以设定[VER-A,VER+B]为[26-7,26+7]=[19,33],[HOR-C,HOR+D]=[10-7,10+7]=[3,17]。
需要注意的是,如果PML位于第一范围外,且位于第二范围外,即PML不属于上述两个范围。例如按照上述的范围配置,如果PML为0(Planar),或者为1(DC),或者18等,即不属于上述任一范围。此时可以设定一种默认情况,比如,默认使用LML模式,或者默认使用LMA模式,即配置一种预配置模式,预配置模式可以为LMA模式,或者为LML模式。例如,PML为0,确定所述当前块的色度分量采用的预测模式为预配置模式。
S1104,根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量预测值。
已知当前块的色度分量的预测模式,根据当前块的色度分量的预测模式得到当前块的色度分量预测值。例如,如果已知当前块的色度分量的预测模式为方向性预测模式,则按照模式对应的方向基于参考像素得到预测值。如果为LM模式,利用上模板和左模板(公式(2.1)和公式(2.2))计算线性相关性模型系数,并根据公式(1.2)得到当前块的色度 分量预测值。如果为LMA,则根据公式(1.2)、公式(2.1)和公式(2.2),仅使用上模板计算线性模型系数,得到当前块色度分量的预测值。
实施例二,参见图12所示,对第二种选择方式详细说明。实施例二与实施例一的不同在于,实施例二中并不使用亮度分量预测模式进行判断,而是通过比较亮度块中上模板和左模板中的平均梯度值的大小,自适应的判断当前块色度分量使用MDLM模式中的LMA模式还是LML模式。
S1201~S1202,具体可以参见步骤S1101~S1102,此处不再赘述。
S1203,根据所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式。
具体的,可以计算当前块下采样后的亮度块rec′ L中上模板的平均梯度值MGA和左模板的平均梯度值MGL。如果MGA大于MGL,则确定当前块色度分量使用MDLM模式中的LMA模式,如果MGA大于MGL,则确定当前块色度分量使用MDLM模式中的LML模式。如果MGA等于MGL,此时可以设定一种默认情况,比如,默认使用LML模式,或者默认使用LMA模式,即预先配置一种预配置模式,预配置模式可以为LMA模式,或者为LML模式。在MGA等于MGL时,则确定当前块色度分量使用预配置模式。
例如,可以使用[1,0,-1]算子进行计算,即采用每三个参考像素计算。例如,假设上模板中像素个数为NA,左模板中像素个数为NL。
Figure PCTCN2019071209-appb-000003
Figure PCTCN2019071209-appb-000004
其中,A(n)表示上模板中第n个参考像素的像素值,L(n)表示左模板中第n个参考像素的像素值。这里需要注意的是,由于[1,0,-1]仅可以计算NA-2或者NL-2个梯度值,因此这里计算均值时,使用的是NA-2或者NL-2。
另外,本申请实施例中对梯度值的计算方法并不限定。除了上述[1,0,-1]算子,还可以采用[1,-1]算子,参见公式(3.3)和公式(3.4),或者采用其它算子等,本申请实施例对此不作具体限定。
Figure PCTCN2019071209-appb-000005
Figure PCTCN2019071209-appb-000006
S1204,可以参见步骤S1104,此处不再赘述。
实施例三,参见图13所示,对第三种选择方式详细说明。实施例三与实施例一、实施例二的不同在于,实施例三中通过比较当前块的宽度值和高度值的大小,自适应的判断当前块色度分量使用MDLM模式中的LMA模式还是LML模式。
S1301~S1302,具体可以参见步骤S1101~S1102,此处不再赘述。
S1303,根据所述当前块的宽度值和高度值,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式。
具体的,如果当前块的宽度值大于高度值,则确定所述当前块的色度分量采用的预测模式为LML模式。如果当前块的高度值大于宽度值,则确定所述当前块的色度分量采用 的预测模式为LMA模式。如果当前块的高度值等于宽度值,此时可以设定一种默认情况,比如,默认使用LML模式,或者默认使用LMA模式,即预先配置一种预配置模式,预配置模式可以为LMA模式,或者为LML模式。在当前块的高度值等于宽度值时,则确定当前块色度分量使用预配置模式。
S1304,可以参见步骤S1104,此处不再赘述。
基于已有编码经验,如果某一区域偏竖直的纹理比较多,则相对而言,在划分图像块时,一般更倾向于划分的图像块的高度大于宽度。因此,大多数的图像也被划分成高度大于宽度的图像块。因此,通过本申请实施例三提供的方案,在当前块的高度值大于宽度值时,则确定采用上模板的LMA模式,保证了编码准确度。从而不需要在色度预测模式列表中增加LMA模式和LML模式,避免编码长度的增加,降低了编码开销。
以下针对第二方面的方案进行详细说明。通过在色度预测模式列表中同时保留LMA模式和LML模式,能够使LMA模式和LML模式的选择更准确。基于此,第二方面,通过对LMA模式和LML模式在色度预测模式列表中的顺序进行自适应调整,而不同的顺序影响编码比特的长度。
第二方面中通过重新确定LMA模式和LML模式在色度预测模式列表中的顺序。具体的,不同的顺序对应的色度预测模式列表可以参见表4所示。
表4
模式(顺序1) 模式(顺序2) 索引值 编码比特(TU)
DM DM 0 0
LM LM 1 10
LMA LML 2 110
LML LMA 3 1110
Planar Planar 4 11110
VER VER 5 111110
HOR HOR 6 1111110
DC DC 7 1111111
参见图14所示,为本申请实施例提供的图像块的帧内预测方法。其中,该方法可以由视频编码器20执行,或者由设置在视频编码器20内部的处理器实现,或者由预测模块21执行,或者由用于执行编码功能的芯片执行。该方法还可以由视频解码器30执行,或者由设置在视频解码器30内部的处理器实现,或者由预测模块32执行,或者由用于执行解码功能的芯片执行。
S1401,确定当前块的预测模式的索引值满足预设条件。即,确定当前块的色度分量的预测模式为LMA模式和LML模式中的一个。
比如,以色度预设模式列表为表4为例,当索引值为3或者4时,则确定当前块的预测模式的索引值满足预设条件。
S1402,根据预配置策略确定LMA模式以及LML模式在色度预测模式列表中的顺序。所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模 式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式。
S1403,根据所述索引值从所述确定顺序的LMA模式和LML模式中,确定所述当前块的色度分量采用的预测模式。
S1404,根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量的预测值。
通过第二方面提供的方法,自适应的对LMA模式和LML模式在色度预测模式列表中的顺序进行调整,将选择概率较高的模式对应的编码比特长度较短,进而提高LMA和LML的编码效率。
本申请实施例中,在步骤S1402,根据预配置策略确定LMA模式以及LML模式在色度预测模式列表中的顺序,可以包括如下几种确定方式:
第一确定顺序的方式是:以所述当前块的亮度分量采用的预测模式为参考,确定所述LMA模式和所述LML模式在所述色度预测模式列表中的顺序。
第二确定顺序的方式是:以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序。
第三确定顺序的方式是:以所述当前块的宽度值和高度值为参考,确定所述LMA模式和所述LML模式在所述色度预测模式列表中的顺序。
下面通过实施例四~实施例六对以上第一种~第三种确定顺序的方式进行详细说明。
实施例四,参见图15所示,对第一种确定顺序的方式详细说明。
S1501,获得当前块的色度分量采用的预测模式。
具体的,如果在解码流程中,则可以解析码流信息获得当前块的色度分量的编码模式的索引值,通过索引值得到当前块的色度分量编码的预测模式。例如,如果解析得到当前块的色度分量编码的预测模式的二进制码流为1110,则按照表3可知当前块色度分量的预测模式为Planar模式;如果当前块的色度分量的预测模式的二进制码流为110(1110),则按照表4可知当前块色度分量的预测模式为LMA模式和LML模式中的一种。
如果在编码流程中,则可以基于色度预测模式列表,并通过RDO准则获得当前块的色度分量的采用的预测模式。
S1502,判断当前块的色度分量采用的预测模式的索引值是否满足预设条件,如果是,则执行S1503,否则,执行S1505。
S1503,根据当前块的亮度分量采用的预测模式,确定LMA模式以及LML模式在所述色度预测模式列表中的顺序。
由于当前块的亮度分量先于色度分量进行编码或者解码,在编码当前块的色度分量时,对应当前块的亮度分量的编码模式已确定。获取对应当前块的亮度分量的预测模式对应的第一参数值PML,如果PML偏竖直,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第一顺序。第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值。如果PML偏水平,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第二顺序。第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值。
具体的,可以通过设置区间范围来判定PML偏竖直或者偏水平。
例如,第一范围=[VER-A,VER+B],VER表示垂直模式对应的第二参数值,A和B均为正整数;第二范围=[HOR-C,HOR+D],HOR表示水平模式对应的第三参数值,C和D均为正整数。
如果PML位于第一范围内,即VER-A≤PML≤VER+B,则PML偏竖直,则参见表3所示,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为顺序1;如果PML位于第二范围,即HOR-C≤PML≤HOR+D,则PML偏水平,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为顺序2。
其中,A可以等于B,也可以不等于B;C可以等于D,也可以不等于D。例如,对于H.265中,共有33种方向性预测模式,其中VER对应26,HOR对应10。则可以设定[VER-A,VER+B]为[26-7,26+7]=[19,33],[HOR-C,HOR+D]=[10-7,10+7]=[3,17]。
需要注意的是,如果PML位于第一范围外,且位于第二范围外,即PML不属于上述两个范围。例如按照上述的范围配置,如果PML为0(Planar),或者为1(DC),或者18等,即不属于上述任一范围。此时可以设定一种默认情况,比如,默认采用第一顺序,或者默认采用第二顺序,即配置一种预配置顺序,预配置模式可以为第一顺序或者为第二顺序。例如,PML为0,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为预配置顺序。
S1504,根据所述索引值从所述确定顺序的LMA模式和LML模式中,确定所述当前块的色度分量采用的预测模式。
比如,确定的顺序为顺序1,从接收到的码流中解析得到当前块的色度分量的预测模式的二进制码流为110,则确定当前的色度分量采用的预测模式为LMA模式。
S1505,根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量的预测值。具体获取预测值的方式可以参见实施例一中步骤S1504,此处不再赘述。
实施例五,参见图16所示,对第二种确定顺序的方式详细说明。
S1601~S1602,参加实施例四中步骤S1501~S1502,此处不再赘述。
S1603,根据所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序。
具体的,可以计算当前块下采样后的亮度块rec′ L中上模板的平均梯度值MGA和左模板的平均梯度值MGL。如果MGA大于MGL,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第一顺序。如果MGA大于MGL,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第二顺序。如果MGA等于MGL,此时可以设定一种默认情况,比如,默认采用第一顺序,或者默认采用第二顺序,即配置一种预配置顺序,预配置模式可以为第一顺序或者为第二顺序。例如,PML为0,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为预配置顺序。
具体计算MGA和MGL的方式可以参见实施例二中的描述,此处不再赘述。
S1604~S1605,可以参见实施例四中S1504~S1505,此处不再赘述。
实施例六,参见图17所示,对第三种确定顺序的方式详细说明。实施例六与实施例四、实施例五的不同在于,实施例六中通过比较当前块的宽度值和高度值的大小,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序。
S1701~S1702,具体可以参见步骤S1501~S1502,此处不再赘述。
S1703,根据所述当前块的宽度值和高度值,确定LMA模式以及LML模式在所述色度预测模式列表中的顺序。
具体的,在所述当前块的宽度值小于高度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值。在所述当前块的宽度值大于高度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值。在所述当前块的宽度值等于高度值时,此时可以设定一种默认情况,比如,默认采用第一顺序,或者默认采用第二顺序,即预先配置一种预配置顺序,预配置顺序可以为第一顺序或者为第二顺序。在当前块的高度值等于宽度值时,则确定当前块色度分量使用预配置模式。
S1704~S1705,可以参见实施例四中S1504~S1505,此处不再赘述。
基于与方法实施例同样的发明构思,本申请实施例还提供了一种装置,该装置1800具体可以是视频编码器中的处理器,或者芯片或者芯片系统,或者是视频编码器中一个模块,比如帧内预测模块211,或者可以是视频解码器中的处理器,或者芯片或者芯片系统,或者是视频解码器中的一个模块,比如帧内预测模块321。示意性的,该装置可以包括确定单元1801、选择单元1802、计算单元1803。确定单元1801、选择单元1802、计算单元1803用于执行图10~图13对应的实施例所示的方法步骤。比如确定单元1801可以用于确定当前块的色度分量采用的预测模式为MDLM模式,所述MDLM包括LMA模式和LML模式。选择单元1802可以用于根据预配置策略确定所述当前块的色度分量采用的预测模式为LMA模式或者LML模式,其中,所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式。计算单元1803可以用于根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量预测值。
本申请实施例还提供该装置另外一种结构,如图19所示,装置1900中可以包括通信接口1910、处理器1920。可选的,装置1900中还可以包括存储器1930。其中,存储器1930可以设置于装置内部,还可以设置于装置外部。上述图18中所示的确定单元1801、选择单元1802,以及计算单元1803均可以由处理器1920实现。处理器1920通过通信接口1910发送或者接收视频流或者码流,并用于实现图10~图13中所述的方法。在实现过程中,处理流程的各步骤可以通过处理器1920中的硬件的集成逻辑电路或者软件形式的指令完成图10~图13中所述的方法。
本申请实施例中通信接口1910可以是电路、总线、收发器或者其它任意可以用于进行信息交互的装置。其中,示例性地,该其它装置可以是与装置1900相连的设备,比如,该装置是视频编码器时,则其它装置可以是视频解码器。
本申请实施例中处理器1920可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件单元组合执行完成。处理器1920用于实现上述方法所执行的程序代码可以存储在存储器1930中。存储器1930和处理器1920耦合。
本申请实施例中的耦合是装置、单元或模块之间的间接耦合或通信连接,可以是电性,机械或其它的形式,用于装置、单元或模块之间的信息交互。
处理器1920可能和存储器1930协同操作。存储器1930可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM)。存储器1930是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。
本申请实施例中不限定上述通信接口1910、处理器1920以及存储器1930之间的具体连接介质。本申请实施例在图19中以存储器1930、处理器1920以及通信接口1910之间通过总线连接,总线在图19中以粗线表示,其它部件之间的连接方式,仅是进行示意性说明,并不引以为限。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图19中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
基于与方法实施例同样的发明构思,本申请实施例还提供了一种装置,该装置2000具体可以是视频编码器中的处理器,或者芯片或者芯片系统,或者是视频编码器中一个模块,比如帧内预测模块211,或者可以是视频解码器中的处理器,或者芯片或者芯片系统,或者是视频解码器中的一个模块,比如帧内预测模块321。示意性的,该装置可以包括确定单元2001以及计算单元2005。其中确定单元2001具体可以包括第一确定单元2002、第二确定单元2003、第三确定单元2004。第一确定单元2002、第二确定单元2003、第三确定单元2004以及计算单元2005用于执行图14~图17对应的实施例所示的方法步骤。比如第一确定单元2002可以用于确定当前块的预测模式的索引值满足预设条件。第二确定单元2003可以用于根据预配置策略确定上模板线性模型LMA模式以及左模板线性模型LML模式在色度预测模式列表中的顺序,所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式。第三确定单元2004可以用于根据所述索引值从所述确定顺序的LMA模式和LML模式中,确定所述当前块的色度分量采用的预测模式。计算单元2005可以用于根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量的预测值。
本申请实施例还提供该装置另外一种结构,如图21所示,装置2100中可以包括通信接口2110、处理器2120。可选的,装置2100中还可以包括存储器2130。其中,存储器2130可以设置于装置内部,还可以设置于装置外部。上述图20中所示的确定单元2001以及计算单元2004均可以由处理器2120实现。处理器2120通过通信接口2110发送或者接收视频流或者码流,并用于实现图14~图17中所述的方法。在实现过程中,处理流程的各步骤 可以通过处理器2120中的硬件的集成逻辑电路或者软件形式的指令完成图14~图17中所述的方法。
本申请实施例中通信接口2110可以是电路、总线、收发器或者其它任意可以用于进行信息交互的装置。其中,示例性地,该其它装置可以是与装置2100相连的设备,比如,该装置是视频编码器时,则其它装置可以是视频解码器。
本申请实施例中处理器2120可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件单元组合执行完成。处理器2120用于实现上述方法所执行的程序代码可以存储在存储器2130中。存储器2130和处理器2120耦合。
本申请实施例中的耦合是装置、单元或模块之间的间接耦合或通信连接,可以是电性,机械或其它的形式,用于装置、单元或模块之间的信息交互。
处理器2120可能和存储器2130协同操作。存储器2130可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM)。存储器2130是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。
本申请实施例中不限定上述通信接口2110、处理器2120以及存储器2130之间的具体连接介质。本申请实施例在图21中以存储器2130、处理器2120以及通信接口2110之间通过总线连接,总线在图21中以粗线表示,其它部件之间的连接方式,仅是进行示意性说明,并不引以为限。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图21中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
基于以上实施例,本申请实施例还提供了一种计算机存储介质,该存储介质中存储软件程序,该软件程序在被一个或多个处理器读取并执行时可实现上述任意一个或多个实施例提供的方法。所述计算机存储介质可以包括:U盘、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
基于以上实施例,本申请实施例还提供了一种芯片,该芯片包括处理器,用于实现上述任意一个或多个实施例所涉及的功能,例如获取或处理上述方法中所涉及的信息或者消息。可选地,所述芯片还包括存储器,所述存储器,用于处理器所执行必要的程序指令和数据。该芯片,可以由芯片构成,也可以包含芯片和其他分立器件。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指 令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (23)

  1. 一种图像块的帧内预测方法,其特征在于,包括:
    确定当前块的色度分量采用的预测模式为多方向线性模型MDLM模式,所述MDLM包括上模板线性模型LMA模式和左模板线性模型LML模式;
    根据预配置策略确定所述当前块的色度分量采用的预测模式为LMA模式或者LML模式,其中,所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式;
    根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量预测值。
  2. 如权利要求1所述的方法,其特征在于,根据所述预配置策略确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式,包括:
    以所述当前块的亮度分量采用的预测模式为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式;或者,
    以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式;或者,
    以所述当前块的宽度值和高度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式。
  3. 如权利要求2所述的方法,其特征在于,以所述当前块的亮度分量采用的预测模式为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式,包括:
    确定所述当前块的亮度分量采用的预测模式对应的第一参数值;
    在确定所述第一参数值位于第一范围内时,确定所述当前块的色度分量采用的预测模式为LMA模式;或者,
    在确定所述第一参数值位于第二范围内时,确定所述当前块的色度分量采用的预测模式为LML模式;或者,
    在确定所述第一参数值位于所述第一范围外,且所述第一参数值位于所述第二范围外时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为LMA模式或者LML模式;
    其中,第一范围=[VER-A,VER+B],VER表示垂直模式对应的第二参数值,A和B均为正整数;第二范围=[HOR-C,HOR+D],HOR表示水平模式对应的第三参数值,C和D均为正整数。
  4. 如权利要求2所述的方法,其特征在于,以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式,包括:
    在所述当前块的左侧参考像素的亮度分量的平均梯度值大于所述当前块的上侧参考像素的亮度分量的平均梯度值时,确定所述当前块的色度分量采用的预测模式为所述LML模式;或者,
    在所述当前块的左侧参考像素的亮度分量的平均梯度值小于所述当前块的上侧参考像素的亮度分量的平均梯度值时,确定所述当前块的色度分量采用的预测模式为所述LMA模式;或者,
    在所述当前块的左侧参考像素的亮度分量的平均梯度值等于所述当前块的上侧参考像素的亮度分量平均梯度值时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为所述LMA模式或者所述LML模式。
  5. 如权利要求2所述的方法,其特征在于,以所述当前块的宽度值和高度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式,包括:
    在所述当前块的宽度值大于高度值时,确定所述当前块的色度分量采用的预测模式为所述LML模式;或者,
    在所述当前块的宽度值小于高度值时,确定所述当前块的色度分量采用的预测模式为所述LMA模式;或者,
    在所述当前块的宽度值等于高度值时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为所述LMA模式或者所述LML模式。
  6. 一种图像块的帧内预测方法,其特征在于,包括:
    确定当前块的预测模式的索引值满足预设条件;
    根据预配置策略确定上模板线性模型LMA模式和左模板线性模型LML模式在色度预测模式列表中的顺序,所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式;
    根据所述索引值从所述确定顺序的LMA模式和LML模式中,确定所述当前块的色度分量采用的预测模式;
    根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量的预测值。
  7. 如权利要求6所述的方法,其特征在于,根据预配置策略确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序,包括:
    以所述当前块的亮度分量采用的预测模式为参考,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序;或者,
    以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序;或者,
    以所述当前块的宽度值和高度值为参考,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序。
  8. 如权利要求7所述的方法,其特征在于,以所述当前块的亮度分量采用的预测模式为参考,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序,包括:
    确定所述当前块的亮度分量采用的预测模式对应的第一参数值;
    在确定所述第一参数值位于第一范围内时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
    在确定所述第一参数值位于第二范围内时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
    在确定所述第一参数值位于所述第一范围外,且所述第一参数值位于所述第二范围外时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序;
    其中,第一范围=[VER-A,VER+B],VER表示垂直模式对应的第二参数值,A和B均为正整数;第二范围=[HOR-C,HOR+D],HOR表示水平模式对应的第三参数值,C和D均为正整数。
  9. 如权利要求7所述的方法,其特征在于,以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序,包括:
    在所述当前块的上侧参考像素的亮度分量的平均梯度值大于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
    在所述当前块的上侧参考像素的亮度分量的平均梯度值小于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
    在所述当前块的上侧参考像素的亮度分量的平均梯度值等于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序。
  10. 如权利要求7所述的方法,其特征在于,以所述当前块的宽度值和高度值为参考,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序,包括:
    在所述当前块的宽度值小于高度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
    在所述当前块的宽度值大于高度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
    在所述当前块的宽度值等于高度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序。
  11. 一种图像块的帧内预测装置,其特征在于,包括:
    确定单元,用于确定当前块的色度分量采用的预测模式为多方向线性模型MDLM模式,所述MDLM包括上模板线性模型LMA模式和左模板线性模型LML模式;
    选择单元,用于根据预配置策略确定所述当前块的色度分量采用的预测模式为LMA模式或者LML模式,其中,所述LMA模式为基于所述当前块的上侧参考像素计算所述当 前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式;
    计算单元,用于根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量预测值。
  12. 如权利要求11所述的装置,其特征在于,所述选择单元,具体用于:
    以所述当前块的亮度分量采用的预测模式为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式;或者,
    以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式;或者,
    以所述当前块的宽度值和高度值为参考,确定所述当前块的色度分量采用的预测模式为所述LMA模式或者所述LML模式。
  13. 如权利要求12所述的装置,其特征在于,所述选择单元,具体用于:
    确定所述当前块的亮度分量采用的预测模式对应的第一参数值;
    在确定所述第一参数值位于第一范围内时,确定所述当前块的色度分量采用的预测模式为LMA模式;或者,
    在确定所述第一参数值位于第二范围内时,确定所述当前块的色度分量采用的预测模式为LML模式;或者,
    在确定所述第一参数值位于所述第一范围外,且所述第一参数值位于所述第二范围外时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为LMA模式或者LML模式;
    其中,第一范围=[VER-A,VER+B],VER表示垂直模式对应的第二参数值,A和B均为正整数;第二范围=[HOR-C,HOR+D],HOR表示水平模式对应的第三参数值,C和D均为正整数。
  14. 如权利要求12所述的装置,其特征在于,所述选择单元,具体用于:
    在所述当前块的左侧参考像素的亮度分量的平均梯度值大于所述当前块的上侧参考像素的亮度分量的平均梯度值时,确定所述当前块的色度分量采用的预测模式为所述LML模式;或者,
    在所述当前块的左侧参考像素的亮度分量的平均梯度值小于所述当前块的上侧参考像素的亮度分量的平均梯度值时,确定所述当前块的色度分量采用的预测模式为所述LMA模式;或者,
    在所述当前块的左侧参考像素的亮度分量的平均梯度值等于所述当前块的上侧参考像素的亮度分量的平均梯度值时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为所述LMA模式或者所述LML模式。
  15. 如权利要求12所述的装置,其特征在于,所述选择单元,具体用于:
    在所述当前块的宽度值大于高度值时,确定所述当前块的色度分量采用的预测模式为所述LML模式;或者,
    在所述当前块的宽度值小于高度值时,确定所述当前块的色度分量采用的预测模式为所述LMA模式;或者,
    在所述当前块的宽度值等于高度值时,确定所述当前块的色度分量采用的预测模式为预配置模式,所述预配置模式为所述LMA模式或者所述LML模式。
  16. 一种图像块的帧内预测装置,其特征在于,包括:
    确定单元,用于确定当前块的预测模式的索引值满足预设条件;用于根据预配置策略确定上模板线性模型LMA模式以及左模板线性模型LML模式在色度预测模式列表中的顺序,所述LMA模式为基于所述当前块的上侧参考像素计算所述当前块的色度分量预测值的模式,所述LML模式为基于所述当前块的左侧参考像素计算所述当前块的色度分量预测值的模式;并用于根据所述索引值从所述确定顺序的LMA模式和LML模式中,确定所述当前块的色度分量采用的预测模式;
    计算单元,用于根据确定的所述当前块的色度分量采用的预测模式,获得所述当前块的色度分量的预测值。
  17. 如权利要求16所述的装置,其特征在于,所述确定单元,具体用于:
    以所述当前块的亮度分量采用的预测模式为参考,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序;或者,
    以所述当前块的左侧参考像素的亮度分量的平均梯度值、和所述当前块的上侧参考像素的亮度分量的平均梯度值为参考,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序;或者,
    以所述当前块的宽度值和高度值为参考,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序。
  18. 如权利要求17所述的装置,其特征在于,所述确定单元具体用于:
    确定所述当前块的亮度分量采用的预测模式对应的第一参数值;
    在确定所述第一参数值位于第一范围内时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
    在确定所述第一参数值位于第二范围内时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
    在确定所述第一参数值位于所述第一范围外,且所述第一参数值位于所述第二范围外时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序;
    其中,第一范围=[VER-A,VER+B],VER表示垂直模式对应的第二参数值,A和B均为正整数;第二范围=[HOR-C,HOR+D],HOR表示水平模式对应的第三参数值,C和D均为正整数。
  19. 如权利要求17所述的装置,其特征在于,所述确定单元,具体用于:
    在所述当前块的上侧参考像素的亮度分量的平均梯度值大于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
    在所述当前块的上侧参考像素的亮度分量的平均梯度值小于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在所述色度预测 模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
    在所述当前块的上侧参考像素的亮度分量的平均梯度值等于所述当前块的左侧参考像素的亮度分量的平均梯度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序。
  20. 如权利要求17所述的装置,其特征在于,所述确定单元,具体用于:
    在所述当前块的宽度值小于高度值时,确定所述LMA模式以及所述LML模式在所述色度预测模式列表中的顺序为第一顺序,所述第一顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值小于所述LML模式的索引值;或者,
    在所述当前块的宽度值大于高度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为第二顺序,所述第二顺序表征所述LMA模式在所述色度预测模式列表中对应的索引值大于所述LML模式对应的索引值;或者,
    在所述当前块的宽度值等于高度值时,确定所述LMA模式以及所述LML模式在色度预测模式列表中的顺序为预配置顺序,所述预配置顺序为所述第一顺序或者为所述第二顺序。
  21. 一种编码器,其特征在于,包括:
    存储器以及处理器;
    所述存储器,用于存储程序指令;
    所述处理器,用于调用并执行所述存储器中存储的程序指令,以实现如权利要求1至10中任一项所述的方法。
  22. 一种解码器,其特征在于,包括:
    存储器以及处理器;
    所述存储器,用于存储程序指令;
    所述处理器,用于调用并执行所述存储器中存储的程序指令,以实现如权利要求1至10中任一项所述的方法。
  23. 一种芯片,其特征在于,所述芯片与存储器相连,用于读取并执行所述存储器中存储的软件程序,以实现如权利要求1至10任一项所述的方法。
PCT/CN2019/071209 2018-03-16 2019-01-10 一种图像块的帧内预测方法及装置 WO2019174389A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810219434.9A CN110278435B (zh) 2018-03-16 2018-03-16 一种图像块的帧内预测方法及装置
CN201810219434.9 2018-03-16

Publications (1)

Publication Number Publication Date
WO2019174389A1 true WO2019174389A1 (zh) 2019-09-19

Family

ID=67908626

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/071209 WO2019174389A1 (zh) 2018-03-16 2019-01-10 一种图像块的帧内预测方法及装置

Country Status (2)

Country Link
CN (1) CN110278435B (zh)
WO (1) WO2019174389A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112532997A (zh) * 2019-10-04 2021-03-19 Oppo广东移动通信有限公司 图像预测方法、编码器、解码器以及存储介质
US11477444B2 (en) 2019-08-06 2022-10-18 Hfi Innovation Inc. Method and apparatus of encoding or decoding video data with intra prediction mode mapping
US11785221B2 (en) 2019-10-04 2023-10-10 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Encoding and decoding method, apparatus and communication system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992913B (zh) * 2021-12-29 2022-05-17 康达洲际医疗器械有限公司 一种可适用于vvc编码标准的帧内跨分量预测方法与系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101494792A (zh) * 2009-01-15 2009-07-29 北京航空航天大学 一种基于边缘特征的h.264/avc帧内预测方法
CN102355579A (zh) * 2011-02-24 2012-02-15 中兴通讯股份有限公司 一种预测模式的编码或解码方法及装置
CN103096055A (zh) * 2011-11-04 2013-05-08 华为技术有限公司 一种图像信号帧内预测及解码的方法和装置
CN103227917A (zh) * 2012-01-31 2013-07-31 华为技术有限公司 解码方法和装置
US20130251028A1 (en) * 2012-03-22 2013-09-26 The Hong Kong University Of Science And Technology Video encoding and decoding with channel prediction and error correction capability

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3021578B1 (en) * 2013-07-10 2019-01-02 KDDI Corporation Sub-sampling of reference pixels for chroma prediction based on luma intra prediction mode

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101494792A (zh) * 2009-01-15 2009-07-29 北京航空航天大学 一种基于边缘特征的h.264/avc帧内预测方法
CN102355579A (zh) * 2011-02-24 2012-02-15 中兴通讯股份有限公司 一种预测模式的编码或解码方法及装置
CN103096055A (zh) * 2011-11-04 2013-05-08 华为技术有限公司 一种图像信号帧内预测及解码的方法和装置
CN103227917A (zh) * 2012-01-31 2013-07-31 华为技术有限公司 解码方法和装置
US20130251028A1 (en) * 2012-03-22 2013-09-26 The Hong Kong University Of Science And Technology Video encoding and decoding with channel prediction and error correction capability

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11477444B2 (en) 2019-08-06 2022-10-18 Hfi Innovation Inc. Method and apparatus of encoding or decoding video data with intra prediction mode mapping
CN112532997A (zh) * 2019-10-04 2021-03-19 Oppo广东移动通信有限公司 图像预测方法、编码器、解码器以及存储介质
CN112532997B (zh) * 2019-10-04 2023-05-23 Oppo广东移动通信有限公司 图像预测方法、编码器、解码器以及存储介质
US11785221B2 (en) 2019-10-04 2023-10-10 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Encoding and decoding method, apparatus and communication system

Also Published As

Publication number Publication date
CN110278435A (zh) 2019-09-24
CN110278435B (zh) 2021-11-19

Similar Documents

Publication Publication Date Title
JP6710682B2 (ja) ビデオコーディングにおける適応色変換のためのqp導出およびオフセット
TW201841501A (zh) 用於視訊寫碼之多種類型樹架構
TW202101989A (zh) 用於視訊寫碼之參考圖像重採樣及框間寫碼工具
TW202143717A (zh) 視頻譯碼中的亮度映射與色度縮放(lmcs)
WO2020220884A1 (zh) 视频序列的帧内预测方法及装置
TW201907718A (zh) 用於不可分開轉換之記憶體減少
TW202110189A (zh) 用於視訊寫碼的環繞運動補償
WO2019174389A1 (zh) 一种图像块的帧内预测方法及装置
TW202115977A (zh) 用於視訊編碼的跨分量自我調整迴路濾波
TW202025767A (zh) 具有適應性方向性資訊集合之最終動作向量表示
TWI826487B (zh) 用於視訊寫碼中之適應性運動向量差解析度及增加的運動向量儲存精確度的運動向量捨位
US11985309B2 (en) Picture coding method, picture decoding method, and related apparatuses
WO2019184639A1 (zh) 一种双向帧间预测方法及装置
TW202044833A (zh) 使用不同色度格式之三角預測單元模式中之視訊寫碼
TW202135531A (zh) 用於視訊編解碼的經解碼圖片緩衝器(dpb)參數訊號傳遞通知
WO2020114394A1 (zh) 视频编解码方法、视频编码器和视频解码器
TW202034695A (zh) 用於視訊寫碼之限制仿射運動繼承
TW201943270A (zh) 去區塊濾波器及自適應迴路濾波器之統一
JP2022538060A (ja) クロマ量子化パラメータ(qp)マッピングテーブルをシグナリングすること
JP7410236B2 (ja) ビデオ符号化のための位置依存の空間変化変換
TW202139715A (zh) 視訊譯碼中的參考圖片列表和共位圖片訊號傳遞
TW202123701A (zh) 具有協調的運動場儲存及運動補償的幾何分區模式
TW201921938A (zh) 具有在用於視訊寫碼之隨機存取組態中之未來參考訊框之可調適圖像群組結構
CN114514748A (zh) 图像编码方法、图像解码方法及相关装置
TW202133619A (zh) 用於合併估計區域的基於歷史的運動向量預測約束

Legal Events

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

Ref document number: 19767638

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19767638

Country of ref document: EP

Kind code of ref document: A1