WO2019041222A1 - 编码方法、解码方法以及编码装置和解码装置 - Google Patents

编码方法、解码方法以及编码装置和解码装置 Download PDF

Info

Publication number
WO2019041222A1
WO2019041222A1 PCT/CN2017/099898 CN2017099898W WO2019041222A1 WO 2019041222 A1 WO2019041222 A1 WO 2019041222A1 CN 2017099898 W CN2017099898 W CN 2017099898W WO 2019041222 A1 WO2019041222 A1 WO 2019041222A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
encoded
segment
data
pixel point
Prior art date
Application number
PCT/CN2017/099898
Other languages
English (en)
French (fr)
Inventor
郑萧桢
余良
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN201780004573.3A priority Critical patent/CN108521871B/zh
Priority to PCT/CN2017/099898 priority patent/WO2019041222A1/zh
Publication of WO2019041222A1 publication Critical patent/WO2019041222A1/zh
Priority to US16/734,767 priority patent/US20200145676A1/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/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/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/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/152Data rate or code amount at the encoder output by measuring the fullness of the transmission buffer
    • 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/167Position within a video image, e.g. region of interest [ROI]
    • 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/184Methods 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 bits, e.g. of the compressed video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/587Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal sub-sampling or interpolation, e.g. decimation or subsequent interpolation of pictures in a video sequence
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

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.
  • a typical video compression processing technique can be classified into two types: fixed length coding and adaptive length coding.
  • the coding type there may be an upper limit on the number of coding bits allowed in a plurality of pixel points in the image. It may happen that the number of coded bits currently used by the plurality of pixels has reached the maximum number of coded bits allowed for the plurality of pixels, and there are still uncoded pixels in the plurality of pixels, thus requiring The boundary of the plurality of pixel points is processed, and no related art has been able to solve such a problem.
  • the present application provides an encoding method, a decoding method, and an encoding device and a decoding device, which can improve encoding quality.
  • an encoding method comprising: encoding a pixel in a first rectangular region of an image; and using a total number of encoded bits of the first i encoded pixel in the first rectangular region Bi is less than or equal to the maximum allowable use coded bit number Bmax of the first rectangular area, and the sum of the coded bit numbers bi+1 and Bi to be used for the i+1th pixel point in the first rectangular area is greater than Bmax, according to Encoding data of at least one encoded pixel in the image, determining encoded data of at least one uncoded pixel in the first rectangular region, wherein the at least one uncoded pixel includes the (i+1)th pixel, 1 ⁇ i ⁇ T-1, where T is the total number of pixels included in the first rectangular area; adding a first identifier to the encoded bit stream of the first rectangular area, the first An identifier is used to identify the end of encoding of the first rectangular region and the first rectangular region has at least one uncoded pixel
  • the image may comprise at least one rectangular area, each rectangular area 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.
  • Bmax may represent the maximum number of coded bits allowed for the first rectangular area.
  • determining, according to the encoded data of the encoded pixel points in the image, the encoded data of the at least one uncoded pixel in the first rectangular region including: from at least one of the encoded pixels in the image, Determining a reference pixel point of each of the at least one uncoded pixel; determining encoded data (or referred to as encoded data) of each of the at least one uncoded pixel as the each pixel
  • encoded data of the reference pixel or called encoded data
  • a reference pixel point of each of the at least one uncoded pixel points is located on a left side or an upper side of the each pixel point.
  • the reference pixel point of each pixel of the at least one uncoded pixel point is located in the same rectangular area or a different rectangular area as the each pixel point.
  • determining, from the at least one encoded pixel in the image, determining a reference pixel of each pixel of the at least one uncoded pixel comprising: dividing the at least one uncoded pixel into N groups of pixels a point, each set of pixels includes at least one of the at least one uncoded pixel, N being an integer greater than or equal to 1; from the at least one encoded pixel in the image, determining the set of pixels The reference pixel of the jth group of pixels, 1 ⁇ j ⁇ N.
  • determining, from the at least one encoded pixel in the image, determining a reference pixel point of the jth group of the N groups of pixel points including: according to the original data of the jth group of pixel points, The reference pixel points of the jth group of pixel points are determined from the first encoded pixel point on the left side of the jth group pixel point and the at least one second coded pixel point on the upper side of the jth group pixel point.
  • the first coded pixel point from the left side of the jth group of pixel points and the at least one second coded pixel point on the upper side of the jth group of pixel points according to the original data of the jth group of pixel points Determining a reference pixel point of the jth group of pixels includes: determining, according to original data of each pixel point of the jth group of pixels, a correlation between the each pixel point and the first encoded pixel point Degree; determining each pixel point and the original data according to the original data of each pixel point of the j-th group of pixels Correlation between second encoded pixel points on the upper side of each pixel; correlation between each pixel of the jth group of pixels and the first encoded pixel and the jth pixel a correlation between each pixel in the point and a second encoded pixel on the upper side of each pixel, determining the first encoded pixel or the at least one second encoded pixel as the jth
  • the first encoded pixel point is specifically the last encoded pixel point of the first i encoded pixel points, or the first encoded pixel point and the last encoded pixel point At least one pixel is spaced apart.
  • each of the jth group of pixels is adjacent to or spaced apart from the second encoded pixel located on the upper side of the pixel.
  • the method further includes: adding a second identifier to the encoded bit stream of the first rectangular area, the second identifier being used to indicate a location of the reference pixel point of the jth group of pixel points.
  • dividing the at least one uncoded pixel into N sets of pixels includes: dividing the at least one uncoded pixel into N sets of pixels according to the number of the at least one uncoded pixel, where The number of uncoded pixels included in the first N-1 group of pixels in the N group of pixels is the same.
  • N is equal to two.
  • dividing the at least one uncoded pixel into two sets of pixels includes: determining the first P pixels in the at least one uncoded pixel as the first set of pixels, wherein, P a preset value greater than or equal to 1; determining, among the at least one uncoded pixel, the remaining uncoded pixel points other than the first set of pixel points as the second set of pixel points.
  • the jth group of pixel points is specifically the first group of pixel points.
  • determining, from the at least one encoded pixel in the image, the reference pixel point of each uncoded pixel in the at least one uncoded pixel further comprising: according to the second group of pixels The original data of each pixel in the point, from the encoded pixel point on the left side of the pixel point and the encoded pixel point on the upper side of the pixel point, the reference pixel point of each pixel point is determined.
  • the method further includes: adding at least one third identifier to the encoded bitstream of the first rectangular region, the at least one third identifier corresponding to at least one of the first set of pixels, and Each of the at least one of the third identifiers is used to indicate a location of a reference pixel point of the corresponding pixel.
  • performing encoding processing on the pixel points in the first rectangular area of the image including: determining reference data of the to-be-coded segment in the first rectangular area; and according to the reference data, the The coding segment is subjected to prediction processing to obtain a prediction residual of the to-be-coded segment; and the prediction result of the to-be-coded segment is quantized by using the quantization parameter of the to-be-coded segment to obtain a quantized result of the to-be-coded segment; The quantized result of the segment is subjected to entropy coding processing to obtain a coding result of the segment to be encoded.
  • the determining the reference data of the to-be-coded segment in the first rectangular area includes: determining, according to the data in the to-be-coded segment, the to-be-coded data from the left side data and the upper side data of the to-be-coded segment
  • 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 number according to the fragment to be encoded And determining, according to the data in the to-be-coded segment and the data of the at least one first pixel, determining the to-be-determined data from the left-side data and the upper-side data of the to-be-coded segment.
  • 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 fourth identifier to the encoded bit stream of the to-be-coded segment, The fourth 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 pair of segments in the image At least one fourth identifier, each of which may be used to identify the reference data of the corresponding segment or the location of the reference pixel.
  • the fourth identifier may be used to identify that the reference pixel of the segment corresponding to the fourth identifier is located on the left or upper side of the segment.
  • the encoding, by the reference data, the encoding process including: according to the reference data And performing prediction processing on the to-be-coded segment to obtain a prediction residual of the to-be-coded segment; using the quantization parameter of the to-be-coded segment, performing quantization processing on the prediction residual of the to-be-coded segment to obtain a quantized result of the to-be-coded segment And performing entropy coding processing on the quantized result of the fragment to be encoded to obtain a coding 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 includes: if the to-be-coded segment has available left-side data and available upper-side data, determining from available left-side data of the to-be-coded segment and available upper-side data Reference data of the segment to be encoded.
  • 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 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.
  • 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 pixel points in the segment to be encoded are encoded.
  • 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 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 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 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 can be determined according to whether the segment to be encoded is located at a left boundary of the sub-image to which it belongs.
  • 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 image.
  • 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.
  • 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
  • the number of coded bits B that is allowed to be used in the rectangular area to which the fragment to be encoded belongs is less than or equal to, 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, to be encoded.
  • the encoded bitstream of the segment adds an end code for identifying the end of encoding of the rectangular region to which the segment to be encoded belongs and the rectangular region to which the segment 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 decoding method comprising: decoding a first rectangular region in the image according to an encoded bitstream of the image, wherein the image includes at least one rectangular region, each rectangular region including at least one a pixel; if the encoded bitstream includes a first identifier, determining decoded data of at least one undecoded pixel in the first rectangular region according to decoded data of at least one decoded pixel in the image, wherein the first An identifier is used to identify the end of encoding of the first rectangular region and having at least one uncoded pixel in the first rectangular region.
  • determining, according to the decoded data of the at least one decoded pixel in the image, the decoded data of the at least one undecoded pixel in the first rectangular region including: from the at least one decoded pixel of the image, Determining a reference pixel point of each of the at least one undecoded pixel in the first rectangular region; determining decoded data (or referred to as decoded data) of each of the at least one undecoded pixel as the Decoded data (or called decoded data) of reference pixels of each pixel.
  • a reference pixel point of each of the at least one uncoded pixel points is located on a left side or an upper side of the each pixel point.
  • the reference pixel point of each pixel of the at least one uncoded pixel point is located in the same rectangular area or a different rectangular area as the each pixel point.
  • determining, from the at least one decoded pixel of the image, a reference pixel of each pixel of the at least one undecoded pixel in the first rectangular region including: the at least one undecoded pixel Dividing into N sets of pixels, each set of pixels including at least one of the at least one uncoded pixel, N being an integer greater than or equal to 1; at least one from the image Among the decoded pixels, the reference pixel point of the j-th pixel point among the N sets of pixel points is determined, 1 ⁇ j ⁇ N.
  • determining the reference pixel of the jth group of pixels from the at least one decoded pixel of the image comprises: acquiring a second identifier from the encoded bitstream of the image, the second identifier a location for indicating a reference pixel point of the jth group of pixels; and determining, according to the second identifier, a reference pixel of each of the jth group of pixels.
  • the reference pixel of the jth group of pixels is located to the left of the jth group of pixels, and is the last encoded pixel of the first rectangular area, or the reference of the jth group of pixels The pixel is spaced apart from the last encoded pixel by at least one pixel.
  • a reference pixel point of each pixel point of the j-th group of pixel points is located on an upper side of the each pixel point, and is adjacent to or spaced apart from the pixel point by at least one pixel point.
  • dividing the at least one undecoded pixel into N groups of pixels includes: dividing the at least one undecoded pixel into N groups of pixels according to the number of the at least one undecoded pixel, where The number of undecoded pixels included in the first N-1 group of pixels in the N group of pixels is the same.
  • the dividing the at least one undecoded pixel into two sets of pixels includes: determining the first P pixels in the at least one undecoded pixel as the first group of pixels, where P is greater than or equal to a preset value of 1; determining, among the at least one undecoded pixel, the remaining undecoded pixels except the first set of pixels as the second set of pixels.
  • the jth group of pixel points is specifically the first group of pixel points; and determining, from the at least one decoded pixel of the image, each pixel point of the at least one undecoded pixel in the first rectangular area a reference pixel, further comprising: acquiring at least one third identifier from the encoded bitstream of the image, the at least one third identifier corresponding to at least one of the first set of pixels, and the at least one Each third identifier of the third identifier is used to indicate a location of a reference pixel point of the corresponding pixel point; determining, according to the third identifier corresponding to each pixel point of the first group of pixel points, Reference pixel.
  • the decoding process is performed on the first rectangular area in the image according to the encoded bit stream of the image, including: performing entropy decoding processing on the to-be-decoded segment of the first rectangular area, to obtain a quantization parameter of the to-be-decoded segment.
  • the first rectangular area includes at least one segment, each segment includes at least one pixel; and the segment to be decoded is inverse quantized according to the quantization parameter of the segment to be decoded, to obtain residual data of the segment to be decoded. ; according to the parameters of the segment to be decoded
  • the data is subjected to inverse prediction processing on the residual data of the to-be-decoded segment to obtain a decoding result of the to-be-decoded segment.
  • acquiring a fourth identifier corresponding to the to-be-decoded segment in the encoded bitstream of the image determining, according to the fourth identifier corresponding to the to-be-coded segment, reference data of the to-be-decoded segment as an upper side of the to-be-decoded segment Data or left side data, wherein 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 to-be-decoded segment, and the upper side data of the to-be-decoded data includes the segment above the to-be-decoded segment Data of at least one second pixel; decoding the segment to be 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 fourth identifier corresponding to each of the at least one segment included in the image, and the fourth 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 first aspect or the first A method in any possible implementation of the 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 a schematic block diagram of a decoding apparatus provided by an embodiment of the present application.
  • FIG. 5 is another schematic block diagram of an encoding apparatus according to an embodiment of the present application.
  • FIG. 6 is another schematic block diagram of a decoding apparatus provided by an embodiment of the present application.
  • the embodiments of the present application can be applied to various coding and decoding systems, such as a codec system with a fixed compression ratio or a codec system with an adaptive compression ratio, which is not limited in this embodiment of the present application.
  • the image may be divided into at least one rectangular area, and each rectangular area includes one or more 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.
  • the image is divided into a plurality of rectangular regions, 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 width 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.
  • the number of coded bits allowed for the rectangular area may have an upper limit.
  • 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.
  • FIG. 1 shows an encoding method 100 provided by an embodiment of the present application.
  • At least one rectangular area in the image may include the first rectangular area.
  • the pixel points in the first rectangular area may be encoded in a certain order, for example, the pixel points in the first rectangular area may be encoded from left to right, optionally if the first rectangular area Including a plurality of rows of pixels, the different rows in the first rectangular region may be encoded in a top-to-bottom manner, but the embodiment of the present application is not limited thereto.
  • the first rectangular region is determined according to the encoded data of at least one encoded pixel in the image.
  • the first i pixel points in the first rectangular area have been encoded, and the i+1th pixel point in the first rectangular area needs to be encoded, where 1 ⁇ i ⁇ T-1, T is the total number of pixels included in the first rectangular area, and the number of coded bits b i+1 to be used for the i+ 1th pixel and the total number of bits used by the first i pixels If the sum of the coded bits of the first rectangular area is greater than the maximum allowable number of coded bits B max of the first rectangular area, it indicates that the number of coded bits allowed in the first rectangular area is insufficient for encoding the i+1th pixel.
  • the at least one uncoded pixel including the i+1th pixel point in the first rectangular area may be determined according to the encoded data of the at least one pixel that has been encoded in the image by using a method of pixel expansion.
  • the encoded data of the at least one uncoded pixel may be obtained without performing encoding processing on the at least one uncoded pixel in the first rectangular region.
  • the decoding end may also adopt a similar manner. Decoding data of the at least one uncoded pixel is determined.
  • the encoded data of the at least one pixel that has been encoded in the image may be directly copied to the at least one uncoded pixel, so that the encoded data of the at least one uncoded pixel may be determined as being in the image.
  • Encoded data of at least one pixel of the code may be processed, and the processed data is determined as the encoded data of the at least one uncoded pixel, wherein the processing may include averaging.
  • At least one encoded pixel in the image may include an encoded pixel located to the left of the at least one uncoded pixel and/or located At least one encoded pixel point on the upper side of the at least one uncoded pixel point, wherein the encoded pixel point located to the left of the at least one uncoded pixel point may be adjacent to the at least one uncoded pixel point, or Separating at least one pixel from the at least one uncoded pixel; at least one encoded pixel located on an upper side of the at least one uncoded pixel may be adjacent to the at least one uncoded pixel, or may be The at least one uncoded pixel is separated by at least one pixel, which is not limited by the embodiment of the present application.
  • At least one of the encoded pixel points in the image may be located in the first rectangular area or may not be located in the first rectangular area.
  • the image may include at least one sub-image, each sub-image including 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.
  • at least one encoded pixel point in the image may be located in the sub-image to which the first rectangular area belongs, but the embodiment of the present application is not limited thereto.
  • a reference pixel of each pixel of the at least one uncoded pixel may be determined from at least one encoded pixel of the image, and the at least one uncoded The encoded data of each pixel in the pixel is determined as the encoded data of the reference pixel of each pixel.
  • the reference pixel points of different pixels in the at least one uncoded pixel point may be the same or different pixel points.
  • the reference pixel point of each of the at least one uncoded pixel point may be predetermined.
  • a reference pixel point of each of the at least one uncoded pixel point is an encoded pixel point located on an upper side of the each pixel point.
  • the reference pixel point of each pixel of the at least one uncoded pixel may be a pixel located on the left side of the at least one uncoded pixel in the first rectangular area, for example, the first rectangle.
  • the last encoded pixel in the region may be an encoded pixel located on the left side of the pixel and spaced apart from the pixel by P pixels, but The application embodiment is not limited to this.
  • the reference pixel point of each pixel point may also be determined according to information of each pixel point in the at least one uncoded pixel point.
  • the encoded data points on the left side of each pixel point and the encoded pixels on the upper side of each pixel point may be based on original data and/or position of each pixel point in the at least one uncoded pixel point.
  • the reference pixel of each pixel is determined, which is not limited by the embodiment of the present application.
  • the at least one uncoded pixel point may be divided into N sets of pixel points, each set of pixel points including at least one of the at least one uncoded pixel point, and N is an integer greater than or equal to 1.
  • the at least one uncoded pixel may be divided into N groups of pixels according to a preset length, wherein the number of uncoded pixels included in the first N-1 group of pixels may be the same, and the Nth group of pixels The number of uncoded pixels included in the sum may be equal to the total number of the at least one uncoded pixel minus the total number of uncoded pixels included in the previous N-1 set of pixels.
  • the value of N may be determined by the total number of the at least one uncoded pixel points and the preset length of each set of pixel points.
  • grouping can be performed without knowing the total number of the at least one uncoded pixel points, thereby reducing coding complexity.
  • the at least one uncoded pixel is grouped by other methods, which is not limited in this embodiment of the present application.
  • reference pixel points of at least one of the set of pixel points may be determined in units of groups.
  • the first encoded pixel point on the left side of the jth group of pixel points and the at least one second side on the upper side of the jth group of pixel points may be based on raw data of the jth group of pixel points in the N sets of pixel points Among the coded pixels, the reference pixel of the jth group of pixels is determined.
  • the first encoded pixel point may be in the same row as the jth group of pixel points and located to the left of the jth group of pixel points, for example, the first encoded pixel point may be the first rectangular area.
  • the last pixel that has been encoded, or the first coded pixel may be separated from the last pixel of the first rectangular area by at least one pixel, which is not limited in this embodiment of the present application.
  • the at least one second encoded pixel point may be located directly on the jth group of pixel points, for example, the number of the at least one second encoded pixel point may be included in the jth group of pixel points The number of pixels is equal, and each of the at least one second encoded pixel may be located directly above one of the j-th pixels, ie, the at least one The second coded pixel point may be in one-to-one correspondence with at least one of the j-th group of pixel points, wherein one of the j-th group of pixel points may be the second one that is located directly above the pixel point
  • the coded pixels are adjacent to each other or at least one pixel is spaced apart, which is not limited in this embodiment of the present application.
  • the first encoded pixel point may be determined as a reference pixel point of the jth group of pixel points, and the at least one second encoded pixel point may also be determined as a reference pixel point of the jth group of pixel points.
  • the reference pixel of each of the j-th pixels may be specifically a second encoded pixel located directly above the pixel, but the embodiment of the present application is not limited thereto.
  • a correlation between the jth group of pixel points and the first encoded pixel point may be determined, a correlation between the jth group of pixel points and the at least one second encoded pixel point is determined, and
  • the first encoded pixel point may be according to a correlation between the jth group of pixel points and the first encoded pixel point and a correlation between the jth group of pixel points and the at least one second encoded pixel point Or the at least one second encoded pixel point is determined as a reference pixel point of the jth group of pixel points.
  • the correlation between the j-th pixel point and the first encoded pixel may be determined according to a correlation between each pixel of the j-th pixel and the first encoded pixel
  • the correlation between the j-th pixel point and the first encoded pixel point may be a correlation between each pixel point of the j-th group of pixel points and the first encoded pixel point.
  • the embodiment of the present application is not limited thereto.
  • the correlation between the j-th group of pixels and the at least one second encoded pixel may be based on each pixel of the j-th pixel and the second of the upper of each pixel The degree of correlation between the encoded pixels is determined.
  • the correlation between the jth group of pixels and the at least one second encoded pixel may be each pixel of the jth group of pixels and the second encoded pixel of the upper side of each of the pixels The sum of the correlations between the points, but the embodiment of the present application is not limited thereto.
  • the correlation between the first encoded pixel point and the at least one second encoded pixel point and the j-th group of pixel points may be determined as the reference pixel point of the j-th group of pixel points. For example, if the correlation between the first encoded pixel point and the jth group of pixel points is greater than the correlation between the at least one second encoded pixel point and the jth group of pixel points, A coded pixel is determined as a reference pixel of the jth group of pixels, and at this time, all of the pixels of the jth group have the same reference pixel.
  • At least one second encoded pixel point is determined as a reference pixel point of the j-th group of pixel points, and at this time, a reference pixel point of each of the j-th group of pixel points is an upper side of the each pixel point Two encoded pixels, but the embodiment of the present application does not Limited to this.
  • the reference pixels of each of the Nth group of pixels may also be determined.
  • the encoded pixel points on the left side of each pixel point and the encoded pixels on the upper side of each pixel point may be based on original data and/or position of each pixel point in the Nth group of pixel points.
  • the reference pixel point of each pixel is determined. For example, a correlation between a pixel point and a coded pixel point on the left side thereof and a correlation between the pixel point and an encoded pixel point on the upper side thereof may be determined, and a pre-coded pixel point having a large correlation degree is determined. It is a reference pixel of the pixel, but the embodiment of the present application is not limited thereto.
  • the first identifier needs to be distinguished from the coded bits in the encoded bitstream corresponding to the rectangular area, that is, the uniqueness of the first identifier in the encoded bitstream corresponding to the rectangular area needs to be guaranteed.
  • the first identifier may be specifically an end code, and when the 0th-order Columbus code is adopted and the bit depth of the coded pixel is 12, the pattern of the first identifier may be set to consecutive 14 '0's.
  • the embodiment of the present application does not limit this.
  • the first identifier may be immediately after the coded bit corresponding to the i th pixel in the first rectangular area, but the embodiment of the present application is not limited thereto.
  • At least one second identifier may be added to the encoded bitstream of the first rectangular area, where each second identifier is used to identify a location of a reference pixel point of a group of the pixel points of the N sets of pixels
  • each second identifier is used to identify a location of a reference pixel point of a group of the pixel points of the N sets of pixels
  • At least one third identifier may be added to the encoded bitstream of the first rectangular area, where each third identifier is used to identify a location of a reference pixel point of one pixel of the Nth group of pixels, but
  • each third identifier is used to identify a location of a reference pixel point of one pixel of the Nth group of pixels, but
  • the embodiments of the present application are not limited thereto.
  • different rectangular regions in the image may be encoded at a fixed magnification. 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 rectangular area when the number of encoded bits is less than or equal to a preset number of bits The coding compression ratio of the corresponding image is greater than or equal to the compression ratio of the same rectangular bit area corresponding to the same number of coding bits.
  • 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.
  • some or all of the rectangular regions in the at least one rectangular region in the image may be further divided into at least one segment, each segment comprising 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.
  • 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.
  • reference data of a segment to be encoded may be determined.
  • 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. .
  • to The first pixel may be spaced apart from the segment to be encoded.
  • the at least one first pixel and the segment to be encoded may be separated by at least one pixel, that is, the most of the at least one first pixel.
  • the pixel on the right side 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 may be less than a certain number of pixels.
  • a threshold value that is, the at least one first pixel point 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 raw data or encoded data of the second pixel.
  • 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. Specifically, at least one first pixel from the left side of the segment may be according to at least one pixel included in the segment to be encoded. A reference pixel point of the segment is determined from the point and at least one second pixel above the segment. 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.
  • 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 segment to be encoded and the data on the left side of the segment to be encoded, the correlation between the segment to be encoded and the data on the left side of the segment to be encoded may be indicated.
  • the degree 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 may be obtained by averaging data within a specific step size in the left side data of the slice to be encoded, or may be obtained by extracting a point in the left side data of the slice to be encoded within a specific step size.
  • the 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 fragment and the upper side data of the fragment to be encoded is determined.
  • 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.
  • 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.
  • a segment may only use data in the sub-image to which the segment belongs as reference data.
  • data in the sub-image to which the segment belongs may belong to the same rectangular region as the segment, or may be used in the sub-image to which the segment belongs. The data belonging to a different rectangular area is not 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 and the upper boundary of the image If not adjacent or spaced apart, 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 may be determined that the segment to be encoded does not have an 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 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 fragment to be encoded has available left side data and/or on the basis of whether the fragment to be encoded is located at a boundary of a rectangular area, a boundary of a sub image, or a boundary of an image Side data.
  • 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 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 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 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 image, and the pixel in the segment to be encoded is encoded according to the left-side data of the segment to be 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 pixels in the segment to be encoded may be determined as a preset value, for example, 1 ⁇ ⁇ (BitDepth-1) is determined as the predicted value of the first N pixel points, where ⁇ is the left shift operator, and BitDepth is the pixel bit depth, indicating the number of coded bits used for 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 to-be-encoded segment may be encoded according to the reference data to obtain an encoded bitstream of the to-be-coded segment.
  • 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, quantization in the AVS1-P2 standard, quantization in the AVS2-P2 standard, or self-designed
  • the 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 can be maintained.
  • the parameter is invariant, that is, the quantization parameter of the fragment to be encoded is equal to the original quantization parameter, which is not limited by the embodiment of the present application.
  • 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 fourth identifier may be added to the encoded bitstream of the to-be-coded segment, where the reference data of the segment to be encoded is indicated. position.
  • the fourth 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 fourth 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 fourth 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.
  • determining the left side data or the upper side data of the segment as the reference data of the segment, and according to the The reference data of the segment is encoded, until the total number of coded bits used by the encoded pixel in the rectangular region is less than or equal to the number of coded bits allowed for the rectangular region, and the current to be encoded in the rectangular region.
  • the number of coded bits to be used for the pixel and the total number of coded bits used for the previously encoded pixel are greater than the number of coded bits allowed for the rectangular region.
  • the encoded data or the encoded data of the encoded pixel points in the rectangular area can be utilized to determine the encoded data or the encoded data of the uncoded pixel points, which can improve Coding quality.
  • FIG. 2 shows a decoding method 200 provided by an embodiment of the present application.
  • S210 Perform decoding processing on the first rectangular area in the image according to the encoded bit stream of the image.
  • the first rectangular area may be divided into at least one segment, each segment including at least one pixel, and decoding processing is performed in units of segments.
  • the encoded bitstream of the image may include at least one included with the image A fourth identifier corresponding to each segment in the segment, wherein the fourth identifier corresponding to each segment can be used to identify the location of the reference data (or reference pixel) of each segment.
  • the reference data of the to-be-decoded segment may be determined according to the fourth identifier corresponding to the to-be-decoded segment, and the to-be-coded segment is determined to perform decoding processing according to the reference data of the to-be-decoded segment.
  • different segments may correspond to different fourth identifiers.
  • the location of the reference data of each segment may be determined according to the fourth identifier corresponding to each segment, but the embodiment of the present application Not limited to this.
  • the segment to be decoded of the first rectangular region may be subjected to entropy decoding processing to obtain a quantization parameter of the segment to be decoded. Then, the to-be-decoded segment may be inverse quantized according to the quantization parameter of the to-be-decoded segment to obtain residual data of the segment to be decoded. Then, the residual data of the to-be-decoded segment may be subjected to an anti-prediction process or a compensation process according to the reference data of the to-be-decoded segment to obtain a decoding result of the to-be-decoded segment, which is not limited in this embodiment of the present application.
  • the encoded bitstream includes a first identifier, determining decoded data of at least one undecoded pixel in the first rectangular region according to the decoded data of the at least one decoded pixel in the image, where the first identifier
  • the symbol is used to identify the end of encoding of the first rectangular region and has at least one uncoded pixel in the first rectangular region.
  • a reference pixel point of each of the at least one undecoded pixel in the first rectangular area may be determined from the at least one decoded pixel of the image, and the at least one undecoded pixel is The decoded data of each pixel is determined as the decoded data of the reference pixel of each pixel.
  • a reference pixel point of each undecoded pixel in the first rectangle may be determined according to at least one second identifier included in the encoded bitstream of the image.
  • the at least one undecoded pixel point may be divided into N sets of pixel points, each set of pixel points including at least one of the at least one uncoded pixel point.
  • the reference pixel point of the jth group of pixel points may be determined from at least one decoded pixel point of the image, 1 ⁇ j ⁇ N.
  • the at least one undecoded pixel may be divided into N groups of pixels according to the number of the at least one undecoded pixel, wherein the first N-1 group of the N groups of pixels are included
  • the number of undecoded pixels is the same.
  • the number of the Nth group of pixel points may be equal to the number of the at least one undecoded pixel minus the total number of pixels included in the previous N-1 group of pixels.
  • embodiments of the present application are not limited thereto.
  • the number of the pixels included in the first N-1 group of pixels may be predefined, but the embodiment of the present application is not limited thereto.
  • the at least one undecoded pixel point may be further divided into two sets of pixel points, wherein, optionally, the first P pixels of the at least one undecoded pixel point may be determined as the first set of pixel points, Wherein P is a preset value greater than or equal to 1, and the remaining undecoded pixels of the at least one undecoded pixel except the first set of pixels are determined as the second set of pixels.
  • P is a preset value greater than or equal to 1
  • the remaining undecoded pixels of the at least one undecoded pixel except the first set of pixels are determined as the second set of pixels.
  • the reference pixel points of the jth group of pixel points may be determined in various manners.
  • a second identifier may be obtained from the encoded bitstream of the image, the second identifier is used to indicate a location of a reference pixel point of the jth group of pixels, and may be determined according to the second identifier.
  • the reference pixel point of each pixel in the jth group of pixels may be determined in various manners.
  • the encoded bitstream of the image may include a second identifier corresponding to at least one of the N sets of pixel points, and the second identifier corresponding to each set of pixel points may be used to identify the set of pixels.
  • the reference pixel point of each set of pixel points may be determined according to the second identifier corresponding to each set of pixel points in the at least one set of pixel points.
  • the reference pixel points may be determined for each of the Nth group of pixel points.
  • at least one third identifier may be obtained from the encoded bitstream of the image, the at least one third identifier corresponding to at least one of the Nth group of pixels, and the at least one third identifier
  • Each third identifier is used to indicate a location of a reference pixel point of the corresponding pixel, and a reference pixel of each pixel is determined according to a third identifier corresponding to each pixel of the second set of pixels.
  • the implementation principle of the decoding method provided by the embodiment of the present application may be similar to the coding method.
  • the description of the coding method For details, refer to the description of the coding method. For brevity, details are not described herein again.
  • FIG. 3 shows an encoding apparatus 300 provided by an embodiment of the present application, including:
  • the encoding unit 310 is configured to perform encoding processing on pixel points in the first rectangular area of the image, where the image includes at least one rectangular area, each rectangular area includes at least one pixel point;
  • the boundary processing unit 320 is configured to: if the total number of coded bits Bi used by the first i encoded pixel points in the first rectangular area is less than or equal to the maximum allowable use coded bit number Bmax of the first rectangular area, and the first The encoding required for the i+1th pixel in a rectangular area The sum of the number of bits bi+1 and Bi is greater than Bmax, and the encoded data of at least one uncoded pixel in the first rectangular region is determined according to the encoded data of the at least one encoded pixel in the image, wherein the at least one is not
  • the coded pixel includes the i+1th pixel, 1 ⁇ i ⁇ T-1, T is the total number of pixels included in the first rectangular region, and the first identifier is added to the encoded bitstream of the first rectangular region The first identifier is used to identify the end of encoding of the first rectangular region and the first rectangular region has at least one uncoded pixel.
  • the boundary processing unit 320 is specifically configured to:
  • the encoded data (or encoded data) of each of the at least one uncoded pixel is determined as the encoded data (or encoded data) of the reference pixel of each pixel.
  • a reference pixel point of each of the at least one uncoded pixel points is located on a left side or an upper side of the each pixel point.
  • the reference pixel point of each pixel of the at least one uncoded pixel point is located in the same rectangular area or a different rectangular area as the each pixel point.
  • the boundary processing unit 320 is specifically configured to:
  • each set of pixels including at least one of the at least one uncoded pixel, N being an integer greater than or equal to 1;
  • the boundary processing unit 320 is configured to: according to the original data of the jth group of pixel points, the first encoded pixel point on the left side of the jth group of pixel points and the upper side of the jth group of pixel points Among the at least one second encoded pixel, the reference pixel of the jth group of pixels is determined.
  • the boundary processing unit 320 is specifically configured to:
  • Correlating the correlation between each pixel point of the jth group of pixels and the first encoded pixel point, and each pixel point of the jth group of pixel points and a second encoded upper side of the each pixel point A correlation between the pixels, the first encoded pixel point or the at least one second encoded pixel point being determined as a reference pixel point of the jth group of pixel points.
  • the first encoded pixel point is specifically the last encoded pixel point of the first i encoded pixel points, or the first encoded pixel point and the last encoded pixel point At least one pixel is spaced apart.
  • each of the jth group of pixels is adjacent to or spaced apart from the second encoded pixel located on the upper side of the pixel.
  • the boundary processing unit 320 is further configured to: add a second identifier to the encoded bit stream of the first rectangular area, where the second identifier is used to indicate a location of the reference pixel point of the jth group of pixel points.
  • the boundary processing unit 320 is configured to: divide the at least one uncoded pixel point into N groups of pixel points according to the number of the at least one uncoded pixel point, where the first N of the N groups of pixel points The number of uncoded pixels included in the -1 set of pixels is the same.
  • N is equal to two.
  • the boundary processing unit 320 is specifically configured to:
  • the remaining uncoded pixels of the at least one uncoded pixel except the first set of pixels are determined as the second set of pixels.
  • the jth group of pixels is specifically the first group of pixels
  • the boundary processing unit 320 is specifically configured to: according to the original data of each pixel in the second group of pixels, from each of the pixels
  • the reference pixel point of each pixel point is determined from the coded pixel point on the left side of the pixel point and the coded pixel point on the upper side of the each pixel point.
  • the boundary processing unit 320 is further configured to: add at least one third identifier to the encoded bitstream of the first rectangular region, the at least one third identifier and at least one pixel of the second group of pixels The points correspond, and each of the at least one third identifier is used to indicate the location of the reference pixel point of the corresponding pixel.
  • the coding unit 310 is specifically configured to:
  • Determining reference data of the segment to be encoded in the first rectangular region wherein the first rectangular region includes at least one segment, each segment including at least one pixel;
  • the prediction result of the segment to be encoded is quantized to obtain a quantized result of the segment to be encoded
  • the quantization result of the fragment to be encoded is subjected to entropy coding processing to obtain an encoding result of the fragment to be encoded.
  • the coding unit 310 is specifically configured to: determine, according to data in the to-be-coded segment, reference data of the to-be-coded segment from the left-side data and the upper-side data of the to-be-coded segment, where the to-be-coded
  • the data on the left side of the segment includes data of at least one first pixel located to the left of the segment to be encoded
  • the data of the upper side of the data to be encoded includes data of at least one second pixel located on the upper side of the segment 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 encoding unit 310 can be specifically configured to:
  • the reference data of the segment to be encoded is determined.
  • the coding unit 310 is specifically configured to determine, as the reference data of the to-be-coded segment, the data on the left side of the to-be-encoded segment and the data in the upper-side data that is highly correlated with the segment to be encoded.
  • the encoding module 310 is further configured to: add a fourth identifier to the encoded bitstream of the to-be-encoded segment, where the fourth identifier is used to indicate a location of the reference data of the to-be-coded segment.
  • the coding unit 310 is further configured to determine, according to the reference data, a quantization parameter corresponding to the to-be-coded segment, before performing quantization processing on the prediction result of the to-be-coded segment by using the quantization parameter of the to-be-encoded segment.
  • the coding unit 310 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 coding unit 310 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 coding unit 310 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 coding unit 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, The reference data of the segment to be encoded is determined.
  • the encoding unit 310 may determine the available left-side data or upper-side data of the to-be-coded segment as a reference of the to-be-coded segment. data.
  • the coding unit 310 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 coding unit 310 may be further 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 coding unit 310 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 coding unit 310 may be further configured to use
  • 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 coding unit 310 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 coding unit 310 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 coding unit 310 may also be used 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 coding unit 310 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 to-be-coded segment is spaced apart from an upper boundary of the sub-image to which the fragment to be encoded belongs, and the to-be-coded segment is adjacent to a 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 coding unit 310 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 coding unit 310 may be further 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 neighboring 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, where ⁇ 1.
  • the above description of the encoding device 300 is merely exemplary. In some cases, the encoding device 300 may not include one or more of the above modules, which is not limited by the embodiment of the present application.
  • 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. 4 shows a decoding apparatus 400 provided by an embodiment of the present application, including:
  • the decoding unit 410 is configured to perform decoding processing on the first rectangular area in the image according to the encoded bit stream of the image, where the image includes at least one rectangular area, each rectangular area includes at least one pixel point;
  • the boundary processing unit 420 is configured to determine, according to the decoded data of the at least one decoded pixel in the image, the decoded data of the at least one undecoded pixel in the first rectangular region, where the encoded bitstream includes the first identifier, where The first identifier is used to identify the end of encoding of the first rectangular region and the at least one uncoded pixel in the first rectangular region.
  • the boundary processing unit 420 is specifically configured to:
  • Decoded data (or decoded data) of each of the at least one undecoded pixel is determined as decoded data (or decoded data) of the reference pixel of each pixel.
  • the boundary processing unit 420 is specifically configured to:
  • each set of pixels including at least one of the at least one uncoded pixel, N being an integer greater than or equal to 1;
  • a reference pixel point of the jth group of pixel points of the N sets of pixel points is determined from at least one decoded pixel of the image, 1 ⁇ j ⁇ N.
  • the boundary processing unit 420 is specifically configured to:
  • the reference pixel of the jth group of pixels is located to the left of the jth group of pixels, and is the last encoded pixel of the first rectangular area, or the reference of the jth group of pixels The pixel is spaced apart from the last encoded pixel by at least one pixel.
  • the boundary processing unit 420 is specifically configured to: divide the at least one undecoded pixel into N sets of pixels according to the number of the at least one undecoded pixel, where the first N of the N sets of pixels The number of undecoded pixels included in the -1 set of pixels is the same.
  • N is equal to two.
  • the boundary processing unit 420 is specifically configured to:
  • the remaining undecoded pixels of the at least one undecoded pixel except the first set of pixels are determined as the second set of pixels.
  • the jth group of pixel points is specifically the first group of pixel points.
  • the boundary processing unit 420 is specifically configured to:
  • the at least one third identifier is used to indicate the location of the reference pixel point of the corresponding pixel;
  • the decoding unit 410 is specifically configured to:
  • the decoding unit 410 is specifically configured to:
  • 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 of the to-be-decoded segment
  • the upper side data of the data to be decoded includes data of at least one second pixel located above the segment to be decoded
  • 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.
  • unit 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. 5 shows another encoding apparatus 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 instructions stored in memory 520 causes the processor 510 to perform the following operations:
  • the total number of coded bits Bi used by the first i coded pixel points in the first rectangular area is less than or equal to the maximum allowable use coded bit number Bmax of the first rectangular area, and the i-th in the first rectangular area
  • the sum of the number of coded bits bi+1 and Bi to be used for the +1 pixel is greater than Bmax, and at least one uncoded pixel in the first rectangular region is determined according to the encoded data of the at least one encoded pixel in the image.
  • Coded data, wherein the at least one uncoded pixel point includes the (i+1)th pixel point, 1 ⁇ i ⁇ T-1, where T is the total number of pixel points included in the first rectangular area;
  • a first identifier is added to the encoded bitstream of the first rectangular region, the first identifier being used to identify the end of encoding of the first rectangular region and the first rectangular region having at least one uncoded pixel.
  • 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. 6 shows another decoding apparatus 600 provided by an embodiment of the present application, including: a processor 610 and memory 620, wherein the memory 620 is configured to store instructions for executing the memory stored instructions, wherein execution of the instructions stored in the memory 620 causes the processor 610 to:
  • Decoding data of at least one undecoded pixel in the first rectangular region is determined according to the decoded data of the at least one decoded pixel in the image, where the encoded bitstream includes a first identifier, wherein the first identifier is used for the first identifier
  • the encoding of the first rectangular region is ended and the at least one uncoded pixel is included in the first rectangular region.
  • 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), and 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.
  • 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

