WO2020007187A1 - Image block decoding method and device - Google Patents

Image block decoding method and device Download PDF

Info

Publication number
WO2020007187A1
WO2020007187A1 PCT/CN2019/091505 CN2019091505W WO2020007187A1 WO 2020007187 A1 WO2020007187 A1 WO 2020007187A1 CN 2019091505 W CN2019091505 W CN 2019091505W WO 2020007187 A1 WO2020007187 A1 WO 2020007187A1
Authority
WO
WIPO (PCT)
Prior art keywords
correction amount
image block
prediction
preset
value
Prior art date
Application number
PCT/CN2019/091505
Other languages
French (fr)
Chinese (zh)
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 WO2020007187A1 publication Critical patent/WO2020007187A1/en

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/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Definitions

  • the present application relates to the technical field of video coding and decoding, and in particular, to a method and a device for decoding an image block.
  • Digital video capabilities can be incorporated into a wide variety of devices, including digital television, digital live broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, Digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radio phones (so-called "smart phones"), video teleconferencing devices, video streaming devices, and the like .
  • Digital video devices implement video compression technology, for example, in standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10 Advanced Video Coding (AVC), Video coding standards described in the H.265 / High Efficiency Video Coding (HEVC) standard and extensions to such standards.
  • Video devices can implement such video compression techniques to more efficiently transmit, receive, encode, decode, and / or store digital video information.
  • Video compression techniques perform spatial (intra-image) prediction and / or temporal (inter-image) prediction to reduce or remove redundancy inherent in video sequences.
  • a video slice ie, a video frame or a portion of a video frame
  • image blocks can also be referred to as tree blocks, coding units (CU), and / or coding nodes .
  • Spatial predictions about reference samples in neighboring blocks in the same image are used to encode image blocks in the to-be-encoded (I) slice of the image.
  • the image blocks in the to-be-intercoded (P or B) slice of the image may use spatial prediction relative to reference samples in neighboring blocks in the same image or temporal prediction relative to reference samples in other reference images.
  • An image may be referred to as a frame, and a reference image may be referred to as a reference frame.
  • various video coding standards including the High-Efficiency Video Coding (HEVC) standard have proposed predictive coding modes for image blocks, that is, predicting a current block to be coded based on a video data block that has been coded.
  • HEVC High-Efficiency Video Coding
  • intra prediction mode the current block is predicted based on one or more previously decoded neighboring blocks in the same image as the current block; in inter prediction mode, the current block is predicted based on already decoded blocks in different images.
  • the intra prediction mode includes a directional mode and a non-directional mode
  • the non-directional mode includes a direct current (DC) mode and a plane (Planar) mode.
  • An existing Planar mode uses the following methods to generate any pixel in the current image block. Predicted value, the predicted value of the pixel is recorded as P (x, y), where (x, y) represents the coordinate position of the pixel, the upper left corner of the current image block is the (0,0) position, and the horizontal right is the positive direction of the x axis , Vertical downward is the positive direction of the y-axis.
  • the prediction value of the pixel closer to P (W, H) is closer to P (W, H).
  • the prediction residual in the lower right part of the prediction image generated by this prediction method is large and the prediction efficiency is low.
  • the embodiments of the present application provide an image block decoding method and device, which can improve the prediction accuracy of the motion information of the image block, thereby improving the encoding and decoding performance.
  • an image block decoding method including: parsing a bitstream to obtain a prediction residual, a prediction mode, and prediction reference information of a current image block to be decoded; wherein when the prediction mode is a planar prediction mode, The prediction reference information includes a prediction correction amount sequence number; if the prediction mode of the current image block is a planar prediction mode, determining a prediction correction amount based on the prediction correction amount number; and obtaining a A predicted image; obtaining a reconstructed image of the current image block based on the predicted image of the current image block and the prediction residual of the current image block.
  • determining the prediction correction amount based on the prediction correction amount number includes: if the prediction correction amount number is a first preset number, determining the prediction correction amount as A first preset correction amount; if the predicted correction amount number is a second preset number, determining the predicted correction amount as a second preset correction amount.
  • the first preset correction amount and the second preset correction amount are opposite numbers to each other.
  • the first preset serial number may be 1 and the second preset serial number may be 2.
  • the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
  • A1 Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
  • A1 represents the first preset correction amount
  • pow (2, BD– 8) represents the BD-8 power of 2
  • H represents the height of the current image block
  • W represents the width of the current image block
  • the determining a prediction correction amount based on the prediction correction amount number includes:
  • the predicted correction amount number is a first preset number, determine the predicted correction amount as a third preset number; if the predicted correction amount is a second preset number, determine the predicted correction amount Is the fourth preset correction amount; if the predicted correction amount number is a third preset number, determining that the predicted correction amount is a fifth preset correction amount; or if the predicted correction amount number is a fourth preset number
  • the serial number determines that the predicted correction amount is a sixth preset correction amount.
  • the third preset correction amount and the fourth preset correction amount are opposite numbers to each other; and the fifth preset correction amount and the sixth preset correction amount are opposite numbers to each other.
  • the first preset serial number can be 1, the second preset serial number can be 2, the third preset serial number can be 3, and the fourth preset serial number can be 4.
  • the third preset correction amount and the fifth preset correction amount are preset positive integers, and the fifth preset correction amount is greater than the third preset correction amount.
  • the fifth preset correction amount may be the third preset correction amount.
  • the amount is 1.75 times, or 2 times, or 2.25 times.
  • the determining a prediction correction amount based on the prediction correction amount number includes: comparing a value of a lower left reference pixel of the current image block with an upper right reference pixel of the current image block The weighted average value is used to obtain a weighted average value; when the weighted average value is less than the value of the upper left reference pixel of the current image block, if the prediction correction amount serial number is a first preset serial number, the prediction is determined The correction amount is a first preset correction amount; if the predicted correction amount number is a second preset number, determining that the predicted correction amount is a second preset correction amount; or when the weighted average is not less than the weighted average When the value of the upper left reference pixel of the current image block is, if the predicted correction amount is a first preset number, it is determined that the predicted correction amount is a second preset correction amount; if the predicted correction amount number is a second The preset serial number determines that the predicted correction
  • the first preset correction amount and the second preset correction amount are opposite numbers to each other.
  • the weighted average value may specifically be a predicted value of a lower right pixel of the current image block, and may be obtained by, for example, the following calculation formula:
  • P1 (W, H) P (W, –1) * a + P (–1, H) * (1–a);
  • P1 (W, H) represents the predicted value of the lower right pixel
  • P (W, –1) represents the value of the upper right reference pixel
  • P (–1, H) represents the value of the lower left reference pixel
  • a can be a preset value, such as 0.4, 0.5, or 0.6, etc .
  • the upper left reference pixel, the lower left reference pixel, the upper right reference pixel, and the lower right pixel do not belong to the current image block.
  • the current image block is an image block of W * H
  • the range of the abscissa of the pixel in the current image block is [0, W-1]
  • the range of the ordinate of the pixel in the current image block is [ 0, H-1]
  • the coordinates of the upper left reference pixel are (-1, -1)
  • the coordinates of the lower left reference pixel are (-1, H)
  • the coordinates of the lower right pixel are ( W, H)
  • the coordinates of the upper right reference pixel are (W, -1).
  • the first preset serial number may be 1 and the second preset serial number may be 2.
  • the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
  • A1 Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
  • A1 represents the first preset correction amount
  • pow (2, BD– 8) represents the BD-8 power of 2
  • H represents the height of the current image block
  • W represents the width of the current image block
  • determining the prediction correction amount based on the prediction correction amount number includes: if the prediction correction amount number is a first preset number, based on a lower left of the current image block The value of the reference pixel, the value of the upper right reference pixel of the current image block and the value of the upper left reference pixel of the current image block are used to obtain a difference value; and the prediction correction amount is determined based on the difference value.
  • the difference value is obtained through calculation by the following calculation formula:
  • D represents the difference value
  • P (W, –1) represents the value of the lower left reference pixel of the current image block
  • P (–1, H) represents the value of the upper right reference pixel of the current image block
  • P (–1, –1) represents the value of the upper left reference pixel of the current image block
  • a can be a preset value, such as 0.4, 0.5, or 0.6, etc .
  • a can also be the same as all
  • the determining the prediction correction amount based on the difference value includes:
  • the prediction correction amount is determined based on the following calculation formula:
  • M represents the predicted correction amount
  • D represents the difference value.
  • B3 is a preset positive integer
  • B4 is a preset positive integer
  • the obtaining a predicted image of the current image block based on the prediction correction amount includes: based on the prediction correction The predicted value of the lower right pixel of the current image block is modified by a quantity; and the predicted image of the current image block is obtained based on the corrected value of the predicted value of the lower right pixel of the current image block.
  • the method before obtaining a prediction image of the current image block based on a correction value of a prediction value of a lower right pixel of the current image block
  • the method further includes: limiting the correction value of the predicted value of the lower right pixel of the current image block to a preset value range, the preset value range is [0, pow (2, N ) –1], where pow (2, N) represents the Nth power of 2, and N represents the bit width.
  • the prediction value of the prediction value of the lower right pixel of the current image block is less than 0, the prediction value of the lower right pixel of the current image block is corrected to 0, that is, the correction value of the prediction value of the lower right pixel of the current image block is 0; if the correction value of the prediction value of the bottom right pixel of the current image block is greater than, the prediction value of the bottom right pixel of the current image block is modified to pow (2, N) -1, that is, the The correction value of the predicted value is pow (2, N) –1; if the correction value of the predicted value of the lower right pixel of the current image block is greater than or equal to 0 and less than or equal to pow (2, N) –1, then it is not required Correct the predicted value of the lower right pixel of the current image block, that is, the predicted value of the lower right pixel of the current image block is the predicted value of the lower right pixel of the current image block.
  • an image block decoding apparatus including: an entropy decoder for parsing a bitstream to obtain a prediction residual, a prediction mode, and prediction reference information of a current image block to be decoded; wherein, in the prediction mode, When the prediction mode is a planar prediction mode, the prediction reference information includes a prediction correction quantity number; an intra predictor is used to determine a prediction correction quantity based on the prediction correction quantity number when the prediction mode of the current image block is a planar prediction mode; Obtaining a predicted image of the current image block based on the prediction correction amount; a reconstruction unit for obtaining a reconstruction of the current image block based on the predicted image of the current image block and the prediction residual of the current image block image.
  • the intra predictor is specifically configured to: if the prediction correction amount is a first preset number, determine the prediction correction amount as a first preset correction Or if the serial number of the predicted correction amount is a second preset serial number, determining that the predicted correction amount is a second preset correction amount.
  • the first preset correction amount and the second preset correction amount are opposite numbers to each other.
  • the first preset serial number may be 1 and the second preset serial number may be 2.
  • the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
  • A1 Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
  • A1 represents the first preset correction amount
  • pow (2, BD– 8) represents the BD-8 power of 2
  • H represents the height of the current image block
  • W represents the width of the current image block
  • the intra predictor is specifically configured to: if the prediction correction amount is a first preset number, determine that the prediction correction amount is a third preset correction If the predicted correction amount number is a second preset number, determine the predicted correction amount as a fourth preset number; if the predicted correction amount serial number is a third preset number, determine the prediction The correction amount is a fifth preset correction amount; or if the predicted correction amount number is a fourth preset number, determining that the predicted correction amount is a sixth preset correction amount.
  • the third preset correction amount and the fourth preset correction amount are opposite numbers to each other; and the fifth preset correction amount and the sixth preset correction amount are opposite numbers to each other.
  • the first preset serial number can be 1, the second preset serial number can be 2, the third preset serial number can be 3, and the fourth preset serial number can be 4.
  • the third preset correction amount and the fifth preset correction amount are preset positive integers, and the fifth preset correction amount is greater than the third preset correction amount.
  • the fifth preset correction amount may be the third preset correction amount.
  • the amount is 1.75 times, or 2 times, or 2.25 times.
  • the intra predictor is specifically configured to:
  • the predicted correction amount number is a first preset number, determining the predicted correction amount as a first preset correction amount; if If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a second preset correction amount; or
  • the prediction correction amount is a first preset number, determining that the prediction correction amount is a second preset correction amount; If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a first preset correction amount.
  • the first preset correction amount and the second preset correction amount are opposite numbers to each other.
  • the weighted average value may specifically be a predicted value of a lower right pixel of the current image block, and may be obtained by, for example, the following calculation formula:
  • P1 (W, H) P (W, –1) * a + P (–1, H) * (1–a);
  • P1 (W, H) represents the predicted value of the lower right pixel
  • P (W, –1) represents the value of the upper right reference pixel
  • P (–1, H) represents the value of the lower left reference pixel
  • a can be a preset value, such as 0.4, 0.5, or 0.6, etc .
  • the upper left reference pixel, the lower left reference pixel, the upper right reference pixel, and the lower right pixel do not belong to the current image block.
  • the current image block is an image block of W * H
  • the range of the abscissa of the pixel in the current image block is [0, W-1]
  • the range of the ordinate of the pixel in the current image block is [ 0, H-1]
  • the coordinates of the upper left reference pixel are (-1, -1)
  • the coordinates of the lower left reference pixel are (-1, H)
  • the coordinates of the lower right pixel are ( W, H)
  • the coordinates of the upper right reference pixel are (W, -1).
  • the first preset serial number may be 1 and the second preset serial number may be 2.
  • the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
  • A1 Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
  • A1 represents the first preset correction amount
  • pow (2, BD– 8) represents the BD-8 power of 2
  • H represents the height of the current image block
  • W represents the width of the current image block
  • the intra predictor is specifically configured to: if the prediction correction amount sequence number is a first preset sequence number, based on a value of a lower left reference pixel of the current image block, A difference value is obtained from the value of the upper right reference pixel of the current image block and the value of the upper left reference pixel of the current image block; and the prediction correction amount is determined based on the difference value.
  • the intra predictor is specifically configured to obtain the difference value through calculation using the following calculation formula:
  • D represents the difference value
  • P (W, –1) represents the value of the lower left reference pixel of the current image block
  • P (–1, H) represents the value of the upper right reference pixel of the current image block
  • P (–1, –1) represents the value of the upper left reference pixel of the current image block
  • a can be a preset value, such as 0.4, 0.5, or 0.6, etc .
  • a can also be the same as all
  • the intra predictor is specifically configured to:
  • the prediction correction amount is determined based on the following calculation formula:
  • M represents the predicted correction amount
  • D represents the difference value
  • sign (D) represents the sign of taking the difference value
  • B3 is a preset positive integer
  • B4 is a preset positive integer
  • the intra predictor is specifically configured to: The prediction value of the lower right pixel is modified; based on the correction value of the prediction value of the lower right pixel of the current image block, a predicted image of the current image block is obtained.
  • the intra predictor is further specifically configured to: modify a prediction value of a lower right pixel of the current image block by a correction value Limited to a preset value range, the preset value range is [0, pow (2, N) –1], where pow (2, N) represents the Nth power of 2, and N represents the bit Wide; obtaining a predicted image of the current image block based on a correction value of a predicted value of a lower-right pixel of the current image block that is restricted within the preset value range.
  • the prediction value of the prediction value of the lower right pixel of the current image block is less than 0, the prediction value of the lower right pixel of the current image block is corrected to 0, that is, the correction value of the prediction value of the lower right pixel of the current image block is 0; if the correction value of the prediction value of the bottom right pixel of the current image block is greater than, the prediction value of the bottom right pixel of the current image block is modified to pow (2, N) -1, that is, the The correction value of the predicted value is pow (2, N) –1; if the correction value of the predicted value of the lower right pixel of the current image block is greater than or equal to 0 and less than or equal to pow (2, N) –1, then it is not required Correct the predicted value of the lower right pixel of the current image block, that is, the predicted value of the lower right pixel of the current image block is the predicted value of the lower right pixel of the current image block.
  • a decoder including: a non-volatile memory and a processor coupled to each other, the processor calling program code stored in the memory to execute the first aspect or any of the first aspect Some or all steps of a method in one implementation.
  • a computer-readable storage medium stores program code, where the program code includes a method for executing the first aspect or any implementation manner of the first aspect. Instructions for some or all steps of the method.
  • a computer program product is provided, and when the computer program product is run on a computer, the computer is caused to perform part or all of the steps of the method in the first aspect or any one of the implementation manners of the first aspect. Instructions.
  • FIG. 1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of the present application
  • FIG. 2A is a schematic block diagram of a video encoder according to an embodiment of the present application.
  • 2B is a schematic block diagram of a video decoder according to an embodiment of the present application.
  • FIG. 3 is a flowchart of a video encoding method according to an embodiment of the present application.
  • FIG. 4 is a flowchart of a video decoding method according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a video decoding device according to an embodiment of the present application.
  • FIG. 6 is a schematic block diagram of an encoding device or a decoding device according to an embodiment of the present application.
  • FIG. 7A is a schematic diagram of acquiring a horizontal prediction value of a current pixel in the prior art
  • FIG. 7B is a schematic diagram of acquiring a vertical prediction value of a current pixel in the prior art.
  • Encoding a video stream, or a portion thereof, such as a video frame or an image block can use temporal and spatial similarities in the video stream to improve encoding performance.
  • the current image block of a video stream can predict motion information for the current image block based on previously encoded blocks in the video stream, and identify the difference between the predicted block and the current image block (that is, the original block) (also known as the original block) Is the residual), thereby encoding the current image block based on the previously encoded block.
  • the original block also known as the original block
  • Is the residual the difference between the predicted block and the current image block (that is, the original block) (also known as the original block) Is the residual)
  • the motion vector is an important parameter in the inter prediction process, which represents the spatial displacement of a previously coded block relative to the current coded block.
  • Motion vectors can be obtained using motion estimation methods, such as motion search.
  • the bits representing the motion vector were included in the encoded bit stream to allow the decoder to reproduce the predicted block and then obtain the reconstructed block.
  • it was later proposed to use the reference motion vector to differentially encode the motion vector that is, instead of encoding the entire motion vector, only the difference between the motion vector and the reference motion vector was encoded.
  • the reference motion vector may be selected from previously used motion vectors in the video stream. Selecting a previously used motion vector to encode the current motion vector can further reduce the number of bits included in the encoded video bitstream .
  • FIG. 1 is a block diagram of a video decoding system 1 according to an example described in the embodiment of the present application.
  • video coder generally refers to both video encoders and video decoders.
  • video coding or “coding” may generally refer to video encoding or video decoding.
  • the video encoder 100 and the video decoder 200 of the video coding system 1 are configured to predict a current coded image block according to various method examples described in any of a variety of new inter prediction modes proposed in the present application.
  • the motion information of the sub-block or its sub-blocks makes the predicted motion vector close to the motion vector obtained by using the motion estimation method to the greatest extent, so that the motion vector difference value is not transmitted during encoding, thereby further improving the encoding and decoding performance.
  • the video decoding system 1 includes a source device 10 and a destination device 20.
  • the source device 10 generates encoded video data. Therefore, the source device 10 may be referred to as a video encoding device.
  • the destination device 20 may decode the encoded video data generated by the source device 10. Therefore, the destination device 20 may be referred to as a video decoding device.
  • Various implementations of the source device 10, the destination device 20, or both may include one or more processors and a memory coupled to the one or more processors.
  • the memory may include, but is not limited to, RAM, ROM, EEPROM, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures accessible by a computer, as described herein.
  • the source device 10 and the destination device 20 may include various devices including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets, such as so-called “smart” phones, etc. Cameras, televisions, cameras, display devices, digital media players, video game consoles, on-board computers, or the like.
  • the destination device 20 may receive the encoded video data from the source device 10 via the link 30.
  • the link 30 may include one or more media or devices capable of moving the encoded video data from the source device 10 to the destination device 20.
  • the link 30 may include one or more communication media enabling the source device 10 to directly transmit the encoded video data to the destination device 20 in real time.
  • the source device 10 may modulate the encoded video data according to a communication standard, such as a wireless communication protocol, and may transmit the modulated video data to the destination device 20.
  • the one or more communication media may include wireless and / or wired communication media, such as a radio frequency (RF) spectrum or one or more physical transmission lines.
  • RF radio frequency
  • the one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (eg, the Internet).
  • the one or more communication media may include a router, a switch, a base station, or other devices that facilitate communication from the source device 10 to the destination device 20.
  • the encoded data may be output from the output interface 140 to the storage device 40.
  • the encoded data can be accessed from the storage device 40 through the input interface 240.
  • the storage device 40 may include any of a variety of distributed or locally accessed data storage media, such as a hard drive, Blu-ray disc, DVD, CD-ROM, flash memory, volatile or non-volatile memory, Or any other suitable digital storage medium for storing encoded video data.
  • the storage device 40 may correspond to a file server or another intermediate storage device that may hold the encoded video produced by the source device 10.
  • the destination device 20 may access the stored video data from the storage device 40 via streaming or download.
  • the file server may be any type of server capable of storing encoded video data and transmitting the encoded video data to the destination device 20.
  • Example file servers include a web server (eg, for a website), an FTP server, a network attached storage (NAS) device, or a local disk drive.
  • the destination device 20 can access the encoded video data through any standard data connection, including an Internet connection.
  • This may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., DSL, cable modem, etc.), or a combination of both suitable for accessing encoded video data stored on a file server.
  • the transmission of the encoded video data from the storage device 40 may be a streaming transmission, a download transmission, or a combination of the two.
  • the motion vector prediction technology of the present application can be applied to video codecs to support a variety of multimedia applications, such as air television broadcasting, cable television transmission, satellite television transmission, streaming video transmission (e.g., via the Internet), for storage in data storage Encoding of video data on media, decoding of video data stored on data storage media, or other applications.
  • the video coding system 1 may be used to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting, and / or video telephony.
  • the video decoding system 1 illustrated in FIG. 1 is only an example, and the techniques of the present application can be applied to a video decoding setting (for example, video encoding or video decoding) that does not necessarily include any data communication between the encoding device and the decoding device. .
  • data is retrieved from local storage, streamed over a network, and so on.
  • the video encoding device may encode the data and store the data to a memory, and / or the video decoding device may retrieve the data from the memory and decode the data.
  • encoding and decoding are performed by devices that do not communicate with each other, but only encode data to and / or retrieve data from memory and decode data.
  • the source device 10 includes a video source 120, a video encoder 100, and an output interface 140.
  • the output interface 140 may include a regulator / demodulator (modem) and / or a transmitter.
  • Video source 120 may include a video capture device (e.g., a video camera), a video archive containing previously captured video data, a video feed interface to receive video data from a video content provider, and / or a computer for generating video data Graphics systems, or a combination of these sources of video data.
  • the video encoder 100 may encode video data from the video source 120.
  • the source device 10 transmits the encoded video data directly to the destination device 20 via the output interface 140.
  • the encoded video data may also be stored on the storage device 40 for later access by the destination device 20 for decoding and / or playback.
  • the destination device 20 includes an input interface 240, a video decoder 200, and a display device 220.
  • the input interface 240 includes a receiver and / or a modem.
  • the input interface 240 may receive encoded video data via the link 30 and / or from the storage device 40.
  • the display device 220 may be integrated with the destination device 20 or may be external to the destination device 20. Generally, the display device 220 displays decoded video data.
  • the display device 220 may include various display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
  • LCD liquid crystal display
  • OLED organic light emitting diode
  • video encoder 100 and video decoder 200 may each be integrated with an audio encoder and decoder, and may include a suitable multiplexer-demultiplexer unit Or other hardware and software to handle encoding of both audio and video in a common or separate data stream.
  • the MUX-DEMUX unit may conform to the ITU H.223 multiplexer protocol, or other protocols such as the User Datagram Protocol (UDP), if applicable.
  • UDP User Datagram Protocol
  • Video encoder 100 and video decoder 200 may each be implemented as any of a variety of circuits, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), Field Programmable Gate Array (FPGA), discrete logic, hardware, or any combination thereof. If the present application is implemented partially in software, the device may store instructions for the software in a suitable non-volatile computer-readable storage medium and may use one or more processors to execute the instructions in hardware Thus, the technology of the present application is implemented. Any of the foregoing (including hardware, software, a combination of hardware and software, etc.) may be considered as one or more processors. Each of video encoder 100 and video decoder 200 may be included in one or more encoders or decoders, any of which may be integrated as a combined encoder in a corresponding device / Decoder (codec).
  • codec device / Decoder
  • This application may generally refer to video encoder 100 as “signaling” or “transmitting” certain information to another device, such as video decoder 200.
  • the terms “signaling” or “transmitting” may generally refer to the transmission of syntax elements and / or other data used to decode compressed video data. This transfer can occur in real time or almost real time. Alternatively, this communication may occur over a period of time, such as when a syntax element is stored in a coded bitstream to a computer-readable storage medium at the time of encoding, and the decoding device may then after the syntax element is stored in this medium. retrieve the syntax element at any time.
  • the video encoder 100 and the video decoder 200 may operate according to a video compression standard such as High Efficiency Video Coding (HEVC) or an extension thereof, and may conform to the HEVC test model (HM).
  • HEVC High Efficiency Video Coding
  • HM HEVC test model
  • the video encoder 100 and video decoder 200 may also operate according to other industry standards, such as the ITU-T H.264, H.265 standards, or extensions of such standards.
  • the techniques of this application are not limited to any particular codec standard.
  • the video encoder 100 is configured to encode syntax elements related to a current image block to be encoded into a digital video output bit stream (referred to as a bit stream or code stream), which will be used between the current image block frames.
  • the syntax element of prediction is referred to as inter-prediction data for short.
  • the inter-prediction data may include a first identifier for indicating whether to use the above-mentioned candidate inter prediction mode set for inter prediction on the current image block (in other words, for indicating whether or not (The first identifier for performing inter prediction on the current image block by using the new inter prediction mode proposed in this application); or, the inter prediction data may include: indicating whether to use a candidate inter prediction mode for the current image block to be encoded
  • the first identifier of the inter-prediction set and the second identifier of the inter-prediction mode for indicating the current image block are collected; in order to determine the inter-prediction mode for encoding the current image block, the video encoder 100 is further configured to: Determine or select the inter prediction mode in the candidate inter prediction mode set used for inter prediction of the current image block (for example, select multiple Encoding the current image block in the inter-prediction mode with a compromise or minimum inter-prediction mode); and encoding the current image block based on the determined inter-prediction mode, the encoding process here may include
  • the difference that is, the residual
  • the difference that is, the residual
  • the current image block that is, the original block
  • the video encoder 100 only needs to program the syntax elements related to the image block to be encoded into a bit stream (also known as a code stream); otherwise, in addition to the syntax elements, the corresponding residuals need to be coded into bits flow.
  • the video decoder 200 is configured to decode a syntax element related to the image block to be decoded from the bit stream.
  • the syntax element used for inter prediction of the current image block is referred to as inter prediction data for short.
  • the inter-prediction data includes a first identifier for indicating whether to use a candidate inter-prediction mode set for inter-prediction for the currently decoded image block (that is, for indicating whether to use the The first identifier of the new inter prediction mode for performing inter prediction) is determined when the inter prediction data indicates that a set of candidate inter prediction modes (that is, a new inter prediction mode) is used to predict the current image block
  • An inter prediction mode for performing inter prediction on the current image block in the candidate inter prediction mode set, and decoding the current image block based on the determined inter prediction mode, and the decoding process here may include based on the determined frame Inter prediction mode, predicting motion information of one or more sub-blocks in the current image block, and using the operation of one or more sub-blocks in the current image block The
  • the video decoder 200 is configured to determine the inter prediction indicated by the second identifier.
  • the mode is an inter-prediction mode for inter-prediction of the current image block; or, if the inter-prediction data does not include a second identifier used to indicate which inter-prediction mode is used by the current image block
  • the video decoder 200 is configured to determine that a first inter prediction mode used for a non-directional motion field is an inter prediction mode used for inter prediction of the current image block.
  • FIG. 2A is a block diagram of a video encoder 100 according to an example described in the embodiment of the present application.
  • the video encoder 100 is configured to output a video to the post-processing entity 41.
  • the post-processing entity 41 represents an example of a video entity that can process encoded video data from the video encoder 100, such as a media-aware network element (MANE) or a stitching / editing device.
  • the post-processing entity 41 may be an instance of a network entity.
  • the post-processing entity 41 and the video encoder 100 may be parts of a separate device, while in other cases, the functionality described with respect to the post-processing entity 41 may be performed by the same device including the video encoder 100 carried out.
  • the post-processing entity 41 is an example of the storage device 40 of FIG. 1.
  • the video encoder 100 may perform encoding of a video image block according to any new inter prediction mode set of candidate inter prediction mode sets including modes 0, 1, 2, ..., or 10 proposed in the present application, for example, perform a video image block. Inter prediction.
  • the video encoder 100 includes a prediction processing unit 108, a filter unit 106, a decoded image buffer (DPB) 107, a summer 112, a transformer 101, a quantizer 102, and an entropy encoder 103.
  • the prediction processing unit 108 includes an inter predictor 110 and an intra predictor 109.
  • the video encoder 100 further includes an inverse quantizer 104, an inverse transformer 105, and a summer 111.
  • the filter unit 106 is intended to represent one or more loop filters, such as a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) filter.
  • the filter unit 106 is shown as an in-loop filter in FIG. 2A, in other implementations, the filter unit 106 may be implemented as a post-loop filter.
  • the video encoder 100 may further include a video data memory and a segmentation unit (not shown in the figure).
  • the video data memory may store video data to be encoded by the components of the video encoder 100.
  • the video data stored in the video data storage may be obtained from the video source 120.
  • the DPB 107 may be a reference image memory that stores reference video data used by the video encoder 100 to encode video data in an intra-frame or inter-frame decoding mode.
  • Video data memory and DPB 107 can be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM), synchronous resistive RAM (MRAM), resistive RAM (RRAM) including synchronous DRAM (SDRAM), Or other types of memory devices.
  • Video data storage and DPB 107 can be provided by the same storage device or separate storage devices.
  • the video data memory may be on-chip with other components of video encoder 100, or off-chip relative to those components.
  • the video encoder 100 receives video data and stores the video data in a video data memory.
  • the segmentation unit divides the video data into several image blocks, and these image blocks can be further divided into smaller blocks, such as image block segmentation based on a quad-tree structure or a binary tree structure. This segmentation may also include segmentation into slices, tiles, or other larger units.
  • Video encoder 100 typically illustrates components that encode image blocks within a video slice to be encoded. The slice can be divided into multiple image patches (and possibly into a collection of image patches called slices).
  • the prediction processing unit 108 may select one of a plurality of possible decoding modes for the current image block, such as one of a plurality of intra-coding modes or one of a plurality of inter-coding modes, wherein The multiple inter-frame decoding modes include, but are not limited to, one or more of the modes 0, 1, 2, 3 ... 10 proposed in the present application.
  • the prediction processing unit 108 may provide the obtained intra, inter-coded block to the summer 112 to generate a residual block, and to the summer 111 to reconstruct the encoded block used as a reference image.
  • the intra predictor 109 within the prediction processing unit 108 may perform intra predictive encoding of the current image block with respect to one or more neighboring blocks in the same frame or slice as the current block to be encoded to remove spatial redundancy.
  • the inter predictor 110 within the prediction processing unit 108 may perform inter predictive encoding of the current image block with respect to one or more prediction blocks in the one or more reference images to remove temporal redundancy.
  • the inter predictor 110 may be configured to determine an inter prediction mode for encoding a current image block.
  • the inter predictor 110 may use rate-distortion analysis to calculate rate-distortion values for various inter-prediction modes in a set of candidate inter-prediction modes and select an inter-frame having the best rate-distortion characteristics from among them. Forecasting mode.
  • Rate distortion analysis generally determines the amount of distortion (or error) between the coded block and the original uncoded block that was coded to produce the coded block, and the bit rate used to generate the coded block (that is, , Number of bits).
  • the inter predictor 110 may determine that the inter prediction mode with the lowest code rate distortion cost of encoding the current image block in the candidate inter prediction mode set is the inter prediction mode used for inter prediction of the current image block.
  • the following describes the inter-predictive coding process in detail, especially in the various inter-prediction modes for non-directional or directional sports fields in this application, predicting one or more sub-blocks in the current image block. Sub-block or all sub-blocks).
  • the inter predictor 110 is configured to predict motion information (such as a motion vector) of one or more sub-blocks in the current image block based on the determined inter prediction mode, and use the motion information (such as the motion vector) of one or more sub-blocks in the current image block. Motion vector) to obtain or generate a prediction block of the current image block.
  • the inter predictor 110 may locate a prediction block pointed to by the motion vector in one of the reference image lists.
  • the inter predictor 110 may also generate syntax elements associated with the image blocks and video slices for use by the video decoder 200 when decoding the image blocks of the video slices.
  • the inter predictor 110 uses the motion information of each sub-block to perform a motion compensation process to generate a prediction block of each sub-block, thereby obtaining a prediction block of the current image block. It should be understood that the The inter predictor 110 performs motion estimation and motion compensation processes.
  • the inter predictor 110 may provide information indicating the selected inter prediction mode of the current image block to the entropy encoder 103 so that the entropy encoder 103 encodes the instruction.
  • Information on the selected inter prediction mode may include inter prediction data related to the current image block in the transmitted bit stream, which may include a first identifier block_based_enable_flag, to indicate whether the new image proposed by the present application is adopted for the current image block.
  • the inter prediction mode is used for inter prediction; optionally, a second identifier block_based_index may also be included to indicate which new inter prediction mode is used by the current image block.
  • the process of using the motion vectors of multiple reference blocks to predict the motion vectors of the current image block or its sub-blocks in different modes 0, 1, 2 ... 10 will be described in detail below.
  • the intra predictor 109 may perform intra prediction on the current image block.
  • the intra predictor 109 may determine an intra prediction mode used to encode the current block.
  • the intra-predictor 109 may use rate-distortion analysis to calculate rate-distortion values for various intra-prediction modes to be tested, and select an intra-prediction with the best rate-distortion characteristics from the test modes. mode.
  • the intra predictor 109 may provide information indicating the selected intra prediction mode of the current image block to the entropy encoder 103 so that the entropy encoder 103 encodes the instruction Information on the selected intra prediction mode.
  • the video encoder 100 forms a residual image block by subtracting the prediction block from the current image block to be encoded.
  • the summer 112 represents one or more components that perform this subtraction operation.
  • the residual video data in the residual block may be included in one or more TUs and applied to the transformer 101.
  • the transformer 101 transforms the residual video data into a residual transform coefficient using a transform such as a discrete cosine transform (DCT) or a conceptually similar transform.
  • the transformer 101 may transform the residual video data from a pixel value domain to a transform domain, such as a frequency domain.
  • DCT discrete cosine transform
  • the transformer 101 may send the obtained transform coefficients to a quantizer 102.
  • a quantizer 102 quantizes the transform coefficients to further reduce the bit rate.
  • the quantizer 102 may then perform a scan of a matrix containing the quantized transform coefficients.
  • the entropy encoder 103 may perform scanning.
  • the entropy encoder 103 After quantization, the entropy encoder 103 entropy encodes the quantized transform coefficients. For example, the entropy encoder 103 can perform context-adaptive variable-length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), and probability interval segmentation entropy (PIPE ) Coding or another entropy coding method or technique.
  • CAVLC context-adaptive variable-length coding
  • CABAC context-adaptive binary arithmetic coding
  • SBAC syntax-based context-adaptive binary arithmetic coding
  • PIPE probability interval segmentation entropy Coding or another entropy coding method or technique.
  • the encoded bitstream may be transmitted to the video decoder 200, or archived for later transmission or retrieved by the video decoder 200.
  • the entropy encoder 103 may also perform entrop
  • the inverse quantizer 104 and the inverse changer 105 respectively apply inverse quantization and inverse transform to reconstruct the residual block in the pixel domain, for example, for later use as a reference block of a reference image.
  • the summer 111 adds the reconstructed residual block to a prediction block generated by the inter predictor 110 or the intra predictor 109 to generate a reconstructed image block.
  • the filter unit 106 may be adapted to reconstructed image blocks to reduce distortion, such as block artifacts. This reconstructed image block is then stored as a reference block in the decoded image buffer 107 and can be used by the inter predictor 110 as a reference block to inter-predict the subsequent video frames or blocks in the image.
  • the video encoder 100 can directly quantize the residual signal without processing by the transformer 101 and correspondingly without the inverse transformer 105; or, for some image blocks Or image frames, the video encoder 100 does not generate residual data, and accordingly does not need to be processed by the transformer 101, quantizer 102, inverse quantizer 104, and inverse transformer 105; or, the video encoder 100 may convert the reconstructed image
  • the blocks are directly stored as reference blocks without being processed by the filter unit 106; alternatively, the quantizer 102 and the inverse quantizer 104 in the video encoder 100 may be merged together.
  • FIG. 2B is a block diagram of a video decoder 200 according to an example described in the embodiment of the present application.
  • the video decoder 200 includes an entropy decoder 203, a prediction processing unit 208, an inverse quantizer 204, an inverse transformer 205, a summer 211, a filter unit 206, and a decoded image buffer 207.
  • the prediction processing unit 208 may include an inter predictor 210 and an intra predictor 209.
  • video decoder 200 may perform a decoding process that is substantially reciprocal to the encoding process described with respect to video encoder 100 from FIG. 2A.
  • video decoder 200 receives from video encoder 100 an encoded video bitstream representing image blocks of the encoded video slice and associated syntax elements.
  • the video decoder 200 may receive video data from the network entity 42, optionally, the video data may also be stored in a video data storage (not shown in the figure).
  • the video data memory may store video data, such as an encoded video bitstream, to be decoded by components of the video decoder 200.
  • the video data stored in the video data storage can be obtained, for example, from the storage device 40, from a local video source such as a camera, via a wired or wireless network of video data, or by accessing a physical data storage medium.
  • the video data memory can be used as a decoded image buffer (CPB) for storing encoded video data from the encoded video bitstream. Therefore, although the video data storage is not shown in FIG. 2B, the video data storage and the DPB 207 may be the same storage, or may be separately set storages. Video data memory and DPB 207 can be formed by any of a variety of memory devices, such as: dynamic random access memory (DRAM) including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), and resistive RAM (RRAM) , Or other types of memory devices. In various examples, the video data memory may be integrated on a chip with other components of the video decoder 200 or provided off-chip relative to those components.
  • DRAM dynamic random access memory
  • SDRAM synchronous DRAM
  • MRAM magnetoresistive RAM
  • RRAM resistive RAM
  • the video data memory may be integrated on a chip with other components of the video decoder 200 or provided off-chip relative to those components.
  • the network entity 42 may be, for example, a server, a MANE, a video editor / splicer, or other such device for implementing one or more of the techniques described above.
  • the network entity 42 may or may not include a video encoder, such as video encoder 100.
  • the network entity 42 may implement some of the techniques described in this application.
  • the network entity 42 and the video decoder 200 may be part of separate devices, while in other cases, the functionality described with respect to the network entity 42 may be performed by the same device including the video decoder 200.
  • the network entity 42 may be an example of the storage device 40 of FIG. 1.
  • the entropy decoder 203 of the video decoder 200 entropy decodes the bit stream to generate quantized coefficients and some syntax elements.
  • the entropy decoder 203 forwards the syntax elements to the prediction processing unit 208.
  • Video decoder 200 may receive syntax elements at a video slice level and / or an image block level.
  • the syntax element here may include inter prediction data related to the current image block, and the inter prediction data may include a first identifier block_based_enable_flag to indicate whether the above candidate frame is adopted for the current image block.
  • a second identifier block_based_index may also be included to indicate Which new inter prediction mode is used by the current image block.
  • the intra predictor 209 of the prediction processing unit 208 may be based on the signaled intra prediction mode and the previously decoded block from the current frame or image. Data to generate prediction blocks for image blocks of the current video slice.
  • the inter predictor 210 of the prediction processing unit 208 may determine, based on the syntax elements received from the entropy decoder 203, the An inter prediction mode in which a current image block of a video slice is decoded, and based on the determined inter prediction mode, the current image block is decoded (for example, inter prediction is performed).
  • the inter predictor 210 may determine whether to use the new inter prediction mode to predict the current image block of the current video slice. If the syntax element indicates that the new inter prediction mode is used to predict the current image block, based on A new inter prediction mode (e.g., a new inter prediction mode specified by a syntax element or a default new inter prediction mode) predicts the current image block of the current video slice or a sub-block of the current image block. Motion information, thereby obtaining or generating a predicted block of the current image block or a sub-block of the current image block using the predicted motion information of the current image block or a sub-block of the current image block through a motion compensation process.
  • a new inter prediction mode e.g., a new inter prediction mode specified by a syntax element or a default new inter prediction mode
  • the motion information here may include reference image information and motion vectors, where the reference image information may include but is not limited to unidirectional / bidirectional prediction information, a reference image list number, and a reference image index corresponding to the reference image list.
  • a prediction block may be generated from one of reference pictures within one of the reference picture lists.
  • the video decoder 200 may construct a reference picture list, that is, a list 0 and a list 1, based on the reference pictures stored in the DPB 207.
  • the reference frame index of the current image may be included in one or more of the reference frame list 0 and list 1.
  • the video encoder 100 may signal whether to use a new inter prediction mode to decode a specific syntax element of a specific block, or may be a signal to indicate whether to use a new inter prediction mode. And indicate which new inter prediction mode is used to decode a specific syntax element of a specific block.
  • the inter predictor 210 here performs a motion compensation process. In the following, the inter prediction process for using the motion information of the reference block to predict the motion information of the current image block or a sub-block of the current image block under various new inter prediction modes will be explained in detail.
  • the inverse quantizer 204 inverse quantizes, that is, dequantizes, the quantized transform coefficients provided in the bitstream and decoded by the entropy decoder 203.
  • the inverse quantization process may include using a quantization parameter calculated by the video encoder 100 for each image block in the video slice to determine the degree of quantization that should be applied and similarly to determine the degree of inverse quantization that should be applied.
  • the inverse transformer 205 applies an inverse transform to transform coefficients, such as an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process in order to generate a residual block in the pixel domain.
  • the video decoder 200 works by comparing the residual block from the inverse transformer 205 with the corresponding prediction generated by the inter predictor 210 The blocks are summed to get the reconstructed block, that is, the decoded image block.
  • the summer 211 represents a component that performs this summing operation.
  • a loop filter in the decoding loop or after the decoding loop
  • the filter unit 206 may represent one or more loop filters, such as a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) filter.
  • the filter unit 206 is shown as an in-loop filter in FIG. 2B, in other implementations, the filter unit 206 may be implemented as a post-loop filter.
  • the filter unit 206 is adapted to reconstruct a block to reduce block distortion, and the result is output as a decoded video stream.
  • a decoded image block in a given frame or image may also be stored in a decoded image buffer 207, and the decoded image buffer 207 stores a reference image for subsequent motion compensation.
  • the decoded image buffer 207 may be part of a memory, which may also store the decoded video for later presentation on a display device, such as the display device 220 of FIG. 1, or may be separate from such memory.
  • the video decoder 200 may generate an output video stream without being processed by the filter unit 206; or, for certain image blocks or image frames, the entropy decoder 203 of the video decoder 200 does not decode the quantized coefficients, and accordingly It does not need to be processed by the inverse quantizer 204 and the inverse transformer 205.
  • the current image block may include, but is not limited to, 16 ⁇ 16 pixels, 32 ⁇ 32 pixels, 32 ⁇ 16 pixels, 16 ⁇ 32 pixels, and the like.
  • each image frame can be divided into image blocks for encoding. These image blocks can be further divided into smaller blocks.
  • the current image block 600 can be divided into multiple MxN sub-blocks, that is, each sub-block has a size of MxN pixels.
  • M ⁇ N and M times N are used interchangeably to refer to the pixel size of an image block according to the horizontal and vertical dimensions, that is, there are M pixels in the horizontal direction and N pixels in the vertical direction. Where M and N represent non-negative integer values.
  • the block does not necessarily need to have the same number of pixels in the horizontal direction as in the vertical direction.
  • the subblock size and reference block size of the current image block can also be 8x8 pixels, 8x4 pixels, or 4x8 pixels, or the smallest predicted block size.
  • the image block described in this application may be understood as a coding unit (CU).
  • Image blocks can have fixed or variable sizes and differ in size according to different video compression codec standards.
  • the current image block refers to an image block to be encoded or decoded currently, such as a prediction unit to be encoded or decoded.
  • FIG. 3 is a flowchart illustrating a process 300 of an encoding method according to an embodiment of the present application.
  • the process 300 may be performed by the video encoder 100, and specifically, may be performed by the intra predictor 109 of the video encoder 100.
  • the process 300 is described as a series of steps or operations. It should be understood that the process 300 may be performed in various orders and / or concurrently, and is not limited to the execution order shown in FIG. 3.
  • a process 300 including the following steps is performed to implement the encoding of the current image block through the Planar prediction method in the intra prediction method, where the current image
  • the block may be a luma image block of a CU or a chroma image block of a CU.
  • the F kinds of correction amounts M and its corresponding predicted correction amount numbers Idx can be determined according to one of the following methods.
  • Method 1 Prediction correction amount serial number Idx is 0 corresponding to correction amount M is 0; Idx is 1 corresponding to correction amount M is first preset value A1; Idx is 2 corresponding to correction amount M is -A1.
  • A1 can also be a variable related to the width and height of the current block, for example:
  • A1 Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)),
  • Method 2 Predicted correction amount serial number Idx is 0 corresponding to correction amount M is 0; Idx is 1 corresponding to correction amount M is second preset value A2; Idx is 2 corresponding to correction amount M is -A2; Idx is 3 corresponding to correction amount M Is the third preset value A3; Idx is 4 and the correction amount M is -A3.
  • Method 3 Weight the average of the lower left reference pixel P (–1, H) and the upper right reference pixel P (W, –1) to obtain the first predicted value P1 (W, H) of the lower right pixel of the current image block. If the first predicted value P1 (W, H) is smaller than the value of the upper left reference pixel P (–1, –1), the predicted correction amount number Idx is 1 and the correction amount M is the first preset value A1; Idx is 2 corresponding The correction amount M is –A1; if the first predicted value P1 (W, H) is greater than or equal to the value of the reference pixel P (–1, –1) in the upper left corner, the predicted correction amount number Idx is 1, and the corresponding correction amount M is the first prediction. Set the value -A1; Idx is 2 and the correction amount M is A1.
  • step 702 may further include: limiting the second prediction value P2 (W, H) to a value range of the prediction signal, for example, the value range of the N-bit wide prediction signal is [0, pow (2, N) –1].
  • the F kinds of plane prediction images in step 302 can be obtained by the following methods:
  • Step 2.1 Weighted average of the second predicted value P2 (W, H, f) of the lower right pixel and the lower left reference pixel P (–1, H) to obtain the predicted value P () of the lower pixel of the predicted pixel P (x, y).
  • x, H, f the weighted average of the second predicted value P2 (W, H, f) of the lower right pixel and the upper right reference pixel P (W, –1) to obtain the right of the predicted pixel P (x, y)
  • Predicted value P (W, y, f) Predicted value P (W, y, f).
  • Step 2.2 Calculate the predicted pixel value P (x, y, f) of each position (x, y) in the predicted image.
  • the weighted average of P (x, H, f) and P (x, –1) gives the vertical prediction value Pv (x, y, f) of P (x, y); P (W, y, f) and P (–1, y) weighted average to get the level prediction value Ph (x, y, f) of P (x, y); Ph (x, y, f) and Pv (x, y, f) weighted average,
  • the predicted value P (x, y, f) of the pixel with coordinates (x, y) is obtained.
  • the difference may be calculated using an existing method, for example, an absolute error sum (Sum of Absolute Difference, SAD) algorithm may be used to calculate the difference.
  • SAD Sum of Absolute Difference
  • Step 303 Encode the current image block according to the optimal plane prediction image to obtain the rate distortion cost; compare the rate distortion cost of the optimal plane prediction image with the rate distortion cost of other intra prediction modes, and select the one with the least rate distortion cost.
  • the intra prediction mode is used as an optimal intra coding mode for the current image block.
  • the current image block is encoded according to the optimal plane prediction image to obtain the rate distortion cost.
  • This is a conventional technique, which usually includes: calculating the residual corresponding to the optimal plane prediction image, transforming and quantizing the residual to obtain the current image block. Encoding the prediction mode information and residual information of the current image block to obtain the number of bits.
  • the prediction mode is a planar prediction mode
  • the prediction correction amount serial number corresponding to the optimal planar prediction image needs to be encoded and counted into the bits. Weighted sum of distortion and number of bits to get the rate distortion cost.
  • the prediction correction amount serial number can be encoded using, for example, context-based binary arithmetic coding.
  • Step 304 If the optimal intra coding mode is a planar prediction mode, write the prediction correction number into the code stream.
  • the current image block uses only the intra coding mode as an example.
  • the current image block is an image block in an I frame. If the current image block is an image block in a P / B frame, the current image block can also use inter prediction coding.
  • the rate distortion cost of the optimal intra coding mode and the rate of the optimal inter coding mode also need to be used. The distortion cost is compared to determine the optimal prediction mode.
  • the encoding end generates plane prediction images with various prediction corrections, selects the best plane prediction image, and writes the corresponding prediction correction number to the code stream; this method improves the prediction efficiency of the plane prediction, thereby improving the intra frame. Compression efficiency of Intra coding.
  • An embodiment of the present invention further provides a decoding apparatus, and the apparatus includes a module for performing the foregoing encoding method.
  • An embodiment of the present invention further provides another encoder, including: a non-volatile memory and a processor coupled to each other, the processor invoking program code stored in the memory to execute part or all of the foregoing encoding method. step.
  • An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores program code, where the program code includes instructions for performing part or all of the steps of the foregoing encoding method.
  • An embodiment of the present invention further provides a computer program product.
  • the computer program product is run on a computer, the computer program product is caused to execute instructions of some or all steps of the foregoing coding method.
  • FIG. 4 is a flowchart illustrating a process 400 of a decoding method according to an embodiment of the present application.
  • Process 400 may be performed by video decoder 200.
  • the process 400 is described as a series of steps or operations. It should be understood that the process 400 may be performed in various orders and / or concurrently, and is not limited to the execution order shown in FIG. 4.
  • a process 400 including the following steps is performed to implement decoding of a current image block through a Planar prediction method in an intra prediction method, where the current image
  • the block may be a luma image block of a CU or a chroma image block of a CU.
  • the prediction mode is a planar prediction mode
  • the prediction reference information includes a sequence number of a prediction correction amount.
  • This step may be specifically performed by the entropy decoder 203 in the decoder 200.
  • the specific solution implemented in the embodiment of the present invention is an intra prediction method in Planar mode, so the prediction mode of the current image block is actually parsed from the bitstream, and the prediction mode indicates The prediction mode of the current image block is Planar mode.
  • This step may be performed by the intra predictor 209 in the decoder 200.
  • the predicted correction amount serial number Idx is 0, which indicates that the correction amount M is 0, and the serial number greater than 0 indicates that the correction amount M is not zero.
  • any one of the following methods may be used to determine the specific value of the correction amount M:
  • the prediction correction amount is a first preset number, determine the prediction correction amount as a first preset correction amount; or if the prediction correction amount number is a second preset number, determine the prediction correction The amount is the second preset correction amount.
  • the first preset correction amount and the second preset correction amount are opposite numbers to each other.
  • the first preset serial number may be 1 and the second preset serial number may be 2.
  • the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
  • A1 Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
  • A1 represents the first preset correction amount
  • pow (2, BD– 8) represents the BD-8 power of 2
  • H represents the height of the current image block
  • W represents the width of the current image block
  • the predicted correction amount number is a first preset number, determine the predicted correction amount as a third preset number; if the predicted correction amount is a second preset number, determine the predicted correction amount Is the fourth preset correction amount; if the predicted correction amount number is a third preset number, it is determined that the predicted correction amount is a fifth preset correction amount; if the predicted correction amount number is a fourth preset number , It is determined that the predicted correction amount is a sixth preset correction amount.
  • the third preset correction amount and the fourth preset correction amount are opposite numbers to each other; and the fifth preset correction amount and the sixth preset correction amount are opposite numbers to each other.
  • the first preset serial number can be 1, the second preset serial number can be 2, the third preset serial number can be 3, and the fourth preset serial number can be 4.
  • the third preset correction amount and the fifth preset correction amount are preset positive integers, and the fifth preset correction amount is greater than the third preset correction amount.
  • the fifth preset correction amount may be the third preset correction amount.
  • the amount is 1.75 times, or 2 times, or 2.25 times.
  • the value of the predicted correction amount is the first preset number
  • the predicted correction amount is the second preset number
  • the determination is determined.
  • the predicted correction amount is the second preset correction amount; or when the weighted average value is not less than the value of the upper left reference pixel of the current image block, if the predicted correction amount number is the first preset number, the determined correction amount is determined.
  • the predicted correction amount is a second preset correction amount; if the predicted correction amount number is a second preset number, determining that the predicted correction amount is the first preset correction amount.
  • the first preset correction amount and the second preset correction amount are opposite numbers to each other.
  • the weighted average value may specifically be a predicted value of a lower right pixel of the current image block, and may be obtained by, for example, the following calculation formula:
  • P1 (W, H) P (W, –1) * a + P (–1, H) * (1–a);
  • P1 (W, H) represents the predicted value of the lower right pixel
  • P (W, –1) represents the value of the upper right reference pixel
  • P (–1, H) represents the value of the lower left reference pixel
  • a can be a preset value, such as 0.4, 0.5, or 0.6, etc .
  • the upper left reference pixel, the lower left reference pixel, the upper right reference pixel, and the lower right pixel do not belong to the current image block.
  • the current image block is an image block of W * H
  • the range of the abscissa of the pixel in the current image block is [0, W-1]
  • the range of the ordinate of the pixel in the current image block is [ 0, H-1]
  • the coordinates of the upper left reference pixel are (-1, -1)
  • the coordinates of the lower left reference pixel are (-1, H)
  • the coordinates of the lower right pixel are ( W, H)
  • the coordinates of the upper right reference pixel are (W, -1).
  • the first preset serial number may be 1 and the second preset serial number may be 2.
  • the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
  • A1 Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
  • A1 represents the first preset correction amount
  • pow (2, BD– 8) represents the BD-8 power of 2
  • H represents the height of the current image block
  • W represents the width of the current image block
  • the prediction correction amount serial number is a first preset serial number, based on the value of the lower left reference pixel of the current image block, the value of the upper right reference pixel of the current image block, and the value of the upper left reference pixel of the current image block Obtain a difference value; determine the predicted correction amount based on the difference value.
  • the difference value can be obtained by calculating as follows:
  • D represents the difference value
  • P (W, –1) represents the value of the lower left reference pixel of the current image block
  • P (–1, H) represents the value of the upper right reference pixel of the current image block
  • P (–1, –1) represents the value of the upper left reference pixel of the current image block
  • a can be a preset value, such as 0.4, 0.5, or 0.6, etc .
  • a can also be the same as all
  • the determining the prediction correction amount based on the difference value includes:
  • the prediction correction amount is determined based on the following calculation formula:
  • M represents the predicted correction amount
  • D represents the difference value.
  • B3 is a preset positive integer
  • B4 is a preset positive integer
  • This step may be performed by an intra predictor 209 in the decoder 200, and the predicted image may be a predicted block in FIG. 2B.
  • obtaining the predicted image of the current image block based on the prediction correction amount may include the following steps:
  • Step 1 Weighted average the lower left reference pixel P (–1, H) and the upper right reference pixel P (W, –1) to obtain the first predicted value P1 (W, H) of the lower right pixel of the current image block; M is added to the first prediction value P1 (W, H) to obtain a second prediction value P2 (W, H) of the lower right pixel.
  • Step 2 A weighted average of the second predicted value P2 (W, H) of the lower right pixel and the lower left reference pixel P (-1, H) to obtain the predicted value P (x, y) of the lower pixel of the predicted pixel P (x, y). H); weighted average of the second predicted value P2 (W, H) of the lower right pixel and the upper right reference pixel P (W, –1) to obtain the predicted value P (W, of the right pixel of the predicted pixel P (x, y) y).
  • Step 3 Weighted average of P (x, H) and P (x, –1) to obtain the vertical prediction value Pv (x, y) of P (x, y); from P (W, y) and P (- 1, y) weighted average to get the level prediction value Ph (x, y) of P (x, y); weighted average of Ph (x, y) and Pv (x, y) to get the coordinates of (x, y) The pixel's predicted value P (x, y).
  • the predicted values of all pixels in the current image block can be obtained, so as to obtain a predicted image.
  • This step may be performed by the summer 211 in the decoder 200, and the prediction residual of the current image block may be a residual block in FIG. 2B.
  • the prediction image of the current image block and the prediction residual of the current image block may be added to obtain a reconstructed image of the current image block.
  • the method described in FIG. 4 may further include:
  • the preset value range is [0, pow (2, N) –1], where pow (2, N) represents the Nth power of 2, and N represents the bit width.
  • the prediction value of the prediction value of the lower right pixel of the current image block is less than 0, the prediction value of the lower right pixel of the current image block is corrected to 0, that is, the correction value of the prediction value of the lower right pixel of the current image block is 0; if the correction value of the prediction value of the bottom right pixel of the current image block is greater than, the prediction value of the bottom right pixel of the current image block is modified to pow (2, N) -1, that is, the The correction value of the predicted value is pow (2, N) –1; if the correction value of the predicted value of the lower right pixel of the current image block is greater than or equal to 0 and less than or equal to pow (2, N) –1, then it is not required Correct the predicted value of the lower right pixel of the current image block, that is, the predicted value of the lower right pixel of the current image block is the predicted value of the lower right pixel of the current image block.
  • FIG. 5 illustrates a structure of an image block decoding apparatus according to an embodiment of the present invention.
  • the image block decoding apparatus includes:
  • Entropy decoder 501 is configured to parse a bitstream to obtain prediction residuals, prediction modes, and prediction reference information of a current image block to be decoded; wherein when the prediction mode is a planar prediction mode, the prediction reference information includes prediction correction Quantity serial number.
  • the entropy decoder 501 may specifically be the entropy decoder 203 in FIG. 2B.
  • the intra predictor 502 is configured to determine a prediction correction amount based on the prediction correction amount number when the prediction mode of the current image block is a flat prediction mode; and obtain a prediction image of the current image block based on the prediction correction amount. .
  • the intra predictor 502 may specifically be the intra predictor 209 in FIG. 2B.
  • a reconstruction unit 503 is configured to obtain a reconstructed image of the current image block based on the predicted image of the current image block and the prediction residual of the current image block.
  • the reconstruction unit 503 may specifically be the summer 211 in FIG. 2B.
  • the intra predictor 502 may be specifically configured to: if the prediction correction amount number is a first preset number, determine the prediction correction amount as a first preset correction amount; or If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a second preset correction amount.
  • the first preset correction amount and the second preset correction amount are opposite numbers to each other.
  • the first preset serial number may be 1 and the second preset serial number may be 2.
  • the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
  • A1 Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
  • A1 represents the first preset correction amount
  • pow (2, BD– 8) represents the BD-8 power of 2
  • H represents the height of the current image block
  • W represents the width of the current image block
  • the intra predictor 502 may be further specifically configured to: if the prediction correction amount is a first preset number, determine that the prediction correction amount is a third preset correction amount; if If the predicted correction amount number is a second preset number, it is determined that the predicted correction amount is a fourth preset number; if the predicted correction amount is a third preset number, it is determined that the predicted correction amount is A fifth preset correction amount; or if the predicted correction amount number is a fourth preset number, determining that the predicted correction amount is a sixth preset correction amount.
  • the third preset correction amount and the fourth preset correction amount are opposite numbers to each other; and the fifth preset correction amount and the sixth preset correction amount are opposite numbers to each other.
  • the first preset serial number can be 1, the second preset serial number can be 2, the third preset serial number can be 3, and the fourth preset serial number can be 4.
  • the third preset correction amount and the fifth preset correction amount are preset positive integers, and the fifth preset correction amount is greater than the third preset correction amount.
  • the fifth preset correction amount may be the third preset correction amount.
  • the amount is 1.75 times, or 2 times, or 2.25 times.
  • the intra predictor 502 may be further specifically configured to:
  • the predicted correction amount number is a first preset number, determining the predicted correction amount as a first preset correction amount; if If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a second preset correction amount; or
  • the prediction correction amount is a first preset number, determining that the prediction correction amount is a second preset correction amount; If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a first preset correction amount.
  • the first preset correction amount and the second preset correction amount are opposite numbers to each other.
  • the weighted average value may specifically be a predicted value of a lower right pixel of the current image block, and may be obtained by, for example, the following calculation formula:
  • P1 (W, H) P (W, –1) * a + P (–1, H) * (1–a);
  • P1 (W, H) represents the predicted value of the lower right pixel
  • P (W, –1) represents the value of the upper right reference pixel
  • P (–1, H) represents the value of the lower left reference pixel
  • a can be a preset value, such as 0.4, 0.5, or 0.6, etc .
  • the upper left reference pixel, the lower left reference pixel, the upper right reference pixel, and the lower right pixel do not belong to the current image block.
  • the current image block is an image block of W * H
  • the range of the abscissa of the pixel in the current image block is [0, W-1]
  • the range of the ordinate of the pixel in the current image block is [ 0, H-1]
  • the coordinates of the upper left reference pixel are (-1, -1)
  • the coordinates of the lower left reference pixel are (-1, H)
  • the coordinates of the lower right pixel are ( W, H)
  • the coordinates of the upper right reference pixel are (W, -1).
  • the first preset serial number may be 1 and the second preset serial number may be 2.
  • the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
  • A1 Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
  • A1 represents the first preset correction amount
  • pow (2, BD– 8) represents the BD-8 power of 2
  • H represents the height of the current image block
  • W represents the width of the current image block
  • the intra predictor may be further specifically configured to: if the prediction correction amount sequence number is a first preset sequence number, based on a value of a lower left reference pixel of the current image block, the current image A value of the upper right reference pixel of the block and a value of the upper left reference pixel of the current image block are used to obtain a difference value; and the prediction correction amount is determined based on the difference value.
  • the intra predictor may be specifically configured to obtain the difference value by calculating as follows:
  • D represents the difference value
  • P (W, –1) represents the value of the lower left reference pixel of the current image block
  • P (–1, H) represents the value of the upper right reference pixel of the current image block
  • P (–1, –1) represents the value of the upper left reference pixel of the current image block
  • a can be a preset value, such as 0.4, 0.5, or 0.6, etc .
  • a can also be the same as all
  • the intra predictor 502 may be specifically configured to:
  • the prediction correction amount is determined based on the following calculation formula:
  • M represents the predicted correction amount
  • D represents the difference value
  • sign (D) represents the sign of taking the difference value
  • B3 is a preset positive integer
  • B4 is a preset positive integer
  • the intra predictor 502 may be further specifically configured to: modify the prediction value of the lower right pixel of the current image block based on the prediction correction amount; based on the right of the current image block The correction value of the prediction value of the lower pixel obtains the prediction image of the current image block.
  • the intra predictor 502 may be further specifically configured to: limit the correction value of the prediction value of the lower right pixel of the current image block to a preset value range, and the prediction The value range is set to [0, pow (2, N) –1], where pow (2, N) represents the Nth power of 2 and N represents the bit width; based on being limited to the preset value range A correction value of a prediction value of a lower right pixel of the current image block is used to obtain a prediction image of the current image block.
  • the prediction value of the prediction value of the lower right pixel of the current image block is less than 0, the prediction value of the lower right pixel of the current image block is corrected to 0, that is, the correction value of the prediction value of the lower right pixel of the current image block is 0; if the correction value of the prediction value of the bottom right pixel of the current image block is greater than, the prediction value of the bottom right pixel of the current image block is modified to pow (2, N) -1, that is, the The correction value of the predicted value is pow (2, N) –1; if the correction value of the predicted value of the lower right pixel of the current image block is greater than or equal to 0 and less than or equal to pow (2, N) –1, then it is not required Correct the predicted value of the lower right pixel of the current image block, that is, the predicted value of the lower right pixel of the current image block is the predicted value of the lower right pixel of the current image block.
  • the current image block is a CU luma image block, and may also be a CU chroma image block.
  • the current image block uses a planar prediction mode.
  • the process of decoding the current image block by using the plane prediction method includes the following steps:
  • Step 1 Parse the predicted correction amount number Idx of the current image block from the code stream, and obtain the correction amount M according to the number.
  • the predicted correction amount serial number Idx is 0, which indicates that the correction amount M is 0, and the serial number greater than 0 indicates that the correction amount M is not zero.
  • its derivation method may adopt one of the following methods.
  • Method 1 When the predicted correction amount number Idx is 1, the correction amount M is the first preset value A1; when Idx is 2, the correction amount M is -A1.
  • A1 can also be a variable related to the width and height of the current block, for example:
  • A1 Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)),
  • Method 3 Weight the average of the lower left reference pixel P (–1, H) and the upper right reference pixel P (W, –1) to obtain the first predicted value P1 (W, H) of the lower right pixel of the current image block. If the first predicted value P1 (W, H) is smaller than the value of the upper left reference pixel P (–1, –1), when the predicted correction amount number Idx is 1, the correction amount M is the first preset value A1; when Idx When it is 2, the correction amount M is –A1; if the first predicted value P1 (W, H) is greater than or equal to the value of the upper left reference pixel P (–1, –1), when the predicted correction amount number Idx is 1, the correction amount is corrected. The amount M is the first preset value -A1; when Idx is 2, the correction amount M is A1.
  • Step 2 Weighted average the lower left reference pixel P (–1, H) and the upper right reference pixel P (W, –1) to obtain the first predicted value P1 (W, H) of the lower right pixel of the current image block; M is added to the first prediction value P1 (W, H) to obtain a second prediction value P2 (W, H) of the pixel in the lower right corner.
  • step 2 may further include: limiting the second prediction value P2 (W, H) to the value range of the prediction signal, for example, the value range of the N-bit wide prediction signal is [0, pow ( 2, N) –1].
  • the weighted average of the lower left reference pixel and the upper right reference pixel to obtain the first prediction value P1 (W, H) of the lower right corner pixel of the current image block is the prior art, such as using the method in JVET-E0068 (the second prior art). .
  • Step 3 The weighted average of the second predicted value P2 (W, H) of the lower right pixel and the lower left reference pixel P (–1, H) to obtain the predicted value P (x, y) of the lower pixel of the predicted pixel P (x, y). H); weighted average of the second predicted value P2 (W, H) of the lower right pixel and the upper right reference pixel P (W, –1) to obtain the predicted value P (W, of the right pixel of the predicted pixel P (x, y) y).
  • This step is the prior art, such as using the method in JVET-E0068 (the second prior art).
  • Step 4 The weighted average of P (x, H) and P (x, –1) to obtain the vertical prediction value Pv (x, y) of P (x, y); P (W, y) and P (– 1, y) weighted average to get the level prediction value Ph (x, y) of P (x, y); weighted average of Ph (x, y) and Pv (x, y) to get the coordinates of (x, y) The pixel's predicted value P (x, y).
  • This step is the prior art, such as using the method in JVET-E0068 (the second prior art).
  • Step 5 Add the predicted image of the current image block and the residual of the current image block to obtain a reconstructed image of the current image block.
  • This step is prior art, such as using the method in H.265.
  • FIG. 6 is a schematic block diagram of an implementation manner of an encoding device or a decoding device (referred to as a decoding device 1200) according to an embodiment of the present application.
  • the decoding device 1200 may include a processor 1210, a memory 1230, and a bus system 1250.
  • the processor and the memory are connected through a bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory.
  • the memory of the encoding device stores program code, and the processor can call the program code stored in the memory to perform various video encoding or decoding methods described in this application, especially the video encoding or decoding methods in various new inter prediction modes. , And methods for predicting motion information in various new inter prediction modes. To avoid repetition, it will not be described in detail here.
  • the processor 1210 may be a Central Processing Unit (“CPU”), and the processor 1210 may also be another general-purpose processor, digital signal processor (DSP), or special-purpose integration. Circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 1230 may include a read only memory (ROM) device or a random access memory (RAM) device. Any other suitable type of storage device may also be used as the memory 1230.
  • the memory 1230 may include code and data 1231 accessed by the processor 1210 using the bus 1250.
  • the memory 1230 may further include an operating system 1233 and an application program 1235, which includes a processor 1210 that allows the processor 1210 to perform the video encoding or decoding method described in this application (especially the inter prediction method or the motion information prediction method described in this application). At least one program.
  • the application program 1235 may include applications 1 to N, which further includes a video encoding or decoding application (referred to as a video decoding application) that executes the video encoding or decoding method described in this application.
  • the bus system 1250 may include a data bus, a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are marked as the bus system 1250 in the figure.
  • the decoding device 1200 may further include one or more output devices, such as a display 1270.
  • the display 1270 may be a tactile display that incorporates the display with a tactile unit operatively sensing a touch input.
  • the display 1270 may be connected to the processor 1210 via a bus 1250.
  • Computer-readable media may include computer-readable storage media, which corresponds to tangible media, such as data storage media, or communication media including any medium that facilitates transfer of a computer program from one place to another (e.g., according to a communication protocol) .
  • computer-readable media may generally correspond to (1) tangible computer-readable storage media that is non-transitory, or (2) a communication medium such as a signal or carrier wave.
  • a data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, code, and / or data structures used to implement the techniques described in this application.
  • the computer program product may include a computer-readable medium.
  • such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, flash memory, or may be used to store instructions or data structures Any other medium in the form of the required program code and accessible by a computer. Also, any connection is properly termed a computer-readable medium. For example, if coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave are used to transmit instructions from a website, server, or other remote source, then coaxial cable Wire, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of media.
  • DSL digital subscriber line
  • the computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other temporary media, but are instead directed to non-transitory tangible storage media.
  • magnetic and optical discs include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), and Blu-ray discs, where magnetic discs typically reproduce data magnetically, and optical discs use lasers to reproduce optical data. Combinations of the above should also be included within the scope of computer-readable media.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGAs field programmable logic arrays
  • processor may refer to any of the aforementioned structures or any other structure suitable for implementing the techniques described herein.
  • functions described by the various illustrative logical blocks, modules, and steps described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or Into the combined codec.
  • the techniques can be fully implemented in one or more circuits or logic elements.
  • the techniques of this application may be implemented in a wide variety of devices or devices, including a wireless handset, an integrated circuit (IC), or a group of ICs (eg, a chipset).
  • IC integrated circuit
  • Various components, modules, or units are described in this application to emphasize functional aspects of the apparatus for performing the disclosed techniques, but do not necessarily need to be implemented by different hardware units.
  • the various units may be combined in a codec hardware unit in combination with suitable software and / or firmware, or through interoperable hardware units (including one or more processors as described above) provide.

