WO2022217474A1 - Video encoding and decoding methods, apparatus, system, and storage medium - Google Patents

Video encoding and decoding methods, apparatus, system, and storage medium Download PDF

Info

Publication number
WO2022217474A1
WO2022217474A1 PCT/CN2021/087084 CN2021087084W WO2022217474A1 WO 2022217474 A1 WO2022217474 A1 WO 2022217474A1 CN 2021087084 W CN2021087084 W CN 2021087084W WO 2022217474 A1 WO2022217474 A1 WO 2022217474A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
interval
image
segments
intervals
Prior art date
Application number
PCT/CN2021/087084
Other languages
French (fr)
Chinese (zh)
Inventor
郭泽
郑萧桢
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2021/087084 priority Critical patent/WO2022217474A1/en
Priority to CN202180077049.5A priority patent/CN116615905A/en
Publication of WO2022217474A1 publication Critical patent/WO2022217474A1/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/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression

Definitions

  • the embodiments of the present application relate to the technical field of image processing, and in particular, to a video encoding and decoding method, apparatus, system, and storage medium.
  • HEVC high efficiency video coding
  • VVC versatile video coding
  • VVC versatile video coding
  • HEVC high efficiency video coding
  • the present application provides a video encoding and decoding method, device, system, and storage medium, which can be adaptively adjusted according to the actual situation, which helps to improve the flexibility of mapping and improve the efficiency of encoding and decoding.
  • a first aspect of the present application provides a video encoding method, comprising:
  • a second aspect of the present application provides a video decoding method, comprising:
  • the code stream includes first indication information, and the first indication information is used to indicate the number of pixel interval segments corresponding to the image to be decoded, and the number of pixel interval segments is based on the bit depth of the to-be-decoded image definite;
  • the code stream is decoded according to the number of segments in the pixel interval to obtain a decoded image.
  • a third aspect of the present application provides a video encoding method, comprising:
  • the bit depth of the to-be-coded image determine the number of pixel interval segments corresponding to the to-be-coded image
  • the number of pixel interval segments determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-coded image
  • a fourth aspect of the present application provides a video decoding method, comprising:
  • the number of pixel interval segments determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image
  • the code stream is decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  • a fifth aspect of the present application provides a video encoding apparatus, including: a memory and a processor;
  • the memory for storing programs
  • the processor coupled to the memory, executes the program stored in the memory for:
  • the transmitter is controlled to send the code stream.
  • a sixth aspect of the present application provides a video decoding apparatus, including: a memory and a processor;
  • the memory for storing programs
  • the processor coupled to the memory, executes the program stored in the memory for:
  • the code stream includes first indication information, and the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-decoded image, and the pixel interval segment number is based on the to-be-decoded image is determined by the bit depth;
  • the code stream is decoded according to the number of segments in the pixel interval to obtain a decoded image.
  • a seventh aspect of the present application provides a video encoding apparatus, including: a memory and a processor;
  • the memory for storing programs
  • the processor coupled to the memory, executes the program stored in the memory for:
  • the bit depth of the to-be-coded image determine the number of pixel interval segments corresponding to the to-be-coded image
  • the number of pixel interval segments determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-coded image
  • the transmitter is controlled to send the code stream.
  • An eighth aspect of the present application provides a video decoding apparatus, including: a memory and a processor;
  • the memory for storing programs
  • the processor coupled to the memory, executes the program stored in the memory for:
  • the number of pixel interval segments determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image
  • the code stream is decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  • a ninth aspect of the present application provides an electronic device, including the video encoding apparatus and the transmitter described in the fifth aspect.
  • a tenth aspect of the present application provides an electronic device, including the video decoding apparatus and receiver described in the sixth aspect.
  • An eleventh aspect of the present application provides an electronic device, including the video encoding apparatus and the transmitter described in the seventh aspect.
  • a twelfth aspect of the present application provides an electronic device, including the video decoding apparatus and receiver described in the eighth aspect.
  • a thirteenth aspect of the present application provides a computer-readable storage medium, comprising instructions that, when executed on a computer, cause the computer to implement the video encoding method described in any one of the above.
  • a fourteenth aspect of the present application provides a computer-readable storage medium, comprising instructions that, when executed on a computer, cause the computer to implement the video decoding method described in any one of the above.
  • a fifteenth aspect of the present application provides a video encoding and decoding system, including: an encoding end device and a decoding end device;
  • the encoding terminal device includes the electronic device described in the ninth aspect
  • the decoding end device includes the electronic device described in the tenth aspect above.
  • a sixteenth aspect of the present application provides a video encoding and decoding system, including: an encoding end device and a decoding end device;
  • the encoding terminal device includes the electronic device described in the eleventh aspect
  • the decoding end device includes the electronic device described in the twelfth aspect.
  • the technical solutions provided by the embodiments of the present application when the to-be-coded image is encoded, the number of pixel interval segments that need to be divided during pixel mapping is determined based on the bit depth of the to-be-coded image. Compared with the solution in the existing VCC standard in which the number of pixel intervals before and after the mapping is fixed or set by default, the technical solutions provided in the embodiments of the present application can be adaptively adjusted in combination with the actual situation, which helps to improve the flexibility of the mapping. sex.
  • FIG. 1 is an architectural diagram of a technical solution provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of a video coding framework 2 provided by an embodiment of the present application.
  • FIG. 3 is a LMCS-based decoding framework diagram provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of an embodiment of a video encoding method provided by an embodiment of the present application
  • FIG. 5 is a schematic flowchart of an embodiment of a video decoding method provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of another embodiment of a video encoding method provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of another embodiment of a video decoding method provided by an embodiment of the present application.
  • FIG. 8 is a frame diagram of an embodiment of a video encoding apparatus provided by an embodiment of the present application.
  • FIG. 9 is a frame diagram of an embodiment of a video decoding apparatus according to an embodiment of the present application.
  • FIG. 1 is an architectural diagram of applying the technical solution of the embodiment of the present application.
  • the system 100 may receive data 102 to be processed, process the data 102 to be processed, and generate processed data 108 .
  • system 100 may receive data to be encoded and encode the data to be encoded to generate encoded data, or system 100 may receive data to be decoded and decode the data to be decoded to generate decoded data.
  • components in system 100 may be implemented by one or more processors, which may be processors in computing devices or processors in mobile devices (eg, drones).
  • the processor may be any type of processor, which is not limited in this embodiment of the present invention.
  • the processor may include an encoder, a decoder, or a codec, among others.
  • One or more memories may also be included in system 100 .
  • the memory may be used to store instructions and data, for example, computer-executable instructions, data to be processed 102 , processed data 108 , etc. that implement the technical solutions of the embodiments of the present invention.
  • the memory may be any type of memory, which is also not limited in this embodiment of the present invention.
  • the data to be encoded may include text, images, graphic objects, animation sequences, audio, video, or any other data that needs to be encoded.
  • the data to be encoded may include sensory data from sensors, which may be visual sensors (eg, cameras, infrared sensors), microphones, near-field sensors (eg, ultrasonic sensors, radar), position sensors, temperature sensor, touch sensor, etc.
  • the data to be encoded may include information from the user, eg, biometric information, which may include facial features, fingerprint scans, retinal scans, voice recordings, DNA sampling, and the like.
  • FIG. 2 shows the VVC video coding framework. Similar to the HEVC coding standard, VVC uses a block-based hybrid coding framework to perform a series of processing such as block division, prediction, transformation, quantization, entropy coding, and loop filtering on the input video frame image. , to get the final stream for storage or network transmission.
  • FIG. 2 after receiving the video to be encoded, starting from the first frame of the video to be encoded, each frame of the video to be encoded is encoded in sequence. Among them, the current coded frame mainly undergoes: prediction (Prediction), transformation (Transform), quantization (Quantization) and entropy coding (Entropy Coding), etc., and finally outputs the code stream of the current coded frame.
  • the decoding process usually decodes the received code stream according to the inverse process of the above process, so as to recover the video frame information before decoding.
  • the video coding framework 2 includes a coding control module 201 for performing decision control actions and parameter selection in the coding process.
  • the encoding control module 201 controls parameters used in transform, quantization, inverse quantization, and inverse transform, controls selection of intra-frame or inter-frame mode, and parameter control of motion estimation and filtering, and
  • the control parameters of the encoding control module 201 will also be input into the entropy encoding module to be encoded to form a part of the encoded code stream.
  • the coded frame is divided 202, and specifically, the coded frame is divided into slices first, and then divided into blocks.
  • the coding frame is divided into a plurality of non-overlapping largest coding tree units (Coding Tree Units, CTUs), and each CTU can also be in the form of a quad tree, or a binary tree, or a ternary tree, respectively.
  • CTUs Coding Tree Units
  • a CU may also include a prediction unit (Prediction Unit, PU) and a transform unit (Transform Unit, TU) associated with it, where PU is the basic unit of prediction, and TU is the basic unit of transform and quantization.
  • Prediction Unit PU
  • Transform Unit TU
  • PUs and TUs are obtained by dividing into one or more blocks on the basis of CUs, wherein one PU includes multiple prediction blocks (Prediction Blocks, PBs) and related syntax elements.
  • the PU and the TU may be the same, or may be obtained by the CU through different partitioning methods.
  • At least two of the CUs, PUs, and TUs are the same, eg, CUs, PUs, and TUs are not distinguished, and all are predicted, quantized, and transformed in units of CUs.
  • the CTU, CU or other formed data units are referred to as coding blocks.
  • a data unit targeted for video coding may be a frame, a slice, a coding tree unit, a coding unit, a coding block, or a group of any of the above.
  • the size of the data unit may vary.
  • a prediction process is performed to remove redundant information in the spatial and temporal domains of the current coded frame.
  • the commonly used predictive coding methods include intra-frame prediction and inter-frame prediction. Intra-frame prediction only uses the reconstructed information in this frame to predict the current coding block, while inter-frame prediction uses the information in other frames (also called reference frames) that have been reconstructed before to predict the current coding block. Make predictions.
  • the encoding control module 201 is configured to decide whether to select intra-frame prediction or inter-frame prediction.
  • the process of intra-frame prediction 203 includes obtaining the reconstructed block of the coded adjacent blocks around the current coding block as a reference block, and using the prediction mode method to calculate the prediction value based on the pixel value of the reference block to generate the prediction block. , the corresponding pixel values of the current coding block and the prediction block are subtracted to obtain the residual of the current coding block.
  • the residual of the current coding block is transformed 204 , quantized 205 and entropy encoded 210 to form the code stream of the current coding block. Further, after all the coded blocks of the current coded frame are subjected to the above coding process, a part of the coded code stream of the coded frame is formed.
  • the control and reference data generated in the intra prediction 203 are also encoded by entropy encoding 210 to form part of the encoded code stream.
  • the transform 204 is used to de-correlate the residuals of image blocks in order to improve coding efficiency.
  • two-dimensional discrete cosine transform Discrete Cosine Transform, DCT
  • two-dimensional discrete sine transform Discrete Sine Transform, DST
  • quantization 205 is used to further improve the compression efficiency.
  • the transform coefficients can be quantized to obtain quantized coefficients, and then the quantized coefficients are entropy encoded 210 to obtain the residual code stream of the current encoding block.
  • the entropy encoding method includes: But not limited to content adaptive binary arithmetic coding (Context Adaptive Binary Arithmetic Coding, CABAC) entropy coding.
  • CABAC Context Adaptive Binary Arithmetic Coding
  • the bit stream obtained by entropy encoding and the encoded encoding mode information are stored or sent to the decoding end.
  • inverse quantization 206 is also performed on the quantized result, and inverse transformation 207 is performed on the inverse quantization result.
  • the reconstructed pixels are obtained using the inverse transformation result and the motion compensation result. Afterwards, the reconstructed pixels are filtered (ie loop filtered) 211. After 211, the filtered reconstructed image (belonging to the reconstructed video frame) is output. Subsequently, the reconstructed image can be used as a reference frame image of other frame images for inter-frame prediction. In this embodiment of the present application, the reconstructed image may also be referred to as a reconstructed image or a reconstructed image.
  • the coded adjacent blocks in the process of intra-frame prediction 203 are: adjacent blocks that have been coded before the current coded block is coded, and the residuals generated in the coding process of the adjacent blocks are transformed 204, quantized 205, After inverse quantization 206 and inverse transform 207, the reconstructed block is obtained by adding the prediction block of the adjacent block.
  • inverse quantization 206 and inverse transform 207 are inverse processes of quantization 206 and transform 204, and are used to restore residual data before quantization and transform.
  • the inter prediction process includes motion estimation (Motion Estimation, ME) 208 and motion compensation (Motion Compensation, MC) 209 .
  • the motion estimation 208 is performed according to the reference frame image in the reconstructed video frame, and the image block most similar to the current coding block is searched in one or more reference frame images according to a certain matching criterion to be the matching block.
  • the relative displacement with the current coding block is the motion vector (Motion Vector, MV) of the current coding block.
  • motion compensation 209 is performed on the current coding block to obtain a prediction block of the current coding block.
  • the original value of the pixel of the coding block is subtracted from the pixel value of the corresponding prediction block to obtain the residual of the coding block.
  • the residual of the current coded block is transformed 204, quantized 205 and entropy coded 210 to form a part of the coded code stream of the coded frame.
  • the control and reference data generated in motion compensation 209 are also encoded by entropy coding 210 to form part of the encoded code stream.
  • the reconstructed video frame is a video frame obtained after filtering 211 .
  • a reconstructed video frame includes one or more reconstructed images.
  • Filtering 211 is used to reduce compression distortions such as blocking and ringing effects during the encoding process.
  • the reconstructed video frame is used to provide reference frames for inter-frame prediction during the encoding process.
  • the reconstructed video frame is post-processed and output. for the final decoded video.
  • the inter prediction mode may include an advanced motion vector prediction (Advanced Motion Vector Prediction, AMVP) mode, a merge (Merge) mode, or a skip (skip) mode.
  • AMVP Advanced Motion Vector Prediction
  • merge Merge
  • skip skip
  • the motion vector prediction can be determined first. After the MVP is obtained, the starting point of the motion estimation can be determined according to the MVP, and a motion search can be performed near the starting point. After the search is completed, the optimal MV, the position of the reference block in the reference image is determined by the MV, the reference block is subtracted from the current block to obtain the residual block, the MV is subtracted from the MVP to obtain the Motion Vector Difference (MVD), and the difference between the MVD and the MVP is obtained.
  • the index is transmitted to the decoder through the code stream.
  • the MVP can be determined first, and the MVP can be directly determined as the MV of the current block.
  • a MVP candidate list (merge candidate list) can be constructed first.
  • the MVP candidate list at least one candidate MVP can be included, and each candidate MVP can have an index corresponding to the MVP candidate list.
  • the MVP index can be written into the code stream, and the decoder can find the MVP corresponding to the index from the MVP candidate list according to the index, so as to decode the image block.
  • Skip mode is a special case of Merge mode. After the MV is obtained according to the Merge mode, if the encoder determines that the current block is basically the same as the reference block, it does not need to transmit the residual data, only the index of the MVP needs to be passed, and further a flag can be passed, which can indicate that the current block can be directly Obtained from the reference block.
  • the image block to be encoded can be divided into a plurality of sub-image blocks in the shape of a polygon, and a motion vector can be determined for each sub-image block from the motion information candidate list, and based on the The motion vector determines the prediction sub-block corresponding to each sub-image block, and constructs the prediction block of the current image block based on the prediction sub-block corresponding to each sub-image block, so as to realize the encoding of the current image block.
  • the decoding end perform operations corresponding to the encoding end.
  • the residual information is obtained by entropy decoding, inverse quantization and inverse transformation, and according to the decoded code stream, it is determined whether the current image block uses intra-frame prediction or inter-frame prediction. If it is intra-frame prediction, use the reconstructed image blocks in the current frame to construct prediction information according to the intra-frame prediction method; if it is inter-frame prediction, you need to parse out the motion information, and use the parsed motion information in the reconstructed image. Then, the prediction information and the residual information are superimposed, and the reconstruction information can be obtained through the filtering operation.
  • LMCS luma mapping with chroma scaling
  • LMCS mainly includes two parts: luma mapping (luma mapping) and luminance-dependent chroma scaling (chroma scaling).
  • the basic idea of LM is to make full use of the value range of luminance values under a given bit depth, because a general video signal will not take all the values in the value space.
  • This technology maps the luminance pixel value of the input image to the mapping domain (ie, the mapping pixel domain) through a piecewise linear function, and then performs related encoding process processing.
  • the technology is divided into 16 segments for mapping.
  • the mapped interval is firstly divided into 16 segments, each segment is 64 long, and then the length of each segment is scaled according to some statistical data.
  • the length of the first segment is 68 after processing, and the original pixel value will be 0-63, mapped to 0-67 according to a linear function. It can be seen from this that no matter how much the input bit width is, the current technology is only divided into 16 segments by default. For high bit width, the interval length of each segment will be longer, which reduces the efficiency and flexibility of the mapping. sex.
  • FIG. 3 shows the decoding process of the luminance component, including: generating the luminance residual value Yres in the mapping domain through inverse quantization and inverse transformation 301 in the code stream. Through reconstruction 302, that is, adding the residual value Yres and the corresponding predicted value Y'pred of the mapping domain to obtain the reconstructed value Yr of the mapping domain.
  • the application of LMCS for the luma mapping is not exactly the same in the intra- and inter-frame parts.
  • Y'pred can be obtained by mapping the luminance value in the domain.
  • motion compensation 304 For inter-frame prediction, it is necessary to construct motion compensation 304 according to the mapped pixel values of the original signal domain (ie, the original pixel domain), obtain the predicted value Ypred of the original signal domain according to the motion compensation 304, and pass the predicted value Ypred of the original signal domain through the mapping 305 Get the Y'pred of the mapped domain. Perform inverse mapping 306 on the reconstructed value Y'res, then perform loop filtering 307, and send the result to DPB (decoded picture buffer, decoded picture buffer) 308, thereby obtaining a decoded video. Among them, the pixel values in the DPB are in the original signal domain.
  • DPB decoded picture buffer, decoded picture buffer
  • the mapped interval is fixedly set to 16 segments.
  • the pixel ranges corresponding to different bit widths are different.
  • the corresponding pixel ranges of 8bit, 10bit, 12bit and 16bit are 0-255, 0-1023, 0-4095 and 0-65535 respectively.
  • VVC is only an example of this application.
  • this application is also applicable.
  • the embodiment of the present application proposes a video coding method, which can perform adaptive adjustment in combination with actual conditions, which helps to improve the flexibility of mapping.
  • the method includes:
  • the above-mentioned bit depth refers to the number of bits occupied by the pixel value of the pixel point in the to-be-encoded image.
  • the above image to be encoded is in YUV format, and its bit depth is 10 bits.
  • Y is a luminance component
  • U and V are both chrominance components
  • the number of bits occupied by the pixel values of the Y, U, and V components of the pixel point in the image to be encoded are all 10 bits.
  • the appropriate number of pixel interval segments can be determined for images with different bit depths through experiments in advance, and the correspondence between different bit depths and the corresponding number of pixel interval segments can be established and stored for subsequent application. .
  • the preset number of pixel interval segments may be set according to actual needs, which is not specifically limited in this embodiment of the present application.
  • the adjustment range of the segment number and the adjustment direction of the segment number can be determined according to the bit depth of the image to be encoded; according to the adjustment range of the segment number and the adjustment direction of the segment number, the preset pixel interval segment number is adjusted to obtain the above-mentioned pixel interval segment number. .
  • the magnification can be determined according to the absolute value of the difference between the bit depth and the bit depth threshold; the preset number of pixel interval segments is amplified according to the magnification, for example, the magnification is compared with the preset pixel interval. The product of the number of segments is used as the number of segments in the above-mentioned pixel interval.
  • different bit depths may correspond to different magnifications, that is, each bit depth corresponds to one magnification; or, multiple different bit depths may correspond to the same magnification, and other multiple Different bit depths correspond to another same magnification factor, that is, each group of bit depths corresponds to a magnification factor.
  • the magnification may be increased according to a preset step size, and the preset step size may be a multiple of 2, or a multiple of other values.
  • the magnification can be calculated by the same calculation process at both ends of the codec, or it can be indicated in the code stream.
  • a plurality of correspondences between the absolute difference values and their corresponding magnifications can be established in advance, so that the corresponding magnification can be found subsequently according to the absolute value of the difference between the bit depth and the bit depth threshold.
  • the correspondence relationship between a plurality of different absolute value ranges of differences and their corresponding magnifications may be established in advance, so that the subsequent absolute value ranges of the differences are determined according to the absolute values of the differences between the bit depth and the bit depth threshold;
  • the magnification corresponding to the absolute value range of the difference is taken as the above magnification.
  • the magnifications corresponding to the multiple different absolute values of the difference and the magnifications corresponding to the multiple different absolute value ranges may be determined according to experiments, which are not specifically limited in the embodiments of the present application.
  • the absolute value of the difference between the bit depth and the bit depth threshold can be input into an exponential function, and the exponential function is executed to obtain the magnification.
  • the exponential function can be:
  • x is the independent variable
  • y is the dependent variable
  • a is a constant.
  • the value of a may be set according to actual needs, which is not specifically limited in this embodiment of the present application, for example, a is 0.
  • a is 0, the bit depth is 12 bits, the bit depth threshold is 10 bits, the absolute value of the difference is 2 bits, and the magnification is 2 2 , which is 4.
  • the preset number of pixel interval segments can be left-shifted by 2 bits, that is, multiplied by 4, to obtain the above-mentioned number of pixel interval segments.
  • a is 1, the bit depth is 12 bits, the bit depth threshold is 10 bits, the absolute value of the difference is 2 bits, and the magnification is 2 2 , which is 4.
  • the preset number of pixel interval segments can be left-shifted by 1 bit, that is, multiplied by 2, to obtain the above-mentioned number of pixel interval segments. In this embodiment, instead of shifting 2 bits to the left, it shifts 1 bit to the left, which can reduce a certain number of coded bits.
  • the bit depth of the to-be-encoded image is less than the bit-depth threshold, it indicates that the to-be-encoded image is a low bit depth image, and the number of pixel interval segments needs to be reduced.
  • the number of segments in the pixel interval is reduced, so that the relevant information of a small number of pixel intervals can be encoded during encoding, that is, the number of encoded bits is reduced.
  • the reduction factor can be determined according to the absolute value of the difference between the bit depth and the bit depth threshold; and the preset number of segments in the pixel interval is reduced according to the reduction factor, for example, dividing the number of segments in the preset pixel interval by The quotient of the reduction factor is used as the number of segments of the above-mentioned pixel interval.
  • bit depths may correspond to different reduction factors, that is, each bit depth corresponds to a reduction factor; or, multiple different bit depths may correspond to the same reduction factor, while other multiple Different bit depths correspond to another same reduction factor, that is, each group of bit depths corresponds to a reduction factor.
  • the reduction factor may be decreased according to a preset step size, and the preset step size may be a multiple of 2, or a multiple of other values.
  • the reduction factor can be calculated by the same calculation process at both ends of the codec, or it can be indicated in the code stream.
  • a plurality of different absolute values of the difference and their corresponding reduction factors may be established in advance, so that the corresponding reduction factors can be found subsequently according to the absolute value of the difference between the bit depth and the bit depth threshold.
  • a plurality of different absolute value ranges of the difference and the corresponding relationship of the corresponding reduction multiples can be established in advance, so that the subsequent absolute value of the difference between the bit depth and the bit depth threshold is used to determine the absolute value range of the difference;
  • the reduction factor corresponding to the absolute value range of the difference is used as the reduction factor above.
  • the reduction factor corresponding to the multiple different absolute values of the difference and the reduction factor corresponding to the multiple different absolute value ranges can be determined according to experiments, which are not specifically limited in the embodiment of the present application.
  • the absolute value of the difference between the bit depth and the bit depth threshold can be input into the above exponential function, and the exponential function is executed to obtain the reduction factor.
  • the exponential function can also be the above formula (1).
  • a is 0, the bit depth is 8 bits, the bit depth threshold is 10 bits, the absolute value of the difference is 2 bits, and the reduction factor is 2 2 , which is 4.
  • the preset number of pixel interval segments may be shifted to the right by 2 bits, that is, divided by 4, to obtain the above-mentioned number of pixel interval segments.
  • the preset number of pixel interval segments may not be adjusted.
  • bit depth threshold may be set according to actual needs, which is not specifically limited in this embodiment of the present application.
  • the above-mentioned bit depth threshold and the above-mentioned preset number of pixel interval segments can be jointly determined.
  • the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals.
  • the original pixel interval can be understood as a pixel interval in the original pixel domain; the mapped pixel interval can be understood as a pixel interval in the mapped pixel domain.
  • the number of the plurality of mapped pixel intervals and the plurality of original pixel intervals is determined by the number of pixel interval segments. In an example, the number of the plurality of mapped pixel intervals and the plurality of original pixel intervals may be equal to the number of pixel interval segments.
  • the pixel value may be a luminance pixel value or a chrominance pixel value. If the above-mentioned image to be encoded is in RGB format, the above-mentioned pixel value may be the pixel value of G, R or B component.
  • the code stream can be sent to the decoding end.
  • the technical solutions provided by the embodiments of the present application when the to-be-coded image is encoded, the number of pixel interval segments that need to be divided during pixel mapping is determined based on the bit depth of the to-be-coded image. Compared with the solution in the existing VCC standard in which the number of pixel intervals before and after the mapping is fixed or set by default, the technical solutions provided in the embodiments of the present application can be adaptively adjusted in combination with the actual situation, which helps to improve the mapping efficiency. flexibility.
  • each pixel in the image determines a plurality of mapped pixel intervals corresponding to the plurality of original pixel intervals one-to-one.
  • a plurality of pixel intervals may be obtained by dividing the original pixel value range determined based on the bit depth of the image to be encoded according to the number of pixel interval segments.
  • the plurality of pixel intervals can be directly used as the above-mentioned plurality of original pixel intervals.
  • the above-mentioned multiple original pixel intervals are multiple valid original pixel intervals.
  • the plurality of valid original pixel intervals may be determined from the plurality of pixel intervals according to the distribution of pixel values of the image to be encoded.
  • a plurality of pixel intervals that have an intersection with the pixel value distribution range of the image to be encoded among the plurality of pixel intervals are determined as the plurality of valid original pixel intervals.
  • the distribution range of pixel values is determined by the minimum pixel value and the maximum pixel value in the image to be encoded.
  • intersection There is an intersection between a certain pixel interval and the pixel value distribution range of the image to be encoded, indicating that there is at least one pixel value in the to-be-encoded image that falls into the pixel interval; a pixel interval and the pixel value distribution range of the to-be-encoded image No intersection, it means that there is no pixel value of a certain pixel in the to-be-encoded image that falls within the pixel range. In this embodiment, those invalid pixel intervals are eliminated, which can help to reduce the number of encoded bits.
  • the multiple original pixel intervals include a first original pixel interval; the multiple mapped pixel intervals include a first mapped pixel interval corresponding to the first original pixel interval.
  • the first original pixel interval refers to any one of multiple original pixel intervals.
  • the pixel value of the at least one pixel point falls within the first original pixel interval.
  • the first original pixel interval is 0-63; the pixel value of pixel A in the image to be encoded is 4, the pixel value of pixel B is 63, and the pixel value of pixel C is 90.
  • Pixel points A and B are the pixel points that fall within the first original pixel interval.
  • the above method may further include:
  • the mapping pixel value range may be a preset range corresponding to a preset bit depth, for example: the preset bit depth is 10bit, and the corresponding preset range is 0-1023; or, it is determined according to the bit depth of the image to be encoded, for example: When the bit depth of the image to be encoded is 12 bits, the value range of the mapped pixels is 0-4095 corresponding to 12 bits.
  • the ratio of the total length of the mapped pixel value range to the number of pixel interval segments may be determined as the initial mapping interval length.
  • the pixel value distribution variance of the area where each pixel point is located in the at least one pixel point in the to-be-coded image is calculated respectively, and the area where each pixel point is located may be centered on the corresponding pixel point, and win is a window area with a square side length, and calculate.
  • the variance of the distribution of pixel values within this window area refers to the luminance pixel value distribution variance.
  • the calculation formula of win is as follows:
  • width and height are respectively the width and height of the image to be encoded; min (width, height) is a function of taking the minimum value of width and height. Indicates rounded down.
  • the ratio of the sum of the variances of the pixel value distribution in the region where each pixel point is located in the at least one pixel point and the number of the at least one pixel point is taken as the above average value.
  • the adjustment direction is to increase; when the average value is greater than the preset average threshold, the adjustment direction is to decrease; when the average value is equal to the preset average threshold, the adjustment may not be made.
  • the size of the preset average threshold may be set according to actual needs, which is not specifically limited in this embodiment of the present application, for example, set to 1.
  • the larger the absolute value of the difference between the average value and the above-mentioned preset average threshold value is, the larger the adjustment range is; or, the larger the proportion of the number of at least one pixel, the larger the adjustment range.
  • the proportion of the number of at least one pixel refers to the ratio of the number of at least one pixel to the total number of pixels of the image to be encoded.
  • the adjustment range may be determined according to the average value and the ratio of the number of the at least one pixel point.
  • the length of the initial mapping interval is adjusted to obtain the adjusted interval length; based on the adjusted interval length, the interval length of the first mapped pixel interval is determined.
  • obinCW[i] represents the length of the initial mapping interval
  • binCW[i] is the length of the interval after adjustment
  • normVar is the above average value
  • hist represents the proportion of the above number
  • i can be understood as the index value of the first original pixel interval, and the relevant index The determination of the value will be described in detail in the following embodiments
  • delta1 and delta2 are two different adjustment amplitudes
  • round() is a downward rounding function.
  • the mapping pixel value range may be mapped to the pixel range corresponding to the bit depth of the image to be encoded, or may be first mapped to a preset pixel range, and then to the pixel corresponding to the bit depth of the image to be encoded scope.
  • the adjusted interval length may be directly used as the interval length of the first mapped pixel interval.
  • mapping pixel value range is the preset range corresponding to the preset bit depth and the bit depth of the image to be encoded is inconsistent with the preset bit depth, it is necessary to perform the above adjustment according to the bit depth of the image to be encoded and the preset bit depth.
  • the interval length is scaled to obtain the interval length of the first mapped pixel interval.
  • the zoom factor and the zoom mode are determined according to the absolute value and the sign of the difference between the bit depth of the image to be encoded and the preset bit depth, respectively.
  • the zoom factor is determined according to the absolute value of the difference between the bit depth of the image to be encoded and the preset bit depth; if the sign is negative, the zoom mode is zooming out; if the sign is positive, the zoom mode is zooming in.
  • the bit depth of the to-be-encoded image is 12 bits and the above preset bit depth is 10 bits
  • the above-mentioned adjusted interval length needs to be left-shifted by two bits, that is, multiplied by 4 to obtain the interval length of the first mapped pixel interval.
  • the adjusted interval length needs to be shifted to the right by two bits, that is, divided by 4 to obtain the interval length of the first mapped pixel interval.
  • the first mapped pixel interval is determined, that is, the start and end points of the first mapped pixel interval are determined.
  • the plurality of pixel intervals may be sequentially numbered according to the starting positions of the above-mentioned multiple pixel intervals, for example, the numbering starts from 0. The further forward the starting point is, the smaller the number. In practical application, the number of each pixel interval can be used as its corresponding index value.
  • the above-mentioned multiple original pixel intervals may be arranged in ascending order according to the index values of the above-mentioned multiple original pixel intervals, so as to obtain the original pixel interval sequence. If the above-mentioned first original pixel interval is the original pixel interval ranked first in the original pixel interval sequence, it can be determined that the starting point of the first mapped pixel interval is 0; according to the starting point of the first mapped pixel interval and the interval length, it can be determined the end point of the first mapped pixel interval. Specifically, the start point of the first mapped pixel interval is added to the interval length and then subtracted by 1, as the end point of the first mapped pixel interval.
  • the interval length of the first mapped pixel interval and the previous original pixel interval of the first original pixel interval in the sequence of original pixel intervals may be used.
  • the end point of the mapped pixel interval corresponding to the pixel interval determines the start and end point of the first mapped pixel interval.
  • the end point of the previous mapped pixel interval can be added by 1 to obtain the starting point of the first mapped pixel interval; the starting point of the first mapped pixel interval can be added to the length of the first mapped pixel interval, and then subtracted by 1 to obtain the first mapped pixel interval. end.
  • the plurality of mapped pixel intervals correspond one-to-one with the plurality of original pixel intervals.
  • the following steps can be specifically implemented:
  • a linear mapping function can be determined according to the start and end points of each original pixel interval in the plurality of original pixel intervals and the start and end points of the corresponding mapped pixel intervals, as a mapping relationship corresponding to each original pixel interval.
  • the mapped pixel value of the to-be-encoded image may be determined according to the original pixel value of the to-be-encoded image and the mapping relationship corresponding to the original pixel interval in which the image to be encoded is located. Specifically, the original pixel value is input into the linear mapping function corresponding to the original pixel interval where it is located to obtain the mapped pixel value.
  • the pixel values may be luma pixel values.
  • the to-be-encoded image can be divided into multiple encoding blocks for sub-block encoding.
  • image's mapped pixel values including:
  • mapping relationship map the pixel value of the block to be encoded from the original pixel domain to the mapped pixel domain to obtain the mapped block to be encoded.
  • each block to be coded it may be determined according to the configuration whether to use intra-frame prediction or inter-frame prediction to remove redundant information in the spatial domain or time domain of the to-be-coded image.
  • the specific encoding process includes:
  • the reconstructed blocks of the coded adjacent blocks around the to-be-coded block in the to-be-coded image are determined as the reference blocks of the to-be-coded block.
  • intra-frame prediction process For details of the intra-frame prediction process, reference may be made to the above-mentioned contents of FIG. 2 and FIG. 3 , and details are not repeated here.
  • the pixel values in the reference block and the prediction block are all pixel values in the mapped pixel domain.
  • the specific encoding process includes:
  • the pixel value of the prediction block is the pixel value of the original pixel domain.
  • the pixel value of the prediction block is the pixel value of the original pixel domain.
  • mapping relationship map the prediction block from the original pixel domain to the mapped pixel domain to obtain a mapped prediction block.
  • the to-be-coded block is mapped from the original pixel domain to the mapped pixel domain to obtain the mapped to-be-coded block.
  • the residual block may be transformed, quantized, and entropy encoded to form part of the codestream.
  • the pixel value involved in this embodiment refers to the luminance pixel value.
  • the method includes:
  • the code stream may be actively requested from other devices.
  • the code stream actively sent by other devices can be passively accepted.
  • other devices may be encoding end devices.
  • the to-be-decoded image in the decoding process is also the to-be-encoded image involved in the above-mentioned encoding process.
  • the code stream is decoded according to the multiple original pixel intervals and the multiple mapped pixel intervals to obtain a decoded image.
  • the luminance pixel values in the code stream may be decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  • the technical solutions provided by the embodiments of the present application when the to-be-decoded image is decoded, the number of pixel interval segments that need to be divided during pixel mapping is determined based on the bit depth of the to-be-decoded image. Compared with the solution in the existing VCC standard in which the number of pixel intervals before and after the mapping is fixed or set by default, the technical solutions provided in the embodiments of the present application can be adaptively adjusted in combination with the actual situation, which helps to improve the mapping efficiency. flexibility.
  • bit depth of the to-be-decoded image is less than a bit depth threshold, reduce the number of segments in the preset pixel interval to obtain the number of segments in the pixel interval.
  • the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals; the original pixel intervals are valid original pixel intervals; the code stream includes third indication information and fourth indication information and fifth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be decoded; the fourth indication information is used to indicate the valid original pixel corresponding to the image to be decoded The maximum index value of the interval; the fifth indication information is used to indicate interval lengths of the plurality of mapped pixel intervals.
  • the plurality of pixel intervals may be numbered in sequence according to the starting positions of the plurality of pixel intervals, for example, the numbering starts from 0. The further forward the starting point is, the smaller the number.
  • the number of each pixel interval can be used as its corresponding index value.
  • the above code stream may only include one of the third indication information and the fourth indication information.
  • the above code stream only contains the third indication information, then, the encoder and decoder can default the maximum index value to the number of pixel interval segments minus 1.
  • the above-mentioned code stream only includes the fourth indication information, then, the encoder and the decoder can default the minimum index value to 0.
  • the interval lengths of the plurality of pixel intervals may be the same, that is, the interval lengths of the plurality of original pixel intervals are the same.
  • the length of the original pixel interval may be determined based on the original pixel value range and the number of pixel interval segments determined by the bit depth of the image to be decoded. Specifically, the ratio of the total length of the original pixel value range to the number of pixel interval segments may be determined as the original pixel interval length.
  • the interval length of each pixel interval is the original pixel interval length.
  • the code stream further includes sixth indication information; the sixth indication information is used to indicate the bit depth.
  • “Determining the length of the original pixel interval according to the number of segments of the pixel interval" in the above 5031 is specifically: determining the length of the original pixel interval according to the bit depth and the number of segments of the pixel interval. That is, the length of the original pixel interval is determined based on the original pixel value range and the number of pixel interval segments determined by the bit depth of the image to be decoded.
  • the multiple valid original pixel intervals are determined, that is, the start and end points of the multiple valid original pixel intervals are determined.
  • Start and end points include start and end points.
  • the length of the original pixel interval is 64; the minimum index value of the valid original pixel interval is 1, and the maximum index value is 2; that is, there are two valid original pixel intervals, and the index values are 1 and 2 respectively.
  • the starting point of the valid original pixel interval with an index value of 1 is 64, and its end point is 127; the starting point of the valid original pixel interval with an index value of 2 is 128, and its end point is 191.
  • the fifth indication information is used to indicate the interval length of each mapped pixel interval in the plurality of mapped pixel intervals.
  • the fifth indication information may include a plurality of sub-indication information, and the plurality of sub-indication information are respectively used to indicate the interval length of each mapped pixel interval in the plurality of mapped pixel intervals.
  • a plurality of sub-indication information are sequentially recorded in the above-mentioned code stream. The recording sequence of the multiple sub-indication information is determined by the index values of the multiple original mapped pixel ranges corresponding to the multiple mapped pixel ranges.
  • each sub-indication information carries the index value of the original pixel interval corresponding to the corresponding mapped pixel interval.
  • the start and end points of the plurality of mapped pixel intervals are determined.
  • the start and end points of the multiple mapped pixel intervals may be determined according to the recording sequence of the multiple sub-indication information in the code stream and the interval lengths of the multiple mapped pixel intervals.
  • the interval lengths are 68 and 60, respectively.
  • the sub-indication information corresponding to 68 and 60 is recorded in the code stream in the following order: 68 comes first, 60 comes after, then, a mapped pixel interval
  • the start and end points of the pixel interval are 0 and 67, respectively; the start and end points of the other mapped pixel interval are 68 and 127, respectively.
  • the multiple valid original pixel intervals can be sorted in ascending order according to their respective index values; the multiple mapped pixel intervals can be sorted in ascending order according to the recording order of the sub-indication information corresponding to each of the multiple mapped pixel intervals; the sequence number is determined.
  • the same valid original pixel interval corresponds to the mapped pixel interval.
  • the decoding process for intra prediction includes the following steps:
  • the pixel value of the residual block is the pixel value of the mapped pixel domain.
  • the pixel value of the prediction block is the pixel value of the mapped pixel domain.
  • the decoding process for inter prediction includes:
  • the pixel value of the residual block is the pixel value of the mapped pixel domain.
  • the pixel value of the prediction block is the pixel value of the original pixel domain.
  • the pixel value of the prediction block is the pixel value of the original pixel domain.
  • mapping relationship map the pixel values of the prediction block from the original pixel domain to the mapped pixel domain to obtain the mapped prediction block.
  • mapping prediction block and the residual block determine the mapping to-be-decoded block corresponding to the to-be-decoded block.
  • the pixel value of the mapped block to be decoded is mapped from the mapped pixel domain to the original pixel domain to obtain the to-be-decoded block.
  • the mapping relationship between the pixel values of the mapped block to be decoded and the original pixel interval corresponding to the mapped pixel interval in which the mapped pixel value is located the original pixel value of the mapped to-be-decoded block is determined.
  • FIG. 6 shows a schematic flowchart of a video encoding method provided by another embodiment of the present application. As shown in Figure 5, the method includes:
  • the code stream includes first indication information, where the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-encoded image, and the pixel interval segment number is determined based on the bit depth of the to-be-encoded image .
  • the first indication information for indicating the number of pixel interval segments corresponding to the image to be encoded is directly carried in the code stream.
  • the decoding end can directly obtain the number of pixel interval segments from the code stream, that is, Yes, it does not need to be determined by calculation, which is beneficial to save the computing resources of the decoding end and reduce the decoding time.
  • the first indication information includes the number of segments in the pixel interval.
  • the first indication information includes a difference between the number of segments in the pixel interval and a preset value.
  • the preset value is a parameter determined in the encoding process, and the code stream further includes second indication information for indicating the preset value; or, the preset value is solidified before encoding. Or preset parameters on the encoding side and the decoding side.
  • the size of the preset value can be determined according to actual needs, which is not specifically limited in this application.
  • the preset value includes the bit depth.
  • the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be encoded; the The fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the image to be encoded.
  • the third indication information includes the minimum index value.
  • the fourth indication information includes the maximum index value.
  • the fourth indication information includes a difference between the number of segments in the pixel interval and the maximum index value.
  • the code stream further includes fifth indication information; the fifth indication information is used to indicate the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the image to be encoded.
  • the fifth indication information includes the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-encoded image and the initial mapped interval length and the sign thereof;
  • the length of the initial mapping interval is determined according to the number of segments of the pixel interval.
  • the code stream further includes sixth indication information for indicating the bit depth.
  • encode the to-be-encoded image to obtain a code stream including:
  • the bit depth of the to-be-coded image determine the number of pixel interval segments corresponding to the to-be-coded image
  • the pixel values of the to-be-encoded image are encoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to generate a code stream.
  • the pixel value is a luminance pixel value.
  • FIG. 7 shows a schematic flowchart of a video decoding method provided by another embodiment of the present application. As shown in Figure 6, the method includes:
  • the code stream includes first indication information, where the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-decoded image, and the pixel interval segment number is determined based on the bit depth of the to-be-decoded image.
  • the first indication information for indicating the number of pixel interval segments corresponding to the image to be encoded is directly carried in the code stream.
  • the decoding end can directly obtain the number of pixel interval segments from the code stream, that is, Yes, it does not need to be determined by calculation, which is beneficial to save the computing resources of the decoding end and reduce the decoding time.
  • the first indication information includes the number of segments in the pixel interval.
  • the first indication information includes a difference between the number of segments in the pixel interval and a preset value.
  • the preset value is a parameter determined in the encoding process
  • the code stream further includes second indication information for indicating the preset value; or, the preset value is solidified before encoding. Or preset parameters on the encoding side and the decoding side.
  • the preset value includes the bit depth.
  • the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be decoded; the The fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the to-be-decoded image.
  • the third indication information includes the minimum index value.
  • the fourth indication information includes the maximum index value.
  • the fourth indication information includes a difference between the number of segments in the pixel interval and the maximum index value.
  • the code stream further includes fifth indication information; the fifth indication information is used to indicate the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the image to be decoded.
  • the fifth indication information includes the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-decoded image and the length of the initial mapped interval and its sign;
  • the length of the initial mapping interval is determined according to the number of segments of the pixel interval.
  • the code stream further includes sixth indication information for indicating the bit depth.
  • the bit depth of the image to be decoded can be obtained by inverse inference based on the number of segments in the pixel interval. to determine the number of pixel interval segments of the image to be encoded", which will not be described in detail here.
  • decode the code stream according to the number of segments in the pixel interval to obtain a decoded image including:
  • the code stream is decoded according to the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  • the decoding of the code stream based on the multiple original pixel intervals and the multiple mapped pixel intervals to obtain a decoded image includes:
  • the luminance pixel values in the code stream are decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  • the apparatus 1100 includes: a memory 1120, a processor 1110, and a communication interface 1130;
  • the memory 1120 for storing programs
  • the processor 1110 is configured to execute the program stored in the memory, so as to:
  • the transmitter is controlled to send the code stream through the communication interface 1130 .
  • the communication interface may be a data interface, a U/I interface, etc.
  • the transmitter may be an antenna, a radio frequency module, etc., and data transmission may be performed in a wired or wireless manner.
  • the transmitter can be integrated with the receiver or designed independently.
  • the memory 1120 may be a separate device independent of the processor 1110, or may be integrated in the processor 1110.
  • the first indication information includes the number of segments in the pixel interval.
  • the first indication information includes a difference between the number of segments in the pixel interval and a preset value.
  • the preset value is a parameter determined in the encoding process
  • the code stream further includes second indication information for indicating the preset value; or, the preset value is solidified before encoding. Or preset parameters on the encoding side and the decoding side.
  • the preset value includes the bit depth.
  • the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be encoded; the The fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the image to be encoded.
  • the third indication information includes the minimum index value.
  • the fourth indication information includes the maximum index value.
  • the fourth indication information includes a difference between the number of segments in the pixel interval and the maximum index value.
  • the code stream further includes fifth indication information; the fifth indication information is used to indicate the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the image to be encoded.
  • the fifth indication information includes the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-encoded image and the initial mapped interval length and the sign thereof;
  • the length of the initial mapping interval is determined according to the number of segments of the pixel interval.
  • the code stream further includes sixth indication information for indicating the bit depth.
  • processor 1110 is further configured to:
  • the bit depth of the to-be-coded image determine the number of pixel interval segments corresponding to the to-be-coded image
  • the pixel values of the to-be-encoded image are encoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to generate a code stream.
  • the pixel value is a luminance pixel value.
  • the encoding device can be, for example, an encoder, a terminal (including but not limited to a mobile phone, a camera, a drone, etc.), a chip, a processing device, etc., and the encoding device can implement each encoding method in the corresponding embodiment of the present application.
  • a terminal including but not limited to a mobile phone, a camera, a drone, etc.
  • the encoding device can implement each encoding method in the corresponding embodiment of the present application.
  • the corresponding processes in , for brevity, are not repeated here.
  • the apparatus 1200 includes: a memory 1220, a processor 1210, and a communication interface 1230;
  • the memory 1220 for storing programs
  • the processor 1210 is configured to execute the program stored in the memory, so as to:
  • the receiver Control the receiver to obtain a code stream through the communication interface 1230; wherein, the code stream includes first indication information, and the first indication information is used to indicate the number of pixel intervals corresponding to the image to be decoded, and the number of pixel intervals is determined based on the bit depth of the to-be-decoded image;
  • the code stream is decoded according to the number of segments in the pixel interval to obtain a decoded image.
  • the first indication information includes the number of segments in the pixel interval.
  • the first indication information includes a difference between the number of segments in the pixel interval and a preset value.
  • the preset value is a parameter determined in the encoding process
  • the code stream further includes second indication information for indicating the preset value; or, the preset value is solidified before encoding. Or preset parameters on the encoding side and the decoding side.
  • the preset value includes the bit depth.
  • the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be decoded; the The fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the to-be-decoded image.
  • the third indication information includes the minimum index value.
  • the fourth indication information includes the maximum index value.
  • the fourth indication information includes a difference between the number of segments in the pixel interval and the maximum index value.
  • the code stream further includes fifth indication information; the fifth indication information is used to indicate the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the image to be decoded.
  • the fifth indication information includes the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-decoded image and the length of the initial mapped interval and its sign;
  • the length of the initial mapping interval is determined according to the number of segments of the pixel interval.
  • the code stream further includes sixth indication information for indicating the bit depth.
  • processor 1210 is further configured to:
  • the code stream is decoded according to the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  • processor 1210 is further configured to:
  • the luminance pixel values in the code stream are decoded according to the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  • the decoding device can be, for example, a decoder, a terminal (including but not limited to a mobile phone, a camera, a drone, etc.), a chip, a processing device, etc., and the decoding device can implement each decoding method in the corresponding embodiment of the present application.
  • a decoder including but not limited to a mobile phone, a camera, a drone, etc.
  • the decoding device can implement each decoding method in the corresponding embodiment of the present application.
  • the corresponding processes in , for brevity, are not repeated here.
  • the apparatus 1100 includes: a memory 1120, a processor 1110, and a communication interface 1130;
  • the memory 1120 for storing programs
  • the processor 1110 is configured to execute the program stored in the memory, so as to:
  • the bit depth of the to-be-coded image determine the number of pixel interval segments corresponding to the to-be-coded image
  • the number of pixel interval segments determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-coded image
  • the transmitter is controlled to send the code stream through the communication interface 1130 .
  • processor 1110 is further configured to:
  • the preset number of segments in the pixel interval is adjusted to obtain the number of segments in the pixel interval.
  • processor 1110 is further configured to:
  • the preset number of segments in the pixel interval is increased to obtain the number of segments in the pixel interval.
  • processor 1110 is further configured to:
  • bit depth of the to-be-encoded image is less than the bit depth threshold, reducing the number of segments in the preset pixel interval is performed to obtain the number of segments in the pixel interval.
  • processor 1110 is further configured to:
  • a plurality of mapped pixel intervals corresponding to the plurality of original pixel intervals one-to-one is determined.
  • the multiple original pixel intervals include a first original pixel interval;
  • the multiple mapped pixel intervals include a first mapped pixel interval corresponding to the first original pixel interval;
  • the processor 1110 is further configured to:
  • each pixel in the to-be-coded image determines at least one pixel that falls within the first original pixel interval
  • the first mapped pixel interval is determined based on the interval length of the first mapped pixel interval.
  • processor 1110 is further configured to:
  • the processor 1110 is further configured to:
  • the length of the initial mapping interval is adjusted to obtain the interval length of the first mapped pixel interval.
  • the multiple original pixel intervals are multiple valid original pixel intervals
  • the processor 1110 is further configured to:
  • the plurality of valid original pixel intervals are determined from the plurality of pixel intervals according to the distribution of pixel values of the to-be-coded image.
  • processor 1110 is further configured to:
  • a plurality of pixel intervals that have an intersection with the pixel value distribution range of the image to be encoded among the plurality of pixel intervals are determined as the plurality of valid original pixel intervals.
  • the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals
  • the processor 1110 is further configured to:
  • the encoding is performed according to the mapped pixel values of the to-be-encoded image to generate a code stream.
  • processor 1110 is further configured to:
  • the mapped pixel value of the to-be-encoded image is determined according to the mapping relationship corresponding to the original pixel value of the to-be-encoded image and its original pixel interval.
  • the pixel value is a luminance pixel value.
  • the encoding device can be, for example, an encoder, a terminal (including but not limited to a mobile phone, a camera, an unmanned aerial vehicle, etc.), and the encoding device can implement the corresponding processes in the encoding methods in the corresponding embodiments of the present application, in order to It is concise and will not be repeated here.
  • the apparatus 1200 includes: a memory 1220, a processor 1210, and a communication interface 1230;
  • the memory 1220 for storing programs
  • the processor 1210 is configured to execute the program stored in the memory, so as to:
  • the number of pixel interval segments determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image
  • the code stream is decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  • processor 1210 is further configured to:
  • the preset number of pixel intervals is adjusted to obtain the number of pixel intervals.
  • processor 1210 is further configured to:
  • the preset number of segments in the pixel interval is increased to obtain the number of segments in the pixel interval.
  • processor 1210 is further configured to:
  • bit depth of the to-be-decoded image is less than the bit depth threshold, reducing the number of segments in the preset pixel interval is performed to obtain the number of segments in the pixel interval.
  • the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals; the original pixel intervals are valid original pixel intervals;
  • the code stream includes third indication information, fourth indication information and fifth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be decoded; the fourth indication information The indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the image to be decoded; the fifth indication information is used to indicate the interval length of the plurality of mapped pixel intervals;
  • the processor 1210 is further configured to:
  • the plurality of mapped pixel intervals are determined according to the interval lengths of the plurality of mapped pixel intervals.
  • the code stream further includes sixth indication information; the sixth indication information is used to indicate the bit depth;
  • the processor 1210 is further configured to:
  • the length of the original pixel interval is determined according to the bit depth and the number of segments of the pixel interval.
  • processor 1210 is further configured to:
  • the original pixel value of the to-be-decoded image is determined according to the mapping relationship between the mapped pixel value of the to-be-decoded image and the original pixel interval corresponding to the mapped pixel interval in which the image is to be decoded.
  • processor 1210 is further configured to:
  • the luminance pixel values in the code stream are decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  • the decoding device can be, for example, a decoder, a terminal (including but not limited to a mobile phone, a camera, an unmanned aerial vehicle, etc.), and the decoding device can implement the corresponding processes in the decoding methods in the corresponding embodiments of the present application, in order to It is concise and will not be repeated here.
  • the processor in this embodiment of the present application may be a video processing system, which has a signal processing capability.
  • each step of the above method embodiments may be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software.
  • the above-mentioned processor can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available Programming logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
  • the memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be Random Access Memory (RAM), which acts as an external cache.
  • RAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDR SDRAM
  • enhanced SDRAM ESDRAM
  • synchronous link dynamic random access memory Synchlink DRAM, SLDRAM
  • Direct Rambus RAM Direct Rambus RAM
  • the memory in the embodiments of the present application may provide instructions and data to the processor.
  • a portion of the memory may also include non-volatile random access memory.
  • the memory may also store device type information.
  • the processor may be configured to execute the instructions stored in the memory, and when the processor executes the instructions, the processor may execute various steps in the above method embodiments.
  • each step of the above-mentioned method can be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software.
  • the steps of the methods disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor executes the instructions in the memory, and completes the steps of the above method in combination with its hardware. To avoid repetition, detailed description is omitted here.
  • the embodiments of the present application also provide an electronic device.
  • the electronic device includes the video encoding apparatus in each of the above embodiments and the transmitter.
  • the specific structure of the video encoding apparatus and the processing flow thereof reference may be made to the corresponding contents in the foregoing embodiments, and details are not described herein again.
  • the embodiments of the present application also provide an electronic device.
  • the electronic device includes the video decoding apparatus and the receiver in the above embodiments.
  • Embodiments of the present application further provide a computer-readable storage medium, including instructions, which, when executed on a computer, enable the computer to implement any one of the video encoding methods or the video decoding methods in the foregoing embodiments.
  • a computer-readable storage medium including instructions, which, when executed on a computer, enable the computer to implement any one of the video encoding methods or the video decoding methods in the foregoing embodiments.
  • Embodiments of the present application also provide a video encoding and decoding system, including: an encoding end device and a decoding end device;
  • the encoding terminal equipment includes the above-mentioned electronic equipment including the video encoding device and the transmitter;
  • the decoding end device includes the above-mentioned electronic device including a video decoding device and the receiver.
  • the encoding end device and the decoding end device may be mobile phones, computers, drones and other devices.
  • the processing flow of the encoding end device and the decoding end device reference may be made to the corresponding content in the foregoing embodiments, and details are not described herein again.

