WO2019041219A1 - Encoding method, decoding method, encoding apparatus and decoding apparatus - Google Patents

Encoding method, decoding method, encoding apparatus and decoding apparatus Download PDF

Info

Publication number
WO2019041219A1
WO2019041219A1 PCT/CN2017/099892 CN2017099892W WO2019041219A1 WO 2019041219 A1 WO2019041219 A1 WO 2019041219A1 CN 2017099892 W CN2017099892 W CN 2017099892W WO 2019041219 A1 WO2019041219 A1 WO 2019041219A1
Authority
WO
WIPO (PCT)
Prior art keywords
segment
encoded
data
decoded
coded
Prior art date
Application number
PCT/CN2017/099892
Other languages
French (fr)
Chinese (zh)
Inventor
郑萧桢
余良
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN201780004672.1A priority Critical patent/CN108476320A/en
Priority to PCT/CN2017/099892 priority patent/WO2019041219A1/en
Publication of WO2019041219A1 publication Critical patent/WO2019041219A1/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/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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • 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/174Methods 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 slice, e.g. a line of blocks or a group of blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation

Definitions

  • the present application relates to the field of video coding, and more particularly to an encoding method, a decoding method, and an encoding device and a decoding device.
  • Video compression technology is usually used to encode the generated video data from the RAM or sensor into the DDR.
  • the compressed data is usually read into the RAM from the DDR, and then Decoding the data to obtain decoded video data.
  • the compression ratio of such data to video data is usually not too high. For example, a typical compression ratio is usually between 1 and 5 times.
  • such systems require video coding and decoding algorithms with lower implementation complexity to meet the overall system implementation requirements and overall system complexity. Existing video compression techniques are often not suitable for such systems.
  • the present application provides an encoding method, a decoding method, and an encoding apparatus and a decoding apparatus, which have low implementation complexity.
  • an encoding method including: an encoding method, comprising: determining, according to data in a fragment to be encoded of an image, a reference of the fragment to be encoded from a left side data and an upper side data of the fragment to be encoded Data; encoding the segment to be encoded according to the reference data, An encoded bit stream of the segment to be encoded is obtained.
  • the image may comprise at least one rectangular region, each rectangular region comprising at least one segment, each segment comprising at least one pixel.
  • the image may be divided into a plurality of rectangular regions, wherein at least one rectangular region spaced apart from the image boundary has the same length.
  • the first rectangular area in the at least one rectangular area may be divided into a plurality of segments, wherein at least one segment spaced apart from the boundary of the first rectangular area has the same length.
  • the height of the rectangular area may be one or more lines, that is, one rectangular area may include one or more pixel points belonging to the same column.
  • the height of the segment may be one row, that is, the number of data points belonging to the same column included in one segment may be one.
  • the rectangular area of the same length may have a corresponding number of coded bits less than or equal to a preset number of bits.
  • the rectangular areas of the same length correspond to the same number of coded bits, that is, the rectangular area in the image is encoded at a fixed magnification.
  • the code compression ratio of the image corresponding to the rectangular area is greater than or equal to the compression ratio of the same number of coded bits corresponding to the same rectangular area.
  • the purpose of the processing method is to ensure the coding compression ratio of the entire image, and at the same time, since it is not strictly guaranteed that each rectangular area corresponds to the same number of coding bits, the coding flexibility of each rectangular area can be improved and the coding efficiency can be improved.
  • the left side data of the fragment to be encoded may include data of at least one first pixel point located to the left of the fragment to be encoded.
  • the at least one first pixel may be adjacent to the segment to be encoded.
  • the rightmost pixel point of the at least one first pixel and the leftmost pixel point of the to-be-coded segment may be adjacent pixel points.
  • the at least one first pixel may be adjacent to but spaced apart from the segment to be encoded.
  • the at least one first pixel may be spaced apart from the segment to be encoded by at least one pixel.
  • at least one pixel point may be spaced between the rightmost pixel point of the at least one first pixel and the leftmost pixel point of the to-be-coded segment.
  • the data of the at least one first pixel may include original data of one or more first pixels of the at least one first pixel.
  • the data of the at least one first pixel may also include encoded data of one or more first pixels of the at least one first pixel.
  • the upper side data of the data to be encoded may include data of at least one second pixel point located above the fragment to be encoded.
  • the at least one second pixel may be adjacent to the segment to be encoded.
  • the lowest pixel point of the at least one second pixel and the uppermost pixel point of the to-be-coded segment may be adjacent pixel points.
  • the at least one second pixel may be adjacent to but spaced apart from the segment to be encoded.
  • the at least one second pixel may be spaced apart from the segment to be encoded by at least one pixel.
  • at least one pixel point may be spaced between the lowest pixel point of the at least one second pixel and the uppermost pixel point of the to-be-coded segment.
  • the data of the at least one second pixel may include original data of one or more second pixels of the at least one second pixel.
  • the data of the at least one second pixel may also include encoded data of one or more second of the at least one second pixel.
  • the encoded data of the pixel may include the encoded data of the pixel.
  • the reference pixel of the to-be-coded segment may be determined from at least one first pixel point on the left side of the fragment to be encoded and at least one second pixel point above the fragment to be encoded according to data in the fragment to be encoded. point. That is, the at least one first pixel or the at least one second pixel may be determined as a reference pixel of the segment to be encoded.
  • the data of the at least one first pixel or the data of the at least one second pixel may be determined as reference data of the segment to be encoded.
  • the coding method provided by the present application encodes a rectangular area by a fixed magnification, and has a lower implementation complexity while having a higher coding quality.
  • the determining, according to the data in the fragment to be encoded, the reference data of the fragment to be encoded from the left side data and the upper side data of the to-be-coded fragment including: Determining, by the data in the to-be-coded segment and the data of the at least one first pixel, a correlation between the segment to be encoded and the left-side data of the segment to be encoded; according to the data in the segment to be encoded and the at least one Data of the second pixel, determining the segment to be encoded and the code to be encoded Correlation between the upper side data of the fragment; the degree of correlation between the fragment to be encoded and the left side data of the fragment to be encoded, and the correlation between the fragment to be encoded and the upper side of the fragment to be encoded, From the left side data and the upper side data of the to-be-coded slice, reference data of the segment to be encoded is determined.
  • an absolute value of a difference between the data in the to-be-coded segment and the left-side data of the to-be-coded segment may be determined, and the to-be-coded segment and the to-be-coded segment are determined according to an absolute value of the difference.
  • the correlation between the data on the left side may be determined, and the to-be-coded segment and the to-be-coded segment are determined according to an absolute value of the difference.
  • the absolute value of the difference between the data in the fragment to be encoded and the data on the left side of the encoded segment may be based on data of each pixel in the encoded segment and corresponding to each pixel The absolute value of the difference between the data of a pixel is obtained.
  • the absolute value of the difference between the data in the segment to be encoded and the data on the left side of the segment to be encoded may be data of each pixel in the segment and corresponding to each pixel.
  • the function may be an absolute value function or an average variance function of the absolute difference.
  • the smaller the absolute value of the difference between the data in the fragment to be encoded and the data on the left side of the fragment to be encoded, the correlation between the fragment to be encoded and the left side data of the fragment to be encoded may be indicated. The greater the degree.
  • the correlation between the fragment to be encoded and the left side data of the fragment to be encoded is Correlation between the to-be-coded segment and the upper-side data of the to-be-coded segment, determining the reference data of the to-be-coded segment from the left-side data and the upper-side data of the to-be-coded segment, including: the segment to be encoded
  • the data of the left side data and the upper side data which are highly correlated with the fragment to be encoded are determined as reference data of the fragment to be encoded.
  • the method further includes: adding a first identifier to the encoded bit stream of the to-be-coded segment, The first identifier is used to indicate the location of the reference data of the segment to be encoded.
  • the encoded bitstream of the image may include at least one first identifier corresponding to at least one segment of the image, each first identifier may be used to identify reference data or reference pixel point of the corresponding segment position.
  • the first identifier may be used to identify that the reference pixel of the segment corresponding to the first identifier is located on the left or upper side of the segment.
  • the fourth aspect in the first aspect According to the reference data, the encoding process of the to-be-coded segment is performed according to the reference data, and the prediction residual of the to-be-coded segment is obtained, and the prediction residual is used. a quantization parameter of the fragment to be encoded, performing quantization processing on the prediction residual of the fragment to be encoded, obtaining a quantization result of the fragment to be encoded; performing entropy encoding processing on the quantization result of the fragment to be encoded, to obtain an encoding result of the fragment to be encoded .
  • the prediction result of the to-be-coded segment is quantized by using the quantization parameter of the to-be-coded segment Before the processing, the method further comprises: determining, according to the reference data, a quantization parameter of the segment to be encoded.
  • determining the quantization parameter of the to-be-coded segment according to the reference data including: determining, according to the reference data and the data in the to-be-coded segment, the complexity of the segment to be encoded; according to the complexity of the segment to be encoded Degree, the quantization parameter of the segment to be encoded is determined.
  • determining, according to the reference data and the data in the to-be-coded segment, the complexity of the to-be-coded segment including: determining, according to the reference data and the data in the to-be-coded segment, each of the to-be-coded segments The residual of the pixel; determining the complexity of the segment to be encoded according to the residual of each pixel in the segment to be encoded.
  • determining the quantization parameter of the to-be-coded segment according to the complexity of the to-be-coded segment includes: Determining the complexity of the rectangular region to which the segment to be encoded belongs according to the complexity of each segment in the rectangular region to which the segment to be encoded belongs; by comparing the complexity of the segment to be encoded and the complexity of the rectangular region to which the segment to be encoded belongs, A quantization parameter of the segment to be encoded is determined.
  • the complexity of the rectangular region may be equal to a function of the complexity of each segment in the rectangular region, such as an average function or an average variance function, and the like.
  • the determining the to-be-coded fragment from the left side data and the upper side data of the to-be-coded fragment The reference data includes: if the to-be-coded segment has available left-side data and available upper-side data, determining a reference of the to-be-coded segment from available left-side data of the to-be-coded segment and available upper-side data data.
  • the reference to the segment to be encoded is determined from the left side data and the available upper side data available for the segment to be encoded. data.
  • the left data of the segment to be encoded may be determined as reference data of the segment to be encoded.
  • the upper side data of the segment to be encoded may be determined as reference data of the segment to be encoded.
  • whether the segment to be encoded has available left side data and/or upper side data may be determined according to whether the segment to be encoded is located at a boundary of a rectangular area, a boundary of a sub image, or a boundary of an image.
  • data belonging to the same image as the segment to be encoded may be used as left side data and/or upper side data available for the piece to be encoded.
  • whether the segment to be encoded has available left side data and/or upper side data can be determined according to whether the segment to be encoded is located at the boundary of the image.
  • the upper side data of the fragment to be encoded may be used as the reference data of the fragment to be encoded as much as possible, thereby facilitating the improvement of the encoding quality.
  • the predicted value of the first N pixels in the to-be-coded segment may be determined as Determining a value, and encoding, according to the data of the first N pixels, the remaining (TN) pixels in the to-be-coded segment, where T is the number of pixels included in the segment to be encoded, 1 ⁇ N ⁇ T.
  • the segment to be encoded may have neither available left data nor available.
  • Upper side data may be
  • the preset value may be 1 ⁇ (BitDepth-1), indicating that 1 is shifted to the left by the BitDepth-1 bit, where BitDepth is the pixel bit depth.
  • N may be determined according to the number M of simultaneous processing pixels and the timing logic delay L.
  • the first N pixels of the to-be-coded segment may be specifically the N-most pixel points of the T pixels included in the to-be-coded segment.
  • the left-side data of the to-be-coded segment may be used in the segment to be encoded.
  • the pixel is encoded.
  • the segment to be encoded may have available left side data and no upper side data available.
  • the left side data of the to-be-encoded segment may be determined as reference data of the to-be-encoded segment, where the left-side data of the to-be-coded segment may specifically refer to at least one pixel located in the image to the left of the segment to be encoded. The data.
  • the upper-side data of the to-be-coded segment may be used in the segment to be encoded.
  • the pixel is encoded.
  • the segment to be encoded may have available upper side data and no available left side data.
  • the upper side data of the to-be-encoded fragment may be determined as reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically refer to at least one pixel located in the image above the to-be-coded fragment. data.
  • only data belonging to the same rectangular region as the segment to be encoded can be used as the left side data and/or the upper side data available for the segment to be encoded.
  • whether the segment to be encoded has available left side data and/or upper side data may be determined according to whether the segment to be encoded is located at a boundary of the first rectangular region.
  • prediction of the first N pixel points in the to-be-coded segment is determined as a preset value, and according to the data of the first N pixels, the remaining (TN) pixels in the to-be-coded segment are encoded, where T is the pixel included in the segment to be encoded.
  • T is the pixel included in the segment to be encoded. The number, 1 ⁇ N ⁇ T.
  • the segment to be encoded may have neither left side data available nor The upper side data is available.
  • the to-be-coded segment is adjacent to an upper boundary of the first rectangular region and the to-be-coded segment is spaced apart from a left boundary of the first rectangular region, the to-be-coded segment is configured according to the left-side data of the segment to be encoded.
  • the pixel points in the encoded segment are subjected to encoding processing.
  • the fragment to be encoded may have available left-side data and not Has available upper side data. At this point, you can left the fragment to be encoded.
  • the side data is determined as the reference data of the fragment to be encoded, wherein the left side data of the fragment to be encoded may specifically refer to the same rectangular area (ie, located in the first rectangular area) and located in the to-be-coded fragment. Data for at least one pixel on the left side.
  • the to-be-coded segment is spaced apart from an upper boundary of the first rectangular region and the to-be-coded segment is adjacent to a left boundary of the first rectangular region, according to the upper side data of the to-be-coded segment, the to-be-coded segment
  • the pixel points in the encoded segment are subjected to encoding processing.
  • the to-be-coded segment may have available upper-side data and not Has left side data available.
  • the upper side data of the to-be-coded fragment may be determined as the reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically belong to the same rectangular area as the to-be-coded fragment (ie, located at the Data in at least one pixel of the rectangular region and located above the segment to be encoded.
  • the image may include at least one sub-image, each sub-image including at least one rectangular region.
  • each sub-image may include one or more rectangular regions in the height direction.
  • only the data belonging to the same sub-image as the segment to be encoded can be used as the left side data and/or the upper side data available for the segment to be encoded.
  • whether the segment to be encoded has available left side data and/or upper side data can be determined according to whether the segment to be encoded is located at the boundary of the sub-image to which it belongs.
  • the first N in the to-be-coded segment is determined as a preset value, and according to the data of the first N pixels, the remaining (TN) pixels in the to-be-coded segment are encoded, where T is the segment to be encoded.
  • T is the segment to be encoded.
  • the segment to be encoded may have neither available left data nor available Side data.
  • the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the fragment to be encoded belongs, and the to-be-coded segment is spaced apart from a left boundary of the sub-image to which the fragment to be encoded belongs, according to the left-side data of the fragment to be encoded. And encoding the pixel points in the segment to be encoded.
  • the segment to be encoded is adjacent to the upper boundary of the sub-image to which it belongs and the to-be-written
  • the code segment is spaced apart from the left boundary of the sub-image to which it belongs, and the segment to be encoded may have available left side data and no available upper side data.
  • the left side data of the to-be-coded fragment may be determined as the reference data of the to-be-coded fragment, where the left-hand data of the to-be-coded fragment may specifically belong to the same sub-image as the to-be-coded fragment and is located in the to-be-coded
  • the data of at least one pixel on the left side of the segment may be determined as the reference data of the to-be-coded fragment, where the left-hand data of the to-be-coded fragment may specifically belong to the same sub-image as the to-be-coded fragment and is located in the to-be-coded The data of at least one pixel on the left side of the segment.
  • the to-be-coded segment is spaced apart from the upper boundary of the sub-image to which the fragment to be encoded belongs, and the to-be-coded segment is adjacent to the left boundary of the sub-image to which the fragment to be encoded belongs, according to the upper data of the fragment to be encoded. And encoding the pixel points in the segment to be encoded.
  • the segment to be encoded may have available upper side data and has no available left. Side data.
  • the upper side data of the to-be-coded fragment may be determined as the reference data of the to-be-encoded fragment, where the upper-side data of the to-be-coded fragment may specifically belong to the same sub-image as the to-be-coded fragment and is located in the to-be-coded
  • the segment to be encoded may use the upper side data in the same sub-image as the available upper side data and only the left side data in the same rectangular area as the available left side data.
  • the segment to be encoded may use the left side data in the same sub image as the available left side data and only the left side data in the same rectangular area as the available left side data, and the like.
  • the to-be-coded segment is adjacent to a left boundary of the sub-image to which the to-be-coded segment belongs, and the to-be-coded segment is spaced apart from an upper boundary of the image, the to-be-coded according to the upper-side data of the to-be-coded segment
  • the pixels in the segment are encoded.
  • only data belonging to the same sub-image as the segment to be encoded can be used as the left side data available for the segment to be encoded, and the data located on the upper side of the segment to be encoded in the image can be used as the available segment of the segment to be encoded.
  • Side data Specifically, whether the segment to be encoded has available left side data is determined according to whether the segment to be encoded is located at a left boundary of the sub-image to which it is to be included, and whether the segment to be encoded is determined according to whether the segment to be encoded is located at an upper boundary of the image Has available upper side data.
  • the upper boundary of the sub-image can be considered to have available upper side data.
  • the upper side data of the to-be-encoded fragment may be determined as reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically refer to at least one pixel located in the image above the to-be-coded fragment. data.
  • the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the to-be-coded segment belongs and the to-be-coded segment is spaced apart from the left boundary of the image, the to-be-coded according to the left-side data of the to-be-coded segment
  • the pixels in the segment are encoded.
  • the data belonging to the same sub-image as the segment to be encoded can be used as the upper side data of the segment to be encoded, and the data located in the image to the left of the segment to be encoded can be used as the available left of the segment to be encoded.
  • Side data may be determined according to whether the segment to be encoded is located at an upper boundary of the sub-image to which it is to be included, and whether the segment to be encoded is determined according to whether the segment to be encoded is located at a left boundary of the image Has left side data available.
  • the left side data of the to-be-encoded segment may be determined as reference data of the to-be-encoded segment, where the left-side data of the to-be-coded segment may specifically refer to at least one pixel located in the image to the left of the segment to be encoded. The data.
  • each of the M adjacent pixel points in the to-be-coded segment corresponds to the same reference pixel point
  • the reference data of the segment to be encoded includes data of the reference pixel, and M ⁇ 1.
  • M adjacent pixel points located in the same row may correspond to the same reference pixel point. Accordingly, encoding processing can be performed on M adjacent pixel points located in the same row at the same time.
  • M pixel points can be simultaneously encoded, so that data processing efficiency can be improved.
  • the method further includes: if the number of coded bits currently used by the rectangular area to which the fragment to be encoded belongs is Bi Less than or equal to the number of coded bits B allowed for the rectangular region to which the segment to be encoded belongs, and the coded bits to be used by the current pixel to be coded in the segment to be encoded The sum of the numbers bi+1 and Bi is greater than B, and an end code is added to the encoded bit stream of the fragment to be encoded, where the end code is used to identify that the encoding of the rectangular area to which the fragment to be encoded belongs is ended and the rectangular area to which the fragment to be encoded belongs has At least one uncoded pixel.
  • B may be equal to the number of coded bits corresponding to the fixed code rate.
  • an end code corresponding to the rectangular area may be added to the encoded bit stream of the image to indicate that the rectangular area has at least one Uncoded pixels.
  • a second aspect provides a decoding method, including: acquiring a first identifier corresponding to a segment to be decoded in an encoded bitstream of an image; determining a reference of the segment to be decoded according to the first identifier corresponding to the segment to be encoded
  • the data is the upper side data or the left side data of the to-be-decoded segment, where the left side data of the to-be-decoded segment includes data of at least one first pixel point located on the left side of the to-be-decoded segment, and the upper side of the to-be-decoded data
  • the data includes data of at least one second pixel located above the segment to be decoded; and the segment to be decoded is decoded according to the reference data of the segment to be decoded.
  • the image may include at least one rectangular region, each rectangular region including at least one segment, each segment including at least one pixel point, wherein the rectangular regions of the same length correspond to a number of coded bits less than or equal to a preset number of bits.
  • the encoded bitstream of the image may include a first identifier corresponding to each of the at least one segment included in the image, and the first identifier corresponding to each segment is used to identify reference data of each segment (or reference pixel point) where.
  • the decoding process of the to-be-decoded segment according to the reference data includes: performing entropy decoding processing on the to-be-decoded segment to obtain a quantization parameter of the to-be-decoded segment; Performing inverse quantization processing on the to-be-decoded segment according to the quantization parameter of the to-be-decoded segment to obtain residual data of the to-be-decoded segment; and performing inverse prediction (or compensation) on the residual data of the to-be-decoded segment according to the reference data. Processing, obtaining a decoding result of the segment to be decoded.
  • an encoding apparatus for performing the method of any of the above first aspect or any of the possible implementations of the first aspect.
  • the apparatus comprises means for performing the method of any of the above-described first aspect or any of the possible implementations of the first aspect.
  • a decoding apparatus for performing the method of any of the above-described second aspect or any of the possible implementations of the second aspect.
  • the apparatus comprises means for performing the method of any of the above-described second aspect or any of the possible implementations of the second aspect.
  • another encoding apparatus comprising: a memory for storing instructions for executing instructions stored in the memory, and a processor, and when the processor executes the instructions stored by the memory, The execution causes the processor to perform the method of the first aspect or any possible implementation of the first aspect.
  • another decoding apparatus comprising: a memory for storing instructions for executing instructions stored in the memory, and a processor, when the processor executes the instructions stored by the memory, The execution causes the processor to perform the method of the second aspect or any possible implementation of the second aspect.
  • a seventh aspect a computer readable medium for storing a computer program, the computer program comprising instructions for performing the method of the first aspect or any of the possible implementations of the first aspect.
  • a computer readable medium for storing a computer program comprising instructions for performing the method of the second aspect or any of the possible implementations of the second aspect.
  • a computer program product comprising instructions, when executed on a computer, causes the computer to perform the method of any of the first aspect or the first aspect of the first aspect.
  • a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any of the above-described second or second aspects.
  • a codec system comprising any of the encoding devices of the third aspect and any of the fourth aspects, or any of the encoding devices of the fifth aspect and any of the sixth aspects.
  • FIG. 1 is a schematic flowchart of an encoding method provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a decoding method provided by an embodiment of the present application.
  • FIG. 3 is a schematic block diagram of an encoding apparatus according to an embodiment of the present application.
  • FIG. 4 is another schematic block diagram of an encoding apparatus according to an embodiment of the present application.
  • FIG. 5 is a schematic block diagram of a decoding apparatus provided by an embodiment of the present application.
  • FIG. 6 is another schematic block diagram of an encoding apparatus according to an embodiment of the present application.
  • FIG. 7 is another schematic block diagram of a decoding apparatus provided by an embodiment of the present application.
  • the image may be divided into at least one rectangular area, and each rectangular area includes a plurality of pixel points.
  • a rectangular area may be referred to as a tile or other name, but this embodiment of the present application does not limit this.
  • different rectangular regions in the image may have the same or different lengths.
  • at least one rectangular area spaced from the image boundary may have the same length.
  • the height of the rectangular area may be 1 pixel point or a plurality of pixel points, which is not limited in this embodiment of the present application.
  • an image may be divided into a plurality of rectangular regions according to a first preset size, and rectangular regions not located at an image boundary may have the same size.
  • the rectangular area located at the boundary of the image is limited by the size of the image, and its size may be determined by the first preset size and the image size, and may be the same size as other rectangular areas not located at the boundary of the image, or may be different from other rectangular areas. the same.
  • the image length is 3840 pixels and the first preset size is 1056 pixels
  • the image can be divided into four rectangular regions in order from left to right, wherein the lengths of the first to third rectangular regions are It can be 1056 pixels, and the fourth rectangular area is located at the image boundary. If the length of the rectangular area is still 1056 pixels, the rectangular area will exceed the image boundary. At this time, the length of the fourth rectangular area can be set. It is 672 pixels, but the embodiment of the present application is not limited thereto.
  • some or all of the rectangular regions in the at least one rectangular region may be further divided into at least one segment, each segment including at least one pixel.
  • different segments in the rectangular region may have the same or different lengths.
  • at least one segment spaced apart from the boundary of the rectangular region may have the same length, but the embodiment of the present application is not limited thereto.
  • a rectangular area may be divided into a plurality of segments according to a second preset size, and segments not located at a boundary of the rectangular area may have the same size, and the segments located at the boundary of the rectangular area are limited by the size of the rectangular area, and the size may be different from other sizes.
  • the segments that are not located at the boundary of the rectangular area are the same or different in size, which is not limited by the embodiment of the present application.
  • the pixel points in the image may be encoded and decoded by using a fixed magnification in units of rectangular regions. That is to say, the number of coded bits corresponding to the rectangular area of the same length is less than or equal to the preset number of bits.
  • the rectangular areas of the same length correspond to the same number of coded bits, that is, the rectangular area in the image is encoded at a fixed magnification.
  • the code compression ratio of the image corresponding to the rectangular area is greater than or equal to the compression ratio of the same number of coded bits corresponding to the same rectangular area.
  • the purpose of the processing method is to ensure the coding compression ratio of the entire image, and at the same time, since it is not strictly guaranteed that each rectangular area corresponds to the same number of coding bits, the coding flexibility of each rectangular area can be improved and the coding efficiency can be improved.
  • the technical solution provided by the embodiment of the present application has lower implementation complexity and higher coding efficiency.
  • each pixel contains three components of Y, U, and V, and the number of bits of each component is 12 bits
  • the total number of uncoded bits included in the rectangular area is 12672. If the compression ratio is 2 times, the number of bits (ie, the number of coded bits) after compression corresponding to the rectangular area is 6336.
  • the left side data or the upper side data is used as the reference data for each segment in the rectangular area, which is beneficial to improve the encoding quality.
  • the number of coded bits of the segment may be coded and processed without using a fixed magnification, thereby ensuring the coding quality of the segment in the rectangular region and the flexibility of encoding and decoding.
  • FIG. 1 is a schematic flowchart of an encoding method 100 provided by an embodiment of the present application.
  • the reference data of the fragment to be encoded may be determined from the left side data and the upper side data of the to-be-coded fragment according to data in the to-be-coded fragment.
  • the left side data of the fragment to be encoded may include data of at least one first pixel point located to the left of the fragment to be encoded.
  • the number of the at least one first pixel may be equal to the number of pixels included in the segment to be encoded, or the number of the at least one first pixel may be greater or smaller than the segment to be encoded.
  • the number of the pixel points is not limited in this embodiment of the present application.
  • the at least one first pixel may be located to the left of the segment to be encoded.
  • the at least one first pixel may be adjacent to the to-be-coded segment, that is, the rightmost pixel in the at least one first pixel may be adjacent to the leftmost pixel in the to-be-coded segment.
  • the at least one first pixel may be spaced apart from the to-be-coded segment.
  • the at least one first pixel and the to-be-coded segment may be separated by at least one pixel, that is, the at least one first pixel.
  • the rightmost pixel in the image may be spaced apart from the leftmost pixel in the segment to be encoded by at least one pixel, wherein the number of pixels spaced between the at least one first pixel and the segment to be encoded It may be less than a certain threshold, that is, the at least one first pixel may be adjacent to the fragment to be encoded, but the embodiment of the present application does not limit this.
  • the data of the first pixel may refer to raw data or encoded data of the first pixel.
  • the data of the at least one first pixel may include original data of each of the at least one first pixel, or may include each of the at least one first pixel
  • the encoded data or may include the original data of the partial pixels in the at least one first pixel and the encoded data of the other partial pixels, and the like, which is not limited in this embodiment of the present application.
  • the upper side data of the data to be encoded includes data of at least one second pixel point located above the fragment to be encoded.
  • the number of the at least one second pixel may be equal to the number of pixels included in the segment to be encoded, or the number of the at least one second pixel may be greater or smaller than the segment to be encoded.
  • the number of the pixel points is not limited in this embodiment of the present application.
  • the at least one second pixel may be located above the segment to be encoded.
  • the at least one second pixel may be adjacent to the segment to be encoded.
  • the at least one second pixel may be spaced apart from the to-be-coded segment.
  • the at least one second pixel and the to-be-coded segment may be separated by at least one pixel, wherein the at least one second pixel
  • the number of the pixels in the interval between the point and the to-be-coded segment may be less than a certain threshold, that is, the at least one second pixel may be adjacent to the segment to be encoded, but the embodiment of the present application does not limit this.
  • the data of the second pixel may refer to the original data of the second pixel or has been edited. Code data.
  • the data of the at least one second pixel may include original data of each of the at least one second pixel, or may include each second pixel of the at least one second pixel
  • the encoded data or may include the original data of the partial pixels of the at least one second pixel and the encoded data of the other partial pixels, and the like, which is not limited by the embodiment of the present application.
  • the reference data of the segment may be selected from the left side data and the upper side data of the segment according to at least one pixel included in the segment.
  • the reference pixel point of the segment may be determined from at least one first pixel point on the left side of the segment and at least one second pixel point above the segment according to at least one pixel point included in the segment to be encoded.
  • at least one first pixel on the left side of the segment to be encoded may be determined as a reference pixel of the segment to be encoded, and correspondingly, the left side data of the segment to be encoded may be determined as reference data of the segment to be encoded.
  • At least one second pixel above the segment to be encoded may be determined as a reference pixel of the segment to be encoded, and correspondingly, the upper data of the segment to be encoded may be determined as reference data of the segment to be encoded.
  • the reference data herein may specifically refer to the data of the reference pixel, which is not limited by the embodiment of the present application.
  • the correlation between the fragment to be encoded and the at least one first pixel and the correlation between the fragment to be encoded and the at least one second pixel may be selected from the at least one A reference pixel of the segment to be encoded is determined from a pixel and the at least one second pixel.
  • reference data of the segment to be encoded is determined according to the correlation between the to-be-coded segment and the left-side data of the to-be-coded segment and the correlation between the segment to be encoded and the upper-side data of the segment to be encoded.
  • the data to be encoded and the left side data of the to-be-coded segment may be determined according to data of at least one pixel included in the to-be-coded segment and left-side data of the segment to be encoded.
  • the correlation between the two As an example, the absolute value of the difference between the data in the fragment to be encoded and the data on the left side of the fragment to be encoded may be determined, and the fragment to be encoded and the fragment to be encoded are determined according to the absolute value of the difference. The correlation between the data on the left side.
  • the variance between the to-be-coded segment and the left-side data of the to-be-coded segment or the data transformation, such as a Hadamard transform, and subsequent data may be used to determine the coded segment and the left side data.
  • the correlation between the two As an example, the smaller the absolute value of the difference between the data in the fragment to be encoded and the data on the left side of the fragment to be encoded, the smaller the number of the difference between the data to be encoded and the data to be encoded.
  • the correlation between the data on the left side of the segment is larger, but the embodiment of the present application is not limited thereto.
  • the absolute value of the difference between the data in the to-be-coded segment and the left-side data of the encoded segment may be based on data of each pixel in the encoded segment and The absolute value of the difference between the data of the first pixel corresponding to each pixel is obtained.
  • the absolute value of the difference between the data in the segment to be encoded and the data on the left side of the segment to be encoded may be data of each pixel in the segment and a first pixel corresponding to each pixel.
  • a function of the sum of the absolute values of the differences between the points of the data, the function may be an average function or a mean square function, etc., but the embodiment of the present application is not limited thereto.
  • the difference diff between the to-be-coded segment and the left-side data of the segment to be encoded can be determined by:
  • the sampled data may be obtained by averaging data within a specific step size in the data of the segment to be encoded, or may be obtained by extracting a point in the data of the segment to be encoded within a specific step size, etc.
  • This embodiment of the present application does not limit this.
  • the particular step size may be determined based on n and m.
  • the particular step size can optionally be a divisor of n and m; or, if n is not equal to an integer multiple of m, then the particular step size can optionally be n and m
  • the approximation of the divisor is such that the divisor of n and m is rounded up, rounded down, or rounded off, but the embodiment of the present application is not limited thereto.
  • the difference diff between the data to be encoded and the left data of the data to be encoded can be determined by:
  • the sampled data can Is obtained by averaging data within a specific step size in the left side data of the coded segment, or may be obtained by extracting a point in the left side data of the slice to be encoded within a specific step size, etc. This embodiment of the present application does not limit this.
  • the particular step size may be determined based on n and m.
  • the particular step size can optionally be a divisor of n and m; or, if m is not equal to an integer multiple of n, the particular step size can optionally be n and m
  • the approximation of the divisor, such as the divisor of m and n is rounded up, rounded down or rounded to the value obtained, but the embodiment of the present application is not limited thereto.
  • the correlation between the to-be-coded segment and the upper-side data of the to-be-coded segment may be determined according to data of at least one pixel included in the to-be-coded segment and upper-side data of the segment to be encoded.
  • the specific implementation of the present invention may be similar to the foregoing method for processing the data on the left side, but the embodiment of the present application does not limit this.
  • the data on the left side of the fragment to be encoded and the data in the upper side data having a greater degree of relevance to the fragment to be encoded may be determined as the reference data of the fragment to be encoded, but The application embodiment is not limited to this.
  • the left-side data of the to-be-coded segment may be determined as reference data of the to-be-coded segment.
  • the upper-side data of the to-be-coded segment may be determined as reference data of the to-be-coded segment, but the present application is implemented. The example is not limited to this.
  • a segment can use any data in the image as reference data, that is, the segment can use any data in an image of the same rectangular region or a different rectangular region as the segment as reference data.
  • a segment may use the upper side data of the segment (for example, data of adjacent pixel points located above the segment) as reference data, regardless of whether the pixel corresponding to the upper side data and the segment Belongs to the same rectangular area.
  • a segment can only use data in a rectangular region to which the segment belongs as reference data, and cannot use data other than the rectangular region to which the segment belongs as reference data, so that codecs between different rectangular regions in the image can be made. They can be independent of each other.
  • the image may be divided into at least one sub-image, each sub-image may include at least one rectangular region, for example, one rectangular region may include one row of pixel points, one sub-image may include H rows of pixel points, and H is greater than or equal to 1.
  • a clip can only use the slice
  • the data in the sub-image to which the segment belongs is used as the reference data.
  • the data of the sub-image to which the segment belongs may be the same rectangular area as the segment, or the data of the sub-image to which the segment belongs may belong to a different rectangular area.
  • the data other than the sub-image to which the segment belongs may not be used as the reference data, but the embodiment of the present application is not limited thereto.
  • the segment to be encoded may be determined that the segment to be encoded has available upper side data, and accordingly, if the segment to be encoded and the to-be-coded segment If the upper boundary of the rectangular region to which the encoded segment belongs is adjacent, it can be determined that the segment to be encoded does not have available upper side data.
  • the segment to be encoded may be determined that the segment to be encoded has available upper side data, and accordingly, if the segment to be encoded is adjacent to the upper boundary of the image, It is determined that the segment to be encoded does not have available upper side data.
  • the segment to be encoded is not adjacent to or spaced apart from the upper boundary of the sub-image to which the segment to be encoded belongs, it may be determined that the segment to be encoded has available upper side data, and correspondingly, if the segment to be encoded and the segment to be encoded are If the upper boundary of the sub-image is adjacent, it can be determined that the segment to be encoded does not have the available upper-side data, but the embodiment of the present application does not limit this.
  • the segment to be encoded is not adjacent to or spaced apart from the left boundary of the rectangular region to which the segment to be encoded belongs, it may be determined that the segment to be encoded has available left data, and correspondingly, if the segment to be encoded and the segment to which the segment to be encoded belongs If the left border of the region is adjacent, it can be determined that the segment to be encoded does not have available left side data. Alternatively, if the segment to be encoded is not adjacent to or spaced apart from the left boundary of the image, it may be determined that the segment to be encoded has available left side data, and correspondingly, if the segment to be encoded is adjacent to the left boundary of the image, It is determined that the segment to be encoded does not have available left side data.
  • the segment to be encoded is not adjacent to or spaced apart from the left boundary of the sub-image to which the segment to be encoded belongs, it may be determined that the segment to be encoded has available left-side data, and correspondingly, if the segment to be encoded and the segment to be encoded are If the left edge of the sub-image is adjacent to the sub-image, it can be determined that the segment to be encoded does not have the available left-side data, but the embodiment of the present application does not limit this.
  • whether the segment has available upper side data and whether the segment has available left side data may have the same criterion.
  • Determining the reference data of the to-be-coded segment from the left-side data and the upper-side data of the to-be-coded segment including: if the to-be-coded segment has available left-side data and available upper-side data, from the to-be-coded segment
  • the available left side data and the available upper side data determine the reference data of the fragment to be encoded.
  • the reference data of the segment to be encoded is determined from the left side data available for the segment to be encoded and the available upper side data.
  • the left data of the segment to be encoded may be determined as reference data of the segment to be encoded.
  • the upper side data of the segment to be encoded may be determined as reference data of the segment to be encoded.
  • whether the segment to be encoded has available left side data and/or upper side data may be determined according to whether the segment to be encoded is located at a boundary of a rectangular area, a boundary of a sub image, or a boundary of an image.
  • data belonging to the same image as the segment to be encoded may be used as left side data and/or upper side data available for the piece to be encoded.
  • whether the segment to be encoded has available left side data and/or upper side data can be determined according to whether the segment to be encoded is located at the boundary of the image.
  • the upper side data of the fragment to be encoded may be used as the reference data of the fragment to be encoded as much as possible, thereby facilitating the improvement of the encoding quality.
  • the left-side data of the to-be-coded segment may be used in the segment to be encoded.
  • the pixel is encoded.
  • the segment to be encoded may have available left side data and does not have available upper side data.
  • the left side data of the to-be-encoded segment may be determined as reference data of the to-be-encoded segment, where the left-side data of the to-be-coded segment may specifically refer to at least one pixel located in the image to the left of the segment to be encoded. The data.
  • the upper-side data of the to-be-coded segment may be used in the segment to be encoded.
  • the pixel is encoded.
  • the segment to be encoded may have available upper side data and no available left side data.
  • the upper side data of the to-be-encoded fragment may be determined as reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically refer to at least one pixel located in the image above the to-be-coded fragment. data.
  • only data belonging to the same rectangular region as the segment to be encoded can be used as the left side data and/or the upper side data available for the segment to be encoded.
  • whether the segment to be encoded has available left side data and/or upper side data may be determined according to whether the segment to be encoded is located at a boundary of the first rectangular region.
  • the to-be-coded segment is adjacent to an upper boundary of the first rectangular region and the to-be-coded segment is spaced apart from a left boundary of the first rectangular region, the to-be-coded segment is configured according to the left-side data of the segment to be encoded.
  • the pixel points in the encoded segment are subjected to encoding processing.
  • the fragment to be encoded may have available left-side data and not Has available upper side data.
  • the data of the left side of the to-be-coded segment may be determined as the reference data of the to-be-coded segment, where the left-hand data of the segment to be encoded may specifically belong to the same rectangular region as the segment to be encoded (ie, located at the first Data in at least one pixel of a rectangular area and located to the left of the segment to be encoded.
  • the to-be-coded segment is spaced apart from an upper boundary of the first rectangular region and the to-be-coded segment is adjacent to a left boundary of the first rectangular region, according to the upper side data of the to-be-coded segment, the to-be-coded segment
  • the pixel points in the encoded segment are subjected to encoding processing.
  • the to-be-coded segment may have available upper-side data and not Has left side data available.
  • the upper side data of the to-be-coded fragment may be determined as the reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically belong to the same rectangular area as the to-be-coded fragment (ie, located at the Data in at least one pixel of the rectangular region and located above the segment to be encoded.
  • the image may include at least one sub-image, each sub-image including at least one rectangular region.
  • each sub-image may include one or more rectangular regions in the height direction.
  • only the data belonging to the same sub-image as the segment to be encoded can be used as the left side data and/or the upper side data available for the segment to be encoded.
  • whether the segment to be encoded has available left side data and/or upper side data can be determined according to whether the segment to be encoded is located at the boundary of the sub-image to which it belongs.
  • the segment to be encoded is opposite to the upper boundary of the sub-image to which the segment to be encoded belongs
  • the neighboring segment and the to-be-coded segment are spaced apart from the left boundary of the sub-image to which the segment to be encoded belongs, and the pixel in the segment to be encoded is encoded according to the left-side data of the segment to be encoded.
  • the segment to be encoded may have available left-side data and is not available. Side data.
  • the left side data of the to-be-coded fragment may be determined as the reference data of the to-be-coded fragment, where the left-hand data of the to-be-coded fragment may specifically belong to the same sub-image as the to-be-coded fragment and is located in the to-be-coded
  • the to-be-coded segment is spaced apart from the upper boundary of the sub-image to which the fragment to be encoded belongs, and the to-be-coded segment is adjacent to the left boundary of the sub-image to which the fragment to be encoded belongs, according to the upper data of the fragment to be encoded. And encoding the pixel points in the segment to be encoded.
  • the segment to be encoded may have available upper side data and has no available left. Side data.
  • the upper side data of the to-be-coded fragment may be determined as the reference data of the to-be-encoded fragment, where the upper-side data of the to-be-coded fragment may specifically belong to the same sub-image as the to-be-coded fragment and is located in the to-be-coded
  • the segment to be encoded may also be determined according to different criteria whether the segment to be encoded has available upper side data and left side data.
  • the segment to be encoded may use the upper side data in the same sub-image as the available upper side data and only the left side data in the same rectangular area as the available left side data.
  • the segment to be encoded may use the left side data in the same sub image as the available left side data and only the left side data in the same rectangular area as the available left side data, and the like.
  • the to-be-coded segment is adjacent to a left boundary of the sub-image to which the to-be-coded segment belongs, and the to-be-coded segment is spaced apart from an upper boundary of the image, the to-be-coded according to the upper-side data of the to-be-coded segment
  • the pixels in the segment are encoded.
  • only data belonging to the same sub-image as the segment to be encoded can be used as the left side data available for the segment to be encoded, and the data located on the upper side of the segment to be encoded in the image can be used as the available segment of the segment to be encoded.
  • Side data Specifically, whether the segment to be encoded has available left side data is determined according to whether the segment to be encoded is located at a left boundary of the sub-image to which it is to be included, and whether the segment to be encoded is determined according to whether the segment to be encoded is located at an upper boundary of the image Has available upper side data.
  • the fragment to be encoded is adjacent to a left boundary of the sub-image to which the sub-image is to be located and the segment to be encoded is spaced apart from an upper boundary of the image
  • whether the segment to be encoded is at an upper boundary of the sub-image to which the sub-image belongs can be considered to have available upper side data.
  • the upper side data of the to-be-encoded fragment may be determined as reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically refer to at least one pixel located in the image above the to-be-coded fragment. data.
  • the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the to-be-coded segment belongs and the to-be-coded segment is spaced apart from the left boundary of the image, the to-be-coded according to the left-side data of the to-be-coded segment
  • the pixels in the segment are encoded.
  • the data belonging to the same sub-image as the segment to be encoded can be used as the upper side data of the segment to be encoded, and the data located in the image to the left of the segment to be encoded can be used as the available left of the segment to be encoded.
  • Side data may be determined according to whether the segment to be encoded is located at an upper boundary of the sub-image to which it is to be included, and whether the segment to be encoded is determined according to whether the segment to be encoded is located at a left boundary of the image Has left side data available.
  • the left side data of the to-be-encoded segment may be determined as reference data of the to-be-encoded segment, where the left-side data of the to-be-coded segment may specifically refer to at least one pixel located in the image to the left of the segment to be encoded. The data.
  • the to-be-encoded segment may not have available upper-side data and does not have available left-side data, for example, the to-be-encoded segment and the upper boundary of the image, and the sub-image to which the segment to be encoded belongs The boundary or the upper boundary of the rectangular region to which the code segment belongs is adjacent, and the segment to be encoded is adjacent to the left boundary of the image, the left boundary of the sub-image to which the slice to be encoded belongs, or the left boundary of the rectangular region to which the code segment belongs.
  • the data of at least one pixel in the segment to be encoded may be As reference data of at least one pixel in the latter to be encoded.
  • the predicted value of the first N pixel points in the to-be-coded segment may be determined as a preset value. For example, 1 ⁇ (BitDepth-1) may be determined as the predicted value of the first N pixel points, where , ⁇ is the left shift operator, BitDepth is the pixel bit depth, indicating the number of coded bits used by each uncoded pixel.
  • the pixel point j located on the left side of the pixel point i and spaced apart from the pixel point i by L pixels may be used as the reference pixel of the pixel point i.
  • the value of the pixel point j as the reference pixel may be the value of the original pixel point of the pixel point j or the value of the coded reconstructed pixel point of the pixel point j.
  • the pixel points in the segment may be encoded/decoded by the degree of parallelism M, that is, the M pixels may be encoded/decoded at the same time, where M is greater than or equal to 1
  • M is greater than or equal to 1
  • each of the M adjacent pixel points in the to-be-coded segment may correspond to the same reference pixel, where the M adjacent pixels may be located in the same row, but the embodiment of the present application does not limit this.
  • N may be determined by M and a timing logic delay L, where the delay of the sequential logic is determined by the structure of the hardware design, such as the number of stages designed by the chip pipeline, wherein L may be The pixel coding delay value of the encoding end and the maximum value of the pixel decoding delay value of the decoding end, but the embodiment of the present application is not limited thereto.
  • the segment to be encoded may be subjected to prediction processing according to the reference data to obtain a prediction residual of the segment to be encoded. Then, the prediction residual of the to-be-coded segment may be quantized by using the quantization parameter of the to-be-coded segment to obtain a quantized result of the segment to be encoded. Then, the quantization result of the segment to be encoded may be subjected to entropy coding processing to obtain a coding result of the segment to be encoded.
  • the prediction residual of the fragment to be encoded may include an absolute value of the residual value of each pixel in the to-be-coded segment, wherein, as an example, the absolute value of the residual value of the pixel may be the pixel The absolute value of the difference between the original data and the original data of the reference pixel of the pixel, but this embodiment of the present application does not limit this.
  • the quantization result of the to-be-coded segment may be obtained by performing quantization processing on a residual of each pixel in the to-be-coded segment.
  • the quantization process may be quantization in the H.264/AVC standard, quantization in the H.265/HEVC standard, and the AVS1-P2 standard.
  • the quantization, the quantization in the AVS2-P2 standard, or the self-designed quantization table, and the like, are not limited in this embodiment of the present application.
  • the entropy coding process may be a lossless coding process, and specifically, an Nth order Golomb code and a context-based adaptive variable length coding (CAVLC) may be adopted.
  • CAVLC context-based adaptive variable length coding
  • CABAC content-based adaptive binary arithmetic coding
  • the quantization parameter of the fragment to be encoded may also be determined according to the reference data.
  • the original quantization parameter may be updated according to the reference data to obtain a quantization parameter of the fragment to be encoded.
  • the original quantization parameter may be an initial quantization parameter of the to-be-coded segment.
  • the original quantization parameter may be an initial quantization parameter of the image, or a quantization parameter of a previous segment of the to-be-coded segment, and the like. The embodiment does not limit this.
  • the quantization parameter may include a quantization step, a quantization step size, or a value (for example, QP) indicating a quantization step size, a quantization matrix, or a quantization matrix index, etc.
  • a value for example, QP
  • the complexity of the segment to be encoded may be determined according to the reference data, and the quantization parameter of the segment to be encoded is determined according to the complexity of the segment to be encoded.
  • the quantization parameter of the segment to be encoded may be determined according to the complexity of the segment to be encoded and the total complexity of the rectangular region to which the segment to be encoded belongs.
  • the residual of each pixel point may be determined according to the reference data of the to-be-coded segment and the data of each pixel in the to-be-coded segment, and according to the to-be-coded segment.
  • the residual of each pixel determines the complexity of the segment to be encoded.
  • the residual of each pixel may be determined according to data of each pixel in the to-be-coded segment and data of a reference pixel of each pixel, where the reference of the segment to be encoded is
  • the data may include the data of the reference pixel of each pixel in the segment to be encoded, but the embodiment of the present application does not limit this.
  • the total complexity of the rectangular area to which the fragment to be encoded belongs may be determined according to the complexity of each fragment included in the rectangular area to which the fragment to be encoded belongs.
  • the total complexity of a rectangular area may be the rectangle.
  • the average of the complexity of the plurality of segments included in the region but the embodiment of the present application is not limited thereto.
  • the quantization parameter of the segment to be encoded may be determined by comparing the complexity of the segment to be encoded and the total complexity of the rectangular region to which the segment to be encoded belongs. For example, if the complexity of the segment to be encoded is greater than the total complexity of the rectangular region to which the segment to be encoded belongs, the original quantization parameter may be reduced to obtain a quantization parameter of the segment to be encoded. For another example, if the complexity of the segment to be encoded is smaller than the total complexity of the rectangular region to which the segment to be encoded belongs, the original quantization parameter may be added to obtain a quantization parameter of the segment to be encoded.
  • the original quantization parameter may be kept unchanged, that is, the quantization parameter of the segment to be encoded is equal to the original quantization parameter. There is no limit to this.
  • the to-be-coded segment may be encoded by using the quantization parameter of the to-be-encoded segment, but the embodiment of the present application does not limit this.
  • the quantization parameter of each segment and the corresponding number of coded bits are determined according to the data included in each segment in the rectangular region, which is advantageous for improving the coding quality.
  • a first identifier may be added to the encoded bitstream of the to-be-coded segment, where the reference data of the to-be-coded segment is located. position.
  • the first identifier may be used to indicate whether the reference data point of the fragment to be encoded is located on the left side or the upper side of the fragment to be encoded, or the first identifier may further indicate the coordinates of the reference data point of the fragment to be encoded.
  • the pixel is separated from the to-be-coded segment by a few pixels, and the like.
  • the first identifier corresponding to each segment may be added to the header information of the encoded bit stream of the image to identify the location of the reference data of the segment, but the embodiment of the present application does not limit this.
  • an end code is added to the encoded bitstream corresponding to the rectangular region, wherein the end code can be used to identify the end of encoding of the rectangular region and the rectangular region further has at least one uncoded pixel.
  • the end code needs to be different from the coded bit in the coded bitstream corresponding to the rectangular area, that is, the uniqueness of the end code in the coded bit stream corresponding to the rectangular area needs to be guaranteed. For example, when a 0th-order Columbus code is used and the bit depth of the coded pixel is 12, the pattern of the end code can be set to consecutive 14 '0's, but this embodiment of the present application Not limited.
  • the stuffing bits may be added to the encoded bit stream corresponding to the rectangular area, so that the number of bits included in the encoded bit stream corresponding to the rectangular area is Strictly equal to the number of bits corresponding to the fixed compression ratio.
  • the padding bit may be a plurality of consecutive '1's or a plurality of consecutive '0's, which is not limited by the embodiment of the present application.
  • the coding method provided by the embodiment of the present application can have lower implementation complexity while ensuring the coding quality.
  • parallel coding processing on pixel points can be implemented, thereby improving data processing capability.
  • FIG. 2 shows a decoding method 200 provided by an embodiment of the present application.
  • the image may include at least one rectangular region, each rectangular region including at least one segment, each segment including at least one pixel.
  • rectangular areas of the same length may correspond to the same number of coded/decoded bits.
  • the encoded bitstream of the image may include a first identifier corresponding to each of the at least one segment included in the image, wherein the first identifier corresponding to each segment may be used to identify each segment The location of the reference data.
  • the different segments may correspond to different first identifiers.
  • the location of the reference data of each segment may be determined according to the first identifier corresponding to each segment, but the embodiment of the present application Not limited to this.
  • S220 Determine, according to the first identifier corresponding to the to-be-decoded segment, the reference data of the to-be-decoded segment as the upper side data or the left side data of the to-be-decoded segment.
  • the first identifier corresponding to the to-be-coded segment may be used to identify that the location of the reference data of the to-be-decoded segment is the left side or the upper side of the to-be-coded segment.
  • the left side data of the to-be-decoded segment may include data of at least one first pixel point located to the left of the to-be-decoded segment, where the at least one first pixel point may be adjacent to or spaced from the to-be-decoded segment.
  • the data of each of the first pixel points may include the original data or the decoded data of the first pixel, which is not limited by the embodiment of the present application.
  • the upper side data of the to-be-decoded data may include data of at least one second pixel point located above the to-be-decoded segment, where the at least one second pixel point may be
  • the decoded segments are adjacent or spaced apart, and the data of each second pixel may include the original data or the decoded data of the second pixel, which is not limited in this embodiment of the present application.
  • S230 Perform decoding processing on the to-be-decoded segment according to the reference data of the to-be-decoded segment.
  • the to-be-decoded segment may be subjected to an entropy decoding process to obtain a quantization parameter of the to-be-decoded segment. Then, the to-be-decoded segment may be inverse quantized according to the quantization parameter of the to-be-decoded segment to obtain the to-be-decoded
  • the residual data of the segment may be inversely predicted or compensated according to the reference data to obtain a decoding result of the segment to be decoded.
  • the reference data of the segment to be decoded may include data of pixels in the image that are adjacent to the segment to be decoded.
  • the to-be-decoded segment is adjacent to an upper boundary of the image and the to-be-decoded segment is adjacent to a left boundary of the image, determining a residual value of the first N pixel points in the to-be-decoded segment as a pre- Setting a value, and performing decoding processing on the remaining (TN) pixel points in the to-be-decoded segment according to the data of the first N pixel points, where T is the number of pixel points included in the to-be-decoded segment, 1 ⁇ N ⁇ T.
  • the pixel in the to-be-decoded segment Perform decoding processing.
  • the pixel in the to-be-decoded segment Perform decoding processing.
  • the reference data of the segment to be decoded may be data adjacent to the segment to be decoded in the rectangular region to which the segment to be decoded belongs.
  • the first N in the to-be-decoded segment is determined as a preset value, and according to the data of the first N pixel points, the remaining (TN) pixel points in the to-be-decoded segment are decoded, where T is the to-be-decoded The number of pixels included in the segment, 1 ⁇ N ⁇ T.
  • the root According to the left side data of the to-be-decoded segment, the pixel points in the to-be-decoded segment are subjected to decoding processing.
  • the to-be-decoded segment is spaced apart from the upper boundary of the rectangular region to which the segment to be decoded belongs, and the to-be-decoded segment is adjacent to the left boundary of the rectangular region to which the segment to be decoded belongs, according to the upper data of the segment to be decoded. Decoding processing of the pixel points in the segment to be decoded.
  • the image includes at least one sub-image, each sub-image including at least one rectangular region.
  • the reference data of the segment to be decoded may be data adjacent to the segment to be decoded in the sub-image to which the segment to be decoded belongs.
  • the first N in the to-be-decoded segment is determined as a preset value, and according to the data of the first N pixel points, the remaining (TN) pixel points in the to-be-decoded segment are decoded, where T is the to-be-decoded The number of pixels included in the segment, 1 ⁇ N ⁇ T.
  • the to-be-decoded segment is adjacent to an upper boundary of the sub-image to which the to-be-decoded segment belongs and the to-be-decoded segment is spaced apart from a left boundary of the sub-image to which the to-be-decoded segment belongs, according to the left-side data of the to-be-decoded segment Decoding processing of the pixel points in the segment to be decoded.
  • the to-be-decoded segment is spaced apart from an upper boundary of the sub-image to which the to-be-decoded segment belongs and the to-be-decoded segment is adjacent to a left boundary of the sub-image to which the to-be-decoded segment belongs, according to the upper side data of the to-be-decoded segment Decoding processing of the pixel points in the segment to be decoded.
  • the to-be-decoded segment is adjacent to an upper boundary and a left boundary of the sub-image to which the to-be-decoded segment belongs, and the to-be-decoded segment is spaced apart from an upper boundary of the image, according to the upper side data of the to-be-decoded segment,
  • the pixel in the segment to be decoded is subjected to decoding processing.
  • the to-be-decoded segment is adjacent to an upper boundary and a left boundary of the sub-image to which the to-be-decoded segment belongs, and the to-be-decoded segment is spaced apart from a left boundary of the image, according to the left side data of the to-be-decoded segment,
  • the pixel in the segment to be decoded is subjected to decoding processing.
  • each M adjacent pixel points in the to-be-decoded segment corresponds to the same reference pixel point, where the reference data of the to-be-decoded segment includes data of the reference pixel point, and M ⁇ 1.
  • the decoding method 200 may correspond to the foregoing encoding method, and may specifically be an inverse process of the encoding method.
  • the description of the encoding method For specific implementation, here is not Let me repeat.
  • FIG. 3 shows an encoding apparatus 300 provided by an embodiment of the present application, including:
  • the pre-analysis module 310 is configured to determine, according to data in the segment to be encoded of the image, reference data of the segment to be encoded from the left side data and the upper side data of the to-be-coded segment;
  • the encoding module 320 is configured to perform encoding processing on the fragment to be encoded according to the reference data determined by the pre-analysis module 310 to obtain an encoded bit stream of the fragment to be encoded.
  • the image may include at least one rectangular area, each rectangular area including at least one segment, and each segment may include at least one pixel.
  • the number of coded bits corresponding to the rectangular area having the same length is less than or equal to the preset number of bits.
  • the rectangular areas of the same length correspond to the same number of coded bits, that is, the rectangular area in the image is encoded at a fixed magnification.
  • the code compression ratio of the image corresponding to the rectangular area is greater than or equal to the compression ratio of the same number of coded bits corresponding to the same rectangular area.
  • the purpose of the processing method is to ensure the coding compression ratio of the entire image, and at the same time, since it is not strictly guaranteed that each rectangular area corresponds to the same number of coding bits, the coding flexibility of each rectangular area can be improved and the coding efficiency can be improved.
  • the data of the left side of the fragment to be encoded may include data of at least one first pixel located to the left of the fragment to be encoded, and the data of the upper side of the data to be encoded may be located above the fragment to be encoded. At least one second pixel point of data.
  • the reference data of the segment to be encoded may refer to the data of the reference data point of the segment to be encoded.
  • the process of determining the reference data of the segment to be encoded may include determining a reference data point of the segment to be encoded, where the location of the reference data point of the segment to be encoded may be the left side or the upper side of the segment to be encoded, specifically The embodiment of the present application does not limit the data and/or the location of the fragment to be encoded.
  • the at least one first pixel may be adjacent to the segment to be encoded or adjacent to the segment to be encoded but spaced apart.
  • the data of the at least one first pixel may include original data of the at least one first pixel or encoded data of the at least one first pixel.
  • the at least one second pixel may be adjacent to the segment to be encoded or adjacent to the segment to be encoded but spaced apart.
  • the data of the at least one second pixel may include original data of the at least one second pixel or encoded data of the at least one second pixel.
  • the pre-analysis module 310 can be specifically configured to:
  • the reference data of the segment to be encoded is determined.
  • the pre-analysis module 310 is configured to determine, as the reference data of the to-be-coded segment, the data on the left side of the to-be-coded segment and the data in the upper-side data that is highly correlated with the to-be-coded segment. .
  • the encoding module 320 is further configured to: add a first identifier to the encoded bitstream of the to-be-encoded segment, where the first identifier is used to indicate a location of the reference data of the to-be-coded segment.
  • the apparatus 300 further includes: a boundary processing module 330, configured to: if the number of coded bits Bi currently used by the rectangular area to which the fragment to be encoded belongs is less than or equal to the fragment to be encoded The number of coded bits B to be used in the rectangular area to be used, and the sum of the number of coded bits bi+1 and Bi to be used in the current to-be-coded pixel to be encoded is greater than B, and the end of the coded bit stream to be added to the segment to be encoded is added. And the end code is used to identify that the encoding of the rectangular region to which the segment to be encoded belongs is ended and the rectangular region to which the segment to be encoded belongs has at least one uncoded pixel.
  • a boundary processing module 330 configured to: if the number of coded bits Bi currently used by the rectangular area to which the fragment to be encoded belongs is less than or equal to the fragment to be encoded The number of coded bits B to be used in the rectangular area to be used, and the sum of the number of
  • the encoding module 320 can include:
  • the prediction unit 321 is configured to perform prediction processing on the to-be-coded segment according to the reference data, to obtain a prediction residual of the to-be-coded segment;
  • the quantization unit 322 is configured to perform quantization processing on the prediction residual of the to-be-coded segment obtained by the prediction unit 321 by using the quantization parameter of the to-be-coded segment, to obtain a quantization result of the to-be-coded segment;
  • the entropy encoding unit 323 is configured to perform entropy encoding processing on the quantized result of the to-be-encoded segment obtained by the quantization unit 322 to obtain an encoding result of the to-be-encoded segment.
  • the encoding module 320 may further include: a rate control unit 324, configured to: before the quantization unit 322 quantizes the prediction result of the to-be-coded segment by using the quantization parameter of the to-be-coded segment, according to the pre- Determining the quantization parameter of the segment to be encoded by the reference data determined by the analysis module 310;
  • the quantization unit 322 can be specifically configured to perform quantization processing on the prediction result of the segment to be encoded by using the quantization parameter determined by the rate control unit 324.
  • the rate control unit 324 is specifically configured to:
  • the quantization parameter of the segment to be encoded is determined according to the complexity of the segment to be encoded.
  • the rate control unit 324 is specifically configured to:
  • the complexity of the segment to be encoded is determined according to the residual of each pixel in the segment to be encoded.
  • the rate control unit 324 is specifically configured to:
  • the quantization parameter of the segment to be encoded is determined by comparing the complexity of the segment to be encoded and the complexity of the rectangular region to which the segment to be encoded belongs.
  • the pre-analysis module 310 may be specifically configured to: if the to-be-coded segment has available left-side data and available upper-side data, from available left-side data and available upper-side data of the to-be-coded segment Determining the reference data of the segment to be encoded.
  • the pre-analysis module 310 may determine available left-side data or upper-side data of the to-be-coded segment as the to-be-coded segment. Reference data.
  • the encoding module 320 may be further configured to use the first N pixels in the to-be-coded segment.
  • the predicted value of the point is determined as a preset value, and according to the data of the first N pixel points, the remaining (TN) pixel points in the to-be-coded segment are encoded, where T is included in the to-be-coded segment.
  • the encoding module 320 may further be configured to: according to the left side data of the to-be-coded segment, The pixel points in the segment to be encoded are subjected to encoding processing.
  • the encoding module 320 may be further configured to use, according to the upper-side data of the to-be-coded segment, The pixel points in the segment to be encoded are subjected to encoding processing.
  • the encoding module 320 may be further configured to:
  • the predicted values of the first N pixels in the to-be-coded segment are determined as preset values, and the remaining (TN) pixels in the to-be-coded segment are encoded according to the data of the first N pixels.
  • T is the number of pixel points included in the segment to be encoded, 1 ⁇ N ⁇ T.
  • the encoding module 320 may be further configured to The left side data of the fragment to be encoded is encoded by the pixel in the fragment to be encoded;
  • the encoding module 320 may be further configured to The upper side data of the fragment to be encoded is subjected to encoding processing on the pixel points in the fragment to be encoded.
  • the encoding module 320 may be further configured to:
  • the predicted values of the first N pixels in the to-be-coded segment are determined as preset values, and the remaining (TN) pixels in the to-be-coded segment are encoded according to the data of the first N pixels.
  • T is the number of pixel points included in the segment to be encoded, 1 ⁇ N ⁇ T.
  • the encoding module 320 may be further configured to The left side data of the to-be-coded segment is subjected to encoding processing on the pixel points in the to-be-coded segment.
  • the segment to be encoded and the upper boundary of the sub-image to which the segment to be encoded belongs An interval is distributed and the segment to be encoded is adjacent to a left boundary of the sub-image to which the segment to be encoded belongs, and the pixel in the segment to be encoded is encoded according to the upper side data of the segment to be encoded.
  • the encoding module 320 may be further configured to be used according to the to-be-coded segment. Encoding the upper side data of the segment, and encoding the pixel points in the segment to be encoded.
  • the encoding module 320 may further be configured to be used according to the to-be-coded segment. Encoding the left side data of the segment, and encoding the pixel points in the segment to be encoded.
  • each M adjacent pixel points in the to-be-coded segment may correspond to the same reference pixel point, where the reference data of the to-be-coded segment includes data of the reference pixel point, and M ⁇ 1.
  • the encoding device 300 may not include the one or more modules described above.
  • the encoding device 300 may not include the boundary processing module 330.
  • the embodiment of the present application does not limit this.
  • the apparatus 300 herein is embodied in the form of a functional module.
  • the apparatus 300 may be specifically the execution body of the coding method in the foregoing embodiment, and the apparatus 300 may be used to perform various processes and/or steps in the foregoing method embodiments. Avoid repetition and we will not repeat them here.
  • FIG. 5 shows a decoding apparatus 400 provided by an embodiment of the present application, including:
  • the obtaining module 410 is configured to acquire a first identifier corresponding to the segment to be decoded in the encoded bit stream of the image, where the image includes at least one rectangular region, each rectangular region includes at least one segment, and each segment includes at least one pixel a point, wherein the number of coded bits corresponding to the rectangular area having the same length is less than or equal to a preset number of bits, and the coded bit stream of the image includes a first identifier corresponding to each of the at least one segment included in the image, The first identifier corresponding to each segment is used to identify the location of the reference data of each segment;
  • the determining module 420 is configured to determine, according to the first identifier corresponding to the to-be-coded segment that is obtained by the acquiring module 410, that the reference data of the to-be-decoded segment is the upper-side data or the left-side data of the to-be-decoded segment, where the The left side data of the decoded segment includes data of at least one first pixel located to the left of the segment to be decoded, and the upper side data of the to-be-decoded data includes the segment to be decoded Data of at least one second pixel above;
  • the decoding module 430 is configured to perform decoding processing on the to-be-decoded segment according to the reference data of the to-be-decoded segment determined by the determining module 420.
  • the decoding module 430 can include:
  • An entropy decoding unit configured to perform entropy decoding processing on the to-be-decoded segment, to obtain a quantization parameter of the to-be-decoded segment
  • An inverse quantization unit configured to perform inverse quantization processing on the to-be-decoded segment according to the quantization parameter of the to-be-decoded segment obtained by the entropy decoding unit, to obtain residual data of the to-be-decoded segment;
  • the anti-prediction unit is configured to perform inverse prediction processing on the residual data of the to-be-decoded segment obtained by the inverse quantization unit according to the reference data determined by the determining module 420, to obtain a decoding result of the to-be-decoded segment.
  • the apparatus 400 herein is embodied in the form of a functional module.
  • the apparatus 400 may be specifically the execution body of the decoding method in the foregoing embodiment, and the apparatus 400 may be used to perform various processes and/or steps in the foregoing method embodiments. Avoid repetition and we will not repeat them here.
  • module may refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor for executing one or more software or firmware programs (eg, sharing). Processors, proprietary processors or group processors, etc.) and memory, merge logic, and/or other suitable components that support the described functionality.
  • ASIC application specific integrated circuit
  • FIG. 6 illustrates another encoding apparatus 500 provided by an embodiment of the present application, including: a processor 510 and a memory 520, wherein the memory 520 is configured to store an instruction, and the processor 510 is configured to execute the memory stored instruction, where Execution of the instruction stored in the memory 520 causes the processor 510 to perform an operation of determining the fragment to be encoded from the left side data and the upper side data of the fragment to be encoded according to data in the fragment to be encoded of the image.
  • the segment to be encoded is encoded to obtain an encoded bit stream of the segment to be encoded.
  • the processor 510 is specifically configured to: perform prediction processing on the to-be-coded segment according to the reference data, to obtain a prediction residual of the to-be-coded segment, and use the quantization parameter of the to-be-coded segment to be encoded.
  • the prediction residual of the segment is quantized to obtain a quantization result of the segment to be encoded; and the quantization result of the segment to be encoded is subjected to entropy coding processing to obtain a coding result of the segment to be encoded.
  • the processor 510 is further configured to: determine, according to the reference data, the to-be-determined The quantization parameter of the encoded fragment.
  • the apparatus 500 may be specifically the encoding apparatus in the foregoing embodiment, and the apparatus 500 may be used to perform various processes and/or steps in the foregoing method embodiments, in order to avoid duplication. I will not repeat them here.
  • FIG. 7 illustrates another decoding apparatus 600 provided by an embodiment of the present application, including: a processor 610 and a memory 620, wherein the memory 620 is configured to store an instruction, and the processor 610 is configured to execute the memory stored instruction, where Execution of the instruction stored in memory 620 causes the processor 610 to perform the following operations:
  • the processor 610 is specifically configured to:
  • the residual data of the to-be-decoded segment is subjected to inverse prediction processing to obtain a decoding result of the to-be-decoded segment.
  • the apparatus 600 may be specifically the decoding apparatus in the foregoing embodiment, and the apparatus 600 may be used to perform various processes and/or steps in the foregoing method embodiments, to avoid repetition. I will not repeat them here.
  • the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory can include read only memory and random access memory and provides instructions and data to the processor.
  • a portion of the memory may also include a non-volatile random access memory.
  • the memory can also store information of the device type.
  • the processor can be used to execute instructions stored in the memory, and when the processor executes the instructions, the processor can perform the steps corresponding to the terminal device in the above method embodiments.
  • each step of the above method may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented by the hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in a memory, and the processor executes instructions in the memory, in combination with hardware to perform the steps of the above method. To avoid repetition, it will not be described in detail here.
  • the pixels in the image may be located in different rows and/or columns, wherein the length of A may correspond to the number of pixels included in the same row of A, and the height of A may be Corresponds to the number of pixels in the same column that A includes.
  • the length and height of A may also be referred to as the width and depth of A, respectively, which is not limited by the embodiment of the present application.
  • the boundary distribution with A may mean that at least one pixel is spaced apart from the boundary of A, and may also be referred to as “not adjacent to the boundary of A” or “not located at A”.
  • the boundary is not limited in this embodiment, and A may be an image, a rectangular area or a sub-image, and the like.
  • system and “network” are used interchangeably herein.
  • the term “and/or” in this context is merely an association describing the associated object, indicating that there may be three relationships, for example, A and/or B, which may indicate that A exists separately, and both A and B exist, respectively. B these three situations.
  • the character "/" in this article generally indicates that the contextual object is an "or" relationship.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transfer to another website site, computer, server, or data center by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL), or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media.
  • the usable medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)) or the like.
  • a magnetic medium eg, a floppy disk, a hard disk, a magnetic tape
  • an optical medium eg, a DVD
  • a semiconductor medium eg, a solid state disk (SSD)