一种编码方法、解码方法以及编码装置和解码装置,能够提高编码质量。该编码方法包括:对图像的第一矩形区域中的像素点进行编码处理;若该第一矩形区域中的前i个已编码的像素点使用的总编码比特数Bi小于或等于该第一矩形区域的最大允许使用编码比特数Bmax,并且该第一矩形区域中的第i+1个像素点需要使用的编码比特数bi+1与Bi之和大于Bmax,根据该图像中至少一个已编码的像素点的编码数据,确定该第一矩形区域中至少一个未编码像素点的编码数据;向该第一矩形区域的编码比特流添加第一标识符,该第一标识符用于标识对该第一矩形区域的编码结束并且该第一矩形区域具有至少一个未编码像素点。

Description

编码方法、解码方法以及编码装置和解码装置
版权申明
本专利文件披露的内容包含受版权保护的材料。该版权为版权所有人所有。版权所有人不反对任何人复制专利与商标局的官方记录和档案中所存在的该专利文件或者该专利披露。
技术领域
本申请涉及视频编码领域,并且更具体地,涉及编码方法、解码方法以及编码装置和解码装置。
背景技术
为了减少视频存储和传输所占用的带宽,需要对视频数据进行编码压缩处理。典型的视频压缩处理技术可以分为固定长度编码和自适应长度编码两种类型,其中,无论哪种编码类型,图像中的多个像素点允许使用的编码比特数都可能存在上限,此时,可能会出现该多个像素点当前已使用的编码比特数已达到该多个像素点允许使用的最大编码比特数,而该多个像素点中还存在未编码的像素点的情形,这样就需要对该多个像素点的边界进行处理,目前尚未有相关技术能够解决这样的问题。
发明内容
本申请提供一种编码方法、解码方法以及编码装置和解码装置,能够提高编码质量。
第一方面,提供了一种编码方法,包括:对图像的第一矩形区域中的像素点进行编码处理;若该第一矩形区域中的前i个已编码的像素点使用的总编码比特数Bi小于或等于该第一矩形区域的最大允许使用编码比特数Bmax,并且该第一矩形区域中的第i+1个像素点需要使用的编码比特数bi+1与Bi之和大于Bmax,根据该图像中至少一个已编码的像素点的编码数据,确定该第一矩形区域中至少一个未编码像素点的编码数据,其中,该至少一个未编码像素点包括该第i+1个像素点,1≤i≤T-1,T为该第一矩形区域包括的像素点总数;向该第一矩形区域的编码比特流添加第一标识符,该第一 标识符用于标识对该第一矩形区域的编码结束并且该第一矩形区域具有至少一个未编码像素点。
可选地,该图像可以包括至少一个矩形区域,每个矩形区域包括至少一个像素点。
可选地,可以将该图像划分为多个矩形区域,其中,与该图像边界间隔分布的至少一个矩形区域具有相同的长度。
可选地,Bmax可以表示该第一矩形区域允许使用的编码比特数的最大数值。
可选地,该根据该图像中已编码的像素点的编码数据,确定该第一矩形区域中至少一个未编码像素点的编码数据,包括:从该图像中至少一个已编码的像素点中,确定该至少一个未编码像素点中每个像素点的参考像素点;将该至少一个未编码像素点中的每个像素点的编码数据(或称为已编码数据)确定为该每个像素点的参考像素点的编码数据(或称为已编码数据)。
可选地,该至少一个未编码像素点中每个像素点的参考像素点位于该每个像素点的左侧或上侧。
可选地,该至少一个未编码像素点中每个像素点的参考像素点与该每个像素点位于同一矩形区域或不同矩形区域。
可选地,该从该图像中至少一个已编码的像素点中,确定该至少一个未编码像素点中每个像素点的参考像素点,包括:将该至少一个未编码像素点分成N组像素点,每组像素点包括该至少一个未编码像素点中的至少一个像素点,N为大于或等于1的整数;从该图像中至少一个已编码的像素点中,确定该N组像素点中的第j组像素点的参考像素点,1≤j≤N。
可选地,该从该图像中至少一个已编码的像素点中,确定该N组像素点中的第j组像素点的参考像素点,包括:根据该第j组像素点的原始数据,从该第j组像素点左侧的第一已编码像素点和该第j组像素点上侧的至少一个第二已编码像素点中,确定该第j组像素点的参考像素点。
可选地,该根据该第j组像素点的原始数据,从该第j组像素点左侧的第一已编码像素点和该第j组像素点上侧的至少一个第二已编码像素点中,确定该第j组像素点的参考像素点,包括:根据该第j组像素点中每个像素点的原始数据,确定该每个像素点与该第一已编码像素点之间的相关度;根据该第j组像素点中每个像素点的原始数据,确定该每个像素点与该 每个像素点上侧的第二已编码像素点之间的相关度;根据该第j组像素点中每个像素点与该第一已编码像素点之间的相关度以及该第j组像素点中每个像素点与该每个像素点上侧的第二已编码像素点之间的相关度,将该第一已编码像素点或该至少一个第二已编码像素点确定为该第j组像素点的参考像素点。
可选地,该第一已编码像素点具体为该前i个已编码的像素点中的最后一个已编码的像素点,或者该第一已编码像素点与该最后一个已编码的像素点之间间隔至少一个像素点。
可选地,该第j组像素点中每个像素点与位于该每个像素点上侧的第二已编码像素点相邻或间隔至少一个像素点。
可选地,该方法还包括:向该第一矩形区域的编码比特流添加第二标识符,该第二标识符用于指示该第j组像素点的参考像素点所在位置。
可选地,该将该至少一个未编码像素点分成N组像素点,包括:根据该至少一个未编码像素点的个数,将该至少一个未编码像素点分成N组像素点,其中,该N组像素点中的前N-1组像素点中包括的未编码像素点的个数相同。
可选地,N等于2。此时,可选地,该将该至少一个未编码像素点分成两组像素点,包括:将该至少一个未编码像素点中的前P个像素点确定为第一组像素点,其中,P为大于或等于1的预设数值;将该至少一个未编码像素点中除该第一组像素点之外的其余未编码像素点确定为第二组像素点。
可选地,如果N=2,则该第j组像素点具体为该第一组像素点。此时,可选地,该从该图像中至少一个已编码的像素点中,确定该至少一个未编码像素点中每个未编码像素点的参考像素点,还包括:根据该第二组像素点中每个像素点的原始数据,从该每个像素点左侧的已编码像素点和该每个像素点上侧的已编码像素点中,确定该每个像素点的参考像素点。
可选地,该方法还包括:向该第一矩形区域的编码比特流添加至少一个第三标识符,该至少一个第三标识符与该第一组像素点中的至少一个像素点对应,并且该至少一个该第三标识符中每个第三标识符用于指示对应像素点的参考像素点所在位置。
可选地,该对图像的第一矩形区域中的像素点进行编码处理,包括:确定该第一矩形区域中的待编码片段的参考数据;根据该参考数据,对该待 编码片段进行预测处理,得到该待编码片段的预测残差;利用该待编码片段的量化参数,对该待编码片段的预测结果进行量化处理,得到该待编码片段的量化结果;对该待编码片段的量化结果进行熵编码处理,得到该待编码片段的编码结果。
可选地,该确定该第一矩形区域中的待编码片段的参考数据,包括:根据该待编码片段中的数据,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据,其中,该待编码片段的左侧数据包括位于该待编码片段左侧的至少一个第一像素点的数据,该待编码数据的上侧数据包括位于该待编码片段上侧的至少一个第二像素点的数据。
可选地,可以将该至少一个矩形区域中的第一矩形区域划分为多个片段,其中,与该第一矩形区域的边界间隔分布的至少一个片段具有相同的长度。
可选地,矩形区域的高度可以为一行或多行,即一个矩形区域可以包括属于同一列的像素点个数可以为一个或多个。
可选地,片段的高度可以为一行,即一个片段包括的属于同一列的数据点个数可以为一个。
可选地,长度相同的矩形区域可以对应的编码比特数少于或等于预设的比特数。
当所述的编码比特数等于预设的比特数时,长度相同的矩形区域对应相同的编码比特数,即以固定倍率对该图像中的矩形区域进行编码处理。
当所述的编码比特数少于或等于预设的比特数时,所述矩形区域对应的图像的编码压缩率大于或等于所述长度相同的矩形区域对应相同的编码比特数的压缩率。
所述处理方法的目的在于保证整幅图像的编码压缩率,同时由于不用严格保证每个矩形区域对应相同的编码比特数,从而可以提高每个矩形区域的编码灵活性并提高编码效率。
可选地,待编码片段的左侧数据可以包括位于该待编码片段左侧的至少一个第一像素点的数据。
可选地,该至少一个第一像素点可以与该待编码片段相邻。例如,该至少一个第一像素点中的最右侧像素点与该待编码片段中的最左侧像素点可以为相邻的像素点。
可选地,该至少一个第一像素点可以与该待编码片段临近但间隔分布。例如,该至少一个第一像素点可以与该待编码片段间隔至少一个像素点。例如,该至少一个第一像素点中的最右侧像素点与该待编码片段中的最左侧像素点之间可以间隔至少一个像素点。
可选地,该至少一个第一像素点的数据可以包括该至少一个第一像素点中一个或多个第一像素点的原始数据。
可选地,该至少一个第一像素点的数据也可以包括该至少一个第一像素点中一个或多个第一该像素点的已编码数据。
可选地,待编码数据的上侧数据可以包括位于该待编码片段上方的至少一个第二像素点的数据。
可选地,该至少一个第二像素点可以与该待编码片段相邻。例如,该至少一个第二像素点中的最下方像素点与该待编码片段中的最上方像素点可以为相邻的像素点。
可选地,该至少一个第二像素点可以与该待编码片段临近但间隔分布。例如,该至少一个第二像素点可以与该待编码片段间隔至少一个像素点。例如,该至少一个第二像素点中的最下方像素点与该待编码片段中的最上方像素点之间可以间隔至少一个像素点。
可选地,该至少一个第二像素点的数据可以包括该至少一个第二像素点中一个或多个第二像素点的原始数据。
可选地,该至少一个第二像素点的数据也可以包括该至少一个第二像素点中一个或多个第二该像素点的已编码数据。
可选地,像素点的已编码数据可以包括像素点的已编码的数据。
可选地,可以根据待编码片段中的数据,从该待编码片段左侧的至少一个第一像素点和该待编码片段上方的至少一个第二像素点中,确定该待编码片段的参考像素点。即,可以将该至少一个第一像素点或该至少一个第二像素点确定为该待编码片段的参考像素点。
相应地,可以将该至少一个第一像素点的数据或将该至少一个第二像素点的数据确定为该待编码片段的参考数据。
因此,本申请提供的编码方法,采用固定倍率对矩形区域进行编码处理,在具有较高编码质量的同时具有较低的实现复杂度。
在第一方面的第一种可能的实现方式中,该根据待编码片段中的数 据,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据,包括:根据该待编码片段中的数据和该至少一个第一像素点的数据,确定该待编码片段与该待编码片段的左侧数据之间的相关度;根据该待编码片段中的数据和该至少一个第二像素点的数据,确定该待编码片段与该待编码片段的上侧数据之间的相关度;根据该待编码片段与该待编码片段的左侧数据之间的相关度以及该待编码片段与该待编码片段的上侧数据之间的相关度,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据。
可选地,可以确定该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值,并根据该差值的绝对值,确定该待编码片段与该待编码片段的左侧数据之间的相关度。
可选地,该待编码片段中的数据与该编码片段的左侧数据之间的差值的绝对值可以是根据该编码片段中每个像素点的数据和与该每个像素点对应的第一像素点的数据之间的差值的绝对值得到的。
作为一个例子,该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值可以是该编码片段中每个像素点的数据和与该每个像素点对应的第一像素点的数据之间的差值的绝对值之和的函数。
可选地,该函数可以为绝对差值的绝对值函数或平均方差函数。
可选地,该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值越小,可以表明该待编码片段与该待编码片段的左侧数据之间的相关度越大。
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第二种可能的实现方式中,该根据该待编码片段与该待编码片段的左侧数据之间的相关度以及该待编码片段与该待编码片段的上侧数据之间的相关度,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据,包括:将该待编码片段的左侧数据和上侧数据中与该待编码片段之间相关度较大的数据,确定为该待编码片段的参考数据。
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第三种可能的实现方式中,该方法还包括:向该待编码片段的编码比特流添加第四标识符,该第四标识符用于指示该待编码片段的参考数据所在位置。
可选地,该图像的编码比特流可以包括与该图像中的至少一个片段对 应的至少一个第四标识符,每个第四标识符可以用于标识对应的片段的参考数据或参考像素点所在位置。例如,第四标识符可以用于标识该第四标识符对应的片段的参考像素点位于该片段的左侧或上侧。
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第四种可能的实现方式中,该根据该参考数据,对该待编码片段进行编码处理,包括:根据该参考数据,对该待编码片段进行预测处理,得到该待编码片段的预测残差;利用该待编码片段的量化参数,对该待编码片段的预测残差进行量化处理,得到该待编码片段的量化结果;对该待编码片段的量化结果进行熵编码处理,得到该待编码片段的编码结果。
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第五种可能的实现方式中,在该利用该待编码片段的量化参数,对该待编码片段的预测结果进行量化处理之前,该方法还包括:根据该参考数据,确定该待编码片段的量化参数。
可选地,该根据该参考数据,确定该待编码片段的量化参数,包括:根据该参考数据和该待编码片段中的数据,确定该待编码片段的复杂度;根据该待编码片段的复杂度,确定该待编码片段的量化参数。
可选地,该根据该参考数据和该待编码片段中的数据,确定该待编码片段的复杂度,包括:根据该参考数据和该待编码片段中的数据,确定该待编码片段中每个像素点的残差;根据该待编码片段中每个像素点的残差,确定该待编码片段的复杂度。
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第六种可能的实现方式中,该根据该待编码片段的复杂度,确定该待编码片段的量化参数,包括:根据该待编码片段所属矩形区域中的每个片段的复杂度,确定该待编码片段所属矩形区域的复杂度;通过比较该待编码片段的复杂度和该待编码片段所属矩形区域的复杂度,确定该待编码片段的量化参数。
可选地,矩形区域的复杂度可以等于该矩形区域中每个片段的复杂度的函数,例如,平均值函数或平均方差函数等等。
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第七种可能的实现方式中,该从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据,包括:若该待编码片段具有可用的左侧数据和可用的上侧数据,从该待编码片段的可用的左侧数据和可用的上侧数据中,确定 该待编码片段的参考数据。
此时,在确定待编码片段具有可用的左侧数据并且具有可用的上侧数据的情况下,从该待编码片段可用的左侧数据和可用的上侧数据中,确定该待编码片段的参考数据。
可选地,如果待编码片段仅具有可用的左侧数据,则可以将该待编码片段的左侧数据确定为该待编码片段的参考数据。
可选地,如果待编码片段仅具有可用的上侧数据,则可以将该待编码片段的上侧数据确定为该待编码片段的参考数据。
可选地,可以根据待编码片段是否位于矩形区域的边界、子图像的边界或图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。
作为一个例子,与待编码片段属于同一个图像中的数据可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,可以根据待编码片段是否位于图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。
可选地,可以尽量使用待编码片段的上侧数据作为待编码片段的参考数据,从而有利于提高编码质量。
可选地,若该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界相邻,则可以将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。
具体地,如果该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界相邻,则该待编码片段可以既不具有可用的左侧数据,也不具有可用的上侧数据。
可选地,该预设数值可以为1<<(BitDepth-1),表示将1向左移位BitDepth-1位,其中,BitDepth为像素比特深度。
可选地,N可以根据同时处理的像素点个数M和时序逻辑延迟L确定。
可选地,该待编码片段的前N个像素点可以具体为该待编码片段包括的T个像素点中位于最左侧的N个像素点。
可选地,若该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,则可以根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指图像中位于该待编码片段左侧的至少一个像素点的数据。
可选地,若该待编码片段与该图像的上边界间隔分布并且该待编码片段与该图像的左边界相邻,则可以根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与该图像的左边界相邻并且该待编码片段与该图像的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指图像中位于该待编码片段上方的至少一个像素点的数据。
作为另一个例子,只有与待编码片段属于同一个矩形区域中的数据才可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,假设待编码片段属于第一矩形区域,可以根据待编码片段是否位于第一矩形区域的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。
这样,能够使得对各个矩形区域之间的编码相互独立。
可选地,若该待编码片段与第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界相邻,将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。
如果该待编码片段与第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界相邻,则该待编码片段可以既不具有可用的左侧数据,也不具有可用的上侧数据。
可选地,若该待编码片段与该第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界间隔分布,根据该待编码片段的左侧数 据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与该第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指与该待编码片段属于同一个矩形区域(即位于第一矩形区域中)并且位于该待编码片段左侧的至少一个像素点的数据。
可选地,若该待编码片段与该第一矩形区域的上边界间隔分布并且该待编码片段与该第一矩形区域的左边界相邻,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与该第一矩形区域的左边界相邻并且该待编码片段与该第一矩形区域的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指与该待编码片段属于同一个矩形区域(即位于第一矩形区域中)并且位于该待编码片段上方的至少一个像素点的数据。
作为另一个例子,该图像可以包括至少一个子图像,每个子图像包括至少一个矩形区域。例如,每个子图像在高度方向上可以包括一个或多个矩形区域。
此时,可选地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,可以根据待编码片段是否位于其所属子图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。
可选地,若该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该待编码片段所属子图像的左边界相邻,将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。
如果该待编码片段与其所属子图像的上边界相邻并且该待编码片段与其所属子图像的左边界相邻,则该待编码片段可以既不具有可用的左侧数据,也不具有可用的上侧数据。
可选地,若该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该待编码片段所属子图像的左边界间隔分布,根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与其所属子图像的上边界相邻并且该待编码片段与其所属子图像的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指与该待编码片段属于同一个子图像且位于该待编码片段左侧的至少一个像素点的数据。
可选地,若该待编码片段与该待编码片段所属子图像的上边界间隔分布并且该待编码片段与该待编码片段所属子图像的左边界相邻,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与其所属子图像的左边界相邻并且该待编码片段与其所属子图像的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指与该待编码片段属于同一个子图像并且位于该待编码片段上方的至少一个像素点的数据。
作为另一个例子,也可以根据不同的标准确定该待编码片段是否具有可用的上侧数据和左侧数据。例如,待编码片段可以将同一子图像中的上侧数据作为可用的上侧数据而仅可以将同一个矩形区域中的左侧数据作为可用的左侧数据。再例如,待编码片段可以将同一子图像中的左侧数据作为可用的左侧数据而仅可以将同一个矩形区域中的左侧数据作为可用的左侧数据,等等。
可选地,若该待编码片段与该待编码片段所属子图像的左边界相邻并且该待编码片段与该图像的上边界间隔分布,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
具体地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的左侧数据,而图像中位于该待编码片段上侧的数据可以作为该待编码片段的可用的上侧数据。相应地,可以根据待编码片段是否位于其所属子图像的左边界来确定该待编码片段是否具有可用的左侧数据,并且 可以根据待编码片段是否位于图像的上边界来确定该待编码片段是否具有可用的上侧数据。
可选地,若该待编码片段与该其所属子图像的左边界相邻并且该待编码片段与图像的上边界间隔分布,此时,无论该待编码片段是否处于其所属子图像的上边界,都可以认为其具有可用的上侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指图像中位于该待编码片段上方的至少一个像素点的数据。
可选地,若该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。
具体地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的上侧数据,而图像中位于该待编码片段左侧的数据可以作为该待编码片段的可用的左侧数据。相应地,可以根据待编码片段是否位于其所属子图像的上边界来确定该待编码片段是否具有可用的上侧数据,并且可以根据待编码片段是否位于图像的左边界来确定该待编码片段是否具有可用的左侧数据。
可选地,若该待编码片段与该其所属子图像的上边界相邻并且该待编码片段与图像的左边界间隔分布,此时,无论该待编码片段是否处于其所属子图像的左边界,都可以认为其具有可用的左侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指图像中位于该待编码片段左侧的至少一个像素点的数据。
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第八种可能的实现方式中,该待编码片段中的每M个相邻像素点对应于相同的参考像素点,其中,该待编码片段的参考数据包括该参考像素点的数据,M≥1。
可选地,位于同一行的M个相邻像素点可以对应于相同的参考像素点。相应地,可以同时对位于同一行的M个相邻像素点进行编码处理。
这样,可以同时对M个像素点同时进行编码处理,从而能够提高数据处理效率。
结合第一方面或第一方面的上述可能的实现方式,在第一方面的第九种可能的实现方式中,该方法还包括:若该待编码片段所属矩形区域当前已使用的编码比特数Bi小于或等于该待编码片段所属矩形区域允许使用的编码比特数B,并且该待编码片段中的当前待编码像素点需要使用的编码比特数bi+1与Bi之和大于B,向该待编码片段的编码比特流添加结束码,该结束码用于标识对该待编码片段所属矩形区域的编码结束并且该待编码片段所属矩形区域具有至少一个未编码的像素点。
可选地,B可以等于固定码率对应的编码比特数。
如果矩形区域的编码比特数用尽并且该矩形区域还有未编码的至少一个像素点,则可以在图像的编码比特流中添加矩形区域对应的结束码,用于指示该矩形区域中具有至少一个未编码的像素点。
第二方面,提供了一种解码方法,包括:根据图像的编码比特流,对该图像中的第一矩形区域进行解码处理,其中,该图像包括至少一个矩形区域,每个矩形区域包括至少一个像素点;若该编码比特流包括第一标识符,根据该图像中至少一个已解码像素点的解码数据,确定该第一矩形区域中至少一个未解码像素点的解码数据,其中,该第一标识符用于标识对该第一矩形区域的编码结束并且该第一矩形区域中具有至少一个未编码像素点。
可选地,该根据该图像中至少一个已解码像素点的解码数据,确定该第一矩形区域中至少一个未解码像素点的解码数据,包括:从该图像的至少一个已解码像素点中,确定该第一矩形区域中至少一个未解码像素点中每个像素点的参考像素点;将该至少一个未解码像素点中每个像素点的解码数据(或称为已解码数据)确定为该每个像素点的参考像素点的解码数据(或称为已解码数据)。
可选地,该至少一个未编码像素点中每个像素点的参考像素点位于该每个像素点的左侧或上侧。
可选地,该至少一个未编码像素点中每个像素点的参考像素点与该每个像素点位于同一矩形区域或不同矩形区域。
可选地,该从该图像的至少一个已解码像素点中,确定该第一矩形区域中至少一个未解码像素点中每个像素点的参考像素点,包括:将该至少一个未解码像素点分成N组像素点,每组像素点包括该至少一个未编码像素点中的至少一个像素点,N为大于或等于1的整数;从该图像的至少一个 已解码像素点中,确定该N组像素点中的第j组像素点的参考像素点,1≤j≤N。
可选地,该从该图像的至少一个已解码像素点中,确定该第j组像素点的参考像素点,包括:从该图像的编码比特流中获取第二标识符,该第二标识符用于指示该第j组像素点的参考像素点所在位置;根据该第二标识符,确定该第j组像素点中每个像素点的参考像素点。
可选地,该第j组像素点的参考像素点位于该第j组像素点的左侧,并且为该第一矩形区域的最后一个已编码的像素点,或者该第j组像素点的参考像素点与该最后一个已编码的像素点之间间隔至少一个像素点。
可选地,该第j组像素点中每个像素点的参考像素点位于该每个相素点的上侧,并且与该每个像素点相邻或间隔至少一个像素点。
可选地,该将该至少一个未解码像素点分成N组像素点,包括:根据该至少一个未解码像素点的个数,将该至少一个未解码像素点分成N组像素点,其中,该N组像素点中的前N-1组像素点中包括的未解码像素点的个数相同。
可选地,N等于2。此时,该将该至少一个未解码像素点分成两组像素点,包括:将该至少一个未解码像素点中的前P个像素点确定为第一组像素点,其中,P为大于或等于1的预设数值;将该至少一个未解码像素点中除该第一组像素点之外的其余未解码像素点确定为第二组像素点。
可选地,该第j组像素点具体为该第一组像素点;该从该图像的至少一个已解码像素点中,确定该第一矩形区域中至少一个未解码像素点中每个像素点的参考像素点,还包括:从该图像的编码比特流中获取至少一个第三标识符,该至少一个第三标识符与该第一组像素点中的至少一个像素点对应,并且该至少一个第三标识符中每个第三标识符用于指示对应像素点的参考像素点所在位置;根据该第一组像素点中每个像素点对应的第三标识符,确定该每个像素点的参考像素点。
可选地,该根据图像的编码比特流,对该图像中的第一矩形区域进行解码处理,包括:对该第一矩形区域的待解码片段进行熵解码处理,得到该待解码片段的量化参数,其中,该第一矩形区域包括至少一个片段,每个片段包括至少一个像素点;根据该待解码片段的量化参数,对该待解码片段进行反量化处理,得到该待解码片段的残差数据;根据该待解码片段的参 考数据,对该待解码片段的残差数据进行反预测处理,得到该待解码片段的解码结果。
可选地,获取图像的编码比特流中与待解码片段对应的第四标识符;根据该待编码片段对应的第四标识符,确定该待解码片段的参考数据为该待解码片段的上侧数据或左侧数据,其中,该待解码片段的左侧数据包括位于该待解码片段左侧的至少一个第一像素点的数据,该待解码数据的上侧数据包括位于该待解码片段上方的至少一个第二像素点的数据;根据该待解码片段的参考数据,对该待解码片段进行解码处理。
该图像可以包括至少一个矩形区域,每个矩形区域包括至少一个片段,每个片段包括至少一个像素点,其中,长度相同的矩形区域对应的编码比特数少于或等于预设的比特数。
可选地,该图像的编码比特流可以包括与该图像包括的至少一个片段中每个片段对应的第四标识符,每个片段对应的第四标识符用于标识该每个片段的参考数据(或参考像素点)所在位置。
在第二方面的第一种可能的实现方式中,该根据该参考数据,对该待解码片段进行解码处理,包括:对该待解码片段进行熵解码处理,得到该待解码片段的量化参数;根据该待解码片段的量化参数,对该待解码片段进行反量化处理,得到该待解码片段的残差数据;根据该参考数据,对该待解码片段的残差数据进行反预测(或补偿)处理,得到该待解码片段的解码结果。
第三方面,提供了一种编码装置,用于执行上述第一方面或第一方面的任意可能的实现方式中的方法。
具体地,该装置包括用于执行上述第一方面或第一方面的任意可能的实现方式中的方法的单元。
第四方面,提供了一种解码装置,用于执行上述第二方面或第二方面的任意可能的实现方式中的方法。
具体地,该装置包括用于执行上述第二方面或第二方面的任意可能的实现方式中的方法的单元。
第五方面,提供了另一种编码装置,包括:存储器和处理器,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,并且当该处理器执行该存储器存储的指令时,该执行使得该处理器执行第一方面或第一 方面的任意可能的实现方式中的方法。
第六方面,提供了另一种解码装置,包括:存储器和处理器,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,并且当该处理器执行该存储器存储的指令时,该执行使得该处理器执行第二方面或第二方面的任意可能的实现方式中的方法。
第七方面,提供了一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行第一方面或第一方面的任意可能的实现方式中的方法的指令。
第八方面,提供了一种计算机可读介质,用于存储计算机程序,该计算机程序包括用于执行第二方面或第二方面的任意可能的实现方式中的方法的指令。
第九方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面或第一方面中的任一可能的实现方式中的方法。
第十方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第二方面或第二方面中的任一可能的实现方式中的方法。
第十一方面,提供了编解码系统,包括第三方面中的任意编码装置和第四方面中的任意解码装置,或者包括第五方面中的任意编码装置和第六方面中的任意解码装置。
附图说明
图1是本申请实施例提供的编码方法的示意性流程图。
图2是本申请实施例提供的解码方法的示意性流程图。
图3是本申请实施例提供的编码装置的示意性框图。
图4是本申请实施例提供的解码装置的示意性框图。
图5是本申请实施例提供的编码装置的另一示意性框图。
图6是本申请实施例提供的解码装置的另一示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方 案进行描述。
本申请实施例可以应用于各种编解码系统,例如固定压缩倍率的编解码系统或自适应压缩倍率的编解码系统,本申请实施例对此不做限定。
在本申请实施例中,可以将图像分成至少一个矩形区域,每个矩形区域包括一个或多个像素点。可选地,可以将一个矩形区域称为一个tile或其他名称,但本申请实施例对此不做限定。可选地,如果将图像分成多个矩形区域,则图像中的不同矩形区域可以具有相同或不同的长度。作为一个例子,与图像边界间隔分布的至少一个矩形区域可以具有相同的长度。可选地,在本申请实施例中,矩形区域的宽度可以为1个像素点或多个像素点,本申请实施例对此不做限定。
例如,可以按照第一预设尺寸将一幅图像划分成多个矩形区域,不位于图像边界的矩形区域可以具有相同的大小。位于图像边界的矩形区域受图像尺寸的限制,其大小可以由第一预设尺寸和图像尺寸共同决定,可能与其它不位于图像边界的矩形区域的大小相同,也可能与其他矩形区域的大小不相同。例如,假设图像长度为3840个像素,并且第一预设尺寸为1056个像素,可以按照从左至右的顺序,将图像分成四个矩形区域,其中,第1到第3个矩形区域的长度可以均为1056个像素,第4个矩形区域位于图像边界,如果该矩形区域的长度仍为1056个像素,则该矩形区域会超出图像边界,此时,可以将第4个矩形区域的长度设置为672个像素,但本申请实施例不限于此。
在本申请实施例中,矩形区域允许使用的编码比特数可以存在上限。例如,长度相同的矩形区域对应的编码比特数少于或等于预设的比特数。
具体地,当所述的编码比特数等于预设的比特数时,长度相同的矩形区域对应相同的编码比特数,即以固定倍率对该图像中的矩形区域进行编码处理。
当所述的编码比特数少于或等于预设的比特数时,所述矩形区域对应的图像的编码压缩率大于或等于所述长度相同的矩形区域对应相同的编码比特数的压缩率。
图1示出了本申请实施例提供的编码方法100。
S110,对图像的第一矩形区域中的像素点进行编码处理。
图像中的至少一个矩形区域可以包括该第一矩形区域。可选地, 可以按照一定顺序对该第一矩形区域中的像素点进行编码处理,例如可以从左到右的顺序对该第一矩形区域中的像素点进行编码处理,可选地,如果该第一矩形区域包括多行像素点,则可以以从上到下的方式对该第一矩形区域中的不同行进行编码处理,但本申请实施例不限于此。
S120,若该第一矩形区域中的前i个已编码的像素点使用的总编码比特数Bi小于或等于该第一矩形区域的最大允许使用编码比特数Bmax,并且该第一矩形区域中的第i+1个像素点需要使用的编码比特数bi+1与Bi之和大于Bmax,根据该图像中至少一个已编码的像素点的编码数据,确定该第一矩形区域中至少一个未编码像素点的编码数据,其中,该至少一个未编码像素点包括该第i+1个像素点,i为大于或等于1的整数。
具体地,假设当前已经对该第一矩形区域中的前i个像素点进行了编码处理,并且需要对该第一矩形区域中的第i+1个像素点进行编码处理,其中,1≤i≤T-1,T为该第一矩形区域包括的像素点总数,如果该第i+1个像素点需要使用的编码比特数bi+1与该前i个像素点使用的总比特数Bi之和Bi+1大于该第一矩形区域的最大允许使用编码比特数Bmax,则表明该第一矩形区域允许使用的编码比特数不够用于对该第i+1个像素点进行编码处理,也就是说,该第一矩形区域的编码比特数已用尽并且该第一矩形区域中还具有未编码的像素点。此时,可以利用像素扩展的方式,根据该图像中已编码的至少一个像素点的编码数据,确定该第一矩形区域中的包括该第i+1个像素点在内的至少一个未编码像素点的编码数据。此时,可以在不对该第一矩形区域中的该至少一个未编码像素点进行编码处理的情况下,得到该至少一个未编码像素点的编码数据,类似地,解码端也可以采用类似的方式确定该至少一个未编码像素点的解码数据。
作为一个例子,可以将该图像中已编码的至少一个像素点的编码数据直接拷贝到该至少一个未编码像素点,这样,可以将该至少一个未编码像素点的编码数据确定为该图像中已编码的至少一个像素点的编码数据。作为另一个例子,可以对该图像中已编码的至少一个像素点的编码数据进行处理,并将处理得到的数据确定为该至少一个未编码像素点的编码数据,其中,该处理可以包括求平均等一种或多种处理,本申请实施例对此不做限定。
在本申请实施例中,可选地,该图像中的至少一个已编码的像素点可以包括位于该至少一个未编码像素点左侧的已编码的像素点和/或位于 该至少一个未编码像素点上侧的至少一个已编码的像素点,其中,位于该至少一个未编码像素点左侧的已编码的像素点可以与该至少一个未编码像素点相邻,或者也可以与该至少一个未编码像素点间隔至少一个像素点;位于该至少一个未编码像素点上侧的至少一个已编码的像素点可以与该至少一个未编码像素点相邻,或者也可以与该至少一个未编码像素点之间间隔至少一个像素点,本申请实施例对此不做限定。
可选地,该图像中的至少一个已编码的像素点可以位于该第一矩形区域内,或者也可以不位于该第一矩形区域内。作为一个例子,该图像可以包括至少一个子图像,每个子图像包括至少一个矩形区域,例如,一个矩形区域可以包括一行像素点,一个子图像可以包括H行像素点,H为大于或等于1的整数,这样,一个子图像可以至少包括H个矩形区域。此时,可选地,该图像中的至少一个已编码的像素点可以位于该第一矩形区域所属子图像内,但本申请实施例不限于此。
在本申请实施例中,作为一个例子,可以从该图像的至少一个已编码的像素点中,确定该至少一个未编码像素点中每个像素点的参考像素点,并将该至少一个未编码像素点中每个像素点的编码数据确定为该每个像素点的参考像素点的编码数据。
可选地,该至少一个未编码像素点中不同像素点的参考像素点可以为相同或不同的像素点。此外,可选地,该至少一个未编码像素点中每个像素点的参考像素点可以是预先规定的。例如,该至少一个未编码像素点中每个像素点的参考像素点为位于该每个像素点上侧的已编码的像素点。再例如,该至少一个未编码像素点中每个像素点的参考像素点可以均为该第一矩形区域中位于该至少一个未编码像素点左侧的某一个像素点,例如为该第一矩形区域中最后一个已编码的像素点。再例如,该至少一个未编码像素点中每个像素点的参考像素点可以为位于该每个像素点左侧且与该每个像素点间隔P个像素点的已编码的像素点,但本申请实施例不限于此。
可选地,也可以根据该至少一个未编码像素点中每个像素点的信息,确定该每个像素点的参考像素点。例如,可以根据该至少一个未编码像素点中每个像素点的原始数据和/或位置,从该每个像素点左侧的已编码的像素点和该每个像素点上侧的已编码像素点中,确定该每个像素点的参考像素点,本申请实施例对此不做限定。
作为一个例子,可以将该至少一个未编码像素点分成N组像素点,每组像素点包括该至少一个未编码像素点中的至少一个像素点,N为大于或等于1的整数。例如,可以按照预设长度,将该至少一个未编码像素点分成N组像素点,其中,前N-1组像素点中包括的未编码的像素点的个数可以相同,第N组像素点中包括的未编码的像素点的个数可以等于该至少一个未编码像素点的总个数减去该前N-1组像素点中包括的未编码的像素点的总个数。此时,可选地,N的数值可以由该至少一个未编码像素点的总数量和每组像素点的预设长度确定。再例如,可以将该至少一个未编码像素点分成两组像素点,即N=2,其中,该两组像素点中的第一组像素点可以具有预设长度,并且将该至少一个未编码像素点中除该第一组像素点之外的其余未编码的像素点确定为第二组像素点。这样,可以无需获知该至少一个未编码像素点的总数量即可进行分组,从而降低编码复杂度。可选地,还可以采用其他方式对该至少一个未编码像素点进行分组,本申请实施例对此不做限定。
此时,对于该N组像素点中的一组或多组像素点,可以以组为单位确定该组像素点中至少一个像素点的参考像素点。例如,可以根据该N组像素点中第j组像素点的原始数据,从该第j组像素点左侧的第一已编码像素点和该第j组像素点上侧的至少一个第二已编码像素点中,确定该第j组像素点的参考像素点。
可选地,该第一已编码像素点可以与该第j组像素点位于同一行并且位于该第j组像素点的左侧,例如,该第一已编码像素点可以为该第一矩形区域中已编码的最后一个像素点,或者,该第一已编码像素点可以与该第一矩形区域中已编码的最后一个像素点间隔至少一个像素点,本申请实施例对此不做限定。可选地,该至少一个第二已编码像素点可以位于该第j组像素点的正上侧,例如,该至少一个第二已编码像素点的个数可以与该第j组像素点中包括的像素点的个数相等,并且该至少一个第二已编码像素点中的每个第二已编码像素点可以位于该第j组像素点中的一个像素点的正上侧,即该至少一个第二已编码像素点可以与该第j组像素点中的至少一个像素点一一对应,其中,该第j组像素点中的一个像素点可以与位于该像素点正上侧的第二已编码像素点相邻或间隔至少一个像素点,本申请实施例对此不做限定。
可选地,可以将该第一已编码像素点确定为该第j组像素点的参考像素点,也可以将该至少一个第二已编码像素点确定为该第j组像素点的参考像素点,其中,该第j组像素点中每个像素点的参考像素点可以具体为位于该每个像素点正上侧的第二已编码像素点,但本申请实施例不限于此。
作为一个可选实施例,可以确定该第j组像素点与第一已编码像素点的相关度,确定该第j组像素点与该至少一个第二已编码像素点之间的相关度,并且可以根据该第j组像素点与该第一已编码像素点的相关度以及该第j组像素点与该至少一个第二已编码像素点之间的相关度,将该第一已编码像素点或该至少一个第二已编码像素点确定为该第j组像素点的参考像素点。
可选地,该第j组像素点与该第一已编码像素点之间的相关度可以是根据该第j像素点中每个像素点与该第一已编码像素点之间的相关度确定的,例如,该第j组像素点与该第一已编码像素点之间的相关度可以是该第j组像素点中每个像素点与该第一已编码像素点之间的相关度之和,但本申请实施例不限于此。
可选地,该第j组像素点与该至少一个第二已编码像素点之间的相关度可以是根据该第j组像素点中每个像素点与该每个像素点上侧的第二已编码像素点之间的相关度确定的。例如,该第j组像素点与该至少一个第二已编码像素点之间的相关度可以是该第j组像素点中每个像素点与该每个像素点上侧的第二已编码像素点之间的相关度之和,但本申请实施例不限于此。
作为一个例子,可以将该第一已编码像素点和该至少一个第二已编码像素点中与该第j组像素点的相关度较大的确定为该第j组像素点的参考像素点。例如,如果该第一已编码像素点与该第j组像素点之间的相关度大于该至少一个第二已编码像素点与该第j组像素点之间的相关度,则可以将该第一已编码像素点确定为该第j组像素点的参考像素点,此时,该第j组像素点中的所有像素点具有相同的参考像素点。再例如,如果该第一已编码像素点与该第j组像素点之间的相关度小于该至少一个第二已编码像素点与该第j组像素点之间的相关度,则可以将该至少一个第二已编码像素点确定为该第j组像素点的参考像素点,此时,该第j组像素点中的每个像素点的参考像素点为该每个像素点上侧的第二已编码像素点,但本申请实施例不 限于此。
可选地,对于该N组像素点中的第N组像素点,也可以分别确定该第N组像素点中每个像素点的参考像素点。作为一个例子,可以根据该第N组像素点中每个像素点的原始数据和/或位置,从该每个像素点左侧的已编码像素点和该每个像素点上侧的已编码像素点中,确定该每个像素点的参考像素点。例如,可以确定一个像素点与其左侧的已编码像素点之间的相关度以及该像素点与其上侧的已编码像素点之间的相关度,并将相关度较大的预编码像素点确定为该像素点的参考像素点,但本申请实施例不限于此。
S130,向该第一矩形区域的编码比特流添加第一标识符,该第一标识符用于标识对该第一矩形区域的编码结束并且该第一矩形区域具有至少一个未编码像素点。
可选地,该第一标识符需要区别于该矩形区域对应的编码比特流中的编码比特,即需要保证该第一标识符在该矩形区域对应的编码比特流中的唯一性。例如,该第一标识符可以具体为结束码,并且在采用0阶哥伦布码且编码像素的比特深度(bitdepth)为12时,可以将第一标识符的图样设置为连续的14个‘0’,但本申请实施例对此不做限定。
可选地,该第一标识符可以紧邻于该第一矩形区域中第i个像素点对应的编码比特之后,但本申请实施例不限于此。
可选地,还可以向该第一矩形区域的编码比特流添加至少一个第二标识符,每个第二标识符用于标识该N组像素点中的一组像素点的参考像素点所在位置,但本申请实施例不限于此。
可选地,还可以向该第一矩形区域的编码比特流添加至少一个第三标识符,每个第三标识符用于标识第N组像素点中一个像素点的参考像素点所在位置,但本申请实施例不限于此。
在本申请实施例中,可选地,可以以固定倍率对该图像中的不同矩形区域进行编码处理。也就是说,长度相同的矩形区域对应的编码比特数少于或等于预设的比特数。
具体地,当所述的编码比特数等于预设的比特数时,长度相同的矩形区域对应相同的编码比特数,即以固定倍率对该图像中的矩形区域进行编码处理。
当所述的编码比特数少于或等于预设的比特数时,所述矩形区域 对应的图像的编码压缩率大于或等于所述长度相同的矩形区域对应相同的编码比特数的压缩率。
该处理方法的目的在于保证整幅图像的编码压缩率,同时由于不用严格保证每个矩形区域对应相同的编码比特数,从而可以提高每个矩形区域的编码灵活性并提高编码效率。
这样,本申请实施例提供的技术方案具有较低的实现复杂度,同时具有较高的编码效率。
作为一个可选实施例,可以将该图像中的至少一个矩形区域中的部分或所有矩形区域进一步划分成至少一个片段(segment),每个片段包括至少一个像素点。可选地,如果将一个矩形区域分成多个片段,则矩形区域中的不同片段可以具有相同或不同的长度。作为一个例子,与矩形区域的边界间隔分布的至少一个片段可以具有相同的长度,但本申请实施例不限于此。
在本申请实施例中,可选地,可以针对矩形区域中的每个片段确定采用左侧数据或上侧数据作为参考数据,有利于提高编码质量。
此外,在本申请实施例中,可选地,对片段的编码比特数可以不采用固定倍率进行编解码处理,从而保证矩形区域中片段的编码质量以及编码和解码的灵活性。
下面将结合具体例子,介绍本申请实施例中对矩形区域中的像素点的编码方法。
可选地,在S110中,可以确定待编码片段的参考数据。
作为一个可选实施例,可以根据待编码片段中的数据,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据。
该待编码片段的左侧数据可以包括位于该待编码片段左侧的至少一个第一像素点的数据。可选地,该至少一个第一像素点的个数可以与该待编码片段包括的像素点个数相等,或者,该至少一个第一像素点的个数也可以大于或小于该待编码片段包括的像素点个数,本申请实施例对此不做限定。
该至少一个第一像素点可以位于该待编码片段的左侧。可选地,该至少一个第一像素点可以与该待编码片段相邻,即该至少一个第一像素点中的最右侧像素点可以与该待编码片段中的最左侧像素点相邻。或者,该至 少一个第一像素点也可以与该待编码片段间隔分布,例如,该至少一个第一像素点与该待编码片段之间可以间隔至少一个像素点,即该至少一个第一像素点中的最右侧像素点可以与该待编码片段中的最左侧像素点之间间隔至少一个像素点,其中,该至少一个第一像素点与该待编码片段之间间隔的像素点个数可以小于某一阈值,即该至少一个第一像素点可以与该待编码片段临近,但本申请实施例对此不做限定。
可选地,第一像素点的数据可以指第一像素点的原始数据或已编码数据。相应地,该至少一个第一像素点的数据可以包括该至少一个第一像素点中每个第一像素点的原始数据,或者可以包括该至少一个第一像素点中每个第一像素点的已编码数据,或者可以包括该至少一个第一像素点中部分像素点的原始数据以及另一部分像素点的已编码数据,等等,本申请实施例对此不做限定。
该待编码数据的上侧数据包括位于该待编码片段上方的至少一个第二像素点的数据。可选地,该至少一个第二像素点的个数可以与该待编码片段包括的像素点个数相等,或者,该至少一个第二像素点的个数也可以大于或小于该待编码片段包括的像素点个数,本申请实施例对此不做限定。
该至少一个第二像素点可以位于该待编码片段的上方。可选地,该至少一个第二像素点可以与该待编码片段相邻。或者,该至少一个第二像素点也可以与该待编码片段间隔分布,例如,该至少一个第二像素点与该待编码片段之间可以间隔至少一个像素点,其中,该至少一个第二像素点与该待编码片段之间间隔的像素点个数可以小于某一阈值,即该至少一个第二像素点可以与该待编码片段临近,但本申请实施例对此不做限定。
可选地,第二像素点的数据可以指第二像素点的原始数据或已编码数据。相应地,该至少一个第二像素点的数据可以包括该至少一个第二像素点中每个第二像素点的原始数据,或者可以包括该至少一个第二像素点中每个第二像素点的已编码数据,或者可以包括该至少一个第二像素点中部分像素点的原始数据以及另一部分像素点的已编码数据,等等,本申请实施例对此不做限定。
在本申请实施例中,可以根据片段中包括的至少一个像素点,从该片段的左侧数据和上侧数据中,选择该片段的参考数据。具体地,可以根据待编码片段中包括的至少一个像素点,从该片段左侧的至少一个第一像素 点和该片段上方的至少一个第二像素点中,确定该片段的参考像素点。例如,可以将待编码片段左侧的至少一个第一像素点确定为该待编码片段的参考像素点,相应地,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据。再例如,也可以将待编码片段上方的至少一个第二像素点确定为该待编码片段的参考像素点,相应地,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,这里的参考数据可以具体指参考像素点的数据,本申请实施例对此不做限定。
作为一个可选实施例,可以根据该待编码片段与该至少一个第一像素点之间的相关度以及该待编码片段与该至少一个第二像素点之间的相关度,从该至少一个第一像素点和该至少一个第二像素点中,确定该待编码片段的参考像素点。相应地,可以根据该待编码片段与该待编码片段的左侧数据之间的相关度以及该待编码片段与该待编码片段的上侧数据之间的相关度,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据。
可选地,在本申请实施例中,可以根据该待编码片段中包括的至少一个像素点的数据和该待编码片段的左侧数据,确定该待编码片段与该待编码片段的左侧数据之间的相关度。作为一个例子,可以确定该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值,并根据该差值的绝对值,确定该待编码片段与该待编码片段的左侧数据之间的相关度。可选地,还可以采用该待编码片段与该待编码片段的左侧数据之间的方差或经数据变换,如哈达码(Hadamard)变换,之后的数据,确定该带编码片段与左侧数据之间的相关度。作为一个例子,该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值越小,可以表明该待编码片段与该待编码片段的左侧数据之间的相关度越大,但本申请实施例不限于此。
可选地,在本申请实施例中,该待编码片段中的数据与该编码片段的左侧数据之间的差值的绝对值可以是根据该编码片段中每个像素点的数据和与该每个像素点对应的第一像素点的数据之间的差值的绝对值得到的。例如,该待编码片段中的数据与该待编码片段的左侧数据之间的差值的绝对值可以是该编码片段中每个像素点的数据和与该每个像素点对应的第一像素点的数据之间的差值的绝对值之和的函数,该函数可以是平均值函数或均方差函数,等等,但本申请实施例不限于此。
例如,假设待编码片段的数据可以由以下集合表示:{currSegi,i=1,...,n},并假设待编码片段的左侧数据可以由以下集合表示{neiSegj,j=1,...,m},其中,n为该待编码片段包括的像素点个数,m为该至少一个第一像素点的个数。如果n=m,则该待编码片段和该待编码片段的左侧数据之间的差值diff可以由下式确定:
Figure PCTCN2017099898-appb-000001
如果n>m,则该待编码片段和该待编码片段的左侧数据之间的差值diff可以由下式确定:
Figure PCTCN2017099898-appb-000002
其中,{currSeg′i,i=1,...,m}可以是利用特定步长对待编码片段的数据{currSegi,i=1,...,n}进行采样得到的m个数据。该采样数据可以是通过对待编码片段的数据中的特定步长内的数据求平均值得到的,或者可以是通过在特定步长内抽取该待编码片段的数据中的一个点得到的,等等,本申请实施例对此不做限定。可选地,该特定步长可以是根据n和m确定的。例如,如果n等于m的整数倍,则该特定步长可选地可以为n和m的除数;或者,如果n不等于m的整数倍,则该特定步长可选地可以为n和m的除数的近似值,如n与m的除数向上取整、向下取整或四舍五入得到的数值,但本申请实施例不限于此。
如果n<m,则该待编码数据和该待编码数据的左侧数据之间的差值diff可以由下式确定:
Figure PCTCN2017099898-appb-000003
其中,{neiSeg′i,i=1,...,m}可以是利用特定步长对待编码片段的左侧数据{neiSegi,i=1,...,n}进行采样得到的n个数据。该采样数据可以是通过对待编码片段的左侧数据中的特定步长内的数据求平均值得到的,或者可以是通过在特定步长内抽取该待编码片段的左侧数据中的一个点得到的,等等,本申请实施例对此不做限定。可选地,该特定步长可以是根据n和m确定的。例如,如果m等于n的整数倍,则该特定步长可选地可以为n和m的除数;或者,如果m不等于n的整数倍,则该特定步长可选地可以为n和m的除数的近似值,如m与n的除数向上取整、向下取整或四舍五入得到的数值,但本申请实施例不限于此。
可选地,可以根据该待编码片段中包括的至少一个像素点的数据 和该待编码片段的上侧数据,确定该待编码片段与该待编码片段的上侧数据之间的相关度。其具体实现可选地可以与上述对左侧数据的处理方式类似,但本申请实施例对此不做限定。
在本申请实施例中,可选地,可以将该待编码片段的左侧数据和上侧数据中与该待编码片段相关度较大的数据,确定为该待编码片段的参考数据,但本申请实施例不限于此。
作为另一个可选实施例,如果该待编码片段仅具有可用的左侧数据而不具有可用的上侧数据,则可以将该待编码片段的左侧数据确定为该待编码片段的参考数据。可选地,如果该待编码片段仅具有可用的上侧数据而不具有可用的左侧数据,则可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,但本申请实施例不限于此。
在本申请实施例中,可选地,一个片段能够使用图像中的任意数据作为参考数据,即该片段能够使用与该片段位于同一矩形区域或不同矩形区域的图像中的任意数据作为参考数据,例如,为了提高编码质量,一个片段可以尽可能使用该片段的上侧数据(例如位于该片段上方的相邻像素点的数据)作为参考数据,无论该上侧数据对应的像素点是否与该片段属于同一矩形区域。或者,一个片段可以仅能够使用该片段所属矩形区域中的数据作为参考数据,而不能使用该片段所属矩形区域以外的数据作为参考数据,这样,能够使得图像中不同矩形区域之间的编解码之间可以相互独立。或者,可以将图像划分为至少一个子图像,每个子图像可以包括至少一个矩形区域,例如,一个矩形区域可以包括一行像素点,一个子图像可以包括H行像素点,H为大于或等于1的整数,这样,一个子图像可以至少包括H个矩形区域,但本申请实施例对此不做限定。此时,一个片段可以仅能够使用该片段所属子图像中的数据作为参考数据,例如,可以使用该片段所属子图像中与该片段属于同一矩形区域的数据,也可以使用该片段所属子图像中与该片段属于不同矩形区域的数据,而不能使用该片段所属子图像之外的数据作为参考数据,但本申请实施例不限于此。
可选地,如果待编码片段与该待编码片段所属矩形区域的上边界不相邻或间隔分布,则可以确定该待编码片段具有可用的上侧数据,相应地,如果待编码片段与该待编码片段所属矩形区域的上边界相邻,则可以确定该待编码片段不具有可用的上侧数据。或者,如果待编码片段与图像的上边界 不相邻或间隔分布,则可以确定该待编码片段具有可用的上侧数据,相应地,如果该待编码片段与图像的上边界相邻,则可以确定该待编码片段不具有可用的上侧数据。或者,如果待编码片段与该待编码片段所属子图像的上边界不相邻或间隔分布,则可以确定该待编码片段具有可用的上侧数据,相应地,如果待编码片段与该待编码片段所属子图像的上边界相邻,则可以确定该待编码片段不具有可用的上侧数据,但本申请实施例对此不做限定。
如果待编码片段与该待编码片段所属矩形区域的左边界不相邻或间隔分布,则可以确定该待编码片段具有可用的左侧数据,相应地,如果待编码片段与该待编码片段所属矩形区域的左边界相邻,则可以确定该待编码片段不具有可用的左侧数据。或者,如果待编码片段与图像的左边界不相邻或间隔分布,则可以确定该待编码片段具有可用的左侧数据,相应地,如果该待编码片段与图像的左边界相邻,则可以确定该待编码片段不具有可用的左侧数据。或者,如果待编码片段与该待编码片段所属子图像的左边界不相邻或间隔分布,则可以确定该待编码片段具有可用的左侧数据,相应地,如果待编码片段与该待编码片段所属子图像的左边界相邻,则可以确定该待编码片段不具有可用的左侧数据,但本申请实施例对此不做限定。
作为一个可选实施例,在本申请实施例中,片段是否具有可用的上侧数据和该片段是否具有可用的左侧数据可以具有相同的判断标准。
该从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据,包括:若该待编码片段具有可用的左侧数据和可用的上侧数据,从该待编码片段的可用的左侧数据和可用的上侧数据中,确定该待编码片段的参考数据。
此时,在确定待编码片段具有可用的左侧数据并且具有可用的上侧数据的情况下,从该待编码片段可用的左侧数据和可用的上侧数据中,确定该待编码片段的参考数据。
可选地,如果待编码片段仅具有可用的左侧数据,则可以将该待编码片段的左侧数据确定为该待编码片段的参考数据。
可选地,如果待编码片段仅具有可用的上侧数据,则可以将该待编码片段的上侧数据确定为该待编码片段的参考数据。
可选地,可以根据待编码片段是否位于矩形区域的边界、子图像的边界或图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上 侧数据。
作为一个例子,与待编码片段属于同一个图像中的数据可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,可以根据待编码片段是否位于图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。
可选地,可以尽量使用待编码片段的上侧数据作为待编码片段的参考数据,从而有利于提高编码质量。
可选地,若该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,则可以根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指图像中位于该待编码片段左侧的至少一个像素点的数据。
可选地,若该待编码片段与该图像的上边界间隔分布并且该待编码片段与该图像的左边界相邻,则可以根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与该图像的左边界相邻并且该待编码片段与该图像的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指图像中位于该待编码片段上方的至少一个像素点的数据。
作为另一个例子,只有与待编码片段属于同一个矩形区域中的数据才可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,假设待编码片段属于第一矩形区域,可以根据待编码片段是否位于第一矩形区域的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。
这样,能够使得对各个矩形区域之间的编码相互独立。
可选地,若该待编码片段与该第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界间隔分布,根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与该第一矩形区域的上边界相邻并且该待编码片段与该第一矩形区域的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指与该待编码片段属于同一个矩形区域(即位于第一矩形区域中)并且位于该待编码片段左侧的至少一个像素点的数据。
可选地,若该待编码片段与该第一矩形区域的上边界间隔分布并且该待编码片段与该第一矩形区域的左边界相邻,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与该第一矩形区域的左边界相邻并且该待编码片段与该第一矩形区域的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指与该待编码片段属于同一个矩形区域(即位于第一矩形区域中)并且位于该待编码片段上方的至少一个像素点的数据。
作为另一个例子,该图像可以包括至少一个子图像,每个子图像包括至少一个矩形区域。例如,每个子图像在高度方向上可以包括一个或多个矩形区域。
此时,可选地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的左侧数据和/或上侧数据。相应地,可以根据待编码片段是否位于其所属子图像的边界来确定该待编码片段是否具有可用的左侧数据和/或上侧数据。
可选地,若该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该待编码片段所属子图像的左边界间隔分布,根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与其所属子图像的上边界相邻并且该待编码片段与其所属子图像的左边界间隔分布,则该待编码片段可以具有可用的左侧数据并且不具有可用的上侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指与该待编码片段属于同一个子图像且位于该待编码片段左侧的至少一个像素点的数据。
可选地,若该待编码片段与该待编码片段所属子图像的上边界间隔分布并且该待编码片段与该待编码片段所属子图像的左边界相邻,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
具体地,如果该待编码片段与其所属子图像的左边界相邻并且该待编码片段与其所属子图像的上边界间隔分布,则该待编码片段可以具有可用的上侧数据并且不具有可用的左侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指与该待编码片段属于同一个子图像并且位于该待编码片段上方的至少一个像素点的数据。
作为另一个可选实施例,也可以根据不同的标准确定该待编码片段是否具有可用的上侧数据和左侧数据。例如,待编码片段可以将同一子图像中的上侧数据作为可用的上侧数据而仅可以将同一个矩形区域中的左侧数据作为可用的左侧数据。再例如,待编码片段可以将同一子图像中的左侧数据作为可用的左侧数据而仅可以将同一个矩形区域中的左侧数据作为可用的左侧数据,等等。
可选地,若该待编码片段与该待编码片段所属子图像的左边界相邻并且该待编码片段与该图像的上边界间隔分布,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
具体地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的左侧数据,而图像中位于该待编码片段上侧的数据可以作为该待编码片段的可用的上侧数据。相应地,可以根据待编码片段是否位于其所属子图像的左边界来确定该待编码片段是否具有可用的左侧数据,并且可以根据待编码片段是否位于图像的上边界来确定该待编码片段是否具有可用的上侧数据。
可选地,若该待编码片段与该其所属子图像的左边界相邻并且该待编码片段与图像的上边界间隔分布,此时,无论该待编码片段是否处于其所属子图像的上边界,都可以认为其具有可用的上侧数据。此时,可以将该待编码片段的上侧数据确定为该待编码片段的参考数据,其中,该待编码片段的上侧数据可以具体指图像中位于该待编码片段上方的至少一个像素点的数据。
可选地,若该待编码片段与该待编码片段所属子图像的上边界相 邻并且该待编码片段与该图像的左边界间隔分布,根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。
具体地,只有与待编码片段属于同一个子图像中的数据才可以作为该待编码片段可用的上侧数据,而图像中位于该待编码片段左侧的数据可以作为该待编码片段的可用的左侧数据。相应地,可以根据待编码片段是否位于其所属子图像的上边界来确定该待编码片段是否具有可用的上侧数据,并且可以根据待编码片段是否位于图像的左边界来确定该待编码片段是否具有可用的左侧数据。
可选地,若该待编码片段与该其所属子图像的上边界相邻并且该待编码片段与图像的左边界间隔分布,此时,无论该待编码片段是否处于其所属子图像的左边界,都可以认为其具有可用的左侧数据。此时,可以将该待编码片段的左侧数据确定为该待编码片段的参考数据,其中,该待编码片段的左侧数据可以具体指图像中位于该待编码片段左侧的至少一个像素点的数据。
作为另一个可选实施例,该待编码片段可以不具有可用的上侧数据并且不具有可用的左侧数据,例如,该待编码片段与图像的上边界、该待编码片段所属子图像的上边界或该编码片段所属矩形区域的上边界相邻,并且该待编码片段与图像的左边界、该待编码片段所属子图像的左边界或该编码片段所属矩形区域的左边界相邻,此时,如果该待编码片段的长度大于某一阈值,即该待编码片段包括的位于同一行的像素点的个数大于某一阈值,则可以将该待编码片段中的前面至少一个像素点的数据作为该待编码片段中的后面至少一个像素点的参考数据。
例如,如果该待编码片段包括的位于同一行的像素点个数T大于N,则可以将该待编码片段中的前N个像素点的预测值确定为预设数值,例如,可以将1<<(BitDepth-1)确定为该前N个像素点的预测值,其中,<<为向左移位运算符,BitDepth为像素比特深度,表示每个未编码像素使用的编码比特个数。对该待编码片段中的剩余的(T-N)个像素点进行编码处理时,可以将位于像素点i左侧并且与像素点i间隔L个像素点的像素点j作为像素点i的参考像素,但本申请实施例不限于此。其中,作为参考像素的像素点j的值可以为像素点j的原始像素点的值也可以为像素点j的编码重构像素点的值。
可选地,在本申请实施例中,可以以并行度M对片段中的像素点进行编/解码处理,即可以同时对M个像素点进行编/解码处理,其中,M为大于或等于1的整数。例如,该待编码片段中的每M个相邻像素点可以对应于相同的参考像素点,其中,该M个相邻像素点可以位于同一行,但本申请实施例对此不做限定。
可选地,在本申请实施例中,N可以由M和时序逻辑延迟L决定,所述的时序逻辑延迟由硬件设计的结构决定,如由芯片流水设计的级数决定,其中,L可以是编码端的像素编码延迟值和解码端的像素解码延迟值的最大值,但本申请实施例不限于此。
可选地,在S110中,在确定了待编码片段的参考数据之后,可以根据该参考数据,对该待编码片段进行编码处理,得到该待编码片段的编码比特流。
作为一个例子,可以根据该参考数据,对该待编码片段进行预测处理,得到该待编码片段的预测残差。然后,可以利用该待编码片段的量化参数,对该待编码片段的预测残差进行量化处理,得到该待编码片段的量化结果。然后,可以对该待编码片段的量化结果进行熵编码处理,得到该待编码片段的编码结果。
具体地,待编码片段的预测残差可以包括该待编码片段中每个像素点的残差值的绝对值,其中,作为一个例子,像素点的残差值的绝对值可以是该像素点的原始数据与该像素点的参考像素点的原始数据之间的差值的绝对值,但本申请实施例对此不做限定。
可选地,该待编码片段的量化结果可以是通过该待编码片段中每个像素点的残差进行量化处理得到的。本申请实施例中,该量化处理可以为H.264/AVC标准中的量化、H.265/HEVC标准中的量化、AVS1-P2标准中的量化、AVS2-P2标准中的量化或自行设计的量化表,等等,本申请实施例对此不做限定。
在本申请实施例中,熵编码处理可以为无损编码处理,具体可以采用N阶哥伦布码(Nth order Golomb code)、基于内容的自适应可变长度编码(context-based adaptive variable length coding,CAVLC)、基于内容的自适应二进制算术编码(context-based adaptive binary arithmetic coding,CABAC)等方式,本申请实施例对此不做限定。
作为另一个可选实施例,还可以根据该参考数据,确定该待编码片段的量化参数。例如,可以根据该参考数据,对原始量化参数进行更新处理,得到该待编码片段的量化参数。其中,该原始量化参数可以为该待编码片段的初始量化参数,例如,该原始量化参数可以为该图像的初始量化参数,或者该待编码片段的上一片段的量化参数,等等,本申请实施例对此不做限定。
可选地,在本申请实施例中,量化参数可以包括量化步长(quantization step)、与量化步长相关或用于指示量化步长的数值(例如QP)、量化矩阵或量化矩阵索引,等等,本申请实施例对此不做限定。
可选地,可以根据该参考数据,确定该待编码片段的复杂度,并根据该待编码片段的复杂度,确定该待编码片段的量化参数。
作为一个例子,可以根据该待编码片段的复杂度和该待编码片段所属矩形区域的总复杂度,确定该待编码片段的量化参数。
在本申请实施例中,可选地,可以根据该待编码片段的参考数据和该待编码片段中每个像素点的数据,确定该每个像素点的残差,并根据该待编码片段中每个像素点的残差,确定该待编码片段的复杂度。其中,可选地,可以根据该待编码片段中每个像素点的数据以及该每个像素点的参考像素点的数据,确定该每个像素点的残差,其中,该待编码片段的参考数据可以包括该待编码片段中每个像素点的参考像素点的数据,但本申请实施例对此不做限定。
可选地,该待编码片段所属矩形区域的总复杂度可以是根据该待编码片段所属矩形区域中包括的每个片段的复杂度确定的,例如,一个矩形区域的总复杂度可以是该矩形区域中包括的多个片段的复杂度的平均值,但本申请实施例不限于此。
作为一个可选实施例,可以通过比较该待编码片段的复杂度和该待编码片段所属矩形区域的总复杂度,确定该待编码片段的量化参数。例如,如果该待编码片段的复杂度大于该待编码片段所属矩形区域的总复杂度,则可以减小原始量化参数,得到该待编码片段的量化参数。再例如,如果该待编码片段的复杂度小于该待编码片段所属矩形区域的总复杂度,则可以增加原始量化参数,得到该待编码片段的量化参数。再例如,如果该待编码片段的复杂度等于该待编码片段所属矩形区域的总复杂度,则可以保持原始量化 参数不变,即该待编码片段的量化参数等于原始量化参数,本申请实施例对此不做限定。
在确定了该待编码片段的量化参数之后,可以利用该待编码片段的量化参数,对该待编码片段进行编码处理,但本申请实施例对此不做限定。
这样,在矩形区域对应的编码比特数固定的条件下,根据矩形区域中的每个片段包括的数据,确定该每个片段的量化参数和对应的编码比特数,有利于提高编码质量。
在本申请实施例中,可选地,在确定了该待编码片段的参考数据之后,可以向该待编码片段的编码比特流添加第四标识符,用于指示该待编码片段的参考数据所在位置。例如,该第四标识符可以用于指示该待编码片段的参考数据点位于该待编码片段的左侧还是上侧,或者该第四标识符可以进一步指示该待编码片段的参考数据点的坐标,例如与该待编码片段之间间隔几个像素点等等,本申请实施例对此不做限定。
作为一个例子,可以在该图像的编码比特流的头信息中添加每个片段对应的第四标识符,以标识该片段的参考数据所在位置,但本申请实施例对此不做限定。
在本申请实施例中,作为一个例子,对于矩形区域中的前一个或多个片段中的每个片段,可以确定将片段的左侧数据或上侧数据作为该片段的参考数据,并根据该片段的参考数据,对该片段进行编码处理,直到该矩形区域中的已编码像素点使用的总编码比特数小于或等于该矩形区域允许使用的编码比特数,并且该矩形区域中的当前待编码的像素点需要使用的编码比特数与前述已编码像素点使用的总编码比特数大于该矩形区域允许使用的编码比特数。然后,对于该矩形区域中剩余的未编码的像素点,可以利用该矩形区域中已编码的像素点的编码数据或已编码数据,确定未编码的像素点的编码数据或已编码数据,能够提高编码质量。
图2示出了本申请实施例提供的解码方法200。
S210,根据图像的编码比特流,对该图像中的第一矩形区域进行解码处理。
可选地,可以将该第一矩形区域分成至少一个片段,每个片段包括至少一个像素点,并以片段为单位进行解码处理。
可选地,该图像的编码比特流可以包括与该图像包括的至少一个 片段中每个片段对应的第四标识符,其中,每个片段对应的第四标识符可以用于标识该每个片段的参考数据(或参考像素点)所在位置。此时,可以根据该待解码片段对应的第四标识符,确定该待解码片段的参考数据,并根据该待解码片段的参考数据,确定该待编码片段进行解码处理。
在本申请实施例中,不同片段可以对应于不同的第四标识符,相应地,可以根据每个片段对应的第四标识符,确定该每个片段的参考数据所在位置,但本申请实施例不限于此。
作为一个例子,可以对该第一矩形区域的待解码片段进行熵解码处理,得到该待解码片段的量化参数。然后,可以根据该待解码片段的量化参数,对该待解码片段进行反量化处理,得到该待解码片段的残差数据。然后,可以根据该待解码片段的参考数据,对该待解码片段的残差数据进行反预测处理或补偿处理,得到该待解码片段的解码结果,但本申请实施例对此不做限定。
S220,若该编码比特流包括第一标识符,根据该图像中至少一个已解码像素点的解码数据,确定该第一矩形区域中至少一个未解码像素点的解码数据,其中,该第一标识符用于标识对该第一矩形区域的编码结束并且该第一矩形区域中具有至少一个未编码像素点。
可选地,可以从该图像的至少一个已解码像素点中,确定该第一矩形区域中至少一个未解码像素点中每个像素点的参考像素点,并且将该至少一个未解码像素点中每个像素点的解码数据确定为该每个像素点的参考像素点的解码数据。
可选地,可以根据该图像的编码比特流中包括的至少一个第二标识符,确定该第一矩形中每个未解码像素点的参考像素点。
作为一个例子,可以将该至少一个未解码像素点分成N组像素点,每组像素点包括该至少一个未编码像素点中的至少一个像素点。此时,针对该N组像素点中的一组或多组像素点,可以从该图像的至少一个已解码像素点中,确定第j组像素点的参考像素点,1≤j≤N。
可选地,可以根据该至少一个未解码像素点的个数,将该至少一个未解码像素点分成N组像素点,其中,该N组像素点中的前N-1组像素点中包括的未解码像素点的个数相同。此时,第N组像素点的个数可以等于该至少一个未解码像素点的个数减去该前N-1组像素点包括的像素点总数, 但本申请实施例不限于此。可选地,该前N-1组像素点中包括的像素点的个数可以预先定义,但本申请实施例不限于此。
可选地,也可以将该至少一个未解码像素点分成两组像素点,其中,可选地,可以将该至少一个未解码像素点中的前P个像素点确定为第一组像素点,其中,P为大于或等于1的预设数值,并且将该至少一个未解码像素点中除该第一组像素点之外的其余未解码像素点确定为第二组像素点。此时,可以无需获知该至少一个未解码像素点的总个数,但本申请实施例不限于此。
在本申请实施例中,可以以多种方式确定该第j组像素点的参考像素点。作为一个例子,可以从该图像的编码比特流中获取第二标识符,该第二标识符用于指示该第j组像素点的参考像素点所在位置,并且可以根据该第二标识符,确定该第j组像素点中每个像素点的参考像素点。
可选地,该图像的编码比特流中可以包括该N组像素点中至少一组像素点对应的第二标识符,每组像素点对应的第二标识符可以用于标识该每组像素点的参考像素点所在位置。此时,可以根据该至少一组像素点中每组像素点对应的第二标识符,确定该每组像素点的参考像素点。
可选地,对于该N组像素点中的第N组像素点,可以分别针对该第N组像素点中的每个像素点确定参考像素点。例如,可以从该图像的编码比特流中获取至少一个第三标识符,该至少一个第三标识符与该第N组像素点中的至少一个像素点对应,并且该至少一个第三标识符中每个第三标识符用于指示对应像素点的参考像素点所在位置,并且根据该第二组像素点中每个像素点对应的第三标识符,确定该每个像素点的参考像素点。
可选地,本申请实施例提供的解码方法的实现原理可以与编码方法类似,具体可以参见上文对编码方法的描述,为了简洁,这里不再赘述。
图3示出了本申请实施例提供的编码装置300,包括:
编码单元310,用于对图像的第一矩形区域中的像素点进行编码处理,其中,该图像包括至少一个矩形区域,每个矩形区域包括至少一个像素点;
边界处理单元320,用于若该第一矩形区域中的前i个已编码的像素点使用的总编码比特数Bi小于或等于该第一矩形区域的最大允许使用编码比特数Bmax,并且该第一矩形区域中的第i+1个像素点需要使用的编码 比特数bi+1与Bi之和大于Bmax,根据该图像中至少一个已编码的像素点的编码数据,确定该第一矩形区域中至少一个未编码像素点的编码数据,其中,该至少一个未编码像素点包括该第i+1个像素点,1≤i≤T-1,T为该第一矩形区域包括的像素点总数,以及向该第一矩形区域的编码比特流添加第一标识符,该第一标识符用于标识对该第一矩形区域的编码结束并且该第一矩形区域具有至少一个未编码像素点。
可选地,该边界处理单元320具体用于:
从该图像中至少一个已编码的像素点中,确定该至少一个未编码像素点中每个像素点的参考像素点;以及
将该至少一个未编码像素点中的每个像素点的编码数据(或已编码数据)确定为该每个像素点的参考像素点的编码数据(或已编码数据)。
可选地,该至少一个未编码像素点中每个像素点的参考像素点位于该每个像素点的左侧或上侧。
可选地,该至少一个未编码像素点中每个像素点的参考像素点与该每个像素点位于同一矩形区域或不同矩形区域。
可选地,该边界处理单元320具体用于:
将该至少一个未编码像素点分成N组像素点,每组像素点包括该至少一个未编码像素点中的至少一个像素点,N为大于或等于1的整数;以及
从该图像中至少一个已编码的像素点中,确定该N组像素点中的第j组像素点的参考像素点,1≤j≤N。
可选地,该边界处理单元320具体用于:根据该第j组像素点的原始数据,从该第j组像素点左侧的第一已编码像素点和该第j组像素点上侧的至少一个第二已编码像素点中,确定该第j组像素点的参考像素点。
可选地,该边界处理单元320具体用于:
根据该第j组像素点中每个像素点的原始数据,确定该每个像素点与该第一已编码像素点之间的相关度;
根据该第j组像素点中每个像素点的原始数据,确定该每个像素点与该每个像素点上侧的第二已编码像素点之间的相关度;
根据该第j组像素点中每个像素点与该第一已编码像素点之间的相关度以及该第j组像素点中每个像素点与该每个像素点上侧的第二已编码 像素点之间的相关度,将该第一已编码像素点或该至少一个第二已编码像素点确定为该第j组像素点的参考像素点。
可选地,该第一已编码像素点具体为该前i个已编码的像素点中的最后一个已编码的像素点,或者该第一已编码像素点与该最后一个已编码的像素点之间间隔至少一个像素点。
可选地,该第j组像素点中每个像素点与位于该每个像素点上侧的第二已编码像素点相邻或间隔至少一个像素点。
可选地,该边界处理单元320还用于:向该第一矩形区域的编码比特流添加第二标识符,该第二标识符用于指示该第j组像素点的参考像素点所在位置。
可选地,该边界处理单元320具体用于:根据该至少一个未编码像素点的个数,将该至少一个未编码像素点分成N组像素点,其中,该N组像素点中的前N-1组像素点中包括的未编码像素点的个数相同。
可选地,N等于2。
此时,该边界处理单元320具体用于:
将该至少一个未编码像素点中的前P个像素点确定为第一组像素点,其中,P为大于或等于1的预设数值;
将该至少一个未编码像素点中除该第一组像素点之外的其余未编码像素点确定为第二组像素点。
可选地,该第j组像素点具体为该第一组像素点,相应地,该边界处理单元320具体用于:根据该第二组像素点中每个像素点的原始数据,从该每个像素点左侧的已编码像素点和该每个像素点上侧的已编码像素点中,确定该每个像素点的参考像素点。
可选地,该边界处理单元320还用于:向该第一矩形区域的编码比特流添加至少一个第三标识符,该至少一个第三标识符与该第二组像素点中的至少一个像素点对应,并且该至少一个该第三标识符中每个第三标识符用于指示对应像素点的参考像素点所在位置。
可选地,该编码单元310具体用于:
确定该第一矩形区域中的待编码片段的参考数据,其中,该第一矩形区域包括至少一个片段,每个片段包括至少一个像素点;
根据该参考数据,对该待编码片段进行预测处理,得到该待编码 片段的预测残差;
利用该待编码片段的量化参数,对该待编码片段的预测结果进行量化处理,得到该待编码片段的量化结果;
对该待编码片段的量化结果进行熵编码处理,得到该待编码片段的编码结果。
可选地,该编码单元310具体用于:根据该待编码片段中的数据,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据,其中,该待编码片段的左侧数据包括位于该待编码片段左侧的至少一个第一像素点的数据,该待编码数据的上侧数据包括位于该待编码片段上侧的至少一个第二像素点的数据。
在本申请实施例中,图像可以包括至少一个矩形区域,每个矩形区域包括至少一个片段,每个片段可以包括至少一个像素点。
在本申请实施例中,可选地,长度相同的矩形区域对应的编码比特数少于或等于预设的比特数。
具体地,当所述的编码比特数等于预设的比特数时,长度相同的矩形区域对应相同的编码比特数,即以固定倍率对该图像中的矩形区域进行编码处理。
当所述的编码比特数少于或等于预设的比特数时,所述矩形区域对应的图像的编码压缩率大于或等于所述长度相同的矩形区域对应相同的编码比特数的压缩率。
所述处理方法的目的在于保证整幅图像的编码压缩率,同时由于不用严格保证每个矩形区域对应相同的编码比特数,从而可以提高每个矩形区域的编码灵活性并提高编码效率。
在本申请实施例中,待编码片段的左侧数据可以包括位于该待编码片段左侧的至少一个第一像素点的数据,该待编码数据的上侧数据可以包括位于该待编码片段上方的至少一个第二像素点的数据。
待编码片段的参考数据可以指该待编码片段的参考数据点的数据。相应地,确定待编码片段的参考数据的过程可以包括确定该待编码片段的参考数据点,其中,该待编码片段的参考数据点所在位置可以为待编码片段的左侧或上侧,具体可以根据待编码片段的数据和/或位置确定,本申请实施例对此不做限定。
可选地,该至少一个第一像素点可以与该待编码片段相邻或者与该待编码片段临近但间隔分布。
可选地,该至少一个第一像素点的数据可以包括该至少一个第一像素点的原始数据或该至少一个第一像素点的已编码数据。
可选地,该至少一个第二像素点可以与该待编码片段相邻或者与该待编码片段临近但间隔分布。
可选地,该至少一个第二像素点的数据可以包括该至少一个第二像素点的原始数据或该至少一个第二像素点的已编码数据。
作为一个例子,编码单元310可以具体用于:
根据该待编码片段中的数据和该至少一个第一像素点的数据,确定该待编码片段与该待编码片段的左侧数据之间的相关度;
根据该待编码片段中的数据和该至少一个第二像素点的数据,确定该待编码片段与该待编码片段的上侧数据之间的相关度;
根据该待编码片段与该待编码片段的左侧数据之间的相关度以及该待编码片段与该待编码片段的上侧数据之间的相关度,从该待编码片段的左侧数据和上侧数据中,确定该待编码片段的参考数据。
可选地,该编码单元310具体用于:将该待编码片段的左侧数据和上侧数据中与该待编码片段之间相关度较大的数据,确定为该待编码片段的参考数据。
可选地,该编码模块310还可以用于:向该待编码片段的编码比特流添加第四标识符,该第四标识符用于指示该待编码片段的参考数据所在位置。
可选地,该编码单元310还用于:在利用该待编码片段的量化参数,对该待编码片段的预测结果进行量化处理之前,根据该参考数据,确定该待编码片段对应的量化参数。
可选地,该编码单元310具体用于:
根据该待编码片段的参考数据和该待编码片段中的数据,确定该待编码片段的复杂度;
根据该待编码片段的复杂度,确定该待编码片段的量化参数。
可选地,该编码单元310具体用于:
根据该参考数据和该待编码片段中的数据,确定该待编码片段中 每个像素点的残差;
根据该待编码片段中每个像素点的残差,确定该待编码片段的复杂度。
可选地,该编码单元310具体用于:
根据该待编码片段所属矩形区域中的每个片段的复杂度,确定该待编码片段所属矩形区域的复杂度;
通过比较该待编码片段的复杂度和该待编码片段所属矩形区域的复杂度,确定该待编码片段的量化参数。
作为一个例子,该编码单元310可以具体用于:若该待编码片段具有可用的左侧数据和可用的上侧数据,从该待编码片段的可用的左侧数据和可用的上侧数据中,确定该待编码片段的参考数据。
此时,如果该待编码片段仅具有可用的左侧数据或上侧数据,则该编码单元310可以将该待编码片段具有的可用的左侧数据或上侧数据确定为该待编码片段的参考数据。
可选地,如果该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界相邻,该编码单元310还可以用于将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。
可选地,如果该待编码片段与该图像的上边界相邻并且该待编码片段与该图像的左边界间隔分布,该编码单元310还可以用于根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。
可选地,如果该待编码片段与该图像的上边界间隔分布并且该待编码片段与该图像的左边界相邻,该编码单元310还可以用于根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
可选地,如果该待编码片段与该待编码片段所属矩形区域的上边界相邻并且该待编码片段与该待编码片段所属矩形区域的左边界相邻,该编码单元310还可以用于将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。
可选地,如果该待编码片段与该待编码片段所属矩形区域的上边界相邻并且该待编码片段与该待编码片段所属矩形区域的左边界间隔分布,该编码单元310还可以用于根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理;
可选地,如果该待编码片段与该待编码片段所属矩形区域的上边界间隔分布并且该待编码片段与该待编码片段所属矩形区域的左边界相邻,该编码单元310还可以用于根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
可选地,如果该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该待编码片段所属子图像的左边界相邻,该编码单元310还可以用于将该待编码片段中的前N个像素点的预测值确定为预设数值,并且根据该前N个像素点的数据,对该待编码片段中的剩余的(T-N)个像素点进行编码处理,其中,T为该待编码片段中包括的像素点的数量,1≤N≤T。
可选地,如果该待编码片段与该待编码片段所属子图像的上边界相邻并且该待编码片段与该待编码片段所属子图像的左边界间隔分布,该编码单元310还可以用于根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。
可选地,如果该待编码片段与该待编码片段所属子图像的上边界间隔分布并且该待编码片段与该待编码片段所属子图像的左边界相邻,根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
可选地,如果该待编码片段与该待编码片段所属子图像的上边界和左边界相邻并且该待编码片段与该图像的上边界间隔分布,该编码单元310还可以用于根据该待编码片段的上侧数据,对该待编码片段中的像素点进行编码处理。
可选地,如果该待编码片段与该待编码片段所属子图像的上边界和左边界相邻并且该待编码片段与该图像的左边界间隔分布,该编码单元310还可以用于根据该待编码片段的左侧数据,对该待编码片段中的像素点进行编码处理。
可选地,该待编码片段中的每M个相邻像素点可以对应于相同的参考像素点,其中,该待编码片段的参考数据包括该参考像素点的数据,M ≥1。
应理解,上文对编码装置300的描述仅是示例性地,在某些情况下,编码装置300也可以不包括上述一个或多个模块,本申请实施例对此不做限定。
还应理解,这里的装置300以功能模块的形式体现。在一个可选例子中,本领域技术人员可以理解,装置300可以具体为上述实施例中的编码方法的执行主体,装置300可以用于执行上述方法实施例中的各个流程和/或步骤,为避免重复,在此不再赘述。
图4示出了本申请实施例提供的解码装置400,包括:
解码单元410,用于根据图像的编码比特流,对该图像中的第一矩形区域进行解码处理,其中,该图像包括至少一个矩形区域,每个矩形区域包括至少一个像素点;
边界处理单元420,用于若该编码比特流包括第一标识符,根据该图像中至少一个已解码像素点的解码数据,确定该第一矩形区域中至少一个未解码像素点的解码数据,其中,该第一标识符用于标识对该第一矩形区域的编码结束并且该第一矩形区域中具有至少一个未编码像素点。
可选地,该边界处理单元420具体用于:
从该图像的至少一个已解码像素点中,确定该第一矩形区域中至少一个未解码像素点中每个像素点的参考像素点;
将该至少一个未解码像素点中每个像素点的解码数据(或已解码数据)确定为该每个像素点的参考像素点的解码数据(或已解码数据)。
可选地,该边界处理单元420具体用于:
将该至少一个未解码像素点分成N组像素点,每组像素点包括该至少一个未编码像素点中的至少一个像素点,N为大于或等于1的整数;
从该图像的至少一个已解码像素点中,确定该N组像素点中的第j组像素点的参考像素点,1≤j≤N。
可选地,该边界处理单元420具体用于:
从该图像的编码比特流中获取第二标识符,该第二标识符用于指示该第j组像素点的参考像素点所在位置;
根据该第二标识符,确定该第j组像素点中每个像素点的参考像素点。
可选地,该第j组像素点的参考像素点位于该第j组像素点的左侧,并且为该第一矩形区域的最后一个已编码的像素点,或者该第j组像素点的参考像素点与该最后一个已编码的像素点之间间隔至少一个像素点。
可选地,该边界处理单元420具体用于:根据该至少一个未解码像素点的个数,将该至少一个未解码像素点分成N组像素点,其中,该N组像素点中的前N-1组像素点中包括的未解码像素点的个数相同。
可选地,N等于2。相应地,该边界处理单元420具体用于:
将该至少一个未解码像素点中的前P个像素点确定为第一组像素点,其中,P为大于或等于1的预设数值;
将该至少一个未解码像素点中除该第一组像素点之外的其余未解码像素点确定为第二组像素点。
可选地,该第j组像素点具体为该第一组像素点。此时,该边界处理单元420具体用于:
从该图像的编码比特流中获取至少一个第三标识符,该至少一个第三标识符与该第二组像素点中的至少一个像素点对应,并且该至少一个第三标识符中每个第三标识符用于指示对应像素点的参考像素点所在位置;
根据该第二组像素点中每个像素点对应的第三标识符,确定该每个像素点的参考像素点。
可选地,该解码单元410具体用于:
对该第一矩形区域的待解码片段进行熵解码处理,得到该待解码片段的量化参数,其中,该第一矩形区域包括至少一个片段,每个片段包括至少一个像素点;
根据该待解码片段的量化参数,对该待解码片段进行反量化处理,得到该待解码片段的残差数据;
根据该待解码片段的参考数据,对该待解码片段的残差数据进行反预测处理,得到该待解码片段的解码结果。
可选地,该解码单元410具体用于:
获取与该待解码片段对应的第四标识符,其中,该待解码片段对应的第四标识符用于标识该待解码片段的参考数据所在位置;
根据该待编码片段对应的第四标识符,确定该待解码片段的参考数据为该待解码片段的上侧数据或左侧数据,其中,该待解码片段的左侧数 据包括位于该待解码片段左侧的至少一个第一像素点的数据,该待解码数据的上侧数据包括位于该待解码片段上方的至少一个第二像素点的数据;
根据该待解码片段的参考数据,对该待解码片段进行解码处理。
应理解,这里的装置400以功能模块的形式体现。在一个可选例子中,本领域技术人员可以理解,装置400可以具体为上述实施例中的解码方法的执行主体,装置400可以用于执行上述方法实施例中的各个流程和/或步骤,为避免重复,在此不再赘述。
还应理解,在本申请实施例中,术语“单元”可以指应用特有集成电路(application specific integrated circuit,ASIC)、电子电路、用于执行一个或多个软件或固件程序的处理器(例如共享处理器、专有处理器或组处理器等)和存储器、合并逻辑电路和/或其它支持所描述的功能的合适组件。
图5示出了本申请实施例提供的另一编码装置,包括:处理器510和存储器520,其中,该存储器520用于存储指令,该处理器510用于执行该存储器存储的指令,其中,对存储器520中存储的该指令的执行使得该处理器510执行以下操作:
对图像的第一矩形区域中的像素点进行编码处理,其中,该图像包括至少一个矩形区域,每个矩形区域包括至少一个像素点;
若该第一矩形区域中的前i个已编码的像素点使用的总编码比特数Bi小于或等于该第一矩形区域的最大允许使用编码比特数Bmax,并且该第一矩形区域中的第i+1个像素点需要使用的编码比特数bi+1与Bi之和大于Bmax,根据该图像中至少一个已编码的像素点的编码数据,确定该第一矩形区域中至少一个未编码像素点的编码数据,其中,该至少一个未编码像素点包括该第i+1个像素点,1≤i≤T-1,T为该第一矩形区域包括的像素点总数;
向该第一矩形区域的编码比特流添加第一标识符,该第一标识符用于标识对该第一矩形区域的编码结束并且该第一矩形区域具有至少一个未编码像素点。
在一个可选例子中,本领域技术人员可以理解,装置500可以具体为上述实施例中的编码装置,装置500可以用于执行上述方法实施例中的各个流程和/或步骤,为避免重复,在此不再赘述。
图6示出了本申请实施例提供的另一解码装置600,包括:处理器 610和存储器620,其中,该存储器620用于存储指令,该处理器610用于执行该存储器存储的指令,其中,对存储器620中存储的该指令的执行使得该处理器610执行以下操作:
根据图像的编码比特流,对该图像中的第一矩形区域进行解码处理,其中,该图像包括至少一个矩形区域,每个矩形区域包括至少一个像素点;
若该编码比特流包括第一标识符,根据该图像中至少一个已解码像素点的解码数据,确定该第一矩形区域中至少一个未解码像素点的解码数据,其中,该第一标识符用于标识对该第一矩形区域的编码结束并且该第一矩形区域中具有至少一个未编码像素点。
在一个可选例子中,本领域技术人员可以理解,装置600可以具体为上述实施例中的解码装置,装置600可以用于执行上述方法实施例中的各个流程和/或步骤,为避免重复,在此不再赘述。
应理解,在本申请实施例中,处理器可以是中央边界处理单元(central processing unit,CPU),处理器还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器可以包括只读存储器和随机存取存储器,并向处理器提供指令和数据。存储器的一部分还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。该处理器可以用于执行存储器中存储的指令,并且该处理器执行该指令时,该处理器可以执行上述方法实施例中与终端设备对应的各个步骤。
在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器执行存储器中的指令,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。
还应理解,上文对本申请实施例的描述着重于强调各个实施例之 间的不同之处,未提到的相同或相似之处可以互相参考,为了简洁,这里不再赘述。
此外,本文中术语“系统”和“网络”在本文中常被可互换使用。本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产 品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘solid state disk(SSD))等。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。

