WO2023174076A1 - 编码方法及装置、解码方法及装置、存储介质、电子装置 - Google Patents

编码方法及装置、解码方法及装置、存储介质、电子装置 Download PDF

Info

Publication number
WO2023174076A1
WO2023174076A1 PCT/CN2023/079630 CN2023079630W WO2023174076A1 WO 2023174076 A1 WO2023174076 A1 WO 2023174076A1 CN 2023079630 W CN2023079630 W CN 2023079630W WO 2023174076 A1 WO2023174076 A1 WO 2023174076A1
Authority
WO
WIPO (PCT)
Prior art keywords
sub
stream
symbol processing
coefficients
target symbol
Prior art date
Application number
PCT/CN2023/079630
Other languages
English (en)
French (fr)
Inventor
高莹
吴平
谢绍伟
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023174076A1 publication Critical patent/WO2023174076A1/zh

Links

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/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/18Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a set of transform coefficients
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding

Definitions

  • Embodiments of the present invention relate to the field of communications, and specifically, to an encoding method and device, a decoding method and device, a storage medium, and an electronic device.
  • Video compression coding is widely used in various digital video application scenarios, including digital TV, interactive media, video conferencing, video on demand, streaming media services, remote video monitoring, video games, etc. No matter what kind of application it is, the amount of data that needs to be transmitted is very large, and the requirements for network transmission and storage space are very high. By removing spatiotemporal redundant information from video data, the amount of data can be effectively reduced, which not only saves storage space, but also improves network transmission efficiency.
  • Embodiments of the present invention provide an encoding method and device, a decoding method and device, a storage medium, and an electronic device to at least solve the problem of low flexibility of symbol processing methods in related technologies, which in turn leads to low coding efficiency and complex coding. High degree of problem.
  • an encoding method including: determining the target type of the currently encoded target sub-code stream, and the target symbol processing method and target symbol processing parameters corresponding to the target type; based on the The target symbol processing parameter performs target symbol processing on the coefficients of the current image block according to the target symbol processing method; and encodes the coefficients of the current image block based on the processing result of the target symbol processing.
  • a decoding method including: when receiving a layered encoded video code stream, obtaining the target symbol processing method and target symbol processing parameters corresponding to each sub-stream; based on each The target symbol processing method and target symbol processing parameters corresponding to the sub-code streams determine the symbols of the coefficients corresponding to each of the sub-code streams; and the layered encoding video code stream is encoded based on the symbols of the coefficients corresponding to each of the sub-code streams.
  • Each sub-stream in is decoded.
  • an encoding device including: a first determination module configured to determine the target type of the currently encoded target sub-code stream, and the target symbol processing method corresponding to the target type; Target symbol processing parameters; a processing module, configured to perform target symbol processing on the coefficients of the current image block according to the target symbol processing method based on the target symbol processing parameters; an encoding module, configured to perform target symbol processing based on the processing results of the target symbol processing The coefficients of the current image block are encoded.
  • a decoding device including: an acquisition module configured to acquire the target symbol processing method and target symbol corresponding to each sub-stream when receiving a layered encoded video stream. Processing parameters; the second determination module is configured to determine the symbol of the coefficient corresponding to each sub-code stream based on the target symbol processing method and target symbol processing parameters corresponding to each of the sub-code streams; the decoding module is configured to determine the symbol of the coefficient corresponding to each of the sub-code streams based on the target symbol processing method and target symbol processing parameters corresponding to each of the sub-code streams. Corresponding to the sub-stream The symbols of the coefficients are used to decode each sub-stream in the layered coded video stream.
  • a computer-readable storage medium is also provided.
  • a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the above encoding method embodiment when running. or perform the steps in the above decoding method embodiment.
  • an electronic device including a memory and a processor.
  • a computer program is stored in the memory, and the processor is configured to run the computer program to perform the above coding method implementation. or perform the steps in the above decoding method embodiment.
  • Figure 1 is a schematic diagram of the coefficient scanning sequence of the 8*8 transform block in the related art
  • Figure 2 is a logical processing block diagram of a video encoder in related art
  • Figure 3 is a hardware structure block diagram of a mobile terminal according to the encoding method or decoding method according to the embodiment of the present invention
  • Figure 4 is a flow chart of an encoding method according to an embodiment of the present invention.
  • Figure 5 is a coding flow chart according to specific embodiment 1 of the present invention.
  • Figure 6 is a schematic diagram of determining the prediction estimate symbol according to specific embodiment 1 of the present invention.
  • Figure 7 is a schematic diagram of the coefficient scanning sequence of the 8*8 transform block according to the second embodiment of the present invention.
  • Figure 8 is a coding flow chart according to specific embodiment 2 of the present invention.
  • Figure 9 is a coding flow chart according to specific embodiment 3 of the present invention.
  • Figure 10 is a flow chart of a decoding method according to an embodiment of the present invention.
  • Figure 11 is a decoding flow chart according to specific embodiment 4 of the present invention.
  • Figure 12 is a decoding flow chart according to specific embodiment 5 of the present invention.
  • Figure 13 is a decoding flow chart according to specific embodiment 6 of the present invention.
  • Figure 14 is a structural block diagram of an encoding device according to an embodiment of the present invention.
  • Figure 15 is a structural block diagram of a decoding device according to an embodiment of the present invention.
  • a method for image coefficients (usually transform coefficients, of course, they can also be quantized transform coefficients or residual coefficients) in layered coding (or scalable coding) video streams.
  • the symbol processing method can provide a variety of flexible and configurable symbol processing methods for different types of code streams (for example, base layer code stream, enhancement layer code stream), thereby achieving the purpose of balancing coding efficiency and coding complexity.
  • High-performance video coding H.265/High Efficiency Video Coding, HEVC
  • JVET Joint Video Expert Teams
  • ITU H.266/Versatile Video Coding
  • VVC Versatibility Video Coding
  • the scalable video encoder can provide a single layered nested video stream. Different sub-streams can be extracted from the layered video stream to meet different needs. The sub-streams can be different frame rates or spaces. Resolution. Or different bitrates (i.e. different video qualities) with the same frame rate and spatial resolution.
  • the video code stream may include a base layer (Base Layer) sub-stream and at least one enhancement layer (Enhancement Layer) sub-stream.
  • the enhancement layer sub-stream may be an independent enhancement layer sub-stream or depend on the enhancement layer. substream.
  • the base layer sub-stream can ensure that the decoder can normally decode the video content, but the video image obtained by the base layer sub-stream may have a lower frame rate, lower resolution, or lower quality.
  • the enhancement layer sub-stream can be transmitted.
  • the independent enhancement layer sub-stream can be independently decoded to provide enhanced video content.
  • the dependent enhancement layer sub-stream needs to be decoded together with the base layer sub-stream to provide enhancement.
  • video content to increase the frame rate, or resolution, or video quality.
  • the enhancement layer can be further hierarchically encoded, which means that within the range of the total bit rate of the video stream, the greater the received bit rate, the better the video quality.
  • layered coding is also widely used in compression coding of stereoscopic videos.
  • the left-view video image is encoded as a base layer sub-stream
  • the right-view video image is used as an enhancement layer sub-stream, using space, time and two Information redundancy between viewpoints enables efficient compression of stereoscopic videos.
  • the enhancement layer sub-stream can also be called a non-base layer sub-stream. In subsequent descriptions, the enhancement layer sub-stream will be uniformly used for explanation.
  • the video encoder can divide a frame of image into multiple coding tree units (Coding Tree Unit, referred to as CTU), and one CTU can be divided into multiple coding units (Coding Unit, referred to as CU), it is decided at the CU level whether to use intra-frame coding or inter-frame coding.
  • Each CU can be further divided into one or more prediction units (Prediction Units, referred to as PUs for short), and the prediction results are also transmitted to the decoder in PU units.
  • Prediction Units referred to as PUs for short
  • PUs prediction units
  • PUs Transform Units
  • a CU may contain a brightness component.
  • a PU may contain a Prediction Block (PB for short) for luma components and/or predictions for two chroma components.
  • PB Prediction Block
  • a TU may contain a Transform Block (TB) for the luminance component and/or two transform blocks for the chrominance component.
  • PB Prediction Block
  • TB Transform Block
  • an example of the scanning order of coefficients of an 8*8 transform block is given (the numbers in Figure 1 indicate the scanning order), where the non-zero transform coefficients in the transform block consist of signs and absolute values, and the encoding
  • the encoder needs to allocate a sign bit to each coefficient to indicate the positive or negative sign. For example, when the sign bit value is equal to 0, it means that the coefficient corresponding to the sign bit is positive, and when the sign bit value is equal to 1, it means that the coefficient corresponding to the sign bit is negative, and vice versa.
  • ECM 2 Enhanced Compression Model 2
  • the coefficient symbol of the current block uses a binary value to represent the prediction result between the estimated symbol and the original symbol. For example, "0" indicates that the estimated symbol and the original symbol are the same, and "1" indicates that the estimated symbol and the original symbol are different. If the symbols are well estimated, then most of the prediction results will be 0, and then encoding the prediction results through Context Adaptive Binary Arithmetic Coding (CABAC) can effectively improve the coding efficiency.
  • CABAC Context Adaptive Binary Arithmetic Coding
  • Figure 2 shows a general conceptual logical processing block diagram of a video encoder that complies with the HEVC and VVC standards, but it does not rule out that the embodiments of the present invention can also be applied to Other encoding methods or standards.
  • the video data processing module divides the input video data into image blocks.
  • Video data usually consists of a series of video image sequences, and video images can also be called images or frames.
  • Video data processing includes dividing the video image into CTUs.
  • the CTU contains a coding tree block (CTB) corresponding to brightness and two coding tree blocks corresponding to chroma and their correlations.
  • CTB coding tree block
  • the coding tree unit CTU may only contain one brightness-corresponding coding tree block CTB and its associated syntax structure.
  • the CTU may further include one or more CUs.
  • the coding unit may include one CB corresponding to luminance and two coding blocks corresponding to chroma and their associated syntax structures, or may only contain one coding block corresponding to luminance and its associated grammatical structure.
  • the slice Silce may contain an integer number of coding tree units CTU arranged in raster scanning order
  • the tile Tile may contain an integer number of coding tree units CTU arranged in a rectangular shape.
  • the video processing unit may be a "coding tree unit CTU", a “coding unit CU”, a prediction unit PU, a transformation unit TU, etc.
  • video processing units may also be macroblocks, macroblock partitions, etc.
  • the type of video block may be a coding tree block, a coding block, a prediction block PB, a transformation block TB, or a block of other data types, etc.
  • the prediction processing module selects an appropriate prediction mode (intra-frame prediction or inter-frame prediction) for the coding unit according to the image characteristics, and obtains the prediction unit corresponding to the coding unit.
  • the prediction unit may include a prediction block corresponding to luminance and two corresponding chrominance blocks. prediction block.
  • the appropriate prediction mode may provide the best matching or the minimum residual error, etc.
  • the actual selection of the prediction mode may also be determined based on rate-distortion optimization.
  • Intra-frame prediction can include a variety of non-directional prediction modes and directional prediction modes, and the best matching block is searched within the current image as an intra-frame prediction block.
  • Inter prediction is to search for the best matching reference block as an inter prediction block in a reference image (an at least partially decoded image previously stored in a decoded picture buffer) according to associated inter prediction parameters.
  • the prediction processing unit can also further divide the coding block in the coding unit into smaller sub-blocks through any combination of quad-tree, binary tree or ternary tree before prediction, and predict the sub-blocks. Unless there are special circumstances in the embodiments of the present invention, coding blocks or coding sub-blocks will not be differentiated and explained.
  • the image block is subtracted from the predicted image after motion estimation to obtain a difference image, also called a residual block.
  • a difference image also called a residual block.
  • each pixel value in the encoding block is subtracted from the corresponding pixel value in the prediction block, and the resulting difference of each pixel constitutes the residual block.
  • the transformation unit transforms the residual block or the sub-block of the residual block from the spatial domain to the frequency domain to obtain the transformation coefficient in the frequency domain.
  • the transformation coefficient can also be called the transformation residual coefficient or the residual transformation coefficient.
  • Commonly used transformation methods include Discrete Cosine Transform (DCT) or Discrete Fourier Transform (DFT).
  • DCT Discrete Cosine Transform
  • DFT Discrete Fourier Transform
  • the two-dimensional matrix composed of transform coefficients is also called a transform coefficient block.
  • the quantization unit quantizes the transform coefficient to obtain a quantized coefficient.
  • the quantized coefficient may also be called a quantized transform coefficient or a quantized residual coefficient, etc.
  • the two-dimensional matrix composed of quantized coefficients is also called a quantized coefficient block. Since the human eye is very sensitive to the low-frequency characteristics of the image, such as the overall brightness of the object, and is insensitive to the high-frequency detailed information in the image, less or no high-frequency information can be transmitted during the transmission process, and only high-frequency information can be transmitted. low frequency part.
  • the quantization process removes high-frequency information that is insensitive to the human eye by finely quantizing the coefficients in the low-frequency area and coarsely quantizing the coefficients in the high-frequency area, thereby reducing the amount of information transmission.
  • the common quantization method is dividing by the quantization step size.
  • the quantization step size can be indicated by the quantization parameter (Quantization Parameter, QP for short).
  • QP Quantization Parameter
  • the quantized coefficients output by quantization have two different places: one is sent to the entropy encoder for encoding, and the encoded code stream can be output to a buffer for storage, waiting to be sent to the decoder. Another application is to send it to the inverse quantization unit and the inverse transform unit to perform corresponding inverse quantization and inverse transform operations.
  • the inverse quantization and inverse transformation performed by the inverse quantization unit and the inverse transformation unit are the inverse processes of quantization and transformation, respectively.
  • the inverse quantization coefficient can be obtained, which is also called the inverse quantization residual coefficient or the inverse quantization transform coefficient, etc. Since the quantization process is lossy, inverse quantization is usually not equal to the transform coefficients before quantization.
  • an inverse transformation process such as inverse discrete cosine transform or inverse discrete Fourier transform
  • an inverse transform block in the pixel domain can be obtained, which can also be called an inversely transformed inverse quantization block or an inversely transformed residual block.
  • the buffer is used to buffer or store reconstructed blocks for intra-frame estimation and/or intra-frame prediction or other types of estimation and/or prediction, etc.
  • the loop filter unit can filter the reconstruction block to obtain a filter block.
  • the filter block may also be called a filtered reconstruction block or a filtered reconstruction block.
  • Commonly used loop filtering methods include pixel adaptive offset (SAO) filtering, deblocking filtering, etc.
  • the Decoded Picture Buffer can receive and store filter blocks, and can also store the current image or other filter blocks of previously reconstructed images, and can provide a complete previously reconstructed image and/or a partially reconstructed current image.
  • Image for inter-frame estimation and/or inter-frame prediction, etc.
  • the coding control unit records coding-related control parameters, such as coding block division method, hierarchical coding method, and control parameters related to intra-frame prediction, inter-frame prediction, transformation, quantization, etc.
  • the encoding control module involves the entire encoding process and can interact with any other module mentioned above to obtain the control parameters that need to be used in the decoding process. Finally, they are provided to the entropy encoding unit, which performs entropy encoding on these parameters and transmits them to the decoding end.
  • the video encoder may include more, less, or partially different functional components. This is only a general introduction, and no separate drawing will be used to illustrate each variation.
  • coefficients or coding coefficients mentioned in subsequent embodiments of the present invention usually refer to transform coefficients, but it is not excluded that they may be quantized transform coefficients or residual coefficients.
  • FIG. 3 is a hardware structure block diagram of a mobile terminal using the encoding method or the decoding method according to an embodiment of the present invention.
  • the mobile terminal may include one or more (only one is shown in Figure 3) processors 302 (the processor 302 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 304 for storing data, wherein the above-mentioned mobile terminal may also include a transmission device 306 and an input and output device 308 for communication functions.
  • FIG. 3 is only illustrative, and it does not limit the structure of the above-mentioned mobile terminal.
  • the mobile terminal may also include more or fewer components than shown in FIG. 3 , or have a different configuration than that shown in FIG. 3 .
  • the memory 304 can be used to store computer programs, for example, software programs and modules of application software, such as the computer programs corresponding to the encoding method or the decoding method in the embodiment of the present invention.
  • the processor 302 runs the computer program stored in the memory 304, thereby Execute various functional applications and data processing, that is, implement the above methods.
  • Memory 304 may include high-speed random access memory and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or or other non-volatile solid-state memory.
  • the memory 304 may further include memory located remotely relative to the processor 302, and these remote memories may be connected to the mobile terminal through a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
  • the transmission device 306 is used to receive or send data via a network.
  • Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of the mobile terminal.
  • the transmission device 306 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 306 may be a radio frequency (Radio Frequency, RF for short) module, which is used to communicate with the Internet wirelessly.
  • NIC Network Interface Controller
  • Figure 4 is a flow chart of an encoding method according to an embodiment of the present invention. As shown in Figure 4, the process includes the following steps:
  • Step S402 Determine the target type of the currently encoded target sub-code stream, as well as the target symbol processing method and target symbol processing parameters corresponding to the target type;
  • Step S404 Perform target symbol processing on the coefficients of the current image block based on the target symbol processing parameter and the target symbol processing method;
  • Step S406 Encode the coefficients of the current image block based on the processing result of the target symbol processing.
  • What performs the above operations may be an encoding device (for example, a video encoder), or a processor provided within the encoding device, or a processor provided independently from the encoding device. Of course, it may also be other devices with similar encoding capabilities.
  • the currently encoded target sub-stream may be a sub-stream in a layered encoded video stream, and the currently encoded sub-stream type includes but is not limited to a base layer sub-stream or an enhancement layer sub-stream.
  • the enhancement layer sub-stream may further include an independent enhancement layer sub-stream or a dependent enhancement layer sub-stream.
  • the above-mentioned target symbol processing method includes at least one of the symbol prediction method, the symbol bit hiding method, and other types of symbol processing methods.
  • a symbol processing can be used. The method processes the coefficients of the image block. You can also use a variety of symbol processing methods to process the coefficients of the image block. That is, a symbol processing method is used to process a part of the coefficients of the image block. Different symbol processing methods The coefficients processed are different, and multiple symbol processing methods can have corresponding processing priorities, that is, the one with the highest priority is executed first.
  • the symbol prediction parameters corresponding to different symbol processing methods may be different.
  • the symbol prediction parameters corresponding to the prediction method may include but are not limited to the number of coefficients for symbol prediction, and/or the maximum value of the coefficients for symbol prediction, and/or the method for symbol prediction.
  • the symbol prediction methods include but are not limited to template generation methods, hypothesis reconstruction generation methods, cost function calculation methods, etc.
  • the symbol prediction parameters may be predetermined or determined based on the type of the sub-stream.
  • encoding the coefficient of the current image block based on the processing result of the target symbol processing includes encoding the absolute value of the coefficient of the current image block and the sign of the coefficient based on the processing result of the target symbol processing.
  • Encoding that is, encoding the coefficient includes encoding the absolute value of the coefficient and the sign of the coefficient.
  • the focus is on encoding the sign of the coefficient.
  • encoding the absolute value of the coefficient is The encoding method can adopt the conventional encoding method, which will not be described again later.
  • the symbol processing method and processing parameters for the coefficients in the image block are determined based on the types of each sub-stream included in the code stream, and the symbol processing method can be flexibly adjusted based on the code stream type. increased The flexibility of symbol processing methods achieves the purpose of balancing coding efficiency and coding complexity.
  • the method before performing target symbol processing on the coefficients of the current image block according to the target symbol processing method based on the target symbol processing parameters, the method further includes: determining that all the coefficients of the current image block need to be processed based on the first condition.
  • the coefficients of the current image block are used to perform the target symbol processing, wherein the first condition includes at least one of the following:
  • the characteristic size of the current image block The characteristic size of the current image block, the distribution state of the coefficients of the current image block, the number of non-zero coefficients in the current image block, the processing mode and transformation method of the target symbol processing, and the current image block Characteristic information of other adjacent image blocks, local configuration information, the target type of the target sub-stream, priorities of multiple symbol processing methods, characteristics of the image where the current image block is located, the current image block
  • the order between the operation of determining that the target symbol processing needs to be performed on the coefficients of the current image block and the above-mentioned S402 may be unrestricted. It may be determined first that the coefficients of the current image block need to be processed. Perform the target symbol processing and then execute S402. Alternatively, S402 may be executed first and then it is determined that the coefficients of the current image block need to be processed with the target symbol. Of course, it may also be determined at the same time that the coefficients of the current image block need to be processed. Perform the target symbol processing operation and S402.
  • encoding the coefficients of the current image block based on the processing result of the target symbol processing includes: encoding the coefficients included in the current image block that have been subjected to the target symbol processing and the coefficients that have not been processed by the target symbol.
  • the coefficients subjected to the target symbol processing are separately encoded, wherein the encoding method for encoding the coefficients subjected to the target symbol processing is the same as or different from the encoding method for encoding the coefficients not subjected to the target symbol processing; wherein , the target symbol processing method includes one or more; in the case that the target symbol processing method includes a processing method, a coding method is used to perform the target symbol included in the current image block.
  • the processed coefficients are encoded; when the target symbol processing method includes multiple processing methods, the coefficients included in the current image block that have been subjected to target symbol processing according to different target symbol processing methods are encoded respectively, and
  • the encoding methods of coefficients subjected to target symbol processing according to different target symbol processing methods are the same or different from each other.
  • the following is an example of the target symbol processing method including one processing method and two processing methods (the encoding method processing logic including three or more processing methods is also similar and will not be listed here):
  • the target symbol processing method when the target symbol processing method includes a processing method, the symbols of the first coefficients included in the current image block that have been subjected to the target symbol processing are processed according to the first encoding method. Encoding; and encoding the symbols of the second coefficients other than the first coefficients included in the current image block according to the second encoding method; wherein the first encoding method and the second encoding method The same or different; when the target symbol processing method includes two processing methods, the symbols of the first coefficients included in the current image block that have been processed by the first target symbol are encoded according to the first encoding method; The symbols of the second coefficients that have been processed by the second target symbol included in the current image block are encoded according to the second encoding method, and the symbols of the second coefficients included in the current image block that have been processed by the second target symbol are encoded according to the third encoding method.
  • a coefficient and a symbol of a third coefficient other than the second coefficient are encoded; wherein the target symbol processing method includes the first target symbol processing method and the second target symbol processing method, and the first The encoding method, the second encoding method and the third encoding method are all different or at least two of them are the same.
  • encoding the coefficients of the current image block based on the processing result of the target symbol processing includes: when the target symbol processing method includes a symbol prediction processing method, encoding the coefficients of the current image block based on the symbol processing method.
  • the processing result of the prediction processing determines the difference between the predicted symbol of the coefficient and the original symbol; the difference is encoded according to the encoding method corresponding to the symbol prediction processing method.
  • the difference can be represented by a specific value, for example, 0 or 1. That is, when it is determined that the predicted symbol is consistent with the original symbol, it means that the predicted symbol is correct, and the difference can be represented by 0. means that when it is determined that the predicted symbol is inconsistent with the original symbol, it means that the predicted symbol is wrong.
  • the difference can be represented by 1. It should be noted that other values or symbols can also be used to represent the difference, for example, binary numbers To express, use English letters to express etc.
  • the method further includes: adding the encoding result to the target sub-code in the flow.
  • the method before encoding the coefficients of the current image block based on the processing result of the target symbol processing, the method further includes: determining that the coefficients need to be encoded in a hierarchical coding manner based on coefficient importance.
  • the coefficients of the current image block are encoded.
  • hierarchical coding can be performed based on coefficient importance.
  • hierarchical coding can also be performed according to a preconfigured coding method, or , encode according to random encoding, and so on.
  • determining that the coefficients of the current image block need to be encoded in a hierarchical coding manner based on coefficient importance includes: determining that the coefficients of the current image block need to be encoded in a hierarchical coding manner based on coefficient importance based on at least one of the following methods: The coefficients of the current image block are encoded in a manner: determined according to the local configuration of the encoder, determined according to the characteristics of the current image block, determined according to the video sequence in which the current image block is located, and determined according to the known encoding code to be received.
  • the decoder capability or configuration of the stream is determined based on the adopted enhancement layer coding method and the received indicative information, where the indicative information comes from the sender of the uncoded image or the receiver of the coded image. end. It should also be noted that each of the above methods can be adjusted based on actual conditions, and of course, may not be limited to the implementation methods listed above.
  • the method further includes: reordering the coefficients of the current image block according to coefficient importance; determining each location according to the position of the reordered coefficient of the current image block. Coding layer to which the coefficient belongs.
  • the reordering operation and the operation of determining the coding layer to which each coefficient belongs may be performed before S406. Further, it may be performed before S404, or before S402.
  • the specific execution sequence is in this embodiment. Examples are not limited.
  • the method further includes at least one of the following:
  • identification information is used to indicate at least one of the following: when the decoding end decodes the reference layer sub-stream, it needs to store decoding results or decoding metadata for decoding subsequent enhancements. layer sub-stream; when decoding the enhancement layer sub-stream, the decoding end obtains the decoding result or decoding metadata of the reference layer sub-stream on which the enhancement layer sub-stream depends.
  • the decoding metadata includes but is not limited to inverse transform coefficients or inverse quantization coefficients
  • the reference layer sub-stream includes the base layer sub-stream or other enhancement layer sub-streams on which the enhancement layer sub-stream depends.
  • This embodiment provides a method for predicting the symbols of coefficients in a layered coded video stream. It should be noted that this embodiment uses symbol prediction as an example, and the related processing logic is also Suitable for symbol bit hiding methods or other symbol processing methods.
  • this embodiment includes the following steps:
  • Step 1 Determine the symbol prediction for the coefficients of the current image block
  • the video encoder can decide whether to perform symbol prediction on the coefficients of the current block based on certain conditions.
  • these conditions may be the characteristics of the image block, such as the size of the block, the distribution of corresponding coefficients, the number of non-zero coefficients, the prediction mode, the transformation method, and the information of adjacent image blocks.
  • Step 2 Determine the current encoding sub-stream type and obtain the symbol prediction parameters corresponding to the sub-stream type.
  • the current encoding sub-stream type includes but is not limited to a base layer sub-stream and an enhancement layer sub-stream, wherein the enhancement layer sub-stream may further include an independent enhancement layer sub-stream or a dependent enhancement layer sub-stream.
  • the sub-code stream type may be determined according to the layer identifier of the sub-code stream.
  • the symbol prediction parameters may include, but are not limited to, the number of coefficients for symbol prediction, and/or the maximum value of the coefficients for symbol prediction, and/or the method for symbol prediction.
  • the methods for symbol prediction include but are not limited to template generation methods, hypothesis reconstruction generation methods, cost function calculation methods, etc.
  • the number of parameters included in the symbol prediction parameters corresponding to different sub-stream types may be different or the same.
  • the values of the same symbol prediction parameter corresponding to different sub-stream types may be different or the same.
  • steps 1 and 2 are not strictly fixed. You can also first determine the current encoding sub-stream type and obtain the symbol prediction parameters corresponding to the sub-stream type to determine the current image block. coefficients for sign prediction. It is also possible to first determine the current encoding sub-stream type, determine to perform symbol prediction on the coefficients of the current image block, and obtain the symbol prediction parameters corresponding to the sub-stream type.
  • step 1 Determining the current encoding sub-stream type can be omitted.
  • Step 3 Perform a symbol prediction process on the coefficients of the image block according to the symbol prediction parameters.
  • a video codec may separately reconstruct a transform block using the positive and negative signs of a predicted coefficient, which is called a "hypothetical reconstruction".
  • Two hypothesis reconstructions are evaluated using a predefined cost function, and the hypothesis reconstruction with the smallest cost function is used to generate the predicted estimate sign of the predicted coefficient.
  • N different symbol combinations are used to generate 2 N hypothesis reconstructions corresponding to each symbol combination.
  • Each hypothesis is evaluated against a predefined cost function, and the hypothesis with the smallest cost function is used to reconstruct a combination of the symbols of the predicted estimates that generate the predicted coefficients.
  • a template-based symbol prediction method is described in JVET proposal D0031.
  • n non-zero coefficients are selected in the coefficient block for symbol prediction, and the corresponding templates are calculated for the n coefficients.
  • a single inverse transform operation is first performed on the inverse quantized coefficients, setting the signs of all predicted coefficients to positive values, and the prediction of the current block corresponds to the boundary reconstruction of the first hypothesis.
  • the first hypothesis reconstruction and template are further used to construct the remaining 2 n -1 hypotheses.
  • the calculation method is shown in Table 2:
  • the cost function is typically used to measure the spatial discontinuity between the previously reconstructed adjacent pixels and the hypothesized reconstruction using each hypothesis, as shown in Figure 6.
  • the hypothetical nearest symbol combination that minimizes the cost function is the predicted estimated symbol.
  • Step 4 Encode the coefficients of the current image block based on the results of the symbol prediction process.
  • Encoding the coefficients of the current image block includes encoding the absolute value of the coefficient of the current image block and the symbol of the coefficient of the current image block. Coding the coefficient symbols of the current image block further includes using a first encoding method for the symbols of the coefficients for symbol prediction to obtain a first encoding result.
  • the first encoding method may be used for the symbols of the coefficients for symbol prediction.
  • the symbol prediction difference of the coefficients for symbol prediction may be encoded by the first encoding method.
  • the symbol prediction difference refers to the difference between the predicted symbol and the original symbol. For example, when the original sign of the coefficient is positive, if the predicted sign is also positive, that is, the sign prediction is correct, then the sign prediction difference can be represented by "0". On the contrary, if the predicted sign is negative, that is, the sign prediction is wrong. , then the sign prediction difference can be represented by "1".
  • a second encoding method may be used for symbols of remaining coefficients other than the predicted coefficients to obtain a second encoding result.
  • the first encoding method and the second encoding method may be the same or different.
  • the first encoding method and the second encoding method can use conventional encoding methods, such as CABAC encoding, bypass encoding, and so on.
  • Step 5 Add the encoding result to the sub-stream corresponding to the sub-stream type.
  • the encoding result includes at least a first encoding result and/or a second encoding result.
  • the symbol prediction method can also be applied to only part of the coding layer sub-streams, and the symbol prediction method is not used for the rest of the coding layer sub-streams.
  • the symbol prediction method is only applied to the base layer sub-streams, and the enhancement layer sub-streams are No symbol prediction method is applied to the code stream.
  • the order of steps 1 and 2 is not completely fixed. You can also perform step 2 "Determine the current encoding sub-stream type and obtain the symbol prediction parameters corresponding to the sub-stream type" first, and then perform step 1. Determine the symbol prediction for the coefficients of the current image block".
  • the symbol prediction parameters are also related to the symbol prediction method used. This solution does not limit the specific symbol prediction method.
  • a symbol prediction method based on a neural network can also be used. Or other symbol prediction methods optimized for the symbol prediction method described in this embodiment, etc.
  • transform coefficient scanning order for an 8*8 image block is introduced in the description related to Figure 1 .
  • These transform coefficients are further quantized and then scanned and encoded in a zigzag sequence. This arrangement helps place low-frequency non-zero coefficients before high-frequency coefficients.
  • a method of rearranging the transform coefficients and then performing hierarchical coding is also proposed.
  • the 4 coefficients in the upper left corner can be encoded as the data of the base layer; among the 16 coefficients in the upper left corner, except for 4 in the base layer
  • the remaining 12 coefficients other than the coefficients are encoded as the data of the first enhancement layer; the coefficients from 17-48 are encoded as the data of the second enhancement layer; the remaining 16 coefficients in the lower right corner are encoded as the data of the third enhancement layer.
  • the first 16 coefficients can also be encoded as the data of the base layer
  • the coefficients from 17 to 32 can be encoded as the data of the first enhancement layer
  • the remaining 32 coefficients can be encoded as the data of the second enhancement layer, etc.
  • this embodiment provides another example of predicting the symbols of transform coefficients in a layered coded video stream, as shown in Figure 8, which includes the following steps:
  • Step 1 Determine the symbol prediction for the coefficients of the current image block
  • step 1 same as step 1 in specific embodiment one.
  • Step 2 Determine to use the hierarchical coding method based on coefficient importance for the current image block
  • Step 3 Determine the current encoding sub-stream type and obtain the symbol prediction parameters corresponding to the sub-stream type
  • step 3 Determine the current encoding sub-stream type and obtain the symbol prediction parameters corresponding to the sub-stream type
  • Step 2 Determine to use the hierarchical coding method based on coefficient importance for the current image block.
  • the current coding sub-stream type can only be a base layer sub-stream or a dependent enhancement layer sub-stream.
  • Step 4 Perform a symbol prediction process on the coefficients corresponding to the sub-stream type in the image block according to the symbol prediction parameters;
  • the reordered coefficients are encoded as coefficients of different coding layers according to their positions.
  • the coefficients corresponding to the sub-stream type refer to a part of the coefficients corresponding to the image block.
  • the coefficients corresponding to all sub-stream types can be combined to form the complete coefficients corresponding to the image block.
  • Step 5 Encode the coefficients corresponding to the sub-stream type in the current image block based on the result of the symbol prediction process
  • Step 6 Add the encoding result to the sub-stream corresponding to the sub-stream type
  • the enhancement layer sub-stream is a dependent enhancement-layer sub-stream, that is, the dependent enhancement-layer sub-stream needs to be decoded together with the base layer sub-stream to provide Higher quality video images. Therefore, a flag needs to be added to the sub-code stream to indicate that the sub-code stream type is an enhancement layer-dependent sub-code stream.
  • the sub-code stream may also include an extraction decoding metadata mode flag bit, which is used to instruct the decoder when decoding non-highest enhancement layer sub-streams or reference layer sub-streams. , it is necessary to buffer or store decoding metadata for use when decoding subsequent enhancement layer sub-streams; it can also be used to instruct the decoder to obtain the reference layer sub-codes on which the enhancement layer sub-streams depend when decoding the enhancement layer sub-streams.
  • Decoding metadata of the stream including but not limited to inverse transform coefficients or inverse quantization coefficients.
  • the extraction decoding metadata mode flag bit can also be replaced by a coefficient-based hierarchical coding flag bit, which is used to indicate that the decoding end needs to buffer or store decoding elements when decoding non-highest enhancement layer sub-streams or reference layer sub-streams.
  • the data is used when decoding subsequent enhancement layer sub-streams; it can also be used to instruct the decoder to obtain the decoding metadata of the reference layer sub-stream on which the enhancement layer sub-streams depend, so
  • the decoding metadata includes but is not limited to inverse transform coefficients or inverse quantization coefficients. The functions of the extraction decoding metadata mode flag and the coefficient-based hierarchical encoding flag mentioned in the subsequent description are equivalent.
  • the symbol prediction method in this embodiment can also be replaced by other symbol processing methods, including but not limited to symbol bit hiding methods.
  • This embodiment provides a method for processing the symbols of coding coefficients in a layered coding video stream, as shown in Figure 9, which includes the following steps:
  • Step 1 Determine the current encoding sub-stream type
  • the current encoding sub-stream type includes but is not limited to a base layer sub-stream and an enhancement layer sub-stream, wherein the enhancement layer sub-stream may further include an independent enhancement layer sub-stream or a dependent enhancement layer sub-stream.
  • the sub-code stream type corresponds to the layer identifier of the sub-code stream.
  • Step 2 Determine the first symbol processing method and the second symbol processing method for the coefficients of the current image block
  • the first symbol processing method refers to a method of first selecting the coefficients of the image block for symbol processing
  • the second symbol processing method refers to performing symbol processing on the remaining coefficients in the image block except for the coefficients selected by the first symbol processing method. method.
  • the first symbol processing method and the second symbol processing method include, but are not limited to, any combination of a symbol prediction method and a symbol bit hiding method.
  • the video encoder may determine to perform first symbol processing and second symbol processing on the coefficients of the current block according to certain conditions. These conditions can be the characteristics of the current image block, for example, the size of the block, the distribution of corresponding coefficients, the number of non-zero coefficients, prediction mode, transformation method, and information of adjacent image blocks, etc. In addition, you can also determine whether the two symbol processing methods are allowed to be turned on by obtaining the local configuration file. You can also determine whether the current encoding sub-stream type is suitable for the current encoding sub-stream. The previous image block undergoes first symbol processing and second symbol processing.
  • Methods for determining the first symbol processing method and the second symbol processing method include but are not limited to: determining based on configuration information; determining based on the priorities corresponding to the two symbol processing methods; adaptively determining based on the characteristics of the aforementioned image block; based on the current image
  • the characteristics of the image where the block is located and/or the sequence of the image where the current image block is located are adaptively determined; determined based on the calculation results of the cost function or rate-distortion function;
  • Symbol bit hiding refers to symbols that can be inferred according to predetermined rules to derive the coefficients of the hidden symbols.
  • the predetermined rule may be a predetermined check function.
  • the sign value of the coefficient of the hidden symbol corresponds to the value of the check function of the coefficient set. For example, by calculating the sum of the absolute values of all non-zero transformation coefficients in the coefficient set, a parity judgment is made on the sum of absolute values.
  • an even number indicates that the estimated sign of the coefficient of the hidden symbol is positive, and an odd number indicates that the estimated sign of the coefficient of the hidden symbol is positive.
  • the estimated sign of the coefficient is negative.
  • the coefficient of the hidden symbol may be the first non-zero transformation coefficient in the coefficient set, or may be selected through other rules.
  • the coefficient of the hidden symbol may be one or multiple. The existing technology of symbol bit hiding will not be described in too much detail here.
  • Step 3 Obtain the first symbol processing parameter and the second symbol processing parameter corresponding to the sub-stream type
  • the first symbol processing method and the second symbol processing method include but are not limited to any combination of a symbol prediction method and a symbol bit concealment method. Therefore, the first symbol processing parameters and the second symbol processing parameters also include, but are not limited to, any combination of symbol prediction parameters and symbol bit hiding parameters.
  • the symbol prediction parameters may include, but are not limited to, the number of coefficients for symbol prediction, and/or the maximum value of the coefficients for symbol prediction, and/or the method for symbol prediction.
  • the methods for symbol prediction include but are not limited to template generation methods, hypothesis reconstruction generation methods, cost function calculation methods, etc.
  • the sign bit concealment parameters may include, but are not limited to, the number of coefficients for sign bit concealment, and/or the maximum value of the coefficients for sign bit concealment, and/or the method for sign bit concealment.
  • the parameter types and the number of parameters included in the first symbol processing parameters or the second symbol processing parameters corresponding to different sub-stream types may be different, or they may be the same.
  • the value of the same symbol processing parameter in the first symbol processing parameter or the second symbol processing parameter corresponding to different sub-stream types may be different, or may be the same.
  • Step 4 Perform a first symbol processing process on the coefficients of the image block according to the first symbol processing parameters
  • the first symbol processing method is a symbol prediction method as an example.
  • the symbol of the coefficient of the image block is predicted according to the symbol prediction parameters.
  • the symbol prediction method refer to the first embodiment or the second embodiment.
  • Step 5 Perform a second symbol processing process on the remaining coefficients of the image block according to the second symbol processing parameters
  • the remaining coefficients of the image block refer to the coefficients of the image block except the coefficients that have been subjected to the first symbol processing in step 4.
  • Step 6 Encode the coefficients of the current image block based on the first symbol processing result and the second symbol processing result.
  • Encoding the coefficients of the current image block includes encoding the absolute value of the coefficient of the current image block and the symbol of the coefficient of the current image block.
  • the encoding of the coefficient symbols of the current image block further includes that the symbol of the coefficient processed by the first symbol may adopt a first encoding method, the symbol of the coefficient processed by the second symbol may adopt a second encoding method and the symbol divided by the first symbol may be used.
  • the symbols of the remaining coefficients other than the coefficients processed by the second symbol processing may use a third encoding method.
  • the first encoding method, the second encoding method and the third encoding method may be the same or different.
  • the CABAC encoding method can be used for the signs of the coefficients processed by the first symbol and the symbols of the coefficients processed by the second symbol, and for the coefficients in the current image block except those processed by the first symbol and the second symbol
  • the signs of the remaining coefficients can be encoded using a bypass encoding method.
  • the encoding result is added to the sub-code stream corresponding to the sub-code stream type.
  • the sub-code stream optionally includes any combination of one or more of first symbol processing method indication information, first symbol processing parameter information, second symbol processing method indication information, and second symbol processing parameter information.
  • the first symbol processing method indication information may be a first symbol processing method enable flag
  • the second symbol processing method indication information may be a second symbol processing method enable flag.
  • All the above parameter information or indication information can be carried in the Video Parameter Set (VPS for short) VPS, Sequence Parameter Set (SPS for short), Picture Parameter Set (PPS for short) , Any one or more parameter sets in the Adaptive Parameter Set (APS for short) can also be carried in the SEI message, or can be carried in the code stream in any other way.
  • VPS Video Parameter Set
  • SPS Sequence Parameter Set
  • PPS Picture Parameter Set
  • APS Adaptive Parameter Set
  • the embodiment of the present invention also provides a decoding method, as shown in Figure 10, including the following steps:
  • S1004 Determine the symbols of the coefficients corresponding to each of the sub-code streams based on the target symbol processing method and target symbol processing parameters corresponding to each of the sub-code streams;
  • S1006 Decode each sub-stream in the layered coded video stream based on the symbol of the coefficient corresponding to each sub-stream.
  • What performs the above operations may be a decoding device (for example, a video decoder), or a processor provided within the decoding device, or a processor provided independently from the decoding device. Of course, it may also be other devices with similar decoding capabilities.
  • the sub-streams in the layered coding (also called scalable decoding) video streams include but are not limited to base layer sub-streams or enhancement layer sub-streams, where the enhancement layer sub-streams can also be It further includes an independent enhancement layer sub-stream or a dependent enhancement layer sub-stream.
  • the above-mentioned target symbol processing method includes at least one of the symbol prediction method, the symbol bit hiding method, and other types of symbol processing methods. It should be noted that when performing symbol processing on the coefficients of the image block, a symbol processing can be used. The method processes the coefficients of the image block. You can also use a variety of symbol processing methods to process the coefficients of the image block. That is, a symbol processing method is used to process a part of the coefficients of the image block. Different symbol processing methods The coefficients processed are different, and multiple symbol processing methods can have corresponding processing priorities, that is, the one with the highest priority is executed first. In an optional embodiment, obtaining the target symbol processing parameters corresponding to each sub-code stream includes at least one of the following:
  • the method further includes: When it is determined that the currently decoded sub-stream is a reference layer sub-stream, store the decoding result of the currently decoded sub-stream; or, when it is determined that the currently decoded sub-stream is a reference layer sub-stream, Decoding metadata of the currently decoded sub-stream is stored.
  • the reference layer sub-stream can be a base layer sub-stream or a non-highest layer sub-stream. When decoding the reference layer sub-stream, it is necessary to store the decoding result or the decoding metadata of the reference layer sub-stream. For use when decoding subsequent enhancement layer sub-streams.
  • obtaining the target symbol processing method and target symbol processing parameters corresponding to each sub-code stream includes: determining the target symbol processing corresponding to the currently decoded sub-code stream based on the type of the currently decoded sub-code stream. Method and target symbol processing parameters. It should be noted that the target symbol processing methods and target symbol processing parameters corresponding to each sub-code stream may be the same or different. In addition, the target symbol processing methods corresponding to each sub-code stream may also have the same method and parameters. different.
  • the method further includes at least one of the following: obtaining indication information carried in the layered encoded video code stream, and determining the type of the currently decoded sub-code stream based on the indication information. ; Acquire the identification information carried in the layered coded video code stream, and perform at least one of the following operations based on the identification information: when the currently decoded sub-code stream is a reference layer sub-code stream, store the current decoded sub-code stream The decoding result or decoding metadata of the sub-code stream is used when decoding the subsequent enhancement layer sub-code stream; when the currently decoded sub-code stream is an enhancement layer sub-code stream, obtaining the enhancement layer sub-code stream depends on The decoding result or decoding metadata of the reference layer sub-stream.
  • obtaining the target symbol processing method and target symbol processing parameters corresponding to each sub-code stream includes: obtaining the target number of symbol processing methods corresponding to the currently decoded sub-code stream; determining the target number based on the target number. Describe the target symbol processing method and target symbol processing parameters corresponding to the currently decoded sub-stream.
  • the symbol processing method corresponding to the currently decoded sub-code stream may be one or multiple (that is, multiple symbol processing methods process the coefficients of the image block).
  • the processing parameters corresponding to each method need to be obtained separately.
  • the symbol processing parameters corresponding to different symbol processing methods can be the same or different.
  • determining the target symbol processing method and target symbol processing parameters corresponding to the currently decoded sub-stream based on the target number includes:
  • the target number is 1, determine the target symbol processing method and target symbol processing parameters corresponding to the currently decoded sub-stream based on the type of the currently decoded sub-stream;
  • each of the target symbol processing methods and corresponding target symbol processing parameters are determined respectively, as well as the processing order of each of the target symbol processing methods.
  • the processing order of each target symbol processing method may be pre-configured, or may be determined based on actual application scenarios. Of course, it may also be default.
  • determining the target symbol processing method and target symbol processing parameters corresponding to the currently decoded sub-stream based on the type of the currently decoded sub-stream includes:
  • the currently decoded sub-stream is an enhancement layer-dependent sub-stream
  • obtaining the decoding metadata of the reference layer sub-stream of the currently decoded sub-stream included in the layered coded video stream Determine the coefficients of the currently decoded sub-stream and the signs of the coefficients based on the decoding metadata of the reference layer sub-stream; and/or,
  • the currently decoded sub-code stream is an enhancement layer-dependent sub-code stream
  • the decoded image referenced by the image corresponding to the sub-code stream, and the coefficients of the currently decoded sub-code stream and the signs of the coefficients are determined based on the decoded image.
  • determining the symbol of the coefficient corresponding to each sub-code stream based on the target symbol processing method and target symbol processing parameters corresponding to each sub-code stream includes:
  • symbol prediction processing and sign bit hiding processing can be flexibly set.
  • the symbol prediction processing can be performed first, and then the sign bit hiding processing can be performed, or the sign bit hiding processing can be performed first, and then the symbol bit hiding processing can be performed.
  • Perform symbol prediction processing Of course, if supported, symbol prediction processing and sign bit hiding processing can also be performed simultaneously.
  • This embodiment provides a symbol processing method when decoding a layered encoded video stream, as shown in Figure 11, including the following steps:
  • Step 1 Obtain the layered encoding video stream
  • the number of sub-streams included in the layered encoded video stream and the layer identifiers corresponding to the sub-streams can be determined based on the layered encoded video stream.
  • the layered coded video code stream should include a base layer sub-stream and at least one enhancement layer sub-stream. Therefore, the number of sub-code streams should be greater than or equal to 2, and the enhancement layer sub-stream can be an independent enhancement layer. Layer sub-stream or dependent enhanced layer sub-stream.
  • the base layer sub-stream can be decoded independently to provide basic quality video content.
  • the independent enhancement layer sub-stream can be independently decoded to provide higher quality video content.
  • the dependent enhancement layer sub-stream needs to be decoded together with the base layer sub-stream to provide higher quality video content. quality video content.
  • Step 2 Obtain the symbol processing method corresponding to each sub-code stream layer and its corresponding symbol processing parameters.
  • the symbol processing methods include, but are not limited to, symbol prediction methods, symbol bit hiding methods, and any combination thereof.
  • the symbol prediction parameters may include, but are not limited to, the number of coefficients for symbol prediction, and/or the maximum value of the coefficients for symbol prediction, and/or the method for symbol prediction.
  • the methods for symbol prediction include but are not limited to template generation methods, hypothesis reconstruction generation methods, cost function calculation methods, etc.
  • the sign bit concealment parameters may include, but are not limited to, the number of coefficients for sign bit concealment, and/or the maximum value of the coefficients for sign bit concealment, and/or the method for sign bit concealment.
  • the symbol processing parameters may be obtained from local configuration information, or may be obtained from code streams or media files, or may be partially obtained from configuration information and partially obtained from code streams. In addition, when the symbol prediction method and the symbol bit concealment method are used simultaneously, indication information of the sequence of the symbol prediction and symbol bit concealment methods may be further included.
  • the above symbol processing parameter information can be obtained directly in the code stream, or can be obtained in local configuration information.
  • the local configuration information can be predetermined rules jointly followed by the encoding end and the decoding end, or can be obtained through the code stream. It can be derived from other parameter information passed in the stream, or it can also be derived from the parameter information passed in the code stream and the local configuration information. derived.
  • the symbol processing method corresponding to each sub-code stream layer may be further limited to the symbol processing method corresponding to each image block of each sub-code stream layer. Because in the actual decoding process, the decoder decodes image blocks block by block, it can be understood as the symbol processing method corresponding to the currently decoded image block in the currently decoded sub-stream layer.
  • the number of symbol processing methods and symbol processing methods corresponding to all image blocks in the same sub-code stream layer may be the same or different. Furthermore, the number of symbol processing methods and symbol processing methods corresponding to all image blocks in the same frame in the same code stream layer The number of methods can also be the same or different. For the convenience of explanation in the following examples, it is still simply described as the symbol processing method corresponding to each sub-code stream layer.
  • Step 3 Determine the corresponding coefficients and their symbols in each sub-code stream according to the symbol processing method and its corresponding symbol parameters.
  • Determining the corresponding coefficients and their symbols in each coding layer sub-stream may include the following two parts: determining the symbol-processed coefficients and their corresponding symbols according to the symbol processing method and their corresponding symbol parameters; and/or not Sign-processed coefficients and their corresponding signs. Determining symbol-processed coefficients and their corresponding symbols according to the symbol processing method and their corresponding symbol parameters, depending on the symbol processing method, may further include: determining according to the symbol prediction method and its corresponding symbol parameters.
  • the symbol-predicted coefficients and their corresponding symbols, and/or the symbol-bit hidden coefficients and their corresponding symbols determined according to the symbol bit hiding method and their corresponding symbol parameters, are detailed in steps 3.1 and 3.2 in the fifth embodiment. description.
  • Step 4. Perform the subsequent decoding process to obtain the decoded image.
  • the decoding result may be a decoded image and/or decoded metadata. For details, see the explanation in Specific Embodiment 5.
  • This embodiment provides an embodiment of the decomposition step of step 3 in the fourth embodiment of "determining the corresponding coefficients and their symbols in each coding layer sub-stream according to the symbol processing method and its corresponding symbol parameters", As shown in Figure 12, it includes the following steps:
  • Step 3.1 Determine the absolute value and sign of the symbol-processed coefficient according to the symbol processing method and parameters
  • the symbol processing method is a symbol prediction method
  • determine the predicted coefficients of the symbols and their corresponding symbol values according to the symbol prediction parameters may include the following steps: perform the following steps on the difference between the estimated symbols and the original symbols.
  • Decoding performing the symbol prediction process to obtain the predicted estimated symbols, and correcting the predicted estimated symbols based on the differences obtained by decoding, to obtain the final symbols.
  • n coefficients corresponding to the specific embodiment 1 are used as an example to illustrate the symbol prediction process.
  • the video decoder can perform a single inverse transformation operation on the inverse quantization coefficients, and set the symbols of all predicted coefficients to positive values.
  • the prediction of the current block corresponds to the boundary reconstruction of the first hypothesis.
  • the decoder further calculates the corresponding templates for n coefficients.
  • the template is generated by performing an inverse transformation operation on each coefficient as a block of unique non-zero coefficients, and then using its leftmost and topmost boundary values as the template corresponding to the coefficient. Multiple hypotheses are constructed using the previously saved first hypothesis reconstruction and template, so that the nearest symbol combination of the hypothesis with the smallest cost function is the predicted estimated symbol.
  • the decoding end determines the coefficient of the symbol being hidden and its corresponding symbol value according to the symbol bit hiding parameter. This process can include the following steps:
  • the symbol processing method includes both a symbol prediction method and a symbol bit hiding method and the priority of the symbol prediction method is changed When it is high, first determine the coefficients whose symbols are predicted and their corresponding symbol values based on the symbol prediction parameters, and determine the coefficients whose symbols are hidden and their corresponding symbol values among the remaining coefficients based on the symbol bit hiding parameters. On the contrary, when the symbol processing method includes both a symbol prediction method and a symbol bit hiding method and the symbol bit hiding method has a higher priority, first determine the hidden coefficient of the symbol and its corresponding symbol value according to the symbol bit hiding parameter, And among the remaining coefficients, the coefficients whose symbols are predicted and their corresponding symbol values are determined according to the symbol prediction parameters.
  • Step 3.2 Obtain the absolute values of the remaining unsigned coefficients and their corresponding signs
  • the coefficients obtained from the decoded code stream are the remaining coefficients that have not been symbol processed. Usually, these coefficients are transmitted in the form of absolute values.
  • the corresponding symbols can be obtained from the bypass encoding code stream.
  • Step 3.3 Determine whether the current sub-stream is an enhancement layer-dependent sub-stream. If so, proceed to step 3.4. Otherwise, proceed to step 4:
  • Determining whether the sub-code stream is dependent on the enhancement layer is an existing technology.
  • Step 3.4 determines whether it is a coefficient-based hierarchical coding mode. If so, perform step 3.6; otherwise, perform step 3.5;
  • Determining whether it is a coefficient-based hierarchical coding mode may be in any of the following ways: determining that the code stream contains a flag bit based on the coefficient-based hierarchical coding mode. The flag bit is used to instruct the decoder when decoding the enhancement layer-dependent sub-code stream. It is necessary to extract the decoding metadata of the base layer sub-stream and/or the lower enhancement layer sub-stream.
  • the decoding metadata of the base layer sub-stream and/or the lower enhancement layer sub-stream should include at least step 3.1 and steps The coding coefficients obtained in 3.2 and their corresponding symbols.
  • the base layer sub-code stream may be a sub-code stream with a layer identifier (layer_id) equal to 0, and the lower enhancement layer sub-code stream may be a sub-code stream with a layer identifier (layer_id) smaller than the current sub-code stream layer identifier.
  • Step 3.5 Obtain the decoded image of the reference layer as the reference image
  • the reference layer decoded image is usually cached in the decoded picture buffer (Decoded Picuture Buffer, DPB) of the decoder, from which the decoder can obtain the decoded image referenced by the currently decoded sub-stream image.
  • DPB Decoded Picuture Buffer
  • Step 3.6 Obtains the decoding metadata of the reference layer sub-stream
  • the reference layer sub-code stream includes a base layer sub-code stream, that is, a sub-code stream with a layer identifier equal to 0, and/or a reference layer enhanced sub-code stream, that is, a sub-code stream with a layer identifier smaller than the current sub-code stream layer identifier.
  • the sub-code stream is the reference layer of the current sub-code stream.
  • Obtaining the decoding metadata of the reference layer sub-stream is to obtain the absolute value and symbol of the coefficient of the reference layer sub-stream, including but not limited to the absolute value of the coefficient and its corresponding symbol obtained in step 3.1 and step 3.2.
  • this embodiment may also need to perform the following operations: when determining that the current sub-code stream layer is a reference layer, further determine whether it is a coefficient-based hierarchical coding mode. If it is a coefficient-based hierarchical coding mode, set the current sub-code stream layer to the reference layer. The decoded metadata of the code stream is stored for subsequent reference use by other sub-code stream layers; conversely, if it is not based on the coefficient hierarchical coding mode, the decoded image of the current sub-code stream is stored for subsequent reference use by other sub-code stream layers;
  • This embodiment provides yet another symbol processing method when decoding a layered coded video stream. As shown in Figure 13, it includes the following steps:
  • Step 1 Obtain the layered encoding video stream
  • Step 2 Obtain the number of symbol processing methods corresponding to each sub-code stream layer
  • Obtaining the number of symbol processing methods corresponding to each sub-code stream layer includes but is not limited to: determining according to the configuration information.
  • the configuration information can be that the number of symbol processing methods for sub-code streams other than the basic layer is 1; or turning on according to the instructions in the code stream.
  • symbol The number of processing methods is determined; or it is determined based on the maximum number of symbol processing methods indicated in the code stream and/or media file, etc.
  • Step 3 Whether the current sub-code stream layer only contains one symbol processing method, if so, proceed to step 4, otherwise proceed to step 5;
  • the decoding end selects the sub-code stream layer that currently needs to be decoded, and further determines whether the number of symbol processing methods corresponding to the current sub-code stream layer only includes one type of symbol processing based on the number of symbol processing methods corresponding to each sub-code stream layer obtained in step 2. method. It should be noted here that the decoding end can also select the sub-code stream layer that currently needs to be decoded as the current code stream layer before step 2, and then determine the number of symbol processing methods corresponding to the current code stream layer.
  • Step 4 Go to step 3 in the fourth specific embodiment
  • Step 5 Determine the first symbol processing method and the second symbol processing method and their corresponding symbol processing parameters
  • the first symbol processing method and the second symbol processing method include but are not limited to any combination of a symbol prediction method and a symbol bit concealment method. Therefore, the first symbol processing parameters and the second symbol processing parameters also include, but are not limited to, any combination of symbol prediction parameters and symbol bit hiding parameters.
  • the symbol prediction parameters may include, but are not limited to, the number of coefficients for symbol prediction, and/or the maximum value of the coefficients for symbol prediction, and/or the method for symbol prediction.
  • the methods for symbol prediction include but are not limited to template generation methods, hypothesis reconstruction generation methods, cost function calculation methods, etc.
  • the sign bit concealment parameters may include, but are not limited to, the number of coefficients for sign bit concealment, and/or the maximum value of the coefficients for sign bit concealment, and/or the method for sign bit concealment.
  • the symbol processing parameters may be obtained from local configuration information, or may be obtained from code streams or media files, or may be partially obtained from configuration information and partially obtained from code streams.
  • the parameter types and the number of parameters contained in the corresponding first symbol processing parameters or second symbol processing parameters in different sub-stream layers may be different, or they may be the same.
  • the value of the same symbol processing parameter in the first symbol processing parameter or the second symbol processing parameter corresponding to different sub-stream types may be different, or may be the same.
  • the parameter types and the number of parameters contained in the first symbol processing parameters or the second symbol processing parameters corresponding to different image blocks may be different, or they may be the same.
  • the value of the same symbol processing parameter in the first symbol processing parameter or the second symbol processing parameter corresponding to different sub-stream types may be different, or may be the same.
  • Step 6 Determine the coefficients and symbols of the current sub-code stream layer according to the first and second symbol processing methods and parameters
  • Determining the coefficients of the current sub-code stream layer and their symbols may further include the following steps: determining the first coefficients of the current sub-code stream layer and their corresponding symbols according to the first symbol processing method and its parameters; and processing according to the second symbol The method and its parameters determine the second coefficient of the current sub-code stream layer and its corresponding symbol; determine the remaining third coefficient and its corresponding symbol except for the coefficients processed by the first symbol and the second symbol.
  • the coefficients and their symbols of the current sub-code stream layer include first coefficients and their symbols, second coefficients and their symbols, and third coefficients and their symbols.
  • the first coefficient, the second coefficient and the third coefficient may each include the absolute value of one or more coefficients.
  • Step 7 Execute the subsequent decoding process to obtain the decoded image
  • the method according to the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present invention can be embodied in the form of a software product in essence or the part that contributes to the existing technology.
  • the computer software product is stored in a storage medium (such as ROM/RAM, disk, CD), including several instructions to enable a terminal device (which can be a mobile phone, computer, Server, or network device, etc.) performs the methods described in various embodiments of the present invention.
  • This embodiment also provides an encoding device and a decoding device, which are respectively used to implement the above-mentioned encoding embodiment and preferred implementation mode and decoding embodiment and preferred real-time mode. Those that have been described will not be described again.
  • the term "module” may be a combination of software and/or hardware that implements a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
  • Figure 14 is a structural block diagram of an encoding device according to an embodiment of the present invention. As shown in Figure 14, the device includes:
  • the first determination module 142 is configured to determine the target type of the currently encoded target sub-stream, as well as the target symbol processing method and target symbol processing parameters corresponding to the target type;
  • the processing module 144 is configured to perform target symbol processing on the coefficients of the current image block according to the target symbol processing method based on the target symbol processing parameters;
  • the encoding module 146 is configured to encode the coefficients of the current image block based on the processing result of the target symbol processing.
  • the device further includes a third determination module configured to perform target symbol processing on the coefficients of the current image block based on the target symbol processing parameter according to the target symbol processing method based on the third determination module.
  • a condition determines that the target symbol processing needs to be performed on the coefficients of the current image block, wherein the first condition includes at least one of the following: the feature size of the current image block, the distribution of the coefficients of the current image block status, the number of non-zero coefficients in the current image block, the processing mode of the target symbol processing, the transformation method, the characteristic information of other image blocks adjacent to the current image block, local configuration information, the target sub- The target type of the code stream, the priorities of multiple symbol processing methods, the characteristics of the image where the current image block is located, the characteristics of the sequence of the image where the current image block is located, and the calculation results of the cost function or rate distortion function.
  • the encoding module 146 includes: a first encoding unit configured to encode coefficients included in the current image block that have been subjected to the target symbol processing and coefficients that have not been subjected to the target symbol processing.
  • the coefficients are encoded respectively, wherein the encoding method for encoding the coefficients that have been subjected to the target symbol processing is the same as or different from the encoding method for encoding the coefficients that have not been subjected to the target symbol processing; wherein, the target symbol processing method Including one or more; when the target symbol processing method includes a plurality of processing methods, using a coding method to encode the coefficients included in the current image block that have been subjected to the target symbol processing; in When the target symbol processing method includes multiple processing methods, the coefficients included in the current image block that have been subjected to target symbol processing according to different target symbol processing methods are separately encoded, and the coefficients included in the current image block are encoded according to the different target symbol processing methods.
  • the encoding module 146 includes: a first determination unit configured to determine coefficients based on a processing result of the symbol prediction processing when the target symbol processing method includes a symbol prediction processing method. The difference between the predicted symbol and the original symbol; the second encoding unit is configured to encode the difference according to the encoding method corresponding to the symbol prediction processing method.
  • the device further includes: a first adding module configured to, after encoding the coefficients of the current image block based on the processing result of the target symbol processing, add the encoding result to Added to the target sub-stream.
  • a first adding module configured to, after encoding the coefficients of the current image block based on the processing result of the target symbol processing, add the encoding result to Added to the target sub-stream.
  • the device further includes: a fourth determination module configured to determine the target symbol based on the target symbol. Processing Results Before encoding the coefficients of the current image block, it is determined that the coefficients of the current image block need to be encoded in a hierarchical encoding method based on coefficient importance.
  • the fourth determination module includes: a second determination unit configured to determine the coefficients of the current image block that need to be encoded in a hierarchical coding manner based on coefficient importance based on at least one of the following methods: To encode:
  • the device further includes: a sorting module configured to reorder the coefficients of the current image block according to coefficient importance; and a fifth determination module configured to reorder the coefficients according to the reordered The position of the coefficients of the current image block determines the coding layer to which each coefficient belongs.
  • the device further includes a second adding module configured to perform at least one of the following operations after encoding the coefficients of the current image block based on the processing result of the target symbol processing:
  • identification information is used to indicate at least one of the following: when the decoding end decodes the reference layer sub-stream, it needs to store decoding results or decoding metadata for decoding subsequent enhancements. layer sub-stream; when decoding the enhancement layer sub-stream, the decoding end obtains the decoding result or decoding metadata of the reference layer sub-stream on which the enhancement layer sub-stream depends.
  • the target symbol processing includes at least one of the following processing: symbol prediction processing and symbol bit hiding processing.
  • Figure 15 is a structural block diagram of a decoding device according to an embodiment of the present invention. As shown in Figure 15, the device includes:
  • the acquisition module 152 is configured to acquire the target symbol processing method and target symbol processing parameters corresponding to each sub-stream when receiving the layered encoded video code stream;
  • the second determination module 154 is configured to determine the symbol of the coefficient corresponding to each of the sub-code streams based on the target symbol processing method and target symbol processing parameters corresponding to each of the sub-code streams;
  • the decoding module 156 is configured to decode each sub-stream in the layered coded video stream based on the sign of the coefficient corresponding to each sub-stream.
  • the acquisition module 152 includes at least one of the following:
  • a first acquisition unit configured to acquire the target symbol processing parameters from local configuration information
  • a second acquisition unit configured to acquire the target symbol processing parameters from the layered encoded video stream or target media file
  • a third acquisition unit configured to determine the target symbol processing parameters based on parameter information included in the layered encoded video code stream.
  • the device further includes a storage module configured to store data based on the corresponding sub-stream After decoding each sub-stream in the layered coded video code stream with the coefficients and the symbols of the coefficients, when it is determined that the currently decoded sub-stream is a reference layer sub-stream, the currently decoded sub-stream is stored.
  • the acquisition module 152 includes: a third determination unit configured to determine the target symbol processing method and target symbol corresponding to the currently decoded sub-stream based on the type of the currently decoded sub-stream. Process parameters.
  • the device further includes at least one of the following:
  • the sixth determination module is configured to obtain the indication information carried in the layered encoded video code stream, and determine the type of the currently decoded sub-code stream based on the indication information;
  • a processing module configured to obtain identification information carried in the layered coded video code stream, and perform at least one of the following operations based on the identification information: when the currently decoded sub-code stream is a reference layer sub-code stream, store The decoding result or decoding metadata of the currently decoded sub-stream is used for decoding subsequent enhancement layer sub-streams; when the currently decoded sub-stream is an enhancement layer sub-stream, the enhancement layer sub-stream is obtained The decoding result or decoding metadata of the reference layer sub-stream on which the code stream depends.
  • the acquisition module 152 includes: a fourth acquisition unit, configured to acquire the target number of symbol processing methods corresponding to the currently decoded sub-stream; a fourth determination unit, configured to acquire the target number based on the target The quantity determines the target symbol processing method and target symbol processing parameters corresponding to the currently decoded sub-stream.
  • the fourth determining unit includes: a first determining subunit configured to determine the type of the currently decoded sub-stream based on the type of the currently decoded sub-code stream when the target number is 1.
  • the second determination subunit is configured to determine each of the target symbol processing methods and corresponding targets when the number of targets is greater than 1. Symbol processing parameters, and the processing order of each of the target symbol processing methods.
  • the third determination unit and the first determination sub-unit are configured to determine the currently decoded sub-stream based on the type of the currently decoded sub-stream in the following manner.
  • Corresponding target symbol processing method and target symbol processing parameters when it is determined that the currently decoded sub-code stream is an enhancement layer-dependent sub-code stream, obtain the currently decoded sub-code included in the layered coded video code stream.
  • Decoding metadata of the reference layer sub-stream of the stream determining the coefficients and symbols of the coefficients of the currently decoded sub-stream based on the decoding metadata of the reference layer sub-stream; and/or, after determining the currently decoded sub-stream
  • the code stream is a sub-code stream that depends on the enhancement layer, obtain the decoded image of the stored image reference corresponding to the currently decoded sub-code stream, and determine the value of the currently decoded sub-code stream based on the decoded image. coefficients and the signs of the coefficients.
  • the second determination module 154 includes: a fifth determination unit configured to determine the first coefficient included in the currently decoded sub-code stream according to symbol prediction processing and symbol prediction processing parameters. symbol, wherein the first coefficient is a coefficient that has been subjected to the symbol prediction process; the sixth determination unit is configured to determine the number included in the currently decoded sub-code stream according to the symbol bit concealment process and the symbol bit concealment process parameters. The sign of the second coefficient, wherein the second coefficient is the coefficient that has been subjected to the sign bit concealment process; the sixth determination unit is configured to determine the sign of the third coefficient included in the currently decoded sub-stream, Wherein, the third coefficient is a coefficient included in the currently decoded sub-code stream except for the first coefficient and the second coefficient.
  • each of the above modules can be implemented through software or hardware.
  • it can be implemented through It can be implemented in the following manner, but is not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are located in different processors in any combination.
  • Embodiments of the present invention also provide a computer-readable storage medium that stores a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
  • the computer-readable storage medium may include but is not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM) , mobile hard disk, magnetic disk or optical disk and other media that can store computer programs.
  • ROM read-only memory
  • RAM random access memory
  • mobile hard disk magnetic disk or optical disk and other media that can store computer programs.
  • An embodiment of the present invention also provides an electronic device, including a memory and a processor.
  • a computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
  • the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.
  • modules or steps of the present invention can be implemented using general-purpose computing devices. They can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices. They may be implemented in program code executable by a computing device, such that they may be stored in a storage device for execution by the computing device, and in some cases may be executed in a sequence different from that shown herein. Or the described steps can be implemented by making them into individual integrated circuit modules respectively, or by making multiple modules or steps among them into a single integrated circuit module. As such, the invention is not limited to any specific combination of hardware and software.

