WO2020078228A1 - 视频编码、视频解码方法、装置、计算机设备和存储介质 - Google Patents

视频编码、视频解码方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2020078228A1
WO2020078228A1 PCT/CN2019/109972 CN2019109972W WO2020078228A1 WO 2020078228 A1 WO2020078228 A1 WO 2020078228A1 CN 2019109972 W CN2019109972 W CN 2019109972W WO 2020078228 A1 WO2020078228 A1 WO 2020078228A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixels
target
reconstructed
current
pixel
Prior art date
Application number
PCT/CN2019/109972
Other languages
English (en)
French (fr)
Inventor
张涛
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to EP19872771.1A priority Critical patent/EP3869805A4/en
Publication of WO2020078228A1 publication Critical patent/WO2020078228A1/zh
Priority to US17/074,482 priority patent/US11115672B2/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/149Data rate or code amount at the encoder output by estimating the code amount by means of a model, e.g. mathematical model or statistical model
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation

Definitions

  • the present application relates to the field of computer technology, in particular to video encoding, video decoding methods, devices, computer equipment, and storage media.
  • embodiments of the present application provide a video encoding, video decoding method, device, computer equipment, and storage medium, which can be used to solve the above-mentioned problem of low video encoding efficiency.
  • a video encoding method includes: acquiring a current encoding block to be encoded in a current video frame; determining a target reference pixel corresponding to the current encoding block, and the target number corresponding to the target reference pixel being a target base Times e to the power of e, where e is a positive integer, and the target base number is the base number used when calculating the predicted value of the current encoding block; the corresponding value of the current encoding block is obtained according to the target reference pixel Prediction value; video encoding the current encoding block according to the prediction value to obtain encoded data.
  • a video encoding device includes: a current encoding block acquisition module for acquiring a current encoding block to be encoded in a current video frame; a first determination module for determining a target reference pixel corresponding to the current encoding block , The target number corresponding to the target reference pixel is the e-th power of the target base, where e is a positive integer, and the target base is the base used when calculating the predicted value of the current encoding block;
  • the first prediction value calculation module is used to obtain the prediction value corresponding to the current encoding block according to the target reference pixel; the encoding module is used to video encode the current encoding block according to the prediction value to obtain encoded data .
  • a computer device includes a memory and a processor.
  • a computer program is stored in the memory.
  • the processor is caused to perform the following operations:
  • the target number corresponding to the target reference pixel is the e-th power of the target base, the e is a positive integer, and the target base is the calculation of the current The base number used when encoding the predicted value of the block;
  • a computer-readable storage medium that stores a computer program on the computer-readable storage medium, and when the computer program is executed by a processor, causes the processor to perform the steps of the video encoding method described above.
  • the above video encoding method, device, computer equipment, and storage medium can be predicted by acquiring target reference pixel points whose number is the same as the e-th power of the target base number, and the target base number is the base number used to calculate the predicted value.
  • the average pixel value of the target reference pixel needs to be obtained, that is, the total pixel value of the target reference pixel is divided by the target number to obtain the average pixel value. If the target number is the e-th power of the target hexadecimal, the shift operation can be used to avoid the division operation, so the calculation speed of calculating the predicted value during video encoding can be increased, and the encoding efficiency is improved.
  • a video decoding method includes: acquiring encoded data corresponding to a current block to be decoded in a video frame to be decoded; determining a target reference pixel corresponding to the current block to be decoded, and a target corresponding to the target reference pixel
  • the quantity is a power of e times the target base number, the e is a positive integer, and the target base number is the base number used when calculating the predicted value of the current encoding block; the target reference pixel point is used to obtain the The prediction value corresponding to the current block to be decoded; decoding the encoded data according to the prediction value to obtain the video image block corresponding to the current block to be decoded.
  • a video decoding device includes: an encoded data acquisition module for acquiring encoded data corresponding to a current block to be decoded in a video frame to be decoded; a second determination module for determining the corresponding to the current block to be decoded Target reference pixel, the target number corresponding to the target reference pixel is the e-th power of the target base, the e is a positive integer, and the target base is used to calculate the predicted value of the current encoding block Base; the second predicted value calculation module, used to obtain the predicted value corresponding to the current block to be decoded according to the target reference pixel; the decoding module, used to decode the encoded data according to the predicted value, Obtain the video image block corresponding to the current block to be decoded.
  • a computer device includes a memory and a processor.
  • a computer program is stored in the memory.
  • the processor is caused to perform the following operations:
  • the target number corresponding to the target reference pixel is the e-th power of the target base, the e is a positive integer, and the target base is to calculate the The base number used in the prediction value of the current coding block;
  • a computer-readable storage medium that stores a computer program on the computer-readable storage medium, and when the computer program is executed by a processor, causes the processor to perform the steps of the video decoding method described above.
  • the above video decoding method, device, computer equipment and storage medium can be predicted by acquiring the target reference pixel points whose number is the same as the e-th power of the target base number, and the target base number is the base number used to calculate the predicted value.
  • the average pixel value of the target reference pixel needs to be obtained, that is, the total pixel value of the target reference pixel is divided by the target number to obtain the average pixel value. If the target number is the e-th power of the target hexadecimal, the shift operation can be used to avoid the division operation, so the calculation speed of calculating the predicted value during video encoding can be increased, and the encoding efficiency is improved.
  • FIG. 1 is an application environment diagram of a video encoding method provided in an embodiment
  • FIG. 2 is a diagram of a coding framework corresponding to a video coding method provided in an embodiment
  • FIG. 3 is a decoding framework diagram corresponding to the video decoding method provided in an embodiment
  • 4A is a flowchart of a video encoding method in an embodiment
  • 4B is a schematic diagram of the division of image blocks in an embodiment
  • FIG. 5A is a flowchart of determining a target reference pixel corresponding to a current coding block in an embodiment
  • 5B is a schematic diagram of the current coding block and the corresponding target reference pixel in one embodiment
  • FIG. 6 is a flowchart of acquiring a first set of reconstructed pixels in the first direction and a second set of reconstructed pixels in the second direction in an embodiment of an embodiment
  • FIG. 7 is a schematic diagram of a current coding block and corresponding target reference pixels in an embodiment
  • FIG. 8 is a schematic diagram of a current encoding block and corresponding target reference pixels in an embodiment
  • FIG. 9 is a schematic diagram of a current coding block and corresponding target reference pixels in an embodiment
  • FIG. 10 is a flowchart of a video decoding method in an embodiment
  • FIG. 11 is a structural block diagram of a video encoding device in an embodiment
  • FIG. 12 is a structural block diagram of a video decoding device in an embodiment
  • FIG. 13 is a block diagram of an internal structure of a computer device in an embodiment
  • FIG. 14 is a block diagram of the internal structure of a computer device in an embodiment.
  • first”, “second”, etc. used in this application can be used herein to describe various elements, but unless specifically stated, these elements are not limited by these terms. These terms are only used to distinguish the first element from another element.
  • first direction may be referred to as the second direction, and similarly, the second direction may be referred to as the first direction.
  • FIG. 1 is an application environment diagram of a video encoding method provided in an embodiment. As shown in FIG. 1, the application environment includes a terminal 110 and a server 120.
  • FIG. 1 is an application environment diagram of a video encoding method and a video decoding method provided in an embodiment.
  • the application environment includes a terminal 110 and a server 120.
  • the terminal 110 may perform video encoding through an encoder or video decoding through a decoder; the terminal 110 may also run a video encoding program through a processor to perform video encoding, or the processor runs a video decoding program to perform video decoding. This is not specifically limited.
  • the server 120 may perform video encoding through an encoder or video decoding through a decoder.
  • the server 120 may also run the video encoding program through the processor to perform video encoding, or run the video decoding program through the processor to perform video decoding.
  • the server 120 can directly pass it to the processor for decoding, or it can be stored in the database to wait for subsequent decoding.
  • the server 120 may also send it to the corresponding receiving terminal, and the receiving terminal will decode it.
  • the server 120 receives the video frame sent by the terminal 110 through the input interface
  • the processor encodes the video frame to obtain the encoded data
  • it can be directly sent to the terminal 110 through the output interface, or the encoded data can be stored in the database and waited For subsequent delivery, this embodiment of the present application does not specifically limit this.
  • the terminal 110 and the server 120 may be connected through a network.
  • the terminal 110 may be a desktop terminal or a mobile terminal, and the mobile terminal may include at least one of a mobile phone, a tablet computer, a notebook computer, etc., but is not limited thereto.
  • the server 120 may be implemented by an independent server or a server cluster composed of multiple servers.
  • FIG. 2 is a coding frame diagram corresponding to a video coding method provided in an embodiment.
  • the video coding method provided in an embodiment of the present application can obtain each video frame of a video sequence for coding to obtain corresponding coded data, and pass the storage transmission unit 218 Perform one or more steps in storing or sending the encoded data. Among them, at the video frame acquisition unit 202, the current video frame is acquired.
  • intra-frame prediction or inter-frame prediction may be performed on each coding block of the current video frame.
  • the prediction mode of the coding block is inter prediction
  • the predicted value and the corresponding motion vector are obtained according to the image value of the reference block corresponding to the coding block, and the actual value of the coding block is subtracted from the predicted value to obtain the prediction residual
  • the prediction mode of the coding block is the intra prediction mode
  • the reference pixel in the current video frame is obtained according to the type of the intra prediction mode, the corresponding prediction value is calculated, and the actual value of the coding block is subtracted from the prediction value to obtain the prediction residual .
  • the prediction residual and vector information in the spatial domain are transformed into the frequency domain, and the transform coefficients can be encoded.
  • the transform method may be discrete Fourier transform or discrete cosine transform, etc.
  • the vector information may be the actual motion vector representing the displacement or the difference between the motion vector, and the difference between the motion vector is the difference between the actual motion vector and the predicted motion vector.
  • the transformed data is mapped to another value, for example, a smaller value can be obtained by dividing the transformed data by the quantization step size.
  • the quantization parameter is the serial number corresponding to the quantization step size, where the value of the quantization parameter is an integer. According to the quantization parameter, the corresponding quantization step size can be found. If the quantization parameter is small, most details of the image frame will be preserved, and the corresponding code rate is high. If the quantization parameter is large, the corresponding bit rate is low, but the image distortion is large and the quality is not high.
  • FQ roued (y / Qstep). Where y is the prediction residual corresponding to the video frame before quantization, Qstep is the quantization step size, and FQ is the quantization value obtained by quantizing y.
  • the Roued (x) function refers to rounding the value to five, even when the last bit of the value is less than or equal to four, it is rounded off; when the last bit of the value is greater than or equal to six, it is rounded up; when When the last digit of the value is five, if there is a number after five, then round five to one; if there is no number after five, and the first digit of five is an odd number, then round five to one; if the first one of five If the number is even, the number is not rounded.
  • the corresponding relationship between the quantization parameter and the quantization step size can be set as required.
  • the quantization step size has 52 values, which are integers between 0 and 51.
  • the quantization step size is between 0 and 39. Integer, and the quantization step size increases with the increase of the quantization parameter. When the quantization parameter increases by 6, the quantization step size doubles.
  • the entropy encoding unit 216 is used to perform entropy encoding.
  • the entropy encoding is a data encoding method that encodes according to the principle of entropy without losing any information, and can use small characters to express certain information.
  • the entropy coding method may be, for example, shaeeoe coding or Huffmae coding.
  • the first inverse quantization unit 210, the first inverse transform unit 212, and the reconstruction unit 214 are units corresponding to the reconstruction path. Each unit of the reconstruction path is used to reconstruct the frame to obtain a reference frame, which can maintain the consistency of the reference frame in encoding and decoding.
  • the step performed by the first inverse quantization unit 210 is the inverse process of quantization
  • the step performed by the first inverse quantization unit 212 is the inverse process of the transformation by the transformation unit 206
  • the reconstruction unit 214 is used to convert the residual data obtained by the inverse transformation Add the prediction data to get the reconstructed reference frame.
  • FIG. 3 is a decoding frame diagram corresponding to the video decoding method provided in an embodiment.
  • the video decoding method provided in the embodiment of the present application may obtain the encoded data corresponding to each video frame to be decoded of the video sequence to be decoded through the encoded data acquiring unit 300, After entropy decoding by the entropy decoding unit 302, entropy decoded data is obtained.
  • the second inverse quantization unit 304 inversely quantizes the entropy decoded data to obtain inverse quantized data.
  • the second inverse transform unit 306 inversely transforms the inverse quantized data to obtain inverse
  • the transformed data, the inverse transformed data may be consistent with the data obtained after the inverse transformation by the first inverse transformation unit 212 in FIG. 2.
  • the second prediction unit 308 performs intra prediction or inter prediction on the decoded block according to the prediction mode of the block to be decoded, for example, in the case of inter prediction, obtains the target reference block corresponding to the block to be decoded according to the motion vector information carried in the encoded data , The predicted value consistent with the predicted value in FIG. 2 is obtained according to the image value of the target reference block, and the pixel value of the decoded video data block is obtained according to the predicted value and the predicted residual in the encoded data, where the reference block is derived from the second prediction
  • the unit 308 has obtained the reference frame that has been decoded.
  • the playback storage unit 310 may perform one or more steps of playing video and storing video on the decoded video frame.
  • coding frame diagram and decoding frame diagram are just an example, and do not constitute a limitation on the coding method to which the scheme of the present application is applied.
  • the coding frame diagram and the decoding frame diagram may include more than shown in the figure or Fewer units, or some combination of units, or units with different components are unknown. For example, you can also perform loop filtering on the reconstructed video frame to reduce the square effect of the video frame to improve the video quality.
  • the end that performs encoding is called an encoding end
  • the end that performs decoding is called a decoding end.
  • the encoding end and the decoding end may be the same end or different ends.
  • the above-mentioned computer devices such as the terminal and the server may be either the encoding end or the decoding end.
  • a video encoding method is proposed.
  • the video encoding method provided in this embodiment may be applied to the terminal 110 and the server 120 in FIG. 1 described above. The following steps can be included:
  • Step S402 Obtain the current encoding block to be encoded in the current video frame.
  • a video frame is a unit that constitutes a video.
  • the video frame may be a video frame collected by a computer device in real time, for example, a video frame obtained in real time through a camera of a terminal.
  • the video frame may also be a video frame corresponding to a pre-stored video sequence.
  • a video can be regarded as a sequence of video frames, and a sequence of video frames can include multiple video frames.
  • the current video frame refers to a video frame that currently needs to be encoded, which can be any video frame among multiple video frames, and the current encoding block is an encoding block that currently needs to be encoded in the current video frame.
  • the video frame may include one or more coding blocks, and the size of the coding block in the video frame may be set as needed.
  • a video frame can be divided into multiple coding blocks with a size of 4 * 8 or 8 * 4 pixels.
  • the size of the coding block in the video frame can also be calculated by calculating the rate-distortion cost corresponding to the division of various coding blocks, and selecting a division mode with a small rate-distortion cost to divide the coding block.
  • FIG. 4B it is a schematic diagram of dividing a 64 * 64 pixel image block, where a square represents an encoding block.
  • the size of the encoding block may include 32 * 32 pixels, 16 * 16 pixels, 8 * 8 pixels, and 4 * 4 pixels.
  • the size of the coding block may also be other sizes, for example, it may be 32 * 16 pixels or 64 * 64 pixels.
  • Step S404 Determine the target reference pixel corresponding to the current coding block, the target number corresponding to the target reference pixel is the e-th power of the target base, e is a positive integer, and the target base is the location when calculating the predicted value of the current encoding block The base number used.
  • the target reference pixel point is obtained in the reconstructed frame obtained after the encoding end is encoded and then reconstructed.
  • the target reference pixel is used to calculate the prediction value of the current coding block.
  • it is usually necessary to find the reference pixel corresponding to the current coding block, calculate the prediction value corresponding to the current coding block according to the reference pixel, and obtain the prediction residual according to the difference between the actual value and the prediction value.
  • the difference is further encoded to reduce the amount of video data.
  • the hexadecimal system refers to the carry counting system and is a counting method with carry, such as binary, decimal, hexadecimal, and so on. The same number can be expressed in different bases.
  • the target base number is the base number used when calculating the prediction value of the current encoding block.
  • the base number used when calculating the prediction value of the current encoding block can be based on one or more of the hardware parameters and software parameters corresponding to the device that performs video encoding determine. For example, at present, the calculation method adopted by most computer devices is binary, and the target hexadecimal number may be binary.
  • the target number is the power of e in the target hexadecimal system: assuming that the target system is a and e is a positive integer, the power of e in a is expressed as a e , that is, the target quantity represents the product of e multiplied by a.
  • the target reference pixel may be determined according to the prediction mode corresponding to the current coding block.
  • the target reference pixel may include an adjacent pixel located above the current coding block and an adjacent pixel on the left.
  • neighboring pixels can be obtained from the current coding block in all directions as target reference pixels.
  • the current coding block may include two directions, such as a height direction and a width direction.
  • a reconstructed pixel whose distance from the current coding block is less than a preset distance may be used as the target reference pixel.
  • the preset distance can be set as required, for example, it can be a distance of 2 pixels.
  • the reconstructed pixels refer to the pixels reconstructed through the reconstruction path.
  • the target reference pixel may be a pixel whose distance from the boundary of the current coding block is less than a preset distance, for example, may be a pixel that has a repeated boundary with a pixel in the current coding block.
  • the video encoding method provided by the embodiment of the present application may be applied to intra prediction, therefore, the target reference pixel is acquired in the video frame where the current encoding block is located. It can also be acquired in other video frames.
  • the target reference pixels are obtained after encoding at the encoding end and then reconstruct Obtained from the reconstructed frame.
  • Step S406 Obtain the prediction value corresponding to the current coding block according to the target reference pixel.
  • the predicted value of the current coding block is the pixel value predicted by the target reference pixel.
  • the prediction value of the current coding block is obtained according to the pixel value of each target reference pixel.
  • the prediction value of the current coding block may be obtained by weighted summation of the target reference pixel and the corresponding weight, and the weight of each target reference pixel may be set as needed. For example, it may be set that the weights of the target reference pixels are equal to the reciprocal of the number of target reference pixels, that is, the predicted value of the current encoding block is the average value of the pixel values of the target reference pixels.
  • the predicted value may also be a value calculated based on the average value.
  • the predicted value may also be obtained by adding the average pixel value to the preset pixel value, and the preset pixel value may be determined according to the target number.
  • the calculation method of the predicted value can be expressed by formula (1) or (2), where P represents the predicted value, P1 is the pixel value of the first target reference pixel, and Pm is the pixel value of the mth target reference pixel, m represents the number of target reference pixels, b can be set as needed, for example equal to m.
  • the target number m is the e-th power of the target hexadecimal
  • the target number m in formula (1) and formula (2) can be converted to the target e-th power Calculate multiple times, you can quickly calculate the predicted value.
  • the prediction value of the current coding block may be the same as the prediction value of each pixel in the current coding block, and the prediction value of the current coding block may also be that the prediction value of each pixel of the current coding block is different.
  • the predicted value of each pixel of the current coding block may be the same.
  • the predicted value can also be transformed according to the distance of the pixel in the current coding block from the target reference pixel.
  • the predicted value corresponding to each pixel of the current coding block may be P * 0.99 i , where i is the number of pixels between the current coding block and the target reference pixel.
  • obtaining the predicted value corresponding to the current coding block according to the target reference pixel includes: summing the pixel values of the target reference pixel to obtain the pixel statistical value; obtaining the number of shifted bits according to the target number, based on the shift The shift calculation is performed on the number of bits and the statistical value of pixels to obtain a shift result, and the predicted value corresponding to the current coding block is obtained according to the shift result.
  • Shift calculation refers to shifting the number to the left or right.
  • Left shift is to move to the left, which is equivalent to multiplying the number by the corresponding target base
  • right shift is to move to the right, which is equivalent to dividing the number by the corresponding base.
  • left shift refers to shifting the number represented by the binary representation to the left by the corresponding number of digits, shifting out high, and zero-filling the low-order gaps.
  • Right shift refers to shifting the digits in the binary representation to the right by the corresponding number of digits, shifting out the lower digits, and filling the high-order gaps with sign bits, that is, positive numbers with zeros and negative numbers with 1s.
  • the number 8 is divided by 2 to obtain the number 4, and the above shift calculation may include: the binary representation of the number 8 is 1000, and the division by 2 is a right shift to obtain the binary 0100, and the number represented by the binary 0100 is 4.
  • the number 3 is multiplied by 2 to obtain the number 6, and the above shift calculation may include: the binary identification of the number 3 is 0011, and the multiplication by 2 is a left shift by one, to obtain a binary 0110, and the number identified by the binary 0110 is 6.
  • shifting one bit to the left is equivalent to multiplying the target radix by one
  • shifting the e-bit to the left is equivalent to multiplying the target radix by e
  • Shifting one bit to the right is equivalent to dividing by the target base one power
  • shifting the e-bit to the right is equivalent to dividing by the target base e power.
  • the left shift symbol can be represented by " ⁇ ”
  • the right shift symbol can be represented by ">>”.
  • the pixel statistical value may be shifted, or the pixel statistical value may be further calculated to obtain a value that needs to be shifted, for example, the pixel statistical value is added to the preset value b to perform shift calculation.
  • the shift result may be used as the predicted value corresponding to the current coding block, or the shift result may be further calculated to obtain the predicted value.
  • the shift result is multiplied by a preset coefficient to obtain a predicted value.
  • the preset coefficient can be set as required, for example, 0.99.
  • the numerators P1 + ... + Pm on the right side of the equation represent the pixel statistical values of m target reference pixels.
  • the denominator, the target number m is used to calculate the number of shifted bits.
  • the number of shifted bits can be log a a e , that is, the number of shifted bits is e.
  • shifting the pixel statistical value may be shifted, or the pixel statistical value may be further calculated to obtain a value that needs to be shifted, and then the value that needs to be shifted may be shifted.
  • formula (1) can be converted into formula (3) for calculation
  • formula (2) can be converted into formula (4) for calculation, so that the division of formula (1) and formula (2) is transformed into shift Bit calculation, the calculation cycle of division operation in computer equipment is relatively long, the hardware loss is large, or special hardware equipment needs to be configured to calculate, and the use of shift calculation can get the number of shifted bits according to the target number, according to the shift The shift calculation of the number of bits and the statistical value of pixels. In this way, by using the shift calculation instead of the division calculation, the calculation of division can be reduced or avoided, reducing the calculation time and the loss of hardware equipment.
  • Step S408 Perform video encoding on the current encoding block according to the predicted value to obtain encoded data.
  • the actual value of the current coding block can be subtracted from the predicted value to obtain a prediction residual, and one or more steps of transformation, quantization, and entropy coding can be performed according to the prediction residual to obtain encoded data.
  • prediction can be performed by acquiring target reference pixel points whose number is the same as the e-th power of the target base system, and the target base system is the base system used to calculate the predicted value.
  • the average pixel value of the target reference pixel needs to be obtained, that is, the total pixel value of the target reference pixel is divided by the target number to obtain the average pixel value. If the target number is the e-th power of the target hexadecimal, the shift operation can be used to avoid the division operation, so the calculation speed of calculating the predicted value during video encoding can be increased, and the encoding efficiency is improved.
  • step S404 that is, the step of determining the target reference pixel corresponding to the current coding block may include the following steps:
  • Step S502 Acquire a first set of reconstructed pixels in the first direction of the current coding block and a second set of reconstructed pixels in the second direction.
  • the current coding block may include two directions, a height direction and a width direction. If it is in the height direction, the pixels in the set of reconstruction pixels corresponding to the height direction are the reconstruction pixels adjacent to the side corresponding to the height of the current encoding block, for example, the reconstruction pixels corresponding to the height direction may be located to the left of the current encoding block Reconstructed pixels on at least one of the side or the right side. If it is in the width direction, the pixels in the set of reconstruction pixels corresponding to the width direction are the reconstruction pixels adjacent to the side corresponding to the width of the current encoding block, for example, the pixels in the set of reconstruction pixels corresponding to the width direction may be located at Reconstructed pixels of at least one of the top or bottom of the current coding block.
  • the definition of proximity can be set as needed. For example, less than the preset distance.
  • the first direction may be one of a height direction and a width direction
  • the second direction may be one of a height direction and a width direction, but the first direction and the second direction are different.
  • the first direction is the height direction
  • the second direction is the width direction.
  • the number of pixels in the first set of reconstructed pixel points and the second set of reconstructed pixel points can be set as needed, and can be equal or not equal. For example, the number of pixels in the first set of reconstructed pixels is 8, and the number of pixels in the second set of reconstructed pixels is 4.
  • the number of pixels in the first set of reconstructed pixels can be determined according to the length of the current encoding block in the first direction, and the number of pixels in the second set of reconstructed pixels can be determined according to the current encoding block in the second direction
  • the length is determined.
  • the number of pixels in the first set of reconstructed pixels may be equal to the number of pixels corresponding to the length of the current coding block in the first direction.
  • the number of second reconstruction pixel point sets may be equal to the number of pixels corresponding to the length of the current coding block in the second direction.
  • it can be different from the preset length. For example, as shown in FIG. 5B, assume that the current coding block is the rectangular coding block C in FIG.
  • a square represents one pixel
  • the height of the rectangular coding block is 4 pixels
  • the width is 8 pixels.
  • the corresponding set of reconstructed pixels in the height direction may be a set consisting of 4 gray pixels on the left side of the current coding block.
  • the corresponding set of reconstructed pixels in the width direction may be a set consisting of 8 gray pixels above.
  • pixels in one or more of the first set of reconstructed pixel points and the second set of reconstructed pixel points are pixels adjacent to the current coding block.
  • the number of pixels on the side corresponding to the height of the current coding block is the power of r in the target system, and the number of pixels on the side corresponding to the width is the power of j in the target system.
  • r and j are positive integers.
  • the current encoding block may be an encoding block of 8 * 4 pixel size, and 8 and 4 are both powers of e of the target base 2.
  • Step S504 according to at least one of the first set of reconstructed pixel points and the second set of reconstructed pixel points, obtain a set of copied pixel points, the first set of reconstructed pixel points, the second set of reconstructed pixel points, and the pixels in the set of copied pixel points The sum of the number of points is equal to the target number.
  • obtaining the set of copied pixels according to at least one of the first set of reconstructed pixels and the second set of reconstructed pixels may include: obtaining the set of copied pixels according to the reconstructed pixels in the first set of reconstructed pixels; or , Based on the reconstructed pixels in the second set of reconstructed pixels, get a set of copied pixels; or, based on the reconstructed pixels in the first set of reconstructed pixels, and the reconstructed pixels in the second set of reconstructed pixels, get a copy Pixels collection.
  • the copied pixel point set is obtained by using at least one set of reconstructed pixel points in the first reconstructed pixel point set and the second reconstructed pixel point set.
  • all or part of the pixels in the first set of reconstructed pixels may be copied, or only all or part of the pixels in the second set of reconstructed pixels may be copied, or of course, the first All or part of the pixels in the two sets of the reconstructed pixel set and the second reconstructed pixel set are copied.
  • the number of pixels in the three sets of the first set of reconstructed pixel points, the second set of reconstructed pixel points, and the set of duplicated pixel points are added together, and the resulting sum is the target number e times Square times, the sum is the target number.
  • the number of targets is 16
  • the number of pixels in the first set of reconstructed pixels can be 8
  • the number of pixels in the second set of reconstructed pixels can be 4, and the number of pixels in the set of copied pixels Is 4.
  • the size relationship between the two lengths may be determined according to the length of the current coding block in the first direction and the length of the current coding block in the second direction, so as to determine the need for copying Rebuild the pixel collection.
  • the set of reconstructed pixels corresponding to the direction with a small length can be used as the set of copied pixels.
  • the height of the current coding block is smaller than the width, and the set of reconstructed pixels composed of 4 gray pixels on the left can be copied to obtain a set of copied pixels.
  • the set of copied pixels is composed of The four pixels are composed of the same pixels.
  • the reconstruction pixel points are selected from other columns adjacent to the first column of the current coding block, and the selected reconstruction pixel points are used as the corresponding reconstruction pixel points in the height direction.
  • Reconstruction pixel points are selected from other lines adjacent to the first line of the current coding block, and the selected reconstruction pixel points are used as corresponding reconstruction pixel points in the width direction.
  • the reconstructed pixel point may be selected from the reconstructed pixel point adjacent to the left side of the current coding block and the reconstructed pixel point adjacent to the top as the target reference pixel point to calculate the prediction value of the current coding block.
  • the number of pixels corresponding to the second set of reconstructed pixel points is greater than the number of pixels corresponding to the first set of reconstructed pixel points.
  • the ratio n of the set to the first set of reconstructed pixels is determined.
  • the number of shift bits corresponding to the left shift may be log an . That is, the first pixel statistical value is multiplied by the ratio n to obtain the shifted pixel statistical value.
  • the pixels corresponding to the first reconstructed pixel set are copied, so that the first reconstructed pixel and the second reconstructed pixel have corresponding weights when calculating the predicted value.
  • the pixel statistical value is obtained according to the shifted pixel statistical value and the second pixel statistical value corresponding to the second reconstructed pixel set.
  • width-to-height ratio of the current coding block is n
  • n is the power of the target base a
  • n is a positive integer
  • DCvalue represents the predicted value
  • a represents the target base, for example is 2.
  • w represents the width of the current encoding block, expressed by the number of pixels
  • h represents the height of the current encoding block, expressed by the number of pixels.
  • w and h are greater than or equal to 2
  • the sum of w + w is the power of the target base t
  • t is a positive integer.
  • w is 8, and h is 4.
  • the pixel position of the first row and first column of the current coding block can be expressed as (0,0), p (x, -1) refers to the pixel value of the adjacent pixel located above the current coding block, p (- 1, y) refers to the pixel value of the adjacent pixel located on the left side of the current coding block.
  • p (x, -1) represents the pixel value of the pixel above the first pixel of the first line of the current coding block
  • x is equal to w-1, it represents the first line of the current coding block
  • the ratio of the height to the width of the current coding block is n, n is the power of the target base a, and n is a positive integer, the sum of h + h is the target base u Power of multiples, u is a positive integer. That is, when the height of the current coding block is greater than the width, the reconstruction pixel point adjacent to the left side of the current coding block and the reconstruction pixel point adjacent to the top can be used to select the pixel point from these reconstruction pixel points as the target reference pixel point to encode the current The predicted value of the block is calculated, then formula (2) can be converted into formula (6) during actual calculation.
  • step S506 the reconstructed pixels in the first set of reconstructed pixel points, the second set of reconstructed pixel points, and the set of copied pixel points are used as the target reference pixel points.
  • the first set of reconstructed pixel points, the second set of reconstructed pixel points, and the reconstructed pixel points in the set of copied pixel points are all used as target reference pixels, so that the target number corresponding to the target reference pixel points is the target E times the system.
  • step S404 that is, the step of determining the target reference pixel corresponding to the current coding block may include the following steps: acquiring a first set of reconstructed pixel points corresponding to the first direction of the current coding block and a corresponding In the second set of reconstructed pixels, the reconstructed pixels in the first set of reconstructed pixels and the second set of reconstructed pixels are used as target reference pixels.
  • the first direction may be one of a height direction and a width direction
  • the second direction may be one of a height direction and a width direction, but the first direction and the second direction are different.
  • the first direction is the height direction
  • the second direction is the width direction.
  • the number of pixels in the first reconstructed pixel set and the second reconstructed pixel set can be set as required, but the sum of the number of pixels in the first reconstructed pixel set and the second reconstructed pixel set is the target number Times the power of e, which is equal to the target quantity. For example, assuming that the number of targets is 16, the number of pixels in the first reconstructed pixel set may be 9, and the number of pixels in the second reconstructed pixel set may be 7.
  • the number of reconstructed pixels in the first set of reconstructed pixels and the second set of reconstructed pixels are equal. For example, assuming that the number of targets is 8, you can obtain four reconstructed pixels from the left of the current target encoding block to form a first set of reconstructed pixels, and four reconstructed pixels from above the current target encoding block to form a second reconstructed pixel Point collection.
  • acquiring the first set of reconstructed pixels in the first direction and the second set of reconstructed pixels in the second direction of the current coding block includes:
  • Step S602 The length of the current coding block in the first direction or the second direction is taken as the target length.
  • the length of the current coding block can be expressed by the number of pixels. For example, assuming that the current coding block is a 4 * 8 coding block, the length in the width direction is 4 pixels, and the length in the height direction is 8 Pixels.
  • the length of the current coding block in either the first direction or the second direction can be used as the target length, which can be set as required.
  • the length of the current coding block in the first direction is taken as the target length.
  • the length corresponding to the direction with a longer length in the current coding block may be used as the target length. For example, if the width length of the current coding block is greater than the height length, the length of the width is the target length.
  • the length of the current coding block in the first direction is smaller than the length in the second direction, the length of the current coding block in the first direction is taken as the target length.
  • the length corresponding to the direction with a shorter length in the current coding block may be used as the target length. For example, if the width length of the current coding block is greater than the height length, the length of the height is the target length.
  • step S604 the first pixel number and the second pixel number are determined according to the target length, and the sum of the first pixel number and the second pixel number is equal to the target number.
  • the first pixel number is obtained based on the target length
  • the second pixel number is obtained based on the target length.
  • one or more of the first pixel number and the second pixel number may be the same as the pixel number corresponding to the target length, that is,
  • the number of first pixels may be the same as the number of pixels corresponding to the target length; or, the number of second pixels may be the same as the number of pixels corresponding to the target length; or, the number of first and second pixels may be the same as the number of pixels corresponding to the target length .
  • the preset number based on the target length or increase the preset number to obtain one or more of the first pixel number and the second pixel number that is, to reduce the preset number based on the target length Either increase the preset number to get the first pixel number; or, reduce the preset number based on the target length or increase the preset number to get the second pixel number; or, reduce the preset number based on the target length to get the first pixel
  • the number and the number of the second pixels or, increase the preset number on the basis of the target length to obtain the number of the first pixels and the number of the second pixels, so that the sum of the number of the first pixels and the number of the second pixels is equal to e times of the target system Square times, which is the target quantity.
  • the target length is 8
  • twice the value of 8 is 16, assuming that the target hexadecimal is 2, and 16 is the fourth power of 2, so the number of first pixels and the second number can be 8.
  • the target length is 6
  • the first pixel number may be 6
  • the second pixel number may be the target length 6 plus 4 equals 10.
  • Step S606 Select target reconstruction pixels with the first number of pixels from the reconstruction pixels in the first direction of the current coding block to form a first set of reconstruction pixels.
  • the target reconstruction pixel point can be selected from the reconstruction pixel points above and / or below the current coding block, that is, the reconstruction pixel point above the current coding block Select the target reconstruction pixel in; or select the target reconstruction pixel in the reconstruction pixel below the current coding block; or, select the target reconstruction pixel in the reconstruction pixel above and below the current coding block, the target reconstruction pixel
  • the number is the number of first pixels.
  • the target reconstruction pixel can be selected from the reconstruction pixels on the left and / or right of the current coding block, that is, the target reconstruction can be selected from the reconstruction pixels on the left of the current coding block Pixels; or, select target reconstruction pixels from the reconstruction pixels on the right of the current coding block; or, select target reconstruction pixels from the reconstruction pixels on the left and right of the current coding block, the number of target reconstruction pixels Is the number of first pixels.
  • the target reconstructed pixels are pixels adjacent to the current coding block.
  • Step S608 Select target reconstructed pixels with the second number of pixels in the second direction of the current coding block to form a second set of reconstructed pixels.
  • the target reconstruction pixel point can be selected from the reconstruction pixel points above and / or below the current coding block, that is, the reconstruction pixel point above the current coding block Select the target reconstruction pixel in; or select the target reconstruction pixel in the reconstruction pixel below the current coding block; or, select the target reconstruction pixel in the reconstruction pixel above and below the current coding block, the target reconstruction pixel
  • the number is the number of second pixels.
  • the target reconstruction pixel can be selected from the reconstruction pixels on the left and / or right of the current coding block, that is, the target reconstruction can be selected from the reconstruction pixels on the left of the current coding block Pixels; or, select target reconstruction pixels from the reconstruction pixels on the right of the current coding block; or, select target reconstruction pixels from the reconstruction pixels on the left and right of the current coding block, the number of target reconstruction pixels Is the number of second pixels.
  • the target reconstructed pixels are pixels adjacent to the current coding block.
  • step S606 is from the first direction of the current coding block
  • the target reconstruction pixels of the first number of pixels are selected from the reconstruction pixels of the pixel, and the first reconstruction pixel set includes: selecting target reconstruction pixels of the first number of pixels from adjacent reconstruction pixels in the first direction of the current encoding block , Forming a first set of reconstructed pixels, the length corresponding to the first number of pixels is less than or equal to the target length.
  • Step S608 is to select target reconstruction pixels of the second number of pixels in the second direction of the current encoding block, and to form a second set of reconstruction pixels includes: selecting adjacent reconstruction pixels of the current encoding block in the second direction according to the number of second pixels And the non-adjacent reconstructed pixels are used as target reconstructed pixels to form a second set of reconstructed pixels, the number of second pixels is greater than or equal to the number of pixels of the current encoding block in the second direction.
  • the length in the width direction is 4 pixels
  • the length in the height direction is 8 pixels.
  • the length in the height direction is greater than the length in the width direction, and the length of the current coding block in the height direction is taken as the target length, and the target length is 8.
  • the length corresponding to the pixels of the first number of pixels is less than or equal to 8, which may be 4.
  • the second pixel can be 4, which is equal to the width direction The number of pixels in the current encoding block.
  • the number of pixels of the current coding block in the second direction refers to the number of pixels corresponding to the sides in the second direction.
  • the second direction is the height direction
  • the number of pixels corresponding to the sides in the second direction is the pixels corresponding to the height sides Quantity.
  • the length of the current encoding block in the first direction is greater than the length in the second direction
  • the length of the current encoding block in the first direction is taken as the target length
  • the length corresponding to the pixels of the first number of pixels is less than or equal to the target length
  • the number of second pixels When it is greater than or equal to the number of pixels of the current encoding block in the second direction. Since the adjacent reconstruction pixel points in the first direction are greater than or equal to the target length, the target reconstruction pixel points of the first number of pixels can be screened from the adjacent reconstruction pixel points in the first direction.
  • the adjacent reconstructed pixels in the second direction are less than or equal to the number of pixels corresponding to the target length, so that the phase in the second direction
  • the number of adjacent reconstruction pixels is not enough, so adjacent reconstruction pixels and non-adjacent reconstruction pixels in the second direction are used as target reconstruction pixels.
  • the corresponding reconstruction pixel points in the height direction are reconstruction pixel points on other columns adjacent to the first column of the current coding block.
  • the corresponding reconstruction pixel points in the width direction are reconstruction pixel points on other lines adjacent to the first line of the current coding block.
  • adjacent pixels above the pixels in the first row of the current coding block, adjacent pixels to the left of the pixels in the first column, and non-adjacent pixels to the left of the pixels in the first column are used as targets Reference pixels.
  • the current coding block is the rectangular coding block C in FIG. 7
  • the height of the rectangular coding block is 4 pixels
  • the width is 8 pixels.
  • the corresponding reconstruction pixel set in the height direction may be a set consisting of 8 gray pixels on the left, and the second to sixth from top to bottom are 5 adjacent pixels on the left Point, the 7th to 9th three gray pixels are non-adjacent pixels.
  • the corresponding set of reconstructed pixels in the width direction may be a set consisting of 8 gray adjacent pixels above. If the current coding block is a rectangular coding block, the length corresponding to the width direction of the current coding block is greater than the length corresponding to the height direction, w + w is q times the target hexadecimal, and q is a positive integer, then the length corresponding to the width direction can be used as Target length.
  • the number of first pixels and the number of second pixels are obtained according to the length corresponding to the width direction, the number of shift bits corresponding to the pixel statistical value is obtained according to the length corresponding to the width direction, and the predicted value of the current encoding block is obtained according to the pixel statistical value and the number of shift bits .
  • the calculation formula of the prediction value of the current coding block can be as shown in formula (7), log a (w + w) is the number of right shifts, and is also q.
  • the other parameters in formula (7) are similar to the parameters in formula (5), and the corresponding meanings of the parameters are also similar, which will not be repeated here.
  • adjacent pixels on the left of the pixels in the first column of the current coding block, adjacent pixels above the pixels in the first row, and non-adjacent pixels above the pixels in the first row can be targeted Reference pixels.
  • the current coding block is a rectangular coding block
  • the length corresponding to the height direction of the current coding block is greater than the length corresponding to the width direction
  • h + h is the g-fold multiple of the target system
  • g is a positive integer.
  • the length corresponding to the height direction can be used as the target length.
  • the number of first pixels and the number of second pixels are obtained according to the length corresponding to the height direction, the number of shift bits corresponding to the pixel statistical value is obtained according to the length corresponding to the height direction, and the predicted value of the current encoding block is obtained based on the pixel statistical value and the number of shift bits .
  • the calculation formula of the prediction value of the current coding block can be as shown in formula (8), log a (h + h) is the right shift number, and is also g.
  • the other parameters in formula (8) are similar to the parameters in formula (5), and the corresponding meanings of the parameters are also similar, which will not be repeated here.
  • step S606 is from the first direction of the current coding block
  • the target reconstruction pixels of the first number of pixels are selected from the reconstruction pixels of the first pixel
  • the first set of reconstruction pixels includes: selecting target reconstruction pixels of the first number of pixels from adjacent reconstruction pixels in the first direction of the current coding block, A first set of reconstructed pixel points is formed, and the length corresponding to the first number of pixels is less than or equal to the target length.
  • Step S608 is to select target reconstructed pixels with a second number of pixels in the second direction of the current encoding block to form a second set of reconstructed pixels including: according to the second number of pixels, reconstructed pixels from neighboring pixels in the first direction of the current encoding block The target reconstructed pixels with the second number of pixels are selected to form a second set of reconstructed pixels.
  • the number of second pixels is smaller than the number of pixels of the current encoding block in the second direction.
  • the length corresponding to the shorter length direction is selected as the target length
  • the length corresponding to the first number of pixels is less than or equal to the target length
  • the second number of pixels is less than the number of pixels of the current encoding block in the second direction.
  • the upward neighboring reconstruction pixels are greater than or equal to the target length, so the target reconstruction pixels of the first number of pixels can be screened from the neighboring reconstruction pixels in the first direction. Since the number of second pixels is smaller than the number of pixels of the current encoding block in the second direction, the adjacent reconstructed pixels in the second direction are also larger than the number of pixels corresponding to the target length, so it can be reconstructed from the adjacent in the second direction Among the pixels, target reconstruction pixels with the second number of pixels are selected. Since the adjacent pixels are more likely to be similar to the pixels of the current coding block, the predicted value and the actual value can be made closer, and the prediction residual can be reduced.
  • adjacent pixel points to the left of the first column of pixel points in the current coding block, and some adjacent pixel points above the first row of pixel points may be used as target reference pixel points.
  • the target reference pixels above the pixels in the first row may be the same as the number of pixels in the height direction.
  • some pixels can be selected according to a preset rule, for example, one or more ways from left to right, right to left, and interval selection can be used.
  • the length corresponding to the shorter length direction is selected as the target length
  • the length corresponding to the width direction of the current coding block is greater than the length corresponding to the height direction
  • h + h is the target
  • the power of the system is L times, L is a positive integer
  • the length corresponding to the height direction of the current coding block can be selected as the target length
  • the number of first pixels and the number of second pixels can be obtained according to the length corresponding to the height direction
  • the length corresponding to the height direction The number of shifted bits corresponding to the pixel statistical value is obtained
  • the predicted value of the current coding block is obtained according to the pixel statistical value and the number of shifted bits.
  • the calculation formula of the prediction value of the current coding block is expressed as follows using formula (9) or (10).
  • the current coding block is the rectangular coding block C in FIG. 8 or FIG. 9, and the height of the rectangular coding block is 4 pixels, and the width is 8 pixels.
  • the corresponding reconstruction pixel set in the height direction in FIG. 8 may be a set consisting of 4 gray pixels on the left side, and the corresponding reconstruction pixel set in the width direction may be 4 sets on the left side in the upper part. A collection of gray pixels.
  • the corresponding reconstruction pixel set in the width direction may be 4 grays located on the right in the upper part.
  • the parameters in formula (9) and formula (10) are similar to the parameters in formula (5), and the corresponding meanings of the parameters are also similar, which will not be repeated here.
  • adjacent pixel points above the pixels in the first row of the current coding block, and some adjacent pixel points to the left of the pixels in the first column may be used as target reference pixels.
  • a part of the pixels on the left of the pixels in the first column may be the same as the number of pixels in the width direction.
  • the length corresponding to the shorter length direction is selected as the target length
  • the length corresponding to the height direction of the current coding block is greater than the length corresponding to the width direction
  • w + w is the z-th power of the target system
  • z is a positive integer.
  • the length corresponding to the width direction of the current coding block can be selected as the target length
  • the first pixel number and the second pixel number can be obtained according to the length corresponding to the width direction
  • the shift corresponding to the pixel statistical value can be obtained according to the first pixel number and the second pixel number
  • the number of bits, the predicted value of the current coding block is obtained according to the pixel statistical value and the number of shifted bits.
  • the number of first pixels and the number of second pixels are equal to the target length h
  • the calculation formula of the prediction value of the current coding block can be expressed as follows using formulas (11) and (12).
  • formula (11) for the reference pixel points corresponding to the height direction, the w adjacent pixel points on the left side of the first column of pixel points are selected as the target reference pixel points.
  • formula (12) for the reference pixel points corresponding to the height direction, the w adjacent pixel points on the left side of the first column of pixel points are selected as the target reference pixel points.
  • formulas (5) to (12) can be used for calculation. If the encoding direction is from right to left, p (x, -1) in formulas (5) to (12) can be replaced by p (x, 1), if the encoding direction is from bottom to top, then formula (5 ), P (-1, y) can be replaced by p (1, y).
  • a video decoding method is proposed.
  • the video decoding method provided in this embodiment may be applied to the terminal 110 and the server 120 in FIG. 1 described above. The following steps can be included:
  • Step S1002 Obtain the encoded data corresponding to the current block to be decoded in the video frame to be decoded.
  • the video frame to be decoded is a video frame that needs to be decoded.
  • a sequence of video frames to be decoded may include multiple video frames to be decoded.
  • the video frame to be decoded may be a video frame acquired in real time, or may be a video frame acquired in a pre-stored video sequence to be decoded.
  • the current video frame to be decoded refers to a video frame that currently needs to be decoded, and the current block to be decoded is a block to be decoded that currently needs to be decoded in the current video frame to be decoded.
  • the video frame may include one or more blocks to be decoded.
  • the encoded data corresponding to the current block to be decoded is obtained by encoding the corresponding current coding block Encode the data. Therefore, the size of the coding block and the block to be decoded are the same, and the pixel size of the block to be decoded may also include 32 * 32 pixels, 16 * 16 pixels, 8 * 8 pixels, and 4 * 4 pixels.
  • Step S1004 determine the target reference pixel corresponding to the current block to be decoded, the target number corresponding to the target reference pixel is the e-th power of the target hexadecimal, e is a positive integer, and the target hexadecimal is when calculating the predicted value of the current encoding block The hexadecimal used.
  • the step of obtaining the target reference pixel point at the decoding end may refer to the step of obtaining the target reference pixel point in the video encoding method, which will not be repeated here.
  • Step S1006 Obtain the prediction value corresponding to the current block to be decoded according to the target reference pixel.
  • the calculation method of the prediction value is corresponding to the corresponding current coding block and the current block to be decoded, so the step of obtaining the prediction value corresponding to the current block to be decoded at the decoding end can refer to video encoding The step of obtaining the prediction value corresponding to the current coding block in the method will not be repeated here.
  • determining the target reference pixel corresponding to the current block to be decoded includes obtaining the first set of reconstructed pixel points in the first direction and the second set of reconstructed pixel points in the second direction of the current block to be decoded.
  • Reconstructed pixels in a set of reconstructed pixels and reconstructed pixels in a set of second reconstructed pixels serve as target reference pixels; the number of pixels in the first set of reconstructed pixels and the number of pixels in the second set of reconstructed pixels The sum of the number of pixels is equal to the target number.
  • determining the target reference pixel corresponding to the current block to be decoded includes: acquiring a first set of reconstructed pixels in the first direction of the current block to be decoded, and acquiring second reconstructed pixels in the second direction of the current decoded block Set; according to at least one of the first set of reconstructed pixels and the second set of reconstructed pixels, a set of copied pixels is obtained; the number of pixels in the first set of reconstructed pixels, the pixels in the second set of reconstructed pixels The sum of the number and the number of pixels in the set of copied pixels is equal to the target number, and the first set of reconstructed pixels, the second set of reconstructed pixels, and the reconstructed pixels in the set of copied pixels are targeted Reference pixels.
  • obtaining the duplicate pixel set according to at least one of the first reconstructed pixel set and the second reconstructed pixel set may include: obtaining the duplicate pixel set according to the reconstructed pixels in the first reconstructed pixel set; Or, based on the reconstructed pixels in the second set of reconstructed pixels, a set of copied pixels is obtained; or, based on the reconstructed pixels in the first set of reconstructed pixels and the reconstructed pixels in the second set of reconstructed pixels, a copy is obtained Pixels collection.
  • step S1006 that is, obtaining the predicted value corresponding to the current block to be decoded according to the target reference pixel includes: summing the pixel values of the target reference pixel to obtain a pixel statistical value; obtaining a shift bit according to the target number The number is calculated according to the number of shifted bits and the statistical value of pixels to obtain a shift result, and the predicted value corresponding to the current block to be decoded is obtained according to the shift result.
  • Step S1008 Decode the encoded data according to the predicted value to obtain the video image block corresponding to the current block to be decoded.
  • the pixel value of the video image block is obtained according to the sum of the prediction residual in the encoded data and the prediction value.
  • the decoding process may be determined according to the encoding process.
  • the decoding process may further include at least one of inverse transform, inverse quantization, and entropy decoding.
  • the above video decoding method can be predicted by acquiring target reference pixels with the same number as the e-th power of the target base, which is the base used to calculate the predicted value.
  • the average pixel value of the target reference pixel needs to be obtained, that is, the total pixel value of the target reference pixel is divided by the target number to obtain the average pixel value. If the target number is the e-th power of the target hexadecimal, the shift operation can be used to avoid the division operation, so the calculation speed of calculating the predicted value during video encoding can be increased, and the encoding efficiency is improved.
  • obtaining the first set of reconstructed pixels in the first direction of the current block to be decoded and the second set of reconstructed pixels in the second direction may include: converting the current block to be decoded in the first direction or the second direction The length of is taken as the target length; the number of first pixels and the number of second pixels are determined according to the target length, the sum of the number of first pixels and the number of second pixels is equal to the target number; Target reconstruction pixels of the first number of pixels form a first set of reconstruction pixels; target reconstruction pixels of the second number of pixels are selected from the second direction of the current block to be decoded to form a second set of reconstruction pixels.
  • using the length of the current block to be decoded in the first direction or the second direction as the target length includes: when the length of the current block to be decoded in the first direction is greater than the length in the second direction, changing the length in the first direction The length of the current block to be decoded is taken as the target length.
  • Selecting target reconstruction pixels of the first number of pixels from the reconstruction pixels in the first direction of the current block to be decoded, and forming the first set of reconstruction pixels includes: from adjacent reconstruction pixels in the first direction of the current block to be decoded Select target reconstruction pixels of the first number of pixels to form a first set of reconstruction pixels.
  • the length corresponding to the pixels of the first number of pixels is less than or equal to the target length; select the target of the second number of pixels from the second direction of the current block to be decoded
  • Reconstructing pixels to form a second set of reconstructed pixels includes: selecting adjacent reconstructed pixels in the second direction of the current block to be decoded and non-adjacent reconstructed pixels according to the number of second pixels as target reconstructed pixels to form a second reconstruction
  • the number of second pixels is greater than or equal to the number of pixels of the current block to be decoded in the second direction.
  • using the length of the current block to be decoded in the first direction or the second direction as the target length includes: when the length of the current block to be decoded in the first direction is less than the length in the second direction, changing the length in the first direction The length of the current block to be decoded is taken as the target length.
  • Selecting target reconstruction pixels of the first number of pixels from the reconstruction pixels in the first direction of the current block to be decoded, forming the first set of reconstruction pixels includes: selecting from neighboring reconstruction pixels in the first direction of the current block to be decoded Target reconstruction pixels of the first number of pixels constitute the first set of reconstruction pixels, and the length corresponding to the pixels of the first number of pixels is less than or equal to the target length; the target reconstruction of the second number of pixels is selected from the second direction of the current block to be decoded Pixels, forming a second set of reconstructed pixels include: selecting target reconstructed pixels of a second number of pixels from adjacent reconstructed pixels in the first direction of the current block to be decoded according to the number of second pixels to form a second set of reconstructed pixels The number of second pixels is smaller than the number of pixels of the current block to be decoded in the second direction.
  • the video encoding method and the video decoding method provided in the embodiments of the present application will be described below with an embodiment, assuming that the width of the current encoding block is 8 pixels, the height is 4 pixels, and the target base is binary.
  • the encoding end obtains the current video frame in the video frame sequence, assuming the third video frame, and the first two video frames have been encoded.
  • the current video frame is divided, assuming that it is divided into 16 coding blocks.
  • the first 9 have been coded, so the 10th coded block is used as the current coded block.
  • the coding block C in FIG. 5B and FIGS. 7 to 9 may be used as the current coding block.
  • the encoding end determines the prediction mode of the current coding block. If the prediction mode is the DC prediction mode, go to step 3. Otherwise, perform video coding according to the video coding method corresponding to other prediction modes, for example, if the prediction mode of the current coding block is a frame In inter prediction mode, inter prediction coding is performed.
  • the encoding end determines the target reference pixel corresponding to the current encoding block.
  • the gray pixels on the left and above the current coding block are used as target reference pixels.
  • the encoding end performs a sum operation on the pixel values of the target reference pixel to obtain pixel statistical values.
  • the pixel values of each target reference pixel are added to obtain a pixel value sum as a pixel statistical value.
  • the encoding end obtains the number of shifted bits according to the target number, performs shift calculation according to the number of shifted bits and pixel statistical values, obtains a shift result, and obtains a predicted value corresponding to the current encoding block according to the shift result.
  • the target base is used as the base of the logarithmic function
  • the target number is used as the independent variable to calculate the number of shifts. For example, if the number of target reference pixels is 16, the number of shifts is log 2 16, which is 4. The bit direction is right shift. If the pixel statistic value is 1100000 (binary), then the 1100000 (binary) is shifted right by four bits.
  • the encoding end performs video encoding on the current encoding block according to the predicted value to obtain encoded data
  • the encoding end sends the encoded data to the decoding end through the channel, and the decoding end obtains the encoding data corresponding to the current block to be decoded.
  • the decoding end determines that the current encoding block is the DC prediction mode according to the encoded data, and proceeds to step 9, otherwise, the video decoding method corresponding to other prediction modes is used for video decoding.
  • the decoding end determines the target reference pixel corresponding to the current block to be decoded.
  • the decoding end performs a sum operation on the pixel values of the target reference pixels to obtain pixel statistical values.
  • the decoding end obtains the number of shifted bits according to the target number, performs shift calculation according to the number of shifted bits and pixel statistical values, obtains a shift result, and uses the shift result as the prediction value corresponding to the current block to be decoded.
  • the decoding end decodes the encoded data according to the predicted value to obtain the video image block corresponding to the current block to be decoded.
  • a video encoding device is provided.
  • the video encoding device may be integrated into the terminal 110 and the server 120 described above, and may include a current encoding block acquisition module 1102 and a first determination module 1104 , A first predicted value calculation module 1106 and an encoding module 1108.
  • the current coding block obtaining module 1102 is used to obtain the current coding block to be coded in the current video frame.
  • the first determination module 1104 is used to determine the target reference pixel corresponding to the current encoding block, the target number corresponding to the target reference pixel is the e-th power of the target base, e is a positive integer, and the target base is the calculation of the current encoding block The hexadecimal value used when predicting the value.
  • the first prediction value calculation module 1106 is configured to obtain the prediction value corresponding to the current coding block according to the target reference pixel.
  • the encoding module 1108 is configured to perform video encoding on the current encoding block according to the predicted value to obtain encoded data.
  • the first predicted value calculation module 1106 is used to: sum the pixel values of the target reference pixel to obtain the pixel statistical value; obtain the shifted number of bits according to the target number, and the shifted number of bits and pixels The statistical value is used for shift calculation to obtain a shift result, and the predicted value corresponding to the current coding block is obtained according to the shift result.
  • the first determining module 1104 is configured to: obtain a first set of reconstructed pixel points corresponding to the first direction of the current coding block and a second set of reconstructed pixel points corresponding to the second direction, and convert the first reconstructed pixel points
  • the reconstructed pixels in the set and the second reconstructed pixel set serve as target reference pixels; the sum of the number of reconstructed pixels in the first reconstructed pixel set and the number of reconstructed pixels in the second reconstructed pixel set, Equal to the target quantity.
  • the first determining module 1104 includes:
  • a first reconstruction point set acquisition unit configured to acquire a first reconstruction pixel set corresponding to the first direction of the current coding block and a second reconstruction pixel set corresponding to the second direction;
  • the first copying unit is configured to obtain a set of reconstructed pixels according to at least one of the first set of reconstructed pixel points and the second set of reconstructed pixel points, the first set of reconstructed pixel points, the second set of reconstructed pixel points And the sum of the number of pixels in the set of copied pixels is equal to the target number;
  • the first pixel determining unit is configured to use the reconstructed pixels in the first set of reconstructed pixels, the second set of reconstructed pixels, and the set of copied pixels as target reference pixels.
  • the reconstruction point set acquisition unit includes:
  • the length determining unit is used to take the length of the current coding block in the first direction or the second direction as the target length
  • the number determining unit is used to determine the first pixel number and the second pixel number according to the target length, and the sum of the first pixel number and the second pixel number is equal to the target number;
  • a first selection unit configured to select target reconstruction pixels with a first number of pixels from the reconstruction pixels in the first direction of the current coding block to form a first reconstruction pixel set
  • the second selection unit is used to select target reconstruction pixels with a second number of pixels from the second direction of the current coding block to form a second reconstruction pixel set.
  • the length determining unit is configured to: when the length of the current coding block in the first direction is greater than the length in the second direction, use the length of the current coding block in the first direction as the target length.
  • the first selection unit is used to: select target reconstruction pixels of the first number of pixels from adjacent reconstruction pixels in the first direction of the current coding block to form a first set of reconstruction pixels, and the length corresponding to the pixels of the first number of pixels Less than or equal to the target length.
  • the second selection unit is used to select adjacent reconstruction pixels and non-adjacent reconstruction pixels in the second direction of the current coding block according to the number of second pixels, and use the selected reconstruction pixels as target reconstruction pixels to form a second Reconstructing the pixel set, the number of second pixels is greater than the number of pixels of the current encoding block in the second direction.
  • the length determining unit is configured to: when the length of the current coding block in the first direction is smaller than the length in the second direction, use the length of the current coding block in the first direction as the target length.
  • the first selection unit is used to: select target reconstruction pixels of the first number of pixels from adjacent reconstruction pixels in the first direction of the current coding block to form a first set of reconstruction pixels, corresponding to the pixels of the first number of pixels
  • the length is less than or equal to the target length.
  • the second selection unit is used to: according to the number of second pixels, select target reconstruction pixels of the second number of pixels from adjacent reconstruction pixels in the first direction of the current coding block to form a second set of reconstruction pixels, the second The number of pixels is smaller than the number of pixels of the current encoding block in the second direction.
  • a video decoding device is provided.
  • the video decoding device may be integrated into the above-mentioned terminal 110 or server 120.
  • the terminal 110 or server 120 may include an encoded data acquisition module 1202, The second determination module 1204, the second predicted value calculation module 1206, and the decoding module 1208.
  • the coded data obtaining module 1202 is configured to obtain coded data corresponding to the current block to be decoded in the video frame to be decoded.
  • the second determination module 1204 is used to determine the target reference pixel corresponding to the current block to be decoded, the target number corresponding to the target reference pixel is the e-th power of the target base, e is a positive integer, and the target base is the calculation of the current encoding The base number used when predicting the block.
  • the second prediction value calculation module 1206 is configured to obtain the prediction value corresponding to the current block to be decoded according to the target reference pixel.
  • the decoding module 1208 is configured to decode the encoded data according to the prediction value to obtain the video image block corresponding to the current block to be decoded.
  • the second predicted value calculation module 1206 is used to: sum the pixel values of the target reference pixel points to obtain the pixel statistical value; obtain the shifted number of bits according to the target number, according to the shifted number of bits and pixels The statistical value is used for shift calculation to obtain a shift result, and the predicted value corresponding to the current block to be decoded is obtained according to the shift result.
  • the second determination module 1204 is configured to: obtain a first set of reconstructed pixels in the first direction and a second set of reconstructed pixels in the second direction of the current block to be decoded, and combine the first set of reconstructed pixels And the reconstructed pixels in the second set of reconstructed pixels serve as target reference pixels; the sum of the number of pixels in the first set of reconstructed pixels and the number of pixels in the second set of reconstructed pixels is equal to the target number.
  • the second determination module 1204 includes:
  • the second reconstruction point set acquisition unit is used to acquire a first reconstruction pixel set in the first direction and a second reconstruction pixel set in the second direction of the current block to be decoded.
  • a second copying unit configured to obtain a set of copied pixels according to at least one of the first set of reconstructed pixels and the second set of reconstructed pixels; the number of pixels in the first set of reconstructed pixels, the second reconstructed pixels The sum of the number of pixels in the point set and the number of pixels in the copied pixel set is equal to the target number.
  • the second pixel determination unit is configured to use the reconstructed pixels in the first set of reconstructed pixels, the second set of reconstructed pixels, and the set of copied pixels as target reference pixels.
  • FIG. 13 shows an internal structure diagram of a computer device in an embodiment.
  • the computer device may be the terminal 110 in FIG. 1.
  • the computer device includes the computer device including a processor, a memory, a network interface, an input device, and a display screen connected through a system bus.
  • the memory includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium of the computer device stores an operating system and may also store a computer program.
  • the processor may enable the processor to implement at least one of a video encoding method and a video decoding method.
  • a computer program may also be stored in the internal memory.
  • the processor may cause the processor to execute at least one of the video encoding method and the video decoding method.
  • the display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen
  • the input device of the computer device may be a touch layer covered on the display screen, or may be a button, a trackball, or a touch pad provided on the computer device casing. It can be an external keyboard, touchpad, or mouse.
  • FIG. 14 shows an internal structure diagram of a computer device in an embodiment.
  • the computer device may be the server 120 in FIG. 1.
  • the computer device includes the computer device including a processor, a memory, and a network interface connected through a system bus.
  • the memory includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium of the computer device stores an operating system and may also store a computer program.
  • the processor may enable the processor to implement at least one of a video encoding method and a video decoding method.
  • a computer program may also be stored in the internal memory.
  • the processor may cause the processor to execute at least one of the video encoding method and the video decoding method.
  • FIGS. 13 and 14 are only block diagrams of some structures related to the solution of the present application, and do not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the computer device may Include more or less components than shown in the figure, or combine certain components, or have a different arrangement of components.
  • the video encoding apparatus may be implemented in the form of a computer program, and the computer program may run on the computer equipment shown in FIGS. 13 and 14.
  • the memory of the computer device may store various program modules constituting the video encoding device, for example, the current encoding block acquisition module 1102, the first determination module 1104, the first prediction value calculation module 1106, and the encoding module 1108 shown in FIG.
  • the computer program constituted by each program module causes the processor to execute the steps in the video encoding method of each embodiment of the present application described in this specification.
  • the computer device shown in FIGS. 13 and 14 may obtain the current coding block to be coded in the current video frame through the current coding block obtaining module 1102 in the video coding apparatus shown in FIG. 11.
  • the first determination module 1104 determines the target reference pixel corresponding to the current coding block, the target number corresponding to the target reference pixel is the e-th power of the target base, e is a positive integer, and the target base is the prediction for calculating the current encoding block The base number used for the value.
  • the first predicted value calculation module 1106 obtains the predicted value corresponding to the current coding block according to the target reference pixel.
  • the encoding module 1108 performs video encoding on the current encoding block according to the predicted value to obtain encoded data.
  • the video decoding apparatus provided in this application may be implemented in the form of a computer program, and the computer program may run on a computer device as shown in FIG. 13 or 14.
  • the memory of the computer device may store various program modules constituting the video decoding device, for example, the encoded data acquisition module 1202, the second determination module 1204, the second prediction value calculation module 1206, and the decoding module 1208 shown in FIG.
  • the computer program composed of each program module causes the processor to execute the steps in the video decoding method of each embodiment of the present application described in this specification.
  • the computer device shown in FIGS. 13 and 14 may obtain the encoded data corresponding to the current block to be decoded in the video frame to be decoded through the encoded data acquisition module 1202 in the video decoding apparatus shown in FIG.
  • the second determination module 1204 determines the target reference pixel corresponding to the current block to be decoded, the target number corresponding to the target reference pixel is the e-th power of the target base, e is a positive integer, and the target base is the calculation of the current encoding block The base number used when predicting the value.
  • the second predicted value calculation module 1206 obtains the predicted value corresponding to the current block to be decoded according to the target reference pixel.
  • the decoding module 1208 decodes the encoded data according to the prediction value to obtain the video image block corresponding to the current block to be decoded.
  • a computer device including a memory and a processor.
  • the memory stores a computer program.
  • the processor is caused to perform the following operations:
  • the target number corresponding to the target reference pixel is the e-th power of the target hexadecimal, e is a positive integer, and the target hexadecimal is the input used when calculating the predicted value of the current coding block.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the number of shift bits is obtained according to the target number, the shift calculation is performed according to the number of shift bits and the statistical value of pixels, and the shift result is obtained, and the predicted value corresponding to the current coding block is obtained according to the shift result.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the sum of the number of reconstructed pixels in the first set of reconstructed pixels and the number of reconstructed pixels in the second set of reconstructed pixels is equal to the target number.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • a set of copied pixels, the number of pixels in the first set of reconstructed pixels, the second set of reconstructed pixels, and the set of copied pixels are obtained The sum is equal to the target number;
  • the reconstructed pixels in the first set of reconstructed pixel points, the second set of reconstructed pixel points, and the set of copied pixel points are used as target reference pixels.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the length of the current coding block in the first direction is taken as the target length
  • Selecting the target reconstruction pixel points of the first number of pixels from the reconstruction pixel points in the first direction of the current coding block to form the first reconstruction pixel set includes:
  • Selecting target reconstructed pixels with the second number of pixels in the second direction of the current coding block to form the second reconstructed pixel set includes:
  • the number of second pixels select adjacent reconstruction pixels and non-adjacent reconstruction pixels in the second direction of the current coding block, and use the selected reconstruction pixels as target reconstruction pixels to form a second set of reconstruction pixels.
  • the number of pixels is greater than or equal to the number of pixels of the current encoding block in the second direction.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the length of the current coding block in the first direction is smaller than the length in the second direction, the length of the current coding block in the first direction is taken as the target length;
  • Selecting the target reconstruction pixel points of the first number of pixels from the reconstruction pixel points in the first direction of the current coding block to form the first reconstruction pixel set includes:
  • Selecting target reconstructed pixels with the second number of pixels in the second direction of the current coding block to form the second reconstructed pixel set includes:
  • the number of second pixels from the adjacent reconstruction pixels in the first direction of the current coding block, select target reconstruction pixels of the second number of pixels to form a second set of reconstruction pixels, the number of second pixels is smaller than that in the second direction The number of pixels in the current encoding block.
  • a computer device including a memory and a processor.
  • the memory stores a computer program.
  • the processor is caused to perform the following operations:
  • the target number corresponding to the target reference pixel is the e-th power of the target base, e is a positive integer, and the target base is the one used when calculating the predicted value of the current encoding block Hexadecimal
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the number of shift bits is obtained according to the target number, the shift calculation is performed according to the number of shift bits and the statistical value of pixels, and the shift result is obtained, and the predicted value corresponding to the current block to be decoded is obtained according to the shift result.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the sum of the number of pixels in the first set of reconstructed pixels and the number of pixels in the second set of reconstructed pixels is equal to the target number.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • a duplicate pixel set is obtained, the number of pixels in the first reconstructed pixel set, the number of pixels in the second reconstructed pixel set
  • the sum of the number of pixels in the set of duplicated pixel points is equal to the target number
  • the reconstructed pixels in the first set of reconstructed pixel points, the second set of reconstructed pixel points, and the set of copied pixel points are used as target reference pixels.
  • a computer-readable storage medium which stores a computer program.
  • the processor is caused to perform the following operations:
  • the target number corresponding to the target reference pixel is the e-th power of the target hexadecimal, e is a positive integer, and the target hexadecimal is the input used when calculating the predicted value of the current coding block.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the number of shift bits is obtained according to the target number, the shift calculation is performed according to the number of shift bits and the statistical value of pixels, and the shift result is obtained, and the predicted value corresponding to the current coding block is obtained according to the shift result.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the sum of the number of reconstructed pixels in the first set of reconstructed pixels and the number of reconstructed pixels in the second set of reconstructed pixels is equal to the target number.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • a set of copied pixels, the number of pixels in the first set of reconstructed pixels, the second set of reconstructed pixels, and the set of copied pixels are obtained The sum is equal to the target number;
  • the reconstructed pixels in the first set of reconstructed pixel points, the second set of reconstructed pixel points, and the set of copied pixel points are used as target reference pixels.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the length of the current coding block in the first direction is taken as the target length
  • Selecting the target reconstruction pixel points of the first number of pixels from the reconstruction pixel points in the first direction of the current coding block to form the first reconstruction pixel set includes:
  • Selecting target reconstructed pixels with the second number of pixels in the second direction of the current coding block to form the second reconstructed pixel set includes:
  • the number of second pixels select adjacent reconstruction pixels and non-adjacent reconstruction pixels in the second direction of the current coding block, and use the selected reconstruction pixels as target reconstruction pixels to form a second set of reconstruction pixels.
  • the number of pixels is greater than or equal to the number of pixels of the current encoding block in the second direction.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the length of the current coding block in the first direction is smaller than the length in the second direction, the length of the current coding block in the first direction is taken as the target length;
  • Selecting the target reconstruction pixel points of the first number of pixels from the reconstruction pixel points in the first direction of the current coding block to form the first reconstruction pixel set includes:
  • Selecting target reconstructed pixels with the second number of pixels in the second direction of the current coding block to form the second reconstructed pixel set includes:
  • the number of second pixels from the adjacent reconstruction pixels in the first direction of the current coding block, select target reconstruction pixels of the second number of pixels to form a second set of reconstruction pixels, the number of second pixels is smaller than that in the second direction The number of pixels in the current encoding block.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the target number corresponding to the target reference pixel is the e-th power of the target base, e is a positive integer, and the target base is the one used when calculating the predicted value of the current encoding block Hexadecimal
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the number of shift bits is obtained according to the target number, the shift calculation is performed according to the number of shift bits and the statistical value of pixels, and the shift result is obtained, and the predicted value corresponding to the current block to be decoded is obtained according to the shift result.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • the sum of the number of pixels in the first set of reconstructed pixels and the number of pixels in the second set of reconstructed pixels is equal to the target number.
  • the processor when the computer program is executed by the processor, the processor is caused to perform the following operations:
  • a duplicate pixel set is obtained, the number of pixels in the first reconstructed pixel set, the number of pixels in the second reconstructed pixel set
  • the sum of the number of pixels in the set of duplicated pixel points is equal to the target number
  • the reconstructed pixels in the first set of reconstructed pixel points, the second set of reconstructed pixel points, and the set of copied pixel points are used as target reference pixels.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Syechliek) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Road (Syechliek) DRAM
  • SLDRAM synchronous chain Road (Syechliek) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Algebra (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本申请涉及一种视频编码、视频解码方法、装置、计算机设备和存储介质,所述视频编码方法包括:获取当前视频帧中待编码的当前编码块;确定所述当前编码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;根据所述目标参考像素点得到所述当前编码块对应的预测值;根据所述预测值对所述当前编码块进行视频编码,得到编码数据。上述方法可以提高编码效率。

Description

视频编码、视频解码方法、装置、计算机设备和存储介质
本申请要求于2018年10月15日提交、申请号为201811197962.5、发明名称为“视频编码、视频解码方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别是涉及视频编码、视频解码方法、装置、计算机设备和存储介质。
背景技术
随着多媒体技术和网络技术的飞速发展和广泛应用,人们在日常生活和生产活动中大量使用视频信息。为了减少视频的传输数据量或者存储数据量,需要对视频进行压缩编码。
进行视频编码时,通常需要获取多个参考像素值的平均值,来得到编码块的预测值,再根据预测值进行视频编码。而在获取多个参考像素值的平均值时,会用到除法运算,而除法运算在计算机设备中的运算周期比较长,因此计算速度慢,视频编码效率低。
发明内容
基于此,本申请实施例提供一种视频编码、视频解码方法、装置、计算机设备和存储介质,可以用于解决上述视频编码效率低的问题。
一种视频编码方法,所述方法包括:获取当前视频帧中待编码的当前编码块;确定所述当前编码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;根据所述目标参考像素点得到所述当前编码块对应的预测值;根据所述预测值对所述当前编码块进行视频编码,得到编码数据。
一种视频编码装置,所述装置包括:当前编码块获取模块,用于获取当前视频帧中待编码的当前编码块;第一确定模块,用于确定所述当前编码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;第一预测值计算模块,用于根据所述目标参考像素点得到所述当前编码块对应的预测值;编码模块,用于根据所述预测值对所述当前编码块进行视频编码,得到编码数据。
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
获取当前视频帧中待编码的当前编码块;
确定所述当前编码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;
根据所述目标参考像素点得到所述当前编码块对应的预测值;
根据所述预测值对所述当前编码块进行视频编码,得到编码数据。
一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行上述视频编码方法的步骤。
上述视频编码方法、装置、计算机设备和存储介质,可通过获取数量与目标进制的e次方倍相同的目标参考像素点进行预测,目标进制为计算预测值所采用的进制。在通过目标参考像素点进行预测时,需要获取目标参考像素点的像素平均值,也即,将目标参考像素点的像素值总和除以目标数量,得到像素平均值。若目标数量为目标进制的e次方倍,则可以采用移位操作,避免了除法运算,因此能够提高视频编码时计算预测值的计算速度,提高了编码效率。
一种视频解码方法,所述方法包括:获取待解码视频帧中的当前待解码块对应的编码数据;确定所述当前待解码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;根据所述目标参考像素点得到所述当前待解码块对应的预测值;根据所述预测值对所述编码数据进行解码,得到所述当前待解码块对应的视频图像块。
一种视频解码装置,所述装置包括:编码数据获取模块,用于获取待解码视频帧中的当前待解码块对应的编码数据;第二确定模块,用于确定所述当前待解码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;第二预测值计算模块,用于根据所述目标参考像素点得到所述当前待解码块对应的预测值;解码模块,用于根据所述预测值对所述编码数据进行解码,得到所述当前待解码块对应的视频图像块。
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
获取待解码视频帧中的当前待解码块对应的编码数据;
确定所述当前待解码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;
根据所述目标参考像素点得到所述当前待解码块对应的预测值;
根据所述预测值对所述编码数据进行解码,得到所述当前待解码块对应的视频图像块。
一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行上述视频解码方法的步骤。
上述视频解码方法、装置、计算机设备和存储介质,可通过获取数量与目标进制的e次方倍相同的目标参考像素点进行预测,目标进制为计算预测值所采用的进制。在通过目标参考像素点进行预测时,需要获取目标参考像素点的像素平均值,也即,将目标参考像素点的像素值总和除以目标数量,得到像素平均值。若目标数量为目标进制的e次方倍,则可以采用移位操作,避免了除法运算,因此能够提高视频编码时计算预测值的计算速度,提高了编码效率。
附图说明
图1为一个实施例中提供的视频编码方法的应用环境图;
图2为一个实施例中提供的视频编码方法对应的编码框架图;
图3为一个实施例中提供的视频解码方法对应的解码框架图;
图4A为一个实施例中视频编码方法的流程图;
图4B为一个实施例中图像块的划分示意图;
图5A为一个实施例中确定当前编码块对应的目标参考像素点的流程图;
图5B为一个实施例中当前编码块与对应的目标参考像素点的示意图;
图6为一个实施例中获取当前编码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合的流程图;
图7为一个实施例中当前编码块与对应的目标参考像素点的示意图;
图8为一个实施例中当前编码块与对应的目标参考像素点的示意图;
图9为一个实施例中当前编码块与对应的目标参考像素点的示意图;
图10为一个实施例中视频解码方法的流程图;
图11为一个实施例中视频编码装置的结构框图;
图12为一个实施例中视频解码装置的结构框图;
图13为一个实施例中计算机设备的内部结构框图;
图14为一个实施例中计算机设备的内部结构框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但除非特别说明,这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一方向称为第二方向,且类似地,可将第二方向称为第一方向。
图1为一个实施例中提供的视频编码方法的应用环境图,如图1所示,在该应用环境中,包括终端110以及服务器120。
图1为一个实施例中提供的视频编码方法以及视频解码方法的应用环境图,如图1所示,在该应用环境中,包括终端110以及服务器120。终端110可以通过编码器进行视频编码,或者通过解码器进行视频解码;终端110也可以通过处理器运行视频编码程序进行视频编码,或者通过处理器运行视频解码程序进行视频解码,本申请实施例对此不作具体限定。
服务器120可以通过编码器进行视频编码,或者通过解码器进行视频解码。服务器120也可以通过处理器运行视频编码程序进行视频编码,或者通过处理器运行视频解码程序进行视频解码。
例如,服务器120通过输入接口接收到终端110发送的编码数据后,可直接传递至处理器进行解码,也可存储至数据库中等待后续解码。当然,服务器120也可以在获取终端110发送的编码数据后,发送到对应的接收终端中,由接收终端进行解码。又如,服务器120通过输入接口接收到终端110发送的视频帧后,通过处理器对视频帧编码得到编码数据后,可直接通过输出接口发送至终端110,也可将编码数据存储至数据库中等待后续传递,本申请实施例对此不作具体限定。
终端110和服务器120可以通过网络连接。终端110可以是台式终端或移动终端,移动 终端可以包括手机、平板电脑以及笔记本电脑等中的至少一种,但并不局限于此。服务器120可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
图2为一个实施例中提供的视频编码方法对应的编码框架图,本申请实施例提供的视频编码方法可以获取视频序列的各个视频帧进行编码,得到对应的编码数据,并通过存储发送单元218执行存储或者发送编码数据中的一个或多个步骤。其中,在视频帧获取单元202处,获取当前视频帧。
在第一预测单元204处,可以对当前视频帧的各个编码块进行帧内预测或者帧间预测。例如,当编码块的预测模式为帧间预测时,根据编码块对应的参考块的图像值得到预测值以及对应的运动矢量,将编码块实际值与预测值相减得到预测残差,运动矢量表示编码块相对于参考块的位移。当编码块的预测模式为帧内预测模式时,根据帧内预测模式的类型获取当前视频帧内的参考像素点,计算对应的预测值,将编码块实际值与预测值相减得到预测残差。
在变换单元206处,将空间域中的预测残差以及矢量信息变换到频率域,并可以对变换系数进行编码。变换的方法可以为离散傅里叶变换或者离散余弦变换等等,矢量信息可以为表示位移的实际运动矢量或者运动矢量差值,运动矢量差值为实际运动矢量与预测运动矢量的差值。
在量化单元208处,将变换后的数据映射成另一个数值,例如可以通过变换后的数据除以量化步长得到一个较小的值。量化参数是量化步长对应的序号,其中,量化参数的取值为整数。根据量化参数可以查找到对应的量化步长。量化参数小,则图像帧的大部分的细节都会被保留,对应的码率高。量化参数大,则对应的码率低,但图像失真较大、质量不高。
量化的原理用公式表示如下:FQ=roued(y/Qstep)。其中,y为量化之前视频帧对应的预测残差,Qstep为量化步长,FQ为对y进行量化得到的量化值。Roued(x)函数指将取值进行四舍六入五取偶,即当取值的最末位小于等于四时,舍去;当取值的最末位大于等于六时,进一;当取值的最末位为五时,若五后面有数字,则舍五进一;若五后无数字,且五的前一位数字为奇数,则舍五进一;若五的前一位数字为偶数,则舍五不进。量化参数与量化步长的对应关系可以根据需要进行设置。例如,在一些视频编码标准中,对于亮度编码而言,量化步长共有52个值,为0~51之间的整数,对于色度编码,量化步长的取值为0~39之间的整数,且量化步长随着量化参数的增加而增加,每当量化参数增加6,量化步长便增加一倍。
熵编码单元216用于进行熵编码,熵编码为按熵原理进行编码,且不丢失任何信息的数据编码方式,能够利用较小的字符来表达一定的信息。熵编码方法例如可以为香农编码(shaeeoe)或者哈夫曼编码(huffmae)等。
第一反量化单元210、第一反变换单元212以及重建单元214是重建路径对应的单元,利用重建路径的各个单元进行帧的重建得到参考帧,能够保持编码以及解码中参考帧的一致。其中第一反量化单元210进行的步骤是进行量化的逆过程,第一反变换单元212进行的步骤是是变换单元206进行变换的逆过程,重建单元214用于将反变换得到的残差数据加上预测数据得到重建参考帧。
图3为一个实施例中提供的视频解码方法对应的解码框架图,本申请实施例提供的视频解码方法可以通过编码数据获取单元300获取待解码视频序列的各个待解码视频帧对应的编码数据,通过熵解码单元302进行熵解码后,得到熵解码数据,第二反量化单元304对熵解码数据进行反量化,得到反量化数据,第二反变换单元306对反量化数据进行反变换,得到反变换的数据,该反变换的数据可以与图2中第一反变换单元212进行反变换后得到的数据 是一致的。
第二预测单元308根据待解码块的预测模式对待解码块进行帧内预测或者帧间预测,例如当为帧间预测时,根据编码数据中携带的运动矢量信息获取待解码块对应的目标参考块,根据目标参考块的图像值得到与图2中的预测值一致的预测值,根据预测值以及编码数据中的预测残差得到解码视频数据块的像素值,其中,参考块是从第二预测单元308已经解码得到的参考帧中获取的。
当编码块的预测模式为帧内预测模式时,根据帧内预测模式的类型获取当前视频帧内的参考像素点,计算对应的预测值,将编码块实际值与预测值相减得到预测残差。播放存储单元310可以对解码得到的视频帧执行播放视频以及存储视频中的一个或多个步骤。
可以理解,上述的编码框架图、解码框架图仅是一种示例,并不构成对本申请方案所应用于的编码方法的限定,编码框架图以及解码框架图可以包括比图中所示更多或更少的单元,或者组合某些单元,或者具有不同的部件单元不知。例如,还可以对重建视频帧进行环路滤波,降低视频帧的方块效应,以提高视频质量。
在本申请实施例中,将执行编码的一端称为编码端,将执行解码的一端称为解码端。编码端和解码端可以是同一端或者不同端,上述计算机设备比如终端以及服务器,可以是编码端也可以是解码端。
如图4A所示,在一个实施例中,提出了一种视频编码方法,本实施例提供的视频编码方法可以应用于上述图1中的终端110以及服务器120中。可以包括以下步骤:
步骤S402,获取当前视频帧中待编码的当前编码块。
视频帧是构成视频的单位,视频帧可以是计算机设备实时采集的视频帧,例如可以是通过终端的摄像头实时获取的视频帧。视频帧也可以是预先存储的视频序列对应的视频帧。一个视频可以看做一个视频帧序列,一个视频帧序列可以包括多个视频帧。当前视频帧是指当前需要编码的视频帧,可以为多个视频帧中的任一视频帧,当前编码块是当前视频帧中当前需要编码的编码块。视频帧可以包括一个或多个编码块,视频帧中编码块的大小可以根据需要进行设置。例如可以将一个视频帧分为多个大小为4*8或8*4像素的编码块。视频帧中编码块的大小也可以通过计算各种编码块的划分方式对应的率失真代价,选择率失真代价小的划分方式进行编码块的划分。如图4B所示为一个64*64像素图像块的划分示意图,其中的一个方块代表一个编码块。由图4B可知,编码块的大小可以包括32*32像素、16*16像素、8*8像素以及4*4像素。当然,编码块的大小也可是其他大小,例如可以是32*16像素或者是64*64像素。
步骤S404,确定当前编码块对应的目标参考像素点,目标参考像素点对应的目标数量为目标进制的e次方倍,e为正整数,目标进制为计算当前编码块的预测值时所采用的进制。
目标参考像素点是在编码端进行编码后再重建得到的重建帧中获取的。目标参考像素点用于计算当前编码块的预测值。在进行视频编码时,通常需要找出与当前编码块对应的参考像素点,根据参考像素点计算当前编码块对应的预测值,根据实际值与预测值的差值得到预测残差,对预测残差进行进一步编码,以减小视频的数据量。进制是指进位计数制,是一种带进位的计数方法,例如二进制、十进制、十六进制等等。同一数字,可以采用不同的进制进行表示。例如,对于十进制的数字57,用二进制表示为111001,用五进制表示为212。目标进制是计算当前编码块的预测值时所采用的进制,计算当前编码块的预测值时所采用的进制可以根据执行视频编码的设备对应的硬件参数以及软件参数的一个或多个确定。例如,目 前,大多数的计算机设备所采用的计算方法均为二进制,则目标进制可以为二进制。目标数量为目标进制的e次方倍是指:假设目标进制为a,e为正整数,a的e次方倍表示为a e,即目标数量表示e个a相乘得到的乘积。
在一个实施例中,可以根据当前编码块对应的预测模式确定目标参考像素点。例如,对于帧内预测模式的DC(Direct Curreet,直流)模式,目标参考像素点可以包括位于当前编码块上方的相邻像素点以及左侧的相邻像素点。
在一个实施例中,可以从当前编码块各个方向上获取邻近的像素点作为目标参考像素点。当前编码块可以包括两个方向,例如高度方向以及宽度方向。通过从各个方向上获取目标参考像素点,使得当前编码块的预测值与实际值更加接近,降低编码数据的数据量。
在一个实施例中,可以将与当前编码块的距离小于预设距离的重建像素点作为目标参考像素点。预设距离可以根据需要设置,例如可以是2个像素的距离。其中,重建像素点是指经过重建路径重建得到的像素点。
在一个实施例中,目标参考像素点可以是与当前编码块的边界的距离小于预设距离的像素点,例如可以是与当前编码块中的像素点存在重复边界的像素点。
在一个实施例中,本申请实施例提供的视频编码方法可以应用于帧内预测中,因此,目标参考像素点是在当前编码块所在的视频帧中获取的。也可以是在其他视频帧中获取的。
可以理解,视频编码中,为了保持编码端以及解码端中参考帧的一致,使得编码端以及解码端中同一图像块对应的预测值相同,目标参考像素点是在编码端进行编码后再重建得到的重建帧中获取的。
步骤S406,根据目标参考像素点得到当前编码块对应的预测值。
当前编码块的预测值是通过目标参考像素点进行预测得到的像素值。当前编码块的预测值是根据各个目标参考像素点的像素值得到的。当前编码块的预测值可以是目标参考像素点与对应的权重进行加权求和得到的,各个目标参考像素点的权重可以根据需要设置。例如,可以设置目标参考像素点的权重均等于目标参考像素点的个数的倒数,即当前编码块的预测值是目标参考像素点像素值的平均值。当然,预测值也可以是根据平均值进一步计算得到的值,例如,预测值也可以是平均值加上预设像素值得到的,预设像素值可以根据目标数量确定。预测值的计算方法可以利用公式(1)或(2)表示,其中,P表示预测值,P1为第一个目标参考像素点的像素值,Pm为第m个目标参考像素点的像素值,m表示目标参考像素点的数量,b可以根据需要设置,例如等于m。由于目标数量m为目标进制的e次方倍,因此在采用目标进制计算预测值时,可以将公式(1)以及公式(2)中的目标数量m变换为目标进制的e次方倍进行计算,可以快速计算得到预测值。
P=(P1+…+Pm)/m    (1)
P=(P1+…+Pm+b)/m  (2)
在一个实施例中,当前编码块的预测值可以是当前编码块中的各个像素点的预测值均相同,当前编码块的预测值还可以是当前编码块的各个像素点的预测值不同。例如,在帧内DC模式中,当前编码块的各个像素点的预测值可以是相同的。当然,也可以根据当前编码块中像素点离目标参考像素点的距离对预测值进行变换。例如,当前编码块各个像素点对应的预测值可以为P*0.99 i,i为当前编码块与目标参考像素点之间的像素数量。
在一个实施例中,根据目标参考像素点得到当前编码块对应的预测值包括:对目标参考像素点的像素值进行求和运算,得到像素统计值;根据目标数量得到移位位数,根据移位位 数以及像素统计值进行移位计算,得到移位结果,根据移位结果得到当前编码块对应的预测值。
移位计算是指对数字进行左移或者右移。左移是指向左移动,相当于将该数字乘以对应的目标进制,右移是指向右移动,相当于将该数字除以对应的进制。例如,对于二进制,左移指的是将所采用的二进制表示的数字向左移动对应的位数,高位移出,低位的空位补零。右移指的是将所采用的二进制表示的数字向右移动对应的位数,低位移出,高位的空位补符号位,即正数补零,负数补1。
例如,数字8除以2得到数字4,采用上述移位计算可以包括:数字8的二进制表示为1000,除以2即是右移一位,得到二进制0100,而二进制0100表示的数字为4。数字3乘以2得到数字6,采用上述移位计算可以包括:数字3的二进制标识为0011,乘以2即是左移一位,得到二进制0110,而二进制0110标识的数字为6。
因此在目标进制中,左移一位都相当于乘以目标进制的1次方,左移e位就相当于乘以目标进制的e次方。右移一位相当于除以目标进制的1次方,右移e位相当于除以目标进制的e次方。左移符号可以用“<<”表示,右移符号可以用“>>”表示。得到目标参考像素点后,对各个目标参考像素点的像素值进行统计求和,得到像素统计值。可以是对像素统计值进行移位,也可以根据像素统计值进行进一步计算,得到需要进行移位的值,例如将像素统计值加上预设值b后进行移位计算。得到移位结果后,可以将移位结果作为当前编码块对应的预测值,也可以是对移位结果进行进一步计算,得到预测值。例如,将移位结果与预设的系数相乘,得到预测值。预设的系数可以根据需要设置,例如0.99。
如公式(1)所示,等式右边的分子P1+…+Pm表示m个目标参考像素点的像素统计值。分母即目标数量m用于计算得到移位位数,移位位数可以为log aa e,即移位位数为e。进行移位时,可以是对像素统计值进行移位,也可以是对像素统计值进行进一步计算,得到需要进行移位的值,再对需要进行移位的值进行移位。例如,可以将像素统计值与预设比例相乘,得到乘积,对得到的乘积进行移位计算;也可以是将像素值与预设的值相加,对相加得到的和进行移位计算。由于像素统计值是求和得到的,因此移位方向为右移。故在实际计算中,公式(1)可以转化为公式(3)进行计算,公式(2)可以转化为公式(4)进行计算,这样,公式(1)以及公式(2)的除法变换为移位计算,除法运算在计算机设备中的运算周期比较长,硬件损耗大,或者需要配置专门的硬件设备才能计算得到,而采用移位计算,能够根据目标数量得到移位的位数,根据移位位数以及像素统计值移位计算,这样,通过利用移位计算替换除法计算,能够减少或者避免除法的运算,减少运算时间以及对硬件设备的损耗。
P=(P1+…+Pm)>>log am  (3)
P=(P1+…+Pm+b)>>log am  (4)
步骤S408,根据预测值对当前编码块进行视频编码,得到编码数据。
得到预测值后,可以将当前编码块的实际值与预测值相减,得到预测残差,根据预测残差进行变换、量化以及熵编码中的一个或多个步骤,得到编码数据。
上述视频编码方法,可通过获取数量与目标进制的e次方倍相同的目标参考像素点进行预测,目标进制为计算预测值所采用的进制。在通过目标参考像素点进行预测时,需要获取目标参考像素点的像素平均值,也即,将目标参考像素点的像素值总和除以目标数量,得到像素平均值。若目标数量为目标进制的e次方倍,则可以采用移位操作,避免了除法运算,因此能够提高视频编码时计算预测值的计算速度,提高了编码效率。
在一个实施例中,如图5A所示,步骤S404即确定当前编码块对应的目标参考像素点的步骤可以包括以下步骤:
步骤S502,获取当前编码块第一方向上对应的第一重建像素点集合以及第二方向上对应的第二重建像素点集合。
当前编码块可以包括两个方向,高度方向以及宽度方向。如果为高度方向,则高度方向对应的重建像素点集合中的像素点,是与当前编码块高度对应的边邻近的重建像素点,如高度方向对应的重建像素点可以是位于当前编码块的左侧或者右侧中的至少一侧的重建像素点。如果为宽度方向,则宽度方向对应的重建像素点集合中的像素点,是与当前编码块宽度对应的边邻近的重建像素点,如宽度方向对应的重建像素点集合中的像素点可以是位于当前编码块的上方或者下方中的至少一方的重建像素点。
在一种可能实现方式中,邻近的定义可以根据需要设置。例如,小于预设距离。第一方向可以是高度方向以及宽度方向中的一个,第二方向可以是高度方向以及宽度方向中的一个,但第一方向和第二方向是不同的。例如第一方向是高度方向,则第二方向为宽度方向。第一重建像素点集合以及第二重建像素点集合中的像素点数量可以根据需要设置,可以相等也可以不相等。例如,第一重建像素点集合的像素点数量为8,第二重建像素点集合的像素点数量为4。
在一个实施例中,第一重建像素点集合的像素点数量可以根据当前编码块在第一方向上的长度确定,第二重建像素点集合的像素点数量可以根据当前编码块在第二方向上的长度确定。第一重建像素点集合的像素点的数量可以与当前编码块在第一方向上的长度对应的像素数量相等。第二重建像素点集合的数量可以与当前编码块在第二方向上的长度对应的像素数量相等。当然也可以相差预设的长度。例如,如图5B所示,假设当前编码块为图5B中的长方形编码块C,一个正方形代表一个像素点,长方形编码块的高度为4个像素,宽度为8个像素。则高度方向上对应的重建像素点集合可以是由当前编码块左侧的4个灰色的像素点组成的集合。宽度方向上对应的重建像素点集合可以是由上方的8个灰色的像素点组成的集合。
在一个实施例中,第一重建像素点集合以及第二重建像素点集合中的一个或多个集合中的像素点为与当前编码块相邻的像素点。
在一个实施例中,当前编码块高度对应的边的像素个数为目标进制的r次方倍,宽度对应的边的像素个数为目标进制的j次方倍。r、j为正整数。例如,如果目标进制为二进制,则当前编码块可以为8*4像素大小的编码块,8以及4均为目标进制2的e次方倍。
步骤S504,根据第一重建像素点集合和第二重建像素点集合中的至少一个集合,得到复制像素点集合,第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的像素点个数之和等于目标数量。
其中,根据第一重建像素点集合和第二重建像素点集合中的至少一个集合,得到复制像素点集合可以包括:根据第一重建像素点集合中的重建像素点,得到复制像素点集合;或者,根据第二重建像素点集合中的重建像素点,得到复制像素点集合;或者,根据第一重建像素点集合中的重建像素点、以及第二重建像素点集合中的重建像素点,得到复制像素点集合。
复制像素点集合是利用第一重建像素点集合和第二重建像素点集合中的至少一个集合的重建像素点复制得到的。进行复制时,可以是仅对第一重建像素点集合的全部或者部分像素点进行复制,也可以是仅对第二重建像素点集合的全部或者部分像素点进行复制,当然也可以是对第一重建像素点集合以及第二重建像素点集合两个集合中的全部或者部分像素点进 行复制。
在一种可能的实现方式中,第一重建像素点集合、第二重建像素点集合以及复制像素点集合这三个集合中的像素点的数量相加,得到的和为目标进制的e次方倍,该和即目标数量。例如,假设目标数量为16,则第一重建像素点集合中的像素点个数可以为8,第二重建像素点集合中的像素点个数可以为4,复制像素点集合的像素点个数为4。
在一个实施例中,在进行复制时,可以根据当前编码块在第一方向上的长度以及当前编码块在第二方向上的长度,确定这两个长度的大小关系,从而确定需要进行复制的重建像素点集合。其中,可以将长度小的方向对应的重建像素点集合作为复制像素点集合。例如,再参见图5B,当前编码块的高比宽的长度小,可以对左侧的4个灰色的像素点组成的重建像素点集合进行复制,得到复制像素点集合,复制像素点集合由与该4个像素点相同的像素点组成。
在一个实施例中,对于矩形编码块,从与当前编码块的第一列相邻的其他列上选取重建像素点,将选取的重建像素点作为高度方向上对应的重建像素点。从与当前编码块的第一行相邻的其他行上选取重建像素点,将选取的重建像素点作为宽度方向上对应的重建像素点。
在一个实施例中,可以从当前编码块左侧相邻的重建像素点和上方相邻的重建像素点中选取重建像素点作为目标参考像素点,对当前编码块的预测值进行计算。
在一个实施例中,第二重建像素点集合对应的像素点数量大于第一重建像素点集合对应的像素点数量。在计算预测值时,对第一重建像素点集合对应的第一像素统计值进行左移移位计算,得到移位像素统计值,其中,左移对应的移位位数根据第二重建像素点集合与第一重建像素点集合的比值n确定。左移对应的移位位数可以为log an。也即,将第一像素统计值乘以比值n,得到移位像素统计值。这样,对第一重建像素点集合对应的像素点进行了复制,使得第一重建像素点以及第二重建像素点在计算预测值时对应的权重相等。根据移位像素统计值以及第二重建像素点集合对应的第二像素统计值得到像素统计值。
例如,当当前编码块的宽与高的比为n,n为目标进制a的次方倍,n为正整数时,即当前编码块的宽大于高时,则公式(2)在实际计算时可以转换为公式(5)。其中,DCvalue表示预测值,a表示目标进制,例如为2。w表示当前编码块宽度,用像素数量表示,h表示当前编码块的高度,用像素数量表示。w以及h大于等于2,w+w的和为目标进制的t次方倍,t为正整数。
例如,图5B中,w为8,h为4。当前编码块第一行第一列的像素点的位置可以表示为(0,0),p(x,-1)指的是位于当前编码块上方的相邻像素点的像素值,p(-1,y)指的是位于当前编码块左侧的相邻像素点的像素值。当x等于0时,p(x,-1)表示当前编码块第一行的第一个像素点上方的像素点的像素值,当x等于w-1时,表示当前编码块第一行的第w个像素点上方的像素点的像素值。当y等于0时,表示当前编码块第一列的第一个像素点左边的像素点的像素值,当y等于h-1时,表示当前编码块第一列的第h个像素点左边的像素点的像素值。
其中,“<<”为左移符号,“>>”为右移符号,log an为左移位数,log a(w+w)为右移位数。
Figure PCTCN2019109972-appb-000001
表示当前编码块第一行的第一个像素点至第w个像素点上方的像素点的像 素统计值。
Figure PCTCN2019109972-appb-000002
表示当前编码块第一列的第一个像素点至第w个像素点左边的像素点的像素统计值。
根据公式(5)可知,当当前编码块的宽大于高时,在获取目标参考像素点时,由于当前编码块的像素点左侧的相邻像素点较少,对于左侧即高度方向上的重建像素点,需要进行左移,即对左侧的像素点进行复制,使得在计算预测值时,左侧的相邻重建像素点的比重与上方的比重是一致的。
Figure PCTCN2019109972-appb-000003
在一个实施例中,同理,当当前编码块的高与宽的比为n,n为目标进制a的次方倍,n为正整数时,h+h的和为目标进制的u次方倍,u为正整数。即当前编码块的高大于宽时,可以利用当前编码块左侧相邻的重建像素点和上方相邻的重建像素点,从这些重建像素点中选取像素点作为目标参考像素点,对当前编码块的预测值进行计算,则公式(2)在实际计算时可以转换为公式(6)。根据公式(6)可知,当当前编码块的高大于宽时,在获取目标参考像素点时,由于当前编码块的像素点上方的相邻像素点较少,对于上方即宽度方向上的重建像素点,需要进行左移,即对上方的像素点进行复制,使得在计算预测值时,左侧的相邻重建像素点的比重与上方的比重是一致的。
Figure PCTCN2019109972-appb-000004
公式(6)中的参数与公式(5)中的参数类似,且参数对应的含义也类似,在此不再一一赘述。
步骤S506,将第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的重建像素点作为目标参考像素点。
得到复制像素点集合后,将第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的重建像素点均作为目标参考像素点,使得目标参考像素点对应的目标数量为目标进制的e次方倍。
在一个实施例中,步骤S404即确定当前编码块对应的目标参考像素点的步骤可以包括以下步骤:获取当前编码块第一方向上对应的第一重建像素点集合以及第二方向上对应的第二重建像素点集合,将第一重建像素点集合以及第二重建像素点集合中的重建像素点作为目标参考像素点。
在一种可能实现方式中,第一方向可以是高度方向以及宽度方向中的一个,第二方向可以是高度方向以及宽度方向中的一个,但第一方向和第二方向是不同的。例如第一方向是高度方向,则第二方向为宽度方向。第一重建像素点集合以及第二重建像素点集合中的像素点数量可以根据需要设置,但是第一重建像素点集合中与第二重建像素点集合中的像素点个数之和为目标进制的e次方倍,即等于目标数量。例如,假设目标数量为16,则第一重建像素点集合中的像素点个数可以为9,第二重建像素点集合中的像素点个数可以为7。
在一个实施例中,第一重建像素点集合与第二重建像素点集合中的重建像素点个数相等。例如,假设目标数量为8,则可以从当前目标编码块的左侧获取四个重建像素点组成第一重建像素点集合,从当前目标编码块的上方获取四个重建像素点组成第二重建像素点集合。
在一个实施例中,如图6所示,获取当前编码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合包括:
步骤S602,将第一方向或第二方向上当前编码块的长度作为目标长度。
在一种可能实现方式中,当前编码块的长度可以用像素数量进行表示,例如,假设当前编码块为4*8的编码块,则宽度方向的长度为4个像素,高度方向的长度为8个像素。可以是将第一方向或第二方向的任意一个方向上当前编码块的长度作为目标长度,可以根据需要设置。
在一个实施例中,当当前编码块第一方向的长度大于第二方向上的长度时,将第一方向上当前编码块的长度作为目标长度。
可以将当前编码块中长度较长的方向所对应的长度作为目标长度。例如,如果当前编码块的宽的长度大于高的长度,则宽度的长度为目标长度。
在一个实施例中,当当前编码块第一方向的长度小于第二方向上的长度时,将第一方向上当前编码块的长度作为目标长度。
可以将当前编码块中长度较短的方向所对应的长度作为目标长度。例如,如果当前编码块的宽的长度大于高的长度,则高度的长度为目标长度。
步骤S604,根据目标长度确定第一像素数量以及第二像素数量,第一像素数量以及第二像素数量的和等于目标数量。
第一像素数量是根据目标长度得到的,第二像素数量是根据目标长度得到的。在一个实施例中,如果目标长度的2倍为目标进制的e次方倍,则第一像素数量以及第二像素数量中的一个或多个可以与目标长度对应的像素数量相同,即,第一像素数量可以与目标长度对应的像素数量相同;或者,第二像素数量可以与目标长度对应的像素数量相同;或者,第一像素数量和第二像素数量均与目标长度对应的像素数量相同。
当然,也可以是在目标长度的基础上减少预设数量或者增加预设数量得到第一像素数量以及第二像素数量中的一个或多个,也即是在目标长度的基础上减少预设数量或者增加预设数量得到第一像素数量;或者,在目标长度的基础上减少预设数量或者增加预设数量得到第二像素数量;或者,在目标长度的基础上减少预设数量得到第一像素数量和第二像素数量;或者,在目标长度的基础上增加预设数量得到第一像素数量和第二像素数量,以使得第一像素数量以及第二像素数量的和等于目标进制的e次方倍,即目标数量。例如,如果目标长度为8,8的两倍为16,假设目标进制为2,16为2的4次方倍,故第一像素数量以及第二数量可以为8。如果目标长度为6,则,第一像素数量可以为6,第二像素数量可以为目标长度6加上4等于10。
步骤S606,从当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合。
得到第一像素数量后,如果第一方向为宽度方向,则可以在当前编码块上方和/或下方的重建像素点中选取目标重建像素点,也即是,在当前编码块上方的重建像素点中选取目标重建像素点;或者,在当前编码块下方的重建像素点中选取目标重建像素点;或者,在当前编码块上方和下方的重建像素点中选取目标重建像素点,目标重建像素点的数量为第一像素数量。
如果第一方向为高度方向,则可以在当前编码块左侧和/或右侧的重建像素点中选取目标重建像素点,也即是,在当前编码块左侧的重建像素点中选取目标重建像素点;或者,在当 前编码块右侧的重建像素点中选取目标重建像素点;或者,在当前编码块左侧和右侧的重建像素点中选取目标重建像素点,目标重建像素点的数量为第一像素数量。
在一个实施例中,目标重建像素点是与当前编码块相邻的像素点。
步骤S608,从当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合。
得到第二像素数量后,如果第二方向为宽度方向,则可以在当前编码块上方和/或下方的重建像素点中选取目标重建像素点,也即是,在当前编码块上方的重建像素点中选取目标重建像素点;或者,在当前编码块下方的重建像素点中选取目标重建像素点;或者,在当前编码块上方和下方的重建像素点中选取目标重建像素点,目标重建像素点的数量为第二像素数量。
如果第二方向为高度方向,则可以在当前编码块左侧和/或右侧的重建像素点中选取目标重建像素点,也即是,在当前编码块左侧的重建像素点中选取目标重建像素点;或者,在当前编码块右侧的重建像素点中选取目标重建像素点;或者,在当前编码块左侧和右侧的重建像素点中选取目标重建像素点,目标重建像素点的数量为第二像素数量。
在一个实施例中,目标重建像素点是与当前编码块相邻的像素点。
在一个实施例中,当当前编码块第一方向的长度大于第二方向上的长度,将第一方向上当前编码块的长度作为目标长度时,则步骤S606即从当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合包括:从当前编码块第一方向上的相邻重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合,第一像素数量的像素对应的长度小于或等于目标长度。步骤S608即从当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:根据第二像素数量选取当前编码块第二方向上的相邻重建像素点以及非相邻重建像素点作为目标重建像素点,组成第二重建像素点集合,第二像素数量大于或等于第二方向上当前编码块的像素数量。
例如,当前编码块为4*8的编码块,则宽度方向的长度为4个像素,高度方向的长度为8个像素。高度方向的长度大于宽度方向的长度,将高度方向上当前编码块的长度作为目标长度,目标长度为8。从当前编码块高度方向上的相邻重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合,第一像素数量的像素对应的长度小于等于8,可以为4。根据第二像素数量选取当前编码块宽度方向上的相邻重建像素点以及非相邻重建像素点作为目标重建像素点,组成第二重建像素点集合,第二像素点可以为4,等于宽度方向上当前编码块的像素数量。
第二方向上当前编码块的像素数量是指第二方向的边所对应的像素数量,当第二方向为高度方向时,第二方向的边所对应的像素数量为高度的边所对应的像素数量。
若当前编码块第一方向的长度大于第二方向的长度时,将第一方向上当前编码块的长度作为目标长度,第一像素数量的像素对应的长度小于或等于目标长度,第二像素数量大于或等于第二方向上当前编码块的像素数量时。由于第一方向上相邻重建像素点是大于或等于目标长度的,故可以从第一方向上的相邻重建像素点中筛选第一像素数量的目标重建像素点。而由于第二像素数量大于或等于第二方向上当前编码块的像素数量,因此,第二方向上相邻重建像素点是小于或等于目标长度对应的像素数量的,从而第二方向上的相邻重建像素点数量不够,故将第二方向上的相邻重建像素点以及非相邻重建像素点作为目标重建像素点。
在一个实施例中,对于矩形编码块,高度方向上对应的重建像素点为与当前编码块的第 一列相邻的其他列上的重建像素点。宽度方向上对应的重建像素点为与当前编码块的第一行相邻的其他行上的重建像素点。
在一个实施例中,利用当前编码块第一行像素点上方的相邻像素点、第一列像素点左侧的相邻像素点以及第一列像素点左侧的非相邻像素点作为目标参考像素点。例如,如图7所示,假设当前编码块为图7中的长方形编码块C,长方形编码块的高度为4个像素,宽度为8个像素。目标长度为宽度,则高度方向上对应的重建像素点集合可以是由左侧的8个灰色的像素点组成的集合,从上到下的第2至6共5个为左侧的相邻像素点,第7至9共3个灰色的像素点为非相邻的像素点。宽度方向上对应的重建像素点集合可以是由上方的8个灰色的相邻像素点组成的集合。如果当前编码块为矩形编码块,当前编码块宽度方向对应的长度大于高度方向对应的长度,w+w为目标进制的q次倍,q为正整数,则可以将宽度方向对应的长度作为目标长度。根据宽度方向对应的长度得到第一像素数量以及第二像素数量,根据宽度方向对应的长度得到像素统计值对应的移位位数,根据像素统计值以及移位位数得到当前编码块的预测值。例如,第一像素数量以及第二像素数量与目标长度相等,则当前编码块的预测值的计算公式可以如公式(7)所示,log a(w+w)为右移位数,也为q。公式(7)中的其他参数与公式(5)中的参数类似,且参数对应的含义也类似,在此不再一一赘述。
Figure PCTCN2019109972-appb-000005
在一个实施例中,可以将当前编码块第一列像素点左侧的相邻像素点,第一行像素点上方的相邻像素点以及第一行像素点上方的非相邻像素点作为目标参考像素点。如果当前编码块为矩形编码块,当前编码块高度方向对应的长度大于宽度方向对应的长度,h+h为目标进制的g次倍,g为正整数。可以将高度方向对应的长度作为目标长度。根据高度方向对应的长度得到第一像素数量以及第二像素数量,根据高度方向对应的长度得到像素统计值对应的移位位数,根据像素统计值以及移位位数得到当前编码块的预测值。例如,第一像素数量以及第二像素数量与目标长度相等,则当前编码块的预测值的计算公式可以如公式(8)所示,log a(h+h)为右移位数,也为g。公式(8)中的其他参数与公式(5)中的参数类似,且参数对应的含义也类似,在此不再一一赘述。
Figure PCTCN2019109972-appb-000006
在一个实施例中,当当前编码块第一方向的长度小于第二方向上的长度,将第一方向上当前编码块的长度作为目标长度时,则步骤S606即从当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合包括:从当前编码块第一方向上的相邻重建像素点选取第一像素数量的目标重建像素点,组成第一重建像素点集合,第一像素数量的像素对应的长度小于或等于目标长度。步骤S608即从当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:根据第二像素数量从当前编码块第一方向上的相邻重建像素点选取第二像素数量的目标重建像素点,组成第二重建像素点集合,第二像素数量小于第二方向上当前编码块的像素数量。
当选择长度较短的方向对应的长度,作为目标长度,第一像素数量的像素对应的长度小于或等于目标长度,第二像素数量小于第二方向上当前编码块的像素数量时,第一方向上相邻重建像素点是大于或等于目标长度的,故可以从第一方向上的相邻重建像素点中筛选第一像素数量的目标重建像素点。由于第二像素数量小于第二方向上当前编码块的像素数量,因 此,第二方向上相邻重建像素点是也是大于目标长度对应的像素数量的,故可以从第二方向上的相邻重建像素点中筛选第二像素数量的目标重建像素点。由于相邻的像素点与当前编码块的像素点相似的可能性更大,因此能够使得预测值与实际值更相近,减少预测残差。
在一个实施例中,可以将当前编码块第一列像素点左侧的相邻像素点、第一行像素点上方的部分相邻像素点作为目标参考像素点。其中,第一行像素点上方的目标参考像素点可以与高度方向的像素点的数量相同。在选择第一行像素点上方部分像素点时,可以按照预设的规则选择部分像素点,如可以按照从左到右、从右到左、间隔选择中的一种或多种方式进行选择。
在一个实施例中,如果当前编码块为矩形编码块,选择长度较短的方向对应的长度,作为目标长度,当前编码块宽度方向对应的长度大于高度方向对应的长度,h+h为目标进制的L次方倍,L为正整数,则可以选择当前编码块高度方向对应的长度作为目标长度,根据高度方向对应的长度得到第一像素数量以及第二像素数量,根据高度方向对应的长度得到像素统计值对应的移位位数,根据像素统计值以及移位位数得到当前编码块的预测值。
例如,第一像素数量以及第二像素数量与目标长度h相等,则当前编码块的预测值的计算公式用公式(9)或(10)表示如下。例如,假设当前编码块为图8或图9中的长方形编码块C,长方形编码块的高度为4个像素,宽度为8个像素。则图8中高度方向上对应的重建像素点集合可以是由左侧的4个灰色的像素点组成的集合,宽度方向上对应的重建像素点集合可以是由上方中位于靠左部分的4个灰色的像素点组成的集合。图9中高度方向上对应的重建像素点集合可以是由左侧的4个灰色的像素点组成的集合,宽度方向上对应的重建像素点集合可以是由上方中位于靠右部分的4个灰色的像素点组成的集合,公式(9)和公式(10)中的参数与公式(5)中的参数类似,且参数对应的含义也类似,在此不再一一赘述。
Figure PCTCN2019109972-appb-000007
Figure PCTCN2019109972-appb-000008
在一个实施例中,可以将当前编码块第一行像素点上方的相邻像素点、第一列像素点左侧的部分相邻像素点作为目标参考像素点。其中,第一列像素点左侧的部分像素点可以与宽度方向的像素点的数量相同。在选择第一列像素点左侧的部分像素点时,可以按照预设的规则选择部分像素点,如可以按照从上到下、从下到上、间隔选择中的一种或多种方式进行选择。
如果当前编码块为矩形编码块,选择长度较短的方向对应的长度作为目标长度,当前编码块高度方向对应的长度大于宽度方向对应的长度,w+w为目标进制的z次方倍,z为正整数。则可以选择当前编码块宽度方向对应的长度作为目标长度,根据宽度方向对应的长度得到第一像素数量以及第二像素数量,根据第一像素数量以及第二像素数量,得到像素统计值对应的移位位数,根据像素统计值以及移位位数得到当前编码块的预测值。
例如,第一像素数量以及第二像素数量与目标长度h相等,当前编码块的预测值的计算公式用公式(11)、(12)可以表示如下。其中,在公式(11)中,对于高度方向对应的参考像素点,选择第一列像素点左侧靠上的w个相邻像素点作为目标参考像素点。在公式(12)中,对于高度方向对应的参考像素点,选择第一列像素点左侧靠下的的w个相邻像素点作为目标参考像素点。
Figure PCTCN2019109972-appb-000009
Figure PCTCN2019109972-appb-000010
可以理解,对于帧内编码,一般的编码方向为从左到右,从上到小。因此可以利用公式(5)至(12)进行计算。如果编码方向为从右到左,则公式(5)至(12)中的p(x,-1)可以替换为p(x,1),如果编码方向为从下到上,则公式(5)中的p(-1,y)可以替换为p(1,y)。
如图10所示,在一个实施例中,提出了一种视频解码方法,本实施例提供的视频解码方法可以应用于上述图1中的终端110以及服务器120中。可以包括以下步骤:
步骤S1002,获取待解码视频帧中的当前待解码块对应的编码数据。
待解码视频帧是需要进行解码的视频帧。一个待解码视频帧序列可以包括多个待解码视频帧。待解码视频帧可以是实时获取的视频帧,也可以是预先存储的待解码视频序列中获取的视频帧。当前待解码视频帧是指当前需要进行解码的视频帧,当前待解码块是当前待解码视频帧中当前需要解码的待解码块。视频帧可以包括一个或多个待解码块,可以理解,在解码时,由于编码块与待解码块是一一对应的,当前待解码块对应的编码数据为对应的当前编码块进行编码得到的编码数据。因此编码块与待解码块的大小是一致的,待解码块的像素大小也可以包括32*32像素、16*16像素、8*8像素以及4*4像素等。
步骤S1004,确定当前待解码块对应的目标参考像素点,目标参考像素点对应的目标数量为目标进制的e次方倍,e为正整数,目标进制为计算当前编码块的预测值时所采用的进制。
可以理解,由于编解码规则的一致性,对于对应的当前编码块以及当前待解码块,目标参考像素点是相同的。因此解码端获取目标参考像素点的步骤可以参考视频编码方法中获取目标参考像素点的步骤,在此不再赘述。
步骤S1006,根据目标参考像素点得到当前待解码块对应的预测值。
可以理解,由于编解码规则的一致性,对于对应的当前编码块以及当前待解码块,预测值的计算方法是对应的,因此解码端得到当前待解码块对应的预测值的步骤可以参考视频编码方法中得到当前编码块对应的预测值的步骤,在此不再赘述。
在一个实施例中,确定当前待解码块对应的目标参考像素点包括:获取当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合,将第一重建像素点集合中的重建像素点以及第二重建像素点集合中的重建像素点,作为目标参考像素点;第一重建像素点集合中的像素点个数与第二重建像素点集合中的像素点个数的和等于目标数量。
在一个实施例中,确定当前待解码块对应的目标参考像素点包括:获取当前待解码块第一方向上的第一重建像素点集合,获取当前解码块第二方向上的第二重建像素点集合;根据第一重建像素点集合和第二重建像素点集合中的至少一个集合,得到复制像素点集合;第一重建像素点集合中的像素点个数、第二重建像素点集合中像素点个数和复制像素点集合中像素点个数的和等于目标数量,将所述第一重建像素点集合、所述第二重建像素点集合以及所述复制像素点集合中的重建像素点作为目标参考像素点。
其中,根据第一重建像素点集合和第二重建像素点集合中的至少一个集合,得到复制像素点集合,可以包括:根据第一重建像素点集合中的重建像素点,得到复制像素点集合;或者,根据第二重建像素点集合中的重建像素点,得到复制像素点集合;或者,根据第一重建像素点集合中的重建像素点和第二重建像素点集合中的重建像素点,得到复制像素点集合。
在一个实施例中,步骤S1006即根据目标参考像素点得到当前待解码块对应的预测值包括:对目标参考像素点的像素值进行求和运算,得到像素统计值;根据目标数量得到移位位数,根据移位位数以及像素统计值进行移位计算,得到移位结果,根据移位结果得到当前待解码块对应的预测值。
步骤S1008,根据预测值对编码数据进行解码,得到当前待解码块对应的视频图像块。
得到预测值后,根据编码数据中的预测残差以及预测值的和得到视频图像块的像素值。解码的过程可以根据编码的过程确定,例如解码过程还可以包括反变换、反量化以及熵解码中的至少一个过程。
上述视频解码方法,可通过获取数量与目标进制的e次方倍相同的目标参考像素点进行预测,目标进制为计算预测值所采用的进制。在通过目标参考像素点进行预测时,需要获取目标参考像素点的像素平均值,也即,将目标参考像素点的像素值总和除以目标数量,得到像素平均值。若目标数量为目标进制的e次方倍,则可以采用移位操作,避免了除法运算,因此能够提高视频编码时计算预测值的计算速度,提高了编码效率。
在一个实施例中,获取当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合可以包括:将第一方向或第二方向上当前待解码块的长度作为目标长度;根据目标长度确定第一像素数量以及第二像素数量,第一像素数量以及第二像素数量的和等于目标数量;从当前待解码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合;从当前待解码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合。
在一个实施例中,将第一方向或第二方向上当前待解码块的长度作为目标长度包括:当当前待解码块第一方向的长度大于第二方向上的长度时,将第一方向上当前待解码块的长度作为目标长度。
从当前待解码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合包括:从当前待解码块第一方向上的相邻重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合,第一像素数量的像素对应的长度小于或等于目标长度;从当前待解码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:根据第二像素数量选取当前待解码块第二方向上的相邻重建像素点以及非相邻重建像素点作为目标重建像素点,组成第二重建像素点集合,第二像素数量大于或等于第二方向上当前待解码块的像素数量。
在一个实施例中,将第一方向或第二方向上当前待解码块的长度作为目标长度包括:当当前待解码块第一方向的长度小于第二方向上的长度时,将第一方向上当前待解码块的长度作为目标长度。
从当前待解码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合包括:从当前待解码块第一方向上的相邻重建像素点选取第一像素数量的目标重建像素点,组成第一重建像素点集合,第一像素数量的像素对应的长度小于或等于目标长度;从当前待解码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:根据第二像素数量从当前待解码块第一方向上的相邻重建像素点选取第二像素数量的目标重建像素点,组成第二重建像素点集合,第二像素数量小于第二方向上当前待解码块的像素数量。
以下以一个实施例对本申请实施例提供的视频编码方法以及视频解码方法进行说明,假 设当前编码块的宽度为8个像素,高度为4个像素,目标进制为2进制。
1、编码端获取视频帧序列中的当前视频帧,假设为第三个视频帧,且前两个视频帧均已编码。对当前视频帧进行划分,假设划分为16个编码块。前9个已经编码完成,因此将第10个编码块作为当前编码块。例如,可以将图5B中、图7~9中的编码块C作为当前编码块。
2、编码端确定当前编码块的预测模式,如果预测模式为DC预测模式,则进入步骤3,否则,根据其他预测模式对应的视频编码方法进行视频编码,例如如果当前编码块的预测模式为帧间预测模式,则进行帧间预测编码。
3、编码端确定当前编码块对应的目标参考像素点。例如,将图7~图9中,当前编码块左侧和上方的灰色像素点作为目标参考像素点,其中图7中,目标参考像素点的数量为8+8=16,图8至9中,目标参考像素点的数量为4+4=8。图5B中,将当前编码块左侧和上方的像素点以及对左侧的像素点进行复制得到的像素点均作为目标参考像素点,目标参考像素点个数为8+4*2=16。这样,使得目标参考像素点的个数为2进制的4次方倍。
4、编码端对目标参考像素点的像素值进行求和运算,得到像素统计值。在一种可能实现方式中,将各个目标参考像素点的像素值进行相加,得到像素值的和作为像素统计值。
5、编码端根据目标数量得到移位位数,根据移位位数以及像素统计值进行移位计算,得到移位结果,根据移位结果得到当前编码块对应的预测值。其中,以目标进制作为对数函数的底数,目标数量作为自变量,计算移位位数,例如,目标参考像素点的数量为16,则移位位数为log 216,为4,移位方向为右移。如果像素统计值是1100000(2进制),则对1100000(2进制)右移四位。
6、编码端根据预测值对当前编码块进行视频编码,得到编码数据
7、编码端通过信道将编码数据发送到解码端,解码端获取当前待解码块对应的编码数据。
8、解码端根据编码数据确定当前编码块为DC预测模式,进入步骤9,否则采用其他预测模式对应的视频解码方法进行视频解码。
9、解码端确定当前待解码块对应的目标参考像素点。
10、解码端对目标参考像素点的像素值进行求和运算,得到像素统计值。
11、解码端根据目标数量得到移位位数,根据移位位数以及像素统计值进行移位计算,得到移位结果,根据移位结果作为当前待解码块对应的预测值。
12、解码端根据预测值对编码数据进行解码,得到当前待解码块对应的视频图像块。
如图11所示,在一个实施例中,提供了一种视频编码装置,该视频编码装置可以集成于上述的终端110以及服务器120中,可以包括当前编码块获取模块1102、第一确定模块1104、第一预测值计算模块1106以及编码模块1108。
当前编码块获取模块1102,用于获取当前视频帧中待编码的当前编码块。
第一确定模块1104,用于确定当前编码块对应的目标参考像素点,目标参考像素点对应的目标数量为目标进制的e次方倍,e为正整数,目标进制为计算当前编码块的预测值时所采用的进制。
第一预测值计算模块1106,用于根据目标参考像素点得到当前编码块对应的预测值。
编码模块1108,用于根据预测值对当前编码块进行视频编码,得到编码数据。
在一个实施例中,第一预测值计算模块1106用于:对目标参考像素点的像素值进行求和运算,得到像素统计值;根据目标数量得到移位位数,根据移位位数以及像素统计值进行移位计算,得到移位结果,根据移位结果得到当前编码块对应的预测值。
在一个实施例中,第一确定模块1104用于:获取当前编码块第一方向上对应的第一重建像素点集合以及第二方向上对应的第二重建像素点集合,将第一重建像素点集合以及第二重建像素点集合中的重建像素点作为目标参考像素点;第一重建像素点集合中的重建像素点个数、与第二重建像素点集合中的重建像素点个数之和,等于目标数量。
在一个实施例中,第一确定模块1104包括:
第一重建点集合获取单元,用于获取当前编码块第一方向上对应的第一重建像素点集合以及第二方向上对应的第二重建像素点集合;
第一复制单元,用于根据第一重建像素点集合和第二重建像素点集合中的至少一个集合,得到重建像素点得到复制像素点集合,第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的像素点个数之和等于目标数量;
第一像素点确定单元,用于将第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的重建像素点作为目标参考像素点。
在一个实施例中,重建点集合获取单元包括:
长度确定单元,用于将第一方向或第二方向上当前编码块的长度作为目标长度;
数量确定单元,用于根据目标长度确定第一像素数量以及第二像素数量,第一像素数量以及第二像素数量的和等于目标数量;
第一选取单元,用于从当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合;
第二选取单元,用于从当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合。
在一个实施例中,长度确定单元用于:当当前编码块第一方向的长度大于第二方向上的长度时,将第一方向上当前编码块的长度作为目标长度。
第一选取单元用于:从当前编码块第一方向上的相邻重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合,第一像素数量的像素对应的长度小于或等于目标长度。
第二选取单元用于:根据第二像素数量,选取当前编码块第二方向上的相邻重建像素点以及非相邻重建像素点,将选取的重建像素点作为目标重建像素点,组成第二重建像素点集合,第二像素数量大于第二方向上当前编码块的像素数量。
在一个实施例中,长度确定单元用于:当当前编码块第一方向的长度小于第二方向上的长度时,将第一方向上当前编码块的长度作为目标长度。
第一选取单元用于:从当前编码块第一方向上的相邻重建像素点中,选取第一像素数量的目标重建像素点,组成第一重建像素点集合,第一像素数量的像素对应的长度小于或等于目标长度。
第二选取单元用于:根据第二像素数量,从当前编码块第一方向上的相邻重建像素点中,选取第二像素数量的目标重建像素点,组成第二重建像素点集合,第二像素数量小于第二方向上当前编码块的像素数量。
如图12所示,在一个实施例中,提供了一种视频解码装置,该视频解码装置可以集成于上述的终端110或者服务器120中,该终端110或者服务器120可以包括编码数据获取模块1202、第二确定模块1204、第二预测值计算模块1206以及解码模块1208。
编码数据获取模块1202,用于获取待解码视频帧中的当前待解码块对应的编码数据。
第二确定模块1204,用于确定当前待解码块对应的目标参考像素点,目标参考像素点对应的目标数量为目标进制的e次方倍,e为正整数,目标进制为计算当前编码块的预测值时所采用的进制。
第二预测值计算模块1206,用于根据目标参考像素点得到当前待解码块对应的预测值。
解码模块1208,用于根据预测值对编码数据进行解码,得到当前待解码块对应的视频图像块。
在一个实施例中,第二预测值计算模块1206用于:对目标参考像素点的像素值进行求和运算,得到像素统计值;根据目标数量得到移位位数,根据移位位数以及像素统计值进行移位计算,得到移位结果,根据移位结果得到当前待解码块对应的预测值。
在一个实施例中,第二确定模块1204用于:获取当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合,将第一重建像素点集合以及第二重建像素点集合中的重建像素点作为目标参考像素点;第一重建像素点集合中的像素点个数与第二重建像素点集合中的像素点个数的和等于目标数量。
在一个实施例中,第二确定模块1204包括:
第二重建点集合获取单元,用于获取当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合。
第二复制单元,用于根据第一重建像素点集合和第二重建像素点集合中的至少一个集合,得到复制像素点集合;第一重建像素点集合中的像素点个数、第二重建像素点集合中像素点个数和复制像素点集合中像素点个数的和等于目标数量。
第二像素点确定单元,用于将第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的重建像素点作为目标参考像素点。
图13示出了一个实施例中计算机设备的内部结构图。该计算机设备可以是图1中的终端110。如图13所示,该计算机设备包括该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、输入装置和显示屏。其中,存储器包括非易失性存储介质和内存储器。该计算机设备的非易失性存储介质存储有操作系统,还可存储有计算机程序,该计算机程序被处理器执行时,可使得处理器实现视频编码方法以及视频解码方法中的至少一种方法。该内存储器中也可储存有计算机程序,该计算机程序被处理器执行时,可使得处理器执行视频编码方法以及视频解码方法中的至少一种方法。计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
图14示出了一个实施例中计算机设备的内部结构图。该计算机设备可以是图1中的服务器120。如图14所示,该计算机设备包括该计算机设备包括通过系统总线连接的处理器、存储器以及网络接口。其中,存储器包括非易失性存储介质和内存储器。该计算机设备的非易失性存储介质存储有操作系统,还可存储有计算机程序,该计算机程序被处理器执行时,可使得处理器实现视频编码方法以及视频解码方法中的至少一种方法。该内存储器中也可储存有计算机程序,该计算机程序被处理器执行时,可使得处理器执行视频编码方法以及视频解码方法中的至少一种方法。
本领域技术人员可以理解,图13以及14中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,本申请提供的视频编码装置可以实现为一种计算机程序的形式,计算机程序可在如图13以及14所示的计算机设备上运行。计算机设备的存储器中可存储组成该视频编码装置的各个程序模块,比如,图11所示的当前编码块获取模块1102、第一确定模块1104、第一预测值计算模块1106以及编码模块1108。各个程序模块构成的计算机程序使得处理器执行本说明书中描述的本申请各个实施例的视频编码方法中的步骤。
例如,图13以及14所示的计算机设备可以通过如图11所示的视频编码装置中的当前编码块获取模块1102获取当前视频帧中待编码的当前编码块。通过第一确定模块1104确定当前编码块对应的目标参考像素点,目标参考像素点对应的目标数量为目标进制的e次方倍,e为正整数,目标进制为计算当前编码块的预测值时所采用的进制。通过第一预测值计算模块1106根据目标参考像素点得到当前编码块对应的预测值。通过编码模块1108根据预测值对当前编码块进行视频编码,得到编码数据。
在一个实施例中,本申请提供的视频解码装置可以实现为一种计算机程序的形式,计算机程序可在如图13或14所示的计算机设备上运行。计算机设备的存储器中可存储组成该视频解码装置的各个程序模块,比如,图12所示的编码数据获取模块1202、第二确定模块1204、第二预测值计算模块1206以及解码模块1208。各个程序模块构成的计算机程序使得处理器执行本说明书中描述的本申请各个实施例的视频解码方法中的步骤。
例如,图13以及14所示的计算机设备可以通过如图12所示的视频解码装置中的编码数据获取模块1202获取待解码视频帧中的当前待解码块对应的编码数据。通过第二确定模块1204确定当前待解码块对应的目标参考像素点,目标参考像素点对应的目标数量为目标进制的e次方倍,e为正整数,目标进制为计算当前编码块的预测值时所采用的进制。通过第二预测值计算模块1206根据目标参考像素点得到当前待解码块对应的预测值。通过解码模块1208根据预测值对编码数据进行解码,得到当前待解码块对应的视频图像块。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器存储有计算机程序,计算机程序被处理器执行时,使得处理器执行如下操作:
获取当前视频帧中待编码的当前编码块;
确定当前编码块对应的目标参考像素点,目标参考像素点对应的目标数量为目标进制的e次方倍,e为正整数,目标进制为计算当前编码块的预测值时所采用的进制;
根据目标参考像素点得到当前编码块对应的预测值;
根据预测值对当前编码块进行视频编码,得到编码数据。
在一个实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
对目标参考像素点的像素值进行求和运算,得到像素统计值;
根据目标数量得到移位位数,根据移位位数以及像素统计值进行移位计算,得到移位结果,根据移位结果得到当前编码块对应的预测值。
在一个实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
获取当前编码块第一方向上对应的第一重建像素点集合、以及第二方向上对应的第二重建像素点集合,将第一重建像素点集合以及第二重建像素点集合中的重建像素点作为目标参考像素点;
第一重建像素点集合中的重建像素点个数、与第二重建像素点集合中的重建像素点个数之和,等于目标数量。
在一个实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
获取当前编码块第一方向上对应的第一重建像素点集合以及第二方向上对应的第二重建像素点集合;
根据第一重建像素点集合和第二重建像素点集合中的至少一个集合,得到复制像素点集合,第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的像素点个数之和等于目标数量;
将第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的重建像素点作为目标参考像素点。
在一个实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
将第一方向或第二方向上当前编码块的长度作为目标长度;
根据目标长度确定第一像素数量以及第二像素数量,第一像素数量以及第二像素数量的和等于目标数量;
从当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合;
从当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合。
在一个实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
当当前编码块第一方向的长度大于第二方向的长度时,将第一方向上当前编码块的长度作为目标长度;
从当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合包括:
从当前编码块第一方向上的相邻重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合,第一像素数量的像素对应的长度小于或等于目标长度;
从当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:
根据第二像素数量,选取当前编码块第二方向上的相邻重建像素点以及非相邻重建像素点,将选取的重建像素点作为目标重建像素点,组成第二重建像素点集合,第二像素数量大于或等于第二方向上当前编码块的像素数量。
在一个实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
当当前编码块第一方向的长度小于第二方向的长度时,将第一方向上当前编码块的长度作为目标长度;
从当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合包括:
从当前编码块第一方向上的相邻重建像素点中,选取第一像素数量的目标重建像素点,组成第一重建像素点集合,第一像素数量的像素对应的长度小于或等于目标长度;
从当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:
根据第二像素数量,从当前编码块第一方向上的相邻重建像素点中,选取第二像素数量的目标重建像素点,组成第二重建像素点集合,第二像素数量小于第二方向上当前编码块的像素数量。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器存储有计算机 程序,计算机程序被处理器执行时,使得处理器执行如下操作:
获取待解码视频帧中的当前待解码块对应的编码数据;
确定当前待解码块对应的目标参考像素点,目标参考像素点对应的目标数量为目标进制的e次方倍,e为正整数,目标进制为计算当前编码块的预测值时所采用的进制;
根据目标参考像素点得到当前待解码块对应的预测值;
根据预测值对编码数据进行解码,得到当前待解码块对应的视频图像块。
在一个实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
对目标参考像素点的像素值进行求和运算,得到像素统计值;
根据目标数量得到移位位数,根据移位位数以及像素统计值进行移位计算,得到移位结果,根据移位结果得到当前待解码块对应的预测值。
在一个实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
获取当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合,将第一重建像素点集合以及第二重建像素点集合中的重建像素点作为目标参考像素点;
第一重建像素点集合中的像素点个数与第二重建像素点集合中的像素点个数的和等于目标数量。
在一个实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
获取当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合;
根据第一重建像素点集合和第二重建像素点集合中的至少一个集合,得到复制像素点集合,第一重建像素点集合中的像素点个数、第二重建像素点集合中像素点个数和复制像素点集合中像素点个数的和等于目标数量;
将第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的重建像素点作为目标参考像素点。
在一个实施例中,提供了一种计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时,使得处理器执行如下操作:
获取当前视频帧中待编码的当前编码块;
确定当前编码块对应的目标参考像素点,目标参考像素点对应的目标数量为目标进制的e次方倍,e为正整数,目标进制为计算当前编码块的预测值时所采用的进制;
根据目标参考像素点得到当前编码块对应的预测值;
根据预测值对当前编码块进行视频编码,得到编码数据。
在一实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
对目标参考像素点的像素值进行求和运算,得到像素统计值;
根据目标数量得到移位位数,根据移位位数以及像素统计值进行移位计算,得到移位结果,根据移位结果得到当前编码块对应的预测值。
在一实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
获取当前编码块第一方向上对应的第一重建像素点集合、以及第二方向上对应的第二重建像素点集合,将第一重建像素点集合以及第二重建像素点集合中的重建像素点作为目标参考像素点;
第一重建像素点集合中的重建像素点个数、与第二重建像素点集合中的重建像素点个数 之和,等于目标数量。
在一实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
获取当前编码块第一方向上对应的第一重建像素点集合以及第二方向上对应的第二重建像素点集合;
根据第一重建像素点集合和第二重建像素点集合中的至少一个集合,得到复制像素点集合,第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的像素点个数之和等于目标数量;
将第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的重建像素点作为目标参考像素点。
在一实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
将第一方向或第二方向上当前编码块的长度作为目标长度;
根据目标长度确定第一像素数量以及第二像素数量,第一像素数量以及第二像素数量的和等于目标数量;
从当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合;
从当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合。
在一实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
当当前编码块第一方向的长度大于第二方向的长度时,将第一方向上当前编码块的长度作为目标长度;
从当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合包括:
从当前编码块第一方向上的相邻重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合,第一像素数量的像素对应的长度小于或等于目标长度;
从当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:
根据第二像素数量,选取当前编码块第二方向上的相邻重建像素点以及非相邻重建像素点,将选取的重建像素点作为目标重建像素点,组成第二重建像素点集合,第二像素数量大于或等于第二方向上当前编码块的像素数量。
在一实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
当当前编码块第一方向的长度小于第二方向的长度时,将第一方向上当前编码块的长度作为目标长度;
从当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成第一重建像素点集合包括:
从当前编码块第一方向上的相邻重建像素点中,选取第一像素数量的目标重建像素点,组成第一重建像素点集合,第一像素数量的像素对应的长度小于或等于目标长度;
从当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:
根据第二像素数量,从当前编码块第一方向上的相邻重建像素点中,选取第二像素数量的目标重建像素点,组成第二重建像素点集合,第二像素数量小于第二方向上当前编码块的 像素数量。
在一实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
获取待解码视频帧中的当前待解码块对应的编码数据;
确定当前待解码块对应的目标参考像素点,目标参考像素点对应的目标数量为目标进制的e次方倍,e为正整数,目标进制为计算当前编码块的预测值时所采用的进制;
根据目标参考像素点得到当前待解码块对应的预测值;
根据预测值对编码数据进行解码,得到当前待解码块对应的视频图像块。
在一实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
对目标参考像素点的像素值进行求和运算,得到像素统计值;
根据目标数量得到移位位数,根据移位位数以及像素统计值进行移位计算,得到移位结果,根据移位结果得到当前待解码块对应的预测值。
在一实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
获取当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合,将第一重建像素点集合以及第二重建像素点集合中的重建像素点作为目标参考像素点;
第一重建像素点集合中的像素点个数与第二重建像素点集合中的像素点个数的和等于目标数量。
在一实施例中,计算机程序被处理器执行时,使得处理器执行如下操作:
获取当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合;
根据第一重建像素点集合和第二重建像素点集合中的至少一个集合,得到复制像素点集合,第一重建像素点集合中的像素点个数、第二重建像素点集合中像素点个数和复制像素点集合中像素点个数的和等于目标数量;
将第一重建像素点集合、第二重建像素点集合以及复制像素点集合中的重建像素点作为目标参考像素点。
应该理解的是,虽然本申请各实施例的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,各实施例中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM (DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Syechliek)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (25)

  1. 一种视频编码方法,应用于计算机设备中,所述方法包括:
    获取当前视频帧中待编码的当前编码块;
    确定所述当前编码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;
    根据所述目标参考像素点得到所述当前编码块对应的预测值;
    根据所述预测值对所述当前编码块进行视频编码,得到编码数据。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述目标参考像素点得到所述当前编码块对应的预测值包括:
    对所述目标参考像素点的像素值进行求和运算,得到像素统计值;
    根据所述目标数量得到移位位数,根据所述移位位数以及所述像素统计值进行移位计算,得到移位结果,根据所述移位结果得到所述当前编码块对应的预测值。
  3. 根据权利要求1所述的方法,其特征在于,所述确定所述当前编码块对应的目标参考像素点包括:
    获取所述当前编码块第一方向上对应的第一重建像素点集合、以及第二方向上对应的第二重建像素点集合,将所述第一重建像素点集合以及所述第二重建像素点集合中的重建像素点作为所述目标参考像素点;
    所述第一重建像素点集合中的重建像素点个数、与所述第二重建像素点集合中的重建像素点个数之和,等于所述目标数量。
  4. 根据权利要求1所述的方法,其特征在于,所述确定所述当前编码块对应的目标参考像素点包括:
    获取所述当前编码块第一方向上对应的第一重建像素点集合以及第二方向上对应的第二重建像素点集合;
    根据所述第一重建像素点集合和所述第二重建像素点集合中的至少一个集合,得到复制像素点集合,所述第一重建像素点集合、所述第二重建像素点集合以及所述复制像素点集合中的像素点个数之和等于所述目标数量;
    将所述第一重建像素点集合、所述第二重建像素点集合以及所述复制像素点集合中的重建像素点作为目标参考像素点。
  5. 根据权利要求3所述的方法,其特征在于,所述获取所述当前编码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合包括:
    将所述第一方向或所述第二方向上所述当前编码块的长度作为目标长度;
    根据所述目标长度确定第一像素数量以及第二像素数量,所述第一像素数量以及所述第二像素数量的和等于所述目标数量;
    从所述当前编码块第一方向上的重建像素点中选取所述第一像素数量的目标重建像素点,组成所述第一重建像素点集合;
    从所述当前编码块第二方向上选取所述第二像素数量的目标重建像素点,组成第二重建像素点集合。
  6. 根据权利要求5所述的方法,其特征在于,所述将所述第一方向或所述第二方向上所述当前编码块的长度作为目标长度包括:
    当所述当前编码块第一方向的长度大于第二方向的长度时,将第一方向上所述当前编码块的长度作为所述目标长度;
    所述从所述当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成所述第一重建像素点集合包括:
    从所述当前编码块第一方向上的相邻重建像素点中选取第一像素数量的目标重建像素点,组成所述第一重建像素点集合,所述第一像素数量的像素对应的长度小于或等于目标长度;
    所述从所述当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:
    根据所述第二像素数量,选取所述当前编码块第二方向上的相邻重建像素点以及非相邻重建像素点,将选取的重建像素点作为所述目标重建像素点,组成所述第二重建像素点集合,所述第二像素数量大于或等于第二方向上所述当前编码块的像素数量。
  7. 根据权利要求5所述的方法,其特征在于,所述将所述第一方向或所述第二方向上所述当前编码块的长度作为目标长度包括:
    当所述当前编码块第一方向的长度小于第二方向的长度时,将第一方向上所述当前编码块的长度作为所述目标长度;
    所述从所述当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成所述第一重建像素点集合包括:
    从所述当前编码块第一方向上的相邻重建像素点中,选取第一像素数量的目标重建像素点,组成所述第一重建像素点集合,所述第一像素数量的像素对应的长度小于或等于所述目标长度;
    所述从所述当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:
    根据所述第二像素数量,从所述当前编码块第一方向上的相邻重建像素点中,选取所述第二像素数量的目标重建像素点,组成所述第二重建像素点集合,所述第二像素数量小于第二方向上所述当前编码块的像素数量。
  8. 一种视频解码方法,应用于计算机设备中,所述方法包括:
    获取待解码视频帧中的当前待解码块对应的编码数据;
    确定所述当前待解码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;
    根据所述目标参考像素点得到所述当前待解码块对应的预测值;
    根据所述预测值对所述编码数据进行解码,得到所述当前待解码块对应的视频图像块。
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述目标参考像素点得到所述当前待解码块对应的预测值,包括:
    对所述目标参考像素点的像素值进行求和运算,得到像素统计值;
    根据所述目标数量得到移位位数,根据所述移位位数以及所述像素统计值进行移位计算, 得到移位结果,根据所述移位结果得到所述当前待解码块对应的预测值。
  10. 根据权利要求8所述的方法,其特征在于,所述确定所述当前待解码块对应的目标参考像素点包括:
    获取所述当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合,将所述第一重建像素点集合以及所述第二重建像素点集合中的重建像素点作为所述目标参考像素点;
    所述第一重建像素点集合中的像素点个数与所述第二重建像素点集合中的像素点个数的和等于所述目标数量。
  11. 根据权利要求8所述的方法,其特征在于,所述确定所述当前待解码块对应的目标参考像素点包括:
    获取所述当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合;
    根据所述第一重建像素点集合和所述第二重建像素点集合中的至少一个集合,得到复制像素点集合,所述第一重建像素点集合中的像素点个数、所述第二重建像素点集合中像素点个数和所述复制像素点集合中像素点个数的和等于所述目标数量;
    将所述第一重建像素点集合、所述第二重建像素点集合以及所述复制像素点集合中的重建像素点作为所述目标参考像素点。
  12. 一种视频编码装置,所述装置包括:
    当前编码块获取模块,用于获取当前视频帧中待编码的当前编码块;
    第一确定模块,用于确定所述当前编码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;
    第一预测值计算模块,用于根据所述目标参考像素点得到所述当前编码块对应的预测值;
    编码模块,用于根据所述预测值对所述当前编码块进行视频编码,得到编码数据。
  13. 一种视频解码装置,所述装置包括:
    编码数据获取模块,用于获取待解码视频帧中的当前待解码块对应的编码数据;
    第二确定模块,用于确定所述当前待解码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;
    第二预测值计算模块,用于根据所述目标参考像素点得到所述当前待解码块对应的预测值;
    解码模块,用于根据所述预测值对所述编码数据进行解码,得到所述当前待解码块对应的视频图像块。
  14. 一种计算机设备,其特征在于,包括存储器和处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    获取当前视频帧中待编码的当前编码块;
    确定所述当前编码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;
    根据所述目标参考像素点得到所述当前编码块对应的预测值;
    根据所述预测值对所述当前编码块进行视频编码,得到编码数据。
  15. 根据权利要求14所述的计算机设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    对所述目标参考像素点的像素值进行求和运算,得到像素统计值;
    根据所述目标数量得到移位位数,根据所述移位位数以及所述像素统计值进行移位计算,得到移位结果,根据所述移位结果得到所述当前编码块对应的预测值。
  16. 根据权利要求14所述的计算机设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    获取所述当前编码块第一方向上对应的第一重建像素点集合、以及第二方向上对应的第二重建像素点集合,将所述第一重建像素点集合以及所述第二重建像素点集合中的重建像素点作为所述目标参考像素点;
    所述第一重建像素点集合中的重建像素点个数、与所述第二重建像素点集合中的重建像素点个数之和,等于所述目标数量。
  17. 根据权利要求14所述的计算机设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    获取所述当前编码块第一方向上对应的第一重建像素点集合以及第二方向上对应的第二重建像素点集合;
    根据所述第一重建像素点集合和所述第二重建像素点集合中的至少一个集合,得到复制像素点集合,所述第一重建像素点集合、所述第二重建像素点集合以及所述复制像素点集合中的像素点个数之和等于所述目标数量;
    将所述第一重建像素点集合、所述第二重建像素点集合以及所述复制像素点集合中的重建像素点作为目标参考像素点。
  18. 根据权利要求16所述的计算机设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    将所述第一方向或所述第二方向上所述当前编码块的长度作为目标长度;
    根据所述目标长度确定第一像素数量以及第二像素数量,所述第一像素数量以及所述第二像素数量的和等于所述目标数量;
    从所述当前编码块第一方向上的重建像素点中选取所述第一像素数量的目标重建像素点,组成所述第一重建像素点集合;
    从所述当前编码块第二方向上选取所述第二像素数量的目标重建像素点,组成第二重建像素点集合。
  19. 根据权利要求18所述的计算机设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    当所述当前编码块第一方向的长度大于第二方向的长度时,将第一方向上所述当前编码块的长度作为所述目标长度;
    所述从所述当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成所述第一重建像素点集合包括:
    从所述当前编码块第一方向上的相邻重建像素点中选取第一像素数量的目标重建像素 点,组成所述第一重建像素点集合,所述第一像素数量的像素对应的长度小于或等于目标长度;
    所述从所述当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:
    根据所述第二像素数量,选取所述当前编码块第二方向上的相邻重建像素点以及非相邻重建像素点,将选取的重建像素点作为所述目标重建像素点,组成所述第二重建像素点集合,所述第二像素数量大于或等于第二方向上所述当前编码块的像素数量。
  20. 根据权利要求18所述的计算机设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    当所述当前编码块第一方向的长度小于第二方向的长度时,将第一方向上所述当前编码块的长度作为所述目标长度;
    所述从所述当前编码块第一方向上的重建像素点中选取第一像素数量的目标重建像素点,组成所述第一重建像素点集合包括:
    从所述当前编码块第一方向上的相邻重建像素点中,选取第一像素数量的目标重建像素点,组成所述第一重建像素点集合,所述第一像素数量的像素对应的长度小于或等于所述目标长度;
    所述从所述当前编码块第二方向上选取第二像素数量的目标重建像素点,组成第二重建像素点集合包括:
    根据所述第二像素数量,从所述当前编码块第一方向上的相邻重建像素点中,选取所述第二像素数量的目标重建像素点,组成所述第二重建像素点集合,所述第二像素数量小于第二方向上所述当前编码块的像素数量。
  21. 一种计算机设备,其特征在于,包括存储器和处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    获取待解码视频帧中的当前待解码块对应的编码数据;
    确定所述当前待解码块对应的目标参考像素点,所述目标参考像素点对应的目标数量为目标进制的e次方倍,所述e为正整数,所述目标进制为计算所述当前编码块的预测值时所采用的进制;
    根据所述目标参考像素点得到所述当前待解码块对应的预测值;
    根据所述预测值对所述编码数据进行解码,得到所述当前待解码块对应的视频图像块。
  22. 根据权利要求21所述的计算机设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    对所述目标参考像素点的像素值进行求和运算,得到像素统计值;
    根据所述目标数量得到移位位数,根据所述移位位数以及所述像素统计值进行移位计算,得到移位结果,根据所述移位结果得到所述当前待解码块对应的预测值。
  23. 根据权利要求21所述的计算机设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    获取所述当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合,将所述第一重建像素点集合以及所述第二重建像素点集合中的重建像素点作为所述目标参考像素点;
    所述第一重建像素点集合中的像素点个数与所述第二重建像素点集合中的像素点个数的和等于所述目标数量。
  24. 根据权利要求21所述的计算机设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    获取所述当前待解码块第一方向上的第一重建像素点集合以及第二方向上的第二重建像素点集合;
    根据所述第一重建像素点集合和所述第二重建像素点集合中的至少一个集合,得到复制像素点集合,所述第一重建像素点集合中的像素点个数、所述第二重建像素点集合中像素点个数和所述复制像素点集合中像素点个数的和等于所述目标数量;
    将所述第一重建像素点集合、所述第二重建像素点集合以及所述复制像素点集合中的重建像素点作为所述目标参考像素点。
  25. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行权利要求1至7中任一项权利要求所述方法的步骤;或者,使得所述处理器执行权利要求8至11中任一项权利要求所述方法的步骤。
PCT/CN2019/109972 2018-10-15 2019-10-08 视频编码、视频解码方法、装置、计算机设备和存储介质 WO2020078228A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP19872771.1A EP3869805A4 (en) 2018-10-15 2019-10-08 METHOD AND DEVICE FOR VIDEO ENCODING, METHOD AND DEVICE FOR VIDEO DECODING, COMPUTER DEVICE AND STORAGE MEDIUM
US17/074,482 US11115672B2 (en) 2018-10-15 2020-10-19 Video encoding method and apparatus, video decoding method and apparatus, computer device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811197962.5A CN111050176B (zh) 2018-10-15 2018-10-15 视频编码、视频解码方法、装置、计算机设备和存储介质
CN201811197962.5 2018-10-15

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/074,482 Continuation US11115672B2 (en) 2018-10-15 2020-10-19 Video encoding method and apparatus, video decoding method and apparatus, computer device, and storage medium

Publications (1)

Publication Number Publication Date
WO2020078228A1 true WO2020078228A1 (zh) 2020-04-23

Family

ID=70230455

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/109972 WO2020078228A1 (zh) 2018-10-15 2019-10-08 视频编码、视频解码方法、装置、计算机设备和存储介质

Country Status (4)

Country Link
US (1) US11115672B2 (zh)
EP (1) EP3869805A4 (zh)
CN (1) CN111050176B (zh)
WO (1) WO2020078228A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020164480A1 (en) * 2019-02-11 2020-08-20 Beijing Bytedance Network Technology Co., Ltd. Condition dependent video block partition
CN113784140B (zh) * 2021-09-15 2023-11-07 深圳市朗强科技有限公司 一种数学无损编码方法及设备
WO2024012559A1 (en) * 2022-07-14 2024-01-18 Zhejiang Dahua Technology Co., Ltd. Methods, systems, and storage mediums for video encoding and decoding
CN114900691B (zh) * 2022-07-14 2022-10-28 浙江大华技术股份有限公司 编码方法、编码器及计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102695061A (zh) * 2011-03-20 2012-09-26 华为技术有限公司 一种权重因子的确定方法和装置,以及一种帧内加权预测方法和装置
CN103200406A (zh) * 2013-04-12 2013-07-10 华为技术有限公司 深度图像的编解码方法和编解码装置
CN104584550A (zh) * 2012-08-31 2015-04-29 高通股份有限公司 用于可缩放视频译码的帧内预测改善
US20150245072A1 (en) * 2005-07-15 2015-08-27 Qualcomm Incorporated Video encoding method enabling highly efficient partial decoding of h.264 and other transform coded information
CN105144718A (zh) * 2013-03-25 2015-12-09 高通股份有限公司 当跳过变换时用于有损译码的帧内预测模式

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102215392B (zh) * 2010-04-09 2013-10-09 华为技术有限公司 用于估计像素值的帧内预测方法或装置
WO2012093377A1 (en) * 2011-01-07 2012-07-12 Nokia Corporation Motion prediction in video coding
CN104702962B (zh) * 2015-03-03 2019-04-16 华为技术有限公司 帧内编解码方法、编码器和解码器
US10375391B2 (en) * 2015-06-04 2019-08-06 Tsinghua University Encoding method, decoding method and device thereof
US10582195B2 (en) * 2017-06-02 2020-03-03 Futurewei Technologies, Inc. Intra prediction using unequal weight planar prediction

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150245072A1 (en) * 2005-07-15 2015-08-27 Qualcomm Incorporated Video encoding method enabling highly efficient partial decoding of h.264 and other transform coded information
CN102695061A (zh) * 2011-03-20 2012-09-26 华为技术有限公司 一种权重因子的确定方法和装置,以及一种帧内加权预测方法和装置
CN104584550A (zh) * 2012-08-31 2015-04-29 高通股份有限公司 用于可缩放视频译码的帧内预测改善
CN105144718A (zh) * 2013-03-25 2015-12-09 高通股份有限公司 当跳过变换时用于有损译码的帧内预测模式
CN103200406A (zh) * 2013-04-12 2013-07-10 华为技术有限公司 深度图像的编解码方法和编解码装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3869805A4 *

Also Published As

Publication number Publication date
EP3869805A4 (en) 2021-12-08
US20210037253A1 (en) 2021-02-04
CN111050176A (zh) 2020-04-21
EP3869805A1 (en) 2021-08-25
US11115672B2 (en) 2021-09-07
CN111050176B (zh) 2021-10-15

Similar Documents

Publication Publication Date Title
WO2020078228A1 (zh) 视频编码、视频解码方法、装置、计算机设备和存储介质
CA2676099C (en) Method of compressing digital images
JP4700491B2 (ja) 適応係数スキャン順序付け
TW201826786A (zh) 用於視訊寫碼之低複雜度符號預測
US20170195692A1 (en) Video data encoding and decoding methods and apparatuses
JP4924904B2 (ja) データフレームのシーケンスの効率的な符号化/復号
JP4987086B2 (ja) 画像符号化方法及び復号方法、それらの装置、それらのプログラム並びにプログラムを記録した記録媒体
US20060251330A1 (en) Hybrid video compression method
WO2019148906A1 (zh) 视频编码方法、计算机设备和存储介质
US8170334B2 (en) Image processing systems employing image compression and accelerated image decompression
CN106375765A (zh) 通过使用任意块的帧间预测编码/解码图像的方法和装置
US8170333B2 (en) Image processing systems employing image compression
US11917156B2 (en) Adaptation of scan order for entropy coding
US8170335B2 (en) Image processing systems employing image compression and accelerated decompression
CN105163130B (zh) 一种基于离散Tchebichef正交多项式的图像无损压缩方法
Shin et al. Expanded adaptive scaling normalization for end to end image compression
CN105453566B (zh) 数据编码及数据解码
RU2683614C2 (ru) Кодер, декодер и способ работы с использованием интерполяции
CN115442617A (zh) 一种基于视频编码的视频处理方法和装置
CN113038131B (zh) 视频编码方法、装置、计算机设备和存储介质
JP2017525185A (ja) ウェーブレット変換行列に適応可能な高精度化及び量子化方法
US20200084442A1 (en) Method of compressing image data
CN107172425B (zh) 缩略图生成方法、装置及终端设备
CN106688235B (zh) 非因果预测的信号编码方法、解码方法
WO2019150435A1 (ja) 映像符号化装置、映像符号化方法、映像復号装置、映像復号方法、及び映像符号化システム

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019872771

Country of ref document: EP

Effective date: 20210517