Landscapes

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

Abstract

Disclosed are an image block decoding method and device. The method comprises: parsing a code stream to acquire a prediction residual, a prediction mode, and prediction reference information of a current image block to be decoded, wherein when the prediction mode is a planar prediction mode, the prediction reference information comprises a prediction correction amount sequence number; if the prediction mode of the current image block is the planar prediction mode, determining a prediction correction amount on the basis of the prediction correction amount sequence number; acquiring a prediction image of the current image block on the basis of the prediction correction amount; and acquiring a reconstructed image of the current image block on the basis of the prediction image and the prediction residual of the current image block. The method improves the accuracy of predicting motion information of an image block, thereby improving coding and decoding performance.

Description

图像块解码方法及装置Image block decoding method and device
本申请要求于2018年7月2日提交美国专利局、申请号为62/693,428、发明名称为“Method and apparatus for planar prediction”的美国专利临时申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority from a US Patent Provisional Application filed on July 2, 2018 with the US Patent Office, application number 62 / 693,428, and the invention name is "Method and Apparatus for Planar Prediction", the entire contents of which are incorporated herein by reference Applying.
技术领域Technical field
本申请涉及视频编解码技术领域,尤其涉及图像块解码方法及装置。The present application relates to the technical field of video coding and decoding, and in particular, to a method and a device for decoding an image block.
背景技术Background technique
数字视频能力可并入到多种多样的装置中,包含数字电视、数字直播系统、无线广播系统、个人数字助理(PDA)、膝上型或桌上型计算机、平板计算机、电子图书阅读器、数码相机、数字记录装置、数字媒体播放器、视频游戏装置、视频游戏控制台、蜂窝式或卫星无线电电话(所谓的“智能电话”)、视频电话会议装置、视频流式传输装置及其类似者。数字视频装置实施视频压缩技术,例如,在由MPEG-2、MPEG-4、ITU-T H.263、ITU-T H.264/MPEG-4第10部分高级视频编码(AVC)定义的标准、视频编码标准H.265/高效视频编码(HEVC)标准以及此类标准的扩展中所描述的视频压缩技术。视频装置可通过实施此类视频压缩技术来更有效率地发射、接收、编码、解码和/或存储数字视频信息。Digital video capabilities can be incorporated into a wide variety of devices, including digital television, digital live broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, Digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radio phones (so-called "smart phones"), video teleconferencing devices, video streaming devices, and the like . Digital video devices implement video compression technology, for example, in standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10 Advanced Video Coding (AVC), Video coding standards described in the H.265 / High Efficiency Video Coding (HEVC) standard and extensions to such standards. Video devices can implement such video compression techniques to more efficiently transmit, receive, encode, decode, and / or store digital video information.
视频压缩技术执行空间(图像内)预测和/或时间(图像间)预测以减少或去除视频序列中固有的冗余。对于基于块的视频编码,视频条带(即,视频帧或视频帧的一部分)可分割成若干图像块,所述图像块也可被称作树块、编码单元(CU)和/或编码节点。使用关于同一图像中的相邻块中的参考样本的空间预测来编码图像的待帧内编码(I)条带中的图像块。图像的待帧间编码(P或B)条带中的图像块可使用相对于同一图像中的相邻块中的参考样本的空间预测或相对于其它参考图像中的参考样本的时间预测。图像可被称作帧,且参考图像可被称作参考帧。Video compression techniques perform spatial (intra-image) prediction and / or temporal (inter-image) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (ie, a video frame or a portion of a video frame) can be partitioned into image blocks, which can also be referred to as tree blocks, coding units (CU), and / or coding nodes . Spatial predictions about reference samples in neighboring blocks in the same image are used to encode image blocks in the to-be-encoded (I) slice of the image. The image blocks in the to-be-intercoded (P or B) slice of the image may use spatial prediction relative to reference samples in neighboring blocks in the same image or temporal prediction relative to reference samples in other reference images. An image may be referred to as a frame, and a reference image may be referred to as a reference frame.
其中,包含高效视频编码(HEVC)标准在内的各种视频编码标准提出了用于图像块的预测性编码模式,即基于已经编码的视频数据块来预测当前待编码的块。在帧内预测模式中,基于与当前块在相同的图像中的一或多个先前经解码相邻块来预测当前块;在帧间预测模式中,基于不同图像中的已经解码块来预测当前块。Among them, various video coding standards including the High-Efficiency Video Coding (HEVC) standard have proposed predictive coding modes for image blocks, that is, predicting a current block to be coded based on a video data block that has been coded. In intra prediction mode, the current block is predicted based on one or more previously decoded neighboring blocks in the same image as the current block; in inter prediction mode, the current block is predicted based on already decoded blocks in different images. Piece.
其中,帧内预测模式包括方向模式和非方向模式,其中非方向模式包括直流(DC)模式和平面(Planar)模式,现有的一种Planar模式使用以下方式产生当前图像块中任意一个像素的预测值,像素的预测值记为P(x,y),其中(x,y)表示像素的坐标位置,当前图像块的左上角为(0,0)位置,水平向右为x轴正方向,竖直向下为y轴正方向。对位于(x,y)的像素,由它上方的参考像素P(x,–1)、左方的参考像素P(–1,y)、当前图像块右上预设位置的参考像素P(W,–1)、当前图像块左下预设位置的参考像素P(–1,H)加权平均得到这个像素的预测值P(x,y),其中W和H分别为当前图像块的宽和高,x=0,1,…,W–1,y=0,1,…,H–1。具体处理包括:Among them, the intra prediction mode includes a directional mode and a non-directional mode, and the non-directional mode includes a direct current (DC) mode and a plane (Planar) mode. An existing Planar mode uses the following methods to generate any pixel in the current image block. Predicted value, the predicted value of the pixel is recorded as P (x, y), where (x, y) represents the coordinate position of the pixel, the upper left corner of the current image block is the (0,0) position, and the horizontal right is the positive direction of the x axis , Vertical downward is the positive direction of the y-axis. For the pixel at (x, y), the reference pixel P (x, –1) above it, the left reference pixel P (–1, y), and the reference pixel P (W at the preset upper right position of the current image block) , –1), the weighted average of the reference pixel P (–1, H) at the preset lower left position of the current image block to obtain the predicted value P (x, y) of this pixel, where W and H are the width and height of the current image block, respectively , x = 0,1, ..., W-1, y = 0,1, ..., H-1. Specific processing includes:
使用左下参考像素P(–1,H)和右上参考像素P(W,–1)的加权平均值作为当前图像块右下位置(W,H)的预测值P(W,H);Use the weighted average of the lower left reference pixel P (-1, H) and the upper right reference pixel P (W, -1) as the predicted value P (W, H) of the lower right position (W, H) of the current image block;
利用P(W,–1)和P(W,H)线性插值得到P(x,y)右侧像素的预测值P(W,y),其中y=0,1,…,H-1;由P(W,y)和P(–1,y)线性插值得到位置为(x,y)的像素的水平预测值Ph(x,y);该步骤的具体处理可以如图7A所示;Use P (W, –1) and P (W, H) linear interpolation to get the predicted value P (W, y) of the pixel on the right side of P (x, y), where y = 0,1, ..., H-1; The linear prediction value of the pixel at position (x, y) is Ph (x, y) by linear interpolation of P (W, y) and P (-1, y); the specific processing of this step can be shown in Figure 7A;
利用P(–1,H)和P(W,H)线性插值得到P(x,y)下侧像素的预测值P(x,H),其中x=0,1,…,W-1;由P(x,H)和P(x,–1)线性插值得到位置为(x,y)的像素的竖直预测值Pv(x,y);该步骤的具体处理可以如图7B所示。Use P (–1, H) and P (W, H) linear interpolation to get the predicted value P (x, H) of the pixel below P (x, y), where x = 0,1, ..., W-1; The linear prediction of the pixel at position (x, y) Pv (x, y) is obtained by linear interpolation of P (x, H) and P (x, –1); the specific processing of this step can be shown in Figure 7B .
将Ph(x,y)和Pv(x,y)加权平均得到P(x,y),一种具体的加权处理可以如下式所示:The weighted average of Ph (x, y) and Pv (x, y) to get P (x, y), a specific weighting process can be shown as follows:
Figure PCTCN2019091505-appb-000001
Figure PCTCN2019091505-appb-000001
当前图像块右下部分区域的像素中,距离P(W,H)较近的像素的预测值与P(W,H)较接近。当P(W,H)对应的实际像素值与此预测值偏离较大时,这种预测方式产生的预测图像的右下部分区域的预测残差较大,预测效率较低。Among the pixels in the lower right part of the current image block, the prediction value of the pixel closer to P (W, H) is closer to P (W, H). When the actual pixel value corresponding to P (W, H) deviates significantly from this prediction value, the prediction residual in the lower right part of the prediction image generated by this prediction method is large and the prediction efficiency is low.
发明内容Summary of the invention
本申请实施例提供一种图像块解码方法及装置,可以提高图像块的运动信息的预测准确性,从而提高编解码性能。The embodiments of the present application provide an image block decoding method and device, which can improve the prediction accuracy of the motion information of the image block, thereby improving the encoding and decoding performance.
第一方面,提供了一种图像块解码方法,包括:解析码流以获取待解码当前图像块的预测残差,预测模式以及预测参考信息;其中,在所述预测模式为平面预测模式时,所述预测参考信息包括预测修正量序号;若所述当前图像块的预测模式为平面预测模式,基于所述预测修正量序号确定预测修正量;基于所述预测修正量获得所述当前图像块的预测图像;基于所述当前图像块的预测图像和所述当前图像块的预测残差,获得所述当前图像块的重建图像。According to a first aspect, an image block decoding method is provided, including: parsing a bitstream to obtain a prediction residual, a prediction mode, and prediction reference information of a current image block to be decoded; wherein when the prediction mode is a planar prediction mode, The prediction reference information includes a prediction correction amount sequence number; if the prediction mode of the current image block is a planar prediction mode, determining a prediction correction amount based on the prediction correction amount number; and obtaining a A predicted image; obtaining a reconstructed image of the current image block based on the predicted image of the current image block and the prediction residual of the current image block.
结合第一方面,在第一种实施方式中,所述基于所述预测修正量序号确定预测修正量包括:若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量。With reference to the first aspect, in a first implementation manner, determining the prediction correction amount based on the prediction correction amount number includes: if the prediction correction amount number is a first preset number, determining the prediction correction amount as A first preset correction amount; if the predicted correction amount number is a second preset number, determining the predicted correction amount as a second preset correction amount.
其中,所述第一预设修正量与所述第二预设修正量互为相反数。The first preset correction amount and the second preset correction amount are opposite numbers to each other.
其中,第一预设序号可以为1,第二预设序号可以为2。The first preset serial number may be 1 and the second preset serial number may be 2.
其中,若所述预测修正量序号为0,则确定所述预测修正量为0。Wherein, if the prediction correction amount number is 0, it is determined that the prediction correction amount is 0.
在一种实施方式中,所述第一预设修正量为预设的正整数,例如可以为8、16、32、64等正整数。进一步地,对于不同的比特位宽,所述第一预设修正量的预设值可能也不一样,例如在8比特位宽时,所述第一预设修正量可以为10、16或20;在10比特位宽时,所述第一预设修正量可以为A1=40、64或80。In an implementation manner, the first preset correction amount is a preset positive integer, and may be, for example, a positive integer such as 8, 16, 32, or 64. Further, the preset value of the first preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the first preset correction amount may be 10, 16, or 20 ; When the width is 10 bits, the first preset correction amount may be A1 = 40, 64, or 80.
在另一种实施方式中,所述第一预设修正量也可以为与所述当前图像块的宽和高相关的变量;例如,所述第一预设修正量可以基于如下计算式计算确定:In another implementation manner, the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
A1=Clip3(B1,B2,(W+H)/2*pow(2,BD–8));A1 = Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
其中,A1表示所述第一预设修正量;B1和B2为预设正整数且B1<B2,例如B1=8、B2=16,或者B1=12、B2=20;pow(2,BD–8)表示2的BD–8次幂,BD表示比特位宽, 例如BD=8或10或12;H表示所述当前图像块的高,W表示所述当前图像块的宽;Clip3(B1,B2,(W+H)/2*pow(2,BD–8))表示将(W+H)/2*pow(2,BD–8)的值限制在B1和B2之间,即若((W+H)/2*pow(2,BD–8))<B1,则(W+H)/2*pow(2,BD–8)=B1,若((W+H)/2*pow(2,BD–8))>B2,则(W+H)/2*pow(2,BD–8)=B2,若B1≤((W+H)/2*pow(2,BD–8))≤B2,则(W+H)/2*pow(2,BD–8)=(W+H)/2*pow(2,BD–8)。Among them, A1 represents the first preset correction amount; B1 and B2 are preset positive integers and B1 <B2, for example, B1 = 8, B2 = 16, or B1 = 12, B2 = 20; pow (2, BD– 8) represents the BD-8 power of 2, BD represents the bit width, for example BD = 8 or 10 or 12; H represents the height of the current image block, W represents the width of the current image block; Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)) means to limit the value of (W + H) / 2 * pow (2, BD–8) to between B1 and B2, that is, if ( (W + H) / 2 * pow (2, BD–8)) <B1, then (W + H) / 2 * pow (2, BD–8) = B1, if ((W + H) / 2 * pow (2, BD–8))> B2, then (W + H) / 2 * pow (2, BD–8) = B2, if B1≤ ((W + H) / 2 * pow (2, BD– 8)) ≤ B2, then (W + H) / 2 * pow (2, BD–8) = (W + H) / 2 * pow (2, BD–8).
结合第一方面,在第二种实施方式中,所述基于所述预测修正量序号确定预测修正量包括:With reference to the first aspect, in a second implementation manner, the determining a prediction correction amount based on the prediction correction amount number includes:
若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第三预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第四预设修正量;若所述预测修正量序号为第三预设序号,则确定所述预测修正量为第五预设修正量;或者若所述预测修正量序号为第四预设序号,则确定所述预测修正量为第六预设修正量。If the predicted correction amount number is a first preset number, determine the predicted correction amount as a third preset number; if the predicted correction amount is a second preset number, determine the predicted correction amount Is the fourth preset correction amount; if the predicted correction amount number is a third preset number, determining that the predicted correction amount is a fifth preset correction amount; or if the predicted correction amount number is a fourth preset number The serial number determines that the predicted correction amount is a sixth preset correction amount.
其中,所述第三预设修正量与所述第四预设修正量互为相反数;且所述第五预设修正量与所述第六预设修正量互为相反数。The third preset correction amount and the fourth preset correction amount are opposite numbers to each other; and the fifth preset correction amount and the sixth preset correction amount are opposite numbers to each other.
其中,若所述预测修正量序号为0,则确定所述预测修正量为0。Wherein, if the prediction correction amount number is 0, it is determined that the prediction correction amount is 0.
其中,第一预设序号可以为1,第二预设序号可以为2,第三预设序号可以为3,第四预设序号可以为4。The first preset serial number can be 1, the second preset serial number can be 2, the third preset serial number can be 3, and the fourth preset serial number can be 4.
其中,第三预设修正量和第五预设修正量为预设正整数,且第五预设修正量大于第三预设修正量,例如第五预设修正量可以为第三预设修正量的1.75倍,或2倍,或2.25倍。The third preset correction amount and the fifth preset correction amount are preset positive integers, and the fifth preset correction amount is greater than the third preset correction amount. For example, the fifth preset correction amount may be the third preset correction amount. The amount is 1.75 times, or 2 times, or 2.25 times.
其中,所述第三预设修正量可以为8、16、32、或64等正整数。进一步地,对于不同的比特位宽,所述第三预设修正量的预设值可能也不一样,例如在8比特位宽时,所述第三预设修正量可以为10、16或20等等;在10比特位宽时,所述第三预设修正量可以为A1=40、64或80等等。The third preset correction amount may be a positive integer such as 8, 16, 32, or 64. Further, the preset value of the third preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the third preset correction amount may be 10, 16, or 20 And so on; when the width is 10 bits, the third preset correction amount may be A1 = 40, 64, 80, and so on.
结合第一方面,在第三种实施方式中,所述基于所述预测修正量序号确定预测修正量包括:将所述当前图像块的左下参考像素的值与所述当前图像块的右上参考像素的值进行加权平均,获得加权平均值;在所述加权平均值小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量;或者在所述加权平均值不小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第二预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第一预设修正量。With reference to the first aspect, in a third implementation manner, the determining a prediction correction amount based on the prediction correction amount number includes: comparing a value of a lower left reference pixel of the current image block with an upper right reference pixel of the current image block The weighted average value is used to obtain a weighted average value; when the weighted average value is less than the value of the upper left reference pixel of the current image block, if the prediction correction amount serial number is a first preset serial number, the prediction is determined The correction amount is a first preset correction amount; if the predicted correction amount number is a second preset number, determining that the predicted correction amount is a second preset correction amount; or when the weighted average is not less than the weighted average When the value of the upper left reference pixel of the current image block is, if the predicted correction amount is a first preset number, it is determined that the predicted correction amount is a second preset correction amount; if the predicted correction amount number is a second The preset serial number determines that the predicted correction amount is a first preset correction amount.
其中,所述第一预设修正量与所述第二预设修正量互为相反数。The first preset correction amount and the second preset correction amount are opposite numbers to each other.
其中,所述加权平均值具体可以为所述当前图像块的右下像素的预测值,例如可以通过如下计算式获得:The weighted average value may specifically be a predicted value of a lower right pixel of the current image block, and may be obtained by, for example, the following calculation formula:
P1(W,H)=P(W,–1)*a+P(–1,H)*(1–a);P1 (W, H) = P (W, –1) * a + P (–1, H) * (1–a);
其中,P1(W,H)表示所述右下像素的预测值,P(W,–1)表示所述右上参考像素的值,P(–1,H)表示所述左下参考像素的值;0<a<1,a可以为预设值,例如为0.4,0.5,或0.6等等;a也可以为与所述当前图像块的宽和高相关的变量,例如a=H/(W+H),其中H表示所述 当前图像块的高,W表示所述当前图像块的宽。Wherein, P1 (W, H) represents the predicted value of the lower right pixel, P (W, –1) represents the value of the upper right reference pixel, and P (–1, H) represents the value of the lower left reference pixel; 0 <a <1, a can be a preset value, such as 0.4, 0.5, or 0.6, etc .; a can also be a variable related to the width and height of the current image block, such as a = H / (W + H), where H represents the height of the current image block, and W represents the width of the current image block.
其中,所述左上参考像素,左下参考像素,所述右上参考像素和所述右下像素均不属于所述当前图像块。例如,在当前图像块为W*H的图像块时,当前图像块中像素的横坐标的取值范围为[0,W-1],当前图像块中像素的纵坐标的取值范围为[0,H-1];相应的,所述左上参考像素的坐标为(-1,-1),所述左下参考像素的坐标为(-1,H),所述右下像素的坐标为(W,H),所述右上参考像素的坐标为(W,-1)。The upper left reference pixel, the lower left reference pixel, the upper right reference pixel, and the lower right pixel do not belong to the current image block. For example, when the current image block is an image block of W * H, the range of the abscissa of the pixel in the current image block is [0, W-1], and the range of the ordinate of the pixel in the current image block is [ 0, H-1]; correspondingly, the coordinates of the upper left reference pixel are (-1, -1), the coordinates of the lower left reference pixel are (-1, H), and the coordinates of the lower right pixel are ( W, H), and the coordinates of the upper right reference pixel are (W, -1).
其中,第一预设序号可以为1,第二预设序号可以为2。The first preset serial number may be 1 and the second preset serial number may be 2.
其中,若所述预测修正量序号为0,则确定所述预测修正量为0。Wherein, if the prediction correction amount number is 0, it is determined that the prediction correction amount is 0.
在一种实施方式中,所述第一预设修正量为预设的正整数,例如可以为8、16、32、64等正整数。进一步地,对于不同的比特位宽,所述第一预设修正量的预设值可能也不一样,例如在8比特位宽时,所述第一预设修正量可以为10、16或20;在10比特位宽时,所述第一预设修正量可以为A1=40、64或80。In an implementation manner, the first preset correction amount is a preset positive integer, and may be, for example, a positive integer such as 8, 16, 32, or 64. Further, the preset value of the first preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the first preset correction amount may be 10, 16, or 20 ; When the width is 10 bits, the first preset correction amount may be A1 = 40, 64, or 80.
在另一种实施方式中,所述第一预设修正量也可以为与所述当前图像块的宽和高相关的变量;例如,所述第一预设修正量可以基于如下计算式计算确定:In another implementation manner, the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
A1=Clip3(B1,B2,(W+H)/2*pow(2,BD–8));A1 = Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
其中,A1表示所述第一预设修正量;B1和B2为预设正整数且B1<B2,例如B1=8、B2=16,或者B1=12、B2=20;pow(2,BD–8)表示2的BD–8次幂,BD表示比特位宽,例如BD=8或10或12;H表示所述当前图像块的高,W表示所述当前图像块的宽;Clip3(B1,B2,(W+H)/2*pow(2,BD–8))表示将(W+H)/2*pow(2,BD–8)的值限制在B1和B2之间,即若((W+H)/2*pow(2,BD–8))<B1,则(W+H)/2*pow(2,BD–8)=B1,若((W+H)/2*pow(2,BD–8))>B2,则(W+H)/2*pow(2,BD–8)=B2,若B1≤((W+H)/2*pow(2,BD–8))≤B2,则(W+H)/2*pow(2,BD–8)=(W+H)/2*pow(2,BD–8)。Among them, A1 represents the first preset correction amount; B1 and B2 are preset positive integers and B1 <B2, for example, B1 = 8, B2 = 16, or B1 = 12, B2 = 20; pow (2, BD– 8) represents the BD-8 power of 2, BD represents the bit width, such as BD = 8 or 10 or 12; H represents the height of the current image block, W represents the width of the current image block; Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)) means to limit the value of (W + H) / 2 * pow (2, BD–8) to between B1 and B2, that is, if ( (W + H) / 2 * pow (2, BD–8)) <B1, then (W + H) / 2 * pow (2, BD–8) = B1, if ((W + H) / 2 * pow (2, BD–8))> B2, then (W + H) / 2 * pow (2, BD–8) = B2, if B1≤ ((W + H) / 2 * pow (2, BD– 8)) ≤ B2, then (W + H) / 2 * pow (2, BD–8) = (W + H) / 2 * pow (2, BD–8).
结合第一方面,在第四种实施方式中,所述基于所述预测修正量序号确定预测修正量包括:若所述预测修正量序号为第一预设序号,基于所述当前图像块的左下参考像素的值,所述当前图像块的右上参考像素的值以及所述当前图像块的左上参考像素的值获得差分值;基于所述差分值确定所述预测修正量。With reference to the first aspect, in a fourth implementation manner, determining the prediction correction amount based on the prediction correction amount number includes: if the prediction correction amount number is a first preset number, based on a lower left of the current image block The value of the reference pixel, the value of the upper right reference pixel of the current image block and the value of the upper left reference pixel of the current image block are used to obtain a difference value; and the prediction correction amount is determined based on the difference value.
结合第一方面的第四种实施方式,在第五种实施方式中,通过如下计算式计算获得所述差分值:With reference to the fourth implementation manner of the first aspect, in a fifth implementation manner, the difference value is obtained through calculation by the following calculation formula:
D=P(W,–1)*a+P(–1,H)*(1–a)–P(–1,–1);D = P (W, –1) * a + P (–1, H) * (1–a) –P (–1, –1);
其中,D表示所述差分值,P(W,–1)表示所述当前图像块的左下参考像素的值,P(–1,H)表示所述当前图像块的右上参考像素的值,P(–1,–1)表示所述当前图像块的左上参考像素的值;0<a<1,a可以为预设值,例如为0.4,0.5,或0.6等等;a也可以为与所述当前图像块的宽和高相关的变量,例如a=H/(W+H),其中H表示所述当前图像块的高,W表示所述当前图像块的宽。Among them, D represents the difference value, P (W, –1) represents the value of the lower left reference pixel of the current image block, P (–1, H) represents the value of the upper right reference pixel of the current image block, P (–1, –1) represents the value of the upper left reference pixel of the current image block; 0 <a <1, a can be a preset value, such as 0.4, 0.5, or 0.6, etc .; a can also be the same as all The width and height related variables of the current image block are described, for example, a = H / (W + H), where H represents the height of the current image block and W represents the width of the current image block.
结合第一方面的第四种实施方式或第五种实施方式,在第六种实施方式中,所述基于所述差分值确定所述预测修正量包括:With reference to the fourth embodiment or the fifth embodiment of the first aspect, in a sixth embodiment, the determining the prediction correction amount based on the difference value includes:
基于如下计算式计算确定所述预测修正量:The prediction correction amount is determined based on the following calculation formula:
M=Clip3(sign(D)*B3,sign(D)*B4,D);M = Clip3 (sign (D) * B3, sign (D) * B4, D);
其中,M表示所述预测修正量,D表示所述差分值。sign(D)表示取所述差分值的符号,其中,如果D≥0,sign(D)=1;如果D<0,sign(D)=–1。B3为预设正整数,B4为预设正整数,B3<B4。Clip3(sign(D)*B3,sign(D)*B4,D)表示将D的值限制在sign(D)*B3与sign(D)*B4之间;例如,在sign(D)=1时,如果D<sign(D)*B3,则D=sign(D)*B3,如果D>sign(D)*B4,则D=sign(D)*B4,如果sign(D)*B3≤D≤sign(D)*B4,则D=D;例如,在sign(D)=-1时,如果D<sign(D)*B4,则D=sign(D)*B4,如果D>sign(D)*B3,则D=sign(D)*B3,如果sign(D)*B4≤D≤sign(D)*B3,则D=D。Wherein, M represents the predicted correction amount, and D represents the difference value. sign (D) represents the sign of the difference value, where if D ≧ 0, sign (D) = 1; if D <0, sign (D) = − 1. B3 is a preset positive integer, B4 is a preset positive integer, and B3 <B4. Clip3 (sign (D) * B3, sign (D) * B4, D) means to limit the value of D between sign (D) * B3 and sign (D) * B4; for example, at sign (D) = 1 If D <sign (D) * B3, then D = sign (D) * B3, if D> sign (D) * B4, then D = sign (D) * B4, if sign (D) * B3≤ D≤sign (D) * B4, then D = D; for example, when sign (D) =-1, if D <sign (D) * B4, then D = sign (D) * B4, if D> sign (D) * B3, then D = sign (D) * B3, if sign (D) * B4≤D≤sign (D) * B3, then D = D.
结合第一方面或第一方面的上述实施方式中的任意一种,在第七种实施方式中,所述基于所述预测修正量获得所述当前图像块的预测图像包括:基于所述预测修正量对所述当前图像块的右下像素的预测值进行修正;基于所述当前图像块的右下像素的预测值的修正值获得所述当前图像块的预测图像。With reference to the first aspect or any one of the foregoing implementation manners of the first aspect, in a seventh implementation manner, the obtaining a predicted image of the current image block based on the prediction correction amount includes: based on the prediction correction The predicted value of the lower right pixel of the current image block is modified by a quantity; and the predicted image of the current image block is obtained based on the corrected value of the predicted value of the lower right pixel of the current image block.
结合第一方面的第七种实施方式,在第一方面的第八种实施方式中,在基于所述当前图像块的右下像素的预测值的修正值获得所述当前图像块的预测图像前,所述方法还包括:将所述当前图像块的右下像素的预测值的修正值限制在预设的取值范围内,所述预设的取值范围为[0,pow(2,N)–1],其中pow(2,N)表示2的N次幂,N表示比特位宽。With reference to the seventh implementation manner of the first aspect, in an eighth implementation manner of the first aspect, before obtaining a prediction image of the current image block based on a correction value of a prediction value of a lower right pixel of the current image block The method further includes: limiting the correction value of the predicted value of the lower right pixel of the current image block to a preset value range, the preset value range is [0, pow (2, N ) –1], where pow (2, N) represents the Nth power of 2, and N represents the bit width.
例如,如果当前图像块的右下像素的预测值的修正值小于0,则将当前图像块的右下像素的预测值修正为0,即当前图像块的右下像素的预测值的修正值为0;如果当前图像块的右下像素的预测值的修正值大于,则将当前图像块的右下像素的预测值修正为pow(2,N)–1,即当前图像块的右下像素的预测值的修正值为pow(2,N)–1;如果当前图像块的右下像素的预测值的修正值大于或等于0,且小于或等于pow(2,N)–1,则不需要对当前图像块的右下像素的预测值进行修正,即所述当前图像块的右下像素的预测值的修正值为所述当前图像块的右下像素的预测值。For example, if the correction value of the prediction value of the lower right pixel of the current image block is less than 0, the prediction value of the lower right pixel of the current image block is corrected to 0, that is, the correction value of the prediction value of the lower right pixel of the current image block is 0; if the correction value of the prediction value of the bottom right pixel of the current image block is greater than, the prediction value of the bottom right pixel of the current image block is modified to pow (2, N) -1, that is, the The correction value of the predicted value is pow (2, N) –1; if the correction value of the predicted value of the lower right pixel of the current image block is greater than or equal to 0 and less than or equal to pow (2, N) –1, then it is not required Correct the predicted value of the lower right pixel of the current image block, that is, the predicted value of the lower right pixel of the current image block is the predicted value of the lower right pixel of the current image block.
第二方面,提供了一种图像块解码装置,包括:熵解码器,用于解析码流以获取待解码当前图像块的预测残差,预测模式以及预测参考信息;其中,在所述预测模式为平面预测模式时,所述预测参考信息包括预测修正量序号;帧内预测器,用于在所述当前图像块的预测模式为平面预测模式时,基于所述预测修正量序号确定预测修正量;基于所述预测修正量获得所述当前图像块的预测图像;重建单元,用于基于所述当前图像块的预测图像和所述当前图像块的预测残差,获得所述当前图像块的重建图像。According to a second aspect, an image block decoding apparatus is provided, including: an entropy decoder for parsing a bitstream to obtain a prediction residual, a prediction mode, and prediction reference information of a current image block to be decoded; wherein, in the prediction mode, When the prediction mode is a planar prediction mode, the prediction reference information includes a prediction correction quantity number; an intra predictor is used to determine a prediction correction quantity based on the prediction correction quantity number when the prediction mode of the current image block is a planar prediction mode; Obtaining a predicted image of the current image block based on the prediction correction amount; a reconstruction unit for obtaining a reconstruction of the current image block based on the predicted image of the current image block and the prediction residual of the current image block image.
结合第二方面,在第一种实施方式中,所述帧内预测器具体用于:若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;或若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量。With reference to the second aspect, in a first implementation manner, the intra predictor is specifically configured to: if the prediction correction amount is a first preset number, determine the prediction correction amount as a first preset correction Or if the serial number of the predicted correction amount is a second preset serial number, determining that the predicted correction amount is a second preset correction amount.
其中,所述第一预设修正量与所述第二预设修正量互为相反数。The first preset correction amount and the second preset correction amount are opposite numbers to each other.
其中,第一预设序号可以为1,第二预设序号可以为2。The first preset serial number may be 1 and the second preset serial number may be 2.
其中,若所述预测修正量序号为0,则确定所述预测修正量为0。Wherein, if the prediction correction amount number is 0, it is determined that the prediction correction amount is 0.
在一种实施方式中,所述第一预设修正量为预设的正整数,例如可以为8、16、32、64等正整数。进一步地,对于不同的比特位宽,所述第一预设修正量的预设值可能也不一 样,例如在8比特位宽时,所述第一预设修正量可以为10、16或20;在10比特位宽时,所述第一预设修正量可以为A1=40、64或80。In an implementation manner, the first preset correction amount is a preset positive integer, and may be, for example, a positive integer such as 8, 16, 32, or 64. Further, the preset value of the first preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the first preset correction amount may be 10, 16, or 20 ; When the width is 10 bits, the first preset correction amount may be A1 = 40, 64, or 80.
在另一种实施方式中,所述第一预设修正量也可以为与所述当前图像块的宽和高相关的变量;例如,所述第一预设修正量可以基于如下计算式计算确定:In another implementation manner, the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
A1=Clip3(B1,B2,(W+H)/2*pow(2,BD–8));A1 = Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
其中,A1表示所述第一预设修正量;B1和B2为预设正整数且B1<B2,例如B1=8、B2=16,或者B1=12、B2=20;pow(2,BD–8)表示2的BD–8次幂,BD表示比特位宽,例如BD=8或10或12;H表示所述当前图像块的高,W表示所述当前图像块的宽;Clip3(B1,B2,(W+H)/2*pow(2,BD–8))表示将(W+H)/2*pow(2,BD–8)的值限制在B1和B2之间,即若((W+H)/2*pow(2,BD–8))<B1,则(W+H)/2*pow(2,BD–8)=B1,若((W+H)/2*pow(2,BD–8))>B2,则(W+H)/2*pow(2,BD–8)=B2,若B1≤((W+H)/2*pow(2,BD–8))≤B2,则(W+H)/2*pow(2,BD–8)=(W+H)/2*pow(2,BD–8)。Among them, A1 represents the first preset correction amount; B1 and B2 are preset positive integers and B1 <B2, for example, B1 = 8, B2 = 16, or B1 = 12, B2 = 20; pow (2, BD– 8) represents the BD-8 power of 2, BD represents the bit width, such as BD = 8 or 10 or 12; H represents the height of the current image block, W represents the width of the current image block; Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)) means to limit the value of (W + H) / 2 * pow (2, BD–8) to between B1 and B2, that is, if ( (W + H) / 2 * pow (2, BD–8)) <B1, then (W + H) / 2 * pow (2, BD–8) = B1, if ((W + H) / 2 * pow (2, BD–8))> B2, then (W + H) / 2 * pow (2, BD–8) = B2, if B1≤ ((W + H) / 2 * pow (2, BD– 8)) ≤ B2, then (W + H) / 2 * pow (2, BD–8) = (W + H) / 2 * pow (2, BD–8).
结合第二方面,在第二种实施方式中,所述帧内预测器具体用于:若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第三预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第四预设修正量;若所述预测修正量序号为第三预设序号,则确定所述预测修正量为第五预设修正量;或者若所述预测修正量序号为第四预设序号,则确定所述预测修正量为第六预设修正量。With reference to the second aspect, in a second implementation manner, the intra predictor is specifically configured to: if the prediction correction amount is a first preset number, determine that the prediction correction amount is a third preset correction If the predicted correction amount number is a second preset number, determine the predicted correction amount as a fourth preset number; if the predicted correction amount serial number is a third preset number, determine the prediction The correction amount is a fifth preset correction amount; or if the predicted correction amount number is a fourth preset number, determining that the predicted correction amount is a sixth preset correction amount.
其中,所述第三预设修正量与所述第四预设修正量互为相反数;且所述第五预设修正量与所述第六预设修正量互为相反数。The third preset correction amount and the fourth preset correction amount are opposite numbers to each other; and the fifth preset correction amount and the sixth preset correction amount are opposite numbers to each other.
其中,若所述预测修正量序号为0,则确定所述预测修正量为0。Wherein, if the prediction correction amount number is 0, it is determined that the prediction correction amount is 0.
其中,第一预设序号可以为1,第二预设序号可以为2,第三预设序号可以为3,第四预设序号可以为4。The first preset serial number can be 1, the second preset serial number can be 2, the third preset serial number can be 3, and the fourth preset serial number can be 4.
其中,第三预设修正量和第五预设修正量为预设正整数,且第五预设修正量大于第三预设修正量,例如第五预设修正量可以为第三预设修正量的1.75倍,或2倍,或2.25倍。The third preset correction amount and the fifth preset correction amount are preset positive integers, and the fifth preset correction amount is greater than the third preset correction amount. For example, the fifth preset correction amount may be the third preset correction amount. The amount is 1.75 times, or 2 times, or 2.25 times.
其中,所述第三预设修正量可以为8、16、32、或64等正整数。进一步地,对于不同的比特位宽,所述第三预设修正量的预设值可能也不一样,例如在8比特位宽时,所述第三预设修正量可以为10、16或20等等;在10比特位宽时,所述第三预设修正量可以为A1=40、64或80等等。The third preset correction amount may be a positive integer such as 8, 16, 32, or 64. Further, the preset value of the third preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the third preset correction amount may be 10, 16, or 20 And so on; when the width is 10 bits, the third preset correction amount may be A1 = 40, 64, 80, and so on.
结合第二方面,在第三种实施方式中,所述帧内预测器具体用于:With reference to the second aspect, in a third implementation manner, the intra predictor is specifically configured to:
将所述当前图像块的左下参考像素的值与所述当前图像块的右上参考像素的值进行加权平均,获得加权平均值;Performing a weighted average of the value of the lower left reference pixel of the current image block and the value of the upper right reference pixel of the current image block to obtain a weighted average;
在所述加权平均值小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量;或者When the weighted average value is less than the value of the upper left reference pixel of the current image block, if the predicted correction amount number is a first preset number, determining the predicted correction amount as a first preset correction amount; if If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a second preset correction amount; or
在所述加权平均值不小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第二预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第一预设修正量。When the weighted average value is not less than the value of the upper left reference pixel of the current image block, if the prediction correction amount is a first preset number, determining that the prediction correction amount is a second preset correction amount; If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a first preset correction amount.
其中,所述第一预设修正量与所述第二预设修正量互为相反数。The first preset correction amount and the second preset correction amount are opposite numbers to each other.
其中,所述加权平均值具体可以为所述当前图像块的右下像素的预测值,例如可以通过如下计算式获得:The weighted average value may specifically be a predicted value of a lower right pixel of the current image block, and may be obtained by, for example, the following calculation formula:
P1(W,H)=P(W,–1)*a+P(–1,H)*(1–a);P1 (W, H) = P (W, –1) * a + P (–1, H) * (1–a);
其中,P1(W,H)表示所述右下像素的预测值,P(W,–1)表示所述右上参考像素的值,P(–1,H)表示所述左下参考像素的值;0<a<1,a可以为预设值,例如为0.4,0.5,或0.6等等;a也可以为与所述当前图像块的宽和高相关的变量,例如a=H/(W+H),其中H表示所述当前图像块的高,W表示所述当前图像块的宽。Wherein, P1 (W, H) represents the predicted value of the lower right pixel, P (W, –1) represents the value of the upper right reference pixel, and P (–1, H) represents the value of the lower left reference pixel; 0 <a <1, a can be a preset value, such as 0.4, 0.5, or 0.6, etc .; a can also be a variable related to the width and height of the current image block, such as a = H / (W + H), where H represents the height of the current image block, and W represents the width of the current image block.
其中,所述左上参考像素,左下参考像素,所述右上参考像素和所述右下像素均不属于所述当前图像块。例如,在当前图像块为W*H的图像块时,当前图像块中像素的横坐标的取值范围为[0,W-1],当前图像块中像素的纵坐标的取值范围为[0,H-1];相应的,所述左上参考像素的坐标为(-1,-1),所述左下参考像素的坐标为(-1,H),所述右下像素的坐标为(W,H),所述右上参考像素的坐标为(W,-1)。The upper left reference pixel, the lower left reference pixel, the upper right reference pixel, and the lower right pixel do not belong to the current image block. For example, when the current image block is an image block of W * H, the range of the abscissa of the pixel in the current image block is [0, W-1], and the range of the ordinate of the pixel in the current image block is [ 0, H-1]; correspondingly, the coordinates of the upper left reference pixel are (-1, -1), the coordinates of the lower left reference pixel are (-1, H), and the coordinates of the lower right pixel are ( W, H), and the coordinates of the upper right reference pixel are (W, -1).
其中,第一预设序号可以为1,第二预设序号可以为2。The first preset serial number may be 1 and the second preset serial number may be 2.
其中,若所述预测修正量序号为0,则确定所述预测修正量为0。Wherein, if the prediction correction amount number is 0, it is determined that the prediction correction amount is 0.
在一种实施方式中,所述第一预设修正量为预设的正整数,例如可以为8、16、32、64等正整数。进一步地,对于不同的比特位宽,所述第一预设修正量的预设值可能也不一样,例如在8比特位宽时,所述第一预设修正量可以为10、16或20;在10比特位宽时,所述第一预设修正量可以为A1=40、64或80。In an implementation manner, the first preset correction amount is a preset positive integer, and may be, for example, a positive integer such as 8, 16, 32, or 64. Further, the preset value of the first preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the first preset correction amount may be 10, 16, or 20 ; When the width is 10 bits, the first preset correction amount may be A1 = 40, 64, or 80.
在另一种实施方式中,所述第一预设修正量也可以为与所述当前图像块的宽和高相关的变量;例如,所述第一预设修正量可以基于如下计算式计算确定:In another implementation manner, the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
A1=Clip3(B1,B2,(W+H)/2*pow(2,BD–8));A1 = Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
其中,A1表示所述第一预设修正量;B1和B2为预设正整数且B1<B2,例如B1=8、B2=16,或者B1=12、B2=20;pow(2,BD–8)表示2的BD–8次幂,BD表示比特位宽,例如BD=8或10或12;H表示所述当前图像块的高,W表示所述当前图像块的宽;Clip3(B1,B2,(W+H)/2*pow(2,BD–8))表示将(W+H)/2*pow(2,BD–8)的值限制在B1和B2之间,即若((W+H)/2*pow(2,BD–8))<B1,则(W+H)/2*pow(2,BD–8)=B1,若((W+H)/2*pow(2,BD–8))>B2,则(W+H)/2*pow(2,BD–8)=B2,若B1≤((W+H)/2*pow(2,BD–8))≤B2,则(W+H)/2*pow(2,BD–8)=(W+H)/2*pow(2,BD–8)。Among them, A1 represents the first preset correction amount; B1 and B2 are preset positive integers and B1 <B2, for example, B1 = 8, B2 = 16, or B1 = 12, B2 = 20; pow (2, BD– 8) represents the BD-8 power of 2, BD represents the bit width, such as BD = 8 or 10 or 12; H represents the height of the current image block, W represents the width of the current image block; Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)) means to limit the value of (W + H) / 2 * pow (2, BD–8) to between B1 and B2, that is, if ( (W + H) / 2 * pow (2, BD–8)) <B1, then (W + H) / 2 * pow (2, BD–8) = B1, if ((W + H) / 2 * pow (2, BD–8))> B2, then (W + H) / 2 * pow (2, BD–8) = B2, if B1≤ ((W + H) / 2 * pow (2, BD– 8)) ≤ B2, then (W + H) / 2 * pow (2, BD–8) = (W + H) / 2 * pow (2, BD–8).
结合第二方面,在第四种实施方式中,所述帧内预测器具体用于:若所述预测修正量序号为第一预设序号,基于所述当前图像块的左下参考像素的值,所述当前图像块的右上参考像素的值以及所述当前图像块的左上参考像素的值获得差分值;基于所述差分值确定所述预测修正量。With reference to the second aspect, in a fourth implementation manner, the intra predictor is specifically configured to: if the prediction correction amount sequence number is a first preset sequence number, based on a value of a lower left reference pixel of the current image block, A difference value is obtained from the value of the upper right reference pixel of the current image block and the value of the upper left reference pixel of the current image block; and the prediction correction amount is determined based on the difference value.
结合第二方面的第四种实施方式,在第五种实施方式中,,所述帧内预测器具体用于通过如下计算式计算获得所述差分值:With reference to the fourth implementation manner of the second aspect, in a fifth implementation manner, the intra predictor is specifically configured to obtain the difference value through calculation using the following calculation formula:
D=P(W,–1)*a+P(–1,H)*(1–a)–P(–1,–1);D = P (W, –1) * a + P (–1, H) * (1–a) –P (–1, –1);
其中,D表示所述差分值,P(W,–1)表示所述当前图像块的左下参考像素的值,P(–1,H) 表示所述当前图像块的右上参考像素的值,P(–1,–1)表示所述当前图像块的左上参考像素的值;0<a<1,a可以为预设值,例如为0.4,0.5,或0.6等等;a也可以为与所述当前图像块的宽和高相关的变量,例如a=H/(W+H),其中H表示所述当前图像块的高,W表示所述当前图像块的宽。Among them, D represents the difference value, P (W, –1) represents the value of the lower left reference pixel of the current image block, P (–1, H) represents the value of the upper right reference pixel of the current image block, P (–1, –1) represents the value of the upper left reference pixel of the current image block; 0 <a <1, a can be a preset value, such as 0.4, 0.5, or 0.6, etc .; a can also be the same as all The width and height related variables of the current image block are described, for example, a = H / (W + H), where H represents the height of the current image block and W represents the width of the current image block.
结合第二方面的第四种实施方式或第五种实施方式,在第六种实施方式中,所述帧内预测器具体用于:With reference to the fourth implementation manner or the fifth implementation manner of the second aspect, in a sixth implementation manner, the intra predictor is specifically configured to:
基于如下计算式计算确定所述预测修正量:The prediction correction amount is determined based on the following calculation formula:
M=Clip3(sign(D)*B3,sign(D)*B4,D);M = Clip3 (sign (D) * B3, sign (D) * B4, D);
其中,M表示所述预测修正量,D表示所述差分值,sign(D)表示取所述差分值的符号,其中,如果D≥0,sign(D)=1;如果D<0,sign(D)=–1。B3为预设正整数,B4为预设正整数,B3<B4,Clip3(sign(D)*B3,sign(D)*B4,D)表示将D的值限制在sign(D)*B3与sign(D)*B4之间;例如,在sign(D)=1时,如果D<sign(D)*B3,则D=sign(D)*B3,如果D>sign(D)*B4,则D=sign(D)*B4,如果sign(D)*B3≤D≤sign(D)*B4,则D=D;例如,在sign(D)=-1时,如果D<sign(D)*B4,则D=sign(D)*B4,如果D>sign(D)*B3,则D=sign(D)*B3,如果sign(D)*B4≤D≤sign(D)*B3,则D=D。Among them, M represents the predicted correction amount, D represents the difference value, and sign (D) represents the sign of taking the difference value, where if D≥0, sign (D) = 1; if D <0, sign (D) = -1. B3 is a preset positive integer, B4 is a preset positive integer, B3 <B4, Clip3 (sign (D) * B3, sign (D) * B4, D) means to limit the value of D to sign (D) * B3 and sign (D) * B4; for example, when sign (D) = 1, if D <sign (D) * B3, then D = sign (D) * B3, if D> sign (D) * B4, Then D = sign (D) * B4, if sign (D) * B3≤D≤sign (D) * B4, then D = D; for example, when sign (D) =-1, if D <sign (D ) * B4, then D = sign (D) * B4, if D> sign (D) * B3, then D = sign (D) * B3, if sign (D) * B4≤D≤sign (D) * B3 , Then D = D.
结合第二方面或第二方面的上述实施方式中的任意一种,在第七种实施方式中,,所述帧内预测器具体用于:基于所述预测修正量对所述当前图像块的右下像素的预测值进行修正;基于所述当前图像块的右下像素的预测值的修正值获得所述当前图像块的预测图像。With reference to the second aspect or any one of the foregoing implementation manners of the second aspect, in a seventh implementation manner, the intra predictor is specifically configured to: The prediction value of the lower right pixel is modified; based on the correction value of the prediction value of the lower right pixel of the current image block, a predicted image of the current image block is obtained.
结合第二方面的第七种实施方式,在第二方面的第八种实施方式中,所述帧内预测器具体还用于:将所述当前图像块的右下像素的预测值的修正值限制在预设的取值范围内,所述预设的取值范围为[0,pow(2,N)–1],其中pow(2,N)表示2的N次幂,N表示比特位宽;基于限制在所述预设的取值范围内的所述当前图像块的右下像素的预测值的修正值获得所述当前图像块的预测图像。With reference to the seventh implementation manner of the second aspect, in an eighth implementation manner of the second aspect, the intra predictor is further specifically configured to: modify a prediction value of a lower right pixel of the current image block by a correction value Limited to a preset value range, the preset value range is [0, pow (2, N) –1], where pow (2, N) represents the Nth power of 2, and N represents the bit Wide; obtaining a predicted image of the current image block based on a correction value of a predicted value of a lower-right pixel of the current image block that is restricted within the preset value range.
例如,如果当前图像块的右下像素的预测值的修正值小于0,则将当前图像块的右下像素的预测值修正为0,即当前图像块的右下像素的预测值的修正值为0;如果当前图像块的右下像素的预测值的修正值大于,则将当前图像块的右下像素的预测值修正为pow(2,N)–1,即当前图像块的右下像素的预测值的修正值为pow(2,N)–1;如果当前图像块的右下像素的预测值的修正值大于或等于0,且小于或等于pow(2,N)–1,则不需要对当前图像块的右下像素的预测值进行修正,即所述当前图像块的右下像素的预测值的修正值为所述当前图像块的右下像素的预测值。For example, if the correction value of the prediction value of the lower right pixel of the current image block is less than 0, the prediction value of the lower right pixel of the current image block is corrected to 0, that is, the correction value of the prediction value of the lower right pixel of the current image block is 0; if the correction value of the prediction value of the bottom right pixel of the current image block is greater than, the prediction value of the bottom right pixel of the current image block is modified to pow (2, N) -1, that is, the The correction value of the predicted value is pow (2, N) –1; if the correction value of the predicted value of the lower right pixel of the current image block is greater than or equal to 0 and less than or equal to pow (2, N) –1, then it is not required Correct the predicted value of the lower right pixel of the current image block, that is, the predicted value of the lower right pixel of the current image block is the predicted value of the lower right pixel of the current image block.
第三方面,提供一种解码器,包括:相互耦合的非易失性存储器和处理器,所述处理器调用存储在所述存储器中的程序代码以执行第一方面或者第一方面中的任意一种实现方式中的方法的部分或全部步骤。According to a third aspect, a decoder is provided, including: a non-volatile memory and a processor coupled to each other, the processor calling program code stored in the memory to execute the first aspect or any of the first aspect Some or all steps of a method in one implementation.
第四方面,提供一种计算机可读存储介质,所述计算机可读存储介质存储了程序代码,其中,所述程序代码包括用于执行第一方面或第一方面中的任意一种实现方式中的方法的部分或全部步骤的指令。According to a fourth aspect, a computer-readable storage medium is provided, where the computer-readable storage medium stores program code, where the program code includes a method for executing the first aspect or any implementation manner of the first aspect. Instructions for some or all steps of the method.
第五方面,提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使 得所述计算机执行第一方面或第一方面中的任意一种实现方式中的方法的部分或全部步骤的指令。According to a fifth aspect, a computer program product is provided, and when the computer program product is run on a computer, the computer is caused to perform part or all of the steps of the method in the first aspect or any one of the implementation manners of the first aspect. Instructions.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例或背景技术中的技术方案,下面将对本申请实施例或背景技术中所需要使用的附图进行说明。In order to more clearly explain the technical solutions in the embodiments of the present application or the background art, the drawings that are needed in the embodiments of the present application or the background art will be described below.
图1为本申请实施例中一种视频编码及解码系统的示意性框图;FIG. 1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of the present application;
图2A为本申请实施例中一种视频编码器的示意性框图;2A is a schematic block diagram of a video encoder according to an embodiment of the present application;
图2B为本申请实施例中一种视频解码器的示意性框图;2B is a schematic block diagram of a video decoder according to an embodiment of the present application;
图3为本申请实施例中一种视频编码方法的流程图;3 is a flowchart of a video encoding method according to an embodiment of the present application;
图4为本申请实施例中一种视频解码方法的流程图;4 is a flowchart of a video decoding method according to an embodiment of the present application;
图5为本申请实施例中一种视频解码装置的结构示意图;5 is a schematic structural diagram of a video decoding device according to an embodiment of the present application;
图6为本申请实施例中一种编码设备或解码设备的示意性框图;6 is a schematic block diagram of an encoding device or a decoding device according to an embodiment of the present application;
图7A为现有技术中当前像素的水平预测值的获取示意图;7A is a schematic diagram of acquiring a horizontal prediction value of a current pixel in the prior art;
图7B为现有技术中当前像素的竖直预测值的获取示意图。FIG. 7B is a schematic diagram of acquiring a vertical prediction value of a current pixel in the prior art.
具体实施方式detailed description
下面结合本申请实施例中的附图对本申请实施例进行描述。The following describes the embodiments of the present application with reference to the drawings in the embodiments of the present application.
编码视频流,或者其一部分,诸如视频帧或者图像块可以使用视频流中的时间和空间相似性以改善编码性能。例如,视频流的当前图像块可以通过基于视频流中的先前已编码块预测用于当前图像块的运动信息,并识别预测块和当前图像块(即原始块)之间的差值(亦称为残差),从而基于先前已编码块对当前图像块进行编码。以这种方法,仅仅将用于产生当前图像块的残差和一些参数包括于数字视频输出位流中,而不是将当前图像块的整体包括于数字视频输出位流。这种技术可以称为帧间预测。Encoding a video stream, or a portion thereof, such as a video frame or an image block, can use temporal and spatial similarities in the video stream to improve encoding performance. For example, the current image block of a video stream can predict motion information for the current image block based on previously encoded blocks in the video stream, and identify the difference between the predicted block and the current image block (that is, the original block) (also known as the original block) Is the residual), thereby encoding the current image block based on the previously encoded block. In this way, only the residuals and some parameters used to generate the current image block are included in the digital video output bitstream, rather than the entirety of the current image block is included in the digital video output bitstream. This technique can be called inter prediction.
运动矢量是帧间预测过程中的一个重要参数,其表示先前已编码块相对于该当前编码块的空间位移。可以使用运动估算的方法,诸如运动搜索来获取运动矢量。初期的帧间预测技术,将表示运动矢量的位包括在编码的位流中,以允许解码器再现预测块,进而得到重建块。为了进一步的改善编码效率,后来又提出使用参考运动矢量差分地编码运动矢量,即取代编码运动矢量整体,而仅仅编码运动矢量和参考运动矢量之间的差值。在有些情况下,参考运动矢量可以是从在视频流中先前使用的运动矢量中选择出来的,选择先前使用的运动矢量编码当前的运动矢量可以进一步减少包括在编码的视频位流中的位数。The motion vector is an important parameter in the inter prediction process, which represents the spatial displacement of a previously coded block relative to the current coded block. Motion vectors can be obtained using motion estimation methods, such as motion search. In the early inter-prediction technology, the bits representing the motion vector were included in the encoded bit stream to allow the decoder to reproduce the predicted block and then obtain the reconstructed block. In order to further improve the coding efficiency, it was later proposed to use the reference motion vector to differentially encode the motion vector, that is, instead of encoding the entire motion vector, only the difference between the motion vector and the reference motion vector was encoded. In some cases, the reference motion vector may be selected from previously used motion vectors in the video stream. Selecting a previously used motion vector to encode the current motion vector can further reduce the number of bits included in the encoded video bitstream .
图1为本申请实施例中所描述的一种实例的视频译码系统1的框图。如本文所使用,术语“视频译码器”一般是指视频编码器和视频解码器两者。在本申请中,术语“视频译码”或“译码”可一般地指代视频编码或视频解码。视频译码系统1的视频编码器100和视频解码器200用于根据本申请提出的多种新的帧间预测模式中的任一种所描述的各种方法实例来预测当前经译码图像块或其子块的运动信息,例如运动矢量,使得预测出的运动矢量最大程度上接近使用运动估算方法得到的运动矢量,从而编码时无需传送运动矢量差值,从而进一步的改善编解码性能。FIG. 1 is a block diagram of a video decoding system 1 according to an example described in the embodiment of the present application. As used herein, the term "video coder" generally refers to both video encoders and video decoders. In this application, the terms "video coding" or "coding" may generally refer to video encoding or video decoding. The video encoder 100 and the video decoder 200 of the video coding system 1 are configured to predict a current coded image block according to various method examples described in any of a variety of new inter prediction modes proposed in the present application. The motion information of the sub-block or its sub-blocks, such as the motion vector, makes the predicted motion vector close to the motion vector obtained by using the motion estimation method to the greatest extent, so that the motion vector difference value is not transmitted during encoding, thereby further improving the encoding and decoding performance.
如图1中所示,视频译码系统1包含源装置10和目的地装置20。源装置10产生经编码视频数据。因此,源装置10可被称为视频编码装置。目的地装置20可对由源装置10所产生的经编码的视频数据进行解码。因此,目的地装置20可被称为视频解码装置。源装置10、目的地装置20或两个的各种实施方案可包含一或多个处理器以及耦合到所述一或多个处理器的存储器。所述存储器可包含但不限于RAM、ROM、EEPROM、快闪存储器或可用于以可由计算机存取的指令或数据结构的形式存储所要的程序代码的任何其它媒体,如本文所描述。As shown in FIG. 1, the video decoding system 1 includes a source device 10 and a destination device 20. The source device 10 generates encoded video data. Therefore, the source device 10 may be referred to as a video encoding device. The destination device 20 may decode the encoded video data generated by the source device 10. Therefore, the destination device 20 may be referred to as a video decoding device. Various implementations of the source device 10, the destination device 20, or both may include one or more processors and a memory coupled to the one or more processors. The memory may include, but is not limited to, RAM, ROM, EEPROM, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures accessible by a computer, as described herein.
源装置10和目的地装置20可以包括各种装置,包含桌上型计算机、移动计算装置、笔记型(例如,膝上型)计算机、平板计算机、机顶盒、例如所谓的“智能”电话等电话手持机、电视机、相机、显示装置、数字媒体播放器、视频游戏控制台、车载计算机或其类似者。The source device 10 and the destination device 20 may include various devices including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets, such as so-called "smart" phones, etc. Cameras, televisions, cameras, display devices, digital media players, video game consoles, on-board computers, or the like.
目的地装置20可经由链路30从源装置10接收经编码视频数据。链路30可包括能够将经编码视频数据从源装置10移动到目的地装置20的一或多个媒体或装置。在一个实例中,链路30可包括使得源装置10能够实时将经编码视频数据直接发射到目的地装置20的一或多个通信媒体。在此实例中,源装置10可根据通信标准(例如无线通信协议)来调制经编码视频数据,且可将经调制的视频数据发射到目的地装置20。所述一或多个通信媒体可包含无线和/或有线通信媒体,例如射频(RF)频谱或一或多个物理传输线。所述一或多个通信媒体可形成基于分组的网络的一部分,基于分组的网络例如为局域网、广域网或全球网络(例如,因特网)。所述一或多个通信媒体可包含路由器、交换器、基站或促进从源装置10到目的地装置20的通信的其它设备。The destination device 20 may receive the encoded video data from the source device 10 via the link 30. The link 30 may include one or more media or devices capable of moving the encoded video data from the source device 10 to the destination device 20. In one example, the link 30 may include one or more communication media enabling the source device 10 to directly transmit the encoded video data to the destination device 20 in real time. In this example, the source device 10 may modulate the encoded video data according to a communication standard, such as a wireless communication protocol, and may transmit the modulated video data to the destination device 20. The one or more communication media may include wireless and / or wired communication media, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (eg, the Internet). The one or more communication media may include a router, a switch, a base station, or other devices that facilitate communication from the source device 10 to the destination device 20.
在另一实例中,可将经编码数据从输出接口140输出到存储装置40。类似地,可通过输入接口240从存储装置40存取经编码数据。存储装置40可包含多种分布式或本地存取的数据存储媒体中的任一者,例如硬盘驱动器、蓝光光盘、DVD、CD-ROM、快闪存储器、易失性或非易失性存储器,或用于存储经编码视频数据的任何其它合适的数字存储媒体。In another example, the encoded data may be output from the output interface 140 to the storage device 40. Similarly, the encoded data can be accessed from the storage device 40 through the input interface 240. The storage device 40 may include any of a variety of distributed or locally accessed data storage media, such as a hard drive, Blu-ray disc, DVD, CD-ROM, flash memory, volatile or non-volatile memory, Or any other suitable digital storage medium for storing encoded video data.
在另一实例中,存储装置40可对应于文件服务器或可保持由源装置10产生的经编码视频的另一中间存储装置。目的地装置20可经由流式传输或下载从存储装置40存取所存储的视频数据。文件服务器可为任何类型的能够存储经编码的视频数据并且将经编码的视频数据发射到目的地装置20的服务器。实例文件服务器包含网络服务器(例如,用于网站)、FTP服务器、网络附接式存储(NAS)装置或本地磁盘驱动器。目的地装置20可通过任何标准数据连接(包含因特网连接)来存取经编码视频数据。这可包含无线信道(例如,Wi-Fi连接)、有线连接(例如,DSL、电缆调制解调器等),或适合于存取存储在文件服务器上的经编码视频数据的两者的组合。经编码视频数据从存储装置40的传输可为流式传输、下载传输或两者的组合。In another example, the storage device 40 may correspond to a file server or another intermediate storage device that may hold the encoded video produced by the source device 10. The destination device 20 may access the stored video data from the storage device 40 via streaming or download. The file server may be any type of server capable of storing encoded video data and transmitting the encoded video data to the destination device 20. Example file servers include a web server (eg, for a website), an FTP server, a network attached storage (NAS) device, or a local disk drive. The destination device 20 can access the encoded video data through any standard data connection, including an Internet connection. This may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., DSL, cable modem, etc.), or a combination of both suitable for accessing encoded video data stored on a file server. The transmission of the encoded video data from the storage device 40 may be a streaming transmission, a download transmission, or a combination of the two.
本申请的运动矢量预测技术可应用于视频编解码以支持多种多媒体应用,例如空中电视广播、有线电视发射、卫星电视发射、串流视频发射(例如,经由因特网)、用于存储于数据存储媒体上的视频数据的编码、存储在数据存储媒体上的视频数据的解码,或其它应用。在一些实例中,视频译码系统1可用于支持单向或双向视频传输以支持例如视频流式传输、视频回放、视频广播和/或视频电话等应用。The motion vector prediction technology of the present application can be applied to video codecs to support a variety of multimedia applications, such as air television broadcasting, cable television transmission, satellite television transmission, streaming video transmission (e.g., via the Internet), for storage in data storage Encoding of video data on media, decoding of video data stored on data storage media, or other applications. In some examples, the video coding system 1 may be used to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting, and / or video telephony.
图1中所说明的视频译码系统1仅为实例,并且本申请的技术可适用于未必包含编码装置与解码装置之间的任何数据通信的视频译码设置(例如,视频编码或视频解码)。在其它实例中,数据从本地存储器检索、在网络上流式传输等等。视频编码装置可对数据进行编码并且将数据存储到存储器,和/或视频解码装置可从存储器检索数据并且对数据进行解码。在许多实例中,由并不彼此通信而是仅编码数据到存储器和/或从存储器检索数据且解码数据的装置执行编码和解码。The video decoding system 1 illustrated in FIG. 1 is only an example, and the techniques of the present application can be applied to a video decoding setting (for example, video encoding or video decoding) that does not necessarily include any data communication between the encoding device and the decoding device. . In other examples, data is retrieved from local storage, streamed over a network, and so on. The video encoding device may encode the data and store the data to a memory, and / or the video decoding device may retrieve the data from the memory and decode the data. In many examples, encoding and decoding are performed by devices that do not communicate with each other, but only encode data to and / or retrieve data from memory and decode data.
在图1的实例中,源装置10包含视频源120、视频编码器100和输出接口140。在一些实例中,输出接口140可包含调节器/解调器(调制解调器)和/或发射器。视频源120可包括视频捕获装置(例如,摄像机)、含有先前捕获的视频数据的视频存档、用以从视频内容提供者接收视频数据的视频馈入接口,和/或用于产生视频数据的计算机图形系统,或视频数据的此些来源的组合。In the example of FIG. 1, the source device 10 includes a video source 120, a video encoder 100, and an output interface 140. In some examples, the output interface 140 may include a regulator / demodulator (modem) and / or a transmitter. Video source 120 may include a video capture device (e.g., a video camera), a video archive containing previously captured video data, a video feed interface to receive video data from a video content provider, and / or a computer for generating video data Graphics systems, or a combination of these sources of video data.
视频编码器100可对来自视频源120的视频数据进行编码。在一些实例中,源装置10经由输出接口140将经编码视频数据直接发射到目的地装置20。在其它实例中,经编码视频数据还可存储到存储装置40上,供目的地装置20以后存取来用于解码和/或播放。The video encoder 100 may encode video data from the video source 120. In some examples, the source device 10 transmits the encoded video data directly to the destination device 20 via the output interface 140. In other examples, the encoded video data may also be stored on the storage device 40 for later access by the destination device 20 for decoding and / or playback.
在图1的实例中,目的地装置20包含输入接口240、视频解码器200和显示装置220。在一些实例中,输入接口240包含接收器和/或调制解调器。输入接口240可经由链路30和/或从存储装置40接收经编码视频数据。显示装置220可与目的地装置20集成或可在目的地装置20外部。一般来说,显示装置220显示经解码视频数据。显示装置220可包括多种显示装置,例如,液晶显示器(LCD)、等离子显示器、有机发光二极管(OLED)显示器或其它类型的显示装置。In the example of FIG. 1, the destination device 20 includes an input interface 240, a video decoder 200, and a display device 220. In some examples, the input interface 240 includes a receiver and / or a modem. The input interface 240 may receive encoded video data via the link 30 and / or from the storage device 40. The display device 220 may be integrated with the destination device 20 or may be external to the destination device 20. Generally, the display device 220 displays decoded video data. The display device 220 may include various display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
尽管图1中未图示,但在一些方面,视频编码器100和视频解码器200可各自与音频编码器和解码器集成,且可包含适当的多路复用器-多路分用器单元或其它硬件和软件,以处置共同数据流或单独数据流中的音频和视频两者的编码。在一些实例中,如果适用的话,那么MUX-DEMUX单元可符合ITU H.223多路复用器协议,或例如用户数据报协议(UDP)等其它协议。Although not illustrated in FIG. 1, in some aspects, video encoder 100 and video decoder 200 may each be integrated with an audio encoder and decoder, and may include a suitable multiplexer-demultiplexer unit Or other hardware and software to handle encoding of both audio and video in a common or separate data stream. In some examples, the MUX-DEMUX unit may conform to the ITU H.223 multiplexer protocol, or other protocols such as the User Datagram Protocol (UDP), if applicable.
视频编码器100和视频解码器200各自可实施为例如以下各项的多种电路中的任一者:一或多个微处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)、离散逻辑、硬件或其任何组合。如果部分地以软件来实施本申请,那么装置可将用于软件的指令存储在合适的非易失性计算机可读存储媒体中,且可使用一或多个处理器在硬件中执行所述指令从而实施本申请技术。前述内容(包含硬件、软件、硬件与软件的组合等)中的任一者可被视为一或多个处理器。视频编码器100和视频解码器200中的每一者可包含在一或多个编码器或解码器中,所述编码器或解码器中的任一者可集成为相应装置中的组合编码器/解码器(编码解码器)的一部分。 Video encoder 100 and video decoder 200 may each be implemented as any of a variety of circuits, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), Field Programmable Gate Array (FPGA), discrete logic, hardware, or any combination thereof. If the present application is implemented partially in software, the device may store instructions for the software in a suitable non-volatile computer-readable storage medium and may use one or more processors to execute the instructions in hardware Thus, the technology of the present application is implemented. Any of the foregoing (including hardware, software, a combination of hardware and software, etc.) may be considered as one or more processors. Each of video encoder 100 and video decoder 200 may be included in one or more encoders or decoders, any of which may be integrated as a combined encoder in a corresponding device / Decoder (codec).
本申请可大体上将视频编码器100称为将某些信息“发信号通知”或“发射”到例如视频解码器200的另一装置。术语“发信号通知”或“发射”可大体上指代用以对经压缩视频数据进行解码的语法元素和/或其它数据的传送。此传送可实时或几乎实时地发生。替代地,此通信可经过一段时间后发生,例如可在编码时在经编码位流中将语法元素存储到计算机可 读存储媒体时发生,解码装置接着可在所述语法元素存储到此媒体之后的任何时间检索所述语法元素。This application may generally refer to video encoder 100 as "signaling" or "transmitting" certain information to another device, such as video decoder 200. The terms "signaling" or "transmitting" may generally refer to the transmission of syntax elements and / or other data used to decode compressed video data. This transfer can occur in real time or almost real time. Alternatively, this communication may occur over a period of time, such as when a syntax element is stored in a coded bitstream to a computer-readable storage medium at the time of encoding, and the decoding device may then after the syntax element is stored in this medium. Retrieve the syntax element at any time.
视频编码器100和视频解码器200可根据例如高效视频编码(HEVC)等视频压缩标准或其扩展来操作,并且可符合HEVC测试模型(HM)。或者,视频编码器100和视频解码器200也可根据其它业界标准来操作,所述标准例如是ITU-T H.264、H.265标准,或此类标准的扩展。然而,本申请的技术不限于任何特定编解码标准。The video encoder 100 and the video decoder 200 may operate according to a video compression standard such as High Efficiency Video Coding (HEVC) or an extension thereof, and may conform to the HEVC test model (HM). Alternatively, the video encoder 100 and video decoder 200 may also operate according to other industry standards, such as the ITU-T H.264, H.265 standards, or extensions of such standards. However, the techniques of this application are not limited to any particular codec standard.
在一个实例中,视频编码器100用于:将与当前待编码的图像块相关的语法元素编码入数字视频输出位流(简称为位流或码流),这里将用于当前图像块帧间预测的语法元素简称为帧间预测数据,其中帧间预测数据可以包括用于指示是否对当前图像块采用上述候选帧间预测模式集合进行帧间预测的第一标识(换言之,即用于指示是否对当前图像块采用本申请提出的新的帧间预测模式进行帧间预测的第一标识);或者,帧间预测数据可以包括:用于指示是否对当前待编码图像块采用候选帧间预测模式集合进行帧间预测的第一标识和用于指示当前待图像块的帧间预测模式的第二标识;为了确定用于对当前图像块进行编码的帧间预测模式,视频编码器100还用于确定或选择上述候选帧间预测模式集合中用于对当前图像块进行帧间预测的帧间预测模式(例如选择多种新的帧间预测模式中编码当前图像块的码率失真代价折中或最小的帧间预测模式);以及基于确定的帧间预测模式,编码所述当前图像块,这里的编码过程可以包括基于确定的帧间预测模式,预测所述当前图像块中一个或多个子块的运动信息(具体可以是每个子块或者所有子块的运动信息),并利用所述当前图像块中一个或多个子块的运动信息对所述当前图像块执行帧间预测;In one example, the video encoder 100 is configured to encode syntax elements related to a current image block to be encoded into a digital video output bit stream (referred to as a bit stream or code stream), which will be used between the current image block frames. The syntax element of prediction is referred to as inter-prediction data for short. The inter-prediction data may include a first identifier for indicating whether to use the above-mentioned candidate inter prediction mode set for inter prediction on the current image block (in other words, for indicating whether or not (The first identifier for performing inter prediction on the current image block by using the new inter prediction mode proposed in this application); or, the inter prediction data may include: indicating whether to use a candidate inter prediction mode for the current image block to be encoded The first identifier of the inter-prediction set and the second identifier of the inter-prediction mode for indicating the current image block are collected; in order to determine the inter-prediction mode for encoding the current image block, the video encoder 100 is further configured to: Determine or select the inter prediction mode in the candidate inter prediction mode set used for inter prediction of the current image block (for example, select multiple Encoding the current image block in the inter-prediction mode with a compromise or minimum inter-prediction mode); and encoding the current image block based on the determined inter-prediction mode, the encoding process here may include Inter prediction mode, predicting motion information of one or more sub-blocks in the current image block (specifically, motion information of each sub-block or all sub-blocks), and using one or more sub-blocks in the current image block Performing inter prediction on the current image block of the motion information;
应当理解的是,如果由基于本申请提出的新的帧间预测模式预测出的运动信息产生的预测块与当前待编码图像块(即原始块)之间的差值(即残差)为0,则视频编码器100中只需要将与当前待编码的图像块相关的语法元素编入位流(亦称为码流);反之,除了语法元素外,还需要将相应的残差编入位流。It should be understood that if the difference (that is, the residual) between the prediction block generated by the motion information predicted based on the new inter prediction mode proposed in the present application and the current image block (that is, the original block) to be encoded is 0 , The video encoder 100 only needs to program the syntax elements related to the image block to be encoded into a bit stream (also known as a code stream); otherwise, in addition to the syntax elements, the corresponding residuals need to be coded into bits flow.
在另一实例中,视频解码器200用于:从位流中解码出与当前待解码的图像块相关的语法元素,这里将用于当前图像块帧间预测的语法元素简称为帧间预测数据,所述帧间预测数据包括用于指示是否对当前经解码图像块采用候选帧间预测模式集合进行帧间预测的第一标识(即用于指示是否对当前待解码图像块采用本申请提出的新的帧间预测模式进行帧间预测的第一标识),当所述帧间预测数据指示采用候选帧间预测模式集合(即新的帧间预测模式)来对当前图像块进行预测时,确定所述候选帧间预测模式集合中用于对当前图像块进行帧间预测的帧间预测模式,并基于确定的帧间预测模式解码所述当前图像块,这里的解码过程可以包括基于确定的帧间预测模式,预测所述当前图像块中一个或多个子块的运动信息,并利用所述当前图像块中一个或多个子块的运动信息对所述当前图像块执行帧间预测。In another example, the video decoder 200 is configured to decode a syntax element related to the image block to be decoded from the bit stream. Here, the syntax element used for inter prediction of the current image block is referred to as inter prediction data for short. The inter-prediction data includes a first identifier for indicating whether to use a candidate inter-prediction mode set for inter-prediction for the currently decoded image block (that is, for indicating whether to use the The first identifier of the new inter prediction mode for performing inter prediction) is determined when the inter prediction data indicates that a set of candidate inter prediction modes (that is, a new inter prediction mode) is used to predict the current image block An inter prediction mode for performing inter prediction on the current image block in the candidate inter prediction mode set, and decoding the current image block based on the determined inter prediction mode, and the decoding process here may include based on the determined frame Inter prediction mode, predicting motion information of one or more sub-blocks in the current image block, and using the operation of one or more sub-blocks in the current image block The motion information performs inter prediction on the current image block.
可选的,如果所述帧间预测数据还包括用于指示所述当前图像块采用何种帧间预测模式的第二标识,视频解码器200用于确定所述第二标识指示的帧间预测模式为用于对所述当前图像块进行帧间预测的帧间预测模式;或者,如果所述帧间预测数据未包括用于指示所述当前图像块采用何种帧间预测模式的第二标识,视频解码器200用于确定用于非方向 性的运动场的第一帧间预测模式为用于对所述当前图像块进行帧间预测的帧间预测模式。Optionally, if the inter prediction data further includes a second identifier for indicating which inter prediction mode the current image block uses, the video decoder 200 is configured to determine the inter prediction indicated by the second identifier. The mode is an inter-prediction mode for inter-prediction of the current image block; or, if the inter-prediction data does not include a second identifier used to indicate which inter-prediction mode is used by the current image block The video decoder 200 is configured to determine that a first inter prediction mode used for a non-directional motion field is an inter prediction mode used for inter prediction of the current image block.
图2A为本申请实施例中所描述的一种实例的视频编码器100的框图。视频编码器100用于将视频输出到后处理实体41。后处理实体41表示可处理来自视频编码器100的经编码视频数据的视频实体的实例,例如媒体感知网络元件(MANE)或拼接/编辑装置。在一些情况下,后处理实体41可为网络实体的实例。在一些视频编码系统中,后处理实体41和视频编码器100可为单独装置的若干部分,而在其它情况下,相对于后处理实体41所描述的功能性可由包括视频编码器100的相同装置执行。在某一实例中,后处理实体41是图1的存储装置40的实例。FIG. 2A is a block diagram of a video encoder 100 according to an example described in the embodiment of the present application. The video encoder 100 is configured to output a video to the post-processing entity 41. The post-processing entity 41 represents an example of a video entity that can process encoded video data from the video encoder 100, such as a media-aware network element (MANE) or a stitching / editing device. In some cases, the post-processing entity 41 may be an instance of a network entity. In some video encoding systems, the post-processing entity 41 and the video encoder 100 may be parts of a separate device, while in other cases, the functionality described with respect to the post-processing entity 41 may be performed by the same device including the video encoder 100 carried out. In a certain example, the post-processing entity 41 is an example of the storage device 40 of FIG. 1.
视频编码器100可根据本申请提出的包括模式0,1,2…或10的候选帧间预测模式集合中的任一种新的帧间预测模式执行视频图像块的编码,例如执行视频图像块的帧间预测。The video encoder 100 may perform encoding of a video image block according to any new inter prediction mode set of candidate inter prediction mode sets including modes 0, 1, 2, ..., or 10 proposed in the present application, for example, perform a video image block. Inter prediction.
在图2A的实例中,视频编码器100包括预测处理单元108、滤波器单元106、经解码图像缓冲器(DPB)107、求和器112、变换器101、量化器102和熵编码器103。预测处理单元108包括帧间预测器110和帧内预测器109。为了图像块重构,视频编码器100还包含反量化器104、反变换器105和求和器111。滤波器单元106既定表示一或多个环路滤波器,例如去块滤波器、自适应环路滤波器(ALF)和样本自适应偏移(SAO)滤波器。尽管在图2A中将滤波器单元106示出为环路内滤波器,但在其它实现方式下,可将滤波器单元106实施为环路后滤波器。在一种示例下,视频编码器100还可以包括视频数据存储器、分割单元(图中未示意)。In the example of FIG. 2A, the video encoder 100 includes a prediction processing unit 108, a filter unit 106, a decoded image buffer (DPB) 107, a summer 112, a transformer 101, a quantizer 102, and an entropy encoder 103. The prediction processing unit 108 includes an inter predictor 110 and an intra predictor 109. For image block reconstruction, the video encoder 100 further includes an inverse quantizer 104, an inverse transformer 105, and a summer 111. The filter unit 106 is intended to represent one or more loop filters, such as a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) filter. Although the filter unit 106 is shown as an in-loop filter in FIG. 2A, in other implementations, the filter unit 106 may be implemented as a post-loop filter. In one example, the video encoder 100 may further include a video data memory and a segmentation unit (not shown in the figure).
视频数据存储器可存储待由视频编码器100的组件编码的视频数据。可从视频源120获得存储在视频数据存储器中的视频数据。DPB 107可为参考图像存储器,其存储用于由视频编码器100在帧内、帧间译码模式中对视频数据进行编码的参考视频数据。视频数据存储器和DPB 107可由多种存储器装置中的任一者形成,例如包含同步DRAM(SDRAM)的动态随机存取存储器(DRAM)、磁阻式RAM(MRAM)、电阻式RAM(RRAM),或其它类型的存储器装置。视频数据存储器和DPB 107可由同一存储器装置或单独存储器装置提供。在各种实例中,视频数据存储器可与视频编码器100的其它组件一起在芯片上,或相对于那些组件在芯片外。The video data memory may store video data to be encoded by the components of the video encoder 100. The video data stored in the video data storage may be obtained from the video source 120. The DPB 107 may be a reference image memory that stores reference video data used by the video encoder 100 to encode video data in an intra-frame or inter-frame decoding mode. Video data memory and DPB 107 can be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM), synchronous resistive RAM (MRAM), resistive RAM (RRAM) including synchronous DRAM (SDRAM), Or other types of memory devices. Video data storage and DPB 107 can be provided by the same storage device or separate storage devices. In various examples, the video data memory may be on-chip with other components of video encoder 100, or off-chip relative to those components.
如图2A中所示,视频编码器100接收视频数据,并将所述视频数据存储在视频数据存储器中。分割单元将所述视频数据分割成若干图像块,而且这些图像块可以被进一步分割为更小的块,例如基于四叉树结构或者二叉树结构的图像块分割。此分割还可包含分割成条带(slice)、片(tile)或其它较大单元。视频编码器100通常说明编码待编码的视频条带内的图像块的组件。所述条带可分成多个图像块(并且可能分成被称作片的图像块集合)。预测处理单元108可选择用于当前图像块的多个可能的译码模式中的一者,例如多个帧内译码模式中的一者或多个帧间译码模式中的一者,其中所述多个帧间译码模式包括但不限于本申请提出的模式0,1,2,3…10中的一个或多个。预测处理单元108可将所得经帧内、帧间译码的块提供给求和器112以产生残差块,且提供给求和器111以重构用作参考图像的经编码块。As shown in FIG. 2A, the video encoder 100 receives video data and stores the video data in a video data memory. The segmentation unit divides the video data into several image blocks, and these image blocks can be further divided into smaller blocks, such as image block segmentation based on a quad-tree structure or a binary tree structure. This segmentation may also include segmentation into slices, tiles, or other larger units. Video encoder 100 typically illustrates components that encode image blocks within a video slice to be encoded. The slice can be divided into multiple image patches (and possibly into a collection of image patches called slices). The prediction processing unit 108 may select one of a plurality of possible decoding modes for the current image block, such as one of a plurality of intra-coding modes or one of a plurality of inter-coding modes, wherein The multiple inter-frame decoding modes include, but are not limited to, one or more of the modes 0, 1, 2, 3 ... 10 proposed in the present application. The prediction processing unit 108 may provide the obtained intra, inter-coded block to the summer 112 to generate a residual block, and to the summer 111 to reconstruct the encoded block used as a reference image.
预测处理单元108内的帧内预测器109可相对于与待编码当前块在相同帧或条带中的 一或多个相邻块执行当前图像块的帧内预测性编码,以去除空间冗余。预测处理单元108内的帧间预测器110可相对于一或多个参考图像中的一或多个预测块执行当前图像块的帧间预测性编码以去除时间冗余。The intra predictor 109 within the prediction processing unit 108 may perform intra predictive encoding of the current image block with respect to one or more neighboring blocks in the same frame or slice as the current block to be encoded to remove spatial redundancy. . The inter predictor 110 within the prediction processing unit 108 may perform inter predictive encoding of the current image block with respect to one or more prediction blocks in the one or more reference images to remove temporal redundancy.
具体的,帧间预测器110可用于确定用于编码当前图像块的帧间预测模式。举例来说,帧间预测器110可使用速率-失真分析来计算候选帧间预测模式集合中的各种帧间预测模式的速率-失真值,并从中选择具有最佳速率-失真特性的帧间预测模式。速率失真分析通常确定经编码块与经编码以产生所述经编码块的原始的未经编码块之间的失真(或误差)的量,以及用于产生经编码块的位速率(也就是说,位数目)。例如,帧间预测器110可确定候选帧间预测模式集合中编码所述当前图像块的码率失真代价最小的帧间预测模式为用于对当前图像块进行帧间预测的帧间预测模式。下文将详细介绍帧间预测性编码过程,尤其是在本申请各种用于非方向性或方向性的运动场的帧间预测模式下,预测当前图像块中一个或多个子块(具体可以是每个子块或所有子块)的运动信息的过程。Specifically, the inter predictor 110 may be configured to determine an inter prediction mode for encoding a current image block. For example, the inter predictor 110 may use rate-distortion analysis to calculate rate-distortion values for various inter-prediction modes in a set of candidate inter-prediction modes and select an inter-frame having the best rate-distortion characteristics from among them. Forecasting mode. Rate distortion analysis generally determines the amount of distortion (or error) between the coded block and the original uncoded block that was coded to produce the coded block, and the bit rate used to generate the coded block (that is, , Number of bits). For example, the inter predictor 110 may determine that the inter prediction mode with the lowest code rate distortion cost of encoding the current image block in the candidate inter prediction mode set is the inter prediction mode used for inter prediction of the current image block. The following describes the inter-predictive coding process in detail, especially in the various inter-prediction modes for non-directional or directional sports fields in this application, predicting one or more sub-blocks in the current image block. Sub-block or all sub-blocks).
帧间预测器110用于基于确定的帧间预测模式,预测当前图像块中一个或多个子块的运动信息(例如运动矢量),并利用当前图像块中一个或多个子块的运动信息(例如运动矢量)获取或产生当前图像块的预测块。帧间预测器110可在参考图像列表中的一者中定位所述运动向量指向的预测块。帧间预测器110还可产生与图像块和视频条带相关联的语法元素以供视频解码器200在对视频条带的图像块解码时使用。又或者,一种示例下,帧间预测器110利用每个子块的运动信息执行运动补偿过程,以生成每个子块的预测块,从而得到当前图像块的预测块;应当理解的是,这里的帧间预测器110执行运动估计和运动补偿过程。The inter predictor 110 is configured to predict motion information (such as a motion vector) of one or more sub-blocks in the current image block based on the determined inter prediction mode, and use the motion information (such as the motion vector) of one or more sub-blocks in the current image block. Motion vector) to obtain or generate a prediction block of the current image block. The inter predictor 110 may locate a prediction block pointed to by the motion vector in one of the reference image lists. The inter predictor 110 may also generate syntax elements associated with the image blocks and video slices for use by the video decoder 200 when decoding the image blocks of the video slices. In another example, the inter predictor 110 uses the motion information of each sub-block to perform a motion compensation process to generate a prediction block of each sub-block, thereby obtaining a prediction block of the current image block. It should be understood that the The inter predictor 110 performs motion estimation and motion compensation processes.
具体的,在为当前图像块选择帧间预测模式之后,帧间预测器110可将指示当前图像块的所选帧间预测模式的信息提供到熵编码器103,以便于熵编码器103编码指示所选帧间预测模式的信息。在本申请中,视频编码器100可在所发射的位流中包含与当前图像块相关的帧间预测数据,其可包括第一标识block_based_enable_flag,以表示是否对当前图像块采用本申请提出的新的帧间预测模式进行帧间预测;可选的,还可以包括第二标识block_based_index,以指示当前图像块使用的是哪一种新的帧间预测模式。本申请中,在不同的模式0,1,2…10下,利用多个参考块的运动矢量来预测当前图像块或其子块的运动矢量的过程,将在下文详细描述。Specifically, after the inter prediction mode is selected for the current image block, the inter predictor 110 may provide information indicating the selected inter prediction mode of the current image block to the entropy encoder 103 so that the entropy encoder 103 encodes the instruction. Information on the selected inter prediction mode. In the present application, the video encoder 100 may include inter prediction data related to the current image block in the transmitted bit stream, which may include a first identifier block_based_enable_flag, to indicate whether the new image proposed by the present application is adopted for the current image block. The inter prediction mode is used for inter prediction; optionally, a second identifier block_based_index may also be included to indicate which new inter prediction mode is used by the current image block. In the present application, the process of using the motion vectors of multiple reference blocks to predict the motion vectors of the current image block or its sub-blocks in different modes 0, 1, 2 ... 10 will be described in detail below.
帧内预测器109可对当前图像块执行帧内预测。明确地说,帧内预测器109可确定用来编码当前块的帧内预测模式。举例来说,帧内预测器109可使用速率-失真分析来计算各种待测试的帧内预测模式的速率-失真值,并从待测试模式当中选择具有最佳速率-失真特性的帧内预测模式。在任何情况下,在为图像块选择帧内预测模式之后,帧内预测器109可将指示当前图像块的所选帧内预测模式的信息提供到熵编码器103,以便熵编码器103编码指示所选帧内预测模式的信息。The intra predictor 109 may perform intra prediction on the current image block. In particular, the intra predictor 109 may determine an intra prediction mode used to encode the current block. For example, the intra-predictor 109 may use rate-distortion analysis to calculate rate-distortion values for various intra-prediction modes to be tested, and select an intra-prediction with the best rate-distortion characteristics from the test modes. mode. In any case, after the intra prediction mode is selected for the image block, the intra predictor 109 may provide information indicating the selected intra prediction mode of the current image block to the entropy encoder 103 so that the entropy encoder 103 encodes the instruction Information on the selected intra prediction mode.
在预测处理单元108经由帧间预测、帧内预测产生当前图像块的预测块之后,视频编码器100通过从待编码的当前图像块减去所述预测块来形成残差图像块。求和器112表示执行此减法运算的一或多个组件。所述残差块中的残差视频数据可包含在一或多个TU中, 并应用于变换器101。变换器101使用例如离散余弦变换(DCT)或概念上类似的变换等变换将残差视频数据变换成残差变换系数。变换器101可将残差视频数据从像素值域转换到变换域,例如频域。After the prediction processing unit 108 generates a prediction block of the current image block via inter prediction and intra prediction, the video encoder 100 forms a residual image block by subtracting the prediction block from the current image block to be encoded. The summer 112 represents one or more components that perform this subtraction operation. The residual video data in the residual block may be included in one or more TUs and applied to the transformer 101. The transformer 101 transforms the residual video data into a residual transform coefficient using a transform such as a discrete cosine transform (DCT) or a conceptually similar transform. The transformer 101 may transform the residual video data from a pixel value domain to a transform domain, such as a frequency domain.
变换器101可将所得变换系数发送到量化器102。量化器102量化所述变换系数以进一步减小位速率。在一些实例中,量化器102可接着执行对包含经量化的变换系数的矩阵的扫描。或者,熵编码器103可执行扫描。The transformer 101 may send the obtained transform coefficients to a quantizer 102. A quantizer 102 quantizes the transform coefficients to further reduce the bit rate. In some examples, the quantizer 102 may then perform a scan of a matrix containing the quantized transform coefficients. Alternatively, the entropy encoder 103 may perform scanning.
在量化之后,熵编码器103对经量化变换系数进行熵编码。举例来说,熵编码器103可执行上下文自适应可变长度编码(CAVLC)、上下文自适应二进制算术编码(CABAC)、基于语法的上下文自适应二进制算术编码(SBAC)、概率区间分割熵(PIPE)编码或另一熵编码方法或技术。在由熵编码器103熵编码之后,可将经编码位流发射到视频解码器200,或经存档以供稍后发射或由视频解码器200检索。熵编码器103还可对待编码的当前图像块的语法元素进行熵编码。After quantization, the entropy encoder 103 entropy encodes the quantized transform coefficients. For example, the entropy encoder 103 can perform context-adaptive variable-length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), and probability interval segmentation entropy (PIPE ) Coding or another entropy coding method or technique. After entropy encoding by the entropy encoder 103, the encoded bitstream may be transmitted to the video decoder 200, or archived for later transmission or retrieved by the video decoder 200. The entropy encoder 103 may also perform entropy coding on the syntax elements of the current image block to be coded.
反量化器104和反变化器105分别应用逆量化和逆变换以在像素域中重构所述残差块,例如以供稍后用作参考图像的参考块。求和器111将经重构的残差块添加到由帧间预测器110或帧内预测器109产生的预测块,以产生经重构图像块。滤波器单元106可以适用于经重构图像块以减小失真,诸如方块效应(block artifacts)。然后,该经重构图像块作为参考块存储在经解码图像缓冲器107中,可由帧间预测器110用作参考块以对后续视频帧或图像中的块进行帧间预测。The inverse quantizer 104 and the inverse changer 105 respectively apply inverse quantization and inverse transform to reconstruct the residual block in the pixel domain, for example, for later use as a reference block of a reference image. The summer 111 adds the reconstructed residual block to a prediction block generated by the inter predictor 110 or the intra predictor 109 to generate a reconstructed image block. The filter unit 106 may be adapted to reconstructed image blocks to reduce distortion, such as block artifacts. This reconstructed image block is then stored as a reference block in the decoded image buffer 107 and can be used by the inter predictor 110 as a reference block to inter-predict the subsequent video frames or blocks in the image.
应当理解的是,视频编码器100的其它的结构变化可用于编码视频流。例如,对于某些图像块或者图像帧,视频编码器100可以直接地量化残差信号而不需要经变换器101处理,相应地也不需要经反变换器105处理;或者,对于某些图像块或者图像帧,视频编码器100没有产生残差数据,相应地不需要经变换器101、量化器102、反量化器104和反变换器105处理;或者,视频编码器100可以将经重构图像块作为参考块直接地进行存储而不需要经滤波器单元106处理;或者,视频编码器100中量化器102和反量化器104可以合并在一起。It should be understood that other structural changes of the video encoder 100 may be used to encode a video stream. For example, for some image blocks or image frames, the video encoder 100 can directly quantize the residual signal without processing by the transformer 101 and correspondingly without the inverse transformer 105; or, for some image blocks Or image frames, the video encoder 100 does not generate residual data, and accordingly does not need to be processed by the transformer 101, quantizer 102, inverse quantizer 104, and inverse transformer 105; or, the video encoder 100 may convert the reconstructed image The blocks are directly stored as reference blocks without being processed by the filter unit 106; alternatively, the quantizer 102 and the inverse quantizer 104 in the video encoder 100 may be merged together.
图2B为本申请实施例中所描述的一种实例的视频解码器200的框图。在图2B的实例中,视频解码器200包括熵解码器203、预测处理单元208、反量化器204、反变换器205、求和器211、滤波器单元206以及经解码图像缓冲器207。预测处理单元208可以包括帧间预测器210和帧内预测器209。在一些实例中,视频解码器200可执行大体上与相对于来自图2A的视频编码器100描述的编码过程互逆的解码过程。FIG. 2B is a block diagram of a video decoder 200 according to an example described in the embodiment of the present application. In the example of FIG. 2B, the video decoder 200 includes an entropy decoder 203, a prediction processing unit 208, an inverse quantizer 204, an inverse transformer 205, a summer 211, a filter unit 206, and a decoded image buffer 207. The prediction processing unit 208 may include an inter predictor 210 and an intra predictor 209. In some examples, video decoder 200 may perform a decoding process that is substantially reciprocal to the encoding process described with respect to video encoder 100 from FIG. 2A.
在解码过程中,视频解码器200从视频编码器100接收表示经编码视频条带的图像块和相关联的语法元素的经编码视频位流。视频解码器200可从网络实体42接收视频数据,可选的,还可以将所述视频数据存储在视频数据存储器(图中未示意)中。视频数据存储器可存储待由视频解码器200的组件解码的视频数据,例如经编码视频位流。存储在视频数据存储器中的视频数据,例如可从存储装置40、从相机等本地视频源、经由视频数据的有线或无线网络通信或者通过存取物理数据存储媒体而获得。视频数据存储器可作为用于存储来自经编码视频位流的经编码视频数据的经解码图像缓冲器(CPB)。因此,尽管在图 2B中没有示意出视频数据存储器,但视频数据存储器和DPB 207可以是同一个的存储器,也可以是单独设置的存储器。视频数据存储器和DPB 207可由多种存储器装置中的任一者形成,例如:包含同步DRAM(SDRAM)的动态随机存取存储器(DRAM)、磁阻式RAM(MRAM)、电阻式RAM(RRAM),或其它类型的存储器装置。在各种实例中,视频数据存储器可与视频解码器200的其它组件一起集成在芯片上,或相对于那些组件设置在芯片外。During the decoding process, video decoder 200 receives from video encoder 100 an encoded video bitstream representing image blocks of the encoded video slice and associated syntax elements. The video decoder 200 may receive video data from the network entity 42, optionally, the video data may also be stored in a video data storage (not shown in the figure). The video data memory may store video data, such as an encoded video bitstream, to be decoded by components of the video decoder 200. The video data stored in the video data storage can be obtained, for example, from the storage device 40, from a local video source such as a camera, via a wired or wireless network of video data, or by accessing a physical data storage medium. The video data memory can be used as a decoded image buffer (CPB) for storing encoded video data from the encoded video bitstream. Therefore, although the video data storage is not shown in FIG. 2B, the video data storage and the DPB 207 may be the same storage, or may be separately set storages. Video data memory and DPB 207 can be formed by any of a variety of memory devices, such as: dynamic random access memory (DRAM) including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), and resistive RAM (RRAM) , Or other types of memory devices. In various examples, the video data memory may be integrated on a chip with other components of the video decoder 200 or provided off-chip relative to those components.
网络实体42可例如为服务器、MANE、视频编辑器/剪接器,或用于实施上文所描述的技术中的一或多者的其它此装置。网络实体42可包括或可不包括视频编码器,例如视频编码器100。在网络实体42将经编码视频位流发送到视频解码器200之前,网络实体42可实施本申请中描述的技术中的部分。在一些视频解码系统中,网络实体42和视频解码器200可为单独装置的部分,而在其它情况下,相对于网络实体42描述的功能性可由包括视频解码器200的相同装置执行。在一些情况下,网络实体42可为图1的存储装置40的实例。The network entity 42 may be, for example, a server, a MANE, a video editor / splicer, or other such device for implementing one or more of the techniques described above. The network entity 42 may or may not include a video encoder, such as video encoder 100. Before the network entity 42 sends the encoded video bitstream to the video decoder 200, the network entity 42 may implement some of the techniques described in this application. In some video decoding systems, the network entity 42 and the video decoder 200 may be part of separate devices, while in other cases, the functionality described with respect to the network entity 42 may be performed by the same device including the video decoder 200. In some cases, the network entity 42 may be an example of the storage device 40 of FIG. 1.
视频解码器200的熵解码器203对位流进行熵解码以产生经量化的系数和一些语法元素。熵解码器203将语法元素转发到预测处理单元208。视频解码器200可接收在视频条带层级和/或图像块层级处的语法元素。本申请中,在一种示例下,这里的语法元素可以包括与当前图像块相关的帧间预测数据,该帧间预测数据可以包括第一标识block_based_enable_flag,以表示是否对当前图像块采用上述候选帧间预测模式集合进行帧间预测(换言之,即以表示是否对当前图像块采用本申请提出的新的帧间预测模式进行帧间预测);可选的,还可以包括第二标识block_based_index,以指示当前图像块使用的是哪一种新的帧间预测模式。The entropy decoder 203 of the video decoder 200 entropy decodes the bit stream to generate quantized coefficients and some syntax elements. The entropy decoder 203 forwards the syntax elements to the prediction processing unit 208. Video decoder 200 may receive syntax elements at a video slice level and / or an image block level. In this application, in one example, the syntax element here may include inter prediction data related to the current image block, and the inter prediction data may include a first identifier block_based_enable_flag to indicate whether the above candidate frame is adopted for the current image block. Set of inter prediction modes to perform inter prediction (in other words, to indicate whether to use the new inter prediction mode proposed in the present application to perform inter prediction on the current image block); optionally, a second identifier block_based_index may also be included to indicate Which new inter prediction mode is used by the current image block.
当视频条带被解码为经帧内解码(I)条带时,预测处理单元208的帧内预测器209可基于发信号通知的帧内预测模式和来自当前帧或图像的先前经解码块的数据而产生当前视频条带的图像块的预测块。当视频条带被解码为经帧间解码(即,B或P)条带时,预测处理单元208的帧间预测器210可基于从熵解码器203接收到的语法元素,确定用于对当前视频条带的当前图像块进行解码的帧间预测模式,基于确定的帧间预测模式,对所述当前图像块进行解码(例如执行帧间预测)。具体的,帧间预测器210可确定是否对当前视频条带的当前图像块采用新的帧间预测模式进行预测,如果语法元素指示采用新的帧间预测模式来对当前图像块进行预测,基于新的帧间预测模式(例如通过语法元素指定的一种新的帧间预测模式或默认的一种新的帧间预测模式)预测当前视频条带的当前图像块或当前图像块的子块的运动信息,从而通过运动补偿过程使用预测出的当前图像块或当前图像块的子块的运动信息来获取或生成当前图像块或当前图像块的子块的预测块。这里的运动信息可以包括参考图像信息和运动矢量,其中参考图像信息可以包括但不限于单向/双向预测信息,参考图像列表号和参考图像列表对应的参考图像索引。对于帧间预测,可从参考图像列表中的一者内的参考图像中的一者产生预测块。视频解码器200可基于存储在DPB 207中的参考图像来建构参考图像列表,即列表0和列表1。当前图像的参考帧索引可包含于参考帧列表0和列表1中的一或多者中。在一些实例中,可以是视频编码器100发信号通 知指示是否采用新的帧间预测模式来解码特定块的特定语法元素,或者,也可以是发信号通知指示是否采用新的帧间预测模式,以及指示具体采用哪一种新的帧间预测模式来解码特定块的特定语法元素。应当理解的是,这里的帧间预测器210执行运动补偿过程。下文将详细的阐述在各种新的帧间预测模式下,利用参考块的运动信息来预测当前图像块或当前图像块的子块的运动信息的帧间预测过程。When a video slice is decoded as an intra decoded (I) slice, the intra predictor 209 of the prediction processing unit 208 may be based on the signaled intra prediction mode and the previously decoded block from the current frame or image. Data to generate prediction blocks for image blocks of the current video slice. When a video slice is decoded into an inter-decoded (ie, B or P) slice, the inter predictor 210 of the prediction processing unit 208 may determine, based on the syntax elements received from the entropy decoder 203, the An inter prediction mode in which a current image block of a video slice is decoded, and based on the determined inter prediction mode, the current image block is decoded (for example, inter prediction is performed). Specifically, the inter predictor 210 may determine whether to use the new inter prediction mode to predict the current image block of the current video slice. If the syntax element indicates that the new inter prediction mode is used to predict the current image block, based on A new inter prediction mode (e.g., a new inter prediction mode specified by a syntax element or a default new inter prediction mode) predicts the current image block of the current video slice or a sub-block of the current image block. Motion information, thereby obtaining or generating a predicted block of the current image block or a sub-block of the current image block using the predicted motion information of the current image block or a sub-block of the current image block through a motion compensation process. The motion information here may include reference image information and motion vectors, where the reference image information may include but is not limited to unidirectional / bidirectional prediction information, a reference image list number, and a reference image index corresponding to the reference image list. For inter prediction, a prediction block may be generated from one of reference pictures within one of the reference picture lists. The video decoder 200 may construct a reference picture list, that is, a list 0 and a list 1, based on the reference pictures stored in the DPB 207. The reference frame index of the current image may be included in one or more of the reference frame list 0 and list 1. In some examples, the video encoder 100 may signal whether to use a new inter prediction mode to decode a specific syntax element of a specific block, or may be a signal to indicate whether to use a new inter prediction mode. And indicate which new inter prediction mode is used to decode a specific syntax element of a specific block. It should be understood that the inter predictor 210 here performs a motion compensation process. In the following, the inter prediction process for using the motion information of the reference block to predict the motion information of the current image block or a sub-block of the current image block under various new inter prediction modes will be explained in detail.
反量化器204将在位流中提供且由熵解码器203解码的经量化变换系数逆量化,即去量化。逆量化过程可包括:使用由视频编码器100针对视频条带中的每个图像块计算的量化参数来确定应施加的量化程度以及同样地确定应施加的逆量化程度。反变换器205将逆变换应用于变换系数,例如逆DCT、逆整数变换或概念上类似的逆变换过程,以便产生像素域中的残差块。The inverse quantizer 204 inverse quantizes, that is, dequantizes, the quantized transform coefficients provided in the bitstream and decoded by the entropy decoder 203. The inverse quantization process may include using a quantization parameter calculated by the video encoder 100 for each image block in the video slice to determine the degree of quantization that should be applied and similarly to determine the degree of inverse quantization that should be applied. The inverse transformer 205 applies an inverse transform to transform coefficients, such as an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process in order to generate a residual block in the pixel domain.
在帧间预测器210产生用于当前图像块或当前图像块的子块的预测块之后,视频解码器200通过将来自反变换器205的残差块与由帧间预测器210产生的对应预测块求和以得到重建的块,即经解码图像块。求和器211表示执行此求和操作的组件。在需要时,还可使用环路滤波器(在解码环路中或在解码环路之后)来使像素转变平滑或者以其它方式改进视频质量。滤波器单元206可以表示一或多个环路滤波器,例如去块滤波器、自适应环路滤波器(ALF)以及样本自适应偏移(SAO)滤波器。尽管在图2B中将滤波器单元206示出为环路内滤波器,但在其它实现方式中,可将滤波器单元206实施为环路后滤波器。在一种示例下,滤波器单元206适用于重建块以减小块失真,并且该结果作为经解码视频流输出。并且,还可以将给定帧或图像中的经解码图像块存储在经解码图像缓冲器207中,经解码图像缓冲器207存储用于后续运动补偿的参考图像。经解码图像缓冲器207可为存储器的一部分,其还可以存储经解码视频,以供稍后在显示装置(例如图1的显示装置220)上呈现,或可与此类存储器分开。After the inter predictor 210 generates a prediction block for the current image block or a sub-block of the current image block, the video decoder 200 works by comparing the residual block from the inverse transformer 205 with the corresponding prediction generated by the inter predictor 210 The blocks are summed to get the reconstructed block, that is, the decoded image block. The summer 211 represents a component that performs this summing operation. When needed, a loop filter (in the decoding loop or after the decoding loop) can also be used to smooth pixel transitions or otherwise improve video quality. The filter unit 206 may represent one or more loop filters, such as a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) filter. Although the filter unit 206 is shown as an in-loop filter in FIG. 2B, in other implementations, the filter unit 206 may be implemented as a post-loop filter. In one example, the filter unit 206 is adapted to reconstruct a block to reduce block distortion, and the result is output as a decoded video stream. And, a decoded image block in a given frame or image may also be stored in a decoded image buffer 207, and the decoded image buffer 207 stores a reference image for subsequent motion compensation. The decoded image buffer 207 may be part of a memory, which may also store the decoded video for later presentation on a display device, such as the display device 220 of FIG. 1, or may be separate from such memory.
应当理解的是,视频解码器200的其它结构变化可用于解码经编码视频位流。例如,视频解码器200可以不经滤波器单元206处理而生成输出视频流;或者,对于某些图像块或者图像帧,视频解码器200的熵解码器203没有解码出经量化的系数,相应地不需要经反量化器204和反变换器205处理。It should be understood that other structural variations of the video decoder 200 may be used to decode the encoded video bitstream. For example, the video decoder 200 may generate an output video stream without being processed by the filter unit 206; or, for certain image blocks or image frames, the entropy decoder 203 of the video decoder 200 does not decode the quantized coefficients, and accordingly It does not need to be processed by the inverse quantizer 204 and the inverse transformer 205.
本发明实施例中,当前图像块可以包括但不限于16x16像素,32x32像素,32x16像素和16x32像素等。如上所述,每个图像帧可以被分割为用于编码的图像块。这些图像块可以被进一步分割为更小的块,例如当前图像块600可以被分割成多个MxN子块,即每个子块的大小均为MxN像素。“M×N”与“M乘N”可互换使用以指依照水平维度及垂直维度的图像块的像素尺寸,即在水平方向上具有M个像素,且在垂直方向上具有N个像素,其中M、N表示非负整数值。此外,块未必需要在水平方向上与在垂直方向上具有相同数目个像素。举例说明,这里的M=N=4,当然当前图像块的子块大小和参考块的大小也可以是8x8像素,8x4像素,或4x8像素,或者最小的预测块大小。此外,本申请描述的图像块可以理解为编码单元(coding unit,CU)。图像块可具有固定或可变的大小,且根据不同视频压缩编解码标准而在大小上不同。此外,当前图像块是指当前待编码或解码的图像块,例如待编码或解码的预测单元。In the embodiment of the present invention, the current image block may include, but is not limited to, 16 × 16 pixels, 32 × 32 pixels, 32 × 16 pixels, 16 × 32 pixels, and the like. As described above, each image frame can be divided into image blocks for encoding. These image blocks can be further divided into smaller blocks. For example, the current image block 600 can be divided into multiple MxN sub-blocks, that is, each sub-block has a size of MxN pixels. "M × N" and "M times N" are used interchangeably to refer to the pixel size of an image block according to the horizontal and vertical dimensions, that is, there are M pixels in the horizontal direction and N pixels in the vertical direction. Where M and N represent non-negative integer values. In addition, the block does not necessarily need to have the same number of pixels in the horizontal direction as in the vertical direction. For example, here M = N = 4, of course, the subblock size and reference block size of the current image block can also be 8x8 pixels, 8x4 pixels, or 4x8 pixels, or the smallest predicted block size. In addition, the image block described in this application may be understood as a coding unit (CU). Image blocks can have fixed or variable sizes and differ in size according to different video compression codec standards. In addition, the current image block refers to an image block to be encoded or decoded currently, such as a prediction unit to be encoded or decoded.
图3是示出根据本申请一种实施例的编码方法的过程300的流程图。过程300可由视频编码器100执行,具体的,可以由视频编码器100的帧内预测器109来执行。过程300描述为一系列的步骤或操作,应当理解的是,过程300可以以各种顺序执行和/或同时发生,不限于图3所示的执行顺序。假设具有多个视频帧的视频数据流正在使用视频编码器或者视频解码器,执行包括如下步骤的过程300来通过帧内预测方法中的Planar预测方法来实现当前图像块的编码,其中,当前图像块可为一个CU的亮度图像块,也可以是一个CU的色度图像块。FIG. 3 is a flowchart illustrating a process 300 of an encoding method according to an embodiment of the present application. The process 300 may be performed by the video encoder 100, and specifically, may be performed by the intra predictor 109 of the video encoder 100. The process 300 is described as a series of steps or operations. It should be understood that the process 300 may be performed in various orders and / or concurrently, and is not limited to the execution order shown in FIG. 3. Assuming that a video data stream with multiple video frames is using a video encoder or video decoder, a process 300 including the following steps is performed to implement the encoding of the current image block through the Planar prediction method in the intra prediction method, where the current image The block may be a luma image block of a CU or a chroma image block of a CU.
301、将左下参考像素P(–1,H)和右上参考像素P(W,–1)加权平均,得到当前图像块右下像素的第一预测值P1(W,H);301. Weighted average the lower left reference pixel P (-1, H) and the upper right reference pixel P (W, -1) to obtain a first prediction value P1 (W, H) of the lower right pixel of the current image block.
302、按照预设的F种修正量,分别与第一预测值P1(W,H)相加,得到第二预测值P2(W,H,f),f=0,1,2,…,F-1;根据F种第二预测值P2(W,H,f),分别得到F种平面预测图像,计算F种平面预测图像与当前图像块的差异D(f),所择差异最小的平面预测图像作为最优的平面预测图像,记录最优平面预测图像对应的预测修正量序号。302: Add the first predicted value P1 (W, H) according to the preset F kinds of correction amounts to obtain a second predicted value P2 (W, H, f), f = 0,1,2, ..., F-1; According to F second prediction values P2 (W, H, f), F types of plane prediction images are obtained, and the differences D (f) between the F types of plane prediction images and the current image block are calculated. The plane prediction image is used as the optimal plane prediction image, and the sequence number of the prediction correction amount corresponding to the optimal plane prediction image is recorded.
其中,F种修正量M和它对应的预测修正量序号Idx可按以下方法之一确定。Among them, the F kinds of correction amounts M and its corresponding predicted correction amount numbers Idx can be determined according to one of the following methods.
方法一:预测修正量序号Idx为0对应修正量M为0;Idx为1对应修正量M为第一预设值A1;Idx为2对应修正量M为–A1。所述A1为正整数,例如为8、16、32、64等正整数,例如对于8比特位宽的预测信号,A1=10、16或20,对于10比特位宽的预测信号A1=40、64或80。Method 1: Prediction correction amount serial number Idx is 0 corresponding to correction amount M is 0; Idx is 1 corresponding to correction amount M is first preset value A1; Idx is 2 corresponding to correction amount M is -A1. The A1 is a positive integer, for example, a positive integer such as 8, 16, 32, 64, for example, for an 8-bit wide prediction signal, A1 = 10, 16 or 20, and for a 10-bit wide prediction signal A1 = 40, 64 or 80.
A1也可以为与当前块的宽和高相关的变量,例如:A1 can also be a variable related to the width and height of the current block, for example:
A1=Clip3(B1,B2,(W+H)/2*pow(2,BD–8)),A1 = Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)),
其中,Clip3(min,max,val)表示将val限制在min和max之间;pow(a,b)表示a的b次幂;BD表示预测信号的位宽(bit depth),例如BD=8或10或12;B1和B2为预设正常数,如B1=8、B2=16,或者B1=12、B2=20。Among them, Clip3 (min, max, val) indicates that val is limited to between min and max; pow (a, b) indicates the power of b of a; BD indicates the bit depth of the predicted signal, for example, BD = 8 Or 10 or 12; B1 and B2 are preset normal numbers, such as B1 = 8, B2 = 16, or B1 = 12, B2 = 20.
方法二:预测修正量序号Idx为0对应修正量M为0;Idx为1对应修正量M为第二预设值A2;Idx为2对应修正量M为–A2;Idx为3对应修正量M为第三预设值A3;Idx为4对应修正量M为–A3。其中,A3>A2,如A3=2*A2,或者A3=1.75*A2。Method 2: Predicted correction amount serial number Idx is 0 corresponding to correction amount M is 0; Idx is 1 corresponding to correction amount M is second preset value A2; Idx is 2 corresponding to correction amount M is -A2; Idx is 3 corresponding to correction amount M Is the third preset value A3; Idx is 4 and the correction amount M is -A3. Among them, A3> A2, such as A3 = 2 * A2, or A3 = 1.75 * A2.
方法三:将左下参考像素P(–1,H)和右上参考像素P(W,–1)加权平均,得到当前图像块右下像素的第一预测值P1(W,H)。如果第一预测值P1(W,H)小于左上角参考像素P(–1,–1)的值,预测修正量序号Idx为1对应修正量M为第一预设值A1;Idx为2对应修正量M为–A1;如果第一预测值P1(W,H)大于等于左上角参考像素P(–1,–1)的值,预测修正量序号Idx为1对应修正量M为第一预设值–A1;Idx为2对应修正量M为A1。Method 3: Weight the average of the lower left reference pixel P (–1, H) and the upper right reference pixel P (W, –1) to obtain the first predicted value P1 (W, H) of the lower right pixel of the current image block. If the first predicted value P1 (W, H) is smaller than the value of the upper left reference pixel P (–1, –1), the predicted correction amount number Idx is 1 and the correction amount M is the first preset value A1; Idx is 2 corresponding The correction amount M is –A1; if the first predicted value P1 (W, H) is greater than or equal to the value of the reference pixel P (–1, –1) in the upper left corner, the predicted correction amount number Idx is 1, and the corresponding correction amount M is the first prediction. Set the value -A1; Idx is 2 and the correction amount M is A1.
方法四:将左下参考像素P(–1,H)和右上参考像素P(W,–1)加权平均并减去左上参考像素P(–1,–1),得到差分值D,即D=P(W,–1)*a+P(–1,H)*(1–a)–P(–1,–1),其中a为预设常数,如a=0.5,或者a=H/(W+H)。预测修正量序号Idx为1对应修正量M为Clip3(sign(D)*B3,sign(D)*B4,D),其中B3和B4为预设正常数,如B3=8、B4=16,或者B3=32、B4=64;sign(D)表示取D的符号,即D≥0,sign(D)=1;D<0,sign(D)=–1。Method 4: Weight the average of the lower left reference pixel P (–1, H) and the upper right reference pixel P (W, –1) and subtract the upper left reference pixel P (–1, –1) to obtain the difference value D, that is, D = P (W, –1) * a + P (–1, H) * (1–a) –P (–1, –1), where a is a preset constant, such as a = 0.5, or a = H / (W + H). Prediction correction amount Idx is 1, corresponding correction amount M is Clip3 (sign (D) * B3, sign (D) * B4, D), where B3 and B4 are preset normal numbers, such as B3 = 8, B4 = 16, Or B3 = 32 and B4 = 64; sign (D) means the sign of D, that is, D≥0, sign (D) = 1; D <0, sign (D) =-1.
在一种实施方式中,步骤702还可以包括:将第二预测值P2(W,H)限制在预测信号的 取值范围内,如N比特位宽的预测信号的取值范围为[0,pow(2,N)–1]。In an embodiment, step 702 may further include: limiting the second prediction value P2 (W, H) to a value range of the prediction signal, for example, the value range of the N-bit wide prediction signal is [0, pow (2, N) –1].
在一种实施方式中,步骤302中的F种平面预测图像可以通过如下方式获得:In one embodiment, the F kinds of plane prediction images in step 302 can be obtained by the following methods:
步骤2.1:由右下像素的第二预测值P2(W,H,f)和左下参考像素P(–1,H)加权平均得到预测像素P(x,y)下侧像素的预测值P(x,H,f);由右下像素的第二预测值P2(W,H,f)和右上参考像素P(W,–1)加权平均得到预测像素P(x,y)右侧像素的预测值P(W,y,f)。Step 2.1: Weighted average of the second predicted value P2 (W, H, f) of the lower right pixel and the lower left reference pixel P (–1, H) to obtain the predicted value P () of the lower pixel of the predicted pixel P (x, y). x, H, f); the weighted average of the second predicted value P2 (W, H, f) of the lower right pixel and the upper right reference pixel P (W, –1) to obtain the right of the predicted pixel P (x, y) Predicted value P (W, y, f).
步骤2.2:计算预测图像中各个位置(x,y)的预测像素值P(x,y,f)。由P(x,H,f)和P(x,–1)加权平均得到P(x,y)的竖直预测值Pv(x,y,f);由P(W,y,f)和P(–1,y)加权平均得到P(x,y)的水平预测值Ph(x,y,f);将Ph(x,y,f)和Pv(x,y,f)加权平均,得到坐标为(x,y)的像素的预测值P(x,y,f)。Step 2.2: Calculate the predicted pixel value P (x, y, f) of each position (x, y) in the predicted image. The weighted average of P (x, H, f) and P (x, –1) gives the vertical prediction value Pv (x, y, f) of P (x, y); P (W, y, f) and P (–1, y) weighted average to get the level prediction value Ph (x, y, f) of P (x, y); Ph (x, y, f) and Pv (x, y, f) weighted average, The predicted value P (x, y, f) of the pixel with coordinates (x, y) is obtained.
其中,所述差异的计算可以使用现有的方法,例如可以使用绝对误差和(Sum of Absolute Difference,SAD)算法计算差异。The difference may be calculated using an existing method, for example, an absolute error sum (Sum of Absolute Difference, SAD) algorithm may be used to calculate the difference.
步骤303、根据最优平面预测图像对当前图像块进行编码,得到率失真代价;将最优平面预测图像的率失真代价与其它帧内预测模式的率失真代价进行比较,选择率失真代价最小的帧内预测模式作为将当前图像块的最优帧内编码模式。Step 303: Encode the current image block according to the optimal plane prediction image to obtain the rate distortion cost; compare the rate distortion cost of the optimal plane prediction image with the rate distortion cost of other intra prediction modes, and select the one with the least rate distortion cost. The intra prediction mode is used as an optimal intra coding mode for the current image block.
其中根据最优平面预测图像对当前图像块进行编码,得到率失真代价,为现有技术,通常包括:计算最优平面预测图像对应的残差,对残差进行变换、量化,得到当前图像块的失真;编码当前图像块的预测模式信息和残差信息,得到比特数,当所述预测模式为平面预测模式时,需要将最优平面预测图像对应的预测修正量序号进行编码,计入比特数;将失真和比特数加权求和,得到率失真代价。所述预测修正量序号例如可使用基于上下文的二元算术编码进行编码。Among them, the current image block is encoded according to the optimal plane prediction image to obtain the rate distortion cost. This is a conventional technique, which usually includes: calculating the residual corresponding to the optimal plane prediction image, transforming and quantizing the residual to obtain the current image block. Encoding the prediction mode information and residual information of the current image block to obtain the number of bits. When the prediction mode is a planar prediction mode, the prediction correction amount serial number corresponding to the optimal planar prediction image needs to be encoded and counted into the bits. Weighted sum of distortion and number of bits to get the rate distortion cost. The prediction correction amount serial number can be encoded using, for example, context-based binary arithmetic coding.
步骤304、如果最优帧内编码模式为平面预测模式,则将预测修正量序号写入码流。Step 304: If the optimal intra coding mode is a planar prediction mode, write the prediction correction number into the code stream.
需要说明的是,本发明实施例中以当前图像块只使用帧内编码模式为例,例如当前图像块为I帧中的一个图像块。如果当前图像块为P/B帧中的图像块,则当前图像块还可以使用帧间预测编码,此时还需要将最优帧内编码模式的率失真代价与最优帧间编码模式的率失真代价进行比较,从而确定最优的预测模式。It should be noted that, in the embodiment of the present invention, the current image block uses only the intra coding mode as an example. For example, the current image block is an image block in an I frame. If the current image block is an image block in a P / B frame, the current image block can also use inter prediction coding. At this time, the rate distortion cost of the optimal intra coding mode and the rate of the optimal inter coding mode also need to be used. The distortion cost is compared to determine the optimal prediction mode.
编码端产生多种预测修正量下的平面预测图像,选用最佳的平面预测图像,并将相应的预测修正量序号写入码流;此方法提高了平面预测的预测效率,从而改进了帧内编码(Intra coding)的压缩效率。The encoding end generates plane prediction images with various prediction corrections, selects the best plane prediction image, and writes the corresponding prediction correction number to the code stream; this method improves the prediction efficiency of the plane prediction, thereby improving the intra frame. Compression efficiency of Intra coding.
本发明实施例还提供了一种解码装置,该装置包括用于执行上述编码方法的模块。An embodiment of the present invention further provides a decoding apparatus, and the apparatus includes a module for performing the foregoing encoding method.
本发明实施例还提供了另一种编码器,包括:相互耦合的非易失性存储器和处理器,所述处理器调用存储在所述存储器中的程序代码以执行上述编码方法的部分或全部步骤。An embodiment of the present invention further provides another encoder, including: a non-volatile memory and a processor coupled to each other, the processor invoking program code stored in the memory to execute part or all of the foregoing encoding method. step.
本发明实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储了程序代码,其中,所述程序代码包括用于执行上述编码方法的部分或全部步骤的指令。An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores program code, where the program code includes instructions for performing part or all of the steps of the foregoing encoding method.
本发明实施例还提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述编码方法的部分或全部步骤的指令。An embodiment of the present invention further provides a computer program product. When the computer program product is run on a computer, the computer program product is caused to execute instructions of some or all steps of the foregoing coding method.
图4是示出根据本申请一种实施例的解码方法的过程400的流程图。过程400可由视频解码器200执行。过程400描述为一系列的步骤或操作,应当理解的是,过程400可以 以各种顺序执行和/或同时发生,不限于图4所示的执行顺序。假设具有多个视频帧的视频数据流正在使用视频编码器或者视频解码器,执行包括如下步骤的过程400来通过帧内预测方法中的Planar预测方法来实现当前图像块的解码,其中,当前图像块可为一个CU的亮度图像块,也可以是一个CU的色度图像块。FIG. 4 is a flowchart illustrating a process 400 of a decoding method according to an embodiment of the present application. Process 400 may be performed by video decoder 200. The process 400 is described as a series of steps or operations. It should be understood that the process 400 may be performed in various orders and / or concurrently, and is not limited to the execution order shown in FIG. 4. Assuming that a video data stream with multiple video frames is using a video encoder or video decoder, a process 400 including the following steps is performed to implement decoding of a current image block through a Planar prediction method in an intra prediction method, where the current image The block may be a luma image block of a CU or a chroma image block of a CU.
401、解析码流以获取待解码当前图像块的预测残差,预测模式以及预测参考信息;其中,在所述预测模式为平面预测模式时,所述预测参考信息包括预测修正量序号。401. Parse a bitstream to obtain prediction residuals, prediction modes, and prediction reference information of a current image block to be decoded. When the prediction mode is a planar prediction mode, the prediction reference information includes a sequence number of a prediction correction amount.
该步骤具体可以由解码器200中的熵解码器203来执行。This step may be specifically performed by the entropy decoder 203 in the decoder 200.
其中,需要说明的是,本发明实施例实施的具体方案是Planar模式下的帧内预测方法,所以实际上还会从码流中解析出所述当前图像块的预测模式,并且该预测模式指示当前图像块的预测模式为Planar模式。It should be noted that the specific solution implemented in the embodiment of the present invention is an intra prediction method in Planar mode, so the prediction mode of the current image block is actually parsed from the bitstream, and the prediction mode indicates The prediction mode of the current image block is Planar mode.
402、若所述当前图像块的预测模式为平面预测模式,基于所述预测修正量序号确定预测修正量。402. If the prediction mode of the current image block is a planar prediction mode, determine a prediction correction amount based on the prediction correction amount number.
该步骤可以由解码器200中的帧内预测器209来执行。This step may be performed by the intra predictor 209 in the decoder 200.
所述预测修正量序号Idx为0表示修正量M为0,序号大于0表示修正量M不为零。The predicted correction amount serial number Idx is 0, which indicates that the correction amount M is 0, and the serial number greater than 0 indicates that the correction amount M is not zero.
在一种实施方式中,当修正量M不为0时,可采用以下方法中的任意一种来确定修正量M的具体值:In one embodiment, when the correction amount M is not 0, any one of the following methods may be used to determine the specific value of the correction amount M:
方法一:method one:
若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;或若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量。其中,所述第一预设修正量与所述第二预设修正量互为相反数。If the prediction correction amount is a first preset number, determine the prediction correction amount as a first preset correction amount; or if the prediction correction amount number is a second preset number, determine the prediction correction The amount is the second preset correction amount. The first preset correction amount and the second preset correction amount are opposite numbers to each other.
其中,第一预设序号可以为1,第二预设序号可以为2。The first preset serial number may be 1 and the second preset serial number may be 2.
在一种实施方式中,所述第一预设修正量为预设的正整数,例如可以为8、16、32、64等正整数。进一步地,对于不同的比特位宽,所述第一预设修正量的预设值可能也不一样,例如在8比特位宽时,所述第一预设修正量可以为10、16或20;在10比特位宽时,所述第一预设修正量可以为A1=40、64或80。In an implementation manner, the first preset correction amount is a preset positive integer, and may be, for example, a positive integer such as 8, 16, 32, or 64. Further, the preset value of the first preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the first preset correction amount may be 10, 16, or 20 ; When the width is 10 bits, the first preset correction amount may be A1 = 40, 64, or 80.
在另一种实施方式中,所述第一预设修正量也可以为与所述当前图像块的宽和高相关的变量;例如,所述第一预设修正量可以基于如下计算式计算确定:In another implementation manner, the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
A1=Clip3(B1,B2,(W+H)/2*pow(2,BD–8));A1 = Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
其中,A1表示所述第一预设修正量;B1和B2为预设正整数且B1<B2,例如B1=8、B2=16,或者B1=12、B2=20;pow(2,BD–8)表示2的BD–8次幂,BD表示比特位宽,例如BD=8或10或12;H表示所述当前图像块的高,W表示所述当前图像块的宽;Clip3(B1,B2,(W+H)/2*pow(2,BD–8))表示将(W+H)/2*pow(2,BD–8)的值限制在B1和B2之间,即若((W+H)/2*pow(2,BD–8))<B1,则(W+H)/2*pow(2,BD–8)=B1,若((W+H)/2*pow(2,BD–8))>B2,则(W+H)/2*pow(2,BD–8)=B2,若B1≤((W+H)/2*pow(2,BD–8))≤B2,则(W+H)/2*pow(2,BD–8)=(W+H)/2*pow(2,BD–8)。Among them, A1 represents the first preset correction amount; B1 and B2 are preset positive integers and B1 <B2, for example, B1 = 8, B2 = 16, or B1 = 12, B2 = 20; pow (2, BD– 8) represents the BD-8 power of 2, BD represents the bit width, such as BD = 8 or 10 or 12; H represents the height of the current image block, W represents the width of the current image block; Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)) means to limit the value of (W + H) / 2 * pow (2, BD–8) to between B1 and B2, that is, if ( (W + H) / 2 * pow (2, BD–8)) <B1, then (W + H) / 2 * pow (2, BD–8) = B1, if ((W + H) / 2 * pow (2, BD–8))> B2, then (W + H) / 2 * pow (2, BD–8) = B2, if B1≤ ((W + H) / 2 * pow (2, BD– 8)) ≤ B2, then (W + H) / 2 * pow (2, BD–8) = (W + H) / 2 * pow (2, BD–8).
方法二:Method Two:
若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第三预设修正量; 若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第四预设修正量;若所述预测修正量序号为第三预设序号,则确定所述预测修正量为第五预设修正量;若所述预测修正量序号为第四预设序号,则确定所述预测修正量为第六预设修正量。If the predicted correction amount number is a first preset number, determine the predicted correction amount as a third preset number; if the predicted correction amount is a second preset number, determine the predicted correction amount Is the fourth preset correction amount; if the predicted correction amount number is a third preset number, it is determined that the predicted correction amount is a fifth preset correction amount; if the predicted correction amount number is a fourth preset number , It is determined that the predicted correction amount is a sixth preset correction amount.
其中,所述第三预设修正量与所述第四预设修正量互为相反数;且所述第五预设修正量与所述第六预设修正量互为相反数。The third preset correction amount and the fourth preset correction amount are opposite numbers to each other; and the fifth preset correction amount and the sixth preset correction amount are opposite numbers to each other.
其中,第一预设序号可以为1,第二预设序号可以为2,第三预设序号可以为3,第四预设序号可以为4。The first preset serial number can be 1, the second preset serial number can be 2, the third preset serial number can be 3, and the fourth preset serial number can be 4.
其中,第三预设修正量和第五预设修正量为预设正整数,且第五预设修正量大于第三预设修正量,例如第五预设修正量可以为第三预设修正量的1.75倍,或2倍,或2.25倍。The third preset correction amount and the fifth preset correction amount are preset positive integers, and the fifth preset correction amount is greater than the third preset correction amount. For example, the fifth preset correction amount may be the third preset correction amount. The amount is 1.75 times, or 2 times, or 2.25 times.
其中,所述第三预设修正量可以为8、16、32、或64等正整数。进一步地,对于不同的比特位宽,所述第三预设修正量的预设值可能也不一样,例如在8比特位宽时,所述第三预设修正量可以为10、16或20等等;在10比特位宽时,所述第三预设修正量可以为A1=40、64或80等等。The third preset correction amount may be a positive integer such as 8, 16, 32, or 64. Further, the preset value of the third preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the third preset correction amount may be 10, 16, or 20 And so on; when the width is 10 bits, the third preset correction amount may be A1 = 40, 64, 80, and so on.
方法三:Method three:
将所述当前图像块的左下参考像素的值与所述当前图像块的右上参考像素的值进行加权平均,获得加权平均值;在所述加权平均值小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量;或在所述加权平均值不小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第二预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第一预设修正量。其中,所述第一预设修正量与所述第二预设修正量互为相反数。Performing a weighted average of the value of the lower left reference pixel of the current image block and the value of the upper right reference pixel of the current image block to obtain a weighted average; where the weighted average is less than the value of the upper left reference pixel of the current image block When the value of the predicted correction amount is the first preset number, it is determined that the predicted correction amount is the first preset number; if the predicted correction amount is the second preset number, the determination is determined. The predicted correction amount is the second preset correction amount; or when the weighted average value is not less than the value of the upper left reference pixel of the current image block, if the predicted correction amount number is the first preset number, the determined correction amount is determined. The predicted correction amount is a second preset correction amount; if the predicted correction amount number is a second preset number, determining that the predicted correction amount is the first preset correction amount. The first preset correction amount and the second preset correction amount are opposite numbers to each other.
其中,所述加权平均值具体可以为所述当前图像块的右下像素的预测值,例如可以通过如下计算式获得:The weighted average value may specifically be a predicted value of a lower right pixel of the current image block, and may be obtained by, for example, the following calculation formula:
P1(W,H)=P(W,–1)*a+P(–1,H)*(1–a);P1 (W, H) = P (W, –1) * a + P (–1, H) * (1–a);
其中,P1(W,H)表示所述右下像素的预测值,P(W,–1)表示所述右上参考像素的值,P(–1,H)表示所述左下参考像素的值;0<a<1,a可以为预设值,例如为0.4,0.5,或0.6等等;a也可以为与所述当前图像块的宽和高相关的变量,例如a=H/(W+H),其中H表示所述当前图像块的高,W表示所述当前图像块的宽。Wherein, P1 (W, H) represents the predicted value of the lower right pixel, P (W, –1) represents the value of the upper right reference pixel, and P (–1, H) represents the value of the lower left reference pixel; 0 <a <1, a can be a preset value, such as 0.4, 0.5, or 0.6, etc .; a can also be a variable related to the width and height of the current image block, such as a = H / (W + H), where H represents the height of the current image block, and W represents the width of the current image block.
其中,所述左上参考像素,左下参考像素,所述右上参考像素和所述右下像素均不属于所述当前图像块。例如,在当前图像块为W*H的图像块时,当前图像块中像素的横坐标的取值范围为[0,W-1],当前图像块中像素的纵坐标的取值范围为[0,H-1];相应的,所述左上参考像素的坐标为(-1,-1),所述左下参考像素的坐标为(-1,H),所述右下像素的坐标为(W,H),所述右上参考像素的坐标为(W,-1)。The upper left reference pixel, the lower left reference pixel, the upper right reference pixel, and the lower right pixel do not belong to the current image block. For example, when the current image block is an image block of W * H, the range of the abscissa of the pixel in the current image block is [0, W-1], and the range of the ordinate of the pixel in the current image block is [ 0, H-1]; correspondingly, the coordinates of the upper left reference pixel are (-1, -1), the coordinates of the lower left reference pixel are (-1, H), and the coordinates of the lower right pixel are ( W, H), and the coordinates of the upper right reference pixel are (W, -1).
其中,第一预设序号可以为1,第二预设序号可以为2。The first preset serial number may be 1 and the second preset serial number may be 2.
其中,若所述预测修正量序号为0,则确定所述预测修正量为0。Wherein, if the prediction correction amount number is 0, it is determined that the prediction correction amount is 0.
在一种实施方式中,所述第一预设修正量为预设的正整数,例如可以为8、16、32、 64等正整数。进一步地,对于不同的比特位宽,所述第一预设修正量的预设值可能也不一样,例如在8比特位宽时,所述第一预设修正量可以为10、16或20;在10比特位宽时,所述第一预设修正量可以为A1=40、64或80。In an implementation manner, the first preset correction amount is a preset positive integer, and may be, for example, a positive integer such as 8, 16, 32, or 64. Further, the preset value of the first preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the first preset correction amount may be 10, 16, or 20 ; When the width is 10 bits, the first preset correction amount may be A1 = 40, 64, or 80.
在另一种实施方式中,所述第一预设修正量也可以为与所述当前图像块的宽和高相关的变量;例如,所述第一预设修正量可以基于如下计算式计算确定:In another implementation manner, the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
A1=Clip3(B1,B2,(W+H)/2*pow(2,BD–8));A1 = Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
其中,A1表示所述第一预设修正量;B1和B2为预设正整数且B1<B2,例如B1=8、B2=16,或者B1=12、B2=20;pow(2,BD–8)表示2的BD–8次幂,BD表示比特位宽,例如BD=8或10或12;H表示所述当前图像块的高,W表示所述当前图像块的宽;Clip3(B1,B2,(W+H)/2*pow(2,BD–8))表示将(W+H)/2*pow(2,BD–8)的值限制在B1和B2之间,即若((W+H)/2*pow(2,BD–8))<B1,则(W+H)/2*pow(2,BD–8)=B1,若((W+H)/2*pow(2,BD–8))>B2,则(W+H)/2*pow(2,BD–8)=B2,若B1≤((W+H)/2*pow(2,BD–8))≤B2,则(W+H)/2*pow(2,BD–8)=(W+H)/2*pow(2,BD–8)。Among them, A1 represents the first preset correction amount; B1 and B2 are preset positive integers and B1 <B2, for example, B1 = 8, B2 = 16, or B1 = 12, B2 = 20; pow (2, BD– 8) represents the BD-8 power of 2, BD represents the bit width, such as BD = 8 or 10 or 12; H represents the height of the current image block, W represents the width of the current image block; Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)) means to limit the value of (W + H) / 2 * pow (2, BD–8) to between B1 and B2, that is, if ( (W + H) / 2 * pow (2, BD–8)) <B1, then (W + H) / 2 * pow (2, BD–8) = B1, if ((W + H) / 2 * pow (2, BD–8))> B2, then (W + H) / 2 * pow (2, BD–8) = B2, if B1≤ ((W + H) / 2 * pow (2, BD– 8)) ≤ B2, then (W + H) / 2 * pow (2, BD–8) = (W + H) / 2 * pow (2, BD–8).
方法四:Method four:
若所述预测修正量序号为第一预设序号,基于所述当前图像块的左下参考像素的值,所述当前图像块的右上参考像素的值以及所述当前图像块的左上参考像素的值获得差分值;基于所述差分值确定所述预测修正量。If the prediction correction amount serial number is a first preset serial number, based on the value of the lower left reference pixel of the current image block, the value of the upper right reference pixel of the current image block, and the value of the upper left reference pixel of the current image block Obtain a difference value; determine the predicted correction amount based on the difference value.
其中,在一种实施方式中,可以通过如下计算式计算获得所述差分值:Wherein, in one embodiment, the difference value can be obtained by calculating as follows:
D=P(W,–1)*a+P(–1,H)*(1–a)–P(–1,–1);D = P (W, –1) * a + P (–1, H) * (1–a) –P (–1, –1);
其中,D表示所述差分值,P(W,–1)表示所述当前图像块的左下参考像素的值,P(–1,H)表示所述当前图像块的右上参考像素的值,P(–1,–1)表示所述当前图像块的左上参考像素的值;0<a<1,a可以为预设值,例如为0.4,0.5,或0.6等等;a也可以为与所述当前图像块的宽和高相关的变量,例如a=H/(W+H),其中H表示所述当前图像块的高,W表示所述当前图像块的宽。Among them, D represents the difference value, P (W, –1) represents the value of the lower left reference pixel of the current image block, P (–1, H) represents the value of the upper right reference pixel of the current image block, P (–1, –1) represents the value of the upper left reference pixel of the current image block; 0 <a <1, a can be a preset value, such as 0.4, 0.5, or 0.6, etc .; a can also be the same as all The width and height related variables of the current image block are described, for example, a = H / (W + H), where H represents the height of the current image block and W represents the width of the current image block.
在一种实施方式中,所述基于所述差分值确定所述预测修正量包括:In an implementation manner, the determining the prediction correction amount based on the difference value includes:
基于如下计算式计算确定所述预测修正量:The prediction correction amount is determined based on the following calculation formula:
M=Clip3(sign(D)*B3,sign(D)*B4,D);M = Clip3 (sign (D) * B3, sign (D) * B4, D);
其中,M表示所述预测修正量,D表示所述差分值。sign(D)表示取所述差分值的符号,其中,如果D≥0,sign(D)=1;如果D<0,sign(D)=–1。B3为预设正整数,B4为预设正整数,B3<B4。Clip3(sign(D)*B3,sign(D)*B4,D)表示将D的值限制在sign(D)*B3与sign(D)*B4之间;例如,在sign(D)=1时,如果D<sign(D)*B3,则D=sign(D)*B3,如果D>sign(D)*B4,则D=sign(D)*B4,如果sign(D)*B3≤D≤sign(D)*B4,则D=D;例如,在sign(D)=-1时,如果D<sign(D)*B4,则D=sign(D)*B4,如果D>sign(D)*B3,则D=sign(D)*B3,如果sign(D)*B4≤D≤sign(D)*B3,则D=D。Wherein, M represents the predicted correction amount, and D represents the difference value. sign (D) represents the sign of the difference value, where if D ≧ 0, sign (D) = 1; if D <0, sign (D) = − 1. B3 is a preset positive integer, B4 is a preset positive integer, and B3 <B4. Clip3 (sign (D) * B3, sign (D) * B4, D) means to limit the value of D between sign (D) * B3 and sign (D) * B4; for example, at sign (D) = 1 If D <sign (D) * B3, then D = sign (D) * B3, if D> sign (D) * B4, then D = sign (D) * B4, if sign (D) * B3≤ D≤sign (D) * B4, then D = D; for example, when sign (D) =-1, if D <sign (D) * B4, then D = sign (D) * B4, if D> sign (D) * B3, then D = sign (D) * B3, if sign (D) * B4≤D≤sign (D) * B3, then D = D.
403、基于所述预测修正量获得所述当前图像块的预测图像。403. Obtain a predicted image of the current image block based on the predicted correction amount.
该步骤可以由解码器200中的帧内预测器209来执行,所述预测图像可以为图2B中的预测块。This step may be performed by an intra predictor 209 in the decoder 200, and the predicted image may be a predicted block in FIG. 2B.
具体地,所述基于所述预测修正量获得所述当前图像块的预测图像可以包括如下步骤:Specifically, obtaining the predicted image of the current image block based on the prediction correction amount may include the following steps:
步骤1、将左下参考像素P(–1,H)和右上参考像素P(W,–1)加权平均,得到当前图像块右下像素的第一预测值P1(W,H);将修正量M和第一预测值P1(W,H)相加,得到右下像素的第二预测值P2(W,H)。 Step 1. Weighted average the lower left reference pixel P (–1, H) and the upper right reference pixel P (W, –1) to obtain the first predicted value P1 (W, H) of the lower right pixel of the current image block; M is added to the first prediction value P1 (W, H) to obtain a second prediction value P2 (W, H) of the lower right pixel.
其中,得到当前图像块右下像素的第一预测值P1(W,H)可以采用现有技术描述的方案。Wherein, to obtain the first prediction value P1 (W, H) of the lower right pixel of the current image block, a solution described in the prior art may be adopted.
步骤2、由右下像素的第二预测值P2(W,H)和左下参考像素P(–1,H)加权平均得到预测像素P(x,y)下侧像素的预测值P(x,H);由右下像素的第二预测值P2(W,H)和右上参考像素P(W,–1)加权平均得到预测像素P(x,y)右侧像素的预测值P(W,y)。Step 2: A weighted average of the second predicted value P2 (W, H) of the lower right pixel and the lower left reference pixel P (-1, H) to obtain the predicted value P (x, y) of the lower pixel of the predicted pixel P (x, y). H); weighted average of the second predicted value P2 (W, H) of the lower right pixel and the upper right reference pixel P (W, –1) to obtain the predicted value P (W, of the right pixel of the predicted pixel P (x, y) y).
步骤3、由P(x,H)和P(x,–1)加权平均得到P(x,y)的竖直预测值Pv(x,y);由P(W,y)和P(–1,y)加权平均得到P(x,y)的水平预测值Ph(x,y);将Ph(x,y)和Pv(x,y)加权平均,得到坐标为(x,y)的像素的预测值P(x,y)。Step 3. Weighted average of P (x, H) and P (x, –1) to obtain the vertical prediction value Pv (x, y) of P (x, y); from P (W, y) and P (- 1, y) weighted average to get the level prediction value Ph (x, y) of P (x, y); weighted average of Ph (x, y) and Pv (x, y) to get the coordinates of (x, y) The pixel's predicted value P (x, y).
重复执行步骤2-3就可以获得所述当前图像块中所有像素的预测值,从而得到预测图像。By repeatedly performing steps 2-3, the predicted values of all pixels in the current image block can be obtained, so as to obtain a predicted image.
404、基于所述当前图像块的预测图像和所述当前图像块的预测残差,获得所述当前图像块的重建图像。404. Obtain a reconstructed image of the current image block based on the predicted image of the current image block and the prediction residual of the current image block.
该步骤可以由解码器200中的求和器211来执行,所述当前图像块的预测残差可以为图2B中的残差块。This step may be performed by the summer 211 in the decoder 200, and the prediction residual of the current image block may be a residual block in FIG. 2B.
具体地,可以所述当前图像块的预测图像和所述当前图像块的预测残差相加,得到当前图像块的重建图像。Specifically, the prediction image of the current image block and the prediction residual of the current image block may be added to obtain a reconstructed image of the current image block.
在另一个实施方式中,在基于所述当前图像块的右下像素的预测值的修正值获得所述当前图像块的预测图像前,图4所描述的方法还可以包括:In another embodiment, before the prediction image of the current image block is obtained based on the correction value of the prediction value of the lower right pixel of the current image block, the method described in FIG. 4 may further include:
将所述当前图像块的右下像素的预测值的修正值限制在预设的取值范围内,所述预设的取值范围为[0,pow(2,N)–1],其中pow(2,N)表示2的N次幂,N表示比特位宽。Limiting the correction value of the prediction value of the lower right pixel of the current image block to a preset value range, the preset value range is [0, pow (2, N) –1], where pow (2, N) represents the Nth power of 2, and N represents the bit width.
例如,如果当前图像块的右下像素的预测值的修正值小于0,则将当前图像块的右下像素的预测值修正为0,即当前图像块的右下像素的预测值的修正值为0;如果当前图像块的右下像素的预测值的修正值大于,则将当前图像块的右下像素的预测值修正为pow(2,N)–1,即当前图像块的右下像素的预测值的修正值为pow(2,N)–1;如果当前图像块的右下像素的预测值的修正值大于或等于0,且小于或等于pow(2,N)–1,则不需要对当前图像块的右下像素的预测值进行修正,即所述当前图像块的右下像素的预测值的修正值为所述当前图像块的右下像素的预测值。For example, if the correction value of the prediction value of the lower right pixel of the current image block is less than 0, the prediction value of the lower right pixel of the current image block is corrected to 0, that is, the correction value of the prediction value of the lower right pixel of the current image block is 0; if the correction value of the prediction value of the bottom right pixel of the current image block is greater than, the prediction value of the bottom right pixel of the current image block is modified to pow (2, N) -1, that is, the The correction value of the predicted value is pow (2, N) –1; if the correction value of the predicted value of the lower right pixel of the current image block is greater than or equal to 0 and less than or equal to pow (2, N) –1, then it is not required Correct the predicted value of the lower right pixel of the current image block, that is, the predicted value of the lower right pixel of the current image block is the predicted value of the lower right pixel of the current image block.
图5描述了本发明一个实施例提供的图像块解码装置的结构,如图5所示,该图像块解码装置包括:FIG. 5 illustrates a structure of an image block decoding apparatus according to an embodiment of the present invention. As shown in FIG. 5, the image block decoding apparatus includes:
熵解码器501,用于解析码流以获取待解码当前图像块的预测残差,预测模式以及预测参考信息;其中,在所述预测模式为平面预测模式时,所述预测参考信息包括预测修正量序号。其中,熵解码器501具体可以是图2B中的熵解码器203。 Entropy decoder 501 is configured to parse a bitstream to obtain prediction residuals, prediction modes, and prediction reference information of a current image block to be decoded; wherein when the prediction mode is a planar prediction mode, the prediction reference information includes prediction correction Quantity serial number. The entropy decoder 501 may specifically be the entropy decoder 203 in FIG. 2B.
帧内预测器502,用于在所述当前图像块的预测模式为平面预测模式时,基于所述预测修正量序号确定预测修正量;基于所述预测修正量获得所述当前图像块的预测图像。其 中,帧内预测器502具体可以是图2B中的帧内预测器209。The intra predictor 502 is configured to determine a prediction correction amount based on the prediction correction amount number when the prediction mode of the current image block is a flat prediction mode; and obtain a prediction image of the current image block based on the prediction correction amount. . Among them, the intra predictor 502 may specifically be the intra predictor 209 in FIG. 2B.
重建单元503,用于基于所述当前图像块的预测图像和所述当前图像块的预测残差,获得所述当前图像块的重建图像。其中,重建单元503具体可以是图2B中的求和器211。A reconstruction unit 503 is configured to obtain a reconstructed image of the current image block based on the predicted image of the current image block and the prediction residual of the current image block. The reconstruction unit 503 may specifically be the summer 211 in FIG. 2B.
在一种实施方式中,所述帧内预测器502可以具体用于:若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;或若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量。In an implementation manner, the intra predictor 502 may be specifically configured to: if the prediction correction amount number is a first preset number, determine the prediction correction amount as a first preset correction amount; or If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a second preset correction amount.
其中,所述第一预设修正量与所述第二预设修正量互为相反数。The first preset correction amount and the second preset correction amount are opposite numbers to each other.
其中,第一预设序号可以为1,第二预设序号可以为2。The first preset serial number may be 1 and the second preset serial number may be 2.
其中,若所述预测修正量序号为0,则确定所述预测修正量为0。Wherein, if the prediction correction amount number is 0, it is determined that the prediction correction amount is 0.
在一种实施方式中,所述第一预设修正量为预设的正整数,例如可以为8、16、32、64等正整数。进一步地,对于不同的比特位宽,所述第一预设修正量的预设值可能也不一样,例如在8比特位宽时,所述第一预设修正量可以为10、16或20;在10比特位宽时,所述第一预设修正量可以为A1=40、64或80。In an implementation manner, the first preset correction amount is a preset positive integer, and may be, for example, a positive integer such as 8, 16, 32, or 64. Further, the preset value of the first preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the first preset correction amount may be 10, 16, or 20 ; When the width is 10 bits, the first preset correction amount may be A1 = 40, 64, or 80.
在另一种实施方式中,所述第一预设修正量也可以为与所述当前图像块的宽和高相关的变量;例如,所述第一预设修正量可以基于如下计算式计算确定:In another implementation manner, the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
A1=Clip3(B1,B2,(W+H)/2*pow(2,BD–8));A1 = Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
其中,A1表示所述第一预设修正量;B1和B2为预设正整数且B1<B2,例如B1=8、B2=16,或者B1=12、B2=20;pow(2,BD–8)表示2的BD–8次幂,BD表示比特位宽,例如BD=8或10或12;H表示所述当前图像块的高,W表示所述当前图像块的宽;Clip3(B1,B2,(W+H)/2*pow(2,BD–8))表示将(W+H)/2*pow(2,BD–8)的值限制在B1和B2之间,即若((W+H)/2*pow(2,BD–8))<B1,则(W+H)/2*pow(2,BD–8)=B1,若((W+H)/2*pow(2,BD–8))>B2,则(W+H)/2*pow(2,BD–8)=B2,若B1≤((W+H)/2*pow(2,BD–8))≤B2,则(W+H)/2*pow(2,BD–8)=(W+H)/2*pow(2,BD–8)。Among them, A1 represents the first preset correction amount; B1 and B2 are preset positive integers and B1 <B2, for example, B1 = 8, B2 = 16, or B1 = 12, B2 = 20; pow (2, BD– 8) represents the BD-8 power of 2, BD represents the bit width, such as BD = 8 or 10 or 12; H represents the height of the current image block, W represents the width of the current image block; Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)) means to limit the value of (W + H) / 2 * pow (2, BD–8) to between B1 and B2, that is, if ( (W + H) / 2 * pow (2, BD–8)) <B1, then (W + H) / 2 * pow (2, BD–8) = B1, if ((W + H) / 2 * pow (2, BD–8))> B2, then (W + H) / 2 * pow (2, BD–8) = B2, if B1≤ ((W + H) / 2 * pow (2, BD– 8)) ≤ B2, then (W + H) / 2 * pow (2, BD–8) = (W + H) / 2 * pow (2, BD–8).
在一种实施方式中,所述帧内预测器502还可以具体用于:若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第三预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第四预设修正量;若所述预测修正量序号为第三预设序号,则确定所述预测修正量为第五预设修正量;或者若所述预测修正量序号为第四预设序号,则确定所述预测修正量为第六预设修正量。In an implementation manner, the intra predictor 502 may be further specifically configured to: if the prediction correction amount is a first preset number, determine that the prediction correction amount is a third preset correction amount; if If the predicted correction amount number is a second preset number, it is determined that the predicted correction amount is a fourth preset number; if the predicted correction amount is a third preset number, it is determined that the predicted correction amount is A fifth preset correction amount; or if the predicted correction amount number is a fourth preset number, determining that the predicted correction amount is a sixth preset correction amount.
其中,所述第三预设修正量与所述第四预设修正量互为相反数;且所述第五预设修正量与所述第六预设修正量互为相反数。The third preset correction amount and the fourth preset correction amount are opposite numbers to each other; and the fifth preset correction amount and the sixth preset correction amount are opposite numbers to each other.
其中,若所述预测修正量序号为0,则确定所述预测修正量为0。Wherein, if the prediction correction amount number is 0, it is determined that the prediction correction amount is 0.
其中,第一预设序号可以为1,第二预设序号可以为2,第三预设序号可以为3,第四预设序号可以为4。The first preset serial number can be 1, the second preset serial number can be 2, the third preset serial number can be 3, and the fourth preset serial number can be 4.
其中,第三预设修正量和第五预设修正量为预设正整数,且第五预设修正量大于第三预设修正量,例如第五预设修正量可以为第三预设修正量的1.75倍,或2倍,或2.25倍。The third preset correction amount and the fifth preset correction amount are preset positive integers, and the fifth preset correction amount is greater than the third preset correction amount. For example, the fifth preset correction amount may be the third preset correction amount. The amount is 1.75 times, or 2 times, or 2.25 times.
其中,所述第三预设修正量可以为8、16、32、或64等正整数。进一步地,对于不同的比特位宽,所述第三预设修正量的预设值可能也不一样,例如在8比特位宽时,所述第 三预设修正量可以为10、16或20等等;在10比特位宽时,所述第三预设修正量可以为A1=40、64或80等等。The third preset correction amount may be a positive integer such as 8, 16, 32, or 64. Further, the preset value of the third preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the third preset correction amount may be 10, 16, or 20 And so on; when the width is 10 bits, the third preset correction amount may be A1 = 40, 64, 80, and so on.
在一种实施方式中,所述帧内预测器502还可以具体用于:In an implementation manner, the intra predictor 502 may be further specifically configured to:
将所述当前图像块的左下参考像素的值与所述当前图像块的右上参考像素的值进行加权平均,获得加权平均值;Performing a weighted average of the value of the lower left reference pixel of the current image block and the value of the upper right reference pixel of the current image block to obtain a weighted average;
在所述加权平均值小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量;或者When the weighted average value is less than the value of the upper left reference pixel of the current image block, if the predicted correction amount number is a first preset number, determining the predicted correction amount as a first preset correction amount; if If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a second preset correction amount; or
在所述加权平均值不小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第二预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第一预设修正量。When the weighted average value is not less than the value of the upper left reference pixel of the current image block, if the prediction correction amount is a first preset number, determining that the prediction correction amount is a second preset correction amount; If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a first preset correction amount.
其中,所述第一预设修正量与所述第二预设修正量互为相反数。The first preset correction amount and the second preset correction amount are opposite numbers to each other.
其中,所述加权平均值具体可以为所述当前图像块的右下像素的预测值,例如可以通过如下计算式获得:The weighted average value may specifically be a predicted value of a lower right pixel of the current image block, and may be obtained by, for example, the following calculation formula:
P1(W,H)=P(W,–1)*a+P(–1,H)*(1–a);P1 (W, H) = P (W, –1) * a + P (–1, H) * (1–a);
其中,P1(W,H)表示所述右下像素的预测值,P(W,–1)表示所述右上参考像素的值,P(–1,H)表示所述左下参考像素的值;0<a<1,a可以为预设值,例如为0.4,0.5,或0.6等等;a也可以为与所述当前图像块的宽和高相关的变量,例如a=H/(W+H),其中H表示所述当前图像块的高,W表示所述当前图像块的宽。Wherein, P1 (W, H) represents the predicted value of the lower right pixel, P (W, –1) represents the value of the upper right reference pixel, and P (–1, H) represents the value of the lower left reference pixel; 0 <a <1, a can be a preset value, such as 0.4, 0.5, or 0.6, etc .; a can also be a variable related to the width and height of the current image block, such as a = H / (W + H), where H represents the height of the current image block, and W represents the width of the current image block.
其中,所述左上参考像素,左下参考像素,所述右上参考像素和所述右下像素均不属于所述当前图像块。例如,在当前图像块为W*H的图像块时,当前图像块中像素的横坐标的取值范围为[0,W-1],当前图像块中像素的纵坐标的取值范围为[0,H-1];相应的,所述左上参考像素的坐标为(-1,-1),所述左下参考像素的坐标为(-1,H),所述右下像素的坐标为(W,H),所述右上参考像素的坐标为(W,-1)。The upper left reference pixel, the lower left reference pixel, the upper right reference pixel, and the lower right pixel do not belong to the current image block. For example, when the current image block is an image block of W * H, the range of the abscissa of the pixel in the current image block is [0, W-1], and the range of the ordinate of the pixel in the current image block is [ 0, H-1]; correspondingly, the coordinates of the upper left reference pixel are (-1, -1), the coordinates of the lower left reference pixel are (-1, H), and the coordinates of the lower right pixel are ( W, H), and the coordinates of the upper right reference pixel are (W, -1).
其中,第一预设序号可以为1,第二预设序号可以为2。The first preset serial number may be 1 and the second preset serial number may be 2.
其中,若所述预测修正量序号为0,则确定所述预测修正量为0。Wherein, if the prediction correction amount number is 0, it is determined that the prediction correction amount is 0.
在一种实施方式中,所述第一预设修正量为预设的正整数,例如可以为8、16、32、64等正整数。进一步地,对于不同的比特位宽,所述第一预设修正量的预设值可能也不一样,例如在8比特位宽时,所述第一预设修正量可以为10、16或20;在10比特位宽时,所述第一预设修正量可以为A1=40、64或80。In an implementation manner, the first preset correction amount is a preset positive integer, and may be, for example, a positive integer such as 8, 16, 32, or 64. Further, the preset value of the first preset correction amount may be different for different bit widths. For example, when the bit width is 8 bits, the first preset correction amount may be 10, 16, or 20 ; When the width is 10 bits, the first preset correction amount may be A1 = 40, 64, or 80.
在另一种实施方式中,所述第一预设修正量也可以为与所述当前图像块的宽和高相关的变量;例如,所述第一预设修正量可以基于如下计算式计算确定:In another implementation manner, the first preset correction amount may also be a variable related to the width and height of the current image block; for example, the first preset correction amount may be determined based on the following calculation formula. :
A1=Clip3(B1,B2,(W+H)/2*pow(2,BD–8));A1 = Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8));
其中,A1表示所述第一预设修正量;B1和B2为预设正整数且B1<B2,例如B1=8、B2=16,或者B1=12、B2=20;pow(2,BD–8)表示2的BD–8次幂,BD表示比特位宽,例如BD=8或10或12;H表示所述当前图像块的高,W表示所述当前图像块的宽;Clip3(B1,B2,(W+H)/2*pow(2,BD–8))表示将(W+H)/2*pow(2,BD–8)的值限制在B1和B2之 间,即若((W+H)/2*pow(2,BD–8))<B1,则(W+H)/2*pow(2,BD–8)=B1,若((W+H)/2*pow(2,BD–8))>B2,则(W+H)/2*pow(2,BD–8)=B2,若B1≤((W+H)/2*pow(2,BD–8))≤B2,则(W+H)/2*pow(2,BD–8)=(W+H)/2*pow(2,BD–8)。Among them, A1 represents the first preset correction amount; B1 and B2 are preset positive integers and B1 <B2, for example, B1 = 8, B2 = 16, or B1 = 12, B2 = 20; pow (2, BD– 8) represents the BD-8 power of 2, BD represents the bit width, such as BD = 8 or 10 or 12; H represents the height of the current image block, W represents the width of the current image block; Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)) means to limit the value of (W + H) / 2 * pow (2, BD–8) to between B1 and B2, that is, if ( (W + H) / 2 * pow (2, BD–8)) <B1, then (W + H) / 2 * pow (2, BD–8) = B1, if ((W + H) / 2 * pow (2, BD–8))> B2, then (W + H) / 2 * pow (2, BD–8) = B2, if B1≤ ((W + H) / 2 * pow (2, BD– 8)) ≤ B2, then (W + H) / 2 * pow (2, BD–8) = (W + H) / 2 * pow (2, BD–8).
在一种实施方式中,所述帧内预测器还可以具体用于:若所述预测修正量序号为第一预设序号,基于所述当前图像块的左下参考像素的值,所述当前图像块的右上参考像素的值以及所述当前图像块的左上参考像素的值获得差分值;基于所述差分值确定所述预测修正量。In an implementation manner, the intra predictor may be further specifically configured to: if the prediction correction amount sequence number is a first preset sequence number, based on a value of a lower left reference pixel of the current image block, the current image A value of the upper right reference pixel of the block and a value of the upper left reference pixel of the current image block are used to obtain a difference value; and the prediction correction amount is determined based on the difference value.
在另一种实施方式中,所述帧内预测器可以具体用于通过如下计算式计算获得所述差分值:In another implementation manner, the intra predictor may be specifically configured to obtain the difference value by calculating as follows:
D=P(W,–1)*a+P(–1,H)*(1–a)–P(–1,–1);D = P (W, –1) * a + P (–1, H) * (1–a) –P (–1, –1);
其中,D表示所述差分值,P(W,–1)表示所述当前图像块的左下参考像素的值,P(–1,H)表示所述当前图像块的右上参考像素的值,P(–1,–1)表示所述当前图像块的左上参考像素的值;0<a<1,a可以为预设值,例如为0.4,0.5,或0.6等等;a也可以为与所述当前图像块的宽和高相关的变量,例如a=H/(W+H),其中H表示所述当前图像块的高,W表示所述当前图像块的宽。Among them, D represents the difference value, P (W, –1) represents the value of the lower left reference pixel of the current image block, P (–1, H) represents the value of the upper right reference pixel of the current image block, P (–1, –1) represents the value of the upper left reference pixel of the current image block; 0 <a <1, a can be a preset value, such as 0.4, 0.5, or 0.6, etc .; a can also be the same as all The width and height related variables of the current image block are described, for example, a = H / (W + H), where H represents the height of the current image block and W represents the width of the current image block.
在另一种实施方式中,所述帧内预测器502可以具体用于:In another implementation manner, the intra predictor 502 may be specifically configured to:
基于如下计算式计算确定所述预测修正量:The prediction correction amount is determined based on the following calculation formula:
M=Clip3(sign(D)*B3,sign(D)*B4,D);M = Clip3 (sign (D) * B3, sign (D) * B4, D);
其中,M表示所述预测修正量,D表示所述差分值,sign(D)表示取所述差分值的符号,其中,如果D≥0,sign(D)=1;如果D<0,sign(D)=–1。B3为预设正整数,B4为预设正整数,B3<B4,Clip3(sign(D)*B3,sign(D)*B4,D)表示将D的值限制在sign(D)*B3与sign(D)*B4之间;例如,在sign(D)=1时,如果D<sign(D)*B3,则D=sign(D)*B3,如果D>sign(D)*B4,则D=sign(D)*B4,如果sign(D)*B3≤D≤sign(D)*B4,则D=D;例如,在sign(D)=-1时,如果D<sign(D)*B4,则D=sign(D)*B4,如果D>sign(D)*B3,则D=sign(D)*B3,如果sign(D)*B4≤D≤sign(D)*B3,则D=D。Among them, M represents the predicted correction amount, D represents the difference value, and sign (D) represents the sign of taking the difference value, where if D≥0, sign (D) = 1; if D <0, sign (D) = -1. B3 is a preset positive integer, B4 is a preset positive integer, B3 <B4, Clip3 (sign (D) * B3, sign (D) * B4, D) means to limit the value of D to sign (D) * B3 and sign (D) * B4; for example, when sign (D) = 1, if D <sign (D) * B3, then D = sign (D) * B3, if D> sign (D) * B4, Then D = sign (D) * B4, if sign (D) * B3≤D≤sign (D) * B4, then D = D; for example, when sign (D) =-1, if D <sign (D ) * B4, then D = sign (D) * B4, if D> sign (D) * B3, then D = sign (D) * B3, if sign (D) * B4≤D≤sign (D) * B3 , Then D = D.
在一种实施方式中,所述帧内预测器502还可以具体用于:基于所述预测修正量对所述当前图像块的右下像素的预测值进行修正;基于所述当前图像块的右下像素的预测值的修正值获得所述当前图像块的预测图像。In an implementation manner, the intra predictor 502 may be further specifically configured to: modify the prediction value of the lower right pixel of the current image block based on the prediction correction amount; based on the right of the current image block The correction value of the prediction value of the lower pixel obtains the prediction image of the current image block.
在一种实施方式中,所述帧内预测器502还可以具体还用于:将所述当前图像块的右下像素的预测值的修正值限制在预设的取值范围内,所述预设的取值范围为[0,pow(2,N)–1],其中pow(2,N)表示2的N次幂,N表示比特位宽;基于限制在所述预设的取值范围内的所述当前图像块的右下像素的预测值的修正值获得所述当前图像块的预测图像。In an implementation manner, the intra predictor 502 may be further specifically configured to: limit the correction value of the prediction value of the lower right pixel of the current image block to a preset value range, and the prediction The value range is set to [0, pow (2, N) –1], where pow (2, N) represents the Nth power of 2 and N represents the bit width; based on being limited to the preset value range A correction value of a prediction value of a lower right pixel of the current image block is used to obtain a prediction image of the current image block.
例如,如果当前图像块的右下像素的预测值的修正值小于0,则将当前图像块的右下像素的预测值修正为0,即当前图像块的右下像素的预测值的修正值为0;如果当前图像块的右下像素的预测值的修正值大于,则将当前图像块的右下像素的预测值修正为pow(2,N)–1,即当前图像块的右下像素的预测值的修正值为pow(2,N)–1;如果当前图像块的右下像素的预测值的修正值大于或等于0,且小于或等于pow(2,N)–1,则不需要对当前图像块 的右下像素的预测值进行修正,即所述当前图像块的右下像素的预测值的修正值为所述当前图像块的右下像素的预测值。For example, if the correction value of the prediction value of the lower right pixel of the current image block is less than 0, the prediction value of the lower right pixel of the current image block is corrected to 0, that is, the correction value of the prediction value of the lower right pixel of the current image block is 0; if the correction value of the prediction value of the bottom right pixel of the current image block is greater than, the prediction value of the bottom right pixel of the current image block is modified to pow (2, N) -1, that is, the The correction value of the predicted value is pow (2, N) –1; if the correction value of the predicted value of the lower right pixel of the current image block is greater than or equal to 0 and less than or equal to pow (2, N) –1, then it is not required Correct the predicted value of the lower right pixel of the current image block, that is, the predicted value of the lower right pixel of the current image block is the predicted value of the lower right pixel of the current image block.
本发明另一个实施例提供了一种图像块解码方法。当前图像块为一个CU的亮度图像块,也可以是一个CU的色度图像块。当前图像块使用平面预测模式。使用所述平面预测方法对当前图像块进行解码的处理,包括以下步骤:Another embodiment of the present invention provides a method for decoding an image block. The current image block is a CU luma image block, and may also be a CU chroma image block. The current image block uses a planar prediction mode. The process of decoding the current image block by using the plane prediction method includes the following steps:
步骤1:从码流中解析当前图像块的预测修正量序号Idx,并根据序号得到修正量M。所述预测修正量序号Idx为0表示修正量M为0,序号大于0表示修正量M不为零。当修正量M不为零时,它的导出方法可采用以下方法中的一种。Step 1: Parse the predicted correction amount number Idx of the current image block from the code stream, and obtain the correction amount M according to the number. The predicted correction amount serial number Idx is 0, which indicates that the correction amount M is 0, and the serial number greater than 0 indicates that the correction amount M is not zero. When the correction amount M is not zero, its derivation method may adopt one of the following methods.
方法一:当预测修正量序号Idx为1时,修正量M为第一预设值A1;当Idx为2时,修正量M为–A1。所述A1为正整数,例如为8、16、32、64等正整数,例如对于8比特位宽的预测信号,A1=10、16或20,对于10比特位宽的预测信号A1=40、64或80。Method 1: When the predicted correction amount number Idx is 1, the correction amount M is the first preset value A1; when Idx is 2, the correction amount M is -A1. The A1 is a positive integer, for example, a positive integer such as 8, 16, 32, 64, for example, for an 8-bit wide prediction signal, A1 = 10, 16 or 20, and for a 10-bit wide prediction signal A1 = 40, 64 or 80.
A1也可以为与当前块的宽和高相关的变量,例如:A1 can also be a variable related to the width and height of the current block, for example:
A1=Clip3(B1,B2,(W+H)/2*pow(2,BD–8)),A1 = Clip3 (B1, B2, (W + H) / 2 * pow (2, BD–8)),
其中,Clip3(min,max,val)表示将val限制在min和max之间;pow(a,b)表示a的b次幂;BD表示预测信号的位宽(bit depth),例如BD=8或10或12;B1和B2为预设正常数,如B1=8、B2=16,或者B1=12、B2=20。Among them, Clip3 (min, max, val) indicates that val is limited to between min and max; pow (a, b) indicates the power of b of a; BD indicates the bit depth of the predicted signal, for example, BD = 8 Or 10 or 12; B1 and B2 are preset normal numbers, such as B1 = 8, B2 = 16, or B1 = 12, B2 = 20.
方法二:当预测修正量序号Idx为1时,修正量M为第二预设值A2;当Idx为2时,修正量M为–A2;当Idx为3时,修正量M为第三预设值A3;当Idx为4时,修正量M为–A3。其中,A3>A2,如A3=2*A2,或者A3=1.75*A2。Method 2: When the predicted correction amount serial number Idx is 1, the correction amount M is the second preset value A2; when Idx is 2, the correction amount M is -A2; when Idx is 3, the correction amount M is the third preset value. Set the value A3; when Idx is 4, the correction amount M is -A3. Among them, A3> A2, such as A3 = 2 * A2, or A3 = 1.75 * A2.
方法三:将左下参考像素P(–1,H)和右上参考像素P(W,–1)加权平均,得到当前图像块右下角像素的第一预测值P1(W,H)。如果第一预测值P1(W,H)小于左上角参考像素P(–1,–1)的值,当预测修正量序号Idx为1时,修正量M为第一预设值A1;当Idx为2时,修正量M为–A1;如果第一预测值P1(W,H)大于等于左上角参考像素P(–1,–1)的值,当预测修正量序号Idx为1时,修正量M为第一预设值–A1;当Idx为2时,修正量M为A1。Method 3: Weight the average of the lower left reference pixel P (–1, H) and the upper right reference pixel P (W, –1) to obtain the first predicted value P1 (W, H) of the lower right pixel of the current image block. If the first predicted value P1 (W, H) is smaller than the value of the upper left reference pixel P (–1, –1), when the predicted correction amount number Idx is 1, the correction amount M is the first preset value A1; when Idx When it is 2, the correction amount M is –A1; if the first predicted value P1 (W, H) is greater than or equal to the value of the upper left reference pixel P (–1, –1), when the predicted correction amount number Idx is 1, the correction amount is corrected. The amount M is the first preset value -A1; when Idx is 2, the correction amount M is A1.
方法四:将左下参考像素P(–1,H)和右上参考像素P(W,–1)加权平均并减去左上参考像素P(–1,–1),得到差分值D,即D=P(W,–1)*a+P(–1,H)*(1–a)–P(–1,–1),其中a为预设常数,如a=0.5,或者a=H/(W+H)。当预测修正量序号Idx为1时,修正量M为Clip3(sign(D)*B3,sign(D)*B4,D),其中B3和B4为预设正常数,如B3=8、B4=16,或者B3=32、B4=64;sign(D)表示取D的符号,即D≥0,sign(D)=1;D<0,sign(D)=–1。Method 4: Weight the average of the lower left reference pixel P (–1, H) and the upper right reference pixel P (W, –1) and subtract the upper left reference pixel P (–1, –1) to obtain the difference value D, that is, D = P (W, –1) * a + P (–1, H) * (1–a) –P (–1, –1), where a is a preset constant, such as a = 0.5, or a = H / (W + H). When the predicted correction number Idx is 1, the correction amount M is Clip3 (sign (D) * B3, sign (D) * B4, D), where B3 and B4 are preset normal numbers, such as B3 = 8, B4 = 16, or B3 = 32, B4 = 64; sign (D) means to take the sign of D, that is, D≥0, sign (D) = 1; D <0, sign (D) =-1.
步骤2:将左下参考像素P(–1,H)和右上参考像素P(W,–1)加权平均,得到当前图像块右下角像素的第一预测值P1(W,H);将修正量M和第一预测值P1(W,H)相加,得到右下角像素的第二预测值P2(W,H)。Step 2: Weighted average the lower left reference pixel P (–1, H) and the upper right reference pixel P (W, –1) to obtain the first predicted value P1 (W, H) of the lower right pixel of the current image block; M is added to the first prediction value P1 (W, H) to obtain a second prediction value P2 (W, H) of the pixel in the lower right corner.
需要说明的是,步骤2还可以包括:将第二预测值P2(W,H)限制在预测信号的取值范围内,如N比特位宽的预测信号的取值范围为[0,pow(2,N)–1]。It should be noted that step 2 may further include: limiting the second prediction value P2 (W, H) to the value range of the prediction signal, for example, the value range of the N-bit wide prediction signal is [0, pow ( 2, N) –1].
其中,将左下参考像素和右上参考像素加权平均,得到当前图像块右下角像素的第一预测值P1(W,H)为现有技术,如使用JVET–E0068(现有技术二)中的方法。The weighted average of the lower left reference pixel and the upper right reference pixel to obtain the first prediction value P1 (W, H) of the lower right corner pixel of the current image block is the prior art, such as using the method in JVET-E0068 (the second prior art). .
步骤3:由右下角像素的第二预测值P2(W,H)和左下参考像素P(–1,H)加权平均得到预 测像素P(x,y)下侧像素的预测值P(x,H);由右下角像素的第二预测值P2(W,H)和右上参考像素P(W,–1)加权平均得到预测像素P(x,y)右侧像素的预测值P(W,y)。Step 3: The weighted average of the second predicted value P2 (W, H) of the lower right pixel and the lower left reference pixel P (–1, H) to obtain the predicted value P (x, y) of the lower pixel of the predicted pixel P (x, y). H); weighted average of the second predicted value P2 (W, H) of the lower right pixel and the upper right reference pixel P (W, –1) to obtain the predicted value P (W, of the right pixel of the predicted pixel P (x, y) y).
此步骤为现有技术,如使用JVET–E0068(现有技术二)中的方法。This step is the prior art, such as using the method in JVET-E0068 (the second prior art).
步骤4:由P(x,H)和P(x,–1)加权平均得到P(x,y)的竖直预测值Pv(x,y);由P(W,y)和P(–1,y)加权平均得到P(x,y)的水平预测值Ph(x,y);将Ph(x,y)和Pv(x,y)加权平均,得到坐标为(x,y)的像素的预测值P(x,y)。Step 4: The weighted average of P (x, H) and P (x, –1) to obtain the vertical prediction value Pv (x, y) of P (x, y); P (W, y) and P (– 1, y) weighted average to get the level prediction value Ph (x, y) of P (x, y); weighted average of Ph (x, y) and Pv (x, y) to get the coordinates of (x, y) The pixel's predicted value P (x, y).
此步骤为现有技术,如使用JVET–E0068(现有技术二)中的方法。This step is the prior art, such as using the method in JVET-E0068 (the second prior art).
步骤5:将当前图像块的预测图像与当前图像块的残差相加,得到当前图像块的重建图像。Step 5: Add the predicted image of the current image block and the residual of the current image block to obtain a reconstructed image of the current image block.
此步骤为现有技术,如使用H.265中的方法。This step is prior art, such as using the method in H.265.
图6为本申请实施例的编码设备或解码设备(简称为译码设备1200)的一种实现方式的示意性框图。其中,译码设备1200可以包括处理器1210、存储器1230和总线系统1250。其中,处理器和存储器通过总线系统相连,该存储器用于存储指令,该处理器用于执行该存储器存储的指令。编码设备的存储器存储程序代码,且处理器可以调用存储器中存储的程序代码执行本申请描述的各种视频编码或解码方法,尤其是在各种新的帧间预测模式下的视频编码或解码方法,以及在各种新的帧间预测模式下预测运动信息的方法。为避免重复,这里不再详细描述。FIG. 6 is a schematic block diagram of an implementation manner of an encoding device or a decoding device (referred to as a decoding device 1200) according to an embodiment of the present application. The decoding device 1200 may include a processor 1210, a memory 1230, and a bus system 1250. The processor and the memory are connected through a bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory. The memory of the encoding device stores program code, and the processor can call the program code stored in the memory to perform various video encoding or decoding methods described in this application, especially the video encoding or decoding methods in various new inter prediction modes. , And methods for predicting motion information in various new inter prediction modes. To avoid repetition, it will not be described in detail here.
在本申请实施例中,该处理器1210可以是中央处理单元(Central Processing Unit,简称为“CPU”),该处理器1210还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。In the embodiment of the present application, the processor 1210 may be a Central Processing Unit (“CPU”), and the processor 1210 may also be another general-purpose processor, digital signal processor (DSP), or special-purpose integration. Circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
该存储器1230可以包括只读存储器(ROM)设备或者随机存取存储器(RAM)设备。任何其他适宜类型的存储设备也可以用作存储器1230。存储器1230可以包括由处理器1210使用总线1250访问的代码和数据1231。存储器1230可以进一步包括操作系统1233和应用程序1235,该应用程序1235包括允许处理器1210执行本申请描述的视频编码或解码方法(尤其是本申请描述的帧间预测方法或运动信息预测方法)的至少一个程序。例如,应用程序1235可以包括应用1至N,其进一步包括执行在本申请描述的视频编码或解码方法的视频编码或解码应用(简称视频译码应用)。The memory 1230 may include a read only memory (ROM) device or a random access memory (RAM) device. Any other suitable type of storage device may also be used as the memory 1230. The memory 1230 may include code and data 1231 accessed by the processor 1210 using the bus 1250. The memory 1230 may further include an operating system 1233 and an application program 1235, which includes a processor 1210 that allows the processor 1210 to perform the video encoding or decoding method described in this application (especially the inter prediction method or the motion information prediction method described in this application). At least one program. For example, the application program 1235 may include applications 1 to N, which further includes a video encoding or decoding application (referred to as a video decoding application) that executes the video encoding or decoding method described in this application.
该总线系统1250除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统1250。The bus system 1250 may include a data bus, a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are marked as the bus system 1250 in the figure.
可选的,译码设备1200还可以包括一个或多个输出设备,诸如显示器1270。在一个示例中,显示器1270可以是触感显示器,其将显示器与可操作地感测触摸输入的触感单元合并。显示器1270可以经由总线1250连接到处理器1210。Optionally, the decoding device 1200 may further include one or more output devices, such as a display 1270. In one example, the display 1270 may be a tactile display that incorporates the display with a tactile unit operatively sensing a touch input. The display 1270 may be connected to the processor 1210 via a bus 1250.
本领域技术人员能够领会,结合本文公开描述的各种说明性逻辑框、模块和算法步骤所描述的功能可以硬件、软件、固件或其任何组合来实施。如果以软件来实施,那么各种说明性逻辑框、模块、和步骤描述的功能可作为一或多个指令或代码在计算机可读媒体上 存储或传输,且由基于硬件的处理单元执行。计算机可读媒体可包含计算机可读存储媒体,其对应于有形媒体,例如数据存储媒体,或包括任何促进将计算机程序从一处传送到另一处的媒体(例如,根据通信协议)的通信媒体。以此方式,计算机可读媒体大体上可对应于(1)非暂时性的有形计算机可读存储媒体,或(2)通信媒体,例如信号或载波。数据存储媒体可为可由一或多个计算机或一或多个处理器存取以检索用于实施本申请中描述的技术的指令、代码和/或数据结构的任何可用媒体。计算机程序产品可包含计算机可读媒体。Those skilled in the art can appreciate that the functions described in connection with the various illustrative logical blocks, modules, and algorithm steps disclosed in this disclosure may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions described by the various illustrative logical boxes, modules, and steps may be stored or transmitted as one or more instructions or code on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which corresponds to tangible media, such as data storage media, or communication media including any medium that facilitates transfer of a computer program from one place to another (e.g., according to a communication protocol) . In this manner, computer-readable media may generally correspond to (1) tangible computer-readable storage media that is non-transitory, or (2) a communication medium such as a signal or carrier wave. A data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, code, and / or data structures used to implement the techniques described in this application. The computer program product may include a computer-readable medium.
作为实例而非限制,此类计算机可读存储媒体可包括RAM、ROM、EEPROM、CD-ROM或其它光盘存储装置、磁盘存储装置或其它磁性存储装置、快闪存储器或可用来存储指令或数据结构的形式的所要程序代码并且可由计算机存取的任何其它媒体。并且,任何连接被恰当地称作计算机可读媒体。举例来说,如果使用同轴缆线、光纤缆线、双绞线、数字订户线(DSL)或例如红外线、无线电和微波等无线技术从网站、服务器或其它远程源传输指令,那么同轴缆线、光纤缆线、双绞线、DSL或例如红外线、无线电和微波等无线技术包含在媒体的定义中。但是,应理解,所述计算机可读存储媒体和数据存储媒体并不包括连接、载波、信号或其它暂时媒体,而是实际上针对于非暂时性有形存储媒体。如本文中所使用,磁盘和光盘包含压缩光盘(CD)、激光光盘、光学光盘、数字多功能光盘(DVD)和蓝光光盘,其中磁盘通常以磁性方式再现数据,而光盘利用激光以光学方式再现数据。以上各项的组合也应包含在计算机可读媒体的范围内。By way of example, and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, flash memory, or may be used to store instructions or data structures Any other medium in the form of the required program code and accessible by a computer. Also, any connection is properly termed a computer-readable medium. For example, if coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave are used to transmit instructions from a website, server, or other remote source, then coaxial cable Wire, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of media. It should be understood, however, that the computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other temporary media, but are instead directed to non-transitory tangible storage media. As used herein, magnetic and optical discs include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), and Blu-ray discs, where magnetic discs typically reproduce data magnetically, and optical discs use lasers to reproduce optical data. Combinations of the above should also be included within the scope of computer-readable media.
可通过例如一或多个数字信号处理器(DSP)、通用微处理器、专用集成电路(ASIC)、现场可编程逻辑阵列(FPGA)或其它等效集成或离散逻辑电路等一或多个处理器来执行指令。因此,如本文中所使用的术语“处理器”可指前述结构或适合于实施本文中所描述的技术的任一其它结构中的任一者。另外,在一些方面中,本文中所描述的各种说明性逻辑框、模块、和步骤所描述的功能可以提供于经配置以用于编码和解码的专用硬件和/或软件模块内,或者并入在组合编解码器中。而且,所述技术可完全实施于一或多个电路或逻辑元件中。Can be processed by one or more, such as one or more digital signal processors (DSPs), general purpose microprocessors, application specific integrated circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuits To execute instructions. Accordingly, the term "processor" as used herein may refer to any of the aforementioned structures or any other structure suitable for implementing the techniques described herein. Additionally, in some aspects, the functions described by the various illustrative logical blocks, modules, and steps described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or Into the combined codec. Moreover, the techniques can be fully implemented in one or more circuits or logic elements.
本申请的技术可在各种各样的装置或设备中实施,包含无线手持机、集成电路(IC)或一组IC(例如,芯片组)。本申请中描述各种组件、模块或单元是为了强调用于执行所揭示的技术的装置的功能方面,但未必需要由不同硬件单元实现。实际上,如上文所描述,各种单元可结合合适的软件和/或固件组合在编码解码器硬件单元中,或者通过互操作硬件单元(包含如上文所描述的一或多个处理器)来提供。The techniques of this application may be implemented in a wide variety of devices or devices, including a wireless handset, an integrated circuit (IC), or a group of ICs (eg, a chipset). Various components, modules, or units are described in this application to emphasize functional aspects of the apparatus for performing the disclosed techniques, but do not necessarily need to be implemented by different hardware units. In fact, as described above, the various units may be combined in a codec hardware unit in combination with suitable software and / or firmware, or through interoperable hardware units (including one or more processors as described above) provide.
以上所述,仅为本申请示例性的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应该以权利要求的保护范围为准。The above description is only an exemplary specific implementation of the present application, but the scope of protection of the present application is not limited to this. Any person skilled in the art can easily think of changes or changes within the technical scope disclosed in this application. Replacement should be covered by the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims (22)

  1. 一种图像块解码方法,其特征在于,包括:An image block decoding method, comprising:
    解析码流以获取待解码当前图像块的预测残差,预测模式以及预测参考信息;其中,在所述预测模式为平面预测模式时,所述预测参考信息包括预测修正量序号;Parse a bitstream to obtain prediction residuals, prediction modes, and prediction reference information of a current image block to be decoded; wherein when the prediction mode is a planar prediction mode, the prediction reference information includes a prediction correction amount sequence number;
    若所述当前图像块的预测模式为平面预测模式,基于所述预测修正量序号确定预测修正量;If the prediction mode of the current image block is a planar prediction mode, determining a prediction correction amount based on the prediction correction amount number;
    基于所述预测修正量获得所述当前图像块的预测图像;Obtaining a predicted image of the current image block based on the prediction correction amount;
    基于所述当前图像块的预测图像和所述当前图像块的预测残差,获得所述当前图像块的重建图像。A reconstructed image of the current image block is obtained based on the predicted image of the current image block and the prediction residual of the current image block.
  2. 如权利要求1所述的图像块解码方法,其特征在于,所述基于所述预测修正量序号确定预测修正量包括:The method for decoding an image block according to claim 1, wherein determining the prediction correction amount based on the prediction correction amount number comprises:
    若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;或If the predicted correction amount is a first preset number, determining that the predicted correction amount is a first preset correction amount; or
    若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量。If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a second preset correction amount.
  3. 如权利要求1所述的图像块解码方法,其特征在于,所述基于所述预测修正量序号确定预测修正量包括:The method for decoding an image block according to claim 1, wherein determining the prediction correction amount based on the prediction correction amount number comprises:
    若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第三预设修正量;If the predicted correction amount is a first preset number, determining that the predicted correction amount is a third preset correction amount;
    若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第四预设修正量;If the predicted correction amount is a second preset number, determining that the predicted correction amount is a fourth preset correction amount;
    若所述预测修正量序号为第三预设序号,则确定所述预测修正量为第五预设修正量;或If the predicted correction amount number is a third preset number, determining that the predicted correction amount is a fifth preset correction amount; or
    若所述预测修正量序号为第四预设序号,则确定所述预测修正量为第六预设修正量。If the predicted correction amount is a fourth preset number, it is determined that the predicted correction amount is a sixth preset correction amount.
  4. 如权利要求3所述的图像块解码方法,其特征在于,所述第三预设修正量与所述第四预设修正量互为相反数;且The method of claim 3, wherein the third preset correction amount and the fourth preset correction amount are opposite numbers to each other; and
    所述第五预设修正量与所述第六预设修正量互为相反数。The fifth preset correction amount and the sixth preset correction amount are opposite numbers to each other.
  5. 如权利要求1所述的图像块解码方法,其特征在于,所述基于所述预测修正量序号确定预测修正量包括:The method for decoding an image block according to claim 1, wherein determining the prediction correction amount based on the prediction correction amount number comprises:
    将所述当前图像块的左下参考像素的值与所述当前图像块的右上参考像素的值进行加权平均,获得加权平均值;Performing a weighted average of the value of the lower left reference pixel of the current image block and the value of the upper right reference pixel of the current image block to obtain a weighted average;
    在所述加权平均值小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量;或When the weighted average value is less than the value of the upper left reference pixel of the current image block, if the predicted correction amount number is a first preset number, determining the predicted correction amount as a first preset correction amount; if If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a second preset correction amount; or
    在所述加权平均值不小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第二预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第一预设修正量。When the weighted average value is not less than the value of the upper left reference pixel of the current image block, if the prediction correction amount is a first preset number, determining that the prediction correction amount is a second preset correction amount; If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a first preset correction amount.
  6. 如权利要求2或5所述的图像块解码方法,其特征在于,所述第一预设修正量与所述第二预设修正量互为相反数。The image block decoding method according to claim 2 or 5, wherein the first preset correction amount and the second preset correction amount are opposite numbers to each other.
  7. 如权利要求1所述的图像块解码方法,其特征在于,所述基于所述预测修正量序号 确定预测修正量包括:The method for decoding an image block according to claim 1, wherein determining the prediction correction amount based on the prediction correction amount number comprises:
    若所述预测修正量序号为第一预设序号,基于所述当前图像块的左下参考像素的值,所述当前图像块的右上参考像素的值以及所述当前图像块的左上参考像素的值获得差分值;If the prediction correction amount serial number is a first preset serial number, based on the value of the lower left reference pixel of the current image block, the value of the upper right reference pixel of the current image block, and the value of the upper left reference pixel of the current image block Obtain the difference value;
    基于所述差分值确定所述预测修正量。The prediction correction amount is determined based on the difference value.
  8. 如权利要求7所述的图像块解码方法,其特征在于,通过如下计算式计算获得所述差分值:The method for decoding an image block according to claim 7, wherein the difference value is obtained by calculating as follows:
    D=P(W,–1)*a+P(–1,H)*(1–a)–P(–1,–1);D = P (W, –1) * a + P (–1, H) * (1–a) –P (–1, –1);
    其中,D表示所述差分值,P(W,–1)表示所述当前图像块的左下参考像素的值,P(–1,H)表示所述当前图像块的右上参考像素的值,P(–1,–1)表示所述当前图像块的左上参考像素的值,0<a<1。Among them, D represents the difference value, P (W, –1) represents the value of the lower left reference pixel of the current image block, P (–1, H) represents the value of the upper right reference pixel of the current image block, P (-1, -1) represent the value of the upper left reference pixel of the current image block, 0 <a <1.
  9. 如权利要求7或8所述的图像块解码方法,其特征在于,所述基于所述差分值确定所述预测修正量包括:The image block decoding method according to claim 7 or 8, wherein the determining the prediction correction amount based on the difference value comprises:
    基于如下计算式计算确定所述预测修正量:The prediction correction amount is determined based on the following calculation formula:
    M=Clip3(sign(D)*B3,sign(D)*B4,D);M = Clip3 (sign (D) * B3, sign (D) * B4, D);
    其中,M表示所述预测修正量,D表示所述差分值,sign(D)表示取所述差分值的符号,B3为预设正整数,B4为预设正整数,B3<B4,Clip3(sign(D)*B3,sign(D)*B4,D)表示将D的值限制在sign(D)*B3与sign(D)*B4之间。Among them, M represents the predicted correction amount, D represents the difference value, sign (D) represents the sign of taking the difference value, B3 is a preset positive integer, B4 is a preset positive integer, and B3 <B4, Clip3 ( sign (D) * B3, sign (D) * B4, D) means to limit the value of D between sign (D) * B3 and sign (D) * B4.
  10. 如权利要求1至9任一所述的图像块解码方法,其特征在于,所述基于所述预测修正量获得所述当前图像块的预测图像包括:The method for decoding an image block according to any one of claims 1 to 9, wherein the obtaining a predicted image of the current image block based on the prediction correction amount comprises:
    基于所述预测修正量对所述当前图像块的右下像素的预测值进行修正;Correct the prediction value of the lower right pixel of the current image block based on the prediction correction amount;
    基于所述当前图像块的右下像素的预测值的修正值获得所述当前图像块的预测图像。A prediction image of the current image block is obtained based on a correction value of a prediction value of a lower right pixel of the current image block.
  11. 如权利要求10所述的图像块解码方法,其特征在于,基于所述当前图像块的右下像素的预测值的修正值获得所述当前图像块的预测图像前,所述方法还包括:The image block decoding method according to claim 10, wherein before obtaining the predicted image of the current image block based on the correction value of the prediction value of the lower right pixel of the current image block, the method further comprises:
    将所述当前图像块的右下像素的预测值的修正值限制在预设的取值范围内,所述预设的取值范围为[0,pow(2,N)–1],其中pow(2,N)表示2的N次幂,N表示比特位宽。Limiting the correction value of the prediction value of the lower right pixel of the current image block to a preset value range, the preset value range is [0, pow (2, N) –1], where pow (2, N) represents the Nth power of 2, and N represents the bit width.
  12. 一种图像块解码装置,其特征在于,包括:An image block decoding device, comprising:
    熵解码器,用于解析码流以获取待解码当前图像块的预测残差,预测模式以及预测参考信息;其中,在所述预测模式为平面预测模式时,所述预测参考信息包括预测修正量序号;An entropy decoder is used to parse a bitstream to obtain prediction residuals, prediction modes, and prediction reference information of a current image block to be decoded; where the prediction reference information includes a prediction correction amount when the prediction mode is a planar prediction mode Serial number
    帧内预测器,用于在所述当前图像块的预测模式为平面预测模式时,基于所述预测修正量序号确定预测修正量;基于所述预测修正量获得所述当前图像块的预测图像;An intra predictor, configured to determine a prediction correction amount based on the prediction correction amount number when the prediction mode of the current image block is a flat prediction mode; obtain a prediction image of the current image block based on the prediction correction amount;
    重建单元,用于基于所述当前图像块的预测图像和所述当前图像块的预测残差,获得所述当前图像块的重建图像。A reconstruction unit, configured to obtain a reconstructed image of the current image block based on the predicted image of the current image block and the prediction residual of the current image block.
  13. 如权利要求12所述的图像块解码装置,其特征在于,所述帧内预测器具体用于:The image block decoding device according to claim 12, wherein the intra predictor is specifically configured to:
    若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;或If the predicted correction amount is a first preset number, determining that the predicted correction amount is a first preset correction amount; or
    若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量。If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a second preset correction amount.
  14. 如权利要求12所述的图像块解码装置,其特征在于,所述帧内预测器具体用于:The image block decoding device according to claim 12, wherein the intra predictor is specifically configured to:
    若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第三预设修正量;If the predicted correction amount is a first preset number, determining that the predicted correction amount is a third preset correction amount;
    若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第四预设修正量;If the predicted correction amount is a second preset number, determining that the predicted correction amount is a fourth preset correction amount;
    若所述预测修正量序号为第三预设序号,则确定所述预测修正量为第五预设修正量;或者If the predicted correction amount is a third preset number, determining that the predicted correction amount is a fifth preset correction amount; or
    若所述预测修正量序号为第四预设序号,则确定所述预测修正量为第六预设修正量。If the predicted correction amount is a fourth preset number, it is determined that the predicted correction amount is a sixth preset correction amount.
  15. 如权利要求14所述的图像块解码装置,其特征在于,所述第三预设修正量与所述第四预设修正量互为相反数;且The image block decoding device according to claim 14, wherein the third preset correction amount and the fourth preset correction amount are opposite numbers to each other; and
    所述第五预设修正量与所述第六预设修正量互为相反数。The fifth preset correction amount and the sixth preset correction amount are opposite numbers to each other.
  16. 如权利要求12所述的图像块解码装置,其特征在于,所述帧内预测器具体用于:The image block decoding device according to claim 12, wherein the intra predictor is specifically configured to:
    将所述当前图像块的左下参考像素的值与所述当前图像块的右上参考像素的值进行加权平均,获得加权平均值;Performing a weighted average of the value of the lower left reference pixel of the current image block and the value of the upper right reference pixel of the current image block to obtain a weighted average;
    在所述加权平均值小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第一预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第二预设修正量;或者When the weighted average value is less than the value of the upper left reference pixel of the current image block, if the predicted correction amount number is a first preset number, determining the predicted correction amount as a first preset correction amount; if If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a second preset correction amount; or
    在所述加权平均值不小于所述当前图像块的左上参考像素的值时,若所述预测修正量序号为第一预设序号,则确定所述预测修正量为第二预设修正量;若所述预测修正量序号为第二预设序号,则确定所述预测修正量为第一预设修正量。When the weighted average value is not less than the value of the upper left reference pixel of the current image block, if the prediction correction amount is a first preset number, determining that the prediction correction amount is a second preset correction amount; If the predicted correction amount is a second preset number, it is determined that the predicted correction amount is a first preset correction amount.
  17. 如权利要求13或16所述的图像块解码装置,其特征在于,所述第一预设修正量与所述第二预设修正量互为相反数。The image block decoding device according to claim 13 or 16, wherein the first preset correction amount and the second preset correction amount are opposite numbers to each other.
  18. 如权利要求12所述的图像块解码装置,其特征在于,所述帧内预测器具体用于:The image block decoding device according to claim 12, wherein the intra predictor is specifically configured to:
    若所述预测修正量序号为第一预设序号,基于所述当前图像块的左下参考像素的值,所述当前图像块的右上参考像素的值以及所述当前图像块的左上参考像素的值获得差分值;If the prediction correction amount serial number is a first preset serial number, based on the value of the lower left reference pixel of the current image block, the value of the upper right reference pixel of the current image block, and the value of the upper left reference pixel of the current image block Obtain the difference value;
    基于所述差分值确定所述预测修正量。The prediction correction amount is determined based on the difference value.
  19. 如权利要求18所述的图像块解码装置,其特征在于,所述帧内预测器具体用于通过如下计算式计算获得所述差分值:The image block decoding device according to claim 18, wherein the intra predictor is specifically configured to obtain the difference value by calculating as follows:
    D=P(W,–1)*a+P(–1,H)*(1–a)–P(–1,–1);D = P (W, –1) * a + P (–1, H) * (1–a) –P (–1, –1);
    其中,D表示所述差分值,P(W,–1)表示所述当前图像块的左下参考像素的值,P(–1,H)表示所述当前图像块的右上参考像素的值,P(–1,–1)表示所述当前图像块的左上参考像素的值,0<a<1。Among them, D represents the difference value, P (W, –1) represents the value of the lower left reference pixel of the current image block, P (–1, H) represents the value of the upper right reference pixel of the current image block, P (-1, -1) represent the value of the upper left reference pixel of the current image block, 0 <a <1.
  20. 如权利要求18或19所述的图像块解码装置,其特征在于,所述帧内预测器具体用于:The image block decoding device according to claim 18 or 19, wherein the intra predictor is specifically configured to:
    基于如下计算式计算确定所述预测修正量:The prediction correction amount is determined based on the following calculation formula:
    M=Clip3(sign(D)*B3,sign(D)*B4,D);M = Clip3 (sign (D) * B3, sign (D) * B4, D);
    其中,M表示所述预测修正量,D表示所述差分值,sign(D)表示取所述差分值的符号,B3为预设正整数,B4为预设正整数,B3<B4,Clip3(sign(D)*B3,sign(D)*B4,D)表示将D的值限制在sign(D)*B3与sign(D)*B4之间。Among them, M represents the predicted correction amount, D represents the difference value, sign (D) represents the sign of taking the difference value, B3 is a preset positive integer, B4 is a preset positive integer, and B3 <B4, Clip3 ( sign (D) * B3, sign (D) * B4, D) means to limit the value of D between sign (D) * B3 and sign (D) * B4.
  21. 如权利要求12至20任一所述的图像块解码装置,其特征在于,所述帧内预测器具体用于:The image block decoding device according to any one of claims 12 to 20, wherein the intra predictor is specifically configured to:
    基于所述预测修正量对所述当前图像块的右下像素的预测值进行修正;Correct the prediction value of the lower right pixel of the current image block based on the prediction correction amount;
    基于所述当前图像块的右下像素的预测值的修正值获得所述当前图像块的预测图像。A prediction image of the current image block is obtained based on a correction value of a prediction value of a lower right pixel of the current image block.
  22. 如权利要求21所述的图像块解码装置,其特征在于,右下所述帧内预测器具体还用于:The image block decoding device according to claim 21, wherein the intra predictor in the lower right is further configured to:
    将所述当前图像块的右下像素的预测值的修正值限制在预设的取值范围内,所述预设的取值范围为[0,pow(2,N)–1],其中pow(2,N)表示2的N次幂,N表示比特位宽;Limiting the correction value of the prediction value of the lower right pixel of the current image block to a preset value range, the preset value range is [0, pow (2, N) –1], where pow (2, N) represents the Nth power of 2, and N represents the bit width;
    基于限制在所述预设的取值范围内的所述当前图像块的右下像素的预测值的修正值获得所述当前图像块的预测图像。A predicted image of the current image block is obtained based on a correction value of a prediction value of a lower right pixel of the current image block that is limited to the preset value range.