Landscapes

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

Abstract

本发明实施例提供了一种编码方法及装置、解码方法及装置、存储介质、电子装置,其中,该编码方法包括:确定当前编码的目标子码流的目标类型,以及与目标类型对应的目标符号处理方法以及目标符号处理参数(S402);基于目标符号处理参数按照目标符号处理方法对当前图像块的系数进行目标符号处理(S404);基于目标符号处理的处理结果对当前图像块的系数进行编码(S406)。

Description

编码方法及装置、解码方法及装置、存储介质、电子装置 技术领域
本发明实施例涉及通信领域,具体而言,涉及一种编码方法及装置、解码方法及装置、存储介质、电子装置。
背景技术
视频压缩编码广泛用于各类数字视频应用场景,包括数字电视、交互媒体、视频会议、视频点播、流媒体服务、远程视频监控、视频游戏等。无论是哪种应用,需要传输的数据量都非常大,对网络传输和存储空间的要求都非常高。而通过去除视频数据中的时空冗余信息可以有效地把数据量降低,既节约存储空间,又提高网络传输效率。
在相关技术中,在对图像块的系数进行符号处理时,通常所采用的是单一的处理方式,不会针对码流类型的不同来调整符号处理方式,由此导致符号处理方式的灵活性较低,进而导致编码效率较低以及编码复杂度高的问题。
发明内容
本发明实施例提供了一种编码方法及装置、解码方法及装置、存储介质、电子装置,以至少解决相关技术中存在的符号处理方式的灵活性较低,进而导致编码效率较低以及编码复杂度高的问题。
根据本发明的一个实施例,提供了一种编码方法,包括:确定当前编码的目标子码流的目标类型,以及与所述目标类型对应的目标符号处理方法以及目标符号处理参数;基于所述目标符号处理参数按照所述目标符号处理方法对当前图像块的系数进行目标符号处理;基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码。
根据本发明的一个实施例,还提供了一种解码方法,包括:在接收到分层编码视频码流的情况下,获取各个子码流对应的目标符号处理方法以及目标符号处理参数;基于各个所述子码流对应的目标符号处理方法以及目标符号处理参数确定各个所述子码流对应的系数的符号;基于各个所述子码流对应的系数的符号对所述分层编码视频码流中的各个子码流进行解码。
根据本发明的一个实施例,还提供了一种编码装置,包括:第一确定模块,设置为确定当前编码的目标子码流的目标类型,以及与所述目标类型对应的目标符号处理方法以及目标符号处理参数;处理模块,设置为基于所述目标符号处理参数按照所述目标符号处理方法对当前图像块的系数进行目标符号处理;编码模块,设置为基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码。
根据本发明的一个实施例,还提供了一种解码装置,包括:获取模块,设置为在接收到分层编码视频码流的情况下,获取各个子码流对应的目标符号处理方法以及目标符号处理参数;第二确定模块,设置为基于各个所述子码流对应的目标符号处理方法以及目标符号处理参数确定各个所述子码流对应的系数的符号;解码模块,设置为基于各个所述子码流对应的 系数的符号对所述分层编码视频码流中的各个子码流进行解码。
根据本发明的又一个实施例,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述编码方法实施例中的步骤,或者,执行上述解码方法实施例中的步骤。
根据本发明的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述编码方法实施例中的步骤,或者,执行上述解码方法实施例中的步骤。
附图说明
图1是相关技术中8*8变换块的系数扫描顺序示意图;
图2是相关技术中的视频编码器的逻辑处理框图;
图3是本发明实施例的编码方法或者解码方法的移动终端的硬件结构框图;
图4是根据本发明实施例的编码方法的流程图;
图5是根据本发明具体实施例一的编码流程图;
图6是根据本发明具体实施例一的确定预测估计符号的示意图;
图7是根据本发明具体实施例二的8*8变换块的系数扫描顺序示意图;
图8是根据本发明具体实施例二的编码流程图;
图9是根据本发明具体实施例三的编码流程图;
图10是根据本发明实施例的解码方法的流程图;
图11是根据本发明具体实施例四的解码流程图;
图12是根据本发明具体实施例五的解码流程图;
图13是根据本发明具体实施例六的解码流程图;
图14是根据本发明实施例的编码装置的结构框图;
图15是根据本发明实施例的解码装置的结构框图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本发明的实施例。
随着视频技术的日益发展,视频分辨率的不断提高,以及类似全景视频、3D立体视频的应用普及,无论是哪种情况,需要传输的数据量都非常大。能够根据网络带宽情况为用户提供不同质量视频的分层视频编码技术的应用必然会越来越广泛。如何在分层视频编码架构下提供多种灵活可配置的符号处理方式,实现平衡编码效率和编码复杂度的效果也必然是未来需要解决的问题。
在本发明实施例中给出了一种针对分层编码(或者称为可伸缩编码)视频码流中对图像的系数(通常是变换系数,当然,也可以是量化变换系数或者残差系数)进行符号处理的方法,可以分别为不同类型的码流(例如,基本层码流、增强层码流)提供多种灵活可配置的符号处理方式,从而实现平衡编码效率和编码复杂度的目的。
首先对本发明实施例中涉及到的相关技术进行说明:
由ISO/IEC和ITU下属的联合专家组(Joint Video Expert Teams,简称为JVET)制定的高性能视频编码(H.265/High Efficiency Video Coding,简称为HEVC)标准和通用视频编码 (H.266/Versatile Video Coding,简称为VVC)标准都已经支持“分层视频编码/可伸缩视频编码”的概念。可伸缩视频编码器能提供一个单独的分层嵌套视频码流.从分层视频码流中可以抽取不同的子码流来满足不一样的需求,子码流可以是不同的帧率或者空间分辨率.或者在帧率和空间分辨率相同的情况下不同的比特率(也就是不同的视频质量)。例如,视频码流中可以包括一个基本层(Base Layer)子码流和至少一个增强层(Enhancement Layer)子码流,所述增强层子码流可以是独立增强层子码流或依赖增强层子码流。其中,基本层子码流可以确保解码端能够正常的解码出视频内容,但是基本层子码流获得的视频图像可能帧率较低,分辨率较低,或者质量较低。通常用于信道受限或信道环境复杂时,可以保证解码端能够接收到可以观看的流畅视频图像,提供低质量的视频内容。当信道环境良好或信道资源丰富时,可以传递增强层子码流,独立增强层子码流可以独立解码提供增强的视频内容,依赖增强层子码流需要与基本层子码流一起解码提供增强的视频内容,以提高帧率,或分辨率,或视频质量。而增强层是可以进一步分层编码的,这就意味着,在视频码流总码率的范围内,接收到的码率越大,视频质量越好。此外,分层编码还广泛用于立体视频的压缩编码中,例如将左视点的视频图像编码为基本层子码流,右视点的视频图像作为增强层子码流,利用空间、时间以及两个视点间的信息冗余对立体视频进行高效压缩。增强层子码流也可以称为非基本层(non-base layer)子码流,后续说明中统一采用增强层子码流进行说明。
以H.265/HEVC为例,视频编码器可以将一帧图像划分为多个编码树单元(Coding Tree Unit,简称为CTU),一个CTU又可以划分为多个编码单元(Coding Unit,简称为CU),在CU级决定采用帧内编码还是帧间编码。每个CU又可以进一步被划分为一个或多个预测单元(Prediction Unit,简称为PU),预测结果也以PU为单位传输到解码端。在经过对PU的预测并得到残差信息后,一个CU又可以被划分为若干个变换单元(Transform Unit,简称为TU),而对于三色彩分量的视频序列,一个CU可能包含一个亮度分量的编码块(Coding Block,简称为CB)和/或两个色度分量的编码块,一个PU可能包含一个亮度分量的预测块(Prediction Block,简称为PB)和/或两个色度分量的预测块,一个TU可能包含一个亮度分量的变换块(Transform Block,简称为TB)和/或两个色度分量的变换块。需要说明的是,由于H.266/VVC中取消了HEVC中定义的预测单元PU、变换单元TU的概念,统一为编码单元CU,同时也取消了预测块、变换块的概念,统一为编码块,因此本发明方案中后续提到的变换单元也可以替换为编码单元,变换块也可以替换为编码块。
如图1所示,给出了一种8*8变换块的系数扫描顺序示例(图1中的数字表示扫描顺序),其中,变换块中的非零变换系数由符号和绝对值组成,编码器对非零系数编码时需要为每个系数分配一个符号位用于指示正号或者负号。例如,符号位值等于0时表示该符号位对应的系数是正的,而符号位值等于1时表示该符号位对应的系数是负的,反之亦可。
JVET第23次会议的输出文档“增强压缩模型2的算法描述Algorithm description of Enhanced Compression Model 2(ECM 2)”编号JVET-W2025中描述了ECM采用的符号预测方法,根据相邻块中的系数估计当前块的系数符号,用二进制值表示估计符号和原始符号之间的预测结果,例如“0”指示估计符号和原始符号相同,“1”指示估计符号和原始符号不同。如果符号被很好地估计,那么预测结果中多数为0,再通过上下文自适应二进制算术编码(Context Adaptive Binary Arithmetic Coding,简称为CABAC)对预测结果进行编码,可以有效提高编码效率。
为了更好地解释说明本发明实施例方案中的技术,图2给出了符合HEVC,VVC标准的视频编码器的一般概念性的逻辑处理框图,但是不排除本发明实施例方案同样可适用于其他编码方法或标准。其中,视频数据处理模块对输入的视频数据进行图像块划分处理,视频数据通常由一系列的视频图像序列组成,视频图像也可以称为图像或帧。视频数据处理包括将视频图像划分为CTU,对于彩色图像来说,CTU中包含一个亮度对应的编码树块(Coding Tree Block,简称为CTB)和两个色度对应的编码树块及其相关联的语法结构,对于黑白图像来说,编码树单元CTU中可仅包含一个亮度对应的编码树块CTB及其相关联的语法结构。CTU可进一步包含一个或多个CU,同理,编码单元可以包含一个亮度对应的CB和两个色度对应的编码块及其相关联的语法结构,也可以仅包含一个亮度对应的编码块及其相关联的语法结构。切片Silce可包含整数个按光栅扫描顺序排列的编码树单元CTU,瓦块Tile可包含整数个按矩形形状排列的编码树单元CTU。
在本发明实施例后续的描述中,视频处理单元可能是“编码树单元CTU”、“编码单元CU”、预测单元PU、变换单元TU等。在特定情形中,视频处理单元还可以是宏块、宏块分区等。视频块的类型可以是编码树块、编码块、预测块PB、变换块TB或者其他数据类型的块等。
预测处理模块根据图像特征对编码单元选择合适的预测模式(帧内预测或帧间预测),得到该编码单元对应的预测单元,预测单元可以包括一个亮度对应的预测块和两个色度对应的预测块。所述合适的预测模式可以是提供最佳匹配或者是最小残差等,实际选择预测模式时也可基于率失真优化来确定。帧内预测可以包括多种非方向性预测模式和方向性预测模式,在当前图像内部搜索最佳匹配块作为帧内预测块。帧间预测则是根据相关联的帧间预测参数在参考图像(先前存储在解码图片缓冲器中的至少部分解码的图像)中搜索最佳匹配参考块作为帧间预测块。预测处理单元还可以在预测前通过四叉树、二叉树或三叉树等任意组合将编码单元中的编码块进一步划分成更小的子块,并对该子块进行预测。本发明实施例方案中无特殊情况下,并不会对编码块或编码子块进行区分说明。
图像块与经过运动估计的预测图像相减可以得到差值图像,也叫残差块。例如,将编码块中的每个像素点值减去预测块中对应的像素点值,得到的每个像素点的差值组成残差块。
变换单元对残差块或残差块的子块进行从空间域到频率域的变换,从而获得频率域中的变换系数,变换系数也可以称为变换残差系数或残差变换系数,用于表示变换块或频率域中的残差块或残差块的子块。常用的变换方法包括离散余弦变换(Discrete Cosine Transform,简称为DCT)或离散傅里叶变换(Discrete Fourier Transform,简称为DFT)等。当变换单元对残差块应用一个或多个变换时,变换块对应残差块;当变换单元对残差块的子块应用一个或多个变换时,变换块对应残差块的子块。变换系数组成的二维矩阵也称为变换系数块。
量化单元对变换系数进行量化,从而得到量化系数,量化系数也可以称为量化变换系数或量化残差系数等。量化系数组成的二维矩阵也称为量化系数块。由于人的眼睛对图像的低频特性比如物体的总体亮度之类的信息很敏感,而对图像中的高频细节信息不敏感,因此在传送过程中可以少传或不传送高频信息,只传送低频部分。量化过程通过对低频区的系数进行细量化,高频区的系数进行粗量化,去除了人眼不敏感的高频信息,从而降低信息传送量。其中常见的量化方法为除以量化步长。量化步长可以通过量化参数(Quantization Parameter,简称为QP)来指示,通常QP值越小,对应的量化步长越小,也就是图像压缩损耗越少,而QP值越大,对应的量化步长越大,也就是图像压缩损耗越大。
量化输出的量化系数有两个不同的去处:一个是送给熵编码器进行编码,编码后的码流可以输出到一个缓存器中保存,等待发送到解码端。另一个应用是送至反量化单元和逆变换单元执行相应的反量化和逆变换操作。
反量化单元和逆变换单元所执行的反量化和逆变换分别是量化和变换的逆过程。经过反量化过程可以得到反量化系数,或者称为反量化残差系数或反量化变换系数等。由于量化过程是有损的,所以反量化通常并不等于量化前的变换系数。经过逆变换过程(如逆离散余弦变换或逆离散傅里叶变换)可以得到像素点域的逆变换块,也可以称为经逆变换的反量化块或者经逆变换的残差块。
逐像素点对,逆变换块的像素点值和预测块的像素点值进行相加合并得到重建块。缓冲器用于缓冲或存储重建块,以进行帧内估计和/或帧内预测或者其他类型的估计和/或预测等。
环路滤波器单元可以对重建块进行滤波获得滤波块,滤波块也可以称为滤波后重建块或经滤波重建块等。常用的环路滤波方法包括像素自适应补偿(sample adaptive offset,简称为SAO)滤波、去方块(deblocking)滤波等。
解码图像缓冲器(Decoded Picture Buffer,简称为DPB)可以接收并存储滤波块,还可以存储当前图像或者先前重建图像的其他滤波块,并且可以提供完整的先前重建的图像和/或部分重建的当前图像,用于帧间估计和/或帧间预测等。
编码控制单元,记录编码相关的控制参数,例如编码块划分方式,分层编码方式以及与帧内预测、帧间预测、变换、量化等相关的控制参数。编码控制模块涉及整个编码过程,可以与前述任意其他模块进行交互,获取需要用于解码过程的控制参数,最后提供给熵编码单元,对这些参数进行熵编码,并传输给解码端。
在部分实施例中,视频编码器可能包含更多、更少或者部分不同的功能组件,这里仅做一般性介绍,不再针对每一种变化单独绘图进行说明。
本发明后续实施例中提到的系数或编码系数,如果不作特殊说明,通常是指变换系数,但是也不排除可以是量化变换系数或者是残差系数。
下面结合实施例对本发明进行说明:
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
本申请实施例中所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图3是本发明实施例的编码方法或者解码方法的移动终端的硬件结构框图。如图3所示,移动终端可以包括一个或多个(图3中仅示出一个)处理器302(处理器302可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器304,其中,上述移动终端还可以包括用于通信功能的传输设备306以及输入输出设备308。本领域普通技术人员可以理解,图3所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端还可包括比图3中所示更多或者更少的组件,或者具有与图3所示不同的配置。
存储器304可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本发明实施例中的编码方法或者解码方法对应的计算机程序,处理器302通过运行存储在存储器304内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器304可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或 者其他非易失性固态存储器。在一些实例中,存储器304可进一步包括相对于处理器302远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置306用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端的通信供应商提供的无线网络。在一个实例中,传输装置306包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置306可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。
在本实施例中提供了一种编码方法,图4是根据本发明实施例的编码方法的流程图,如图4所示,该流程包括如下步骤:
步骤S402,确定当前编码的目标子码流的目标类型,以及与所述目标类型对应的目标符号处理方法以及目标符号处理参数;
步骤S404,基于所述目标符号处理参数按照所述目标符号处理方法对当前图像块的系数进行目标符号处理;
步骤S406,基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码。
执行上述操作的可以是编码设备(例如,视频编码器),或者编码设备内设置的处理器,或者是与编码设备独立设置的处理器,当然,还可以是其他的具备类似编码能力的设备。
在上述实施例中,当前编码的目标子码流可以是分层编码视频流中的子码流,所述当前编码子码流类型包括但不限于是基本层子码流或增强层子码流,其中增强层子码流还可以进一步包括独立增强层子码流或者依赖增强层子码流。
上述的目标符号处理方法包括符号预测方法、符号位隐藏方法、其他类型的符号处理方法中的至少之一,需要说明的是,在对图像块的系数进行符号处理时,可以采用一种符号处理方法对图像块的系数进行处理,也可以采用多种符号处理方法对图像块的系数进行处理,即,采用一种符号处理方法对图像块的系数中的一部分系数进行处理,不同的符号处理方法所处理的系数是不同的,多个符号处理方法之间可以有对应的处理优先级,即,优先级最高的先执行。
当采用多种符号处理方法时,需要确定出针对每一种符号处理方法的符号处理参数,不同的符号处理方法所对应的参数可以是不同的,例如,当上述目标符号处理方法包括符号预测方式时,与该预测方法对应的符号预测参数可以包括但不限于进行符号预测的系数个数、和/或进行符号预测的系数最大值、和/或进行符号预测的方法。该符号预测的方法包括但不限于模板生成方法、假设重构生成方法、成本函数计算方法等,另外,该符号预测参数可以是预先规定的,还可以是基于子码流的类型来确定的。
在上述实施例中,基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码包括基于所述目标符号处理的处理结果对所述当前图像块的系数的绝对值和系数的符号进行编码,即,对系数进行编码包括对系数的绝对值和系数的符号进行编码,在后边所提及的实施例中重点描述的是对系数的符号进行编码,此外,对系数的绝对值进行编码的方式可以采用常规的编码方式,后续不再赘述。
通过本发明实施例,基于码流中包括的各子码流的类型来确定对图像块中的系数进行符号处理的方法以及处理的参数,可以实现基于码流类型来灵活调整符号处理的方式,提高了 符号处理方式的灵活性,进而实现了平衡编码效率以及编码复杂度的目的。
在一个可选的实施例中,在基于所述目标符号处理参数按照所述目标符号处理方法对当前图像块的系数进行目标符号处理之前,所述方法还包括:基于第一条件确定需要对所述当前图像块的系数进行所述目标符号处理,其中,所述第一条件包括以下至少之一:
所述当前图像块的特征大小、所述当前图像块的系数的分布状态、所述当前图像块中非零系数的数量、所述目标符号处理的处理模式、变换方式、与所述当前图像块相邻的其他图像块的特征信息、本地配置信息、所述目标子码流的所述目标类型、多种符号处理方法的优先级、所述当前图像块所在图像的特征、所述当前图像块所在图像的所在序列的特征、成本函数或率失真函数的计算结果。
在上述实施例中,确定需要对所述当前图像块的系数进行所述目标符号处理的操作与上述S402之间的顺序可以是不做限制的,可以先确定需要对所述当前图像块的系数进行所述目标符号处理再去执行S402,也可以先执行S402再确定需要对所述当前图像块的系数进行所述目标符号处理,当然,也可以同时执行确定需要对所述当前图像块的系数进行所述目标符号处理的操作和S402。
还需要说明的是,上述第一条件中包括的内容可以基于实际情况进行调整的,当然,也可以不仅仅限于上述所列出的第一条件。
在一个可选的实施例中,基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码包括:对所述当前图像块中包括的进行了所述目标符号处理的系数以及未进行所述目标符号处理的系数分别进行编码,其中,对进行了所述目标符号处理的系数进行编码的编码方式与对未进行所述目标符号处理的系数进行编码的编码方式相同或者不同;其中,所述目标符号处理方法包括一种或多种;在所述目标符号处理方法包括一种处理方法的情况下,采用一种编码方式对所述当前图像块中包括的进行了所述目标符号处理的系数进行编码;在所述目标符号处理方法包括多种处理方法的情况下,对所述当前图像块中包括的按照不同的目标符号处理方法进行了目标符号处理的系数分别进行编码,且按照不同的目标符号处理方法进行了目标符号处理的系数的编码方式彼此之间相同或不同。下面对目标符号处理方法包括一种处理方法和包括两种处理方法进行举例说明(包括三种及以上的处理方法的编码方式处理逻辑也是类似的,在此不再列举):
在上述实施例中,在所述目标符号处理方法包括一种处理方法的情况下,按照第一编码方式对所述当前图像块中包括的进行了所述目标符号处理的第一系数的符号进行编码;以及,按照第二编码方式对所述当前图像块中包括的除所述第一系数之外的第二系数的符号进行编码;其中,所述第一编码方式和所述第二编码方式相同或者不同;在所述目标符号处理方法包括两种处理方法的情况下,按照第一编码方式对所述当前图像块中包括的进行了第一目标符号处理的第一系数的符号进行编码;按照第二编码方式对所述当前图像块中包括的进行了第二目标符号处理的第二系数的符号进行编码,以及,按照第三编码方法对所述当前图像块中还包括除所述第一系数和所述第二系数之外的第三系数的符号进行编码;其中,所述目标符号处理方法包括所述第一目标符号处理方法和所述第二目标符号处理方法,所述第一编码方式、所述第二编码方式以及第三编码方式均不同或者至少两个相同。
在一个可选的实施例中,基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码包括:在所述目标符号处理方法包括符号预测处理方法的情况下,基于所述符号预测处理的处理结果确定系数的预测符号与原始符号的差异;按照与所述符号预测处理方法对应的编码方式对所述差异进行编码。在本实施例中,该差异可以通过特定的值来表示,例如,通过0、1来表示,即,在确定预测符号和原始符号一致时,说明预测符号是正确的,该差异可以用0来表示,在确定预测符号和原始符号不一致时,说明预测符号是错误的,该差异可以用1来表示,需要说明的是,还可以用其他的值或者符号来表示该差异,例如,用二进制数来表示,用英文字母来表示等。
在一个可选的实施例中,在基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码之后,所述方法还包括:将所述编码的结果添加到所述目标子码流中。
在一个可选的实施例中,在基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码之前,所述方法还包括:确定需要按照基于系数重要性的分层编码方式对所述当前图像块的系数进行编码。在本实施例中,在进行分层编码时,可以有多种类型的编码方式,例如可以基于系数重要性来进行分层编码,当然,也可以按照预先配置的编码方式进行分层编码,或者,按照随机编码的方式进行编码,等等。
在一个可选的实施例中,确定需要按照基于系数重要性的分层编码方式对所述当前图像块的系数进行编码包括:基于以下方式至少之一确定需要按照基于系数重要性的分层编码方式对所述当前图像块的系数进行编码:根据编码器的本地配置确定,根据所述当前图像块的特征确定,根据所述当前图像块所在的视频序列确定,根据已知的待接收编码码流的解码器能力或配置确定,根据采用的依赖增强层编码方式确定,根据接收到的指示性信息确定,其中,所述指示性信息来自于未编码图像的发送端或者是已编码图像的接收端。还需要说明的是,上述各方式可以基于实际情况进行调整的,当然,也可以不仅仅限于上述所列出的实现方式。
在一个可选的实施例中,所述方法还包括:对所述当前图像块的系数按照系数重要性进行重新排序;按照重新排序后的所述当前图像块的系数所处的位置确定各个所述系数所属的编码层。在本实施例中,重新排序的操作以及确定各个系数所属的编码层的操作可以是在S406之前执行的,进一步地,可以是在S404之前执行,或者是在S402之前执行,具体执行顺序本实施例不作限定。
在一个可选的实施例中,在基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码之后,所述方法还包括以下至少之一:
在所述目标子码流中添加用于指示所述目标子码流类型的指示信息;
在所述目标子码流中添加标识信息,其中,所述标识信息用于指示以下至少之一:解码端在解码参考层子码流时,需要存储解码结果或解码元数据以供解码后续增强层子码流时使用;解码端在解码增强层子码流时获取所述增强层子码流所依赖的参考层子码流的解码结果或解码元数据。
在本实施例中,解码元数据包括但不限于逆变换系数或反量化系数,参考层子码流包括增强层子码流所依赖的基本层子码流或其他增强层子码流。
下面结合实施例对本发明编码端的操作进行具体说明:
具体实施例一:
本实施例中提供了一种在分层编码视频码流中对系数的符号进行预测处理的方法,需要说明的是,本实施例是以符号预测方式进行举例说明的是,相关处理逻辑同样也适用于符号位隐藏方法中,或者其他的符号处理方法中。
如图5所示,该实施例中包括如下步骤:
步骤1:确定对当前图像块的系数进行符号预测;
视频编码器可以根据一定的条件决定是否对当前块的系数进行符号预测。根据已经公开的现有技术,这些条件可以是图像块的特征,例如,块的大小,对应系数的分布,非零系数的数量,预测模式,变换方法以及相邻图像块的信息等。
步骤2:确定当前编码子码流类型并获取所述子码流类型对应的符号预测参数。
所述当前编码子码流类型包括但不限于基本层子码流和增强层子码流,其中增强层子码流还可以进一步包括独立增强层子码流或者依赖增强层子码流。子码流类型可以根据所述子码流的层标识来确定。
所述符号预测参数可以包括但不限于进行符号预测的系数个数、和/或进行符号预测的系数最大值、和/或进行符号预测的方法。所述进行符号预测的方法包括但不限于模板生成方法、假设重构生成方法、成本函数计算方法等。
对于同一图像块,不同子码流类型对应的符号预测参数所包含的参数数量可以是不同的,也可以是相同的。不同子码流类型对应的同一个符号预测参数的值可以是不同的,也可以是相同的。
需要补充说明的是,步骤1和步骤2的顺序并不是严格固定的,也可以是先确定当前编码子码流类型并获取所述子码流类型对应的符号预测参数,确定对当前图像块的系数进行符号预测。还可以是先确定当前编码子码流类型,确定对当前图像块的系数进行符号预测并获取所述子码流类型对应的符号预测参数。
需要补充说明的是,如果步骤1中需要根据当前编码子码流类型确定对当前图像块的系数进行两种符号处理方法(即,上述的符号预测方法、符号位隐藏方法)时,本步骤中可以省略确定当前编码子码流类型。
步骤3:根据所述符号预测参数对所述图像块的系数执行符号预测过程。
通常为了预测一个系数的符号,视频编解码器可以使用一个被预测系数的正值和负值符号分别重建变换块,所述重建块被称为“假设重建”。利用预定义的成本函数评估两个假设重建,利用成本函数最小的假设重建生成被预测系数的预测估计符号。当被预测系数的数量为N时,使用不同符号组合生成与每一符号组合对应的2N个假设重建。根据预定义的成本函数评估每一假设,利用成本函数最小的假设重建生成被预测系数的预测估计符号组合。在JVET提案D0031中描述了一种基于模板(template)的符号预测方法,首先在系数块中选择n个非零系数进行符号预测,针对n个系数计算得到其对应的模板。所述模板的生成方法为,将每个系数作为唯一非零系数的块进行逆变换操作后,将其最左边和最上面的边界值作为该系数对应的模板。如下表1对应n=3时的模板:
表1
先对反量化系数执行单一逆变换操作,将所有被预测的系数的符号设为正值,当前块的预测对应于第一假设的边界重建。进一步利用第一假设重建以及模板构建剩余2n-1个假设,计算方法如表2所示:
表2
成本函数通常是使用每一个假设来测量先前重建的相邻像素与假设重建之间的空间不连续,如图6所示。使得成本函数最小的假设最近的符号组合即为预测估计符号。
实际应用中,除了上述描述的基础符号预测方法,还可以基于此进行各类优化,例如在计算成本函数时,只选取假设重构边界中的一半样本从而降低计算量,又或者在选择被预测系数时,增加一定的条件限制,优先选择到比较容易预测的系数或者符号误差对结果影响相对较大的系数。
步骤4:基于所述符号预测过程的结果对当前图像块的系数进行编码。
针对当前图像块的系数进行编码包括对当前图像块的系数绝对值和当前图像块的系数符号进行编码。其中针对当前图像块的系数符号进行编码进一步包括针对进行符号预测的系数的符号可以采用第一编码方法,得到第一编码结果。针对符号预测的系数的符号可以采用第一编码方法可以是针对进行符号预测的系数的符号预测差异采用第一编码方法进行编码。所述符号预测差异是指预测符号与原始符号之间的差异。例如当系数的原始符号为正时,如果预测符号也为正值,即符号预测是正确的,那么符号预测差异可以用“0”来表示,反之,如果预测符号为负,即符号预测是错误的,那么符号预测差异可以用“1”来表示。
针对除被预测的系数以外的剩余系数的符号可以采用第二编码方法,得到第二编码结果。所述第一编码方法、第二编码方法可以相同,也可以不同。在本步骤中,第一编码方法和第二编码方法可以采用常规的编码方式,例如,CABAC编码、旁路编码等等。
步骤5:将所述编码的结果添加到所述子码流类型对应的子码流中。
所述编码结果至少包括第一编码结果和/或第二编码结果。
需要说明的是,本实施例中对于同一图像块的不同类型的编码层子码流不仅可以对应不 同的符号预测参数,也可以只对部分编码层子码流应用符号预测方法,其余编码层子码流不采用符号预测方法,例如,只针对基本层子码流应用符号预测方法,增强层子码流不应用符号预测方法。此外,步骤1和步骤2的先后顺序并不是完全固定的,也可以先执行步骤2“确定当前编码子码流类型并获取所述子码流类型对应的符号预测参数”,再执行步骤1“确定对当前图像块的系数进行符号预测”。
此外,符号预测参数还和所采用的符号预测方法有关,本方案并不限定具体的符号预测方法,除了本实施例中所举例的符号预测方法以外,例如还可以采用基于神经网络的符号预测方法或者其他针对本实施例中描述的符号预测方法进行优化以后的符号预测方法等。
具体实施例二:
在与图1相关的描述中介绍了通常对于一个8*8的图像块的变换系数扫描顺序。对这些变换系数进一步量化后按照Z字型顺序扫描并进行编码。这种排列方法有助于将低频非0系数置于高频系数之前。相关技术中还提出了一种对变换系数进行重新排列,然后进行分层次的编码。如图7所示,以一个基本层加三个增强层为例进行举例说明,可以将左上角的4个系数作为基本层的数据进行编码;左上角16个系数中除了基本层中的4个系数以外的其余12个系数作为第一增强层的数据进行编码;从17-48的系数作为第二增强层的数据进行编码;其余右下角的16个系数作为第三增强层的数据进行编码。
上述仅作为一种示例进行解释说明,实际应用中,不同编码层与系数的对应关系可以进行灵活的调整和优化。例如,还可以将前16个系数作为基本层的数据进行编码,从17-32的系数作为第一增强层的数据进行编码;其余32个系数作为第二增强层的数据进行编码等。
依据前述基于系数重要性的分层编码原理,本实施例给出另一种在分层编码视频码流中对变换系数的符号进行预测处理的示例,具体如图8所示,包括如下步骤:
步骤1:确定对当前图像块的系数进行符号预测;
同具体实施例一中步骤1。
步骤2:确定对当前图像块采用基于系数重要性的分层编码方法;
所述基于系数重要性的分层编码方法是指对图像块的系数进行重新排序,实现分层编码。确定对当前图像块采用基于系数重要性的分层编码方法包括但不限于:根据编码器的本地配置确定;或者根据当前图像或图像块的特征确定;或者根据当前图像所在的视频序列确定;或者根据已知的待接收编码码流的解码器能力或配置确定;或者根据采用的依赖增强层编码方式确定;又或者根据其他指示性信息确定;所述其他指示性信息可以是来自于未编码图像的发送端或者是已编码图像的接收端。
步骤3:确定当前编码子码流类型并获取所述子码流类型对应的符号预测参数;
参考具体实施例一中步骤2。
需要注意的是,步骤2和步骤3之间并没有严格的先后顺序,也可以是先执行步骤3“确定当前编码子码流类型并获取所述子码流类型对应的符号预测参数”再执行步骤2“确定对当前图像块采用基于系数重要性的分层编码方法”。另外,当确定采用基于系数重要性的分层编码方法后,当前编码子码流类型只可以是基本层子码流或者是依赖增强层子码流。
步骤4:根据所述符号预测参数对所述图像块中对应所述子码流类型对应的系数执行符号预测过程;
其中,该预测过程具体可以参考具体实施例一中的步骤3。
如前所述,基于系数重要性的分层编码方法将当前图像块的变换系数进行重新排序后,经过重新排序的系数按照所处的位置分别作为不同编码层的系数进行编码。所述子码流类型对应的系数是指所述图像块对应的系数中的一部分。而所有子码流类型对应的系数组合起来可以构成图像块对应的完整系数。
步骤5:基于所述符号预测过程的结果对当前图像块中对应所述子码流类型的系数进行编码;
参考具体实施例一中步骤4;
步骤6:将所述编码的结果添加到所述子码流类型对应的子码流中;
当所述子码流类型为增强层子码流时,若所述增强层子码流为依赖增强层子码流,即所述依赖增强层子码流需要与基本层子码流一起解码提供较高质量的视频图像。因此所述子码流中需要增加标识,指示所述子码流类型为依赖增强层子码流。
采用基于系数重要性的分层编码方法时,所述子码流中还可以包含提取解码元数据模式标志位,用于指示解码端在解码非最高增强层子码流或参考层子码流时,需要缓冲或存储解码元数据以供解码后续增强层子码流时使用;还可以用于指示解码端在解码增强层子码流时获取所述增强层子码流所依赖的参考层子码流的解码元数据,所述解码元数据包括但不限于逆变换系数或反量化系数。
所述提取解码元数据模式标志位,也可以替换为基于系数分层编码标志位,用于指示解码端在解码非最高增强层子码流或参考层子码流时,需要缓冲或存储解码元数据以供解码后续增强层子码流时使用;还可以用于指示解码端在解码增强层子码流时获取所述增强层子码流所依赖的参考层子码流的解码元数据,所述解码元数据包括但不限于逆变换系数或反量化系数。后续说明中提到的提取解码元数据模式标志位和基于系数分层编码标志位的作用是等同的。
本实施例中的符号预测方法也可以替换为其他符号处理方法,包括但不限于符号位隐藏方法。
具体实施例三:
本实施例给出一种在分层编码视频码流中对编码系数的符号进行处理的方法,具体如图9所示,包括如下步骤:
步骤1.确定当前编码子码流类型;
所述当前编码子码流类型包括但不限于基本层子码流和增强层子码流,其中增强层子码流还可以进一步包括独立增强层子码流或者依赖增强层子码流。子码流类型与所述子码流的层标识对应。
步骤2.确定对当前图像块的系数进行第一符号处理方法和第二符号处理方法;
所述第一符号处理方法是指先选择图像块的系数进行符号处理的方法,所述第二符号处理方法是指对图像块中除第一符号处理方法选择的系数以外的剩余系数进行符号处理的方法。
所述第一符号处理方法和第二符号处理方法包括但不限于符号预测方法和符号位隐藏方法的任意组合。视频编码器可以根据一定的条件确定对当前块的系数进行第一符号处理和第二符号处理。这些条件可以是当前图像块的特征,例如,块的大小,对应系数的分布,非零系数的数量,预测模式,变换方法以及相邻图像块的信息等。此外也可以通过获取本地配置文件判断是否允许开启两种符号处理方法,还可以通过当前编码子码流的类型确定是否对当 前图像块进行第一符号处理和第二符号处理。
确定第一符号处理方法和第二符号处理方法的方法包括但不限于:根据配置信息确定;根据两种符号处理方法对应的优先级来确定;根据前述图像块的特征自适应确定;根据当前图像块所在的图像和/或当前图像块所在图像的所在序列的特征自适应确定;根据成本函数或率失真函数的计算结果确定;
相关技术中的符号预测方法在前述实施例中已经描述说明。为了方案描述的完整性,这里补充说明符号位隐藏方法。符号位隐藏是指可以根据预定规则推理得出被隐藏符号的系数的符号。通常所述预定规则可以是预定的校验函数,对于给定的系数集合,被隐藏符号的系数的符号的值与所述系数集合的校验函数的值对应。例如,通过计算系数集合中所有非零变换系数的绝对值之和,对绝对值之和进行奇偶判断,偶数指示所述被隐藏符号的系数的估计符号为正,奇数指示所述被隐藏符号的系数的估计符号为负。实际应用中,被隐藏符号的系数可以是所述系数集合中第一个非零变换系数,也可以是通过其他规则选出。被隐藏符号的系数可以是一个也可以是多个,这里对符号位隐藏的现有技术不作过多扩展描述。
步骤3.获取所述子码流类型对应的第一符号处理参数和第二符号处理参数;
根据步骤1中描述,所述第一符号处理方法和第二符号处理方法包括但不限于符号预测方法和符号位隐藏方法的任意组合。因此第一符号处理参数和第二符号处理参数同样包括但不限于符号预测参数和符号位隐藏参数的任意组合。
所述符号预测参数可以包括但不限于进行符号预测的系数个数、和/或进行符号预测的系数最大值、和/或进行符号预测的方法。所述进行符号预测的方法包括但不限于模板生成方法、假设重构生成方法、成本函数计算方法等。
所述符号位隐藏参数可以包括但不限于进行符号位隐藏的系数个数、和/或进行符号位隐藏的系数最大值、和/或进行符号位隐藏的方法。
对于同一图像块,不同子码流类型对应的第一符号处理参数或第二符号处理参数所包含的参数类型、参数数量可以是不同的,也可以是相同的。不同子码流类型对应的第一符号处理参数或第二符号处理参数中的同一个符号处理参数的值可以是不同的,也可以是相同的。
步骤4.根据所述第一符号处理参数对所述图像块的系数执行第一符号处理过程;
这里以所述第一符号处理方法为符号预测方法为例进行说明,此时根据符号预测参数针对所述图像块的系数的符号进行预测,符号预测方法参考具体实施例一或具体实施例二。
步骤5.根据所述第二符号处理参数对所述图像块的剩余系数执行第二符号处理过程;
所述图像块的剩余系数是指图像块的系数中除去在步骤4中被进行第一符号处理的系数。
步骤6.基于第一符号处理结果和第二符号处理结果对当前图像块的系数进行编码。
针对当前图像块的系数进行编码包括对当前图像块的系数绝对值和当前图像块的系数符号进行编码。其中针对当前图像块的系数符号进行编码进一步包括针对第一符号处理的系数的符号可以采用第一编码方法,针对第二符号处理的系数的符号可以采用第二编码方法以及针对除被第一符号处理和第二符号处理的系数以外的剩余系数的符号可以采用第三编码方法。所述第一编码方法、第二编码方法和第三编码方法可以相同,也可以不同。
作为一种示例说明,针对第一符号处理的系数的符号和第二符号处理的系数的符号可以采用CABAC编码方法,而针对当前图像块中除被第一符号处理和第二符号处理的系数以外的剩余系数的符号可以采用旁路编码方法。
进一步地,将所述编码的结果添加到所述子码流类型对应的子码流中。
所述子码流中可选地包括第一符号处理方法指示信息、第一符号处理参数信息、第二符号处理方法指示信息、第二符号处理参数信息中一个或者多个的任意组合。所述第一符号处理方法指示信息可以是第一符号处理方法开启标志位,所述第二符号处理方法指示信息可以是第二符号处理方法开启标志位。
上述所有的参数信息或者指示信息可以携带在视频参数集(Video Parameter Set,简称为VPS)VPS、序列参数集(Sequence Parameter Set,简称为SPS)、图像参数集(Picture Parameter Set,简称为PPS)、自适应参数集(Adaptive Parameter Set,简称为APS)中的任意一个或者多个参数集中,也可以是携带在SEI消息中,还可以是其他任意方式携带在码流中。
需要补充说明的是,同一段码流中,不同类型的子码流类型可以分别支持采用两种符号处理方法,只采用一种符号处理方法,或者不采用符号处理方法。本实施例着重说明了采用两种符号处理方法的过程,只采用一种符号处理的方法可以参考具体实施例一或二的描述,不采用符号处理方法即对所有系数或者非零系数的符号不作处理,单独进行旁路编码并传输。
前边各实施例是对编码端的处理进行的说明,下面对解码端的处理进行说明:
在本发明实施例中还提供了一种解码方法,如图10所示,包括如下步骤:
S1002,在接收到分层编码视频码流的情况下,获取各个子码流对应的目标符号处理方法以及目标符号处理参数;
S1004,基于各个所述子码流对应的目标符号处理方法以及目标符号处理参数确定各个所述子码流对应的系数的符号;
S1006,基于各个所述子码流对应的系数的符号对所述分层编码视频码流中的各个子码流进行解码。
执行上述操作的可以是解码设备(例如,视频解码器),或者解码设备内设置的处理器,或者是与解码设备独立设置的处理器,当然,还可以是其他的具备类似解码能力的设备。
在上述实施例中,分层编码(也可以称为可伸缩解码)视频流中的子码流包括但不限于是基本层子码流或增强层子码流,其中增强层子码流还可以进一步包括独立增强层子码流或者依赖增强层子码流。
上述的目标符号处理方法包括符号预测方法、符号位隐藏方法、其他类型的符号处理方法中的至少之一,需要说明的是,在对图像块的系数进行符号处理时,可以采用一种符号处理方法对图像块的系数进行处理,也可以采用多种符号处理方法对图像块的系数进行处理,即,采用一种符号处理方法对图像块的系数中的一部分系数进行处理,不同的符号处理方法所处理的系数是不同的,多个符号处理方法之间可以有对应的处理优先级,即,优先级最高的先执行。在一个可选的实施例中,获取各个子码流对应的目标符号处理参数包括以下至少之一:
从本地配置信息中获取所述目标符号处理参数;
从所述分层编码视频码流或目标媒体文件中获取所述目标符号处理参数;
基于所述分层编码视频码流中包括的参数信息确定所述目标符号处理参数
需要说明的是,上述几种获取方式仅是示例性说明,在实际应用中还可以通过其他方式获取,例如,获取其他设备发送的目标符号处理参数等等。
在一个可选的实施例中,在基于各个所述子码流对应的系数以及系数的符号对所述分层编码视频码流中的各个子码流进行解码之后,所述方法还包括:在确定当前解码的子码流为参考层子码流的情况下,存储所述当前解码的子码流的解码结果;或者,在确定当前解码的子码流为参考层子码流的情况下,存储所述当前解码的子码流的解码元数据。在本实施例中,参考层子码流可以是基本层子码流或者是非最高层子码流,在解码参考层子码流时,需要存储解码结果或者参考层子码流的解码元数据,以供解码后续增强层子码流时使用。
在一个可选的实施例中,获取各个子码流对应的目标符号处理方法以及目标符号处理参数包括:基于当前解码的子码流的类型确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数。需要说明的是,各个子码流对应的目标符号处理方法以及目标符号处理参数可能是相同的,也可能是不同的,此外,各个子码流对应的目标符号处理方法也可以是方法相同,参数不同。
在一个可选的实施例中,所述方法还包括以下至少之一:获取所述分层编码视频码流中携带的指示信息,基于所述指示信息确定所述当前解码的子码流的类型;获取所述分层编码视频码流中携带的标识信息,基于所述标识信息执行以下操作至少之一:在所述当前解码的子码流为参考层子码流时,存储所述当前解码的子码流的解码结果或解码元数据以供解码后续增强层子码流时使用;在所述当前解码的子码流为增强层子码流时,获取所述增强层子码流所依赖的参考层子码流的解码结果或解码元数据。
在一个可选的实施例中,获取各个子码流对应的目标符号处理方法以及目标符号处理参数包括:获取当前解码的子码流对应的符号处理方法的目标数量;基于所述目标数量确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数。在本实施例中,当前解码的子码流对应的符号处理方法可以是一种,也可以是多种(即,多种符号处理方法对图像块的系数进行处理),在当前解码的子码流对应的符号处理方法为多种的情况下,需要分别获取各方法对应的处理参数,不同的符号处理方法所对应的符号处理参数可以是相同的,也可以是不同的。
在一个可选的实施例中,基于所述目标数量确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数包括:
在所述目标数量为1的情况下,基于所述当前解码的子码流的类型确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数;
在所述目标数量大于1的情况下,分别确定各个所述目标符号处理方法以及对应的目标符号处理参数,以及各个所述目标符号处理方法的处理顺序。
在本实施例中,各个所述目标符号处理方法的处理顺序可以是预先配置的,也可以是基于实际应用场景而确定的,当然,也可以是默认的。
在一个可选的实施例中,基于所述当前解码的子码流的类型确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数包括:
在确定当前解码的子码流为依赖增强层子码流的情况下,获取所述分层编码视频码流中包括的所述当前解码的子码流的参考层子码流的解码元数据,基于所述参考层子码流的解码元数据确定所述当前解码的子码流的系数以及系数的符号;和/或,
在确定当前解码的子码流为依赖增强层子码流的情况下,获取存储的与所述当前解码的 子码流对应的图像参考的已解码图像,基于所述已解码图像确定所述当前解码的子码流的系数以及系数的符号。
在一个可选的实施例中,基于各个所述子码流对应的目标符号处理方法以及目标符号处理参数确定各个所述子码流对应的系数的符号包括:
根据符号预测处理以及符号预测处理参数确定所述当前解码的子码流中包括的第一系数的符号,其中,所述第一系数为进行了所述符号预测处理的系数;
根据符号位隐藏处理以及符号位隐藏处理参数确定所述当前解码的子码流中包括的第二系数的符号,其中,所述第二系数为进行了所述符号位隐藏处理的系数;
确定所述当前解码的子码流中包括的第三系数的符号,其中,所述第三系数为所述当前解码的子码流中包括的除所述第一系数及所述第二系数之外的系数。
需要说明的是,上述的符号预测处理和符号位隐藏处理所执行的先后顺序是可以灵活设置的,可以先执行符号预测处理,再执行符号位隐藏处理,也可以先执行符号位隐藏处理,在执行符号预测处理,当然,如果支持的话,也可以同时执行符号预测处理以及符号位隐藏处理。
下面结合实施例对本发明解码端的操作进行具体说明:
具体实施例四:
本实施例给出了一种解码分层编码视频码流时的符号处理方法,如图11所示,包括如下步骤:
步骤1.获取分层编码视频码流;
根据所述分层编码视频码流可以确定所述分层编码视频码流中包含的子码流数量以及所述子码流对应的层标识。
所述分层编码视频码流中应包含一个基本层子码流和至少一个增强层子码流,因此,所述子码流数量应大于等于2,所述增强层子码流可以是独立增强层子码流或依赖增强层子码流。基本层子码流可以独立解码提供基础质量的视频内容,独立增强层子码流可以独立解码提供较高质量的视频内容,依赖增强层子码流需要与基本层子码流一起解码提供较高质量的视频内容。
步骤2.获取各子码流层对应的符号处理方法及其对应的符号处理参数。
所述符号处理方法包括但不限于符号预测方法、符号位隐藏方法及其任意组合。所述符号预测参数可以包括但不限于进行符号预测的系数个数、和/或进行符号预测的系数最大值、和/或进行符号预测的方法。所述进行符号预测的方法包括但不限于模板生成方法、假设重构生成方法、成本函数计算方法等。所述符号位隐藏参数可以包括但不限于进行符号位隐藏的系数个数、和/或进行符号位隐藏的系数最大值、和/或进行符号位隐藏的方法。所述符号处理参数可以从本地配置信息中获取,也可以从码流或媒体文件中获取,还可以一部分从配置信息中获取,一部分从码流中获取。此外,当同时使用符号预测方法和符号位隐藏方法时,还可以进一步包括符号预测和符号位隐藏方法的先后顺序的指示信息。
需要说明的是,上述符号处理参数信息可以直接在码流中获取,也可以在本地配置信息中获取,所述本地配置信息可以是编码端和解码端共同遵守的预定规则,也可以是通过码流中传递的其他参数信息推导得出,还可以是通过码流中传递的参数信息和本地配置信息共同 推导得到。
可以允许其中某一子码流不采用任一符号处理方法。
各子码流层对应的符号处理方法进一步可以限定为各子码流层的各图像块对应的符号处理方法。因为在实际解码过程中,解码器是以图像块为单位逐块解码,所以可以理解为当前解码的子码流层中当前解码图像块对应的符号处理方法。同一子码流层中的所有图像块对应的符号处理方法和符号处理方法的数量可以相同或者不同,进一步地,同一码流层中的同一帧中的所有图像块对应的符号处理方法和符号处理方法的数量也可以相同或者不同。后续为例说明的简便,依然简单描述为各子码流层对应的符号处理方法。
步骤3.根据所述符号处理方法及其对应的符号参数确定各子码流中对应的系数及其符号。
确定各编码层子码流中对应的系数及其符号可以包含以下两个部分:根据所述符号处理方法及其对应的符号参数确定经过符号处理的系数及其对应的符号;和/或未经过符号处理的系数及其对应的符号。所述根据所述符号处理方法及其对应的符号参数确定经过符号处理的系数及其对应的符号,根据符号处理方法的不同,可以进一步包括:根据所述符号预测方法及其对应的符号参数确定经过符号预测的系数及其对应的符号,和/或根据所述符号位隐藏方法及其对应的符号参数确定经过符号位隐藏的系数及其对应的符号具体见具体实施例五中步骤3.1和3.2的描述说明。
步骤4.执行后续解码过程,获得解码图像。
需要补充说明的是,执行完步骤4以后还可能需要执行如下操作:确定当前子码流层为参考层(reference layer)时,存储当前子码流的解码结果供后续其他子码流层参考使用。所述解码结果可以是解码图像和/或解码元数据,具体见具体实施例五中的解释说明。
具体实施例五:
本实施例给出一种针对具体实施例四中步骤3“根据所述符号处理方法及其对应的符号参数确定各编码层子码流中对应的系数及其符号”的分解步骤的实施例,如图12所示,包括如下步骤:
步骤3.1根据所述符号处理方法及参数确定经符号处理的系数的绝对值和符号;
当所述符号处理方法为符号预测方法时,根据所述符号预测参数确定符号被预测的系数及其对应的符号值;这一过程可以包括如下步骤:对估计符号与原始符号之间的差异进行解码,执行符号预测过程得到预测估计符号,并基于解码得到的差异对预测估计符号进行校正,得到最终的符号。这里采用与具体实施例一对应的n个系数为例,对符号预测过程进行具体示例说明,视频解码器可对反量化系数执行单一逆变换操作,将所有被预测的系数的符号设为正值,当前块的预测对应于第一假设的边界重建。解码器进一步针对n个系数计算得到其对应的模板。所述模板的生成方法为,将每个系数作为唯一非零系数的块进行逆变换操作后,将其最左边和最上面的边界值作为该系数对应的模板。利用之前保存的第一假设重建以及模板构建多个假设,使得成本函数最小的假设最近的符号组合即为预测估计符号。
当所述符号处理方法为符号位隐藏方法时,解码端根据所述符号位隐藏参数确定符号被隐藏的系数及其对应的符号值。这一过程可以包括如下步骤:
当所述符号处理方法同时包括符号预测方法和符号位隐藏方法且符号预测方法优先级更 高时,首先根据符号预测参数确定所述符号被预测的系数及其对应的符号值,并在剩余的系数中根据符号位隐藏参数确定符号被隐藏的系数及其对应的符号值。反之,当所述符号处理方法同时包括符号预测方法和符号位隐藏方法且符号位隐藏方法优先级更高时,首先根据符号位隐藏参数确定所述符号被隐藏的系数及其对应的符号值,并在剩余的系数中根据符号预测参数确定符号被预测的系数及其对应的符号值。
步骤3.2获取其余未经符号处理的系数的绝对值及其对应的符号;
从解码码流中获取的除确定为经过符号处理的系数以外的系数即为其余未经符号处理的系数,通常这些系数是以绝对值的形式进行传输。其对应的符号可以通过旁路编码码流中获取。
步骤3.3确定当前子码流是否为依赖增强层子码流,若是,执行步骤3.4,否则执行步骤4:
确定是否为依赖增强层子码流为现有技术。
步骤3.4确定是否为基于系数分层编码模式,若是,执行步骤3.6,否则执行步骤3.5;
确定是否为基于系数分层编码模式可以是如下任一方式:确定码流中包含基于系数分层编码模式的标志位,所述标志位用于指示解码器在解码依赖增强层子码流时,需要提取基本层子码流和/或较低增强层子码流的解码元数据,所述基本层子码流和/或较低增强层子码流的解码元数据应至少包括步骤3.1和步骤3.2中获得的编码系数及其对应的符号。所述基本层子码流可以是层标识(layer_id)等于0的子码流,较低增强层子码流可以是层标识(layer_id)小于当前子码流层标识的子码流。
步骤3.5获取参考层已解码图像作为参考图像;
参考层已解码图像通常缓存在解码器的已解码图像缓存器(Decoded Picuture Buffer,DPB)中,解码器可以从中获取当前解码的子码流图像所参考的已解码图像。
步骤3.6获取参考层子码流的解码元数据;
所述参考层子码流包括基本层子码流,即层标识等于0的子码流,和/或参考层增强子码流,即层标识小于当前子码流层标识的子码流。并且所述子码流为当前子码流的参考层(reference layer)。获取参考层子码流的解码元数据,即获取所述参考层子码流的系数绝对值及符号,包括但不限于步骤3.1和步骤3.2中获得的系数绝对值及其对应的符号。
类似地,本实施例还可能需要执行如下操作:确定当前子码流层为参考层(reference layer)时,进一步确定是否为基于系数分层编码模式,若是基于系数分层编码模式,将当前子码流的解码元数据存储供后续其他子码流层参考使用;反之若不是基于系数分层编码模式,将当前子码流的解码图像存储供后续其他子码流层参考使用;
具体实施例六:
本实施例给出又一种解码分层编码视频码流时的符号处理方法。如图13所示,包括如下步骤:
步骤1:获取分层编码视频码流;
同具体实施例四中步骤1。
步骤2:获取各子码流层对应的符号处理方法数量;
获取各子码流层对应的符号处理方法数量包括但不限于:根据配置信息确定,如配置信息可以是除基本层以外的子码流的符号处理方法数量为1;或者根据码流中指示开启的符号 处理方法的数量确定;或者根据码流和/或媒体文件中指示的最大符号处理方法数量确定等。
步骤3:当前子码流层是否只包含一种符号处理方法,若是,执行步骤4,否则执行步骤5;
解码端选择当前需要解码的子码流层,进一步根据步骤2中获取到的各子码流层对应的符号处理方法数量确定当前子码流层对应的符号处理方法数量是否只包含一种符号处理方法。这里需要说明的是,解码端也可以在步骤2之前先选择当前需要解码的子码流层为当前码流层,再确定当前码流层对应的符号处理方法数量。
步骤4:转至执行具体实施例四中步骤3;
参考具体实施例四中步骤3。
步骤5:确定第一符号处理方法和第二符号处理方法及其对应的符号处理参数;
参考具体实施例三中步骤3,所述第一符号处理方法和第二符号处理方法包括但不限于符号预测方法和符号位隐藏方法的任意组合。因此第一符号处理参数和第二符号处理参数同样包括但不限于符号预测参数和符号位隐藏参数的任意组合。
所述符号预测参数可以包括但不限于进行符号预测的系数个数、和/或进行符号预测的系数最大值、和/或进行符号预测的方法。所述进行符号预测的方法包括但不限于模板生成方法、假设重构生成方法、成本函数计算方法等。所述符号位隐藏参数可以包括但不限于进行符号位隐藏的系数个数、和/或进行符号位隐藏的系数最大值、和/或进行符号位隐藏的方法。所述符号处理参数可以从本地配置信息中获取,也可以从码流或媒体文件中获取,还可以一部分从配置信息中获取,一部分从码流中获取。
对于同一图像块,不同子码流层中对应的第一符号处理参数或第二符号处理参数所包含的参数类型、参数数量可以是不同的,也可以是相同的。不同子码流类型对应的第一符号处理参数或第二符号处理参数中的同一个符号处理参数的值可以是不同的,也可以是相同的。
对于同一码流层中,不同的图像块对应的第一符号处理参数或第二符号处理参数所包含的参数类型、参数数量可以是不同的,也可以是相同的。不同子码流类型对应的第一符号处理参数或第二符号处理参数中的同一个符号处理参数的值可以是不同的,也可以是相同的。
步骤6:根据所述第一和第二符号处理方法及参数确定当前子码流层的系数及其符号;
确定当前子码流层的系数及其符号可以进一步包括如下步骤:根据所述第一符号处理方法及其参数确定当前子码流层的第一系数其对应的符号;根据所述第二符号处理方法及其参数确定当前子码流层的第二系数及其对应的符号;确定除被第一符号处理和第二符号处理的系数以外的剩余第三系数及其对应的符号。
所述当前子码流层的系数及其符号包括第一系数及其符号、第二系数及其符号和第三系数及其符号。所述第一系数、第二系数和第三系数分别可以包含一个或多个系数的绝对值。
步骤7:执行后续解码过程,获得解码图像;
参考具体实施例四中步骤4。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机, 服务器,或者网络设备等)执行本发明各个实施例所述的方法。
在本实施例中还提供了一种编码装置和一种解码装置,该装置分别用于实现上述编码实施例及优选实施方式以及解码实施例及优选实时方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图14是根据本发明实施例的编码装置的结构框图,如图14所示,该装置包括:
第一确定模块142,设置为确定当前编码的目标子码流的目标类型,以及与所述目标类型对应的目标符号处理方法以及目标符号处理参数;
处理模块144,设置为基于所述目标符号处理参数按照所述目标符号处理方法对当前图像块的系数进行目标符号处理;
编码模块146,设置为基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码。
在一个可选的实施例中,所述装置还包括第三确定模块,设置为在基于所述目标符号处理参数按照所述目标符号处理方法对当前图像块的系数进行目标符号处理之前,基于第一条件确定需要对所述当前图像块的系数进行所述目标符号处理,其中,所述第一条件包括以下至少之一:所述当前图像块的特征大小、所述当前图像块的系数的分布状态、所述当前图像块中非零系数的数量、所述目标符号处理的处理模式、变换方式、与所述当前图像块相邻的其他图像块的特征信息、本地配置信息、所述目标子码流的所述目标类型、多种符号处理方法的优先级、所述当前图像块所在图像的特征、所述当前图像块所在图像的所在序列的特征、成本函数或率失真函数的计算结果。
在一个可选的实施例中,所述编码模块146包括:第一编码单元,设置为对所述当前图像块中包括的进行了所述目标符号处理的系数以及未进行所述目标符号处理的系数分别进行编码,其中,对进行了所述目标符号处理的系数进行编码的编码方式与对未进行所述目标符号处理的系数进行编码的编码方式相同或者不同;其中,所述目标符号处理方法包括一种或多种;在所述目标符号处理方法包括多种处理方法的情况下,采用一种编码方式对所述当前图像块中包括的进行了所述目标符号处理的系数进行编码;在所述目标符号处理方法包括多种处理方法的情况下,对所述当前图像块中包括的按照不同的目标符号处理方法进行了目标符号处理的系数分别进行编码,且按照不同的目标符号处理方法进行了目标符号处理的系数的编码方式彼此之间相同或不同。
在一个可选的实施例中,所述编码模块146包括:第一确定单元,设置为在所述目标符号处理方法包括符号预测处理方法的情况下,基于所述符号预测处理的处理结果确定系数的预测符号与原始符号的差异;第二编码单元,设置为按照与所述符号预测处理方法对应的编码方式对所述差异进行编码。
在一个可选的实施例中,所述装置还包括:第一添加模块,设置为在基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码之后,将所述编码的结果添加到所述目标子码流中。
在一个可选的实施例中,所述装置还包括:第四确定模块,设置为在基于所述目标符号 处理的处理结果对所述当前图像块的系数进行编码之前,确定需要按照基于系数重要性的分层编码方式对所述当前图像块的系数进行编码。
在一个可选的实施例中,所述第四确定模块包括:第二确定单元,设置为基于以下方式至少之一确定需要按照基于系数重要性的分层编码方式对所述当前图像块的系数进行编码:
根据编码器的本地配置确定,根据所述当前图像块的特征确定,根据所述当前图像块所在的视频序列确定,根据已知的待接收编码码流的解码器能力或配置确定,根据采用的依赖增强层编码方式确定,根据接收到的指示性信息确定,其中,所述指示性信息来自于未编码图像的发送端或者是已编码图像的接收端。
在一个可选的实施例中,所述装置还包括:排序模块,设置为对所述当前图像块的系数按照系数重要性进行重新排序;第五确定模块,设置为按照重新排序后的所述当前图像块的系数所处的位置确定各个所述系数所属的编码层。
在一个可选的实施例中,所述装置还包括第二添加模块,设置为在基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码之后,执行以下操作至少之一:
在所述目标子码流中添加用于指示所述目标子码流类型的指示信息;
在所述目标子码流中添加标识信息,其中,所述标识信息用于指示以下至少之一:解码端在解码参考层子码流时,需要存储解码结果或解码元数据以供解码后续增强层子码流时使用;解码端在解码增强层子码流时获取所述增强层子码流所依赖的参考层子码流的解码结果或解码元数据。
在一个可选的实施例中,所述目标符号处理包括以下处理至少之一:符号预测处理、符号位隐藏处理。
图15是根据本发明实施例的解码装置的结构框图,如图15所示,该装置包括:
获取模块152,设置为在接收到分层编码视频码流的情况下,获取各个子码流对应的目标符号处理方法以及目标符号处理参数;
第二确定模块154,设置为基于各个所述子码流对应的目标符号处理方法以及目标符号处理参数确定各个所述子码流对应的系数的符号;
解码模块156,设置为基于各个所述子码流对应的系数的符号对所述分层编码视频码流中的各个子码流进行解码。
在一个可选的实施例中,所述获取模块152包括以下至少之一:
第一获取单元,设置为从本地配置信息中获取所述目标符号处理参数;
第二获取单元,设置为从所述分层编码视频码流或目标媒体文件中获取所述目标符号处理参数;
第三获取单元,设置为基于所述分层编码视频码流中包括的参数信息确定所述目标符号处理参数。
在一个可选的实施例中,所述装置还包括存储模块,设置为在基于各个所述子码流对应 的系数以及系数的符号对所述分层编码视频码流中的各个子码流进行解码之后,在确定当前解码的子码流为参考层子码流的情况下,存储所述当前解码的子码流的解码结果;或者,在确定当前解码的子码流为参考层子码流的情况下,存储所述当前解码的子码流的解码元数据。
在一个可选的实施例中,所述获取模块152包括:第三确定单元,设置为基于当前解码的子码流的类型确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数。
在一个可选的实施例中,所述装置还包括以下至少之一:
第六确定模块,设置为获取所述分层编码视频码流中携带的指示信息,基于所述指示信息确定所述当前解码的子码流的类型;
处理模块,设置为获取所述分层编码视频码流中携带的标识信息,基于所述标识信息执行以下操作至少之一:在所述当前解码的子码流为参考层子码流时,存储所述当前解码的子码流的解码结果或解码元数据以供解码后续增强层子码流时使用;在所述当前解码的子码流为增强层子码流时,获取所述增强层子码流所依赖的参考层子码流的解码结果或解码元数据。
在一个可选的实施例中,所述获取模块152包括:第四获取单元,设置为获取当前解码的子码流对应的符号处理方法的目标数量;第四确定单元,设置为基于所述目标数量确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数。
在一个可选的实施例中,所述第四确定单元包括:第一确定子单元,设置为在所述目标数量为1的情况下,基于所述当前解码的子码流的类型确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数;第二确定子单元,设置为在所述目标数量大于1的情况下,分别确定各个所述目标符号处理方法以及对应的目标符号处理参数,以及各个所述目标符号处理方法的处理顺序。
在一个可选的实施例中,所述第三确定单元以及所述第一确定子单元均设置为通过如下方式实现基于所述当前解码的子码流的类型确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数:在确定当前解码的子码流为依赖增强层子码流的情况下,获取所述分层编码视频码流中包括的所述当前解码的子码流的参考层子码流的解码元数据,基于所述参考层子码流的解码元数据确定所述当前解码的子码流的系数以及系数的符号;和/或,在确定当前解码的子码流为依赖增强层子码流的情况下,获取存储的与所述当前解码的子码流对应的图像参考的已解码图像,基于所述已解码图像确定所述当前解码的子码流的系数以及系数的符号。
在一个可选的实施例中,所述第二确定模块154包括:第五确定单元,设置为根据符号预测处理以及符号预测处理参数确定所述当前解码的子码流中包括的第一系数的符号,其中,所述第一系数为进行了所述符号预测处理的系数;第六确定单元,设置为根据符号位隐藏处理以及符号位隐藏处理参数确定所述当前解码的子码流中包括的第二系数的符号,其中,所述第二系数为进行了所述符号位隐藏处理的系数;第六确定单元,设置为确定所述当前解码的子码流中包括的第三系数的符号,其中,所述第三系数为所述当前解码的子码流中包括的除所述第一系数及所述第二系数之外的系数。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以 下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
本发明的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
本发明的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。
在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (23)

  1. 一种编码方法,包括:
    确定当前编码的目标子码流的目标类型,以及与所述目标类型对应的目标符号处理方法以及目标符号处理参数;
    基于所述目标符号处理参数按照所述目标符号处理方法对当前图像块的系数进行目标符号处理;
    基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码。
  2. 根据权利要求1所述的方法,其中,在基于所述目标符号处理参数按照所述目标符号处理方法对当前图像块的系数进行目标符号处理之前,所述方法还包括:
    基于第一条件确定需要对所述当前图像块的系数进行所述目标符号处理,其中,所述第一条件包括以下至少之一:
    所述当前图像块的特征大小、所述当前图像块的系数的分布状态、所述当前图像块中非零系数的数量、所述目标符号处理的处理模式、变换方式、与所述当前图像块相邻的其他图像块的特征信息、本地配置信息、所述目标子码流的所述目标类型、多种符号处理方法的优先级、所述当前图像块所在图像的特征、所述当前图像块所在图像的所在序列的特征、成本函数或率失真函数的计算结果。
  3. 根据权利要求1所述的方法,其中,基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码包括:
    对所述当前图像块中包括的进行了所述目标符号处理的系数以及未进行所述目标符号处理的系数分别进行编码,其中,对进行了所述目标符号处理的系数进行编码的编码方式与对未进行所述目标符号处理的系数进行编码的编码方式相同或者不同;
    其中,所述目标符号处理方法包括一种或多种;在所述目标符号处理方法包括一种处理方法的情况下,采用一种编码方式对所述当前图像块中包括的进行了所述目标符号处理的系数进行编码;在所述目标符号处理方法包括多种处理方法的情况下,对所述当前图像块中包括的按照不同的目标符号处理方法进行了目标符号处理的系数分别进行编码,且按照不同的目标符号处理方法进行了目标符号处理的系数的编码方式彼此之间相同或不同。
  4. 根据权利要求3所述的方法,其中,基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码包括:
    在所述目标符号处理方法包括符号预测处理方法的情况下,基于所述符号预测处理的处理结果确定系数的预测符号与原始符号的差异;
    按照与所述符号预测处理方法对应的编码方式对所述差异进行编码。
  5. 根据权利要求1所述的方法,其中,在基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码之后,所述方法还包括:
    将所述编码的结果添加到所述目标子码流中。
  6. 根据权利要求1所述的方法,其中,在基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码之前,所述方法还包括:
    确定需要按照基于系数重要性的分层编码方式对所述当前图像块的系数进行编码。
  7. 根据权利要求6所述的方法,其中,确定需要按照基于系数重要性的分层编码方式对所述当前图像块的系数进行编码包括:
    基于以下方式至少之一确定需要按照基于系数重要性的分层编码方式对所述当前图像块的系数进行编码:
    根据编码器的本地配置确定,根据所述当前图像块的特征确定,根据所述当前图像块所在的视频序列确定,根据已知的待接收编码码流的解码器能力或配置确定,根据采用的依赖增强层编码方式确定,根据接收到的指示性信息确定,其中,所述指示性信息来自于未编码图像的发送端或者是已编码图像的接收端。
  8. 根据权利要求6所述的方法,其中,所述方法还包括:
    对所述当前图像块的系数按照系数重要性进行重新排序;
    按照重新排序后的所述当前图像块的系数所处的位置确定各个所述系数所属的编码层。
  9. 根据权利要求6所述的方法,其中,在基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码之后,所述方法还包括以下至少之一:
    在所述目标子码流中添加用于指示所述目标子码流类型的指示信息;
    在所述目标子码流中添加标识信息,其中,所述标识信息用于指示以下至少之一:解码端在解码参考层子码流时,需要存储解码结果或解码元数据以供解码后续增强层子码流时使用;解码端在解码增强层子码流时获取所述增强层子码流所依赖的参考层子码流的解码结果或解码元数据。
  10. 根据权利要求1至9中任一项所述的方法,所述目标符号处理包括以下处理至少之一:
    符号预测处理、符号位隐藏处理。
  11. 一种解码方法,包括:
    在接收到分层编码视频码流的情况下,获取各个子码流对应的目标符号处理方法以及目标符号处理参数;
    基于各个所述子码流对应的目标符号处理方法以及目标符号处理参数确定各个所述子码流对应的系数的符号;
    基于各个所述子码流对应的系数的符号对所述分层编码视频码流中的各个子码流进行解码。
  12. 根据权利要求11所述的方法,其中,获取各个子码流对应的目标符号处理参数包括以下至少之一:
    从本地配置信息中获取所述目标符号处理参数;
    从所述分层编码视频码流或目标媒体文件中获取所述目标符号处理参数;
    基于所述分层编码视频码流中包括的参数信息确定所述目标符号处理参数。
  13. 根据权利要求11所述的方法,其中,在基于各个所述子码流对应的系数以及系数的符号对所述分层编码视频码流中的各个子码流进行解码之后,所述方法还包括:
    在确定当前解码的子码流为参考层子码流的情况下,存储所述当前解码的子码流的解码结果;或者,
    在确定当前解码的子码流为参考层子码流的情况下,存储所述当前解码的子码流的解码元数据。
  14. 根据权利要求11所述的方法,其中,获取各个子码流对应的目标符号处理方法以及目标符号处理参数包括:
    基于当前解码的子码流的类型确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数。
  15. 根据权利要求11所述的方法,其中,所述方法还包括以下至少之一:
    获取所述分层编码视频码流中携带的指示信息,基于所述指示信息确定当前解码的子码流的类型;
    获取所述分层编码视频码流中携带的标识信息,基于所述标识信息执行以下操作至少之一:在所述当前解码的子码流为参考层子码流时,存储所述当前解码的子码流的解码结果或解码元数据以供解码后续增强层子码流时使用;在所述当前解码的子码流为增强层子码流时,获取所述增强层子码流所依赖的参考层子码流的解码结果或解码元数据。
  16. 根据权利要求14所述的方法,其中,获取各个子码流对应的目标符号处理方法以及目标符号处理参数包括:
    获取当前解码的子码流对应的符号处理方法的目标数量;
    基于所述目标数量确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数。
  17. 根据权利要求16所述的方法,其中,基于所述目标数量确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数包括:
    在所述目标数量为1的情况下,基于所述当前解码的子码流的类型确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数;
    在所述目标数量大于1的情况下,分别确定各个所述目标符号处理方法以及对应的目标符号处理参数,以及各个所述目标符号处理方法的处理顺序。
  18. 根据权利要求14或17所述的方法,其中,基于所述当前解码的子码流的类型确定所述当前解码的子码流对应的目标符号处理方法以及目标符号处理参数包括:
    在确定当前解码的子码流为依赖增强层子码流的情况下,获取所述分层编码视频码流中包括的所述当前解码的子码流的参考层子码流的解码元数据,基于所述参考层子码流的解码元数据确定所述当前解码的子码流的系数以及系数的符号;和/或,
    在确定当前解码的子码流为依赖增强层子码流的情况下,获取存储的与所述当前解码的子码流对应的图像参考的已解码图像,基于所述已解码图像确定所述当前解码的子码流的系数以及系数的符号。
  19. 根据权利要求17所述的方法,其中,基于各个所述子码流对应的目标符号处理方法以及目标符号处理参数确定各个所述子码流对应的系数的符号包括:
    根据符号预测处理以及符号预测处理参数确定所述当前解码的子码流中包括的第一系数的符号,其中,所述第一系数为进行了所述符号预测处理的系数;
    根据符号位隐藏处理以及符号位隐藏处理参数确定所述当前解码的子码流中包括的第二系数的符号,其中,所述第二系数为进行了所述符号位隐藏处理的系数;
    确定所述当前解码的子码流中包括的第三系数的符号,其中,所述第三系数为所述当前解码的子码流中包括的除所述第一系数及所述第二系数之外的系数。
  20. 一种编码装置,包括:
    第一确定模块,设置为确定当前编码的目标子码流的目标类型,以及与所述目标类型对应的目标符号处理方法以及目标符号处理参数;
    处理模块,设置为基于所述目标符号处理参数按照所述目标符号处理方法对当前图像块的系数进行目标符号处理;
    编码模块,设置为基于所述目标符号处理的处理结果对所述当前图像块的系数进行编码。
  21. 一种解码装置,包括:
    获取模块,设置为在接收到分层编码视频码流的情况下,获取各个子码流对应的目标符号处理方法以及目标符号处理参数;
    第二确定模块,设置为基于各个所述子码流对应的目标符号处理方法以及目标符号处理参数确定各个所述子码流对应的系数的符号;
    解码模块,设置为基于各个所述子码流对应的系数的符号对所述分层编码视频码流中的各个子码流进行解码。
  22. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被处理器执行时实现所述权利要求1至10任一项中所述的方法的步骤,或者实现权利要求11至19任一项中所述的方法的步骤。
  23. 一种电子装置,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现所述权利要求1至10任一项中所述的方法的步骤,或者实现权利要求11至19任一项中所述的方法的步骤。