Claims (50)

  1. 一种编码方法,其特征在于,包括:
    对图像的第一矩形区域中的像素点进行编码处理,其中,所述图像包括至少一个矩形区域,每个矩形区域包括至少一个像素点;
    若所述第一矩形区域中的前i个已编码的像素点使用的总编码比特数Bi小于或等于所述第一矩形区域的最大允许使用编码比特数Bmax,并且所述第一矩形区域中的第i+1个像素点需要使用的编码比特数bi+1与Bi之和大于Bmax,根据所述图像中至少一个已编码的像素点的编码数据,确定所述第一矩形区域中至少一个未编码像素点的编码数据,其中,所述至少一个未编码像素点包括所述第i+1个像素点,1≤i≤T-1,T为所述第一矩形区域包括的像素点总数;
    向所述第一矩形区域的编码比特流添加第一标识符,所述第一标识符用于标识对所述第一矩形区域的编码结束并且所述第一矩形区域具有至少一个未编码像素点。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述图像中已编码的像素点的编码数据,确定所述第一矩形区域中至少一个未编码像素点的编码数据,包括:
    从所述图像中至少一个已编码的像素点中,确定所述至少一个未编码像素点中每个像素点的参考像素点;
    将所述至少一个未编码像素点中的每个像素点的编码数据确定为所述每个像素点的参考像素点的编码数据。
  3. 根据权利要求2所述的方法,其特征在于,
    所述至少一个未编码像素点中每个像素点的参考像素点位于所述每个像素点的左侧或上侧;和/或
    所述至少一个未编码像素点中每个像素点的参考像素点与所述每个像素点位于同一矩形区域或不同矩形区域。
  4. 根据权利要求2或3所述的方法,其特征在于,所述从所述图像中至少一个已编码的像素点中,确定所述至少一个未编码像素点中每个像素点的参考像素点,包括:
    将所述至少一个未编码像素点分成N组像素点,每组像素点包括所述至少一个未编码像素点中的至少一个像素点,N为大于或等于1的整数;
    从所述图像中至少一个已编码的像素点中,确定所述N组像素点中的第j组像素点的参考像素点,1≤j≤N。
  5. 根据权利要求4所述的方法,其特征在于,所述从所述图像中至少一个已编码的像素点中,确定所述N组像素点中的第j组像素点的参考像素点,包括:
    根据所述第j组像素点的原始数据,从所述第j组像素点左侧的第一已编码像素点和所述第j组像素点上侧的至少一个第二已编码像素点中,确定所述第j组像素点的参考像素点。
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述第j组像素点的原始数据,从所述第j组像素点左侧的第一已编码像素点和所述第j组像素点上侧的至少一个第二已编码像素点中,确定所述第j组像素点的参考像素点,包括:
    根据所述第j组像素点中每个像素点的原始数据,确定所述每个像素点与所述第一已编码像素点之间的相关度;
    根据所述第j组像素点中每个像素点的原始数据,确定所述每个像素点与所述每个像素点上侧的第二已编码像素点之间的相关度;
    根据所述第j组像素点中每个像素点与所述第一已编码像素点之间的相关度以及所述第j组像素点中每个像素点与所述每个像素点上侧的第二已编码像素点之间的相关度,将所述第一已编码像素点或所述至少一个第二已编码像素点确定为所述第j组像素点的参考像素点。
  7. 根据权利要求5或6所述的方法,其特征在于,下列中的至少一项满足:
    所述第一已编码像素点具体为所述前i个已编码的像素点中的最后一个已编码的像素点,或者所述第一已编码像素点中与所述最后一个已编码的像素点之间间隔至少一个像素点的像素点;
    所述第j组像素点中每个像素点与位于所述每个像素点上侧的第二已编码像素点相邻或间隔至少一个像素点。
  8. 根据权利要求4至7中任一项所述的方法,其特征在于,所述方法还包括:
    向所述第一矩形区域的编码比特流添加第二标识符,所述第二标识符用于指示所述第j组像素点的参考像素点所在位置。
  9. 根据权利要求4至8中任一项所述的方法,其特征在于,所述将所述至少一个未编码像素点分成N组像素点,包括:
    根据所述至少一个未编码像素点的个数,将所述至少一个未编码像素点分成N组像素点,其中,所述N组像素点中的前N-1组像素点中包括的未编码像素点的个数相同。
  10. 根据权利要求4至8中任一项所述的方法,其特征在于,N等于2;
    所述将所述至少一个未编码像素点分成两组像素点,包括:
    将所述至少一个未编码像素点中的前P个像素点确定为第一组像素点,其中,P为大于或等于1的预设数值;
    将所述至少一个未编码像素点中除所述第一组像素点之外的其余未编码像素点确定为第二组像素点。
  11. 根据权利要求10所述的方法,其特征在于,;
    所述从所述图像中至少一个已编码的像素点中,确定所述至少一个未编码像素点中每个未编码像素点的参考像素点,还包括:
    根据所述第一组像素点中每个像素点的原始数据,从所述每个像素点左侧的已编码像素点和所述每个像素点上侧的已编码像素点中,确定所述每个像素点的参考像素点。
  12. 根据权利要求11所述的方法,其特征在于,所述方法还包括:
    向所述第一矩形区域的编码比特流添加至少一个第三标识符,所述至少一个第三标识符与所述第一组像素点中的至少一个像素点对应,并且所述至少一个所述第三标识符中每个第三标识符用于指示对应像素点的参考像素点所在位置。
  13. 根据权利要求1至12中任一项所述的方法,其特征在于,所述对图像的第一矩形区域中的像素点进行编码处理,包括:
    确定所述第一矩形区域中的待编码片段的参考数据,其中,所述第一矩形区域包括至少一个片段,每个片段包括至少一个像素点;
    根据所述参考数据,对所述待编码片段进行预测处理,得到所述待编码片段的预测残差;
    利用所述待编码片段的量化参数,对所述待编码片段的预测结果进行量化处理,得到所述待编码片段的量化结果;
    对所述待编码片段的量化结果进行熵编码处理,得到所述待编码片段的 编码结果。
  14. 根据权利要求13所述的方法,其特征在于,所述确定所述第一矩形区域中的待编码片段的参考数据,包括:
    根据所述待编码片段中的数据,从所述待编码片段的左侧数据和上侧数据中,确定所述待编码片段的参考数据,其中,所述待编码片段的左侧数据包括位于所述待编码片段左侧的至少一个第一像素点的数据,所述待编码数据的上侧数据包括位于所述待编码片段上侧的至少一个第二像素点的数据。
  15. 根据权利要求13或14所述的方法,其特征在于,在所述利用所述待编码片段的量化参数,对所述待编码片段的预测结果进行量化处理之前,所述方法还包括:
    根据所述参考数据,确定所述待编码片段对应的量化参数。
  16. 一种解码方法,其特征在于,包括:
    根据图像的编码比特流,对所述图像中的第一矩形区域进行解码处理,其中,所述图像包括至少一个矩形区域,每个矩形区域包括至少一个像素点;
    若所述编码比特流包括第一标识符,根据所述图像中至少一个已解码像素点的解码数据,确定所述第一矩形区域中至少一个未解码像素点的解码数据,其中,所述第一标识符用于标识对所述第一矩形区域的解码结束并且所述第一矩形区域中具有至少一个未解码像素点。
  17. 根据权利要求16所述的方法,其特征在于,所述根据所述图像中至少一个已解码像素点的解码数据,确定所述第一矩形区域中至少一个未解码像素点的解码数据,包括:
    从所述图像的至少一个已解码像素点中,确定所述第一矩形区域中至少一个未解码像素点中每个像素点的参考像素点;
    将所述至少一个未解码像素点中每个像素点的解码数据确定为所述每个像素点的参考像素点的解码数据。
  18. 根据权利要求17所述的方法,其特征在于,
    所述至少一个未编码像素点中每个像素点的参考像素点位于所述每个像素点的左侧或上侧;和/或
    所述至少一个未编码像素点中每个像素点的参考像素点与所述每个像素点位于同一矩形区域或不同矩形区域。
  19. 根据权利要求17或18所述的方法,其特征在于,所述从所述图像 的至少一个已解码像素点中,确定所述第一矩形区域中至少一个未解码像素点中每个像素点的参考像素点,包括:
    将所述至少一个未解码像素点分成N组像素点,每组像素点包括所述至少一个未编码像素点中的至少一个像素点,N为大于或等于1的整数;
    从所述图像的至少一个已解码像素点中,确定所述N组像素点中的第j组像素点的参考像素点,1≤j≤N。
  20. 根据权利要求19所述的方法,其特征在于,所述从所述图像的至少一个已解码像素点中,确定所述第j组像素点的参考像素点,包括:
    从所述图像的编码比特流中获取第二标识符,所述第二标识符用于指示所述第j组像素点的参考像素点所在位置;
    根据所述第二标识符,确定所述第j组像素点中每个像素点的参考像素点。
  21. 根据权利要求19或20所述的方法,其特征在于,下列中的至少一项满足:
    所述第j组像素点的参考像素点位于所述第j组像素点的左侧,并且为所述第一矩形区域的最后一个已解码的像素点,或者所述第j组像素点的参考像素点与所述最后一个已解码的像素点之间间隔至少一个像素点;
    所述第j组像素点中每个像素点的参考像素点位于所述每个相素点的上侧,并且与所述每个像素点相邻或间隔至少一个像素点。
  22. 根据权利要求19至21中任一项所述的方法,其特征在于,所述将所述至少一个未解码像素点分成N组像素点,包括:
    根据所述至少一个未解码像素点的个数,将所述至少一个未解码像素点分成N组像素点,其中,所述N组像素点中的前N-1组像素点中包括的未解码像素点的个数相同。
  23. 根据权利要求19至21中任一项所述的方法,其特征在于,N等于2;
    所述将所述至少一个未解码像素点分成两组像素点,包括:
    将所述至少一个未解码像素点中的前P个像素点确定为第一组像素点,其中,P为大于或等于1的预设数值;
    将所述至少一个未解码像素点中除所述第一组像素点之外的其余未解码像素点确定为第二组像素点。
  24. 根据权利要求23所述的方法,其特征在于;
    所述从所述图像的至少一个已解码像素点中,确定所述第一矩形区域中至少一个未解码像素点中每个像素点的参考像素点,还包括:
    从所述图像的编码比特流中获取至少一个第三标识符,所述至少一个第三标识符与所述第一组像素点中的至少一个像素点对应,并且所述至少一个第三标识符中每个第三标识符用于指示对应像素点的参考像素点所在位置;
    根据所述第一组像素点中每个像素点对应的第三标识符,确定所述每个像素点的参考像素点。
  25. 根据权利要求16至24中任一项所述的方法,其特征在于,所述根据图像的编码比特流,对所述图像中的第一矩形区域进行解码处理,包括:
    对所述第一矩形区域的待解码片段进行熵解码处理,得到所述待解码片段的量化参数,其中,所述第一矩形区域包括至少一个片段,每个片段包括至少一个像素点;
    根据所述待解码片段的量化参数,对所述待解码片段进行反量化处理,得到所述待解码片段的残差数据;
    根据所述待解码片段的参考数据,对所述待解码片段的残差数据进行反预测处理,得到所述待解码片段的解码结果。
  26. 一种编码装置,其特征在于,包括:
    编码单元,用于对图像的第一矩形区域中的像素点进行编码处理,其中,所述图像包括至少一个矩形区域,每个矩形区域包括至少一个像素点;
    边界处理单元,用于若所述第一矩形区域中的前i个已编码的像素点使用的总编码比特数Bi小于或等于所述第一矩形区域的最大允许使用编码比特数Bmax,并且所述第一矩形区域中的第i+1个像素点需要使用的编码比特数bi+1与Bi之和大于Bmax,根据所述图像中至少一个已编码的像素点的编码数据,确定所述第一矩形区域中至少一个未编码像素点的编码数据,其中,所述至少一个未编码像素点包括所述第i+1个像素点,1≤i≤T-1,T为所述第一矩形区域包括的像素点总数,以及向所述第一矩形区域的编码比特流添加第一标识符,所述第一标识符用于标识对所述第一矩形区域的编码结束并且所述第一矩形区域具有至少一个未编码像素点。
  27. 根据权利要求26所述的装置,其特征在于,所述边界处理单元具体用于:
    从所述图像中至少一个已编码的像素点中,确定所述至少一个未编码像素点中每个像素点的参考像素点;
    将所述至少一个未编码像素点中的每个像素点的编码数据确定为所述每个像素点的参考像素点的编码数据。
  28. 根据权利要求27所述的装置,其特征在于,
    所述至少一个未编码像素点中每个像素点的参考像素点位于所述每个像素点的左侧或上侧;和/或
    所述至少一个未编码像素点中每个像素点的参考像素点与所述每个像素点位于同一矩形区域或不同矩形区域。
  29. 根据权利要求27或28所述的装置,其特征在于,所述边界处理单元具体用于:
    将所述至少一个未编码像素点分成N组像素点,每组像素点包括所述至少一个未编码像素点中的至少一个像素点,N为大于或等于1的整数;
    从所述图像中至少一个已编码的像素点中,确定所述N组像素点中的第j组像素点的参考像素点,1≤j≤N。
  30. 根据权利要求29所述的装置,其特征在于,所述边界处理单元具体用于:根据所述第j组像素点的原始数据,从所述第j组像素点左侧的第一已编码像素点和所述第j组像素点上侧的至少一个第二已编码像素点中,确定所述第j组像素点的参考像素点。
  31. 根据权利要求30所述的装置,其特征在于,所述边界处理单元具体用于:
    根据所述第j组像素点中每个像素点的原始数据,确定所述每个像素点与所述第一已编码像素点之间的相关度;
    根据所述第j组像素点中每个像素点的原始数据,确定所述每个像素点与所述每个像素点上侧的第二已编码像素点之间的相关度;
    根据所述第j组像素点中每个像素点与所述第一已编码像素点之间的相关度以及所述第j组像素点中每个像素点与所述每个像素点上侧的第二已编码像素点之间的相关度,将所述第一已编码像素点或所述至少一个第二已编码像素点确定为所述第j组像素点的参考像素点。
  32. 根据权利要求30或31所述的装置,其特征在于,下列中的至少一项满足:
    所述第一已编码像素点具体为所述前i个已编码的像素点中的最后一个已编码的像素点,或者所述第一已编码像素点与所述最后一个已编码的像素点之间间隔至少一个像素点;
    所述第j组像素点中每个像素点与位于所述每个像素点上侧的第二已编码像素点相邻或间隔至少一个像素点。
  33. 根据权利要求29至32中任一项所述的装置,其特征在于,所述边界处理单元还用于:向所述第一矩形区域的编码比特流添加第二标识符,所述第二标识符用于指示所述第j组像素点的参考像素点所在位置。
  34. 根据权利要求29至33中任一项所述的装置,其特征在于,所述边界处理单元具体用于:
    根据所述至少一个未编码像素点的个数,将所述至少一个未编码像素点分成N组像素点,其中,所述N组像素点中的前N-1组像素点中包括的未编码像素点的个数相同。
  35. 根据权利要求29至33中任一项所述的装置,其特征在于,N等于2;
    所述边界处理单元具体用于:
    将所述至少一个未编码像素点中的前P个像素点确定为第一组像素点,其中,P为大于或等于1的预设数值;
    将所述至少一个未编码像素点中除所述第一组像素点之外的其余未编码像素点确定为第二组像素点。
  36. 根据权利要求35所述的装置,其特征在于,所述第j组像素点具体为所述第一组像素点;
    所述边界处理单元具体用于:根据所述第二组像素点中每个像素点的原始数据,从所述每个像素点左侧的已编码像素点和所述每个像素点上侧的已编码像素点中,确定所述每个像素点的参考像素点。
  37. 根据权利要求36所述的装置,其特征在于,所述边界处理单元还用于:向所述第一矩形区域的编码比特流添加至少一个第三标识符,所述至少一个第三标识符与所述第二组像素点中的至少一个像素点对应,并且所述至少一个所述第三标识符中每个第三标识符用于指示对应像素点的参考像素点所在位置。
  38. 根据权利要求26至37中任一项所述的装置,其特征在于,所述编 码单元具体用于:
    确定所述第一矩形区域中的待编码片段的参考数据,其中,所述第一矩形区域包括至少一个片段,每个片段包括至少一个像素点;
    根据所述参考数据,对所述待编码片段进行预测处理,得到所述待编码片段的预测残差;
    利用所述待编码片段的量化参数,对所述待编码片段的预测结果进行量化处理,得到所述待编码片段的量化结果;
    对所述待编码片段的量化结果进行熵编码处理,得到所述待编码片段的编码结果。
  39. 根据权利要求38所述的装置,其特征在于,所述编码单元具体用于:
    根据所述待编码片段中的数据,从所述待编码片段的左侧数据和上侧数据中,确定所述待编码片段的参考数据,其中,所述待编码片段的左侧数据包括位于所述待编码片段左侧的至少一个第一像素点的数据,所述待编码数据的上侧数据包括位于所述待编码片段上侧的至少一个第二像素点的数据。
  40. 根据权利要求38或39所述的装置,其特征在于,所述编码单元还用于:在利用所述待编码片段的量化参数,对所述待编码片段的预测结果进行量化处理之前,根据所述参考数据,确定所述待编码片段对应的量化参数。
  41. 一种解码装置,其特征在于,包括:
    解码单元,用于根据图像的编码比特流,对所述图像中的第一矩形区域进行解码处理,其中,所述图像包括至少一个矩形区域,每个矩形区域包括至少一个像素点;
    边界处理单元,用于若所述编码比特流包括第一标识符,根据所述图像中至少一个已解码像素点的解码数据,确定所述第一矩形区域中至少一个未解码像素点的解码数据,其中,所述第一标识符用于标识对所述第一矩形区域的编码结束并且所述第一矩形区域中具有至少一个未编码像素点。
  42. 根据权利要求41所述的装置,其特征在于,所述边界处理单元具体用于:
    从所述图像的至少一个已解码像素点中,确定所述第一矩形区域中至少一个未解码像素点中每个像素点的参考像素点;
    将所述至少一个未解码像素点中每个像素点的解码数据确定为所述每 个像素点的参考像素点的解码数据。
  43. 根据权利要求42所述的装置,其特征在于,
    所述至少一个未编码像素点中每个像素点的参考像素点位于所述每个像素点的左侧或上侧;和/或
    所述至少一个未编码像素点中每个像素点的参考像素点与所述每个像素点位于同一矩形区域或不同矩形区域。
  44. 根据权利要求42或43所述的装置,其特征在于,所述边界处理单元具体用于:
    将所述至少一个未解码像素点分成N组像素点,每组像素点包括所述至少一个未编码像素点中的至少一个像素点,N为大于或等于1的整数;
    从所述图像的至少一个已解码像素点中,确定所述N组像素点中的第j组像素点的参考像素点,1≤j≤N。
  45. 根据权利要求44所述的装置,其特征在于,所述边界处理单元具体用于:
    从所述图像的编码比特流中获取第二标识符,所述第二标识符用于指示所述第j组像素点的参考像素点所在位置;
    根据所述第二标识符,确定所述第j组像素点中每个像素点的参考像素点。
  46. 根据权利要求44或45所述的装置,其特征在于,下列中的至少一项满足:
    所述第j组像素点的参考像素点位于所述第j组像素点的左侧,并且为所述第一矩形区域的最后一个已编码的像素点,或者所述第j组像素点的参考像素点与所述最后一个已编码的像素点之间间隔至少一个像素点;
    所述第j组像素点中每个像素点的参考像素点位于所述每个相素点的上侧,并且与所述每个像素点相邻或间隔至少一个像素点。
  47. 根据权利要求44至46中任一项所述的装置,其特征在于,所述边界处理单元具体用于:根据所述至少一个未解码像素点的个数,将所述至少一个未解码像素点分成N组像素点,其中,所述N组像素点中的前N-1组像素点中包括的未解码像素点的个数相同。
  48. 根据权利要求44至46中任一项所述的装置,其特征在于,N等于2;
    所述边界处理单元具体用于:
    将所述至少一个未解码像素点中的前P个像素点确定为第一组像素点,其中,P为大于或等于1的预设数值;
    将所述至少一个未解码像素点中除所述第一组像素点之外的其余未解码像素点确定为第二组像素点。
  49. 根据权利要求48所述的装置,其特征在于,所述第j组像素点具体为所述第一组像素点;
    所述边界处理单元具体用于:
    从所述图像的编码比特流中获取至少一个第三标识符,所述至少一个第三标识符与所述第二组像素点中的至少一个像素点对应,并且所述至少一个第三标识符中每个第三标识符用于指示对应像素点的参考像素点所在位置;
    根据所述第二组像素点中每个像素点对应的第三标识符,确定所述每个像素点的参考像素点。
  50. 根据权利要求41至49中任一项所述的装置,其特征在于,所述解码单元具体用于:
    对所述第一矩形区域的待解码片段进行熵解码处理,得到所述待解码片段的量化参数,其中,所述第一矩形区域包括至少一个片段,每个片段包括至少一个像素点;
    根据所述待解码片段的量化参数,对所述待解码片段进行反量化处理,得到所述待解码片段的残差数据;
    根据所述待解码片段的参考数据,对所述待解码片段的残差数据进行反预测处理,得到所述待解码片段的解码结果。