PCT/CN2019/091505 2018-07-02 2019-06-17 Image block decoding method and device WO2020007187A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US201862693428P 2018-07-02 2018-07-02
US62/693,428 2018-07-02

Publications (1)

Publication Number Publication Date
WO2020007187A1 true WO2020007187A1 (en) 2020-01-09

Family

ID=69060577

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/091505 WO2020007187A1 (en) 2018-07-02 2019-06-17 Image block decoding method and device

Country Status (1)

Country Link
WO (1) WO2020007187A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611885A (en) * 2011-01-20 2012-07-25 华为技术有限公司 Encoding and decoding method and device
CN102934441A (en) * 2010-05-25 2013-02-13 Lg电子株式会社 New planar prediction mode
US20150341662A1 (en) * 2013-07-01 2015-11-26 Panasonic Intellectual Property Corporation Of America Image coding apparatus, image coding method, and image coding system
US20180184083A1 (en) * 2016-12-28 2018-06-28 Arris Enterprises Llc Adaptive unequal weight planar prediction

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102934441A (en) * 2010-05-25 2013-02-13 Lg电子株式会社 New planar prediction mode
CN102611885A (en) * 2011-01-20 2012-07-25 华为技术有限公司 Encoding and decoding method and device
US20150341662A1 (en) * 2013-07-01 2015-11-26 Panasonic Intellectual Property Corporation Of America Image coding apparatus, image coding method, and image coding system
US20180184083A1 (en) * 2016-12-28 2018-06-28 Arris Enterprises Llc Adaptive unequal weight planar prediction