PCT/CN2023/079630 2022-03-17 2023-03-03 编码方法及装置、解码方法及装置、存储介质、电子装置 WO2023174076A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210266047.7A CN116800968A (zh) 2022-03-17 2022-03-17 编码方法及装置、解码方法及装置、存储介质、电子装置
CN202210266047.7 2022-03-17

Publications (1)

Publication Number Publication Date
WO2023174076A1 true WO2023174076A1 (zh) 2023-09-21

Family

ID=88022313

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/079630 WO2023174076A1 (zh) 2022-03-17 2023-03-03 编码方法及装置、解码方法及装置、存储介质、电子装置

Country Status (2)

Country Link
CN (1) CN116800968A (zh)
WO (1) WO2023174076A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101606391A (zh) * 2007-01-18 2009-12-16 弗劳恩霍夫应用研究促进协会 质量可缩放视频数据流
CN103916670A (zh) * 2013-01-07 2014-07-09 华为技术有限公司 一种图像的编码、解码方法及装置
CN106105047A (zh) * 2014-03-14 2016-11-09 夏普株式会社 具有颜色空间可缩放性的视频压缩
US20190208225A1 (en) * 2018-01-02 2019-07-04 Qualcomm Incorporated Sign prediction in video coding
CN109997361A (zh) * 2016-12-21 2019-07-09 高通股份有限公司 用于视频译码的低复杂度符号预测
CN111684810A (zh) * 2018-02-05 2020-09-18 索尼公司 数据编码和解码
US20200404311A1 (en) * 2018-03-07 2020-12-24 Huawei Technologies Co., Ltd. Method and apparatus for residual sign prediction in transform domain

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101606391A (zh) * 2007-01-18 2009-12-16 弗劳恩霍夫应用研究促进协会 质量可缩放视频数据流
CN103916670A (zh) * 2013-01-07 2014-07-09 华为技术有限公司 一种图像的编码、解码方法及装置
CN106105047A (zh) * 2014-03-14 2016-11-09 夏普株式会社 具有颜色空间可缩放性的视频压缩
CN109997361A (zh) * 2016-12-21 2019-07-09 高通股份有限公司 用于视频译码的低复杂度符号预测
US20190208225A1 (en) * 2018-01-02 2019-07-04 Qualcomm Incorporated Sign prediction in video coding
CN111684810A (zh) * 2018-02-05 2020-09-18 索尼公司 数据编码和解码
US20200404311A1 (en) * 2018-03-07 2020-12-24 Huawei Technologies Co., Ltd. Method and apparatus for residual sign prediction in transform domain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
L. XU (OPPO), Y. YU (OPPO), H. YU (OPPO), Z. XIE (OPPO), F. WANG (OPPO), D. WANG (OPPO): "EE2-4.2-related: On adaptive sign prediction position selection", 25. JVET MEETING; 20220112 - 20220121; TELECONFERENCE; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 5 January 2022 (2022-01-05), XP030300440 *

