WO2023051776A1 - 一种编码方法、解码方法、装置、设备及可读存储介质 - Google Patents
一种编码方法、解码方法、装置、设备及可读存储介质 Download PDFInfo
- Publication number
- WO2023051776A1 WO2023051776A1 PCT/CN2022/123194 CN2022123194W WO2023051776A1 WO 2023051776 A1 WO2023051776 A1 WO 2023051776A1 CN 2022123194 W CN2022123194 W CN 2022123194W WO 2023051776 A1 WO2023051776 A1 WO 2023051776A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- channel
- range
- codebook
- parameter
- decoding
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/13—Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/174—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a slice, e.g. a line of blocks or a group of blocks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/44—Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/91—Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
Definitions
- This invention is based on a Chinese patent application with application number 202111163092.1 and application date of September 30, 2021.
- the applicants are Migu Culture Technology Co., Ltd., China Mobile Communications Group Co., Ltd., and Peking University.
- the application name is "A Coding Method” , decoding method, device, equipment and readable storage medium", and claim the priority of this Chinese patent application, the entire content of this Chinese patent application is hereby incorporated by reference into this application.
- the present application relates to the field of communication technology, and relates to but not limited to an encoding method, decoding method, device, equipment, and a readable storage medium.
- Image compression technology based on full neural network is a research trend in recent years.
- most deep learning image compression methods use the maximum and minimum values of the entire hidden variable as the codebook range in the entropy coding algorithm.
- the distribution of the median value of each channel of the hidden variable is different, and the value in most channels Smaller, the use of a large codebook range greatly affects the encoding and decoding speed.
- Embodiments of the present application provide an encoding method, a decoding method, a device, a device, and a readable storage medium, which can improve encoding speed and decoding speed.
- the embodiment of this application provides an encoding method, including:
- Entropy encoding is performed on the target channel according to the actual character range of the target channel of the feature image and the content adaptive prior codebook range of the target channel to form a coded code stream;
- the target channel is any channel of the feature image.
- the embodiment of the present application also provides a decoding method, including:
- the decoding codebook range includes the actual character range of the channel or the content adaptive prior codebook range of the channel.
- An embodiment of the present application provides an encoding device, including:
- the first acquisition module is configured to acquire the feature image of the image to be encoded
- the second acquisition module is configured to obtain a codebook range scaling factor according to the feature image
- the third acquisition module is configured to use the codebook range scaling factor and the channel-adaptive prior codebook range of each channel to obtain the content-adaptive prior codebook range of each channel of the feature image;
- the first encoding module is configured to perform entropy encoding on the target channel according to the actual character range of the target channel of the feature image and the content adaptive prior codebook range of the target channel to form an encoded code stream;
- the target channel is any channel of the feature image.
- An embodiment of the present application provides a decoding device, including:
- the fourth obtaining module is configured to obtain the encoded code stream
- the first determining module is configured to determine the decoding codebook range according to the information in the encoded code stream
- the first decoding module is configured to use the range of the decoding codebook to perform entropy decoding on the encoded code stream;
- the decoding codebook range includes the actual character range of the channel or the content adaptive prior codebook range of the channel.
- the embodiment of the present application also provides an electronic device, including: a transceiver, a memory, a processor, and a program stored in the memory and operable on the processor.
- a transceiver When the processor executes the program, the above-mentioned coding is realized. method or steps in a decoding method.
- the embodiment of the present application further provides a readable storage medium, where a program is stored on the readable storage medium, and when the program is executed by a processor, the steps in the encoding method or decoding method as described above are implemented.
- the codebook range scaling coefficient is obtained according to the feature image of the image to be encoded, so that the codebook range scaling coefficient and the channel adaptive prior codebook range of each channel can be used to obtain the The content of each channel of the feature image is adaptive to the range of the prior codebook to form a coded stream. Since the content-adaptive prior codebook range is scaled based on the channel-adaptive prior codebook range of each channel, when encoding each channel, each channel can use The range of the codebook is encoded, so that the encoding speed can be improved.
- the decoding codebook range is determined, so that decoding can be performed within the actual character range of each channel or the content-adaptive prior codebook range of the channel, which can improve the decoding speed.
- Fig. 1 is one of the flowcharts of the encoding method provided by the embodiment of the present application.
- Fig. 2 is the second flowchart of the decoding method provided by the embodiment of the present application.
- FIG. 3 is a structural diagram of an encoding device provided in an embodiment of the present application.
- FIG. 4 is a structural diagram of a decoding device provided by an embodiment of the present application.
- Fig. 1 is a flow chart of the encoding method provided by the embodiment of the present application, as shown in Fig. 1, including the following steps:
- Step 101 Obtain a feature image of an image to be encoded.
- the image to be coded is divided into a plurality of M ⁇ N sub-blocks, where M and N represent the length and width of the sub-block respectively, and both M and N are greater than 0. Then, the sub-blocks are input into the encoding sub-network to obtain the feature image.
- the values of M and N can be 512. Usually, after the image to be coded is segmented, there may still be remaining pixels.
- the image to be coded is divided into multiple sub-blocks of M ⁇ N If there are remaining pixels, the remaining pixels are complemented with 0 to obtain a complemented sub-block, wherein the length and width of the complemented sub-block are both multiples of 64.
- the multiple M ⁇ N sub-blocks and the completed sub-blocks are input into the coding sub-network to obtain the feature image.
- the encoding sub-network is a network structure that processes multiple sub-blocks to generate feature maps.
- the convolution parameters are first determined, and then the convolution parameters are mapped and associated with the convolution kernels in the encoding subnetwork to generate convolution kernels with associated parameters , and finally multiply multiple sub-blocks with the convolution kernel of the associated parameters one by one to generate a feature map corresponding to each sub-block.
- Step 102 Obtain a codebook range scaling factor according to the feature image.
- the codebook range scaling factor is used to scale the channel-adaptive prior codebook range of each channel, so as to obtain the content-adaptive prior codebook range of each channel.
- the channel-adaptive prior codebook range of each channel may be obtained in advance, or the channel-adaptive prior codebook range of each channel may be obtained when the embodiment of the present application is executed.
- a training set of a certain size (such as 800 256 ⁇ 256 training images) can be used to conduct a pre-experiment on the full neural network model of each code rate, and the training set of each channel of the model can be obtained by traversal. Character maximum and minimum values, thus forming the channel-adaptive prior codebook range for each channel.
- the codebook range scaling factor can be calculated as follows:
- n is greater than the preset value, reduce the second parameter obtained for the i-1th time or the initial second parameter to obtain the second parameter of the i-th judgment output; when n is less than the preset value, Add the second parameter obtained in the i-1th time or the initial second parameter to obtain the second parameter of the i-th judgment output.
- the preset value can be set according to actual needs, for example, set to 20 and so on.
- the second parameter of the i-th judgment is calculated according to the first formula; when n is smaller than the preset value, the i-th judgment is calculated according to the second formula The second parameter of the judgment;
- the second parameter of the first judgment output is obtained on the basis of the initial second parameter; in the second formula, it is obtained on the basis of the initial second parameter The second parameter of the first judgment output; when 2 ⁇ i ⁇ 3, in the first formula, the second parameter of the i-th judgment output is obtained on the basis of the second parameter obtained at the i-1th time; In the second formula, the second parameter of the i-th judgment output is obtained on the basis of the second parameter obtained at the i-1th time; wherein, s is a constant greater than 0.
- the second parameter for the i-th judgment is calculated according to the third formula; when n is smaller than the preset value, the second parameter for the i-th judgment is calculated according to the fourth formula.
- the second parameter of the first judgment output is obtained on the basis of the initial second parameter; in the fourth formula, on the basis of the initial second parameter Obtain the second parameter of the first judgment output; when 2 ⁇ i ⁇ 3, in the third formula, the second parameter of the i-th judgment output is obtained on the basis of the second parameter obtained at the i-1 time ; In the fourth formula, the second parameter of the i-th judgment output is obtained on the basis of the second parameter obtained at the i-1th time.
- For the second channel compare the actual character range of the second channel with the channel adaptive prior codebook range of the second channel to determine whether the actual character range of the second channel exceeds the channel self-adaptive codebook range of the second channel Adapt to t times the range of the prior codebook.
- t and n are obtained.
- the value of t obtained in the last judgment can be used as the codebook range scaling coefficient, and the obtained value of n can be used as the value of the subsequent third parameter Q.
- n when n is greater than the preset value, a certain value can be reduced on the basis of the second parameter obtained at the i-1th time or the initial second parameter, and the value can be Set as desired.
- n when n is less than the preset value, a certain value can be added on the basis of the second parameter obtained at the i-1th time or the initial second parameter, and the value can also be set as required.
- the increased or decreased values corresponding to different judgments may be the same or different. For example, if both the first judgment and the second judgment need to increase the second parameter, then the added value of the first judgment and the added value of the second judgment can be the same or different.
- Step 103 using the codebook range scaling factor and the channel-adaptive prior codebook range of each channel to obtain the content-adaptive prior codebook range of each channel of the feature image.
- the maximum value and the minimum value in the range of the channel-adaptive prior codebook of each channel are respectively multiplied by the scaling factor of the codebook range to obtain the scaled maximum value and the scaled minimum value, and A content-adaptive prior codebook range of each channel of the feature image is formed using the scaled maximum value and the scaled minimum value.
- Step 104 Perform entropy encoding on the target channel according to the actual character range of the target channel of the feature image and the content adaptive prior codebook range of the target channel to form a coded stream; wherein, the target channel is an arbitrary channel of the feature image.
- entropy coding may be performed on the target channel according to the relationship between the actual character range of the target channel of the feature image and the content-adaptive prior codebook range of the target channel in channel order. in:
- the actual character range of the target channel exceeds the range of the content-adaptive prior codebook, such as the index of the channel, the maximum and minimum values of the actual character range of the channel. If both the maximum value and the minimum value of a certain channel exceed the range of the content-adaptive prior codebook, then the information needs to include two indexes of the channel, one index indicates the maximum value, and the other index indicates the minimum value.
- the coded code stream includes any of the following:
- the codebook range scaling coefficient, the third parameter Q corresponding to the codebook range scaling coefficient, Q is an integer greater than 0, and indication information, the indication information is used to indicate the information of the first channel, the The actual character range of the first channel is larger than the content-adaptive prior codebook range of the first channel.
- the third parameter is used to represent the number of channels whose actual character range is T times larger than the range of the corresponding channel adaptive prior codebook in the feature image, where T represents the scaling parameter of the codebook range, and T is greater than or equal to 1 .
- the information of the first channel may include, for example, the index of the first channel, the maximum value and/or the minimum value of the actual character range, and the like.
- the codebook range scaling coefficient is obtained according to the feature image of the image to be encoded, so that the codebook range scaling coefficient and the channel adaptive prior codebook range of each channel can be used to obtain the
- the content of each channel of the feature image is adaptive to the range of the prior codebook to form a coded stream. Since the content-adaptive prior codebook range is scaled based on the channel-adaptive prior codebook range of each channel, when encoding each channel, each channel can use The range of the codebook is encoded, so that the encoding speed can be improved.
- Fig. 2 is a flow chart of the decoding method provided by the embodiment of the present application, as shown in Fig. 2, including the following steps:
- Step 201 Obtain an encoded code stream.
- Step 202 Determine the decoding codebook range according to the information in the encoded code stream.
- Step 203 Perform entropy decoding on the coded code stream by using the range of the decoded codebook.
- the decoding codebook range includes the actual character range of the channel or the content adaptive prior codebook range of the channel.
- decoding can be performed in combination with the above information in channel order.
- the encoded code stream includes any of the following:
- codebook range scaling coefficient the third parameter Q corresponding to the codebook range scaling coefficient, Q is an integer greater than 0, and indication information, the indication information is used to indicate the information of the first channel, and the second The actual character range of a channel is greater than the content-adaptive prior codebook range of the first channel;
- the third parameter is used to represent the number of channels whose actual character range is larger than T times the range of the corresponding channel-adaptive prior codebook in the feature image of the encoding end, T represents the scaling parameter of the codebook range, and T is greater than or equal to 1 .
- the information of the first channel may include, for example, an index of the first channel, a maximum value and/or a minimum value of an actual character range, and the like.
- the range scaling coefficient is used to obtain the scaled maximum value and the scaled minimum value, and the scaled maximum value and the scaled minimum value are used to form the content adaptive prior codebook range of each channel.
- the target channel when the content-adaptive prior codebook range of the target channel is 0, the target channel is decoded as 0; when the content-adaptive prior codebook range of the target channel is not 0, the The content of the target channel is adaptive to the range of the prior codebook to decode the target channel; the target channel is any channel.
- the encoded code stream includes: a codebook range scaling factor, the third parameter Q corresponding to the codebook range scaling factor and indication information, it is necessary to determine that the actual character range is larger than the corresponding channel adaptive prior
- the maximum and minimum values in the channel adaptive prior codebook range of each channel are respectively multiplied by the scaling coefficient of the codebook range to obtain the scaled maximum value and Scaled minimum value.
- the indication information includes the maximum value of the actual character range of the first channel, using the maximum value and the scaled minimum value of the actual character range of the first channel to form the actual character range of the first channel ;
- the indication information includes the minimum value of the actual character range of the first channel, using the scaled maximum value and the minimum value of the actual character range of the first channel to form the actual character range of the first channel ;
- the indication information includes the maximum and minimum values of the actual character range of the first channel
- using the maximum and minimum values of the actual character range of the first channel to form the actual character range of the first channel using the maximum and minimum values of the actual character range of the first channel to form the actual character range of the first channel .
- the first channel is decoded using the actual character range of the first channel.
- the second channel is a channel other than the first channel.
- the content adaptive prior codebook range of the second channel is used to decode the second channel.
- the second channel when the content adaptive prior codebook range of the second channel is 0, the second channel is decoded as 0; when the content adaptive prior codebook range of the second channel is not When 0, use the content-adaptive prior codebook range of the second channel to decode the second channel.
- the range of the channel-adaptive prior codebook of each channel may also be obtained in advance, and the range of the channel-adaptive prior codebook of each channel may also be obtained when the embodiment of the present application is executed.
- the range of the channel-adaptive prior codebook of each channel is consistent with that of the encoding end, thereby ensuring information synchronization between the encoding end and the decoding end.
- a training set of a certain size (such as: 800 256 ⁇ 256 training images) can be used to conduct pre-experiments on the full neural network model of each code rate, and the training set of each channel of the model can be obtained by traversing The character maximum and minimum values of , thus forming the channel-adaptive prior codebook range for each channel.
- the codebook range scaling coefficient is obtained according to the feature image of the image to be encoded, so that the codebook range scaling coefficient and the channel adaptive prior codebook range of each channel can be used to obtain the The content of each channel of the feature image is adaptive to the range of the prior codebook to form a coded stream. Since the content-adaptive prior codebook range is scaled based on the channel-adaptive prior codebook range of each channel, when encoding each channel, each channel can use The range of the codebook is encoded, so that the encoding speed can be improved.
- the decoding codebook range is determined, so that decoding can be performed within the actual character range of each channel or the content-adaptive prior codebook range of the channel, which can improve the decoding speed.
- FIG. 3 is a structural diagram of an encoding device provided by an embodiment of the present application. Since the principle of the encoding device to solve the problem is similar to the encoding method in the embodiment of the present application, the implementation of the encoding device can refer to the implementation of the encoding method, and the repeated description will not be repeated.
- the encoding device 300 includes:
- the first acquiring module 301 is configured to acquire a feature image of the image to be encoded
- the second obtaining module 302 is configured to obtain a codebook range scaling factor according to the feature image
- the third acquiring module 303 is configured to obtain the content-adaptive prior codebook range of each channel of the feature image by using the codebook range scaling factor and the channel-adaptive prior codebook range of each channel;
- the first encoding module 304 is configured to perform entropy encoding on the target channel according to the actual character range of the target channel of the feature image and the content adaptive prior codebook range of the target channel to form an encoded code stream; wherein , the target channel is any channel of the feature image.
- the first acquisition module 301 includes: a sub-slicing module configured to segment the image to be encoded into a plurality of M ⁇ N sub-blocks, where M and N represent the length and width of the sub-blocks respectively , M and N are both greater than 0; the processing sub-module is configured to input the sub-block into the encoding sub-network to obtain the feature image.
- the first obtaining module 301 may further include: a completion submodule configured to, when the image to be encoded has remaining pixels after being divided into a plurality of M ⁇ N sub-blocks, the remaining The pixels are completed with 0 to obtain a completed sub-block, wherein the length and width of the completed sub-block are both multiples of 64; the processing sub-module is also configured to convert the multiple sub-blocks of M ⁇ N The blocks and the completed sub-blocks are input into the encoding sub-network to obtain the feature image.
- a completion submodule configured to, when the image to be encoded has remaining pixels after being divided into a plurality of M ⁇ N sub-blocks, the remaining The pixels are completed with 0 to obtain a completed sub-block, wherein the length and width of the completed sub-block are both multiples of 64; the processing sub-module is also configured to convert the multiple sub-blocks of M ⁇ N The blocks and the completed sub-blocks are input into the encoding sub-network to obtain the feature image.
- the second acquisition module 302 is configured to perform the following process: S1: For the i-th judgment, the actual character range and channel adaptive prior codebook range of each channel of the feature image The first parameter n is obtained according to the comparison result, wherein n represents the number of channels whose actual character range is greater than t times the range of the corresponding channel-adaptive prior codebook in the feature image, and t represents the first Two parameters; S2: When n is greater than the preset value, reduce the second parameter obtained for the i-1th time or the initial second parameter to obtain the second parameter for the i-th judgment output; when n is less than the preset value value, increase the second parameter obtained for the i-1th time or the initial second parameter, and obtain the second parameter of the i-th judgment output; when the judgment end condition is not satisfied, the i value is accumulated by 1, and S1 to S2 are repeated , until the judgment end condition is met, and the second parameter obtained by the last judgment is used as the codebook range scaling coefficient; wherein,
- the third obtaining module 303 is configured to multiply the maximum and minimum values in the range of the channel-adaptive prior codebook of each channel by the scaling coefficient of the codebook range to obtain the scaled and the scaled maximum value and the scaled minimum value, and use the scaled maximum value and the scaled minimum value to form the content adaptive prior codebook range of each channel of the feature image.
- the first encoding module 304 includes: a first encoding submodule configured to not perform entropy encoding on the target channel when the content-adaptive prior codebook range of the target channel is 0;
- the second encoding submodule is configured to use the content adaptive prior codebook range or the content adaptive prior codebook range when the actual character range of the target channel is less than or equal to the content adaptive prior codebook range Perform entropy encoding on the target channel within the range of the prior codebook;
- the third encoding submodule is configured to use the target channel when the actual character range of the target channel is greater than the range of the content-adaptive prior codebook Entropy-encodes the target channel for the actual character range of .
- the encoding device may further include: a fifth obtaining module configured to obtain a channel-adaptive prior codebook range of each channel.
- the encoding device 300 provided in the embodiment of the present application can execute the above-mentioned encoding method embodiment, and its implementation principle and technical effect are similar, and will not be described here in this embodiment.
- FIG. 4 is a structural diagram of a decoding device provided by an embodiment of the present application. Since the problem-solving principle of the decoding device is similar to that of the decoding method in the embodiment of the present application, the implementation of the decoding device can refer to the implementation of the decoding method, and repeated descriptions will not be repeated.
- the decoding device 400 includes:
- the fourth obtaining module 401 is configured to obtain the encoded code stream
- the first determining module 402 is configured to determine the decoding codebook range according to the information in the encoded code stream;
- the first decoding module 403 is configured to perform entropy decoding on the encoded code stream by using the range of the decoding codebook;
- the decoding codebook range includes the actual character range of the channel or the content adaptive prior codebook range of the channel.
- the content adaptive prior codebook range of the channel is used to represent the number of channels whose actual character range is T times larger than the corresponding channel adaptive prior codebook range in the feature image of the encoding end, and T represents the Codebook range scaling parameter, T greater than or equal to 1.
- the first determination module 402 is configured to According to the codebook range scaling coefficient, the maximum value and the minimum value in the channel adaptive prior codebook range of each channel are respectively multiplied by the codebook range scaling coefficient to obtain the scaled maximum value and the scaled minimum value, and use the scaled maximum value and the scaled minimum value to form the content-adaptive prior codebook range for each channel.
- the first decoding module 403 is configured to decode the target channel as 0 when the content adaptive prior codebook range of the target channel is 0; When the codebook range is not 0, the target channel is decoded by using the content adaptive prior codebook range of the target channel; the target channel is any channel.
- the first determination module 402 when the encoded code stream includes: a codebook range scaling factor, a third parameter Q corresponding to the codebook range scaling factor, and indication information, the first determination module 402 includes: a first The acquisition submodule is configured to multiply the maximum value and the minimum value in the channel adaptive prior codebook range of each channel by the codebook range scaling coefficient respectively according to the codebook range scaling coefficient to obtain the scaled The maximum value and the scaled minimum value; the first determination submodule is configured to determine the actual character range of the first channel according to the first parameter and the indication information, and calculate the actual character range of the first channel The range is used as the decoding codebook range of the first channel; the second determining submodule is configured to use the scaled maximum value and the scaled minimum value to form the content adaptive prior codebook range of the second channel, and The content adaptive prior codebook range of the second channel is used as the decoding codebook range of the second channel, and the second channel is a channel other than the first channel.
- the first determining submodule is configured to use the maximum value of the actual character range of the first channel when the indication information includes the maximum value of the actual character range of the first channel and the scaled minimum value to form the actual character range of the first channel; when the indication information includes the minimum value of the actual character range of the first channel, use the scaled maximum value and the first channel
- the minimum value of the actual character range of the first channel forms the actual character range of the first channel; when the indication information includes the maximum and minimum values of the actual character range of the first channel, the actual character range of the first channel is used
- the maximum and minimum values of the character range form the actual character range of the first channel.
- the first decoding module 403 includes: a first decoding submodule configured to use the actual character range of the first channel to decode the first channel; a second decoding submodule configured The second channel is decoded to utilize a content-adaptive prior codebook range of the second channel.
- the second decoding submodule is configured to decode the second channel to 0 when the content-adaptive prior codebook range of the second channel is 0; When the content adaptive prior codebook range of the channel is not 0, the second channel is decoded by using the content adaptive prior codebook range of the second channel.
- the decoding device 400 provided in the embodiment of the present application can execute the above-mentioned decoding method embodiment, and its implementation principle and technical effect are similar, and will not be described here in this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
- the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
- the integrated unit is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a processor-readable storage medium.
- the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application.
- the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other various media that can store program codes.
- the embodiment of the present application also provides an electronic device, including: a transceiver, a memory, a processor, and a program stored in the memory and operable on the processor.
- a transceiver When the processor executes the program, the above-mentioned coding is realized. method or steps in a decoding method.
- the embodiment of the present application also provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, each process of the above-mentioned encoding method or decoding method embodiment can be achieved, and the same technical effect can be achieved. To avoid repetition, it is not described here.
- the readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disk, hard disk, magnetic tape, magneto optical disc (Magneto Optical disc, MO disc) etc.), optical storage (such as: laser disc (Compact Disk, CD), digital versatile disc (Digital Versatile Disc, DVD), Blu-ray Disc (Blu-ray Disc, BD), high-definition universal disc (High-Definition Versatile Disc, HVD ), etc.), and semiconductor memory (such as: ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), non- Volatile Memory (Non Volatile Memory NVM), Solid State Disk (Solid State Disk, SSD)), etc.
- magnetic storage such as floppy disk, hard disk, magnetic tape, magneto optical disc (Magneto Optical disc, MO disc) etc.
- optical storage such as: laser disc (Compac
- the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation.
- the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk, etc.) ) includes several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present application.
- a terminal which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.
- the application discloses an encoding method, a decoding method, a device, a device and a readable storage medium, which relate to the technical field of communication and can improve the encoding speed and decoding speed.
- the method includes: acquiring a feature image of an image to be encoded; obtaining a codebook range scaling factor according to the feature image; using the codebook range scaling factor and the channel adaptive prior codebook range of each channel to obtain the The content adaptive prior codebook range of each channel of the feature image; according to the actual character range of the target channel of the feature image and the content adaptive prior codebook range of the target channel, perform entropy on the target channel Encoding to form an encoded code stream; wherein, the target channel is any channel of the feature image.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
本申请公开了一种编码方法、解码方法、装置、设备及可读存储介质,涉及通信技术领域,能够提高编码速度和解码速度。该方法包括:获取待编码图像的特征图像;根据所述特征图像,得到码本范围缩放系数;利用所述码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围;根据所述特征图像的目标通道的实际字符范围和所述目标通道的内容自适应先验码本范围,对所述目标通道进行熵编码,形成编码码流;其中,所述目标通道为所述特征图像的任意通道。
Description
相关申请的交叉引用
本发明基于申请号为202111163092.1、申请日为2021年09月30日的中国专利申请提出,申请人为咪咕文化科技有限公司、中国移动通信集团有限公司、北京大学,申请名称为“一种编码方法、解码方法、装置、设备及可读存储介质”的技术方案,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
本申请涉及通信技术领域,涉及但不限于一种编码方法、解码方法、装置、设备及可读存储介质。
基于全神经网络的图像压缩技术是近年来的研究趋势。当前,多数深度学习图像压缩方法在熵编码算法上使用整个隐变量的最大值和最小值作为码本的范围,然而隐变量的每个通道中值的分布各不相同,大部分通道中的值较小,使用大的码本范围较大的影响了编解码速度。
发明内容
本申请实施例提供一种编码方法、解码方法、装置、设备及可读存储介质,能够提高编码速度和解码速度。
本申请实施例提供了一种编码方法,包括:
获取待编码图像的特征图像;
根据所述特征图像,得到码本范围缩放系数;
利用所述码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围;
根据所述特征图像的目标通道的实际字符范围和所述目标通道的内容自适应先验码本范围,对所述目标通道进行熵编码,形成编码码流;
其中,所述目标通道为所述特征图像的任意通道。
本申请实施例还提供一种解码方法,包括:
获取编码码流;
根据所述编码码流中的信息,确定解码码本范围;
利用所述解码码本范围,对所述编码码流进行熵解码;
其中,所述解码码本范围包括通道的实际字符范围或者通道的内容自适应先验码本范围。
本申请实施例提供了一种编码装置,包括:
第一获取模块,配置为获取待编码图像的特征图像;
第二获取模块,配置为根据所述特征图像,得到码本范围缩放系数;
第三获取模块,配置为利用所述码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围;
第一编码模块,配置为根据所述特征图像的目标通道的实际字符范围和所述目标通道的内容自适应先验码本范围,对所述目标通道进行熵编码,形成编码码流;
其中,所述目标通道为所述特征图像的任意通道。
本申请实施例提供了一种解码装置,包括:
第四获取模块,配置为获取编码码流;
第一确定模块,配置为根据所述编码码流中的信息,确定解码码本范围;
第一解码模块,配置为利用所述解码码本范围,对所述编码码流进行熵解码;
其中,所述解码码本范围包括通道的实际字符范围或者通道的内容自适应先验码本范围。
本申请实施例还提供一种电子设备,包括:收发机、存储器、处理器及存储在存储器上并可在处理器上运行的程序,所述处理器执行所述程序时实现如上所述的编码方法或者解码方法中的步骤。
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储程序,所述程序被处理器执行时实现如上所述的编码方法或者解码方法中的步骤。
在本申请实施例中,在编码端,根据待编码图像的特征图像得到码本范围缩放系数,从而可基于码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围,进行形成编码码流。由于内容自适应先验码本范围是基于每个通道的通道自适应先验码本范围进行缩放得到的,因此,在对每个通道进行编码时,每个通道可以使用与每个通道相适应的码本范围进行编码,从而能够提高编码速度。相应的,在解码端,确定解码码本范围,从而可在每个通道的实际字符范围或者通道的内容自适应先验码本范围进行解码,能够提高解码速度。
图1是本申请实施例提供的编码方法的流程图之一;
图2是本申请实施例提供的解码方法的流程图之二;
图3是本申请实施例提供的编码装置的结构图;
图4是本申请实施例提供的解码装置的结构图。
本申请实施例中术语“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
本申请实施例中术语“多个”是指两个或两个以上,其它量词与之类似。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,并不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
参见图1,图1是本申请实施例提供的编码方法的流程图,如图1所示,包括以下步骤:
步骤101、获取待编码图像的特征图像。
示例性地,在此步骤中,将待编码图像切分成M×N的多个子块,其中,M和N分别表示子块的长和宽,M和N均大于0。然后,将所述子块输入到编码子网络中,得到所述特征图像。在本申请实施例中,M和N可取值为512。通常情况下,待编码图像在经切分之后,还可能有剩余像素,那么,为了进一步保证编码的准确性和信息的完整性,当所述待编码图像在切分成M×N的多个子块之后具有剩余像素时,将所述剩余像素以0补全,得到补全后的子块,其中,补全后的子块的长和宽均为64的倍数。在这种情况下,将所述M×N的多个子块和补全后的子块输入到编码子网络中,得到所述特征图像。
其中,编码子网络是将多个子块处理生成特征图的网络结构。在一种可能的实现方式中,在将多个块生成特征图时,首先确定卷积参数,然后将卷积参数与编码子网络中的卷积核进行映射关联,生成关联参数的卷积核,最后将多个子块逐一与关联参数的卷积核进行相乘,生成每个子块所对应的特征图(feature map)。
步骤102、根据所述特征图像,得到码本范围缩放系数。
在本申请实施例中,所述码本范围缩放系数用于对每个通道的通道自适应先验码本范围进行缩放,以得到每个通道的内容自适应先验码本范围。
其中,在此可预先获得每个通道的通道自适应先验码本范围,也可在执行本申请实施例时获取每个通道的通道自适应先验码本范围。
示例性地,可使用一定大小的训练集(如800张256×256的训练图像)对每个码率的全神经网络模型进行预实验,通过遍历的方式获得模型的每 个通道的训练集的字符最大值和最小值,从而形成每个通道的通道自适应先验码本范围。
在此步骤中,可按照如下方式计算码本范围缩放系数:
S1:对于第i次判断,将所述特征图像的每个通道的实际字符范围和自适应先验码本范围的t倍进行比较,并根据比较结果得到第一参数n,其中,n表示所述特征图像中,实际字符范围大于对应的通道自适应先验码本范围t倍的通道个数,t表示第二参数。
S2:当n大于预设值时,减小第i-1次获得的第二参数或者初始的第二参数,得到第i次判断输出的第二参数;当n小于所述预设值时,增加第i-1次获得的第二参数或者初始的第二参数,得到第i次判断输出的第二参数。其中,预设值可根据实际需要设置,例如设置为20等。
当不满足判断结束条件时,i值累加1,并重复S1至S2,直至满足判断结束条件,并将最后一次判断得到的第二参数作为所述码本范围缩放系数;
其中,i表示当前次判断的序号,i为整数且i的初始值为1;i=1时,t=1;所述判断结束条件包括第i次判断得到的第一参数等于所述预设值,或者,i大于3。
示例性地,在所述S2中,当n大于预设值时,按照第一公式计算第i次判断的第二参数;当n小于所述预设值时,按照第二公式计算第i次判断的第二参数;
第一公式:t=t-s
i;
第二公式:t=t+s
i;
其中,当i=1时,在第一公式中,在初始的第二参数的基础上得到第1次判断输出的第二参数;在第二公式中,在初始的第二参数的基础上得到第1次判断输出的第二参数;当2≤i≤3时,在第一公式中,在第i-1次获得的第二参数的基础上获得第i次判断输出的第二参数;在第二公式中,在第i-1次获得的第二参数的基础上获得第i次判断输出的第二参数;其中,s为大于0的常数。
例如,当n大于预设值时,按照第三公式计算第i次判断的第二参数;当n小于所述预设值时,按照第四公式计算第i次判断的第二参数。
第三公式:t=t-0.5
i;
第四公式:t=t+0.5
i;
其中,其中,当i=1时,在第三公式中,在初始的第二参数的基础上得到第1次判断输出的第二参数;在第四公式中,在初始的第二参数的基础上得到第1次判断输出的第二参数;当2≤i≤3时,在第三公式中,在第i-1次获得的第二参数的基础上获得第i次判断输出的第二参数;在第四公式中,在第i-1次获得的第二参数的基础上获得第i次判断输出的第二参数。
在以上的公式中,当s=0.5时,可获得较好的编解码效果,但是,在实 际应用中,s还可取其他的数值。
在一些实施例中:
当i=1时,初始化t=1。对于特征图像的每个通道,将所述特征图像的每个通道的实际字符范围和通道自适应先验码本范围进行比较,并根据比较结果得到n。
例如,对于第1个通道,将第1个通道的实际字符范围和第1个通道的通道自适应先验码本范围进行比较,判断第1个通道的实际字符范围是否超过第1个通道的通道自适应先验码本范围的t倍。此时,t=1。若第1个通道的实际字符范围超过第1个通道的通道自适应先验码本范围的t倍,则n=1。对于第2个通道,将第2个通道的实际字符范围和第2个通道的通道自适应先验码本范围进行比较,判断第2个通道的实际字符范围是否超过第2个通道的通道自适应先验码本范围的t倍。此时,t=1。若第2个通道的实际字符范围超过第2个通道的通道自适应先验码本范围的t倍,则n值加1,否则n保持不变。以此类推,直到判断完所有的通道,得到最后的n值。当n>20时,按照第一公式计算t,执行后续过程;当n<20时,按照第二公式计算t,执行后续过程;n=20时,则结束循环,此时t=1,n=20。
当i=2时,t的取值为i=1时计算得到的t值。对于第1个通道,将第1个通道的实际字符范围和第1个通道的通道自适应先验码本范围进行比较,判断第1个通道的实际字符范围是否超过第1个通道的通道自适应先验码本范围的t倍。若第1个通道的实际字符范围超过第1个通道的通道自适应先验码本范围的t倍,则n=1。对于第2个通道,将第2个通道的实际字符范围和第2个通道的通道自适应先验码本范围进行比较,判断第2个通道的实际字符范围是否超过第2个通道的通道自适应先验码本范围的t倍。若第2个通道的实际字符范围超过第2个通道的通道自适应先验码本范围的t倍,则n值加1,否则n保持不变。以此类推,直到判断完所有的通道,得到最后的n值。当n>20时,按照第一公式计算t,执行后续过程;当n<20时,按照第二公式计算t,执行后续过程;n=20时,则结束循环,按照上述方式得到t和n=20。
当i=3时,t的取值为i=2时计算得到的t值。对于第1个通道,将第1个通道的实际字符范围和第1个通道的通道自适应先验码本范围进行比较,判断第1个通道的实际字符范围是否超过第1个通道的通道自适应先验码本范围的t倍。若第1个通道的实际字符范围超过第1个通道的通道自适应先验码本范围的t倍,则n=1。对于第2个通道,将第2个通道的实际字符范围和第2个通道的通道自适应先验码本范围进行比较,判断第2个通道的实际字符范围是否超过第2个通道的通道自适应先验码本范围的t倍。若第2个通道的实际字符范围超过第2个通道的通道自适应先验码本范围的t倍,则n值加1,否则n保持不变。以此类推,直到判断完所有的通道,得到最后的n值。当n>20时,按照第一公式计算t,结束过程;当n<20时, 按照第二公式计算t,结束过程;n=20时,则结束循环,按照上述方式得到t和n=20。
按照上述过程,得到t和n。最后一次判断得到的t的值可作为码本范围缩放系数,得到n的值可作为后续的第三参数Q的值。
或者,在实际应用中,对于第i次判断,当n大于预设值时,可在第i-1次获得的第二参数或者初始的第二参数的基础上减少某个数值,该数值可根据需要设置。对于第i次判断,当n小于预设值时,可在第i-1次获得的第二参数或者初始的第二参数的基础上增加某个数值,该数值也可根据需要设置。同时,不同次判断对应的增加或者减小的数值可相同,也可不同。例如,第一次判断和第二次判断都需要增加第二参数,那么,第一次判断的增加值和第二次判断的增加值可相同或者不同。
步骤103、利用所述码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围。
示例性地的,将每个通道的通道自适应先验码本范围中的最大值和最小值分别乘以所述码本范围缩放系数,得到缩放后的最大值和缩放后的最小值,并利用缩放后的最大值和缩放后的最小值,形成所述特征图像的每个通道的内容自适应先验码本范围。
步骤104、根据所述特征图像的目标通道的实际字符范围和所述目标通道的内容自适应先验码本范围,对所述目标通道进行熵编码,形成编码码流;其中,所述目标通道为所述特征图像的任意通道。
在此步骤中,按通道顺序,可根据所述特征图像的目标通道的实际字符范围和所述目标通道的内容自适应先验码本范围之间的关系,对所述目标通道进行熵编码。其中:
(1)当所述目标通道的内容自适应先验码本范围为0时,不对所述目标通道进行熵编码。
(2)当所述目标通道的实际字符范围小于或等于所述内容自适应先验码本范围内时,利用所述内容自适应先验码本范围或者所述内容自适应先验码本范围内对所述目标通道进行熵编码。
(3)当所述目标通道的实际字符范围大于所述内容自适应先验码本范围时,利用所述目标通道的实际字符范围对所述目标通道进行熵编码。
在这种情况下,还需向解码端指示目标通道的实际字符范围超出内容自适应先验码本范围的信息,如通道的索引,该通道的实际字符范围的最大值、最小值。如果某个通道的最大值和最小值均超出内容自适应先验码本范围,那么,在该信息中需包括两个该通道的索引,一个索引指示最大值,另一个索引指示最小值。
基于以上描述,在本申请实施例中,所述编码码流中包括以下任意一项:
(1)所述码本范围缩放系数和所述码本范围缩放系数对应的第三参数 Q,Q=0。也即,在这种情况下,所有通道的实际字符范围都位于该通道对应的内容自适应先验码本范围内。
(2)所述码本范围缩放系数,所述码本范围缩放系数对应的第三参数Q,Q为大于0的整数,以及指示信息,所述指示信息用于指示第一通道的信息,所述第一通道的实际字符范围大于所述第一通道的内容自适应先验码本范围。
所述第三参数用于表示所述特征图像中,实际字符范围大于对应的通道自适应先验码本范围T倍的通道个数,T表示所述码本范围缩放参数,T大于或等于1。第一通道的信息例如可包括第一通道的索引,实际字符范围的最大值和/或最小值等。
在本申请实施例中,在编码端,根据待编码图像的特征图像得到码本范围缩放系数,从而可基于码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围,进行形成编码码流。由于内容自适应先验码本范围是基于每个通道的通道自适应先验码本范围进行缩放得到的,因此,在对每个通道进行编码时,每个通道可以使用与每个通道相适应的码本范围进行编码,从而能够提高编码速度。
参见图2,图2是本申请实施例提供的解码方法的流程图,如图2所示,包括以下步骤:
步骤201、获取编码码流。
步骤202、根据所述编码码流中的信息,确定解码码本范围。
步骤203、利用所述解码码本范围,对所述编码码流进行熵解码。
其中,所述解码码本范围包括通道的实际字符范围或者通道的内容自适应先验码本范围。在实际应用中,可按通道顺序并结合上述信息进行解码。
如前所述,所述编码码流中包括以下任意一项:
(1)码本范围缩放系数和所述码本范围缩放系数对应的第三参数Q,Q=0;
(2)码本范围缩放系数,所述码本范围缩放系数对应的第三参数Q,Q为大于0的整数,以及指示信息,所述指示信息用于指示第一通道的信息,所述第一通道的实际字符范围大于所述第一通道的内容自适应先验码本范围;
所述第三参数用于表示编码端的特征图像中,实际字符范围大于对应的通道自适应先验码本范围T倍的通道个数,T表示所述码本范围缩放参数,T大于或等于1。所述第一通道的信息例如可包括第一通道的索引,实际字符范围的最大值和/或最小值等。
对于以上两种不同的情况,可有不同的方式确定解码码本范围。
(1)当所述编码码流中包括:码本范围缩放系数和所述码本范围缩放 系数对应的第三参数Q,Q=0时,由于所有通道的实际字符范围都位于该通道对应的内容自适应先验码本范围内,因此,在此可根据所述码本范围缩放系数,将每个通道的通道自适应先验码本范围中的最大值和最小值分别乘以所述码本范围缩放系数,得到缩放后的最大值和缩放后的最小值,并利用缩放后的最大值和缩放后的最小值,形成每个通道的内容自适应先验码本范围。
在此情况下,当目标通道的内容自适应先验码本范围为0时,将所述目标通道解码为0;当目标通道的内容自适应先验码本范围不为0时,利用所述目标通道的内容自适应先验码本范围对所述目标通道进行解码;所述目标通道为任意通道。
(2)当所述编码码流中包括:码本范围缩放系数,所述码本范围缩放系数对应的第三参数Q以及指示信息时,需要确定出实际字符范围大于对应的通道自适应先验码本范围T倍的通道即第一通道,以及第二通道(除第一通道之外的通道),再针对不同类型的通道确定出对应的解码码本,进而解码。
示例性地,包括如下过程:
(1)根据所述码本范围缩放系数,将每个通道的通道自适应先验码本范围中的最大值和最小值分别乘以所述码本范围缩放系数,得到缩放后的最大值和缩放后的最小值。
(2)根据所述第一参数和所述指示信息,确定所述第一通道的实际字符范围,并将所述第一通道的实际字符范围作为所述第一通道的解码码本范围。
根据所述第一参数的位置,确定所述指示信息在编码码流中的位置。然后,读取该指示信息获取第一通道的信息,如索引,最大值和/或最小值,并依据索引确定该第一通道。之后,再确定该第一通道的实际字符范围,具体的:
当所述指示信息包括所述第一通道的实际字符范围的最大值时,利用所述第一通道的实际字符范围的最大值和缩放后的最小值,形成所述第一通道的实际字符范围;
当所述指示信息包括所述第一通道的实际字符范围的最小值时,利用缩放后的最大值和所述第一通道的实际字符范围的最小值,形成所述第一通道的实际字符范围;
当所述指示信息包括所述第一通道的实际字符范围的最大值和最小值时,利用所述第一通道的实际字符范围的最大值和最小值,形成所述第一通道的实际字符范围。
也即,在上述过程中,利用指示信息中指示的最大值和/或最小值,更新前述(1)中获得的缩放后的最大值和/或缩放后的最小值
对于第一通道,利用所述第一通道的实际字符范围,对所述第一通道 进行解码。
(3)利用缩放后的最大值和缩放后的最小值,形成第二通道的内容自适应先验码本范围,并将第二通道的内容自适应先验码本范围作为所述第二通道的解码码本范围,所述第二通道为除所述第一通道之外的通道。
其中,前述(1)和(2)之间并无严格的先后顺序关系。如果某个通道的索引没有出现在指示信息中,那么,该通道即可被认为是第二通道。
对于第二通道,利用所述第二通道的内容自适应先验码本范围,对所述第二通道进行解码。
示例性地,当所述第二通道的内容自适应先验码本范围为0时,将所述第二通道解码为0;当所述第二通道的内容自适应先验码本范围不为0时,利用所述第二通道的内容自适应先验码本范围对所述第二通道进行解码。
其中,在本申请实施例中,也可预先获得每个通道的通道自适应先验码本范围,也可在执行本申请实施例时获取每个通道的通道自适应先验码本范围。该每个通道的通道自适应先验码本范围与编码端的一致,从而保证编码端和解码端的信息同步。
示例性地,可使用一定大小的训练集(如:800张256×256的训练图像)对每个码率的全神经网络模型进行预实验,通过遍历的方式获得模型的每个通道的训练集的字符最大值和最小值,从而形成每个通道的通道自适应先验码本范围。
在本申请实施例中,在编码端,根据待编码图像的特征图像得到码本范围缩放系数,从而可基于码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围,进行形成编码码流。由于内容自适应先验码本范围是基于每个通道的通道自适应先验码本范围进行缩放得到的,因此,在对每个通道进行编码时,每个通道可以使用与每个通道相适应的码本范围进行编码,从而能够提高编码速度。相应的,在解码端,确定解码码本范围,从而可在每个通道的实际字符范围或者通道的内容自适应先验码本范围进行解码,能够提高解码速度。
与其它的全神经网路图像编码熵编解码器如NIC-0.3的熵编解码器相比,利用本申请实施例的方案,可以实现内容、通道双自适应的熵编码,提升了编解码效率,且率失真性能损失在可接受范围内。在引入了新的熵编解码算法后,全神经网络图像编码器的编码、解码速度获得大幅提升,其中编码时间节约了51%(在Kodak测试集上取平均,下同),解码时间节约了47%,且率失真损失仅为0.8%。
本申请实施例还提供了一种编码装置。参见图3,图3是本申请实施例提供的编码装置的结构图。由于编码装置解决问题的原理与本申请实施例中编码方法相似,因此该编码装置的实施可以参见编码方法的实施,重复之处不再描述。
如图3所示,编码装置300包括:
第一获取模块301,配置为获取待编码图像的特征图像;
第二获取模块302,配置为根据所述特征图像,得到码本范围缩放系数;
第三获取模块303,配置为利用所述码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围;
第一编码模块304,配置为根据所述特征图像的目标通道的实际字符范围和所述目标通道的内容自适应先验码本范围,对所述目标通道进行熵编码,形成编码码流;其中,所述目标通道为所述特征图像的任意通道。
在一些实施例中,所述第一获取模块301包括:切分子模块,配置为将所述待编码图像切分成M×N的多个子块,其中,M和N分别表示子块的长和宽,M和N均大于0;处理子模块,配置为将所述子块输入到编码子网络中,得到所述特征图像。
在一些实施例中,所述第一获取模块301还可包括:补全子模块,配置为当所述待编码图像在切分成M×N的多个子块之后具有剩余像素时,将所述剩余像素以0补全,得到补全后的子块,其中,补全后的子块的长和宽均为64的倍数;所述处理子模块,还配置为将所述M×N的多个子块和所述补全后的子块输入到编码子网络中,得到所述特征图像。
在一些实施例中,所述第二获取模块302,配置为执行如下过程:S1:对于第i次判断,将所述特征图像的每个通道的实际字符范围和通道自适应先验码本范围的t倍进行比较,并根据比较结果得到第一参数n,其中,n表示所述特征图像中,实际字符范围大于对应的通道自适应先验码本范围t倍的通道个数,t表示第二参数;S2:当n大于预设值时,减小第i-1次获得的第二参数或者初始的第二参数,得到第i次判断输出的第二参数;当n小于所述预设值时,增加第i-1次获得的第二参数或者初始的第二参数,得到第i次判断输出的第二参数;当不满足判断结束条件时,i值累加1,并重复S1至S2,直至满足判断结束条件,并将最后一次判断得到的第二参数作为所述码本范围缩放系数;其中,i表示当前次判断的序号,i为整数且i的初始值为1;i=1时,t=1;所述判断结束条件包括第i次判断得到的第一参数等于所述预设值,或者,i大于3。
在一些实施例中,所述第二获取模块302,配置为执行如下过程:在所述S2中,当n大于预设值时,按照第一公式计算第i次判断的第二参数;当n小于所述预设值时,按照第二公式计算第i次判断的第二参数;第一公式:t=t-s
i;第二公式:t=t+s
i;其中,当i=1时,在第一公式中,在初始的第二参数的基础上得到第1次判断输出的第二参数;在第二公式中,在初始的第二参数的基础上得到第1次判断的第二参数;当2≤i≤3时,在第一公式中,在第i-1次获得的第二参数的基础上获得第i次判断输出的第二参数;在第二公式中,在第i-1次获得的第二参数的基础上获得第i次判断 输出的第二参数;其中,s为大于0的常数。
在一些实施例中,所述第三获取模块303,配置为将每个通道的通道自适应先验码本范围中的最大值和最小值分别乘以所述码本范围缩放系数,得到缩放后的最大值和缩放后的最小值,并利用缩放后的最大值和缩放后的最小值,形成所述特征图像的每个通道的内容自适应先验码本范围。
在一些实施例中,所述第一编码模块304包括:第一编码子模块,配置为当所述目标通道的内容自适应先验码本范围为0时,不对所述目标通道进行熵编码;第二编码子模块,配置为当所述目标通道的实际字符范围小于或等于所述内容自适应先验码本范围内时,利用所述内容自适应先验码本范围或者所述内容自适应先验码本范围内对所述目标通道进行熵编码;第三编码子模块,配置为当所述目标通道的实际字符范围大于所述内容自适应先验码本范围时,利用所述目标通道的实际字符范围对所述目标通道进行熵编码。
在一些实施例中,所述编码码流中包括以下任一项:所述码本范围缩放系数和所述码本范围缩放系数对应的第三参数Q,Q=0;所述码本范围缩放系数,所述码本范围缩放系数对应的第三参数Q,Q为大于0的整数,以及指示信息,所述指示信息用于指示第一通道的信息,所述第一通道的实际字符范围大于所述第一通道的内容自适应先验码本范围;其中,所述第三参数用于表示所述特征图像中,实际字符范围大于对应的通道自适应先验码本范围T倍的通道个数,T表示所述码本范围缩放参数,T大于或等于1。
在一些实施例中,所述编码装置还可包括:第五获取模块,配置为获取每个通道的通道自适应先验码本范围。
本申请实施例提供的编码装置300,可以执行上述编码方法实施例,其实现原理和技术效果类似,本实施例此处不再描述。
本申请实施例还提供了一种解码装置。参见图4,图4是本申请实施例提供的解码装置的结构图。由于解码装置解决问题的原理与本申请实施例中解码方法相似,因此该解码装置的实施可以参见解码方法的实施,重复之处不再描述。
如图4所示,解码装置400包括:
第四获取模块401,配置为获取编码码流;
第一确定模块402,配置为根据所述编码码流中的信息,确定解码码本范围;
第一解码模块403,配置为利用所述解码码本范围,对所述编码码流进行熵解码;
其中,所述解码码本范围包括通道的实际字符范围或者通道的内容自适应先验码本范围。
在一些实施例中,所述编码码流中包括以下任一项:码本范围缩放系 数和所述码本范围缩放系数对应的第三参数Q,Q=0;码本范围缩放系数,所述码本范围缩放系数对应的第三参数Q,Q为大于0的整数,以及指示信息,所述指示信息用于指示第一通道的信息,所述第一通道的实际字符范围大于所述第一通道的内容自适应先验码本范围;所述第三参数用于表示编码端的特征图像中,实际字符范围大于对应的通道自适应先验码本范围T倍的通道个数,T表示所述码本范围缩放参数,T大于或等于1。
在一些实施例中,当所述编码码流中包括:码本范围缩放系数和所述码本范围缩放系数对应的第三参数Q,Q=0时,所述第一确定模块402,配置为根据所述码本范围缩放系数,将每个通道的通道自适应先验码本范围中的最大值和最小值分别乘以所述码本范围缩放系数,得到缩放后的最大值和缩放后的最小值,并利用缩放后的最大值和缩放后的最小值,形成每个通道的内容自适应先验码本范围。
在一些实施例中,所述第一解码模块403,配置为当目标通道的内容自适应先验码本范围为0时,将所述目标通道解码为0;当目标通道的内容自适应先验码本范围不为0时,利用所述目标通道的内容自适应先验码本范围对所述目标通道进行解码;所述目标通道为任意通道。
在一些实施例中,当所述编码码流中包括:码本范围缩放系数,所述码本范围缩放系数对应的第三参数Q以及指示信息时,所述第一确定模块402包括:第一获取子模块,配置为根据所述码本范围缩放系数,将每个通道的通道自适应先验码本范围中的最大值和最小值分别乘以所述码本范围缩放系数,得到缩放后的最大值和缩放后的最小值;第一确定子模块,配置为根据所述第一参数和所述指示信息,确定所述第一通道的实际字符范围,并将所述第一通道的实际字符范围作为所述第一通道的解码码本范围;第二确定子模块,配置为利用缩放后的最大值和缩放后的最小值,形成第二通道的内容自适应先验码本范围,并将第二通道的内容自适应先验码本范围作为所述第二通道的解码码本范围,所述第二通道为除所述第一通道之外的通道。
在一些是胜利中宏,所述第一确定子模块,配置为当所述指示信息包括所述第一通道的实际字符范围的最大值时,利用所述第一通道的实际字符范围的最大值和缩放后的最小值,形成所述第一通道的实际字符范围;当所述指示信息包括所述第一通道的实际字符范围的最小值时,利用缩放后的最大值和所述第一通道的实际字符范围的最小值,形成所述第一通道的实际字符范围;当所述指示信息包括所述第一通道的实际字符范围的最大值和最小值时,利用所述第一通道的实际字符范围的最大值和最小值,形成所述第一通道的实际字符范围。
在一些实施例中,所述第一解码模块403包括:第一解码子模块,配置为利用所述第一通道的实际字符范围,对所述第一通道进行解码;第二解码子模块,配置为利用所述第二通道的内容自适应先验码本范围,对所 述第二通道进行解码。
在一些实施例中,所述第二解码子模块,配置为当所述第二通道的内容自适应先验码本范围为0时,将所述第二通道解码为0;当所述第二通道的内容自适应先验码本范围不为0时,利用所述第二通道的内容自适应先验码本范围对所述第二通道进行解码。
本申请实施例提供的解码装置400,可以执行上述解码方法实施例,其实现原理和技术效果类似,本实施例此处不再描述。
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本申请实施例还提供一种电子设备,包括:收发机、存储器、处理器及存储在存储器上并可在处理器上运行的程序,所述处理器执行所述程序时实现如上所述的编码方法或者解码方法中的步骤。
本申请实施例还提供一种可读存储介质,可读存储介质上存储有程序,该程序被处理器执行时实现上述编码方法或者解码方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再描述。其中,所述的可读存储介质,可以是处理器能够存取的任何可用介质或数据存储设备,包括但不限于磁性存储器(例如软盘、硬盘、磁带、磁光盘(Magneto Optical disc,MO disc)等)、光学存储器(例如:激光唱片(Compact Disk,CD)、数字通用光盘(Digital Versatile Disc,DVD)、蓝光光盘(Blu-ray Disc,BD)、高清通用光盘(High-Definition Versatile Disc,HVD)等)、以及半导体存储器(例如:ROM、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、带电可擦可编程只读存储器(Electrically Erasable Programmable Read Only Memory,EEPROM)、非易失性存储器(Non Volatile Memory NVM)、固态硬盘(Solid State Disk,SSD))等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物 品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。根据这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁盘、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。
本申请公开了一种编码方法、解码方法、装置、设备及可读存储介质,涉及通信技术领域,能够提高编码速度和解码速度。该方法包括:获取待编码图像的特征图像;根据所述特征图像,得到码本范围缩放系数;利用所述码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围;根据所述特征图像的目标通道的实际字符范围和所述目标通道的内容自适应先验码本范围,对所述目标通道进行熵编码,形成编码码流;其中,所述目标通道为所述特征图像的任意通道。
Claims (22)
- 一种编码方法,包括:获取待编码图像的特征图像;根据所述特征图像,得到码本范围缩放系数;利用所述码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围;根据所述特征图像的目标通道的实际字符范围和所述目标通道的内容自适应先验码本范围,对所述目标通道进行熵编码,形成编码码流;其中,所述目标通道为所述特征图像的任意通道。
- 根据权利要求1所述的方法,其中,所述获取待编码图像的特征图像,包括:将所述待编码图像切分成M×N的多个子块,其中,M和N分别表示子块的长和宽,M和N均大于0;将所述子块输入到编码子网络中,得到所述特征图像。
- 根据权利要求2所述的方法,其中,在将所述子块输入到编码子网络中,得到所述特征图像之前,所述方法还包括:当所述待编码图像在切分成M×N的多个子块之后具有剩余像素时,将所述剩余像素以0补全,得到补全后的子块,其中,补全后的子块的长和宽均为64的倍数;所述将所述子块输入到编码子网络中,得到所述特征图像,包括:将所述M×N的多个子块和所述补全后的子块输入到编码子网络中,得到所述特征图像。
- 根据权利要求1所述的方法,其中,所述根据所述特征图像,得到码本范围缩放系数,包括:S1:对于第i次判断,将所述特征图像的每个通道的实际字符范围和通道自适应先验码本范围的t倍进行比较,并根据比较结果得到第一参数n,其中,n表示所述特征图像中,实际字符范围大于对应的通道自适应先验码本范围t倍的通道个数,t表示第二参数;S2:当n大于预设值时,减小第i-1次获得的第二参数或者初始的第二参数,得到第i次判断输出的第二参数;当n小于所述预设值时,增加第i-1次获得的第二参数或者初始的第二参数,得到第i次判断输出的第二参数;当不满足判断结束条件时,i值累加1,并重复S1至S2,直至满足判断结束条件,并将最后一次判断得到的第二参数作为所述码本范围缩放系数;其中,i表示当前次判断的序号,i为整数且i的初始值为1;i=1时,t=1;所述判断结束条件包括第i次判断得到的第一参数等于所述预设值,或 者,i大于3。
- 根据权利要求4所述的方法,其中,在所述S2中,当n大于预设值时,按照第一公式计算第i次判断的第二参数;当n小于所述预设值时,按照第二公式计算第i次判断的第二参数;第一公式:t=t-s i;第二公式:t=t+s i;其中,当i=1时,在第一公式中,在初始的第二参数的基础上得到第1次判断输出的第二参数;在第二公式中,在初始的第二参数的基础上得到第1次判断输出的第二参数;当2≤i≤3时,在第一公式中,在第i-1次获得的第二参数的基础上获得第i次判断输出的第二参数;在第二公式中,在第i-1次获得的第二参数的基础上获得第i次判断输出的第二参数;其中,s为大于0的常数。
- 根据权利要求1所述的方法,其中,所述利用所述码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围,包括:将每个通道的通道自适应先验码本范围中的最大值和最小值分别乘以所述码本范围缩放系数,得到缩放后的最大值和缩放后的最小值,并利用缩放后的最大值和缩放后的最小值,形成所述特征图像的每个通道的内容自适应先验码本范围。
- 根据权利要求1所述的方法,其中,所述根据所述特征图像的目标通道的实际字符范围和所述目标通道的内容自适应先验码本范围,对所述目标通道进行熵编码,包括:当所述目标通道的内容自适应先验码本范围为0时,不对所述目标通道进行熵编码;当所述目标通道的实际字符范围小于或等于所述内容自适应先验码本范围内时,利用所述内容自适应先验码本范围或者所述内容自适应先验码本范围内对所述目标通道进行熵编码;当所述目标通道的实际字符范围大于所述内容自适应先验码本范围时,利用所述目标通道的实际字符范围对所述目标通道进行熵编码。
- 根据权利要求1所述的方法,其中,所述编码码流中包括以下任一项:所述码本范围缩放系数和所述码本范围缩放系数对应的第三参数Q,Q=0;所述码本范围缩放系数,所述码本范围缩放系数对应的第三参数Q,Q为大于0的整数,以及指示信息,所述指示信息用于指示第一通道的信息,所述第一通道的实际字符范围大于所述第一通道的内容自适应先验码本范围;其中,所述第三参数用于表示所述特征图像中,实际字符范围大于对应的通道自适应先验码本范围T倍的通道个数,T表示所述码本范围缩放参数,T大于或等于1。
- 根据权利要求8所述的方法,其中,所述指示信息包括第一通道的索引,所述第一通道的实际字符范围的最大值和/或最小值。
- 根据权利要求1至9任一项所述的方法,其中,所述方法还包括:获取每个通道的通道自适应先验码本范围。
- 一种解码方法,包括:获取编码码流;根据所述编码码流中的信息,确定解码码本范围;利用所述解码码本范围,对所述编码码流进行熵解码;其中,所述解码码本范围包括通道的实际字符范围或者通道的内容自适应先验码本范围。
- 根据权利要求11所述的方法,其中,所述编码码流中包括以下任一项:码本范围缩放系数和所述码本范围缩放系数对应的第三参数Q,Q=0;码本范围缩放系数,所述码本范围缩放系数对应的第三参数Q,Q为大于0的整数,以及指示信息,所述指示信息用于指示第一通道的信息,所述第一通道的实际字符范围大于所述第一通道的内容自适应先验码本范围;所述第三参数用于表示编码端的特征图像中,实际字符范围大于对应的通道自适应先验码本范围T倍的通道个数,T表示所述码本范围缩放参数,T大于或等于1。
- 根据权利要求12所述的方法,其中,当所述编码码流中包括:码本范围缩放系数和所述码本范围缩放系数对应的第三参数Q,Q=0时,所述根据所述编码码流中的信息,确定解码码本范围,包括:根据所述码本范围缩放系数,将每个通道的通道自适应先验码本范围中的最大值和最小值分别乘以所述码本范围缩放系数,得到缩放后的最大值和缩放后的最小值,并利用缩放后的最大值和缩放后的最小值,形成每个通道的内容自适应先验码本范围。
- 根据权利要求13所述的方法,其中,所述利用所述解码码本范围,对所述编码码流进行熵解码,包括:当目标通道的内容自适应先验码本范围为0时,将所述目标通道解码为0;当目标通道的内容自适应先验码本范围不为0时,利用所述目标通道的内容自适应先验码本范围对所述目标通道进行解码;所述目标通道为任意通道。
- 根据权利要求12所述的方法,其中,当所述编码码流中包括:码 本范围缩放系数,所述码本范围缩放系数对应的第三参数Q以及指示信息时,所述根据所述编码码流中的信息,确定解码码本范围,包括:根据所述码本范围缩放系数,将每个通道的通道自适应先验码本范围中的最大值和最小值分别乘以所述码本范围缩放系数,得到缩放后的最大值和缩放后的最小值;根据所述第一参数和所述指示信息,确定所述第一通道的实际字符范围,并将所述第一通道的实际字符范围作为所述第一通道的解码码本范围;利用缩放后的最大值和缩放后的最小值,形成第二通道的内容自适应先验码本范围,并将第二通道的内容自适应先验码本范围作为所述第二通道的解码码本范围,所述第二通道为除所述第一通道之外的通道。
- 根据权利要求15所述的方法,其中,所述根据所述第一参数和所述指示信息,确定所述第一通道的实际字符范围,包括:当所述指示信息包括所述第一通道的实际字符范围的最大值时,利用所述第一通道的实际字符范围的最大值和缩放后的最小值,形成所述第一通道的实际字符范围;当所述指示信息包括所述第一通道的实际字符范围的最小值时,利用缩放后的最大值和所述第一通道的实际字符范围的最小值,形成所述第一通道的实际字符范围;当所述指示信息包括所述第一通道的实际字符范围的最大值和最小值时,利用所述第一通道的实际字符范围的最大值和最小值,形成所述第一通道的实际字符范围。
- 根据权利要求15所述的方法,其中,所述利用所述解码码本范围,对所述编码码流进行熵解码,包括:利用所述第一通道的实际字符范围,对所述第一通道进行解码;利用所述第二通道的内容自适应先验码本范围,对所述第二通道进行解码。
- 根据权利要求17所述的方法,其中,所述利用所述第二通道的内容自适应先验码本范围,对所述第二通道进行解码,包括:当所述第二通道的内容自适应先验码本范围为0时,将所述第二通道解码为0;当所述第二通道的内容自适应先验码本范围不为0时,利用所述第二通道的内容自适应先验码本范围对所述第二通道进行解码。
- 一种编码装置,包括:第一获取模块,配置为获取待编码图像的特征图像;第二获取模块,配置为根据所述特征图像,得到码本范围缩放系数;第三获取模块,配置为利用所述码本范围缩放系数和每个通道的通道自适应先验码本范围,得到所述特征图像的每个通道的内容自适应先验码本范围;第一编码模块,配置为根据所述特征图像的目标通道的实际字符范围和所述目标通道的内容自适应先验码本范围,对所述目标通道进行熵编码,形成编码码流;其中,所述目标通道为所述特征图像的任意通道。
- 一种解码装置,包括:第四获取模块,配置为获取编码码流;第一确定模块,配置为根据所述编码码流中的信息,确定解码码本范围;第一解码模块,配置为利用所述解码码本范围,对所述编码码流进行熵解码;其中,所述解码码本范围包括通道的实际字符范围或者通道的内容自适应先验码本范围。
- 一种电子设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序;所述处理器,用于读取存储器中的程序实现如权利要求1至10中任一项所述的编码方法中的步骤;或者实现如权利要求11至18中任一项所述的解码方法中的步骤。
- 一种可读存储介质,用于存储程序,所述程序被处理器执行时实现如权利要求1至10中任一项所述的编码方法中的步骤;或者实现如权利要求11至18中任一项所述的解码方法中的步骤。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP22875157.4A EP4412219A4 (en) | 2021-09-30 | 2022-09-30 | CODING METHOD AND APPARATUS, DECODING METHOD AND APPARATUS, DEVICE, AND READABLE STORAGE MEDIA |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111163092.1 | 2021-09-30 | ||
| CN202111163092.1A CN113766237B (zh) | 2021-09-30 | 2021-09-30 | 一种编码方法、解码方法、装置、设备及可读存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2023051776A1 true WO2023051776A1 (zh) | 2023-04-06 |
Family
ID=78798608
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/123194 Ceased WO2023051776A1 (zh) | 2021-09-30 | 2022-09-30 | 一种编码方法、解码方法、装置、设备及可读存储介质 |
Country Status (3)
| Country | Link |
|---|---|
| EP (1) | EP4412219A4 (zh) |
| CN (1) | CN113766237B (zh) |
| WO (1) | WO2023051776A1 (zh) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113766237B (zh) * | 2021-09-30 | 2024-07-02 | 咪咕文化科技有限公司 | 一种编码方法、解码方法、装置、设备及可读存储介质 |
| CN114581542B (zh) * | 2022-03-04 | 2025-08-19 | 北京市商汤科技开发有限公司 | 图像预览方法及装置、电子设备和存储介质 |
| CN117036755B (zh) * | 2023-07-28 | 2025-11-21 | 上海交通大学 | 图像压缩差错检测方法及抗差错的图像压缩方法、系统 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105761269A (zh) * | 2016-03-14 | 2016-07-13 | 北京大学 | 基于多尺度区分性子空间的图像显著对象的检测方法 |
| WO2021102125A1 (en) * | 2019-11-22 | 2021-05-27 | Tencent America LLC | Method and apparatus for quantization, adaptive block partitioning and codebook coding for neural network model compression |
| US20210218997A1 (en) * | 2020-01-10 | 2021-07-15 | Nokia Technologies Oy | Cascaded Prediction-Transform Approach for Mixed Machine-Human Targeted Video Coding |
| CN113225554A (zh) * | 2021-03-17 | 2021-08-06 | 北京大学 | 一种基于神经网络的图像编解码方法、装置、存储介质及终端 |
| CN113766237A (zh) * | 2021-09-30 | 2021-12-07 | 咪咕文化科技有限公司 | 一种编码方法、解码方法、装置、设备及可读存储介质 |
Family Cites Families (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5136374A (en) * | 1990-04-03 | 1992-08-04 | At&T Bell Laboratories | Geometric vector quantization |
| US6701021B1 (en) * | 2000-11-22 | 2004-03-02 | Canadian Space Agency | System and method for encoding/decoding multidimensional data using successive approximation multi-stage vector quantization |
| US7657429B2 (en) * | 2003-06-16 | 2010-02-02 | Panasonic Corporation | Coding apparatus and coding method for coding with reference to a codebook |
| CN100527843C (zh) * | 2003-12-31 | 2009-08-12 | 中国科学院计算技术研究所 | 解码获取图像的方法 |
| US7262719B2 (en) * | 2006-01-30 | 2007-08-28 | International Business Machines Corporation | Fast data stream decoding using apriori information |
| CN100583649C (zh) * | 2007-07-23 | 2010-01-20 | 华为技术有限公司 | 矢量编/解码方法、装置及流媒体播放器 |
| US20110243437A1 (en) * | 2008-10-24 | 2011-10-06 | Solomon Systech Limited. | System and method for image compression |
| CN101742330B (zh) * | 2008-11-24 | 2013-03-27 | 北京中星微电子有限公司 | 一种图像编码方法及装置 |
| US7880647B1 (en) * | 2009-07-07 | 2011-02-01 | Silicon Motion Inc. | Huffman decoding method |
| CN101668204A (zh) * | 2009-09-25 | 2010-03-10 | 西安电子科技大学 | 免疫克隆图像压缩方法 |
| WO2012060171A1 (ja) * | 2010-11-04 | 2012-05-10 | シャープ株式会社 | 動画像符号化装置、動画像復号装置、動画像伝送システム、動画像符号化装置の制御方法、動画像復号装置の制御方法、動画像符号化装置制御プログラム、動画像復号装置制御プログラム、および記録媒体 |
| US9454972B2 (en) * | 2012-02-10 | 2016-09-27 | Panasonic Intellectual Property Corporation Of America | Audio and speech coding device, audio and speech decoding device, method for coding audio and speech, and method for decoding audio and speech |
| CN109428602A (zh) * | 2017-08-30 | 2019-03-05 | 前海中科芯片控股(深圳)有限公司 | 一种数据编码方法、装置以及存储介质 |
| CN110602494A (zh) * | 2019-08-01 | 2019-12-20 | 杭州皮克皮克科技有限公司 | 基于深度学习的图像编码、解码系统及编码、解码方法 |
| US11245903B2 (en) * | 2019-11-22 | 2022-02-08 | Tencent America LLC | Method and apparatus for quantization, adaptive block partitioning and codebook coding for neural network model compression |
| CN111901596B (zh) * | 2020-06-29 | 2021-10-22 | 北京大学 | 基于深度学习的视频混合编码与解码方法及装置、介质 |
| CN112887722B (zh) * | 2020-12-09 | 2023-03-14 | 清华大学 | 一种图像无损压缩方法 |
| CN113382265B (zh) * | 2021-05-19 | 2023-03-24 | 北京大学深圳研究生院 | 视频数据熵编码硬件实现方法、设备、介质及程序产品 |
-
2021
- 2021-09-30 CN CN202111163092.1A patent/CN113766237B/zh active Active
-
2022
- 2022-09-30 WO PCT/CN2022/123194 patent/WO2023051776A1/zh not_active Ceased
- 2022-09-30 EP EP22875157.4A patent/EP4412219A4/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105761269A (zh) * | 2016-03-14 | 2016-07-13 | 北京大学 | 基于多尺度区分性子空间的图像显著对象的检测方法 |
| WO2021102125A1 (en) * | 2019-11-22 | 2021-05-27 | Tencent America LLC | Method and apparatus for quantization, adaptive block partitioning and codebook coding for neural network model compression |
| US20210218997A1 (en) * | 2020-01-10 | 2021-07-15 | Nokia Technologies Oy | Cascaded Prediction-Transform Approach for Mixed Machine-Human Targeted Video Coding |
| CN113225554A (zh) * | 2021-03-17 | 2021-08-06 | 北京大学 | 一种基于神经网络的图像编解码方法、装置、存储介质及终端 |
| CN113766237A (zh) * | 2021-09-30 | 2021-12-07 | 咪咕文化科技有限公司 | 一种编码方法、解码方法、装置、设备及可读存储介质 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4412219A4 * |
Also Published As
| Publication number | Publication date |
|---|---|
| EP4412219A4 (en) | 2025-10-29 |
| CN113766237A (zh) | 2021-12-07 |
| CN113766237B (zh) | 2024-07-02 |
| EP4412219A1 (en) | 2024-08-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2023051776A1 (zh) | 一种编码方法、解码方法、装置、设备及可读存储介质 | |
| US11783511B2 (en) | Channel-wise autoregressive entropy models for image compression | |
| CN116506073B (zh) | 一种工业计算机平台数据快速传输方法及系统 | |
| JP6573640B2 (ja) | オーディオ・エンコーダおよびデコーダ | |
| CN107666370B (zh) | 编码方法和设备 | |
| TWI714203B (zh) | 使用在先譜係數以算術解碼和編碼現時譜係數之方法及裝置 | |
| JP2006126810A (ja) | 後方適応規則を用いた整数データの無損失適応Golomb−Rice符号化および復号化 | |
| CN110249384B (zh) | 具有索引编码和位安排的量化器 | |
| WO2021130754A1 (en) | Systems and methods of data compression | |
| CN114640354B (zh) | 数据压缩方法、装置、电子设备及计算机可读存储介质 | |
| US20220005229A1 (en) | Point cloud attribute encoding method and device, and point cloud attribute decoding method and devcie | |
| JP2017527165A (ja) | 制限されたキャリー演算による算術コーディングを遂行するための方法及び装置 | |
| JP2006129467A (ja) | 整数データの無損失適応符号化・復号化 | |
| WO2008110116A1 (fr) | Procédé et dispositif de mise en œuvre et procédé pour quantifier le codage et le décodage d'un vecteur de grille | |
| CN120730074A (zh) | 编码方式的确定方法、装置、电子设备、存储介质、程序产品 | |
| CN112735392B (zh) | 语音处理方法、装置、设备及存储介质 | |
| CN109346091B (zh) | 一种基于等长熵码字替换的压缩音频自适应隐写方法和系统 | |
| CN113365060B (zh) | 一种图像滤波方法、装置、设备及存储介质 | |
| CN113473154B (zh) | 视频编码、视频解码方法、装置及存储介质 | |
| CN107026652B (zh) | 基于分区的正整数序列压缩方法 | |
| CN119450050B (zh) | 分级编码解码方法及模型训练方法、装置、设备及介质 | |
| JP6526629B2 (ja) | 特に「レンジコーダ」又は算術圧縮による,特に圧縮画像を符号化する方法 | |
| US20240087585A1 (en) | Encoding method and apparatus, decoding method and apparatus, device, storage medium, and computer program | |
| CN102223529B (zh) | 混合维度编解码方法和装置 | |
| CN115834910A (zh) | 一种视频编码和解码方法、装置、电子设备及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22875157 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| ENP | Entry into the national phase |
Ref document number: 2022875157 Country of ref document: EP Effective date: 20240430 |