PCT/CN2017/099898 2017-08-31 2017-08-31 编码方法、解码方法以及编码装置和解码装置 WO2019041222A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201780004573.3A CN108521871B (zh) 2017-08-31 2017-08-31 编码方法、解码方法以及编码装置和解码装置
PCT/CN2017/099898 WO2019041222A1 (zh) 2017-08-31 2017-08-31 编码方法、解码方法以及编码装置和解码装置
US16/734,767 US20200145676A1 (en) 2017-08-31 2020-01-06 Encoding method, decoding method, encoding apparatus and decoding apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/099898 WO2019041222A1 (zh) 2017-08-31 2017-08-31 编码方法、解码方法以及编码装置和解码装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/734,767 Continuation US20200145676A1 (en) 2017-08-31 2020-01-06 Encoding method, decoding method, encoding apparatus and decoding apparatus

Publications (1)

Publication Number Publication Date
WO2019041222A1 true WO2019041222A1 (zh) 2019-03-07

Family

ID=63434466

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/099898 WO2019041222A1 (zh) 2017-08-31 2017-08-31 编码方法、解码方法以及编码装置和解码装置

Country Status (3)

Country Link
US (1) US20200145676A1 (zh)
CN (1) CN108521871B (zh)
WO (1) WO2019041222A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102647586A (zh) * 2011-02-16 2012-08-22 富士通株式会社 用在视频编码系统中的码率控制方法和装置
CN103391439A (zh) * 2013-07-18 2013-11-13 西安交通大学 一种基于主动宏块隐藏的h.264/avc码率控制方法
US20140072027A1 (en) * 2012-09-12 2014-03-13 Ati Technologies Ulc System for video compression
CN104603834A (zh) * 2012-09-07 2015-05-06 德克萨斯仪器股份有限公司 用于多媒体数据处理的方法和系统
CN105323588A (zh) * 2014-06-16 2016-02-10 旭曜科技股份有限公司 一种动态适应压缩参数的影像压缩系统
CN105592313A (zh) * 2014-10-21 2016-05-18 广东中星电子有限公司 一种分组自适应熵编码压缩方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11262006A (ja) * 1998-03-11 1999-09-24 Sony Corp 映像信号伝送装置
CN101588487B (zh) * 2009-06-10 2011-06-29 武汉大学 一种视频帧内预测编码方法
AU2013206815A1 (en) * 2013-07-11 2015-03-05 Canon Kabushiki Kaisha Method, apparatus and system for encoding and decoding video data
CN104320660B (zh) * 2014-10-31 2017-10-31 中国科学技术大学 用于无损视频编码的率失真优化方法及编码方法
CN106559671B (zh) * 2015-09-30 2019-08-23 展讯通信(上海)有限公司 一种显示图像压缩方法及系统
WO2019041219A1 (zh) * 2017-08-31 2019-03-07 深圳市大疆创新科技有限公司 编码方法、解码方法以及编码装置和解码装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102647586A (zh) * 2011-02-16 2012-08-22 富士通株式会社 用在视频编码系统中的码率控制方法和装置
CN104603834A (zh) * 2012-09-07 2015-05-06 德克萨斯仪器股份有限公司 用于多媒体数据处理的方法和系统
US20140072027A1 (en) * 2012-09-12 2014-03-13 Ati Technologies Ulc System for video compression
CN103391439A (zh) * 2013-07-18 2013-11-13 西安交通大学 一种基于主动宏块隐藏的h.264/avc码率控制方法
CN105323588A (zh) * 2014-06-16 2016-02-10 旭曜科技股份有限公司 一种动态适应压缩参数的影像压缩系统
CN105592313A (zh) * 2014-10-21 2016-05-18 广东中星电子有限公司 一种分组自适应熵编码压缩方法