Also Published As

Publication number Publication date
CN116800968A (zh) 2023-09-22

Similar Documents

Publication Publication Date Title
US20220217387A1 (en) Temporal Identifier Constraints For SEI Messages
CN113498522A (zh) 视频译码中的自适应参数集类型
KR20210113390A (ko) 인트라 예측의 인코더, 디코더 및 대응하는 방법
US20220217376A1 (en) Picture Timing And Decoding Unit Information For Temporal Scalability
US11445188B2 (en) Partitioning with high level constraint
US20210337237A1 (en) Efficient Patch Rotation in Point Cloud Coding
KR20220065061A (ko) 다계층 비디오 비트스트림에서 불필요한 계층 금지
US11889087B2 (en) Tile group assignment for raster scan and rectangular tile groups in video coding
US11425377B2 (en) Arbitrary and wrap-around tile grouping
CN113796078A (zh) 帧内预测模式相关的编码器、解码器及对应方法
CN115002474A (zh) 支持多视图可适性的ols
CN115836527A (zh) 编码器、解码器及用于自适应环路滤波的对应方法
WO2022166462A1 (zh) 编码、解码方法和相关设备
KR102650289B1 (ko) 비디오 인코더, 비디오 디코더 및 상응하는 방법들
CN111416975A (zh) 预测模式确定方法和装置
WO2023174076A1 (zh) 编码方法及装置、解码方法及装置、存储介质、电子装置
WO2021180220A1 (zh) 图像编码和解码方法及装置
WO2021027799A1 (zh) 视频编码器及qp设置方法
CN114846789A (zh) 用于指示条带的图像分割信息的解码器及对应方法
CN114598873B (zh) 量化参数的解码方法和装置
CN113891084B (zh) 帧内预测模式相关的编码器、解码器、对应方法及计算机可读介质
CN115299070A (zh) 编码器、解码器及对应的方法
US20170055003A1 (en) Context Reduction Of Palette Run Type In High Efficiency Video Coding (HEVC) Screen Content Coding (SCC)

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

Country of ref document: EP

Kind code of ref document: A1