WO2022183335A1 - Image encoding and decoding methods, encoder, decoder, and storage medium - Google Patents

Image encoding and decoding methods, encoder, decoder, and storage medium Download PDF

Info

Publication number
WO2022183335A1
WO2022183335A1 PCT/CN2021/078522 CN2021078522W WO2022183335A1 WO 2022183335 A1 WO2022183335 A1 WO 2022183335A1 CN 2021078522 W CN2021078522 W CN 2021078522W WO 2022183335 A1 WO2022183335 A1 WO 2022183335A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
quantization
channels
value
inverse quantization
Prior art date
Application number
PCT/CN2021/078522
Other languages
French (fr)
Chinese (zh)
Inventor
虞露
周胜辉
邵宇超
于化龙
戴震宇
Original Assignee
浙江大学
Oppo广东移动通信有限公司
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 浙江大学, Oppo广东移动通信有限公司 filed Critical 浙江大学
Priority to CN202180090510.0A priority Critical patent/CN116982082A/en
Priority to PCT/CN2021/078522 priority patent/WO2022183335A1/en
Publication of WO2022183335A1 publication Critical patent/WO2022183335A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation

Definitions

  • the present application relates to the technical field of video encoding and decoding, and in particular, to an image encoding and decoding method, an encoder, a decoder, and a storage medium.
  • Digital video technology can be incorporated into a variety of video devices, such as digital televisions, smartphones, computers, e-readers or video players, and the like. With the development of video technology, the amount of data included in video data is relatively large. In order to facilitate the transmission of video data, video devices implement video compression technology to enable more efficient transmission or storage of video data.
  • Embodiments of the present application provide an image encoding and decoding method, an encoder, a decoder, and a storage medium, so as to improve encoding efficiency.
  • the present application provides an image encoding method, including:
  • an embodiment of the present application provides an image decoding method, including:
  • inverse quantization is performed on the feature data of the at least one channel.
  • the present application provides a video encoder for performing the method in the first aspect or each of its implementations.
  • the encoder includes a functional unit for executing the method in the above-mentioned first aspect or each of its implementations.
  • the present application provides a video decoder for executing the method in the second aspect or each of its implementations.
  • the decoder includes functional units for performing the methods in the second aspect or the respective implementations thereof.
  • a video encoder including a processor and a memory.
  • the memory is used for storing a computer program
  • the processor is used for calling and running the computer program stored in the memory, so as to execute the method in the above-mentioned first aspect or each implementation manner thereof.
  • a video decoder including a processor and a memory.
  • the memory is used for storing a computer program
  • the processor is used for calling and running the computer program stored in the memory, so as to execute the method in the above-mentioned second aspect or each implementation manner thereof.
  • a video encoding and decoding system including a video encoder and a video decoder.
  • a video encoder is used to perform the method in the first aspect or each of its implementations, and a video decoder is used to perform the method in the above-mentioned second aspect or its implementations.
  • a chip for implementing any one of the above-mentioned first aspect to the second aspect or the method in each implementation manner thereof.
  • the chip includes: a processor for invoking and running a computer program from a memory, so that a device on which the chip is installed executes any one of the above-mentioned first to second aspects or each of its implementations method.
  • a computer-readable storage medium for storing a computer program, the computer program causing a computer to execute the method in any one of the above-mentioned first aspect to the second aspect or each of its implementations.
  • a computer program product comprising computer program instructions, the computer program instructions causing a computer to perform the method in any one of the above-mentioned first to second aspects or the implementations thereof.
  • a computer program which, when run on a computer, causes the computer to perform the method in any one of the above-mentioned first to second aspects or the respective implementations thereof.
  • the feature data of the current image includes the feature data of N channels; Perform quantization; encode the quantized feature data of at least one channel to obtain a code stream, where the code stream includes first information, and the first information is used to instruct the decoding point to perform the quantization on the feature data of at least one channel in the N channels Inverse quantization.
  • the feature data output by the middle layer of the neural network is quantized, so that the technologies in the existing video and image encoding and decoding standards can be reused to encode the feature data, and the encoding efficiency is improved.
  • FIG. 1 is a schematic diagram of an encoding and decoding framework for image pre-analysis and recompression involved in an embodiment of the present application
  • Fig. 2 is a schematic diagram of an MPEG-VCM potential encoding process
  • FIG. 3 is a schematic flowchart of an image encoding method 300 provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of an image encoding method 400 provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of an image encoding method 500 provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of an image encoding method 600 provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of an image decoding method 700 provided by an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of an image decoding method 800 provided by an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of an image decoding method 900 provided by an embodiment of the present application.
  • FIG. 10 is a schematic flowchart of an image decoding method 1000 provided by an embodiment of the present application.
  • FIG. 11 is a schematic block diagram of a video encoder 10 provided by an embodiment of the present application.
  • FIG. 12 is a schematic block diagram of a video decoder 20 provided by an embodiment of the present application.
  • FIG. 13 is a schematic block diagram of an electronic device 30 provided by an embodiment of the present application.
  • FIG. 14 is a schematic block diagram of a video encoding and decoding system 40 provided by an embodiment of the present application.
  • This application can be applied to various video encoding and decoding fields for machine vision and human-machine hybrid vision, combining 5G, AI, deep learning, feature extraction and video analysis technologies with existing video processing and encoding technologies.
  • the 5G era has spawned a large number of machine-oriented applications, such as the Internet of Vehicles, unmanned driving, industrial Internet, smart and safe cities, wearables, video surveillance and other machine vision content. Compared with the increasingly saturated human-oriented video, the application scenarios are more extensive. , video encoding for machine vision will become one of the main sources of incremental traffic in the 5G and post-5G era.
  • the solution of the present application can be combined with audio video coding standard (audio video coding standard, AVS for short), for example, H.264/audio video coding (audio video coding, AVC for short) standard, H.265/High Efficiency Video Coding ( High efficiency video coding, referred to as HEVC) standard and H.266/versatile video coding (versatile video coding, referred to as VVC) standard.
  • audio video coding standard audio video coding standard, AVS for short
  • AVS audio video coding standard
  • AVS audio video coding standard
  • H.264/audio video coding audio video coding, AVC for short
  • H.265/High Efficiency Video Coding High efficiency video coding, referred to as HEVC
  • H.266/versatile video coding versatile video coding, referred to as VVC
  • the schemes of the present application may operate in conjunction with other proprietary or industry standards including ITU-TH.261, ISO/IECMPEG-1 Visual, ITU-TH.262 or ISO/IECMPEG-2 Visual, ITU-TH.263 , ISO/IECMPEG-4Visual, ITU-TH.264 (also known as ISO/IECMPEG-4AVC), including Scalable Video Codec (SVC) and Multi-View Video Codec (MVC) extensions.
  • SVC Scalable Video Codec
  • MVC Multi-View Video Codec
  • FIG. 1 is a schematic diagram of an encoding/decoding framework for image pre-analysis and recompression according to an embodiment of the present application.
  • videos and images are also used to analyze and understand the semantic information in them.
  • many researchers now switch from traditional direct compression coding of images to compression coding of feature data output by the middle layer of the intelligent analysis task network.
  • end-side devices such as cameras first use task networks to pre-analyze the original video and image data collected or input, such as input task network A, task network B, and task network B, and extract enough cloud analysis. feature data, and compress, encode and transmit these feature data.
  • the cloud device After the cloud device receives the corresponding code stream, it reconstructs the corresponding feature data according to the syntax information of the code stream, and inputs it into the specific task network for further analysis.
  • the cloud device Under the coding and decoding framework shown in Figure 1, there is a large amount of feature data transmission between the terminal device and the cloud device.
  • the purpose of feature data compression is to compress and encode the feature data extracted from the existing task network in a recoverable manner. , for further intelligent analysis and processing in the cloud.
  • FIG. 2 is a schematic diagram of a potential coding flow of MPEG-VCM.
  • the VCM standard working group has designed a potential coding flow chart as shown in Figure 2, in order to improve the coding efficiency of video and images under intelligent analysis tasks.
  • the video and image can directly pass through the video and image encoder optimized for the task, or use network pre-analysis to extract feature data and encode it, and then input the decoded feature data into the subsequent network for further analysis. If it is necessary to multiplex the existing video and image coding standards to compress the extracted feature data, it is necessary to perform fixed-point processing on the feature data represented by the floating point type.
  • the encoding process is introduced by taking the encoding end as an example.
  • FIG. 3 is a schematic flowchart of an image encoding method 300 provided by an embodiment of the present application.
  • the execution body of the embodiment of the present application can be understood as the encoder shown in FIG. 2 , as shown in FIG. 3 , including:
  • S302 input the current image into a neural network to obtain feature data of the current image, where the feature data of the current image includes the feature data of N channels, where N is a positive integer;
  • S304 Encode the quantized feature data of the at least one channel to obtain a code stream, where the code stream includes first information, where the first information is used to indicate that the feature data of at least one channel among the N channels is to be encoded. Inverse quantization.
  • the current image in this application can be understood as a frame of image to be encoded in the video process or a part of the image in the frame; or, the current image can be understood as a single image to be encoded or a part of the image in the image to be encoded.
  • the neural network in this application is any task network, for example, a classification network, a target detection network, a semantic segmentation gateway, etc.
  • the type of the neural network is not limited in this application.
  • the feature data is a floating-point number type.
  • Feature data is quantified.
  • most existing video coding frameworks compress fixed-point data during compression. Therefore, the encoder needs to quantize floating-point feature data into fixed-point feature data. Characteristic data of point type is encoded.
  • the feature data of the fixed-point type includes the feature data of the integer type, that is, the encoder quantizes the feature data of the floating-point number type into the feature data of the integer type.
  • the feature data of the floating-point number type of the current image includes the feature data of the floating-point number type of N channels, where N is a positive integer. Types of feature data are quantified.
  • the methods for quantizing the floating-point type feature data of at least one of the N channels in S303 include, but are not limited to, the following:
  • Manner 1 Use the same quantization method to quantize the floating-point feature data of all channels in the N channels; in this case, transmit a set of quantization parameters in all the N channels in the code stream.
  • the second method is to use a quantization method to quantize the floating point type feature data of each channel in the N channels; at this time, each channel of the N channels in the code stream transmits a set of quantization parameters.
  • Manner 3 Group the N channels, and use a quantization method to quantize the floating point type feature data of each group of channels. At this time, a set of quantization parameters are transmitted in the same group of channels in the code stream.
  • the quantization method for quantizing the floating point type feature data of at least one channel may include a linear uniform quantization method, a nonlinear uniform quantization method, or a look-up table quantization method.
  • the nonlinear uniform quantization method further includes nonlinear exponential function quantization and nonlinear logarithmic function quantization.
  • the quantization methods in the embodiments of the present application include but are not limited to the above several quantization methods, and other quantization methods may also be used to quantify the characteristic data of the floating point type into the characteristic data of the fixed point type. No restrictions.
  • the current image to be encoded is obtained, and the current image is input into a neural network to obtain floating-point feature data of the current image, wherein the floating-point feature data of the current image includes floating point data of N channels. point type feature data; quantize the floating point type feature data of at least one channel in the N channels; encode the quantized feature data of at least one channel to obtain a code stream.
  • the progress of the feature data output from the middle layer of the neural network is fixed, so that the existing video and image coding and decoding standards can be reused to encode the feature data, and the feature data of at least one channel of the N channels can be encoded at the same time.
  • Fixed-pointing is performed, so as to improve the encoding efficiency of the fixed-point feature data and realize efficient compression of the feature data.
  • the present application considers the channel information of the feature data in the quantization process at the encoding end, and can process the feature data between different channels, thereby improving the quantization reliability of the feature data.
  • FIG. 4 is a schematic flowchart of an image encoding method 400 provided by an embodiment of the present application, as shown in FIG. 4 , including:
  • S404 Encode the feature data of the fixed-point type of the current image to obtain a code stream.
  • the quantization method includes linear uniform quantization, nonlinear function quantization, and look-up table quantization.
  • the above code stream includes fixed-point feature data under all channels.
  • the above S403 includes the following S403-A1 and S403-A2:
  • S403-A1 obtain the preset first quantization bit width, and the first eigenvalue and the second eigenvalue in the feature data of the floating point type of all channels in the N channels;
  • the first eigenvalue, the second eigenvalue, and the first quantization bit width use a linear uniform quantization method to quantize the floating point type feature data of each channel in the N channels.
  • the feature data of the floating point type of all channels in the N channels are taken as a whole, and the first feature value and the second feature value are obtained from the feature data of the floating point number type of all channels in the N channels.
  • the above-mentioned preset first quantization bit width may be preset and set in the configuration file of the encoder.
  • the first eigenvalue is the smallest eigenvalue in the feature data of the floating point type of all channels in the N channels of the current image
  • the second eigenvalue is the floating point number of all channels in the N channels of the current image The largest eigenvalue in the eigendata of type.
  • the encoder quantizes the floating-point type feature data of all channels in the N channels according to the following formula (1):
  • x cij is the eigenvalue of the floating-point type of the i-th row and the j-th column of the c-th channel; x cmax1 and x cmin1 are the second eigenvalues and The first eigenvalue; bitdepth1 is the first quantization bit width, int[ ] represents the integerization function; y cij is the eigenvalue of the fixed-point type of the i-th row and the j-th column of the c-th channel after quantization; ⁇ is a polar It is a small value, and can be set to 0, which is used to map the floating-point feature data into a value range of left closed and right open.
  • nonlinear uniform quantization methods include nonlinear logarithmic uniform quantization methods and nonlinear exponential uniform quantization methods.
  • the above S403 includes the following S403-B1 and S403-B2:
  • S403-B1 obtain the preset second quantization bit width and the first base of the logarithmic function, and the first eigenvalue and the second eigenvalue in the characteristic data of the floating point type of all channels in the N channels;
  • the preset second quantization bit width and the first base of the logarithmic function may be preset by the user and set in the configuration file of the encoder.
  • the second quantization bit width may be determined according to the size of the first characteristic value
  • the first base of the logarithmic function is determined according to the characteristic of the characteristic data.
  • the encoder quantizes the floating point type feature data of each of the N channels according to the following formula (3):
  • bitdepth2 is the second quantization bit width
  • log_base1 is the first base of the logarithmic function used in logarithmic quantization.
  • the second quantization bit width is equal to the first quantization bit width.
  • the above S403 includes the following S403-C1 and S403-C2:
  • S403-C1 obtain the preset third quantization bit width and the first base of the exponential function, and the first eigenvalue and the second eigenvalue in the characteristic data of the floating point type of all channels in the N channels;
  • the above-mentioned preset third quantization bit width and the first base of the exponential function may be preset by the user and set in the configuration file of the encoder.
  • the third quantization bit width may be determined according to the size of the first characteristic value, and the first base of the exponential function is determined according to the characteristic of the characteristic data.
  • the encoder quantizes the floating point type feature data of each of the N channels according to the following formula (5):
  • bitdepth3 is the third quantization bit width
  • e_base is the first base of the exponential function used in exponential quantization.
  • the above-mentioned third quantization bit width is equal to the above-mentioned first quantization bit width.
  • the above S403 includes the following S403-D1 to S403-D3:
  • the feature data of the floating-point number type of all channels in the N channels are taken as a whole, and each feature value in the feature data of the floating-point number type of all channels in the N channels is sorted in descending order according to the value size. Or sort from small to large to obtain the feature data of the floating point type of all channels after sorting.
  • the sorted feature data is called the sorted first feature data.
  • the sorted first feature data is divided into a plurality of first quantization intervals, and each first quantization interval includes the same quantity of feature data.
  • Each first quantization interval is represented by an index that can be represented by a corresponding quantization bit width, so that each first quantization interval has an index. In this way, during quantization, the value of the feature data in each first quantization interval can be quantized into an index value of each first quantization interval.
  • the corresponding reconstruction value is also set to 0 value.
  • the following describes the process of using a quantization method to quantize the feature data of the floating point type of each channel of the N channels of the current image in detail with reference to FIG. 5 .
  • FIG. 5 is a schematic flowchart of an image encoding method 500 provided by an embodiment of the present application, as shown in FIG. 5 , including:
  • S502 Input the current image into a neural network to obtain feature data of the floating point type of N channels of the current image.
  • S505 Encode the feature data of the fixed-point type of the current image to obtain a code stream.
  • the quantization method includes linear uniform quantization, nonlinear function quantization, and look-up table quantization.
  • the above S503 includes the following S503-A1 and S503-A2:
  • the feature data of the floating point number type of each channel in the N channels is taken as a whole, and a quantization method is used to quantize the feature data of the floating point number type of each channel.
  • the quantization process for the characteristic data of each channel in the N channels is the same, and for convenience of description, one channel in the N channels is taken as an example.
  • the above-mentioned preset fourth quantization bit width may be preset by the user and set in the configuration file of the encoder.
  • the fourth quantization bit width may be determined according to the size of the third eigenvalue.
  • the third eigenvalue is the largest eigenvalue in the feature data of the floating point type of the channel
  • the fourth eigenvalue is the smallest eigenvalue in the feature data of the floating point type of the channel.
  • the encoder quantizes the floating point type feature data of the channel according to the following formula (7):
  • the current channel is the c-th channel
  • x cij is the eigenvalue of the floating-point type of the i-th row and the j-th column of the channel
  • x cmax2 and x cmin2 are the second largest among the floating-point type characteristic data of the channel.
  • bitdepth4 is the fourth quantization bit width
  • int[ ] represents the integerization function
  • y cij is the eigenvalue of the fixed-point type of the i-th row and the j-th column of the channel after quantization
  • is a polar Small value, which can be set to 0, is used to map the floating-point feature data into a value range of left closed and right open.
  • the characteristic data of the floating point type of the channel is quantized into the characteristic data of the fixed point type
  • the characteristic data of the fixed point type is encoded to form a code stream.
  • nonlinear uniform quantization methods include nonlinear logarithmic uniform quantization methods and nonlinear exponential uniform quantization methods.
  • the above S503 includes the following S503-B1 and S503-B2:
  • the preset fifth quantization bit width and the second base of the logarithmic function may be preset by the user and set in the configuration file of the encoder.
  • the fifth quantization bit width can be determined according to the size of the third characteristic value
  • the second base of the logarithmic function is determined according to the characteristics of the characteristic data in the channel.
  • the encoder quantizes the floating point type feature data of the channel according to the following formula (9):
  • bitdepth5 is the fifth quantization bit width
  • log_base2 is the second base of the logarithmic function used in logarithmic quantization, for example, 10.
  • the fifth quantization bit width is equal to the fourth quantization bit width.
  • the above S503 includes the following S503-C1 and S503-C2:
  • the above-mentioned preset sixth quantization bit width and the second base of the exponential function may be preset by the user and set in the configuration file of the encoder.
  • the sixth quantization bit width can be determined according to the size of the third characteristic value
  • the second base of the exponential function is determined according to the characteristics of the characteristic data under the channel.
  • the encoder quantizes the floating point type feature data of the channel according to the following formula (11):
  • bitdepth6 is the sixth quantization bit width
  • e_base2 is the second base of the exponential function used in exponential quantization.
  • the above-mentioned sixth quantization bit width is equal to the above-mentioned fourth quantization bit width.
  • the above S503 includes the following S503-D1 to S503-D3:
  • the second characteristic data sorted under the channel is divided into a plurality of second quantization intervals, wherein each second quantization interval includes the same amount of characteristic data;
  • S503-D3 For each second quantization interval, quantize the value of the feature data in the second quantization interval into an index value of the second quantization interval.
  • the feature data of the floating point type of the channel is sorted from large to small or from small to large according to the value size.
  • the sorted feature data of the channel is called sorted Second characteristic data.
  • the second feature data sorted in the channel is divided into a plurality of second quantization intervals, and each second quantization interval includes the same quantity of feature data.
  • Each second quantization interval is represented by an index that can be represented by a corresponding quantization bit width, so that each second quantization interval has an index. In this way, during quantization, the value of the feature data in each second quantization interval can be quantized into an index value of each second quantization interval.
  • FIG. 6 is a schematic flowchart of an image encoding method 600 provided by an embodiment of the present application, as shown in FIG. 6 , including:
  • S602 Input the current image into a neural network to obtain floating point type feature data of N channels of the current image.
  • S603 Quantize the feature data of the floating point type of each group of channels using a quantization method respectively.
  • S604 Encode the feature data of the fixed-point type of the current image to obtain a code stream.
  • the quantization method includes linear uniform quantization, nonlinear function quantization, and look-up table quantization.
  • the above S603 includes the following S603-A1 and S603-A2:
  • S603-A1 for each group of channels, obtain the preset seventh quantization bit width, and the fifth eigenvalue and the sixth eigenvalue in the feature data of the floating point type of the group of channels;
  • the N channels are divided into multiple groups of channels, the feature data of the floating-point number type of each group of channels is taken as a whole, and a quantization method is used for the feature data of the floating-point number type of each group of channels. quantify.
  • the quantization process for the characteristic data of each group of channels is the same.
  • a group of channels is taken as an example.
  • the above-mentioned preset seventh quantization bit width may be preset by the user and set in the configuration file of the encoder.
  • the seventh quantization bit width may be determined according to the size of the fifth eigenvalue.
  • the fifth characteristic value is the largest characteristic value in the floating point type characteristic data of the group of channels
  • the sixth characteristic value is the smallest characteristic value in the floating point type characteristic data of the group of channels.
  • the encoder quantizes the floating point type feature data of the set of channels according to the following formula (13):
  • the c-th channel is a channel in the group of channels
  • x cij is the eigenvalue of the floating-point number type in the i-th row and the j-th column of the c-th channel
  • x cmax3 and x cmin3 are the floating-point number type of the group of channels respectively.
  • bitdepth7 is the seventh quantization bit width
  • int[ ] represents the integerization function
  • y cij is the fixed-point number of the i-th row and the j-th column of the c-th channel after quantization
  • is a minimum value, which is used to map the eigendata of the floating-point type into the value range of left closed and right open.
  • the feature data of the floating point type of the group of channels is quantized into the feature data of the fixed point type
  • the feature data of the fixed point type is encoded to form a code stream.
  • nonlinear uniform quantization methods include nonlinear logarithmic uniform quantization methods and nonlinear exponential uniform quantization methods.
  • the above S603 includes the following S603-B1 and S603-B2:
  • S603-B1 for each group of channels, obtain the preset eighth quantization bit width and the third base of the logarithmic function, and the fifth eigenvalue and the sixth eigenvalue in the feature data of the floating point type of the group channel;
  • the above-mentioned preset eighth quantization bit width and the third base of the logarithmic function may be preset by the user and set in the configuration file of the encoder.
  • the eighth quantization bit width may be determined according to the size of the fifth characteristic value
  • the third base of the logarithmic function is determined according to the characteristics of the characteristic data in the group of channels.
  • the encoder quantizes the floating point type feature data of the set of channels according to the following formula (15):
  • bitdepth8 is the eighth quantization bit width
  • log_base3 is the third base of the logarithmic function used in logarithmic quantization, for example, 10.
  • the above-mentioned eighth quantization bit width is equal to the above-mentioned eighth quantization bit width.
  • the above S603 includes the following S603-C1 and S603-C2:
  • S603-C1 for each group of channels, obtain the preset ninth quantization bit width and the third base of the exponential function, and the fifth eigenvalue and the sixth eigenvalue in the feature data of the floating point type of the group of channels;
  • the above-mentioned preset ninth quantization bit width and the third base of the exponential function may be preset by the user and set in the configuration file of the encoder.
  • the ninth quantization bit width may be determined according to the size of the fifth characteristic value
  • the third base of the exponential function is determined according to the characteristics of the characteristic data under the group of channels.
  • the encoder quantizes the floating point type feature data of the set of channels according to the following formula (17):
  • bitdepth9 is the ninth quantization bit width
  • e_base3 is the third base of the exponential function used in exponential quantization.
  • the above-mentioned ninth quantization bit width is equal to the above-mentioned ninth quantization bit width.
  • the above S603 includes the following S603-D1 to S603-D3:
  • S603-D3 For each third quantization interval, quantize the value of the feature data in the third quantization interval into an index value of the third quantization interval.
  • the feature data of the floating point type of the group of channels is sorted according to the value size from large to small or from small to large.
  • the sorted feature data under the group of channels is called sorting After the third characteristic data.
  • the sorted third characteristic data in the group of channels is divided into a plurality of third quantization intervals, and each third quantization interval includes the same quantity of characteristic data.
  • Each third quantization interval is represented by an index that can be represented by a corresponding quantization bit width, so that each third quantization interval has an index. In this way, during quantization, the value of the feature data in each third quantization interval can be quantized into an index value of each third quantization interval.
  • the quantization process at the encoding end is described above, and the content indicated by the first information is described below.
  • the encoding end After the encoding end quantizes the floating point type feature data of at least one channel into a fixed point number type according to the above steps, the encoding end encodes the fixed point number type characteristic data in a code stream and sends it to the decoding end. At the same time, the encoding end carries first information in the code stream, where the first information indicates to perform inverse quantization on the feature data of the fixed-point type of at least one channel.
  • the code stream further includes second information, where the second information is used to indicate an inverse quantization method used when performing inverse quantization on the characteristic data of the fixed-point type of at least one channel.
  • the inverse quantization method used when performing inverse quantization on the fixed-point type characteristic data of at least one channel includes any one of the following: linear uniform inverse quantization method, nonlinear exponential uniform inverse quantization method, nonlinear logarithmic uniform inverse quantization method, Look-up table inverse quantification method.
  • linear uniform inverse quantization method nonlinear exponential uniform inverse quantization method
  • nonlinear logarithmic uniform inverse quantization method Look-up table inverse quantification method.
  • the inverse quantization methods in the embodiments of the present application include but are not limited to the above several quantization methods, and other inverse quantization methods can also be used to inverse quantize the characteristic data of the fixed-point type into the characteristic data of the floating-point type. There is no restriction on the inverse quantization method.
  • the first information includes at least one parameter required for inverse quantization of fixed-point type feature data of at least one channel.
  • At least one parameter included in the first information in this application includes the following situations:
  • the first information indicates that inverse quantization is performed on the characteristic data of the fixed-point type of all channels in the N channels.
  • the first information includes the following example 1, example 2, example 3 or example Any of the four:
  • the first information includes the first target feature value, the first target scaling value and the The first target quantization bit width.
  • the first target feature value is one feature value in the feature data of all the channels in the N channels, for example, the first target feature value is the minimum value of the feature data of all the channels in the N channels.
  • the first target scaling value is the scaling value corresponding to the feature data of all channels in the N channels during quantization
  • the first target quantization bit width is the quantization bit width corresponding to the feature data of all channels in the N channels during quantization.
  • the following describes the process of determining the first target scaling value in conjunction with the encoding mode of the encoding end.
  • the encoding end may use the first eigenvalue and the second eigenvalue in the characteristic data of all the channels in the N channels, and the A target quantization bit width determines the first target scaling value.
  • the first target scaling value s c1 may be determined according to the following formula (19):
  • x cmin1 and x cmax1 are the first eigenvalue and the second eigenvalue in the feature data of all channels in the N channels, respectively.
  • the first target quantization bit width 1bitdepth may be the first quantization bit width bitdepth1 in the above formula (1).
  • the above formula (19) is only an example, and the formula for determining the first target scaling value s c1 in the present application also includes the modification of the above formula (19), or the addition and addition of the above formula (19). Multiply or divide one or more coefficients, etc.
  • the encoding end may use the first eigenvalue and the second feature in the feature data of all channels in the N channels. value, together with the first target quantization bit width and the first base of the logarithmic function to determine the first target scaling value.
  • the first target scaling value s c1 may be determined according to the following formula (20):
  • log log_base1 is the first base of the logarithmic function
  • the first target quantization bit width may be the second quantization bit width in the above formula (3).
  • the above formula (20) is just an example, and the formula for determining the first target scaling value s c1 in the present application also includes the modification of the above formula (20), or the addition and addition of the above formula (20). Multiply or divide one or more coefficients, etc.
  • the encoding end may use the first eigenvalue and the second eigenvalue in the feature data of all channels in the N channels. , and the first target quantization bit width and the first base of the exponential function determine the first target scaling value.
  • the first target scaling value s c1 may be determined according to the following formula (21):
  • e_base1 is the first base of the exponential function
  • the first target quantization bit width may be the third quantization bit width bitdepth3 in the above formula (5).
  • the above formula (21) is only an example, and the formula for determining the first target scaling value s c1 in the present application also includes the modification of the above formula (21), or the addition and addition of the above formula (21). Multiply or divide one or more coefficients, etc.
  • the decoding end can parse the first information from the code stream, and according to the first target feature value, the first target scaling value and the first target quantization bit width included in the first information, use the linear uniform inverse quantization method to Inverse quantization is performed on the fixed-point type feature data of all channels in the channel.
  • the first information includes the first target eigenvalue, the first The target scaling value and the first target quantization bit width, or the first information includes the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base, or the first information includes the first target feature value, the first target scaling value, and the indication information of the first target quantization bit width and the first logarithmic base.
  • the decoding end uses the first target feature value, the first target scaling value, and the first target quantization bit width and The default logarithmic base, which uses the nonlinear logarithmic uniform inverse quantization method to dequantize the fixed-point type feature data of all the N channels.
  • the decoding end directly uses the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first logarithmic base, and use the nonlinear logarithmic uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of all the N channels.
  • the first logarithmic base indication information is used to indicate the multiple The first logarithmic base is determined from the logarithmic bases.
  • the decoding end parses the first information from the code stream, determines the first logarithmic base from the preset multiple logarithmic bases according to the indication information of the first logarithmic base, and then determines the first logarithmic base according to the first target characteristic value,
  • the first target scaling value, the first target quantization bit width, and the first logarithmic base are used to perform inverse quantization on the fixed-point type feature data of all channels in the N channels by using a non-linear logarithmic uniform inverse quantization method.
  • the first information includes the first target eigenvalue, the first target scaling value and the first target quantization bit width, or the first information includes the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first exponent base, or the first information includes the first target eigenvalue, the first A target scaling value and indication information of a first target quantization bit width and a first exponent base.
  • the decoding end uses the first target feature value, the first target scaling value, and the first target quantization bit width and The default exponential base, which uses the nonlinear exponential uniform inverse quantization method to inverse quantize the fixed-point feature data of all channels in the N channels.
  • the decoding end directly uses the first target eigenvalue and the first target scaling value carried in the first information With the first target quantization bit width and the first exponent base, the non-linear exponent uniform inverse quantization method is used to inverse quantize the fixed-point type feature data of all the N channels.
  • the indication information of the first exponent base is used to indicate multiple exponents from preset In the base number, the base of the first exponent is determined.
  • the decoding end parses the first information from the code stream, determines the first exponent base from the preset multiple exponent bases according to the indication information of the first exponent base, and then determines the first exponent base according to the first target characteristic value, the first target
  • the scaling value, the first target quantization bit width and the first exponent base are used to inversely quantize the fixed-point feature data of all channels in the N channels by using a non-linear exponential uniform inverse quantization method.
  • the first information includes the index value of the quantization interval and the inverse quantization value of the quantization interval.
  • the first correspondence between the N channels is determined based on the pre-quantization value and the post-quantization value of the feature data of all channels in the N channels.
  • the index of the quantization interval can be understood as a fixed-point eigenvalue
  • the inverse quantization value of the quantization interval can be understood as the weighted average value of each eigenvalue in the quantization interval, or the eigenvalue corresponding to the center position of the quantization interval.
  • the weighted average value of each eigenvalue in the quantization interval can also be called the eigenvalue corresponding to the probability distribution center of the quantization interval.
  • the inverse quantization value may also be called a reconstruction value.
  • the feature data other than the 0 value after sorting can be divided into intervals containing the same amount of feature data, that is, all 0 values of the sorted feature data are recorded. is index 0, and the corresponding reconstruction value is also set to 0 value.
  • the quantization method of the encoding end corresponds to the inverse quantization method of the decoding end one-to-one.
  • the decoding end uses linear inverse quantization to perform inverse quantization on the fixed-point feature data of all channels of the N channels. If the decoding end uses the nonlinear logarithmic uniform quantization method to quantize the floating-point type feature data of all channels in the N channels, the decoding end uses the nonlinear logarithmic uniform inverse quantization method to quantize all the N channels.
  • the feature data of fixed-point type is inversely quantized.
  • the decoding end uses the nonlinear exponential uniform quantization method to quantize the floating-point type feature data of all channels in the N channels
  • the decoding end uses the nonlinear exponential uniform inverse quantization method to quantize the fixed-point data of all channels of the N channels.
  • Type of feature data for inverse quantization If the decoding end uses the table lookup quantization method to quantize the floating point type feature data of all channels in the N channels, the decoding end uses the table lookup inverse quantization method to quantize the fixed point type characteristic data of all the N channels. Do inverse quantization.
  • the embodiments of the present application may adopt the linear uniform inverse quantization method, the nonlinear logarithmic function inverse quantization method, the nonlinear exponential function inverse quantization method, and the look-up table inverse quantization method.
  • the inverse quantization information related to the inverse quantization feature data of the present application may be recorded in the supplementary enhancement information, for example, recorded in the Supplemental Enhancement Information (Supplemental Enhancement Information) of the existing video coding standards H.265/HEVC and H.266/VVC SEI) or AVS standard extension data (Extension Data).
  • Supplemental Enhancement Information Supplemental Enhancement Information
  • H.265/HEVC and H.266/VVC SEI Supplemental Enhancement Information
  • AVS standard extension data Extension Data
  • a new SEI category is added to sei_paylod() of sei_message() in sei_rbsp() of existing video coding standards
  • AVC/HEVC/VVC/EVC namely Feature data quantization SEI message, payloadType can be defined It is any number that has not been used by other SEI, such as 183.
  • the syntax structure of sei_payload() is shown in Table 1.
  • feature_data_quantization represents the inverse quantization of feature data.
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 0;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; here the value of flag_iquantization is 0;
  • channel_num The number of channels used to describe the feature data is channel_num;
  • scale_num The scaling value used to describe the feature data in all channels is scale_num, which can be understood as the above-mentioned first target scaling value
  • min_num The minimum value used to describe the feature data under all channels is min_num, which can be understood as the above-mentioned first target feature value.
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 0;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 1;
  • channel_num The number of channels used to describe the feature data is channel_num;
  • scale_num The scaling value used to describe the feature data in all channels is scale_num, which can be understood as the above-mentioned first target scaling value
  • min_num the minimum value used to describe the feature data under all channels is min_num, which can be understood as the above-mentioned first target feature value
  • log_base The base used to describe the logarithmic inverse quantization is log_base, which can be understood as the first logarithmic base above.
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 0;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 2.
  • channel_num The number of channels used to describe the feature data is channel_num;
  • scale_num The scaling value used to describe the feature data in all channels is scale_num, which can be understood as the above-mentioned first target scaling value
  • min_num the minimum value used to describe the feature data under all channels is min_num, which can be understood as the above-mentioned first target feature value
  • e_base The base of the exponential function used to describe the exponential inverse quantization is e_base, which can be understood as the base of the first exponent.
  • table lookup inverse quantization includes histogram equalization inverse quantization.
  • Table 5 The grammatical structure of look-up table inverse quantization is shown in Table 5:
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 0;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; here flag_iquantization is 3;
  • channel_num The number of channels used to describe the feature data is channel_num;
  • hist_codebook_num the number of inverse quantization values hist_codebook_num included in the reconstructed codebook formed by the first correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval;
  • hist_codebook used to describe the inverse quantization value corresponding to the i-th quantization interval index in the reconstructed codebook under table lookup inverse quantization.
  • the first information indicates that inverse quantization is performed on the characteristic data of the fixed-point number type of each channel in the N channels.
  • the content included in the first information is as follows: Example 1. Any of the examples shown in Example 2, Example 3 or Example 4:
  • Example 1 if the inverse quantization method for inverse quantization of the characteristic data of the fixed-point type of the channel is a linear uniform inverse quantization method, then the first information includes the second target eigenvalue, the second target scaling value and the second target quantization bit. width.
  • the second target feature value is a feature value in the feature data of the channel, for example, the second target feature value is the minimum value of the feature data of the channel.
  • the second target scaling value is the scaling value corresponding to the feature data of the channel during quantization
  • the second target quantization bit width is the quantization bit width corresponding to the feature data of the channel during quantization
  • the following describes the process of determining the second target scaling value in combination with the encoding mode of the encoding end.
  • the encoding end can use the third eigenvalue and the fourth eigenvalue in the feature data of the channel and the second target quantization bit according to the The width determines the second target scaling value determines the second target scaling value.
  • the second target scaling value s c2 may be determined according to the following formula (22):
  • x cmax2 and x cmin2 are the third eigenvalue and the second eigenvalue in the feature data of the channel, respectively.
  • the second target quantization bit width 2bitdepth may be the fourth quantization bit width bitdepth4 in the above formula (7).
  • the above formula (21) is only an example, and the formula for determining the second target scaling value s c2 in the present application also includes the modification of the above formula (21), or the addition and addition of the above formula (21). Multiply or divide one or more coefficients, etc.
  • the encoding end can use the second eigenvalue and the second eigenvalue in the feature data of the channel, and the first eigenvalue.
  • the second target scaling value is determined by the two target quantization bit widths and the second base of the logarithmic function.
  • the second target scaling value s c2 may be determined according to the following formula (23):
  • log log_base2 is the second base of the logarithmic function
  • the second target quantization bit width may be the fifth quantization bit width in the above formula (9).
  • the above formula (23) is only an example, and the formula for determining the second target scaling value s 2 in the present application also includes the modification of the above formula (23), or the addition and addition of the above formula (23). Multiply or divide one or more coefficients, etc.
  • the encoding end can use the third eigenvalue and the fourth eigenvalue in the feature data of the channel, and the second eigenvalue.
  • the target quantization bit width and the second base of the exponential function determine a second target scaling value.
  • the second target scaling value s c2 may be determined according to the following formula (24):
  • e_base2 is the second base of the exponential function
  • the second target quantization bit width may be the sixth quantization bit width bitdepth6 in the above formula (11).
  • the above formula (24) is only an example, and the formula for determining the second target scaling value s c2 in the present application also includes the modification of the above formula (24), or the addition and addition of the above formula (24). Multiply or divide one or more coefficients, etc.
  • the decoding end can parse the first information from the code stream, and use the linear uniform inverse quantization method for the channel according to the second target eigenvalue, the second target scaling value and the second target quantization bit width included in the first information.
  • the feature data of fixed-point type is inverse quantized.
  • the first information includes the second target eigenvalue, the second target scaling value and the first target eigenvalue.
  • Two target quantization bit widths or the first information includes the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base, or the first information includes the second target feature value, the second target scaling value and indication of the second target quantization bit width and the second logarithmic base.
  • the decoding end uses the sum of the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second target quantization bit width.
  • the default logarithmic base which uses the nonlinear logarithmic uniform inverse quantization method to dequantize the fixed-point type feature data of this channel.
  • the decoding end directly uses the second target eigenvalue, the second target scaling carried by the first information value, the second target quantization bit width and the second logarithmic base, and use the non-linear logarithmic uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of the channel.
  • the second logarithmic base indication information is used to indicate the data from the preset multiple
  • the second logarithmic base is determined from the logarithmic bases.
  • the decoding end parses the first information from the code stream, determines the second logarithmic base from the preset multiple logarithmic bases according to the indication information of the second logarithmic base, and then determines the second logarithmic base according to the second target characteristic value,
  • the second target scaling value, the second target quantization bit width, and the second logarithmic base are used to inversely quantize the fixed-point feature data of the channel by using a non-linear logarithmic uniform inverse quantization method.
  • Example 3 if the inverse quantization method for inverse quantization of the characteristic data of the fixed-point type of the channel is the nonlinear exponential uniform inverse quantization method, then the first information includes the second target eigenvalue, the second target scaling value and the second target.
  • the quantization bit width, or the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second exponent base, or the first information includes the second target eigenvalue, the second target scaling value and The indication information of the second target quantization bit width and the second exponent base.
  • the decoding end uses the sum of the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second target quantization bit width.
  • the default exponential base which uses the non-linear exponential uniform inverse quantization method to inverse quantize the fixed-point feature data of this channel.
  • the decoding end directly uses the second target eigenvalue and the second target scaling value carried by the first information With the second target quantization bit width and the second exponent base, use the non-linear exponential uniform inverse quantization method to inverse quantize the fixed-point type characteristic data of the channel.
  • the indication information of the second exponent base is used to indicate multiple exponents from preset In the base, the base of the second exponent is determined.
  • the decoding end parses the first information from the code stream, determines the second exponent base from the preset multiple exponent bases according to the indication information of the second exponent base, and then determines the second exponent base according to the second target eigenvalue, the second target
  • the scaling value, the second target quantization bit width and the second exponent base are inversely quantized using the non-linear exponential uniform inverse quantization method for the fixed-point type feature data of the channel.
  • the first information includes the second index value between the index value of the quantization interval and the inverse quantization value of the quantization interval.
  • a corresponding relationship, the second corresponding relationship is determined based on the value before quantization and the value after quantization of the characteristic data of the channel.
  • the index of the quantization interval can be understood as a fixed-point eigenvalue
  • the inverse quantization value of the quantization interval can be understood as the weighted average value of each eigenvalue in the quantization interval, or the eigenvalue corresponding to the center position of the quantization interval.
  • the weighted average value of each eigenvalue in the quantization interval may also be referred to as the eigenvalue corresponding to the center of the probability distribution of the quantization interval.
  • the quantization method of the encoding end corresponds to the inverse quantization method of the decoding end.
  • the decoding end uses a linear quantization method to quantize the characteristic data of the floating point type of the channel
  • the decoding end uses a linear inverse quantization method. Inverse quantization of the fixed-point type feature data of this channel. If the decoding end uses the nonlinear logarithmic uniform quantization method to quantize the feature data of the floating point type of the channel, the decoding end uses the nonlinear logarithmic uniform inverse quantization method to inverse quantize the fixed point type feature data of the channel. .
  • the decoding end uses the nonlinear exponential uniform quantization method to quantize the characteristic data of the floating point type of the channel. If the decoding end uses the nonlinear exponential uniform inverse quantization method to inverse quantize the fixed point type characteristic data of the channel. If the decoding end uses the table lookup quantization method to quantize the floating point type feature data of the channel, the decoding end uses the table lookup inverse quantization method to inverse quantize the fixed point type characteristic data of the channel.
  • the above-mentioned linear uniform inverse quantization method, nonlinear function inverse quantization method, and table look-up inverse quantization method can be used to perform inverse quantization on the floating-point type feature data of each channel of the N channels of the current image.
  • the inverse quantization methods are different, the syntax structures thereof are also different, and the syntax structures corresponding to the different inverse quantization methods are described below.
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the sign bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is dequantized separately. When it is 2, it means that each group of channels is quantized separately; here flag_channel is 1 ;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; here flag_iquantization is 0;
  • channel_num The number of channels used to describe feature data is channel_num;
  • scale_num[i] The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned second target scaling value;
  • min_num[i] The minimum value used to describe the feature data under the i-th channel is min_num[i], which can be understood as the above-mentioned second target feature value.
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 1;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 1;
  • channel_num The number of channels used to describe feature data is channel_num;
  • scale_num[i] The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned second target scaling value;
  • min_num[i] The minimum value used to describe the feature data under the i-th channel is min_num[i], which can be understood as the above-mentioned second target feature value.
  • log_base used to describe the base log_base of the logarithmic function used in logarithmic inverse quantization, which can be understood as the second logarithmic base above.
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 1;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 2;
  • channel_num The number of channels used to describe feature data is channel_num;
  • scale_num[i] The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned second target scaling value;
  • min_num[i] The minimum value used to describe the feature data under the i-th channel is min_num[i], which can be understood as the above-mentioned second target feature value.
  • e_base The base used to describe the exponential function used in logarithmic inverse quantization is e_base, which can be understood as the above-mentioned second exponential base.
  • the table lookup inverse quantization includes histogram equalization inverse quantization.
  • Table 9 The grammatical structure of look-up table inverse quantization is shown in Table 9:
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 1;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 3;
  • channel_num The number of channels used to describe feature data is channel_num;
  • hist_codebook_num[i] the size of the reconstructed codebook formed by the second correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval is hist_codebook_num[i];
  • hist_codebook[i][j] The inverse quantization value of the index used to describe the jth quantization interval in the reconstructed codebook corresponding to the ith channel is hist_codebook[i][j].
  • the first information indicates that inverse quantization is performed on the characteristic data of the fixed-point type of each group of channels in the M groups of channels.
  • the content included in the first information is as follows. 1. Any one of Example 2, Example 3 or Example 4:
  • Example 1 if the inverse quantization method for inverse quantization of the characteristic data of the fixed-point type of the set of channels is a linear uniform inverse quantization method, then the first information includes the third target feature value, the third target scaling value and the third target quantization. bit width.
  • the third target feature value is a feature value in the feature data of the group of channels, for example, the third target feature value is the minimum value of the feature data of the group of channels.
  • the third target scaling value is the scaling value corresponding to the feature data of the group of channels during quantization
  • the third target quantization bit width is the quantization bit width corresponding to the feature data of the group of channels during quantization.
  • the following describes the process of determining the third target scaling value in combination with the encoding mode of the encoding end.
  • the encoding end may use the fifth and sixth eigenvalues in the feature data of the group of channels, and the third target The quantization bit width determines the third target scaling value.
  • the third target scaling value s c3 can be determined according to the following formula (25):
  • x cmax3 and x cmin3 are the fifth eigenvalue and the fifth eigenvalue in the feature data of the group of channels, respectively.
  • the third target quantization bit width 3bitdepth may be the seventh quantization bit width bitdepth7 in the above formula (13).
  • the above formula (25) is only an example, and the formula for determining the third target scaling value s c3 in the present application also includes the modification of the above formula (25), or the addition and addition of the above formula (25). Multiply or divide one or more coefficients, etc.
  • the encoding end can, according to the fifth eigenvalue and the fifth eigenvalue in the feature data of the group of channels, and a third target quantization bit width and a third base of the logarithmic function to determine a third target scaling value.
  • the third target scaling value s c3 may be determined according to the following formula (26):
  • log log_base3 is the third base of the logarithmic function
  • the third target quantization bit width may be the eighth quantization bit width in the above formula (15).
  • the above formula (26) is only an example, and the formula for determining the third target scaling value s c3 in the present application also includes the modification of the above formula (26), or the addition and addition of the above formula (26). Multiply or divide one or more coefficients, etc.
  • the encoding end can use the fifth and sixth eigenvalues in the feature data of the group of channels, and The third target quantization bit width and the third base of the exponential function are determined.
  • the third target scaling value s c3 can be determined according to the following formula (27):
  • e_base3 is the third base of the exponential function
  • the third target quantization bit width may be the ninth quantization bit width bitdepth9 in the above formula (18).
  • the above formula (27) is only an example, and the formula for determining the third target scaling value s c3 in the present application also includes the modification of the above formula (27), or the addition and addition of the above formula (27). Multiply or divide one or more coefficients, etc.
  • the decoding end can parse out the first information from the code stream, and use the linear uniform inverse quantization method to perform a linear uniform inverse quantization method according to the third target eigenvalue, the third target scaling value and the third target quantization bit width included in the first information.
  • the channel's fixed-point feature data is inversely quantized.
  • the first information includes the third target eigenvalue, the third target scaling value and the The third target quantization bit width, or the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third logarithmic base, or the first information includes the third target eigenvalue, the third Indication of the target scaling value and the third target quantization bit width and the third log base.
  • the decoding end uses the third target eigenvalue, the third target scaling value, the third target quantization bit width and the sum
  • the default logarithmic base which uses the nonlinear logarithmic uniform inverse quantization method to dequantize the fixed-point type feature data of this group of channels.
  • the decoding end directly uses the third target eigenvalue, the third target scaling carried by the first information value, the third target quantization bit width and the third logarithmic base, and use the non-linear logarithmic uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of the group of channels.
  • the third logarithmic base indication information is used to indicate that the The third logarithmic base is determined from the logarithmic bases.
  • the decoding end parses the first information from the code stream, determines the third logarithmic base from the preset multiple logarithmic bases according to the indication information of the third logarithmic base, and then determines the third logarithmic base according to the third target eigenvalue,
  • the third target scaling value, the third target quantization bit width, and the third logarithmic base are used to inversely quantize the fixed-point feature data of the group of channels by using a non-linear logarithmic uniform inverse quantization method.
  • the first information includes the third target eigenvalue, the third target scaling value and the third target eigenvalue.
  • the target quantization bit width, or the first information includes the third target feature value, the third target scaling value, the third target quantization bit width and the third exponent base, or the first information includes the third target feature value, the third target scaling value and the indication information of the third target quantization bit width and the third exponent base.
  • the decoding end uses the third target eigenvalue, the third target scaling value, the third target quantization bit width and the sum
  • the default exponential base which uses the nonlinear exponential uniform inverse quantization method to inverse quantize the fixed-point feature data of this group of channels.
  • the decoding end directly uses the third target eigenvalue and the third target scaling value carried by the first information and the third target quantization bit width and the third exponent base, and use the non-linear exponential uniform inverse quantization method to inverse quantize the fixed-point type characteristic data of the group of channels.
  • the indication information of the third exponent base is used to indicate multiple exponents from preset The base of the third exponent is determined in the base.
  • the decoding end parses the first information from the code stream, determines the third exponent base from the preset multiple exponent bases according to the indication information of the third exponent base, and then determines the third exponent base according to the third target eigenvalue, the third target
  • the scaling value, the third target quantization bit width and the third exponent base are used to inversely quantize the fixed-point type feature data of the group of channels by using a non-linear exponential uniform inverse quantization method.
  • the first information includes the index value of the quantization interval and the inverse quantization value of the quantization interval.
  • the index of the quantization interval can be understood as a fixed-point eigenvalue
  • the inverse quantization value of the quantization interval can be understood as the weighted average value of each eigenvalue in the quantization interval, or the eigenvalue corresponding to the center position of the quantization interval.
  • the weighted average value of each eigenvalue in the quantization interval may also be referred to as the eigenvalue corresponding to the center of the probability distribution of the quantization interval.
  • the quantization method of the encoding end corresponds to the inverse quantization method of the decoding end.
  • the decoding end uses linear inverse quantization. way to inverse quantize the fixed-point feature data of the group of channels.
  • the decoding end uses the nonlinear logarithmic uniform quantization method to quantize the floating-point type feature data of the group of channels
  • the decoding end uses the nonlinear logarithmic uniform inverse quantization method to quantize the fixed-point number type feature data of the group of channels. Inverse quantization.
  • the decoding end uses the nonlinear exponential uniform quantization method to quantize the floating-point type feature data of the group of channels. If the decoding end uses the nonlinear exponential uniform inverse quantization method to inverse quantize the fixed-point type feature data of the group of channels. . If the decoding end uses the table lookup quantization method to quantize the floating point type feature data of the group of channels, the decoding end uses the table lookup inverse quantization method to inverse quantize the fixed point type characteristic data of the group channel.
  • the above-mentioned linear uniform inverse quantization method, nonlinear function inverse quantization method, and table look-up inverse quantization method can be used to perform inverse quantization on the floating-point type feature data of each channel of the N channels of the current image.
  • the inverse quantization methods are different, the syntax structures thereof are also different, and the syntax structures corresponding to the different inverse quantization methods are described below.
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 2;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; here the value of flag_iquantization is 0;
  • channel_num The number of channels used to describe feature data is channel_num;
  • group_num The number of groups used to describe the feature data is group_num;
  • group_channel The number of channels under each group used to describe the feature data is group_channel;
  • scale_num[i] The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned third target scaling value;
  • min_num[i] The minimum value used to describe the feature data of all channels under the ith group is min_num[i], which can be understood as the third target feature value above.
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the sign bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is dequantized separately. When it is 2, it means that each group of channels is quantized separately;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table inverse quantification;
  • channel_num The number of channels used to describe feature data is channel_num;
  • group_num The number of groups used to describe the feature data is group_num;
  • group_channel The number of channels under each group used to describe the feature data is group_channel;
  • scale_num[i] The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned third target scaling value;
  • min_num[i] The minimum value used to describe the feature data of all channels under the ith group is min_num[i], which can be understood as the third target feature value above;
  • log_base The base log_base used to describe the logarithmic function used in logarithmic inverse quantization, which can be understood as the third logarithmic base above.
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 2;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 2;
  • channel_num The number of channels used to describe feature data is channel_num;
  • group_num The number of groups used to describe the feature data is group_num;
  • group_channel The number of channels under each group used to describe the feature data is group_channel;
  • scale_num[i] The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned third target scaling value;
  • min_num[i] The minimum value used to describe the feature data of all channels under the ith group is min_num[i], which can be understood as the third target feature value above;
  • e_base The base used to describe the exponential function used in logarithmic quantization is e_base, which can be understood as the above-mentioned third exponential base.
  • syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
  • flag_channel used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 2;
  • flag_iquantization used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; here flag_iquantization is 3;
  • channel_num The number of channels used to describe feature data is channel_num;
  • group_num The number of groups used to describe the feature data is group_num;
  • group_channel The number of channels under each group used to describe the feature data is group_channel;
  • hist_codebook[i] The reconstructed codebook formed by describing the third correspondence between the index value of the quantization interval under the ith group and the inverse quantization value of the quantization interval is hist_codebook[i].
  • hist_codebook_num[i] The size of the reconstructed codebook formed by the third correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval under the ith grouping is hist_codebook_num[i];
  • hist_codebook[i][j] used to describe the inverse quantization value of the jth quantization interval index in the reconstructed codebook corresponding to the ith group hist_codebook[i][j].
  • the decoder uses a default inverse quantization method to perform inverse quantization on the fixed-point type feature data of at least one channel.
  • the image encoding process is described above with reference to FIG. 3 to FIG. 7 , and the image decoding process at the decoding end is described below based on the foregoing embodiment.
  • the decoder that performs the image decoding process at the decoding end may be the decoder shown in FIG. 2 .
  • FIG. 7 is a schematic flowchart of an image decoding method 700 provided by an embodiment of the present application, as shown in FIG. 7 , including:
  • the decoder parses the code stream to obtain characteristic data of N channels of the current image and first information, and inversely quantizes the characteristic data of at least one of the N channels according to the first information.
  • performing inverse quantization on the feature data of at least one channel according to the first information in the above S703 includes: according to the first information, inverse quantizing the feature data of the fixed-point type of at least one channel into at least one channel Characteristic data of the channel's float type.
  • the inverse quantization method used by the decoder to perform inverse quantization on the fixed-point type feature data of at least one channel includes any one of the following: a linear uniform inverse quantization method, a nonlinear uniform inverse quantization method, or a look-up table inverse quantization.
  • the nonlinear uniform inverse quantization method further includes nonlinear exponential function inverse quantization and nonlinear logarithmic function inverse quantization.
  • the inverse quantization methods in the embodiments of the present application include but are not limited to the above several inverse quantization methods, and other inverse quantization methods can also be used to inverse quantize the characteristic data of fixed-point type. make restrictions.
  • the inverse quantization method is default, that is, the decoder uses the default inverse quantization method to perform inverse quantization on the fixed-point type feature data of at least one channel according to the first information.
  • the code stream includes second information, where the second information is used to indicate an inverse quantization method used when performing inverse quantization on the fixed-point feature data of at least one channel.
  • the decoder may The first information uses the inverse quantization mode indicated by the second information to perform inverse quantization on the feature data of the fixed-point type of at least one channel.
  • the first information in the code stream includes at least one parameter required for inverse quantization of the fixed-point type feature data of at least one channel.
  • the first information includes parameters corresponding to the inverse quantization method.
  • the manners of performing inverse quantization on the fixed-point type feature data of at least one channel of the N channels include but are not limited to the following:
  • Mode 1 if the first information indicates to perform inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels, use the same inverse quantization method to perform inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels ;
  • Mode 2 if the first information indicates that inverse quantization is performed on the characteristic data of the fixed-point type of each channel in the N channels, then for each channel, use the inverse quantization method corresponding to the channel to perform the inverse quantization of the fixed-point type of the channel.
  • Inverse quantification of feature data if the first information indicates that inverse quantization is performed on the characteristic data of the fixed-point type of each channel in the N channels, then for each channel, use the inverse quantization method corresponding to the channel to perform the inverse quantization of the fixed-point type of the channel.
  • Mode 3 If the first information indicates to perform inverse quantization on the fixed-point type feature data of M groups of channels, the N channels are divided into M groups of channels, and for each group of channels, the inverse quantization method corresponding to the group of channels is used. , perform inverse quantization on the fixed-point feature data of this group of channels.
  • the image decoding method provided by the present application obtains fixed-point type feature data of N channels of the current image by decoding the code stream; decodes the code stream to obtain first information, and the first information indicates the data of at least one of the N channels.
  • the fixed-point feature data is inversely quantized, so that the decoder performs inverse quantization on the fixed-point feature data of at least one channel of the N channels according to the first information to obtain floating-point feature data of the current image.
  • the feature data output from the intermediate layer of the neural network is fixed-point, so that the technology in the existing video and image coding and decoding standards can be reused to decode the feature data, and at least one inverse quantization method is used at the same time.
  • the fixed-point feature data of each channel is inversely quantized, thereby improving the decoding efficiency of the fixed-point feature data.
  • the present application considers the channel information of the feature data in the inverse quantization process at the decoding end, and can process the feature data between different channels, thereby improving the reliability of the inverse quantization of the feature data.
  • FIG. 8 is a schematic flowchart of an image decoding method 800 provided by an embodiment of the present application, including:
  • the parameters included in the first information may be different.
  • the following describes the process of inverse quantization of the fixed-point feature data of all channels in the N channels using different inverse quantization methods for the decoder. .
  • the above S802 includes the following S802-A1 and S802-A2:
  • the first target scaling value and the first target quantization bit width use a linear uniform inverse quantization method to perform inverse quantization on the fixed-point feature data of all channels in the N channels.
  • the above-mentioned first target characteristic value is one characteristic value in the characteristic data of all the channels in the N channels
  • the above-mentioned first target scaling value is the corresponding scaling value when the characteristic data of all the channels in the N channels are quantized
  • the above-mentioned first target quantization bit width is the quantization bit width corresponding to the characteristic data of all channels in the N channels during quantization.
  • the above-mentioned first objective feature value is the smallest feature value among the feature data of all channels in the N channels of the current image.
  • the first information includes the first target eigenvalue, the first target scaling value and the first target quantization bit width required by the linear uniform inverse quantization method.
  • the decoder can A target eigenvalue, a first target scaling value and a first target quantization bit width are used to inverse quantize the fixed-point feature data of all channels in the N channels by using a linear uniform inverse quantization method. For example, the decoder determines several bits as an inverse quantization value according to the first target quantization bit width, and then, according to the first target eigenvalue and the first target scaling value, uses a linear uniform inverse quantization method to quantify all the N channels. The feature data of the channel is inverse quantized.
  • the decoder performs inverse quantization on the fixed-point type feature data of all channels according to the following formula (28):
  • y cij is the quantized value of the i-th row and the j-th column of the c-th channel
  • s c1 is the first target scaling value of the feature data under all channels
  • x1 cmin is the first target feature value of the feature data under all channels
  • x cij is the reconstruction value or inverse quantization value of the i-th row and the j-th column of the c-th channel.
  • nonlinear uniform quantization methods include nonlinear logarithmic uniform inverse quantization methods and nonlinear exponential uniform inverse quantization methods.
  • the above S802 includes the following S802-B1 and S802-B2:
  • S802-B1 according to the first information, determine the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base;
  • the first target eigenvalue, the first target scaling value, the first target quantization bit width, and the first logarithmic base use a nonlinear logarithmic uniform inverse quantization method to quantify the fixed-point type of all channels in the N channels inverse quantization of the feature data.
  • the above S802-B1 according to the first information determines the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base. Not limited to the following:
  • the decoder can directly analyze the first information to obtain the first target eigenvalue. , a first target scaling value and a first target quantization bit width and a first logarithmic base.
  • the decoder parses the first information to obtain the first indication information of the target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base; according to the indication information of the first logarithmic base, from the preset multiple logarithmic bases, determine the first Logarithmic base.
  • the decoder obtains the first target feature by parsing the first information value, a first target scaling value, and a first target quantization bit width, and determine the default log base as the first log base.
  • the decoder determines the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first logarithmic base according to the above method
  • the first target eigenvalue, the first target scaling value and the first target quantization Bit width and the first logarithmic base use the nonlinear logarithmic uniform inverse quantization method to dequantize the fixed-point type feature data of all channels in the N channels.
  • the decoder performs inverse quantization on the fixed-point type feature data of all channels according to the following formula (29):
  • log_base 1 is the first logarithmic base.
  • the above S802 includes the following S802-C1 and S802-C2:
  • S802-C1 according to the first information, determine the first target feature value, the first target scaling value, the first target quantization bit width and the first exponent base;
  • the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first exponential base use a non-linear exponential uniform inverse quantization method to perform a uniform inverse quantization method on the fixed-point number type of all channels in the N channels.
  • the feature data is inverse quantized.
  • the first target feature value, the first target scaling value, the first target quantization bit width and the first exponent base are determined according to the first information.
  • the methods include but are not limited to the following:
  • Mode 1 If the first information includes the first target feature value, the first target scaling value, the first target quantization bit width, and the first exponent base, the decoder directly parses the first information to obtain the first target feature value, the first target feature value, and the first index base.
  • the decoder parses the first information to obtain the first target eigenvalue, The indication information of the first target scaling value, the first target quantization bit width and the first exponent base; and according to the indication information of the first exponent base, the first exponent base is determined from a plurality of preset exponent bases.
  • Mode 3 If the first information includes the first target feature value, the first target scaling value, and the first target quantization bit width, the decoder parses the first information to obtain the first target feature value, the first target scaling value, the first target The target quantization bit width, and the default exponent base is determined as the first exponent base.
  • the decoder determines the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first exponent base according to the above method, the first target eigenvalue, the first target scaling value, the first target quantization bit The width and the first exponent base are used to inversely quantize the fixed-point feature data of all channels in the N channels by using the nonlinear exponential uniform inverse quantization method.
  • the decoder performs inverse quantization on the fixed-point type feature data of all channels according to the following formula (30):
  • e_base 1 is the base of the first exponent.
  • the above S802 includes the following S802-D1 to S802-D3:
  • S802-D Determine the first correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval, where the first correspondence is based on the value before quantization and the value after quantization of the characteristic data of all channels in the N channels value is determined;
  • S802-D3 Determine the target inverse quantization value as a floating-point value of the feature data of the fixed-point type.
  • the corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval is default; or, the first information includes the corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval.
  • the inverse quantization value of the quantization interval is the eigenvalue corresponding to the center position in the quantization interval, or the weighted average value of each eigenvalue in the quantization interval.
  • the weighted average value of each eigenvalue in the quantization interval may also be referred to as the eigenvalue corresponding to the center of the probability distribution of the quantization interval.
  • FIG. 9 is a schematic flowchart of an image decoding method 900 provided by an embodiment of the present application, including:
  • the inverse quantization method includes linear uniform inverse quantization, nonlinear function inverse quantization, and look-up table inverse quantization.
  • the above S902 includes the following S902-A1 and S902-A2:
  • S902-A1 parse the first information to obtain the second target feature value, the second target scaling value and the second target quantization bit width;
  • the second target feature value, the second target scaling value, and the second target quantization bit width use a linear uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of the channel.
  • the second target feature value is a feature value in the feature data of the group of channels
  • the second target scaling value is the scaling value corresponding to the feature data of the channel during quantization
  • the second target quantization bit width is the feature of the channel The corresponding quantization bit width when the data is quantized.
  • the second target feature value is the smallest feature value in the feature data of the channel.
  • the first information includes the second target eigenvalue, the second target scaling value, and the second target quantization bit width required by the linear uniform inverse quantization method.
  • the decoder can The second target eigenvalue, the second target scaling value and the second target quantization bit width are inversely quantized using a linear uniform inverse quantization method for the fixed-point type feature data of the channel. For example, the decoder determines several bits as an inverse quantization value according to the second target quantization bit width, and then, according to the second target feature value and the second target scaling value, uses a linear uniform inverse quantization method for the feature data of the channel Do inverse quantization.
  • the current channel is the c-th channel
  • y cij is the quantized value of the i-th row and the j-th column of the c-th channel
  • s c2 is the second target scaling value of the feature data under this channel
  • x2 cmin is the feature under this channel.
  • the second target eigenvalue of the data, x cij is the reconstructed value of the i-th row and the j-th column of the c-th channel.
  • nonlinear uniform quantization methods include nonlinear logarithmic uniform inverse quantization methods and nonlinear exponential uniform inverse quantization methods.
  • the above S902 includes the following S902-B1 and S902-B1:
  • S902-B1 according to the first information, determine the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base;
  • the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second logarithmic base use the non-linear logarithmic uniform inverse quantization method to obtain the fixed-point type feature data of the channel Do inverse quantization.
  • the above-mentioned S902-B1 determines the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base. But not limited to the following:
  • the decoder directly parses the first information to obtain the second target eigenvalue, the second target eigenvalue, and the second logarithmic base. Two target scaling values, a second target quantization bit width, and a second log base.
  • Method 2 If the first information includes the indication information of the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base, the decoder parses the first information to obtain the second target feature value , the second target scaling value, the second target quantization bit width and the indication information of the second logarithmic base; and according to the indication information of the second logarithmic base, from the preset multiple logarithmic bases, determine the second logarithm base.
  • Mode 3 If the first information includes the second target feature value, the second target scaling value and the second target quantization bit width, the decoder parses the first information to obtain the second target feature value, the second target scaling value and the second target scaling value. The target quantization bit width, and determines the default log base as the second log base.
  • the decoder determines the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second logarithmic base according to the above method
  • the second target eigenvalue, the second target scaling value, the second target quantization Bit width and second logarithmic base use the non-linear logarithmic uniform inverse quantization method to dequantize the fixed-point type feature data of this channel.
  • the decoder performs inverse quantization on the fixed-point type feature data of all channels according to the following formula (32):
  • log_base 2 is the second logarithmic base.
  • the above S902 includes the following S902-C1 and S902-C2:
  • S902-C1 according to the first information, determine the second target feature value, the second target scaling value, the second target quantization bit width and the second exponent base;
  • the second target scaling value, the second target quantization bit width and the second exponential base use the nonlinear exponential uniform inverse quantization method to inverse the feature data of the fixed-point type of the channel quantify.
  • the above S902-B1 determines the second target feature value, the second target scaling value, the second target quantization bit width, and the second exponent base according to the first information.
  • Methods include but are not limited to the following:
  • the decoder directly parses the first information to obtain the second target eigenvalue, the second target eigenvalue, and the second index base.
  • Mode 2 If the first information includes the second target feature value, the second target scaling value, the second target quantization bit width, and the second logarithmic base indication information, the decoder parses the first information, and obtains that the first information includes the first information.
  • Mode 3 If the first information includes the second target feature value, the second target scaling value, and the second target quantization bit width, the decoder parses the first information to obtain the second target feature value, the second target scaling value, and the second target scaling value. Target quantization bit width, and establishes the default exponent base as the second exponent base.
  • the decoder determines the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second exponent base according to the above method, according to the second target eigenvalue, the second target scaling value, the second target quantization bit
  • the width and the second exponential base are used to inversely quantize the fixed-point feature data of the channel using the nonlinear exponential uniform inverse quantization method.
  • the decoder performs inverse quantization on the fixed-point feature data of the channel according to the following formula (33):
  • e_base 2 is the second exponent base.
  • the above S902 includes S902-D1 to S902-D3:
  • S902-D1 determine the second correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval, and the second correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of the channel;
  • S902-D3 Determine the target inverse quantization value as the value of the floating point type of the feature data of the fixed point type.
  • the corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval is default; or, the first information includes the corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval.
  • the inverse quantization value of the quantization interval is the eigenvalue corresponding to the center position in the quantization interval, or the weighted average value of each eigenvalue in the quantization interval.
  • the weighted average value of each eigenvalue in the quantization interval may also be referred to as the eigenvalue corresponding to the center of the probability distribution of the quantization interval.
  • FIG. 10 is a schematic flowchart of an image decoding method 1000 provided by an embodiment of the present application, including:
  • the inverse quantization method includes linear uniform inverse quantization, nonlinear function inverse quantization, and look-up table inverse quantization.
  • the above S102 includes the following S102-A1 and S102-A2:
  • the third target feature value, the third target scaling value, and the third target quantization bit width use a linear uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of the group of channels.
  • the third target feature value is a feature value in the feature data of the group of channels
  • the third target scaling value is the scaling value corresponding to the feature data of the group of channels during quantization
  • the third target quantization bit width is the group of channels. The corresponding quantization bit width of the feature data during quantization.
  • the third target feature value is the smallest feature value in the feature data of the group of channels.
  • the first information includes the third target eigenvalue, the third target scaling value, and the third target quantization bit width required by the linear uniform inverse quantization method.
  • the decoder can The three target eigenvalues, the third target scaling value, and the third target quantization bit width are inversely quantized using a linear uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of the group of channels. For example, the decoder determines several bits as an inverse quantization value according to the third target quantization bit width, and then, according to the third target feature value and the third target scaling value, uses a linear uniform inverse quantization method for the characteristics of the group of channels Data is dequantified.
  • the c-th channel is a channel in the current group of channels
  • y cij is the quantized value of the c-th channel in the i-th row and the j-th column
  • s c3 is the third target scaling value of the feature data under this group of channels
  • x3 cmin is The third target eigenvalue of the feature data under this group of channels
  • x cij is the reconstructed value of the i-th row and the j-th column of the c-th channel.
  • nonlinear uniform quantization methods include nonlinear logarithmic uniform inverse quantization methods and nonlinear exponential uniform inverse quantization methods.
  • the above S102 includes the following S102-B1 and S102-B2:
  • the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third logarithmic base use the non-linear logarithmic uniform inverse quantization method to obtain the fixed-point type feature of the set of channels Data is dequantified.
  • the manners of determining the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base in the above S102-B1 include but are not limited to the following:
  • the decoder directly parses the first information to obtain the third target eigenvalue, the third target eigenvalue, and the third logarithmic base.
  • Method 2 If the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third logarithmic base indication information, the decoder parses the first information to obtain the third target eigenvalue , the third target scaling value, the third target quantization bit width and the third logarithmic base; and according to the third logarithmic base instruction information, from the preset multiple logarithmic bases, determine the third logarithm base;
  • Mode 3 If the first information includes the third target eigenvalue, the third target scaling value and the third target quantization bit width, the decoder parses the first information to obtain the third target eigenvalue, the third target scaling value and the third target eigenvalue. The target quantization bit width, and determines the default log base as the third log base.
  • the decoder determines the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third logarithmic base according to the above method, the decoder determines the third target eigenvalue, the third target scaling value, the third target quantization
  • the bit width and the third logarithmic base are used to inversely quantize the fixed-point feature data of this group of channels using a non-linear logarithmic uniform inverse quantization method.
  • log_base 3 is the third logarithmic base.
  • the above S102 includes the following S102-C1 and S102-C2:
  • S102-C1 according to the first information, determine the third target feature value, the third target scaling value, the third target quantization bit width and the third exponent base;
  • the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third exponent base use the non-linear exponential uniform inverse quantization method to perform the fixed-point number type feature data on the set of channels. Inverse quantization.
  • the manners of determining the third target feature value, the third target scaling value, the third target quantization bit width, and the third exponent base in S102-C1 include but are not limited to the following manners:
  • the decoder directly parses the first information to obtain the third target eigenvalue, the third target eigenvalue, and the third index base.
  • the target scaling value, the third target quantization bit width, and the third exponent base is the third target eigenvalue, the third target quantization bit width, and the third exponent base.
  • Mode 2 If the first information includes the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base indication information, the decoder parses the first information, and obtains that the first information includes the third target quantization bit width and the third logarithmic base.
  • Mode 3 If the first information includes the third target feature value, the third target scaling value, and the third target quantization bit width, the decoder parses the first information to obtain the third target feature value, the third target scaling value, and the third target scaling value. The target quantization bit width, and determines the default exponent base as the third exponent base.
  • the decoder determines the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third exponent base according to the above method, according to the third target eigenvalue, the third target scaling value, the third target quantization bit
  • the width and the third exponent base are inversely quantized using the non-linear exponential uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of this group of channels.
  • e_base 3 is the third exponent base.
  • the above S102 includes the following S102-D1 to S102-D3:
  • S102-D1 determine the third correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval, and the third correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of this group of channels;
  • S102-D3 Determine the target inverse quantization value as a floating-point value of the feature data of the fixed-point type.
  • the corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval is default; or, the first information includes the corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval.
  • the inverse quantization value of the quantization interval is the eigenvalue corresponding to the center position in the quantization interval, or the weighted average value of each eigenvalue in the quantization interval.
  • the weighted average value of each eigenvalue in the quantization interval may also be referred to as the eigenvalue corresponding to the center of the probability distribution of the quantization interval.
  • FIG. 3 to FIG. 10 are only examples of the present application, and should not be construed as a limitation on the present application.
  • the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the present application.
  • the implementation of the embodiments constitutes no limitation.
  • the term "and/or" is only an association relationship for describing associated objects, indicating that there may be three kinds of relationships. Specifically, A and/or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone.
  • the character "/" in this document generally indicates that the related objects are an "or" relationship.
  • FIG. 11 is a schematic block diagram of a video encoder 10 provided by an embodiment of the present application.
  • the video encoder 10 includes:
  • a feature extraction unit 120 configured to input the current image into a neural network to obtain feature data of the current image, where the feature data of the current image includes feature data of N channels, and N is a positive integer;
  • a quantization unit 130 configured to quantify the characteristic data of at least one channel in the N channels
  • the encoding unit 140 is configured to encode the quantized feature data of the at least one channel to obtain a code stream, where the code stream includes first information, and the first information is used to indicate whether the N channels are to be
  • the feature data of at least one channel is inverse quantized.
  • the quantization unit 130 is specifically configured to quantize the feature data of the floating point type of at least one channel of the N channels into the feature data of the fixed point type.
  • the quantization method for quantizing the floating-point type feature data of at least one channel of the N channels includes any one of the following: a linear uniform quantization method, a nonlinear exponential uniform quantization method, and a nonlinear logarithmic method. Uniform quantization method, look-up table quantization method.
  • the quantization unit 130 is specifically configured to use the same quantization method to quantize the floating-point type feature data of all channels in the N channels;
  • the feature data of the floating-point number type is quantized by using different quantization methods respectively; or, the N channels are grouped, and the feature data of the floating-point number type of each group of channels is quantized using a quantization method respectively.
  • the quantization unit 130 is specifically configured to obtain a preset first quantization bit width, and the floating point type feature data of all channels in the N channels. The first eigenvalue and the second eigenvalue of the The feature data of the channel's floating point type is quantized.
  • the quantization unit 130 is specifically configured to obtain a preset second quantization bit width and the first base of the logarithmic function, and the N channels The first eigenvalue and the second eigenvalue in the feature data of the floating point type of all channels in the The first base is to use the nonlinear logarithmic uniform quantization method to quantize the floating point type feature data of each of the N channels.
  • the quantization unit 130 is specifically configured to obtain a preset third quantization bit width and the first base of the exponential function, as well as all of the N channels. the first eigenvalue and the second eigenvalue in the feature data of the floating point type of the channel; according to the first eigenvalue and the second eigenvalue, the third quantization bit width and the first base of the exponential function , using the nonlinear exponential uniform quantization method to quantize the floating point type feature data of each channel in the N channels.
  • the quantization unit 130 specifically sorts the floating-point type feature data of all channels in the N channels according to the value size, and obtains the sorted first characteristic data; dividing the sorted first characteristic data into a plurality of first quantization intervals, wherein each first quantization interval includes the same amount of characteristic data; for each of the first quantization intervals, all The value of the feature data in the first quantization interval is quantized as an index value of the first quantization interval.
  • the first eigenvalue is the smallest eigenvalue in the floating-point type feature data of all channels in the N channels
  • the second eigenvalue is the floating-point number of all channels in the N channels The largest eigenvalue in the eigendata of type.
  • the quantization unit 130 specifically obtains a preset fourth quantization bit width for each of the N channels, and the floating value of the channel.
  • the quantization unit 130 specifically obtains a preset fifth quantization bit width and a logarithmic function for each channel of the N channels The second base of , and the third eigenvalue and the fourth eigenvalue in the characteristic data of the floating point type of the channel; according to the third and fourth eigenvalues, and the fifth quantization bit width and The second base of the logarithmic function uses the nonlinear logarithmic uniform quantization method to quantize the floating point type feature data of the channel.
  • the quantization unit 130 specifically obtains the preset sixth quantization bit width and the sixth index of the exponential function for each channel of the N channels.
  • a base-two number, and the third eigenvalue and the fourth eigenvalue in the feature data of the floating point type of the channel; according to the third and fourth eigenvalues, the sixth quantization bit width and the The second base of the exponential function uses the nonlinear exponential uniform quantization method to quantize the floating point type feature data of the channel.
  • the quantization unit 130 specifically uses, for each channel in the N channels, the feature data of the floating point type of the channel according to the value size. Perform sorting to obtain the sorted second feature data under the channel; divide the sorted second feature data under the channel into a plurality of second quantization intervals, wherein each second quantization interval includes the same number of features data; for each of the second quantization intervals, the value of the feature data in the second quantization interval is quantized as an index value of the second quantization interval.
  • the third eigenvalue is the largest eigenvalue in the feature data of the floating point type of the channel
  • the fourth eigenvalue is the smallest eigenvalue in the feature data of the floating point type of the channel.
  • the quantization unit 130 obtains a preset seventh quantization bit width for each group of channels and the characteristic data of the floating point type of the group of channels.
  • the quantization unit 130 specifically obtains a preset eighth quantization bit width and the third base of the logarithmic function for each group of channels, and the fifth eigenvalue and the sixth eigenvalue in the feature data of the floating point type of the set of channels; according to the fifth eigenvalue and the sixth eigenvalue, and the eighth quantization bit width and the logarithmic function The third base of , using the nonlinear logarithmic uniform quantization method to quantize the floating point type feature data of each channel in the group of channels.
  • the quantization unit 130 specifically obtains a preset ninth quantization bit width and the third base of the exponential function for each group of channels, and the The fifth eigenvalue and the sixth eigenvalue in the feature data of the floating point type of the group channel; according to the fifth eigenvalue and the sixth eigenvalue, and the ninth quantization bit width and the third eigenvalue of the exponential function Base, using the nonlinear logarithmic uniform quantization method to quantize the floating point type feature data of each channel in the group of channels.
  • the quantization unit 130 specifically uses, for each group of channels, to sort the characteristic data of the floating point type of the group of channels according to the value size, to obtain the The third feature data sorted under the set of channels; the third feature data sorted under the set of channels is divided into a plurality of third quantization intervals, wherein each third quantization interval includes the same amount of feature data; for each each of the third quantization intervals, and quantizing the value of the feature data in the third quantization interval into an index value of the third quantization interval.
  • the fifth characteristic value is the largest characteristic value in the floating point type characteristic data of the channel group
  • the sixth characteristic value is the smallest characteristic value in the floating point type characteristic data of the group channel. value.
  • the first information indicates inverse quantization of fixed-point type feature data of all of the N channels; alternatively, the first information indicates that each of the N channels is inverse-quantized The feature data of the fixed-point number type of the channel is respectively inverse-quantized; or, the first information indicates that the feature data of the fixed-point number type of each group of channels in the M groups of channels is respectively inverse-quantized, wherein the M groups of channels are Obtained by grouping the N channels, each group of channels includes at least one channel in the N channels.
  • the inverse quantization method used when performing inverse quantization on the feature data of the fixed-point type of the at least one channel includes any one of the following: a linear uniform inverse quantization method, a nonlinear exponential uniform inverse quantization method, a non-linear uniform inverse quantization method, and a non-linear uniform inverse quantization method.
  • the first information includes at least one parameter required for inverse quantization of the fixed-point type feature data of the at least one channel.
  • the first information indicates that inverse quantization is performed on the fixed-point feature data of all channels in the N channels, and the first information includes any one of the following:
  • the first information includes a first target feature value, a first target scaling value and the first target quantization bit width;
  • the first information includes a first target eigenvalue, a first A target scaling value and a first target quantization bit width, or the first information includes a first target feature value, a first target scaling value, a first target quantization bit width, and a first logarithmic base, or the first information includes Indication information of the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base;
  • the first information includes a first target eigenvalue, a first target The scaling value and the first target quantization bit width, or the first information includes the first target feature value, the first target scaling value, the first target quantization bit width and the first exponent base, or the first information includes the first The indication information of the target feature value, the first target scaling value, the first target quantization bit width and the first exponent base;
  • the inverse quantization method for performing inverse quantization on the fixed-point type characteristic data of all channels in the N channels is a table look-up inverse quantization method
  • the first information includes the index value of the quantization interval and the inverse quantization of the quantization interval the first correspondence between the values, the first correspondence is determined based on the pre-quantized value and the quantized value of the characteristic data of all channels in the N channels;
  • the first target feature value is one feature value in the feature data of all channels in the N channels, and the first target scaling value corresponds to the feature data of all channels in the N channels during quantization
  • the first target quantization bit width is the quantization bit width corresponding to the characteristic data of all channels in the N channels during quantization.
  • the first target feature value is the minimum value of feature data of all channels in the N channels.
  • the first information indicates that inverse quantization is performed on the fixed-point type feature data of each channel in the N channels, and for each channel, the first information includes any one of the following :
  • the first information includes the second target feature value, the second target scaling value, and the second target quantization bit width ;
  • the first information includes a second target feature value, a second target scaling value, and a second target The quantization bit width, or the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second logarithmic base, or the first information includes the second target eigenvalue, the first Two target scaling values and the indication information of the second target quantization bit width and the second logarithmic base;
  • the first information includes the second target feature value, the second target scaling value, and the second target quantization bit width, or the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second exponent base, or the first information includes the second target eigenvalue, the second target scaling value and indication information of the second target quantization bit width and the second exponent base;
  • the first information includes the second correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval relationship, the second corresponding relationship is determined based on the value before quantization and the value after quantization of the characteristic data of the channel;
  • the second target feature value is a feature value in the feature data of the channel
  • the second target scaling value is the scaling value corresponding to the feature data of the channel during quantization
  • the second target quantization bit width It is the corresponding quantization bit width of the feature data of this channel during quantization.
  • the second target feature value is the minimum value of feature data of the channel.
  • the first information indicates that inverse quantization is performed on the fixed-point feature data of M groups of channels, respectively, and for each group of channels, the first information includes any one of the following:
  • the first information includes the third target eigenvalue, the third target scaling value and the third target quantization bit width;
  • the first information includes the third target eigenvalue, the third target scaling value, and the third target scaling value.
  • the target quantization bit width, or the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width, and the third logarithmic base, or the first information includes the third target eigenvalue, Indication information of the third target scaling value, the third target quantization bit width and the third logarithmic base;
  • the first information includes the third target feature value, the third target scaling value, and the third target Quantization bit width, or the first information includes a third target eigenvalue, a third target scaling value, a third target quantization bit width, and a third exponent base, or the first information includes a third target eigenvalue, a third Indication information of the target scaling value, the third target quantization bit width and the third exponent base;
  • the first information includes the third index value between the index value of the quantization interval and the inverse quantization value of the quantization interval.
  • the third correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of this group of channels;
  • the M groups of channels are obtained by grouping the N channels, each group of channels includes at least one channel in the N channels, and the third target feature value is in the feature data of the group of channels.
  • a characteristic value of , the third target scaling value is the corresponding scaling value of the characteristic data of this group of channels during quantization, and the third target quantization bit width is the corresponding quantization bit width of the characteristic data of this group of channels during quantization .
  • the third target feature value is the minimum value of feature data of the group of channels.
  • the code stream further includes second information, where the second information is used to indicate an inverse quantization method used when performing inverse quantization on the characteristic data of the fixed-point type of the at least one channel.
  • the apparatus embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, details are not repeated here.
  • the video encoder 10 shown in FIG. 11 may execute the methods of the embodiments of the present application, and the aforementioned and other operations and/or functions of the various units in the video encoder 10 are for implementing the methods in the methods 300 to 600, respectively. The corresponding process, for the sake of brevity, will not be repeated here.
  • FIG. 12 is a schematic block diagram of a video decoder 20 provided by an embodiment of the present application.
  • the video decoder 20 may include:
  • a decoding unit 210 configured to decode the code stream to obtain characteristic data of the current image, where the characteristic data of the current image includes characteristic data of N channels, and N is a positive integer;
  • the decoding unit 210 is further configured to decode the code stream to obtain first information, where the first information is used to instruct to perform inverse quantization on the feature data of at least one channel in the N channels;
  • An inverse quantization unit 220 configured to perform inverse quantization on the feature data of the at least one channel according to the first information.
  • the inverse quantization unit 220 is specifically configured to, according to the first information, inverse quantize the feature data of the fixed-point type of the at least one channel into the feature of the floating-point type of the at least one channel data.
  • the inverse quantization method used when performing inverse quantization on the feature data of the fixed-point type of the at least one channel includes any one of the following: a linear uniform inverse quantization method, a nonlinear exponential uniform inverse quantization method, a non-linear uniform inverse quantization method, and a non-linear uniform inverse quantization method.
  • the inverse quantization unit 220 is specifically configured to perform inverse quantization on the fixed-point type feature data of the at least one channel by using a default inverse quantization manner according to the first information.
  • the code stream further includes second information, where the second information is used to indicate an inverse quantization method used when performing inverse quantization on the characteristic data of the fixed-point type of the at least one channel, corresponding to
  • the inverse quantization unit 220 is specifically configured to perform inverse quantization on the fixed-point type feature data of the at least one channel by using the inverse quantization manner indicated by the second information according to the first information.
  • the first information includes at least one parameter required for inverse quantization of the fixed-point type feature data of the at least one channel.
  • the inverse quantization unit 220 is specifically configured to use the same inverse quantization method to perform inverse quantization on the fixed-point type feature data of all channels in the N channels if the first information indicates to perform inverse quantization.
  • the N channels are divided into M groups of channels, and for each group of channels, the inverse quantization method corresponding to the group of channels is used to inversely quantize the fixed-point type feature data of the group of channels.
  • the inverse quantization unit 220 is specifically configured to parse the first A piece of information to obtain the first target feature value, the first target scaling value and the first target quantization bit width; according to the first target feature value, the first target scaling value and the first target quantization bit width, use linear uniform inverse quantization manner, inverse quantization is performed on the feature data of the fixed-point number type of all channels in the N channels.
  • the inverse quantization unit 220 is specifically configured to: According to the first information, determine the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base; according to the first target feature value, the first target scaling value and the first The target quantization bit width and the first logarithmic base are used to perform inverse quantization on the fixed-point feature data of all channels in the N channels by using the nonlinear logarithmic uniform inverse quantization method.
  • the inverse quantization unit 220 is specifically configured to parse the first information to obtain the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base; or, parsing For the first information, the indication information of the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base is obtained; according to the indication information of the first logarithmic base, from Among the preset multiple logarithmic bases, the first logarithmic base is determined; or, the first information is analyzed to obtain the first target characteristic value, the first target scaling value and the first target quantization bit width, And the default logarithmic base is determined as the first logarithmic base.
  • the inverse quantization unit 220 is specifically configured to perform inverse quantization according to the the first information, determine the first target feature value, the first target scaling value, the first target quantization bit width and the first exponent base; according to the first target feature value, the first target scaling value, the first target quantization bit The width and the first exponent base are used to dequantize the fixed-point type feature data of all channels in the N channels by using the nonlinear exponential uniform inverse quantization method.
  • the inverse quantization unit 220 is specifically configured to parse the first information to obtain the first target feature value, the first target scaling value, the first target quantization bit width, and the first exponent base;
  • the first information is obtained, and the indication information of the first target characteristic value, the first target scaling value, the first target quantization bit width and the first exponent base is obtained; according to the indication information of the first exponent base, from the preset Among multiple exponent bases, determine the first exponent base; or, parse the first information to obtain the first target feature value, the first target scaling value, and the first target quantization bit width, and use the default exponent
  • the base is determined as the first exponent base.
  • the first target feature value is one feature value in the feature data of all channels in the N channels
  • the first target scaling value is the feature data of all channels in the N channels
  • the first target quantization bit width is the quantization bit width corresponding to the feature data of all channels in the N channels during quantization.
  • the first target feature value is the smallest feature value in feature data of all channels in the N channels.
  • the inverse quantization unit 220 is specifically configured to determine the size of the quantization interval.
  • the first correspondence between the index value and the inverse quantization value of the quantization interval the first correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of all channels in the N channels;
  • the characteristic data of each fixed-point number type of all channels in the N channels, the value of the characteristic data of the fixed-point number type is used as the index of the quantization interval, and in the first correspondence, the feature of the fixed-point number type is queried.
  • the target inverse quantization value corresponding to the value of the data; the target inverse quantization value is determined as the value of the floating point type of the characteristic data of the fixed point type.
  • the inverse quantization unit 220 is specifically configured to parse the first information to obtain the second target feature value and the second target scaling value and the second target quantization bit width; according to the second target feature value, the second target scaling value and the second target quantization bit width, using the linear uniform inverse quantization method, the characteristic data of the fixed-point number type of this channel is carried out. Inverse quantization.
  • the inverse quantization unit 220 is specifically configured to determine the second target eigenvalue, the second target eigenvalue, the second a target scaling value, a second target quantization bit width, and a second logarithmic base; using the nonlinear The logarithmic uniform inverse quantization method performs inverse quantization on the fixed-point type feature data of the channel.
  • the inverse quantization unit 220 is specifically configured to parse the first information to obtain the second target feature value, the second target scaling value, the second target quantization bit width, and the second logarithmic base; or, parsing
  • the first information obtains the indication information of the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second logarithmic base; according to the indication information of the second logarithmic base, from Among the preset multiple logarithmic bases, the second logarithmic base is determined; or, the first information is analyzed to obtain the second target characteristic value, the second target scaling value and the second target quantization bit width, And the default logarithmic base is determined as the second logarithmic base.
  • the inverse quantization unit 220 is specifically configured to determine the second target eigenvalue and the second target scaling according to the first information value, the second target quantization bit width and the second exponent base; according to the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second exponent base, the nonlinear exponent is used for uniform inverse quantization method, inverse quantization is performed on the feature data of the fixed-point type of the channel.
  • the inverse quantization unit 220 is specifically configured to parse the first information to obtain the second target feature value, the second target scaling value, the second target quantization bit width and the second exponent base;
  • the first information is obtained, and the first information includes the indication information of the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base; according to the second logarithmic base
  • the indication information of determine the second exponent base from a plurality of preset exponent bases; or, parse the first information to obtain the second target characteristic value, the second target scaling value, the second target quantization bit width, and the default exponent base is determined as the second exponent base.
  • the second target feature value is a feature value in the feature data of the group of channels
  • the second target scaling value is a scaling value corresponding to the feature data of the channel during quantization
  • the first target scaling value is The second target quantization bit width is the quantization bit width corresponding to the characteristic data of the channel during quantization.
  • the second target feature value is the smallest feature value in the feature data of the channel.
  • the inverse quantization unit 220 is specifically configured to determine the second correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval , the second correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of the channel; for each characteristic data of the fixed-point number type in the channel, the value of the characteristic data of the fixed-point number type is determined.
  • the value is used as the index of the quantization interval, and in the second correspondence, the target inverse quantization value corresponding to the value of the characteristic data of the fixed-point number type is queried; the target inverse quantization value is determined as the characteristic data of the fixed-point number type. value of type floating point.
  • the inverse quantization unit 220 is specifically configured to parse the first information to obtain the third target eigenvalue, the third target scaling value and the third target quantization bit width; according to the third target feature value, the third target scaling value and the third target quantization bit width, using the linear uniform inverse quantization method, the characteristics of the fixed-point number type of the group of channels Data is dequantified.
  • the inverse quantization unit 220 is specifically configured to determine the third target eigenvalue, the first Three target scaling values, the third target quantization bit width and the third logarithmic base; according to the third target feature value, the third target scaling value, the third target quantization bitwidth and the third logarithmic base, use the non- The linear logarithmic uniform inverse quantization method performs inverse quantization on the fixed-point feature data of this group of channels.
  • the inverse quantization unit 220 is specifically configured to parse the first information to obtain the third target feature value, the third target scaling value, the third target quantization bit width, and the third logarithmic base; or, parsing For the first information, the indication information of the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base is obtained; according to the indication information of the third logarithmic base, from Among the preset multiple logarithmic bases, the third logarithmic base is determined; or, the first information is analyzed to obtain the third target characteristic value, the third target scaling value and the third target quantization bit width, And the default logarithmic base is determined as the third logarithmic base.
  • the inverse quantization unit 220 is specifically configured to determine the third target eigenvalue, the third target eigenvalue and the third target according to the first information.
  • the scaling value, the third target quantization bit width and the third exponent base; according to the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third exponent base, the non-linear exponent is used to uniformly invert.
  • inverse quantization is performed on the fixed-point feature data of this group of channels.
  • the inverse quantization unit 220 is specifically configured to parse the first information to obtain the third target feature value, the third target scaling value, the third target quantization bit width, and the third exponent base;
  • the first information is obtained, and the indication information that the first information includes the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base is obtained; according to the third logarithmic base the indication information, determine the third exponent base from a plurality of preset exponent bases; or, parse the first information to obtain the third target characteristic value, the third target scaling value, and the third target quantization bit width, and the default exponent base is determined as the third exponent base.
  • the third target feature value is a feature value in the feature data of the set of channels
  • the third target scaling value is a scaling value corresponding to the feature data of the set of channels during quantization
  • the The third target quantization bit width is the quantization bit width corresponding to the characteristic data of the group of channels during quantization.
  • the third target feature value is the smallest feature value in the feature data of the group of channels.
  • the inverse quantization unit 220 is specifically configured to determine the third correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval relationship, the third corresponding relationship is determined based on the value before quantization and the value after quantization of the characteristic data of this group of channels;
  • the value of the characteristic data of the fixed-point type is used as the index of the quantization interval, and in the third corresponding relationship, the value of the characteristic data of the fixed-point type is queried.
  • the target inverse quantization value is determined as a value of the floating point type of the feature data of the fixed point type.
  • the corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval is default; or, the first information includes the index value of the quantization interval and the inverse quantization value of the quantization interval. Correspondence between.
  • the apparatus embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, details are not repeated here.
  • the video decoder 20 shown in FIG. 12 may correspond to the corresponding subject in performing the methods 700 to 1000 of the embodiments of the present application, and the aforementioned and other operations and/or functions of the respective units in the video decoder 20 are for the purpose of For the sake of brevity, the corresponding processes in each of the implementation methods 700 to 1000 will not be repeated here.
  • the functional unit may be implemented in the form of hardware, may also be implemented by an instruction in the form of software, or may be implemented by a combination of hardware and software units.
  • the steps of the method embodiments in the embodiments of the present application may be completed by hardware integrated logic circuits in the processor and/or instructions in the form of software, and the steps of the methods disclosed in conjunction with the embodiments of the present application may be directly embodied as hardware
  • the execution of the decoding processor is completed, or the execution is completed by a combination of hardware and software units in the decoding processor.
  • the software unit may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps in the above method embodiments in combination with its hardware.
  • FIG. 13 is a schematic block diagram of an electronic device 30 provided by an embodiment of the present application.
  • the electronic device 30 may be the video encoder or the video decoder described in this embodiment of the application, and the electronic device 30 may include:
  • the processor 32 can call and run the computer program 34 from the memory 33 to implement the methods in the embodiments of the present application.
  • the processor 32 may be adapted to perform the steps of the above-described methods according to instructions in the computer program 34 .
  • the processor 32 may include, but is not limited to:
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • the memory 33 includes but is not limited to:
  • Non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which acts as an external cache.
  • RAM Random Access Memory
  • RAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDR SDRAM
  • enhanced SDRAM ESDRAM
  • synchronous link dynamic random access memory SLDRAM
  • Direct Rambus RAM Direct Rambus RAM
  • the computer program 34 may be divided into one or more units, and the one or more units are stored in the memory 33 and executed by the processor 32 to complete the procedures provided by the present application.
  • the one or more units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30 .
  • the electronic device 30 may further include:
  • a transceiver 33 which can be connected to the processor 32 or the memory 33 .
  • the processor 32 can control the transceiver 33 to communicate with other devices, specifically, can send information or data to other devices, or receive information or data sent by other devices.
  • the transceiver 33 may include a transmitter and a receiver.
  • the transceiver 33 may further include antennas, and the number of the antennas may be one or more.
  • each component in the electronic device 30 is connected through a bus system, wherein the bus system includes a power bus, a control bus and a status signal bus in addition to a data bus.
  • FIG. 14 is a schematic block diagram of a video encoding and decoding system 40 provided by an embodiment of the present application.
  • the video encoding and decoding system 40 may include: a video encoder 41 and a video decoder 42 , wherein the video encoder 41 is used for executing the video encoding method involved in the embodiments of the present application, and the video decoder 42 is used for executing The video decoding method involved in the embodiments of the present application.
  • the present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, enables the computer to execute the methods of the above method embodiments.
  • the embodiments of the present application further provide a computer program product including instructions, when the instructions are executed by a computer, the instructions cause the computer to execute the methods of the above method embodiments.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored on or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer, server or data center (eg coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) means to another website site, computer, server or data center.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, digital video disc (DVD)), or semiconductor media (eg, solid state disk (SSD)), and the like.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the unit is only a logical function division.
  • there may be other division methods for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.

Abstract

The present application provides image encoding and decoding methods, an encoder, a decoder, and a storage medium. The image encoding method comprises: acquiring a current image to be encoded; inputting the current image into a neural network to obtain feature data of the current image, the feature data of the current image comprising feature data of N channels; quantizing the feature data of at least one of the N channels; and encoding the quantized feature data of the at least one channel to obtain a code stream, the code stream comprising first information, and the first information being used for instructing a decoding point to perform inverse quantization on the feature data of at least one of the N channels. In this way, the quantization of feature data output by an intermediate layer of a neural network is achieved, so that the technology in the existing video and image encoding and decoding standards can be reused to encode the feature data, thereby improving the encoding efficiency.

Description

图像编解码方法、编码器、解码器及存储介质Image coding and decoding method, encoder, decoder and storage medium 技术领域technical field
本申请涉及视频编解码技术领域,尤其涉及一种图像编解码方法、编码器、解码器及存储介质。The present application relates to the technical field of video encoding and decoding, and in particular, to an image encoding and decoding method, an encoder, a decoder, and a storage medium.
背景技术Background technique
数字视频技术可以并入多种视频装置中,例如数字电视、智能手机、计算机、电子阅读器或视频播放器等。随着视频技术的发展,视频数据所包括的数据量较大,为了便于视频数据的传输,视频装置执行视频压缩技术,以使视频数据更加有效的传输或存储。Digital video technology can be incorporated into a variety of video devices, such as digital televisions, smartphones, computers, e-readers or video players, and the like. With the development of video technology, the amount of data included in video data is relatively large. In order to facilitate the transmission of video data, video devices implement video compression technology to enable more efficient transmission or storage of video data.
随着视觉分析技术的快速发展,将神经网络技术与图像视频压缩技术相结合,提出了面向机器视觉的视频编码框架。With the rapid development of visual analysis technology, a video coding framework for machine vision is proposed by combining neural network technology with image and video compression technology.
但是,目前的面向机器视觉的视频编码框架,其编码效率低。However, the current video coding framework for machine vision has low coding efficiency.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种图像编解码方法、编码器、解码器及存储介质,以提高编码效率。Embodiments of the present application provide an image encoding and decoding method, an encoder, a decoder, and a storage medium, so as to improve encoding efficiency.
第一方面,本申请提供了一种图像编码方法,包括:In a first aspect, the present application provides an image encoding method, including:
获取待编码的当前图像;Get the current image to be encoded;
将所述当前图像输入神经网络,得到所述当前图像的特征数据,所述当前图像的特征数据包括N个通道的特征数据,所述N为正整数;Inputting the current image into a neural network to obtain feature data of the current image, where the feature data of the current image includes feature data of N channels, and N is a positive integer;
对所述N个通道中的至少一个通道的特征数据进行量化;quantifying the feature data of at least one channel in the N channels;
对量化后的所述至少一个通道的特征数据进行编码,得到码流,所述码流中包括第一信息,所述第一信息用于指示对所述N个通道中的至少一个通道的特征数据进行反量化。Encoding the quantized feature data of the at least one channel to obtain a code stream, where the code stream includes first information, and the first information is used to indicate the characteristics of at least one channel in the N channels Data is dequantified.
第二方面,本申请实施例提供一种图像解码方法,包括:In a second aspect, an embodiment of the present application provides an image decoding method, including:
解码码流,得到当前图像的特征数据,所述当前图像的特征数据包括N个通道的特征数据,所述N为正整数;Decoding the code stream to obtain the feature data of the current image, where the feature data of the current image includes the feature data of N channels, and the N is a positive integer;
解码码流,得到第一信息,所述第一信息用于指示对所述N个通道中的至少一个通道的特征数据进行反量化;Decoding the code stream to obtain first information, where the first information is used to instruct to perform inverse quantization on the feature data of at least one channel in the N channels;
根据所述第一信息,对所述至少一个通道的特征数据进行反量化。According to the first information, inverse quantization is performed on the feature data of the at least one channel.
第三方面,本申请提供了一种视频编码器,用于执行上述第一方面或其各实现方式中的方法。具体地,该编码器包括用于执行上述第一方面或其各实现方式中的方法的功能单元。In a third aspect, the present application provides a video encoder for performing the method in the first aspect or each of its implementations. Specifically, the encoder includes a functional unit for executing the method in the above-mentioned first aspect or each of its implementations.
第四方面,本申请提供了一种视频解码器,用于执行上述第二方面或其各实现方式中的方法。具体地,该解码器包括用于执行上述第二方面或其各实现方式中的方法的功能单元。In a fourth aspect, the present application provides a video decoder for executing the method in the second aspect or each of its implementations. Specifically, the decoder includes functional units for performing the methods in the second aspect or the respective implementations thereof.
第五方面,提供了一种视频编码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第一方面或其各实现方式中的方法。In a fifth aspect, a video encoder is provided, including a processor and a memory. The memory is used for storing a computer program, and the processor is used for calling and running the computer program stored in the memory, so as to execute the method in the above-mentioned first aspect or each implementation manner thereof.
第六方面,提供了一种视频解码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第二方面或其各实现方式中的方法。In a sixth aspect, a video decoder is provided, including a processor and a memory. The memory is used for storing a computer program, and the processor is used for calling and running the computer program stored in the memory, so as to execute the method in the above-mentioned second aspect or each implementation manner thereof.
第七方面,提供了一种视频编解码系统,包括视频编码器和视频解码器。视频编码器用于执行上述第一方面或其各实现方式中的方法,视频解码器用于执行上述第二方面、或其各实现方式中的方法。In a seventh aspect, a video encoding and decoding system is provided, including a video encoder and a video decoder. A video encoder is used to perform the method in the first aspect or each of its implementations, and a video decoder is used to perform the method in the above-mentioned second aspect or its implementations.
第八方面,提供了一种芯片,用于实现上述第一方面至第二方面中的任一方面或其各实现方式中的方法。具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行如上述第一方面至第二方面中的任一方面或其各实现方式中的方法。In an eighth aspect, a chip is provided for implementing any one of the above-mentioned first aspect to the second aspect or the method in each implementation manner thereof. Specifically, the chip includes: a processor for invoking and running a computer program from a memory, so that a device on which the chip is installed executes any one of the above-mentioned first to second aspects or each of its implementations method.
第九方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。In a ninth aspect, a computer-readable storage medium is provided for storing a computer program, the computer program causing a computer to execute the method in any one of the above-mentioned first aspect to the second aspect or each of its implementations.
第十方面,提供了一种计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。In a tenth aspect, a computer program product is provided, comprising computer program instructions, the computer program instructions causing a computer to perform the method in any one of the above-mentioned first to second aspects or the implementations thereof.
第十一方面,提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。In an eleventh aspect, there is provided a computer program which, when run on a computer, causes the computer to perform the method in any one of the above-mentioned first to second aspects or the respective implementations thereof.
基于以上技术方案,通过获取待编码的当前图像,将当前图像输入神经网络,得到当前图像的特征数据,当前图像的特征数据包括N通道的特征数据;对N个通道中至少一个通道的特征数据进行量化;对量化后的至少一个通道的特征数据进行编码,得到码流,该码流中包括第一信息,该第一信息用于指示解码点对N个通道中至少一个通道的特征数据进行反量化。这样实现对神经网络中间层输出的特征数据进行量化,从而使得可以复用现有的视频及图像编解码标准中的技术对特征数据进行编码,提供编码效率。Based on the above technical solutions, by acquiring the current image to be encoded, inputting the current image into a neural network to obtain feature data of the current image, the feature data of the current image includes the feature data of N channels; Perform quantization; encode the quantized feature data of at least one channel to obtain a code stream, where the code stream includes first information, and the first information is used to instruct the decoding point to perform the quantization on the feature data of at least one channel in the N channels Inverse quantization. In this way, the feature data output by the middle layer of the neural network is quantized, so that the technologies in the existing video and image encoding and decoding standards can be reused to encode the feature data, and the encoding efficiency is improved.
附图说明Description of drawings
图1为本申请实施例涉及的对图像预分析再压缩的编解码框架示意图;1 is a schematic diagram of an encoding and decoding framework for image pre-analysis and recompression involved in an embodiment of the present application;
图2为MPEG-VCM潜在编码流程示意图;Fig. 2 is a schematic diagram of an MPEG-VCM potential encoding process;
图3为本申请实施例提供的图像编码方法300的流程示意图;FIG. 3 is a schematic flowchart of an image encoding method 300 provided by an embodiment of the present application;
图4为本申请实施例提供的图像编码方法400的流程示意图;FIG. 4 is a schematic flowchart of an image encoding method 400 provided by an embodiment of the present application;
图5为本申请实施例提供的图像编码方法500的流程示意图;FIG. 5 is a schematic flowchart of an image encoding method 500 provided by an embodiment of the present application;
图6为本申请实施例提供的图像编码方法600的流程示意图;FIG. 6 is a schematic flowchart of an image encoding method 600 provided by an embodiment of the present application;
图7为本申请实施例提供的图像解码方法700的流程示意图;FIG. 7 is a schematic flowchart of an image decoding method 700 provided by an embodiment of the present application;
图8为本申请实施例提供的图像解码方法800的流程示意图;FIG. 8 is a schematic flowchart of an image decoding method 800 provided by an embodiment of the present application;
图9为本申请实施例提供的图像解码方法900的流程示意图;FIG. 9 is a schematic flowchart of an image decoding method 900 provided by an embodiment of the present application;
图10为本申请实施例提供的图像解码方法1000的流程示意图;FIG. 10 is a schematic flowchart of an image decoding method 1000 provided by an embodiment of the present application;
图11是本申请实施例提供的视频编码器10的示意性框图;FIG. 11 is a schematic block diagram of a video encoder 10 provided by an embodiment of the present application;
图12是本申请实施例提供的视频解码器20的示意性框图;12 is a schematic block diagram of a video decoder 20 provided by an embodiment of the present application;
图13是本申请实施例提供的电子设备30的示意性框图;FIG. 13 is a schematic block diagram of an electronic device 30 provided by an embodiment of the present application;
图14是本申请实施例提供的视频编解码系统40的示意性框图。FIG. 14 is a schematic block diagram of a video encoding and decoding system 40 provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请可应用于面向机器视觉以及人机混合视觉的各类视频编解码领域,将5G、AI、深度学习、特征提取与视频分析等技术与现有视频处理、编码技术相结合。5G时代催生出面向机器的海量应用,如车联网、无人驾驶、工业互联网、智慧与平安城市、可穿戴、视频监控等机器视觉内容,相比日趋饱和的面向人类视频,应用场景更为广泛,面向机器视觉的视频编码将成为5G和后5G时代的主要增量流量来源之一。This application can be applied to various video encoding and decoding fields for machine vision and human-machine hybrid vision, combining 5G, AI, deep learning, feature extraction and video analysis technologies with existing video processing and encoding technologies. The 5G era has spawned a large number of machine-oriented applications, such as the Internet of Vehicles, unmanned driving, industrial Internet, smart and safe cities, wearables, video surveillance and other machine vision content. Compared with the increasingly saturated human-oriented video, the application scenarios are more extensive. , video encoding for machine vision will become one of the main sources of incremental traffic in the 5G and post-5G era.
例如,本申请的方案可结合至音视频编码标准(audio video coding standard,简称AVS),例如,H.264/音视频编码(audio video coding,简称AVC)标准,H.265/高效视频编码(high efficiency video coding,简称HEVC)标准以及H.266/多功能视频编码(versatile video coding,简称VVC)标准。或者,本申请的方案可结合至其它专属或行业标准而操作,所述标准包含ITU-TH.261、ISO/IECMPEG-1Visual、ITU-TH.262或ISO/IECMPEG-2Visual、ITU-TH.263、ISO/IECMPEG-4Visual,ITU-TH.264(还称为ISO/IECMPEG-4AVC),包含可分级视频编解码(SVC)及多视图视频编解码(MVC)扩展。应理解,本申请的技术不限于任何特定编解码标准或技术。For example, the solution of the present application can be combined with audio video coding standard (audio video coding standard, AVS for short), for example, H.264/audio video coding (audio video coding, AVC for short) standard, H.265/High Efficiency Video Coding ( High efficiency video coding, referred to as HEVC) standard and H.266/versatile video coding (versatile video coding, referred to as VVC) standard. Alternatively, the schemes of the present application may operate in conjunction with other proprietary or industry standards including ITU-TH.261, ISO/IECMPEG-1 Visual, ITU-TH.262 or ISO/IECMPEG-2 Visual, ITU-TH.263 , ISO/IECMPEG-4Visual, ITU-TH.264 (also known as ISO/IECMPEG-4AVC), including Scalable Video Codec (SVC) and Multi-View Video Codec (MVC) extensions. It should be understood that the techniques of this application are not limited to any particular codec standard or technique.
图1为本申请实施例涉及的对图像预分析再压缩的编解码框架示意图。FIG. 1 is a schematic diagram of an encoding/decoding framework for image pre-analysis and recompression according to an embodiment of the present application.
面向智能分析的应用场景下,视频及图像除了需要呈现给用户高质量地观看以外,还更多地被用于分析理解其中的语义信息。针对智能分析任务对视频及图像编码更为独特的分析需求,现在众多研究者们由传统的直接对图像进行压缩编码,转为对智能分析任务网络中间层输出的特征数据进行压缩编码。In intelligent analysis-oriented application scenarios, in addition to high-quality viewing of videos and images, videos and images are also used to analyze and understand the semantic information in them. In view of the more unique analysis requirements of video and image coding in intelligent analysis tasks, many researchers now switch from traditional direct compression coding of images to compression coding of feature data output by the middle layer of the intelligent analysis task network.
如图1所示,摄像头等端侧设备首先对采集或输入得到的原始视频及图像数据利用任务网络进行预分析,例如输入任务网络A、任务网络B和任务网络B,提取得到云端分析足够多的特征数据,并对这些特征数据进行压缩编码和传输。云端设备接收到相应的码流后,根据码流的语法信息重建相应的特征数据,并输入到特定任务网络中继续进行分析。在图1所示的编解码框架下,端侧设备和云端设备之间存在大量特征数据的传输,特征数据压缩的目的即对于现有任务网络中提取的特征数据以可恢复的方式进行压缩编码,以供云端进一步的智能分析处理。As shown in Figure 1, end-side devices such as cameras first use task networks to pre-analyze the original video and image data collected or input, such as input task network A, task network B, and task network B, and extract enough cloud analysis. feature data, and compress, encode and transmit these feature data. After the cloud device receives the corresponding code stream, it reconstructs the corresponding feature data according to the syntax information of the code stream, and inputs it into the specific task network for further analysis. Under the coding and decoding framework shown in Figure 1, there is a large amount of feature data transmission between the terminal device and the cloud device. The purpose of feature data compression is to compress and encode the feature data extracted from the existing task network in a recoverable manner. , for further intelligent analysis and processing in the cloud.
针对图1所示的面向智能分析任务场景的视频及图像高效编码问题,目前国际上ISO/IEC HTC 1/SC 29(音频、图像编码、多媒体及超媒体信息分技术委员会)下设的MPEG(运动图像专家组,原WG11)国际标准组织已于2019年7月在第127次会议上成立了Video Coding for Machines(VCM)标准工作组来研究该方面的技术,旨在针对压缩视频或者从视频中提取的特征信息定义一个码流,使其可以在不显著降低智能任务分析性能的情况下利用同一码流来执行多个智能分析任务,同时解压后的信息对智能分析任务更加友好,在相同码率下智能分析任务性能的损失更小。与此同时,全国信息技术标准化技术委员会下设的多媒体分委会标准工作会议于2020年1月在浙江省杭州市召开了第一次工作组会议,相应成立面向机器智能的数据编码(Data Compression for Machines,DCM)标准工作组来研究该方面的技术应用,旨在通过高效的数据表征与压缩,支撑所涉及到的机器智能应用或人机混合的智能应用。Aiming at the problem of efficient video and image coding for intelligent analysis task scenarios shown in Figure 1, the current international ISO/IEC HTC 1/SC 29 (Audio, Image Coding, Multimedia and Hypermedia Information Subcommittee) under the MPEG ( The Moving Picture Experts Group (formerly WG11) International Standards Organization has established the Video Coding for Machines (VCM) standard working group at its 127th meeting in July 2019 to study technologies in this area, aiming at compressing video or video The feature information extracted from the data defines a code stream, so that it can use the same code stream to perform multiple intelligent analysis tasks without significantly reducing the performance of intelligent task analysis. At the same time, the decompressed information is more friendly to intelligent analysis tasks. The performance loss of intelligent analysis tasks is smaller at the bit rate. At the same time, the standard working meeting of the Multimedia Sub-Committee under the National Information Technology Standardization Technical Committee held the first working group meeting in Hangzhou, Zhejiang Province in January 2020, and correspondingly established the data coding for machine intelligence (Data Compression for Machines, DCM) standard working group to study the technical application of this aspect, aiming to support the involved machine intelligence applications or human-machine hybrid intelligent applications through efficient data representation and compression.
图2为MPEG-VCM潜在编码流程示意图。目前VCM标准工作组设计了如图2所示的潜在编码流程图,以此来提高智能分析任务下视频及图像的编码效率。视频及图像可以直接通过针对任务优化后的视频及图像编码器,也可以利用网络预分析提取特征数据并对其编码,再将解码后的特征数据输入到后续网络中继续分析。若需要复用现有的视频及图像编码标准对提取的特征数据进行压缩,则需要将浮点型表示的特征数据进行定点化的处理。FIG. 2 is a schematic diagram of a potential coding flow of MPEG-VCM. At present, the VCM standard working group has designed a potential coding flow chart as shown in Figure 2, in order to improve the coding efficiency of video and images under intelligent analysis tasks. The video and image can directly pass through the video and image encoder optimized for the task, or use network pre-analysis to extract feature data and encode it, and then input the decoded feature data into the subsequent network for further analysis. If it is necessary to multiplex the existing video and image coding standards to compress the extracted feature data, it is necessary to perform fixed-point processing on the feature data represented by the floating point type.
下面结合具体的示例,对本申请实施例涉及的图像编码方法进行详细描述。The image coding method involved in the embodiments of the present application will be described in detail below with reference to specific examples.
首先以编码端为例,对编码过程进行介绍。First, the encoding process is introduced by taking the encoding end as an example.
图3为本申请实施例提供的图像编码方法300的流程示意图。本申请实施例的执行主体可以理解为图2所示的编码器,如图3所示,包括:FIG. 3 is a schematic flowchart of an image encoding method 300 provided by an embodiment of the present application. The execution body of the embodiment of the present application can be understood as the encoder shown in FIG. 2 , as shown in FIG. 3 , including:
S301、获取待编码的当前图像。S301. Acquire a current image to be encoded.
S302、将当前图像输入神经网络,得到当前图像的特征数据,该当前图像的特征数据包括N个通道的特征数据,其中N为正整数;S302, input the current image into a neural network to obtain feature data of the current image, where the feature data of the current image includes the feature data of N channels, where N is a positive integer;
S303、对N个通道中的至少一个通道的特征数据进行量化;S303, quantify the characteristic data of at least one channel in the N channels;
S304、对量化后的所述至少一个通道的特征数据进行编码,得到码流,该码流中包括第一信息,该第一信息用于指示对N个通道中的至少一个通道的特征数据进行反量化。S304. Encode the quantized feature data of the at least one channel to obtain a code stream, where the code stream includes first information, where the first information is used to indicate that the feature data of at least one channel among the N channels is to be encoded. Inverse quantization.
本申请的当前图像可以理解为视频流程中待编码的一帧图像或该帧图像中的部分图像;或者,当前图像可以理解为单张的待编码图像或该张待编码图像中的部分图像。The current image in this application can be understood as a frame of image to be encoded in the video process or a part of the image in the frame; or, the current image can be understood as a single image to be encoded or a part of the image in the image to be encoded.
本申请的神经网络为任意一个任务网络,例如为分类网络、目标检测网络、语义分割网关等,本申请对神经网络的类型不做限制。The neural network in this application is any task network, for example, a classification network, a target detection network, a semantic segmentation gateway, etc. The type of the neural network is not limited in this application.
将当前图像输入神经网络,得到该神经网络的中间层输出的特征数据,在一些实施例中,该特征数据为浮点数类型,为了复用已有的视频编码框架,则需要对浮点数类型的特征数据进行量化。Input the current image into the neural network to obtain the feature data output by the middle layer of the neural network. In some embodiments, the feature data is a floating-point number type. In order to reuse the existing video coding framework, it is necessary to Feature data is quantified.
在一些实施例中,目前多数已有的视频编码框架在压缩时,对定点数类型的数据进行压缩,因此,编码器需要将浮点数类型的特征数据量化为定点数类型的特征数据,对定点数类型的特征数据进行编码。In some embodiments, most existing video coding frameworks compress fixed-point data during compression. Therefore, the encoder needs to quantize floating-point feature data into fixed-point feature data. Characteristic data of point type is encoded.
可选的,上述定点数类型的特征数据包括整数类型的特征数据,即编码器将浮点数类型的特征数据量化为整数类型的特征数据。Optionally, the feature data of the fixed-point type includes the feature data of the integer type, that is, the encoder quantizes the feature data of the floating-point number type into the feature data of the integer type.
在一些实施例中,当前图像的浮点数类型的特征数据包括N个通道的浮点数类型的特征数据,所述N为正整数,此时,编码器对N个通道中至少一个通道的浮点数类型的特征数据进行量化。In some embodiments, the feature data of the floating-point number type of the current image includes the feature data of the floating-point number type of N channels, where N is a positive integer. Types of feature data are quantified.
在一些实施例中,上述S303中对N个通道中至少一个通道的浮点数类型的特征数据进行量化的方式包括但不限于如下几种:In some embodiments, the methods for quantizing the floating-point type feature data of at least one of the N channels in S303 include, but are not limited to, the following:
方式一,对所述N个通道中所有通道的浮点数类型的特征数据,使用同一种量化方式进行量化;此时,在码流中N个通道中所有通道传输一套量化参数。Manner 1: Use the same quantization method to quantize the floating-point feature data of all channels in the N channels; in this case, transmit a set of quantization parameters in all the N channels in the code stream.
方式二,对所述N个通道中每个通道的浮点数类型的特征数据,分别使用一种量化方式进行量化;此时,在码流中N个通道中每个通道传输一套量化参数。The second method is to use a quantization method to quantize the floating point type feature data of each channel in the N channels; at this time, each channel of the N channels in the code stream transmits a set of quantization parameters.
方式三,对所述N个通道进行分组,对每一组通道的浮点数类型的特征数据,分别使用一种量化方式进行量化。此时,在码流中同一组通道传输一套量化参数。Manner 3: Group the N channels, and use a quantization method to quantize the floating point type feature data of each group of channels. At this time, a set of quantization parameters are transmitted in the same group of channels in the code stream.
在一些实施例中,对至少一个通道的浮点数类型的特征数据进行量化的量化方式可以包括线性均匀量化方式、非线性均匀量化方式或查表量化方式。其中,非线性均匀量化方式又包括非线性指数函数量化和非线性对数函数量化。需要说明的是,本申请实施例的量化方式包括但不限于如上几种量化方式,还可以采用其他的量化方式将浮点数类型的特征数据量化为定点数类型的特征数据,本申请对量化方式不做限制。In some embodiments, the quantization method for quantizing the floating point type feature data of at least one channel may include a linear uniform quantization method, a nonlinear uniform quantization method, or a look-up table quantization method. Among them, the nonlinear uniform quantization method further includes nonlinear exponential function quantization and nonlinear logarithmic function quantization. It should be noted that the quantization methods in the embodiments of the present application include but are not limited to the above several quantization methods, and other quantization methods may also be used to quantify the characteristic data of the floating point type into the characteristic data of the fixed point type. No restrictions.
本申请提供的图像编码方法,通过获取待编码的当前图像,将当前图像输入神经网络,得到当前图像的浮点数类型的特征数据,其中当前图像的浮点数类型的特征数据包括N个通道的浮点数类型的特征数据;对N个通道中至少一个通道的浮点数类型的特征数据进行量化;对量化后的至少一个通道的特征数据进行编码,得到码流。这样实现对神经网络中间层输出的特征数据进度定点化,从而使得可以复用现有的视频及图像编解码标准中的技术对特征数据进行编码,同时对N个通道中至少一个通道的特征数据进行定点化,从而提高定点化后的特征数据的编码效率,实现特征数据的高效压缩。另外,本申请在编码端的量化过程中考虑特征数据的通道信息,可以处理不同通道之间的特征数据,进而提高了特征数据的量化可靠性。In the image encoding method provided by the present application, the current image to be encoded is obtained, and the current image is input into a neural network to obtain floating-point feature data of the current image, wherein the floating-point feature data of the current image includes floating point data of N channels. point type feature data; quantize the floating point type feature data of at least one channel in the N channels; encode the quantized feature data of at least one channel to obtain a code stream. In this way, the progress of the feature data output from the middle layer of the neural network is fixed, so that the existing video and image coding and decoding standards can be reused to encode the feature data, and the feature data of at least one channel of the N channels can be encoded at the same time. Fixed-pointing is performed, so as to improve the encoding efficiency of the fixed-point feature data and realize efficient compression of the feature data. In addition, the present application considers the channel information of the feature data in the quantization process at the encoding end, and can process the feature data between different channels, thereby improving the quantization reliability of the feature data.
下面结合图4,对所述N个通道中所有通道的浮点数类型的特征数据,使用同一种量化方式进行量化的过程进行详细描述。The following describes in detail the process of using the same quantization method to quantize the feature data of the floating point type of all channels in the N channels with reference to FIG. 4 .
图4为本申请实施例提供的图像编码方法400的流程示意图,如图4所示,包括:FIG. 4 is a schematic flowchart of an image encoding method 400 provided by an embodiment of the present application, as shown in FIG. 4 , including:
S401、获取待编码的当前图像。S401. Acquire a current image to be encoded.
S402、将当前图像输入神经网络,得到当前图像的N个通道的浮点数类型的特征数据;S402, input the current image into the neural network, and obtain the feature data of the floating point type of N channels of the current image;
S403、对N个通道中所有通道的浮点数类型的特征数据,使用同一种量化方式进行量化;S403, use the same quantization method to quantize the floating-point type feature data of all channels in the N channels;
S404、对当前图像的定点数类型的特征数据进行编码,得到码流。S404: Encode the feature data of the fixed-point type of the current image to obtain a code stream.
可选的,量化方式包括线性均匀量化、非线性函数量化、查表量化。Optionally, the quantization method includes linear uniform quantization, nonlinear function quantization, and look-up table quantization.
上述码流中包括所有通道下的定点数类型的特征数据。The above code stream includes fixed-point feature data under all channels.
在一些实施例中,若本实施例采用线性均匀量化方式对N个通道中所有通道的浮点数类型的特征数据进行量化时,则上述S403包括如下S403-A1和S403-A2:In some embodiments, if the present embodiment adopts the linear uniform quantization method to quantize the floating point type feature data of all channels in the N channels, the above S403 includes the following S403-A1 and S403-A2:
S403-A1、获取预设的第一量化位宽,以及N个通道中所有通道的浮点数类型的特征数据中的第一特征值和第二特征值;S403-A1, obtain the preset first quantization bit width, and the first eigenvalue and the second eigenvalue in the feature data of the floating point type of all channels in the N channels;
S403-A2、根据第一特征值和第二特征值,以及第一量化位宽,使用线性均匀量化方式,对N个通道中每个通道的浮点数类型的特征数据进行量化。S403-A2. According to the first eigenvalue, the second eigenvalue, and the first quantization bit width, use a linear uniform quantization method to quantize the floating point type feature data of each channel in the N channels.
本申请实施例中,将N个通道中所有通道的浮点数类型的特征数据作为一个整体,从N个通道中所有通道的浮点数类型的特征数据中获取第一特征值和第二特征值。In the embodiment of the present application, the feature data of the floating point type of all channels in the N channels are taken as a whole, and the first feature value and the second feature value are obtained from the feature data of the floating point number type of all channels in the N channels.
可选的,上述预设的第一量化位宽可以为事先设定的,并且设置在编码器的配置文件中。Optionally, the above-mentioned preset first quantization bit width may be preset and set in the configuration file of the encoder.
可选的,上述第一特征值为当前图像的N个通道中所有通道的浮点数类型的特征数据中的最小特征值,上述第二特征值为当前图像的N个通道中所有通道的浮点数类型的特征数据中的最大特征值。Optionally, the first eigenvalue is the smallest eigenvalue in the feature data of the floating point type of all channels in the N channels of the current image, and the second eigenvalue is the floating point number of all channels in the N channels of the current image The largest eigenvalue in the eigendata of type.
在一些实施例中,编码器根据如下公式(1),对N个通道中所有通道的浮点数类型的特征数据进行量化:In some embodiments, the encoder quantizes the floating-point type feature data of all channels in the N channels according to the following formula (1):
Figure PCTCN2021078522-appb-000001
Figure PCTCN2021078522-appb-000001
其中,x cij为第c个通道第i行第j列的浮点数类型的特征值;x cmax1和x cmin1分别为N个通道中所有通道的浮点数类型的特征数据中的第二特征值和第一特征值;bitdepth1为第一量化位宽,int[·]表示整数化函数;y cij为量化后的第c个通道第i行第j列的定点数类型的特征值;Δ为一个极小值,并可以取到0,用以将浮点型的特征数据映射为左闭右开的取值区间。 Among them, x cij is the eigenvalue of the floating-point type of the i-th row and the j-th column of the c-th channel; x cmax1 and x cmin1 are the second eigenvalues and The first eigenvalue; bitdepth1 is the first quantization bit width, int[ ] represents the integerization function; y cij is the eigenvalue of the fixed-point type of the i-th row and the j-th column of the c-th channel after quantization; Δ is a polar It is a small value, and can be set to 0, which is used to map the floating-point feature data into a value range of left closed and right open.
需要说明是,上述公式(1)只是一种示例,本申请的线性均匀量化方式还包括对上述公式(1)进行变形,例如变形为公式(2):It should be noted that the above formula (1) is just an example, and the linear uniform quantization method of the present application also includes transforming the above formula (1), for example, transforming it into formula (2):
Figure PCTCN2021078522-appb-000002
Figure PCTCN2021078522-appb-000002
或者,对上述公式(1)中相加、相乘或相除某一个或多个系数等。Alternatively, add, multiply or divide one or more coefficients in the above formula (1).
根据上述公式(1)对当前图像的N个通道中所有通道的浮点数类型的特征数据量化为定点类型的特征数据后,对定点数类型的特征数据进行编码,形成码流。According to the above formula (1), after quantizing the floating-point feature data of all channels of the current image into fixed-point feature data, encode the fixed-point feature data to form a code stream.
依据非线性函数的不同,非线性均匀量化方式包括非线性对数均匀量化方式和非线性指数均匀量化方式。According to different nonlinear functions, nonlinear uniform quantization methods include nonlinear logarithmic uniform quantization methods and nonlinear exponential uniform quantization methods.
在一些实施例中,若本实施例采用非线性对数均匀量化方式对N个通道中所有通道的浮点数类型的特征数据进行量化时,则上述S403包括如下S403-B1和S403-B2:In some embodiments, if the non-linear logarithmic uniform quantization method is used in this embodiment to quantize the floating point type feature data of all channels in the N channels, the above S403 includes the following S403-B1 and S403-B2:
S403-B1、获取预设的第二量化位宽和对数函数的第一底数,以及N个通道中所有通道的浮点数类型的特征数据中的第一特征值和第二特征值;S403-B1, obtain the preset second quantization bit width and the first base of the logarithmic function, and the first eigenvalue and the second eigenvalue in the characteristic data of the floating point type of all channels in the N channels;
S403-B2、根据第一特征值和第二特征值,以及第二量化位宽和对数函数的第一底数,使用非线性对数均匀量化方式,对N个通道中每个通道的浮点数类型的特征数据进行量化。S403-B2. According to the first eigenvalue and the second eigenvalue, as well as the second quantization bit width and the first base of the logarithmic function, use a non-linear logarithmic uniform quantization method to quantify the floating point number of each channel in the N channels Types of feature data are quantified.
可选的,上述预设的第二量化位宽和对数函数的第一底数可以为用户事先设定的,并且设置在编码器的配置文件中。其中,第二量化位宽可以根据第一特征值的大小来确定,对数函数的第一底数根据特征数据的特性来确定。Optionally, the preset second quantization bit width and the first base of the logarithmic function may be preset by the user and set in the configuration file of the encoder. The second quantization bit width may be determined according to the size of the first characteristic value, and the first base of the logarithmic function is determined according to the characteristic of the characteristic data.
在一些实施例中,编码器根据如下公式(3),对N个通道中每个通道的浮点数类型的特征数据进行量化:In some embodiments, the encoder quantizes the floating point type feature data of each of the N channels according to the following formula (3):
Figure PCTCN2021078522-appb-000003
Figure PCTCN2021078522-appb-000003
其中,bitdepth2为第二量化位宽,log_base1为对数量化时所用的对数函数的第一底数。Wherein, bitdepth2 is the second quantization bit width, and log_base1 is the first base of the logarithmic function used in logarithmic quantization.
需要说明是,上述公式(3)只是一种示例,本申请的非线性对数均匀量化方式还包括对上述公式(3)进行变形,例如变形为公式(4):It should be noted that the above formula (3) is just an example, and the nonlinear logarithmic uniform quantization method of the present application also includes transforming the above formula (3), for example, transforming it into formula (4):
Figure PCTCN2021078522-appb-000004
Figure PCTCN2021078522-appb-000004
或者对上述公式(3)中相加、相乘或相除某一个或多个系数等。Or add, multiply or divide one or more coefficients in the above formula (3).
可选的,上述第二量化位宽与上述第一量化位宽相等。Optionally, the second quantization bit width is equal to the first quantization bit width.
在一些实施例中,若本实施例采用非线性指数均匀量化方式对N个通道中所有通道的浮点数类型的特征数据进行量化时,则上述S403包括如下S403-C1和S403-C2:In some embodiments, if the non-linear exponential uniform quantization method is used to quantize the characteristic data of the floating point type of all channels in the N channels, the above S403 includes the following S403-C1 and S403-C2:
S403-C1、获取预设的第三量化位宽和指数函数的第一底数,以及N个通道中所有通道的浮点数类型的特征数据中的第一特征值和第二特征值;S403-C1, obtain the preset third quantization bit width and the first base of the exponential function, and the first eigenvalue and the second eigenvalue in the characteristic data of the floating point type of all channels in the N channels;
S403-C2、根据第一特征值和第二特征值,以及第三量化位宽和指数函数的第一底数,使用非线性指数均匀量化方式,对N个通道中每个通道的浮点数类型的特征数据进行量化。S403-C2. According to the first eigenvalue and the second eigenvalue, as well as the third quantization bit width and the first base of the exponential function, use a non-linear exponential uniform quantization method to quantify the floating point number type of each channel in the N channels. Feature data is quantified.
可选的,上述预设的第三量化位宽和指数函数的第一底数可以为用户事先设定的,并且设置在编码器的配置文件中。其中,第三量化位宽可以根据第一特征值的大小来确定,指数函数的第一底数根据特征数据的特性来确定。Optionally, the above-mentioned preset third quantization bit width and the first base of the exponential function may be preset by the user and set in the configuration file of the encoder. The third quantization bit width may be determined according to the size of the first characteristic value, and the first base of the exponential function is determined according to the characteristic of the characteristic data.
在一些实施例中,编码器根据如下公式(5),对N个通道中每个通道的浮点数类型的特征数据进行量化:In some embodiments, the encoder quantizes the floating point type feature data of each of the N channels according to the following formula (5):
Figure PCTCN2021078522-appb-000005
Figure PCTCN2021078522-appb-000005
其中,bitdepth3为第三量化位宽,e_base为指数量化时所用指数函数的第一底数。Wherein, bitdepth3 is the third quantization bit width, and e_base is the first base of the exponential function used in exponential quantization.
需要说明是,上述公式(5)只是一种示例,本申请的非线性对数均匀量化方式还包括对上述公式(5)进行变形,例如变形为公式(6):It should be noted that the above formula (5) is only an example, and the nonlinear logarithmic uniform quantization method of the present application also includes transforming the above formula (5), for example, transforming it into formula (6):
Figure PCTCN2021078522-appb-000006
Figure PCTCN2021078522-appb-000006
或者对上述公式(5)中相加、相乘或相除某一个或多个系数等。Or add, multiply or divide one or more coefficients in the above formula (5).
可选的,上述第三量化位宽与上述第一量化位宽相等。Optionally, the above-mentioned third quantization bit width is equal to the above-mentioned first quantization bit width.
在一些实施例中,若本实施例采用查表量化方式对N个通道中所有通道的浮点数类型的特征数据进行量化时,则上述S403包括如下S403-D1至S403-D3:In some embodiments, if the present embodiment adopts the table lookup quantization method to quantize the floating point type feature data of all channels in the N channels, the above S403 includes the following S403-D1 to S403-D3:
S403-D1、对N个通道中所有通道的浮点数类型的特征数据,按照取值大小进行排序,得到排序后的第一特征数据;S403-D1. Sort the floating-point feature data of all channels in the N channels according to the value size, and obtain the sorted first feature data;
S403-D2、将排序后的第一特征数据划分为多个第一量化区间,其中每个第一量化区间包括相同数量的特征数据;S403-D2, dividing the sorted first characteristic data into a plurality of first quantization intervals, wherein each first quantization interval includes the same amount of characteristic data;
S403-D3、针对每个第一量化区间,将第一量化区间内的特征数据的值量化为第一量化区间的索引值。S403-D3. For each first quantization interval, quantize the value of the feature data in the first quantization interval into an index value of the first quantization interval.
本实施例中,将N个通道中所有通道的浮点数类型的特征数据作为一个整体,按照取值大小对N个通道中所有通道的浮点数类型的特征数据中各特征值按照从大到小或从小到大的顺序进行排序,得到排序后的所有通道的浮点数类型的特征数据,为了便于描述,将该排序后的特征数据称为排序后的第一特征数据。将排序后的第一特征数据划分成多个第一量化区间,每个第一量化区间所包括的特征数据的数量相同。使用相应量化位宽所能表示的索引来表示各个第一量化区间,使得每个第一量化区间具有一个索引。这样,在量化时,可以将各第一量化区间内的特征数据的值量化为各第一量化区间的索引值。In this embodiment, the feature data of the floating-point number type of all channels in the N channels are taken as a whole, and each feature value in the feature data of the floating-point number type of all channels in the N channels is sorted in descending order according to the value size. Or sort from small to large to obtain the feature data of the floating point type of all channels after sorting. For the convenience of description, the sorted feature data is called the sorted first feature data. The sorted first feature data is divided into a plurality of first quantization intervals, and each first quantization interval includes the same quantity of feature data. Each first quantization interval is represented by an index that can be represented by a corresponding quantization bit width, so that each first quantization interval has an index. In this way, during quantization, the value of the feature data in each first quantization interval can be quantized into an index value of each first quantization interval.
对于查表量化方式,由于特征数据中0值占比较大,因此可以将排序后除0值之外的特征数据划分为包含等数量特征数据的区间,即将排序后特征数据所有的0值记为0号索引,对应的重建值同样设为0值。For the table lookup quantification method, since the 0 value in the feature data accounts for a large proportion, the feature data other than the 0 value after sorting can be divided into intervals containing the same amount of feature data, that is, all the 0 values of the sorted feature data are recorded as Index 0, the corresponding reconstruction value is also set to 0 value.
下面结合图5,对当前图像的N个通道中每个通道的浮点数类型的特征数据,使用一种量化方式进行量化的过程进行详细描述。The following describes the process of using a quantization method to quantize the feature data of the floating point type of each channel of the N channels of the current image in detail with reference to FIG. 5 .
图5为本申请实施例提供的图像编码方法500的流程示意图,如图5所示,包括:FIG. 5 is a schematic flowchart of an image encoding method 500 provided by an embodiment of the present application, as shown in FIG. 5 , including:
S501、获取待编码的当前图像。S501. Acquire a current image to be encoded.
S502、将当前图像输入神经网络,得到当前图像的N个通道的浮点数类型的特征数据。S502: Input the current image into a neural network to obtain feature data of the floating point type of N channels of the current image.
S503、对N个通道中每个通道的浮点数类型的特征数据,分别使用一种量化方式进行量化。S503. Quantize the feature data of the floating point type of each channel in the N channels by using a quantization method respectively.
S505、对当前图像的定点数类型的特征数据进行编码,得到码流。S505: Encode the feature data of the fixed-point type of the current image to obtain a code stream.
可选的,量化方式包括线性均匀量化、非线性函数量化、查表量化。Optionally, the quantization method includes linear uniform quantization, nonlinear function quantization, and look-up table quantization.
在一些实施例中,若本实施例采用线性均匀量化方式对N个通道中每个通道的浮点数类型的特征数据进行量化时,则上述S503包括如下S503-A1和S503-A2:In some embodiments, if the present embodiment adopts a linear uniform quantization method to quantize the floating point type feature data of each of the N channels, the above S503 includes the following S503-A1 and S503-A2:
S503-A1、针对N个通道中的每个通道,获取预设的第四量化位宽,以及该通道的浮点数类型的特征数据中的第三特征值和第四特征值;S503-A1, for each channel in the N channels, obtain a preset fourth quantization bit width, and the third eigenvalue and the fourth eigenvalue in the feature data of the floating point type of the channel;
S503-A2、根据第三特征值和第四特征值,以及第四量化位宽,使用线性均匀量化方式,对该通道的浮点数类型的特征数据进行量化。S503-A2. According to the third eigenvalue, the fourth eigenvalue, and the fourth quantization bit width, use a linear uniform quantization method to quantize the floating point type feature data of the channel.
本申请实施例中,将N个通道中每个通道的浮点数类型的特征数据作为一个整体,对每个通道的浮点数类型的特征数据使用一种量化方式进行量化。In the embodiment of the present application, the feature data of the floating point number type of each channel in the N channels is taken as a whole, and a quantization method is used to quantize the feature data of the floating point number type of each channel.
需要说明的是,对N个通道中每个通道的特征数据的量化过程相同,为了便于描述,以N个通道中的一个通道为例。从该通道的浮点数类型的特征数据中获取最大的特征值和最小的特征值,将该最大的特征值记为第三特征值,将该最小的特征值记为第四特征值。It should be noted that the quantization process for the characteristic data of each channel in the N channels is the same, and for convenience of description, one channel in the N channels is taken as an example. Obtain the largest eigenvalue and the smallest eigenvalue from the feature data of the floating point type of the channel, record the largest eigenvalue as the third eigenvalue, and record the smallest eigenvalue as the fourth eigenvalue.
可选的,上述预设的第四量化位宽可以为用户事先设定的,并且设置在编码器的配置文件中。其中,第四量化位宽可以根据第三特征值的大小来确定。Optionally, the above-mentioned preset fourth quantization bit width may be preset by the user and set in the configuration file of the encoder. The fourth quantization bit width may be determined according to the size of the third eigenvalue.
可选的,上述第三特征值为该通道的浮点数类型的特征数据中的最大特征值,上述第四特征值为该通道的浮点数类型的特征数据中的最小特征值。Optionally, the third eigenvalue is the largest eigenvalue in the feature data of the floating point type of the channel, and the fourth eigenvalue is the smallest eigenvalue in the feature data of the floating point type of the channel.
在一些实施例中,编码器根据如下公式(7),对该通道的浮点数类型的特征数据进行量化:In some embodiments, the encoder quantizes the floating point type feature data of the channel according to the following formula (7):
Figure PCTCN2021078522-appb-000007
Figure PCTCN2021078522-appb-000007
其中,当前通道为第c个通道,x cij为该通道第i行第j列的浮点数类型的特征值,x cmax2和x cmin2分别为该通道的浮点数类型的特征数据中的第二最大值和第二最小值,bitdepth4为第四量化位宽,int[·]表示整数化函数,y cij为量化后的该通道第i行第j列的定点数类型的特征值,Δ为一个极小值,可以取为0,用以将浮点型的特征数据映射为左闭右开的取值区间。 Among them, the current channel is the c-th channel, x cij is the eigenvalue of the floating-point type of the i-th row and the j-th column of the channel, and x cmax2 and x cmin2 are the second largest among the floating-point type characteristic data of the channel. value and the second minimum value, bitdepth4 is the fourth quantization bit width, int[ ] represents the integerization function, y cij is the eigenvalue of the fixed-point type of the i-th row and the j-th column of the channel after quantization, and Δ is a polar Small value, which can be set to 0, is used to map the floating-point feature data into a value range of left closed and right open.
需要说明是,上述公式(7)只是一种示例,本申请的线性均匀量化方式还包括对上述公式(7)进行变形,例如变形为如下公式(8):It should be noted that the above formula (7) is only an example, and the linear uniform quantization method of the present application also includes transforming the above formula (7), for example, the following formula (8):
Figure PCTCN2021078522-appb-000008
Figure PCTCN2021078522-appb-000008
或者对上述公式(7)中相加、相乘或相除某一个或多个系数等。Or add, multiply or divide one or more coefficients in the above formula (7).
根据上述公式(7)对该通道的浮点数类型的特征数据量化为定点类型的特征数据后,对定点数类型的特征数据进行编码,形成码流。According to the above formula (7), after the characteristic data of the floating point type of the channel is quantized into the characteristic data of the fixed point type, the characteristic data of the fixed point type is encoded to form a code stream.
本申请依据非线性函数的不同,非线性均匀量化方式包括非线性对数均匀量化方式和非线性指数均匀量化方式。In the present application, according to the difference of nonlinear functions, nonlinear uniform quantization methods include nonlinear logarithmic uniform quantization methods and nonlinear exponential uniform quantization methods.
在一些实施例中,若本实施例采用非线性对数均匀量化方式对该通道的浮点数类型的特征数据进行量化时,则上述S503包括如下S503-B1和S503-B2:In some embodiments, if the non-linear logarithmic uniform quantization method is used to quantize the characteristic data of the floating point type of the channel, the above S503 includes the following S503-B1 and S503-B2:
S503-B1、针对N个通道中的每个通道,获取预设的第五量化位宽和对数函数的第二底数,以及该通道的浮点数类型的特征数据中的第三特征值和第四特征值;S503-B1, for each channel of the N channels, obtain a preset fifth quantization bit width and the second base of the logarithmic function, and the third eigenvalue and the third eigenvalue in the feature data of the floating point type of the channel Four eigenvalues;
S503-B2、根据第三特征值和第四特征值,以及第五量化位宽和对数函数的第二底数,使用非线性对数均匀量化方式,对该通道的浮点数类型的特征数据进行量化。S503-B2. According to the third eigenvalue and the fourth eigenvalue, and the fifth quantization bit width and the second base of the logarithmic function, use the nonlinear logarithmic uniform quantization method to perform the floating point number type feature data of the channel. quantify.
可选的,上述预设的第五量化位宽和对数函数的第二底数可以为用户事先设定的,并且设置在编码器的配置文件中。其中,第五量化位宽可以根据第三特征值的大小来确定,对数函数的第二底数根据该通道中特征数据的特性来确定。Optionally, the preset fifth quantization bit width and the second base of the logarithmic function may be preset by the user and set in the configuration file of the encoder. Wherein, the fifth quantization bit width can be determined according to the size of the third characteristic value, and the second base of the logarithmic function is determined according to the characteristics of the characteristic data in the channel.
在一些实施例中,编码器根据如下公式(9),对该通道的浮点数类型的特征数据进行量化:In some embodiments, the encoder quantizes the floating point type feature data of the channel according to the following formula (9):
Figure PCTCN2021078522-appb-000009
Figure PCTCN2021078522-appb-000009
其中,bitdepth5为第五量化位宽,log_base2为对数量化时所用的对数函数的第二底数,例如为10。Wherein, bitdepth5 is the fifth quantization bit width, and log_base2 is the second base of the logarithmic function used in logarithmic quantization, for example, 10.
需要说明是,上述公式(9)只是一种示例,本申请的非线性对数均匀量化方式还包括对上述公式(9)进行变形,例如变形为如下公式(10):It should be noted that the above formula (9) is only an example, and the nonlinear logarithmic uniform quantization method of the present application also includes transforming the above formula (9), for example, the following formula (10):
Figure PCTCN2021078522-appb-000010
Figure PCTCN2021078522-appb-000010
或者对上述公式(9)中相加、相乘或相除某一个或多个系数等。Or add, multiply or divide one or more coefficients in the above formula (9).
可选的,上述第五量化位宽与上述第四量化位宽相等。Optionally, the fifth quantization bit width is equal to the fourth quantization bit width.
在一些实施例中,若本实施例采用非线性指数均匀量化方式对该通道的浮点数类型的特征数据进行量化时,则上述S503包括如下S503-C1和S503-C2:In some embodiments, if the non-linear exponential uniform quantization method is used to quantize the characteristic data of the floating point type of the channel, the above S503 includes the following S503-C1 and S503-C2:
S503-C1、针对N个通道中的每个通道,获取预设的第六量化位宽和指数函数的第二底数,以及通道的浮点数类型的特征数据中的第三特征值和第四特征值;S503-C1, for each channel of the N channels, obtain the preset sixth quantization bit width and the second base of the exponential function, as well as the third eigenvalue and the fourth feature in the feature data of the channel's floating point type value;
S503-C2、根据第三特征值和第四特征值,以及第六量化位宽和指数函数的第二底数,使用非线性指数均匀量化方式,对通道的浮点数类型的特征数据进行量化。S503-C2. According to the third eigenvalue and the fourth eigenvalue, the sixth quantization bit width and the second base of the exponential function, use a nonlinear exponential uniform quantization method to quantize the floating point type feature data of the channel.
可选的,上述预设的第六量化位宽和指数函数的第二底数可以为用户事先设定的,并且设置在编码器的配置文件中。其中,第六量化位宽可以根据第三特征值的大小来确定,指数函数的第二底数根据该通道下特征数据的特性来确定。Optionally, the above-mentioned preset sixth quantization bit width and the second base of the exponential function may be preset by the user and set in the configuration file of the encoder. Wherein, the sixth quantization bit width can be determined according to the size of the third characteristic value, and the second base of the exponential function is determined according to the characteristics of the characteristic data under the channel.
在一些实施例中,编码器根据如下公式(11),对该通道的浮点数类型的特征数据进行量化:In some embodiments, the encoder quantizes the floating point type feature data of the channel according to the following formula (11):
Figure PCTCN2021078522-appb-000011
Figure PCTCN2021078522-appb-000011
其中,bitdepth6为第六量化位宽,e_base2为指数量化时所用指数函数的第二底数。Wherein, bitdepth6 is the sixth quantization bit width, and e_base2 is the second base of the exponential function used in exponential quantization.
需要说明是,上述公式(11)只是一种示例,本申请的非线性对数均匀量化方式还包括对上述公式(11)进行变形,例如变形为如下公式(12):It should be noted that the above formula (11) is only an example, and the nonlinear logarithmic uniform quantization method of the present application also includes transforming the above formula (11), for example, the following formula (12):
Figure PCTCN2021078522-appb-000012
Figure PCTCN2021078522-appb-000012
或者对上述公式(11)中相加、相乘或相除某一个或多个系数等。Or add, multiply or divide one or more coefficients in the above formula (11).
可选的,上述第六量化位宽与上述第四量化位宽相等。Optionally, the above-mentioned sixth quantization bit width is equal to the above-mentioned fourth quantization bit width.
在一些实施例中,若本实施例采用查表量化方式对该通道的浮点数类型的特征数据进行量化时,则上述S503包括如下S503-D1至S503-D3:In some embodiments, if this embodiment adopts the table look-up quantization method to quantize the characteristic data of the floating point type of the channel, the above S503 includes the following S503-D1 to S503-D3:
S503-D1、针对N个通道中的每个通道,对通道的浮点数类型的特征数据,按照取值大小进行排序,得到该通道下排序后的第二特征数据;S503-D1, for each channel in the N channels, sort the feature data of the floating point type of the channel according to the value size, and obtain the sorted second feature data under the channel;
S503-D2、将该通道下排序后的第二特征数据划分为多个第二量化区间,其中每个第二量化区间包括相同数量的特征数据;S503-D2, the second characteristic data sorted under the channel is divided into a plurality of second quantization intervals, wherein each second quantization interval includes the same amount of characteristic data;
S503-D3、针对每个第二量化区间,将第二量化区间内的特征数据的值量化为第二量化区间的索引值。S503-D3: For each second quantization interval, quantize the value of the feature data in the second quantization interval into an index value of the second quantization interval.
本实施例中,将该通道的浮点数类型的特征数据按照取值大小进行从大到小或从小到大的排序,为了便于描述,将该该通道下排序后的特征数据称为排序后的第二特征数据。将该通道下排序后的第二特征数据划分成多个第二量化区间,每个第二量化区间所包括的特征数据的数量相同。使用相应量化位宽所能表示的索引来表示各个第二量化区间,使得每个第二量化区间具有一个索引。这样,在量化时,可以将各第二量化区间内的特征数据的值量化为各第二量化区间的索引值。In this embodiment, the feature data of the floating point type of the channel is sorted from large to small or from small to large according to the value size. For the convenience of description, the sorted feature data of the channel is called sorted Second characteristic data. The second feature data sorted in the channel is divided into a plurality of second quantization intervals, and each second quantization interval includes the same quantity of feature data. Each second quantization interval is represented by an index that can be represented by a corresponding quantization bit width, so that each second quantization interval has an index. In this way, during quantization, the value of the feature data in each second quantization interval can be quantized into an index value of each second quantization interval.
下面结合图6,对M组个通道中每一组通道的浮点数类型的特征数据,使用一种量化方式进行量化的过程进行详细描述。The following describes in detail the process of using a quantization method to quantize the characteristic data of the floating point type of each channel of the M groups of channels with reference to FIG. 6 .
图6为本申请实施例提供的图像编码方法600的流程示意图,如图6所示,包括:FIG. 6 is a schematic flowchart of an image encoding method 600 provided by an embodiment of the present application, as shown in FIG. 6 , including:
S601、获取待编码的当前图像。S601. Acquire a current image to be encoded.
S602、将当前图像输入神经网络,得到当前图像的N个通道的浮点数类型的特征数据。S602: Input the current image into a neural network to obtain floating point type feature data of N channels of the current image.
S603、对每一组通道的浮点数类型的特征数据,分别使用一种量化方式进行量化。S603: Quantize the feature data of the floating point type of each group of channels using a quantization method respectively.
S604、对当前图像的定点数类型的特征数据进行编码,得到码流。S604: Encode the feature data of the fixed-point type of the current image to obtain a code stream.
可选的,量化方式包括线性均匀量化、非线性函数量化、查表量化。Optionally, the quantization method includes linear uniform quantization, nonlinear function quantization, and look-up table quantization.
在一些实施例中,若本实施例采用线性均匀量化方式对该组通道的浮点数类型的特征数据进行量化时,则上述S603包括如下S603-A1和S603-A2:In some embodiments, if the present embodiment adopts the linear uniform quantization method to quantize the floating point type characteristic data of the group of channels, the above S603 includes the following S603-A1 and S603-A2:
S603-A1、针对每一组通道,获取预设的第七量化位宽,以及该组通道的浮点数类型的特征数据中的第五特征值和第六特征值;S603-A1, for each group of channels, obtain the preset seventh quantization bit width, and the fifth eigenvalue and the sixth eigenvalue in the feature data of the floating point type of the group of channels;
S603-A2、根据第五特征值和第六特征值,以及第七量化位宽,使用线性均匀量化方式,对该组通道中的每个通道的浮点数类型的特征数据进行量化。S603-A2. According to the fifth eigenvalue, the sixth eigenvalue, and the seventh quantization bit width, use a linear uniform quantization method to quantize the floating point type feature data of each channel in the group of channels.
本申请实施例中,将N个通道划分为多组通道,将每一组通道的浮点数类型的特征数据作为一个整体,对每一组通道的浮点数类型的特征数据使用一种量化方式进行量化。In the embodiment of the present application, the N channels are divided into multiple groups of channels, the feature data of the floating-point number type of each group of channels is taken as a whole, and a quantization method is used for the feature data of the floating-point number type of each group of channels. quantify.
需要说明的是,对每一组通道的特征数据的量化过程相同,为了便于描述,以一组通道为例。从该组通道的浮点数类型的特征数据中获取最大的特征值和最小的特征值,将该最大的特征值记为第五特征值,将该最小的特征值记为第六特征值。It should be noted that the quantization process for the characteristic data of each group of channels is the same. For the convenience of description, a group of channels is taken as an example. Obtain the largest eigenvalue and the smallest eigenvalue from the feature data of the floating point type of the set of channels, record the largest eigenvalue as the fifth eigenvalue, and record the smallest eigenvalue as the sixth eigenvalue.
可选的,上述预设的第七量化位宽可以为用户事先设定的,并且设置在编码器的配置文件中。其中,第七量化位宽可以根据第五特征值的大小来确定。Optionally, the above-mentioned preset seventh quantization bit width may be preset by the user and set in the configuration file of the encoder. The seventh quantization bit width may be determined according to the size of the fifth eigenvalue.
可选的,上述第五特征值为该组通道的浮点数类型的特征数据中的最大特征值,上述第六特征值为该组通道的浮点数类型的特征数据中的最小特征值。Optionally, the fifth characteristic value is the largest characteristic value in the floating point type characteristic data of the group of channels, and the sixth characteristic value is the smallest characteristic value in the floating point type characteristic data of the group of channels.
在一些实施例中,编码器根据如下公式(13),对该组通道的浮点数类型的特征数据进行量化:In some embodiments, the encoder quantizes the floating point type feature data of the set of channels according to the following formula (13):
Figure PCTCN2021078522-appb-000013
Figure PCTCN2021078522-appb-000013
其中,第c个通道为该组通道中一个通道,x cij为第c个通道第i行第j列的浮点数类型的特征值,x cmax3和x cmin3分别为该组通道的浮点数类型的特征数据中的第三最大值和第三最小值,bitdepth7为第七量化位宽,int[·]表示整数化函数,y cij为量化后的第c个通道第i行第j列的定点数类型的特征值,Δ为一个极小值,用以将浮点型的特征数据映射为左闭右开的取值区间。 Among them, the c-th channel is a channel in the group of channels, x cij is the eigenvalue of the floating-point number type in the i-th row and the j-th column of the c-th channel, and x cmax3 and x cmin3 are the floating-point number type of the group of channels respectively. The third maximum value and the third minimum value in the feature data, bitdepth7 is the seventh quantization bit width, int[ ] represents the integerization function, y cij is the fixed-point number of the i-th row and the j-th column of the c-th channel after quantization The eigenvalue of the type, Δ is a minimum value, which is used to map the eigendata of the floating-point type into the value range of left closed and right open.
需要说明是,上述公式(12)只是一种示例,本申请的线性均匀量化方式还包括对上述公式(13)进行变形,例如变形为如下公式(14):It should be noted that the above formula (12) is only an example, and the linear uniform quantization method of the present application also includes transforming the above formula (13), for example, the following formula (14):
Figure PCTCN2021078522-appb-000014
Figure PCTCN2021078522-appb-000014
或者对上述公式(14)中相加、相乘或相除某一个或多个系数等。Or add, multiply or divide one or more coefficients in the above formula (14).
根据上述公式(14)对该组通道的浮点数类型的特征数据量化为定点类型的特征数据后,对定点数类型的特征数据进行编码,形成码流。According to the above formula (14), after the feature data of the floating point type of the group of channels is quantized into the feature data of the fixed point type, the feature data of the fixed point type is encoded to form a code stream.
依据非线性函数的不同,非线性均匀量化方式包括非线性对数均匀量化方式和非线性指数均匀量化方式。According to different nonlinear functions, nonlinear uniform quantization methods include nonlinear logarithmic uniform quantization methods and nonlinear exponential uniform quantization methods.
在一些实施例中,若本实施例采用非线性对数均匀量化方式对该组通道的浮点数类型的特征数据进行量化时,则上述S603包括如下S603-B1和S603-B2:In some embodiments, if the non-linear logarithmic uniform quantization method is used to quantize the characteristic data of the floating point type of the group of channels, the above S603 includes the following S603-B1 and S603-B2:
S603-B1、针对每一组通道,获取预设的第八量化位宽和对数函数的第三底数,以及组通道的浮点数类型的特征数据中的第五特征值和第六特征值;S603-B1, for each group of channels, obtain the preset eighth quantization bit width and the third base of the logarithmic function, and the fifth eigenvalue and the sixth eigenvalue in the feature data of the floating point type of the group channel;
S603-B2、根据第五特征值和第六特征值,以及第八量化位宽和对数函数的第三底数,使用非线性对数均匀量化方式,对组通道中的每个通道的浮点数类型的特征数据进行量化。S603-B2. According to the fifth eigenvalue and the sixth eigenvalue, as well as the eighth quantization bit width and the third base of the logarithmic function, use a nonlinear logarithmic uniform quantization method to quantify the floating point number of each channel in the group of channels Types of feature data are quantified.
可选的,上述预设的第八量化位宽和对数函数的第三底数可以为用户事先设定的,并且设置在编码器的配置文件中。其中,第八量化位宽可以根据第五特征值的大小来确定,对数函数的第三底数根据该组通道中特征数据的特性来确定。Optionally, the above-mentioned preset eighth quantization bit width and the third base of the logarithmic function may be preset by the user and set in the configuration file of the encoder. The eighth quantization bit width may be determined according to the size of the fifth characteristic value, and the third base of the logarithmic function is determined according to the characteristics of the characteristic data in the group of channels.
在一些实施例中,编码器根据如下公式(15),对该组通道的浮点数类型的特征数据进行量化:In some embodiments, the encoder quantizes the floating point type feature data of the set of channels according to the following formula (15):
Figure PCTCN2021078522-appb-000015
Figure PCTCN2021078522-appb-000015
其中,bitdepth8为第八量化位宽,log_base3为对数量化时所用的对数函数的第三底数,例如为10。Wherein, bitdepth8 is the eighth quantization bit width, and log_base3 is the third base of the logarithmic function used in logarithmic quantization, for example, 10.
需要说明是,上述公式(15)只是一种示例,本申请的非线性对数均匀量化方式还包括对上述公式(15)进行变形,例如变形为如下公式(16):It should be noted that the above formula (15) is just an example, and the nonlinear logarithmic uniform quantization method of the present application also includes transforming the above formula (15), for example, the following formula (16):
Figure PCTCN2021078522-appb-000016
Figure PCTCN2021078522-appb-000016
或者对上述公式(15)中相加、相乘或相除某一个或多个系数等。Or add, multiply or divide one or more coefficients in the above formula (15).
可选的,上述第八量化位宽与上述第八量化位宽相等。Optionally, the above-mentioned eighth quantization bit width is equal to the above-mentioned eighth quantization bit width.
在一些实施例中,若本实施例采用非线性指数均匀量化方式对该通道的浮点数类型的特征数据进行量化时,则上述S603包括如下S603-C1和S603-C2:In some embodiments, if the non-linear exponential uniform quantization method is used to quantize the characteristic data of the floating point type of the channel, the above S603 includes the following S603-C1 and S603-C2:
S603-C1、针对每一组通道,获取预设的第九量化位宽和指数函数的第三底数,以及该组通道的浮点数类型的特征数据中的第五特征值和第六特征值;S603-C1, for each group of channels, obtain the preset ninth quantization bit width and the third base of the exponential function, and the fifth eigenvalue and the sixth eigenvalue in the feature data of the floating point type of the group of channels;
S603-C2、根据第五特征值和第六特征值,以及第九量化位宽和指数函数的第三底数,使用非线性对数均匀量化方式,对该组通道中的每个通道的浮点数类型的特征数据进行量化。S603-C2. According to the fifth eigenvalue and the sixth eigenvalue, as well as the ninth quantization bit width and the third base of the exponential function, use a non-linear logarithmic uniform quantization method to obtain the floating point number of each channel in the group of channels Types of feature data are quantified.
可选的,上述预设的第九量化位宽和指数函数的第三底数可以为用户事先设定的,并且设置在编 码器的配置文件中。其中,第九量化位宽可以根据第五特征值的大小来确定,指数函数的第三底数根据该组通道下特征数据的特性来确定。Optionally, the above-mentioned preset ninth quantization bit width and the third base of the exponential function may be preset by the user and set in the configuration file of the encoder. Wherein, the ninth quantization bit width may be determined according to the size of the fifth characteristic value, and the third base of the exponential function is determined according to the characteristics of the characteristic data under the group of channels.
在一些实施例中,编码器根据如下公式(17),对该组通道的浮点数类型的特征数据进行量化:In some embodiments, the encoder quantizes the floating point type feature data of the set of channels according to the following formula (17):
Figure PCTCN2021078522-appb-000017
Figure PCTCN2021078522-appb-000017
其中,bitdepth9为第九量化位宽,e_base3为指数量化时所用指数函数的第三底数。Wherein, bitdepth9 is the ninth quantization bit width, and e_base3 is the third base of the exponential function used in exponential quantization.
需要说明是,上述公式(17)只是一种示例,本申请的非线性对数均匀量化方式还包括对上述公式(17)进行变形,例如变形为如下公式(18):It should be noted that the above formula (17) is just an example, and the nonlinear logarithmic uniform quantization method of the present application also includes transforming the above formula (17), for example, the following formula (18):
Figure PCTCN2021078522-appb-000018
Figure PCTCN2021078522-appb-000018
或者对上述公式(18)中相加、相乘或相除某一个或多个系数等。Or add, multiply or divide one or more coefficients in the above formula (18).
可选的,上述第九量化位宽与上述第九量化位宽相等。Optionally, the above-mentioned ninth quantization bit width is equal to the above-mentioned ninth quantization bit width.
在一些实施例中,若本实施例采用查表量化方式对该组通道的浮点数类型的特征数据进行量化时,则上述S603包括如下S603-D1至S603-D3:In some embodiments, if this embodiment adopts the table look-up quantization method to quantize the floating point type characteristic data of the group of channels, the above S603 includes the following S603-D1 to S603-D3:
S603-D1、针对每一组通道,对组通道的浮点数类型的特征数据,按照取值大小进行排序,得到组通道下排序后的第三特征数据;S603-D1. For each group of channels, sort the floating-point type feature data of the group channel according to the value size, and obtain the sorted third feature data under the group channel;
S603-D2、将组通道下排序后的第三特征数据划分为多个第三量化区间,其中每个第三量化区间包括相同数量的特征数据;S603-D2, dividing the sorted third characteristic data under the group channel into a plurality of third quantization intervals, wherein each third quantization interval includes the same amount of characteristic data;
S603-D3、针对每个第三量化区间,将第三量化区间内的特征数据的值量化为第三量化区间的索引值。S603-D3: For each third quantization interval, quantize the value of the feature data in the third quantization interval into an index value of the third quantization interval.
本实施例中,将该组通道的浮点数类型的特征数据按照取值大小进行从大到小或从小到大的排序,为了便于描述,将该该组通道下排序后的特征数据称为排序后的第三特征数据。将该组通道下排序后的第三特征数据划分成多个第三量化区间,每个第三量化区间所包括的特征数据的数量相同。使用相应量化位宽所能表示的索引来表示各个第三量化区间,使得每个第三量化区间具有一个索引。这样,在量化时,可以将各第三量化区间内的特征数据的值量化为各第三量化区间的索引值。In this embodiment, the feature data of the floating point type of the group of channels is sorted according to the value size from large to small or from small to large. For the convenience of description, the sorted feature data under the group of channels is called sorting After the third characteristic data. The sorted third characteristic data in the group of channels is divided into a plurality of third quantization intervals, and each third quantization interval includes the same quantity of characteristic data. Each third quantization interval is represented by an index that can be represented by a corresponding quantization bit width, so that each third quantization interval has an index. In this way, during quantization, the value of the feature data in each third quantization interval can be quantized into an index value of each third quantization interval.
上文对编码端的量化过程进行介绍,下面对第一信息所指示的内容进行介绍。The quantization process at the encoding end is described above, and the content indicated by the first information is described below.
本申请中编码端根据上述步骤对至少一个通道的浮点数类型的特征数据量化为定点数类型后,将定点数类型的特征数据编码在码流中发送给解码端。同时,编码端在码流中携带第一信息,该第一信息指示对至少一个通道的定点数类型的特征数据进行反量化。In the present application, after the encoding end quantizes the floating point type feature data of at least one channel into a fixed point number type according to the above steps, the encoding end encodes the fixed point number type characteristic data in a code stream and sends it to the decoding end. At the same time, the encoding end carries first information in the code stream, where the first information indicates to perform inverse quantization on the feature data of the fixed-point type of at least one channel.
在一些实施例中,码流还包括第二信息,该第二信息用于指示对至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式。In some embodiments, the code stream further includes second information, where the second information is used to indicate an inverse quantization method used when performing inverse quantization on the characteristic data of the fixed-point type of at least one channel.
对至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式包括如下任意一种:线性均匀反量化方式、非线性指数均匀反量化方式、非线性对数均匀反量化方式、查表反量化方式。需要说明的是,本申请实施例的反量化方式包括但不限于如上几种量化方式,还可以采用其他的反量化方式将定点数类型的特征数据反量化为浮点数类型的特征数据,本申请对反量化方式不做限制。The inverse quantization method used when performing inverse quantization on the fixed-point type characteristic data of at least one channel includes any one of the following: linear uniform inverse quantization method, nonlinear exponential uniform inverse quantization method, nonlinear logarithmic uniform inverse quantization method, Look-up table inverse quantification method. It should be noted that the inverse quantization methods in the embodiments of the present application include but are not limited to the above several quantization methods, and other inverse quantization methods can also be used to inverse quantize the characteristic data of the fixed-point type into the characteristic data of the floating-point type. There is no restriction on the inverse quantization method.
在一些实施例中,第一信息包括对至少一个通道的定点数类型的特征数据进行反量化时所需的至少一个参数。In some embodiments, the first information includes at least one parameter required for inverse quantization of fixed-point type feature data of at least one channel.
本申请中第一信息所包括的至少一个参数包括如下几种情况:At least one parameter included in the first information in this application includes the following situations:
情况1,第一信息指示对N个通道中所有通道的定点数类型的特征数据进行反量化,此时根据反量化方式的不同,则第一信息包括如下示例一、示例二、示例三或示例四任意一种:In case 1, the first information indicates that inverse quantization is performed on the characteristic data of the fixed-point type of all channels in the N channels. At this time, according to the different inverse quantization methods, the first information includes the following example 1, example 2, example 3 or example Any of the four:
示例一,若对N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为线性均匀反量化方式,则第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽。Example 1, if the inverse quantization method for performing inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels is a linear uniform inverse quantization method, the first information includes the first target feature value, the first target scaling value and the The first target quantization bit width.
其中,第一目标特征值为N个通道中所有通道的特征数据中的一个特征值,例如第一目标特征值为N个通道中所有通道的特征数据最小值。Wherein, the first target feature value is one feature value in the feature data of all the channels in the N channels, for example, the first target feature value is the minimum value of the feature data of all the channels in the N channels.
其中,第一目标缩放值为N个通道中所有通道的特征数据在量化时对应的缩放值,第一目标量化位宽为N个通道中所有通道的特征数据在量化时对应的量化位宽。The first target scaling value is the scaling value corresponding to the feature data of all channels in the N channels during quantization, and the first target quantization bit width is the quantization bit width corresponding to the feature data of all channels in the N channels during quantization.
下面结合编码端的编码方式,对第一目标缩放值的确定过程进行介绍。The following describes the process of determining the first target scaling value in conjunction with the encoding mode of the encoding end.
在一种示例中,若编码端对所有通道进行量化的方式为线性均匀量化方式,则编码端可以根据N个通道中所有通道的特征数据中的第一特征值和第二特征值,以及第一目标量化位宽确定第一目标缩放值。In an example, if the quantization method of the encoding end for all channels is a linear uniform quantization method, the encoding end may use the first eigenvalue and the second eigenvalue in the characteristic data of all the channels in the N channels, and the A target quantization bit width determines the first target scaling value.
可选的,可以根据如下公式(19)确定第一目标缩放值s c1Optionally, the first target scaling value s c1 may be determined according to the following formula (19):
Figure PCTCN2021078522-appb-000019
Figure PCTCN2021078522-appb-000019
其中,x cmin1和x cmax1分别为N个通道中所有通道的特征数据中的第一特征值和第二特征值。第一目标量化位宽1bitdepth可以为上述公式(1)中的第一量化位宽bitdepth1。 Wherein, x cmin1 and x cmax1 are the first eigenvalue and the second eigenvalue in the feature data of all channels in the N channels, respectively. The first target quantization bit width 1bitdepth may be the first quantization bit width bitdepth1 in the above formula (1).
需要说明是,上述公式(19)只是一种示例,本申请确定第一目标缩放值s c1的公式还包括对上述公式(19)进行变形,或者,对上述公式(19)中相加、相乘或相除某一个或多个系数等。 It should be noted that the above formula (19) is only an example, and the formula for determining the first target scaling value s c1 in the present application also includes the modification of the above formula (19), or the addition and addition of the above formula (19). Multiply or divide one or more coefficients, etc.
在一另种示例中,若编码端对所有通道进行量化的方式为非线性对数均匀量化方式,则编码端可以根据N个通道中所有通道的特征数据中的第一特征值和第二特征值,以及第一目标量化位宽和对数函数的第一底数确定第一目标缩放值。In another example, if the encoding end quantizes all channels in a non-linear logarithmic uniform quantization mode, the encoding end may use the first eigenvalue and the second feature in the feature data of all channels in the N channels. value, together with the first target quantization bit width and the first base of the logarithmic function to determine the first target scaling value.
可选的,可以根据如下公式(20)确定第一目标缩放值s c1Optionally, the first target scaling value s c1 may be determined according to the following formula (20):
Figure PCTCN2021078522-appb-000020
Figure PCTCN2021078522-appb-000020
其中,log log_base1为对数函数的第一底数,第一目标量化位宽可以为上述公式(3)中的第二量化位宽。 Wherein, log log_base1 is the first base of the logarithmic function, and the first target quantization bit width may be the second quantization bit width in the above formula (3).
需要说明是,上述公式(20)只是一种示例,本申请确定第一目标缩放值s c1的公式还包括对上述公式(20)进行变形,或者,对上述公式(20)中相加、相乘或相除某一个或多个系数等。 It should be noted that the above formula (20) is just an example, and the formula for determining the first target scaling value s c1 in the present application also includes the modification of the above formula (20), or the addition and addition of the above formula (20). Multiply or divide one or more coefficients, etc.
在一另种示例中,若编码端对所有通道进行量化的方式为非线性指数均匀量化方式,则编码端可以根据N个通道中所有通道的特征数据中的第一特征值和第二特征值,以及第一目标量化位宽和指数函数的第一底数确定第一目标缩放值。In another example, if the encoding end quantizes all channels in a non-linear exponential uniform quantization mode, the encoding end may use the first eigenvalue and the second eigenvalue in the feature data of all channels in the N channels. , and the first target quantization bit width and the first base of the exponential function determine the first target scaling value.
可选的,可以根据如下公式(21)确定第一目标缩放值s c1Optionally, the first target scaling value s c1 may be determined according to the following formula (21):
Figure PCTCN2021078522-appb-000021
Figure PCTCN2021078522-appb-000021
其中,e_base1为指数函数的第一底数,第一目标量化位宽可以为上述公式(5)中的第三量化位宽bitdepth3。Wherein, e_base1 is the first base of the exponential function, and the first target quantization bit width may be the third quantization bit width bitdepth3 in the above formula (5).
需要说明是,上述公式(21)只是一种示例,本申请确定第一目标缩放值s c1的公式还包括对上 述公式(21)进行变形,或者,对上述公式(21)中相加、相乘或相除某一个或多个系数等。 It should be noted that the above formula (21) is only an example, and the formula for determining the first target scaling value s c1 in the present application also includes the modification of the above formula (21), or the addition and addition of the above formula (21). Multiply or divide one or more coefficients, etc.
这样,解码端可以从码流中解析出第一信息,并根据第一信息包括的第一目标特征值、第一目标缩放值和第一目标量化位宽,使用线性均匀反量化方式对N个通道中所有通道的定点数类型的特征数据进行反量化。In this way, the decoding end can parse the first information from the code stream, and according to the first target feature value, the first target scaling value and the first target quantization bit width included in the first information, use the linear uniform inverse quantization method to Inverse quantization is performed on the fixed-point type feature data of all channels in the channel.
示例二,若对N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为非线性对数均匀反量化方式,此时第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽,或者第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数,或者第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数的指示信息。Example 2, if the inverse quantization method for performing inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels is a nonlinear logarithmic uniform inverse quantization method, at this time, the first information includes the first target eigenvalue, the first The target scaling value and the first target quantization bit width, or the first information includes the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base, or the first information includes the first target feature value, the first target scaling value, and the indication information of the first target quantization bit width and the first logarithmic base.
具体的,若第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽,则解码端根据第一目标特征值、第一目标缩放值和第一目标量化位宽和默认的对数底数,使用非线性对数均匀反量化方式对N个通道中的所有通道的定点数类型的特征数据进行反量化。Specifically, if the first information includes the first target feature value, the first target scaling value, and the first target quantization bit width, the decoding end uses the first target feature value, the first target scaling value, and the first target quantization bit width and The default logarithmic base, which uses the nonlinear logarithmic uniform inverse quantization method to dequantize the fixed-point type feature data of all the N channels.
若第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数,则解码端直接使用第一信息携带的第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数,使用非线性对数均匀反量化方式对N个通道中的所有通道的定点数类型的特征数据进行反量化。If the first information includes the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first logarithmic base, the decoding end directly uses the first target eigenvalue, the first target scaling carried by the first information value, the first target quantization bit width and the first logarithmic base, and use the nonlinear logarithmic uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of all the N channels.
若第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数的指示信息,该第一对数底数的指示信息用于指示从预设的多个对数底数中确定第一对数底数。这样,解码端从码流中解析出第一信息,根据第一对数底数的指示信息,从预设的多个对数底数中确定出第一对数底数,进而根据第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数,使用非线性对数均匀反量化方式对N个通道中的所有通道的定点数类型的特征数据进行反量化。If the first information includes the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first logarithmic base indication information, the first logarithmic base indication information is used to indicate the multiple The first logarithmic base is determined from the logarithmic bases. In this way, the decoding end parses the first information from the code stream, determines the first logarithmic base from the preset multiple logarithmic bases according to the indication information of the first logarithmic base, and then determines the first logarithmic base according to the first target characteristic value, The first target scaling value, the first target quantization bit width, and the first logarithmic base are used to perform inverse quantization on the fixed-point type feature data of all channels in the N channels by using a non-linear logarithmic uniform inverse quantization method.
示例三,若对N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为非线性指数均匀反量化方式,则第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽,或者第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一指数底数,或者第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一指数底数的指示信息。Example 3, if the inverse quantization method for performing inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels is a nonlinear exponential uniform inverse quantization method, the first information includes the first target eigenvalue, the first target scaling value and the first target quantization bit width, or the first information includes the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first exponent base, or the first information includes the first target eigenvalue, the first A target scaling value and indication information of a first target quantization bit width and a first exponent base.
具体的,若第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽,则解码端根据第一目标特征值、第一目标缩放值和第一目标量化位宽和默认的指数底数,使用非线性指数均匀反量化方式对N个通道中的所有通道的定点数类型的特征数据进行反量化。Specifically, if the first information includes the first target feature value, the first target scaling value, and the first target quantization bit width, the decoding end uses the first target feature value, the first target scaling value, and the first target quantization bit width and The default exponential base, which uses the nonlinear exponential uniform inverse quantization method to inverse quantize the fixed-point feature data of all channels in the N channels.
若第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一指数底数,则解码端直接使用第一信息携带的第一目标特征值、第一目标缩放值和第一目标量化位宽和第一指数底数,使用非线性指数均匀反量化方式对N个通道中的所有通道的定点数类型的特征数据进行反量化。If the first information includes the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first exponent base, the decoding end directly uses the first target eigenvalue and the first target scaling value carried in the first information With the first target quantization bit width and the first exponent base, the non-linear exponent uniform inverse quantization method is used to inverse quantize the fixed-point type feature data of all the N channels.
若第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一指数底数的指示信息,该第一指数底数的指示信息用于指示从预设的多个指数底数中确定第一指数底数。这样,解码端从码流中解析出第一信息,根据第一指数底数的指示信息,从预设的多个指数底数中确定出第一指数底数,进而根据第一目标特征值、第一目标缩放值和第一目标量化位宽和第一指数底数,使用非线性指数均匀反量化方式对N个通道中的所有通道的定点数类型的特征数据进行反量化。If the first information includes the first target eigenvalue, the first target scaling value, the first target quantization bit width and the indication information of the first exponent base, the indication information of the first exponent base is used to indicate multiple exponents from preset In the base number, the base of the first exponent is determined. In this way, the decoding end parses the first information from the code stream, determines the first exponent base from the preset multiple exponent bases according to the indication information of the first exponent base, and then determines the first exponent base according to the first target characteristic value, the first target The scaling value, the first target quantization bit width and the first exponent base are used to inversely quantize the fixed-point feature data of all channels in the N channels by using a non-linear exponential uniform inverse quantization method.
示例四,若对N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为查表反量化方式,则第一信息包括量化区间的索引值与量化区间的反量化值之间的第一对应关系,该第一对应关系是基于N个通道中所有通道的特征数据的量化前的值和量化后的值确定的。其中,量化区间的索引可以理解为定点化后的特征值,量化区间的反量化值可以理解为量化区间内各特征值的加权均价值,或者为该量化区间的中心位置对应的特征值。量化区间内各特征值的加权平均值也可以称为量化 区间的概率分布中心对应的特征值。其中,反量化值也可以称为重建值。Example 4, if the inverse quantization method for performing inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels is a table look-up inverse quantization method, then the first information includes the index value of the quantization interval and the inverse quantization value of the quantization interval. The first correspondence between the N channels is determined based on the pre-quantization value and the post-quantization value of the feature data of all channels in the N channels. The index of the quantization interval can be understood as a fixed-point eigenvalue, and the inverse quantization value of the quantization interval can be understood as the weighted average value of each eigenvalue in the quantization interval, or the eigenvalue corresponding to the center position of the quantization interval. The weighted average value of each eigenvalue in the quantization interval can also be called the eigenvalue corresponding to the probability distribution center of the quantization interval. The inverse quantization value may also be called a reconstruction value.
对于查表反量化方式,由于特征数据中0值占比较大,因此可以将排序后除0值之外的特征数据划分为包含等数量特征数据的区间,即将排序后特征数据所有的0值记为0号索引,对应的重建值同样设为0值。For the table lookup inverse quantization method, since the 0 value in the feature data accounts for a large proportion, the feature data other than the 0 value after sorting can be divided into intervals containing the same amount of feature data, that is, all 0 values of the sorted feature data are recorded. is index 0, and the corresponding reconstruction value is also set to 0 value.
在一具体的实施例中,编码端的量化方式与解码端的反量化方式一一对应,例如,编码端使用线性量化方式对N个通道中的所有通道的浮点数类型的特征数据进行量化时,则解码端使用线性反量化方式对N个通道的所有通道的定点数类型的特征数据进行反量化。若解码端使用非线性对数均匀量化方式对N个通道中的所有通道的浮点数类型的特征数据进行量化时,则解码端使用非线性对数均匀反量化方式对N个通道的所有通道的定点数类型的特征数据进行反量化。若解码端使用非线性指数均匀量化方式对N个通道中的所有通道的浮点数类型的特征数据进行量化时,则解码端使用非线性指数均匀反量化方式对N个通道的所有通道的定点数类型的特征数据进行反量化。若解码端使用查表量化方式对N个通道中的所有通道的浮点数类型的特征数据进行量化时,则解码端使用查表反量化方式对N个通道的所有通道的定点数类型的特征数据进行反量化。In a specific embodiment, the quantization method of the encoding end corresponds to the inverse quantization method of the decoding end one-to-one. The decoding end uses linear inverse quantization to perform inverse quantization on the fixed-point feature data of all channels of the N channels. If the decoding end uses the nonlinear logarithmic uniform quantization method to quantize the floating-point type feature data of all channels in the N channels, the decoding end uses the nonlinear logarithmic uniform inverse quantization method to quantize all the N channels. The feature data of fixed-point type is inversely quantized. If the decoding end uses the nonlinear exponential uniform quantization method to quantize the floating-point type feature data of all channels in the N channels, the decoding end uses the nonlinear exponential uniform inverse quantization method to quantize the fixed-point data of all channels of the N channels. Type of feature data for inverse quantization. If the decoding end uses the table lookup quantization method to quantize the floating point type feature data of all channels in the N channels, the decoding end uses the table lookup inverse quantization method to quantize the fixed point type characteristic data of all the N channels. Do inverse quantization.
本申请实施例可以采用上述的线性均匀反量化方式、非线性对数函数反量化方式、非线性指数函数反量化方式、查表反量化方式。The embodiments of the present application may adopt the linear uniform inverse quantization method, the nonlinear logarithmic function inverse quantization method, the nonlinear exponential function inverse quantization method, and the look-up table inverse quantization method.
在一些实施例中,本申请与反量化特征数据相关的反量化信息可以记录在补充增强信息中,例如记录在现有视频编码标准H.265/HEVC、H.266/VVC的Supplemental Enhancement Information(SEI)或AVS标准的扩展数据(Extension Data)中。In some embodiments, the inverse quantization information related to the inverse quantization feature data of the present application may be recorded in the supplementary enhancement information, for example, recorded in the Supplemental Enhancement Information (Supplemental Enhancement Information) of the existing video coding standards H.265/HEVC and H.266/VVC SEI) or AVS standard extension data (Extension Data).
在一种示例中,在现有视频编码标准AVC/HEVC/VVC/EVC的sei_rbsp()中sei_message()的sei_paylod()中增加一种新的SEI类别,即Feature data quantization SEI message,payloadType可以定义为任意其他SEI没有使用过的编号,例如183,此时,sei_payload()语法结构如表1所示。In an example, a new SEI category is added to sei_paylod() of sei_message() in sei_rbsp() of existing video coding standards AVC/HEVC/VVC/EVC, namely Feature data quantization SEI message, payloadType can be defined It is any number that has not been used by other SEI, such as 183. At this time, the syntax structure of sei_payload() is shown in Table 1.
表1Table 1
Figure PCTCN2021078522-appb-000022
Figure PCTCN2021078522-appb-000022
其中,feature_data_quantization表示对特征数据反量化。Among them, feature_data_quantization represents the inverse quantization of feature data.
对当前图像的N个通道中所有通道的定点数类型的特征数据进行反量化。当反量化方式不同时,其语法结构也不相同,下面对不同的反量化方式所对应的语法结构进行描述。Perform inverse quantization on the fixed-point feature data of all the N channels of the current image. When the inverse quantization methods are different, the syntax structures thereof are also different, and the syntax structures corresponding to the different inverse quantization methods are described below.
在一些实施例中,若对所有通道进行反量化的方式为线性均匀反量化,其语法结构如表2所示:In some embodiments, if the method of performing inverse quantization on all channels is linear uniform inverse quantization, its syntax structure is shown in Table 2:
表2Table 2
Figure PCTCN2021078522-appb-000023
Figure PCTCN2021078522-appb-000023
Figure PCTCN2021078522-appb-000024
Figure PCTCN2021078522-appb-000024
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表示每个通道分别反量化,为2时表示每组通道分别量化;此处flag_channel取值为0;flag_channel: used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 0;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;此处flag_iquantization取值为0;flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; here the value of flag_iquantization is 0;
channel_num:用于描述特征数据通道数目为channel_num;channel_num: The number of channels used to describe the feature data is channel_num;
scale_num:用于描述所有通道下特征数据的缩放值为scale_num,可以理解为上述第一目标缩放值;scale_num: The scaling value used to describe the feature data in all channels is scale_num, which can be understood as the above-mentioned first target scaling value;
min_num:用于描述所有通道下特征数据的最小值为min_num,可以理解为上述第一目标特征值。min_num: The minimum value used to describe the feature data under all channels is min_num, which can be understood as the above-mentioned first target feature value.
在一些实施例中,若对所有通道进行反量化的方式为非线性对数函数反量化,其语法结构为表3所示:In some embodiments, if the method of performing inverse quantization on all channels is nonlinear logarithmic function inverse quantization, its syntax structure is shown in Table 3:
表3table 3
Figure PCTCN2021078522-appb-000025
Figure PCTCN2021078522-appb-000025
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表示每个通道分别反量化,为2时表示每组通道分别量化;此处flag_channel取值为0;flag_channel: used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 0;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;此处flag_iquantization取值为1;flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 1;
channel_num:用于描述特征数据通道数目为channel_num;channel_num: The number of channels used to describe the feature data is channel_num;
scale_num:用于描述所有通道下特征数据的缩放值为scale_num,可以理解为上述第一目标缩放值;scale_num: The scaling value used to describe the feature data in all channels is scale_num, which can be understood as the above-mentioned first target scaling value;
min_num:用于描述所有通道下特征数据的最小值为min_num,可以理解为上述第一目标特征值;min_num: the minimum value used to describe the feature data under all channels is min_num, which can be understood as the above-mentioned first target feature value;
log_base:用于描述对数反量化时所采用的底数为log_base,可以理解为上述第一对数底数。log_base: The base used to describe the logarithmic inverse quantization is log_base, which can be understood as the first logarithmic base above.
在一些实施例中,若对所有通道进行反量化的方式为非线性对数函数反量化,其语法结构如表4所示:In some embodiments, if the method of performing inverse quantization on all channels is nonlinear logarithmic function inverse quantization, its syntax structure is shown in Table 4:
表4Table 4
Figure PCTCN2021078522-appb-000026
Figure PCTCN2021078522-appb-000026
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表示每个通道分别反量化,为2时表示每组通道分别量化;此处flag_channel取值为0;flag_channel: used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 0;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;此处flag_iquantization取值为2。flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 2.
channel_num:用于描述特征数据通道数目为channel_num;channel_num: The number of channels used to describe the feature data is channel_num;
scale_num:用于描述所有通道下特征数据的缩放值为scale_num,可以理解为上述第一目标缩放值;scale_num: The scaling value used to describe the feature data in all channels is scale_num, which can be understood as the above-mentioned first target scaling value;
min_num:用于描述所有通道下特征数据的最小值为min_num,可以理解为上述第一目标特征值;min_num: the minimum value used to describe the feature data under all channels is min_num, which can be understood as the above-mentioned first target feature value;
e_base:用于描述指数反量化时所用指数函数的底数为e_base,可以理解为上述第一指数底数。e_base: The base of the exponential function used to describe the exponential inverse quantization is e_base, which can be understood as the base of the first exponent.
在一些实施例中,若对所有通道进行反量化的方式为查表反量化,其中查表反量化包括直方图均衡反量化。查表反量化的语法结构如表5所示:In some embodiments, if the way of performing inverse quantization on all channels is table lookup inverse quantization, wherein table lookup inverse quantization includes histogram equalization inverse quantization. The grammatical structure of look-up table inverse quantization is shown in Table 5:
表5table 5
Figure PCTCN2021078522-appb-000027
Figure PCTCN2021078522-appb-000027
Figure PCTCN2021078522-appb-000028
Figure PCTCN2021078522-appb-000028
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表示每个通道分别反量化,为2时表示每组通道分别量化;此处flag_channel取值为0;flag_channel: used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 0;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;此处flag_iquantization为3;flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; here flag_iquantization is 3;
channel_num:用于描述特征数据通道数目为channel_num;channel_num: The number of channels used to describe the feature data is channel_num;
hist_codebook_num:用于描述量化区间的索引值与量化区间的反量化值之间的第一对应关系所构成的重建码本中包含的反量化值个数hist_codebook_num;hist_codebook_num: the number of inverse quantization values hist_codebook_num included in the reconstructed codebook formed by the first correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval;
hist_codebook:用于描述查表反量化下重建码本中第i个量化区间索引对应的反量化值。hist_codebook: used to describe the inverse quantization value corresponding to the i-th quantization interval index in the reconstructed codebook under table lookup inverse quantization.
情况2,第一信息指示对N个通道中每个通道的定点数类型的特征数据分别进行反量化,针对每个通道,根据反量化方式的不同,则第一信息包括的内容如下示例一、示例二、示例三或示例四所示的任意一种:In case 2, the first information indicates that inverse quantization is performed on the characteristic data of the fixed-point number type of each channel in the N channels. For each channel, according to the different inverse quantization methods, the content included in the first information is as follows: Example 1. Any of the examples shown in Example 2, Example 3 or Example 4:
示例一,若对该通道的定点数类型的特征数据进行反量化的反量化方式为线性均匀反量化方式,则第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽。Example 1, if the inverse quantization method for inverse quantization of the characteristic data of the fixed-point type of the channel is a linear uniform inverse quantization method, then the first information includes the second target eigenvalue, the second target scaling value and the second target quantization bit. width.
其中,第二目标特征值为该通道的特征数据中的一个特征值,例如第二目标特征值为该通道的特征数据最小值。Wherein, the second target feature value is a feature value in the feature data of the channel, for example, the second target feature value is the minimum value of the feature data of the channel.
其中,第二目标缩放值为该通道的特征数据在量化时对应的缩放值,第二目标量化位宽为该通道的特征数据在量化时对应的量化位宽。The second target scaling value is the scaling value corresponding to the feature data of the channel during quantization, and the second target quantization bit width is the quantization bit width corresponding to the feature data of the channel during quantization.
下面结合编码端的编码方式,对第二目标缩放值的确定过程进行介绍。The following describes the process of determining the second target scaling value in combination with the encoding mode of the encoding end.
在一种示例中,若编码端对该通道进行量化的方式为线性均匀量化方式,则编码端可以根据该通道的特征数据中的第三特征值和第四特征值,以及第二目标量化位宽确定第二目标缩放值确定第二目标缩放值。In an example, if the encoding end quantizes the channel in a linear uniform quantization mode, the encoding end can use the third eigenvalue and the fourth eigenvalue in the feature data of the channel and the second target quantization bit according to the The width determines the second target scaling value determines the second target scaling value.
可选的,可以根据如下公式(22)确定第二目标缩放值s c2Optionally, the second target scaling value s c2 may be determined according to the following formula (22):
Figure PCTCN2021078522-appb-000029
Figure PCTCN2021078522-appb-000029
其中,x cmax2和x cmin2分别为该通道的特征数据中的第三特征值和第二特征值。第二目标量化位宽2bitdepth可以为上述公式(7)中的第四量化位宽bitdepth4。 Wherein, x cmax2 and x cmin2 are the third eigenvalue and the second eigenvalue in the feature data of the channel, respectively. The second target quantization bit width 2bitdepth may be the fourth quantization bit width bitdepth4 in the above formula (7).
需要说明是,上述公式(21)只是一种示例,本申请确定第二目标缩放值s c2的公式还包括对上述公式(21)进行变形,或者,对上述公式(21)中相加、相乘或相除某一个或多个系数等。 It should be noted that the above formula (21) is only an example, and the formula for determining the second target scaling value s c2 in the present application also includes the modification of the above formula (21), or the addition and addition of the above formula (21). Multiply or divide one or more coefficients, etc.
在一另种示例中,若编码端对该通道进行量化的方式为非线性对数均匀量化方式,则编码端可以根据该通道的特征数据中的第二特征值和第二特征值,以及第二目标量化位宽和对数函数的第二底数确定第二目标缩放值。In another example, if the way that the encoding end quantizes the channel is a non-linear logarithmic uniform quantization method, the encoding end can use the second eigenvalue and the second eigenvalue in the feature data of the channel, and the first eigenvalue. The second target scaling value is determined by the two target quantization bit widths and the second base of the logarithmic function.
可选的,可以根据如下公式(23)确定第二目标缩放值s c2Optionally, the second target scaling value s c2 may be determined according to the following formula (23):
Figure PCTCN2021078522-appb-000030
Figure PCTCN2021078522-appb-000030
其中,log log_base2为对数函数的第二底数,第二目标量化位宽可以为上述公式(9)中的第五量化位宽。 Wherein, log log_base2 is the second base of the logarithmic function, and the second target quantization bit width may be the fifth quantization bit width in the above formula (9).
需要说明是,上述公式(23)只是一种示例,本申请确定第二目标缩放值s 2的公式还包括对上述公式(23)进行变形,或者,对上述公式(23)中相加、相乘或相除某一个或多个系数等。 It should be noted that the above formula (23) is only an example, and the formula for determining the second target scaling value s 2 in the present application also includes the modification of the above formula (23), or the addition and addition of the above formula (23). Multiply or divide one or more coefficients, etc.
在一另种示例中,若编码端对该通道进行量化的方式为非线性指数均匀量化方式,则编码端可以根据该通道的特征数据中的第三特征值和第四特征值,以及第二目标量化位宽和指数函数的第二底数确定第二目标缩放值。In another example, if the encoding end quantizes the channel in a non-linear exponential uniform quantization mode, the encoding end can use the third eigenvalue and the fourth eigenvalue in the feature data of the channel, and the second eigenvalue. The target quantization bit width and the second base of the exponential function determine a second target scaling value.
可选的,可以根据如下公式(24)确定第二目标缩放值s c2Optionally, the second target scaling value s c2 may be determined according to the following formula (24):
Figure PCTCN2021078522-appb-000031
Figure PCTCN2021078522-appb-000031
其中,e_base2为指数函数的第二底数,第二目标量化位宽可以为上述公式(11)中的第六量化位宽bitdepth6。Wherein, e_base2 is the second base of the exponential function, and the second target quantization bit width may be the sixth quantization bit width bitdepth6 in the above formula (11).
需要说明是,上述公式(24)只是一种示例,本申请确定第二目标缩放值s c2的公式还包括对上述公式(24)进行变形,或者,对上述公式(24)中相加、相乘或相除某一个或多个系数等。 It should be noted that the above formula (24) is only an example, and the formula for determining the second target scaling value s c2 in the present application also includes the modification of the above formula (24), or the addition and addition of the above formula (24). Multiply or divide one or more coefficients, etc.
这样,解码端可以从码流中解析出第一信息,并根据第一信息包括的第二目标特征值、第二目标缩放值和第二目标量化位宽,使用线性均匀反量化方式对该通道的定点数类型的特征数据进行反量化。In this way, the decoding end can parse the first information from the code stream, and use the linear uniform inverse quantization method for the channel according to the second target eigenvalue, the second target scaling value and the second target quantization bit width included in the first information. The feature data of fixed-point type is inverse quantized.
示例二,若对该通道的定点数类型的特征数据进行反量化的反量化方式为非线性对数均匀反量化方式,此时第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽,或者第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二对数底数,或者第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二对数底数的指示信息。Example 2, if the inverse quantization method for inverse quantization of the characteristic data of the fixed-point type of the channel is a nonlinear logarithmic uniform inverse quantization method, at this time, the first information includes the second target eigenvalue, the second target scaling value and the first target eigenvalue. Two target quantization bit widths, or the first information includes the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base, or the first information includes the second target feature value, the second target scaling value and indication of the second target quantization bit width and the second logarithmic base.
具体的,若第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽,则解码端根据第二目标特征值、第二目标缩放值和第二目标量化位宽和默认的对数底数,使用非线性对数均匀反量化方式对该通道的定点数类型的特征数据进行反量化。Specifically, if the first information includes the second target eigenvalue, the second target scaling value, and the second target quantization bit width, the decoding end uses the sum of the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second target quantization bit width. The default logarithmic base, which uses the nonlinear logarithmic uniform inverse quantization method to dequantize the fixed-point type feature data of this channel.
若第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二对数底数,则解码端直接使用第一信息携带的第二目标特征值、第二目标缩放值和第二目标量化位宽和第二对数底数,使用非线性对数均匀反量化方式对该通道的定点数类型的特征数据进行反量化。If the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second logarithmic base, the decoding end directly uses the second target eigenvalue, the second target scaling carried by the first information value, the second target quantization bit width and the second logarithmic base, and use the non-linear logarithmic uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of the channel.
若第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二对数底数的指示信息,该第二对数底数的指示信息用于指示从预设的多个对数底数中确定第二对数底数。这样,解码端从码流中解析出第一信息,根据第二对数底数的指示信息,从预设的多个对数底数中确定出第二对数底数,进而根据第二目标特征值、第二目标缩放值和第二目标量化位宽和第二对数底数,使用非线性对数均匀反量化方式对该通道的定点数类型的特征数据进行反量化。If the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second logarithmic base indication information, the second logarithmic base indication information is used to indicate the data from the preset multiple The second logarithmic base is determined from the logarithmic bases. In this way, the decoding end parses the first information from the code stream, determines the second logarithmic base from the preset multiple logarithmic bases according to the indication information of the second logarithmic base, and then determines the second logarithmic base according to the second target characteristic value, The second target scaling value, the second target quantization bit width, and the second logarithmic base are used to inversely quantize the fixed-point feature data of the channel by using a non-linear logarithmic uniform inverse quantization method.
示例三,若对该通道的定点数类型的特征数据进行反量化的反量化方式为非线性指数均匀反量化方式,则第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽,或者第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二指数底数,或者第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二指数底数的指示信息。Example 3, if the inverse quantization method for inverse quantization of the characteristic data of the fixed-point type of the channel is the nonlinear exponential uniform inverse quantization method, then the first information includes the second target eigenvalue, the second target scaling value and the second target. The quantization bit width, or the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second exponent base, or the first information includes the second target eigenvalue, the second target scaling value and The indication information of the second target quantization bit width and the second exponent base.
具体的,若第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽,则解码端根据 第二目标特征值、第二目标缩放值和第二目标量化位宽和默认的指数底数,使用非线性指数均匀反量化方式对该通道的定点数类型的特征数据进行反量化。Specifically, if the first information includes the second target eigenvalue, the second target scaling value, and the second target quantization bit width, the decoding end uses the sum of the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second target quantization bit width. The default exponential base, which uses the non-linear exponential uniform inverse quantization method to inverse quantize the fixed-point feature data of this channel.
若第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二指数底数,则解码端直接使用第一信息携带的第二目标特征值、第二目标缩放值和第二目标量化位宽和第二指数底数,使用非线性指数均匀反量化方式对该通道的定点数类型的特征数据进行反量化。If the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second exponent base, the decoding end directly uses the second target eigenvalue and the second target scaling value carried by the first information With the second target quantization bit width and the second exponent base, use the non-linear exponential uniform inverse quantization method to inverse quantize the fixed-point type characteristic data of the channel.
若第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二指数底数的指示信息,该第二指数底数的指示信息用于指示从预设的多个指数底数中确定第二指数底数。这样,解码端从码流中解析出第一信息,根据第二指数底数的指示信息,从预设的多个指数底数中确定出第二指数底数,进而根据第二目标特征值、第二目标缩放值和第二目标量化位宽和第二指数底数,使用非线性指数均匀反量化方式对该通道的定点数类型的特征数据进行反量化。If the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width and the indication information of the second exponent base, the indication information of the second exponent base is used to indicate multiple exponents from preset In the base, the base of the second exponent is determined. In this way, the decoding end parses the first information from the code stream, determines the second exponent base from the preset multiple exponent bases according to the indication information of the second exponent base, and then determines the second exponent base according to the second target eigenvalue, the second target The scaling value, the second target quantization bit width and the second exponent base are inversely quantized using the non-linear exponential uniform inverse quantization method for the fixed-point type feature data of the channel.
示例四,若对该通道的定点数类型的特征数据进行反量化的反量化方式为查表反量化方式,则第一信息包括量化区间的索引值与量化区间的反量化值之间的第二对应关系,该第二对应关系是基于该通道的特征数据的量化前的值和量化后的值确定的。其中,量化区间的索引可以理解为定点化后的特征值,量化区间的反量化值可以理解为量化区间内各特征值的加权均价值,或者为该量化区间的中心位置对应的特征值。量化区间内各特征值的加权平均值也可以称为量化区间的概率分布中心对应的特征值。Example 4, if the inverse quantization method for inverse quantization of the characteristic data of the fixed-point type of the channel is the table look-up inverse quantization method, then the first information includes the second index value between the index value of the quantization interval and the inverse quantization value of the quantization interval. A corresponding relationship, the second corresponding relationship is determined based on the value before quantization and the value after quantization of the characteristic data of the channel. The index of the quantization interval can be understood as a fixed-point eigenvalue, and the inverse quantization value of the quantization interval can be understood as the weighted average value of each eigenvalue in the quantization interval, or the eigenvalue corresponding to the center position of the quantization interval. The weighted average value of each eigenvalue in the quantization interval may also be referred to as the eigenvalue corresponding to the center of the probability distribution of the quantization interval.
在一具体的实施例中,编码端的量化方式与解码端的反量化方式对应,例如,编码端使用线性量化方式对该通道的浮点数类型的特征数据进行量化时,则解码端使用线性反量化方式对该通道的定点数类型的特征数据进行反量化。若解码端使用非线性对数均匀量化方式对该通道的浮点数类型的特征数据进行量化时,则解码端使用非线性对数均匀反量化方式对该通道的定点数类型的特征数据进行反量化。若解码端使用非线性指数均匀量化方式对该通道的浮点数类型的特征数据进行量化时,则解码端使用非线性指数均匀反量化方式对该通道的定点数类型的特征数据进行反量化。若解码端使用查表量化方式对该通道的浮点数类型的特征数据进行量化时,则解码端使用查表反量化方式对该通道的定点数类型的特征数据进行反量化。In a specific embodiment, the quantization method of the encoding end corresponds to the inverse quantization method of the decoding end. For example, when the encoding end uses a linear quantization method to quantize the characteristic data of the floating point type of the channel, the decoding end uses a linear inverse quantization method. Inverse quantization of the fixed-point type feature data of this channel. If the decoding end uses the nonlinear logarithmic uniform quantization method to quantize the feature data of the floating point type of the channel, the decoding end uses the nonlinear logarithmic uniform inverse quantization method to inverse quantize the fixed point type feature data of the channel. . If the decoding end uses the nonlinear exponential uniform quantization method to quantize the characteristic data of the floating point type of the channel, the decoding end uses the nonlinear exponential uniform inverse quantization method to inverse quantize the fixed point type characteristic data of the channel. If the decoding end uses the table lookup quantization method to quantize the floating point type feature data of the channel, the decoding end uses the table lookup inverse quantization method to inverse quantize the fixed point type characteristic data of the channel.
本申请实施例可以采用上述的线性均匀反量化方式、非线性函数反量化方式、查表反量化方式,对当前图像的N个通道中每个通道的浮点数类型的特征数据进行反量化。当反量化方式不同时,其语法结构也不相同,下面对不同的反量化方式所对应的语法结构进行描述。In this embodiment of the present application, the above-mentioned linear uniform inverse quantization method, nonlinear function inverse quantization method, and table look-up inverse quantization method can be used to perform inverse quantization on the floating-point type feature data of each channel of the N channels of the current image. When the inverse quantization methods are different, the syntax structures thereof are also different, and the syntax structures corresponding to the different inverse quantization methods are described below.
在一些实施例中,若反量化方式为线性均匀反量化6,其语法结构如表6所示:In some embodiments, if the inverse quantization method is linear uniform inverse quantization 6, its syntax structure is shown in Table 6:
表6Table 6
Figure PCTCN2021078522-appb-000032
Figure PCTCN2021078522-appb-000032
Figure PCTCN2021078522-appb-000033
Figure PCTCN2021078522-appb-000033
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表示每个通道分别反量化,为2时表示每组通道分别量化;此处flag_channel为1;flag_channel: used to describe the sign bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is dequantized separately. When it is 2, it means that each group of channels is quantized separately; here flag_channel is 1 ;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;此处flag_iquantization为0;flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; here flag_iquantization is 0;
channel_num:用于描述特征数据的通道数为channel_num;channel_num: The number of channels used to describe feature data is channel_num;
scale_num[i]:用于描述第i个通道下特征数据的缩放值为scale_num[i],可以理解为上述第二目标缩放值;scale_num[i]: The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned second target scaling value;
min_num[i]:用于描述第i个通道下特征数据的最小值为min_num[i],可以理解为上述第二目标特征值。min_num[i]: The minimum value used to describe the feature data under the i-th channel is min_num[i], which can be understood as the above-mentioned second target feature value.
在一些实施例中,若反量化方式为非线性对数函数反量化,其语法结构为表7所示:In some embodiments, if the inverse quantization method is nonlinear logarithmic function inverse quantization, its syntax structure is shown in Table 7:
表7Table 7
Figure PCTCN2021078522-appb-000034
Figure PCTCN2021078522-appb-000034
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表示每个通道分别反量化,为2时表示每组通道分别量化;此处flag_channel取值为1;flag_channel: used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 1;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;此处flag_iquantization取值为1;flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 1;
channel_num:用于描述特征数据的通道数为channel_num;channel_num: The number of channels used to describe feature data is channel_num;
scale_num[i]:用于描述第i个通道下特征数据的缩放值为scale_num[i],可以理解为上述第二目标缩放值;scale_num[i]: The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned second target scaling value;
min_num[i]:用于描述第i个通道下特征数据的最小值为min_num[i],可以理解为上述第二目 标特征值。min_num[i]: The minimum value used to describe the feature data under the i-th channel is min_num[i], which can be understood as the above-mentioned second target feature value.
log_base:用于描述对数反量化时所用对数函数的底数log_base,可以理解为上述第二对数底数。log_base: used to describe the base log_base of the logarithmic function used in logarithmic inverse quantization, which can be understood as the second logarithmic base above.
在一些实施例中,若反量化方式为非线性对数函数反量化,其语法结构如表8所示:In some embodiments, if the inverse quantization method is nonlinear logarithmic function inverse quantization, its syntax structure is shown in Table 8:
表8Table 8
Figure PCTCN2021078522-appb-000035
Figure PCTCN2021078522-appb-000035
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表示每个通道分别反量化,为2时表示每组通道分别量化;此处flag_channel取值为1;flag_channel: used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 1;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;此处flag_iquantization取值为2;flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 2;
channel_num:用于描述特征数据的通道数为channel_num;channel_num: The number of channels used to describe feature data is channel_num;
scale_num[i]:用于描述第i个通道下特征数据的缩放值为scale_num[i],可以理解为上述第二目标缩放值;scale_num[i]: The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned second target scaling value;
min_num[i]:用于描述第i个通道下特征数据的最小值为min_num[i],可以理解为上述第二目标特征值。min_num[i]: The minimum value used to describe the feature data under the i-th channel is min_num[i], which can be understood as the above-mentioned second target feature value.
e_base:用于描述对数反量化时所用指数函数的底数为e_base,可以理解为上述第二指数底数。e_base: The base used to describe the exponential function used in logarithmic inverse quantization is e_base, which can be understood as the above-mentioned second exponential base.
在一些实施例中,若反量化方式为查表反量化,可选的,查表反量化包括直方图均衡反量化。查表反量化的语法结构如表9所示:In some embodiments, if the inverse quantization method is table lookup inverse quantization, optionally, the table lookup inverse quantization includes histogram equalization inverse quantization. The grammatical structure of look-up table inverse quantization is shown in Table 9:
表9Table 9
Figure PCTCN2021078522-appb-000036
Figure PCTCN2021078522-appb-000036
Figure PCTCN2021078522-appb-000037
Figure PCTCN2021078522-appb-000037
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表示每个通道分别反量化,为2时表示每组通道分别量化;此处flag_channel取值为1;flag_channel: used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 1;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;此处flag_iquantization取值为3;flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 3;
channel_num:用于描述特征数据的通道数为channel_num;channel_num: The number of channels used to describe feature data is channel_num;
hist_codebook_num[i]:用于描述量化区间的索引值与量化区间的反量化值之间的第二对应关系所构成的重建码本的大小为hist_codebook_num[i];hist_codebook_num[i]: the size of the reconstructed codebook formed by the second correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval is hist_codebook_num[i];
hist_codebook[i][j]:用于描述第j个量化区间的索引在第i个通道对应的重建码本中的反量化值为hist_codebook[i][j]。hist_codebook[i][j]: The inverse quantization value of the index used to describe the jth quantization interval in the reconstructed codebook corresponding to the ith channel is hist_codebook[i][j].
情况3,第一信息指示对M组通道中每一组通道的定点数类型的特征数据分别进行反量化,针对每个组通道,根据反量化方式的不同,则第一信息包括的内容如下示例一、示例二、示例三或示例四所示的任意一种::Case 3, the first information indicates that inverse quantization is performed on the characteristic data of the fixed-point type of each group of channels in the M groups of channels. For each group of channels, according to different inverse quantization methods, the content included in the first information is as follows. 1. Any one of Example 2, Example 3 or Example 4:
示例一,若对该组通道的定点数类型的特征数据进行反量化的反量化方式为线性均匀反量化方式,则第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽。Example 1, if the inverse quantization method for inverse quantization of the characteristic data of the fixed-point type of the set of channels is a linear uniform inverse quantization method, then the first information includes the third target feature value, the third target scaling value and the third target quantization. bit width.
其中,第三目标特征值为该组通道的特征数据中的一个特征值,例如第三目标特征值为该组通道的特征数据最小值。Wherein, the third target feature value is a feature value in the feature data of the group of channels, for example, the third target feature value is the minimum value of the feature data of the group of channels.
其中,第三目标缩放值为该组通道的特征数据在量化时对应的缩放值,第三目标量化位宽为该组通道的特征数据在量化时对应的量化位宽。The third target scaling value is the scaling value corresponding to the feature data of the group of channels during quantization, and the third target quantization bit width is the quantization bit width corresponding to the feature data of the group of channels during quantization.
下面结合编码端的编码方式,对第三目标缩放值的确定过程进行介绍。The following describes the process of determining the third target scaling value in combination with the encoding mode of the encoding end.
在一种示例中,若编码端对该组通道进行量化的方式为线性均匀量化方式,则编码端可以根据该组通道的特征数据中的第五特征值和第六特征值,以及第三目标量化位宽确定第三目标缩放值。In an example, if the encoding end quantizes the group of channels in a linear uniform quantization manner, the encoding end may use the fifth and sixth eigenvalues in the feature data of the group of channels, and the third target The quantization bit width determines the third target scaling value.
可选的,可以根据如下公式(25)确定第三目标缩放值s c3Optionally, the third target scaling value s c3 can be determined according to the following formula (25):
Figure PCTCN2021078522-appb-000038
Figure PCTCN2021078522-appb-000038
其中,x cmax3和x cmin3分别为该组通道的特征数据中的第五特征值和第五特征值。第三目标量化位宽3bitdepth可以为上述公式(13)中的第七量化位宽bitdepth7。 Wherein, x cmax3 and x cmin3 are the fifth eigenvalue and the fifth eigenvalue in the feature data of the group of channels, respectively. The third target quantization bit width 3bitdepth may be the seventh quantization bit width bitdepth7 in the above formula (13).
需要说明是,上述公式(25)只是一种示例,本申请确定第三目标缩放值s c3的公式还包括对上述公式(25)进行变形,或者,对上述公式(25)中相加、相乘或相除某一个或多个系数等。 It should be noted that the above formula (25) is only an example, and the formula for determining the third target scaling value s c3 in the present application also includes the modification of the above formula (25), or the addition and addition of the above formula (25). Multiply or divide one or more coefficients, etc.
在一另种示例中,若编码端对该组通道进行量化的方式为非线性对数均匀量化方式,则编码端可以根据该组通道的特征数据中的第五特征值和第五特征值,以及第三目标量化位宽和对数函数的第三 底数确定第三目标缩放值。In another example, if the way that the encoding end quantizes the group of channels is a non-linear logarithmic uniform quantization method, then the encoding end can, according to the fifth eigenvalue and the fifth eigenvalue in the feature data of the group of channels, and a third target quantization bit width and a third base of the logarithmic function to determine a third target scaling value.
可选的,可以根据如下公式(26)确定第三目标缩放值s c3Optionally, the third target scaling value s c3 may be determined according to the following formula (26):
Figure PCTCN2021078522-appb-000039
Figure PCTCN2021078522-appb-000039
其中,log log_base3为对数函数的第三底数,第三目标量化位宽可以为上述公式(15)中的第八量化位宽。 Wherein, log log_base3 is the third base of the logarithmic function, and the third target quantization bit width may be the eighth quantization bit width in the above formula (15).
需要说明是,上述公式(26)只是一种示例,本申请确定第三目标缩放值s c3的公式还包括对上述公式(26)进行变形,或者,对上述公式(26)中相加、相乘或相除某一个或多个系数等。 It should be noted that the above formula (26) is only an example, and the formula for determining the third target scaling value s c3 in the present application also includes the modification of the above formula (26), or the addition and addition of the above formula (26). Multiply or divide one or more coefficients, etc.
在一另种示例中,若编码端对该组通道进行量化的方式为非线性指数均匀量化方式,则编码端可以根据该组通道的特征数据中的第五特征值和第六特征值,以及第三目标量化位宽和指数函数的第三底数确定。In another example, if the way that the encoding end quantizes the group of channels is a nonlinear exponential uniform quantization method, the encoding end can use the fifth and sixth eigenvalues in the feature data of the group of channels, and The third target quantization bit width and the third base of the exponential function are determined.
可选的,可以根据如下公式(27)确定第三目标缩放值s c3Optionally, the third target scaling value s c3 can be determined according to the following formula (27):
Figure PCTCN2021078522-appb-000040
Figure PCTCN2021078522-appb-000040
其中,e_base3为指数函数的第三底数,第三目标量化位宽可以为上述公式(18)中的第九量化位宽bitdepth9。Wherein, e_base3 is the third base of the exponential function, and the third target quantization bit width may be the ninth quantization bit width bitdepth9 in the above formula (18).
需要说明是,上述公式(27)只是一种示例,本申请确定第三目标缩放值s c3的公式还包括对上述公式(27)进行变形,或者,对上述公式(27)中相加、相乘或相除某一个或多个系数等。 It should be noted that the above formula (27) is only an example, and the formula for determining the third target scaling value s c3 in the present application also includes the modification of the above formula (27), or the addition and addition of the above formula (27). Multiply or divide one or more coefficients, etc.
这样,解码端可以从码流中解析出第一信息,并根据第一信息包括的第三目标特征值、第三目标缩放值和第三目标量化位宽,使用线性均匀反量化方式对该组通道的定点数类型的特征数据进行反量化。In this way, the decoding end can parse out the first information from the code stream, and use the linear uniform inverse quantization method to perform a linear uniform inverse quantization method according to the third target eigenvalue, the third target scaling value and the third target quantization bit width included in the first information. The channel's fixed-point feature data is inversely quantized.
示例二,若对该组通道的定点数类型的特征数据进行反量化的反量化方式为非线性对数均匀反量化方式,此时第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽,或者第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽和第三对数底数,或者第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽和第三对数底数的指示信息。Example 2, if the inverse quantization method for inverse quantization of the characteristic data of the fixed-point type of the set of channels is a nonlinear logarithmic uniform inverse quantization method, at this time, the first information includes the third target eigenvalue, the third target scaling value and the The third target quantization bit width, or the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third logarithmic base, or the first information includes the third target eigenvalue, the third Indication of the target scaling value and the third target quantization bit width and the third log base.
具体的,若第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽,则解码端根据第三目标特征值、第三目标缩放值和第三目标量化位宽和默认的对数底数,使用非线性对数均匀反量化方式对该组通道的定点数类型的特征数据进行反量化。Specifically, if the first information includes the third target eigenvalue, the third target scaling value, and the third target quantization bit width, the decoding end uses the third target eigenvalue, the third target scaling value, the third target quantization bit width and the sum The default logarithmic base, which uses the nonlinear logarithmic uniform inverse quantization method to dequantize the fixed-point type feature data of this group of channels.
若第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽和第三对数底数,则解码端直接使用第一信息携带的第三目标特征值、第三目标缩放值和第三目标量化位宽和第三对数底数,使用非线性对数均匀反量化方式对该组通道的定点数类型的特征数据进行反量化。If the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third logarithmic base, the decoding end directly uses the third target eigenvalue, the third target scaling carried by the first information value, the third target quantization bit width and the third logarithmic base, and use the non-linear logarithmic uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of the group of channels.
若第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽和第三对数底数的指示信息,该第三对数底数的指示信息用于指示从预设的多个对数底数中确定第三对数底数。这样,解码端从码流中解析出第一信息,根据第三对数底数的指示信息,从预设的多个对数底数中确定出第三对数底数,进而根据第三目标特征值、第三目标缩放值和第三目标量化位宽和第三对数底数,使用非线性对数均匀反量化方式对该组通道的定点数类型的特征数据进行反量化。If the first information includes the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base indication information, the third logarithmic base indication information is used to indicate that the The third logarithmic base is determined from the logarithmic bases. In this way, the decoding end parses the first information from the code stream, determines the third logarithmic base from the preset multiple logarithmic bases according to the indication information of the third logarithmic base, and then determines the third logarithmic base according to the third target eigenvalue, The third target scaling value, the third target quantization bit width, and the third logarithmic base are used to inversely quantize the fixed-point feature data of the group of channels by using a non-linear logarithmic uniform inverse quantization method.
示例三,若对该组通道的定点数类型的特征数据进行反量化的反量化方式为非线性指数均匀反量化方式,则第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽,或者第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽和第三指数底数,或者第一信息包括第三目标 特征值、第三目标缩放值和第三目标量化位宽和第三指数底数的指示信息。Example 3, if the inverse quantization method for inverse quantization of the fixed-point type characteristic data of the group of channels is a nonlinear exponential uniform inverse quantization method, the first information includes the third target eigenvalue, the third target scaling value and the third target eigenvalue. The target quantization bit width, or the first information includes the third target feature value, the third target scaling value, the third target quantization bit width and the third exponent base, or the first information includes the third target feature value, the third target scaling value and the indication information of the third target quantization bit width and the third exponent base.
具体的,若第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽,则解码端根据第三目标特征值、第三目标缩放值和第三目标量化位宽和默认的指数底数,使用非线性指数均匀反量化方式对该组通道的定点数类型的特征数据进行反量化。Specifically, if the first information includes the third target eigenvalue, the third target scaling value, and the third target quantization bit width, the decoding end uses the third target eigenvalue, the third target scaling value, the third target quantization bit width and the sum The default exponential base, which uses the nonlinear exponential uniform inverse quantization method to inverse quantize the fixed-point feature data of this group of channels.
若第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽和第三指数底数,则解码端直接使用第一信息携带的第三目标特征值、第三目标缩放值和第三目标量化位宽和第三指数底数,使用非线性指数均匀反量化方式对该组通道的定点数类型的特征数据进行反量化。If the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third exponent base, the decoding end directly uses the third target eigenvalue and the third target scaling value carried by the first information and the third target quantization bit width and the third exponent base, and use the non-linear exponential uniform inverse quantization method to inverse quantize the fixed-point type characteristic data of the group of channels.
若第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽和第三指数底数的指示信息,该第三指数底数的指示信息用于指示从预设的多个指数底数中确定第三指数底数。这样,解码端从码流中解析出第一信息,根据第三指数底数的指示信息,从预设的多个指数底数中确定出第三指数底数,进而根据第三目标特征值、第三目标缩放值和第三目标量化位宽和第三指数底数,使用非线性指数均匀反量化方式对该组通道的定点数类型的特征数据进行反量化。If the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width and the indication information of the third exponent base, the indication information of the third exponent base is used to indicate multiple exponents from preset The base of the third exponent is determined in the base. In this way, the decoding end parses the first information from the code stream, determines the third exponent base from the preset multiple exponent bases according to the indication information of the third exponent base, and then determines the third exponent base according to the third target eigenvalue, the third target The scaling value, the third target quantization bit width and the third exponent base are used to inversely quantize the fixed-point type feature data of the group of channels by using a non-linear exponential uniform inverse quantization method.
示例四,若对该组通道的定点数类型的特征数据进行反量化的反量化方式为查表反量化方式,则第一信息包括量化区间的索引值与量化区间的反量化值之间的第三对应关系,该第三对应关系是基于该组通道的特征数据的量化前的值和量化后的值确定的。其中,量化区间的索引可以理解为定点化后的特征值,量化区间的反量化值可以理解为量化区间内各特征值的加权均价值,或者为该量化区间的中心位置对应的特征值。量化区间内各特征值的加权平均值也可以称为量化区间的概率分布中心对应的特征值。Example 4, if the inverse quantization method for inverse quantization of the characteristic data of the fixed-point type of the group of channels is the table look-up inverse quantization method, then the first information includes the index value of the quantization interval and the inverse quantization value of the quantization interval. Three correspondences, where the third correspondence is determined based on the pre-quantization value and the post-quantization value of the characteristic data of the group of channels. The index of the quantization interval can be understood as a fixed-point eigenvalue, and the inverse quantization value of the quantization interval can be understood as the weighted average value of each eigenvalue in the quantization interval, or the eigenvalue corresponding to the center position of the quantization interval. The weighted average value of each eigenvalue in the quantization interval may also be referred to as the eigenvalue corresponding to the center of the probability distribution of the quantization interval.
在一具体的实施例中,编码端的量化方式与解码端的反量化方式对应,例如,编码端使用线性量化方式对该组通道的浮点数类型的特征数据进行量化时,则解码端使用线性反量化方式对该组通道的定点数类型的特征数据进行反量化。若解码端使用非线性对数均匀量化方式对该组通道的浮点数类型的特征数据进行量化时,则解码端使用非线性对数均匀反量化方式对该组通道的定点数类型的特征数据进行反量化。若解码端使用非线性指数均匀量化方式对该组通道的浮点数类型的特征数据进行量化时,则解码端使用非线性指数均匀反量化方式对该组通道的定点数类型的特征数据进行反量化。若解码端使用查表量化方式对该组通道的浮点数类型的特征数据进行量化时,则解码端使用查表反量化方式对该组通道的定点数类型的特征数据进行反量化。In a specific embodiment, the quantization method of the encoding end corresponds to the inverse quantization method of the decoding end. For example, when the encoding end uses a linear quantization method to quantize the characteristic data of the floating point type of the group of channels, the decoding end uses linear inverse quantization. way to inverse quantize the fixed-point feature data of the group of channels. If the decoding end uses the nonlinear logarithmic uniform quantization method to quantize the floating-point type feature data of the group of channels, the decoding end uses the nonlinear logarithmic uniform inverse quantization method to quantize the fixed-point number type feature data of the group of channels. Inverse quantization. If the decoding end uses the nonlinear exponential uniform quantization method to quantize the floating-point type feature data of the group of channels, the decoding end uses the nonlinear exponential uniform inverse quantization method to inverse quantize the fixed-point type feature data of the group of channels. . If the decoding end uses the table lookup quantization method to quantize the floating point type feature data of the group of channels, the decoding end uses the table lookup inverse quantization method to inverse quantize the fixed point type characteristic data of the group channel.
本申请实施例可以采用上述的线性均匀反量化方式、非线性函数反量化方式、查表反量化方式,对当前图像的N个通道中每个通道的浮点数类型的特征数据进行反量化。当反量化方式不同时,其语法结构也不相同,下面对不同的反量化方式所对应的语法结构进行描述。In this embodiment of the present application, the above-mentioned linear uniform inverse quantization method, nonlinear function inverse quantization method, and table look-up inverse quantization method can be used to perform inverse quantization on the floating-point type feature data of each channel of the N channels of the current image. When the inverse quantization methods are different, the syntax structures thereof are also different, and the syntax structures corresponding to the different inverse quantization methods are described below.
在一些实施例中,若反量化方式为线性均匀反量化,其语法结构如表10所示:In some embodiments, if the inverse quantization method is linear uniform inverse quantization, its syntax structure is shown in Table 10:
表10Table 10
Figure PCTCN2021078522-appb-000041
Figure PCTCN2021078522-appb-000041
Figure PCTCN2021078522-appb-000042
Figure PCTCN2021078522-appb-000042
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表示每个通道分别反量化,为2时表示每组通道分别量化;此处flag_channel取值为2;flag_channel: used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 2;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;此处flag_iquantization取值为0;flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; here the value of flag_iquantization is 0;
channel_num:用于描述特征数据的通道数为channel_num;channel_num: The number of channels used to describe feature data is channel_num;
group_num:用于描述特征数据的分组数为group_num;group_num: The number of groups used to describe the feature data is group_num;
group_channel:用于描述特征数据的每组下的通道数为group_channel;group_channel: The number of channels under each group used to describe the feature data is group_channel;
scale_num[i]:用于描述第i个通道下特征数据的缩放值为scale_num[i],可以理解为上述第三目标缩放值;scale_num[i]: The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned third target scaling value;
min_num[i]:用于描述第i个分组下所有通道特征数据的最小值为min_num[i],可以理解为上述第三目标特征值。min_num[i]: The minimum value used to describe the feature data of all channels under the ith group is min_num[i], which can be understood as the third target feature value above.
在一些实施例中,若反量化方式为非线性对数函数反量化,其语法结构为表11所示:In some embodiments, if the inverse quantization method is nonlinear logarithmic function inverse quantization, its syntax structure is shown in Table 11:
表11Table 11
Figure PCTCN2021078522-appb-000043
Figure PCTCN2021078522-appb-000043
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表 示每个通道分别反量化,为2时表示每组通道分别量化;flag_channel: used to describe the sign bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is dequantized separately. When it is 2, it means that each group of channels is quantized separately;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table inverse quantification;
channel_num:用于描述特征数据的通道数为channel_num;channel_num: The number of channels used to describe feature data is channel_num;
group_num:用于描述特征数据的分组数为group_num;group_num: The number of groups used to describe the feature data is group_num;
group_channel:用于描述特征数据的每组下的通道数为group_channel;group_channel: The number of channels under each group used to describe the feature data is group_channel;
scale_num[i]:用于描述第i个通道下特征数据的缩放值为scale_num[i],可以理解为上述第三目标缩放值;scale_num[i]: The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned third target scaling value;
min_num[i]:用于描述第i个分组下所有通道特征数据的最小值为min_num[i],可以理解为上述第三目标特征值;min_num[i]: The minimum value used to describe the feature data of all channels under the ith group is min_num[i], which can be understood as the third target feature value above;
log_base:用于描述对数反量化时所用对数函数的底数log_base,可以理解为上述第三对数底数。log_base: The base log_base used to describe the logarithmic function used in logarithmic inverse quantization, which can be understood as the third logarithmic base above.
在一些实施例中,若反量化方式为非线性指数函数反量化,其语法结构如表12所示:In some embodiments, if the inverse quantization method is nonlinear exponential function inverse quantization, its syntax structure is shown in Table 12:
表12Table 12
Figure PCTCN2021078522-appb-000044
Figure PCTCN2021078522-appb-000044
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表示每个通道分别反量化,为2时表示每组通道分别量化;此处flag_channel取值为2;flag_channel: used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 2;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;此处flag_iquantization取值为2;flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; the value of flag_iquantization here is 2;
channel_num:用于描述特征数据的通道数为channel_num;channel_num: The number of channels used to describe feature data is channel_num;
group_num:用于描述特征数据的分组数为group_num;group_num: The number of groups used to describe the feature data is group_num;
group_channel:用于描述特征数据的每组下的通道数为group_channel;group_channel: The number of channels under each group used to describe the feature data is group_channel;
scale_num[i]:用于描述第i个通道下特征数据的缩放值为scale_num[i],可以理解为上述第三目标缩放值;scale_num[i]: The scaling value used to describe the feature data under the i-th channel is scale_num[i], which can be understood as the above-mentioned third target scaling value;
min_num[i]:用于描述第i个分组下所有通道特征数据的最小值为min_num[i],可以理解为上述第三目标特征值;min_num[i]: The minimum value used to describe the feature data of all channels under the ith group is min_num[i], which can be understood as the third target feature value above;
e_base:用于描述对数量化时所用指数函数的底数为e_base,可以理解为上述第三指数底数。e_base: The base used to describe the exponential function used in logarithmic quantization is e_base, which can be understood as the above-mentioned third exponential base.
在一些实施例中,若反量化方式为查表反量化,其语法结构如表14所示:In some embodiments, if the inverse quantization method is look-up table inverse quantization, its syntax structure is as shown in Table 14:
表14Table 14
Figure PCTCN2021078522-appb-000045
Figure PCTCN2021078522-appb-000045
语法元素可以用不同的高效熵编码方式进行编码,其中语法元素为:Syntax elements can be encoded in different efficient entropy coding methods, where the syntax elements are:
flag_channel:用于描述指示解码端处理对象的符号位,为0时表示全通道统一反量化,为1时表示每个通道分别反量化,为2时表示每组通道分别量化;此处flag_channel取值为2;flag_channel: used to describe the symbol bit indicating the processing object of the decoding end. When it is 0, it means that all channels are uniformly inverse quantized. When it is 1, it means that each channel is inversely quantized. When it is 2, it means that each group of channels is quantized separately; here the value of flag_channel is 2;
flag_iquantization:用于描述指示解码端反量化方法的符号位,为0时表示线性反量化,为1时表示非线性对数反量化,为2时表示非线性指数反量化,为3时表示查表反量化;此处flag_iquantization为3;flag_iquantization: used to describe the sign bit indicating the inverse quantization method at the decoding end. When it is 0, it means linear inverse quantization, when it is 1, it means nonlinear logarithmic inverse quantization, when it is 2, it means nonlinear exponential inverse quantization, and when it is 3, it means lookup table Inverse quantization; here flag_iquantization is 3;
channel_num:用于描述特征数据的通道数为channel_num;channel_num: The number of channels used to describe feature data is channel_num;
group_num:用于描述特征数据的分组数为group_num;group_num: The number of groups used to describe the feature data is group_num;
group_channel:用于描述特征数据的每组下的通道数为group_channel;group_channel: The number of channels under each group used to describe the feature data is group_channel;
hist_codebook[i]:用于描述第i个分组下量化区间的索引值与量化区间的反量化值之间的第三对应关系所构成的重建码本为hist_codebook[i]。hist_codebook[i]: The reconstructed codebook formed by describing the third correspondence between the index value of the quantization interval under the ith group and the inverse quantization value of the quantization interval is hist_codebook[i].
hist_codebook_num[i]:用于描述第i个分组下量化区间的索引值与量化区间的反量化值之间的第三对应关系所构成的重建码本的大小为hist_codebook_num[i];hist_codebook_num[i]: The size of the reconstructed codebook formed by the third correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval under the ith grouping is hist_codebook_num[i];
hist_codebook[i][j]:用于描述第j个量化区间索引在第i个分组对应的重建码本中的反量化值为hist_codebook[i][j]。hist_codebook[i][j]: used to describe the inverse quantization value of the jth quantization interval index in the reconstructed codebook corresponding to the ith group hist_codebook[i][j].
在一些实施例中,解码端使用默认的反量化方式对至少一个通道的定点数类型的特征数据进行反量化。In some embodiments, the decoder uses a default inverse quantization method to perform inverse quantization on the fixed-point type feature data of at least one channel.
上文结合图3至图7对图像编码过程进行描述,基于上述实施例下面对解码端的图像解码过程进行介绍。The image encoding process is described above with reference to FIG. 3 to FIG. 7 , and the image decoding process at the decoding end is described below based on the foregoing embodiment.
解码端执行图像解码过程的可以为图2所示的解码器。The decoder that performs the image decoding process at the decoding end may be the decoder shown in FIG. 2 .
图7为本申请实施例提供的图像解码方法700的流程示意图,如图7所示,包括:FIG. 7 is a schematic flowchart of an image decoding method 700 provided by an embodiment of the present application, as shown in FIG. 7 , including:
S701、解码码流,得到当前图像的特征数据,其中当前图像的特征数据包括N个通道的特征数据,所述N为正整数;S701, decoding the code stream to obtain feature data of the current image, wherein the feature data of the current image includes the feature data of N channels, and the N is a positive integer;
S702、解码码流,得到第一信息,该第一信息用于指示对N个通道中的至少一个通道的特征数据进行反量化;S702. Decode the code stream to obtain first information, where the first information is used to instruct inverse quantization of feature data of at least one channel in the N channels;
S703、根据第一信息,对至少一个通道的特征数据进行反量化。S703. Perform inverse quantization on the feature data of at least one channel according to the first information.
由上述可知,编码端在对当前图像的特征数据进行量化时,以特征数据的通道为考量进行量化。因此,在解码端对特征数据进行反量化时,也以通道为考量进行反量化。具体的,解码器解析码流,得到当前图像的N个通道的特征数据,以及第一信息,根据该第一信息对N个通道中至少一个通道的特征数据进行反量化。It can be seen from the above that when the encoding end quantizes the feature data of the current image, the quantization is performed with the channel of the feature data as a consideration. Therefore, when inverse quantization is performed on the feature data at the decoding end, inverse quantization is also performed in consideration of the channel. Specifically, the decoder parses the code stream to obtain characteristic data of N channels of the current image and first information, and inversely quantizes the characteristic data of at least one of the N channels according to the first information.
在一些实施例中,上述S703中根据第一信息,对至少一个通道的特征数据进行反量化,包括:根据所述第一信息,将至少一个通道的定点数类型的特征数据反量化为至少一个通道的浮点数类型的特征数据。In some embodiments, performing inverse quantization on the feature data of at least one channel according to the first information in the above S703 includes: according to the first information, inverse quantizing the feature data of the fixed-point type of at least one channel into at least one channel Characteristic data of the channel's float type.
在一些实施例中,解码器对至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式包括如下任意一种:线性均匀反量化方式、非线性均匀反量化方式或查表反量化方式。其中,非线性均匀反量化方式又包括非线性指数函数反量化和非线性对数函数反量化。需要说明的是,本申请实施例的反量化方式包括但不限于如上几种反量化方式,还可以采用其他的反量化方式对定点数类型的特征数据进行反量化,本申请对反量化方式不做限制。In some embodiments, the inverse quantization method used by the decoder to perform inverse quantization on the fixed-point type feature data of at least one channel includes any one of the following: a linear uniform inverse quantization method, a nonlinear uniform inverse quantization method, or a look-up table inverse quantization. The nonlinear uniform inverse quantization method further includes nonlinear exponential function inverse quantization and nonlinear logarithmic function inverse quantization. It should be noted that the inverse quantization methods in the embodiments of the present application include but are not limited to the above several inverse quantization methods, and other inverse quantization methods can also be used to inverse quantize the characteristic data of fixed-point type. make restrictions.
在一些实施例中,反量化方式是默认的,即解码器根据第一信息,使用默认的反量化方式,对至少一个通道的定点数类型的特征数据进行反量化。In some embodiments, the inverse quantization method is default, that is, the decoder uses the default inverse quantization method to perform inverse quantization on the fixed-point type feature data of at least one channel according to the first information.
在一些实施例中,码流中包括第二信息,该第二信息用于指示对至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式,此时,解码器可以根据第一信息,使用第二信息指示的反量化方式,对至少一个通道的定点数类型的特征数据进行反量化。In some embodiments, the code stream includes second information, where the second information is used to indicate an inverse quantization method used when performing inverse quantization on the fixed-point feature data of at least one channel. In this case, the decoder may The first information uses the inverse quantization mode indicated by the second information to perform inverse quantization on the feature data of the fixed-point type of at least one channel.
在一些实施例中,码流中的第一信息包括对至少一个通道的定点数类型的特征数据进行反量化时所需的至少一个参数。例如,第一信息包括反量化方式所对应的参数。In some embodiments, the first information in the code stream includes at least one parameter required for inverse quantization of the fixed-point type feature data of at least one channel. For example, the first information includes parameters corresponding to the inverse quantization method.
在一些实施例中,上述S703中根据第一信息,对所述N个通道中至少一个通道的定点数类型的特征数据进行反量化的方式包括但不限于如下几种:In some embodiments, according to the first information in the above S703, the manners of performing inverse quantization on the fixed-point type feature data of at least one channel of the N channels include but are not limited to the following:
方式一,若第一信息指示对N个通道中所有通道的定点数类型的特征数据进行反量化,则使用同一种反量化方式对N个通道中所有通道的定点数类型的特征数据进行反量化;Mode 1, if the first information indicates to perform inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels, use the same inverse quantization method to perform inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels ;
方式二,若第一信息指示对N个通道中每个通道的定点数类型的特征数据分别进行反量化,则针对每个通道,使用该通道对应的反量化方式对该通道的定点数类型的特征数据进行反量化;Mode 2, if the first information indicates that inverse quantization is performed on the characteristic data of the fixed-point type of each channel in the N channels, then for each channel, use the inverse quantization method corresponding to the channel to perform the inverse quantization of the fixed-point type of the channel. Inverse quantification of feature data;
方式三,若第一信息指示对M组通道的定点数类型的特征数据分别进行反量化,则将N个通道划分成M组通道,针对每一组通道,使用该组通道对应的反量化方式,对该组通道的定点数类型的特征数据进行反量化。Mode 3: If the first information indicates to perform inverse quantization on the fixed-point type feature data of M groups of channels, the N channels are divided into M groups of channels, and for each group of channels, the inverse quantization method corresponding to the group of channels is used. , perform inverse quantization on the fixed-point feature data of this group of channels.
本申请提供的图像解码方法,通过解码码流,得到当前图像的N个通道的定点数类型的特征数据;解码码流得到第一信息,该第一信息指示对N个通道中至少一个通道的定点数类型的特征数据进行反 量化,这样解码器根据第一信息,对N个通道中至少一个通道的定点数类型的特征数据进行反量化,得到当前图像的浮点数类型的特征数据。本申请通过对神经网络中间层输出的特征数据进度定点化,从而使得可以复用现有的视频及图像编解码标准中的技术对特征数据进行解码,同时使用至少一种反量化方式,对N个通道的定点数类型的特征数据进行反量化,从而提高定点化后的特征数据的解码效率。另外,本申请在解码端的反量化过程中考虑特征数据的通道信息,可以处理不同通道之间的特征数据,进而提高了特征数据的反量化可靠性。The image decoding method provided by the present application obtains fixed-point type feature data of N channels of the current image by decoding the code stream; decodes the code stream to obtain first information, and the first information indicates the data of at least one of the N channels. The fixed-point feature data is inversely quantized, so that the decoder performs inverse quantization on the fixed-point feature data of at least one channel of the N channels according to the first information to obtain floating-point feature data of the current image. In the present application, the feature data output from the intermediate layer of the neural network is fixed-point, so that the technology in the existing video and image coding and decoding standards can be reused to decode the feature data, and at least one inverse quantization method is used at the same time. The fixed-point feature data of each channel is inversely quantized, thereby improving the decoding efficiency of the fixed-point feature data. In addition, the present application considers the channel information of the feature data in the inverse quantization process at the decoding end, and can process the feature data between different channels, thereby improving the reliability of the inverse quantization of the feature data.
下面结合图8,对N个通道中所有通道的定点数类型的特征数据,使用一种量化方式进行反量化的过程进行详细描述。The following describes in detail the process of inverse quantization using a quantization method for the characteristic data of the fixed-point type of all channels in the N channels with reference to FIG. 8 .
图8为本申请实施例提供的图像解码方法800的流程示意图,包括:FIG. 8 is a schematic flowchart of an image decoding method 800 provided by an embodiment of the present application, including:
S801、解码码流,得到第一信息;S801. Decode the code stream to obtain first information;
S802、根据第一信息,使用反量化方式,对N个通道中所有通道的定点数类型的特征数据进行反量化。S802. According to the first information, use an inverse quantization method to perform inverse quantization on the fixed-point type feature data of all channels in the N channels.
针对不同的反量化方式,第一信息所包括的参数可能不同,下面对解码器使用不同的反量化方式,对N个通道中所有通道的定点数类型的特征数据进行反量化的过程进行介绍。For different inverse quantization methods, the parameters included in the first information may be different. The following describes the process of inverse quantization of the fixed-point feature data of all channels in the N channels using different inverse quantization methods for the decoder. .
在一些实施例中,若反量化方式为线性均匀反量化方式,则上述S802包括如下S802-A1和S802-A2:In some embodiments, if the inverse quantization method is a linear uniform inverse quantization method, the above S802 includes the following S802-A1 and S802-A2:
S802-A1、解析第一信息,得到第一目标特征值、第一目标缩放值和第一目标量化位宽;S802-A1, analyzing the first information to obtain the first target feature value, the first target scaling value and the first target quantization bit width;
S802-A2、根据第一目标特征值、第一目标缩放值和第一目标量化位宽,使用线性均匀反量化方式,对N个通道中所有通道的定点数类型的特征数据进行反量化。S802-A2. According to the first target feature value, the first target scaling value and the first target quantization bit width, use a linear uniform inverse quantization method to perform inverse quantization on the fixed-point feature data of all channels in the N channels.
其中,上述第一目标特征值为所述N个通道中所有通道的特征数据中的一个特征值,上述第一目标缩放值为N个通道中所有通道的特征数据在量化时对应的缩放值,上述第一目标量化位宽为N个通道中所有通道的特征数据在量化时对应的量化位宽。Wherein, the above-mentioned first target characteristic value is one characteristic value in the characteristic data of all the channels in the N channels, and the above-mentioned first target scaling value is the corresponding scaling value when the characteristic data of all the channels in the N channels are quantized, The above-mentioned first target quantization bit width is the quantization bit width corresponding to the characteristic data of all channels in the N channels during quantization.
可选的,上述第一目特征值为当前图像的N个通道中所有通道的特征数据中的最小特征值。Optionally, the above-mentioned first objective feature value is the smallest feature value among the feature data of all channels in the N channels of the current image.
在该实施例中,第一信息包括线性均匀反量化方式所需要的第一目标特征值、第一目标缩放值和第一目标量化位宽,这样,解码器可以根据第一信息所携带的第一目标特征值、第一目标缩放值和第一目标量化位宽,使用线性均匀反量化方式,对N个通道中所有通道的定点数类型的特征数据进行反量化。例如,解码器根据第一目标量化位宽判断将几个比特位作为一个反量化值,接着,根据第一目标特征值和第一目标缩放值,使用线性均匀反量化方式对N个通道中所有通道的特征数据进行反量化。In this embodiment, the first information includes the first target eigenvalue, the first target scaling value and the first target quantization bit width required by the linear uniform inverse quantization method. In this way, the decoder can A target eigenvalue, a first target scaling value and a first target quantization bit width are used to inverse quantize the fixed-point feature data of all channels in the N channels by using a linear uniform inverse quantization method. For example, the decoder determines several bits as an inverse quantization value according to the first target quantization bit width, and then, according to the first target eigenvalue and the first target scaling value, uses a linear uniform inverse quantization method to quantify all the N channels. The feature data of the channel is inverse quantized.
例如,解码器根据如下公式(28)对所有通道的定点数类型的特征数据进行反量化:For example, the decoder performs inverse quantization on the fixed-point type feature data of all channels according to the following formula (28):
Figure PCTCN2021078522-appb-000046
Figure PCTCN2021078522-appb-000046
其中,y cij为第c个通道第i行第j列的量化值,s c1为所有通道下特征数据的第一目标缩放值,x1 cmin为所有通道下特征数据的第一目标特征值,x cij为第c个通道第i行第j列的重建值或反量化值。 Among them, y cij is the quantized value of the i-th row and the j-th column of the c-th channel, s c1 is the first target scaling value of the feature data under all channels, x1 cmin is the first target feature value of the feature data under all channels, x cij is the reconstruction value or inverse quantization value of the i-th row and the j-th column of the c-th channel.
依据非线性函数的不同,上述非线性均匀量化方式包括非线性对数均匀反量化方式和非线性指数均匀反量化方式。According to different nonlinear functions, the above-mentioned nonlinear uniform quantization methods include nonlinear logarithmic uniform inverse quantization methods and nonlinear exponential uniform inverse quantization methods.
在一些实施例中,若反量化方式为非线性对数均匀反量化方式,则上述S802包括如下S802-B1 和S802-B2:In some embodiments, if the inverse quantization method is a nonlinear logarithmic uniform inverse quantization method, the above S802 includes the following S802-B1 and S802-B2:
S802-B1、根据第一信息,确定第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数;S802-B1, according to the first information, determine the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base;
S802-B2、根据第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数,使用非线性对数均匀反量化方式对N个通道中所有通道的定点数类型的特征数据进行反量化。S802-B2. According to the first target eigenvalue, the first target scaling value, the first target quantization bit width, and the first logarithmic base, use a nonlinear logarithmic uniform inverse quantization method to quantify the fixed-point type of all channels in the N channels inverse quantization of the feature data.
其中,根据第一信息所包括的参数不同,上述S802-B1根据第一信息,确定第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数的方式包括但不限于如下几种:Wherein, according to the different parameters included in the first information, the above S802-B1 according to the first information determines the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base. Not limited to the following:
方式一,若第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数,则解码器可以直接通过解析第一信息,得到第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数。Mode 1, if the first information includes the first target eigenvalue, the first target scaling value, the first target quantization bit width, and the first logarithmic base, the decoder can directly analyze the first information to obtain the first target eigenvalue. , a first target scaling value and a first target quantization bit width and a first logarithmic base.
方式二,若第一信息包括第一目标特征值、第一目标缩放值、第一目标量化位宽和第一对数底数的指示信息,这样,解码器解析第一信息,得到所述第一目标特征值、第一目标缩放值、第一目标量化位宽和第一对数底数的指示信息;根据第一对数底数的指示信息,从预设的多个对数底数中,确定第一对数底数。Mode 2, if the first information includes the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base indication information, in this way, the decoder parses the first information to obtain the first indication information of the target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base; according to the indication information of the first logarithmic base, from the preset multiple logarithmic bases, determine the first Logarithmic base.
方式三,若第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽,不包括第一对数底数,这样,解码器通过解析第一信息,得到第一目标特征值、第一目标缩放值和第一目标量化位宽,并将默认的对数底数确定为第一对数底数。Mode 3, if the first information includes the first target feature value, the first target scaling value and the first target quantization bit width, but does not include the first logarithmic base, in this way, the decoder obtains the first target feature by parsing the first information value, a first target scaling value, and a first target quantization bit width, and determine the default log base as the first log base.
解码器根据上述方式确定出第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数后,根据第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数,使用非线性对数均匀反量化方式对N个通道中所有通道的定点数类型的特征数据进行反量化。After the decoder determines the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first logarithmic base according to the above method, the first target eigenvalue, the first target scaling value and the first target quantization Bit width and the first logarithmic base, use the nonlinear logarithmic uniform inverse quantization method to dequantize the fixed-point type feature data of all channels in the N channels.
例如,解码器根据如下公式(29)对所有通道的定点数类型的特征数据进行反量化:For example, the decoder performs inverse quantization on the fixed-point type feature data of all channels according to the following formula (29):
Figure PCTCN2021078522-appb-000047
Figure PCTCN2021078522-appb-000047
其中,log_base 1为第一对数底数。 where log_base 1 is the first logarithmic base.
在一些实施例中,若反量化方式为非线性指数均匀反量化方式,则上述S802包括如下S802-C1和S802-C2:In some embodiments, if the inverse quantization method is a nonlinear exponential uniform inverse quantization method, the above S802 includes the following S802-C1 and S802-C2:
S802-C1、根据第一信息,确定第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数;S802-C1, according to the first information, determine the first target feature value, the first target scaling value, the first target quantization bit width and the first exponent base;
S802-C2、根据第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数,使用非线性指数均匀反量化方式,对N个通道中所有通道的定点数类型的特征数据进行反量化。S802-C2. According to the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first exponential base, use a non-linear exponential uniform inverse quantization method to perform a uniform inverse quantization method on the fixed-point number type of all channels in the N channels. The feature data is inverse quantized.
在一些实施例中,根据第一信息所包括的参数不同,上述S802-C1中根据第一信息,确定第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数的方式包括但不限于如下几种:In some embodiments, according to different parameters included in the first information, in S802-C1, the first target feature value, the first target scaling value, the first target quantization bit width and the first exponent base are determined according to the first information. The methods include but are not limited to the following:
方式一,若第一信息包括第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数,则解码器直接解析第一信息,得到第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数。Mode 1: If the first information includes the first target feature value, the first target scaling value, the first target quantization bit width, and the first exponent base, the decoder directly parses the first information to obtain the first target feature value, the first target feature value, and the first index base. A target scaling value, a first target quantization bit width, and a first exponent base.
方式二,若第一信息包括第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数的指示信息,这样解码器解析第一信息,得到第一目标特征值、第一目标缩放值、第一目标量化位宽 和第一指数底数的指示信息;并根据第一指数底数的指示信息,从预设的多个指数底数中,确定第一指数底数。Mode 2, if the first information includes the first target eigenvalue, the first target scaling value, the first target quantization bit width and the indication information of the first exponent base, then the decoder parses the first information to obtain the first target eigenvalue, The indication information of the first target scaling value, the first target quantization bit width and the first exponent base; and according to the indication information of the first exponent base, the first exponent base is determined from a plurality of preset exponent bases.
方式三,若第一信息包括第一目标特征值、第一目标缩放值、第一目标量化位宽,这样解码器解析第一信息,得到第一目标特征值、第一目标缩放值、第一目标量化位宽,并将默认的指数底数确定为第一指数底数。Mode 3: If the first information includes the first target feature value, the first target scaling value, and the first target quantization bit width, the decoder parses the first information to obtain the first target feature value, the first target scaling value, the first target The target quantization bit width, and the default exponent base is determined as the first exponent base.
解码器根据上述方式确定出第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数后,根据第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数,使用非线性指数均匀反量化方式,对N个通道中所有通道的定点数类型的特征数据进行反量化。After the decoder determines the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first exponent base according to the above method, the first target eigenvalue, the first target scaling value, the first target quantization bit The width and the first exponent base are used to inversely quantize the fixed-point feature data of all channels in the N channels by using the nonlinear exponential uniform inverse quantization method.
例如,解码器根据如下公式(30)对所有通道的定点数类型的特征数据进行反量化:For example, the decoder performs inverse quantization on the fixed-point type feature data of all channels according to the following formula (30):
Figure PCTCN2021078522-appb-000048
Figure PCTCN2021078522-appb-000048
其中,e_base 1为第一指数底数。 Among them, e_base 1 is the base of the first exponent.
在一些实施例中,若反量化方式为查表反量化方式,则上述S802包括如下S802-D1至S802-D3:In some embodiments, if the inverse quantization method is a look-up table inverse quantization method, the above S802 includes the following S802-D1 to S802-D3:
S802-D1、确定量化区间的索引值与量化区间的反量化值之间的第一对应关系,该第一对应关系是基于N个通道中所有通道的特征数据的量化前的值和量化后的值确定的;S802-D1. Determine the first correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval, where the first correspondence is based on the value before quantization and the value after quantization of the characteristic data of all channels in the N channels value is determined;
S802-D2、针对N个通道中所有通道的每一个定点数类型的特征数据,将该定点数类型的特征数据的值作为量化区间的索引,在第一对应关系中,查询该定点数类型的特征数据的值对应的目标反量化值;S802-D2. For the characteristic data of each fixed-point number type of all channels in the N channels, use the value of the characteristic data of the fixed-point number type as the index of the quantization interval, and in the first correspondence, query the fixed-point number type of the characteristic data. The target inverse quantization value corresponding to the value of the feature data;
S802-D3、将该目标反量化值,确定为该定点数类型的特征数据的浮点数类型的值。S802-D3: Determine the target inverse quantization value as a floating-point value of the feature data of the fixed-point type.
上述量化区间的索引值与量化区间的反量化值之间的对应关系为默认的;或者,第一信息包括量化区间的索引值与量化区间的反量化值之间的对应关系。The corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval is default; or, the first information includes the corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval.
可选的,量化区间的反量化值为量化区间内中心位置对应的特征值,或者为量化区间内各特征值的加权平均值。量化区间内各特征值的加权平均值也可以称为量化区间的概率分布中心对应的特征值。Optionally, the inverse quantization value of the quantization interval is the eigenvalue corresponding to the center position in the quantization interval, or the weighted average value of each eigenvalue in the quantization interval. The weighted average value of each eigenvalue in the quantization interval may also be referred to as the eigenvalue corresponding to the center of the probability distribution of the quantization interval.
下面结合图9,对当前图像的N个通道中每个通道的定点数类型的特征数据,分别使用一种反量化方式进行反量化的过程进行详细描述。The following describes in detail the process of inverse quantization using an inverse quantization method for the feature data of the fixed-point type of each channel of the N channels of the current image in conjunction with FIG. 9 .
图9为本申请实施例提供的图像解码方法900的流程示意图,包括:FIG. 9 is a schematic flowchart of an image decoding method 900 provided by an embodiment of the present application, including:
S901、针对N个通道中每个通道,解码码流,得到该通道的定点数类型的特征数据;S901, for each channel in the N channels, decode the code stream to obtain characteristic data of the fixed-point type of the channel;
S902、根据第一信息,使用该通道对应的反量化方式,对该通道的定点数类型的特征数据进行反量化。S902. According to the first information, use the inverse quantization mode corresponding to the channel to perform inverse quantization on the feature data of the fixed-point type of the channel.
可选的,反量化方式包括线性均匀反量化、非线性函数反量化、查表反量化。Optionally, the inverse quantization method includes linear uniform inverse quantization, nonlinear function inverse quantization, and look-up table inverse quantization.
在一些实施例中,若反量化方式为线性均匀反量化方式,则上述S902包括如下S902-A1和S902-A2:In some embodiments, if the inverse quantization method is a linear uniform inverse quantization method, the above S902 includes the following S902-A1 and S902-A2:
S902-A1、解析第一信息,得到第二目标特征值、第二目标缩放值和第二目标量化位宽;S902-A1, parse the first information to obtain the second target feature value, the second target scaling value and the second target quantization bit width;
S902-A2、根据第二目标特征值、第二目标缩放值和第二目标量化位宽,使用线性均匀反量化方式,对该通道的定点数类型的特征数据进行反量化。S902-A2. According to the second target feature value, the second target scaling value, and the second target quantization bit width, use a linear uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of the channel.
其中,第二目标特征值为该组通道的特征数据中的一个特征值,第二目标缩放值为该通道的特征 数据在量化时对应的缩放值,第二目标量化位宽为该通道的特征数据在量化时对应的量化位宽。Wherein, the second target feature value is a feature value in the feature data of the group of channels, the second target scaling value is the scaling value corresponding to the feature data of the channel during quantization, and the second target quantization bit width is the feature of the channel The corresponding quantization bit width when the data is quantized.
可选的,第二目标特征值为该通道的特征数据中的最小特征值。Optionally, the second target feature value is the smallest feature value in the feature data of the channel.
在该实施例中,第一信息包括线性均匀反量化方式所需要的第二目标特征值、第二目标缩放值和第二目标量化位宽,这样,解码器可以根据第一信息所携带的第二目标特征值、第二目标缩放值和第二目标量化位宽,使用线性均匀反量化方式,对该通道的定点数类型的特征数据进行反量化。例如,解码器根据第二目标量化位宽判断将几个比特位作为一个反量化值,接着,根据第二目标特征值和第二目标缩放值,使用线性均匀反量化方式对该通道的特征数据进行反量化。In this embodiment, the first information includes the second target eigenvalue, the second target scaling value, and the second target quantization bit width required by the linear uniform inverse quantization method. In this way, the decoder can The second target eigenvalue, the second target scaling value and the second target quantization bit width are inversely quantized using a linear uniform inverse quantization method for the fixed-point type feature data of the channel. For example, the decoder determines several bits as an inverse quantization value according to the second target quantization bit width, and then, according to the second target feature value and the second target scaling value, uses a linear uniform inverse quantization method for the feature data of the channel Do inverse quantization.
例如,根据如下公式(31)对该通道的定点数类型的特征数据进行反量化:For example, according to the following formula (31), inverse quantization is performed on the fixed-point type feature data of the channel:
Figure PCTCN2021078522-appb-000049
Figure PCTCN2021078522-appb-000049
其中,假设当前通道为第c个通道,y cij为第c个通道第i行第j列的量化值,s c2为该通道下特征数据的第二目标缩放值,x2 cmin为该通道下特征数据的第二目标特征值,x cij为第c个通道第i行第j列的重建值。 Among them, it is assumed that the current channel is the c-th channel, y cij is the quantized value of the i-th row and the j-th column of the c-th channel, s c2 is the second target scaling value of the feature data under this channel, and x2 cmin is the feature under this channel. The second target eigenvalue of the data, x cij is the reconstructed value of the i-th row and the j-th column of the c-th channel.
依据非线性函数的不同,上述非线性均匀量化方式包括非线性对数均匀反量化方式和非线性指数均匀反量化方式。According to different nonlinear functions, the above-mentioned nonlinear uniform quantization methods include nonlinear logarithmic uniform inverse quantization methods and nonlinear exponential uniform inverse quantization methods.
在一些实施例中,若反量化方式为非线性对数均匀反量化方式,则上述S902包括如下S902-B1和S902-B1:In some embodiments, if the inverse quantization method is a nonlinear logarithmic uniform inverse quantization method, the above S902 includes the following S902-B1 and S902-B1:
S902-B1、根据第一信息,确定第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数;S902-B1, according to the first information, determine the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base;
S902-B2、根据第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数,使用非线性对数均匀反量化方式,对该通道的定点数类型的特征数据进行反量化。S902-B2. According to the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second logarithmic base, use the non-linear logarithmic uniform inverse quantization method to obtain the fixed-point type feature data of the channel Do inverse quantization.
其中,根据第一信息所包括的参数不同,上述S902-B1根据第一信息,确定第第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数的方式包括但不限于如下几种:Wherein, according to different parameters included in the first information, the above-mentioned S902-B1, according to the first information, determines the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base. But not limited to the following:
方式一,若第一信息包括第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数,则解码器直接解析第一信息,得到第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数。Mode 1, if the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second logarithmic base, the decoder directly parses the first information to obtain the second target eigenvalue, the second target eigenvalue, and the second logarithmic base. Two target scaling values, a second target quantization bit width, and a second log base.
方式二,若第一信息包括第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数的指示信息,则解码器解析第一信息,得到第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数的指示信息;并根据第二对数底数的指示信息,从预设的多个对数底数中,确定第二对数底数。Method 2: If the first information includes the indication information of the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base, the decoder parses the first information to obtain the second target feature value , the second target scaling value, the second target quantization bit width and the indication information of the second logarithmic base; and according to the indication information of the second logarithmic base, from the preset multiple logarithmic bases, determine the second logarithm base.
方式三,若第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽,则解码器解析第一信息,得到第二目标特征值、第二目标缩放值和第二目标量化位宽,并将默认的对数底数确定为第二对数底数。Mode 3: If the first information includes the second target feature value, the second target scaling value and the second target quantization bit width, the decoder parses the first information to obtain the second target feature value, the second target scaling value and the second target scaling value. The target quantization bit width, and determines the default log base as the second log base.
解码器根据上述方式确定出第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数后,根据第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数,使用非线性对数均匀反量化方式对该通道的定点数类型的特征数据进行反量化。After the decoder determines the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second logarithmic base according to the above method, the second target eigenvalue, the second target scaling value, the second target quantization Bit width and second logarithmic base, use the non-linear logarithmic uniform inverse quantization method to dequantize the fixed-point type feature data of this channel.
例如,解码器根据如下公式(32)对所有通道的定点数类型的特征数据进行反量化:For example, the decoder performs inverse quantization on the fixed-point type feature data of all channels according to the following formula (32):
Figure PCTCN2021078522-appb-000050
Figure PCTCN2021078522-appb-000050
其中,log_base 2为第二对数底数。 where log_base 2 is the second logarithmic base.
在一些实施例中,若该通道对应的反量化方式为非线性指数均匀反量化方式,上述S902包括如下S902-C1和S902-C2:In some embodiments, if the inverse quantization method corresponding to the channel is a nonlinear exponential uniform inverse quantization method, the above S902 includes the following S902-C1 and S902-C2:
S902-C1、根据第一信息,确定第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数;S902-C1, according to the first information, determine the second target feature value, the second target scaling value, the second target quantization bit width and the second exponent base;
S902-C2、根据第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数,使用非线性指数均匀反量化方式,对该通道的定点数类型的特征数据进行反量化。S902-C2. According to the second target feature value, the second target scaling value, the second target quantization bit width and the second exponential base, use the nonlinear exponential uniform inverse quantization method to inverse the feature data of the fixed-point type of the channel quantify.
在一些实施例中,根据第一信息所包括的参数不同,上述S902-B1根据第一信息,确定第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数的方式包括但不限于如下几种:In some embodiments, according to different parameters included in the first information, the above S902-B1 determines the second target feature value, the second target scaling value, the second target quantization bit width, and the second exponent base according to the first information. Methods include but are not limited to the following:
方式一,若第一信息包括第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数,则解码器直接解析第一信息,得到第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数。Mode 1, if the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width, and the second exponent base, the decoder directly parses the first information to obtain the second target eigenvalue, the second target eigenvalue, and the second index base. The target scaling value, the second target quantization bit width, and the second exponent base.
方式二,若第一信息包括第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数的指示信息,则解码器解析第一信息,得到第一信息包括第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数的指示信息;并根据第二对数底数的指示信息,从预设的多个指数底数中,确定第二指数底数。Mode 2: If the first information includes the second target feature value, the second target scaling value, the second target quantization bit width, and the second logarithmic base indication information, the decoder parses the first information, and obtains that the first information includes the first information. The indication information of the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base; and according to the indication information of the second logarithmic base, from the preset multiple exponential bases, determine the first Two exponential bases.
方式三,若第一信息包括第二目标特征值、第二目标缩放值、第二目标量化位宽,则解码器解析第一信息,得到第二目标特征值、第二目标缩放值、第二目标量化位宽,并将默认的指数底数确定为第二指数底数。Mode 3: If the first information includes the second target feature value, the second target scaling value, and the second target quantization bit width, the decoder parses the first information to obtain the second target feature value, the second target scaling value, and the second target scaling value. Target quantization bit width, and establishes the default exponent base as the second exponent base.
解码器根据上述方式确定出第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数后,根据第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数,使用非线性指数均匀反量化方式对该通道的定点数类型的特征数据进行反量化。After the decoder determines the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second exponent base according to the above method, according to the second target eigenvalue, the second target scaling value, the second target quantization bit The width and the second exponential base are used to inversely quantize the fixed-point feature data of the channel using the nonlinear exponential uniform inverse quantization method.
例如,解码器根据如下公式(33)对该通道的定点数类型的特征数据进行反量化:For example, the decoder performs inverse quantization on the fixed-point feature data of the channel according to the following formula (33):
Figure PCTCN2021078522-appb-000051
Figure PCTCN2021078522-appb-000051
其中,e_base 2为第二指数底数。 Among them, e_base 2 is the second exponent base.
在一些实施例中,若该通道对应的反量化方式为查表反量化方式,则上述S902包括S902-D1至S902-D3:In some embodiments, if the inverse quantization method corresponding to the channel is a look-up table inverse quantization method, the above S902 includes S902-D1 to S902-D3:
S902-D1、确定量化区间的索引值与量化区间的反量化值之间的第二对应关系,该第二对应关系是基于该通道的特征数据的量化前的值和量化后的值确定的;S902-D1, determine the second correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval, and the second correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of the channel;
S902-D2、针对该通道中的每一个定点数类型的特征数据,将该定点数类型的特征数据的值作为量化区间的索引,在第二对应关系中,查询该定点数类型的特征数据的值对应的目标反量化值;S902-D2. For each characteristic data of the fixed-point type in the channel, use the value of the characteristic data of the fixed-point type as the index of the quantization interval, and in the second correspondence, query the characteristic data of the fixed-point type. The target inverse quantization value corresponding to the value;
S902-D3、将目标反量化值,确定为该定点数类型的特征数据的浮点数类型的值。S902-D3: Determine the target inverse quantization value as the value of the floating point type of the feature data of the fixed point type.
上述量化区间的索引值与量化区间的反量化值之间的对应关系为默认的;或者,第一信息包括量 化区间的索引值与量化区间的反量化值之间的对应关系。The corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval is default; or, the first information includes the corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval.
可选的,量化区间的反量化值为量化区间内中心位置对应的特征值,或者为量化区间内各特征值的加权平均值。量化区间内各特征值的加权平均值也可以称为量化区间的概率分布中心对应的特征值。Optionally, the inverse quantization value of the quantization interval is the eigenvalue corresponding to the center position in the quantization interval, or the weighted average value of each eigenvalue in the quantization interval. The weighted average value of each eigenvalue in the quantization interval may also be referred to as the eigenvalue corresponding to the center of the probability distribution of the quantization interval.
下面结合图10,对每一组通道的浮点数类型的特征数据,分别使用一种反量化方式进行反量化的过程进行详细描述。In the following, in conjunction with FIG. 10 , the process of inverse quantization using an inverse quantization method is described in detail for the characteristic data of the floating point type of each group of channels.
图10为本申请实施例提供的图像解码方法1000的流程示意图,包括:FIG. 10 is a schematic flowchart of an image decoding method 1000 provided by an embodiment of the present application, including:
S101、针对每一组通道,解码码流,得到该组通道的定点数类型的特征数据;S101, for each group of channels, decode the code stream to obtain characteristic data of the fixed-point type of the group of channels;
S102、根据第一信息,使用该组通道对应的反量化方式,对该组通道的定点数类型的特征数据进行反量化方式。S102. According to the first information, use an inverse quantization method corresponding to the group of channels to perform an inverse quantization method on the characteristic data of the fixed-point number type of the group of channels.
可选的,反量化方式包括线性均匀反量化、非线性函数反量化、查表反量化。Optionally, the inverse quantization method includes linear uniform inverse quantization, nonlinear function inverse quantization, and look-up table inverse quantization.
在一些实施例中,若对该组通道对应的反量化方式为线性均匀反量化方式,上述S102包括如下S102-A1和S102-A2:In some embodiments, if the inverse quantization method corresponding to the group of channels is a linear uniform inverse quantization method, the above S102 includes the following S102-A1 and S102-A2:
S102-A1、解析第一信息,得到第三目标特征值、第三目标缩放值和第三目标量化位宽;S102-A1, analyzing the first information to obtain the third target feature value, the third target scaling value and the third target quantization bit width;
S102-A2、根据第三目标特征值、第三目标缩放值和第三目标量化位宽,使用线性均匀反量化方式,对该组通道的定点数类型的特征数据进行反量化。S102-A2. According to the third target feature value, the third target scaling value, and the third target quantization bit width, use a linear uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of the group of channels.
其中,第三目标特征值为该组通道的特征数据中的一个特征值,第三目标缩放值为该组通道的特征数据在量化时对应的缩放值,第三目标量化位宽为该组通道的特征数据在量化时对应的量化位宽。Among them, the third target feature value is a feature value in the feature data of the group of channels, the third target scaling value is the scaling value corresponding to the feature data of the group of channels during quantization, and the third target quantization bit width is the group of channels. The corresponding quantization bit width of the feature data during quantization.
可选的,第三目标特征值为该组通道的特征数据中的最小特征值。Optionally, the third target feature value is the smallest feature value in the feature data of the group of channels.
在该实施例中,第一信息包括线性均匀反量化方式所需要的第三目标特征值、第三目标缩放值和第三目标量化位宽,这样,解码器可以根据第一信息所携带的第三目标特征值、第三目标缩放值和第三目标量化位宽,使用线性均匀反量化方式,对该组通道的定点数类型的特征数据进行反量化。例如,解码器根据第三目标量化位宽判断将几个比特位作为一个反量化值,接着,根据第三目标特征值和第三目标缩放值,使用线性均匀反量化方式对该组通道的特征数据进行反量化。In this embodiment, the first information includes the third target eigenvalue, the third target scaling value, and the third target quantization bit width required by the linear uniform inverse quantization method. In this way, the decoder can The three target eigenvalues, the third target scaling value, and the third target quantization bit width are inversely quantized using a linear uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of the group of channels. For example, the decoder determines several bits as an inverse quantization value according to the third target quantization bit width, and then, according to the third target feature value and the third target scaling value, uses a linear uniform inverse quantization method for the characteristics of the group of channels Data is dequantified.
例如,根据如下公式(34)对该组通道的定点数类型的特征数据进行反量化:For example, according to the following formula (34), inverse quantization is performed on the fixed-point type feature data of this group of channels:
Figure PCTCN2021078522-appb-000052
Figure PCTCN2021078522-appb-000052
其中,第c个通道为当前组通道中一个通道,y cij为第c个通道第i行第j列的量化值,s c3为该组通道下特征数据的第三目标缩放值,x3 cmin为该组通道下特征数据的第三目标特征值,x cij为第c个通道第i行第j列的重建值。 Among them, the c-th channel is a channel in the current group of channels, y cij is the quantized value of the c-th channel in the i-th row and the j-th column, s c3 is the third target scaling value of the feature data under this group of channels, and x3 cmin is The third target eigenvalue of the feature data under this group of channels, x cij is the reconstructed value of the i-th row and the j-th column of the c-th channel.
上述非线性均匀量化方式包括非线性对数均匀反量化方式和非线性指数均匀反量化方式。The above-mentioned nonlinear uniform quantization methods include nonlinear logarithmic uniform inverse quantization methods and nonlinear exponential uniform inverse quantization methods.
在一些实施例中,若对该组通道对应的反量化方式为非线性对数均匀反量化方式,上述S102包括如下S102-B1和S102-B2:In some embodiments, if the inverse quantization method corresponding to the group of channels is a nonlinear logarithmic uniform inverse quantization method, the above S102 includes the following S102-B1 and S102-B2:
S102-B1、根据第一信息,确定第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数;S102-B1, according to the first information, determine the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base;
S102-B2、根据第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数,使用非 线性对数均匀反量化方式,对该组通道的定点数类型的特征数据进行反量化。S102-B2. According to the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third logarithmic base, use the non-linear logarithmic uniform inverse quantization method to obtain the fixed-point type feature of the set of channels Data is dequantified.
在一些实施例中,上述S102-B1中确定第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数的方式包括但不限于如下几种:In some embodiments, the manners of determining the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base in the above S102-B1 include but are not limited to the following:
方式一,若第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数,则解码器直接解析第一信息,得到第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数。Mode 1, if the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width, and the third logarithmic base, the decoder directly parses the first information to obtain the third target eigenvalue, the third target eigenvalue, and the third logarithmic base. Three target scaling values, a third target quantization bit width, and a third log base.
方式二,若第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数的指示信息,则解码器解析第一信息,得到第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数的指示信息;并根据第三对数底数的指示信息,从预设的多个对数底数中,确定第三对数底数;Method 2: If the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third logarithmic base indication information, the decoder parses the first information to obtain the third target eigenvalue , the third target scaling value, the third target quantization bit width and the third logarithmic base; and according to the third logarithmic base instruction information, from the preset multiple logarithmic bases, determine the third logarithm base;
方式三,若第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽,则解码器解析第一信息,得到第三目标特征值、第三目标缩放值和第三目标量化位宽,并将默认的对数底数确定为第三对数底数。Mode 3: If the first information includes the third target eigenvalue, the third target scaling value and the third target quantization bit width, the decoder parses the first information to obtain the third target eigenvalue, the third target scaling value and the third target eigenvalue. The target quantization bit width, and determines the default log base as the third log base.
解码器根据上述方式确定出第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数后,根据第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数,使用非线性对数均匀反量化方式对该组通道的定点数类型的特征数据进行反量化。After the decoder determines the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third logarithmic base according to the above method, the decoder determines the third target eigenvalue, the third target scaling value, the third target quantization The bit width and the third logarithmic base are used to inversely quantize the fixed-point feature data of this group of channels using a non-linear logarithmic uniform inverse quantization method.
例如,根据如下公式(35)对该组通道的定点数类型的特征数据进行反量化:For example, according to the following formula (35), inverse quantization is performed on the fixed-point type feature data of this group of channels:
Figure PCTCN2021078522-appb-000053
Figure PCTCN2021078522-appb-000053
其中,log_base 3为第三对数底数。 where log_base 3 is the third logarithmic base.
在一些实施例中,若该组通道对应的反量化方式为非线性指数均匀反量化方式,上述S102包括如下S102-C1和S102-C2:In some embodiments, if the inverse quantization method corresponding to the group of channels is a nonlinear exponential uniform inverse quantization method, the above S102 includes the following S102-C1 and S102-C2:
S102-C1、根据第一信息,确定第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数;S102-C1, according to the first information, determine the third target feature value, the third target scaling value, the third target quantization bit width and the third exponent base;
S102-C2、根据第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数,使用非线性指数均匀反量化方式,对该组通道的定点数类型的特征数据进行反量化。S102-C2. According to the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third exponent base, use the non-linear exponential uniform inverse quantization method to perform the fixed-point number type feature data on the set of channels. Inverse quantization.
在一些实施例中,上述S102-C1中确定第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数的方式包括但不限于如下几种方式:In some embodiments, the manners of determining the third target feature value, the third target scaling value, the third target quantization bit width, and the third exponent base in S102-C1 include but are not limited to the following manners:
方式一,若第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数,则解码器直接解析第一信息,得到第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数。Mode 1, if the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width, and the third exponent base, the decoder directly parses the first information to obtain the third target eigenvalue, the third target eigenvalue, and the third index base. The target scaling value, the third target quantization bit width, and the third exponent base.
方式二,若第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数的指示信息,则解码器解析第一信息,得到第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数的指示信息;并根据第三对数底数的指示信息,从预设的多个指数底数中,确定第三指数底数;Mode 2: If the first information includes the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base indication information, the decoder parses the first information, and obtains that the first information includes the third target quantization bit width and the third logarithmic base. The indication information of the three target feature values, the third target scaling value, the third target quantization bit width and the third logarithmic base; and according to the indication information of the third logarithmic base, from the preset multiple index bases, determine the three-exponential base;
方式三,若第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽,则解码器解析第一信息,得到第三目标特征值、第三目标缩放值、第三目标量化位宽,并将默认的指数底数确定为 第三指数底数。Mode 3: If the first information includes the third target feature value, the third target scaling value, and the third target quantization bit width, the decoder parses the first information to obtain the third target feature value, the third target scaling value, and the third target scaling value. The target quantization bit width, and determines the default exponent base as the third exponent base.
解码器根据上述方式确定出第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数后,根据第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数,使用非线性指数均匀反量化方式,对该组通道的定点数类型的特征数据进行反量化。After the decoder determines the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third exponent base according to the above method, according to the third target eigenvalue, the third target scaling value, the third target quantization bit The width and the third exponent base are inversely quantized using the non-linear exponential uniform inverse quantization method to perform inverse quantization on the fixed-point type feature data of this group of channels.
例如,根据如下公式(36)对该组通道的定点数类型的特征数据进行反量化:For example, according to the following formula (36), inverse quantization is performed on the fixed-point type feature data of this group of channels:
Figure PCTCN2021078522-appb-000054
Figure PCTCN2021078522-appb-000054
其中,e_base 3为第三指数底数。 Among them, e_base 3 is the third exponent base.
在一些实施例中,若该组通道对应的反量化方式为查表反量化方式,则上述S102包括如下S102-D1至S102-D3:In some embodiments, if the inverse quantization method corresponding to the group of channels is a table look-up inverse quantization method, the above S102 includes the following S102-D1 to S102-D3:
S102-D1、确定量化区间的索引值与量化区间的反量化值之间的第三对应关系,第三对应关系是基于该组通道的特征数据的量化前的值和量化后的值确定的;S102-D1, determine the third correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval, and the third correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of this group of channels;
S102-D2、针对该组通道中的每一个定点数类型的特征数据,将该定点数类型的特征数据的值作为量化区间的索引,在第三对应关系中,查询该定点数类型的特征数据的值对应的目标反量化值;S102-D2. For each feature data of the fixed-point number type in the set of channels, use the value of the feature data of the fixed-point number type as the index of the quantization interval, and in the third correspondence, query the feature data of the fixed-point number type The value of the corresponding target inverse quantization value;
S102-D3、将目标反量化值,确定为该定点数类型的特征数据的浮点数类型的值。S102-D3: Determine the target inverse quantization value as a floating-point value of the feature data of the fixed-point type.
上述量化区间的索引值与量化区间的反量化值之间的对应关系为默认的;或者,第一信息包括量化区间的索引值与量化区间的反量化值之间的对应关系。The corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval is default; or, the first information includes the corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval.
可选的,量化区间的反量化值为量化区间内中心位置对应的特征值,或者为量化区间内各特征值的加权平均值。量化区间内各特征值的加权平均值也可以称为量化区间的概率分布中心对应的特征值。Optionally, the inverse quantization value of the quantization interval is the eigenvalue corresponding to the center position in the quantization interval, or the weighted average value of each eigenvalue in the quantization interval. The weighted average value of each eigenvalue in the quantization interval may also be referred to as the eigenvalue corresponding to the center of the probability distribution of the quantization interval.
应理解,上述图3至图10仅为本申请的示例,不应理解为对本申请的限制。It should be understood that the above-mentioned FIG. 3 to FIG. 10 are only examples of the present application, and should not be construed as a limitation on the present application.
以上结合附图详细描述了本申请的优选实施方式,但是,本申请并不限于上述实施方式中的具体细节,在本申请的技术构思范围内,可以对本申请的技术方案进行多种简单变型,这些简单变型均属于本申请的保护范围。例如,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合,为了避免不必要的重复,本申请对各种可能的组合方式不再另行说明。又例如,本申请的各种不同的实施方式之间也可以进行任意组合,只要其不违背本申请的思想,其同样应当视为本申请所公开的内容。The preferred embodiments of the present application have been described in detail above with reference to the accompanying drawings. However, the present application is not limited to the specific details of the above-mentioned embodiments. Within the scope of the technical concept of the present application, various simple modifications can be made to the technical solutions of the present application. These simple modifications all belong to the protection scope of the present application. For example, the specific technical features described in the above-mentioned specific embodiments can be combined in any suitable manner unless they are inconsistent. In order to avoid unnecessary repetition, this application does not describe any possible combination. State otherwise. For another example, the various embodiments of the present application can also be combined arbitrarily, as long as they do not violate the idea of the present application, they should also be regarded as the content disclosed in the present application.
还应理解,在本申请的各种方法实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。另外,本申请实施例中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。具体地,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should also be understood that, in the various method embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the present application. The implementation of the embodiments constitutes no limitation. In addition, in this embodiment of the present application, the term "and/or" is only an association relationship for describing associated objects, indicating that there may be three kinds of relationships. Specifically, A and/or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character "/" in this document generally indicates that the related objects are an "or" relationship.
上文结合图3至图10,详细描述了本申请的方法实施例,下文结合图14,详细描述本申请的装置实施例。The method embodiments of the present application are described in detail above with reference to FIGS. 3 to 10 , and the apparatus embodiments of the present application are described in detail below with reference to FIG. 14 .
图11是本申请实施例提供的视频编码器10的示意性框图。FIG. 11 is a schematic block diagram of a video encoder 10 provided by an embodiment of the present application.
如图11所示,视频编码器10包括:As shown in Figure 11, the video encoder 10 includes:
获取单元110,用于获取待编码的当前图像;an acquisition unit 110 for acquiring the current image to be encoded;
特征提取单元120,用于将所述当前图像输入神经网络,得到所述当前图像的特征数据,所述当前图像的特征数据包括N个通道的特征数据,所述N为正整数;A feature extraction unit 120, configured to input the current image into a neural network to obtain feature data of the current image, where the feature data of the current image includes feature data of N channels, and N is a positive integer;
量化单元130,用于对所述N个通道中的至少一个通道的特征数据进行量化;a quantization unit 130, configured to quantify the characteristic data of at least one channel in the N channels;
编码单元140,用于对量化后的所述至少一个通道的特征数据进行编码,得到码流,所述码流中包括第一信息,所述第一信息用于指示对所述N个通道中的至少一个通道的特征数据进行反量化。The encoding unit 140 is configured to encode the quantized feature data of the at least one channel to obtain a code stream, where the code stream includes first information, and the first information is used to indicate whether the N channels are to be The feature data of at least one channel is inverse quantized.
在一些实施例中,量化单元130具体用于将所述N个通道中的至少一个通道的浮点数类型的特征数据量化为定点数类型的特征数据。In some embodiments, the quantization unit 130 is specifically configured to quantize the feature data of the floating point type of at least one channel of the N channels into the feature data of the fixed point type.
在一些实施例中,对所述N个通道中至少一个通道的浮点数类型的特征数据进行量化的量化方式包括如下任意一种:线性均匀量化方式、非线性指数均匀量化方式、非线性对数均匀量化方式、查表量化方式。In some embodiments, the quantization method for quantizing the floating-point type feature data of at least one channel of the N channels includes any one of the following: a linear uniform quantization method, a nonlinear exponential uniform quantization method, and a nonlinear logarithmic method. Uniform quantization method, look-up table quantization method.
在一些实施例中,量化单元130具体用于对所述N个通道中所有通道的浮点数类型的特征数据,使用同一种量化方式进行量化;或者,对所述N个通道中每个通道的浮点数类型的特征数据,分别使用一种种量化方式进行量化;或者,对所述N个通道进行分组,对每一组通道的浮点数类型的特征数据,分别使用一种量化方式进行量化。In some embodiments, the quantization unit 130 is specifically configured to use the same quantization method to quantize the floating-point type feature data of all channels in the N channels; The feature data of the floating-point number type is quantized by using different quantization methods respectively; or, the N channels are grouped, and the feature data of the floating-point number type of each group of channels is quantized using a quantization method respectively.
在一些实施例中,若所述量化方式为线性均匀量化方式,量化单元130具体用于获取预设的第一量化位宽,以及所述N个通道中所有通道的浮点数类型的特征数据中的第一特征值和第二特征值;根据所述第一特征值和第二特征值,以及所述第一量化位宽,使用所述线性均匀量化方式,对所述N个通道中每个通道的浮点数类型的特征数据进行量化。In some embodiments, if the quantization method is a linear uniform quantization method, the quantization unit 130 is specifically configured to obtain a preset first quantization bit width, and the floating point type feature data of all channels in the N channels. The first eigenvalue and the second eigenvalue of the The feature data of the channel's floating point type is quantized.
在一些实施例中,若所述量化方式为非线性对数均匀量化方式,量化单元130具体用于获取预设的第二量化位宽和对数函数的第一底数,以及所述N个通道中所有通道的浮点数类型的特征数据中的第一特征值和第二特征值;根据所述第一特征值和第二特征值,以及所述第二量化位宽和所述对数函数的第一底数,使用所述非线性对数均匀量化方式,对所述N个通道中每个通道的浮点数类型的特征数据进行量化。In some embodiments, if the quantization method is a nonlinear logarithmic uniform quantization method, the quantization unit 130 is specifically configured to obtain a preset second quantization bit width and the first base of the logarithmic function, and the N channels The first eigenvalue and the second eigenvalue in the feature data of the floating point type of all channels in the The first base is to use the nonlinear logarithmic uniform quantization method to quantize the floating point type feature data of each of the N channels.
在一些实施例中,若所述量化方式为非线性指数均匀量化方式,量化单元130具体用于获取预设的第三量化位宽和指数函数的第一底数,以及所述N个通道中所有通道的浮点数类型的特征数据中的第一特征值和第二特征值;根据所述第一特征值和第二特征值,以及所述第三量化位宽和所述指数函数的第一底数,使用所述非线性指数均匀量化方式,对所述N个通道中每个通道的浮点数类型的特征数据进行量化。In some embodiments, if the quantization method is a nonlinear exponential uniform quantization method, the quantization unit 130 is specifically configured to obtain a preset third quantization bit width and the first base of the exponential function, as well as all of the N channels. the first eigenvalue and the second eigenvalue in the feature data of the floating point type of the channel; according to the first eigenvalue and the second eigenvalue, the third quantization bit width and the first base of the exponential function , using the nonlinear exponential uniform quantization method to quantize the floating point type feature data of each channel in the N channels.
在一些实施例中,若所述量化方式为查表量化方式,量化单元130具体用对所述N个通道中所有通道的浮点数类型的特征数据,按照取值大小进行排序,得到排序后的第一特征数据;将所述排序后的第一特征数据划分为多个第一量化区间,其中每个第一量化区间包括相同数量的特征数据;针对每个所述第一量化区间,将所述第一量化区间内的特征数据的值量化为所述第一量化区间的索引值。In some embodiments, if the quantization method is a look-up table quantization method, the quantization unit 130 specifically sorts the floating-point type feature data of all channels in the N channels according to the value size, and obtains the sorted first characteristic data; dividing the sorted first characteristic data into a plurality of first quantization intervals, wherein each first quantization interval includes the same amount of characteristic data; for each of the first quantization intervals, all The value of the feature data in the first quantization interval is quantized as an index value of the first quantization interval.
可选的,所述第一特征值为所述N个通道中所有通道的浮点数类型的特征数据中的最小特征值,所述第二特征值为所述N个通道中所有通道的浮点数类型的特征数据中的最大特征值。Optionally, the first eigenvalue is the smallest eigenvalue in the floating-point type feature data of all channels in the N channels, and the second eigenvalue is the floating-point number of all channels in the N channels The largest eigenvalue in the eigendata of type.
在一些实施例中,若所述量化方式为线性均匀量化方式,量化单元130具体用针对所述N个通道中的每个通道,获取预设的第四量化位宽,以及所述通道的浮点数类型的特征数据中的第三特征值和第四特征值;根据所述第三特征值和第四特征值,以及所述第四量化位宽,使用所述线性均匀量化方式,对所述通道的浮点数类型的特征数据进行量化。In some embodiments, if the quantization method is a linear uniform quantization method, the quantization unit 130 specifically obtains a preset fourth quantization bit width for each of the N channels, and the floating value of the channel. The third eigenvalue and the fourth eigenvalue in the feature data of the point type; according to the third eigenvalue and the fourth eigenvalue, and the fourth quantization bit width, using the linear uniform quantization method, the The feature data of the channel's floating point type is quantized.
在一些实施例中,若所述量化方式为非线性对数均匀量化方式,量化单元130具体用针对所述N个通道中的每个通道,获取预设的第五量化位宽和对数函数的第二底数,以及所述通道的浮点数类型的特征数据中的第三特征值和第四特征值;根据所述第三特征值和第四特征值,以及所述第五量化位宽和所述对数函数的第二底数,使用所述非线性对数均匀量化方式,对所述通道的浮点数类型的特征数据进行量化。In some embodiments, if the quantization method is a nonlinear logarithmic uniform quantization method, the quantization unit 130 specifically obtains a preset fifth quantization bit width and a logarithmic function for each channel of the N channels The second base of , and the third eigenvalue and the fourth eigenvalue in the characteristic data of the floating point type of the channel; according to the third and fourth eigenvalues, and the fifth quantization bit width and The second base of the logarithmic function uses the nonlinear logarithmic uniform quantization method to quantize the floating point type feature data of the channel.
在一些实施例中,若所述量化方式为非线性指数均匀量化方式,量化单元130具体用针对所述N个通道中的每个通道,获取预设的第六量化位宽和指数函数的第二底数,以及所述通道的浮点数类型的特征数据中的第三特征值和第四特征值;根据所述第三特征值和第四特征值,以及所述第六量化位宽和所述指数函数的第二底数,使用所述非线性指数均匀量化方式,对所述通道的浮点数类型的特征数据进行量化。In some embodiments, if the quantization method is a non-linear exponential uniform quantization method, the quantization unit 130 specifically obtains the preset sixth quantization bit width and the sixth index of the exponential function for each channel of the N channels. A base-two number, and the third eigenvalue and the fourth eigenvalue in the feature data of the floating point type of the channel; according to the third and fourth eigenvalues, the sixth quantization bit width and the The second base of the exponential function uses the nonlinear exponential uniform quantization method to quantize the floating point type feature data of the channel.
在一些实施例中,若所述量化方式为查表量化方式,量化单元130具体用针对所述N个通道中的每个通道,对所述通道的浮点数类型的特征数据,按照取值大小进行排序,得到所述通道下排序后的第二特征数据;将所述通道下的排序后的第二特征数据划分为多个第二量化区间,其中每个第二量化区间包括相同数量的特征数据;针对每个所述第二量化区间,将所述第二量化区间内的特征数据的值量化为所述第二量化区间的索引值。In some embodiments, if the quantization method is a look-up table quantization method, the quantization unit 130 specifically uses, for each channel in the N channels, the feature data of the floating point type of the channel according to the value size. Perform sorting to obtain the sorted second feature data under the channel; divide the sorted second feature data under the channel into a plurality of second quantization intervals, wherein each second quantization interval includes the same number of features data; for each of the second quantization intervals, the value of the feature data in the second quantization interval is quantized as an index value of the second quantization interval.
可选的,所述第三特征值为该通道的浮点数类型的特征数据中的最大特征值,第四特征值为该通道的浮点数类型的特征数据中的最小特征值。Optionally, the third eigenvalue is the largest eigenvalue in the feature data of the floating point type of the channel, and the fourth eigenvalue is the smallest eigenvalue in the feature data of the floating point type of the channel.
在一些实施例中,若所述量化方式为线性均匀量化方式,量化单元130具体用针对每一组通道,获取预设的第七量化位宽,以及所述组通道的浮点数类型的特征数据中的第五特征值和第六特征值;根据所述第五特征值和第六特征值,以及所述第七量化位宽,使用所述线性均匀量化方式,对所述组通道中的每个通道的浮点数类型的特征数据进行量化。In some embodiments, if the quantization method is a linear uniform quantization method, the quantization unit 130 obtains a preset seventh quantization bit width for each group of channels and the characteristic data of the floating point type of the group of channels. The fifth eigenvalue and the sixth eigenvalue in the Quantize the feature data of the floating point type of each channel.
在一些实施例中,若所述量化方式为非线性对数均匀量化方式,量化单元130具体用针对每一组通道,获取预设的第八量化位宽和对数函数的第三底数,以及所述组通道的浮点数类型的特征数据中的第五特征值和第六特征值;根据所述第五特征值和第六特征值,以及所述第八量化位宽和所述对数函数的第三底数,使用所述非线性对数均匀量化方式,对所述组通道中的每个通道的浮点数类型的特征数据进行量化。In some embodiments, if the quantization method is a non-linear logarithmic uniform quantization method, the quantization unit 130 specifically obtains a preset eighth quantization bit width and the third base of the logarithmic function for each group of channels, and the fifth eigenvalue and the sixth eigenvalue in the feature data of the floating point type of the set of channels; according to the fifth eigenvalue and the sixth eigenvalue, and the eighth quantization bit width and the logarithmic function The third base of , using the nonlinear logarithmic uniform quantization method to quantize the floating point type feature data of each channel in the group of channels.
在一些实施例中,若所述量化方式为非线性指数均匀量化方式,量化单元130具体用针对每一组通道,获取预设的第九量化位宽和指数函数的第三底数,以及所述组通道的浮点数类型的特征数据中的第五特征值和第六特征值;根据所述第五特征值和第六特征值,以及所述第九量化位宽和所述指数函数的第三底数,使用所述非线性对数均匀量化方式,对所述组通道中的每个通道的浮点数类型的特征数据进行量化。In some embodiments, if the quantization method is a nonlinear exponential uniform quantization method, the quantization unit 130 specifically obtains a preset ninth quantization bit width and the third base of the exponential function for each group of channels, and the The fifth eigenvalue and the sixth eigenvalue in the feature data of the floating point type of the group channel; according to the fifth eigenvalue and the sixth eigenvalue, and the ninth quantization bit width and the third eigenvalue of the exponential function Base, using the nonlinear logarithmic uniform quantization method to quantize the floating point type feature data of each channel in the group of channels.
在一些实施例中,若所述量化方式为查表量化方式,量化单元130具体用针对每一组通道,对所述组通道的浮点数类型的特征数据,按照取值大小进行排序,得到所述组通道下排序后的第三特征数据;将所述组通道下排序后的第三特征数据划分为多个第三量化区间,其中每个第三量化区间包括相同数量的特征数据;针对每个所述第三量化区间,将所述第三量化区间内的特征数据的值量化为所述第三量化区间的索引值。In some embodiments, if the quantization method is a look-up table quantization method, the quantization unit 130 specifically uses, for each group of channels, to sort the characteristic data of the floating point type of the group of channels according to the value size, to obtain the The third feature data sorted under the set of channels; the third feature data sorted under the set of channels is divided into a plurality of third quantization intervals, wherein each third quantization interval includes the same amount of feature data; for each each of the third quantization intervals, and quantizing the value of the feature data in the third quantization interval into an index value of the third quantization interval.
可选的,所述第五特征值为所述组通道的浮点数类型的特征数据中的最大特征值,所述第六特征值为所述组通道的浮点数类型的特征数据中的最小特征值。Optionally, the fifth characteristic value is the largest characteristic value in the floating point type characteristic data of the channel group, and the sixth characteristic value is the smallest characteristic value in the floating point type characteristic data of the group channel. value.
在一些实施例中,所述第一信息指示对所述N个通道中所有通道的定点数类型的特征数据进行反量化;或者,所述第一信息指示对所述N个通道中的每个通道的定点数类型的特征数据分别进行反量化;或者,所述第一信息指示对M组通道中的每一组通道的定点数类型的特征数据分别进行反量化,其中所述M组通道为对所述N个通道进行分组得到的,每一组通道包括所述N个通道中的至少一个通道。In some embodiments, the first information indicates inverse quantization of fixed-point type feature data of all of the N channels; alternatively, the first information indicates that each of the N channels is inverse-quantized The feature data of the fixed-point number type of the channel is respectively inverse-quantized; or, the first information indicates that the feature data of the fixed-point number type of each group of channels in the M groups of channels is respectively inverse-quantized, wherein the M groups of channels are Obtained by grouping the N channels, each group of channels includes at least one channel in the N channels.
在一些实施例中,对所述至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式包括如下任意一种:线性均匀反量化方式、非线性指数均匀反量化方式、非线性对数均匀反量化方式、查表反量化方式。In some embodiments, the inverse quantization method used when performing inverse quantization on the feature data of the fixed-point type of the at least one channel includes any one of the following: a linear uniform inverse quantization method, a nonlinear exponential uniform inverse quantization method, a non-linear uniform inverse quantization method, and a non-linear uniform inverse quantization method. Linear logarithmic uniform inverse quantization method, look-up table inverse quantization method.
在一些实施例中,所述第一信息包括对所述至少一个通道的定点数类型的特征数据进行反量化时所需的至少一个参数。In some embodiments, the first information includes at least one parameter required for inverse quantization of the fixed-point type feature data of the at least one channel.
在一些实施例中,所述第一信息指示对所述N个通道中所有通道的定点数类型的特征数据进行反量化,则所述第一信息包括如下任意一种:In some embodiments, the first information indicates that inverse quantization is performed on the fixed-point feature data of all channels in the N channels, and the first information includes any one of the following:
若对所述N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为线性均匀反量化方式,则所述第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽;If the inverse quantization method for performing inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels is a linear uniform inverse quantization method, the first information includes a first target feature value, a first target scaling value and the first target quantization bit width;
若对所述N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为非线性对数均匀反量化方式,则所述第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽,或者所述第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数,或者所述第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数的指示信息;If the inverse quantization method for inverse quantization of the fixed-point type feature data of all channels in the N channels is a nonlinear logarithmic uniform inverse quantization method, the first information includes a first target eigenvalue, a first A target scaling value and a first target quantization bit width, or the first information includes a first target feature value, a first target scaling value, a first target quantization bit width, and a first logarithmic base, or the first information includes Indication information of the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base;
若对所述N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为非线性指数均匀反量化方式,则所述第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽,或者所述第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一指数底数,或者所述第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽和第一指数底数的指示信息;If the inverse quantization method for inverse quantization of the fixed-point type characteristic data of all channels in the N channels is a nonlinear exponential uniform inverse quantization method, the first information includes a first target eigenvalue, a first target The scaling value and the first target quantization bit width, or the first information includes the first target feature value, the first target scaling value, the first target quantization bit width and the first exponent base, or the first information includes the first The indication information of the target feature value, the first target scaling value, the first target quantization bit width and the first exponent base;
若对所述N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为查表反量化方式,则所述第一信息包括量化区间的索引值与量化区间的反量化值之间的第一对应关系,所述第一对应关系是基于所述N个通道中所有通道的特征数据的量化前的值和量化后的值确定的;If the inverse quantization method for performing inverse quantization on the fixed-point type characteristic data of all channels in the N channels is a table look-up inverse quantization method, the first information includes the index value of the quantization interval and the inverse quantization of the quantization interval the first correspondence between the values, the first correspondence is determined based on the pre-quantized value and the quantized value of the characteristic data of all channels in the N channels;
其中,所述第一目标特征值为所述N个通道中所有通道的特征数据中的一个特征值,所述第一目标缩放值为所述N个通道中所有通道的特征数据在量化时对应的缩放值,所述第一目标量化位宽为所述N个通道中所有通道的特征数据在量化时对应的量化位宽。The first target feature value is one feature value in the feature data of all channels in the N channels, and the first target scaling value corresponds to the feature data of all channels in the N channels during quantization The first target quantization bit width is the quantization bit width corresponding to the characteristic data of all channels in the N channels during quantization.
可选的,所述第一目标特征值为所述N个通道中所有通道的特征数据最小值。Optionally, the first target feature value is the minimum value of feature data of all channels in the N channels.
在一些实施例中,所述第一信息指示对所述N个通道中每个通道的定点数类型的特征数据分别进行反量化,针对每一个通道,则所述第一信息包括如下任意一种:In some embodiments, the first information indicates that inverse quantization is performed on the fixed-point type feature data of each channel in the N channels, and for each channel, the first information includes any one of the following :
若对该通道的定点数类型的特征数据进行反量化的反量化方式为线性均匀反量化方式,则所述第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽;If the inverse quantization method for inverse quantization of the fixed-point type feature data of the channel is a linear uniform inverse quantization method, the first information includes the second target feature value, the second target scaling value, and the second target quantization bit width ;
若对该通道的定点数类型的特征数据进行反量化为反量化方式的非线性对数均匀反量化方式,则所述第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽,或者所述第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二对数底数,或者所述第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二对数底数的指示信息;If the feature data of the fixed-point type of the channel is inversely quantized into a non-linear logarithmic uniform inverse quantization method in an inverse quantization manner, the first information includes a second target feature value, a second target scaling value, and a second target The quantization bit width, or the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second logarithmic base, or the first information includes the second target eigenvalue, the first Two target scaling values and the indication information of the second target quantization bit width and the second logarithmic base;
若对该通道的定点数类型的特征数据进行反量化的反量化方式为非线性指数均匀反量化方式,则所述第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽,或者所述第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二指数底数,或者所述第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽和第二指数底数的指示信息;If the inverse quantization method for inverse quantization of the fixed-point type feature data of the channel is a nonlinear exponential uniform inverse quantization method, the first information includes the second target feature value, the second target scaling value, and the second target quantization bit width, or the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second exponent base, or the first information includes the second target eigenvalue, the second target scaling value and indication information of the second target quantization bit width and the second exponent base;
若对该通道的定点数类型的特征数据进行反量化的反量化方式为查表反量化方式,则所述第一信息包括量化区间的索引值与量化区间的反量化值之间的第二对应关系,所述第二对应关系是基于该通道的特征数据的量化前的值和量化后的值确定的;If the inverse quantization method for inverse quantization of the fixed-point type characteristic data of the channel is the table look-up inverse quantization method, the first information includes the second correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval relationship, the second corresponding relationship is determined based on the value before quantization and the value after quantization of the characteristic data of the channel;
其中,所述第二目标特征值为该通道的特征数据中的一个特征值,所述第二目标缩放值为该通道的特征数据在量化时对应的缩放值,所述第二目标量化位宽为该通道的特征数据在量化时对应的量化位宽。Wherein, the second target feature value is a feature value in the feature data of the channel, the second target scaling value is the scaling value corresponding to the feature data of the channel during quantization, and the second target quantization bit width It is the corresponding quantization bit width of the feature data of this channel during quantization.
可选的,所述第二目标特征值为该通道的特征数据最小值。Optionally, the second target feature value is the minimum value of feature data of the channel.
在一些实施例中,所述第一信息指示对M组通道的定点数类型的特征数据分别进行反量化,针对每一组通道,则所述第一信息包括如下任意一种:In some embodiments, the first information indicates that inverse quantization is performed on the fixed-point feature data of M groups of channels, respectively, and for each group of channels, the first information includes any one of the following:
若对该组通道进行反量化为反量化方式为线性均匀反量化方式,则所述第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽;If the inverse quantization is performed on the group of channels so that the inverse quantization method is a linear uniform inverse quantization method, the first information includes the third target eigenvalue, the third target scaling value and the third target quantization bit width;
若对该组通道的定点数类型的特征数据进行反量化的反量化方式为非线性对数均匀反量化方式,则所述第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽,或者所述第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数,或者所述第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数的指示信息;If the inverse quantization method for inverse quantization of the fixed-point type feature data of the group of channels is a nonlinear logarithmic uniform inverse quantization method, the first information includes the third target eigenvalue, the third target scaling value, and the third target scaling value. The target quantization bit width, or the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width, and the third logarithmic base, or the first information includes the third target eigenvalue, Indication information of the third target scaling value, the third target quantization bit width and the third logarithmic base;
若对该组通道的定点数类型的特征数据进行反量化的反量化方式为非线性指数均匀反量化方式,则所述第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽,或者所述第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数,或者所述第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数的指示信息;If the inverse quantization method for inverse quantization of the fixed-point type feature data of the group of channels is a nonlinear exponential uniform inverse quantization method, the first information includes the third target feature value, the third target scaling value, and the third target Quantization bit width, or the first information includes a third target eigenvalue, a third target scaling value, a third target quantization bit width, and a third exponent base, or the first information includes a third target eigenvalue, a third Indication information of the target scaling value, the third target quantization bit width and the third exponent base;
若对该组通道的定点数类型的特征数据进行反量化的反量化方式为查表反量化方式,则所述第一信息包括量化区间的索引值与量化区间的反量化值之间的第三对应关系,所述第三对应关系是基于该组通道的特征数据的量化前的值和量化后的值确定的;If the inverse quantization method for performing inverse quantization on the fixed-point type feature data of the group of channels is the table look-up inverse quantization method, the first information includes the third index value between the index value of the quantization interval and the inverse quantization value of the quantization interval. Correspondence, the third correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of this group of channels;
其中,所述M组通道为对所述N个通道进行分组得到的,每一组通道包括所述N个通道中的至少一个通道,所述第三目标特征值为该组通道的特征数据中的一个特征值,所述第三目标缩放值为该组通道的特征数据在量化时对应的缩放值,所述第三目标量化位宽为该组通道的特征数据在量化时对应的量化位宽。The M groups of channels are obtained by grouping the N channels, each group of channels includes at least one channel in the N channels, and the third target feature value is in the feature data of the group of channels. A characteristic value of , the third target scaling value is the corresponding scaling value of the characteristic data of this group of channels during quantization, and the third target quantization bit width is the corresponding quantization bit width of the characteristic data of this group of channels during quantization .
可选的,所述第三目标特征值为该组通道的特征数据最小值。Optionally, the third target feature value is the minimum value of feature data of the group of channels.
在一些实施例中,所述码流还包括第二信息,所述第二信息用于指示对所述至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式。In some embodiments, the code stream further includes second information, where the second information is used to indicate an inverse quantization method used when performing inverse quantization on the characteristic data of the fixed-point type of the at least one channel.
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图11所示的视频编码器10可以执行本申请实施例的方法,并且视频编码器10中的各个单元的前述和其它操作和/或功能分别为了实现方法300至600等各个方法中的相应流程,为了简洁,在此不再赘述。It should be understood that the apparatus embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, details are not repeated here. Specifically, the video encoder 10 shown in FIG. 11 may execute the methods of the embodiments of the present application, and the aforementioned and other operations and/or functions of the various units in the video encoder 10 are for implementing the methods in the methods 300 to 600, respectively. The corresponding process, for the sake of brevity, will not be repeated here.
图12是本申请实施例提供的视频解码器20的示意性框图。FIG. 12 is a schematic block diagram of a video decoder 20 provided by an embodiment of the present application.
如图12所示,该视频解码器20可包括:As shown in Figure 12, the video decoder 20 may include:
解码单元210,用于解码码流,得到当前图像的特征数据,所述当前图像的特征数据包括N个通道的特征数据,所述N为正整数;a decoding unit 210, configured to decode the code stream to obtain characteristic data of the current image, where the characteristic data of the current image includes characteristic data of N channels, and N is a positive integer;
解码单元210,还用于解码码流,得到第一信息,所述第一信息用于指示对所述N个通道中的至少一个通道的特征数据进行反量化;The decoding unit 210 is further configured to decode the code stream to obtain first information, where the first information is used to instruct to perform inverse quantization on the feature data of at least one channel in the N channels;
反量化单元220,用于根据所述第一信息,对所述至少一个通道的特征数据进行反量化。An inverse quantization unit 220, configured to perform inverse quantization on the feature data of the at least one channel according to the first information.
在一些实施例中,反量化单元220,具体用于所述根据所述第一信息,将所述至少一个通道的定点数类型的特征数据反量化为所述至少一个通道的浮点数类型的特征数据。In some embodiments, the inverse quantization unit 220 is specifically configured to, according to the first information, inverse quantize the feature data of the fixed-point type of the at least one channel into the feature of the floating-point type of the at least one channel data.
在一些实施例中,对所述至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式包括如下任意一种:线性均匀反量化方式、非线性指数均匀反量化方式、非线性对数均匀反量化方式、查表反量化方式。In some embodiments, the inverse quantization method used when performing inverse quantization on the feature data of the fixed-point type of the at least one channel includes any one of the following: a linear uniform inverse quantization method, a nonlinear exponential uniform inverse quantization method, a non-linear uniform inverse quantization method, and a non-linear uniform inverse quantization method. Linear logarithmic uniform inverse quantization method, look-up table inverse quantization method.
在一些实施例中,反量化单元220,具体用于根据所述第一信息,使用默认的反量化方式,对所述至少一个通道的定点数类型的特征数据进行反量化。In some embodiments, the inverse quantization unit 220 is specifically configured to perform inverse quantization on the fixed-point type feature data of the at least one channel by using a default inverse quantization manner according to the first information.
在一些实施例中,所述码流还包括第二信息,所述第二信息用于指示对所述至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式,对应的反量化单元220,具体用于根据所述第一信息,使用所述第二信息指示的反量化方式,对所述至少一个通道的定点数类型的特征数据进行反量化。In some embodiments, the code stream further includes second information, where the second information is used to indicate an inverse quantization method used when performing inverse quantization on the characteristic data of the fixed-point type of the at least one channel, corresponding to The inverse quantization unit 220 is specifically configured to perform inverse quantization on the fixed-point type feature data of the at least one channel by using the inverse quantization manner indicated by the second information according to the first information.
在一些实施例中,所述第一信息包括对所述至少一个通道的定点数类型的特征数据进行反量化时所需的至少一个参数。In some embodiments, the first information includes at least one parameter required for inverse quantization of the fixed-point type feature data of the at least one channel.
在一些实施例中,反量化单元220,具体用于若所述第一信息指示对所述N个通道中所有通道的定点数类型的特征数据进行反量化,则使用同一种反量化方式对所述N个通道中所有通道的定点数类型的特征数据进行反量化;或者,若所述第一信息指示对所述N个通道中每个通道的定点数类型的特征数据分别进行反量化,则针对每个通道,使用该通道对应的反量化方式对该通道的定点数类型的特征数据进行反量化;或者,若所述第一信息指示对M组通道的定点数类型的特征数据分别进行反量化,则将所述N个通道划分成M组通道,针对每一组通道,使用该组通道对应的反量化方式,对该组通道的定点数类型的特征数据进行反量化。In some embodiments, the inverse quantization unit 220 is specifically configured to use the same inverse quantization method to perform inverse quantization on the fixed-point type feature data of all channels in the N channels if the first information indicates to perform inverse quantization. Perform inverse quantization on the feature data of the fixed-point number type of all channels in the N channels; or, if the first information indicates to perform inverse quantization on the feature data of the fixed-point number type of each channel in the N channels, then For each channel, use the inverse quantization method corresponding to the channel to perform inverse quantization on the characteristic data of the fixed-point type of the channel; or, if the first information indicates that the characteristic data of the fixed-point type of the M groups of channels are respectively inversely quantized For quantization, the N channels are divided into M groups of channels, and for each group of channels, the inverse quantization method corresponding to the group of channels is used to inversely quantize the fixed-point type feature data of the group of channels.
在一些实施例中,若对所述N个通道中所有通道的定点数类型的特征数据进行反量化的反量化方式为线性均匀反量化方式,则反量化单元220,具体用于解析所述第一信息,得到第一目标特征值、第一目标缩放值和第一目标量化位宽;根据所述第一目标特征值、第一目标缩放值和第一目标量化位宽,使用线性均匀反量化方式,对所述N个通道中所有通道的定点数类型的特征数据进行反量化。In some embodiments, if the inverse quantization method for performing inverse quantization on the fixed-point type feature data of all channels in the N channels is a linear uniform inverse quantization method, the inverse quantization unit 220 is specifically configured to parse the first A piece of information to obtain the first target feature value, the first target scaling value and the first target quantization bit width; according to the first target feature value, the first target scaling value and the first target quantization bit width, use linear uniform inverse quantization manner, inverse quantization is performed on the feature data of the fixed-point number type of all channels in the N channels.
在一些实施例中,若对所述N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为非线性对数均匀反量化方式,则反量化单元220,具体用于根据所述第一信息,确定第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数;根据所述第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数,使用所述非线性对数均匀反量化方式对所述N个通道中所有通道的定点数类型的特征数据进行反量化。In some embodiments, if the inverse quantization method for performing inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels is a nonlinear logarithmic uniform inverse quantization method, the inverse quantization unit 220 is specifically configured to: According to the first information, determine the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base; according to the first target feature value, the first target scaling value and the first The target quantization bit width and the first logarithmic base are used to perform inverse quantization on the fixed-point feature data of all channels in the N channels by using the nonlinear logarithmic uniform inverse quantization method.
示例性的,反量化单元220,具体用于解析所述第一信息,得到所述第一目标特征值、第一目标 缩放值和第一目标量化位宽和第一对数底数;或者,解析所述第一信息,得到所述第一目标特征值、第一目标缩放值、第一目标量化位宽和第一对数底数的指示信息;根据所述第一对数底数的指示信息,从预设的多个对数底数中,确定所述第一对数底数;或者,解析所述第一信息,得到所述第一目标特征值、第一目标缩放值和第一目标量化位宽,并将默认的对数底数确定为所述第一对数底数。Exemplarily, the inverse quantization unit 220 is specifically configured to parse the first information to obtain the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base; or, parsing For the first information, the indication information of the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base is obtained; according to the indication information of the first logarithmic base, from Among the preset multiple logarithmic bases, the first logarithmic base is determined; or, the first information is analyzed to obtain the first target characteristic value, the first target scaling value and the first target quantization bit width, And the default logarithmic base is determined as the first logarithmic base.
在一些实施例中,若对所述N个通道中所有通道的定点数类型的特征数据进行反量化的反量化方式为非线性指数均匀反量化方式,则反量化单元220,具体用于根据所述第一信息,确定第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数;根据所述第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数,使用所述非线性指数均匀反量化方式,对所述N个通道中所有通道的定点数类型的特征数据进行反量化。In some embodiments, if the inverse quantization method for performing inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels is a nonlinear exponential uniform inverse quantization method, the inverse quantization unit 220 is specifically configured to perform inverse quantization according to the the first information, determine the first target feature value, the first target scaling value, the first target quantization bit width and the first exponent base; according to the first target feature value, the first target scaling value, the first target quantization bit The width and the first exponent base are used to dequantize the fixed-point type feature data of all channels in the N channels by using the nonlinear exponential uniform inverse quantization method.
示例性的,反量化单元220,具体用于解析所述第一信息,得到所述第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数;或者,解析所述第一信息,得到所述第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数的指示信息;根据所述第一指数底数的指示信息,从预设的多个指数底数中,确定所述第一指数底数;或者,解析所述第一信息,得到所述第一目标特征值、第一目标缩放值、第一目标量化位宽,并将默认的指数底数确定为所述第一指数底数。Exemplarily, the inverse quantization unit 220 is specifically configured to parse the first information to obtain the first target feature value, the first target scaling value, the first target quantization bit width, and the first exponent base; The first information is obtained, and the indication information of the first target characteristic value, the first target scaling value, the first target quantization bit width and the first exponent base is obtained; according to the indication information of the first exponent base, from the preset Among multiple exponent bases, determine the first exponent base; or, parse the first information to obtain the first target feature value, the first target scaling value, and the first target quantization bit width, and use the default exponent The base is determined as the first exponent base.
在一些实施例中,所述第一目标特征值为所述N个通道中所有通道的特征数据中的一个特征值,所述第一目标缩放值为所述N个通道中所有通道的特征数据在量化时对应的缩放值,所述第一目标量化位宽为所述N个通道中所有通道的特征数据在量化时对应的量化位宽。In some embodiments, the first target feature value is one feature value in the feature data of all channels in the N channels, and the first target scaling value is the feature data of all channels in the N channels The corresponding scaling value during quantization, and the first target quantization bit width is the quantization bit width corresponding to the feature data of all channels in the N channels during quantization.
可选的,所述第一目标特征值为所述N个通道中所有通道的特征数据中的最小特征值。Optionally, the first target feature value is the smallest feature value in feature data of all channels in the N channels.
在一些实施例中,若对所述N个通道中所有通道的定点数类型的特征数据进行反量化的反量化方式为查表反量化方式,则反量化单元220,具体用于确定量化区间的索引值与量化区间的反量化值之间的第一对应关系,所述第一对应关系是基于所述N个通道中所有通道的特征数据的量化前的值和量化后的值确定的;针对所述N个通道中所有通道的每一个定点数类型的特征数据,将该定点数类型的特征数据的值作为量化区间的索引,在所述第一对应关系中,查询该定点数类型的特征数据的值对应的目标反量化值;将所述目标反量化值,确定为该定点数类型的特征数据的浮点数类型的值。In some embodiments, if the inverse quantization method for performing inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels is a table look-up inverse quantization method, the inverse quantization unit 220 is specifically configured to determine the size of the quantization interval. The first correspondence between the index value and the inverse quantization value of the quantization interval, the first correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of all channels in the N channels; The characteristic data of each fixed-point number type of all channels in the N channels, the value of the characteristic data of the fixed-point number type is used as the index of the quantization interval, and in the first correspondence, the feature of the fixed-point number type is queried. The target inverse quantization value corresponding to the value of the data; the target inverse quantization value is determined as the value of the floating point type of the characteristic data of the fixed point type.
在一些实施例中,若对该通道对应的反量化方式为线性均匀反量化方式,则反量化单元220,具体用于解析所述第一信息,得到第二目标特征值、第二目标缩放值和第二目标量化位宽;根据所述第二目标特征值、第二目标缩放值和第二目标量化位宽,使用所述线性均匀反量化方式,对该通道的定点数类型的特征数据进行反量化。In some embodiments, if the inverse quantization method corresponding to the channel is a linear uniform inverse quantization method, the inverse quantization unit 220 is specifically configured to parse the first information to obtain the second target feature value and the second target scaling value and the second target quantization bit width; according to the second target feature value, the second target scaling value and the second target quantization bit width, using the linear uniform inverse quantization method, the characteristic data of the fixed-point number type of this channel is carried out. Inverse quantization.
在一些实施例中,若对该通道对应的反量化方式为非线性对数均匀反量化方式,则反量化单元220,具体用于根据所述第一信息,确定第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数;根据所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数,使用所述非线性对数均匀反量化方式,对该通道的定点数类型的特征数据进行反量化。In some embodiments, if the inverse quantization method corresponding to the channel is a nonlinear logarithmic uniform inverse quantization method, the inverse quantization unit 220 is specifically configured to determine the second target eigenvalue, the second target eigenvalue, the second a target scaling value, a second target quantization bit width, and a second logarithmic base; using the nonlinear The logarithmic uniform inverse quantization method performs inverse quantization on the fixed-point type feature data of the channel.
示例性的,反量化单元220,具体用于解析所述第一信息,得到所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数;或者,解析所述第一信息,得到所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数的指示信息;根据所述第二对数底数的指示信息,从预设的多个对数底数中,确定所述第二对数底数;或者,解析所述第一信息,得到所述第二目标特征值、第二目标缩放值和第二目标量化位宽,并将默认的对数底数确定为所述第二对数底数。Exemplarily, the inverse quantization unit 220 is specifically configured to parse the first information to obtain the second target feature value, the second target scaling value, the second target quantization bit width, and the second logarithmic base; or, parsing The first information obtains the indication information of the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second logarithmic base; according to the indication information of the second logarithmic base, from Among the preset multiple logarithmic bases, the second logarithmic base is determined; or, the first information is analyzed to obtain the second target characteristic value, the second target scaling value and the second target quantization bit width, And the default logarithmic base is determined as the second logarithmic base.
在一些实施例中,若该通道对应的反量化方式为非线性指数均匀反量化方式,则反量化单元220, 具体用于根据所述第一信息,确定第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数;根据所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数,使用所述非线性指数均匀反量化方式,对该通道的定点数类型的特征数据进行反量化。In some embodiments, if the inverse quantization method corresponding to the channel is a nonlinear exponential uniform inverse quantization method, the inverse quantization unit 220 is specifically configured to determine the second target eigenvalue and the second target scaling according to the first information value, the second target quantization bit width and the second exponent base; according to the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second exponent base, the nonlinear exponent is used for uniform inverse quantization method, inverse quantization is performed on the feature data of the fixed-point type of the channel.
示例性的,反量化单元220,具体用于解析所述第一信息,得到所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数;或者,解析所述第一信息,得到所述第一信息包括所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数的指示信息;根据所述第二对数底数的指示信息,从预设的多个指数底数中,确定所述第二指数底数;或者,解析所述第一信息,得到所述第二目标特征值、第二目标缩放值、第二目标量化位宽,并将默认的指数底数确定为所述第二指数底数。Exemplarily, the inverse quantization unit 220 is specifically configured to parse the first information to obtain the second target feature value, the second target scaling value, the second target quantization bit width and the second exponent base; The first information is obtained, and the first information includes the indication information of the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base; according to the second logarithmic base The indication information of , determine the second exponent base from a plurality of preset exponent bases; or, parse the first information to obtain the second target characteristic value, the second target scaling value, the second target quantization bit width, and the default exponent base is determined as the second exponent base.
在一些实施例中,所述第二目标特征值为该组通道的特征数据中的一个特征值,所述第二目标缩放值为该通道的特征数据在量化时对应的缩放值,所述第二目标量化位宽为该通道的特征数据在量化时对应的量化位宽。In some embodiments, the second target feature value is a feature value in the feature data of the group of channels, the second target scaling value is a scaling value corresponding to the feature data of the channel during quantization, and the first target scaling value is The second target quantization bit width is the quantization bit width corresponding to the characteristic data of the channel during quantization.
可选的,所述第二目标特征值为该通道的特征数据中的最小特征值。Optionally, the second target feature value is the smallest feature value in the feature data of the channel.
在一些实施例中,若该通道对应的反量化方式为查表反量化方式,则反量化单元220,具体用于确定量化区间的索引值与量化区间的反量化值之间的第二对应关系,所述第二对应关系是基于该通道的特征数据的量化前的值和量化后的值确定的;针对该通道中的每一个定点数类型的特征数据,将该定点数类型的特征数据的值作为量化区间的索引,在所述第二对应关系中,查询该定点数类型的特征数据的值对应的目标反量化值;将所述目标反量化值,确定为该定点数类型的特征数据的浮点数类型的值。In some embodiments, if the inverse quantization method corresponding to the channel is a look-up table inverse quantization method, the inverse quantization unit 220 is specifically configured to determine the second correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval , the second correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of the channel; for each characteristic data of the fixed-point number type in the channel, the value of the characteristic data of the fixed-point number type is determined. The value is used as the index of the quantization interval, and in the second correspondence, the target inverse quantization value corresponding to the value of the characteristic data of the fixed-point number type is queried; the target inverse quantization value is determined as the characteristic data of the fixed-point number type. value of type floating point.
在一些实施例中,若对该组通道对应的反量化方式为线性均匀反量化方式,则反量化单元220,具体用于解析所述第一信息,得到第三目标特征值、第三目标缩放值和第三目标量化位宽;根据所述第三目标特征值、第三目标缩放值和第三目标量化位宽,使用所述线性均匀反量化方式,对该组通道的定点数类型的特征数据进行反量化。In some embodiments, if the inverse quantization method corresponding to the group of channels is a linear uniform inverse quantization method, the inverse quantization unit 220 is specifically configured to parse the first information to obtain the third target eigenvalue, the third target scaling value and the third target quantization bit width; according to the third target feature value, the third target scaling value and the third target quantization bit width, using the linear uniform inverse quantization method, the characteristics of the fixed-point number type of the group of channels Data is dequantified.
在一些实施例中,若对该组通道对应的反量化方式为非线性对数均匀反量化方式,则反量化单元220,具体用于根据所述第一信息,确定第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数;根据所述第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数,使用所述非线性对数均匀反量化方式,对该组通道的定点数类型的特征数据进行反量化。In some embodiments, if the inverse quantization method corresponding to the group of channels is a non-linear logarithmic uniform inverse quantization method, the inverse quantization unit 220 is specifically configured to determine the third target eigenvalue, the first Three target scaling values, the third target quantization bit width and the third logarithmic base; according to the third target feature value, the third target scaling value, the third target quantization bitwidth and the third logarithmic base, use the non- The linear logarithmic uniform inverse quantization method performs inverse quantization on the fixed-point feature data of this group of channels.
示例性的,反量化单元220,具体用于解析所述第一信息,得到所述第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数;或者,解析所述第一信息,得到所述第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数的指示信息;根据所述第三对数底数的指示信息,从预设的多个对数底数中,确定所述第三对数底数;或者,解析所述第一信息,得到所述第三目标特征值、第三目标缩放值和第三目标量化位宽,并将默认的对数底数确定为所述第三对数底数。Exemplarily, the inverse quantization unit 220 is specifically configured to parse the first information to obtain the third target feature value, the third target scaling value, the third target quantization bit width, and the third logarithmic base; or, parsing For the first information, the indication information of the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base is obtained; according to the indication information of the third logarithmic base, from Among the preset multiple logarithmic bases, the third logarithmic base is determined; or, the first information is analyzed to obtain the third target characteristic value, the third target scaling value and the third target quantization bit width, And the default logarithmic base is determined as the third logarithmic base.
在一些实施例中,若该组通道对应的反量化方式为非线性指数均匀反量化方式,则反量化单元220,具体用于根据所述第一信息,确定第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数;根据所述第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数,使用所述非线性指数均匀反量化方式,对该组通道的定点数类型的特征数据进行反量化。In some embodiments, if the inverse quantization method corresponding to the set of channels is a nonlinear exponential uniform inverse quantization method, the inverse quantization unit 220 is specifically configured to determine the third target eigenvalue, the third target eigenvalue and the third target according to the first information. The scaling value, the third target quantization bit width and the third exponent base; according to the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third exponent base, the non-linear exponent is used to uniformly invert. In the quantization mode, inverse quantization is performed on the fixed-point feature data of this group of channels.
示例性的,反量化单元220,具体用于解析所述第一信息,得到所述第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数;或者,解析所述第一信息,得到所述第一信息包括所述 第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数的指示信息;根据所述第三对数底数的指示信息,从预设的多个指数底数中,确定所述第三指数底数;或者,解析所述第一信息,得到所述第三目标特征值、第三目标缩放值、第三目标量化位宽,并将默认的指数底数确定为所述第三指数底数。Exemplarily, the inverse quantization unit 220 is specifically configured to parse the first information to obtain the third target feature value, the third target scaling value, the third target quantization bit width, and the third exponent base; The first information is obtained, and the indication information that the first information includes the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base is obtained; according to the third logarithmic base the indication information, determine the third exponent base from a plurality of preset exponent bases; or, parse the first information to obtain the third target characteristic value, the third target scaling value, and the third target quantization bit width, and the default exponent base is determined as the third exponent base.
在一些实施例中,所述第三目标特征值为该组通道的特征数据中的一个特征值,所述第三目标缩放值为该组通道的特征数据在量化时对应的缩放值,所述第三目标量化位宽为该组通道的特征数据在量化时对应的量化位宽。In some embodiments, the third target feature value is a feature value in the feature data of the set of channels, the third target scaling value is a scaling value corresponding to the feature data of the set of channels during quantization, and the The third target quantization bit width is the quantization bit width corresponding to the characteristic data of the group of channels during quantization.
可选的,所述第三目标特征值为该组通道的特征数据中的最小特征值。Optionally, the third target feature value is the smallest feature value in the feature data of the group of channels.
在一些实施例中,若该组通道对应的反量化方式为查表反量化方式,则反量化单元220,具体用于确定量化区间的索引值与量化区间的反量化值之间的第三对应关系,所述第三对应关系是基于该组通道的特征数据的量化前的值和量化后的值确定的;In some embodiments, if the inverse quantization method corresponding to the set of channels is the table look-up inverse quantization method, the inverse quantization unit 220 is specifically configured to determine the third correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval relationship, the third corresponding relationship is determined based on the value before quantization and the value after quantization of the characteristic data of this group of channels;
针对该组通道中的每一个定点数类型的特征数据,将该定点数类型的特征数据的值作为量化区间的索引,在所述第三对应关系中,查询该定点数类型的特征数据的值对应的目标反量化值;For each characteristic data of the fixed-point type in the set of channels, the value of the characteristic data of the fixed-point type is used as the index of the quantization interval, and in the third corresponding relationship, the value of the characteristic data of the fixed-point type is queried. The corresponding target inverse quantization value;
将所述目标反量化值,确定为该定点数类型的特征数据的浮点数类型的值。The target inverse quantization value is determined as a value of the floating point type of the feature data of the fixed point type.
可选的,所述量化区间的索引值与量化区间的反量化值之间的对应关系为默认的;或者,所述第一信息包括所述量化区间的索引值与量化区间的反量化值之间的对应关系。Optionally, the corresponding relationship between the index value of the quantization interval and the inverse quantization value of the quantization interval is default; or, the first information includes the index value of the quantization interval and the inverse quantization value of the quantization interval. Correspondence between.
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图12所示的视频解码器20可以对应于执行本申请实施例的方法700至1000中的相应主体,并且视频解码器20中的各个单元的前述和其它操作和/或功能分别为了实现方法700至1000等各个方法中的相应流程,为了简洁,在此不再赘述。It should be understood that the apparatus embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, details are not repeated here. Specifically, the video decoder 20 shown in FIG. 12 may correspond to the corresponding subject in performing the methods 700 to 1000 of the embodiments of the present application, and the aforementioned and other operations and/or functions of the respective units in the video decoder 20 are for the purpose of For the sake of brevity, the corresponding processes in each of the implementation methods 700 to 1000 will not be repeated here.
上文中结合附图从功能单元的角度描述了本申请实施例的装置和系统。应理解,该功能单元可以通过硬件形式实现,也可以通过软件形式的指令实现,还可以通过硬件和软件单元组合实现。具体地,本申请实施例中的方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路和/或软件形式的指令完成,结合本申请实施例公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件单元组合执行完成。可选地,软件单元可以位于随机存储器,闪存、只读存储器、可编程只读存储器、电可擦写可编程存储器、寄存器等本领域的成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法实施例中的步骤。The apparatus and system of the embodiments of the present application are described above from the perspective of functional units with reference to the accompanying drawings. It should be understood that the functional unit may be implemented in the form of hardware, may also be implemented by an instruction in the form of software, or may be implemented by a combination of hardware and software units. Specifically, the steps of the method embodiments in the embodiments of the present application may be completed by hardware integrated logic circuits in the processor and/or instructions in the form of software, and the steps of the methods disclosed in conjunction with the embodiments of the present application may be directly embodied as hardware The execution of the decoding processor is completed, or the execution is completed by a combination of hardware and software units in the decoding processor. Optionally, the software unit may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, and other storage media mature in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps in the above method embodiments in combination with its hardware.
图13是本申请实施例提供的电子设备30的示意性框图。FIG. 13 is a schematic block diagram of an electronic device 30 provided by an embodiment of the present application.
如图13所示,该电子设备30可以为本申请实施例所述的视频编码器,或者视频解码器,该电子设备30可包括:As shown in FIG. 13 , the electronic device 30 may be the video encoder or the video decoder described in this embodiment of the application, and the electronic device 30 may include:
存储器33和处理器32,该存储器33用于存储计算机程序34,并将该程序代码34传输给该处理器32。换言之,该处理器32可以从存储器33中调用并运行计算机程序34,以实现本申请实施例中的方法。A memory 33 and a processor 32 for storing a computer program 34 and transmitting the program code 34 to the processor 32 . In other words, the processor 32 can call and run the computer program 34 from the memory 33 to implement the methods in the embodiments of the present application.
例如,该处理器32可用于根据该计算机程序34中的指令执行上述方法中的步骤。For example, the processor 32 may be adapted to perform the steps of the above-described methods according to instructions in the computer program 34 .
在本申请的一些实施例中,该处理器32可以包括但不限于:In some embodiments of the present application, the processor 32 may include, but is not limited to:
通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等等。General-purpose processor, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates Or transistor logic devices, discrete hardware components, and so on.
在本申请的一些实施例中,该存储器33包括但不限于:In some embodiments of the present application, the memory 33 includes but is not limited to:
易失性存储器和/或非易失性存储器。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。Volatile memory and/or non-volatile memory. Wherein, the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which acts as an external cache. By way of illustration and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
在本申请的一些实施例中,该计算机程序34可以被分割成一个或多个单元,该一个或者多个单元被存储在该存储器33中,并由该处理器32执行,以完成本申请提供的方法。该一个或多个单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述该计算机程序34在该电子设备30中的执行过程。In some embodiments of the present application, the computer program 34 may be divided into one or more units, and the one or more units are stored in the memory 33 and executed by the processor 32 to complete the procedures provided by the present application. Methods. The one or more units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30 .
如图13所示,该电子设备30还可包括:As shown in FIG. 13 , the electronic device 30 may further include:
收发器33,该收发器33可连接至该处理器32或存储器33。A transceiver 33 which can be connected to the processor 32 or the memory 33 .
其中,处理器32可以控制该收发器33与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。收发器33可以包括发射机和接收机。收发器33还可以进一步包括天线,天线的数量可以为一个或多个。The processor 32 can control the transceiver 33 to communicate with other devices, specifically, can send information or data to other devices, or receive information or data sent by other devices. The transceiver 33 may include a transmitter and a receiver. The transceiver 33 may further include antennas, and the number of the antennas may be one or more.
应当理解,该电子设备30中的各个组件通过总线系统相连,其中,总线系统除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。It should be understood that each component in the electronic device 30 is connected through a bus system, wherein the bus system includes a power bus, a control bus and a status signal bus in addition to a data bus.
图14是本申请实施例提供的视频编解码系统40的示意性框图。FIG. 14 is a schematic block diagram of a video encoding and decoding system 40 provided by an embodiment of the present application.
如图14所示,该视频编解码系统40可包括:视频编码器41和视频解码器42,其中视频编码器41用于执行本申请实施例涉及的视频编码方法,视频解码器42用于执行本申请实施例涉及的视频解码方法。As shown in FIG. 14 , the video encoding and decoding system 40 may include: a video encoder 41 and a video decoder 42 , wherein the video encoder 41 is used for executing the video encoding method involved in the embodiments of the present application, and the video decoder 42 is used for executing The video decoding method involved in the embodiments of the present application.
本申请还提供了一种计算机存储介质,其上存储有计算机程序,该计算机程序被计算机执行时使得该计算机能够执行上述方法实施例的方法。或者说,本申请实施例还提供一种包含指令的计算机程序产品,该指令被计算机执行时使得计算机执行上述方法实施例的方法。The present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, enables the computer to execute the methods of the above method embodiments. In other words, the embodiments of the present application further provide a computer program product including instructions, when the instructions are executed by a computer, the instructions cause the computer to execute the methods of the above method embodiments.
当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions may be stored on or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer, server or data center (eg coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) means to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, digital video disc (DVD)), or semiconductor media (eg, solid state disk (SSD)), and the like.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执 行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。例如,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment. For example, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
以上该,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以该权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art who is familiar with the technical scope disclosed in the present application can easily think of changes or substitutions. Covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (65)

  1. 一种图像编码方法,其特征在于,包括:An image coding method, comprising:
    获取待编码的当前图像;Get the current image to be encoded;
    将所述当前图像输入神经网络,得到所述当前图像的特征数据,所述当前图像的特征数据包括N个通道的特征数据,所述N为正整数;Inputting the current image into a neural network to obtain feature data of the current image, where the feature data of the current image includes feature data of N channels, and N is a positive integer;
    对所述N个通道中的至少一个通道的特征数据进行量化;quantifying the feature data of at least one channel in the N channels;
    对量化后的所述至少一个通道的特征数据进行编码,得到码流,所述码流中包括第一信息,所述第一信息用于指示对所述N个通道中的至少一个通道的特征数据进行反量化。Encoding the quantized feature data of the at least one channel to obtain a code stream, where the code stream includes first information, and the first information is used to indicate the characteristics of at least one channel in the N channels Data is dequantified.
  2. 根据权利要求1所述的方法,其特征在于,所述对所述N个通道中的至少一个通道的特征数据进行量化,包括:The method according to claim 1, wherein the quantizing the feature data of at least one channel in the N channels comprises:
    对所述N个通道中的至少一个通道的浮点数类型的特征数据进行量化,得到所述至少一个通道的定点数类型的特征数据。Quantizing the feature data of the floating point type of at least one channel of the N channels to obtain the feature data of the fixed point type of the at least one channel.
  3. 根据权利要求2所述的方法,其特征在于,对所述N个通道中至少一个通道的浮点数类型的特征数据进行量化的量化方式包括如下任意一种:线性均匀量化方式、非线性指数均匀量化方式、非线性对数均匀量化方式、查表量化方式。The method according to claim 2, wherein the quantization method for quantizing the floating point type characteristic data of at least one channel of the N channels includes any one of the following: a linear uniform quantization method, a nonlinear exponential uniform method Quantization method, nonlinear logarithmic uniform quantization method, look-up table quantization method.
  4. 根据权利要求2或3所述的方法,其特征在于,所述对所述N个通道中至少一个通道的浮点数类型的特征数据进行量化,包括:The method according to claim 2 or 3, wherein the quantizing the floating point type feature data of at least one channel of the N channels comprises:
    对所述N个通道中所有通道的浮点数类型的特征数据,使用同一种量化方式进行量化;或者,Use the same quantization method to quantize the floating-point type feature data of all channels in the N channels; or,
    对所述N个通道中每个通道的浮点数类型的特征数据,分别使用一种种量化方式进行量化;Quantize the characteristic data of the floating point type of each channel in the N channels by using different quantization methods respectively;
    或者,对所述N个通道进行分组,对每一组通道的浮点数类型的特征数据,分别使用一种量化方式进行量化。Alternatively, the N channels are grouped, and a quantization method is used to quantize the floating point type feature data of each group of channels.
  5. 根据权利要求4所述的方法,其特征在于,若所述量化方式为线性均匀量化方式,所述对所述N个通道中所有通道的浮点数类型的特征数据,使用同一种量化方式进行量化,包括:The method according to claim 4, wherein, if the quantization method is a linear uniform quantization method, the feature data of the floating point type of all channels in the N channels is quantized using the same quantization method ,include:
    获取预设的第一量化位宽,以及所述N个通道中所有通道的浮点数类型的特征数据中的第一特征值和第二特征值;Obtain a preset first quantization bit width, and the first eigenvalue and the second eigenvalue in the feature data of the floating point type of all channels in the N channels;
    根据所述第一特征值和第二特征值,以及所述第一量化位宽,使用所述线性均匀量化方式,对所述N个通道中每个通道的浮点数类型的特征数据进行量化。According to the first eigenvalue and the second eigenvalue, and the first quantization bit width, the linear uniform quantization method is used to quantize the floating point type feature data of each of the N channels.
  6. 根据权利要求4所述的方法,其特征在于,若所述量化方式为非线性对数均匀量化方式,所述对所述N个通道中所有通道的浮点数类型的特征数据,使用同一种量化方式进行量化,包括:The method according to claim 4, wherein if the quantization method is a non-linear logarithmic uniform quantization method, the same quantization method is used for the floating-point type feature data of all channels in the N channels. ways to quantify, including:
    获取预设的第二量化位宽和对数函数的第一底数,以及所述N个通道中所有通道的浮点数类型的特征数据中的第一特征值和第二特征值;Obtain the preset second quantization bit width and the first base of the logarithmic function, and the first eigenvalue and the second eigenvalue in the feature data of the floating point type of all channels in the N channels;
    根据所述第一特征值和第二特征值,以及所述第二量化位宽和所述对数函数的第一底数,使用所述非线性对数均匀量化方式,对所述N个通道中每个通道的浮点数类型的特征数据进行量化。According to the first eigenvalue and the second eigenvalue, as well as the second quantization bit width and the first base of the logarithmic function, using the nonlinear logarithmic uniform quantization method, for the N channels The feature data of float type for each channel is quantized.
  7. 根据权利要求4所述的方法,其特征在于,若所述量化方式为非线性指数均匀量化方式,所述对所述N个通道中所有通道的浮点数类型的特征数据,使用同一种量化方式进行量化,包括:The method according to claim 4, wherein if the quantization method is a nonlinear exponential uniform quantization method, the same quantization method is used for the floating-point type feature data of all channels in the N channels. Quantify, including:
    获取预设的第三量化位宽和指数函数的第一底数,以及所述N个通道中所有通道的浮点数类型的特征数据中的第一特征值和第二特征值;Obtain the preset third quantization bit width and the first base of the exponential function, and the first eigenvalue and the second eigenvalue in the feature data of the floating point type of all channels in the N channels;
    根据所述第一特征值和第二特征值,以及所述第三量化位宽和所述指数函数的第一底数,使用所述非线性指数均匀量化方式,对所述N个通道中每个通道的浮点数类型的特征数据进行量化。According to the first eigenvalue and the second eigenvalue, as well as the third quantization bit width and the first base of the exponential function, using the nonlinear exponential uniform quantization method, for each of the N channels The feature data of the channel's floating point type is quantized.
  8. 根据权利要求4所述的方法,其特征在于,若所述量化方式为查表量化方式,所述对所述N个通道中所有通道的浮点数类型的特征数据,使用同一种量化方式进行量化,包括:The method according to claim 4, wherein if the quantization method is a look-up table quantization method, the quantization is performed using the same quantization method for the floating-point type feature data of all channels in the N channels. ,include:
    对所述N个通道中所有通道的浮点数类型的特征数据,按照取值大小进行排序,得到排序后的第一特征数据;Sort the feature data of the floating point type of all channels in the N channels according to the value size to obtain the sorted first feature data;
    将所述排序后的第一特征数据划分为多个第一量化区间,其中每个第一量化区间包括相同数量的特征数据;dividing the sorted first characteristic data into a plurality of first quantization intervals, wherein each first quantization interval includes the same amount of characteristic data;
    针对每个所述第一量化区间,将所述第一量化区间内的特征数据的值量化为所述第一量化区间的索引值。For each of the first quantization intervals, the value of the feature data in the first quantization interval is quantized as an index value of the first quantization interval.
  9. 根据权利要求5-7任一项所述的方法,其特征在于,所述第一特征值为所述N个通道中所有通道的浮点数类型的特征数据中的最小特征值,所述第二特征值为所述N个通道中所有通道的浮点数类型的特征数据中的最大特征值。The method according to any one of claims 5-7, wherein the first eigenvalue is the smallest eigenvalue in the floating-point type feature data of all channels in the N channels, and the second eigenvalue is The eigenvalue is the largest eigenvalue in the feature data of the floating point type of all channels in the N channels.
  10. 根据权利要求4所述的方法,其特征在于,若所述量化方式为线性均匀量化方式,所述对所述N个通道中每个通道的浮点数类型的特征数据,分别使用一种量化方式进行量化,包括:The method according to claim 4, wherein if the quantization method is a linear uniform quantization method, a quantization method is respectively used for the characteristic data of the floating point type of each channel in the N channels. Quantify, including:
    针对所述N个通道中的每个通道,获取预设的第四量化位宽,以及该通道的浮点数类型的特征数据中的第三特征值和第四特征值;For each channel in the N channels, obtain a preset fourth quantization bit width, and the third eigenvalue and the fourth eigenvalue in the feature data of the floating point type of the channel;
    根据所述第三特征值和第四特征值,以及所述第四量化位宽,使用所述线性均匀量化方式,对该通道的浮点数类型的特征数据进行量化。According to the third eigenvalue, the fourth eigenvalue, and the fourth quantization bit width, using the linear uniform quantization method, the feature data of the floating point type of the channel is quantized.
  11. 根据权利要求4所述的方法,其特征在于,若所述量化方式为非线性对数均匀量化方式,所述对所述N个通道中每个通道的浮点数类型的特征数据,分别使用一种量化方式进行量化,包括:The method according to claim 4, wherein if the quantization method is a non-linear logarithmic uniform quantization method, the floating point type feature data of each channel in the N channels is respectively used as a quantified in various ways, including:
    针对所述N个通道中的每个通道,获取预设的第五量化位宽和对数函数的第二底数,以及该通道的浮点数类型的特征数据中的第三特征值和第四特征值;For each of the N channels, obtain a preset fifth quantization bit width and the second base of the logarithmic function, and the third eigenvalue and the fourth feature in the feature data of the floating point type of the channel value;
    根据所述第三特征值和第四特征值,以及所述第五量化位宽和所述对数函数的第二底数,使用所述非线性对数均匀量化方式,对该通道的浮点数类型的特征数据进行量化。According to the third eigenvalue and the fourth eigenvalue, the fifth quantization bit width and the second base of the logarithmic function, using the nonlinear logarithmic uniform quantization method, the floating point type of the channel quantified feature data.
  12. 根据权利要求4所述的方法,其特征在于,若所述量化方式为非线性指数均匀量化方式,所述对所述N个通道中每个通道的浮点数类型的特征数据,分别使用一种量化方式进行量化,包括:The method according to claim 4, wherein if the quantization method is a nonlinear exponential uniform quantization method, the floating-point type feature data of each channel in the N channels is divided into two types. Quantitative methods are quantified, including:
    针对所述N个通道中的每个通道,获取预设的第六量化位宽和指数函数的第二底数,以及该通道的浮点数类型的特征数据中的第三特征值和第四特征值;For each of the N channels, obtain a preset sixth quantization bit width and the second base of the exponential function, and the third and fourth eigenvalues in the floating-point type feature data of the channel ;
    根据所述第三特征值和第四特征值,以及所述第六量化位宽和所述指数函数的第二底数,使用所述非线性指数均匀量化方式,对该通道的浮点数类型的特征数据进行量化。According to the third eigenvalue and the fourth eigenvalue, as well as the sixth quantization bit width and the second base of the exponential function, using the nonlinear exponential uniform quantization method, the floating point type feature of the channel is data is quantified.
  13. 根据权利要求5所述的方法,其特征在于,若所述量化方式为查表量化方式,所述对所述N个通道中每个通道的浮点数类型的特征数据,分别使用一种量化方式进行量化,包括:The method according to claim 5, wherein if the quantization method is a look-up table quantization method, a quantization method is respectively used for the characteristic data of the floating point type of each channel in the N channels. Quantify, including:
    针对所述N个通道中的每个通道,对该通道的浮点数类型的特征数据,按照取值大小进行排序,得到所述通道下排序后的第二特征数据;For each channel in the N channels, sort the feature data of the floating point type of the channel according to the value size, and obtain the sorted second feature data under the channel;
    将该通道下的排序后的第二特征数据划分为多个第二量化区间,其中每个第二量化区间包括相同数量的特征数据;dividing the sorted second characteristic data under the channel into a plurality of second quantization intervals, wherein each second quantization interval includes the same amount of characteristic data;
    针对每个所述第二量化区间,将所述第二量化区间内的特征数据的值量化为所述第二量化区间的索引值。For each second quantization interval, the value of the feature data in the second quantization interval is quantized as an index value of the second quantization interval.
  14. 根据权利要求10-12任一项所述的方法,其特征在于,所述第三特征值为该通道的浮点数类型的特征数据中的最大特征值,所述第四特征值为该通道的浮点数类型的特征数据中的最小特征值。The method according to any one of claims 10-12, wherein the third eigenvalue is the largest eigenvalue in the feature data of the floating point type of the channel, and the fourth eigenvalue is the channel The smallest eigenvalue in eigendata of float type.
  15. 根据权利要求4所述的方法,其特征在于,若所述量化方式为线性均匀量化方式,所述对每一组通道的浮点数类型的特征数据,分别使用一种量化方式进行量化,包括:The method according to claim 4, wherein if the quantization method is a linear uniform quantization method, the feature data of the floating point type of each group of channels is quantized using a quantization method, comprising:
    针对每一组通道,获取预设的第七量化位宽,以及该组通道的浮点数类型的特征数据中的第五特征值和第六特征值;For each group of channels, obtain the preset seventh quantization bit width, and the fifth and sixth eigenvalues in the feature data of the floating point type of the group of channels;
    根据所述第五特征值和第六特征值,以及所述第七量化位宽,使用所述线性均匀量化方式,对该组通道中的每个通道的浮点数类型的特征数据进行量化。According to the fifth eigenvalue and the sixth eigenvalue, and the seventh quantization bit width, using the linear uniform quantization method, the floating point type feature data of each channel in the group of channels is quantized.
  16. 根据权利要求4所述的方法,其特征在于,若所述量化方式为非线性对数均匀量化方式,所述对每一组通道的浮点数类型的特征数据,分别使用一种量化方式进行量化,包括:The method according to claim 4, wherein if the quantization method is a non-linear logarithmic uniform quantization method, the characteristic data of the floating point type of each group of channels is quantized using a quantization method respectively. ,include:
    针对每一组通道,获取预设的第八量化位宽和对数函数的第三底数,以及该组通道的浮点数类型的特征数据中的第五特征值和第六特征值;For each group of channels, obtain the preset eighth quantization bit width and the third base of the logarithmic function, and the fifth and sixth eigenvalues in the feature data of the floating point type of the group of channels;
    根据所述第五特征值和第六特征值,以及所述第八量化位宽和所述对数函数的第三底数,使用所述非线性对数均匀量化方式,对该组通道中的每个通道的浮点数类型的特征数据进行量化。According to the fifth eigenvalue and the sixth eigenvalue, the eighth quantization bit width and the third base of the logarithmic function, using the non-linear logarithmic uniform quantization method, for each channel in the group of channels Quantize the feature data of the floating point type of each channel.
  17. 根据权利要求4所述的方法,其特征在于,若所述量化方式为非线性指数均匀量化方式,所述对每一组通道的浮点数类型的特征数据,分别使用一种量化方式进行量化,包括:The method according to claim 4, wherein, if the quantization method is a nonlinear exponential uniform quantization method, the characteristic data of the floating point type of each group of channels is quantized using a quantization method respectively, include:
    针对每一组通道,获取预设的第九量化位宽和指数函数的第三底数,以及该组通道的浮点数类型的特征数据中的第五特征值和第六特征值;For each group of channels, obtain the preset ninth quantization bit width and the third base of the exponential function, and the fifth and sixth eigenvalues in the feature data of the floating point type of the group of channels;
    根据所述第五特征值和第六特征值,以及所述第九量化位宽和所述指数函数的第三底数,使用所述非线性对数均匀量化方式,对该组通道中的每个通道的浮点数类型的特征数据进行量化。According to the fifth eigenvalue and the sixth eigenvalue, and the ninth quantization bit width and the third base of the exponential function, using the nonlinear logarithmic uniform quantization method, each of the channels in the group of The feature data of the channel's floating point type is quantized.
  18. 根据权利要求4所述的方法,其特征在于,若所述量化方式为查表量化方式,所述对每一组通道的浮点数类型的特征数据,分别使用一种量化方式进行量化,包括:The method according to claim 4, wherein, if the quantization method is a look-up table quantization method, the feature data of the floating point type of each group of channels is quantized by using a quantization method, comprising:
    针对每一组通道,对所述组通道的浮点数类型的特征数据,按照取值大小进行排序,得到该组通道下排序后的第三特征数据;For each group of channels, sort the characteristic data of the floating point type of the group of channels according to the value size, and obtain the sorted third characteristic data under the group of channels;
    将该组通道下排序后的第三特征数据划分为多个第三量化区间,其中每个第三量化区间包括相同数量的特征数据;dividing the sorted third characteristic data under the group of channels into a plurality of third quantization intervals, wherein each third quantization interval includes the same amount of characteristic data;
    针对每个所述第三量化区间,将所述第三量化区间内的特征数据的值量化为所述第三量化区间的索引值。For each third quantization interval, the value of the feature data in the third quantization interval is quantized as an index value of the third quantization interval.
  19. 根据权利要求15-17任一项所述的方法,其特征在于,所述第五特征值为该组通道的浮点数类型的特征数据中的最大特征值,所述第六特征值为该组通道的浮点数类型的特征数据中的最小特征值。The method according to any one of claims 15-17, wherein the fifth eigenvalue is the largest eigenvalue in the floating-point type feature data of the group of channels, and the sixth eigenvalue is the group The smallest eigenvalue in the eigendata of the channel's float type.
  20. 根据权利要求2-19任一项所述的方法,其特征在于,所述第一信息指示对所述N个通道中所有通道的定点数类型的特征数据进行反量化;或者,The method according to any one of claims 2-19, wherein the first information indicates that inverse quantization is performed on fixed-point type feature data of all channels in the N channels; or,
    所述第一信息指示对所述N个通道中的每个通道的定点数类型的特征数据分别进行反量化;或者,The first information indicates that inverse quantization is performed on the fixed-point type feature data of each of the N channels; or,
    所述第一信息指示对M组通道中的每一组通道的定点数类型的特征数据分别进行反量化,其中所述M组通道为对所述N个通道进行分组得到的,每一组通道包括所述N个通道中的至少一个通道。The first information indicates that inverse quantization is performed on the fixed-point type feature data of each channel in the M groups of channels, wherein the M groups of channels are obtained by grouping the N channels, and each group of channels is obtained by grouping the N channels. At least one of the N channels is included.
  21. 根据权利要求2-20任一项所述的方法,其特征在于,对所述至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式包括如下任意一种:线性均匀反量化方式、非线性指数均匀反量化方式、非线性对数均匀反量化方式、查表反量化方式。The method according to any one of claims 2-20, wherein the inverse quantization method used when performing inverse quantization on the characteristic data of the fixed-point type of the at least one channel comprises any one of the following: linear uniform inverse Quantization method, nonlinear exponential uniform inverse quantization method, nonlinear logarithmic uniform inverse quantization method, and look-up table inverse quantization method.
  22. 根据权利要求2-21任一项所述的方法,其特征在于,所述第一信息包括对所述至少一个通 道的定点数类型的特征数据进行反量化时所需的至少一个参数。The method according to any one of claims 2-21, wherein the first information includes at least one parameter required for inverse quantization of the characteristic data of the fixed-point type of the at least one channel.
  23. 根据权利要求22所述的方法,其特征在于,所述第一信息指示对所述N个通道中所有通道的定点数类型的特征数据进行反量化,则所述第一信息包括如下任意一种:The method according to claim 22, wherein the first information indicates that inverse quantization is performed on the fixed-point type feature data of all channels in the N channels, and the first information includes any one of the following :
    若对所述N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为线性均匀反量化方式,则所述第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽;If the inverse quantization method for performing inverse quantization on the characteristic data of the fixed-point type of all channels in the N channels is a linear uniform inverse quantization method, the first information includes a first target feature value, a first target scaling value and the first target quantization bit width;
    若对所述N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为非线性对数均匀反量化方式,则所述第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽,或者所述第一信息包括第一目标特征值、第一目标缩放值、第一目标量化位宽和第一对数底数,或者所述第一信息包括第一目标特征值、第一目标缩放值、第一目标量化位宽和第一对数底数的指示信息;If the inverse quantization method for inverse quantization of the fixed-point type feature data of all channels in the N channels is a nonlinear logarithmic uniform inverse quantization method, the first information includes a first target eigenvalue, a first A target scaling value and a first target quantization bit width, or the first information includes a first target feature value, a first target scaling value, a first target quantization bit width, and a first logarithmic base, or the first information includes The indication information of the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base;
    若对所述N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为非线性指数均匀反量化方式,则所述第一信息包括第一目标特征值、第一目标缩放值和第一目标量化位宽,或者所述第一信息包括第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数,或者所述第一信息包括第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数的指示信息;If the inverse quantization method for inverse quantization of the fixed-point type characteristic data of all channels in the N channels is a nonlinear exponential uniform inverse quantization method, the first information includes a first target eigenvalue, a first target A scaling value and a first target quantization bit width, or the first information includes a first target feature value, a first target scaling value, a first target quantization bit width, and a first exponent base, or the first information includes a first The indication information of the target feature value, the first target scaling value, the first target quantization bit width and the first exponent base;
    若对所述N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为查表反量化方式,则所述第一信息包括量化区间的索引值与量化区间的反量化值之间的第一对应关系,所述第一对应关系是基于所述N个通道中所有通道的特征数据的量化前的值和量化后的值确定的;If the inverse quantization method for performing inverse quantization on the fixed-point type characteristic data of all channels in the N channels is a table look-up inverse quantization method, the first information includes the index value of the quantization interval and the inverse quantization of the quantization interval the first correspondence between the values, the first correspondence is determined based on the pre-quantized value and the quantized value of the characteristic data of all channels in the N channels;
    其中,所述第一目标特征值为所述N个通道中所有通道的特征数据中的一个特征值,所述第一目标缩放值为所述N个通道中所有通道的特征数据在量化时对应的缩放值,所述第一目标量化位宽为所述N个通道中所有通道的特征数据在量化时对应的量化位宽。The first target feature value is one feature value in the feature data of all channels in the N channels, and the first target scaling value corresponds to the feature data of all channels in the N channels during quantization The first target quantization bit width is the quantization bit width corresponding to the characteristic data of all channels in the N channels during quantization.
  24. 根据权利要求23所述的方法,其特征在于,所述第一目标特征值为所述N个通道中所有通道的特征数据最小值。The method according to claim 23, wherein the first target feature value is the minimum value of feature data of all channels in the N channels.
  25. 根据权利要求22所述的方法,其特征在于,所述第一信息指示对所述N个通道中每个通道的定点数类型的特征数据分别进行反量化,针对每一个通道,则所述第一信息包括如下任意一种:The method according to claim 22, wherein the first information indicates that inverse quantization is performed on the fixed-point type feature data of each channel in the N channels, and for each channel, the first A message includes any of the following:
    若对该通道的定点数类型的特征数据进行反量化的反量化方式为线性均匀反量化方式,则所述第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽;If the inverse quantization method for inverse quantization of the fixed-point type feature data of the channel is a linear uniform inverse quantization method, the first information includes the second target feature value, the second target scaling value, and the second target quantization bit width ;
    若对该通道的定点数类型的特征数据进行反量化为反量化方式的非线性对数均匀反量化方式,则所述第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽,或者所述第一信息包括第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数,或者所述第一信息包括第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数的指示信息;If the feature data of the fixed-point type of the channel is inversely quantized into a non-linear logarithmic uniform inverse quantization method in an inverse quantization manner, the first information includes a second target feature value, a second target scaling value, and a second target The quantization bit width, or the first information includes the second target eigenvalue, the second target scaling value, the second target quantization bit width, and the second logarithmic base, or the first information includes the second target eigenvalue, the first Two target scaling values, the second target quantization bit width and the indication information of the second logarithmic base;
    若对该通道的定点数类型的特征数据进行反量化的反量化方式为非线性指数均匀反量化方式,则所述第一信息包括第二目标特征值、第二目标缩放值和第二目标量化位宽,或者所述第一信息包括第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数,或者所述第一信息包括第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数的指示信息;If the inverse quantization method for inverse quantization of the fixed-point type feature data of the channel is a nonlinear exponential uniform inverse quantization method, the first information includes the second target feature value, the second target scaling value, and the second target quantization bit width, or the first information includes a second target eigenvalue, a second target scaling value, a second target quantization bit width, and a second exponent base, or the first information includes a second target eigenvalue, a second target indication information of the scaling value, the second target quantization bit width and the second exponent base;
    若对该通道的定点数类型的特征数据进行反量化的反量化方式为查表反量化方式,则所述第一信息包括量化区间的索引值与量化区间的反量化值之间的第二对应关系,所述第二对应关系是基于该通道的特征数据的量化前的值和量化后的值确定的;If the inverse quantization method for inverse quantization of the fixed-point type characteristic data of the channel is the table look-up inverse quantization method, the first information includes the second correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval relationship, the second corresponding relationship is determined based on the value before quantization and the value after quantization of the characteristic data of the channel;
    其中,所述第二目标特征值为该通道的特征数据中的一个特征值,所述第二目标缩放值为该通道的特征数据在量化时对应的缩放值,所述第二目标量化位宽为该通道的特征数据在量化时对应的量化位宽。Wherein, the second target feature value is a feature value in the feature data of the channel, the second target scaling value is the scaling value corresponding to the feature data of the channel during quantization, and the second target quantization bit width It is the corresponding quantization bit width of the feature data of this channel during quantization.
  26. 根据权利要求25所述的方法,其特征在于,所述第二目标特征值为该通道的特征数据最小值。The method according to claim 25, wherein the second target characteristic value is the minimum value of characteristic data of the channel.
  27. 根据权利要求22所述的方法,其特征在于,所述第一信息指示对M组通道的定点数类型的特征数据分别进行反量化,针对每一组通道,则所述第一信息包括如下任意一种:The method according to claim 22, wherein the first information indicates that inverse quantization is performed on the fixed-point type feature data of M groups of channels respectively, and for each group of channels, the first information includes any of the following A sort of:
    若对该组通道进行反量化为反量化方式为线性均匀反量化方式,则所述第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽;If the inverse quantization is performed on the group of channels so that the inverse quantization method is a linear uniform inverse quantization method, the first information includes the third target eigenvalue, the third target scaling value and the third target quantization bit width;
    若对该组通道的定点数类型的特征数据进行反量化的反量化方式为非线性对数均匀反量化方式,则所述第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽,或者所述第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数,或者所述第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数的指示信息;If the inverse quantization method for inverse quantization of the fixed-point type feature data of the group of channels is a nonlinear logarithmic uniform inverse quantization method, the first information includes the third target eigenvalue, the third target scaling value, and the third target scaling value. The target quantization bit width, or the first information includes the third target eigenvalue, the third target scaling value, the third target quantization bit width, and the third logarithmic base, or the first information includes the third target eigenvalue, Indication information of the third target scaling value, the third target quantization bit width and the third logarithmic base;
    若对该组通道的定点数类型的特征数据进行反量化的反量化方式为非线性指数均匀反量化方式,则所述第一信息包括第三目标特征值、第三目标缩放值和第三目标量化位宽,或者所述第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数,或者所述第一信息包括第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数的指示信息;If the inverse quantization method for inverse quantization of the fixed-point type feature data of the group of channels is a nonlinear exponential uniform inverse quantization method, the first information includes the third target feature value, the third target scaling value, and the third target Quantization bit width, or the first information includes a third target eigenvalue, a third target scaling value, a third target quantization bit width, and a third exponent base, or the first information includes a third target eigenvalue, a third Indication information of the target scaling value, the third target quantization bit width and the third exponent base;
    若对该组通道的定点数类型的特征数据进行反量化的反量化方式为查表反量化方式,则所述第一信息包括量化区间的索引值与量化区间的反量化值之间的第三对应关系,所述第三对应关系是基于该组通道的特征数据的量化前的值和量化后的值确定的;If the inverse quantization method for performing inverse quantization on the fixed-point type feature data of the group of channels is the table look-up inverse quantization method, the first information includes the third index value between the index value of the quantization interval and the inverse quantization value of the quantization interval. Correspondence, the third correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of this group of channels;
    其中,所述M组通道为对所述N个通道进行分组得到的,每一组通道包括所述N个通道中的至少一个通道,所述第三目标特征值为该组通道的特征数据中的一个特征值,所述第三目标缩放值为该组通道的特征数据在量化时对应的缩放值,所述第三目标量化位宽为该组通道的特征数据在量化时对应的量化位宽。The M groups of channels are obtained by grouping the N channels, each group of channels includes at least one channel in the N channels, and the third target feature value is in the feature data of the group of channels. A characteristic value of , the third target scaling value is the corresponding scaling value of the characteristic data of this group of channels during quantization, and the third target quantization bit width is the corresponding quantization bit width of the characteristic data of this group of channels during quantization .
  28. 根据权利要求27所述的方法,其特征在于,所述第三目标特征值为该组通道的特征数据最小值。The method according to claim 27, wherein the third target feature value is the minimum value of feature data of the group of channels.
  29. 根据权利要求2-28任一项所述的方法,其特征在于,所述码流还包括第二信息,所述第二信息用于指示对所述至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式。The method according to any one of claims 2-28, wherein the code stream further includes second information, and the second information is used to indicate that the characteristic data of the fixed-point type of the at least one channel is to be performed The inverse quantization method used during inverse quantization.
  30. 一种图像解码方法,其特征在于,包括:An image decoding method, comprising:
    解码码流,得到当前图像的定点数类型的特征数据,所述当前图像的特征数据包括N个通道的特征数据,所述N为正整数;Decoding the code stream to obtain fixed-point feature data of the current image, where the feature data of the current image includes feature data of N channels, and N is a positive integer;
    解码码流,得到第一信息,所述第一信息用于指示对所述N个通道中的至少一个通道的特征数据进行反量化;Decoding the code stream to obtain first information, where the first information is used to instruct to perform inverse quantization on the feature data of at least one channel in the N channels;
    根据所述第一信息,对所述至少一个通道的特征数据进行反量化。According to the first information, inverse quantization is performed on the feature data of the at least one channel.
  31. 根据权利要求30所述的方法,其特征在于,所述根据所述第一信息,对所述至少一个通道的特征数据进行反量化,包括:The method according to claim 30, wherein the performing inverse quantization on the characteristic data of the at least one channel according to the first information comprises:
    所述根据所述第一信息,对所述至少一个通道的定点数类型的特征数据进行反量化,得到所述至少一个通道的浮点数类型的特征数据。The inverse quantization is performed on the feature data of the fixed-point type of the at least one channel according to the first information, to obtain the feature data of the floating-point number type of the at least one channel.
  32. 根据权利要求31所述的方法,其特征在于,对所述至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式包括如下任意一种:线性均匀反量化方式、非线性指数均匀反量化方式、非线性对数均匀反量化方式、查表反量化方式。The method according to claim 31, wherein the inverse quantization method used when performing inverse quantization on the characteristic data of the fixed-point type of the at least one channel comprises any one of the following: a linear uniform inverse quantization method, a nonlinear Exponential uniform inverse quantization method, nonlinear logarithmic uniform inverse quantization method, and look-up table inverse quantization method.
  33. 根据权利要求31或32所述的方法,其特征在于,所述根据所述第一信息,对所述至少一个通道的定点数类型的特征数据进行反量化,包括:The method according to claim 31 or 32, wherein the performing inverse quantization on the fixed-point feature data of the at least one channel according to the first information comprises:
    根据所述第一信息,使用默认的反量化方式,对所述至少一个通道的定点数类型的特征数据进行反量化。According to the first information, inverse quantization is performed on the fixed-point type feature data of the at least one channel by using a default inverse quantization manner.
  34. 根据权利要求31或32所述的方法,其特征在于,所述码流还包括第二信息,所述第二信息用于指示对所述至少一个通道的定点数类型的特征数据进行反量化时所使用的反量化方式,所述根据所述第一信息,对所述至少一个通道的定点数类型的特征数据进行反量化,包括:The method according to claim 31 or 32, wherein the code stream further comprises second information, and the second information is used to indicate when performing inverse quantization on the characteristic data of the fixed-point type of the at least one channel The inverse quantization method used, in which the inverse quantization is performed on the characteristic data of the fixed-point type of the at least one channel according to the first information, including:
    根据所述第一信息,使用所述第二信息指示的反量化方式,对所述至少一个通道的定点数类型的特征数据进行反量化。According to the first information, inverse quantization is performed on the fixed-point type feature data of the at least one channel by using the inverse quantization manner indicated by the second information.
  35. 根据权利要求31或34所述的方法,其特征在于,所述第一信息包括对所述至少一个通道的定点数类型的特征数据进行反量化时所需的至少一个参数。The method according to claim 31 or 34, wherein the first information includes at least one parameter required for inverse quantization of the fixed-point type feature data of the at least one channel.
  36. 根据权利要求31-35任一项所述的方法,其特征在于,所述根据所述第一信息,对所述至少一个通道的定点数类型的特征数据进行反量化,包括:The method according to any one of claims 31-35, wherein the performing inverse quantization on the fixed-point feature data of the at least one channel according to the first information, comprises:
    若所述第一信息指示对所述N个通道中所有通道的定点数类型的特征数据进行反量化,则使用同一种反量化方式对所述N个通道中所有通道的定点数类型的特征数据进行反量化;或者,If the first information indicates to perform inverse quantization on the fixed-point feature data of all channels in the N channels, use the same inverse quantization method to perform inverse quantization on the fixed-point feature data of all channels in the N channels perform inverse quantification; or,
    若所述第一信息指示对所述N个通道中每个通道的定点数类型的特征数据分别进行反量化,则针对每个通道,使用该通道对应的反量化方式对该通道的定点数类型的特征数据进行反量化;或者,If the first information indicates that inverse quantization is performed on the feature data of the fixed-point type of each channel in the N channels, for each channel, use the inverse quantization method corresponding to the channel to perform the inverse quantization of the fixed-point type of the channel. inverse quantization of the feature data; or,
    若所述第一信息指示对M组通道的定点数类型的特征数据分别进行反量化,则将所述N个通道划分成M组通道,针对每一组通道,使用该组通道对应的反量化方式,对该组通道的定点数类型的特征数据进行反量化。If the first information indicates that inverse quantization is performed on the fixed-point type feature data of M groups of channels, the N channels are divided into M groups of channels, and for each group of channels, the inverse quantization corresponding to the group of channels is used. method, inverse quantization is performed on the fixed-point type feature data of the group of channels.
  37. 根据权利要求36所述的方法,其特征在于,若对所述N个通道中所有通道的定点数类型的特征数据进行反量化的反量化方式为线性均匀反量化方式,则所述使用同一种反量化方式对所述N个通道中所有通道的定点数类型的特征数据进行反量化,包括:The method according to claim 36, wherein if the inverse quantization method for inverse quantization of the fixed-point type feature data of all channels in the N channels is a linear uniform inverse quantization method, the same The inverse quantization method performs inverse quantization on the fixed-point type feature data of all channels in the N channels, including:
    解析所述第一信息,得到第一目标特征值、第一目标缩放值和第一目标量化位宽;Parsing the first information to obtain the first target feature value, the first target scaling value and the first target quantization bit width;
    根据所述第一目标特征值、第一目标缩放值和第一目标量化位宽,使用线性均匀反量化方式,对所述N个通道中所有通道的定点数类型的特征数据进行反量化。According to the first target feature value, the first target scaling value and the first target quantization bit width, a linear uniform inverse quantization method is used to perform inverse quantization on the fixed-point type feature data of all channels in the N channels.
  38. 根据权利要求36所述的方法,其特征在于,若对所述N个通道中的所有通道的定点数类型的特征数据进行反量化的反量化方式为非线性对数均匀反量化方式,则所述使用同一种反量化方式对所述N个通道中所有通道的定点数类型的特征数据进行反量化,包括:The method according to claim 36, wherein if the inverse quantization method for inverse quantization of the fixed-point type feature data of all channels in the N channels is a nonlinear logarithmic uniform inverse quantization method, then the The description uses the same inverse quantization method to perform inverse quantization on the fixed-point type feature data of all channels in the N channels, including:
    根据所述第一信息,确定第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数;According to the first information, determine the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base;
    根据所述第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数,使用所述非线性对数均匀反量化方式对所述N个通道中所有通道的定点数类型的特征数据进行反量化。According to the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first logarithmic base, the nonlinear logarithmic uniform inverse quantization method is used to determine the quantization of all channels in the N channels. The feature data of point type is inversely quantized.
  39. 根据权利要求38所述的方法,其特征在于,所述根据所述第一信息,确定第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数,包括:The method according to claim 38, wherein determining the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base according to the first information comprises:
    解析所述第一信息,得到所述第一目标特征值、第一目标缩放值和第一目标量化位宽和第一对数底数;或者,Parse the first information to obtain the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base; or,
    解析所述第一信息,得到所述第一目标特征值、第一目标缩放值、第一目标量化位宽和第一对数底数的指示信息;根据所述第一对数底数的指示信息,从预设的多个对数底数中,确定所述第一对数底数;或者,Parse the first information to obtain the indication information of the first target feature value, the first target scaling value, the first target quantization bit width and the first logarithmic base; according to the indication information of the first logarithmic base, From a plurality of preset logarithmic bases, determine the first logarithmic base; or,
    解析所述第一信息,得到所述第一目标特征值、第一目标缩放值和第一目标量化位宽,并将默认的对数底数确定为所述第一对数底数。The first information is parsed to obtain the first target feature value, the first target scaling value and the first target quantization bit width, and the default logarithmic base is determined as the first logarithmic base.
  40. 根据权利要求36所述的方法,其特征在于,若对所述N个通道中所有通道的定点数类型的特征数据进行反量化的反量化方式为非线性指数均匀反量化方式,则所述使用同一种反量化方式对所述N个通道中所有通道的定点数类型的特征数据进行反量化,包括:The method according to claim 36, wherein if the inverse quantization method for inverse quantization of the fixed-point type characteristic data of all channels in the N channels is a nonlinear exponential uniform inverse quantization method, the using The same inverse quantization method performs inverse quantization on the fixed-point type feature data of all channels in the N channels, including:
    根据所述第一信息,确定第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数;According to the first information, determine the first target feature value, the first target scaling value, the first target quantization bit width and the first exponent base;
    根据所述第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数,使用所述非线性指数均匀反量化方式,对所述N个通道中所有通道的定点数类型的特征数据进行反量化。According to the first target eigenvalue, the first target scaling value, the first target quantization bit width and the first exponential base, using the nonlinear exponential uniform inverse quantization method, the fixed-point number of all channels in the N channels Type of feature data for inverse quantization.
  41. 根据权利要求40所述的方法,其特征在于,所述根据所述第一信息,确定第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数,包括:The method according to claim 40, wherein determining the first target characteristic value, the first target scaling value, the first target quantization bit width and the first exponent base according to the first information comprises:
    解析所述第一信息,得到所述第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数;或者,Parse the first information to obtain the first target feature value, the first target scaling value, the first target quantization bit width and the first exponent base; or,
    解析所述第一信息,得到所述第一目标特征值、第一目标缩放值、第一目标量化位宽和第一指数底数的指示信息;根据所述第一指数底数的指示信息,从预设的多个指数底数中,确定所述第一指数底数;或者,Parse the first information to obtain the indication information of the first target feature value, the first target scaling value, the first target quantization bit width and the first exponent base; Among the multiple set exponent bases, determine the first exponent base; or,
    解析所述第一信息,得到所述第一目标特征值、第一目标缩放值、第一目标量化位宽,并将默认的指数底数确定为所述第一指数底数。The first information is parsed to obtain the first target characteristic value, the first target scaling value, and the first target quantization bit width, and the default exponent base is determined as the first exponent base.
  42. 根据权利要求37-41任一项所述的方法,其特征在于,所述第一目标特征值为所述N个通道中所有通道的特征数据中的一个特征值,所述第一目标缩放值为所述N个通道中所有通道的特征数据在量化时对应的缩放值,所述第一目标量化位宽为所述N个通道中所有通道的特征数据在量化时对应的量化位宽。The method according to any one of claims 37-41, wherein the first target feature value is one feature value in the feature data of all channels in the N channels, and the first target scaling value is is the scaling value corresponding to the feature data of all channels in the N channels during quantization, and the first target quantization bit width is the quantization bit width corresponding to the feature data of all channels in the N channels during quantization.
  43. 根据权利要求42所述的方法,其特征在于,所述第一目标特征值为所述N个通道中所有通道的特征数据中的最小特征值。The method according to claim 42, wherein the first target feature value is the smallest feature value in feature data of all channels in the N channels.
  44. 根据权利要求36所述的方法,其特征在于,若对所述N个通道中所有通道的定点数类型的特征数据进行反量化的反量化方式为查表反量化方式,则所述使用同一种反量化方式对所述N个通道中所有通道的定点数类型的特征数据进行反量化,包括:The method according to claim 36, wherein, if the inverse quantization method for performing inverse quantization on the fixed-point type characteristic data of all channels in the N channels is a look-up table inverse quantization method, the same The inverse quantization method performs inverse quantization on the fixed-point type feature data of all channels in the N channels, including:
    确定量化区间的索引值与量化区间的反量化值之间的第一对应关系,所述第一对应关系是基于所述N个通道中所有通道的特征数据的量化前的值和量化后的值确定的;Determine the first correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval, and the first correspondence is based on the value before quantization and the value after quantization of the characteristic data of all channels in the N channels definite;
    针对所述N个通道中所有通道的每一个定点数类型的特征数据,将该定点数类型的特征数据的值作为量化区间的索引,在所述第一对应关系中,查询该定点数类型的特征数据的值对应的目标反量化值;For the characteristic data of each fixed-point type of all channels in the N channels, the value of the characteristic data of the fixed-point type is used as the index of the quantization interval, and in the first correspondence, query the fixed-point type of the characteristic data. The target inverse quantization value corresponding to the value of the feature data;
    将所述目标反量化值,确定为该定点数类型的特征数据的浮点数类型的值。The target inverse quantization value is determined as a value of the floating point type of the feature data of the fixed point type.
  45. 根据权利要求36所述的方法,其特征在于,若对该通道对应的反量化方式为线性均匀反量化方式,则所述使用该通道对应的反量化方式对该通道的定点数类型的特征数据进行反量化,包括:The method according to claim 36, wherein if the inverse quantization method corresponding to the channel is a linear uniform inverse quantization method, the use of the inverse quantization method corresponding to the channel is used for the fixed-point type feature data of the channel. Perform inverse quantization, including:
    解析所述第一信息,得到第二目标特征值、第二目标缩放值和第二目标量化位宽;Parsing the first information to obtain a second target feature value, a second target scaling value and a second target quantization bit width;
    根据所述第二目标特征值、第二目标缩放值和第二目标量化位宽,使用所述线性均匀反量化方式,对该通道的定点数类型的特征数据进行反量化。According to the second target feature value, the second target scaling value and the second target quantization bit width, the linear uniform inverse quantization method is used to perform inverse quantization on the fixed-point type feature data of the channel.
  46. 根据权利要求36所述的方法,其特征在于,若对该通道对应的反量化方式为非线性对数均匀反量化方式,则所述使用该通道对应的反量化方式,对该通道的定点数类型的特征数据进行反量化, 包括:The method according to claim 36, wherein if the inverse quantization method corresponding to the channel is a non-linear logarithmic uniform inverse quantization method, the inverse quantization method corresponding to the channel is used, and the fixed-point number of the channel is Types of feature data for inverse quantization, including:
    根据所述第一信息,确定第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数;According to the first information, determine the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base;
    根据所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数,使用所述非线性对数均匀反量化方式,对该通道的定点数类型的特征数据进行反量化。According to the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base, using the nonlinear logarithmic uniform inverse quantization method, the fixed-point type feature data of the channel Do inverse quantization.
  47. 根据权利要求46所述的方法,其特征在于,所述根据所述第一信息,确定第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数,包括:The method according to claim 46, wherein determining the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base according to the first information comprises:
    解析所述第一信息,得到所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数;或者,Parse the first information to obtain the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base; or,
    解析所述第一信息,得到所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数的指示信息;根据所述第二对数底数的指示信息,从预设的多个对数底数中,确定所述第二对数底数;或者,Parse the first information to obtain the indication information of the second target feature value, the second target scaling value, the second target quantization bit width and the second logarithmic base; according to the indication information of the second logarithmic base, From a plurality of preset logarithmic bases, determine the second logarithmic base; or,
    解析所述第一信息,得到所述第二目标特征值、第二目标缩放值和第二目标量化位宽,并将默认的对数底数确定为所述第二对数底数。The first information is parsed to obtain the second target feature value, the second target scaling value and the second target quantization bit width, and the default logarithmic base is determined as the second logarithmic base.
  48. 根据权利要求36所述的方法,其特征在于,若该通道对应的反量化方式为非线性指数均匀反量化方式,则所述使用该通道对应的反量化方式,对该通道的定点数类型的特征数据进行反量化,包括:The method according to claim 36, wherein if the inverse quantization method corresponding to the channel is a nonlinear exponential uniform inverse quantization method, the inverse quantization method corresponding to the channel is used, and the fixed-point number type of the channel is used. Inverse quantization of feature data, including:
    根据所述第一信息,确定第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数;According to the first information, determine the second target feature value, the second target scaling value, the second target quantization bit width and the second exponent base;
    根据所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数,使用所述非线性指数均匀反量化方式,对该通道的定点数类型的特征数据进行反量化。According to the second target eigenvalue, the second target scaling value, the second target quantization bit width and the second exponential base, use the nonlinear exponential uniform inverse quantization method to inverse the feature data of the fixed-point type of the channel quantify.
  49. 根据权利要求48所述的方法,其特征在于,所述根据所述第一信息,确定第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数,包括:The method according to claim 48, wherein determining the second target characteristic value, the second target scaling value, the second target quantization bit width and the second exponent base according to the first information comprises:
    解析所述第一信息,得到所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二指数底数;或者,Parse the first information to obtain the second target feature value, the second target scaling value, the second target quantization bit width and the second exponent base; or,
    解析所述第一信息,得到所述第一信息包括所述第二目标特征值、第二目标缩放值、第二目标量化位宽和第二对数底数的指示信息;根据所述第二对数底数的指示信息,从预设的多个指数底数中,确定所述第二指数底数;或者,Parsing the first information to obtain indication information that the first information includes the second target feature value, the second target scaling value, the second target quantization bit width, and the second logarithmic base; The indication information of the number base, the second exponent base is determined from the preset multiple exponent bases; or,
    解析所述第一信息,得到所述第二目标特征值、第二目标缩放值、第二目标量化位宽,并将默认的指数底数确定为所述第二指数底数。The first information is parsed to obtain the second target characteristic value, the second target scaling value, and the second target quantization bit width, and the default exponent base is determined as the second exponent base.
  50. 根据权利要求45-49任一项所述的方法,其特征在于,所述第二目标特征值为该组通道的特征数据中的一个特征值,所述第二目标缩放值为该通道的特征数据在量化时对应的缩放值,所述第二目标量化位宽为该通道的特征数据在量化时对应的量化位宽。The method according to any one of claims 45-49, wherein the second target feature value is a feature value in the feature data of the group of channels, and the second target scaling value is a feature of the channel The scaling value corresponding to the data during quantization, and the second target quantization bit width is the quantization bit width corresponding to the characteristic data of the channel during quantization.
  51. 根据权利要求50所述的方法,其特征在于,所述第二目标特征值为该通道的特征数据中的最小特征值。The method according to claim 50, wherein the second target feature value is the smallest feature value in the feature data of the channel.
  52. 根据权利要求36所述的方法,其特征在于,若该通道对应的反量化方式为查表反量化方式,则所述使用该通道对应的反量化方式,对该通道的定点数类型的特征数据进行反量化,包括:The method according to claim 36, wherein if the inverse quantization method corresponding to the channel is a look-up table inverse quantization method, the inverse quantization method corresponding to the channel is used to obtain the fixed-point type characteristic data of the channel. Perform inverse quantization, including:
    确定量化区间的索引值与量化区间的反量化值之间的第二对应关系,所述第二对应关系是基于该通道的特征数据的量化前的值和量化后的值确定的;Determine the second correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval, and the second correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of the channel;
    针对该通道中的每一个定点数类型的特征数据,将该定点数类型的特征数据的值作为量化区间的索引,在所述第二对应关系中,查询该定点数类型的特征数据的值对应的目标反量化值;For each characteristic data of the fixed-point type in the channel, the value of the characteristic data of the fixed-point type is used as the index of the quantization interval, and in the second correspondence, query the value corresponding to the characteristic data of the fixed-point type. The target inverse quantization value of ;
    将所述目标反量化值,确定为该定点数类型的特征数据的浮点数类型的值。The target inverse quantization value is determined as a value of the floating point type of the feature data of the fixed point type.
  53. 根据权利要求36所述的方法,其特征在于,若对该组通道对应的反量化方式为线性均匀反量化方式,则所述使用该组通道对应的反量化方式对该组通道的定点数类型的特征数据进行反量化,包括:The method according to claim 36, wherein if the inverse quantization method corresponding to the group of channels is a linear uniform inverse quantization method, the use of the inverse quantization method corresponding to the group of channels is a fixed-point type of the group of channels. Inverse quantization of the feature data, including:
    解析所述第一信息,得到第三目标特征值、第三目标缩放值和第三目标量化位宽;Parsing the first information to obtain a third target feature value, a third target scaling value and a third target quantization bit width;
    根据所述第三目标特征值、第三目标缩放值和第三目标量化位宽,使用所述线性均匀反量化方式,对该组通道的定点数类型的特征数据进行反量化。According to the third target feature value, the third target scaling value and the third target quantization bit width, the linear uniform inverse quantization method is used to perform inverse quantization on the fixed-point type feature data of the group of channels.
  54. 根据权利要求36所述的方法,其特征在于,若对该组通道对应的反量化方式为非线性对数均匀反量化方式,则所述使用该组通道对应的反量化方式,对该组通道的定点数类型的特征数据进行反量化,包括:The method according to claim 36, wherein if the inverse quantization method corresponding to the group of channels is a nonlinear logarithmic uniform inverse quantization method, the inverse quantization method corresponding to the group of channels is used to perform the inverse quantization method corresponding to the group of channels The feature data of fixed-point type is inverse quantized, including:
    根据所述第一信息,确定第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数;According to the first information, determine the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base;
    根据所述第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数,使用所述非线性对数均匀反量化方式,对该组通道的定点数类型的特征数据进行反量化。According to the third target feature value, the third target scaling value, the third target quantization bit width, and the third logarithmic base, using the nonlinear logarithmic uniform inverse quantization method, the fixed-point type feature of the group of channels Data is dequantified.
  55. 根据权利要求54所述的方法,其特征在于,所述根据所述第一信息,确定第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数,包括:The method according to claim 54, wherein determining the third target characteristic value, the third target scaling value, the third target quantization bit width and the third logarithmic base according to the first information comprises:
    解析所述第一信息,得到所述第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数;或者,Parse the first information to obtain the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base; or,
    解析所述第一信息,得到所述第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数的指示信息;根据所述第三对数底数的指示信息,从预设的多个对数底数中,确定所述第三对数底数;或者,Parse the first information to obtain the indication information of the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base; according to the indication information of the third logarithmic base, From a plurality of preset logarithmic bases, determine the third logarithmic base; or,
    解析所述第一信息,得到所述第三目标特征值、第三目标缩放值和第三目标量化位宽,并将默认的对数底数确定为所述第三对数底数。The first information is parsed to obtain the third target feature value, the third target scaling value and the third target quantization bit width, and the default logarithmic base is determined as the third logarithmic base.
  56. 根据权利要求36所述的方法,其特征在于,若该组通道对应的反量化方式为非线性指数均匀反量化方式,则所述使用该组通道对应的反量化方式,对该组通道的定点数类型的特征数据进行反量化,包括:The method according to claim 36, wherein if the inverse quantization method corresponding to the group of channels is a nonlinear exponential uniform inverse quantization method, the inverse quantization method corresponding to the group of channels is used to determine the set of channels. The feature data of point type is inversely quantized, including:
    根据所述第一信息,确定第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数;According to the first information, determine the third target feature value, the third target scaling value, the third target quantization bit width and the third exponent base;
    根据所述第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数,使用所述非线性指数均匀反量化方式,对该组通道的定点数类型的特征数据进行反量化。According to the third target eigenvalue, the third target scaling value, the third target quantization bit width and the third exponential base, using the nonlinear exponential uniform inverse quantization method, the fixed-point type feature data of the group of channels is Inverse quantization.
  57. 根据权利要求56所述的方法,其特征在于,所述根据所述第一信息,确定第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数,包括:The method according to claim 56, wherein determining the third target characteristic value, the third target scaling value, the third target quantization bit width and the third exponent base according to the first information comprises:
    解析所述第一信息,得到所述第三目标特征值、第三目标缩放值、第三目标量化位宽和第三指数底数;或者,Parse the first information to obtain the third target feature value, the third target scaling value, the third target quantization bit width and the third exponent base; or,
    解析所述第一信息,得到所述第一信息包括所述第三目标特征值、第三目标缩放值、第三目标量化位宽和第三对数底数的指示信息;根据所述第三对数底数的指示信息,从预设的多个指数底数中,确定所述第三指数底数;或者,Parse the first information to obtain indication information that the first information includes the third target feature value, the third target scaling value, the third target quantization bit width and the third logarithmic base; The indication information of the number base, and the third exponent base is determined from the preset multiple exponent bases; or,
    解析所述第一信息,得到所述第三目标特征值、第三目标缩放值、第三目标量化位宽,并将默认的指数底数确定为所述第三指数底数。The first information is parsed to obtain the third target feature value, the third target scaling value, and the third target quantization bit width, and the default exponent base is determined as the third exponent base.
  58. 根据权利要求53-57任一项所述的方法,其特征在于,所述第三目标特征值为该组通道的特征数据中的一个特征值,所述第三目标缩放值为该组通道的特征数据在量化时对应的缩放值,所述第 三目标量化位宽为该组通道的特征数据在量化时对应的量化位宽。The method according to any one of claims 53-57, wherein the third target feature value is a feature value in the feature data of the group of channels, and the third target scaling value is a feature value of the group of channels. The scaling value corresponding to the feature data during quantization, and the third target quantization bit width is the quantization bit width corresponding to the feature data of the group of channels during quantization.
  59. 根据权利要求58所述的方法,其特征在于,所述第三目标特征值为该组通道的特征数据中的最小特征值。The method according to claim 58, wherein the third target eigenvalue is the smallest eigenvalue in the eigendata of the group of channels.
  60. 根据权利要求36所述的方法,其特征在于,若该组通道对应的反量化方式为查表反量化方式,则所述使用该组通道对应的反量化方式,对该组通道的定点数类型的特征数据进行反量化,包括:The method according to claim 36, wherein if the inverse quantization method corresponding to the group of channels is a look-up table inverse quantization method, the inverse quantization method corresponding to the group of channels is used, and the fixed-point number type of the group of channels is used. Inverse quantization of the feature data, including:
    确定量化区间的索引值与量化区间的反量化值之间的第三对应关系,所述第三对应关系是基于该组通道的特征数据的量化前的值和量化后的值确定的;Determine the third correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval, and the third correspondence is determined based on the value before quantization and the value after quantization of the characteristic data of the group of channels;
    针对该组通道中的每一个定点数类型的特征数据,将该定点数类型的特征数据的值作为量化区间的索引,在所述第三对应关系中,查询该定点数类型的特征数据的值对应的目标反量化值;For each fixed-point type characteristic data in the set of channels, the value of the fixed-point type characteristic data is used as the index of the quantization interval, and in the third corresponding relationship, the value of the fixed-point type characteristic data is queried. The corresponding target inverse quantization value;
    将所述目标反量化值,确定为该定点数类型的特征数据的浮点数类型的值。The target inverse quantization value is determined as a value of the floating point type of the feature data of the fixed point type.
  61. 根据权利要求44、52或60所述的方法,其特征在于,所述量化区间的索引值与量化区间的反量化值之间的目标对应关系为默认的;或者,所述第一信息包括所述量化区间的索引值与量化区间的反量化值之间的目标对应关系,所述目标对应关系包括第一对关系、第二对应关系或第三对应关系。The method according to claim 44, 52 or 60, wherein the target correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval is a default; or the first information includes the The target correspondence between the index value of the quantization interval and the inverse quantization value of the quantization interval, and the target correspondence includes a first pair, a second correspondence, or a third correspondence.
  62. 一种图像编码器,其特征在于,包括:An image encoder, comprising:
    获取单元,用于获取待编码的当前图像;an acquisition unit for acquiring the current image to be encoded;
    特征提取单元,用于将所述当前图像输入神经网络,得到所述当前图像的特征数据,所述当前图像的特征数据包括N个通道的特征数据,所述N为正整数;A feature extraction unit, configured to input the current image into a neural network to obtain feature data of the current image, where the feature data of the current image includes feature data of N channels, and N is a positive integer;
    量化单元,用于对所述N个通道中的至少一个通道的特征数据进行量化;a quantization unit, configured to quantify the feature data of at least one channel in the N channels;
    编码单元,用于对量化后的所述至少一个通道的特征数据进行编码,得到码流,所述码流中包括第一信息,所述第一信息用于指示对所述N个通道中的至少一个通道的特征数据进行反量化。The encoding unit is configured to encode the quantized feature data of the at least one channel to obtain a code stream, where the code stream includes first information, and the first information is used to indicate the The feature data of at least one channel is inverse quantized.
  63. 一种视频解码器,其特征在于,包括:A video decoder, comprising:
    解码单元,用于解码码流,得到当前图像的特征数据,所述当前图像的特征数据包括N个通道的特征数据,所述N为正整数;以及,解码码流,得到第一信息,所述第一信息用于指示对所述N个通道中的至少一个通道的特征数据进行反量化;a decoding unit, configured to decode the code stream to obtain feature data of the current image, where the feature data of the current image includes the feature data of N channels, where N is a positive integer; and, decode the code stream to obtain the first information, where the The first information is used to indicate that the feature data of at least one channel in the N channels is inversely quantized;
    反量化单元,用于根据所述第一信息,对所述至少一个通道的特征数据进行反量化。an inverse quantization unit, configured to perform inverse quantization on the feature data of the at least one channel according to the first information.
  64. 一种视频编解码系统,其特征在于,包括:A video encoding and decoding system, comprising:
    根据权利要求62所述的视频编码器;The video encoder of claim 62;
    以及根据权利要求63所述的视频解码器。and the video decoder of claim 63.
  65. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,所述计算机执行指令被处理器执行时用于实现如权利要求1至61任一项所述的方法。A computer-readable storage medium, wherein computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, are used to implement any one of claims 1 to 61. Methods.
PCT/CN2021/078522 2021-03-01 2021-03-01 Image encoding and decoding methods, encoder, decoder, and storage medium WO2022183335A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180090510.0A CN116982082A (en) 2021-03-01 2021-03-01 Image encoding/decoding method, encoder, decoder, and storage medium
PCT/CN2021/078522 WO2022183335A1 (en) 2021-03-01 2021-03-01 Image encoding and decoding methods, encoder, decoder, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/078522 WO2022183335A1 (en) 2021-03-01 2021-03-01 Image encoding and decoding methods, encoder, decoder, and storage medium

Publications (1)

Publication Number Publication Date
WO2022183335A1 true WO2022183335A1 (en) 2022-09-09

Family

ID=83153774

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/078522 WO2022183335A1 (en) 2021-03-01 2021-03-01 Image encoding and decoding methods, encoder, decoder, and storage medium

Country Status (2)

Country Link
CN (1) CN116982082A (en)
WO (1) WO2022183335A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220159097A1 (en) * 2020-11-19 2022-05-19 Steradian Semiconductors Private Limited System, Device and Method for Data Compression in a Radar System

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180350110A1 (en) * 2017-05-31 2018-12-06 Samsung Electronics Co., Ltd. Method and device for processing multi-channel feature map images
WO2018230832A1 (en) * 2017-06-15 2018-12-20 Samsung Electronics Co., Ltd. Image processing apparatus and method using multi-channel feature map
US20190042948A1 (en) * 2017-08-04 2019-02-07 Samsung Electronics Co., Ltd. Method and apparatus for generating fixed-point quantized neural network
EP3702962A1 (en) * 2019-02-26 2020-09-02 HERE Global B.V. Method and apparatus for feature point position encoding
US20200364552A1 (en) * 2019-05-13 2020-11-19 Baidu Usa Llc Quantization method of improving the model inference accuracy

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180350110A1 (en) * 2017-05-31 2018-12-06 Samsung Electronics Co., Ltd. Method and device for processing multi-channel feature map images
WO2018230832A1 (en) * 2017-06-15 2018-12-20 Samsung Electronics Co., Ltd. Image processing apparatus and method using multi-channel feature map
US20190042948A1 (en) * 2017-08-04 2019-02-07 Samsung Electronics Co., Ltd. Method and apparatus for generating fixed-point quantized neural network
EP3702962A1 (en) * 2019-02-26 2020-09-02 HERE Global B.V. Method and apparatus for feature point position encoding
US20200364552A1 (en) * 2019-05-13 2020-11-19 Baidu Usa Llc Quantization method of improving the model inference accuracy

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220159097A1 (en) * 2020-11-19 2022-05-19 Steradian Semiconductors Private Limited System, Device and Method for Data Compression in a Radar System
US11949763B2 (en) * 2020-11-19 2024-04-02 Steradian Semiconductors Private Limited System, device and method for data compression in a radar system

Also Published As

Publication number Publication date
CN116982082A (en) 2023-10-31

Similar Documents

Publication Publication Date Title
US11936884B2 (en) Coded-block-flag coding and derivation
US11677987B2 (en) Joint termination of bidirectional data blocks for parallel coding
KR102165070B1 (en) Coding of video syntax elements using context tree
EP4283993A1 (en) Video coding and decoding and model training method and apparatus
US20230064234A1 (en) Systems and methods for encoding a deep neural network
WO2023142716A1 (en) Encoding method and apparatus, real-time communication method and apparatus, device, and storage medium
WO2022183335A1 (en) Image encoding and decoding methods, encoder, decoder, and storage medium
WO2022095871A1 (en) Video processing method, video processing apparatus, smart device, and storage medium
US20210103813A1 (en) High-Level Syntax for Priority Signaling in Neural Network Compression
US9948928B2 (en) Method and apparatus for encoding an image
Wang et al. Compound image compression based on unified LZ and hybrid coding
WO2023169303A1 (en) Encoding and decoding method and apparatus, device, storage medium, and computer program product
WO2023220969A1 (en) Video encoding method and apparatus, video decoding method and apparatus, device, system, and storage medium
US20230014367A1 (en) Compression of data stream
WO2023173255A1 (en) Image encoding and decoding methods and apparatuses, device, system, and storage medium
EP4307662A1 (en) Video coding and decoding method and system, and video coder and video decoder
WO2023078204A1 (en) Data processing method and apparatus, device, readable storage medium, and program product
WO2023213074A1 (en) Point cloud processing method and apparatus, device, storage medium, and product
WO2024007843A1 (en) Encoding method and apparatus, decoding method and apparatus, and computer device
US11265579B2 (en) Systems, methods, and apparatuses for video processing
EP4333432A1 (en) Encoding method and apparatus, decoding method and apparatus, device, storage medium and computer program
WO2022155922A1 (en) Video coding method and system, video decoding method and system, video coder and video decoder
Kobayashi et al. Weighted median cut quantization and its applications
TW202349966A (en) Filtering method, filtering model training method and related apparatus
Laitinen et al. Efficient Topology Coding and Payload Partitioning Techniques for Neural Network Compression (NNC) Standard

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180090510.0

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21928426

Country of ref document: EP

Kind code of ref document: A1