Also Published As

Publication number Publication date
US20200145676A1 (en) 2020-05-07
CN108521871B (zh) 2020-12-18
CN108521871A (zh) 2018-09-11

Similar Documents

Publication Publication Date Title
US11049283B2 (en) Lossless compression of fragmented image data
US8422809B2 (en) Image encoding method, image decoding method, image encoding apparatus, image decoding apparatus, image encoding program, and image decoding program
WO2016045565A1 (zh) 一种视频数据编码、解码的方法及装置
JP2014525183A (ja) 2dマトリクスにエンコーディングパラメータを保存する画像圧縮のための方法および装置
EP1946246A2 (en) Extended amplitude coding for clustered transform coefficients
KR102123620B1 (ko) 대용량 병렬 처리를 위해 비디오 신호를 엔트로피 인코딩 또는 엔트로피 디코딩하는 방법 및 장치
JP7162532B2 (ja) ビデオデータに関係する構文要素を表す一連の2値シンボルをコンテキスト適応型2値算術符号化するための方法及び装置
US7471840B2 (en) Two-dimensional variable length coding of runs of zero and non-zero transform coefficients for image compression
CN110913225B (zh) 图像编码方法、装置、电子设备和计算机可读存储介质
CN110418138B (zh) 视频处理方法、装置、电子设备及存储介质
US8305244B2 (en) Coding data using different coding alphabets
WO2019041219A1 (zh) 编码方法、解码方法以及编码装置和解码装置
AU2019201683A1 (en) Techniques for high efficiency entropy coding of video data
WO2019041222A1 (zh) 编码方法、解码方法以及编码装置和解码装置
US7492956B2 (en) Video coding using multi-dimensional amplitude coding and 2-D non-zero/zero cluster position coding
CN103188486A (zh) H.263视频编码的可变长编码方法和系统
WO2024104503A1 (zh) 图像编解码
EP2810371B1 (en) Binary arithmetic coding scheme
WO2021197158A1 (zh) 一种图像处理方法和图像处理装置
CN107801033B (zh) 应用于数字音视频编解码技术标准系统的解码方法及解码装置
WO2020258378A1 (zh) 一种视频图像处理方法、设备及存储介质
Petersson et al. Improving image quality by SSIM based increase of run-length zeros in GPGPU JPEG encoding
CN115398923A (zh) 视频编解码中支持不同颜色格式的系数编解码
CN113225567A (zh) 一种视频数据的残差系数编解码方法、装置及电子设备
CN116366070A (zh) 小波系数编码方法、装置、系统、设备及介质

Legal Events

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

Ref document number: 17923303

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

Country of ref document: EP

Kind code of ref document: A1