Landscapes

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

Abstract

An encoding method, a decoding method, an encoding apparatus and a decoding apparatus, wherein same have a relatively low implementation complexity. The encoding method comprises: according to data in a fragment to be encoded of an image, determining, from left-side data and upper-side data of the fragment to be encoded, reference data of the fragment to be encoded; and according to the reference data, performing encoding processing on the fragment to be encoded, so as to obtain an encoded bit stream of the fragment to be encoded, wherein the image comprises at least one rectangular area, each rectangular area comprises at least one fragment, each fragment comprises at least one pixel point, and the number of encoded bits corresponding to rectangular areas having the same length is less than or equal to a pre-set number of bits; and the left-side data of the fragment to be encoded comprises data located at at least one first pixel point on the left side of the fragment to be encoded, and the upper-side data of the fragment to be encoded comprises data located at at least one second pixel point on the upper side of the fragment to be encoded.

Description

编码方法、解码方法以及编码装置和解码装置Encoding method, decoding method, and encoding device and decoding device
版权申明Copyright statement
本专利文件披露的内容包含受版权保护的材料。该版权为版权所有人所有。版权所有人不反对任何人复制专利与商标局的官方记录和档案中所存在的该专利文件或者该专利披露。The disclosure of this patent document contains material that is subject to copyright protection. This copyright is the property of the copyright holder. The copyright owner has no objection to the reproduction of the patent document or the patent disclosure in the official records and files of the Patent and Trademark Office.
技术领域Technical field
本申请涉及视频编码领域,并且更具体地,涉及编码方法、解码方法以及编码装置和解码装置。The present application relates to the field of video coding, and more particularly to an encoding method, a decoding method, and an encoding device and a decoding device.
背景技术Background technique
为了减少视频存储和传输所占用的带宽,需要对视频数据进行编码压缩处理。现有的几种典型编码技术均可以达到较高的编码质量,但具有较高的实现复杂度,在一些视频编解码系统中并不适用。例如,在显示系统或者相机系统中,为了降低用于随机存取存储器(random access memory,RAM)与双倍速率(double data rate,DDR)内存或传感器(sensor)与DDR之间交互的带宽压力,通常会利用视频压缩技术将所生成的视频数据经编码后从RAM或传感器写入DDR中,作为该过程的逆过程,也通常会从DDR中将压缩后的数据读入RAM中,然后再对数据进行解码操作获得解码后的视频数据。此类系统对视频数据的压缩率通常不会太高,例如,典型的压缩率通常在1~5倍之间。此外,此类系统要求视频编码及解码算法具有较低的实现复杂度,以便能够满足整个系统的实现要求及整个系统的复杂度。现有的视频压缩技术往往不适用于此类系统。In order to reduce the bandwidth occupied by video storage and transmission, it is necessary to encode and compress the video data. Several existing typical coding techniques can achieve higher coding quality, but have higher implementation complexity, and are not applicable in some video coding and decoding systems. For example, in a display system or a camera system, in order to reduce bandwidth pressure for interaction between random access memory (RAM) and double data rate (DDR) memory or sensor and DDR Video compression technology is usually used to encode the generated video data from the RAM or sensor into the DDR. As the reverse process of the process, the compressed data is usually read into the RAM from the DDR, and then Decoding the data to obtain decoded video data. The compression ratio of such data to video data is usually not too high. For example, a typical compression ratio is usually between 1 and 5 times. In addition, such systems require video coding and decoding algorithms with lower implementation complexity to meet the overall system implementation requirements and overall system complexity. Existing video compression techniques are often not suitable for such systems.
发明内容Summary of the invention
本申请提供一种编码方法、解码方法以及编码装置和解码装置,具有较低的实现复杂度。The present application provides an encoding method, a decoding method, and an encoding apparatus and a decoding apparatus, which have low implementation complexity.
第一方面,提供了一种编码方法,包括:编码方法,包括:根据图像的待编码片段中的数据,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据;根据该参考数据,对该待编码片段进行编码处理, 得到该待编码片段的编码比特流。In a first aspect, an encoding method is provided, including: an encoding method, comprising: determining, according to data in a fragment to be encoded of an image, a reference of the fragment to be encoded from a left side data and an upper side data of the fragment to be encoded Data; encoding the segment to be encoded according to the reference data, An encoded bit stream of the segment to be encoded is obtained.
可选地,该图像可以包括至少一个矩形区域,每个矩形区域包括至少一个片段,每个片段包括至少一个像素点。Optionally, the image may comprise at least one rectangular region, each rectangular region comprising at least one segment, each segment comprising at least one pixel.
可选地,可以将该图像划分为多个矩形区域,其中,与该图像边界间隔分布的至少一个矩形区域具有相同的长度。Alternatively, the image may be divided into a plurality of rectangular regions, wherein at least one rectangular region spaced apart from the image boundary has the same length.
可选地,可以将该至少一个矩形区域中的第一矩形区域划分为多个片段,其中,与该第一矩形区域的边界间隔分布的至少一个片段具有相同的长度。Optionally, the first rectangular area in the at least one rectangular area may be divided into a plurality of segments, wherein at least one segment spaced apart from the boundary of the first rectangular area has the same length.
可选地,矩形区域的高度可以为一行或多行,即一个矩形区域可以包括属于同一列的像素点个数可以为一个或多个。Optionally, the height of the rectangular area may be one or more lines, that is, one rectangular area may include one or more pixel points belonging to the same column.
可选地,片段的高度可以为一行,即一个片段包括的属于同一列的数据点个数可以为一个。Optionally, the height of the segment may be one row, that is, the number of data points belonging to the same column included in one segment may be one.
可选地,长度相同的矩形区域可以对应的编码比特数少于或等于预设的比特数。Optionally, the rectangular area of the same length may have a corresponding number of coded bits less than or equal to a preset number of bits.
当所述的编码比特数等于预设的比特数时,长度相同的矩形区域对应相同的编码比特数,即以固定倍率对该图像中的矩形区域进行编码处理。When the number of coded bits is equal to the preset number of bits, the rectangular areas of the same length correspond to the same number of coded bits, that is, the rectangular area in the image is encoded at a fixed magnification.
当所述的编码比特数少于或等于预设的比特数时,所述矩形区域对应的图像的编码压缩率大于或等于所述长度相同的矩形区域对应相同的编码比特数的压缩率。When the number of coded bits is less than or equal to a preset number of bits, the code compression ratio of the image corresponding to the rectangular area is greater than or equal to the compression ratio of the same number of coded bits corresponding to the same rectangular area.
所述处理方法的目的在于保证整幅图像的编码压缩率,同时由于不用严格保证每个矩形区域对应相同的编码比特数,从而可以提高每个矩形区域的编码灵活性并提高编码效率。The purpose of the processing method is to ensure the coding compression ratio of the entire image, and at the same time, since it is not strictly guaranteed that each rectangular area corresponds to the same number of coding bits, the coding flexibility of each rectangular area can be improved and the coding efficiency can be improved.
可选地,待编码片段的左侧数据可以包括位于该待编码片段左侧的至少一个第一像素点的数据。Optionally, the left side data of the fragment to be encoded may include data of at least one first pixel point located to the left of the fragment to be encoded.
可选地,该至少一个第一像素点可以与该待编码片段相邻。例如,该至少一个第一像素点中的最右侧像素点与该待编码片段中的最左侧像素点可以为相邻的像素点。Optionally, the at least one first pixel may be adjacent to the segment to be encoded. For example, the rightmost pixel point of the at least one first pixel and the leftmost pixel point of the to-be-coded segment may be adjacent pixel points.
可选地,该至少一个第一像素点可以与该待编码片段临近但间隔分布。例如,该至少一个第一像素点可以与该待编码片段间隔至少一个像素点。例如,该至少一个第一像素点中的最右侧像素点与该待编码片段中的最左侧像素点之间可以间隔至少一个像素点。 Optionally, the at least one first pixel may be adjacent to but spaced apart from the segment to be encoded. For example, the at least one first pixel may be spaced apart from the segment to be encoded by at least one pixel. For example, at least one pixel point may be spaced between the rightmost pixel point of the at least one first pixel and the leftmost pixel point of the to-be-coded segment.
可选地,该至少一个第一像素点的数据可以包括该至少一个第一像素点中一个或多个第一像素点的原始数据。Optionally, the data of the at least one first pixel may include original data of one or more first pixels of the at least one first pixel.
可选地,该至少一个第一像素点的数据也可以包括该至少一个第一像素点中一个或多个第一该像素点的已编码数据。Optionally, the data of the at least one first pixel may also include encoded data of one or more first pixels of the at least one first pixel.
可选地,待编码数据的上侧数据可以包括位于该待编码片段上方的至少一个第二像素点的数据。Optionally, the upper side data of the data to be encoded may include data of at least one second pixel point located above the fragment to be encoded.
可选地,该至少一个第二像素点可以与该待编码片段相邻。例如,该至少一个第二像素点中的最下方像素点与该待编码片段中的最上方像素点可以为相邻的像素点。Optionally, the at least one second pixel may be adjacent to the segment to be encoded. For example, the lowest pixel point of the at least one second pixel and the uppermost pixel point of the to-be-coded segment may be adjacent pixel points.
可选地,该至少一个第二像素点可以与该待编码片段临近但间隔分布。例如,该至少一个第二像素点可以与该待编码片段间隔至少一个像素点。例如,该至少一个第二像素点中的最下方像素点与该待编码片段中的最上方像素点之间可以间隔至少一个像素点。Optionally, the at least one second pixel may be adjacent to but spaced apart from the segment to be encoded. For example, the at least one second pixel may be spaced apart from the segment to be encoded by at least one pixel. For example, at least one pixel point may be spaced between the lowest pixel point of the at least one second pixel and the uppermost pixel point of the to-be-coded segment.
可选地,该至少一个第二像素点的数据可以包括该至少一个第二像素点中一个或多个第二像素点的原始数据。Optionally, the data of the at least one second pixel may include original data of one or more second pixels of the at least one second pixel.
可选地,该至少一个第二像素点的数据也可以包括该至少一个第二像素点中一个或多个第二该像素点的已编码数据。Optionally, the data of the at least one second pixel may also include encoded data of one or more second of the at least one second pixel.
可选地,像素点的已编码数据可以包括像素点的已编码的数据。Alternatively, the encoded data of the pixel may include the encoded data of the pixel.
可选地,可以根据待编码片段中的数据,从该待编码片段左侧的至少一个第一像素点和该待编码片段上方的至少一个第二像素点中,确定该待编码片段的参考像素点。即,可以将该至少一个第一像素点或该至少一个第二像素点确定为该待编码片段的参考像素点。Optionally, the reference pixel of the to-be-coded segment may be determined from at least one first pixel point on the left side of the fragment to be encoded and at least one second pixel point above the fragment to be encoded according to data in the fragment to be encoded. point. That is, the at least one first pixel or the at least one second pixel may be determined as a reference pixel of the segment to be encoded.
相应地,可以将该至少一个第一像素点的数据或将该至少一个第二像素点的数据确定为该待编码片段的参考数据。Correspondingly, the data of the at least one first pixel or the data of the at least one second pixel may be determined as reference data of the segment to be encoded.
因此,本申请提供的编码方法,采用固定倍率对矩形区域进行编码处理,在具有较高编码质量的同时具有较低的实现复杂度。Therefore, the coding method provided by the present application encodes a rectangular area by a fixed magnification, and has a lower implementation complexity while having a higher coding quality.
在第一方面的第一种可能的实现方式中,该根据待编码片段中的数据,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据,包括:根据该待编码片段中的数据和该至少一个第一像素点的数据,确定该待编码片段与该待编码片段的左侧数据之间的相关度;根据该待编码片段中的数据和该至少一个第二像素点的数据,确定该待编码片段与该待编码 片段的上侧数据之间的相关度;根据该待编码片段与该待编码片段的左侧数据之间的相关度以及该待编码片段与该待编码片段的上侧数据之间的相关度,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据。In a first possible implementation manner of the first aspect, the determining, according to the data in the fragment to be encoded, the reference data of the fragment to be encoded from the left side data and the upper side data of the to-be-coded fragment, including: Determining, by the data in the to-be-coded segment and the data of the at least one first pixel, a correlation between the segment to be encoded and the left-side data of the segment to be encoded; according to the data in the segment to be encoded and the at least one Data of the second pixel, determining the segment to be encoded and the code to be encoded Correlation between the upper side data of the fragment; the degree of correlation between the fragment to be encoded and the left side data of the fragment to be encoded, and the correlation between the fragment to be encoded and the upper side of the fragment to be encoded, From the left side data and the upper side data of the to-be-coded slice, reference data of the segment to be encoded is determined.
可选地,可以确定该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值,并根据该差值的绝对值,确定该待编码片段与该待编码片段的左侧数据之间的相关度。Optionally, an absolute value of a difference between the data in the to-be-coded segment and the left-side data of the to-be-coded segment may be determined, and the to-be-coded segment and the to-be-coded segment are determined according to an absolute value of the difference. The correlation between the data on the left side.
可选地,该待编码片段中的数据与该编码片段的左侧数据之间的差值的绝对值可以是根据该编码片段中每个像素点的数据和与该每个像素点对应的第一像素点的数据之间的差值的绝对值得到的。Optionally, the absolute value of the difference between the data in the fragment to be encoded and the data on the left side of the encoded segment may be based on data of each pixel in the encoded segment and corresponding to each pixel The absolute value of the difference between the data of a pixel is obtained.
作为一个例子,该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值可以是该编码片段中每个像素点的数据和与该每个像素点对应的第一像素点的数据之间的差值的绝对值之和的函数。As an example, the absolute value of the difference between the data in the segment to be encoded and the data on the left side of the segment to be encoded may be data of each pixel in the segment and corresponding to each pixel. A function of the sum of the absolute values of the differences between the data of a pixel.
可选地,该函数可以为绝对差值的绝对值函数或平均方差函数。Alternatively, the function may be an absolute value function or an average variance function of the absolute difference.
可选地,该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值越小,可以表明该待编码片段与该待编码片段的左侧数据之间的相关度越大。Optionally, the smaller the absolute value of the difference between the data in the fragment to be encoded and the data on the left side of the fragment to be encoded, the correlation between the fragment to be encoded and the left side data of the fragment to be encoded may be indicated. The greater the degree.
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第二种可能的实现方式中,该根据该待编码片段与该待编码片段的左侧数据之间的相关度以及该待编码片段与该待编码片段的上侧数据之间的相关度,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据,包括:将该待编码片段的左侧数据和上侧数据中与该待编码片段之间相关度较大的数据,确定为该待编码片段的参考数据。In conjunction with the first aspect or the foregoing possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the correlation between the fragment to be encoded and the left side data of the fragment to be encoded is Correlation between the to-be-coded segment and the upper-side data of the to-be-coded segment, determining the reference data of the to-be-coded segment from the left-side data and the upper-side data of the to-be-coded segment, including: the segment to be encoded The data of the left side data and the upper side data which are highly correlated with the fragment to be encoded are determined as reference data of the fragment to be encoded.
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第三种可能的实现方式中,该方法还包括:向该待编码片段的编码比特流添加第一标识符,该第一标识符用于指示该待编码片段的参考数据所在位置。With reference to the first aspect or the foregoing possible implementation manner of the first aspect, in a third possible implementation manner of the foregoing aspect, the method further includes: adding a first identifier to the encoded bit stream of the to-be-coded segment, The first identifier is used to indicate the location of the reference data of the segment to be encoded.
可选地,该图像的编码比特流可以包括与该图像中的至少一个片段对应的至少一个第一标识符,每个第一标识符可以用于标识对应的片段的参考数据或参考像素点所在位置。例如,第一标识符可以用于标识该第一标识符对应的片段的参考像素点位于该片段的左侧或上侧。Optionally, the encoded bitstream of the image may include at least one first identifier corresponding to at least one segment of the image, each first identifier may be used to identify reference data or reference pixel point of the corresponding segment position. For example, the first identifier may be used to identify that the reference pixel of the segment corresponding to the first identifier is located on the left or upper side of the segment.
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第四 种可能的实现方式中,该根据该参考数据,对该待编码片段进行编码处理,包括:根据该参考数据,对该待编码片段进行预测处理,得到该待编码片段的预测残差;利用该待编码片段的量化参数,对该待编码片段的预测残差进行量化处理,得到该待编码片段的量化结果;对该待编码片段的量化结果进行熵编码处理,得到该待编码片段的编码结果。In combination with the first aspect or the above possible implementation of the first aspect, the fourth aspect in the first aspect According to the reference data, the encoding process of the to-be-coded segment is performed according to the reference data, and the prediction residual of the to-be-coded segment is obtained, and the prediction residual is used. a quantization parameter of the fragment to be encoded, performing quantization processing on the prediction residual of the fragment to be encoded, obtaining a quantization result of the fragment to be encoded; performing entropy encoding processing on the quantization result of the fragment to be encoded, to obtain an encoding result of the fragment to be encoded .
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第五种可能的实现方式中,在该利用该待编码片段的量化参数,对该待编码片段的预测结果进行量化处理之前,该方法还包括:根据该参考数据,确定该待编码片段的量化参数。With reference to the first aspect or the foregoing possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the prediction result of the to-be-coded segment is quantized by using the quantization parameter of the to-be-coded segment Before the processing, the method further comprises: determining, according to the reference data, a quantization parameter of the segment to be encoded.
可选地,该根据该参考数据,确定该待编码片段的量化参数,包括:根据该参考数据和该待编码片段中的数据,确定该待编码片段的复杂度;根据该待编码片段的复杂度,确定该待编码片段的量化参数。Optionally, determining the quantization parameter of the to-be-coded segment according to the reference data, including: determining, according to the reference data and the data in the to-be-coded segment, the complexity of the segment to be encoded; according to the complexity of the segment to be encoded Degree, the quantization parameter of the segment to be encoded is determined.
可选地,该根据该参考数据和该待编码片段中的数据,确定该待编码片段的复杂度,包括:根据该参考数据和该待编码片段中的数据,确定该待编码片段中每个像素点的残差;根据该待编码片段中每个像素点的残差,确定该待编码片段的复杂度。Optionally, determining, according to the reference data and the data in the to-be-coded segment, the complexity of the to-be-coded segment, including: determining, according to the reference data and the data in the to-be-coded segment, each of the to-be-coded segments The residual of the pixel; determining the complexity of the segment to be encoded according to the residual of each pixel in the segment to be encoded.
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第六种可能的实现方式中,该根据该待编码片段的复杂度,确定该待编码片段的量化参数,包括:根据该待编码片段所属矩形区域中的每个片段的复杂度,确定该待编码片段所属矩形区域的复杂度;通过比较该待编码片段的复杂度和该待编码片段所属矩形区域的复杂度,确定该待编码片段的量化参数。With reference to the first aspect or the foregoing possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, determining the quantization parameter of the to-be-coded segment according to the complexity of the to-be-coded segment includes: Determining the complexity of the rectangular region to which the segment to be encoded belongs according to the complexity of each segment in the rectangular region to which the segment to be encoded belongs; by comparing the complexity of the segment to be encoded and the complexity of the rectangular region to which the segment to be encoded belongs, A quantization parameter of the segment to be encoded is determined.
可选地,矩形区域的复杂度可以等于该矩形区域中每个片段的复杂度的函数,例如,平均值函数或平均方差函数等等。Alternatively, the complexity of the rectangular region may be equal to a function of the complexity of each segment in the rectangular region, such as an average function or an average variance function, and the like.
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第七种可能的实现方式中,该从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据,包括:若该待编码片段具有可用的左侧数据和可用的上侧数据,从该待编码片段的可用的左侧数据和可用的上侧数据中,确定该待编码片段的参考数据。With reference to the first aspect or the foregoing possible implementation manner of the first aspect, in a seventh possible implementation manner of the first aspect, the determining the to-be-coded fragment from the left side data and the upper side data of the to-be-coded fragment The reference data includes: if the to-be-coded segment has available left-side data and available upper-side data, determining a reference of the to-be-coded segment from available left-side data of the to-be-coded segment and available upper-side data data.
此时,在确定待编码片段具有可用的左侧数据并且具有可用的上侧数据的情况下,从该待编码片段可用的左侧数据和可用的上侧数据中,确定该待编码片段的参考数据。 At this time, in a case where it is determined that the segment to be encoded has available left side data and has available upper side data, the reference to the segment to be encoded is determined from the left side data and the available upper side data available for the segment to be encoded. data.
可选地,如果待编码片段仅具有可用的左侧数据,则可以将该待编码片段的左侧数据确定为该待编码片段的参考数据。Optionally, if the segment to be encoded has only available left data, the left data of the segment to be encoded may be determined as reference data of the segment to be encoded.
可选地,如果待编码片段仅具有可用的上侧数据,则可以将该待编码片段的上侧数据确定为该待编码片段的参考数据。Optionally, if the segment to be encoded has only available upper side data, the upper side data of the segment to be encoded may be determined as reference data of the segment to be encoded.
可选地,可以根据待编码片段是否位于矩形区域的边界、子图像的边界或图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。Optionally, whether the segment to be encoded has available left side data and/or upper side data may be determined according to whether the segment to be encoded is located at a boundary of a rectangular area, a boundary of a sub image, or a boundary of an image.
作为一个例子,与待编码片段属于同一个图像中的数据可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,可以根据待编码片段是否位于图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。As an example, data belonging to the same image as the segment to be encoded may be used as left side data and/or upper side data available for the piece to be encoded. Correspondingly, whether the segment to be encoded has available left side data and/or upper side data can be determined according to whether the segment to be encoded is located at the boundary of the image.
可选地,可以尽量使用待编码片段的上侧数据作为待编码片段的参考数据,从而有利于提高编码质量。Optionally, the upper side data of the fragment to be encoded may be used as the reference data of the fragment to be encoded as much as possible, thereby facilitating the improvement of the encoding quality.
可选地,若该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界相邻,则可以将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the image and the to-be-coded segment is adjacent to a left boundary of the image, the predicted value of the first N pixels in the to-be-coded segment may be determined as Determining a value, and encoding, according to the data of the first N pixels, the remaining (TN) pixels in the to-be-coded segment, where T is the number of pixels included in the segment to be encoded, 1 ≤ N ≤ T.
具体地,如果该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界相邻,则该待编码片段可以既不具有可用的左侧数据,也不具有可用的上侧数据。Specifically, if the segment to be encoded is adjacent to an upper boundary of the image and the segment to be encoded is adjacent to a left boundary of the image, the segment to be encoded may have neither available left data nor available. Upper side data.
可选地,该预设数值可以为1<<(BitDepth-1),表示将1向左移位BitDepth-1位,其中,BitDepth为像素比特深度。Optionally, the preset value may be 1<<(BitDepth-1), indicating that 1 is shifted to the left by the BitDepth-1 bit, where BitDepth is the pixel bit depth.
可选地,N可以根据同时处理的像素点个数M和时序逻辑延迟L确定。Alternatively, N may be determined according to the number M of simultaneous processing pixels and the timing logic delay L.
可选地,该待编码片段的前N个像素点可以具体为该待编码片段包括的T个像素点中位于最左侧的N个像素点。Optionally, the first N pixels of the to-be-coded segment may be specifically the N-most pixel points of the T pixels included in the to-be-coded segment.
可选地,若该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,则可以根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the image, and the to-be-coded segment is spaced apart from a left boundary of the image, the left-side data of the to-be-coded segment may be used in the segment to be encoded. The pixel is encoded.
具体地,如果该待编码片段与该图像的上边界相邻并且该待编码片段 与该图像的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指图像中位于该待编码片段左侧的至少一个像素点的数据。Specifically, if the segment to be encoded is adjacent to an upper boundary of the image and the segment to be encoded Distributed with the left border of the image, the segment to be encoded may have available left side data and no upper side data available. At this time, the left side data of the to-be-encoded segment may be determined as reference data of the to-be-encoded segment, where the left-side data of the to-be-coded segment may specifically refer to at least one pixel located in the image to the left of the segment to be encoded. The data.
可选地,若该待编码片段与该图像的上边界间隔分布并且该待编码片段与该图像的左边界相邻,则可以根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is spaced apart from an upper boundary of the image, and the to-be-coded segment is adjacent to a left boundary of the image, the upper-side data of the to-be-coded segment may be used in the segment to be encoded. The pixel is encoded.
具体地,如果该待编码片段与该图像的左边界相邻并且该待编码片段与该图像的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指图像中位于该待编码片段上方的至少一个像素点的数据。Specifically, if the segment to be encoded is adjacent to the left boundary of the image and the segment to be encoded is spaced apart from the upper boundary of the image, the segment to be encoded may have available upper side data and no available left side data. . At this time, the upper side data of the to-be-encoded fragment may be determined as reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically refer to at least one pixel located in the image above the to-be-coded fragment. data.
作为另一个例子,只有与待编码片段属于同一个矩形区域中的数据才可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,假设待编码片段属于第一矩形区域,可以根据待编码片段是否位于第一矩形区域的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。As another example, only data belonging to the same rectangular region as the segment to be encoded can be used as the left side data and/or the upper side data available for the segment to be encoded. Correspondingly, assuming that the segment to be encoded belongs to the first rectangular region, whether the segment to be encoded has available left side data and/or upper side data may be determined according to whether the segment to be encoded is located at a boundary of the first rectangular region.
这样,能够使得对各个矩形区域之间的编码相互独立。In this way, the coding between the respective rectangular regions can be made independent of each other.
可选地,若该待编码片段与第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界相邻,将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the first rectangular region and the to-be-coded segment is adjacent to a left boundary of the first rectangular region, prediction of the first N pixel points in the to-be-coded segment The value is determined as a preset value, and according to the data of the first N pixels, the remaining (TN) pixels in the to-be-coded segment are encoded, where T is the pixel included in the segment to be encoded. The number, 1 ≤ N ≤ T.
如果该待编码片段与第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界相邻,则该待编码片段可以既不具有可用的左侧数据,也不具有可用的上侧数据。If the segment to be encoded is adjacent to an upper boundary of the first rectangular region and the segment to be encoded is adjacent to a left boundary of the first rectangular region, the segment to be encoded may have neither left side data available nor The upper side data is available.
可选地,若该待编码片段与该第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界间隔分布,根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the first rectangular region and the to-be-coded segment is spaced apart from a left boundary of the first rectangular region, the to-be-coded segment is configured according to the left-side data of the segment to be encoded. The pixel points in the encoded segment are subjected to encoding processing.
具体地,如果该待编码片段与该第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左 侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指与该待编码片段属于同一个矩形区域(即位于第一矩形区域中)并且位于该待编码片段左侧的至少一个像素点的数据。Specifically, if the to-be-coded segment is adjacent to an upper boundary of the first rectangular region and the to-be-coded segment is spaced apart from a left boundary of the first rectangular region, the fragment to be encoded may have available left-side data and not Has available upper side data. At this point, you can left the fragment to be encoded. The side data is determined as the reference data of the fragment to be encoded, wherein the left side data of the fragment to be encoded may specifically refer to the same rectangular area (ie, located in the first rectangular area) and located in the to-be-coded fragment. Data for at least one pixel on the left side.
可选地,若该待编码片段与该第一矩形区域的上边界间隔分布并且该待编码片段与该第一矩形区域的左边界相邻,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is spaced apart from an upper boundary of the first rectangular region and the to-be-coded segment is adjacent to a left boundary of the first rectangular region, according to the upper side data of the to-be-coded segment, the to-be-coded segment The pixel points in the encoded segment are subjected to encoding processing.
具体地,如果该待编码片段与该第一矩形区域的左边界相邻并且该待编码片段与该第一矩形区域的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指与该待编码片段属于同一个矩形区域(即位于第一矩形区域中)并且位于该待编码片段上方的至少一个像素点的数据。Specifically, if the to-be-coded segment is adjacent to a left boundary of the first rectangular region and the to-be-coded segment is spaced apart from an upper boundary of the first rectangular region, the to-be-coded segment may have available upper-side data and not Has left side data available. At this time, the upper side data of the to-be-coded fragment may be determined as the reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically belong to the same rectangular area as the to-be-coded fragment (ie, located at the Data in at least one pixel of the rectangular region and located above the segment to be encoded.
作为另一个例子,该图像可以包括至少一个子图像,每个子图像包括至少一个矩形区域。例如,每个子图像在高度方向上可以包括一个或多个矩形区域。As another example, the image may include at least one sub-image, each sub-image including at least one rectangular region. For example, each sub-image may include one or more rectangular regions in the height direction.
此时,可选地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,可以根据待编码片段是否位于其所属子图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。At this time, optionally, only the data belonging to the same sub-image as the segment to be encoded can be used as the left side data and/or the upper side data available for the segment to be encoded. Correspondingly, whether the segment to be encoded has available left side data and/or upper side data can be determined according to whether the segment to be encoded is located at the boundary of the sub-image to which it belongs.
可选地,若该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该待编码片段所属子图像的左边界相邻,将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the to-be-coded segment belongs and the to-be-coded segment is adjacent to a left boundary of the sub-image to which the to-be-coded segment belongs, the first N in the to-be-coded segment The predicted value of the pixel is determined as a preset value, and according to the data of the first N pixels, the remaining (TN) pixels in the to-be-coded segment are encoded, where T is the segment to be encoded. The number of pixels included in the figure, 1 ≤ N ≤ T.
如果该待编码片段与其所属子图像的上边界相邻并且该待编码片段与其所属子图像的左边界相邻,则该待编码片段可以既不具有可用的左侧数据,也不具有可用的上侧数据。If the segment to be encoded is adjacent to the upper boundary of the sub-image to which it belongs and the segment to be encoded is adjacent to the left boundary of the sub-image to which it belongs, the segment to be encoded may have neither available left data nor available Side data.
可选地,若该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该待编码片段所属子图像的左边界间隔分布,根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the fragment to be encoded belongs, and the to-be-coded segment is spaced apart from a left boundary of the sub-image to which the fragment to be encoded belongs, according to the left-side data of the fragment to be encoded. And encoding the pixel points in the segment to be encoded.
具体地,如果该待编码片段与其所属子图像的上边界相邻并且该待编 码片段与其所属子图像的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指与该待编码片段属于同一个子图像且位于该待编码片段左侧的至少一个像素点的数据。Specifically, if the segment to be encoded is adjacent to the upper boundary of the sub-image to which it belongs and the to-be-written The code segment is spaced apart from the left boundary of the sub-image to which it belongs, and the segment to be encoded may have available left side data and no available upper side data. At this time, the left side data of the to-be-coded fragment may be determined as the reference data of the to-be-coded fragment, where the left-hand data of the to-be-coded fragment may specifically belong to the same sub-image as the to-be-coded fragment and is located in the to-be-coded The data of at least one pixel on the left side of the segment.
可选地,若该待编码片段与该待编码片段所属子图像的上边界间隔分布并且该待编码片段与该待编码片段所属子图像的左边界相邻,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is spaced apart from the upper boundary of the sub-image to which the fragment to be encoded belongs, and the to-be-coded segment is adjacent to the left boundary of the sub-image to which the fragment to be encoded belongs, according to the upper data of the fragment to be encoded. And encoding the pixel points in the segment to be encoded.
具体地,如果该待编码片段与其所属子图像的左边界相邻并且该待编码片段与其所属子图像的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指与该待编码片段属于同一个子图像并且位于该待编码片段上方的至少一个像素点的数据。Specifically, if the segment to be encoded is adjacent to the left boundary of the sub-image to which it belongs and the segment to be encoded is spaced apart from the upper boundary of the sub-image to which it belongs, the segment to be encoded may have available upper side data and has no available left. Side data. At this time, the upper side data of the to-be-coded fragment may be determined as the reference data of the to-be-encoded fragment, where the upper-side data of the to-be-coded fragment may specifically belong to the same sub-image as the to-be-coded fragment and is located in the to-be-coded The data of at least one pixel above the segment.
作为另一个例子,也可以根据不同的标准确定该待编码片段是否具有可用的上侧数据和左侧数据。例如,待编码片段可以将同一子图像中的上侧数据作为可用的上侧数据而仅可以将同一个矩形区域中的左侧数据作为可用的左侧数据。再例如,待编码片段可以将同一子图像中的左侧数据作为可用的左侧数据而仅可以将同一个矩形区域中的左侧数据作为可用的左侧数据,等等。As another example, it may also be determined according to different criteria whether the segment to be encoded has available upper side data and left side data. For example, the segment to be encoded may use the upper side data in the same sub-image as the available upper side data and only the left side data in the same rectangular area as the available left side data. For another example, the segment to be encoded may use the left side data in the same sub image as the available left side data and only the left side data in the same rectangular area as the available left side data, and the like.
可选地,若该待编码片段与该待编码片段所属子图像的左边界相邻并且该待编码片段与该图像的上边界间隔分布,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to a left boundary of the sub-image to which the to-be-coded segment belongs, and the to-be-coded segment is spaced apart from an upper boundary of the image, the to-be-coded according to the upper-side data of the to-be-coded segment The pixels in the segment are encoded.
具体地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的左侧数据,而图像中位于该待编码片段上侧的数据可以作为该待编码片段的可用的上侧数据。相应地,可以根据待编码片段是否位于其所属子图像的左边界来确定该待编码片段是否具有可用的左侧数据,并且可以根据待编码片段是否位于图像的上边界来确定该待编码片段是否具有可用的上侧数据。Specifically, only data belonging to the same sub-image as the segment to be encoded can be used as the left side data available for the segment to be encoded, and the data located on the upper side of the segment to be encoded in the image can be used as the available segment of the segment to be encoded. Side data. Correspondingly, whether the segment to be encoded has available left side data is determined according to whether the segment to be encoded is located at a left boundary of the sub-image to which it is to be included, and whether the segment to be encoded is determined according to whether the segment to be encoded is located at an upper boundary of the image Has available upper side data.
可选地,若该待编码片段与该其所属子图像的左边界相邻并且该待编码片段与图像的上边界间隔分布,此时,无论该待编码片段是否处于其所属 子图像的上边界,都可以认为其具有可用的上侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指图像中位于该待编码片段上方的至少一个像素点的数据。Optionally, if the fragment to be encoded is adjacent to a left boundary of the sub-image to which the sub-image is to be located and the segment to be encoded is spaced apart from an upper boundary of the image, at this time, regardless of whether the segment to be encoded is in its The upper boundary of the sub-image can be considered to have available upper side data. At this time, the upper side data of the to-be-encoded fragment may be determined as reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically refer to at least one pixel located in the image above the to-be-coded fragment. data.
可选地,若该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the to-be-coded segment belongs and the to-be-coded segment is spaced apart from the left boundary of the image, the to-be-coded according to the left-side data of the to-be-coded segment The pixels in the segment are encoded.
具体地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的上侧数据,而图像中位于该待编码片段左侧的数据可以作为该待编码片段的可用的左侧数据。相应地,可以根据待编码片段是否位于其所属子图像的上边界来确定该待编码片段是否具有可用的上侧数据,并且可以根据待编码片段是否位于图像的左边界来确定该待编码片段是否具有可用的左侧数据。Specifically, only the data belonging to the same sub-image as the segment to be encoded can be used as the upper side data of the segment to be encoded, and the data located in the image to the left of the segment to be encoded can be used as the available left of the segment to be encoded. Side data. Correspondingly, whether the segment to be encoded has available upper side data may be determined according to whether the segment to be encoded is located at an upper boundary of the sub-image to which it is to be included, and whether the segment to be encoded is determined according to whether the segment to be encoded is located at a left boundary of the image Has left side data available.
可选地,若该待编码片段与该其所属子图像的上边界相邻并且该待编码片段与图像的左边界间隔分布,此时,无论该待编码片段是否处于其所属子图像的左边界,都可以认为其具有可用的左侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指图像中位于该待编码片段左侧的至少一个像素点的数据。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the sub-image is to be located and the segment to be encoded is spaced apart from the left boundary of the image, at this time, whether the segment to be encoded is at the left boundary of the sub-image to which the sub-image belongs , can be considered to have available left side data. At this time, the left side data of the to-be-encoded segment may be determined as reference data of the to-be-encoded segment, where the left-side data of the to-be-coded segment may specifically refer to at least one pixel located in the image to the left of the segment to be encoded. The data.
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第八种可能的实现方式中,该待编码片段中的每M个相邻像素点对应于相同的参考像素点,其中,该待编码片段的参考数据包括该参考像素点的数据,M≥1。With reference to the first aspect or the foregoing possible implementation manner of the first aspect, in an eighth possible implementation manner of the first aspect, each of the M adjacent pixel points in the to-be-coded segment corresponds to the same reference pixel point, The reference data of the segment to be encoded includes data of the reference pixel, and M≥1.
可选地,位于同一行的M个相邻像素点可以对应于相同的参考像素点。相应地,可以同时对位于同一行的M个相邻像素点进行编码处理。Alternatively, M adjacent pixel points located in the same row may correspond to the same reference pixel point. Accordingly, encoding processing can be performed on M adjacent pixel points located in the same row at the same time.
这样,可以同时对M个像素点同时进行编码处理,从而能够提高数据处理效率。In this way, M pixel points can be simultaneously encoded, so that data processing efficiency can be improved.
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第九种可能的实现方式中,该方法还包括:若该待编码片段所属矩形区域当前已使用的编码比特数Bi小于或等于该待编码片段所属矩形区域允许使用的编码比特数B,并且该待编码片段中的当前待编码像素点需要使用的编码比特 数bi+1与Bi之和大于B,向该待编码片段的编码比特流添加结束码,该结束码用于标识对该待编码片段所属矩形区域的编码结束并且该待编码片段所属矩形区域具有至少一个未编码的像素点。With reference to the first aspect or the foregoing possible implementation manner of the first aspect, in a ninth possible implementation manner of the first aspect, the method further includes: if the number of coded bits currently used by the rectangular area to which the fragment to be encoded belongs is Bi Less than or equal to the number of coded bits B allowed for the rectangular region to which the segment to be encoded belongs, and the coded bits to be used by the current pixel to be coded in the segment to be encoded The sum of the numbers bi+1 and Bi is greater than B, and an end code is added to the encoded bit stream of the fragment to be encoded, where the end code is used to identify that the encoding of the rectangular area to which the fragment to be encoded belongs is ended and the rectangular area to which the fragment to be encoded belongs has At least one uncoded pixel.
可选地,B可以等于固定码率对应的编码比特数。Alternatively, B may be equal to the number of coded bits corresponding to the fixed code rate.
如果矩形区域的编码比特数用尽并且该矩形区域还有未编码的至少一个像素点,则可以在图像的编码比特流中添加矩形区域对应的结束码,用于指示该矩形区域中具有至少一个未编码的像素点。If the number of coded bits of the rectangular area is exhausted and the rectangular area has at least one pixel that is not encoded, an end code corresponding to the rectangular area may be added to the encoded bit stream of the image to indicate that the rectangular area has at least one Uncoded pixels.
第二方面,提供了一种解码方法,包括:获取图像的编码比特流中与待解码片段对应的第一标识符;根据该待编码片段对应的第一标识符,确定该待解码片段的参考数据为该待解码片段的上侧数据或左侧数据,其中,该待解码片段的左侧数据包括位于该待解码片段左侧的至少一个第一像素点的数据,该待解码数据的上侧数据包括位于该待解码片段上方的至少一个第二像素点的数据;根据该待解码片段的参考数据,对该待解码片段进行解码处理。A second aspect provides a decoding method, including: acquiring a first identifier corresponding to a segment to be decoded in an encoded bitstream of an image; determining a reference of the segment to be decoded according to the first identifier corresponding to the segment to be encoded The data is the upper side data or the left side data of the to-be-decoded segment, where the left side data of the to-be-decoded segment includes data of at least one first pixel point located on the left side of the to-be-decoded segment, and the upper side of the to-be-decoded data The data includes data of at least one second pixel located above the segment to be decoded; and the segment to be decoded is decoded according to the reference data of the segment to be decoded.
该图像可以包括至少一个矩形区域,每个矩形区域包括至少一个片段,每个片段包括至少一个像素点,其中,长度相同的矩形区域对应的编码比特数少于或等于预设的比特数。The image may include at least one rectangular region, each rectangular region including at least one segment, each segment including at least one pixel point, wherein the rectangular regions of the same length correspond to a number of coded bits less than or equal to a preset number of bits.
可选地,该图像的编码比特流可以包括与该图像包括的至少一个片段中每个片段对应的第一标识符,每个片段对应的第一标识符用于标识该每个片段的参考数据(或参考像素点)所在位置。Optionally, the encoded bitstream of the image may include a first identifier corresponding to each of the at least one segment included in the image, and the first identifier corresponding to each segment is used to identify reference data of each segment (or reference pixel point) where.
在第二方面的第一种可能的实现方式中,该根据该参考数据,对该待解码片段进行解码处理,包括:对该待解码片段进行熵解码处理,得到该待解码片段的量化参数;根据该待解码片段的量化参数,对该待解码片段进行反量化处理,得到该待解码片段的残差数据;根据该参考数据,对该待解码片段的残差数据进行反预测(或补偿)处理,得到该待解码片段的解码结果。In a first possible implementation manner of the second aspect, the decoding process of the to-be-decoded segment according to the reference data includes: performing entropy decoding processing on the to-be-decoded segment to obtain a quantization parameter of the to-be-decoded segment; Performing inverse quantization processing on the to-be-decoded segment according to the quantization parameter of the to-be-decoded segment to obtain residual data of the to-be-decoded segment; and performing inverse prediction (or compensation) on the residual data of the to-be-decoded segment according to the reference data. Processing, obtaining a decoding result of the segment to be decoded.
第三方面,提供了一种编码装置,用于执行上述第一方面或第一方面的任意可能的实现方式中的方法。In a third aspect, there is provided an encoding apparatus for performing the method of any of the above first aspect or any of the possible implementations of the first aspect.
具体地,该装置包括用于执行上述第一方面或第一方面的任意可能的实现方式中的方法的单元。In particular, the apparatus comprises means for performing the method of any of the above-described first aspect or any of the possible implementations of the first aspect.
第四方面,提供了一种解码装置,用于执行上述第二方面或第二方面的任意可能的实现方式中的方法。 In a fourth aspect, there is provided a decoding apparatus for performing the method of any of the above-described second aspect or any of the possible implementations of the second aspect.
具体地,该装置包括用于执行上述第二方面或第二方面的任意可能的实现方式中的方法的单元。In particular, the apparatus comprises means for performing the method of any of the above-described second aspect or any of the possible implementations of the second aspect.
第五方面,提供了另一种编码装置,包括:存储器和处理器,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,并且当该处理器执行该存储器存储的指令时,该执行使得该处理器执行第一方面或第一方面的任意可能的实现方式中的方法。In a fifth aspect, there is provided another encoding apparatus comprising: a memory for storing instructions for executing instructions stored in the memory, and a processor, and when the processor executes the instructions stored by the memory, The execution causes the processor to perform the method of the first aspect or any possible implementation of the first aspect.
第六方面,提供了另一种解码装置,包括:存储器和处理器,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,并且当该处理器执行该存储器存储的指令时,该执行使得该处理器执行第二方面或第二方面的任意可能的实现方式中的方法。In a sixth aspect, there is provided another decoding apparatus comprising: a memory for storing instructions for executing instructions stored in the memory, and a processor, when the processor executes the instructions stored by the memory, The execution causes the processor to perform the method of the second aspect or any possible implementation of the second aspect.
第七方面,提供了一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行第一方面或第一方面的任意可能的实现方式中的方法的指令。A seventh aspect, a computer readable medium for storing a computer program, the computer program comprising instructions for performing the method of the first aspect or any of the possible implementations of the first aspect.
第八方面,提供了一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行第二方面或第二方面的任意可能的实现方式中的方法的指令。In an eighth aspect, a computer readable medium is provided for storing a computer program comprising instructions for performing the method of the second aspect or any of the possible implementations of the second aspect.
第九方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面或第一方面中的任一可能的实现方式中的方法。In a ninth aspect, a computer program product comprising instructions, when executed on a computer, causes the computer to perform the method of any of the first aspect or the first aspect of the first aspect.
第十方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第二方面或第二方面中的任一可能的实现方式中的方法。In a tenth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any of the above-described second or second aspects.
第十一方面,提供了编解码系统,包括第三方面中的任意编码装置和第四方面中的任意解码装置,或者包括第五方面中的任意编码装置和第六方面中的任意解码装置。In an eleventh aspect, a codec system is provided, comprising any of the encoding devices of the third aspect and any of the fourth aspects, or any of the encoding devices of the fifth aspect and any of the sixth aspects.
附图说明DRAWINGS
图1是本申请实施例提供的编码方法的示意性流程图。FIG. 1 is a schematic flowchart of an encoding method provided by an embodiment of the present application.
图2是本申请实施例提供的解码方法的示意性流程图。FIG. 2 is a schematic flowchart of a decoding method provided by an embodiment of the present application.
图3是本申请实施例提供的编码装置的示意性框图。FIG. 3 is a schematic block diagram of an encoding apparatus according to an embodiment of the present application.
图4是本申请实施例提供的编码装置的另一示意性框图。 FIG. 4 is another schematic block diagram of an encoding apparatus according to an embodiment of the present application.
图5是本申请实施例提供的解码装置的示意性框图。FIG. 5 is a schematic block diagram of a decoding apparatus provided by an embodiment of the present application.
图6是本申请实施例提供的编码装置的另一示意性框图。FIG. 6 is another schematic block diagram of an encoding apparatus according to an embodiment of the present application.
图7是本申请实施例提供的解码装置的另一示意性框图。FIG. 7 is another schematic block diagram of a decoding apparatus provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
本申请实施例提供的技术方案能够应用于各种视频应用系统,例如相机系统、显示系统等等,本申请实施例对此不做限定。The technical solutions provided in the embodiments of the present application can be applied to various video application systems, such as a camera system, a display system, and the like.
在本申请实施例中,可以将图像分成至少一个矩形区域,每个矩形区域包括多个像素点。可选地,可以将一个矩形区域称为一个tile或其他名称,但本申请实施例对此不做限定。可选地,如果将图像分成多个矩形区域,则图像中的不同矩形区域可以具有相同或不同的长度。作为一个例子,与图像边界间隔分布的至少一个矩形区域可以具有相同的长度。可选地,在本申请实施例中,矩形区域的高度可以为1个像素点或多个像素点,本申请实施例对此不做限定。In the embodiment of the present application, the image may be divided into at least one rectangular area, and each rectangular area includes a plurality of pixel points. Alternatively, a rectangular area may be referred to as a tile or other name, but this embodiment of the present application does not limit this. Alternatively, if the image is divided into a plurality of rectangular regions, different rectangular regions in the image may have the same or different lengths. As an example, at least one rectangular area spaced from the image boundary may have the same length. Optionally, in the embodiment of the present application, the height of the rectangular area may be 1 pixel point or a plurality of pixel points, which is not limited in this embodiment of the present application.
例如,可以按照第一预设尺寸将一幅图像划分成多个矩形区域,不位于图像边界的矩形区域可以具有相同的大小。位于图像边界的矩形区域受图像尺寸的限制,其大小可以由第一预设尺寸和图像尺寸共同决定,可能与其它不位于图像边界的矩形区域的大小相同,也可能与其他矩形区域的大小不相同。例如,假设图像长度为3840个像素,并且第一预设尺寸为1056个像素,可以按照从左至右的顺序,将图像分成四个矩形区域,其中,第1到第3个矩形区域的长度可以均为1056个像素,第4个矩形区域位于图像边界,如果该矩形区域的长度仍为1056个像素,则该矩形区域会超出图像边界,此时,可以将第4个矩形区域的长度设置为672个像素,但本申请实施例不限于此。For example, an image may be divided into a plurality of rectangular regions according to a first preset size, and rectangular regions not located at an image boundary may have the same size. The rectangular area located at the boundary of the image is limited by the size of the image, and its size may be determined by the first preset size and the image size, and may be the same size as other rectangular areas not located at the boundary of the image, or may be different from other rectangular areas. the same. For example, assuming that the image length is 3840 pixels and the first preset size is 1056 pixels, the image can be divided into four rectangular regions in order from left to right, wherein the lengths of the first to third rectangular regions are It can be 1056 pixels, and the fourth rectangular area is located at the image boundary. If the length of the rectangular area is still 1056 pixels, the rectangular area will exceed the image boundary. At this time, the length of the fourth rectangular area can be set. It is 672 pixels, but the embodiment of the present application is not limited thereto.
可选地,可以将该至少一个矩形区域中的部分或所有矩形区域进一步划分成至少一个片段(segment),每个片段包括至少一个像素点。可选地,如果将一个矩形区域分成多个片段,则矩形区域中的不同片段可以具有相同或不同的长度。作为一个例子,与矩形区域的边界间隔分布的至少一个片段可以具有相同的长度,但本申请实施例不限于此。 Optionally, some or all of the rectangular regions in the at least one rectangular region may be further divided into at least one segment, each segment including at least one pixel. Alternatively, if a rectangular area is divided into a plurality of segments, different segments in the rectangular region may have the same or different lengths. As an example, at least one segment spaced apart from the boundary of the rectangular region may have the same length, but the embodiment of the present application is not limited thereto.
例如,可以按照第二预设尺寸将一个矩形区域划分成多个片段,不位于矩形区域边界的片段可以具有相同的大小,位于矩形区域边界的片段受矩形区域的尺寸限制,其大小可能与其它不位于矩形区域边界的片段大小相同或不同,本申请实施例对此不做限定。For example, a rectangular area may be divided into a plurality of segments according to a second preset size, and segments not located at a boundary of the rectangular area may have the same size, and the segments located at the boundary of the rectangular area are limited by the size of the rectangular area, and the size may be different from other sizes. The segments that are not located at the boundary of the rectangular area are the same or different in size, which is not limited by the embodiment of the present application.
在本申请实施例中,可以以矩形区域为单位,采用固定倍率对图像中的像素点进行编解码处理。也就是说,长度相同的矩形区域对应的编码比特数少于或等于预设的比特数。In the embodiment of the present application, the pixel points in the image may be encoded and decoded by using a fixed magnification in units of rectangular regions. That is to say, the number of coded bits corresponding to the rectangular area of the same length is less than or equal to the preset number of bits.
具体地,当所述的编码比特数等于预设的比特数时,长度相同的矩形区域对应相同的编码比特数,即以固定倍率对该图像中的矩形区域进行编码处理。Specifically, when the number of encoded bits is equal to the preset number of bits, the rectangular areas of the same length correspond to the same number of coded bits, that is, the rectangular area in the image is encoded at a fixed magnification.
当所述的编码比特数少于或等于预设的比特数时,所述矩形区域对应的图像的编码压缩率大于或等于所述长度相同的矩形区域对应相同的编码比特数的压缩率。When the number of coded bits is less than or equal to a preset number of bits, the code compression ratio of the image corresponding to the rectangular area is greater than or equal to the compression ratio of the same number of coded bits corresponding to the same rectangular area.
该处理方法的目的在于保证整幅图像的编码压缩率,同时由于不用严格保证每个矩形区域对应相同的编码比特数,从而可以提高每个矩形区域的编码灵活性并提高编码效率。The purpose of the processing method is to ensure the coding compression ratio of the entire image, and at the same time, since it is not strictly guaranteed that each rectangular area corresponds to the same number of coding bits, the coding flexibility of each rectangular area can be improved and the coding efficiency can be improved.
这样,本申请实施例提供的技术方案具有较低的实现复杂度,同时具有较高的编码效率。Thus, the technical solution provided by the embodiment of the present application has lower implementation complexity and higher coding efficiency.
例如,假设矩形区域的长度为1056个像素,每个像素包含Y、U、V三个分量,每个分量的比特数为12比特,则该矩形区域包含的未编码的比特总数为12672。若压缩倍率为2倍,则该矩形区域对应的压缩之后的比特数(即编码比特数)为6336。For example, assuming that the length of the rectangular area is 1056 pixels, each pixel contains three components of Y, U, and V, and the number of bits of each component is 12 bits, the total number of uncoded bits included in the rectangular area is 12672. If the compression ratio is 2 times, the number of bits (ie, the number of coded bits) after compression corresponding to the rectangular area is 6336.
在本申请实施例中,可选地,可以针对矩形区域中的每个片段确定采用左侧数据或上侧数据作为参考数据,有利于提高编码质量。In the embodiment of the present application, optionally, the left side data or the upper side data is used as the reference data for each segment in the rectangular area, which is beneficial to improve the encoding quality.
此外,在本申请实施例中,可选地,对片段的编码比特数可以不采用固定倍率进行编解码处理,从而保证矩形区域中片段的编码质量以及编码和解码的灵活性。In addition, in the embodiment of the present application, optionally, the number of coded bits of the segment may be coded and processed without using a fixed magnification, thereby ensuring the coding quality of the segment in the rectangular region and the flexibility of encoding and decoding.
图1示出了本申请实施例提供的编码方法100的示意性流程图。FIG. 1 is a schematic flowchart of an encoding method 100 provided by an embodiment of the present application.
S110,确定待编码片段的参考数据。S110. Determine reference data of the segment to be encoded.
作为一个可选实施例,可以根据待编码片段中的数据,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据。 As an optional embodiment, the reference data of the fragment to be encoded may be determined from the left side data and the upper side data of the to-be-coded fragment according to data in the to-be-coded fragment.
该待编码片段的左侧数据可以包括位于该待编码片段左侧的至少一个第一像素点的数据。可选地,该至少一个第一像素点的个数可以与该待编码片段包括的像素点个数相等,或者,该至少一个第一像素点的个数也可以大于或小于该待编码片段包括的像素点个数,本申请实施例对此不做限定。The left side data of the fragment to be encoded may include data of at least one first pixel point located to the left of the fragment to be encoded. Optionally, the number of the at least one first pixel may be equal to the number of pixels included in the segment to be encoded, or the number of the at least one first pixel may be greater or smaller than the segment to be encoded. The number of the pixel points is not limited in this embodiment of the present application.
该至少一个第一像素点可以位于该待编码片段的左侧。可选地,该至少一个第一像素点可以与该待编码片段相邻,即该至少一个第一像素点中的最右侧像素点可以与该待编码片段中的最左侧像素点相邻。或者,该至少一个第一像素点也可以与该待编码片段间隔分布,例如,该至少一个第一像素点与该待编码片段之间可以间隔至少一个像素点,即该至少一个第一像素点中的最右侧像素点可以与该待编码片段中的最左侧像素点之间间隔至少一个像素点,其中,该至少一个第一像素点与该待编码片段之间间隔的像素点个数可以小于某一阈值,即该至少一个第一像素点可以与该待编码片段临近,但本申请实施例对此不做限定。The at least one first pixel may be located to the left of the segment to be encoded. Optionally, the at least one first pixel may be adjacent to the to-be-coded segment, that is, the rightmost pixel in the at least one first pixel may be adjacent to the leftmost pixel in the to-be-coded segment. . Or the at least one first pixel may be spaced apart from the to-be-coded segment. For example, the at least one first pixel and the to-be-coded segment may be separated by at least one pixel, that is, the at least one first pixel. The rightmost pixel in the image may be spaced apart from the leftmost pixel in the segment to be encoded by at least one pixel, wherein the number of pixels spaced between the at least one first pixel and the segment to be encoded It may be less than a certain threshold, that is, the at least one first pixel may be adjacent to the fragment to be encoded, but the embodiment of the present application does not limit this.
可选地,第一像素点的数据可以指第一像素点的原始数据或已编码数据。相应地,该至少一个第一像素点的数据可以包括该至少一个第一像素点中每个第一像素点的原始数据,或者可以包括该至少一个第一像素点中每个第一像素点的已编码数据,或者可以包括该至少一个第一像素点中部分像素点的原始数据以及另一部分像素点的已编码数据,等等,本申请实施例对此不做限定。Alternatively, the data of the first pixel may refer to raw data or encoded data of the first pixel. Correspondingly, the data of the at least one first pixel may include original data of each of the at least one first pixel, or may include each of the at least one first pixel The encoded data, or may include the original data of the partial pixels in the at least one first pixel and the encoded data of the other partial pixels, and the like, which is not limited in this embodiment of the present application.
该待编码数据的上侧数据包括位于该待编码片段上方的至少一个第二像素点的数据。可选地,该至少一个第二像素点的个数可以与该待编码片段包括的像素点个数相等,或者,该至少一个第二像素点的个数也可以大于或小于该待编码片段包括的像素点个数,本申请实施例对此不做限定。The upper side data of the data to be encoded includes data of at least one second pixel point located above the fragment to be encoded. Optionally, the number of the at least one second pixel may be equal to the number of pixels included in the segment to be encoded, or the number of the at least one second pixel may be greater or smaller than the segment to be encoded. The number of the pixel points is not limited in this embodiment of the present application.
该至少一个第二像素点可以位于该待编码片段的上方。可选地,该至少一个第二像素点可以与该待编码片段相邻。或者,该至少一个第二像素点也可以与该待编码片段间隔分布,例如,该至少一个第二像素点与该待编码片段之间可以间隔至少一个像素点,其中,该至少一个第二像素点与该待编码片段之间间隔的像素点个数可以小于某一阈值,即该至少一个第二像素点可以与该待编码片段临近,但本申请实施例对此不做限定。The at least one second pixel may be located above the segment to be encoded. Optionally, the at least one second pixel may be adjacent to the segment to be encoded. Or the at least one second pixel may be spaced apart from the to-be-coded segment. For example, the at least one second pixel and the to-be-coded segment may be separated by at least one pixel, wherein the at least one second pixel The number of the pixels in the interval between the point and the to-be-coded segment may be less than a certain threshold, that is, the at least one second pixel may be adjacent to the segment to be encoded, but the embodiment of the present application does not limit this.
可选地,第二像素点的数据可以指第二像素点的原始数据或已编 码数据。相应地,该至少一个第二像素点的数据可以包括该至少一个第二像素点中每个第二像素点的原始数据,或者可以包括该至少一个第二像素点中每个第二像素点的已编码数据,或者可以包括该至少一个第二像素点中部分像素点的原始数据以及另一部分像素点的已编码数据,等等,本申请实施例对此不做限定。Optionally, the data of the second pixel may refer to the original data of the second pixel or has been edited. Code data. Correspondingly, the data of the at least one second pixel may include original data of each of the at least one second pixel, or may include each second pixel of the at least one second pixel The encoded data, or may include the original data of the partial pixels of the at least one second pixel and the encoded data of the other partial pixels, and the like, which is not limited by the embodiment of the present application.
在本申请实施例中,可以根据片段中包括的至少一个像素点,从该片段的左侧数据和上侧数据中,选择该片段的参考数据。具体地,可以根据待编码片段中包括的至少一个像素点,从该片段左侧的至少一个第一像素点和该片段上方的至少一个第二像素点中,确定该片段的参考像素点。例如,可以将待编码片段左侧的至少一个第一像素点确定为该待编码片段的参考像素点,相应地,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据。再例如,也可以将待编码片段上方的至少一个第二像素点确定为该待编码片段的参考像素点,相应地,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,这里的参考数据可以具体指参考像素点的数据,本申请实施例对此不做限定。In the embodiment of the present application, the reference data of the segment may be selected from the left side data and the upper side data of the segment according to at least one pixel included in the segment. Specifically, the reference pixel point of the segment may be determined from at least one first pixel point on the left side of the segment and at least one second pixel point above the segment according to at least one pixel point included in the segment to be encoded. For example, at least one first pixel on the left side of the segment to be encoded may be determined as a reference pixel of the segment to be encoded, and correspondingly, the left side data of the segment to be encoded may be determined as reference data of the segment to be encoded. For example, at least one second pixel above the segment to be encoded may be determined as a reference pixel of the segment to be encoded, and correspondingly, the upper data of the segment to be encoded may be determined as reference data of the segment to be encoded. The reference data herein may specifically refer to the data of the reference pixel, which is not limited by the embodiment of the present application.
作为一个可选实施例,可以根据该待编码片段与该至少一个第一像素点之间的相关度以及该待编码片段与该至少一个第二像素点之间的相关度,从该至少一个第一像素点和该至少一个第二像素点中,确定该待编码片段的参考像素点。相应地,可以根据该待编码片段与该待编码片段的左侧数据之间的相关度以及该待编码片段与该待编码片段的上侧数据之间的相关度,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据。As an optional embodiment, the correlation between the fragment to be encoded and the at least one first pixel and the correlation between the fragment to be encoded and the at least one second pixel may be selected from the at least one A reference pixel of the segment to be encoded is determined from a pixel and the at least one second pixel. Correspondingly, according to the correlation between the to-be-coded segment and the left-side data of the to-be-coded segment and the correlation between the segment to be encoded and the upper-side data of the segment to be encoded, from the left of the segment to be encoded In the side data and the upper side data, reference data of the segment to be encoded is determined.
可选地,在本申请实施例中,可以根据该待编码片段中包括的至少一个像素点的数据和该待编码片段的左侧数据,确定该待编码片段与该待编码片段的左侧数据之间的相关度。作为一个例子,可以确定该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值,并根据该差值的绝对值,确定该待编码片段与该待编码片段的左侧数据之间的相关度。可选地,还可以采用该待编码片段与该待编码片段的左侧数据之间的方差或经数据变换,如哈达码(Hadamard)变换,之后的数据,确定该带编码片段与左侧数据之间的相关度。作为一个例子,该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值越小,可以表明该待编码片段与该待编码 片段的左侧数据之间的相关度越大,但本申请实施例不限于此。Optionally, in the embodiment of the present application, the data to be encoded and the left side data of the to-be-coded segment may be determined according to data of at least one pixel included in the to-be-coded segment and left-side data of the segment to be encoded. The correlation between the two. As an example, the absolute value of the difference between the data in the fragment to be encoded and the data on the left side of the fragment to be encoded may be determined, and the fragment to be encoded and the fragment to be encoded are determined according to the absolute value of the difference. The correlation between the data on the left side. Optionally, the variance between the to-be-coded segment and the left-side data of the to-be-coded segment or the data transformation, such as a Hadamard transform, and subsequent data, may be used to determine the coded segment and the left side data. The correlation between the two. As an example, the smaller the absolute value of the difference between the data in the fragment to be encoded and the data on the left side of the fragment to be encoded, the smaller the number of the difference between the data to be encoded and the data to be encoded. The correlation between the data on the left side of the segment is larger, but the embodiment of the present application is not limited thereto.
可选地,在本申请实施例中,该待编码片段中的数据与该编码片段的左侧数据之间的差值的绝对值可以是根据该编码片段中每个像素点的数据和与该每个像素点对应的第一像素点的数据之间的差值的绝对值得到的。例如,该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值可以是该编码片段中每个像素点的数据和与该每个像素点对应的第一像素点的数据之间的差值的绝对值之和的函数,该函数可以是平均值函数或均方差函数,等等,但本申请实施例不限于此。Optionally, in the embodiment of the present application, the absolute value of the difference between the data in the to-be-coded segment and the left-side data of the encoded segment may be based on data of each pixel in the encoded segment and The absolute value of the difference between the data of the first pixel corresponding to each pixel is obtained. For example, the absolute value of the difference between the data in the segment to be encoded and the data on the left side of the segment to be encoded may be data of each pixel in the segment and a first pixel corresponding to each pixel. A function of the sum of the absolute values of the differences between the points of the data, the function may be an average function or a mean square function, etc., but the embodiment of the present application is not limited thereto.
例如,假设待编码片段的数据可以由以下集合表示:{currSegi,i=1,…,n},并假设待编码片段的左侧数据可以由以下集合表示{neiSegj,j=1,…,m},其中,n为该待编码片段包括的像素点个数,m为该至少一个第一像素点的个数。如果n=m,则该待编码片段和该待编码片段的左侧数据之间的差值diff可以由下式确定:For example, assume that the data of the segment to be encoded can be represented by the following set: {currSegi, i=1, . . . , n}, and assume that the left side data of the segment to be encoded can be represented by the following set {neiSegj, j=1, . . . , m }, where n is the number of pixels included in the segment to be encoded, and m is the number of the at least one first pixel. If n=m, the difference diff between the segment to be encoded and the left side data of the segment to be encoded can be determined by:
Figure PCTCN2017099892-appb-000001
Figure PCTCN2017099892-appb-000001
如果n>m,则该待编码片段和该待编码片段的左侧数据之间的差值diff可以由下式确定:If n>m, the difference diff between the to-be-coded segment and the left-side data of the segment to be encoded can be determined by:
Figure PCTCN2017099892-appb-000002
Figure PCTCN2017099892-appb-000002
其中,{currSeg′i,i=1,…,m}可以是利用特定步长对待编码片段的数据{currSegi,i=1,…,n}进行采样得到的m个数据。该采样数据可以是通过对待编码片段的数据中的特定步长内的数据求平均值得到的,或者可以是通过在特定步长内抽取该待编码片段的数据中的一个点得到的,等等,本申请实施例对此不做限定。可选地,该特定步长可以是根据n和m确定的。例如,如果n等于m的整数倍,则该特定步长可选地可以为n和m的除数;或者,如果n不等于m的整数倍,则该特定步长可选地可以为n和m的除数的近似值,如n与m的除数向上取整、向下取整或四舍五入得到的数值,但本申请实施例不限于此。Wherein, {currSeg'i, i=1, . . . , m} may be m pieces of data obtained by sampling the data {currSegi, i=1, . . . , n} of the segment to be encoded with a specific step size. The sampled data may be obtained by averaging data within a specific step size in the data of the segment to be encoded, or may be obtained by extracting a point in the data of the segment to be encoded within a specific step size, etc. This embodiment of the present application does not limit this. Alternatively, the particular step size may be determined based on n and m. For example, if n is equal to an integer multiple of m, then the particular step size can optionally be a divisor of n and m; or, if n is not equal to an integer multiple of m, then the particular step size can optionally be n and m The approximation of the divisor is such that the divisor of n and m is rounded up, rounded down, or rounded off, but the embodiment of the present application is not limited thereto.
如果n<m,则该待编码数据和该待编码数据的左侧数据之间的差值diff可以由下式确定:If n < m, the difference diff between the data to be encoded and the left data of the data to be encoded can be determined by:
Figure PCTCN2017099892-appb-000003
Figure PCTCN2017099892-appb-000003
其中,{neiSeg′i,i=1,…,m}可以是利用特定步长对待编码片段的左侧数据{neiSegi,i=1,…,n}进行采样得到的n个数据。该采样数据可以 是通过对待编码片段的左侧数据中的特定步长内的数据求平均值得到的,或者可以是通过在特定步长内抽取该待编码片段的左侧数据中的一个点得到的,等等,本申请实施例对此不做限定。可选地,该特定步长可以是根据n和m确定的。例如,如果m等于n的整数倍,则该特定步长可选地可以为n和m的除数;或者,如果m不等于n的整数倍,则该特定步长可选地可以为n和m的除数的近似值,如m与n的除数向上取整、向下取整或四舍五入得到的数值,但本申请实施例不限于此。Wherein, {neiSeg'i, i=1, . . . , m} may be n pieces of data obtained by sampling the left side data {neiSegi, i=1, . . . , n} of the coded segment with a specific step size. The sampled data can Is obtained by averaging data within a specific step size in the left side data of the coded segment, or may be obtained by extracting a point in the left side data of the slice to be encoded within a specific step size, etc. This embodiment of the present application does not limit this. Alternatively, the particular step size may be determined based on n and m. For example, if m is equal to an integer multiple of n, then the particular step size can optionally be a divisor of n and m; or, if m is not equal to an integer multiple of n, the particular step size can optionally be n and m The approximation of the divisor, such as the divisor of m and n is rounded up, rounded down or rounded to the value obtained, but the embodiment of the present application is not limited thereto.
可选地,可以根据该待编码片段中包括的至少一个像素点的数据和该待编码片段的上侧数据,确定该待编码片段与该待编码片段的上侧数据之间的相关度。其具体实现可选地可以与上述对左侧数据的处理方式类似,但本申请实施例对此不做限定。Optionally, the correlation between the to-be-coded segment and the upper-side data of the to-be-coded segment may be determined according to data of at least one pixel included in the to-be-coded segment and upper-side data of the segment to be encoded. The specific implementation of the present invention may be similar to the foregoing method for processing the data on the left side, but the embodiment of the present application does not limit this.
在本申请实施例中,可选地,可以将该待编码片段的左侧数据和上侧数据中与该待编码片段相关度较大的数据,确定为该待编码片段的参考数据,但本申请实施例不限于此。In the embodiment of the present application, optionally, the data on the left side of the fragment to be encoded and the data in the upper side data having a greater degree of relevance to the fragment to be encoded may be determined as the reference data of the fragment to be encoded, but The application embodiment is not limited to this.
作为另一个可选实施例,如果该待编码片段仅具有可用的左侧数据而不具有可用的上侧数据,则可以将该待编码片段的左侧数据确定为该待编码片段的参考数据。可选地,如果该待编码片段仅具有可用的上侧数据而不具有可用的左侧数据,则可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,但本申请实施例不限于此。As another optional embodiment, if the to-be-coded segment has only available left-side data and no available upper-side data, the left-side data of the to-be-coded segment may be determined as reference data of the to-be-coded segment. Optionally, if the to-be-coded segment has only available upper-side data and no available left-side data, the upper-side data of the to-be-coded segment may be determined as reference data of the to-be-coded segment, but the present application is implemented. The example is not limited to this.
在本申请实施例中,可选地,一个片段能够使用图像中的任意数据作为参考数据,即该片段能够使用与该片段位于同一矩形区域或不同矩形区域的图像中的任意数据作为参考数据,例如,为了提高编码质量,一个片段可以尽可能使用该片段的上侧数据(例如位于该片段上方的相邻像素点的数据)作为参考数据,无论该上侧数据对应的像素点是否与该片段属于同一矩形区域。或者,一个片段可以仅能够使用该片段所属矩形区域中的数据作为参考数据,而不能使用该片段所属矩形区域以外的数据作为参考数据,这样,能够使得图像中不同矩形区域之间的编解码之间可以相互独立。或者,可以将图像划分为至少一个子图像,每个子图像可以包括至少一个矩形区域,例如,一个矩形区域可以包括一行像素点,一个子图像可以包括H行像素点,H为大于或等于1的整数,这样,一个子图像可以至少包括H个矩形区域,但本申请实施例对此不做限定。此时,一个片段可以仅能够使用该片 段所属子图像中的数据作为参考数据,例如,可以使用该片段所属子图像中与该片段属于同一矩形区域的数据,也可以使用该片段所属子图像中与该片段属于不同矩形区域的数据,而不能使用该片段所属子图像之外的数据作为参考数据,但本申请实施例不限于此。In the embodiment of the present application, optionally, a segment can use any data in the image as reference data, that is, the segment can use any data in an image of the same rectangular region or a different rectangular region as the segment as reference data. For example, in order to improve the encoding quality, a segment may use the upper side data of the segment (for example, data of adjacent pixel points located above the segment) as reference data, regardless of whether the pixel corresponding to the upper side data and the segment Belongs to the same rectangular area. Alternatively, a segment can only use data in a rectangular region to which the segment belongs as reference data, and cannot use data other than the rectangular region to which the segment belongs as reference data, so that codecs between different rectangular regions in the image can be made. They can be independent of each other. Alternatively, the image may be divided into at least one sub-image, each sub-image may include at least one rectangular region, for example, one rectangular region may include one row of pixel points, one sub-image may include H rows of pixel points, and H is greater than or equal to 1. An integer, such that a sub-image may include at least H rectangular regions, but this embodiment of the present application does not limit this. At this point, a clip can only use the slice The data in the sub-image to which the segment belongs is used as the reference data. For example, the data of the sub-image to which the segment belongs may be the same rectangular area as the segment, or the data of the sub-image to which the segment belongs may belong to a different rectangular area. The data other than the sub-image to which the segment belongs may not be used as the reference data, but the embodiment of the present application is not limited thereto.
可选地,如果待编码片段与该待编码片段所属矩形区域的上边界不相邻或间隔分布,则可以确定该待编码片段具有可用的上侧数据,相应地,如果待编码片段与该待编码片段所属矩形区域的上边界相邻,则可以确定该待编码片段不具有可用的上侧数据。或者,如果待编码片段与图像的上边界不相邻或间隔分布,则可以确定该待编码片段具有可用的上侧数据,相应地,如果该待编码片段与图像的上边界相邻,则可以确定该待编码片段不具有可用的上侧数据。或者,如果待编码片段与该待编码片段所属子图像的上边界不相邻或间隔分布,则可以确定该待编码片段具有可用的上侧数据,相应地,如果待编码片段与该待编码片段所属子图像的上边界相邻,则可以确定该待编码片段不具有可用的上侧数据,但本申请实施例对此不做限定。Optionally, if the segment to be encoded is not adjacent to or spaced apart from the upper boundary of the rectangular region to which the segment to be encoded belongs, it may be determined that the segment to be encoded has available upper side data, and accordingly, if the segment to be encoded and the to-be-coded segment If the upper boundary of the rectangular region to which the encoded segment belongs is adjacent, it can be determined that the segment to be encoded does not have available upper side data. Alternatively, if the segment to be encoded is not adjacent to or spaced apart from the upper boundary of the image, it may be determined that the segment to be encoded has available upper side data, and accordingly, if the segment to be encoded is adjacent to the upper boundary of the image, It is determined that the segment to be encoded does not have available upper side data. Alternatively, if the segment to be encoded is not adjacent to or spaced apart from the upper boundary of the sub-image to which the segment to be encoded belongs, it may be determined that the segment to be encoded has available upper side data, and correspondingly, if the segment to be encoded and the segment to be encoded are If the upper boundary of the sub-image is adjacent, it can be determined that the segment to be encoded does not have the available upper-side data, but the embodiment of the present application does not limit this.
如果待编码片段与该待编码片段所属矩形区域的左边界不相邻或间隔分布,则可以确定该待编码片段具有可用的左侧数据,相应地,如果待编码片段与该待编码片段所属矩形区域的左边界相邻,则可以确定该待编码片段不具有可用的左侧数据。或者,如果待编码片段与图像的左边界不相邻或间隔分布,则可以确定该待编码片段具有可用的左侧数据,相应地,如果该待编码片段与图像的左边界相邻,则可以确定该待编码片段不具有可用的左侧数据。或者,如果待编码片段与该待编码片段所属子图像的左边界不相邻或间隔分布,则可以确定该待编码片段具有可用的左侧数据,相应地,如果待编码片段与该待编码片段所属子图像的左边界相邻,则可以确定该待编码片段不具有可用的左侧数据,但本申请实施例对此不做限定。If the segment to be encoded is not adjacent to or spaced apart from the left boundary of the rectangular region to which the segment to be encoded belongs, it may be determined that the segment to be encoded has available left data, and correspondingly, if the segment to be encoded and the segment to which the segment to be encoded belongs If the left border of the region is adjacent, it can be determined that the segment to be encoded does not have available left side data. Alternatively, if the segment to be encoded is not adjacent to or spaced apart from the left boundary of the image, it may be determined that the segment to be encoded has available left side data, and correspondingly, if the segment to be encoded is adjacent to the left boundary of the image, It is determined that the segment to be encoded does not have available left side data. Alternatively, if the segment to be encoded is not adjacent to or spaced apart from the left boundary of the sub-image to which the segment to be encoded belongs, it may be determined that the segment to be encoded has available left-side data, and correspondingly, if the segment to be encoded and the segment to be encoded are If the left edge of the sub-image is adjacent to the sub-image, it can be determined that the segment to be encoded does not have the available left-side data, but the embodiment of the present application does not limit this.
作为一个可选实施例,在本申请实施例中,片段是否具有可用的上侧数据和该片段是否具有可用的左侧数据可以具有相同的判断标准。As an alternative embodiment, in the embodiment of the present application, whether the segment has available upper side data and whether the segment has available left side data may have the same criterion.
该从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据,包括:若该待编码片段具有可用的左侧数据和可用的上侧数据,从该待编码片段的可用的左侧数据和可用的上侧数据中,确定该待编码片段的参考数据。Determining the reference data of the to-be-coded segment from the left-side data and the upper-side data of the to-be-coded segment, including: if the to-be-coded segment has available left-side data and available upper-side data, from the to-be-coded segment The available left side data and the available upper side data determine the reference data of the fragment to be encoded.
此时,在确定待编码片段具有可用的左侧数据并且具有可用的上 侧数据的情况下,从该待编码片段可用的左侧数据和可用的上侧数据中,确定该待编码片段的参考数据。At this point, it is determined that the segment to be encoded has available left side data and has available In the case of side data, the reference data of the segment to be encoded is determined from the left side data available for the segment to be encoded and the available upper side data.
可选地,如果待编码片段仅具有可用的左侧数据,则可以将该待编码片段的左侧数据确定为该待编码片段的参考数据。Optionally, if the segment to be encoded has only available left data, the left data of the segment to be encoded may be determined as reference data of the segment to be encoded.
可选地,如果待编码片段仅具有可用的上侧数据,则可以将该待编码片段的上侧数据确定为该待编码片段的参考数据。Optionally, if the segment to be encoded has only available upper side data, the upper side data of the segment to be encoded may be determined as reference data of the segment to be encoded.
可选地,可以根据待编码片段是否位于矩形区域的边界、子图像的边界或图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。Optionally, whether the segment to be encoded has available left side data and/or upper side data may be determined according to whether the segment to be encoded is located at a boundary of a rectangular area, a boundary of a sub image, or a boundary of an image.
作为一个例子,与待编码片段属于同一个图像中的数据可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,可以根据待编码片段是否位于图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。As an example, data belonging to the same image as the segment to be encoded may be used as left side data and/or upper side data available for the piece to be encoded. Correspondingly, whether the segment to be encoded has available left side data and/or upper side data can be determined according to whether the segment to be encoded is located at the boundary of the image.
可选地,可以尽量使用待编码片段的上侧数据作为待编码片段的参考数据,从而有利于提高编码质量。Optionally, the upper side data of the fragment to be encoded may be used as the reference data of the fragment to be encoded as much as possible, thereby facilitating the improvement of the encoding quality.
可选地,若该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,则可以根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the image, and the to-be-coded segment is spaced apart from a left boundary of the image, the left-side data of the to-be-coded segment may be used in the segment to be encoded. The pixel is encoded.
具体地,如果该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指图像中位于该待编码片段左侧的至少一个像素点的数据。Specifically, if the segment to be encoded is adjacent to an upper boundary of the image and the segment to be encoded is spaced apart from the left boundary of the image, the segment to be encoded may have available left side data and does not have available upper side data. . At this time, the left side data of the to-be-encoded segment may be determined as reference data of the to-be-encoded segment, where the left-side data of the to-be-coded segment may specifically refer to at least one pixel located in the image to the left of the segment to be encoded. The data.
可选地,若该待编码片段与该图像的上边界间隔分布并且该待编码片段与该图像的左边界相邻,则可以根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is spaced apart from an upper boundary of the image, and the to-be-coded segment is adjacent to a left boundary of the image, the upper-side data of the to-be-coded segment may be used in the segment to be encoded. The pixel is encoded.
具体地,如果该待编码片段与该图像的左边界相邻并且该待编码片段与该图像的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指图像中位于该待编码片段上方的至少一个像素点的数据。 Specifically, if the segment to be encoded is adjacent to the left boundary of the image and the segment to be encoded is spaced apart from the upper boundary of the image, the segment to be encoded may have available upper side data and no available left side data. . At this time, the upper side data of the to-be-encoded fragment may be determined as reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically refer to at least one pixel located in the image above the to-be-coded fragment. data.
作为另一个例子,只有与待编码片段属于同一个矩形区域中的数据才可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,假设待编码片段属于第一矩形区域,可以根据待编码片段是否位于第一矩形区域的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。As another example, only data belonging to the same rectangular region as the segment to be encoded can be used as the left side data and/or the upper side data available for the segment to be encoded. Correspondingly, assuming that the segment to be encoded belongs to the first rectangular region, whether the segment to be encoded has available left side data and/or upper side data may be determined according to whether the segment to be encoded is located at a boundary of the first rectangular region.
这样,能够使得对各个矩形区域之间的编码相互独立。In this way, the coding between the respective rectangular regions can be made independent of each other.
可选地,若该待编码片段与该第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界间隔分布,根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the first rectangular region and the to-be-coded segment is spaced apart from a left boundary of the first rectangular region, the to-be-coded segment is configured according to the left-side data of the segment to be encoded. The pixel points in the encoded segment are subjected to encoding processing.
具体地,如果该待编码片段与该第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指与该待编码片段属于同一个矩形区域(即位于第一矩形区域中)并且位于该待编码片段左侧的至少一个像素点的数据。Specifically, if the to-be-coded segment is adjacent to an upper boundary of the first rectangular region and the to-be-coded segment is spaced apart from a left boundary of the first rectangular region, the fragment to be encoded may have available left-side data and not Has available upper side data. In this case, the data of the left side of the to-be-coded segment may be determined as the reference data of the to-be-coded segment, where the left-hand data of the segment to be encoded may specifically belong to the same rectangular region as the segment to be encoded (ie, located at the first Data in at least one pixel of a rectangular area and located to the left of the segment to be encoded.
可选地,若该待编码片段与该第一矩形区域的上边界间隔分布并且该待编码片段与该第一矩形区域的左边界相邻,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is spaced apart from an upper boundary of the first rectangular region and the to-be-coded segment is adjacent to a left boundary of the first rectangular region, according to the upper side data of the to-be-coded segment, the to-be-coded segment The pixel points in the encoded segment are subjected to encoding processing.
具体地,如果该待编码片段与该第一矩形区域的左边界相邻并且该待编码片段与该第一矩形区域的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指与该待编码片段属于同一个矩形区域(即位于第一矩形区域中)并且位于该待编码片段上方的至少一个像素点的数据。Specifically, if the to-be-coded segment is adjacent to a left boundary of the first rectangular region and the to-be-coded segment is spaced apart from an upper boundary of the first rectangular region, the to-be-coded segment may have available upper-side data and not Has left side data available. At this time, the upper side data of the to-be-coded fragment may be determined as the reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically belong to the same rectangular area as the to-be-coded fragment (ie, located at the Data in at least one pixel of the rectangular region and located above the segment to be encoded.
作为另一个例子,该图像可以包括至少一个子图像,每个子图像包括至少一个矩形区域。例如,每个子图像在高度方向上可以包括一个或多个矩形区域。As another example, the image may include at least one sub-image, each sub-image including at least one rectangular region. For example, each sub-image may include one or more rectangular regions in the height direction.
此时,可选地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,可以根据待编码片段是否位于其所属子图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。At this time, optionally, only the data belonging to the same sub-image as the segment to be encoded can be used as the left side data and/or the upper side data available for the segment to be encoded. Correspondingly, whether the segment to be encoded has available left side data and/or upper side data can be determined according to whether the segment to be encoded is located at the boundary of the sub-image to which it belongs.
可选地,若该待编码片段与该待编码片段所属子图像的上边界相 邻并且该待编码片段与该待编码片段所属子图像的左边界间隔分布,根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the segment to be encoded is opposite to the upper boundary of the sub-image to which the segment to be encoded belongs The neighboring segment and the to-be-coded segment are spaced apart from the left boundary of the sub-image to which the segment to be encoded belongs, and the pixel in the segment to be encoded is encoded according to the left-side data of the segment to be encoded.
具体地,如果该待编码片段与其所属子图像的上边界相邻并且该待编码片段与其所属子图像的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指与该待编码片段属于同一个子图像且位于该待编码片段左侧的至少一个像素点的数据。Specifically, if the segment to be encoded is adjacent to the upper boundary of the sub-image to which it belongs and the segment to be encoded is spaced apart from the left boundary of the sub-image to which it belongs, the segment to be encoded may have available left-side data and is not available. Side data. At this time, the left side data of the to-be-coded fragment may be determined as the reference data of the to-be-coded fragment, where the left-hand data of the to-be-coded fragment may specifically belong to the same sub-image as the to-be-coded fragment and is located in the to-be-coded The data of at least one pixel on the left side of the segment.
可选地,若该待编码片段与该待编码片段所属子图像的上边界间隔分布并且该待编码片段与该待编码片段所属子图像的左边界相邻,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is spaced apart from the upper boundary of the sub-image to which the fragment to be encoded belongs, and the to-be-coded segment is adjacent to the left boundary of the sub-image to which the fragment to be encoded belongs, according to the upper data of the fragment to be encoded. And encoding the pixel points in the segment to be encoded.
具体地,如果该待编码片段与其所属子图像的左边界相邻并且该待编码片段与其所属子图像的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指与该待编码片段属于同一个子图像并且位于该待编码片段上方的至少一个像素点的数据。Specifically, if the segment to be encoded is adjacent to the left boundary of the sub-image to which it belongs and the segment to be encoded is spaced apart from the upper boundary of the sub-image to which it belongs, the segment to be encoded may have available upper side data and has no available left. Side data. At this time, the upper side data of the to-be-coded fragment may be determined as the reference data of the to-be-encoded fragment, where the upper-side data of the to-be-coded fragment may specifically belong to the same sub-image as the to-be-coded fragment and is located in the to-be-coded The data of at least one pixel above the segment.
作为另一个可选实施例,也可以根据不同的标准确定该待编码片段是否具有可用的上侧数据和左侧数据。例如,待编码片段可以将同一子图像中的上侧数据作为可用的上侧数据而仅可以将同一个矩形区域中的左侧数据作为可用的左侧数据。再例如,待编码片段可以将同一子图像中的左侧数据作为可用的左侧数据而仅可以将同一个矩形区域中的左侧数据作为可用的左侧数据,等等。As another alternative embodiment, it may also be determined according to different criteria whether the segment to be encoded has available upper side data and left side data. For example, the segment to be encoded may use the upper side data in the same sub-image as the available upper side data and only the left side data in the same rectangular area as the available left side data. For another example, the segment to be encoded may use the left side data in the same sub image as the available left side data and only the left side data in the same rectangular area as the available left side data, and the like.
可选地,若该待编码片段与该待编码片段所属子图像的左边界相邻并且该待编码片段与该图像的上边界间隔分布,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to a left boundary of the sub-image to which the to-be-coded segment belongs, and the to-be-coded segment is spaced apart from an upper boundary of the image, the to-be-coded according to the upper-side data of the to-be-coded segment The pixels in the segment are encoded.
具体地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的左侧数据,而图像中位于该待编码片段上侧的数据可以作为该待编码片段的可用的上侧数据。相应地,可以根据待编码片段是否位于其所属子图像的左边界来确定该待编码片段是否具有可用的左侧数据,并且可以根据待编码片段是否位于图像的上边界来确定该待编码片段是否 具有可用的上侧数据。Specifically, only data belonging to the same sub-image as the segment to be encoded can be used as the left side data available for the segment to be encoded, and the data located on the upper side of the segment to be encoded in the image can be used as the available segment of the segment to be encoded. Side data. Correspondingly, whether the segment to be encoded has available left side data is determined according to whether the segment to be encoded is located at a left boundary of the sub-image to which it is to be included, and whether the segment to be encoded is determined according to whether the segment to be encoded is located at an upper boundary of the image Has available upper side data.
可选地,若该待编码片段与该其所属子图像的左边界相邻并且该待编码片段与图像的上边界间隔分布,此时,无论该待编码片段是否处于其所属子图像的上边界,都可以认为其具有可用的上侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指图像中位于该待编码片段上方的至少一个像素点的数据。Optionally, if the fragment to be encoded is adjacent to a left boundary of the sub-image to which the sub-image is to be located and the segment to be encoded is spaced apart from an upper boundary of the image, at this time, whether the segment to be encoded is at an upper boundary of the sub-image to which the sub-image belongs , can be considered to have available upper side data. At this time, the upper side data of the to-be-encoded fragment may be determined as reference data of the to-be-encoded fragment, where the upper side data of the to-be-coded fragment may specifically refer to at least one pixel located in the image above the to-be-coded fragment. data.
可选地,若该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the to-be-coded segment belongs and the to-be-coded segment is spaced apart from the left boundary of the image, the to-be-coded according to the left-side data of the to-be-coded segment The pixels in the segment are encoded.
具体地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的上侧数据,而图像中位于该待编码片段左侧的数据可以作为该待编码片段的可用的左侧数据。相应地,可以根据待编码片段是否位于其所属子图像的上边界来确定该待编码片段是否具有可用的上侧数据,并且可以根据待编码片段是否位于图像的左边界来确定该待编码片段是否具有可用的左侧数据。Specifically, only the data belonging to the same sub-image as the segment to be encoded can be used as the upper side data of the segment to be encoded, and the data located in the image to the left of the segment to be encoded can be used as the available left of the segment to be encoded. Side data. Correspondingly, whether the segment to be encoded has available upper side data may be determined according to whether the segment to be encoded is located at an upper boundary of the sub-image to which it is to be included, and whether the segment to be encoded is determined according to whether the segment to be encoded is located at a left boundary of the image Has left side data available.
可选地,若该待编码片段与该其所属子图像的上边界相邻并且该待编码片段与图像的左边界间隔分布,此时,无论该待编码片段是否处于其所属子图像的左边界,都可以认为其具有可用的左侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指图像中位于该待编码片段左侧的至少一个像素点的数据。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the sub-image is to be located and the segment to be encoded is spaced apart from the left boundary of the image, at this time, whether the segment to be encoded is at the left boundary of the sub-image to which the sub-image belongs , can be considered to have available left side data. At this time, the left side data of the to-be-encoded segment may be determined as reference data of the to-be-encoded segment, where the left-side data of the to-be-coded segment may specifically refer to at least one pixel located in the image to the left of the segment to be encoded. The data.
作为另一个可选实施例,该待编码片段可以不具有可用的上侧数据并且不具有可用的左侧数据,例如,该待编码片段与图像的上边界、该待编码片段所属子图像的上边界或该编码片段所属矩形区域的上边界相邻,并且该待编码片段与图像的左边界、该待编码片段所属子图像的左边界或该编码片段所属矩形区域的左边界相邻,此时,如果该待编码片段的长度大于某一阈值,即该待编码片段包括的位于同一行的像素点的个数大于某一阈值,则可以将该待编码片段中的前面至少一个像素点的数据作为该待编码片段中的后面至少一个像素点的参考数据。As another optional embodiment, the to-be-encoded segment may not have available upper-side data and does not have available left-side data, for example, the to-be-encoded segment and the upper boundary of the image, and the sub-image to which the segment to be encoded belongs The boundary or the upper boundary of the rectangular region to which the code segment belongs is adjacent, and the segment to be encoded is adjacent to the left boundary of the image, the left boundary of the sub-image to which the slice to be encoded belongs, or the left boundary of the rectangular region to which the code segment belongs. If the length of the segment to be encoded is greater than a certain threshold, that is, the number of pixels in the same row included in the segment to be encoded is greater than a certain threshold, the data of at least one pixel in the segment to be encoded may be As reference data of at least one pixel in the latter to be encoded.
例如,如果该待编码片段包括的位于同一行的像素点个数T大于 N,则可以将该待编码片段中的前N个像素点的预测值确定为预设数值,例如,可以将1<<(BitDepth-1)确定为该前N个像素点的预测值,其中,<<为向左移位运算符,BitDepth为像素比特深度,表示每个未编码像素使用的编码比特个数。对该待编码片段中的剩余的(T-N)个像素点进行编码处理时,可以将位于像素点i左侧并且与像素点i间隔L个像素点的像素点j作为像素点i的参考像素,但本申请实施例不限于此。其中,作为参考像素的像素点j的值可以为像素点j的原始像素点的值也可以为像素点j的编码重构像素点的值。For example, if the number of pixels T in the same row included in the segment to be encoded is greater than N, the predicted value of the first N pixel points in the to-be-coded segment may be determined as a preset value. For example, 1<<(BitDepth-1) may be determined as the predicted value of the first N pixel points, where , << is the left shift operator, BitDepth is the pixel bit depth, indicating the number of coded bits used by each uncoded pixel. When encoding the remaining (TN) pixel points in the slice to be encoded, the pixel point j located on the left side of the pixel point i and spaced apart from the pixel point i by L pixels may be used as the reference pixel of the pixel point i. However, embodiments of the present application are not limited thereto. The value of the pixel point j as the reference pixel may be the value of the original pixel point of the pixel point j or the value of the coded reconstructed pixel point of the pixel point j.
可选地,在本申请实施例中,可以以并行度M对片段中的像素点进行编/解码处理,即可以同时对M个像素点进行编/解码处理,其中,M为大于或等于1的整数。例如,该待编码片段中的每M个相邻像素点可以对应于相同的参考像素点,其中,该M个相邻像素点可以位于同一行,但本申请实施例对此不做限定。Optionally, in the embodiment of the present application, the pixel points in the segment may be encoded/decoded by the degree of parallelism M, that is, the M pixels may be encoded/decoded at the same time, where M is greater than or equal to 1 The integer. For example, each of the M adjacent pixel points in the to-be-coded segment may correspond to the same reference pixel, where the M adjacent pixels may be located in the same row, but the embodiment of the present application does not limit this.
可选地,在本申请实施例中,N可以由M和时序逻辑延迟L决定,所述的时序逻辑延迟由硬件设计的结构决定,如由芯片流水设计的级数决定,其中,L可以是编码端的像素编码延迟值和解码端的像素解码延迟值的最大值,但本申请实施例不限于此。Optionally, in the embodiment of the present application, N may be determined by M and a timing logic delay L, where the delay of the sequential logic is determined by the structure of the hardware design, such as the number of stages designed by the chip pipeline, wherein L may be The pixel coding delay value of the encoding end and the maximum value of the pixel decoding delay value of the decoding end, but the embodiment of the present application is not limited thereto.
S120,根据该参考数据,对该待编码片段进行编码处理,得到该待编码片段的编码比特流。S120. Perform encoding processing on the to-be-coded segment according to the reference data to obtain an encoded bitstream of the to-be-coded segment.
作为一个例子,可以根据该参考数据,对该待编码片段进行预测处理,得到该待编码片段的预测残差。然后,可以利用该待编码片段的量化参数,对该待编码片段的预测残差进行量化处理,得到该待编码片段的量化结果。然后,可以对该待编码片段的量化结果进行熵编码处理,得到该待编码片段的编码结果。As an example, the segment to be encoded may be subjected to prediction processing according to the reference data to obtain a prediction residual of the segment to be encoded. Then, the prediction residual of the to-be-coded segment may be quantized by using the quantization parameter of the to-be-coded segment to obtain a quantized result of the segment to be encoded. Then, the quantization result of the segment to be encoded may be subjected to entropy coding processing to obtain a coding result of the segment to be encoded.
具体地,待编码片段的预测残差可以包括该待编码片段中每个像素点的残差值的绝对值,其中,作为一个例子,像素点的残差值的绝对值可以是该像素点的原始数据与该像素点的参考像素点的原始数据之间的差值的绝对值,但本申请实施例对此不做限定。Specifically, the prediction residual of the fragment to be encoded may include an absolute value of the residual value of each pixel in the to-be-coded segment, wherein, as an example, the absolute value of the residual value of the pixel may be the pixel The absolute value of the difference between the original data and the original data of the reference pixel of the pixel, but this embodiment of the present application does not limit this.
可选地,该待编码片段的量化结果可以是通过该待编码片段中每个像素点的残差进行量化处理得到的。本申请实施例中,该量化处理可以为H.264/AVC标准中的量化、H.265/HEVC标准中的量化、AVS1-P2标准中 的量化、AVS2-P2标准中的量化或自行设计的量化表,等等,本申请实施例对此不做限定。Optionally, the quantization result of the to-be-coded segment may be obtained by performing quantization processing on a residual of each pixel in the to-be-coded segment. In the embodiment of the present application, the quantization process may be quantization in the H.264/AVC standard, quantization in the H.265/HEVC standard, and the AVS1-P2 standard. The quantization, the quantization in the AVS2-P2 standard, or the self-designed quantization table, and the like, are not limited in this embodiment of the present application.
在本申请实施例中,熵编码处理可以为无损编码处理,具体可以采用N阶哥伦布码(Nth order Golomb code)、基于内容的自适应可变长度编码(context-based adaptive variable length coding,CAVLC)、基于内容的自适应二进制算术编码(context-based adaptive binary arithmetic coding,CABAC)等方式,本申请实施例对此不做限定。In the embodiment of the present application, the entropy coding process may be a lossless coding process, and specifically, an Nth order Golomb code and a context-based adaptive variable length coding (CAVLC) may be adopted. The content-based adaptive binary arithmetic coding (CABAC) and the like are not limited in this embodiment of the present application.
作为另一个可选实施例,还可以根据该参考数据,确定该待编码片段的量化参数。例如,可以根据该参考数据,对原始量化参数进行更新处理,得到该待编码片段的量化参数。其中,该原始量化参数可以为该待编码片段的初始量化参数,例如,该原始量化参数可以为该图像的初始量化参数,或者该待编码片段的上一片段的量化参数,等等,本申请实施例对此不做限定。As another optional embodiment, the quantization parameter of the fragment to be encoded may also be determined according to the reference data. For example, the original quantization parameter may be updated according to the reference data to obtain a quantization parameter of the fragment to be encoded. The original quantization parameter may be an initial quantization parameter of the to-be-coded segment. For example, the original quantization parameter may be an initial quantization parameter of the image, or a quantization parameter of a previous segment of the to-be-coded segment, and the like. The embodiment does not limit this.
可选地,在本申请实施例中,量化参数可以包括量化步长(quantization step)、与量化步长相关或用于指示量化步长的数值(例如QP)、量化矩阵或量化矩阵索引,等等,本申请实施例对此不做限定。Optionally, in the embodiment of the present application, the quantization parameter may include a quantization step, a quantization step size, or a value (for example, QP) indicating a quantization step size, a quantization matrix, or a quantization matrix index, etc. The embodiment of the present application does not limit this.
可选地,可以根据该参考数据,确定该待编码片段的复杂度,并根据该待编码片段的复杂度,确定该待编码片段的量化参数。Optionally, the complexity of the segment to be encoded may be determined according to the reference data, and the quantization parameter of the segment to be encoded is determined according to the complexity of the segment to be encoded.
作为一个例子,可以根据该待编码片段的复杂度和该待编码片段所属矩形区域的总复杂度,确定该待编码片段的量化参数。As an example, the quantization parameter of the segment to be encoded may be determined according to the complexity of the segment to be encoded and the total complexity of the rectangular region to which the segment to be encoded belongs.
在本申请实施例中,可选地,可以根据该待编码片段的参考数据和该待编码片段中每个像素点的数据,确定该每个像素点的残差,并根据该待编码片段中每个像素点的残差,确定该待编码片段的复杂度。其中,可选地,可以根据该待编码片段中每个像素点的数据以及该每个像素点的参考像素点的数据,确定该每个像素点的残差,其中,该待编码片段的参考数据可以包括该待编码片段中每个像素点的参考像素点的数据,但本申请实施例对此不做限定。In the embodiment of the present application, optionally, the residual of each pixel point may be determined according to the reference data of the to-be-coded segment and the data of each pixel in the to-be-coded segment, and according to the to-be-coded segment. The residual of each pixel determines the complexity of the segment to be encoded. Optionally, the residual of each pixel may be determined according to data of each pixel in the to-be-coded segment and data of a reference pixel of each pixel, where the reference of the segment to be encoded is The data may include the data of the reference pixel of each pixel in the segment to be encoded, but the embodiment of the present application does not limit this.
可选地,该待编码片段所属矩形区域的总复杂度可以是根据该待编码片段所属矩形区域中包括的每个片段的复杂度确定的,例如,一个矩形区域的总复杂度可以是该矩形区域中包括的多个片段的复杂度的平均值,但本申请实施例不限于此。 Optionally, the total complexity of the rectangular area to which the fragment to be encoded belongs may be determined according to the complexity of each fragment included in the rectangular area to which the fragment to be encoded belongs. For example, the total complexity of a rectangular area may be the rectangle. The average of the complexity of the plurality of segments included in the region, but the embodiment of the present application is not limited thereto.
作为一个可选实施例,可以通过比较该待编码片段的复杂度和该待编码片段所属矩形区域的总复杂度,确定该待编码片段的量化参数。例如,如果该待编码片段的复杂度大于该待编码片段所属矩形区域的总复杂度,则可以减小原始量化参数,得到该待编码片段的量化参数。再例如,如果该待编码片段的复杂度小于该待编码片段所属矩形区域的总复杂度,则可以增加原始量化参数,得到该待编码片段的量化参数。再例如,如果该待编码片段的复杂度等于该待编码片段所属矩形区域的总复杂度,则可以保持原始量化参数不变,即该待编码片段的量化参数等于原始量化参数,本申请实施例对此不做限定。As an optional embodiment, the quantization parameter of the segment to be encoded may be determined by comparing the complexity of the segment to be encoded and the total complexity of the rectangular region to which the segment to be encoded belongs. For example, if the complexity of the segment to be encoded is greater than the total complexity of the rectangular region to which the segment to be encoded belongs, the original quantization parameter may be reduced to obtain a quantization parameter of the segment to be encoded. For another example, if the complexity of the segment to be encoded is smaller than the total complexity of the rectangular region to which the segment to be encoded belongs, the original quantization parameter may be added to obtain a quantization parameter of the segment to be encoded. For example, if the complexity of the to-be-coded segment is equal to the total complexity of the rectangular region to which the segment to be encoded belongs, the original quantization parameter may be kept unchanged, that is, the quantization parameter of the segment to be encoded is equal to the original quantization parameter. There is no limit to this.
在确定了该待编码片段的量化参数之后,可以利用该待编码片段的量化参数,对该待编码片段进行编码处理,但本申请实施例对此不做限定。After the quantization parameter of the to-be-coded segment is determined, the to-be-coded segment may be encoded by using the quantization parameter of the to-be-encoded segment, but the embodiment of the present application does not limit this.
这样,在矩形区域对应的编码比特数固定的条件下,根据矩形区域中的每个片段包括的数据,确定该每个片段的量化参数和对应的编码比特数,有利于提高编码质量。In this way, under the condition that the number of coded bits corresponding to the rectangular region is fixed, the quantization parameter of each segment and the corresponding number of coded bits are determined according to the data included in each segment in the rectangular region, which is advantageous for improving the coding quality.
在本申请实施例中,可选地,在确定了该待编码片段的参考数据之后,可以向该待编码片段的编码比特流添加第一标识符,用于指示该待编码片段的参考数据所在位置。例如,该第一标识符可以用于指示该待编码片段的参考数据点位于该待编码片段的左侧还是上侧,或者该第一标识符可以进一步指示该待编码片段的参考数据点的坐标,例如与该待编码片段之间间隔几个像素点等等,本申请实施例对此不做限定。In the embodiment of the present application, optionally, after determining the reference data of the to-be-coded segment, a first identifier may be added to the encoded bitstream of the to-be-coded segment, where the reference data of the to-be-coded segment is located. position. For example, the first identifier may be used to indicate whether the reference data point of the fragment to be encoded is located on the left side or the upper side of the fragment to be encoded, or the first identifier may further indicate the coordinates of the reference data point of the fragment to be encoded. For example, the pixel is separated from the to-be-coded segment by a few pixels, and the like.
作为一个例子,可以在该图像的编码比特流的头信息中添加每个片段对应的第一标识符,以标识该片段的参考数据所在位置,但本申请实施例对此不做限定。As an example, the first identifier corresponding to each segment may be added to the header information of the encoded bit stream of the image to identify the location of the reference data of the segment, but the embodiment of the present application does not limit this.
可选地,在本申请实施例中,如果在对矩形区域编码的过程中,矩形区域允许使用的编码比特数已经用尽,但该矩形区域中还存在未编码的像素点,则可以在该矩形区域对应的编码比特流中添加结束码,其中,该结束码可以用于标识对矩形区域的编码结束并且该矩形区域还具有至少一个未编码的像素点。可选地,该结束码需要区别于该矩形区域对应的编码比特流中的编码比特,即需要保证该结束码在该矩形区域对应的编码比特流中的唯一性。例如,在采用0阶哥伦布码且编码像素的比特深度(bitdepth)为12时,可以将结束码的图样设置为连续的14个‘0’,但本申请实施例对此 不做限定。Optionally, in the embodiment of the present application, if the number of coded bits allowed to be used in the rectangular area is exhausted in the process of encoding the rectangular area, but there are still uncoded pixel points in the rectangular area, An end code is added to the encoded bitstream corresponding to the rectangular region, wherein the end code can be used to identify the end of encoding of the rectangular region and the rectangular region further has at least one uncoded pixel. Optionally, the end code needs to be different from the coded bit in the coded bitstream corresponding to the rectangular area, that is, the uniqueness of the end code in the coded bit stream corresponding to the rectangular area needs to be guaranteed. For example, when a 0th-order Columbus code is used and the bit depth of the coded pixel is 12, the pattern of the end code can be set to consecutive 14 '0's, but this embodiment of the present application Not limited.
作为另一个可选实施例,在对矩形区域编码结束之后,可以在该矩形区域对应的编码比特流中添加填充比特(stuffing bits),以使得该矩形区域对应的编码比特流包括的比特个数严格等于该固定压缩倍率对应的比特数。可选地,该填充比特可以为连续的多个‘1’或连续的多个‘0’,本申请实施例对此不做限定。As another optional embodiment, after encoding the rectangular area, the stuffing bits may be added to the encoded bit stream corresponding to the rectangular area, so that the number of bits included in the encoded bit stream corresponding to the rectangular area is Strictly equal to the number of bits corresponding to the fixed compression ratio. Optionally, the padding bit may be a plurality of consecutive '1's or a plurality of consecutive '0's, which is not limited by the embodiment of the present application.
因此,本申请实施例提供的编码方法,在保证编码质量的同时可以具有较低的实现复杂度,此外,还可以实现对像素点的并行编码处理,从而提高数据处理能力。Therefore, the coding method provided by the embodiment of the present application can have lower implementation complexity while ensuring the coding quality. In addition, parallel coding processing on pixel points can be implemented, thereby improving data processing capability.
图2示出了本申请实施例提供的解码方法200。FIG. 2 shows a decoding method 200 provided by an embodiment of the present application.
S210,获取图像的编码比特流中与待解码片段对应的第一标识符。S210. Acquire a first identifier corresponding to the segment to be decoded in the encoded bitstream of the image.
该图像可以包括至少一个矩形区域,每个矩形区域包括至少一个片段,每个片段包括至少一个像素点。The image may include at least one rectangular region, each rectangular region including at least one segment, each segment including at least one pixel.
可选地,在本申请实施例中,长度相同的矩形区域可以对应相同的编/解码比特数。Optionally, in the embodiment of the present application, rectangular areas of the same length may correspond to the same number of coded/decoded bits.
可选地,该图像的编码比特流可以包括与该图像包括的至少一个片段中每个片段对应的第一标识符,其中,每个片段对应的第一标识符可以用于标识该每个片段的参考数据所在位置。Optionally, the encoded bitstream of the image may include a first identifier corresponding to each of the at least one segment included in the image, wherein the first identifier corresponding to each segment may be used to identify each segment The location of the reference data.
在本申请实施例中,不同片段可以对应于不同的第一标识符,相应地,可以根据每个片段对应的第一标识符,确定该每个片段的参考数据所在位置,但本申请实施例不限于此。In the embodiment of the present application, the different segments may correspond to different first identifiers. Correspondingly, the location of the reference data of each segment may be determined according to the first identifier corresponding to each segment, but the embodiment of the present application Not limited to this.
S220,根据该待解码片段对应的第一标识符,确定该待解码片段的参考数据为该待解码片段的上侧数据或左侧数据。S220. Determine, according to the first identifier corresponding to the to-be-decoded segment, the reference data of the to-be-decoded segment as the upper side data or the left side data of the to-be-decoded segment.
具体地,该待编码片段对应的第一标识符可以用于标识该待解码片段的参考数据所在位置为该待编码片段的左侧还是上侧。Specifically, the first identifier corresponding to the to-be-coded segment may be used to identify that the location of the reference data of the to-be-decoded segment is the left side or the upper side of the to-be-coded segment.
可选地,该待解码片段的左侧数据可以包括位于该待解码片段左侧的至少一个第一像素点的数据,其中,该至少一个第一像素点可以与该待解码片段相邻或间隔分布,每个第一像素点的数据可以包括该第一像素点的原始数据或已解码数据,本申请实施例对此不做限定。Optionally, the left side data of the to-be-decoded segment may include data of at least one first pixel point located to the left of the to-be-decoded segment, where the at least one first pixel point may be adjacent to or spaced from the to-be-decoded segment. The data of each of the first pixel points may include the original data or the decoded data of the first pixel, which is not limited by the embodiment of the present application.
可选地,该待解码数据的上侧数据可以包括位于该待解码片段上方的至少一个第二像素点的数据,其中,该至少一个第二像素点可以与该待 解码片段相邻或间隔分布,每个第二像素点的数据可以包括该第二像素点的原始数据或已解码数据,本申请实施例对此不做限定。Optionally, the upper side data of the to-be-decoded data may include data of at least one second pixel point located above the to-be-decoded segment, where the at least one second pixel point may be The decoded segments are adjacent or spaced apart, and the data of each second pixel may include the original data or the decoded data of the second pixel, which is not limited in this embodiment of the present application.
S230,根据该待解码片段的参考数据,对该待解码片段进行解码处理。S230. Perform decoding processing on the to-be-decoded segment according to the reference data of the to-be-decoded segment.
可选地,可以对该待解码片段进行熵解码处理,得到该待解码片段的量化参数;然后,可以根据该待解码片段的量化参数,对该待解码片段进行反量化处理,得到该待解码片段的残差数据;然后,可以根据该参考数据,对该待解码片段的残差数据进行反预测或补偿处理,得到该待解码片段的解码结果。Optionally, the to-be-decoded segment may be subjected to an entropy decoding process to obtain a quantization parameter of the to-be-decoded segment. Then, the to-be-decoded segment may be inverse quantized according to the quantization parameter of the to-be-decoded segment to obtain the to-be-decoded The residual data of the segment may be inversely predicted or compensated according to the reference data to obtain a decoding result of the segment to be decoded.
作为一个例子,待解码片段的参考数据可以包括该图像中与该待解码片段临近的像素点的数据。As an example, the reference data of the segment to be decoded may include data of pixels in the image that are adjacent to the segment to be decoded.
可选地,若该待解码片段与该图像的上边界相邻并且该待解码片段与该图像的左边界相邻,将该待解码片段中的前N个像素点的残差值确定为预设数值,并且根据该前N个像素点的数据,对该待解码片段中的剩余的(T-N)个像素点进行解码处理,其中,T为该待解码片段中包括的像素点的数量,1≤N≤T。Optionally, if the to-be-decoded segment is adjacent to an upper boundary of the image and the to-be-decoded segment is adjacent to a left boundary of the image, determining a residual value of the first N pixel points in the to-be-decoded segment as a pre- Setting a value, and performing decoding processing on the remaining (TN) pixel points in the to-be-decoded segment according to the data of the first N pixel points, where T is the number of pixel points included in the to-be-decoded segment, 1 ≤ N ≤ T.
可选地,若该待解码片段与该图像的上边界相邻并且该待解码片段与该图像的左边界间隔分布,根据该待解码片段的左侧数据,对该待解码片段中的像素点进行解码处理。Optionally, if the to-be-decoded segment is adjacent to an upper boundary of the image and the to-be-decoded segment is spaced apart from a left boundary of the image, according to the left-side data of the to-be-decoded segment, the pixel in the to-be-decoded segment Perform decoding processing.
可选地,若该待解码片段与该图像的上边界间隔分布并且该待解码片段与该图像的左边界相邻,根据该待解码片段的上侧数据,对该待解码片段中的像素点进行解码处理。Optionally, if the to-be-decoded segment is spaced apart from an upper boundary of the image and the to-be-decoded segment is adjacent to a left boundary of the image, according to the upper side data of the to-be-decoded segment, the pixel in the to-be-decoded segment Perform decoding processing.
作为另一个例子,待解码片段的参考数据可以为该待解码片段所属矩形区域中与该待解码片段临近的数据。As another example, the reference data of the segment to be decoded may be data adjacent to the segment to be decoded in the rectangular region to which the segment to be decoded belongs.
可选地,若该待解码片段与该待解码片段所属矩形区域的上边界相邻并且该待解码片段与该待解码片段所属矩形区域的左边界相邻,将该待解码片段中的前N个像素点的残差值确定为预设数值,并且根据该前N个像素点的数据,对该待解码片段中的剩余的(T-N)个像素点进行解码处理,其中,T为该待解码片段中包括的像素点的数量,1≤N≤T。Optionally, if the to-be-decoded segment is adjacent to an upper boundary of a rectangular region to which the to-be-decoded segment belongs and the to-be-decoded segment is adjacent to a left boundary of the rectangular region to which the to-be-decoded segment belongs, the first N in the to-be-decoded segment The residual value of the pixel points is determined as a preset value, and according to the data of the first N pixel points, the remaining (TN) pixel points in the to-be-decoded segment are decoded, where T is the to-be-decoded The number of pixels included in the segment, 1 ≤ N ≤ T.
可选地,若该待解码片段与该待解码片段所属矩形区域的上边界相邻并且该待解码片段与该待解码片段所属矩形区域的左边界间隔分布,根 据该待解码片段的左侧数据,对该待解码片段中的像素点进行解码处理。Optionally, if the to-be-decoded segment is adjacent to an upper boundary of a rectangular region to which the to-be-decoded segment belongs, and the to-be-decoded segment is spaced apart from a left boundary of the rectangular region to which the to-be-decoded segment belongs, the root According to the left side data of the to-be-decoded segment, the pixel points in the to-be-decoded segment are subjected to decoding processing.
可选地,若该待解码片段与该待解码片段所属矩形区域的上边界间隔分布并且该待解码片段与该待解码片段所属矩形区域的左边界相邻,根据该待解码片段的上侧数据,对该待解码片段中的像素点进行解码处理。Optionally, if the to-be-decoded segment is spaced apart from the upper boundary of the rectangular region to which the segment to be decoded belongs, and the to-be-decoded segment is adjacent to the left boundary of the rectangular region to which the segment to be decoded belongs, according to the upper data of the segment to be decoded. Decoding processing of the pixel points in the segment to be decoded.
作为另一个例子,该图像包括至少一个子图像,每个子图像包括至少一个矩形区域。此时,待解码片段的参考数据可以为该待解码片段所属子图象中与该待解码片段临近的数据。As another example, the image includes at least one sub-image, each sub-image including at least one rectangular region. At this time, the reference data of the segment to be decoded may be data adjacent to the segment to be decoded in the sub-image to which the segment to be decoded belongs.
可选地,若该待解码片段与该待解码片段所属子图像的上边界相邻并且该待解码片段与该待解码片段所属子图像的左边界相邻,将该待解码片段中的前N个像素点的残差值确定为预设数值,并且根据该前N个像素点的数据,对该待解码片段中的剩余的(T-N)个像素点进行解码处理,其中,T为该待解码片段中包括的像素点的数量,1≤N≤T。Optionally, if the to-be-decoded segment is adjacent to an upper boundary of the sub-image to which the to-be-decoded segment belongs and the to-be-decoded segment is adjacent to a left boundary of the sub-image to which the to-be-decoded segment belongs, the first N in the to-be-decoded segment The residual value of the pixel points is determined as a preset value, and according to the data of the first N pixel points, the remaining (TN) pixel points in the to-be-decoded segment are decoded, where T is the to-be-decoded The number of pixels included in the segment, 1 ≤ N ≤ T.
可选地,若该待解码片段与该待解码片段所属子图像的上边界相邻并且该待解码片段与该待解码片段所属子图像的左边界间隔分布,根据该待解码片段的左侧数据,对该待解码片段中的像素点进行解码处理。Optionally, if the to-be-decoded segment is adjacent to an upper boundary of the sub-image to which the to-be-decoded segment belongs and the to-be-decoded segment is spaced apart from a left boundary of the sub-image to which the to-be-decoded segment belongs, according to the left-side data of the to-be-decoded segment Decoding processing of the pixel points in the segment to be decoded.
可选地,若该待解码片段与该待解码片段所属子图像的上边界间隔分布并且该待解码片段与该待解码片段所属子图像的左边界相邻,根据该待解码片段的上侧数据,对该待解码片段中的像素点进行解码处理。Optionally, if the to-be-decoded segment is spaced apart from an upper boundary of the sub-image to which the to-be-decoded segment belongs and the to-be-decoded segment is adjacent to a left boundary of the sub-image to which the to-be-decoded segment belongs, according to the upper side data of the to-be-decoded segment Decoding processing of the pixel points in the segment to be decoded.
可选地,若该待解码片段与该待解码片段所属子图像的上边界和左边界相邻并且该待解码片段与该图像的上边界间隔分布,根据该待解码片段的上侧数据,对该待解码片段中的像素点进行解码处理。Optionally, if the to-be-decoded segment is adjacent to an upper boundary and a left boundary of the sub-image to which the to-be-decoded segment belongs, and the to-be-decoded segment is spaced apart from an upper boundary of the image, according to the upper side data of the to-be-decoded segment, The pixel in the segment to be decoded is subjected to decoding processing.
可选地,若该待解码片段与该待解码片段所属子图像的上边界和左边界相邻并且该待解码片段与该图像的左边界间隔分布,根据该待解码片段的左侧数据,对该待解码片段中的像素点进行解码处理。Optionally, if the to-be-decoded segment is adjacent to an upper boundary and a left boundary of the sub-image to which the to-be-decoded segment belongs, and the to-be-decoded segment is spaced apart from a left boundary of the image, according to the left side data of the to-be-decoded segment, The pixel in the segment to be decoded is subjected to decoding processing.
作为另一个例子,可以同时对M个相邻像素点进行解码处理。可选地,该待解码片段中的每M个相邻像素点对应于相同的参考像素点,其中,该待解码片段的参考数据包括该参考像素点的数据,M≥1。As another example, M adjacent pixels can be decoded at the same time. Optionally, each M adjacent pixel points in the to-be-decoded segment corresponds to the same reference pixel point, where the reference data of the to-be-decoded segment includes data of the reference pixel point, and M≥1.
应理解,在本申请实施例中,解码方法200可以对应于上文所述的编码方法,具体可以为编码方法的逆过程,具体实现可以参见上文对编码方法的描述,为了简洁,这里不再赘述。It should be understood that, in the embodiment of the present application, the decoding method 200 may correspond to the foregoing encoding method, and may specifically be an inverse process of the encoding method. For specific implementation, refer to the description of the encoding method. For brevity, here is not Let me repeat.
图3示出了本申请实施例提供的编码装置300,包括: FIG. 3 shows an encoding apparatus 300 provided by an embodiment of the present application, including:
预分析模块310,用于根据图像的待编码片段中的数据,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据;The pre-analysis module 310 is configured to determine, according to data in the segment to be encoded of the image, reference data of the segment to be encoded from the left side data and the upper side data of the to-be-coded segment;
编码模块320,用于根据该预分析模块310确定的该参考数据,对该待编码片段进行编码处理,得到该待编码片段的编码比特流。The encoding module 320 is configured to perform encoding processing on the fragment to be encoded according to the reference data determined by the pre-analysis module 310 to obtain an encoded bit stream of the fragment to be encoded.
在本申请实施例中,图像可以包括至少一个矩形区域,每个矩形区域包括至少一个片段,每个片段可以包括至少一个像素点。In an embodiment of the present application, the image may include at least one rectangular area, each rectangular area including at least one segment, and each segment may include at least one pixel.
在本申请实施例中,可选地,长度相同的矩形区域对应的编码比特数少于或等于预设的比特数。In the embodiment of the present application, optionally, the number of coded bits corresponding to the rectangular area having the same length is less than or equal to the preset number of bits.
具体地,当所述的编码比特数等于预设的比特数时,长度相同的矩形区域对应相同的编码比特数,即以固定倍率对该图像中的矩形区域进行编码处理。Specifically, when the number of encoded bits is equal to the preset number of bits, the rectangular areas of the same length correspond to the same number of coded bits, that is, the rectangular area in the image is encoded at a fixed magnification.
当所述的编码比特数少于或等于预设的比特数时,所述矩形区域对应的图像的编码压缩率大于或等于所述长度相同的矩形区域对应相同的编码比特数的压缩率。When the number of coded bits is less than or equal to a preset number of bits, the code compression ratio of the image corresponding to the rectangular area is greater than or equal to the compression ratio of the same number of coded bits corresponding to the same rectangular area.
所述处理方法的目的在于保证整幅图像的编码压缩率,同时由于不用严格保证每个矩形区域对应相同的编码比特数,从而可以提高每个矩形区域的编码灵活性并提高编码效率。The purpose of the processing method is to ensure the coding compression ratio of the entire image, and at the same time, since it is not strictly guaranteed that each rectangular area corresponds to the same number of coding bits, the coding flexibility of each rectangular area can be improved and the coding efficiency can be improved.
在本申请实施例中,待编码片段的左侧数据可以包括位于该待编码片段左侧的至少一个第一像素点的数据,该待编码数据的上侧数据可以包括位于该待编码片段上方的至少一个第二像素点的数据。In the embodiment of the present application, the data of the left side of the fragment to be encoded may include data of at least one first pixel located to the left of the fragment to be encoded, and the data of the upper side of the data to be encoded may be located above the fragment to be encoded. At least one second pixel point of data.
待编码片段的参考数据可以指该待编码片段的参考数据点的数据。相应地,确定待编码片段的参考数据的过程可以包括确定该待编码片段的参考数据点,其中,该待编码片段的参考数据点所在位置可以为待编码片段的左侧或上侧,具体可以根据待编码片段的数据和/或位置确定,本申请实施例对此不做限定。The reference data of the segment to be encoded may refer to the data of the reference data point of the segment to be encoded. Correspondingly, the process of determining the reference data of the segment to be encoded may include determining a reference data point of the segment to be encoded, where the location of the reference data point of the segment to be encoded may be the left side or the upper side of the segment to be encoded, specifically The embodiment of the present application does not limit the data and/or the location of the fragment to be encoded.
可选地,该至少一个第一像素点可以与该待编码片段相邻或者与该待编码片段临近但间隔分布。Optionally, the at least one first pixel may be adjacent to the segment to be encoded or adjacent to the segment to be encoded but spaced apart.
可选地,该至少一个第一像素点的数据可以包括该至少一个第一像素点的原始数据或该至少一个第一像素点的已编码数据。Optionally, the data of the at least one first pixel may include original data of the at least one first pixel or encoded data of the at least one first pixel.
可选地,该至少一个第二像素点可以与该待编码片段相邻或者与该待编码片段临近但间隔分布。 Optionally, the at least one second pixel may be adjacent to the segment to be encoded or adjacent to the segment to be encoded but spaced apart.
可选地,该至少一个第二像素点的数据可以包括该至少一个第二像素点的原始数据或该至少一个第二像素点的已编码数据。Optionally, the data of the at least one second pixel may include original data of the at least one second pixel or encoded data of the at least one second pixel.
作为一个例子,该预分析模块310可以具体用于:As an example, the pre-analysis module 310 can be specifically configured to:
根据该待编码片段中的数据和该至少一个第一像素点的数据,确定该待编码片段与该待编码片段的左侧数据之间的相关度;Determining, according to the data in the to-be-coded segment and the data of the at least one first pixel, a correlation between the segment to be encoded and the left-side data of the segment to be encoded;
根据该待编码片段中的数据和该至少一个第二像素点的数据,确定该待编码片段与该待编码片段的上侧数据之间的相关度;Determining, according to the data in the to-be-coded segment and the data of the at least one second pixel, a correlation between the segment to be encoded and the upper data of the segment to be encoded;
根据该待编码片段与该待编码片段的左侧数据之间的相关度以及该待编码片段与该待编码片段的上侧数据之间的相关度,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据。And according to the correlation between the to-be-coded segment and the left-side data of the to-be-coded segment, and the correlation between the segment to be encoded and the upper-side data of the segment to be encoded, from the left side data of the segment to be encoded and In the side data, the reference data of the segment to be encoded is determined.
可选地,该预分析模块310具体用于:将该待编码片段的左侧数据和上侧数据中与该待编码片段之间相关度较大的数据,确定为该待编码片段的参考数据。Optionally, the pre-analysis module 310 is configured to determine, as the reference data of the to-be-coded segment, the data on the left side of the to-be-coded segment and the data in the upper-side data that is highly correlated with the to-be-coded segment. .
可选地,该编码模块320还用于:向该待编码片段的编码比特流添加第一标识符,该第一标识符用于指示该待编码片段的参考数据所在位置。Optionally, the encoding module 320 is further configured to: add a first identifier to the encoded bitstream of the to-be-encoded segment, where the first identifier is used to indicate a location of the reference data of the to-be-coded segment.
作为另一个可选实施例,如图3所示,该装置300还包括:边界处理模块330,用于若该待编码片段所属矩形区域当前已使用的编码比特数Bi小于或等于该待编码片段所属矩形区域允许使用的编码比特数B,并且该待编码片段中的当前待编码像素点需要使用的编码比特数bi+1与Bi之和大于B,向该待编码片段的编码比特流添加结束码,该结束码用于标识对该待编码片段所属矩形区域的编码结束并且该待编码片段所属矩形区域具有至少一个未编码的像素点。As another alternative embodiment, as shown in FIG. 3, the apparatus 300 further includes: a boundary processing module 330, configured to: if the number of coded bits Bi currently used by the rectangular area to which the fragment to be encoded belongs is less than or equal to the fragment to be encoded The number of coded bits B to be used in the rectangular area to be used, and the sum of the number of coded bits bi+1 and Bi to be used in the current to-be-coded pixel to be encoded is greater than B, and the end of the coded bit stream to be added to the segment to be encoded is added. And the end code is used to identify that the encoding of the rectangular region to which the segment to be encoded belongs is ended and the rectangular region to which the segment to be encoded belongs has at least one uncoded pixel.
作为一个例子,如图4所示,该编码模块320可以包括:As an example, as shown in FIG. 4, the encoding module 320 can include:
预测单元321,用于根据该参考数据,对该待编码片段进行预测处理,得到该待编码片段的预测残差;The prediction unit 321 is configured to perform prediction processing on the to-be-coded segment according to the reference data, to obtain a prediction residual of the to-be-coded segment;
量化单元322,用于利用该待编码片段的量化参数,对该预测单元321得到的该待编码片段的预测残差进行量化处理,得到该待编码片段的量化结果;The quantization unit 322 is configured to perform quantization processing on the prediction residual of the to-be-coded segment obtained by the prediction unit 321 by using the quantization parameter of the to-be-coded segment, to obtain a quantization result of the to-be-coded segment;
熵编码单元323,用于对该量化单元322得到的该待编码片段的量化结果进行熵编码处理,得到该待编码片段的编码结果。 The entropy encoding unit 323 is configured to perform entropy encoding processing on the quantized result of the to-be-encoded segment obtained by the quantization unit 322 to obtain an encoding result of the to-be-encoded segment.
作为另一个例子,该编码模块320还可以包括:速率控制单元324,用于在该量化单元322利用该待编码片段的量化参数,对该待编码片段的预测结果进行量化处理之前,根据该预分析模块310确定的参考数据,确定该待编码片段的量化参数;As another example, the encoding module 320 may further include: a rate control unit 324, configured to: before the quantization unit 322 quantizes the prediction result of the to-be-coded segment by using the quantization parameter of the to-be-coded segment, according to the pre- Determining the quantization parameter of the segment to be encoded by the reference data determined by the analysis module 310;
相应地,该量化单元322可以具体用于利用该速率控制单元324确定的量化参数,对该待编码片段的预测结果进行量化处理。Correspondingly, the quantization unit 322 can be specifically configured to perform quantization processing on the prediction result of the segment to be encoded by using the quantization parameter determined by the rate control unit 324.
可选地,该速率控制单元324具体用于:Optionally, the rate control unit 324 is specifically configured to:
根据该预分析模块310确定的该参考数据和该待编码片段中的数据,确定该待编码片段的复杂度;Determining the complexity of the segment to be encoded according to the reference data determined by the pre-analysis module 310 and the data in the segment to be encoded;
根据该待编码片段的复杂度,确定该待编码片段的量化参数。The quantization parameter of the segment to be encoded is determined according to the complexity of the segment to be encoded.
可选地,该速率控制单元324具体用于:Optionally, the rate control unit 324 is specifically configured to:
根据该参考数据和该待编码片段中的数据,确定该待编码片段中每个像素点的残差;Determining a residual of each pixel in the segment to be encoded according to the reference data and the data in the segment to be encoded;
根据该待编码片段中每个像素点的残差,确定该待编码片段的复杂度。The complexity of the segment to be encoded is determined according to the residual of each pixel in the segment to be encoded.
可选地,该速率控制单元324具体用于:Optionally, the rate control unit 324 is specifically configured to:
根据该待编码片段所属矩形区域中的每个片段的复杂度,确定该待编码片段所属矩形区域的复杂度;Determining, according to the complexity of each segment in the rectangular region to which the segment to be encoded belongs, the complexity of the rectangular region to which the segment to be encoded belongs;
通过比较该待编码片段的复杂度和该待编码片段所属矩形区域的复杂度,确定该待编码片段的量化参数。The quantization parameter of the segment to be encoded is determined by comparing the complexity of the segment to be encoded and the complexity of the rectangular region to which the segment to be encoded belongs.
作为一个例子,该预分析模块310可以具体用于:若该待编码片段具有可用的左侧数据和可用的上侧数据,从该待编码片段的可用的左侧数据和可用的上侧数据中,确定该待编码片段的参考数据。As an example, the pre-analysis module 310 may be specifically configured to: if the to-be-coded segment has available left-side data and available upper-side data, from available left-side data and available upper-side data of the to-be-coded segment Determining the reference data of the segment to be encoded.
此时,如果该待编码片段仅具有可用的左侧数据或上侧数据,则该预分析模块310可以将该待编码片段具有的可用的左侧数据或上侧数据确定为该待编码片段的参考数据。At this time, if the to-be-coded segment has only available left-side data or upper-side data, the pre-analysis module 310 may determine available left-side data or upper-side data of the to-be-coded segment as the to-be-coded segment. Reference data.
可选地,如果该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界相邻,该编码模块320还可以用于将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。 Optionally, if the to-be-coded segment is adjacent to an upper boundary of the image and the to-be-coded segment is adjacent to a left boundary of the image, the encoding module 320 may be further configured to use the first N pixels in the to-be-coded segment. The predicted value of the point is determined as a preset value, and according to the data of the first N pixel points, the remaining (TN) pixel points in the to-be-coded segment are encoded, where T is included in the to-be-coded segment. The number of pixels, 1 ≤ N ≤ T.
可选地,如果该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,该编码模块320还可以用于根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the image and the to-be-coded segment is spaced apart from a left boundary of the image, the encoding module 320 may further be configured to: according to the left side data of the to-be-coded segment, The pixel points in the segment to be encoded are subjected to encoding processing.
可选地,如果该待编码片段与该图像的上边界间隔分布并且该待编码片段与该图像的左边界相邻,该编码模块320还可以用于根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is spaced apart from an upper boundary of the image and the to-be-coded segment is adjacent to a left boundary of the image, the encoding module 320 may be further configured to use, according to the upper-side data of the to-be-coded segment, The pixel points in the segment to be encoded are subjected to encoding processing.
可选地,如果该待编码片段与该待编码片段所属矩形区域的上边界相邻并且该待编码片段与该待编码片段所属矩形区域的左边界相邻,该编码模块320还可以用于将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。Optionally, if the to-be-coded segment is adjacent to an upper boundary of a rectangular region to which the to-be-coded segment belongs and the to-be-coded segment is adjacent to a left boundary of the rectangular region to which the segment to be encoded belongs, the encoding module 320 may be further configured to: The predicted values of the first N pixels in the to-be-coded segment are determined as preset values, and the remaining (TN) pixels in the to-be-coded segment are encoded according to the data of the first N pixels. Where T is the number of pixel points included in the segment to be encoded, 1≤N≤T.
可选地,如果该待编码片段与该待编码片段所属矩形区域的上边界相邻并且该待编码片段与该待编码片段所属矩形区域的左边界间隔分布,该编码模块320还可以用于根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理;Optionally, if the to-be-coded segment is adjacent to an upper boundary of a rectangular area to which the to-be-coded segment belongs, and the to-be-coded segment is spaced apart from a left boundary of the rectangular region to which the to-be-coded segment belongs, the encoding module 320 may be further configured to The left side data of the fragment to be encoded is encoded by the pixel in the fragment to be encoded;
可选地,如果该待编码片段与该待编码片段所属矩形区域的上边界间隔分布并且该待编码片段与该待编码片段所属矩形区域的左边界相邻,该编码模块320还可以用于根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is spaced apart from the upper boundary of the rectangular region to which the fragment to be encoded belongs, and the to-be-coded segment is adjacent to the left boundary of the rectangular region to which the fragment to be encoded belongs, the encoding module 320 may be further configured to The upper side data of the fragment to be encoded is subjected to encoding processing on the pixel points in the fragment to be encoded.
可选地,如果该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该待编码片段所属子图像的左边界相邻,该编码模块320还可以用于将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the to-be-coded segment belongs and the to-be-coded segment is adjacent to a left boundary of the sub-image to which the to-be-coded segment belongs, the encoding module 320 may be further configured to: The predicted values of the first N pixels in the to-be-coded segment are determined as preset values, and the remaining (TN) pixels in the to-be-coded segment are encoded according to the data of the first N pixels. Where T is the number of pixel points included in the segment to be encoded, 1≤N≤T.
可选地,如果该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该待编码片段所属子图像的左边界间隔分布,该编码模块320还可以用于根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the to-be-coded segment belongs and the to-be-coded segment is spaced apart from a left boundary of the sub-image to which the to-be-coded segment belongs, the encoding module 320 may be further configured to The left side data of the to-be-coded segment is subjected to encoding processing on the pixel points in the to-be-coded segment.
可选地,如果该待编码片段与该待编码片段所属子图像的上边界 间隔分布并且该待编码片段与该待编码片段所属子图像的左边界相邻,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the segment to be encoded and the upper boundary of the sub-image to which the segment to be encoded belongs An interval is distributed and the segment to be encoded is adjacent to a left boundary of the sub-image to which the segment to be encoded belongs, and the pixel in the segment to be encoded is encoded according to the upper side data of the segment to be encoded.
可选地,如果该待编码片段与该待编码片段所属子图像的上边界和左边界相邻并且该待编码片段与该图像的上边界间隔分布,该编码模块320还可以用于根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to an upper boundary and a left boundary of the sub-image to which the to-be-coded segment belongs, and the to-be-coded segment is spaced apart from an upper boundary of the image, the encoding module 320 may be further configured to be used according to the to-be-coded segment. Encoding the upper side data of the segment, and encoding the pixel points in the segment to be encoded.
可选地,如果该待编码片段与该待编码片段所属子图像的上边界和左边界相邻并且该待编码片段与该图像的左边界间隔分布,该编码模块320还可以用于根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。Optionally, if the to-be-coded segment is adjacent to an upper boundary and a left boundary of the sub-image to which the to-be-coded segment belongs, and the to-be-coded segment is spaced apart from the left boundary of the image, the encoding module 320 may further be configured to be used according to the to-be-coded segment. Encoding the left side data of the segment, and encoding the pixel points in the segment to be encoded.
可选地,该待编码片段中的每M个相邻像素点可以对应于相同的参考像素点,其中,该待编码片段的参考数据包括该参考像素点的数据,M≥1。Optionally, each M adjacent pixel points in the to-be-coded segment may correspond to the same reference pixel point, where the reference data of the to-be-coded segment includes data of the reference pixel point, and M≥1.
应理解,上文对编码装置300的描述仅是示例性地,在某些情况下,编码装置300也可以不包括上述一个或多个模块,例如,该编码装置300可以不包括边界处理模块330,但本申请实施例对此不做限定。It should be understood that the above description of the encoding device 300 is merely exemplary. In some cases, the encoding device 300 may not include the one or more modules described above. For example, the encoding device 300 may not include the boundary processing module 330. However, the embodiment of the present application does not limit this.
还应理解,这里的装置300以功能模块的形式体现。在一个可选例子中,本领域技术人员可以理解,装置300可以具体为上述实施例中的编码方法的执行主体,装置300可以用于执行上述方法实施例中的各个流程和/或步骤,为避免重复,在此不再赘述。It should also be understood that the apparatus 300 herein is embodied in the form of a functional module. In an optional example, those skilled in the art may understand that the apparatus 300 may be specifically the execution body of the coding method in the foregoing embodiment, and the apparatus 300 may be used to perform various processes and/or steps in the foregoing method embodiments. Avoid repetition and we will not repeat them here.
图5示出了本申请实施例提供的解码装置400,包括:FIG. 5 shows a decoding apparatus 400 provided by an embodiment of the present application, including:
获取模块410,用于获取图像的编码比特流中与待解码片段对应的第一标识符,其中,该图像包括至少一个矩形区域,每个矩形区域包括至少一个片段,每个片段包括至少一个像素点,其中,长度相同的矩形区域对应的编码比特数少于或等于预设的比特数,该图像的编码比特流包括与该图像包括的至少一个片段中每个片段对应的第一标识符,每个片段对应的第一标识符用于标识该每个片段的参考数据所在位置;The obtaining module 410 is configured to acquire a first identifier corresponding to the segment to be decoded in the encoded bit stream of the image, where the image includes at least one rectangular region, each rectangular region includes at least one segment, and each segment includes at least one pixel a point, wherein the number of coded bits corresponding to the rectangular area having the same length is less than or equal to a preset number of bits, and the coded bit stream of the image includes a first identifier corresponding to each of the at least one segment included in the image, The first identifier corresponding to each segment is used to identify the location of the reference data of each segment;
确定模块420,用于根据该获取模块410获取的该待编码片段对应的第一标识符,确定该待解码片段的参考数据为该待解码片段的上侧数据或左侧数据,其中,该待解码片段的左侧数据包括位于该待解码片段左侧的至少一个第一像素点的数据,该待解码数据的上侧数据包括位于该待解码片段 上方的至少一个第二像素点的数据;The determining module 420 is configured to determine, according to the first identifier corresponding to the to-be-coded segment that is obtained by the acquiring module 410, that the reference data of the to-be-decoded segment is the upper-side data or the left-side data of the to-be-decoded segment, where the The left side data of the decoded segment includes data of at least one first pixel located to the left of the segment to be decoded, and the upper side data of the to-be-decoded data includes the segment to be decoded Data of at least one second pixel above;
解码模块430,用于根据该确定模块420确定的该待解码片段的参考数据,对该待解码片段进行解码处理。The decoding module 430 is configured to perform decoding processing on the to-be-decoded segment according to the reference data of the to-be-decoded segment determined by the determining module 420.
可选地,该解码模块430可以包括:Optionally, the decoding module 430 can include:
熵解码单元,用于对该待解码片段进行熵解码处理,得到该待解码片段的量化参数;An entropy decoding unit, configured to perform entropy decoding processing on the to-be-decoded segment, to obtain a quantization parameter of the to-be-decoded segment;
反量化单元,用于根据该熵解码单元得到的该待解码片段的量化参数,对该待解码片段进行反量化处理,得到该待解码片段的残差数据;An inverse quantization unit, configured to perform inverse quantization processing on the to-be-decoded segment according to the quantization parameter of the to-be-decoded segment obtained by the entropy decoding unit, to obtain residual data of the to-be-decoded segment;
反预测单元,用于根据该确定模块420确定的该参考数据,对该反量化单元得到的该待解码片段的残差数据进行反预测处理,得到该待解码片段的解码结果。The anti-prediction unit is configured to perform inverse prediction processing on the residual data of the to-be-decoded segment obtained by the inverse quantization unit according to the reference data determined by the determining module 420, to obtain a decoding result of the to-be-decoded segment.
应理解,这里的装置400以功能模块的形式体现。在一个可选例子中,本领域技术人员可以理解,装置400可以具体为上述实施例中的解码方法的执行主体,装置400可以用于执行上述方法实施例中的各个流程和/或步骤,为避免重复,在此不再赘述。It should be understood that the apparatus 400 herein is embodied in the form of a functional module. In an alternative example, those skilled in the art may understand that the apparatus 400 may be specifically the execution body of the decoding method in the foregoing embodiment, and the apparatus 400 may be used to perform various processes and/or steps in the foregoing method embodiments. Avoid repetition and we will not repeat them here.
还应理解,在本申请实施例中,术语“模块”可以指应用特有集成电路(application specific integrated circuit,ASIC)、电子电路、用于执行一个或多个软件或固件程序的处理器(例如共享处理器、专有处理器或组处理器等)和存储器、合并逻辑电路和/或其它支持所描述的功能的合适组件。It should also be understood that in the embodiments of the present application, the term "module" may refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor for executing one or more software or firmware programs (eg, sharing). Processors, proprietary processors or group processors, etc.) and memory, merge logic, and/or other suitable components that support the described functionality.
图6示出了本申请实施例提供的另一编码装置500,包括:处理器510和存储器520,其中,该存储器520用于存储指令,该处理器510用于执行该存储器存储的指令,其中,对存储器520中存储的该指令的执行使得该处理器510执行以下操作:根据图像的待编码片段中的数据,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据;根据该参考数据,对该待编码片段进行编码处理,得到该待编码片段的编码比特流。FIG. 6 illustrates another encoding apparatus 500 provided by an embodiment of the present application, including: a processor 510 and a memory 520, wherein the memory 520 is configured to store an instruction, and the processor 510 is configured to execute the memory stored instruction, where Execution of the instruction stored in the memory 520 causes the processor 510 to perform an operation of determining the fragment to be encoded from the left side data and the upper side data of the fragment to be encoded according to data in the fragment to be encoded of the image. According to the reference data, the segment to be encoded is encoded to obtain an encoded bit stream of the segment to be encoded.
可选地,该处理器510可以具体用于:根据该参考数据,对该待编码片段进行预测处理,得到该待编码片段的预测残差;利用该待编码片段的量化参数,对该待编码片段的预测残差进行量化处理,得到该待编码片段的量化结果;以及对该待编码片段的量化结果进行熵编码处理,得到该待编码片段的编码结果。Optionally, the processor 510 is specifically configured to: perform prediction processing on the to-be-coded segment according to the reference data, to obtain a prediction residual of the to-be-coded segment, and use the quantization parameter of the to-be-coded segment to be encoded. The prediction residual of the segment is quantized to obtain a quantization result of the segment to be encoded; and the quantization result of the segment to be encoded is subjected to entropy coding processing to obtain a coding result of the segment to be encoded.
可选地,该处理器510还可以用于:根据该参考数据,确定该待 编码片段的量化参数。Optionally, the processor 510 is further configured to: determine, according to the reference data, the to-be-determined The quantization parameter of the encoded fragment.
在一个可选例子中,本领域技术人员可以理解,装置500可以具体为上述实施例中的编码装置,装置500可以用于执行上述方法实施例中的各个流程和/或步骤,为避免重复,在此不再赘述。In an alternative example, those skilled in the art may understand that the apparatus 500 may be specifically the encoding apparatus in the foregoing embodiment, and the apparatus 500 may be used to perform various processes and/or steps in the foregoing method embodiments, in order to avoid duplication. I will not repeat them here.
图7示出了本申请实施例提供的另一解码装置600,包括:处理器610和存储器620,其中,该存储器620用于存储指令,该处理器610用于执行该存储器存储的指令,其中,对存储器620中存储的该指令的执行使得该处理器610执行以下操作:FIG. 7 illustrates another decoding apparatus 600 provided by an embodiment of the present application, including: a processor 610 and a memory 620, wherein the memory 620 is configured to store an instruction, and the processor 610 is configured to execute the memory stored instruction, where Execution of the instruction stored in memory 620 causes the processor 610 to perform the following operations:
获取图像的编码比特流中与待解码片段对应的第一标识符;Obtaining a first identifier corresponding to the segment to be decoded in the encoded bitstream of the image;
根据该待编码片段对应的第一标识符,确定该待解码片段的参考数据为该待解码片段的上侧数据或左侧数据;Determining, according to the first identifier corresponding to the to-be-coded segment, reference data of the to-be-decoded segment as upper-side data or left-side data of the to-be-decoded segment;
根据该待解码片段的参考数据,对该待解码片段进行解码处理。Decoding the to-be-decoded segment according to the reference data of the segment to be decoded.
可选地,该处理器610具体用于:Optionally, the processor 610 is specifically configured to:
对该待解码片段进行熵解码处理,得到该待解码片段的量化参数;Performing an entropy decoding process on the to-be-decoded segment to obtain a quantization parameter of the to-be-decoded segment;
根据该待解码片段的量化参数,对该待解码片段进行反量化处理,得到该待解码片段的残差数据;Performing inverse quantization processing on the to-be-decoded segment according to the quantization parameter of the to-be-decoded segment, to obtain residual data of the to-be-decoded segment;
根据该参考数据,对该待解码片段的残差数据进行反预测处理,得到该待解码片段的解码结果。According to the reference data, the residual data of the to-be-decoded segment is subjected to inverse prediction processing to obtain a decoding result of the to-be-decoded segment.
在一个可选例子中,本领域技术人员可以理解,装置600可以具体为上述实施例中的解码装置,装置600可以用于执行上述方法实施例中的各个流程和/或步骤,为避免重复,在此不再赘述。In an alternative example, those skilled in the art may understand that the apparatus 600 may be specifically the decoding apparatus in the foregoing embodiment, and the apparatus 600 may be used to perform various processes and/or steps in the foregoing method embodiments, to avoid repetition. I will not repeat them here.
应理解,在本申请实施例中,处理器可以是中央处理单元(central processing unit,CPU),处理器还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that, in the embodiment of the present application, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
存储器可以包括只读存储器和随机存取存储器,并向处理器提供指令和数据。存储器的一部分还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。该处理器可以用于执行存储器中存储的指令,并且该处理器执行该指令时,该处理器可以执行上述方法实施例中与终端设备对应的各个步骤。 The memory can include read only memory and random access memory and provides instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory can also store information of the device type. The processor can be used to execute instructions stored in the memory, and when the processor executes the instructions, the processor can perform the steps corresponding to the terminal device in the above method embodiments.
在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器执行存储器中的指令,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software. The steps of the method disclosed in the embodiments of the present application may be directly implemented by the hardware processor, or may be performed by a combination of hardware and software modules in the processor. The software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like. The storage medium is located in a memory, and the processor executes instructions in the memory, in combination with hardware to perform the steps of the above method. To avoid repetition, it will not be described in detail here.
还应理解,在本申请实施例中,图像中的像素点可以位于不同的行和/或列,其中,A的长度可以对应于A包括的位于同一行的像素点个数,A的高度可以对应于A包括的位于同一列的像素点个数。此外,A的长度和高度也可以分别称为A的宽度和深度,本申请实施例对此不做限定。It should also be understood that, in the embodiment of the present application, the pixels in the image may be located in different rows and/or columns, wherein the length of A may correspond to the number of pixels included in the same row of A, and the height of A may be Corresponds to the number of pixels in the same column that A includes. In addition, the length and height of A may also be referred to as the width and depth of A, respectively, which is not limited by the embodiment of the present application.
还应理解,在本申请实施例中,“与A的边界间隔分布”可以指与A的边界间隔至少一个像素点,也可以称为“不与A的边界相邻”或者“不位于A的边界”,本申请实施例对此不做限定,其中,A可以是图像、矩形区域或子图像,等等。It should also be understood that, in the embodiment of the present application, “the boundary distribution with A” may mean that at least one pixel is spaced apart from the boundary of A, and may also be referred to as “not adjacent to the boundary of A” or “not located at A”. The boundary is not limited in this embodiment, and A may be an image, a rectangular area or a sub-image, and the like.
还应理解,上文对本申请实施例的描述着重于强调各个实施例之间的不同之处,未提到的相同或相似之处可以互相参考,为了简洁,这里不再赘述。It should be understood that the above description of the embodiments of the present application is emphasized to emphasize the differences between the various embodiments, and the same or similar points that are not mentioned may be referred to each other, and are not described herein again for brevity.
此外,本文中术语“系统”和“网络”在本文中常被可互换使用。本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。Moreover, the terms "system" and "network" are used interchangeably herein. The term "and/or" in this context is merely an association describing the associated object, indicating that there may be three relationships, for example, A and/or B, which may indicate that A exists separately, and both A and B exist, respectively. B these three situations. In addition, the character "/" in this article generally indicates that the contextual object is an "or" relationship.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。 A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘solid state disk(SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present application are generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transfer to another website site, computer, server, or data center by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL), or wireless (eg, infrared, wireless, microwave, etc.). The computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media. The usable medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)) or the like.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请 的保护范围应所述以权利要求的保护范围为准。 The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application. It should be covered by the scope of protection of this application. Therefore, this application The scope of protection shall be determined by the scope of protection of the claims.

Claims (46)

  1. 一种编码方法,其特征在于,包括:An encoding method, comprising:
    根据图像的待编码片段中的数据,从所述待编码片段的左侧数据和上侧数据中,确定所述待编码片段的参考数据;Determining, according to data in the segment to be encoded of the image, reference data of the segment to be encoded from the left side data and the upper side data of the to-be-coded segment;
    根据所述参考数据,对所述待编码片段进行编码处理,得到所述待编码片段的编码比特流;其中,Encoding the to-be-encoded segment according to the reference data to obtain an encoded bitstream of the to-be-coded segment;
    所述图像包括至少一个矩形区域,每个矩形区域包括至少一个片段,每个片段包括至少一个像素点,并且长度相同的矩形区域对应的编码比特数少于或等于预设的编码比特数,The image includes at least one rectangular area, each rectangular area includes at least one segment, each segment includes at least one pixel, and the number of encoded bits corresponding to the rectangular area of the same length is less than or equal to a preset number of encoded bits,
    所述待编码片段的左侧数据包括位于所述待编码片段左侧的至少一个第一像素点的数据,所述待编码数据的上侧数据包括位于所述待编码片段上方的至少一个第二像素点的数据。The data on the left side of the fragment to be encoded includes data of at least one first pixel located on the left side of the fragment to be encoded, and the upper side data of the data to be encoded includes at least one second located above the fragment to be encoded. Pixel data.
  2. 根据权利要求1所述的方法,其特征在于,下列中的至少一项成立:The method of claim 1 wherein at least one of the following is true:
    所述至少一个第一像素点与所述待编码片段相邻或者与所述待编码片段临近但间隔分布;The at least one first pixel is adjacent to the segment to be encoded or adjacent to the segment to be encoded but spaced apart;
    所述至少一个第一像素点的数据包括所述至少一个第一像素点的原始数据或所述至少一个第一像素点的已编码数据;The data of the at least one first pixel includes the original data of the at least one first pixel or the encoded data of the at least one first pixel;
    所述至少一个第二像素点与所述待编码片段相邻或者与所述待编码片段临近但间隔分布;The at least one second pixel is adjacent to the fragment to be encoded or adjacent to the fragment to be encoded but spaced apart;
    所述至少一个第二像素点的数据包括所述至少一个第二像素点的原始数据或所述至少一个第二像素点的已编码数据。The data of the at least one second pixel includes raw data of the at least one second pixel or encoded data of the at least one second pixel.
  3. 根据权利要求1或2所述的方法,其特征在于,所述根据待编码片段中的数据,从所述待编码片段的左侧数据和上侧数据中,确定所述待编码片段的参考数据,包括:The method according to claim 1 or 2, wherein the determining the reference data of the fragment to be encoded from the left side data and the upper side data of the fragment to be encoded according to data in the fragment to be encoded ,include:
    根据所述待编码片段中的数据和所述至少一个第一像素点的数据,确定所述待编码片段与所述待编码片段的左侧数据之间的相关度;Determining, according to the data in the to-be-coded segment and the data of the at least one first pixel, a correlation between the segment to be encoded and the left-side data of the segment to be encoded;
    根据所述待编码片段中的数据和所述至少一个第二像素点的数据,确定所述待编码片段与所述待编码片段的上侧数据之间的相关度;Determining, according to the data in the to-be-coded segment and the data of the at least one second pixel, a correlation between the to-be-coded segment and the upper-side data of the segment to be encoded;
    根据所述待编码片段与所述待编码片段的左侧数据之间的相关度以及所述待编码片段与所述待编码片段的上侧数据之间的相关度,从所述待编码片段的左侧数据和上侧数据中,确定所述待编码片段的参考数据。 And according to the correlation between the to-be-coded segment and the left-side data of the to-be-coded segment, and the correlation between the to-be-coded segment and the upper-side data of the to-be-coded segment, from the segment to be encoded In the left side data and the upper side data, reference data of the fragment to be encoded is determined.
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述待编码片段与所述待编码片段的左侧数据之间的相关度以及所述待编码片段与所述待编码片段的上侧数据之间的相关度,从所述待编码片段的左侧数据和上侧数据中,确定所述待编码片段的参考数据,包括:The method according to claim 3, wherein the correlation between the segment to be encoded and the left side data of the segment to be encoded, and the segment to be encoded and the segment to be encoded are Correlation between the side data, determining the reference data of the fragment to be encoded from the left side data and the upper side data of the fragment to be encoded, including:
    将所述待编码片段的左侧数据和上侧数据中与所述待编码片段之间相关度较大的数据,确定为所述待编码片段的参考数据。And determining, by the left side data of the to-be-coded segment and the data of the upper side data that is highly correlated with the to-be-coded segment, as the reference data of the to-be-coded segment.
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, further comprising:
    向所述待编码片段的编码比特流添加第一标识符,所述第一标识符用于指示所述待编码片段的参考数据所在位置。Adding a first identifier to the encoded bitstream of the fragment to be encoded, the first identifier being used to indicate a location of reference data of the fragment to be encoded.
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述根据所述参考数据,对所述待编码片段进行编码处理,包括:The method according to any one of claims 1 to 5, wherein the encoding processing the fragment to be encoded according to the reference data comprises:
    根据所述参考数据,对所述待编码片段进行预测处理,得到所述待编码片段的预测残差;And performing prediction processing on the to-be-coded segment according to the reference data, to obtain a prediction residual of the to-be-coded segment;
    利用所述待编码片段的量化参数,对所述待编码片段的预测残差进行量化处理,得到所述待编码片段的量化结果;Using the quantization parameter of the fragment to be encoded, performing quantization processing on the prediction residual of the fragment to be encoded, to obtain a quantization result of the fragment to be encoded;
    对所述待编码片段的量化结果进行熵编码处理,得到所述待编码片段的编码结果。Encoding the quantized result of the to-be-coded segment to obtain an encoding result of the segment to be encoded.
  7. 根据权利要求6所述的方法,其特征在于,在所述利用所述待编码片段的量化参数,对所述待编码片段的预测结果进行量化处理之前,所述方法还包括:The method according to claim 6, wherein the method further comprises: before the quantizing the prediction result of the segment to be encoded by using the quantization parameter of the segment to be encoded, the method further comprises:
    根据所述参考数据,确定所述待编码片段的量化参数。Determining, according to the reference data, a quantization parameter of the segment to be encoded.
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述参考数据,确定所述待编码片段的量化参数,包括:The method according to claim 7, wherein the determining the quantization parameter of the fragment to be encoded according to the reference data comprises:
    根据所述参考数据和所述待编码片段中的数据,确定所述待编码片段的复杂度;Determining a complexity of the fragment to be encoded according to the reference data and data in the fragment to be encoded;
    根据所述待编码片段的复杂度,确定所述待编码片段的量化参数。Determining a quantization parameter of the segment to be encoded according to the complexity of the segment to be encoded.
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述参考数据和所述待编码片段中的数据,确定所述待编码片段的复杂度,包括:The method according to claim 8, wherein the determining the complexity of the fragment to be encoded according to the reference data and the data in the fragment to be encoded comprises:
    根据所述参考数据和所述待编码片段中的数据,确定所述待编码片段中每个像素点的残差; Determining a residual of each pixel in the segment to be encoded according to the reference data and data in the segment to be encoded;
    根据所述待编码片段中每个像素点的残差,确定所述待编码片段的复杂度。Determining the complexity of the segment to be encoded according to the residual of each pixel in the segment to be encoded.
  10. 根据权利要求8或9所述的方法,其特征在于,所述根据所述待编码片段的复杂度,确定所述待编码片段的量化参数,包括:The method according to claim 8 or 9, wherein the determining the quantization parameter of the fragment to be encoded according to the complexity of the fragment to be encoded comprises:
    根据所述待编码片段所属矩形区域中的每个片段的复杂度,确定所述待编码片段所属矩形区域的复杂度;Determining, according to the complexity of each segment in the rectangular area to which the fragment to be encoded belongs, the complexity of the rectangular area to which the fragment to be encoded belongs;
    通过比较所述待编码片段的复杂度和所述待编码片段所属矩形区域的复杂度,确定所述待编码片段的量化参数。The quantization parameter of the segment to be encoded is determined by comparing the complexity of the segment to be encoded and the complexity of the rectangular region to which the segment to be encoded belongs.
  11. 根据权利要求1至10中任一项所述的方法,其特征在于,所述从所述待编码片段的左侧数据和上侧数据中,确定所述待编码片段的参考数据,包括:The method according to any one of claims 1 to 10, wherein the determining the reference data of the fragment to be encoded from the left side data and the upper side data of the fragment to be encoded comprises:
    若所述待编码片段具有可用的左侧数据和可用的上侧数据,从所述待编码片段的可用的左侧数据和可用的上侧数据中,确定所述待编码片段的参考数据。If the to-be-coded segment has available left-side data and available upper-side data, the reference data of the segment to be encoded is determined from available left-side data of the segment to be encoded and available upper-side data.
  12. 根据权利要求11所述的方法,其特征在于,所述方法还包括下列中的至少一种:The method of claim 11 wherein said method further comprises at least one of the following:
    若所述待编码片段与所述图像的上边界相邻并且所述待编码片段与所述图像的左边界相邻,将所述待编码片段中的前N个像素点的预测值确定为预设数值,并且根据所述前N个像素点的数据,对所述待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为所述待编码片段中包括的像素点的数量,1≤N≤T;If the segment to be encoded is adjacent to an upper boundary of the image and the segment to be encoded is adjacent to a left boundary of the image, determining a predicted value of the first N pixels in the segment to be encoded is determined as a pre- Setting a value, and performing encoding processing on the remaining (TN) pixel points in the to-be-coded segment according to data of the first N pixel points, where T is a pixel point included in the to-be-coded segment Quantity, 1 ≤ N ≤ T;
    若所述待编码片段与所述图像的上边界相邻并且所述待编码片段与所述图像的左边界间隔分布,根据所述待编码片段的左侧数据,对所述待编码片段中的像素点进行编码处理;If the segment to be encoded is adjacent to an upper boundary of the image and the segment to be encoded is spaced apart from a left boundary of the image, according to the left side data of the segment to be encoded, in the segment to be encoded Pixel points are encoded;
    若所述待编码片段与所述图像的上边界间隔分布并且所述待编码片段与所述图像的左边界相邻,根据所述待编码片段的上侧数据,对所述待编码片段中的像素点进行编码处理。If the segment to be encoded is spaced apart from the upper boundary of the image and the segment to be encoded is adjacent to the left boundary of the image, according to the upper data of the segment to be encoded, in the segment to be encoded The pixel is encoded.
  13. 根据权利要求11所述的方法,其特征在于,所述方法还包括下列中的至少一种:The method of claim 11 wherein said method further comprises at least one of the following:
    若所述待编码片段与所述待编码片段所属矩形区域的上边界相邻并且所述待编码片段与所述待编码片段所属矩形区域的左边界相邻,将所述待编 码片段中的前N个像素点的预测值确定为预设数值,并且根据所述前N个像素点的数据,对所述待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为所述待编码片段中包括的像素点的数量,1≤N≤T;If the to-be-coded segment is adjacent to an upper boundary of a rectangular region to which the fragment to be encoded belongs, and the to-be-coded segment is adjacent to a left boundary of a rectangular region to which the fragment to be encoded belongs, the to-be-written The predicted values of the first N pixels in the code segment are determined as preset values, and the remaining (TN) pixels in the to-be-coded segment are encoded according to the data of the first N pixels. Where T is the number of pixel points included in the segment to be encoded, 1≤N≤T;
    若所述待编码片段与所述待编码片段所属矩形区域的上边界相邻并且所述待编码片段与所述待编码片段所属矩形区域的左边界间隔分布,根据所述待编码片段的左侧数据,对所述待编码片段中的像素点进行编码处理;If the to-be-coded segment is adjacent to an upper boundary of a rectangular region to which the fragment to be encoded belongs, and the to-be-coded segment is spaced apart from a left boundary of the rectangular region to which the fragment to be encoded belongs, according to the left side of the to-be-coded segment Data, encoding a pixel in the segment to be encoded;
    若所述待编码片段与所述待编码片段所属矩形区域的上边界间隔分布并且所述待编码片段与所述待编码片段所属矩形区域的左边界相邻,根据所述待编码片段的上侧数据,对所述待编码片段中的像素点进行编码处理。If the segment to be encoded is spaced apart from the upper boundary of the rectangular region to which the segment to be encoded belongs, and the segment to be encoded is adjacent to the left boundary of the rectangular region to which the segment to be encoded belongs, according to the upper side of the segment to be encoded Data, encoding the pixel points in the segment to be encoded.
  14. 根据权利要求11所述的方法,其特征在于,所述图像包括至少一个子图像,每个子图像包括至少一个矩形区域;The method of claim 11 wherein said image comprises at least one sub-image, each sub-image comprising at least one rectangular region;
    所述方法还包括下列中的一种:The method also includes one of the following:
    若所述待编码片段与所述待编码片段所属子图像的上边界相邻并且所述待编码片段与所述待编码片段所属子图像的左边界相邻,将所述待编码片段中的前N个像素点的预测值确定为预设数值,并且根据所述前N个像素点的数据,对所述待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为所述待编码片段中包括的像素点的数量,1≤N≤T;If the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the slice to be encoded belongs and the to-be-coded segment is adjacent to a left boundary of the sub-image to which the segment to be encoded belongs, the former in the segment to be encoded The predicted value of the N pixel points is determined as a preset value, and the remaining (TN) pixel points in the to-be-coded segment are encoded according to the data of the first N pixel points, where T is Describe the number of pixel points included in the encoded segment, 1≤N≤T;
    若所述待编码片段与所述待编码片段所属子图像的上边界相邻并且所述待编码片段与所述待编码片段所属子图像的左边界间隔分布,根据所述待编码片段的左侧数据,对所述待编码片段中的像素点进行编码处理;If the segment to be encoded is adjacent to an upper boundary of the sub-image to which the segment to be encoded belongs, and the segment to be encoded is spaced apart from the left boundary of the sub-image to which the segment to be encoded belongs, according to the left side of the segment to be encoded Data, encoding a pixel in the segment to be encoded;
    若所述待编码片段与所述待编码片段所属子图像的上边界间隔分布并且所述待编码片段与所述待编码片段所属子图像的左边界相邻,根据所述待编码片段的上侧数据,对所述待编码片段中的像素点进行编码处理;If the segment to be encoded is spaced apart from the upper boundary of the sub-image to which the segment to be encoded belongs and the segment to be encoded is adjacent to the left boundary of the sub-image to which the segment to be encoded belongs, according to the upper side of the segment to be encoded Data, encoding a pixel in the segment to be encoded;
    若所述待编码片段与所述待编码片段所属子图像的左边界相邻并且所述待编码片段与所述图像的上边界间隔分布,根据所述待编码片段的上侧数据,对所述待编码片段中的像素点进行编码处理;And if the to-be-coded segment is adjacent to a left boundary of the sub-image to which the segment to be encoded belongs and the segment to be encoded is spaced apart from an upper boundary of the image, according to the upper data of the segment to be encoded, Pixel points in the segment to be encoded are encoded;
    若所述待编码片段与所述待编码片段所属子图像的上边界相邻并且所述待编码片段与所述图像的左边界间隔分布,根据所述待编码片段的左侧数据,对所述待编码片段中的像素点进行编码处理。And if the to-be-coded segment is adjacent to an upper boundary of a sub-image to which the to-be-coded segment belongs and the to-be-coded segment is spaced apart from a left boundary of the image, according to the left side data of the to-be-coded segment, The pixel points in the segment to be encoded are subjected to encoding processing.
  15. 根据权利要求1至14中任一项所述的方法,其特征在于,所述待编码片段中的每M个相邻像素点对应于相同的参考像素点,其中,所述待 编码片段的参考数据包括所述参考像素点的数据,M≥1。The method according to any one of claims 1 to 14, wherein each M adjacent pixel points in the segment to be encoded corresponds to the same reference pixel point, wherein the waiting The reference data of the encoded segment includes data of the reference pixel, M≥1.
  16. 根据权利要求1至15中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 15, wherein the method further comprises:
    若所述待编码片段所属矩形区域当前已使用的编码比特数Bi小于或等于所述待编码片段所属矩形区域允许使用的编码比特数B,并且所述待编码片段中的当前待编码像素点需要使用的编码比特数bi+1与Bi之和大于B,向所述待编码片段的编码比特流添加结束码,所述结束码用于标识对所述待编码片段所属矩形区域的编码结束并且所述待编码片段所属矩形区域具有至少一个未编码的像素点。If the number of coded bits B i currently used by the rectangular area to which the slice to be encoded belongs is less than or equal to the number of coded bits B allowed for the rectangular area to which the slice to be encoded belongs, and the current pixel to be coded in the to-be-coded slice The sum of the number of coded bits b i+1 and B i to be used is greater than B, and an end code is added to the coded bit stream of the fragment to be encoded, the end code is used to identify the coding of the rectangular area to which the fragment to be encoded belongs Ending and the rectangular area to which the fragment to be encoded belongs has at least one uncoded pixel point.
  17. 一种解码方法,其特征在于,包括:A decoding method, comprising:
    获取图像的编码比特流中与待解码片段对应的第一标识符,其中,所述图像包括至少一个矩形区域,每个矩形区域包括至少一个片段,每个片段包括至少一个像素点,其中,长度相同的矩形区域对应的编码比特数少于或等于预设的编码比特数,所述图像的编码比特流包括与所述图像包括的至少一个片段中每个片段对应的第一标识符,每个片段对应的第一标识符用于标识所述每个片段的参考数据所在位置;Acquiring a first identifier in the encoded bitstream of the image corresponding to the segment to be decoded, wherein the image comprises at least one rectangular region, each rectangular region comprising at least one segment, each segment comprising at least one pixel, wherein the length The number of coded bits corresponding to the same rectangular area is less than or equal to a preset number of coded bits, and the coded bit stream of the image includes a first identifier corresponding to each of the at least one segment included in the image, each The first identifier corresponding to the segment is used to identify the location of the reference data of each segment;
    根据所述待编码片段对应的第一标识符,确定所述待解码片段的参考数据为所述待解码片段的上侧数据或左侧数据,其中,所述待解码片段的左侧数据包括位于所述待解码片段左侧的至少一个第一像素点的数据,所述待解码数据的上侧数据包括位于所述待解码片段上方的至少一个第二像素点的数据;Determining, according to the first identifier corresponding to the to-be-coded segment, the reference data of the to-be-decoded segment is the upper-side data or the left-side data of the to-be-decoded segment, where the left-side data of the to-be-decoded segment is included Data of at least one first pixel on the left side of the segment to be decoded, and data on the upper side of the data to be decoded includes data of at least one second pixel located above the segment to be decoded;
    根据所述待解码片段的参考数据,对所述待解码片段进行解码处理。Decoding the to-be-decoded segment according to the reference data of the to-be-decoded segment.
  18. 根据权利要求17所述的方法,其特征在于,下列中的至少一项满足:The method of claim 17 wherein at least one of the following is satisfied:
    所述至少一个第一像素点与所述待解码片段相邻或者与所述待解码片段临近但间隔分布;The at least one first pixel is adjacent to the segment to be decoded or adjacent to the segment to be decoded but spaced apart;
    所述至少一个第一像素点的数据包括所述至少一个第一像素点的原始数据或所述至少一个第一像素点的已解码数据;The data of the at least one first pixel includes the original data of the at least one first pixel or the decoded data of the at least one first pixel;
    所述至少一个第二像素点与所述待解码片段相邻或者与所述待解码片段临近但间隔分布;The at least one second pixel is adjacent to the segment to be decoded or adjacent to the segment to be decoded but spaced apart;
    所述至少一个第二像素点的数据包括所述至少一个第二像素点的原始 数据或所述至少一个第二像素点的已解码数据。The data of the at least one second pixel includes the original of the at least one second pixel Data or decoded data of the at least one second pixel.
  19. 根据权利要求17或18所述的方法,其特征在于,所述根据所述参考数据,对所述待解码片段进行解码处理,包括:The method according to claim 17 or 18, wherein the decoding the segment to be decoded according to the reference data comprises:
    对所述待解码片段进行熵解码处理,得到所述待解码片段的量化参数;Performing an entropy decoding process on the to-be-decoded segment to obtain a quantization parameter of the to-be-decoded segment;
    根据所述待解码片段的量化参数,对所述待解码片段进行反量化处理,得到所述待解码片段的残差数据;And performing inverse quantization processing on the to-be-decoded segment according to the quantization parameter of the to-be-decoded segment, to obtain residual data of the to-be-decoded segment;
    根据所述参考数据,对所述待解码片段的残差数据进行反预测处理,得到所述待解码片段的解码结果。And performing, according to the reference data, performing residual prediction processing on the residual data of the to-be-decoded segment to obtain a decoding result of the to-be-decoded segment.
  20. 根据权利要求17至19中任一项所述的方法,其特征在于,所述方法还包括下列中的至少一种:The method according to any one of claims 17 to 19, wherein the method further comprises at least one of the following:
    若所述待解码片段与所述图像的上边界相邻并且所述待解码片段与所述图像的左边界相邻,将所述待解码片段中的前N个像素点的残差值确定为预设数值,并且根据所述前N个像素点的数据,对所述待解码片段中的剩余的(T-N)个像素点进行解码处理,其中,T为所述待解码片段中包括的像素点的数量,1≤N≤T;If the segment to be decoded is adjacent to an upper boundary of the image and the segment to be decoded is adjacent to a left boundary of the image, determining a residual value of the first N pixels in the segment to be decoded is determined as Determining a numerical value, and performing decoding processing on the remaining (TN) pixel points in the to-be-decoded segment according to data of the first N pixel points, where T is a pixel point included in the to-be-decoded segment The number, 1 ≤ N ≤ T;
    若所述待解码片段与所述图像的上边界相邻并且所述待解码片段与所述图像的左边界间隔分布,根据所述待解码片段的左侧数据,对所述待解码片段中的像素点进行解码处理;If the segment to be decoded is adjacent to an upper boundary of the image and the segment to be decoded is spaced apart from a left boundary of the image, according to the left side data of the segment to be decoded, in the segment to be decoded The pixel is subjected to decoding processing;
    若所述待解码片段与所述图像的上边界间隔分布并且所述待解码片段与所述图像的左边界相邻,根据所述待解码片段的上侧数据,对所述待解码片段中的像素点进行解码处理。And if the to-be-decoded segment is spaced apart from an upper boundary of the image and the to-be-decoded segment is adjacent to a left boundary of the image, according to an upper side data of the to-be-decoded segment, in the to-be-decoded segment The pixel is subjected to decoding processing.
  21. 根据权利要求17至19中任一项所述的方法,其特征在于,所述方法还包括下列中的至少一种:The method according to any one of claims 17 to 19, wherein the method further comprises at least one of the following:
    若所述待解码片段与所述待解码片段所属矩形区域的上边界相邻并且所述待解码片段与所述待解码片段所属矩形区域的左边界相邻,将所述待解码片段中的前N个像素点的残差值确定为预设数值,并且根据所述前N个像素点的数据,对所述待解码片段中的剩余的(T-N)个像素点进行解码处理,其中,T为所述待解码片段中包括的像素点的数量,1≤N≤T;If the to-be-decoded segment is adjacent to an upper boundary of a rectangular region to which the segment to be decoded belongs and the to-be-decoded segment is adjacent to a left boundary of the rectangular region to which the segment to be decoded belongs, the former in the segment to be decoded The residual value of the N pixel points is determined as a preset value, and the remaining (TN) pixel points in the to-be-decoded segment are decoded according to the data of the first N pixel points, where T is The number of pixel points included in the segment to be decoded, 1≤N≤T;
    若所述待解码片段与所述待解码片段所属矩形区域的上边界相邻并且所述待解码片段与所述待解码片段所属矩形区域的左边界间隔分布,根据所述待解码片段的左侧数据,对所述待解码片段中的像素点进行解码处理; If the to-be-decoded segment is adjacent to an upper boundary of a rectangular region to which the segment to be decoded belongs, and the segment to be decoded is spaced apart from a left boundary of the rectangular region to which the segment to be decoded belongs, according to the left side of the segment to be decoded Data, performing decoding processing on the pixels in the segment to be decoded;
    若所述待解码片段与所述待解码片段所属矩形区域的上边界间隔分布并且所述待解码片段与所述待解码片段所属矩形区域的左边界相邻,根据所述待解码片段的上侧数据,对所述待解码片段中的像素点进行解码处理。If the segment to be decoded is spaced apart from the upper boundary of the rectangular region to which the segment to be decoded belongs, and the segment to be decoded is adjacent to the left boundary of the rectangular region to which the segment to be decoded belongs, according to the upper side of the segment to be decoded Data, performing decoding processing on the pixels in the segment to be decoded.
  22. 根据权利要求17至19中任一项所述的方法,其特征在于,所述图像包括至少一个子图像,每个子图像包括至少一个矩形区域;The method according to any one of claims 17 to 19, wherein the image comprises at least one sub-image, each sub-image comprising at least one rectangular area;
    所述方法还包括下列中的一种:The method also includes one of the following:
    若所述待解码片段与所述待解码片段所属子图像的上边界相邻并且所述待解码片段与所述待解码片段所属子图像的左边界相邻,将所述待解码片段中的前N个像素点的残差值确定为预设数值,并且根据所述前N个像素点的数据,对所述待解码片段中的剩余的(T-N)个像素点进行解码处理,其中,T为所述待解码片段中包括的像素点的数量,1≤N≤T;If the to-be-decoded segment is adjacent to an upper boundary of the sub-image to which the segment to be decoded belongs and the to-be-decoded segment is adjacent to a left boundary of the sub-image to which the segment to be decoded belongs, the former in the segment to be decoded The residual value of the N pixel points is determined as a preset value, and the remaining (TN) pixel points in the to-be-decoded segment are decoded according to the data of the first N pixel points, where T is The number of pixel points included in the segment to be decoded, 1≤N≤T;
    若所述待解码片段与所述待解码片段所属子图像的上边界相邻并且所述待解码片段与所述待解码片段所属子图像的左边界间隔分布,根据所述待解码片段的左侧数据,对所述待解码片段中的像素点进行解码处理;If the to-be-decoded segment is adjacent to an upper boundary of the sub-image to which the segment to be decoded belongs, and the to-be-decoded segment is spaced apart from a left boundary of the sub-image to which the segment to be decoded belongs, according to the left side of the segment to be decoded Data, performing decoding processing on the pixels in the segment to be decoded;
    若所述待解码片段与所述待解码片段所属子图像的上边界间隔分布并且所述待解码片段与所述待解码片段所属子图像的左边界相邻,根据所述待解码片段的上侧数据,对所述待解码片段中的像素点进行解码处理;If the segment to be decoded is spaced apart from the upper boundary of the sub-image to which the segment to be decoded belongs and the segment to be decoded is adjacent to the left boundary of the sub-image to which the segment to be decoded belongs, according to the upper side of the segment to be decoded Data, performing decoding processing on the pixels in the segment to be decoded;
    若所述待解码片段与所述待解码片段所属子图像的上边界和左边界相邻并且所述待解码片段与所述图像的上边界间隔分布,根据所述待解码片段的上侧数据,对所述待解码片段中的像素点进行解码处理;If the to-be-decoded segment is adjacent to an upper boundary and a left boundary of the sub-image to which the segment to be decoded belongs, and the segment to be decoded is spaced apart from an upper boundary of the image, according to the upper side data of the segment to be decoded, Decoding processing on pixel points in the to-be-decoded segment;
    若所述待解码片段与所述待解码片段所属子图像的上边界和左边界相邻并且所述待解码片段与所述图像的左边界间隔分布,根据所述待解码片段的左侧数据,对所述待解码片段中的像素点进行解码处理。If the to-be-decoded segment is adjacent to an upper boundary and a left boundary of the sub-image to which the segment to be decoded belongs, and the segment to be decoded is spaced apart from the left boundary of the image, according to the left-side data of the segment to be decoded, Decoding processing is performed on the pixel points in the segment to be decoded.
  23. 根据权利要求17至22中任一项所述的方法,其特征在于,所述待解码片段中的每M个相邻像素点对应于相同的参考像素点,其中,所述待解码片段的参考数据包括所述参考像素点的数据,M≥1。The method according to any one of claims 17 to 22, wherein each M adjacent pixel points in the to-be-decoded segment corresponds to the same reference pixel point, wherein the reference to the decoded segment The data includes data of the reference pixel, M ≥ 1.
  24. 一种编码装置,其特征在于,包括:An encoding device, comprising:
    预分析模块,用于根据图像的待编码片段中的数据,从所述待编码片段的左侧数据和上侧数据中,确定所述待编码片段的参考数据;a pre-analysis module, configured to determine, according to data in a segment to be encoded of the image, reference data of the segment to be encoded from the left side data and the upper side data of the to-be-coded segment;
    编码模块,用于根据所述预分析模块确定的所述参考数据,对所述待编码片段进行编码处理,得到所述待编码片段的编码比特流;其中, An encoding module, configured to perform encoding processing on the to-be-coded segment according to the reference data determined by the pre-analysis module, to obtain an encoded bitstream of the to-be-coded segment;
    所述图像包括至少一个矩形区域,每个矩形区域包括至少一个片段,每个片段包括至少一个像素点,并且长度相同的矩形区域对应的编码比特数少于或等于预设的比特数,The image includes at least one rectangular area, each rectangular area includes at least one segment, each segment includes at least one pixel, and the number of encoded bits corresponding to the rectangular area of the same length is less than or equal to a preset number of bits,
    所述待编码片段的左侧数据包括位于所述待编码片段左侧的至少一个第一像素点的数据,所述待编码数据的上侧数据包括位于所述待编码片段上方的至少一个第二像素点的数据。The data on the left side of the fragment to be encoded includes data of at least one first pixel located on the left side of the fragment to be encoded, and the upper side data of the data to be encoded includes at least one second located above the fragment to be encoded. Pixel data.
  25. 根据权利要求24所述的装置,其特征在于,下列中的至少一项成立:The apparatus of claim 24 wherein at least one of the following is true:
    所述至少一个第一像素点与所述待编码片段相邻或者与所述待编码片段临近但间隔分布;The at least one first pixel is adjacent to the segment to be encoded or adjacent to the segment to be encoded but spaced apart;
    所述至少一个第一像素点的数据包括所述至少一个第一像素点的原始数据或所述至少一个第一像素点的已编码数据;The data of the at least one first pixel includes the original data of the at least one first pixel or the encoded data of the at least one first pixel;
    所述至少一个第二像素点与所述待编码片段相邻或者与所述待编码片段临近但间隔分布;The at least one second pixel is adjacent to the fragment to be encoded or adjacent to the fragment to be encoded but spaced apart;
    所述至少一个第二像素点的数据包括所述至少一个第二像素点的原始数据或所述至少一个第二像素点的已编码数据。The data of the at least one second pixel includes raw data of the at least one second pixel or encoded data of the at least one second pixel.
  26. 根据权利要求24或25所述的装置,其特征在于,所述预分析模块具体用于:The device according to claim 24 or 25, wherein the pre-analysis module is specifically configured to:
    根据所述待编码片段中的数据和所述至少一个第一像素点的数据,确定所述待编码片段与所述待编码片段的左侧数据之间的相关度;Determining, according to the data in the to-be-coded segment and the data of the at least one first pixel, a correlation between the segment to be encoded and the left-side data of the segment to be encoded;
    根据所述待编码片段中的数据和所述至少一个第二像素点的数据,确定所述待编码片段与所述待编码片段的上侧数据之间的相关度;Determining, according to the data in the to-be-coded segment and the data of the at least one second pixel, a correlation between the to-be-coded segment and the upper-side data of the segment to be encoded;
    根据所述待编码片段与所述待编码片段的左侧数据之间的相关度以及所述待编码片段与所述待编码片段的上侧数据之间的相关度,从所述待编码片段的左侧数据和上侧数据中,确定所述待编码片段的参考数据。And according to the correlation between the to-be-coded segment and the left-side data of the to-be-coded segment, and the correlation between the to-be-coded segment and the upper-side data of the to-be-coded segment, from the segment to be encoded In the left side data and the upper side data, reference data of the fragment to be encoded is determined.
  27. 根据权利要求26所述的装置,其特征在于,所述预分析模块具体用于:The device according to claim 26, wherein the pre-analysis module is specifically configured to:
    将所述待编码片段的左侧数据和上侧数据中与所述待编码片段之间相关度较大的数据,确定为所述待编码片段的参考数据。And determining, by the left side data of the to-be-coded segment and the data of the upper side data that is highly correlated with the to-be-coded segment, as the reference data of the to-be-coded segment.
  28. 根据权利要求24至27中任一项所述的装置,其特征在于,所述编码模块还用于: The apparatus according to any one of claims 24 to 27, wherein the encoding module is further configured to:
    向所述待编码片段的编码比特流添加第一标识符,所述第一标识符用于指示所述待编码片段的参考数据所在位置。Adding a first identifier to the encoded bitstream of the fragment to be encoded, the first identifier being used to indicate a location of reference data of the fragment to be encoded.
  29. 根据权利要求24至28中任一项所述的装置,其特征在于,所述编码模块包括:The apparatus according to any one of claims 24 to 28, wherein the encoding module comprises:
    预测单元,用于根据所述参考数据,对所述待编码片段进行预测处理,得到所述待编码片段的预测残差;a prediction unit, configured to perform prediction processing on the to-be-coded segment according to the reference data, to obtain a prediction residual of the to-be-coded segment;
    量化单元,用于利用所述待编码片段的量化参数,对所述预测单元得到的所述待编码片段的预测残差进行量化处理,得到所述待编码片段的量化结果;And a quantization unit, configured to perform quantization processing on the prediction residual of the to-be-coded segment obtained by the prediction unit by using a quantization parameter of the to-be-coded segment, to obtain a quantization result of the to-be-coded segment;
    熵编码单元,用于对所述量化单元得到的所述待编码片段的量化结果进行熵编码处理,得到所述待编码片段的编码结果。And an entropy coding unit, configured to perform entropy coding processing on the quantization result of the to-be-encoded segment obtained by the quantization unit, to obtain an encoding result of the to-be-encoded segment.
  30. 根据权利要求29所述的装置,其特征在于,所述编码模块还包括:The apparatus according to claim 29, wherein the encoding module further comprises:
    速率控制单元,用于在所述量化单元利用所述待编码片段的量化参数,对所述待编码片段的预测结果进行量化处理之前,根据所述预分析模块确定的所述参考数据,确定所述待编码片段的量化参数;a rate control unit, configured to determine, according to the reference data determined by the pre-analysis module, before the quantization unit uses the quantization parameter of the to-be-encoded segment to perform quantization processing on the prediction result of the to-be-coded segment Determining the quantization parameter of the encoded segment;
    所述量化单元具体用于利用所述速率控制单元确定的量化参数,对所述待编码片段的预测结果进行量化处理。The quantization unit is specifically configured to perform quantization processing on the prediction result of the to-be-coded segment by using the quantization parameter determined by the rate control unit.
  31. 根据权利要求30所述的装置,其特征在于,所述速率控制单元具体用于:The device according to claim 30, wherein the rate control unit is specifically configured to:
    根据所述预分析模块确定的所述参考数据和所述待编码片段中的数据,确定所述待编码片段的复杂度;Determining, according to the reference data determined by the pre-analysis module and the data in the to-be-coded segment, the complexity of the segment to be encoded;
    根据所述待编码片段的复杂度,确定所述待编码片段的量化参数。Determining a quantization parameter of the segment to be encoded according to the complexity of the segment to be encoded.
  32. 根据权利要求31所述的装置,其特征在于,所述速率控制单元具体用于:The device according to claim 31, wherein the rate control unit is specifically configured to:
    根据所述参考数据和所述待编码片段中的数据,确定所述待编码片段中每个像素点的残差;Determining a residual of each pixel in the segment to be encoded according to the reference data and data in the segment to be encoded;
    根据所述待编码片段中每个像素点的残差,确定所述待编码片段的复杂度。Determining the complexity of the segment to be encoded according to the residual of each pixel in the segment to be encoded.
  33. 根据权利要求31或32所述的装置,其特征在于,所述速率控制单元具体用于:The device according to claim 31 or 32, wherein the rate control unit is specifically configured to:
    根据所述待编码片段所属矩形区域中的每个片段的复杂度,确定所述待 编码片段所属矩形区域的复杂度;Determining the waiting according to the complexity of each segment in the rectangular area to which the fragment to be encoded belongs The complexity of the rectangular region to which the encoded segment belongs;
    通过比较所述待编码片段的复杂度和所述待编码片段所属矩形区域的复杂度,确定所述待编码片段的量化参数。The quantization parameter of the segment to be encoded is determined by comparing the complexity of the segment to be encoded and the complexity of the rectangular region to which the segment to be encoded belongs.
  34. 根据权利要求24至33中任一项所述的装置,其特征在于,所述预分析模块具体用于:The apparatus according to any one of claims 24 to 33, wherein the pre-analysis module is specifically configured to:
    若所述待编码片段具有可用的左侧数据和可用的上侧数据,从所述待编码片段的可用的左侧数据和可用的上侧数据中,确定所述待编码片段的参考数据。If the to-be-coded segment has available left-side data and available upper-side data, the reference data of the segment to be encoded is determined from available left-side data of the segment to be encoded and available upper-side data.
  35. 根据权利要求34所述的装置,其特征在于,下列中的至少一种满足:The apparatus of claim 34 wherein at least one of the following satisfies:
    若所述待编码片段与所述图像的上边界相邻并且所述待编码片段与所述图像的左边界相邻,所述编码模块还用于将所述待编码片段中的前N个像素点的预测值确定为预设数值,并且根据所述前N个像素点的数据,对所述待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为所述待编码片段中包括的像素点的数量,1≤N≤T;If the segment to be encoded is adjacent to an upper boundary of the image and the segment to be encoded is adjacent to a left boundary of the image, the encoding module is further configured to use the first N pixels in the segment to be encoded The predicted value of the point is determined as a preset value, and the remaining (TN) pixel points in the to-be-coded segment are encoded according to the data of the first N pixel points, where T is the to-be-coded The number of pixels included in the segment, 1 ≤ N ≤ T;
    若所述待编码片段与所述图像的上边界相邻并且所述待编码片段与所述图像的左边界间隔分布,所述编码模块还用于根据所述待编码片段的左侧数据,对所述待编码片段中的像素点进行编码处理;And if the to-be-coded segment is adjacent to an upper boundary of the image, and the to-be-coded segment is spaced apart from a left boundary of the image, the coding module is further configured to: according to the left-side data of the to-be-coded segment, Pixel points in the to-be-coded segment are subjected to encoding processing;
    若所述待编码片段与所述图像的上边界间隔分布并且所述待编码片段与所述图像的左边界相邻,所述编码模块还用于根据所述待编码片段的上侧数据,对所述待编码片段中的像素点进行编码处理。And if the to-be-coded segment is spaced apart from an upper boundary of the image and the to-be-coded segment is adjacent to a left boundary of the image, the coding module is further configured to: according to the upper side data of the to-be-coded segment, The pixel points in the segment to be encoded are subjected to an encoding process.
  36. 根据权利要求34所述的装置,其特征在于,下列中的至少一种满足:The apparatus of claim 34 wherein at least one of the following satisfies:
    若所述待编码片段与所述待编码片段所属矩形区域的上边界相邻并且所述待编码片段与所述待编码片段所属矩形区域的左边界相邻,所述编码模块还用于将所述待编码片段中的前N个像素点的预测值确定为预设数值,并且根据所述前N个像素点的数据,所述编码模块还用于对所述待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为所述待编码片段中包括的像素点的数量,1≤N≤T;If the to-be-coded segment is adjacent to an upper boundary of a rectangular region to which the fragment to be encoded belongs, and the to-be-coded segment is adjacent to a left boundary of the rectangular region to which the fragment to be encoded belongs, the coding module is further used to Determining a predicted value of the first N pixel points in the encoded segment as a preset value, and according to the data of the first N pixel points, the encoding module is further configured to use the remaining one of the to-be-coded segments ( TN) pixel processing is performed, where T is the number of pixel points included in the segment to be encoded, 1≤N≤T;
    若所述待编码片段与所述待编码片段所属矩形区域的上边界相邻并且所述待编码片段与所述待编码片段所属矩形区域的左边界间隔分布,所述编 码模块还用于根据所述待编码片段的左侧数据,对所述待编码片段中的像素点进行编码处理;If the to-be-coded segment is adjacent to an upper boundary of a rectangular region to which the fragment to be encoded belongs, and the to-be-coded segment is spaced apart from a left boundary of the rectangular region to which the fragment to be encoded belongs, the The code module is further configured to perform coding processing on the pixel points in the to-be-coded segment according to the left side data of the to-be-coded segment;
    若所述待编码片段与所述待编码片段所属矩形区域的上边界间隔分布并且所述待编码片段与所述待编码片段所属矩形区域的左边界相邻,所述编码模块还用于根据所述待编码片段的上侧数据,对所述待编码片段中的像素点进行编码处理。If the segment to be encoded is spaced apart from the upper boundary of the rectangular region to which the segment to be encoded belongs, and the segment to be encoded is adjacent to the left boundary of the rectangular region to which the segment to be encoded belongs, the encoding module is further configured to The upper side data of the encoded fragment is described, and the pixel points in the to-be-coded fragment are encoded.
  37. 根据权利要求34所述的装置,其特征在于,所述图像包括至少一个子图像,每个子图像包括至少一个矩形区域;The apparatus according to claim 34, wherein said image comprises at least one sub-image, each sub-image comprising at least one rectangular area;
    下列中的一种满足:One of the following is satisfied:
    若所述待编码片段与所述待编码片段所属子图像的上边界相邻并且所述待编码片段与所述待编码片段所属子图像的左边界相邻,所述编码模块还用于将所述待编码片段中的前N个像素点的预测值确定为预设数值,并且根据所述前N个像素点的数据,对所述待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为所述待编码片段中包括的像素点的数量,1≤N≤T;And if the to-be-coded segment is adjacent to an upper boundary of a sub-image to which the to-be-coded segment belongs and the to-be-coded segment is adjacent to a left boundary of the sub-image to which the to-be-coded segment belongs, the coding module is further configured to: Determining the predicted values of the first N pixels in the encoded segment as a preset value, and encoding the remaining (TN) pixels in the to-be-coded segment according to the data of the first N pixels Processing, wherein T is the number of pixel points included in the segment to be encoded, 1≤N≤T;
    若所述待编码片段与所述待编码片段所属子图像的上边界相邻并且所述待编码片段与所述待编码片段所属子图像的左边界间隔分布,所述编码模块还用于根据所述待编码片段的左侧数据,对所述待编码片段中的像素点进行编码处理;If the to-be-coded segment is adjacent to an upper boundary of the sub-image to which the fragment to be encoded belongs, and the to-be-coded segment is spaced apart from the left boundary of the sub-image to which the fragment to be encoded belongs, the encoding module is further configured to Decoding the left side data of the encoded segment, and performing encoding processing on the pixel points in the to-be-coded segment;
    若所述待编码片段与所述待编码片段所属子图像的上边界间隔分布并且所述待编码片段与所述待编码片段所属子图像的左边界相邻,所述编码模块还用于根据所述待编码片段的上侧数据,对所述待编码片段中的像素点进行编码处理;If the segment to be encoded is spaced apart from the upper boundary of the sub-image to which the segment to be encoded belongs and the segment to be encoded is adjacent to the left boundary of the sub-image to which the segment to be encoded belongs, the encoding module is further configured to Determining the upper side data of the encoded segment, and performing encoding processing on the pixel points in the to-be-coded segment;
    若所述待编码片段与所述待编码片段所属子图像的左边界相邻并且所述待编码片段与所述图像的上边界间隔分布,所述编码模块还用于根据所述待编码片段的上侧数据,对所述待编码片段中的像素点进行编码处理;And if the to-be-coded segment is adjacent to a left boundary of the sub-image to which the to-be-coded segment belongs, and the to-be-coded segment is spaced apart from an upper boundary of the image, the coding module is further configured to be used according to the to-be-coded segment. Upper side data, performing coding processing on the pixel points in the to-be-coded segment;
    若所述待编码片段与所述待编码片段所属子图像的上边界相邻并且所述待编码片段与所述图像的左边界间隔分布,所述编码模块还用于根据所述待编码片段的左侧数据,对所述待编码片段中的像素点进行编码处理。And if the to-be-coded segment is adjacent to an upper boundary of a sub-image to which the to-be-coded segment belongs and the to-be-coded segment is spaced apart from a left boundary of the image, the coding module is further configured to: according to the to-be-coded segment The data on the left side performs encoding processing on the pixel points in the segment to be encoded.
  38. 根据权利要求24至37中任一项所述的装置,其特征在于,所述待编码片段中的每M个相邻像素点对应于相同的参考像素点,其中,所述待 编码片段的参考数据包括所述参考像素点的数据,M≥1。The apparatus according to any one of claims 24 to 37, wherein each of the M adjacent pixel points in the segment to be encoded corresponds to the same reference pixel point, wherein the waiting The reference data of the encoded segment includes data of the reference pixel, M≥1.
  39. 根据权利要求24至38中任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 24 to 38, wherein the device further comprises:
    边界处理模块,用于若所述待编码片段所属矩形区域当前已使用的编码比特数Bi小于或等于所述待编码片段所属矩形区域允许使用的编码比特数B,并且所述待编码片段中的当前待编码像素点需要使用的编码比特数bi+1与Bi之和大于B,向所述待编码片段的编码比特流添加结束码,所述结束码用于标识对所述待编码片段所属矩形区域的编码结束并且所述待编码片段所属矩形区域具有至少一个未编码的像素点。a boundary processing module, configured to: if the number of coded bits B i currently used by the rectangular area to which the fragment to be encoded belongs is less than or equal to the number of coded bits B allowed for the rectangular area to which the fragment to be encoded belongs, and in the fragment to be encoded The sum of the number of coded bits b i+1 and B i to be used by the current pixel to be coded is greater than B, and an end code is added to the coded bit stream of the segment to be encoded, the end code is used to identify the to-be-coded The encoding of the rectangular region to which the segment belongs ends and the rectangular region to which the segment to be encoded belongs has at least one uncoded pixel.
  40. 一种解码装置,其特征在于,包括:A decoding device, comprising:
    获取模块,用于获取图像的编码比特流中与待解码片段对应的第一标识符,其中,所述图像包括至少一个矩形区域,每个矩形区域包括至少一个片段,每个片段包括至少一个像素点,其中,长度相同的矩形区域对应的编码比特数少于或等于预设的比特数,所述图像的编码比特流包括与所述图像包括的至少一个片段中每个片段对应的第一标识符,每个片段对应的第一标识符用于标识所述每个片段的参考数据所在位置;And an obtaining module, configured to acquire a first identifier corresponding to the to-be-decoded segment in the encoded bitstream of the image, where the image includes at least one rectangular region, each rectangular region includes at least one segment, and each segment includes at least one pixel a point, wherein the number of coded bits corresponding to the rectangular area having the same length is less than or equal to a preset number of bits, and the coded bit stream of the image includes a first identifier corresponding to each of the at least one segment included in the image a first identifier corresponding to each segment for identifying a location of the reference data of each segment;
    确定模块,用于根据所述获取模块获取的所述待编码片段对应的第一标识符,确定所述待解码片段的参考数据为所述待解码片段的上侧数据或左侧数据,其中,所述待解码片段的左侧数据包括位于所述待解码片段左侧的至少一个第一像素点的数据,所述待解码数据的上侧数据包括位于所述待解码片段上方的至少一个第二像素点的数据;a determining module, configured to determine, according to the first identifier corresponding to the to-be-coded segment that is obtained by the acquiring module, that the reference data of the to-be-decoded segment is the upper-side data or the left-side data of the to-be-decoded segment, where The left side data of the to-be-decoded segment includes data of at least one first pixel point located to the left of the fragment to be decoded, and the upper side data of the to-be-decoded data includes at least one second located above the to-be-decoded segment. Pixel point data;
    解码模块,用于根据所述确定模块确定的所述待解码片段的参考数据,对所述待解码片段进行解码处理。And a decoding module, configured to perform decoding processing on the to-be-decoded segment according to the reference data of the to-be-decoded segment determined by the determining module.
  41. 根据权利要求40所述的装置,其特征在于,下列中的至少一项满足:The apparatus according to claim 40, wherein at least one of the following satisfies:
    所述至少一个第一像素点与所述待解码片段相邻或者与所述待解码片段临近但间隔分布;The at least one first pixel is adjacent to the segment to be decoded or adjacent to the segment to be decoded but spaced apart;
    所述至少一个第一像素点的数据包括所述至少一个第一像素点的原始数据或所述至少一个第一像素点的已解码数据;The data of the at least one first pixel includes the original data of the at least one first pixel or the decoded data of the at least one first pixel;
    所述至少一个第二像素点与所述待解码片段相邻或者与所述待解码片段临近但间隔分布; The at least one second pixel is adjacent to the segment to be decoded or adjacent to the segment to be decoded but spaced apart;
    所述至少一个第二像素点的数据包括所述至少一个第二像素点的原始数据或所述至少一个第二像素点的已解码数据。The data of the at least one second pixel includes raw data of the at least one second pixel or decoded data of the at least one second pixel.
  42. 根据权利要求40或41所述的装置,其特征在于,所述解码模块包括:The apparatus according to claim 40 or 41, wherein the decoding module comprises:
    熵解码单元,用于对所述待解码片段进行熵解码处理,得到所述待解码片段的量化参数;An entropy decoding unit, configured to perform entropy decoding processing on the to-be-decoded segment, to obtain a quantization parameter of the to-be-decoded segment;
    反量化单元,用于根据所述熵解码单元得到的所述待解码片段的量化参数,对所述待解码片段进行反量化处理,得到所述待解码片段的残差数据;An inverse quantization unit, configured to perform inverse quantization processing on the to-be-decoded segment according to the quantization parameter of the to-be-decoded segment obtained by the entropy decoding unit, to obtain residual data of the to-be-decoded segment;
    反预测单元,用于根据所述确定模块确定的所述参考数据,对所述反量化单元得到的所述待解码片段的残差数据进行反预测处理,得到所述待解码片段的解码结果。The anti-prediction unit is configured to perform inverse prediction processing on the residual data of the to-be-decoded segment obtained by the inverse quantization unit according to the reference data determined by the determining module, to obtain a decoding result of the to-be-decoded segment.
  43. 根据权利要求40至42中任一项所述的装置,其特征在于,下列中的至少一种满足:A device according to any one of claims 40 to 42, wherein at least one of the following satisfies:
    若所述待解码片段与所述图像的上边界相邻并且所述待解码片段与所述图像的左边界相邻,所述解码模块还用于将所述待解码片段中的前N个像素点的残差值确定为预设数值,并且根据所述前N个像素点的数据,对所述待解码片段中的剩余的(T-N)个像素点进行解码处理,其中,T为所述待解码片段中包括的像素点的数量,1≤N≤T;And if the to-be-decoded segment is adjacent to an upper boundary of the image and the to-be-decoded segment is adjacent to a left boundary of the image, the decoding module is further configured to use the first N pixels in the to-be-decoded segment The residual value of the point is determined as a preset value, and according to the data of the first N pixel points, the remaining (TN) pixel points in the to-be-decoded segment are subjected to decoding processing, where T is the to-be-decoded The number of pixels included in the decoded segment, 1 ≤ N ≤ T;
    若所述待解码片段与所述图像的上边界相邻并且所述待解码片段与所述图像的左边界间隔分布,所述解码模块还用于根据所述待解码片段的左侧数据,对所述待解码片段中的像素点进行解码处理;And if the to-be-decoded segment is adjacent to an upper boundary of the image, and the to-be-decoded segment is spaced apart from a left boundary of the image, the decoding module is further configured to: according to the left-side data of the to-be-decoded segment, Decoding a pixel in the segment to be decoded;
    若所述待解码片段与所述图像的上边界间隔分布并且所述待解码片段与所述图像的左边界相邻,所述解码模块还用于根据所述待解码片段的上侧数据,对所述待解码片段中的像素点进行解码处理。And if the to-be-decoded segment is spaced apart from an upper boundary of the image and the to-be-decoded segment is adjacent to a left boundary of the image, the decoding module is further configured to: according to the upper side data of the to-be-decoded segment, The pixel points in the segment to be decoded are subjected to decoding processing.
  44. 根据权利要求40至42中任一项所述的装置,其特征在于,下列中的至少一种满足:A device according to any one of claims 40 to 42, wherein at least one of the following satisfies:
    若所述待解码片段与所述待解码片段所属矩形区域的上边界相邻并且所述待解码片段与所述待解码片段所属矩形区域的左边界相邻,所述解码模块还用于将所述待解码片段中的前N个像素点的残差值确定为预设数值,并且根据所述前N个像素点的数据,对所述待解码片段中的剩余的(T-N)个像素点进行解码处理,其中,T为所述待解码片段中包括的像素点的数量, 1≤N≤T;And if the to-be-decoded segment is adjacent to an upper boundary of a rectangular area to which the to-be-decoded segment belongs and the to-be-decoded segment is adjacent to a left boundary of a rectangular area to which the to-be-decoded segment belongs, the decoding module is further configured to: Determining a residual value of the first N pixel points in the decoded segment as a preset value, and performing, on the basis of the data of the first N pixel points, the remaining (TN) pixel points in the to-be-decoded segment Decoding processing, where T is the number of pixel points included in the segment to be decoded, 1≤N≤T;
    若所述待解码片段与所述待解码片段所属矩形区域的上边界相邻并且所述待解码片段与所述待解码片段所属矩形区域的左边界间隔分布,所述解码模块还用于根据所述待解码片段的左侧数据,对所述待解码片段中的像素点进行解码处理;And if the to-be-decoded segment is adjacent to an upper boundary of a rectangular region to which the fragment to be decoded belongs, and the to-be-decoded segment is spaced apart from a left boundary of the rectangular region to which the segment to be decoded belongs, the decoding module is further configured to Decoding the left side data of the decoded segment, and performing decoding processing on the pixel points in the to-be-decoded segment;
    若所述待解码片段与所述待解码片段所属矩形区域的上边界间隔分布并且所述待解码片段与所述待解码片段所属矩形区域的左边界相邻,所述解码模块还用于根据所述待解码片段的上侧数据,对所述待解码片段中的像素点进行解码处理。And if the to-be-decoded segment is spaced apart from an upper boundary of a rectangular region to which the segment to be decoded belongs, and the to-be-decoded segment is adjacent to a left boundary of the rectangular region to which the segment to be decoded belongs, the decoding module is further configured to perform The upper side data of the decoded segment is referred to, and the pixel points in the to-be-decoded segment are subjected to decoding processing.
  45. 根据权利要求40至42中任一项所述的装置,其特征在于,所述图像包括至少一个子图像,每个子图像包括至少一个矩形区域;The apparatus according to any one of claims 40 to 42, wherein the image comprises at least one sub-image, each sub-image comprising at least one rectangular area;
    下列中的一种满足:One of the following is satisfied:
    若所述待解码片段与所述待解码片段所属子图像的上边界相邻并且所述待解码片段与所述待解码片段所属子图像的左边界相邻,所述解码模块还用于将所述待解码片段中的前N个像素点的残差值确定为预设数值,并且根据所述前N个像素点的数据,对所述待解码片段中的剩余的(T-N)个像素点进行解码处理,其中,T为所述待解码片段中包括的像素点的数量,1≤N≤T;And if the to-be-decoded segment is adjacent to an upper boundary of a sub-image to which the to-be-decoded segment belongs and the to-be-decoded segment is adjacent to a left boundary of the sub-image to which the to-be-decoded segment belongs, the decoding module is further configured to: Determining a residual value of the first N pixel points in the decoded segment as a preset value, and performing, on the basis of the data of the first N pixel points, the remaining (TN) pixel points in the to-be-decoded segment Decoding processing, where T is the number of pixel points included in the segment to be decoded, 1 ≤ N ≤ T;
    若所述待解码片段与所述待解码片段所属子图像的上边界相邻并且所述待解码片段与所述待解码片段所属子图像的左边界间隔分布,所述解码模块还用于根据所述待解码片段的左侧数据,对所述待解码片段中的像素点进行解码处理;And if the to-be-decoded segment is adjacent to an upper boundary of the sub-image to which the segment to be decoded belongs, and the to-be-decoded segment is spaced apart from a left boundary of the sub-image to which the segment to be decoded belongs, the decoding module is further configured to Decoding the left side data of the decoded segment, and performing decoding processing on the pixel points in the to-be-decoded segment;
    若所述待解码片段与所述待解码片段所属子图像的上边界间隔分布并且所述待解码片段与所述待解码片段所属子图像的左边界相邻,所述解码模块还用于根据所述待解码片段的上侧数据,对所述待解码片段中的像素点进行解码处理;And if the to-be-decoded segment is spaced apart from an upper boundary of the sub-image to which the segment to be decoded belongs, and the to-be-decoded segment is adjacent to a left boundary of the sub-image to which the segment to be decoded belongs, the decoding module is further configured to perform Determining the upper side data of the decoded segment, and performing decoding processing on the pixel points in the to-be-decoded segment;
    若所述待解码片段与所述待解码片段所属子图像的上边界和左边界相邻并且所述待解码片段与所述图像的上边界间隔分布,所述解码模块还用于根据所述待解码片段的上侧数据,对所述待解码片段中的像素点进行解码处理;And if the to-be-decoded segment is adjacent to an upper boundary and a left boundary of the sub-image to which the to-be-decoded segment belongs, and the to-be-decoded segment is spaced apart from an upper boundary of the image, the decoding module is further configured to: Decoding the upper side data of the segment, and performing decoding processing on the pixel points in the to-be-decoded segment;
    若所述待解码片段与所述待解码片段所属子图像的上边界和左边界相 邻并且所述待解码片段与所述图像的左边界间隔分布,所述解码模块还用于根据所述待解码片段的左侧数据,对所述待解码片段中的像素点进行解码处理。If the segment to be decoded and the upper boundary and the left boundary of the sub-image to which the segment to be decoded belongs The neighboring and the to-be-decoded segments are spaced apart from the left boundary of the image, and the decoding module is further configured to perform decoding processing on the pixel points in the to-be-decoded segment according to the left-side data of the to-be-decoded segment.
  46. 根据权利要求40至45中任一项所述的装置,其特征在于,所述待解码片段中的每M个相邻像素点对应于相同的参考像素点,其中,所述待解码片段的参考数据包括所述参考像素点的数据,M≥1。 The apparatus according to any one of claims 40 to 45, wherein each M adjacent pixel points in the to-be-decoded segment correspond to the same reference pixel point, wherein the reference of the fragment to be decoded The data includes data of the reference pixel, M ≥ 1.
PCT/CN2017/099892 2017-08-31 2017-08-31 Encoding method, decoding method, encoding apparatus and decoding apparatus WO2019041219A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201780004672.1A CN108476320A (en) 2017-08-31 2017-08-31 Coding method, coding/decoding method and encoding apparatus and decoding apparatus
PCT/CN2017/099892 WO2019041219A1 (en) 2017-08-31 2017-08-31 Encoding method, decoding method, encoding apparatus and decoding apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/099892 WO2019041219A1 (en) 2017-08-31 2017-08-31 Encoding method, decoding method, encoding apparatus and decoding apparatus

Publications (1)

Publication Number Publication Date
WO2019041219A1 true WO2019041219A1 (en) 2019-03-07

Family

ID=63266560

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/099892 WO2019041219A1 (en) 2017-08-31 2017-08-31 Encoding method, decoding method, encoding apparatus and decoding apparatus

Country Status (2)

Country Link
CN (1) CN108476320A (en)
WO (1) WO2019041219A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019041222A1 (en) * 2017-08-31 2019-03-07 深圳市大疆创新科技有限公司 Encoding method, decoding method, encoding apparatus and decoding apparatus
CN110417811B (en) * 2019-08-22 2021-08-10 上海兆芯集成电路有限公司 Method and device for bit stream coding compression

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102970526A (en) * 2011-08-31 2013-03-13 华为技术有限公司 Method and module for acquiring transformation block size
WO2016182316A1 (en) * 2015-05-12 2016-11-17 삼성전자 주식회사 Image decoding method for performing intra prediction and device thereof, and image encoding method for performing intra prediction and device thereof
CN106576166A (en) * 2014-08-12 2017-04-19 奥兰治 Image encoding and decoding method, image encoding and decoding device, and corresponding computer programs
CN107077113A (en) * 2014-10-27 2017-08-18 深圳市大疆创新科技有限公司 Unmanned vehicle flight display

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6895119B2 (en) * 2002-03-14 2005-05-17 Winbond Electronics Corp. Method and apparatus for decoding compressed image data and capable of preventing error propagation
KR101099884B1 (en) * 2004-04-23 2011-12-28 히또시 기야 Moving picture data encoding method, decoding method, terminal device for executing them, and bi-directional interactive system
JP2010288070A (en) * 2009-06-11 2010-12-24 Hitachi Kokusai Electric Inc Image coding apparatus
KR101712351B1 (en) * 2009-06-26 2017-03-06 에스케이 텔레콤주식회사 Video Encoding/Decoding Method and Apparatus by Using Multiple Dimensional Integer Transform
CN107071450B (en) * 2016-02-10 2021-07-27 同济大学 Coding and decoding method and device for data compression

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102970526A (en) * 2011-08-31 2013-03-13 华为技术有限公司 Method and module for acquiring transformation block size
CN106576166A (en) * 2014-08-12 2017-04-19 奥兰治 Image encoding and decoding method, image encoding and decoding device, and corresponding computer programs
CN107077113A (en) * 2014-10-27 2017-08-18 深圳市大疆创新科技有限公司 Unmanned vehicle flight display
WO2016182316A1 (en) * 2015-05-12 2016-11-17 삼성전자 주식회사 Image decoding method for performing intra prediction and device thereof, and image encoding method for performing intra prediction and device thereof

Also Published As

Publication number Publication date
CN108476320A (en) 2018-08-31

Similar Documents

Publication Publication Date Title
US11049283B2 (en) Lossless compression of fragmented image data
WO2016045565A1 (en) Method and apparatus for coding and decoding video data
JP2014525183A (en) Method and apparatus for image compression storing encoding parameters in a 2D matrix
WO2007056657A2 (en) Extended amplitude coding for clustered transform coefficients
CN117998085A (en) Video coding method, device and storage medium
KR102123620B1 (en) Method and apparatus for entropy encoding or entropy decoding of video signals for large-scale parallel processing
WO2019041219A1 (en) Encoding method, decoding method, encoding apparatus and decoding apparatus
CN110418138B (en) Video processing method and device, electronic equipment and storage medium
AU2019201683A1 (en) Techniques for high efficiency entropy coding of video data
Weißenberger et al. Accelerating jpeg decompression on gpus
WO2011143585A1 (en) Parallel processing of sequentially dependent digital data
US20200145676A1 (en) Encoding method, decoding method, encoding apparatus and decoding apparatus
US7492956B2 (en) Video coding using multi-dimensional amplitude coding and 2-D non-zero/zero cluster position coding
WO2020061784A1 (en) Encoding method, decoding method, encoding device and decoding device
CN113454995A (en) Compression across multiple images
WO2021197158A1 (en) Image processing method and image processing device
TWI829424B (en) Decoding method, encoding method and apparatus
TWI832661B (en) Methods, devices and storage media for image coding or decoding
WO2023185806A9 (en) Image coding method and apparatus, image decoding method and apparatus, and electronic device and storage medium
US9549193B2 (en) Video encoding method and video encoding device
WO2022037478A1 (en) Video decoding method, video encoding method, apparatus, medium, and electronic device
Petersson et al. Improving image quality by SSIM based increase of run-length zeros in GPGPU JPEG encoding
CN117640966A (en) Image processing method, device, equipment and storage medium
CN115398923A (en) Coefficient coding and decoding for supporting different color formats in video coding and decoding
JP2022524916A (en) Shape-adaptive discrete cosine transform for geometric division with adaptive number regions

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17922975

Country of ref document: EP

Kind code of ref document: A1