Similar Documents

Publication Publication Date Title
JP7071603B1 (en) Merging filters for multiple classes of blocks for video coding
CN109792538B (en) Method and apparatus for coding video data
WO2019062544A1 (en) Inter frame prediction method and device and codec for video images
TWI786790B (en) Method and apparatus of frame inter prediction of video data
CN114205592B (en) Intra-frame prediction method and device for video sequence
CN111277828B (en) Video encoding and decoding method, video encoder and video decoder
CN107258081B (en) Optimization of video data encoded using non-square partitions
TW202234883A (en) Intra block copy scratch frame buffer
WO2020042604A1 (en) Video encoder, video decoder and corresponding method
CN113766246A (en) Image encoding method, image decoding method and related device
TW201921938A (en) Adaptive GOP structure with future reference frame in random access configuration for video coding
CN110290384A (en) Image filtering method, device and Video Codec
WO2020007187A1 (en) Image block decoding method and device
CN110677645B (en) Image prediction method and device
WO2020042758A1 (en) Interframe prediction method and device
WO2019237287A1 (en) Inter-frame prediction method for video image, device, and codec
WO2020042724A1 (en) Inter-frame prediction method and device, and video encoder and video decoder
WO2019227297A1 (en) Interframe prediction method, device, and codec for video image
RU2574831C2 (en) Unified merge mode and adaptive motion vector prediction mode candidates selection

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: 19830210

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: 19830210

Country of ref document: EP

Kind code of ref document: A1