Landscapes

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

Abstract

Embodiments of the present application provide video encoding and decoding methods, an apparatus, a system, and a storage medium. A video encoding method comprises: encoding an image to be encoded to obtain a code stream, the code stream comprising first indication information, the first indication information being used for indicating the number of pixel interval segments corresponding to the image to be encoded, the number of pixel interval segments being determined on the basis of a bit depth of the image to be encoded; and sending the code stream. In the technical solution provided in the embodiments of the present application, adaptive adjustment can be performed according to actual situations, which helps to improve the flexibility of mapping.

Description

视频编、解码方法、装置、***及存储介质Video encoding and decoding method, device, system and storage medium 技术领域technical field
本申请实施例涉及图像处理技术领域,尤其涉及一种视频编、解码方法、装置、***及存储介质。The embodiments of the present application relate to the technical field of image processing, and in particular, to a video encoding and decoding method, apparatus, system, and storage medium.
背景技术Background technique
目前,在视频编解码领域,存在多种视频编解码标准,例如:HEVC(high efficiency video coding)、VVC(versatile video coding),等等。At present, in the field of video coding and decoding, there are various video coding and decoding standards, such as HEVC (high efficiency video coding), VVC (versatile video coding), and so on.
其中,VVC(versatile video coding)是新的一版视频编解码标准,于2020年正式定稿。VVC的目标是相比于HEVC(high efficiency video coding)提升一倍的压缩比,同时保证画面质量。Among them, VVC (versatile video coding) is a new version of the video codec standard, which will be officially finalized in 2020. The goal of VVC is to double the compression ratio compared to HEVC (high efficiency video coding), while ensuring picture quality.
目前已有的视频编解码框架中还存在可以改善的地方。There is still room for improvement in the existing video codec framework.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种视频编、解码方法、装置、***及存储介质,能够结合实际情况进行自适应调整,有助于提升映射的灵活性,提升编解码效率。The present application provides a video encoding and decoding method, device, system, and storage medium, which can be adaptively adjusted according to the actual situation, which helps to improve the flexibility of mapping and improve the efficiency of encoding and decoding.
本申请的第一方面提供了一种视频编码方法,包括:A first aspect of the present application provides a video encoding method, comprising:
对待编码图像进行编码,获得码流;其中,所述码流中包括第一指示信息,所述第一指示信息用于指示所述待编码图像对应的像素区间段数,所述像素区间段数是基于所述待编码图像的比特深度确定的;Encoding the to-be-coded image to obtain a code stream; wherein the code stream includes first indication information, where the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-coded image, and the pixel interval segment number is based on The bit depth of the to-be-coded image is determined;
发送所述码流。Send the code stream.
本申请的第二方面提供了一种视频解码方法,包括:A second aspect of the present application provides a video decoding method, comprising:
获取码流;其中,所述码流中包括第一指示信息,所述第一指示信息用于指示待解码图像对应的像素区间段数,所述像素区间段数是基于所述待解码图像的比特深度确定的;Acquire a code stream; wherein, the code stream includes first indication information, and the first indication information is used to indicate the number of pixel interval segments corresponding to the image to be decoded, and the number of pixel interval segments is based on the bit depth of the to-be-decoded image definite;
根据所述像素区间段数对所述码流进行解码,获得解码后的图像。The code stream is decoded according to the number of segments in the pixel interval to obtain a decoded image.
本申请的第三方面提供了一种视频编码方法,包括:A third aspect of the present application provides a video encoding method, comprising:
根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数;According to the bit depth of the to-be-coded image, determine the number of pixel interval segments corresponding to the to-be-coded image;
根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间;According to the number of pixel interval segments, determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-coded image;
基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进行编码,生成码流;encoding the pixel values of the to-be-encoded image based on the multiple original pixel intervals and the multiple mapped pixel intervals to generate a code stream;
发送所述码流。Send the code stream.
本申请的第四方面提供了一种视频解码方法,包括:A fourth aspect of the present application provides a video decoding method, comprising:
获取码流;Get the code stream;
根据待解码图像的比特深度,确定所述待解码图像对应的像素区间段数;Determine the number of pixel interval segments corresponding to the to-be-decoded image according to the bit depth of the to-be-decoded image;
根据所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像素区间;According to the number of pixel interval segments, determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image;
基于所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像。The code stream is decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
本申请的第五方面提供了一种视频编码装置,包括:存储器与处理器;A fifth aspect of the present application provides a video encoding apparatus, including: a memory and a processor;
所述存储器,用于存储程序;the memory for storing programs;
所述处理器,与所述存储器耦合,用于执行所述存储器中存储的所述程序,以用于:The processor, coupled to the memory, executes the program stored in the memory for:
对待编码图像进行编码,获得码流;其中,所述码流中包括第一指示信息,所述第一指示信息用于指示所述待编码图像对应的像素区间段数,所述像素区间段数是基于所述待编码图像的比特深度确定的;Encoding the to-be-coded image to obtain a code stream; wherein the code stream includes first indication information, where the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-coded image, and the pixel interval segment number is based on The bit depth of the to-be-coded image is determined;
控制发射器发送所述码流。The transmitter is controlled to send the code stream.
本申请的第六方面提供了一种视频解码装置,包括:存储器和处理器;A sixth aspect of the present application provides a video decoding apparatus, including: a memory and a processor;
所述存储器,用于存储程序;the memory for storing programs;
所述处理器,与所述存储器耦合,用于执行所述存储器中存储的所述程序,以用于:The processor, coupled to the memory, executes the program stored in the memory for:
控制接收器获取码流;其中,所述码流中包括第一指示信息,所述第一指示信息用于指示待解码图像对应的像素区间段数,所述像素区间段数是基于所述待解码图像的比特深度确定的;Controlling the receiver to obtain a code stream; wherein, the code stream includes first indication information, and the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-decoded image, and the pixel interval segment number is based on the to-be-decoded image is determined by the bit depth;
根据所述像素区间段数对所述码流进行解码,获得解码后的图像。The code stream is decoded according to the number of segments in the pixel interval to obtain a decoded image.
本申请的第七方面提供了一种视频编码装置,包括:存储器与处理器;A seventh aspect of the present application provides a video encoding apparatus, including: a memory and a processor;
所述存储器,用于存储程序;the memory for storing programs;
所述处理器,与所述存储器耦合,用于执行所述存储器中存储的所述程序,以用于:The processor, coupled to the memory, executes the program stored in the memory for:
根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数;According to the bit depth of the to-be-coded image, determine the number of pixel interval segments corresponding to the to-be-coded image;
根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间;According to the number of pixel interval segments, determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-coded image;
基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进行编码,生成码流;encoding the pixel values of the to-be-encoded image based on the multiple original pixel intervals and the multiple mapped pixel intervals to generate a code stream;
控制发射器发送所述码流。The transmitter is controlled to send the code stream.
本申请的第八方面提供了一种视频解码装置,包括:存储器与处理器;An eighth aspect of the present application provides a video decoding apparatus, including: a memory and a processor;
所述存储器,用于存储程序;the memory for storing programs;
所述处理器,与所述存储器耦合,用于执行所述存储器中存储的所述程序,以用于:The processor, coupled to the memory, executes the program stored in the memory for:
控制接收器获取码流;Control the receiver to obtain the code stream;
根据待解码图像的比特深度,确定所述待解码图像对应的像素区间段数;Determine the number of pixel interval segments corresponding to the to-be-decoded image according to the bit depth of the to-be-decoded image;
根据所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像素区间;According to the number of pixel interval segments, determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image;
基于所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像。The code stream is decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
本申请的第九方面提供了一种电子设备,包括上述第五方面所述的视频编码装置以及发射器。A ninth aspect of the present application provides an electronic device, including the video encoding apparatus and the transmitter described in the fifth aspect.
本申请的第十方面提供了一种电子设备,包括上述第六方面所述的视频解码装置以及接收器。A tenth aspect of the present application provides an electronic device, including the video decoding apparatus and receiver described in the sixth aspect.
本申请的第十一方面提供了一种电子设备,包括上述第七方面所述的视频编码装置以及发射器。An eleventh aspect of the present application provides an electronic device, including the video encoding apparatus and the transmitter described in the seventh aspect.
本申请的第十二方面提供了一种电子设备,包括上述第八方面所述的视频解码装置以及接收器。A twelfth aspect of the present application provides an electronic device, including the video decoding apparatus and receiver described in the eighth aspect.
本申请的第十三方面提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得所述计算机实现上述任一项所述的视频编码方法。A thirteenth aspect of the present application provides a computer-readable storage medium, comprising instructions that, when executed on a computer, cause the computer to implement the video encoding method described in any one of the above.
本申请的第十四方面提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得所述计算机实现上述任一项所述的视频解码方法。A fourteenth aspect of the present application provides a computer-readable storage medium, comprising instructions that, when executed on a computer, cause the computer to implement the video decoding method described in any one of the above.
本申请的第十五方面提供了一种视频编解码***,包括:编码端设备和解码端设备;A fifteenth aspect of the present application provides a video encoding and decoding system, including: an encoding end device and a decoding end device;
所述编码端设备,包括上述第九方面所述的电子设备;The encoding terminal device includes the electronic device described in the ninth aspect;
所述解码端设备,包括上述第十方面所述的电子设备。The decoding end device includes the electronic device described in the tenth aspect above.
本申请的第十六方面提供了一种视频编解码***,包括:编码端设备和解码端设备;A sixteenth aspect of the present application provides a video encoding and decoding system, including: an encoding end device and a decoding end device;
所述编码端设备,包括上述第十一方面所述的电子设备;The encoding terminal device includes the electronic device described in the eleventh aspect;
所述解码端设备,包括上述第十二方面所述的电子设备。The decoding end device includes the electronic device described in the twelfth aspect.
本申请实施例提供的技术方案中,在对待编码图像进行编码时,会基于待编码图像的比特深度来确定在进行像素映射时所需划分的像素区间段数。与现有的VCC标准中将映射前和映射的像素区间段数进行固定或默认设置的方案相比,本申请实施例提供的技术方案能够结合实际情况进行自适应调整,有助于提升映射的灵活性。In the technical solutions provided by the embodiments of the present application, when the to-be-coded image is encoded, the number of pixel interval segments that need to be divided during pixel mapping is determined based on the bit depth of the to-be-coded image. Compared with the solution in the existing VCC standard in which the number of pixel intervals before and after the mapping is fixed or set by default, the technical solutions provided in the embodiments of the present application can be adaptively adjusted in combination with the actual situation, which helps to improve the flexibility of the mapping. sex.
附图说明Description of drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the attached image:
图1为本申请实施例提供的技术方案的架构图;FIG. 1 is an architectural diagram of a technical solution provided by an embodiment of the present application;
图2为本申请实施例提供的视频编码框架2示意图;2 is a schematic diagram of a video coding framework 2 provided by an embodiment of the present application;
图3为本申请实施例提供的基于LMCS的解码框架图;FIG. 3 is a LMCS-based decoding framework diagram provided by an embodiment of the present application;
图4为本申请实施例提供的一种视频编码方法的一个实施例的流程示意图;FIG. 4 is a schematic flowchart of an embodiment of a video encoding method provided by an embodiment of the present application;
图5为本申请实施例提供的一种视频解码方法的一个实施例的流程示意图;5 is a schematic flowchart of an embodiment of a video decoding method provided by an embodiment of the present application;
图6为本申请实施例提供的一种视频编码方法的又一个实施例的流程示意图;6 is a schematic flowchart of another embodiment of a video encoding method provided by an embodiment of the present application;
图7为本申请实施例提供的一种视频解码方法的又一个实施例的流程示意图;7 is a schematic flowchart of another embodiment of a video decoding method provided by an embodiment of the present application;
图8为本申请实施例提供的一种视频编码装置的一个实施例的框架图;FIG. 8 is a frame diagram of an embodiment of a video encoding apparatus provided by an embodiment of the present application;
图9为本申请实施例提供的一种视频解码装置的一个实施例的框架图。FIG. 9 is a frame diagram of an embodiment of a video decoding apparatus according to an embodiment of the present application.
具体实施方式Detailed ways
下面对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application are described below.
除非另有说明,本申请实施例所使用的所有技术和科学术语与本申请的技术领域的技术人员通常理解的含义相同。本申请中所使用的术语只是为了描述具体的实施例的目的,不是旨在限制本申请的范围。Unless otherwise specified, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by those skilled in the technical field of the present application. The terminology used in this application is for the purpose of describing specific embodiments only and is not intended to limit the scope of the application.
图1是应用本申请实施例的技术方案的架构图。FIG. 1 is an architectural diagram of applying the technical solution of the embodiment of the present application.
如图1所示,***100可以接收待处理数据102,对待处理数据102进行处理,产生处理后的数据108。例如,***100可以接收待编码数据,对待编码数据进行编码以产生编码后的数据,或者,***100可以接收待解码数据,对待解码数据进行解码以产生解码后的数据。在一些实施例中,***100中的部件可以由一个或多个处理器实现,该处理器可以是计算设备中的处理器,也可以是移动设备(例如无人机)中的处理器。该处理器可以为任意种类的处理器,本发明实施例对此不做限定。在一些可能的设计中,该处理器可以包括编码器、解码器或编解码器等。***100中还可以包括一个或多个存储器。该存储器可用于存储指令和数据,例如,实现本发明实施例的技术方案的计算机可执行指令、待处理数据102、处理后的数据108等。该存储器可以为任意种类的存储器,本发明实施例对此也不做限定。As shown in FIG. 1 , the system 100 may receive data 102 to be processed, process the data 102 to be processed, and generate processed data 108 . For example, system 100 may receive data to be encoded and encode the data to be encoded to generate encoded data, or system 100 may receive data to be decoded and decode the data to be decoded to generate decoded data. In some embodiments, components in system 100 may be implemented by one or more processors, which may be processors in computing devices or processors in mobile devices (eg, drones). The processor may be any type of processor, which is not limited in this embodiment of the present invention. In some possible designs, the processor may include an encoder, a decoder, or a codec, among others. One or more memories may also be included in system 100 . The memory may be used to store instructions and data, for example, computer-executable instructions, data to be processed 102 , processed data 108 , etc. that implement the technical solutions of the embodiments of the present invention. The memory may be any type of memory, which is also not limited in this embodiment of the present invention.
待编码数据可以包括文本、图像、图形对象、动画序列、音频、视频、或者任何需要编码的其他数据。在一些情况下,待编码数据可以包括来自传感器的传感数据,该传感器可以为视觉传感器(例如,相机、红外传感器),麦克风、近场传感器(例如,超声波传感器、雷达)、位置传感器、温度传感器、触摸传感器等。在一些情况下,待编码数据可以包括来自用户的信息,例如,生物信息,该生物信息可以包括面部特征、指纹扫描、视网膜扫描、嗓音记录、DNA采样等。The data to be encoded may include text, images, graphic objects, animation sequences, audio, video, or any other data that needs to be encoded. In some cases, the data to be encoded may include sensory data from sensors, which may be visual sensors (eg, cameras, infrared sensors), microphones, near-field sensors (eg, ultrasonic sensors, radar), position sensors, temperature sensor, touch sensor, etc. In some cases, the data to be encoded may include information from the user, eg, biometric information, which may include facial features, fingerprint scans, retinal scans, voice recordings, DNA sampling, and the like.
图2展示了VVC视频编码框架,与HEVC编码标准类似,VVC采用基于块的混合编码框架,对输入的视频帧图像进行块划分、预测、变换、量化、熵编码、环路滤波等一系列处理,得到最终的码流用于存储或网络传输。如图2所示,在接收待编码视频后,从待编码视频的第一帧开始,依次对待编码视频中的每一帧进行编码。其中,当前编码帧主要经过:预测(Prediction)、变换(Transform)、量化(Quantization)和熵编码(Entropy Coding)等处理,最终输出当前编码帧的码流。对应的,解码过程通常是按照上述过程的逆过程对接收到的码流进行解码,以恢复出解码前的视频帧信息。Figure 2 shows the VVC video coding framework. Similar to the HEVC coding standard, VVC uses a block-based hybrid coding framework to perform a series of processing such as block division, prediction, transformation, quantization, entropy coding, and loop filtering on the input video frame image. , to get the final stream for storage or network transmission. As shown in FIG. 2 , after receiving the video to be encoded, starting from the first frame of the video to be encoded, each frame of the video to be encoded is encoded in sequence. Among them, the current coded frame mainly undergoes: prediction (Prediction), transformation (Transform), quantization (Quantization) and entropy coding (Entropy Coding), etc., and finally outputs the code stream of the current coded frame. Correspondingly, the decoding process usually decodes the received code stream according to the inverse process of the above process, so as to recover the video frame information before decoding.
具体地,如图2所示,所述视频编码框架2中包括一个编码控制模块201,用于进行编码过程中的决策控制动作,以及参数的选择。例如,如图2所示,编码控制模块201控制变换、量化、反量化、反变换的中用到的参数,控制进行帧内或者帧间模式的选择,以及运动估计和滤波的参数控制,且编码控制模块201的控制参数也将输入至熵编码模块中,进行编码形成编码码流中的一部分。Specifically, as shown in FIG. 2 , the video coding framework 2 includes a coding control module 201 for performing decision control actions and parameter selection in the coding process. For example, as shown in FIG. 2, the encoding control module 201 controls parameters used in transform, quantization, inverse quantization, and inverse transform, controls selection of intra-frame or inter-frame mode, and parameter control of motion estimation and filtering, and The control parameters of the encoding control module 201 will also be input into the entropy encoding module to be encoded to form a part of the encoded code stream.
对当前编码帧开始编码时,对编码帧进行划分202处理,具体地,首先对其进行条带(slice)划分,再进行块划分。可选地,在一个示例中,编码帧划分为多个互不重叠的最大的编码树单元(Coding Tree Unit,CTU),各CTU还可以分别按四叉树、或二叉树、或三叉树的方式迭代划分为一系列更小的编码单元(Coding Unit,CU),一些示例中,CU还可以包含与之相关联的预测单元(Prediction Unit,PU)和变换单元(Transform Unit,TU),其中PU为预测的基本单元,TU为变换和量化的基本单元。一些示例中,PU和TU分别是在CU的基础上划分成一个或多个块得到的,其中一个PU包含多个预测块(Prediction Block,PB)以及相关语法元素。一些示例中,PU和TU可以是相同的,或者,是由CU通过不同的划分方法得到的。一些示例中,CU、PU和TU中的至少两种是相同的,例如,不区分CU、PU和TU,全部是以CU为单位进行预测、量化和变换。为方便描述,下文中将CTU、CU或者其它形成的数据单元均称为编码块。When the coding of the current coded frame is started, the coded frame is divided 202, and specifically, the coded frame is divided into slices first, and then divided into blocks. Optionally, in an example, the coding frame is divided into a plurality of non-overlapping largest coding tree units (Coding Tree Units, CTUs), and each CTU can also be in the form of a quad tree, or a binary tree, or a ternary tree, respectively. Iteratively divided into a series of smaller coding units (Coding Unit, CU), in some examples, a CU may also include a prediction unit (Prediction Unit, PU) and a transform unit (Transform Unit, TU) associated with it, where PU is the basic unit of prediction, and TU is the basic unit of transform and quantization. In some examples, PUs and TUs are obtained by dividing into one or more blocks on the basis of CUs, wherein one PU includes multiple prediction blocks (Prediction Blocks, PBs) and related syntax elements. In some examples, the PU and the TU may be the same, or may be obtained by the CU through different partitioning methods. In some examples, at least two of the CUs, PUs, and TUs are the same, eg, CUs, PUs, and TUs are not distinguished, and all are predicted, quantized, and transformed in units of CUs. For the convenience of description, hereinafter, the CTU, CU or other formed data units are referred to as coding blocks.
应理解,在本申请实施例中,视频编码针对的数据单元可以为帧,条带,编码树单元, 编码单元,编码块或以上任一种的组。在不同的实施例中,数据单元的大小可以变化。It should be understood that, in this embodiment of the present application, a data unit targeted for video coding may be a frame, a slice, a coding tree unit, a coding unit, a coding block, or a group of any of the above. In different embodiments, the size of the data unit may vary.
具体地,如图2所示,编码帧划分为多个编码块后,进行预测过程,用于去除当前编码帧的空域和时域冗余信息。当前比较常用的预测编码方法包括帧内预测和帧间预测两种方法。帧内预测仅利用本帧图像中己重建的信息对当前编码块进行预测,而帧间预测会利用到之前已经重建过的其它帧图像(也被称作参考帧)中的信息对当前编码块进行预测。具体地,在本申请实施例中,编码控制模块201用于决策选择帧内预测或者帧间预测。Specifically, as shown in FIG. 2 , after the coded frame is divided into multiple coding blocks, a prediction process is performed to remove redundant information in the spatial and temporal domains of the current coded frame. Currently, the commonly used predictive coding methods include intra-frame prediction and inter-frame prediction. Intra-frame prediction only uses the reconstructed information in this frame to predict the current coding block, while inter-frame prediction uses the information in other frames (also called reference frames) that have been reconstructed before to predict the current coding block. Make predictions. Specifically, in this embodiment of the present application, the encoding control module 201 is configured to decide whether to select intra-frame prediction or inter-frame prediction.
当选择帧内预测模式时,帧内预测203的过程包括获取当前编码块周围已编码相邻块的重建块作为参考块,基于该参考块的像素值,采用预测模式方法计算预测值生成预测块,将当前编码块与预测块的相应像素值相减得到当前编码块的残差,当前编码块的残差经过变换204、量化205以及熵编码210后形成当前编码块的码流。进一步的,当前编码帧的全部编码块经过上述编码过程后,形成编码帧的编码码流中的一部分。此外,帧内预测203中产生的控制和参考数据也经过熵编码210编码,形成编码码流中的一部分。When the intra-frame prediction mode is selected, the process of intra-frame prediction 203 includes obtaining the reconstructed block of the coded adjacent blocks around the current coding block as a reference block, and using the prediction mode method to calculate the prediction value based on the pixel value of the reference block to generate the prediction block. , the corresponding pixel values of the current coding block and the prediction block are subtracted to obtain the residual of the current coding block. The residual of the current coding block is transformed 204 , quantized 205 and entropy encoded 210 to form the code stream of the current coding block. Further, after all the coded blocks of the current coded frame are subjected to the above coding process, a part of the coded code stream of the coded frame is formed. In addition, the control and reference data generated in the intra prediction 203 are also encoded by entropy encoding 210 to form part of the encoded code stream.
具体地,变换204用于去除图像块的残差的相关性,以便提高编码效率。对于当前编码块残差数据的变换通常采用二维离散余弦变换(Discrete Cosine Transform,DCT)变换和二维离散正弦变换(Discrete Sine Transform,DST)变换,例如在编码端将编码块的残差信息分别与一个N×M的变换矩阵及其转置矩阵相乘,相乘之后得到当前编码块的变换系数。Specifically, the transform 204 is used to de-correlate the residuals of image blocks in order to improve coding efficiency. For the transformation of the residual data of the current coding block, two-dimensional discrete cosine transform (Discrete Cosine Transform, DCT) transform and two-dimensional discrete sine transform (Discrete Sine Transform, DST) transform are usually used. Multiply with an N×M transformation matrix and its transposed matrix respectively, and obtain the transformation coefficient of the current coding block after multiplication.
在产生变换系数之后用量化205进一步提高压缩效率,变换系数经量化可以得到量化后的系数,然后将量化后的系数进行熵编码210得到当前编码块的残差码流,其中,熵编码方法包括但不限于内容自适应二进制算术编码(Context Adaptive Binary Arithmetic Coding,CABAC)熵编码。最后将熵编码得到的比特流及进行编码后的编码模式信息进行存储或发送到解码端。在编码端,还会对量化的结果进行反量化206,对反量化结果进行反变换207。在反变换207之后,利用反变换结果以及运动补偿结果,得到重建像素。之后,对重建像素进行滤波(即环路滤波)211。在211之后,输出滤波后的重建图像(属于重建视频帧)。后续,重建图像可以作为其他帧图像的参考帧图像进行帧间预测。本申请实施例中,重建图像又可称为重建后的图像或重构图像。After the transform coefficients are generated, quantization 205 is used to further improve the compression efficiency. The transform coefficients can be quantized to obtain quantized coefficients, and then the quantized coefficients are entropy encoded 210 to obtain the residual code stream of the current encoding block. The entropy encoding method includes: But not limited to content adaptive binary arithmetic coding (Context Adaptive Binary Arithmetic Coding, CABAC) entropy coding. Finally, the bit stream obtained by entropy encoding and the encoded encoding mode information are stored or sent to the decoding end. At the encoding end, inverse quantization 206 is also performed on the quantized result, and inverse transformation 207 is performed on the inverse quantization result. After the inverse transformation 207, the reconstructed pixels are obtained using the inverse transformation result and the motion compensation result. Afterwards, the reconstructed pixels are filtered (ie loop filtered) 211. After 211, the filtered reconstructed image (belonging to the reconstructed video frame) is output. Subsequently, the reconstructed image can be used as a reference frame image of other frame images for inter-frame prediction. In this embodiment of the present application, the reconstructed image may also be referred to as a reconstructed image or a reconstructed image.
具体地,帧内预测203过程中的已编码相邻块为:当前编码块编码之前,已进行编码的相邻块,该相邻块的编码过程中产生的残差经过变换204、量化205、反量化206和反变换207后,与该相邻块的预测块相加得到的重建块。对应的,反量化206和反变换207为量化206和变换204的逆过程,用于恢复量化和变换前的残差数据。Specifically, the coded adjacent blocks in the process of intra-frame prediction 203 are: adjacent blocks that have been coded before the current coded block is coded, and the residuals generated in the coding process of the adjacent blocks are transformed 204, quantized 205, After inverse quantization 206 and inverse transform 207, the reconstructed block is obtained by adding the prediction block of the adjacent block. Correspondingly, inverse quantization 206 and inverse transform 207 are inverse processes of quantization 206 and transform 204, and are used to restore residual data before quantization and transform.
如图2所示,当选择帧间预测模式时,帧间预测过程包括运动估计(Motion Estimation,ME)208和运动补偿(Motion Compensation,MC)209。具体地,根据重建视频帧中的参考帧图像进行运动估计208,在一张或多张参考帧图像中根据一定的匹配准则搜索到与当前编码块最相似的图像块为匹配块,该匹配块与当前编码块的相对位移即为当前编码块的运动矢量(Motion Vector,MV)。然后基于该运动矢量和参考帧对当前编码块进行运动补偿209,获得当前编码块的预测块。并将该编码块像素的原始值与对应的预测块像素值相减得到编码块的残差。当前编码块的残差经过变换204、量化205以及熵编码210后形成编码帧的编码码流中的一部分。此外,运动补偿209中产生的控制和参考数据也经过熵编码210编码,形成编码码流中的一部分。As shown in FIG. 2 , when the inter prediction mode is selected, the inter prediction process includes motion estimation (Motion Estimation, ME) 208 and motion compensation (Motion Compensation, MC) 209 . Specifically, the motion estimation 208 is performed according to the reference frame image in the reconstructed video frame, and the image block most similar to the current coding block is searched in one or more reference frame images according to a certain matching criterion to be the matching block. The relative displacement with the current coding block is the motion vector (Motion Vector, MV) of the current coding block. Then, based on the motion vector and the reference frame, motion compensation 209 is performed on the current coding block to obtain a prediction block of the current coding block. The original value of the pixel of the coding block is subtracted from the pixel value of the corresponding prediction block to obtain the residual of the coding block. The residual of the current coded block is transformed 204, quantized 205 and entropy coded 210 to form a part of the coded code stream of the coded frame. In addition, the control and reference data generated in motion compensation 209 are also encoded by entropy coding 210 to form part of the encoded code stream.
其中,如图2所示,重建视频帧为经过滤波211之后得到视频帧。重建视频帧包括一 个或多个重建后的图像。滤波211用于减少编码过程中产生的块效应和振铃效应等压缩失真,重建视频帧在编码过程中用于为帧间预测提供参考帧,在解码过程中,重建视频帧经过后处理后输出为最终的解码视频。Wherein, as shown in FIG. 2 , the reconstructed video frame is a video frame obtained after filtering 211 . A reconstructed video frame includes one or more reconstructed images. Filtering 211 is used to reduce compression distortions such as blocking and ringing effects during the encoding process. The reconstructed video frame is used to provide reference frames for inter-frame prediction during the encoding process. During the decoding process, the reconstructed video frame is post-processed and output. for the final decoded video.
具体地,帧间预测模式可以包括高级运动矢量预测(Advanced Motion Vector Prediction,AMVP)模式、合并(Merge)模式或跳过(skip)模式。Specifically, the inter prediction mode may include an advanced motion vector prediction (Advanced Motion Vector Prediction, AMVP) mode, a merge (Merge) mode, or a skip (skip) mode.
对于AMVP模式而言,可以先确定运动矢量预测(Motion Vector Prediction,MVP),在得到MVP之后,可以根据MVP确定运动估计的起始点,在起始点附近,进行运动搜索,搜索完毕之后得到最优的MV,由MV确定参考块在参考图像中的位置,参考块减去当前块得到残差块,MV减去MVP得到运动矢量差值(Motion Vector Difference,MVD),并将该MVD和MVP的索引通过码流传输给解码端。For the AMVP mode, the motion vector prediction (MVP) can be determined first. After the MVP is obtained, the starting point of the motion estimation can be determined according to the MVP, and a motion search can be performed near the starting point. After the search is completed, the optimal MV, the position of the reference block in the reference image is determined by the MV, the reference block is subtracted from the current block to obtain the residual block, the MV is subtracted from the MVP to obtain the Motion Vector Difference (MVD), and the difference between the MVD and the MVP is obtained. The index is transmitted to the decoder through the code stream.
对于Merge模式而言,可以先确定MVP,并直接将MVP确定为当前块的MV。其中,为了得到MVP,可以先构建一个MVP候选列表(merge candidate list),在MVP候选列表中,可以包括至少一个候选MVP,每个候选MVP可以对应有一个索引,编码端在从MVP候选列表中选择MVP之后,可以将该MVP索引写入到码流中,则解码端可以按照该索引从MVP候选列表中找到该索引对应的MVP,以实现对图像块的解码。For the Merge mode, the MVP can be determined first, and the MVP can be directly determined as the MV of the current block. Among them, in order to obtain the MVP, a MVP candidate list (merge candidate list) can be constructed first. In the MVP candidate list, at least one candidate MVP can be included, and each candidate MVP can have an index corresponding to the MVP candidate list. After the MVP is selected, the MVP index can be written into the code stream, and the decoder can find the MVP corresponding to the index from the MVP candidate list according to the index, so as to decode the image block.
应理解,以上过程只是Merge模式的一种具体实现方式。Merge模式还可以具有其他的实现方式。It should be understood that the above process is only a specific implementation manner of the Merge mode. The Merge pattern can also have other implementations.
例如,Skip模式是Merge模式的一种特例。按照Merge模式得到MV之后,如果编码端确定当前块和参考块基本一样,那么不需要传输残差数据,只需要传递MVP的索引,以及进一步地可以传递一个标志,该标志可以表明当前块可以直接从参考块得到。For example, Skip mode is a special case of Merge mode. After the MV is obtained according to the Merge mode, if the encoder determines that the current block is basically the same as the reference block, it does not need to transmit the residual data, only the index of the MVP needs to be passed, and further a flag can be passed, which can indicate that the current block can be directly Obtained from the reference block.
也就是说,Merge模式特点为:MV=MVP(MVD=0);而Skip模式还多一个特点,即:重构值rec=预测值pred(残差值resi=0)。That is to say, the Merge mode is characterized by: MV=MVP (MVD=0); and the Skip mode has one more feature, namely: the reconstruction value rec=prediction value pred (residual value resi=0).
Merge模式可以应用于几何预测技术中。在几何预测技术中,可以将待编码的图像块划分为多个形状为多边形的子图像块,可以从运动信息候选列表中,分别为每个子图像块确定运动矢量,并基于每个子图像块的运动矢量,确定每个子图像块对应的预测子块,基于每个子图像块对应的预测子块,构造当前图像块的预测块,从而实现对当前图像块的编码。Merge mode can be applied to geometric prediction techniques. In the geometric prediction technology, the image block to be encoded can be divided into a plurality of sub-image blocks in the shape of a polygon, and a motion vector can be determined for each sub-image block from the motion information candidate list, and based on the The motion vector determines the prediction sub-block corresponding to each sub-image block, and constructs the prediction block of the current image block based on the prediction sub-block corresponding to each sub-image block, so as to realize the encoding of the current image block.
对于解码端,则进行与编码端相对应的操作。首先利用熵解码以及反量化和反变换得到残差信息,并根据解码码流确定当前图像块使用帧内预测还是帧间预测。如果是帧内预测,则利用当前帧中已重建图像块按照帧内预测方法构建预测信息;如果是帧间预测,则需要解析出运动信息,并使用所解析出的运动信息在已重建的图像中确定参考块,得到预测信息;接下来,再将预测信息与残差信息进行叠加,并经过滤波操作便可以得到重建信息。For the decoding end, perform operations corresponding to the encoding end. Firstly, the residual information is obtained by entropy decoding, inverse quantization and inverse transformation, and according to the decoded code stream, it is determined whether the current image block uses intra-frame prediction or inter-frame prediction. If it is intra-frame prediction, use the reconstructed image blocks in the current frame to construct prediction information according to the intra-frame prediction method; if it is inter-frame prediction, you need to parse out the motion information, and use the parsed motion information in the reconstructed image. Then, the prediction information and the residual information are superimposed, and the reconstruction information can be obtained through the filtering operation.
VVC中添加了新的技术—LMCS(luma mapping with chroma scaling)技术。LMCS主要包括两个部分:亮度映射(luma mapping)、依赖亮度的色度缩放(chroma scaling)。其中,LM的基本思想是在给定位深下充分利用亮度值的取值范围,这是因为一般的视频信号不会取完取值空间的所有值。该技术将输入图像的亮度像素值通过分段线性函数映射到映射域(也即映射像素域)中,接着进行相关的编码流程处理。然而该技术目前对于可支持的比特深度,例如8bit,10bit,12bit,16bit等位宽,在映射函数的计算过程中,都是分为16段进行映射的。例如10bit时,将映射的区间先均分为16段,每段长64,接着会根据 一些统计数据对每段长度进行伸缩,例如第一段处理后长度为68,此时即将原始的像素值0-63,根据线性函数映射到0-67。从中可以看出,无论输入比特位宽为多少,目前的技术均默只分为16段,这对于高比特位宽来说,会使得每段的区间长度较长,降低了映射的效率和灵活性。A new technology has been added to VVC - LMCS (luma mapping with chroma scaling) technology. LMCS mainly includes two parts: luma mapping (luma mapping) and luminance-dependent chroma scaling (chroma scaling). Among them, the basic idea of LM is to make full use of the value range of luminance values under a given bit depth, because a general video signal will not take all the values in the value space. This technology maps the luminance pixel value of the input image to the mapping domain (ie, the mapping pixel domain) through a piecewise linear function, and then performs related encoding process processing. However, for the current supported bit depth, such as 8bit, 10bit, 12bit, 16bit and other bit widths, in the calculation process of the mapping function, the technology is divided into 16 segments for mapping. For example, when 10bit is used, the mapped interval is firstly divided into 16 segments, each segment is 64 long, and then the length of each segment is scaled according to some statistical data. For example, the length of the first segment is 68 after processing, and the original pixel value will be 0-63, mapped to 0-67 according to a linear function. It can be seen from this that no matter how much the input bit width is, the current technology is only divided into 16 segments by default. For high bit width, the interval length of each segment will be longer, which reduces the efficiency and flexibility of the mapping. sex.
图3示出了亮度分量的解码过程,包括:码流通过反量化与反变换301,生成映射域的亮度残差值Yres。通过重建302,也即将残差值Yres和对应的映射域预测值Y'pred相加得到映射域的重建值Yr。从图2中可以看出,LMCS对于亮度映射来说,在帧内和帧间部分的应用不完全相同。对于帧内预测303,Y'pred通过映射域内的亮度值即可得到。对于帧间预测,需要根据原始信号域(也即原始像素域)的映射像素值构建运动补偿304,根据运动补偿304得到原始信号域的预测值Ypred,将原始信号域的预测值Ypred通过映射305得到映射域的Y'pred。将重建值Y'res进行逆映射306,然后进行环路滤波307,结果送入DPB(decoded picture buffer,解码图片缓存区)308,从而得到解码后视频。其中,DPB中的像素值都是在原始信号域。FIG. 3 shows the decoding process of the luminance component, including: generating the luminance residual value Yres in the mapping domain through inverse quantization and inverse transformation 301 in the code stream. Through reconstruction 302, that is, adding the residual value Yres and the corresponding predicted value Y'pred of the mapping domain to obtain the reconstructed value Yr of the mapping domain. As can be seen from Figure 2, the application of LMCS for the luma mapping is not exactly the same in the intra- and inter-frame parts. For intra prediction 303, Y'pred can be obtained by mapping the luminance value in the domain. For inter-frame prediction, it is necessary to construct motion compensation 304 according to the mapped pixel values of the original signal domain (ie, the original pixel domain), obtain the predicted value Ypred of the original signal domain according to the motion compensation 304, and pass the predicted value Ypred of the original signal domain through the mapping 305 Get the Y'pred of the mapped domain. Perform inverse mapping 306 on the reconstructed value Y'res, then perform loop filtering 307, and send the result to DPB (decoded picture buffer, decoded picture buffer) 308, thereby obtaining a decoded video. Among them, the pixel values in the DPB are in the original signal domain.
VVC的LMCS技术中,映射的区间固定设置为16段。然而不同比特位宽对应的像素范围是不同的,例如8bit、10bit、12bit以及16bit各自对应的像素范围依次为0-255、0-1023、0-4095以及0-65535。当比特位宽较高时,对应的区间长度就会显得较长,也即映射方式不够细化,使得一些像素的映***度不够,映射效率低;当比特位宽较低时,对应的区间长度就会显得较短,也即映射方式过于细化,造成了编码资源和传输资源的浪费。In the LMCS technology of VVC, the mapped interval is fixedly set to 16 segments. However, the pixel ranges corresponding to different bit widths are different. For example, the corresponding pixel ranges of 8bit, 10bit, 12bit and 16bit are 0-255, 0-1023, 0-4095 and 0-65535 respectively. When the bit width is high, the corresponding interval length will appear longer, that is, the mapping method is not refined enough, so that the mapping accuracy of some pixels is not enough, and the mapping efficiency is low; when the bit width is low, the corresponding interval length will be It will appear shorter, that is, the mapping method is too detailed, resulting in a waste of coding resources and transmission resources.
需要说明的是,VVC仅作为本申请的一种示例,在其他编解码标准及其演进标准中,若涉及到原始像素与映射像素之间的映射过程的,同样适用本申请。It should be noted that VVC is only an example of this application. In other coding and decoding standards and their evolution standards, if the mapping process between original pixels and mapped pixels is involved, this application is also applicable.
本申请实施例提出一种视频编码的方法,该方法能够结合实际情况进行自适应调整,有助于提升映射的灵活性。The embodiment of the present application proposes a video coding method, which can perform adaptive adjustment in combination with actual conditions, which helps to improve the flexibility of mapping.
下面将结合图4详细描述本申请实施例提供的视频编码方法。如图4所示,该方法,包括:The video encoding method provided by the embodiment of the present application will be described in detail below with reference to FIG. 4 . As shown in Figure 4, the method includes:
401、根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数。401. Determine the number of pixel interval segments corresponding to the to-be-coded image according to the bit depth of the to-be-coded image.
402、根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间。402. Determine, according to the number of segments of the pixel interval, multiple original pixel intervals and multiple mapped pixel intervals corresponding to the image to be encoded.
403、基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进行编码,生成码流。403. Encode the pixel values of the to-be-encoded image based on the multiple original pixel intervals and the multiple mapped pixel intervals to generate a code stream.
404、发送所述码流。404. Send the code stream.
上述401中,上述比特深度是指待编码图像中像素点的像素值所需占用的比特位数。In the above-mentioned 401, the above-mentioned bit depth refers to the number of bits occupied by the pixel value of the pixel point in the to-be-encoded image.
举例来说:上述待编码图像为YUV格式,其比特深度为10bit。其中,Y为亮度分量、U和V均为色度分量,该待编码图像中像素点的Y、U、V各分量的像素值所需占用的比特位数均为10bit。For example, the above image to be encoded is in YUV format, and its bit depth is 10 bits. Wherein, Y is a luminance component, U and V are both chrominance components, and the number of bits occupied by the pixel values of the Y, U, and V components of the pixel point in the image to be encoded are all 10 bits.
在一种可实现的方案中,可事先通过实验为不同比特深度的图像确定出合适的像素区间段数,并建立不同比特深度与相应的像素区间段数之间的对应关系并存储,以备后续适用。In an achievable solution, the appropriate number of pixel interval segments can be determined for images with different bit depths through experiments in advance, and the correspondence between different bit depths and the corresponding number of pixel interval segments can be established and stored for subsequent application. .
在另一种可实现的方案中,上述401中“根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数”,可采用如下步骤来实现:In another achievable solution, in the above 401, "determine the number of pixel interval segments corresponding to the to-be-encoded image according to the bit depth of the to-be-encoded image", the following steps can be used to implement:
4011、获取预设像素区间段数。4011. Acquire the number of preset pixel interval segments.
4012、根据待编码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数。4012. Adjust the preset number of segments in the pixel interval according to the bit depth of the image to be encoded, to obtain the number of segments in the pixel interval.
上述4011中,预设像素区间段数可根据实际需要来设定,本申请实施例对此不作具体限定。In the above 4011, the preset number of pixel interval segments may be set according to actual needs, which is not specifically limited in this embodiment of the present application.
在一实例中,上述4012中,可根据待编码图像的比特深度,确定段数调整幅度和段数调整方向;根据段数调整幅度和段数调整方向,对预设像素区间段数进行调整,得到上述像素区间段数。在一实例中,可事先通过实验为不同比特深度的图像确定出合适的段数调整幅度和段数调整方向,并建立不同比特深度与相应的段数调整幅度和段数调整方向之间的对应关系并存储,以备后续适用。In an example, in the above-mentioned 4012, the adjustment range of the segment number and the adjustment direction of the segment number can be determined according to the bit depth of the image to be encoded; according to the adjustment range of the segment number and the adjustment direction of the segment number, the preset pixel interval segment number is adjusted to obtain the above-mentioned pixel interval segment number. . In one example, it is possible to determine a suitable segment number adjustment range and segment number adjustment direction for images of different bit depths through experiments in advance, and establish the corresponding relationship between different bit depths and the corresponding segment number adjustment range and segment number adjustment direction and store, for subsequent application.
在另一实例中,上述4012中“根据待编码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数”,具体可包括如下步骤S11和/或S12:In another example, in the above-mentioned 4012, "adjust the number of the preset pixel interval segments according to the bit depth of the image to be encoded to obtain the pixel interval segment number", which may specifically include the following steps S11 and/or S12:
S11、当待编码图像的比特深度大于比特深度阈值时,对所述预设像素区间段数进行增大处理,得到所述像素区间段数。S11. When the bit depth of the image to be encoded is greater than the bit depth threshold, increase the number of segments in the preset pixel interval to obtain the number of segments in the pixel interval.
S12、当所述待编码图像的比特深度小于比特深度阈值时,对所述预设像素区间段数进行减小处理,得到所述像素区间段数。S12. When the bit depth of the to-be-encoded image is less than a bit depth threshold, reduce the number of segments in the preset pixel interval to obtain the number of segments in the pixel interval.
上述S11中,当待编码图像的比特深度大于比特深度阈值时,说明该待编码图像为高比特深度图像,需要增加像素区间段数。在本实施例中,像素区间段数的增加,使得映射的精度和灵活性得到了提升,同时映射效率也得到了提升。在一种可实现的方案中,可根据比特深度与比特深度阈值的差值绝对值,确定放大倍数;按照放大倍数对预设像素区间段数进行放大处理,例如:将放大倍数与预设像素区间段数的乘积作为上述像素区间段数。In the above S11, when the bit depth of the to-be-encoded image is greater than the bit-depth threshold, it indicates that the to-be-encoded image is a high bit depth image, and the number of pixel interval segments needs to be increased. In this embodiment, the increase in the number of segments in the pixel interval improves the precision and flexibility of the mapping, and also improves the mapping efficiency. In an achievable solution, the magnification can be determined according to the absolute value of the difference between the bit depth and the bit depth threshold; the preset number of pixel interval segments is amplified according to the magnification, for example, the magnification is compared with the preset pixel interval. The product of the number of segments is used as the number of segments in the above-mentioned pixel interval.
在一种可实现的方案中,不同的比特深度可以对应不同的放大倍数,即每一比特深度对应一放大倍数;或者,也可以是多个不同的比特深度对应同一放大倍数,而另外多个不同的比特深度则对应另外相同的放大倍数,即每一组比特深度对应一放大倍数。In an achievable solution, different bit depths may correspond to different magnifications, that is, each bit depth corresponds to one magnification; or, multiple different bit depths may correspond to the same magnification, and other multiple Different bit depths correspond to another same magnification factor, that is, each group of bit depths corresponds to a magnification factor.
在一种可实现的方案中,放大倍数可以按照预设步长进行递增,预设步长可以是2的倍数,或者其他数值的倍数。放大倍数可以是编解码两端按照相同计算过程计算的,也可以是在码流中指示的。In an achievable solution, the magnification may be increased according to a preset step size, and the preset step size may be a multiple of 2, or a multiple of other values. The magnification can be calculated by the same calculation process at both ends of the codec, or it can be indicated in the code stream.
在一具体实例中,可事先建立多个不同差值绝对值及其对应的放大倍数的对应关系,这样,后续根据比特深度与比特深度阈值的差值绝对值,即可查找出对应放大倍数。或者,可事先建立多个不同差值绝对值范围及其对应的放大倍数的对应关系,这样,后续根据比特深度与比特深度阈值的差值绝对值,确定其所在差值绝对值范围;将该差值绝对值范围对应的放大倍数作为上述放大倍数。其中,多个不同差值绝对值对应的放大倍数以及多个不同差值绝对值范围对应的放大倍数可根据实验来确定,本申请实施例对此不做具体限定。In a specific example, a plurality of correspondences between the absolute difference values and their corresponding magnifications can be established in advance, so that the corresponding magnification can be found subsequently according to the absolute value of the difference between the bit depth and the bit depth threshold. Alternatively, the correspondence relationship between a plurality of different absolute value ranges of differences and their corresponding magnifications may be established in advance, so that the subsequent absolute value ranges of the differences are determined according to the absolute values of the differences between the bit depth and the bit depth threshold; The magnification corresponding to the absolute value range of the difference is taken as the above magnification. The magnifications corresponding to the multiple different absolute values of the difference and the magnifications corresponding to the multiple different absolute value ranges may be determined according to experiments, which are not specifically limited in the embodiments of the present application.
在另一具体实例中,可将比特深度与比特深度阈值的差值绝对值输入到指数函数中,执行该指数函数得到放大倍数。示例性的,该指数函数可以为:In another specific example, the absolute value of the difference between the bit depth and the bit depth threshold can be input into an exponential function, and the exponential function is executed to obtain the magnification. Exemplarily, the exponential function can be:
y=2 x-a      (1) y= 2xa (1)
其中,x为自变量,y为因变量,a为常数。a的取值可根据实际需要来设定,本申请实施例对此不做具体限定,例如:a为0。where x is the independent variable, y is the dependent variable, and a is a constant. The value of a may be set according to actual needs, which is not specifically limited in this embodiment of the present application, for example, a is 0.
举例来说:a为0,比特深度为12bit,比特深度阈值为10bit,差值绝对值即为2bit,则放大倍数为2 2,即为4。可将所述预设像素区间段数进行左移2位即乘以4,得到上述 像素区间段数。 For example: a is 0, the bit depth is 12 bits, the bit depth threshold is 10 bits, the absolute value of the difference is 2 bits, and the magnification is 2 2 , which is 4. The preset number of pixel interval segments can be left-shifted by 2 bits, that is, multiplied by 4, to obtain the above-mentioned number of pixel interval segments.
举例来说:a为1,比特深度为12bit,比特深度阈值为10bit,差值绝对值即为2bit,则放大倍数为2 2,即为4。可将所述预设像素区间段数进行左移1位即乘以2,得到上述像素区间段数。在本实施例中,并未左移2位,而是左移1位,这样可减少一定的编码比特数。 For example: a is 1, the bit depth is 12 bits, the bit depth threshold is 10 bits, the absolute value of the difference is 2 bits, and the magnification is 2 2 , which is 4. The preset number of pixel interval segments can be left-shifted by 1 bit, that is, multiplied by 2, to obtain the above-mentioned number of pixel interval segments. In this embodiment, instead of shifting 2 bits to the left, it shifts 1 bit to the left, which can reduce a certain number of coded bits.
上述S12中,当待编码图像的比特深度小于比特深度阈值时,说明该待编码图像为低比特深度图像,需要减少像素区间段数。在本实施例中,像素区间段数的减少,使得编码时可以针对少量像素区间的相关信息进行编码,也即减少了编码的比特数。In the above S12, when the bit depth of the to-be-encoded image is less than the bit-depth threshold, it indicates that the to-be-encoded image is a low bit depth image, and the number of pixel interval segments needs to be reduced. In this embodiment, the number of segments in the pixel interval is reduced, so that the relevant information of a small number of pixel intervals can be encoded during encoding, that is, the number of encoded bits is reduced.
在一种可实现的方案中,可根据比特深度与比特深度阈值的差值绝对值,确定缩小倍数;按照缩小倍数对预设像素区间段数进行缩小处理,例如:将预设像素区间段数除以缩小倍数的商作为上述像素区间段数。In an achievable solution, the reduction factor can be determined according to the absolute value of the difference between the bit depth and the bit depth threshold; and the preset number of segments in the pixel interval is reduced according to the reduction factor, for example, dividing the number of segments in the preset pixel interval by The quotient of the reduction factor is used as the number of segments of the above-mentioned pixel interval.
在一种可实现的方案中,不同的比特深度可以对应不同的缩小倍数,即每一比特深度对应一缩小倍数;或者,也可以是多个不同的比特深度对应同一缩小倍数,而另外多个不同的比特深度则对应另外相同的缩小倍数,即每一组比特深度对应一缩小倍数。In an achievable solution, different bit depths may correspond to different reduction factors, that is, each bit depth corresponds to a reduction factor; or, multiple different bit depths may correspond to the same reduction factor, while other multiple Different bit depths correspond to another same reduction factor, that is, each group of bit depths corresponds to a reduction factor.
在一种可实现的方案中,缩小倍数可以按照预设步长进行递减,预设步长可以是2的倍数,或者其他数值的倍数。缩小倍数可以是编解码两端按照相同计算过程计算的,也可以是在码流中指示的。In an achievable solution, the reduction factor may be decreased according to a preset step size, and the preset step size may be a multiple of 2, or a multiple of other values. The reduction factor can be calculated by the same calculation process at both ends of the codec, or it can be indicated in the code stream.
在一具体实例中,可事先建立多个不同差值绝对值及其对应的缩小倍数的对应关系,这样,后续根据比特深度与比特深度阈值的差值绝对值,即可查找出对应缩小倍数。或者,可事先建立多个不同差值绝对值范围及其对应的缩小倍数的对应关系,这样,后续根据比特深度与比特深度阈值的差值绝对值,确定其所在差值绝对值范围;将该差值绝对值范围对应的缩小倍数作为上述缩小倍数。其中,多个不同差值绝对值对应的缩小倍数以及多个不同差值绝对值范围对应的缩小倍数可根据实验来确定,本申请实施例对此不做具体限定。In a specific example, a plurality of different absolute values of the difference and their corresponding reduction factors may be established in advance, so that the corresponding reduction factors can be found subsequently according to the absolute value of the difference between the bit depth and the bit depth threshold. Alternatively, a plurality of different absolute value ranges of the difference and the corresponding relationship of the corresponding reduction multiples can be established in advance, so that the subsequent absolute value of the difference between the bit depth and the bit depth threshold is used to determine the absolute value range of the difference; The reduction factor corresponding to the absolute value range of the difference is used as the reduction factor above. The reduction factor corresponding to the multiple different absolute values of the difference and the reduction factor corresponding to the multiple different absolute value ranges can be determined according to experiments, which are not specifically limited in the embodiment of the present application.
在另一具体实例中,可将比特深度与比特深度阈值的差值绝对值输入到上述指数函数中,执行该指数函数得到缩小倍数。示例性的,该指数函数也可以为上述公式(1)。In another specific example, the absolute value of the difference between the bit depth and the bit depth threshold can be input into the above exponential function, and the exponential function is executed to obtain the reduction factor. Exemplarily, the exponential function can also be the above formula (1).
举例来说:a为0,比特深度为8bit,比特深度阈值为10bit,差值绝对值即为2bit,则缩小倍数为2 2,即为4。可将所述预设像素区间段数进行右移2位即除以4,得到上述像素区间段数。 For example: a is 0, the bit depth is 8 bits, the bit depth threshold is 10 bits, the absolute value of the difference is 2 bits, and the reduction factor is 2 2 , which is 4. The preset number of pixel interval segments may be shifted to the right by 2 bits, that is, divided by 4, to obtain the above-mentioned number of pixel interval segments.
在一种实施例中,当待编码图像的比特深度等于比特深度阈值时,可不对预设像素区间段数进行调整。In one embodiment, when the bit depth of the image to be encoded is equal to the bit depth threshold, the preset number of pixel interval segments may not be adjusted.
上述比特深度阈值可根据实际需要来设定,本申请实施例对此不做具体限定。注:实际应用时,上述比特深度阈值与上述预设像素区间段数可联合确定。示例性的,申请人通过实验发现针对10bit的图像采用16个像素区间进行像素映射是合适的。因此,可将上述比特深度阈值确定为10bit;将上述预设像素区间段数确定为16。The foregoing bit depth threshold may be set according to actual needs, which is not specifically limited in this embodiment of the present application. Note: In practical application, the above-mentioned bit depth threshold and the above-mentioned preset number of pixel interval segments can be jointly determined. Exemplarily, the applicant finds through experiments that it is suitable to use 16 pixel intervals for pixel mapping for a 10-bit image. Therefore, the above-mentioned bit depth threshold can be determined to be 10 bits; the above-mentioned preset number of pixel intervals can be determined to be 16.
上述402中,多个映射像素区间与多个原始像素区间一一对应。其中,原始像素区间可以理解为是原始像素域中的像素区间;映射像素区间可以理解为是映射像素域中的像素区间。多个映射像素区间和多个原始像素区间的个数由像素区间段数决定。在一实例中,多个映射像素区间和多个原始像素区间的个数可均等于像素区间段数。In the above 402, the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals. The original pixel interval can be understood as a pixel interval in the original pixel domain; the mapped pixel interval can be understood as a pixel interval in the mapped pixel domain. The number of the plurality of mapped pixel intervals and the plurality of original pixel intervals is determined by the number of pixel interval segments. In an example, the number of the plurality of mapped pixel intervals and the plurality of original pixel intervals may be equal to the number of pixel interval segments.
上述403中,若上述待编码图像为YUV格式,则上述像素值可以是亮度像素值或色度像素值。若上述待编码图像为RGB格式,则上述像素值可以是G、R或B分量的像素 值。In the above 403, if the image to be encoded is in the YUV format, the pixel value may be a luminance pixel value or a chrominance pixel value. If the above-mentioned image to be encoded is in RGB format, the above-mentioned pixel value may be the pixel value of G, R or B component.
上述404中,可将码流发送给解码端。In the above 404, the code stream can be sent to the decoding end.
本申请实施例提供的技术方案中,在对待编码图像进行编码时,会基于待编码图像的比特深度来确定在进行像素映射时所需划分的像素区间段数。与现有的VCC标准中将映射前和映射后的像素区间段数进行固定或默认设置的方案相比,本申请实施例提供的技术方案能够结合实际情况进行自适应调整,有助于提升映射的灵活性。In the technical solutions provided by the embodiments of the present application, when the to-be-coded image is encoded, the number of pixel interval segments that need to be divided during pixel mapping is determined based on the bit depth of the to-be-coded image. Compared with the solution in the existing VCC standard in which the number of pixel intervals before and after the mapping is fixed or set by default, the technical solutions provided in the embodiments of the present application can be adaptively adjusted in combination with the actual situation, which helps to improve the mapping efficiency. flexibility.
可选的,上述402中“根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间”,可采用如下步骤来实现:Optionally, in the above 402, "determine multiple original pixel intervals and multiple mapped pixel intervals corresponding to the image to be encoded according to the number of pixel interval segments", the following steps can be used to achieve:
4021、根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间。4021. Determine, according to the number of pixel interval segments, multiple original pixel intervals corresponding to the image to be encoded.
4022、根据所述图像中各像素点的像素值,确定与所述多个原始像素区间一一对应的多个映射像素区间。4022. According to the pixel value of each pixel in the image, determine a plurality of mapped pixel intervals corresponding to the plurality of original pixel intervals one-to-one.
上述4021中,可按照像素区间段数,将基于待编码图像的比特深度确定的原始像素取值范围进行划分得到多个像素区间。In the above 4021, a plurality of pixel intervals may be obtained by dividing the original pixel value range determined based on the bit depth of the image to be encoded according to the number of pixel interval segments.
在一实例中,可将这多个像素区间直接作为上述多个原始像素区间。In an example, the plurality of pixel intervals can be directly used as the above-mentioned plurality of original pixel intervals.
在另一实例中,上述多个原始像素区间为多个有效原始像素区间。可根据所述待编码图像的像素值分布情况,从所述多个像素区间中确定出所述多个有效原始像素区间。示例性的,将所述多个像素区间中与所述待编码图像的像素值分布范围有交集的多个像素区间确定为所述多个有效原始像素区间。像素值分布范围由待编码图像中最小像素值与最大像素值确定。某一像素区间与所述待编码图像的像素值分布范围有交集,说明待编码图像中至少存在一个像素点的像素值落入该像素区间;某一像素区间与待编码图像的像素值分布范围无交集,说明待编码图像中不存在某一像素点的像素值落入该像素区间。在本实施例中,将那些无效的像素区间进行剔除,这样,可有助于减少编码的比特数。In another example, the above-mentioned multiple original pixel intervals are multiple valid original pixel intervals. The plurality of valid original pixel intervals may be determined from the plurality of pixel intervals according to the distribution of pixel values of the image to be encoded. Exemplarily, a plurality of pixel intervals that have an intersection with the pixel value distribution range of the image to be encoded among the plurality of pixel intervals are determined as the plurality of valid original pixel intervals. The distribution range of pixel values is determined by the minimum pixel value and the maximum pixel value in the image to be encoded. There is an intersection between a certain pixel interval and the pixel value distribution range of the image to be encoded, indicating that there is at least one pixel value in the to-be-encoded image that falls into the pixel interval; a pixel interval and the pixel value distribution range of the to-be-encoded image No intersection, it means that there is no pixel value of a certain pixel in the to-be-encoded image that falls within the pixel range. In this embodiment, those invalid pixel intervals are eliminated, which can help to reduce the number of encoded bits.
在一种可实现的方案中,所述多个原始像素区间包括第一原始像素区间;所述多个映射像素区间包括与所述第一原始像素区间对应的第一映射像素区间。其中,第一原始像素区间指代的是多个原始像素区间中的任一个。上述4022中“根据所述图像中各像素点的像素值,确定与所述第一原始像素区间对应的第一映射像素区间”,具体可采用如下步骤:In an achievable solution, the multiple original pixel intervals include a first original pixel interval; the multiple mapped pixel intervals include a first mapped pixel interval corresponding to the first original pixel interval. The first original pixel interval refers to any one of multiple original pixel intervals. In the above 4022, "determine the first mapped pixel interval corresponding to the first original pixel interval according to the pixel value of each pixel in the image", the following steps may be specifically adopted:
S21、根据所述待编码图像中各像素点的像素值,确定落在所述第一原始像素区间的至少一个像素点。S21. Determine at least one pixel that falls within the first original pixel interval according to the pixel value of each pixel in the image to be encoded.
S22、综合所述待编码图像中所述至少一个像素点中各像素点所在区域的像素值分布情况,确定所述第一映射像素区间的区间长度。S22. Determine the interval length of the first mapped pixel interval by synthesizing the distribution of pixel values in the region where each pixel point in the at least one pixel point in the image to be encoded is located.
S23、基于所述第一映射像素区间的区间长度,确定所述第一映射像素区间。S23. Determine the first mapped pixel interval based on the interval length of the first mapped pixel interval.
上述S21中,上述至少一个像素点的像素值落在第一原始像素区间。In the above S21, the pixel value of the at least one pixel point falls within the first original pixel interval.
举例来说:第一原始像素区间为0-63;待编码图像中像素点A的像素值为4,像素点B的像素值为63,像素点C的像素值为90。像素点A和B即是落在第一原始像素区间的像素点。For example, the first original pixel interval is 0-63; the pixel value of pixel A in the image to be encoded is 4, the pixel value of pixel B is 63, and the pixel value of pixel C is 90. Pixel points A and B are the pixel points that fall within the first original pixel interval.
上述S22中,可给平坦区域分配更多的码字,也即更长的映射像素区间长度;可给非平坦区域分配更少的码字,也即是更短的映射像素区间长度。这样,有助于提升整体画面质量。在一实例中,上述方法,还可包括:In the above S22, more codewords may be allocated to the flat area, that is, a longer mapping pixel interval length; less codewords may be allocated to the uneven area, that is, a shorter mapping pixel interval length. In this way, it helps to improve the overall picture quality. In an example, the above method may further include:
405、根据所述像素区间段数,确定初始映射区间长度。405. Determine the length of the initial mapping interval according to the number of the pixel interval segments.
映射像素取值范围可以为预设比特深度对应的预设范围,例如:预设比特深度为10bit, 其对应的预设范围为0-1023;或者,根据待编码图像的比特深度确定,例如:待编码图像的比特深度为12bit时,映射像素取值范围为12bit对应的0-4095。The mapping pixel value range may be a preset range corresponding to a preset bit depth, for example: the preset bit depth is 10bit, and the corresponding preset range is 0-1023; or, it is determined according to the bit depth of the image to be encoded, for example: When the bit depth of the image to be encoded is 12 bits, the value range of the mapped pixels is 0-4095 corresponding to 12 bits.
实际应用时,可将映射像素取值范围的总长度与像素区间段数的比值确定为初始映射区间长度。In practical application, the ratio of the total length of the mapped pixel value range to the number of pixel interval segments may be determined as the initial mapping interval length.
上述S22中“综合所述待编码图像中所述至少一个像素点中各像素点所在区域的像素值分布情况,确定所述第一映射像素区间的区间长度”,具体可采用如下步骤来实现:In the above-mentioned S22, "synthesizing the pixel value distribution in the region where each pixel point is located in the at least one pixel point in the image to be encoded, to determine the interval length of the first mapped pixel interval", the following steps can be specifically implemented:
S221、根据所述待编码图像中所述至少一个像素点中各像素点所在区域的像素值分布方差的平均值,确定调整方向。S221. Determine the adjustment direction according to the average value of the distribution variance of the pixel values in the region where each pixel point in the at least one pixel point in the to-be-coded image is located.
S222、根据所述平均值和/或所述至少一个像素点的数量占比,确定调整幅度。S222. Determine the adjustment range according to the average value and/or the number ratio of the at least one pixel point.
S223、根据所述调整方向和调整幅度,对所述初始映射区间长度进行调整,得到所述第一映射像素区间的区间长度。S223. Adjust the length of the initial mapping interval according to the adjustment direction and adjustment range to obtain the interval length of the first mapped pixel interval.
上述S221中,分别计算待编码图像中至少一个像素点中各像素点所在区域的像素值分布方差,各像素点所在区域可以是以相应像素点为中心,win为方形边长的窗口区域,计算这个窗口区域内的像素值分布方差。在一实例中,上述像素值分布方差指的是亮度像素值分布方差。其中,win的计算公式如下:In the above S221, the pixel value distribution variance of the area where each pixel point is located in the at least one pixel point in the to-be-coded image is calculated respectively, and the area where each pixel point is located may be centered on the corresponding pixel point, and win is a window area with a square side length, and calculate. The variance of the distribution of pixel values within this window area. In an example, the above pixel value distribution variance refers to the luminance pixel value distribution variance. Among them, the calculation formula of win is as follows:
Figure PCTCN2021087084-appb-000001
Figure PCTCN2021087084-appb-000001
其中,width、height分别待待编码图像的宽和高;min(width、height)为取width、height中最小值的函数。
Figure PCTCN2021087084-appb-000002
表示向下取整。
Wherein, width and height are respectively the width and height of the image to be encoded; min (width, height) is a function of taking the minimum value of width and height.
Figure PCTCN2021087084-appb-000002
Indicates rounded down.
计算至少一个像素点中各像素点所在区域的像素值分布方差之和。将至少一个像素点中各像素点所在区域的像素值分布方差之和与至少一个像素点的个数的比值作为上述平均值。在一实例中,上述平均值小于预设平均阈值时,调整方向为调大;上述平均值大于预设平均阈值时,调整方向为调小;上述平均值等于预设平均阈值时,则可不调整。预设平均阈值的大小可根据实际需要来设定,本申请实施例对此不作具体限定,例如:设为1。Calculate the sum of the variances of the distribution of pixel values in the region where each pixel point is located in the at least one pixel point. The ratio of the sum of the variances of the pixel value distribution in the region where each pixel point is located in the at least one pixel point and the number of the at least one pixel point is taken as the above average value. In one example, when the average value is smaller than the preset average threshold, the adjustment direction is to increase; when the average value is greater than the preset average threshold, the adjustment direction is to decrease; when the average value is equal to the preset average threshold, the adjustment may not be made. . The size of the preset average threshold may be set according to actual needs, which is not specifically limited in this embodiment of the present application, for example, set to 1.
上述S222中,在一实例中,平均值与上述预设平均阈值的差值的绝对值越大,调整幅度越大;或者,至少一个像素点的数量占比越大,调整幅度越大。至少一个像素点的数量占比指的是至少一个像素点的个数与待编码图像的总像素点个数的比值。In the above S222, in an example, the larger the absolute value of the difference between the average value and the above-mentioned preset average threshold value is, the larger the adjustment range is; or, the larger the proportion of the number of at least one pixel, the larger the adjustment range. The proportion of the number of at least one pixel refers to the ratio of the number of at least one pixel to the total number of pixels of the image to be encoded.
实际应用时,可根据所述平均值和所述至少一个像素点的数量占比,确定调整幅度。In practical application, the adjustment range may be determined according to the average value and the ratio of the number of the at least one pixel point.
上述S223中,根据所述调整方向和调整幅度,对所述初始映射区间长度进行调整,得到调整后区间长度;基于所述调整后区间长度,确定所述第一映射像素区间的区间长度。In the above S223, according to the adjustment direction and adjustment range, the length of the initial mapping interval is adjusted to obtain the adjusted interval length; based on the adjusted interval length, the interval length of the first mapped pixel interval is determined.
下面将以预设平均阈值为1进行举例介绍,上述S222和S223的步骤可采用如下公式来实现:The following will take the preset average threshold value of 1 as an example, and the steps of S222 and S223 can be implemented by the following formula:
Figure PCTCN2021087084-appb-000003
Figure PCTCN2021087084-appb-000003
Figure PCTCN2021087084-appb-000004
Figure PCTCN2021087084-appb-000004
delta1=round(10*hist)    (5)delta1=round(10*hist) (5)
delta2=round(20*hist)     (6)delta2=round(20*hist) (6)
其中,obinCW[i]表示初始映射区间长度,binCW[i]为调整后区间长度;normVar为上述平均值,hist表示上述数量占比;i可以理解为第一原始像素区间的索引值,有关索引值的确定将在下述各实施例中详细介绍;delta1和delta2为两个不同的调整幅度;round()为向下取整函数。Among them, obinCW[i] represents the length of the initial mapping interval, binCW[i] is the length of the interval after adjustment; normVar is the above average value, and hist represents the proportion of the above number; i can be understood as the index value of the first original pixel interval, and the relevant index The determination of the value will be described in detail in the following embodiments; delta1 and delta2 are two different adjustment amplitudes; round() is a downward rounding function.
在一种实现方式中,映射像素取值范围可以映射到待编码图像的比特深度对应的像素范围,也可以是先映射至预设的像素范围,再进行到待编码图像的比特深度对应的像素范围。In an implementation manner, the mapping pixel value range may be mapped to the pixel range corresponding to the bit depth of the image to be encoded, or may be first mapped to a preset pixel range, and then to the pixel corresponding to the bit depth of the image to be encoded scope.
若上述映射像素取值范围是根据待编码图像的比特深度确定的,则可将所述调整后区间长度直接作为所述第一映射像素区间的区间长度。If the above-mentioned value range of the mapped pixels is determined according to the bit depth of the image to be encoded, the adjusted interval length may be directly used as the interval length of the first mapped pixel interval.
若上述映射像素取值范围为预设比特深度对应的预设范围且待编码图像的比特深度与预设比特深度不一致,则需要根据待编码图像的比特深度以及预设比特深度,对上述调整后区间长度进行缩放,从而得到所述第一映射像素区间的区间长度。在一实例中,分别根据待编码图像的比特深度与预设比特深度的差值的绝对值及其符号,确定缩放倍数和缩放方式。具体地,根据待编码图像的比特深度与预设比特深度的差值的绝对值,确定缩放倍数;符号为负,缩放方式为缩小;符号为正,缩放方式为放大。例如:待编码图像的比特深度为12bit、上述预设比特深度为10bit时,需要将上述调整后区间长度左移两位也即乘4得到第一映射像素区间的区间长度。再例如:待编码图像的比特深度为8bit、上述预设比特深度为10bit时,需要将上述调整后区间长度右移两位也即除以4得到第一映射像素区间的区间长度。If the above-mentioned mapping pixel value range is the preset range corresponding to the preset bit depth and the bit depth of the image to be encoded is inconsistent with the preset bit depth, it is necessary to perform the above adjustment according to the bit depth of the image to be encoded and the preset bit depth. The interval length is scaled to obtain the interval length of the first mapped pixel interval. In an example, the zoom factor and the zoom mode are determined according to the absolute value and the sign of the difference between the bit depth of the image to be encoded and the preset bit depth, respectively. Specifically, the zoom factor is determined according to the absolute value of the difference between the bit depth of the image to be encoded and the preset bit depth; if the sign is negative, the zoom mode is zooming out; if the sign is positive, the zoom mode is zooming in. For example, when the bit depth of the to-be-encoded image is 12 bits and the above preset bit depth is 10 bits, the above-mentioned adjusted interval length needs to be left-shifted by two bits, that is, multiplied by 4 to obtain the interval length of the first mapped pixel interval. For another example, when the bit depth of the image to be encoded is 8 bits and the preset bit depth is 10 bits, the adjusted interval length needs to be shifted to the right by two bits, that is, divided by 4 to obtain the interval length of the first mapped pixel interval.
上述S23中,确定所述第一映射像素区间,也即确定所述第一映射像素区间的起终点。In the above S23, the first mapped pixel interval is determined, that is, the start and end points of the first mapped pixel interval are determined.
为了方便描述,可根据上述多个像素区间的起点位置,依次对上述多个像素区间进行编号,例如:从0开始编号。起点位置越靠前,编号越小。在实际应用时,可将每个像素区间的编号作为其对应的索引值。For the convenience of description, the plurality of pixel intervals may be sequentially numbered according to the starting positions of the above-mentioned multiple pixel intervals, for example, the numbering starts from 0. The further forward the starting point is, the smaller the number. In practical application, the number of each pixel interval can be used as its corresponding index value.
可按照上述多个原始像素区间的索引值对上述多个原始像素区间进行升序排列,得到原始像素区间序列。若上述第一原始像素区间为原始像素区间序列中排序第一的原始像素区间,则可确定第一映射像素区间的起点为0;根据第一映射像素区间的起点及其区间长度,即可确定出第一映射像素区间的终点。具体地,将第一映射像素区间的起点加上区间长度、再减1,作为第一映射像素区间的终点。The above-mentioned multiple original pixel intervals may be arranged in ascending order according to the index values of the above-mentioned multiple original pixel intervals, so as to obtain the original pixel interval sequence. If the above-mentioned first original pixel interval is the original pixel interval ranked first in the original pixel interval sequence, it can be determined that the starting point of the first mapped pixel interval is 0; according to the starting point of the first mapped pixel interval and the interval length, it can be determined the end point of the first mapped pixel interval. Specifically, the start point of the first mapped pixel interval is added to the interval length and then subtracted by 1, as the end point of the first mapped pixel interval.
若上述第一原始像素区间不为原始像素区间序列中排序第一的原始像素区间,则可根据所述第一映射像素区间的区间长度以及原始像素区间序列中第一原始像素区间的前一个原始像素区间对应的映射像素区间的终点,确定所述第一映射像素区间的起终点。可将前一映射像素区间的终点加1,得到第一映射像素区间的起点;将第一映射像素区间的起点加上第一映射像素区间的长度、再减1,得到第一映射像素区间的终点。If the above-mentioned first original pixel interval is not the original pixel interval ranked first in the sequence of original pixel intervals, the interval length of the first mapped pixel interval and the previous original pixel interval of the first original pixel interval in the sequence of original pixel intervals may be used. The end point of the mapped pixel interval corresponding to the pixel interval determines the start and end point of the first mapped pixel interval. The end point of the previous mapped pixel interval can be added by 1 to obtain the starting point of the first mapped pixel interval; the starting point of the first mapped pixel interval can be added to the length of the first mapped pixel interval, and then subtracted by 1 to obtain the first mapped pixel interval. end.
在一实例中,所述多个映射像素区间与所述多个原始像素区间一一对应。上述403中“基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进行编码,生成码流”,具体可采用如下步骤来实现:In one example, the plurality of mapped pixel intervals correspond one-to-one with the plurality of original pixel intervals. In the above 403, "encode the pixel values of the to-be-encoded image based on the multiple original pixel intervals and the multiple mapped pixel intervals, and generate a code stream", the following steps can be specifically implemented:
4031、根据所述多个原始像素区间中各原始像素区间的起终点及其对应的映射像素区间的起终点,确定各原始像素区间对应的映射关系。4031. Determine a mapping relationship corresponding to each original pixel interval according to the start and end points of each original pixel interval in the plurality of original pixel intervals and the corresponding start and end points of the mapped pixel intervals.
4032、根据所述待编码图像的原始像素值以及所述映射关系,确定所述待编码图像的映射像素值。4032. Determine the mapped pixel value of the image to be encoded according to the original pixel value of the image to be encoded and the mapping relationship.
4033、根据所述待编码图像的映射像素值进行编码,生成码流。4033. Perform encoding according to the mapped pixel value of the to-be-encoded image to generate a code stream.
上述4031中,根据所述多个原始像素区间中各原始像素区间的起终点及其对应的映射像素区间的起终点,可确定线性映射函数,以作为各原始像素区间对应的映射关系。In the above step 4031, a linear mapping function can be determined according to the start and end points of each original pixel interval in the plurality of original pixel intervals and the start and end points of the corresponding mapped pixel intervals, as a mapping relationship corresponding to each original pixel interval.
上述4032中,可根据所述待编码图像的原始像素值及其所在的原始像素区间对应的映射关系,确定所述待编码图像的映射像素值。具体地,将原始像素值输入到其所在原始像素区间对应的线性映射函数中,得到映射像素值。In the above step 4032, the mapped pixel value of the to-be-encoded image may be determined according to the original pixel value of the to-be-encoded image and the mapping relationship corresponding to the original pixel interval in which the image to be encoded is located. Specifically, the original pixel value is input into the linear mapping function corresponding to the original pixel interval where it is located to obtain the mapped pixel value.
在一实例中,所述像素值可以为亮度像素值。In an example, the pixel values may be luma pixel values.
实际编码过程中,可将待编码图像划分为多个编码块,进行分块编码,具体的,上述4032中“根据所述待编码图像的原始像素值以及所述映射关系,确定所述待编码图像的映射像素值”,包括:In the actual encoding process, the to-be-encoded image can be divided into multiple encoding blocks for sub-block encoding. image's mapped pixel values", including:
A、确定所述待编码图像中的待编码块。A. Determine the block to be encoded in the image to be encoded.
B、按照所述映射关系,将所述待编码块的像素值从原始像素域映射到映射像素域,得到映射待编码块。B. According to the mapping relationship, map the pixel value of the block to be encoded from the original pixel domain to the mapped pixel domain to obtain the mapped block to be encoded.
上述4033中,针对每一个待编码块,可根据配置来确定是采用帧内预测,还是采用帧间预测,以去除待编码图像的空域或时域冗余信息。In the above 4033, for each block to be coded, it may be determined according to the configuration whether to use intra-frame prediction or inter-frame prediction to remove redundant information in the spatial domain or time domain of the to-be-coded image.
若采用帧内预测,则具体编码过程包括:If intra-frame prediction is used, the specific encoding process includes:
C1、在映射像素域,对所述映射待编码块进行帧内预测,得到预测块。C1. In the mapped pixel domain, perform intra-frame prediction on the mapped to-be-coded block to obtain a predicted block.
将所述待编码图像中所述待编码块周围的已编码的相邻块的重建块确定为所述待编码块的参考块。根据待编码块的参考块,对所述映射待编码块进行帧内预测,得到预测块。其中,帧内预测过程具体可参考上述有关图2和图3的介绍内容,在此不再赘述。The reconstructed blocks of the coded adjacent blocks around the to-be-coded block in the to-be-coded image are determined as the reference blocks of the to-be-coded block. Perform intra-frame prediction on the mapped to-be-coded block according to the reference block of the to-be-coded block to obtain a predicted block. For details of the intra-frame prediction process, reference may be made to the above-mentioned contents of FIG. 2 and FIG. 3 , and details are not repeated here.
其中,参考块和预测块中像素值均为映射像素域的像素值。Wherein, the pixel values in the reference block and the prediction block are all pixel values in the mapped pixel domain.
D1、基于所述预测块,对所述待编码块进行编码。D1. Encode the block to be encoded based on the prediction block.
对所述映射待编码块与所述预测块的残差块变换、量化以及熵编码形成码流中的一部分。Transforming, quantizing and entropy encoding the residual block that maps the block to be encoded and the prediction block forms a part of the code stream.
若采用帧间预测,则具体编码过程包括:If inter-frame prediction is used, the specific encoding process includes:
C2、在原始像素域,对所述待编码块进行帧间预测,得到预测块。C2. In the original pixel domain, perform inter-frame prediction on the to-be-coded block to obtain a predicted block.
其中,预测块的像素值是原始像素域的像素值。其中,帧间预测过程具体可参考上述有关图2和图3的介绍内容,在此不再赘述。Among them, the pixel value of the prediction block is the pixel value of the original pixel domain. For the details of the inter-frame prediction process, reference may be made to the above-mentioned contents of FIG. 2 and FIG. 3 , which will not be repeated here.
D2、按照所述映射关系,将所述预测块从原始像素域映射到映射像素域,得到映射预测块。按照所述映射关系,将所述待编码块从原始像素域映射到映射像素域,得到映射待编码块。D2. According to the mapping relationship, map the prediction block from the original pixel domain to the mapped pixel domain to obtain a mapped prediction block. According to the mapping relationship, the to-be-coded block is mapped from the original pixel domain to the mapped pixel domain to obtain the mapped to-be-coded block.
E2、计算所述映射待编码块和所述映射预测块之间的残差块。E2. Calculate a residual block between the mapped block to be coded and the mapped predicted block.
F2、基于所述残差块,对所述待编码块进行编码。F2. Encode the block to be encoded based on the residual block.
可对残差块进行变换、量化以及熵编码形成码流中的一部分。The residual block may be transformed, quantized, and entropy encoded to form part of the codestream.
具体应用时,在亮度像素映射的场景中,本实施例中所涉及的像素值指代的是亮度像素值。In specific application, in the scene of luminance pixel mapping, the pixel value involved in this embodiment refers to the luminance pixel value.
下面将结合图5来介绍上述码流的解码过程。如图5所示,该方法,包括:The decoding process of the above code stream will be described below with reference to FIG. 5 . As shown in Figure 5, the method includes:
501、获取码流。501. Acquire a code stream.
502、根据待解码图像的比特深度,确定所述待解码图像对应的像素区间段数。502. Determine the number of pixel interval segments corresponding to the to-be-decoded image according to the bit depth of the to-be-decoded image.
503、根据所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像素区间。503. Determine, according to the number of segments of the pixel interval, multiple original pixel intervals and multiple mapped pixel intervals corresponding to the to-be-decoded image.
504、基于所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像。504. Decode the code stream based on the multiple original pixel intervals and the multiple mapped pixel intervals to obtain a decoded image.
上述501中,在一实例中,可从其他设备上主动请求获取码流。在另一实例中,可被动接受其他设备主动发送来的码流。其中,其他设备可以是编码端设备。In the above 501, in an example, the code stream may be actively requested from other devices. In another example, the code stream actively sent by other devices can be passively accepted. Wherein, other devices may be encoding end devices.
上述步骤502和步骤503的具体实现过程可参照上述各实施例中的相应内容,在此不再赘述。注:在解码过程中的待解码图像也即是上述编码过程中涉及的待编码图像。For the specific implementation process of the above-mentioned steps 502 and 503, reference may be made to the corresponding contents in the above-mentioned embodiments, and details are not described herein again. Note: The to-be-decoded image in the decoding process is also the to-be-encoded image involved in the above-mentioned encoding process.
上述504中,根据所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像。示例性的,可基于所述多个原始像素区间和所述多个映射像素区间对所述码流中的亮度像素值进行解码,获得解码后的图像。In the above 504, the code stream is decoded according to the multiple original pixel intervals and the multiple mapped pixel intervals to obtain a decoded image. Exemplarily, the luminance pixel values in the code stream may be decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
本申请实施例提供的技术方案中,在对待解码图像进行解码时,会基于待解码图像的比特深度来确定在进行像素映射时所需划分的像素区间段数。与现有的VCC标准中将映射前和映射后的像素区间段数进行固定或默认设置的方案相比,本申请实施例提供的技术方案能够结合实际情况进行自适应调整,有助于提升映射的灵活性。In the technical solutions provided by the embodiments of the present application, when the to-be-decoded image is decoded, the number of pixel interval segments that need to be divided during pixel mapping is determined based on the bit depth of the to-be-decoded image. Compared with the solution in the existing VCC standard in which the number of pixel intervals before and after the mapping is fixed or set by default, the technical solutions provided in the embodiments of the present application can be adaptively adjusted in combination with the actual situation, which helps to improve the mapping efficiency. flexibility.
在一实例中,上述502中“根据待解码图像的比特深度,确定所述待解码图像对应的像素区间段数”,具体可采用如下步骤来实现:In an example, in the above 502, "determining the number of pixel interval segments corresponding to the to-be-decoded image according to the bit depth of the to-be-decoded image" can be specifically implemented by adopting the following steps:
5021、获取预设像素区间段数。5021. Obtain the number of preset pixel interval segments.
5022、根据待解码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数。5022. Adjust the preset number of segments in the pixel interval according to the bit depth of the image to be decoded, to obtain the number of segments in the pixel interval.
在一实例中,上述5022中“根据待解码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数”,包括如下步骤S31和/或S32:In an example, in the above-mentioned 5022, "adjust the number of segments in the preset pixel interval according to the bit depth of the image to be decoded to obtain the number of segments in the pixel interval", including the following steps S31 and/or S32:
S31、当待解码图像的比特深度大于比特深度阈值时,对所述预设像素区间段数进行增大处理,得到所述像素区间段数。S31. When the bit depth of the to-be-decoded image is greater than the bit depth threshold, increase the number of segments in the preset pixel interval to obtain the number of segments in the pixel interval.
S32、当所述待解码图像的比特深度小于比特深度阈值时,对所述预设像素区间段数进行减小处理,得到所述像素区间段数。S32. When the bit depth of the to-be-decoded image is less than a bit depth threshold, reduce the number of segments in the preset pixel interval to obtain the number of segments in the pixel interval.
在一实例中,所述多个映射像素区间与所述多个原始像素区间一一对应;所述原始像素区间为有效原始像素区间;所述码流中包括第三指示信息、第四指示信息以及第五指示信息;所述第三指示信息用于指示所述待解码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待解码图像对应的有效原始像素区间的最大索引值;所述第五指示信息用于指示所述多个映射像素区间的区间长度。In an example, the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals; the original pixel intervals are valid original pixel intervals; the code stream includes third indication information and fourth indication information and fifth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be decoded; the fourth indication information is used to indicate the valid original pixel corresponding to the image to be decoded The maximum index value of the interval; the fifth indication information is used to indicate interval lengths of the plurality of mapped pixel intervals.
实际应用时,可根据上述多个像素区间的起点位置,依次对上述多个像素区间进行编号,例如:从0开始编号。起点位置越靠前,编号越小。在实际应用时,可将每个像素区间的编号作为其对应的索引值。从多个像素区间中确定出多个有效原始像素区间的过程可参见上述各实施例中相应内容,在此不再赘述。In practical application, the plurality of pixel intervals may be numbered in sequence according to the starting positions of the plurality of pixel intervals, for example, the numbering starts from 0. The further forward the starting point is, the smaller the number. In practical application, the number of each pixel interval can be used as its corresponding index value. For the process of determining a plurality of valid original pixel intervals from the plurality of pixel intervals, reference may be made to the corresponding contents in the above-mentioned embodiments, and details are not described herein again.
举例来说,存在16个像素区间,其索引值依次为0、1、2、···15,其中,存在14个有效原始像素区间,其索引值依次为1、2、3、···14,那么最小索引值即为1;最大索引值即为14。For example, there are 16 pixel intervals, and their index values are 0, 1, 2, . . . 15, and there are 14 valid original pixel intervals, and their index values are 1, 2, 3, . . . 14, then the minimum index value is 1; the maximum index value is 14.
需要补充的是:上述码流中可仅包含第三指示信息和第四指示信息中的一个。例如:上述码流中仅包含第三指示信息,那么,编、解码端可默认最大索引值为像素区间段数减 1。再例如:上述码流中仅包含第四指示信息,那么,编、解码端可默认最小索引值为0。It should be added that: the above code stream may only include one of the third indication information and the fourth indication information. For example: the above code stream only contains the third indication information, then, the encoder and decoder can default the maximum index value to the number of pixel interval segments minus 1. For another example: the above-mentioned code stream only includes the fourth indication information, then, the encoder and the decoder can default the minimum index value to 0.
上述503中“根据所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像素区间”,可采用如下步骤来实现:"According to the number of segments of the pixel interval, determine multiple original pixel intervals and multiple mapped pixel intervals corresponding to the image to be decoded" in the above 503, the following steps can be used to achieve:
5031、根据所述像素区间段数,确定原始像素区间长度。5031. Determine the length of the original pixel interval according to the number of segments of the pixel interval.
5032、根据原始像素区间长度、所述第三指示信息以及所述第四指示信息,确定所述多个有效原始像素区间。5032. Determine the multiple valid original pixel intervals according to the length of the original pixel interval, the third indication information, and the fourth indication information.
5033、根据所述多个映射像素区间的区间长度,确定所述多个映射像素区间。5033. Determine the multiple mapped pixel segments according to the segment lengths of the multiple mapped pixel segments.
上述5031中,上述多个像素区间的区间长度可相等,也即上述多个原始像素区间的区间长度相等。可基于待解码图像的比特深度确定的原始像素取值范围以及像素区间段数来确定原始像素区间长度。具体地,可将原始像素取值范围的总长度与像素区间段数的比值确定为原始像素区间长度。每个像素区间的区间长度均为原始像素区间长度。In the above 5031, the interval lengths of the plurality of pixel intervals may be the same, that is, the interval lengths of the plurality of original pixel intervals are the same. The length of the original pixel interval may be determined based on the original pixel value range and the number of pixel interval segments determined by the bit depth of the image to be decoded. Specifically, the ratio of the total length of the original pixel value range to the number of pixel interval segments may be determined as the original pixel interval length. The interval length of each pixel interval is the original pixel interval length.
在一实例中,所述码流中还包括第六指示信息;所述第六指示信息用于指示所述比特深度。上述5031中“根据所述像素区间段数,确定原始像素区间长度”,具体为:根据所述比特深度与所述像素区间段数,确定原始像素区间长度。也即基于待解码图像的比特深度确定的原始像素取值范围以及像素区间段数来确定原始像素区间长度。In an example, the code stream further includes sixth indication information; the sixth indication information is used to indicate the bit depth. "Determining the length of the original pixel interval according to the number of segments of the pixel interval" in the above 5031 is specifically: determining the length of the original pixel interval according to the bit depth and the number of segments of the pixel interval. That is, the length of the original pixel interval is determined based on the original pixel value range and the number of pixel interval segments determined by the bit depth of the image to be decoded.
上述5032中,确定所述多个有效原始像素区间,也即是确定多个有效原始像素区间的起终点。起终点包括起点和终点。In the above 5032, the multiple valid original pixel intervals are determined, that is, the start and end points of the multiple valid original pixel intervals are determined. Start and end points include start and end points.
举例来说:原始像素区间长度为64;有效原始像素区间的最小索引值为1、最大索引值为2;也即,存在两个有效原始像素区间,索引值分别为1和2。那么,索引值为1的有效原始像素区间的起点为64,其终点为127;索引值为2的有效原始像素区间的起点为128,其终点为191。For example: the length of the original pixel interval is 64; the minimum index value of the valid original pixel interval is 1, and the maximum index value is 2; that is, there are two valid original pixel intervals, and the index values are 1 and 2 respectively. Then, the starting point of the valid original pixel interval with an index value of 1 is 64, and its end point is 127; the starting point of the valid original pixel interval with an index value of 2 is 128, and its end point is 191.
上述5033中,所述第五指示信息用于指示所述多个映射像素区间中每一映射像素区间的区间长度。所述第五指示信息可包括多个子指示信息,多个子指示信息分别用于指示多个映射像素区间中各映射像素区间的区间长度。多个子指示信息按序记录在上述码流中。多个子指示信息的记录顺序由多个映射像素区间对应的多个原始映射像素区间的索引值确定。原始映射像素区间的索引值越小,用于指示其对应的映射像素区间的区间长度的子指示信息的记录顺序越靠前。或者,多个子指示信息也可以不按序记录在上述码流中。例如,每一子指示信息均携带与之对应的映射像素区间对应的原始像素区间的索引值。In the above 5033, the fifth indication information is used to indicate the interval length of each mapped pixel interval in the plurality of mapped pixel intervals. The fifth indication information may include a plurality of sub-indication information, and the plurality of sub-indication information are respectively used to indicate the interval length of each mapped pixel interval in the plurality of mapped pixel intervals. A plurality of sub-indication information are sequentially recorded in the above-mentioned code stream. The recording sequence of the multiple sub-indication information is determined by the index values of the multiple original mapped pixel ranges corresponding to the multiple mapped pixel ranges. The smaller the index value of the original mapped pixel interval, the higher the recording order of the sub-indication information used to indicate the interval length of the corresponding mapped pixel interval. Alternatively, a plurality of sub-indication information may also be recorded in the above-mentioned code stream out of sequence. For example, each sub-indication information carries the index value of the original pixel interval corresponding to the corresponding mapped pixel interval.
根据所述多个映射像素区间的区间长度,确定多个映射像素区间的起终点。示例地,可根据多个子指示信息在码流中的记录顺序以及多个映射像素区间的区间长度,确定多个映射像素区间的起终点。According to the interval lengths of the plurality of mapped pixel intervals, the start and end points of the plurality of mapped pixel intervals are determined. For example, the start and end points of the multiple mapped pixel intervals may be determined according to the recording sequence of the multiple sub-indication information in the code stream and the interval lengths of the multiple mapped pixel intervals.
举例来说:存在两个映射像素区间,区间长度分别为68和60,68和60对应的子指示信息在码流中的记录顺序是:68在前,60在后,那么,一个映射像素区间的起点和终点分别为0、67;另一个映射像素区间的起点和终点分别为68、127。For example: there are two mapped pixel intervals, the interval lengths are 68 and 60, respectively. The sub-indication information corresponding to 68 and 60 is recorded in the code stream in the following order: 68 comes first, 60 comes after, then, a mapped pixel interval The start and end points of the pixel interval are 0 and 67, respectively; the start and end points of the other mapped pixel interval are 68 and 127, respectively.
实际应用时,得到多个有效原始像素区间和多个映射像素区间之后,需确定多个有效原始像素区间与多个映射像素区间之间的对应关系。可根据多个有效原始像素区间各自的索引值对多个有效原始像素区间进行升序排序;根据多个映射像素区间各自对应的子指示信息的记录顺序对多个映射像素区间进行升序排序;确定序号相同的有效原始像素区间与映射像素区间对应。In practical application, after obtaining multiple valid original pixel ranges and multiple mapped pixel ranges, it is necessary to determine the correspondence between multiple valid original pixel ranges and multiple mapped pixel ranges. The multiple valid original pixel intervals can be sorted in ascending order according to their respective index values; the multiple mapped pixel intervals can be sorted in ascending order according to the recording order of the sub-indication information corresponding to each of the multiple mapped pixel intervals; the sequence number is determined. The same valid original pixel interval corresponds to the mapped pixel interval.
在一实例中,上述504中“基于所述多个原始像素区间和所述多个映射像素区间对所 述码流进行解码,获得解码后的图像”,可采用如下步骤来实现:In an example, in the above-mentioned 504, "decode the code stream based on the multiple original pixel intervals and the multiple mapped pixel intervals to obtain the decoded image", the following steps can be adopted to realize:
5041、对所述码流进行解码,得到所述待解码图像的映射像素值。5041. Decode the code stream to obtain the mapped pixel value of the to-be-decoded image.
5042、根据所述多个原始像素区间中各原始像素区间的起终点及其对应的映射像素区间的起终点,确定各原始像素区间对应的映射关系。5042. Determine a mapping relationship corresponding to each original pixel interval according to the start and end points of each original pixel interval in the plurality of original pixel intervals and the corresponding start and end points of the mapped pixel interval.
5043、根据所述待解码图像的映射像素值及其所在的映射像素区间对应的原始像素区间的映射关系,确定所述待解码图像的原始像素值。5043. Determine the original pixel value of the to-be-decoded image according to the mapping relationship between the mapped pixel value of the to-be-decoded image and the original pixel interval corresponding to the mapped pixel interval in which the image is to be decoded.
在上述5041中,针对帧内预测的解码过程包括如下步骤:In the above 5041, the decoding process for intra prediction includes the following steps:
a1、对所述码流进行解码,得到待解码图像中待解码块的残差块。a1. Decode the code stream to obtain a residual block of the to-be-decoded block in the to-be-decoded image.
其中,残差块的像素值为映射像素域的像素值。Among them, the pixel value of the residual block is the pixel value of the mapped pixel domain.
b1、在映射像素域,对所述待解码块进行帧内预测,得到预测块。b1. In the mapped pixel domain, perform intra-frame prediction on the block to be decoded to obtain a predicted block.
其中,预测块的像素值为映射像素域的像素值。The pixel value of the prediction block is the pixel value of the mapped pixel domain.
其中,帧内预测过程具体可参考上述有关图2和图3的介绍内容,在此不再赘述。For details of the intra-frame prediction process, reference may be made to the above-mentioned contents of FIG. 2 and FIG. 3 , and details are not repeated here.
c1、根据预测块和残差块,确定待解码块对应的映射待解码块。c1. Determine, according to the prediction block and the residual block, the mapped block to be decoded corresponding to the block to be decoded.
针对帧间预测的解码过程包括:The decoding process for inter prediction includes:
a1、对所述码流进行解码,得到待解码图像中待解码块的残差块。a1. Decode the code stream to obtain a residual block of the to-be-decoded block in the to-be-decoded image.
其中,残差块的像素值为映射像素域的像素值。Among them, the pixel value of the residual block is the pixel value of the mapped pixel domain.
b1、在原始像素域,对所述待解码块进行帧间预测,得到预测块。b1. In the original pixel domain, perform inter-frame prediction on the to-be-decoded block to obtain a predicted block.
其中,预测块的像素值为原始像素域的像素值。其中,帧间预测过程具体可参考上述有关图2和图3的介绍内容,在此不再赘述。Among them, the pixel value of the prediction block is the pixel value of the original pixel domain. For the details of the inter-frame prediction process, reference may be made to the above-mentioned contents of FIG. 2 and FIG. 3 , which will not be repeated here.
c1、根据上述映射关系,将预测块的像素值从原始像素域映射到映射像素域,得到映射预测块。c1. According to the above mapping relationship, map the pixel values of the prediction block from the original pixel domain to the mapped pixel domain to obtain the mapped prediction block.
d1、根据映射预测块和残差块,确定待解码块对应的映射待解码块。d1. According to the mapping prediction block and the residual block, determine the mapping to-be-decoded block corresponding to the to-be-decoded block.
上述5042的具体实现过程可参见上述各实施例中相应内容,在此不再赘述。For the specific implementation process of the foregoing 5042, reference may be made to the corresponding content in the foregoing embodiments, and details are not described herein again.
相应的,上述5043中,根据上述映射关系,将映射待解码块的像素值从映射像素域映射到原始像素域,得到待解码块。具体地,根据映射待解码块的像素值及其所在的映射像素区间对应的原始像素区间的映射关系,确定所述映射待解码块的原始像素值。Correspondingly, in the above 5043, according to the above-mentioned mapping relationship, the pixel value of the mapped block to be decoded is mapped from the mapped pixel domain to the original pixel domain to obtain the to-be-decoded block. Specifically, according to the mapping relationship between the pixel values of the mapped block to be decoded and the original pixel interval corresponding to the mapped pixel interval in which the mapped pixel value is located, the original pixel value of the mapped to-be-decoded block is determined.
这里需要说明的是:本申请实施例提供的所述方法中各步骤未尽详述的内容可参见上述实施例中的相应内容,此处不再赘述。此外,本申请实施例提供的所述方法中除了上述各步骤以外,还可包括上述各实施例中其他部分或全部步骤,具体可参见上述各实施例相应内容,在此不再赘述。It should be noted here that: for content not described in detail in each step of the method provided in the embodiment of the present application, reference may be made to the corresponding content in the foregoing embodiment, and details are not repeated here. In addition, in addition to the above steps, the methods provided in the embodiments of the present application may also include some or all of the other steps in the above embodiments. For details, please refer to the corresponding contents of the above embodiments, which will not be repeated here.
图6示出了本申请又一实施例提供的视频编码方法的流程示意图。如图5所示,该方法,包括:FIG. 6 shows a schematic flowchart of a video encoding method provided by another embodiment of the present application. As shown in Figure 5, the method includes:
601、对待编码图像进行编码,获得码流。601. Encode the to-be-encoded image to obtain a code stream.
其中,所述码流中包括第一指示信息,所述第一指示信息用于指示所述待编码图像对应的像素区间段数,所述像素区间段数是基于所述待编码图像的比特深度确定的。The code stream includes first indication information, where the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-encoded image, and the pixel interval segment number is determined based on the bit depth of the to-be-encoded image .
602、发送所述码流。602. Send the code stream.
在本实施例中,在码流中直接携带了用于指示待编码图像对应的像素区间段数的第一指示信息,这样,解码端在解码时,可直接从码流中获取到像素区间段数即可,无需通过计算来确定,有利于节省解码端的计算资源以及减低解码时间。In this embodiment, the first indication information for indicating the number of pixel interval segments corresponding to the image to be encoded is directly carried in the code stream. In this way, when decoding, the decoding end can directly obtain the number of pixel interval segments from the code stream, that is, Yes, it does not need to be determined by calculation, which is beneficial to save the computing resources of the decoding end and reduce the decoding time.
可选的,所述第一指示信息包括所述像素区间段数。Optionally, the first indication information includes the number of segments in the pixel interval.
可选的,所述第一指示信息包括所述像素区间段数与预设值的差值。Optionally, the first indication information includes a difference between the number of segments in the pixel interval and a preset value.
可选的,所述预设值为编码过程中确定的参数,所述码流中还包括用于指示所述预设值的第二指示信息;或,所述预设值为编码前固化到或预设在编码端和解码端的参数。预设值的大小可根据实际需要来确定,本申请对此不做具体限定。Optionally, the preset value is a parameter determined in the encoding process, and the code stream further includes second indication information for indicating the preset value; or, the preset value is solidified before encoding. Or preset parameters on the encoding side and the decoding side. The size of the preset value can be determined according to actual needs, which is not specifically limited in this application.
可选的,所述预设值包括所述比特深度。Optionally, the preset value includes the bit depth.
可选的,所述码流中还包括第三指示信息和/或第四指示信息;所述第三指示信息用于指示所述待编码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待编码图像对应的有效原始像素区间的最大索引值。Optionally, the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be encoded; the The fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the image to be encoded.
可选的,所述第三指示信息包括所述最小索引值。Optionally, the third indication information includes the minimum index value.
可选的,所述第四指示信息包括所述最大索引值。Optionally, the fourth indication information includes the maximum index value.
可选的,所述第四指示信息包括所述像素区间段数与所述最大索引值的差值。Optionally, the fourth indication information includes a difference between the number of segments in the pixel interval and the maximum index value.
可选的,所述码流中还包括第五指示信息;所述第五指示信息用于指示所述待编码图像对应的有效原始像素区间对应的映射像素区间的区间长度。Optionally, the code stream further includes fifth indication information; the fifth indication information is used to indicate the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the image to be encoded.
可选的,所述第五指示信息包括所述待编码图像对应的有效原始像素区间对应的映射像素区间的区间长度与初始映射区间长度的差值的绝对值及其符号;Optionally, the fifth indication information includes the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-encoded image and the initial mapped interval length and the sign thereof;
所述初始映射区间长度为根据所述像素区间段数确定的。The length of the initial mapping interval is determined according to the number of segments of the pixel interval.
可选的,所述码流中还包括用于指示所述比特深度的第六指示信息。Optionally, the code stream further includes sixth indication information for indicating the bit depth.
可选的,对待编码图像进行编码,获得码流,包括:Optionally, encode the to-be-encoded image to obtain a code stream, including:
根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数;According to the bit depth of the to-be-coded image, determine the number of pixel interval segments corresponding to the to-be-coded image;
基于所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间;determining, based on the number of pixel interval segments, a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-encoded image;
基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进行编码,生成码流。The pixel values of the to-be-encoded image are encoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to generate a code stream.
可选的,所述像素值为亮度像素值。Optionally, the pixel value is a luminance pixel value.
这里需要说明的是:本申请实施例提供的所述方法中各步骤未尽详述的内容可参见上述实施例中的相应内容,此处不再赘述。此外,本申请实施例提供的所述方法中除了上述各步骤以外,还可包括上述各实施例中其他部分或全部步骤,具体可参见上述各实施例相应内容,在此不再赘述。It should be noted here that: for content not described in detail in each step of the method provided in the embodiment of the present application, reference may be made to the corresponding content in the foregoing embodiment, and details are not repeated here. In addition, in addition to the above steps, the methods provided in the embodiments of the present application may also include some or all of the other steps in the above embodiments. For details, please refer to the corresponding contents of the above embodiments, which will not be repeated here.
图7示出了本申请又一实施例提供的视频解码方法的流程示意图。如图6所示,该方法,包括:FIG. 7 shows a schematic flowchart of a video decoding method provided by another embodiment of the present application. As shown in Figure 6, the method includes:
701、获取码流。701. Obtain a code stream.
其中,所述码流中包括第一指示信息,所述第一指示信息用于指示待解码图像对应的像素区间段数,所述像素区间段数是基于所述待解码图像的比特深度确定的。The code stream includes first indication information, where the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-decoded image, and the pixel interval segment number is determined based on the bit depth of the to-be-decoded image.
702、根据所述像素区间段数对所述码流进行解码,获得解码后的图像。702. Decode the code stream according to the number of segments in the pixel interval to obtain a decoded image.
在本实施例中,在码流中直接携带了用于指示待编码图像对应的像素区间段数的第一指示信息,这样,解码端在解码时,可直接从码流中获取到像素区间段数即可,无需通过计算来确定,有利于节省解码端的计算资源以及减低解码时间。In this embodiment, the first indication information for indicating the number of pixel interval segments corresponding to the image to be encoded is directly carried in the code stream. In this way, when decoding, the decoding end can directly obtain the number of pixel interval segments from the code stream, that is, Yes, it does not need to be determined by calculation, which is beneficial to save the computing resources of the decoding end and reduce the decoding time.
可选的,所述第一指示信息包括所述像素区间段数。Optionally, the first indication information includes the number of segments in the pixel interval.
可选的,所述第一指示信息包括所述像素区间段数与预设值的差值。Optionally, the first indication information includes a difference between the number of segments in the pixel interval and a preset value.
可选的,所述预设值为编码过程中确定的参数,所述码流中还包括用于指示所述预设值的第二指示信息;或,所述预设值为编码前固化到或预设在编码端和解码端的参数。Optionally, the preset value is a parameter determined in the encoding process, and the code stream further includes second indication information for indicating the preset value; or, the preset value is solidified before encoding. Or preset parameters on the encoding side and the decoding side.
可选的,所述预设值包括所述比特深度。Optionally, the preset value includes the bit depth.
可选的,所述码流中还包括第三指示信息和/或第四指示信息;所述第三指示信息用于指示所述待解码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待解码图像对应的有效原始像素区间的最大索引值。Optionally, the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be decoded; the The fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the to-be-decoded image.
可选的,所述第三指示信息包括所述最小索引值。Optionally, the third indication information includes the minimum index value.
可选的,所述第四指示信息包括所述最大索引值。Optionally, the fourth indication information includes the maximum index value.
可选的,所述第四指示信息包括所述像素区间段数与所述最大索引值的差值。Optionally, the fourth indication information includes a difference between the number of segments in the pixel interval and the maximum index value.
可选的,所述码流中还包括第五指示信息;所述第五指示信息用于指示所述待解码图像对应的有效原始像素区间对应的映射像素区间的区间长度。Optionally, the code stream further includes fifth indication information; the fifth indication information is used to indicate the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the image to be decoded.
可选的,所述第五指示信息包括所述待解码图像对应的有效原始像素区间对应的映射像素区间的区间长度与初始映射区间长度的差值的绝对值及其符号;Optionally, the fifth indication information includes the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-decoded image and the length of the initial mapped interval and its sign;
所述初始映射区间长度为根据所述像素区间段数确定的。The length of the initial mapping interval is determined according to the number of segments of the pixel interval.
可选的,所述码流中还包括用于指示所述比特深度的第六指示信息。Optionally, the code stream further includes sixth indication information for indicating the bit depth.
可选的,若码流中没有携带上述第六指示信息,则可基于像素区间段数进行反推得到待解码图像的比特深度,具体的反推过程可参考上述各实施例中“根据待编码图像的比特深度,来确定待编码图像的像素区间段数”的方案,在此不再详述。Optionally, if the above-mentioned sixth indication information is not carried in the code stream, the bit depth of the image to be decoded can be obtained by inverse inference based on the number of segments in the pixel interval. to determine the number of pixel interval segments of the image to be encoded", which will not be described in detail here.
可选的,根据所述像素区间段数对所述码流进行解码,获得解码后的图像,包括:Optionally, decode the code stream according to the number of segments in the pixel interval to obtain a decoded image, including:
基于所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像素区间;determining, based on the number of segments of the pixel interval, a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image;
根据所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像。The code stream is decoded according to the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
可选的,所述基于所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像,包括:Optionally, the decoding of the code stream based on the multiple original pixel intervals and the multiple mapped pixel intervals to obtain a decoded image includes:
基于所述多个原始像素区间和所述多个映射像素区间对所述码流中的亮度像素值进行解码,获得解码后的图像。The luminance pixel values in the code stream are decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
这里需要说明的是:本申请实施例提供的所述方法中各步骤未尽详述的内容可参见上述实施例中的相应内容,此处不再赘述。此外,本申请实施例提供的所述方法中除了上述各步骤以外,还可包括上述各实施例中其他部分或全部步骤,具体可参见上述各实施例相应内容,在此不再赘述。It should be noted here that: for content not described in detail in each step of the method provided in the embodiment of the present application, reference may be made to the corresponding content in the foregoing embodiment, and details are not repeated here. In addition, in addition to the above steps, the methods provided in the embodiments of the present application may also include some or all of the other steps in the above embodiments. For details, please refer to the corresponding contents of the above embodiments, which will not be repeated here.
下面将结合图8,介绍一种视频编码装置。如图8所示,该装置1100,包括:存储器1120、处理器1110以及通信接口1130;A video encoding apparatus will be introduced below with reference to FIG. 8 . As shown in FIG. 8 , the apparatus 1100 includes: a memory 1120, a processor 1110, and a communication interface 1130;
所述存储器1120,用于存储程序;the memory 1120 for storing programs;
所述处理器1110,分别与所述存储器1120以及所述通信接口1130耦合,用于执行所述存储器中存储的所述程序,以用于:The processor 1110, respectively coupled to the memory 1120 and the communication interface 1130, is configured to execute the program stored in the memory, so as to:
对待编码图像进行编码,获得码流;其中,所述码流中包括第一指示信息,所述第一指示信息用于指示所述待编码图像对应的像素区间段数,所述像素区间段数是基于所述待 编码图像的比特深度确定的;Encoding the to-be-coded image to obtain a code stream; wherein the code stream includes first indication information, where the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-coded image, and the pixel interval segment number is based on The bit depth of the to-be-coded image is determined;
通过通信接口1130控制发射器发送所述码流。The transmitter is controlled to send the code stream through the communication interface 1130 .
其中,通信接口可以是数据接口,U/I接口等,发射器可以是天线、射频模块等,可通过有线或者无线的方式进行数据发送。发射器可以与接收器集成在一起,或独立设计。The communication interface may be a data interface, a U/I interface, etc., and the transmitter may be an antenna, a radio frequency module, etc., and data transmission may be performed in a wired or wireless manner. The transmitter can be integrated with the receiver or designed independently.
其中,存储器1120可以是独立于处理器1110的一个单独的器件,也可以集成在处理器1110中。The memory 1120 may be a separate device independent of the processor 1110, or may be integrated in the processor 1110.
可选的,所述第一指示信息包括所述像素区间段数。Optionally, the first indication information includes the number of segments in the pixel interval.
可选的,所述第一指示信息包括所述像素区间段数与预设值的差值。Optionally, the first indication information includes a difference between the number of segments in the pixel interval and a preset value.
可选的,所述预设值为编码过程中确定的参数,所述码流中还包括用于指示所述预设值的第二指示信息;或,所述预设值为编码前固化到或预设在编码端和解码端的参数。Optionally, the preset value is a parameter determined in the encoding process, and the code stream further includes second indication information for indicating the preset value; or, the preset value is solidified before encoding. Or preset parameters on the encoding side and the decoding side.
可选的,所述预设值包括所述比特深度。Optionally, the preset value includes the bit depth.
可选的,所述码流中还包括第三指示信息和/或第四指示信息;所述第三指示信息用于指示所述待编码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待编码图像对应的有效原始像素区间的最大索引值。Optionally, the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be encoded; the The fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the image to be encoded.
可选的,所述第三指示信息包括所述最小索引值。Optionally, the third indication information includes the minimum index value.
可选的,所述第四指示信息包括所述最大索引值。Optionally, the fourth indication information includes the maximum index value.
可选的,所述第四指示信息包括所述像素区间段数与所述最大索引值的差值。Optionally, the fourth indication information includes a difference between the number of segments in the pixel interval and the maximum index value.
可选的,所述码流中还包括第五指示信息;所述第五指示信息用于指示所述待编码图像对应的有效原始像素区间对应的映射像素区间的区间长度。Optionally, the code stream further includes fifth indication information; the fifth indication information is used to indicate the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the image to be encoded.
可选的,所述第五指示信息包括所述待编码图像对应的有效原始像素区间对应的映射像素区间的区间长度与初始映射区间长度的差值的绝对值及其符号;Optionally, the fifth indication information includes the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-encoded image and the initial mapped interval length and the sign thereof;
所述初始映射区间长度为根据所述像素区间段数确定的。The length of the initial mapping interval is determined according to the number of segments of the pixel interval.
可选的,所述码流中还包括用于指示所述比特深度的第六指示信息。Optionally, the code stream further includes sixth indication information for indicating the bit depth.
可选的,所述处理器1110进一步用于:Optionally, the processor 1110 is further configured to:
根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数;According to the bit depth of the to-be-coded image, determine the number of pixel interval segments corresponding to the to-be-coded image;
基于所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间;determining, based on the number of pixel interval segments, a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-encoded image;
基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进行编码,生成码流。The pixel values of the to-be-encoded image are encoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to generate a code stream.
可选的,所述像素值为亮度像素值。Optionally, the pixel value is a luminance pixel value.
可选的,该编码装置例如可以是编码器、终端(包括但不限于手机、相机、无人机等)、芯片、处理装置等,并且该编码装置可以实现本申请相应实施例中各个编码方法中的相应流程,为了简洁,在此不再赘述。Optionally, the encoding device can be, for example, an encoder, a terminal (including but not limited to a mobile phone, a camera, a drone, etc.), a chip, a processing device, etc., and the encoding device can implement each encoding method in the corresponding embodiment of the present application. The corresponding processes in , for brevity, are not repeated here.
下面将结合图9,介绍一种视频解码装置。如图9所示,该装置1200,包括:存储器1220、处理器1210以及通信接口1230;A video decoding apparatus will be introduced below with reference to FIG. 9 . As shown in FIG. 9 , the apparatus 1200 includes: a memory 1220, a processor 1210, and a communication interface 1230;
所述存储器1220,用于存储程序;the memory 1220 for storing programs;
所述处理器1210,分别与所述存储器1220以及所述通信接口1230耦合,用于执行所述存储器中存储的所述程序,以用于:The processor 1210, respectively coupled to the memory 1220 and the communication interface 1230, is configured to execute the program stored in the memory, so as to:
通过通信接口1230控制所述接收器获取码流;其中,所述码流中包括第一指示信息, 所述第一指示信息用于指示待解码图像对应的像素区间段数,所述像素区间段数是基于所述待解码图像的比特深度确定的;Control the receiver to obtain a code stream through the communication interface 1230; wherein, the code stream includes first indication information, and the first indication information is used to indicate the number of pixel intervals corresponding to the image to be decoded, and the number of pixel intervals is determined based on the bit depth of the to-be-decoded image;
根据所述像素区间段数对所述码流进行解码,获得解码后的图像。The code stream is decoded according to the number of segments in the pixel interval to obtain a decoded image.
可选的,所述第一指示信息包括所述像素区间段数。Optionally, the first indication information includes the number of segments in the pixel interval.
可选的,所述第一指示信息包括所述像素区间段数与预设值的差值。Optionally, the first indication information includes a difference between the number of segments in the pixel interval and a preset value.
可选的,所述预设值为编码过程中确定的参数,所述码流中还包括用于指示所述预设值的第二指示信息;或,所述预设值为编码前固化到或预设在编码端和解码端的参数。Optionally, the preset value is a parameter determined in the encoding process, and the code stream further includes second indication information for indicating the preset value; or, the preset value is solidified before encoding. Or preset parameters on the encoding side and the decoding side.
可选的,所述预设值包括所述比特深度。Optionally, the preset value includes the bit depth.
可选的,所述码流中还包括第三指示信息和/或第四指示信息;所述第三指示信息用于指示所述待解码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待解码图像对应的有效原始像素区间的最大索引值。Optionally, the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be decoded; the The fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the to-be-decoded image.
可选的,所述第三指示信息包括所述最小索引值。Optionally, the third indication information includes the minimum index value.
可选的,所述第四指示信息包括所述最大索引值。Optionally, the fourth indication information includes the maximum index value.
可选的,所述第四指示信息包括所述像素区间段数与所述最大索引值的差值。Optionally, the fourth indication information includes a difference between the number of segments in the pixel interval and the maximum index value.
可选的,所述码流中还包括第五指示信息;所述第五指示信息用于指示所述待解码图像对应的有效原始像素区间对应的映射像素区间的区间长度。Optionally, the code stream further includes fifth indication information; the fifth indication information is used to indicate the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the image to be decoded.
可选的,所述第五指示信息包括所述待解码图像对应的有效原始像素区间对应的映射像素区间的区间长度与初始映射区间长度的差值的绝对值及其符号;Optionally, the fifth indication information includes the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-decoded image and the length of the initial mapped interval and its sign;
所述初始映射区间长度为根据所述像素区间段数确定的。The length of the initial mapping interval is determined according to the number of segments of the pixel interval.
可选的,所述码流中还包括用于指示所述比特深度的第六指示信息。Optionally, the code stream further includes sixth indication information for indicating the bit depth.
可选的,所述处理器1210进一步用于:Optionally, the processor 1210 is further configured to:
基于所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像素区间;determining, based on the number of segments of the pixel interval, a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image;
根据所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像。The code stream is decoded according to the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
可选的,所述处理器1210进一步用于:Optionally, the processor 1210 is further configured to:
根据所述多个原始像素区间和所述多个映射像素区间对所述码流中的亮度像素值进行解码,获得解码后的图像。The luminance pixel values in the code stream are decoded according to the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
可选的,该解码装置例如可以是解码器、终端(包括但不限于手机、相机、无人机等)、芯片、处理装置等,并且该解码装置可以实现本申请相应实施例中各个解码方法中的相应流程,为了简洁,在此不再赘述。Optionally, the decoding device can be, for example, a decoder, a terminal (including but not limited to a mobile phone, a camera, a drone, etc.), a chip, a processing device, etc., and the decoding device can implement each decoding method in the corresponding embodiment of the present application. The corresponding processes in , for brevity, are not repeated here.
下面继续结合图8,介绍另一种视频编码装置。如图8所示,该装置1100,包括:存储器1120、处理器1110以及通信接口1130;The following continues to introduce another video encoding apparatus with reference to FIG. 8 . As shown in FIG. 8 , the apparatus 1100 includes: a memory 1120, a processor 1110, and a communication interface 1130;
所述存储器1120,用于存储程序;the memory 1120 for storing programs;
所述处理器1110,分别与所述存储器1120以及所述通信接口1130耦合,用于执行所述存储器中存储的所述程序,以用于:The processor 1110, respectively coupled to the memory 1120 and the communication interface 1130, is configured to execute the program stored in the memory, so as to:
根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数;According to the bit depth of the to-be-coded image, determine the number of pixel interval segments corresponding to the to-be-coded image;
根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间;According to the number of pixel interval segments, determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-coded image;
基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进行编码,生成码流;encoding the pixel values of the to-be-encoded image based on the multiple original pixel intervals and the multiple mapped pixel intervals to generate a code stream;
通过所述通信接口1130控制发射器发送所述码流。The transmitter is controlled to send the code stream through the communication interface 1130 .
可选的,所述处理器1110进一步用于:Optionally, the processor 1110 is further configured to:
获取预设像素区间段数;Get the number of preset pixel interval segments;
根据待编码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数。According to the bit depth of the image to be encoded, the preset number of segments in the pixel interval is adjusted to obtain the number of segments in the pixel interval.
可选的,所述处理器1110进一步用于:Optionally, the processor 1110 is further configured to:
当待编码图像的比特深度大于比特深度阈值时,对所述预设像素区间段数进行增大处理,得到所述像素区间段数。When the bit depth of the image to be encoded is greater than the bit depth threshold, the preset number of segments in the pixel interval is increased to obtain the number of segments in the pixel interval.
可选的,所述处理器1110进一步用于:Optionally, the processor 1110 is further configured to:
当所述待编码图像的比特深度小于比特深度阈值时,对所述预设像素区间段数进行减小处理,得到所述像素区间段数。When the bit depth of the to-be-encoded image is less than the bit depth threshold, reducing the number of segments in the preset pixel interval is performed to obtain the number of segments in the pixel interval.
可选的,所述处理器1110进一步用于:Optionally, the processor 1110 is further configured to:
根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间;Determine a plurality of original pixel intervals corresponding to the to-be-coded image according to the number of pixel interval segments;
根据所述图像中各像素点的像素值,确定与所述多个原始像素区间一一对应的多个映射像素区间。According to the pixel value of each pixel in the image, a plurality of mapped pixel intervals corresponding to the plurality of original pixel intervals one-to-one is determined.
可选的,所述多个原始像素区间包括第一原始像素区间;所述多个映射像素区间包括与所述第一原始像素区间对应的第一映射像素区间;Optionally, the multiple original pixel intervals include a first original pixel interval; the multiple mapped pixel intervals include a first mapped pixel interval corresponding to the first original pixel interval;
所述处理器1110进一步用于:The processor 1110 is further configured to:
根据所述待编码图像中各像素点的像素值,确定落在所述第一原始像素区间的至少一个像素点;According to the pixel value of each pixel in the to-be-coded image, determine at least one pixel that falls within the first original pixel interval;
综合所述待编码图像中所述至少一个像素点中各像素点所在区域的像素值分布情况,确定所述第一映射像素区间的区间长度;Combining the distribution of pixel values in the region where each pixel is located in the at least one pixel in the image to be encoded, determine the interval length of the first mapped pixel interval;
基于所述第一映射像素区间的区间长度,确定所述第一映射像素区间。The first mapped pixel interval is determined based on the interval length of the first mapped pixel interval.
可选的,所述处理器1110还用于:Optionally, the processor 1110 is further configured to:
根据所述像素区间段数,确定初始映射区间长度;Determine the length of the initial mapping interval according to the number of pixel interval segments;
所述处理器1110进一步用于:The processor 1110 is further configured to:
根据所述待编码图像中所述至少一个像素点中各像素点所在区域的像素值分布方差的平均值,确定调整方向;Determine the adjustment direction according to the average value of the distribution variance of the pixel values in the region where each pixel point is located in the at least one pixel point in the image to be encoded;
根据所述平均值和/或所述至少一个像素点的数量占比,确定调整幅度;Determine the adjustment range according to the average value and/or the number ratio of the at least one pixel point;
根据所述调整方向和调整幅度,对所述初始映射区间长度进行调整,得到所述第一映射像素区间的区间长度。According to the adjustment direction and adjustment range, the length of the initial mapping interval is adjusted to obtain the interval length of the first mapped pixel interval.
可选的,所述多个原始像素区间为多个有效原始像素区间;Optionally, the multiple original pixel intervals are multiple valid original pixel intervals;
所述处理器1110进一步用于:The processor 1110 is further configured to:
按照所述像素区间段数,将基于所述待编码图像的比特深度确定的原始像素取值范围进行划分得到多个像素区间;Divide the original pixel value range determined based on the bit depth of the to-be-encoded image according to the number of pixel interval segments to obtain a plurality of pixel intervals;
根据所述待编码图像的像素值分布情况,从所述多个像素区间中确定出所述多个有效原始像素区间。The plurality of valid original pixel intervals are determined from the plurality of pixel intervals according to the distribution of pixel values of the to-be-coded image.
可选的,所述处理器1110进一步用于:Optionally, the processor 1110 is further configured to:
将所述多个像素区间中与所述待编码图像的像素值分布范围有交集的多个像素区间确定为所述多个有效原始像素区间。A plurality of pixel intervals that have an intersection with the pixel value distribution range of the image to be encoded among the plurality of pixel intervals are determined as the plurality of valid original pixel intervals.
可选的,所述多个映射像素区间与所述多个原始像素区间一一对应;Optionally, the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals;
所述处理器1110进一步用于:The processor 1110 is further configured to:
根据所述多个原始像素区间中各原始像素区间的起终点及其对应的映射像素区间的起终点,确定各原始像素区间对应的映射关系;Determine the mapping relationship corresponding to each original pixel interval according to the start and end points of each original pixel interval in the plurality of original pixel intervals and the corresponding start and end points of the mapped pixel interval;
根据所述待编码图像的原始像素值以及所述映射关系,确定所述待编码图像的映射像素值;According to the original pixel value of the to-be-encoded image and the mapping relationship, determine the mapped pixel value of the to-be-encoded image;
根据所述待编码图像的映射像素值进行编码,生成码流。The encoding is performed according to the mapped pixel values of the to-be-encoded image to generate a code stream.
可选的,所述处理器1110进一步用于:Optionally, the processor 1110 is further configured to:
根据所述待编码图像的原始像素值及其所在的原始像素区间对应的映射关系,确定所述待编码图像的映射像素值。The mapped pixel value of the to-be-encoded image is determined according to the mapping relationship corresponding to the original pixel value of the to-be-encoded image and its original pixel interval.
可选的,所述像素值为亮度像素值。Optionally, the pixel value is a luminance pixel value.
可选的,该编码装置例如可以是编码器、终端(包括但不限于手机、相机、无人机等),并且该编码装置可以实现本申请相应实施例中各个编码方法中的相应流程,为了简洁,在此不再赘述。Optionally, the encoding device can be, for example, an encoder, a terminal (including but not limited to a mobile phone, a camera, an unmanned aerial vehicle, etc.), and the encoding device can implement the corresponding processes in the encoding methods in the corresponding embodiments of the present application, in order to It is concise and will not be repeated here.
下面继续结合图9,介绍另一种视频解码装置。如图9所示,该装置1200,包括:存储器1220、处理器1210以及通信接口1230;The following continues to introduce another video decoding apparatus with reference to FIG. 9 . As shown in FIG. 9 , the apparatus 1200 includes: a memory 1220, a processor 1210, and a communication interface 1230;
所述存储器1220,用于存储程序;the memory 1220 for storing programs;
所述处理器1210,分别与所述存储器1220以及所述通信接口1230耦合,用于执行所述存储器中存储的所述程序,以用于:The processor 1210, respectively coupled to the memory 1220 and the communication interface 1230, is configured to execute the program stored in the memory, so as to:
通过通信接口1230控制接收器获取码流;Control the receiver to obtain the code stream through the communication interface 1230;
根据待解码图像的比特深度,确定所述待解码图像对应的像素区间段数;Determine the number of pixel interval segments corresponding to the to-be-decoded image according to the bit depth of the to-be-decoded image;
根据所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像素区间;According to the number of pixel interval segments, determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image;
基于所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像。The code stream is decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
可选的,所述处理器1210进一步用于:Optionally, the processor 1210 is further configured to:
获取预设像素区间段数;Get the number of preset pixel interval segments;
根据待解码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数。According to the bit depth of the image to be decoded, the preset number of pixel intervals is adjusted to obtain the number of pixel intervals.
可选的,所述处理器1210进一步用于:Optionally, the processor 1210 is further configured to:
当待解码图像的比特深度大于比特深度阈值时,对所述预设像素区间段数进行增大处理,得到所述像素区间段数。When the bit depth of the image to be decoded is greater than the bit depth threshold, the preset number of segments in the pixel interval is increased to obtain the number of segments in the pixel interval.
可选的,所述处理器1210进一步用于:Optionally, the processor 1210 is further configured to:
当所述待解码图像的比特深度小于比特深度阈值时,对所述预设像素区间段数进行减小处理,得到所述像素区间段数。When the bit depth of the to-be-decoded image is less than the bit depth threshold, reducing the number of segments in the preset pixel interval is performed to obtain the number of segments in the pixel interval.
可选的,所述多个映射像素区间与所述多个原始像素区间一一对应;所述原始像素区间为有效原始像素区间;Optionally, the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals; the original pixel intervals are valid original pixel intervals;
所述码流中包括第三指示信息、第四指示信息以及第五指示信息;所述第三指示信息用于指示所述待解码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待解码图像对应的有效原始像素区间的最大索引值;所述第五指示信息用于指示所述多个映射像素区间的区间长度;The code stream includes third indication information, fourth indication information and fifth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be decoded; the fourth indication information The indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the image to be decoded; the fifth indication information is used to indicate the interval length of the plurality of mapped pixel intervals;
所述处理器1210进一步用于:The processor 1210 is further configured to:
根据所述像素区间段数,确定原始像素区间长度;Determine the length of the original pixel interval according to the number of segments of the pixel interval;
根据所述原始像素区间长度、所述最小索引值以及所述最大索引值,确定所述多个有效原始像素区间;determining the plurality of valid original pixel intervals according to the length of the original pixel interval, the minimum index value and the maximum index value;
根据所述多个映射像素区间的区间长度,确定所述多个映射像素区间。The plurality of mapped pixel intervals are determined according to the interval lengths of the plurality of mapped pixel intervals.
可选的,所述码流中还包括第六指示信息;所述第六指示信息用于指示所述比特深度;Optionally, the code stream further includes sixth indication information; the sixth indication information is used to indicate the bit depth;
所述处理器1210进一步用于:The processor 1210 is further configured to:
根据所述比特深度与所述像素区间段数,确定原始像素区间长度。The length of the original pixel interval is determined according to the bit depth and the number of segments of the pixel interval.
可选的,所述处理器1210进一步用于:Optionally, the processor 1210 is further configured to:
对所述码流进行解码,得到所述待解码图像的映射像素值;Decoding the code stream to obtain the mapped pixel value of the to-be-decoded image;
根据所述多个原始像素区间中各原始像素区间的起终点及其对应的映射像素区间的起终点,确定各原始像素区间对应的映射关系;Determine the mapping relationship corresponding to each original pixel interval according to the start and end points of each original pixel interval in the plurality of original pixel intervals and the corresponding start and end points of the mapped pixel interval;
根据所述待解码图像的映射像素值及其所在的映射像素区间对应的原始像素区间的映射关系,确定所述待解码图像的原始像素值。The original pixel value of the to-be-decoded image is determined according to the mapping relationship between the mapped pixel value of the to-be-decoded image and the original pixel interval corresponding to the mapped pixel interval in which the image is to be decoded.
可选的,所述处理器1210进一步用于:Optionally, the processor 1210 is further configured to:
基于所述多个原始像素区间和所述多个映射像素区间对所述码流中的亮度像素值进行解码,获得解码后的图像。The luminance pixel values in the code stream are decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
可选的,该解码装置例如可以是解码器、终端(包括但不限于手机、相机、无人机等),并且该解码装置可以实现本申请相应实施例中各个解码方法中的相应流程,为了简洁,在此不再赘述。Optionally, the decoding device can be, for example, a decoder, a terminal (including but not limited to a mobile phone, a camera, an unmanned aerial vehicle, etc.), and the decoding device can implement the corresponding processes in the decoding methods in the corresponding embodiments of the present application, in order to It is concise and will not be repeated here.
应理解,本申请实施例的处理器可能是一种视频处理***,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。It should be understood that the processor in this embodiment of the present application may be a video processing system, which has a signal processing capability. In the implementation process, each step of the above method embodiments may be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software. The above-mentioned processor can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available Programming logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM, EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本文描述的***和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Wherein, the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which acts as an external cache. By way of illustration and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) ) and direct memory bus random access memory (Direct Rambus RAM, DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but not be limited to, these and any other suitable types of memory.
本申请实施例中的存储器可以向处理器提供指令和数据。存储器的一部分还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。该处理器可以用于执行存储器中存储的指令,并且该处理器执行该指令时,该处理器可以执行上述方法实施例中的各个步骤。The memory in the embodiments of the present application may provide instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store device type information. The processor may be configured to execute the instructions stored in the memory, and when the processor executes the instructions, the processor may execute various steps in the above method embodiments.
在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器执行存储器中的指令,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。In the implementation process, each step of the above-mentioned method can be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software. The steps of the methods disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory, and the processor executes the instructions in the memory, and completes the steps of the above method in combination with its hardware. To avoid repetition, detailed description is omitted here.
本申请实施例还提供了一种电子设备。该电子设备包括上述各实施例中视频编码装置以及所述发射器。视频编码装置的具体结构及其处理流程可参见上述各实施例中相应内容,在此不再赘述。The embodiments of the present application also provide an electronic device. The electronic device includes the video encoding apparatus in each of the above embodiments and the transmitter. For the specific structure of the video encoding apparatus and the processing flow thereof, reference may be made to the corresponding contents in the foregoing embodiments, and details are not described herein again.
本申请实施例还提供了一种电子设备。该电子设备包括上述各实施例中视频解码装置及所述接收器。视频解码装置的具体结构及其处理流程可参见上述各实施例中相应内容,在此不再赘述。The embodiments of the present application also provide an electronic device. The electronic device includes the video decoding apparatus and the receiver in the above embodiments. For the specific structure of the video decoding apparatus and the processing flow thereof, reference may be made to the corresponding contents in the foregoing embodiments, which will not be repeated here.
本申请实施例还提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得所述计算机实现上述各实施例中任一项视频编码方法或视频解码方法。具体实现流程可参见上述各实施例中相应内容,在此不再赘述。Embodiments of the present application further provide a computer-readable storage medium, including instructions, which, when executed on a computer, enable the computer to implement any one of the video encoding methods or the video decoding methods in the foregoing embodiments. For the specific implementation process, reference may be made to the corresponding content in the foregoing embodiments, and details are not described herein again.
本申请实施例还提供了一种视频编解码***,包括:编码端设备和解码端设备;Embodiments of the present application also provide a video encoding and decoding system, including: an encoding end device and a decoding end device;
所述编码端设备,包括上述包括视频编码装置及所述发射器的电子设备;The encoding terminal equipment includes the above-mentioned electronic equipment including the video encoding device and the transmitter;
所述解码端设备,包括上述包括视频解码装置及所述接收器的电子设备。The decoding end device includes the above-mentioned electronic device including a video decoding device and the receiver.
其中,编码端设备和解码端设备可以为手机、电脑、无人机等设备。上述编码端设备和解码端设备的处理流程可参见上述各实施例中相应内容,在此不再赘述。Among them, the encoding end device and the decoding end device may be mobile phones, computers, drones and other devices. For the processing flow of the encoding end device and the decoding end device, reference may be made to the corresponding content in the foregoing embodiments, and details are not described herein again.
以上各个实施例中的技术方案、技术特征在与本相冲突的情况下均可以单独,或者进行组合,只要未超出本领域技术人员的认知范围,均属于本申请保护范围内的等同实施例。The technical solutions and technical features in the above embodiments can be used alone or combined in the case of conflict with the present invention, as long as they do not exceed the cognitive scope of those skilled in the art, they all belong to the equivalent embodiments within the protection scope of the present application .
以上所述仅为本申请的实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the embodiments of the present application, and are not intended to limit the scope of the patent of the present application. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present application, or directly or indirectly applied to other related technologies Fields are similarly included within the scope of patent protection of this application.
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然 可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features thereof can be equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present invention. scope.

Claims (101)

  1. 一种视频编码方法,其特征在于,包括:A video coding method, comprising:
    对待编码图像进行编码,获得码流;其中,所述码流中包括第一指示信息,所述第一指示信息用于指示所述待编码图像对应的像素区间段数,所述像素区间段数是基于所述待编码图像的比特深度确定的;Encoding the to-be-coded image to obtain a code stream; wherein the code stream includes first indication information, where the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-coded image, and the pixel interval segment number is based on The bit depth of the to-be-coded image is determined;
    发送所述码流。Send the code stream.
  2. 根据权利要求1所述的方法,其特征在于,所述第一指示信息包括所述像素区间段数。The method according to claim 1, wherein the first indication information includes the number of segments in the pixel interval.
  3. 根据权利要求1所述的方法,其特征在于,所述第一指示信息包括所述像素区间段数与预设值的差值。The method according to claim 1, wherein the first indication information comprises a difference between the number of segments in the pixel interval and a preset value.
  4. 根据权利要求3所述的方法,其特征在于,所述预设值为编码过程中确定的参数,所述码流中还包括用于指示所述预设值的第二指示信息;或,所述预设值为编码前固化到或预设在编码端和解码端的参数。The method according to claim 3, wherein the preset value is a parameter determined in an encoding process, and the code stream further includes second indication information for indicating the preset value; or, the The preset value is a parameter that is solidified or preset at the encoding end and the decoding end before encoding.
  5. 根据权利要求4所述的方法,其特征在于,所述预设值包括所述比特深度。The method of claim 4, wherein the preset value comprises the bit depth.
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述码流中还包括第三指示信息和/或第四指示信息;所述第三指示信息用于指示所述待编码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待编码图像对应的有效原始像素区间的最大索引值。The method according to any one of claims 1 to 5, wherein the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the The minimum index value of the valid original pixel interval corresponding to the coded image; the fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the to-be-coded image.
  7. 根据权利要求6所述的方法,其特征在于,所述第三指示信息包括所述最小索引值。The method according to claim 6, wherein the third indication information includes the minimum index value.
  8. 根据权利要求6所述的方法,其特征在于,所述第四指示信息包括所述最大索引值。The method according to claim 6, wherein the fourth indication information includes the maximum index value.
  9. 根据权利要求6所述的方法,其特征在于,所述第四指示信息包括所述像素区间段数与所述最大索引值的差值。The method according to claim 6, wherein the fourth indication information comprises a difference between the number of segments in the pixel interval and the maximum index value.
  10. 根据权利要求1至9中任一项所述的方法,其特征在于,所述码流中还包括第五指示信息;所述第五指示信息用于指示所述待编码图像对应的有效原始像素区间对应的映射像素区间的区间长度。The method according to any one of claims 1 to 9, wherein the code stream further includes fifth indication information; the fifth indication information is used to indicate valid original pixels corresponding to the to-be-coded image The interval length of the mapped pixel interval corresponding to the interval.
  11. 根据权利要求10所述的方法,其特征在于,所述第五指示信息包括所述待编码图像对应的有效原始像素区间对应的映射像素区间的区间长度与初始映射区间长度的差值的绝对值及其符号;The method according to claim 10, wherein the fifth indication information comprises the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-encoded image and the length of the initial mapped interval and its symbols;
    所述初始映射区间长度为根据所述像素区间段数确定的。The length of the initial mapping interval is determined according to the number of segments of the pixel interval.
  12. 根据权利要求1至11中任一项所述的方法,其特征在于所述码流中还包括用于指示所述比特深度的第六指示信息。The method according to any one of claims 1 to 11, wherein the code stream further includes sixth indication information for indicating the bit depth.
  13. 根据权利要求1至12中任一项所述的方法,其特征在于,对待编码图像进行编码,获得码流,包括:The method according to any one of claims 1 to 12, wherein encoding the image to be encoded to obtain a code stream, comprising:
    根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数;According to the bit depth of the to-be-coded image, determine the number of pixel interval segments corresponding to the to-be-coded image;
    基于所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间;determining, based on the number of pixel interval segments, a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-encoded image;
    基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进 行编码,生成码流。The pixel values of the to-be-encoded image are encoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to generate a code stream.
  14. 根据权利要求13所述的方法,其特征在于,所述像素值为亮度像素值。The method of claim 13, wherein the pixel value is a luminance pixel value.
  15. 一种视频解码方法,其特征在于,包括:A video decoding method, comprising:
    获取码流;其中,所述码流中包括第一指示信息,所述第一指示信息用于指示待解码图像对应的像素区间段数,所述像素区间段数是基于所述待解码图像的比特深度确定的;Acquire a code stream; wherein, the code stream includes first indication information, and the first indication information is used to indicate the number of pixel interval segments corresponding to the image to be decoded, and the number of pixel interval segments is based on the bit depth of the to-be-decoded image definite;
    根据所述像素区间段数对所述码流进行解码,获得解码后的图像。The code stream is decoded according to the number of segments in the pixel interval to obtain a decoded image.
  16. 根据权利要求15所述的方法,其特征在于,所述第一指示信息包括所述像素区间段数。The method according to claim 15, wherein the first indication information comprises the number of segments in the pixel interval.
  17. 根据权利要求15所述的方法,其特征在于,所述第一指示信息包括所述像素区间段数与预设值的差值。The method according to claim 15, wherein the first indication information comprises a difference between the number of segments in the pixel interval and a preset value.
  18. 根据权利要求17所述的方法,其特征在于,所述预设值为编码过程中确定的参数,所述码流中还包括用于指示所述预设值的第二指示信息;或,所述预设值为编码前固化到或预设在编码端和解码端的参数。The method according to claim 17, wherein the preset value is a parameter determined in an encoding process, and the code stream further includes second indication information for indicating the preset value; or, the The preset value is a parameter that is solidified or preset at the encoding end and the decoding end before encoding.
  19. 根据权利要求18所述的方法,其特征在于,所述预设值包括所述比特深度。The method of claim 18, wherein the preset value comprises the bit depth.
  20. 根据权利要求15至19中任一项所述的方法,其特征在于,所述码流中还包括第三指示信息和/或第四指示信息;所述第三指示信息用于指示所述待解码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待解码图像对应的有效原始像素区间的最大索引值。The method according to any one of claims 15 to 19, wherein the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the The minimum index value of the valid original pixel interval corresponding to the decoded image; the fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the to-be-decoded image.
  21. 根据权利要求20所述的方法,其特征在于,所述第三指示信息包括所述最小索引值。The method according to claim 20, wherein the third indication information includes the minimum index value.
  22. 根据权利要求20所述的方法,其特征在于,所述第四指示信息包括所述最大索引值。The method according to claim 20, wherein the fourth indication information includes the maximum index value.
  23. 根据权利要求20所述的方法,其特征在于,所述第四指示信息包括所述像素区间段数与所述最大索引值的差值。The method according to claim 20, wherein the fourth indication information comprises a difference between the number of segments in the pixel interval and the maximum index value.
  24. 根据权利要求15至23中任一项所述的方法,其特征在于,所述码流中还包括第五指示信息;所述第五指示信息用于指示所述待解码图像对应的有效原始像素区间对应的映射像素区间的区间长度。The method according to any one of claims 15 to 23, wherein the code stream further includes fifth indication information; the fifth indication information is used to indicate valid original pixels corresponding to the image to be decoded The interval length of the mapped pixel interval corresponding to the interval.
  25. 根据权利要求24所述的方法,其特征在于,所述第五指示信息包括所述待解码图像对应的有效原始像素区间对应的映射像素区间的区间长度与初始映射区间长度的差值的绝对值及其符号;The method according to claim 24, wherein the fifth indication information comprises the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-decoded image and the length of the initial mapped interval and its symbols;
    所述初始映射区间长度为根据所述像素区间段数确定的。The length of the initial mapping interval is determined according to the number of segments of the pixel interval.
  26. 根据权利要求15至25中任一项所述的方法,其特征在于,所述码流中还包括用于指示所述比特深度的第六指示信息。The method according to any one of claims 15 to 25, wherein the code stream further includes sixth indication information for indicating the bit depth.
  27. 根据权利要求15至26中任一项所述的方法,其特征在于,根据所述像素区间段数对所述码流进行解码,获得解码后的图像,包括:The method according to any one of claims 15 to 26, wherein the code stream is decoded according to the number of segments in the pixel interval to obtain a decoded image, comprising:
    基于所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像素区间;determining, based on the number of segments of the pixel interval, a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image;
    根据所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像。The code stream is decoded according to the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  28. 根据权利要求27所述的方法,其特征在于,根据所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像,包括:The method according to claim 27, wherein decoding the code stream according to the multiple original pixel intervals and the multiple mapped pixel intervals to obtain a decoded image, comprising:
    根据所述多个原始像素区间和所述多个映射像素区间对所述码流中的亮度像素值进行解码,获得解码后的图像。The luminance pixel values in the code stream are decoded according to the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  29. 一种视频编码方法,其特征在于,包括:A video coding method, comprising:
    根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数;According to the bit depth of the to-be-coded image, determine the number of pixel interval segments corresponding to the to-be-coded image;
    根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间;According to the number of pixel interval segments, determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-coded image;
    基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进行编码,生成码流;encoding the pixel values of the to-be-encoded image based on the multiple original pixel intervals and the multiple mapped pixel intervals to generate a code stream;
    发送所述码流。Send the code stream.
  30. 根据权利要求29所述的方法,其特征在于,根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数,包括:The method according to claim 29, wherein determining the number of pixel interval segments corresponding to the to-be-coded image according to the bit depth of the to-be-coded image, comprising:
    获取预设像素区间段数;Get the number of preset pixel interval segments;
    根据待编码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数。According to the bit depth of the image to be encoded, the preset number of segments in the pixel interval is adjusted to obtain the number of segments in the pixel interval.
  31. 根据权利要求30所述的方法,其特征在于,根据待编码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数,包括:The method according to claim 30, wherein, according to the bit depth of the image to be encoded, the preset number of pixel intervals is adjusted to obtain the number of pixel intervals, comprising:
    当待编码图像的比特深度大于比特深度阈值时,对所述预设像素区间段数进行增大处理,得到所述像素区间段数。When the bit depth of the image to be encoded is greater than the bit depth threshold, the preset number of segments in the pixel interval is increased to obtain the number of segments in the pixel interval.
  32. 根据权利要求30所述的方法,其特征在于,根据待编码图像的比特深度,对所述预设区间段数进行调整,得到所述区间段数,包括:The method according to claim 30, wherein, according to the bit depth of the image to be encoded, the preset number of segments is adjusted to obtain the number of segments, comprising:
    当所述待编码图像的比特深度小于比特深度阈值时,对所述预设像素区间段数进行减小处理,得到所述像素区间段数。When the bit depth of the to-be-encoded image is less than the bit depth threshold, reducing the number of segments in the preset pixel interval is performed to obtain the number of segments in the pixel interval.
  33. 根据权利要求29到32中任一项所述的方法,其特征在于,基于所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间,包括:The method according to any one of claims 29 to 32, wherein, based on the number of pixel interval segments, determining multiple original pixel intervals and multiple mapped pixel intervals corresponding to the to-be-encoded image, comprising:
    根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间;Determine a plurality of original pixel intervals corresponding to the to-be-coded image according to the number of pixel interval segments;
    根据所述图像中各像素点的像素值,确定与所述多个原始像素区间一一对应的多个映射像素区间。According to the pixel value of each pixel in the image, a plurality of mapped pixel intervals corresponding to the plurality of original pixel intervals one-to-one is determined.
  34. 根据权利要求33所述的方法,其特征在于,所述多个原始像素区间包括第一原始像素区间;所述多个映射像素区间包括与所述第一原始像素区间对应的第一映射像素区间;The method according to claim 33, wherein the plurality of original pixel intervals comprise a first original pixel interval; the plurality of mapped pixel intervals comprise a first mapped pixel interval corresponding to the first original pixel interval ;
    根据所述待编码图像中各像素点的像素值,确定与所述第一原始像素区间对应的第一映射像素区间,包括:According to the pixel value of each pixel in the to-be-encoded image, determining the first mapped pixel interval corresponding to the first original pixel interval, including:
    根据所述待编码图像中各像素点的像素值,确定落在所述第一原始像素区间的至少一个像素点;According to the pixel value of each pixel in the to-be-coded image, determine at least one pixel that falls within the first original pixel interval;
    综合所述待编码图像中所述至少一个像素点中各像素点所在区域的像素值分布情况,确定所述第一映射像素区间的区间长度;Combining the distribution of pixel values in the region where each pixel is located in the at least one pixel in the image to be encoded, determine the interval length of the first mapped pixel interval;
    基于所述第一映射像素区间的区间长度,确定所述第一映射像素区间。The first mapped pixel interval is determined based on the interval length of the first mapped pixel interval.
  35. 根据权利要求34所述的方法,其特征在于,还包括:The method of claim 34, further comprising:
    根据所述像素区间段数,确定初始映射区间长度;Determine the length of the initial mapping interval according to the number of pixel interval segments;
    综合所述待编码图像中所述至少一个像素点中各像素点所在区域的像素值分布情况,确定所述第一映射像素区间的区间长度,包括:By synthesizing the distribution of pixel values in the region where each pixel is located in the at least one pixel in the image to be encoded, determining the interval length of the first mapped pixel interval, including:
    根据所述待编码图像中所述至少一个像素点中各像素点所在区域的像素值分布方差的平均值,确定调整方向;Determine the adjustment direction according to the average value of the distribution variance of the pixel values in the region where each pixel point is located in the at least one pixel point in the image to be encoded;
    根据所述平均值和/或所述至少一个像素点的数量占比,确定调整幅度;Determine the adjustment range according to the average value and/or the number ratio of the at least one pixel point;
    根据所述调整方向和调整幅度,对所述初始映射区间长度进行调整,得到所述第一映射像素区间的区间长度。According to the adjustment direction and adjustment range, the length of the initial mapping interval is adjusted to obtain the interval length of the first mapped pixel interval.
  36. 根据权利要求29到35中任一项所述的方法,其特征在于,所述多个原始像素区间为多个有效原始像素区间;The method according to any one of claims 29 to 35, wherein the multiple original pixel intervals are multiple valid original pixel intervals;
    根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间,包括:According to the number of pixel interval segments, determine a plurality of original pixel intervals corresponding to the to-be-coded image, including:
    按照所述像素区间段数,将基于所述待编码图像的比特深度确定的原始像素取值范围进行划分得到多个像素区间;Divide the original pixel value range determined based on the bit depth of the to-be-encoded image according to the number of pixel interval segments to obtain a plurality of pixel intervals;
    根据所述待编码图像的像素值分布情况,从所述多个像素区间中确定出所述多个有效原始像素区间。The plurality of valid original pixel intervals are determined from the plurality of pixel intervals according to the distribution of pixel values of the to-be-coded image.
  37. 根据权利要求36所述的方法,其特征在于,根据所述待编码图像的像素值分布情况,从所述多个像素区间中确定出所述多个有效原始像素区间,包括:The method according to claim 36, wherein, according to the pixel value distribution of the to-be-encoded image, determining the plurality of valid original pixel intervals from the plurality of pixel intervals, comprising:
    将所述多个像素区间中与所述待编码图像的像素值分布范围有交集的多个像素区间确定为所述多个有效原始像素区间。A plurality of pixel intervals that have an intersection with the pixel value distribution range of the image to be encoded among the plurality of pixel intervals are determined as the plurality of valid original pixel intervals.
  38. 根据权利要求29至37中任一项所述的方法,其特征在于,所述多个映射像素区间与所述多个原始像素区间一一对应;The method according to any one of claims 29 to 37, wherein the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals;
    基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进行编码,生成码流,包括:Encoding pixel values of the to-be-encoded image based on the multiple original pixel intervals and the multiple mapped pixel intervals to generate a code stream, including:
    根据所述多个原始像素区间中各原始像素区间的起终点及其对应的映射像素区间的起终点,确定各原始像素区间对应的映射关系;Determine the mapping relationship corresponding to each original pixel interval according to the start and end points of each original pixel interval in the plurality of original pixel intervals and the corresponding start and end points of the mapped pixel interval;
    根据所述待编码图像的原始像素值以及所述映射关系,确定所述待编码图像的映射像素值;According to the original pixel value of the to-be-encoded image and the mapping relationship, determine the mapped pixel value of the to-be-encoded image;
    根据所述待编码图像的映射像素值进行编码,生成码流。The encoding is performed according to the mapped pixel values of the to-be-encoded image to generate a code stream.
  39. 根据权利要求38所述的方法,其特征在于,根据所述待编码图像的原始像素值以及所述映射关系,确定所述待编码图像的映射像素值,包括:The method according to claim 38, wherein determining the mapped pixel value of the to-be-coded image according to the original pixel value of the to-be-coded image and the mapping relationship comprises:
    根据所述待编码图像的原始像素值及其所在的原始像素区间对应的映射关系,确定所述待编码图像的映射像素值。The mapped pixel value of the to-be-encoded image is determined according to the mapping relationship corresponding to the original pixel value of the to-be-encoded image and its original pixel interval.
  40. 根据权利要求29到39中任一项所述的方法,其特征在于,所述像素值为亮度像素值。The method according to any one of claims 29 to 39, wherein the pixel value is a luminance pixel value.
  41. 一种视频解码方法,其特征在于,包括:A video decoding method, comprising:
    获取码流;Get the code stream;
    根据待解码图像的比特深度,确定所述待解码图像对应的像素区间段数;Determine the number of pixel interval segments corresponding to the to-be-decoded image according to the bit depth of the to-be-decoded image;
    根据所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像 素区间;Determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image according to the number of segments of the pixel interval;
    基于所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像。The code stream is decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  42. 根据权利要求41所述的方法,其特征在于,根据待解码图像的比特深度,确定所述待解码图像对应的像素区间段数,包括:The method according to claim 41, wherein determining the number of pixel interval segments corresponding to the to-be-decoded image according to the bit depth of the to-be-decoded image, comprising:
    获取预设像素区间段数;Get the number of preset pixel interval segments;
    根据待解码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数。According to the bit depth of the image to be decoded, the preset number of pixel intervals is adjusted to obtain the number of pixel intervals.
  43. 根据权利要求42所述的方法,其特征在于,根据待解码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数,包括:The method according to claim 42, wherein, according to the bit depth of the image to be decoded, the preset number of pixel interval segments is adjusted to obtain the pixel interval segment number, comprising:
    当待解码图像的比特深度大于比特深度阈值时,对所述预设像素区间段数进行增大处理,得到所述像素区间段数。When the bit depth of the image to be decoded is greater than the bit depth threshold, the preset number of segments in the pixel interval is increased to obtain the number of segments in the pixel interval.
  44. 根据权利要求42所述的方法,其特征在于,根据待解码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数,包括:The method according to claim 42, wherein, according to the bit depth of the image to be decoded, the preset number of pixel interval segments is adjusted to obtain the pixel interval segment number, comprising:
    当所述待解码图像的比特深度小于比特深度阈值时,对所述预设像素区间段数进行减小处理,得到所述像素区间段数。When the bit depth of the to-be-decoded image is less than the bit depth threshold, reducing the number of segments in the preset pixel interval is performed to obtain the number of segments in the pixel interval.
  45. 根据权利要求41至44中任一项所述的方法,其特征在于,所述多个映射像素区间与所述多个原始像素区间一一对应;所述原始像素区间为有效原始像素区间;The method according to any one of claims 41 to 44, wherein the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals; the original pixel intervals are valid original pixel intervals;
    所述码流中包括第三指示信息、第四指示信息以及第五指示信息;所述第三指示信息用于指示所述待解码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待解码图像对应的有效原始像素区间的最大索引值;所述第五指示信息用于指示所述多个映射像素区间的区间长度;The code stream includes third indication information, fourth indication information and fifth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be decoded; the fourth indication information The indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the image to be decoded; the fifth indication information is used to indicate the interval length of the plurality of mapped pixel intervals;
    根据所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像素区间,包括:According to the number of pixel interval segments, determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image, including:
    根据所述像素区间段数,确定原始像素区间长度;Determine the length of the original pixel interval according to the number of segments of the pixel interval;
    根据所述原始像素区间长度、所述最小索引值以及所述最大索引值,确定所述多个有效原始像素区间;determining the plurality of valid original pixel intervals according to the length of the original pixel interval, the minimum index value and the maximum index value;
    根据所述多个映射像素区间的区间长度,确定所述多个映射像素区间。The plurality of mapped pixel intervals are determined according to the interval lengths of the plurality of mapped pixel intervals.
  46. 根据权利要求45所述的方法,其特征在于,所述码流中还包括第六指示信息;所述第六指示信息用于指示所述比特深度;The method according to claim 45, wherein the code stream further includes sixth indication information; the sixth indication information is used to indicate the bit depth;
    根据所述像素区间段数,确定原始像素区间长度,包括:According to the number of pixel interval segments, determine the length of the original pixel interval, including:
    根据所述比特深度与所述像素区间段数,确定原始像素区间长度。The length of the original pixel interval is determined according to the bit depth and the number of segments of the pixel interval.
  47. 根据权利要求41至46中任一项所述的方法,其特征在于,基于所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像,包括:The method according to any one of claims 41 to 46, wherein the code stream is decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image, comprising: :
    对所述码流进行解码,得到所述待解码图像的映射像素值;Decoding the code stream to obtain the mapped pixel value of the to-be-decoded image;
    根据所述多个原始像素区间中各原始像素区间的起终点及其对应的映射像素区间的起终点,确定各原始像素区间对应的映射关系;Determine the mapping relationship corresponding to each original pixel interval according to the start and end points of each original pixel interval in the plurality of original pixel intervals and the corresponding start and end points of the mapped pixel interval;
    根据所述待解码图像的映射像素值及其所在的映射像素区间对应的原始像素区间的映射关系,确定所述待解码图像的原始像素值。The original pixel value of the to-be-decoded image is determined according to the mapping relationship between the mapped pixel value of the to-be-decoded image and the original pixel interval corresponding to the mapped pixel interval in which the image is to be decoded.
  48. 根据权利要求41到47中任一项所述的方法,其特征在于,所述基于所述多个原 始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像,包括:The method according to any one of claims 41 to 47, wherein the code stream is decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image ,include:
    基于所述多个原始像素区间和所述多个映射像素区间对所述码流中的亮度像素值进行解码,获得解码后的图像。The luminance pixel values in the code stream are decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  49. 一种视频编码装置,其特征在于,包括:存储器与处理器;A video encoding device, comprising: a memory and a processor;
    所述存储器,用于存储程序;the memory for storing programs;
    所述处理器,与所述存储器耦合,用于执行所述存储器中存储的所述程序,以用于:The processor, coupled to the memory, executes the program stored in the memory for:
    对待编码图像进行编码,获得码流;其中,所述码流中包括第一指示信息,所述第一指示信息用于指示所述待编码图像对应的像素区间段数,所述像素区间段数是基于所述待编码图像的比特深度确定的;Encoding the to-be-coded image to obtain a code stream; wherein the code stream includes first indication information, where the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-coded image, and the pixel interval segment number is based on The bit depth of the to-be-coded image is determined;
    控制发射器发送所述码流。The transmitter is controlled to send the code stream.
  50. 根据权利要求49所述的装置,其特征在于,所述第一指示信息包括所述像素区间段数。The apparatus according to claim 49, wherein the first indication information includes the number of segments in the pixel interval.
  51. 根据权利要求49所述的装置,其特征在于,所述第一指示信息包括所述像素区间段数与预设值的差值。The device according to claim 49, wherein the first indication information comprises a difference between the number of segments in the pixel interval and a preset value.
  52. 根据权利要求51所述的装置,其特征在于,所述预设值为编码过程中确定的参数,所述码流中还包括用于指示所述预设值的第二指示信息;或,所述预设值为编码前固化到或预设在编码端和解码端的参数。The apparatus according to claim 51, wherein the preset value is a parameter determined in an encoding process, and the code stream further includes second indication information for indicating the preset value; or, the The preset value is a parameter that is solidified or preset at the encoding end and the decoding end before encoding.
  53. 根据权利要求51所述的装置,其特征在于,所述预设值包括所述比特深度。The apparatus of claim 51, wherein the preset value comprises the bit depth.
  54. 根据权利要求49至53中任一项所述的装置,其特征在于,所述码流中还包括第三指示信息和/或第四指示信息;所述第三指示信息用于指示所述待编码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待编码图像对应的有效原始像素区间的最大索引值。The apparatus according to any one of claims 49 to 53, wherein the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the The minimum index value of the valid original pixel interval corresponding to the coded image; the fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the to-be-coded image.
  55. 根据权利要求54所述的装置,其特征在于,所述第三指示信息包括所述最小索引值。The apparatus according to claim 54, wherein the third indication information comprises the minimum index value.
  56. 根据权利要求54所述的装置,其特征在于,所述第四指示信息包括所述最大索引值。The apparatus according to claim 54, wherein the fourth indication information includes the maximum index value.
  57. 根据权利要求54所述的装置,其特征在于,所述第四指示信息包括所述像素区间段数与所述最大索引值的差值。The apparatus according to claim 54, wherein the fourth indication information comprises a difference between the number of segments in the pixel interval and the maximum index value.
  58. 根据权利要求49至57中任一项所述的装置,其特征在于,所述码流中还包括第五指示信息;所述第五指示信息用于指示所述待编码图像对应的有效原始像素区间对应的映射像素区间的区间长度。The apparatus according to any one of claims 49 to 57, wherein the code stream further includes fifth indication information; the fifth indication information is used to indicate valid original pixels corresponding to the image to be encoded The interval length of the mapped pixel interval corresponding to the interval.
  59. 根据权利要求58所述的装置,其特征在于,所述第五指示信息包括所述待编码图像对应的有效原始像素区间对应的映射像素区间的区间长度与初始映射区间长度的差值的绝对值及其符号;The apparatus according to claim 58, wherein the fifth indication information comprises the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-encoded image and the length of the initial mapped interval and its symbols;
    所述初始映射区间长度为根据所述像素区间段数确定的。The length of the initial mapping interval is determined according to the number of segments of the pixel interval.
  60. 根据权利要求49至59中任一项所述的装置,其特征在于所述码流中还包括用于指示所述比特深度的第六指示信息。The apparatus according to any one of claims 49 to 59, wherein the code stream further includes sixth indication information for indicating the bit depth.
  61. 根据权利要求49至60中任一项所述的装置,其特征在于,所述处理器进一步用于:The apparatus of any one of claims 49 to 60, wherein the processor is further configured to:
    根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数;According to the bit depth of the to-be-coded image, determine the number of pixel interval segments corresponding to the to-be-coded image;
    基于所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间;determining, based on the number of pixel interval segments, a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-encoded image;
    基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进行编码,生成码流。The pixel values of the to-be-encoded image are encoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to generate a code stream.
  62. 根据权利要求61所述的装置,其特征在于,所述像素值为亮度像素值。The device of claim 61, wherein the pixel value is a luminance pixel value.
  63. 一种视频解码装置,其特征在于,包括:存储器与处理器;A video decoding device, comprising: a memory and a processor;
    所述存储器,用于存储程序;the memory for storing programs;
    所述处理器,与所述存储器耦合,用于执行所述存储器中存储的所述程序,以用于:The processor, coupled to the memory, executes the program stored in the memory for:
    控制接收器获取码流;其中,所述码流中包括第一指示信息,所述第一指示信息用于指示待解码图像对应的像素区间段数,所述像素区间段数是基于所述待解码图像的比特深度确定的;Controlling the receiver to obtain a code stream; wherein, the code stream includes first indication information, and the first indication information is used to indicate the number of pixel interval segments corresponding to the to-be-decoded image, and the pixel interval segment number is based on the to-be-decoded image is determined by the bit depth;
    根据所述像素区间段数对所述码流进行解码,获得解码后的图像。The code stream is decoded according to the number of segments in the pixel interval to obtain a decoded image.
  64. 根据权利要求63所述的装置,其特征在于,所述第一指示信息包括所述像素区间段数。The apparatus according to claim 63, wherein the first indication information includes the number of segments in the pixel interval.
  65. 根据权利要求63所述的装置,其特征在于,所述第一指示信息包括所述像素区间段数与预设值的差值。The device according to claim 63, wherein the first indication information comprises a difference between the number of segments in the pixel interval and a preset value.
  66. 根据权利要求65所述的装置,其特征在于,所述预设值为编码过程中确定的参数,所述码流中还包括用于指示所述预设值的第二指示信息;或,所述预设值为编码前固化到或预设在编码端和解码端的参数。The apparatus according to claim 65, wherein the preset value is a parameter determined in an encoding process, and the code stream further includes second indication information for indicating the preset value; or, the The preset value is a parameter that is solidified or preset at the encoding end and the decoding end before encoding.
  67. 根据权利要求66所述的装置,其特征在于,所述预设值包括所述比特深度。The apparatus of claim 66, wherein the preset value comprises the bit depth.
  68. 根据权利要求63至67中任一项所述的装置,其特征在于,所述码流中还包括第三指示信息和/或第四指示信息;所述第三指示信息用于指示所述待解码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待解码图像对应的有效原始像素区间的最大索引值。The apparatus according to any one of claims 63 to 67, wherein the code stream further includes third indication information and/or fourth indication information; the third indication information is used to indicate the The minimum index value of the valid original pixel interval corresponding to the decoded image; the fourth indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the to-be-decoded image.
  69. 根据权利要求68所述的装置,其特征在于,所述第三指示信息包括所述最小索引值。The apparatus of claim 68, wherein the third indication information includes the minimum index value.
  70. 根据权利要求68所述的装置,其特征在于,所述第四指示信息包括所述最大索引值。The apparatus according to claim 68, wherein the fourth indication information includes the maximum index value.
  71. 根据权利要求68所述的装置,其特征在于,所述第四指示信息包括所述像素区间段数与所述最大索引值的差值。The apparatus according to claim 68, wherein the fourth indication information comprises a difference between the number of segments in the pixel interval and the maximum index value.
  72. 根据权利要求63至71中任一项所述的装置,其特征在于,所述码流中还包括第五指示信息;所述第五指示信息用于指示所述待解码图像对应的有效原始像素区间对应的映射像素区间的区间长度。The apparatus according to any one of claims 63 to 71, wherein the code stream further includes fifth indication information; the fifth indication information is used to indicate valid original pixels corresponding to the image to be decoded The interval length of the mapped pixel interval corresponding to the interval.
  73. 根据权利要求72所述的装置,其特征在于,所述第五指示信息包括所述待解码图像对应的有效原始像素区间对应的映射像素区间的区间长度与初始映射区间长度的差值的绝对值及其符号;The apparatus according to claim 72, wherein the fifth indication information comprises the absolute value of the difference between the interval length of the mapped pixel interval corresponding to the valid original pixel interval corresponding to the to-be-decoded image and the length of the initial mapped interval and its symbols;
    所述初始映射区间长度为根据所述像素区间段数确定的。The length of the initial mapping interval is determined according to the number of segments of the pixel interval.
  74. 根据权利要求63至73中任一项所述的装置,其特征在于,所述码流中还包括用 于指示所述比特深度的第六指示信息。The apparatus according to any one of claims 63 to 73, wherein the code stream further includes sixth indication information for indicating the bit depth.
  75. 根据权利要求63至74中任一项所述的装置,其特征在于,所述处理器进一步用于:The apparatus of any one of claims 63 to 74, wherein the processor is further configured to:
    基于所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像素区间;determining, based on the number of segments of the pixel interval, a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image;
    根据所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像。The code stream is decoded according to the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  76. 根据权利要求75所述的装置,其特征在于,所述处理器进一步用于:The apparatus of claim 75, wherein the processor is further configured to:
    根据所述多个原始像素区间和所述多个映射像素区间对所述码流中的亮度像素值进行解码,获得解码后的图像。The luminance pixel values in the code stream are decoded according to the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  77. 一种视频编码装置,其特征在于,包括:存储器与处理器;A video encoding device, comprising: a memory and a processor;
    所述存储器,用于存储程序;the memory for storing programs;
    所述处理器,与所述存储器耦合,用于执行所述存储器中存储的所述程序,以用于:The processor, coupled to the memory, executes the program stored in the memory for:
    根据待编码图像的比特深度,确定所述待编码图像对应的像素区间段数;According to the bit depth of the to-be-coded image, determine the number of pixel interval segments corresponding to the to-be-coded image;
    根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间和多个映射像素区间;According to the number of pixel interval segments, determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-coded image;
    基于所述多个原始像素区间和所述多个映射像素区间对所述待编码图像的像素值进行编码,生成码流;encoding the pixel values of the to-be-encoded image based on the multiple original pixel intervals and the multiple mapped pixel intervals to generate a code stream;
    控制发射器发送所述码流。The transmitter is controlled to send the code stream.
  78. 根据权利要求77所述的装置,其特征在于,所述处理器进一步用于:The apparatus of claim 77, wherein the processor is further configured to:
    获取预设像素区间段数;Get the number of preset pixel interval segments;
    根据待编码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数。According to the bit depth of the image to be encoded, the preset number of segments in the pixel interval is adjusted to obtain the number of segments in the pixel interval.
  79. 根据权利要求78所述的装置,其特征在于,所述处理器进一步用于:The apparatus of claim 78, wherein the processor is further configured to:
    当待编码图像的比特深度大于比特深度阈值时,对所述预设像素区间段数进行增大处理,得到所述像素区间段数。When the bit depth of the image to be encoded is greater than the bit depth threshold, the preset number of segments in the pixel interval is increased to obtain the number of segments in the pixel interval.
  80. 根据权利要求78所述的装置,其特征在于,所述处理器进一步用于:The apparatus of claim 78, wherein the processor is further configured to:
    当所述待编码图像的比特深度小于比特深度阈值时,对所述预设像素区间段数进行减小处理,得到所述像素区间段数。When the bit depth of the to-be-encoded image is less than the bit depth threshold, reducing the number of segments in the preset pixel interval is performed to obtain the number of segments in the pixel interval.
  81. 根据权利要求77到80中任一项所述的装置,其特征在于,所述处理器进一步用于:The apparatus of any one of claims 77 to 80, wherein the processor is further configured to:
    根据所述像素区间段数,确定所述待编码图像对应的多个原始像素区间;Determine a plurality of original pixel intervals corresponding to the to-be-coded image according to the number of pixel interval segments;
    根据所述图像中各像素点的像素值,确定与所述多个原始像素区间一一对应的多个映射像素区间。According to the pixel value of each pixel in the image, a plurality of mapped pixel intervals corresponding to the plurality of original pixel intervals one-to-one is determined.
  82. 根据权利要求81所述的装置,其特征在于,所述多个原始像素区间包括第一原始像素区间;所述多个映射像素区间包括与所述第一原始像素区间对应的第一映射像素区间;The device according to claim 81, wherein the plurality of original pixel intervals include a first original pixel interval; and the plurality of mapped pixel intervals include a first mapped pixel interval corresponding to the first original pixel interval ;
    所述处理器进一步用于:The processor is further used to:
    根据所述待编码图像中各像素点的像素值,确定落在所述第一原始像素区间的至少一 个像素点;According to the pixel value of each pixel in the to-be-encoded image, determine at least one pixel that falls within the first original pixel interval;
    综合所述待编码图像中所述至少一个像素点中各像素点所在区域的像素值分布情况,确定所述第一映射像素区间的区间长度;Combining the distribution of pixel values in the region where each pixel is located in the at least one pixel in the image to be encoded, determine the interval length of the first mapped pixel interval;
    基于所述第一映射像素区间的区间长度,确定所述第一映射像素区间。The first mapped pixel interval is determined based on the interval length of the first mapped pixel interval.
  83. 根据权利要求82所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 82, wherein the processor is further configured to:
    根据所述像素区间段数,确定初始映射区间长度;Determine the length of the initial mapping interval according to the number of pixel interval segments;
    所述处理器进一步用于:The processor is further used to:
    根据所述待编码图像中所述至少一个像素点中各像素点所在区域的像素值分布方差的平均值,确定调整方向;Determine the adjustment direction according to the average value of the distribution variance of the pixel values in the region where each pixel point is located in the at least one pixel point in the image to be encoded;
    根据所述平均值和/或所述至少一个像素点的数量占比,确定调整幅度;Determine the adjustment range according to the average value and/or the number ratio of the at least one pixel point;
    根据所述调整方向和调整幅度,对所述初始映射区间长度进行调整,得到所述第一映射像素区间的区间长度。According to the adjustment direction and adjustment range, the length of the initial mapping interval is adjusted to obtain the interval length of the first mapped pixel interval.
  84. 根据权利要求77到83中任一项所述的装置,其特征在于,所述多个原始像素区间为多个有效原始像素区间;The device according to any one of claims 77 to 83, wherein the plurality of original pixel intervals are a plurality of valid original pixel intervals;
    所述处理器进一步用于:The processor is further used to:
    按照所述像素区间段数,将基于所述待编码图像的比特深度确定的原始像素取值范围进行划分得到多个像素区间;Divide the original pixel value range determined based on the bit depth of the to-be-encoded image according to the number of pixel interval segments to obtain a plurality of pixel intervals;
    根据所述待编码图像的像素值分布情况,从所述多个像素区间中确定出所述多个有效原始像素区间。The plurality of valid original pixel intervals are determined from the plurality of pixel intervals according to the distribution of pixel values of the to-be-coded image.
  85. 根据权利要求84所述的装置,其特征在于,所述处理器进一步用于:The apparatus of claim 84, wherein the processor is further configured to:
    将所述多个像素区间中与所述待编码图像的像素值分布范围有交集的多个像素区间确定为所述多个有效原始像素区间。A plurality of pixel intervals that have an intersection with the pixel value distribution range of the image to be encoded among the plurality of pixel intervals are determined as the plurality of valid original pixel intervals.
  86. 根据权利要求77至85中任一项所述的装置,其特征在于,所述多个映射像素区间与所述多个原始像素区间一一对应;The device according to any one of claims 77 to 85, wherein the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals;
    所述处理器进一步用于:The processor is further used to:
    根据所述多个原始像素区间中各原始像素区间的起终点及其对应的映射像素区间的起终点,确定各原始像素区间对应的映射关系;Determine the mapping relationship corresponding to each original pixel interval according to the start and end points of each original pixel interval in the plurality of original pixel intervals and the corresponding start and end points of the mapped pixel interval;
    根据所述待编码图像的原始像素值以及所述映射关系,确定所述待编码图像的映射像素值;According to the original pixel value of the to-be-encoded image and the mapping relationship, determine the mapped pixel value of the to-be-encoded image;
    根据所述待编码图像的映射像素值进行编码,生成码流。The encoding is performed according to the mapped pixel values of the to-be-encoded image to generate a code stream.
  87. 根据权利要求86所述的装置,其特征在于,所述处理器进一步用于:The apparatus of claim 86, wherein the processor is further configured to:
    根据所述待编码图像的原始像素值及其所在的原始像素区间对应的映射关系,确定所述待编码图像的映射像素值。The mapped pixel value of the to-be-encoded image is determined according to the mapping relationship corresponding to the original pixel value of the to-be-encoded image and its original pixel interval.
  88. 根据权利要求77到87中任一项所述的装置,其特征在于,所述像素值为亮度像素值。The apparatus according to any one of claims 77 to 87, wherein the pixel value is a luminance pixel value.
  89. 一种视频解码装置,其特征在于,包括:存储器与处理器;A video decoding device, comprising: a memory and a processor;
    所述存储器,用于存储程序;the memory for storing programs;
    所述处理器,与所述存储器耦合,用于执行所述存储器中存储的所述程序,以用于:The processor, coupled to the memory, executes the program stored in the memory for:
    控制接收器获取码流;Control the receiver to obtain the code stream;
    根据待解码图像的比特深度,确定所述待解码图像对应的像素区间段数;Determine the number of pixel interval segments corresponding to the to-be-decoded image according to the bit depth of the to-be-decoded image;
    根据所述像素区间段数,确定所述待解码图像对应的多个原始像素区间和多个映射像素区间;According to the number of pixel interval segments, determine a plurality of original pixel intervals and a plurality of mapped pixel intervals corresponding to the to-be-decoded image;
    基于所述多个原始像素区间和所述多个映射像素区间对所述码流进行解码,获得解码后的图像。The code stream is decoded based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  90. 根据权利要求89所述的装置,其特征在于,所述处理器进一步用于:The apparatus of claim 89, wherein the processor is further configured to:
    获取预设像素区间段数;Get the number of preset pixel interval segments;
    根据待解码图像的比特深度,对所述预设像素区间段数进行调整,得到所述像素区间段数。According to the bit depth of the image to be decoded, the preset number of pixel intervals is adjusted to obtain the number of pixel intervals.
  91. 根据权利要求90所述的装置,其特征在于,所述处理器进一步用于:The apparatus of claim 90, wherein the processor is further configured to:
    当待解码图像的比特深度大于比特深度阈值时,对所述预设像素区间段数进行增大处理,得到所述像素区间段数。When the bit depth of the image to be decoded is greater than the bit depth threshold, the preset number of segments in the pixel interval is increased to obtain the number of segments in the pixel interval.
  92. 根据权利要求90所述的装置,其特征在于,所述处理器进一步用于:The apparatus of claim 90, wherein the processor is further configured to:
    当所述待解码图像的比特深度小于比特深度阈值时,对所述预设像素区间段数进行减小处理,得到所述像素区间段数。When the bit depth of the to-be-decoded image is less than the bit depth threshold, reducing the number of segments in the preset pixel interval is performed to obtain the number of segments in the pixel interval.
  93. 根据权利要求89至92中任一项所述的装置,其特征在于,所述多个映射像素区间与所述多个原始像素区间一一对应;所述原始像素区间为有效原始像素区间;The device according to any one of claims 89 to 92, wherein the plurality of mapped pixel intervals are in one-to-one correspondence with the plurality of original pixel intervals; the original pixel intervals are valid original pixel intervals;
    所述码流中包括第三指示信息、第四指示信息以及第五指示信息;所述第三指示信息用于指示所述待解码图像对应的有效原始像素区间的最小索引值;所述第四指示信息用于指示所述待解码图像对应的有效原始像素区间的最大索引值;所述第五指示信息用于指示所述多个映射像素区间的区间长度;The code stream includes third indication information, fourth indication information and fifth indication information; the third indication information is used to indicate the minimum index value of the valid original pixel interval corresponding to the image to be decoded; the fourth indication information The indication information is used to indicate the maximum index value of the valid original pixel interval corresponding to the image to be decoded; the fifth indication information is used to indicate the interval length of the plurality of mapped pixel intervals;
    所述处理器进一步用于:The processor is further used to:
    根据所述像素区间段数,确定原始像素区间长度;Determine the length of the original pixel interval according to the number of segments of the pixel interval;
    根据所述原始像素区间长度、所述最小索引值以及所述最大索引值,确定所述多个有效原始像素区间;determining the plurality of valid original pixel intervals according to the length of the original pixel interval, the minimum index value and the maximum index value;
    根据所述多个映射像素区间的区间长度,确定所述多个映射像素区间。The plurality of mapped pixel intervals are determined according to the interval lengths of the plurality of mapped pixel intervals.
  94. 根据权利要求93所述的装置,其特征在于,所述码流中还包括第六指示信息;所述第六指示信息用于指示所述比特深度;The apparatus according to claim 93, wherein the code stream further includes sixth indication information; the sixth indication information is used to indicate the bit depth;
    所述处理器进一步用于:The processor is further used to:
    根据所述比特深度与所述像素区间段数,确定原始像素区间长度。The length of the original pixel interval is determined according to the bit depth and the number of segments of the pixel interval.
  95. 根据权利要求89至94中任一项所述的装置,其特征在于,所述处理器进一步用于:The apparatus of any one of claims 89 to 94, wherein the processor is further configured to:
    对所述码流进行解码,得到所述待解码图像的映射像素值;Decoding the code stream to obtain the mapped pixel value of the to-be-decoded image;
    根据所述多个原始像素区间中各原始像素区间的起终点及其对应的映射像素区间的起终点,确定各原始像素区间对应的映射关系;Determine the mapping relationship corresponding to each original pixel interval according to the start and end points of each original pixel interval in the plurality of original pixel intervals and the corresponding start and end points of the mapped pixel interval;
    根据所述待解码图像的映射像素值及其所在的映射像素区间对应的原始像素区间的映射关系,确定所述待解码图像的原始像素值。The original pixel value of the to-be-decoded image is determined according to the mapping relationship between the mapped pixel value of the to-be-decoded image and the original pixel interval corresponding to the mapped pixel interval in which the image is to be decoded.
  96. 根据权利要求89到95中任一项所述的装置,其特征在于,所述处理器进一步用于:The apparatus of any one of claims 89 to 95, wherein the processor is further configured to:
    基于所述多个原始像素区间和所述多个映射像素区间对所述码流中的亮度像素值进 行解码,获得解码后的图像。Decoding the luminance pixel values in the code stream based on the plurality of original pixel intervals and the plurality of mapped pixel intervals to obtain a decoded image.
  97. 一种电子设备,其特征在于,包括上述权利要求49-62、77-88中任一项所述的视频编码装置及所述发射器。An electronic device, characterized by comprising the video encoding device and the transmitter according to any one of claims 49-62 and 77-88.
  98. 一种电子设备,其特征在于,包括上述权利要求63-76、89-96中任一项所述的视频解码装置及所述接收器。An electronic device, characterized by comprising the video decoding device and the receiver according to any one of claims 63-76 and 89-96.
  99. 一种计算机可读存储介质,其特征在于,包括指令,当其在计算机上运行时,使得所述计算机实现权利要求1-15、29-40中任一项所述的视频编码方法。A computer-readable storage medium, characterized by comprising instructions, when executed on a computer, causing the computer to implement the video encoding method of any one of claims 1-15 and 29-40.
  100. 一种计算机可读存储介质,其特征在于,包括指令,当其在计算机上运行时,使得所述计算机实现权利要求16-28、41-48中任一项所述的视频解码方法。A computer-readable storage medium, characterized by comprising instructions, which, when executed on a computer, cause the computer to implement the video decoding method of any one of claims 16-28 and 41-48.
  101. 一种视频编解码***,其特征在在于,包括:编码端设备和解码端设备;A video encoding and decoding system, comprising: an encoding end device and a decoding end device;
    所述编码端设备,包括权利要求97所述的电子设备;The encoding terminal device comprises the electronic device of claim 97;
    所述解码端设备,包括权利要求98所述的电子设备。The decoding end device includes the electronic device of claim 98 .
PCT/CN2021/087084 2021-04-13 2021-04-13 Video encoding and decoding methods, apparatus, system, and storage medium WO2022217474A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2021/087084 WO2022217474A1 (en) 2021-04-13 2021-04-13 Video encoding and decoding methods, apparatus, system, and storage medium
CN202180077049.5A CN116615905A (en) 2021-04-13 2021-04-13 Video encoding and decoding methods, devices, systems and storage media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/087084 WO2022217474A1 (en) 2021-04-13 2021-04-13 Video encoding and decoding methods, apparatus, system, and storage medium

Publications (1)

Publication Number Publication Date
WO2022217474A1 true WO2022217474A1 (en) 2022-10-20

Family

ID=83639965

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/087084 WO2022217474A1 (en) 2021-04-13 2021-04-13 Video encoding and decoding methods, apparatus, system, and storage medium

Country Status (2)

Country Link
CN (1) CN116615905A (en)
WO (1) WO2022217474A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110301134A (en) * 2017-06-29 2019-10-01 杜比实验室特许公司 The image shaping of integration and Video coding
WO2020185387A1 (en) * 2019-03-11 2020-09-17 Interdigital Vc Holdings, Inc. Method and device for picture encoding and decoding with forward and inverse mapping models
WO2020228764A1 (en) * 2019-05-14 2020-11-19 Beijing Bytedance Network Technology Co., Ltd. Methods on scaling in video coding
WO2021039992A1 (en) * 2019-08-28 2021-03-04 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Coding device, decoding device, coding method, and decoding method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110301134A (en) * 2017-06-29 2019-10-01 杜比实验室特许公司 The image shaping of integration and Video coding
WO2020185387A1 (en) * 2019-03-11 2020-09-17 Interdigital Vc Holdings, Inc. Method and device for picture encoding and decoding with forward and inverse mapping models
WO2020228764A1 (en) * 2019-05-14 2020-11-19 Beijing Bytedance Network Technology Co., Ltd. Methods on scaling in video coding
WO2021039992A1 (en) * 2019-08-28 2021-03-04 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Coding device, decoding device, coding method, and decoding method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
X. XIU (KWAI), H.-J. JHU, Y.-W. CHEN, T.-C. MA, X. WANG (KWAI): "AHG12: Fix on encoder overflow issue of the LMCS at high bit-depth coding", 20. JVET MEETING; 20201007 - 20201016; TELECONFERENCE; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 1 October 2020 (2020-10-01), XP030289908 *

Also Published As

Publication number Publication date
CN116615905A (en) 2023-08-18

Similar Documents

Publication Publication Date Title
CN113115047B (en) Video encoding and decoding method and device
CN112913250B (en) Encoder, decoder and corresponding methods using IBC search range optimization for arbitrary CTU sizes
CN112889281B (en) Method, apparatus, and storage medium for intra prediction of block in image
WO2021136375A1 (en) Video encoding or decoding methods and apparatuses related to high-level information signaling
KR102616714B1 (en) Early termination for optical flow purification
CN112889286B (en) Method and apparatus for mode-dependent and size-dependent block-level limiting of position-dependent prediction combinations
CN113196783B (en) Deblocking filtering adaptive encoder, decoder and corresponding methods
CN112913236B (en) Encoder, decoder and corresponding methods using compressed MV storage
CN113196748B (en) Intra-frame prediction method and related device
CN113785573A (en) Encoder, decoder and corresponding methods using an adaptive loop filter
CN113950839A (en) Gradient-based prediction refinement for video coding
CN113411613B (en) Method for video coding image block, decoding device and coder/decoder
CN113473134B (en) Method, apparatus and storage medium for coordinating individual fusion lists of sub-block fusion candidates and intra and inter prediction techniques
WO2021070427A1 (en) Systems and methods for reducing a reconstruction error in video coding based on a cross-component correlation
KR20220101719A (en) Inter prediction method and apparatus in video/video coding system
CN115665407A (en) Inter-component linear modeling method and device for intra-frame prediction
WO2022217474A1 (en) Video encoding and decoding methods, apparatus, system, and storage medium
JP7367237B2 (en) Method and device for prediction-dependent residual scaling for video coding
CN113556566B (en) Method and apparatus for intra-prediction or inter-prediction processing of video frames
CN114598873B (en) Decoding method and device for quantization parameter
CN116647683A (en) Quantization processing method and device
CN118042136A (en) Encoding and decoding method and device

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180077049.5

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21936367

Country of ref document: EP

Kind code of ref document: A1