CN116489358A - Image encoding method, image encoding device, electronic equipment and storage medium - Google Patents

Image encoding method, image encoding device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116489358A
CN116489358A CN202310182725.6A CN202310182725A CN116489358A CN 116489358 A CN116489358 A CN 116489358A CN 202310182725 A CN202310182725 A CN 202310182725A CN 116489358 A CN116489358 A CN 116489358A
Authority
CN
China
Prior art keywords
quantization
path
coefficient
original
coding
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.)
Pending
Application number
CN202310182725.6A
Other languages
Chinese (zh)
Inventor
何召亮
冯伟伦
罗法蕾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202310182725.6A priority Critical patent/CN116489358A/en
Publication of CN116489358A publication Critical patent/CN116489358A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The method comprises the steps of obtaining a plurality of original coding coefficients of an image and a plurality of initial quantization paths corresponding to each original coding coefficient, and determining a quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients; the path type of the quantized path to be pruned is matched with the size of each original coding coefficient; pruning quantized paths to be pruned in a plurality of initial quantized paths to obtain at least one quantized path to be selected; determining a target quantization path from at least one quantization path to be selected based on coding performance indexes corresponding to the at least one quantization path to be selected; and carrying out quantization coding processing on the plurality of original coding coefficients based on the target quantization path to obtain coding data of the image. By utilizing the embodiment of the invention, the consumption of computing resources in the image quantization coding processing process can be reduced, and the quantization coding efficiency can be improved.

Description

Image encoding method, image encoding device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of image encoding, and in particular relates to an image encoding method, an image encoding device, electronic equipment and a storage medium.
Background
Quantization is a core process of multimedia data coding techniques for video, images, etc., and dependent scalar quantization (Dependent Quantization, DQ) is a quantization scheme employed in multimedia data coding techniques. In the related art, in the process of quantizing an image (including each frame of image in an individual image and video) based on the dependency scalar quantization, quantization paths corresponding to a plurality of coefficients to be quantized are constructed, and since each coefficient has a plurality of quantization states, and each quantization state corresponds to the next quantization state, there are 3 quantization paths, and accordingly, a large number of rate distortion losses (indexes representing coding performance of the corresponding quantization paths) corresponding to the quantization paths need to be calculated, which results in the problems of larger consumption of calculation resources, longer time consumption, lower coding efficiency and the like in the coding process of multimedia data such as images and videos in the related art.
Disclosure of Invention
The disclosure provides an image encoding method, an image encoding device, an electronic device and a storage medium, so as to at least solve the technical problems of high computing resource consumption, long time consumption, low encoding efficiency and the like in the related art. The technical scheme of the present disclosure is as follows:
According to a first aspect of embodiments of the present disclosure, there is provided an image encoding method, including:
acquiring a plurality of original coding coefficients of an image and a plurality of initial quantization paths corresponding to each original coding coefficient, wherein each initial quantization path is a path connecting a path node of a preset quantization state corresponding to each original coding coefficient with a path node of a preset quantization state corresponding to the next original coding coefficient;
determining a quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients; the path type of the quantized path to be pruned is matched with the size of each original coding coefficient;
pruning the quantized paths to be pruned in the plurality of initial quantized paths to obtain at least one quantized path to be selected;
determining a target quantization path from the at least one quantization path to be selected based on coding performance indexes corresponding to the at least one quantization path to be selected respectively;
and carrying out quantization coding processing on the plurality of original coding coefficients based on the target quantization path to obtain coded data of the image.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient;
The determining the quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients comprises:
determining a first coding coefficient of which the numerical value is in a preset coefficient interval from the plurality of original coding coefficients;
and taking the even quantization path corresponding to the first coding coefficient and the zero value quantization path corresponding to the first coding coefficient as the quantization path to be pruned.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient;
the determining the quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients comprises:
carrying out quantization processing on each original coding coefficient in the plurality of original coding coefficients to obtain first pre-quantized data corresponding to each original coding coefficient;
determining a second coding coefficient of the plurality of original coding coefficients, wherein the corresponding first pre-quantized data is located in the preset quantization coefficient interval;
And taking the even quantization path corresponding to the second coding coefficient and the zero value quantization path corresponding to the second coding coefficient as the quantization path to be pruned.
In an optional embodiment, the determining the quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients includes:
comparing each original coding coefficient in the plurality of original coding coefficients with the preset pixel threshold value to obtain a first comparison result corresponding to each original coding coefficient;
and determining the quantized paths to be pruned from the plurality of initial quantized paths based on the first comparison result.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient; the determining the quantization path to be pruned from the plurality of initial quantization paths based on the first comparison result includes:
taking a zero value quantization path corresponding to a third coding coefficient as a first pruning path when a first comparison result corresponding to any one of the plurality of original coding coefficients indicates that the value is larger than a preset pixel threshold value, wherein the third coding coefficient is an original coding coefficient which is larger than the preset pixel threshold value in the plurality of original coding coefficients;
Taking an even quantization path corresponding to a fourth coding coefficient as a second pruning path under the condition that a first comparison result corresponding to any one of the plurality of original coding coefficients indicates that the first comparison result is smaller than the preset pixel threshold value; the fourth coding coefficient is an original coding coefficient smaller than the preset pixel threshold value in the plurality of original coding coefficients;
and taking the first pruning path and the second pruning path as the quantized paths to be pruned.
In an optional embodiment, the determining the quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients includes:
carrying out quantization processing on each original coding coefficient in the plurality of original coding coefficients to obtain second pre-quantized data corresponding to each original coding coefficient;
comparing the second pre-quantized data corresponding to each original coding coefficient in the plurality of original coding coefficients with the preset quantized pixel threshold value to obtain a second comparison result corresponding to each original coding coefficient;
and determining the quantized paths to be pruned from the plurality of initial quantized paths based on the second comparison result.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient; the determining the quantization path to be pruned from the plurality of initial quantization paths based on the second comparison result includes:
taking a zero value quantization path corresponding to a fifth coding coefficient as a third pruning path when a second comparison result corresponding to any one of the plurality of original coding coefficients indicates that the corresponding second pre-quantized data is larger than a preset quantized pixel threshold value, wherein the fifth coding coefficient is an original coding coefficient of which the corresponding second pre-quantized data is larger than the preset quantized pixel threshold value;
taking an even quantization path corresponding to a sixth coding coefficient as a fourth pruning path when a second comparison result corresponding to any one of the plurality of original coding coefficients indicates that the corresponding second pre-quantization data is smaller than the preset quantization pixel threshold value; the sixth coding coefficient is an original coding coefficient of which the corresponding second pre-quantized data in the plurality of original coding coefficients is smaller than the preset quantized pixel threshold value;
And taking the third pruning path and the fourth pruning path as the quantized paths to be pruned.
In an optional embodiment, the performing, based on the target quantization path, quantization encoding processing on the plurality of original encoding coefficients, to obtain encoded data of the image includes:
according to the preset quantization state corresponding to each path node in the target quantization path, performing quantization processing on the original coding coefficient corresponding to each path node to obtain a quantized coding coefficient;
and carrying out coding processing based on the quantized coding coefficients to obtain the coded data.
According to a second aspect of embodiments of the present disclosure, there is provided an image encoding apparatus including:
the data acquisition module is configured to execute a plurality of original coding coefficients of an acquired image and a plurality of initial quantization paths corresponding to each original coding coefficient, wherein each initial quantization path is a path connecting a path node of one preset quantization state corresponding to each original coding coefficient with a path node of one preset quantization state corresponding to the next original coding coefficient;
a quantization path to be pruned determining module configured to perform determining a quantization path to be pruned among the plurality of initial quantization paths according to respective sizes of the plurality of original encoding coefficients; the path type of the quantized path to be pruned is matched with the size of each original coding coefficient;
The pruning module is configured to prune the quantized paths to be pruned in the plurality of initial quantized paths to obtain at least one quantized path to be selected;
a target quantization path determining module configured to perform determining a target quantization path from the at least one quantization path to be selected based on coding performance indexes corresponding to the at least one quantization path to be selected, respectively;
and the quantization coding processing module is configured to perform quantization coding processing on the plurality of original coding coefficients based on the target quantization path to obtain coding data of the image.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient;
the to-be-pruned quantization path determining module comprises:
a first coding coefficient determining unit configured to perform determination of a first coding coefficient whose value size is located in a preset coefficient section among the plurality of original coding coefficients;
a first quantization path to be pruned determining unit configured to perform, as the quantization paths to be pruned, an even quantization path corresponding to the first coding coefficient and a zero value quantization path corresponding to the first coding coefficient.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient;
the to-be-pruned quantization path determining module comprises:
the first quantization processing unit is configured to perform quantization processing on each original coding coefficient in the plurality of original coding coefficients to obtain first pre-quantized data corresponding to each original coding coefficient;
a second coding coefficient determining unit configured to perform determining a second coding coefficient in which corresponding first pre-quantized data is located in the preset quantization coefficient interval among the plurality of original coding coefficients;
a second quantization path to be pruned determining unit configured to perform, as the quantization path to be pruned, an even quantization path corresponding to the second coding coefficient and a zero value quantization path corresponding to the second coding coefficient.
In an alternative embodiment, the to-be-pruned quantization path determining module includes:
the first comparison unit is configured to perform comparison between each original coding coefficient in the plurality of original coding coefficients and the preset pixel threshold value to obtain a first comparison result corresponding to each original coding coefficient;
A third quantization path to be pruned determining unit configured to perform determination of the quantization path to be pruned from the plurality of initial quantization paths based on the first comparison result.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient; the third to-be-pruned quantization path determining unit includes:
a first pruning path determining unit configured to perform, as a first pruning path, a zero-value quantization path corresponding to a third coding coefficient, which is an original coding coefficient greater than a preset pixel threshold value among the plurality of original coding coefficients, in a case where a first comparison result corresponding to any one of the plurality of original coding coefficients indicates that the first comparison result is greater than the preset pixel threshold value;
a second pruning path determining unit configured to perform, as a second pruning path, an even quantization path corresponding to a fourth coding coefficient if a first comparison result corresponding to any one of the plurality of original coding coefficients indicates that the first comparison result is smaller than the preset pixel threshold; the fourth coding coefficient is an original coding coefficient smaller than the preset pixel threshold value in the plurality of original coding coefficients;
A fourth to-be-pruned quantized path determination unit configured to perform, as the to-be-pruned quantized paths, the first pruned path and the second pruned path.
In an alternative embodiment, the to-be-pruned quantization path determining module includes:
the second quantization processing unit is configured to perform quantization processing on each original coding coefficient in the plurality of original coding coefficients to obtain second pre-quantized data corresponding to each original coding coefficient;
a second comparing unit configured to perform comparison between second pre-quantized data corresponding to each original encoding coefficient in the plurality of original encoding coefficients and the preset quantized pixel threshold value, so as to obtain a second comparison result corresponding to each original encoding coefficient;
a fifth to-be-pruned quantized path determining unit configured to perform determination of the to-be-pruned quantized path from the plurality of initial quantized paths based on the second comparison result.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient; the fifth to-be-pruned quantization path determination unit includes:
A third pruning path determining unit configured to perform, as a third pruning path, a zero-value quantization path corresponding to a fifth encoding coefficient, which is an original encoding coefficient in which the corresponding second pre-quantization data in the plurality of original encoding coefficients is greater than the preset quantization pixel threshold, if the second comparison result corresponding to any one of the plurality of original encoding coefficients indicates that the corresponding second pre-quantization data is greater than the preset quantization pixel threshold;
a fourth pruning path determining unit configured to perform, as a fourth pruning path, an even quantization path corresponding to a sixth coding coefficient if a second comparison result corresponding to any one of the plurality of original coding coefficients indicates that the corresponding second pre-quantization data is smaller than the preset quantization pixel threshold; the sixth coding coefficient is an original coding coefficient of which the corresponding second pre-quantized data in the plurality of original coding coefficients is smaller than the preset quantized pixel threshold value;
a sixth to-be-pruned quantized path determining unit configured to perform the third pruning path and the fourth pruning path as the to-be-pruned quantized paths.
In an alternative embodiment, the quantization encoding processing module includes:
the third quantization processing unit is configured to perform quantization processing on the original coding coefficient corresponding to each path node according to a preset quantization state corresponding to each path node in the target quantization path to obtain a quantized coding coefficient;
and an encoding processing unit configured to perform encoding processing based on the quantized encoding coefficients to obtain the encoded data.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device, comprising: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method of any of the first aspects above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform any one of the methods of image encoding of embodiments of the present disclosure.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method according to any one of the first aspects described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the image coding process, combining the sizes of a plurality of original coding coefficients of an image, and determining a quantization path to be pruned from a plurality of initial quantization paths corresponding to each original coding coefficient; the path type of the quantized paths to be pruned is matched with the size of each original coding coefficient, the quantized paths to be pruned in a plurality of initial quantized paths are pruned to obtain at least one quantized path to be selected, coding performance indexes corresponding to the quantized paths to be selected respectively, which are obtained after pruning, are combined, path pruning with coding coefficient dimensions can be achieved, quantized paths needing to calculate coding performance indexes are effectively reduced, and then the coding performance indexes corresponding to the quantized paths to be selected are combined, and target quantized paths are screened out; and based on the target quantization path, the quantization coding process is carried out on a plurality of original coding coefficients to obtain the coding data of the image, so that the consumption of system computing resources in the image quantization coding process can be effectively reduced, the image quantization coding efficiency can be greatly improved on the basis of effectively ensuring the image coding performance, and the quality of the multimedia data such as images, videos and the like which need to be subjected to quantization coding in practical application can be greatly improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a schematic diagram of an application environment shown in accordance with an exemplary embodiment;
FIG. 2 is a flow chart illustrating an image encoding method according to an exemplary embodiment;
FIG. 3 is a flow chart illustrating a determination of a quantization path to be pruned among the plurality of initial quantization paths based on the respective sizes of the plurality of original coding coefficients, according to an exemplary embodiment;
FIG. 4 is a flowchart illustrating a method for determining the quantization path to be pruned from the plurality of initial quantization paths based on the first comparison result, according to an example embodiment;
FIG. 5 is a flow chart illustrating another determination of a quantization path to be pruned among the plurality of initial quantization paths based on the respective sizes of the plurality of original coding coefficients, according to an exemplary embodiment;
FIG. 6 is a flowchart illustrating determining the quantized path to be pruned from the plurality of initial quantized paths based on the second comparison result, according to an exemplary embodiment;
FIG. 7 is a block diagram of an image encoding apparatus according to an exemplary embodiment;
FIG. 8 is a block diagram of an electronic device for image encoding, according to an exemplary embodiment;
fig. 9 is a block diagram of another electronic device for image encoding, shown according to an exemplary embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for presentation, analyzed data, etc.) related to the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an application environment, which may optionally include a terminal 100 and a server 200, according to an exemplary embodiment.
In an alternative embodiment, taking a scenario of transmitting multimedia data such as images and videos as an example, optionally, the terminal 100 may be configured to encode the multimedia data and then transmit the encoded multimedia data to the server 200; specifically, the terminal 100 may include, but is not limited to, a smart phone, a desktop computer, a tablet computer, a notebook computer, a smart speaker, a digital assistant, an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a smart wearable device, or other type of electronic device, or may be software running on the electronic device, such as an application program, etc. Alternatively, the operating system running on the electronic device may include, but is not limited to, an android system, an IOS system, linux, windows, and the like. The server 200 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services.
In addition, it should be noted that, fig. 1 is only an application environment provided by the present disclosure, in practical application, other application environments may also be included, for example, the terminal 300 may also be included, optionally, the server may transmit encoded multimedia data to the terminal 300, and accordingly, the terminal 300 may decode the encoded multimedia data to obtain the multimedia data; optionally, the method comprises; the server may also encode the original multimedia data.
In the embodiment of the present disclosure, the terminal 100 and the server 200 may be directly or indirectly connected through a wired or wireless communication manner, which is not limited herein.
Fig. 2 is a flowchart illustrating an image encoding method according to an exemplary embodiment, and as shown in fig. 2, the image encoding method may be applied to an electronic device such as a terminal, a server, etc., and may include the steps of:
in step S201, a plurality of original encoding coefficients of an image and a plurality of initial quantization paths corresponding to each original encoding coefficient are acquired.
In an alternative embodiment, the image may be an image acquired in an image format, or may be at least one frame of image extracted from the video. The plurality of original encoding coefficients of the image may be pixel data of a plurality of pixel blocks in the image.
In a specific embodiment, each initial quantization path is a path connecting a path node of a preset quantization state corresponding to each original coding coefficient and a path node of a preset quantization state corresponding to the next original coding coefficient. In practical application, each coefficient to be quantized corresponds to a plurality of preset quantization states in the process of the dependent scalar quantization, wherein the first coefficient to be quantized corresponds to a plurality of preset quantization states including an uncoded state, a quantization state 0 and a quantization state 2; the plurality of preset quantization states corresponding to the coefficients to be quantized except the first one comprise an uncoded state, a quantization state 0, a quantization state 1, a quantization state 2 and a quantization state 3; specifically, a preset quantizer is set in the process of the scalar quantization, and the preset quantizer can determine a quantization value corresponding to the coefficient to be quantized by combining a preset quantization state corresponding to the coefficient to be quantized. The same coefficient to be quantized corresponds to different quantized values in different preset quantized states.
In the embodiment of the present disclosure, in a process of constructing a plurality of initial quantization paths by using a plurality of preset quantization states corresponding to a plurality of original coding coefficients as path nodes, the plurality of original coding coefficients are coefficients to be quantized; specifically, in constructing the plurality of initial quantization paths (DQ quantization paths), a preset scanning sequence corresponding to a plurality of original coding coefficients (a sequence of scanning original coding coefficients from an image) may be combined, a first scanned original coding coefficient is used as a first coefficient to be quantized, and so on, a next coefficient to be quantized is determined in turn, and accordingly, a path node may be constructed in turn according to a plurality of preset quantization states corresponding to each original coding coefficient, and then, since a connection between each preset quantization state corresponding to each coefficient to be quantized and a preset quantization state corresponding to a next coefficient to be quantized in a dependency scalar quantization process is determined by the coefficient state of the coefficient to be quantized and the parity of a quantization value of the next coefficient to be quantized in a corresponding preset quantization state, a quantization value of the next original coding coefficient corresponding to each original coding coefficient in a corresponding preset quantization state may be calculated by combining a preset quantizer, and then, for each quantization state of the next original coding coefficient corresponding to the corresponding original coding coefficient to the corresponding preset quantization state, a path node may be constructed in turn, and a corresponding to the pre-set quantization state of the next coefficient to be quantized in a corresponding state of the corresponding pre-set quantization state may be calculated; each initial quantization path includes a preset quantization state corresponding to each original coding coefficient of the plurality of original coding coefficients.
In a specific embodiment, there are 3 quantization paths (3 connection lines) between each path node (preset quantization state) corresponding to each coefficient to be quantized and the path node corresponding to the next coefficient to be quantized; specifically, the 3 quantization paths may include paths with quantization values of 0 corresponding to the next coefficient to be quantized; a path with an odd quantized value corresponding to the next coefficient to be quantized; the quantized value corresponding to the next coefficient to be quantized is an even number (even number other than 0) of paths. Correspondingly, the plurality of initial quantization paths corresponding to each original coding coefficient may include a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient; the zero value quantization path corresponding to each original coding coefficient can be an initial quantization path where a path with zero quantization value corresponding to a next original coding coefficient of the original coding coefficient is located; the odd quantization path corresponding to each original coding coefficient may be an initial quantization path where a path whose quantization value corresponding to a next original coding coefficient of the original coding coefficient is an odd number; the even quantization path corresponding to each original coding coefficient may be an initial quantization path where a path having an even quantization value corresponding to a next original coding coefficient of the original coding coefficient is located.
In step S203, a quantization path to be pruned is determined among a plurality of initial quantization paths according to the respective sizes of a plurality of original coding coefficients.
In a specific embodiment, the path type of the quantized path to be pruned matches the size of each original coding coefficient; accordingly, the quantization paths to be pruned can be determined among the plurality of initial quantization paths in combination with the path types of the plurality of initial quantization paths and the sizes of the plurality of original coding coefficients. In practical application, when the coefficient to be quantized (original coding coefficient) is smaller, the corresponding even quantization path has larger coding performance index; when the coefficient to be quantized is larger, the corresponding zero value quantization path has larger coding performance index, and the smaller the coding performance index is, the better the corresponding coding performance is; accordingly, the coding coefficients of the even quantization path and/or the zero value quantization path to be filtered out can be determined by combining the analysis of the coding performance indexes of the corresponding coding coefficients of a large number of sample images (a plurality of sample images) and the corresponding initial quantization path (DQ quantization path).
In an optional embodiment, determining the quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients may include:
Determining a first coding coefficient with a numerical value in a preset coefficient interval from a plurality of original coding coefficients;
and taking an even quantization path corresponding to the first coding coefficient and a zero value quantization path corresponding to the first coding coefficient in the plurality of initial quantization paths as quantization paths to be pruned.
In a specific embodiment, the preset coefficient interval may be a coding coefficient filtering interval corresponding to an even quantization path (path type) and a zero value quantization path (path type) (a coefficient interval required to filter the even quantization path and the zero value quantization path). Specifically, the preset coefficient interval may be determined based on a sample coding coefficient (an original coding coefficient of a sample image) corresponding to a first sample quantization path (DQ quantization path) among sample quantization paths (DQ quantization paths) corresponding to a plurality of sample images, where the first sample quantization path is a zero value quantization path and an even quantization path corresponding to a coding performance index greater than a preset index threshold. Specifically, in the process of determining the preset coefficient interval, a zero value quantization path and an even quantization path with larger coding performance indexes (larger than a preset index threshold value) can be determined from sample quantization paths corresponding to a plurality of sample images, and then, the upper limit value and the lower limit value of the preset coefficient interval are determined by combining the sample coding coefficients corresponding to the zero value quantization path and the even quantization path with larger coding performance indexes, so that the preset coefficient interval is determined.
In a specific embodiment, the first coding coefficient may be an original coding coefficient located in a preset coefficient interval among the plurality of original coding coefficients. Optionally, taking the preset coding coefficient interval as [ T1, T2] as an example, any original coding coefficient with a value greater than or equal to T1 and less than or equal to T2 may be used as the first coding coefficient; then, an even quantization path corresponding to the first coding coefficient and a zero value quantization path corresponding to the first coding coefficient in the plurality of initial quantization paths can be used as quantization paths to be pruned.
In the above embodiment, the first coding coefficient needing to prune the even quantization path and the zero value quantization path is screened out from the plurality of original coding coefficients by combining the preset coefficient interval, so that the path pruning of the coding coefficient dimension can be realized, the quantization path needing to calculate the coding performance index subsequently is reduced, the system calculation resource consumption can be reduced, and the image quantization coding efficiency is greatly improved.
In an alternative embodiment, as shown in fig. 3, determining the quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients may include:
in step S301, each original coding coefficient in the plurality of original coding coefficients is quantized to obtain first pre-quantized data corresponding to each original coding coefficient;
In step S303, determining a second coding coefficient of the plurality of original coding coefficients, where the corresponding first pre-quantized data is located in a preset quantization coefficient interval;
in step S305, an even quantization path corresponding to the second coding coefficient and a zero value quantization path corresponding to the second coding coefficient are used as quantization paths to be pruned.
In a specific embodiment, the preset quantization coefficient interval may be a quantization pixel filtering interval corresponding to the even quantization path and the zero-valued quantization path (a quantization coefficient interval in which the even quantization path and the zero-valued quantization path need to be filtered). Specifically, the preset quantization coefficient interval may be determined based on a quantization coding coefficient corresponding to a second sample quantization path in sample quantization paths corresponding to the plurality of sample images, where the second sample quantization path is a zero value quantization path and an even quantization path corresponding to a coding performance index greater than a preset index threshold. The quantized coded coefficients corresponding to the second sample quantization path are obtained by performing quantization processing on the sample coded coefficients corresponding to the second sample quantization path (original coded coefficients corresponding to the sample image) based on the first preset quantization step length. Specifically, after the sample coding coefficients are quantized, the numerical range of the coding coefficients corresponding to the zero value quantization path and the even quantization path can be reduced, so that the efficiency of determining the path pruning condition of the coding coefficient dimension is improved.
In a specific embodiment, each original coding coefficient may be divided by a first preset quantization step to obtain first pre-quantized data corresponding to each original coding coefficient; specifically, the first preset quantization step length may be set in combination with practical application, and optionally, the first preset quantization step length is greater than 1, so that it may be ensured that the first pre-quantized data corresponding to each original coding coefficient is smaller than the original coding coefficient. The second coding coefficient may be an original coding coefficient in which the corresponding first pre-quantized data in the plurality of original coding coefficients is located in a preset quantization coefficient interval. Optionally, taking the preset quantization coefficient interval as [ T3, T4] as an example, any corresponding original coding coefficient with the first pre-quantization data greater than or equal to T3 and less than or equal to T4 may be used as the second coding coefficient; then, an even quantization path corresponding to the second coding coefficient and a zero value quantization path corresponding to the second coding coefficient can be used as quantization paths to be pruned.
In the above embodiment, in combination with the preset quantization coefficient interval, the second coding coefficient needing to prune the even quantization path and the zero value quantization path is selected from the multiple original coding coefficients, so that the efficiency of determining the preset quantization coefficient interval can be improved on the basis of realizing the path pruning of the coding coefficient dimension, and further on the basis of improving the efficiency of determining the path pruning condition of the coding coefficient dimension, the system computing resource consumption can be effectively reduced, and the image quantization coding efficiency can be greatly improved.
In an optional embodiment, determining the quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients may include:
comparing each original coding coefficient in the plurality of original coding coefficients with a preset pixel threshold value to obtain a first comparison result corresponding to each original coding coefficient;
based on the first comparison result, a quantization path to be pruned is determined from the plurality of initial quantization paths.
In a specific embodiment, the preset pixel threshold may be a pixel filtering threshold corresponding to an even quantization path and a zero value quantization path; specifically, the preset pixel threshold may be determined based on a sample coding coefficient corresponding to a first sample quantization path among sample quantization paths corresponding to the plurality of sample images, where the first sample quantization path may be a zero value quantization path and an even quantization path corresponding to a coding performance index greater than the preset index threshold. Specifically, in the process of determining the preset pixel threshold, a zero value quantization path and an even quantization path with larger coding performance indexes (larger than the preset index threshold) can be determined from sample quantization paths corresponding to a plurality of sample images, then, a critical value of sample coding coefficients which can divide the zero value quantization path with larger coding performance indexes and the even quantization path is determined by combining sample coding coefficients corresponding to the zero value quantization path with larger coding performance indexes and the even quantization path, and the critical value is used as the preset pixel threshold.
In a specific embodiment, the first comparison result corresponding to any original coding coefficient may be used to indicate the comparison of the original coding coefficient with the size of the preset pixel threshold.
In an alternative embodiment, the initial quantization path corresponding to each original coding coefficient includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient; optionally, as shown in fig. 4, determining the quantization path to be pruned from the plurality of initial quantization paths based on the first comparison result may include:
in step S401, when the first comparison result corresponding to any one of the plurality of original encoding coefficients indicates that the first comparison result is greater than the preset pixel threshold, taking the zero value quantization path corresponding to the third encoding coefficient as the first pruning path;
in step S403, when the first comparison result corresponding to any one of the plurality of original encoding coefficients indicates that the first comparison result is smaller than the preset pixel threshold, the even quantization path corresponding to the fourth encoding coefficient is used as the second pruning path;
in step S405, the first pruning path and the second pruning path are used as quantized paths to be pruned.
In a specific embodiment, the third coding coefficient may be an original coding coefficient greater than a preset pixel threshold value in the plurality of original coding coefficients; specifically, when the first comparison result corresponding to the third coding coefficient indicates that the first comparison result is greater than the preset pixel threshold, it may be determined that the third coding coefficient is a larger coefficient to be quantized, and correspondingly, the corresponding zero quantization path has a larger coding performance index, and correspondingly, the zero quantization path corresponding to the third coding coefficient may be used as a first pruning path to be pruned, so as to prune a quantization path with poor coding performance.
In a specific embodiment, the fourth coding coefficient may be an original coding coefficient of the plurality of original coding coefficients that is smaller than a preset pixel threshold; specifically, when the first comparison result corresponding to the fourth coding coefficient indicates that the first comparison result is smaller than the preset pixel threshold, the fourth coding coefficient can be determined to be a smaller coefficient to be quantized, correspondingly, the corresponding even quantization path has a larger coding performance index, correspondingly, the even quantization path corresponding to the fourth coding coefficient can be used as a second pruning path to be pruned, and pruning of a quantization path with poor coding performance can be achieved.
In the above embodiment, by combining the first comparison results of the plurality of original coding coefficients and the preset pixel threshold, the zero-value quantization path corresponding to the third coding coefficient with poor coding performance and the even quantization path corresponding to the fourth coding coefficient with poor coding performance can be screened, and the zero-value quantization path corresponding to the third coding coefficient with poor coding performance and the even quantization path corresponding to the fourth coding coefficient with poor coding performance are used as quantization paths to be pruned, so that the rationality of pruning of paths can be ensured on the basis of reducing quantization paths required to calculate coding performance indexes in the follow-up process, and further, the performance and quality of the follow-up image quantization coding can be effectively ensured.
In addition, it should be noted that, in practical application, if only the first pruning path exists in the plurality of initial quantization paths, the first pruning path may be used as the quantization path to be pruned; alternatively, if only the second pruning path exists in the plurality of initial quantization paths, the second pruning path may be used as the quantization path to be pruned.
In the above embodiment, by combining the comparison results of the plurality of original coding coefficients and the preset pixel threshold, the path pruning of the coding coefficient dimension can be realized, the quantization path for calculating the coding performance index in the subsequent process is reduced, the system calculation resource consumption can be reduced, and the image quantization coding efficiency is greatly improved.
In an alternative embodiment, as shown in fig. 5, determining the quantization path to be pruned in the multiple initial quantization paths according to the respective sizes of the multiple original coding coefficients may include:
in step S501, each original coding coefficient in the plurality of original coding coefficients is quantized to obtain second pre-quantized data corresponding to each original coding coefficient;
in step S503, comparing the second pre-quantized data corresponding to each original coding coefficient in the plurality of original coding coefficients with a preset quantized pixel threshold value to obtain a second comparison result corresponding to each original coding coefficient;
in step S505, a quantization path to be pruned is determined from the plurality of initial quantization paths based on the second comparison result.
In a specific embodiment, the preset quantized pixel threshold may be a quantized pixel filtering threshold corresponding to an even quantized path and a zero value quantized path; specifically, the preset quantized pixel threshold may be determined based on quantized coding coefficients corresponding to a third sample quantization path (DQ quantization path) among sample quantization paths (DQ quantization paths) corresponding to the plurality of sample images, where the third sample quantization path is a zero value quantization path and an even quantization path corresponding to a coding performance index greater than the preset index threshold. The quantized coded coefficients corresponding to the third sample quantization path are obtained by performing quantization processing on the sample coded coefficients corresponding to the third sample quantization path based on a second preset quantization step length. Specifically, the second preset quantization step length may be set in combination with practical application, and optionally, the second preset quantization step length is greater than 1, so that it may be ensured that the second pre-quantized data corresponding to each original coding coefficient is smaller than the original coding coefficient. Specifically, in the process of determining the preset quantized pixel threshold, a zero value quantized path and an even quantized path with larger coding performance indexes (larger than the preset index threshold) can be determined from sample quantized paths corresponding to a plurality of sample images, then, a critical value capable of dividing the zero value quantized path with larger coding performance indexes and quantized coded coefficients corresponding to the even quantized path is determined by combining quantized coded coefficients corresponding to the zero value quantized path with larger coding performance indexes and the even quantized path, and the critical value is used as the preset quantized pixel threshold.
In a specific embodiment, the second comparison result corresponding to any original coding coefficient may be used to indicate the comparison of the original coding coefficient with the size of the preset quantized pixel threshold.
In an alternative embodiment, the plurality of initial quantization paths corresponding to each original coding coefficient includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient; accordingly, as shown in fig. 6, determining the quantization path to be pruned from the plurality of initial quantization paths based on the second comparison result may include:
in step S601, when the second comparison result corresponding to any one of the plurality of original encoding coefficients indicates that the corresponding second pre-quantized data is greater than the preset quantized pixel threshold, taking the zero value quantized path corresponding to the fifth encoding coefficient as a third pruning path;
in step S603, when the second comparison result corresponding to any one of the plurality of original encoding coefficients indicates that the corresponding second pre-quantized data is smaller than the preset quantized pixel threshold, the even quantized path corresponding to the sixth encoding coefficient is used as the fourth pruning path;
In step S605, the third pruning path and the fourth pruning path are used as quantized paths to be pruned.
In a specific embodiment, the fifth coding coefficient may be an original coding coefficient in which the corresponding second pre-quantized data in the plurality of original coding coefficients is greater than a preset quantized pixel threshold. Specifically, when the second comparison result corresponding to the fifth coding coefficient indicates that the corresponding second pre-quantized data is greater than the preset quantized pixel threshold, it may be determined that the fifth coding coefficient is a larger coefficient to be quantized, and accordingly, the corresponding zero quantization path has a larger coding performance index, and accordingly, the zero quantization path corresponding to the fifth coding coefficient may be used as a third pruning path to be pruned, and further pruning of a quantization path with poor coding performance may be achieved.
In a specific embodiment, the sixth coding coefficient may be an original coding coefficient in which the corresponding second pre-quantized data in the plurality of original coding coefficients is smaller than the preset quantized pixel threshold. Specifically, when the second comparison result corresponding to the sixth coding coefficient indicates that the corresponding second pre-quantized data is smaller than the preset quantized pixel threshold, it may be determined that the sixth coding coefficient is a smaller coefficient to be quantized, and correspondingly, the corresponding even quantization path has a relatively larger coding performance index, and correspondingly, the even quantization path corresponding to the sixth coding coefficient may be used as a fourth pruning path to be pruned, so that pruning of a quantization path with relatively poor coding performance may be achieved.
In the above embodiment, by combining the second comparison results of the second pre-quantized data corresponding to the plurality of original coding coefficients and the preset quantized pixel threshold, the zero-value quantized path corresponding to the fifth coding coefficient with poor coding performance and the even quantized path corresponding to the sixth coding coefficient with poor coding performance can be screened, and the zero-value quantized path corresponding to the fifth coding coefficient with poor coding performance and the even quantized path corresponding to the sixth coding coefficient with poor coding performance are used as the quantized paths to be pruned, so that the rationality of pruning of paths can be ensured on the basis of reducing the quantized paths required to calculate the coding performance index in the following steps, and further the performance and quality of the quantized coding of the following images can be effectively ensured.
In addition, it should be noted that, in practical application, if only the third pruning path exists in the plurality of initial quantization paths, the third pruning path may be used as the quantization path to be pruned; alternatively, if only the fourth pruning path exists in the plurality of initial quantization paths, the fourth pruning path may be used as the quantization path to be pruned.
In the above embodiment, by combining the comparison results of the second pre-quantized data corresponding to the plurality of original coding coefficients and the preset quantized pixel threshold, the path pruning of the coding coefficient dimension can be realized, the quantization path for calculating the coding performance index in the subsequent process is reduced, the system calculation resource consumption can be reduced, and the image quantization coding efficiency is greatly improved.
In step S205, pruning the quantized paths to be pruned among the plurality of initial quantized paths to obtain at least one quantized path to be selected.
In step S207, a target quantization path is determined from the at least one quantization path to be selected based on the coding performance index corresponding to each of the at least one quantization path to be selected;
in a specific embodiment, the coding performance index corresponding to any quantization path to be selected may represent coding performance corresponding to performing image coding based on the quantization coding coefficient corresponding to the quantization path to be selected; alternatively, the coding performance index may be rate distortion loss. Specifically, in the inverse quantization stage corresponding to the dependency scalar quantization, the preset quantizer may calculate the rate-distortion loss by combining the inverse quantized coding coefficient and the original coding coefficient.
In a specific embodiment, determining the target quantization path from the at least one quantization path to be selected based on the coding performance indicators corresponding to the at least one quantization path to be selected includes: and taking the path to be quantized corresponding to the minimum coding performance index as a target quantization path, thereby ensuring the coding performance of subsequent coding processing.
In step S209, quantization encoding processing is performed on the plurality of original encoding coefficients based on the target quantization path, and encoded data of the image is obtained.
In an optional embodiment, the performing quantization encoding processing on the plurality of original encoding coefficients based on the target quantization path to obtain encoded data of the image may include:
according to a preset quantization state corresponding to each path node in the target quantization path, carrying out quantization processing on the original coding coefficient corresponding to each path node to obtain a quantized coding coefficient;
and carrying out coding processing based on the quantized coding coefficients to obtain coded data.
In a specific embodiment, a preset quantizer may be combined to calculate an original coding coefficient corresponding to each path node in the target quantization path, and the quantized coding coefficient (quantized values of the plurality of original coding coefficients in the preset quantization states corresponding to the target quantization path) is obtained in the preset quantization states corresponding to the path node.
In a specific embodiment, the encoding process based on the quantized encoded coefficients may be performed to obtain encoded data by performing entropy encoding in combination with the quantized encoded coefficients; alternatively, the encoded data may be transmitted to the corresponding demander; the demander can obtain an image based on decoding the encoded data; alternatively, in the case where the image is at least one frame image extracted from the video, the at least one frame image (image) may be converted into the corresponding video.
In the above embodiment, the original encoding coefficient is quantized in combination with the preset quantization state corresponding to each path node in the target quantization path, so that the encoding performance of encoding based on the quantized encoding coefficient can be effectively improved on the basis of the data amount of multimedia data such as compressed images, videos and the like.
As can be seen from the technical solutions provided in the embodiments of the present disclosure, in the image encoding process of the embodiments of the present disclosure, the quantization paths to be pruned are determined from a plurality of initial quantization paths corresponding to each original encoding coefficient in combination with the sizes of a plurality of original encoding coefficients of an image; the path type of the quantized paths to be pruned is matched with the size of each original coding coefficient, the quantized paths to be pruned in a plurality of initial quantized paths are pruned to obtain at least one quantized path to be selected, coding performance indexes corresponding to the quantized paths to be selected respectively, which are obtained after pruning, are combined, path pruning with coding coefficient dimensions can be achieved, quantized paths needing to calculate coding performance indexes are effectively reduced, and then the coding performance indexes corresponding to the quantized paths to be selected are combined, and target quantized paths are screened out; and based on the target quantization path, the quantization coding process is carried out on a plurality of original coding coefficients to obtain the coding data of the image, so that the consumption of system computing resources in the image quantization coding process can be effectively reduced, the image quantization coding efficiency can be greatly improved on the basis of effectively ensuring the image coding performance, and the quality of the multimedia data such as images, videos and the like which need to be subjected to quantization coding in practical application can be greatly improved.
Fig. 7 is a block diagram of an image encoding apparatus according to an exemplary embodiment. Referring to fig. 7, the apparatus includes:
the data acquisition module 710 is configured to perform acquiring a plurality of original encoding coefficients of an image and a plurality of initial quantization paths corresponding to each original encoding coefficient, where each initial quantization path is a path connecting a path node where a preset quantization state corresponding to each original encoding coefficient is located with a path node where a preset quantization state corresponding to a next original encoding coefficient is located;
a quantization path to be pruned determining module 720 configured to perform determining a quantization path to be pruned among a plurality of initial quantization paths according to respective sizes of a plurality of original coding coefficients; the path type of the quantized path to be pruned is matched with the size of each original coding coefficient;
pruning module 730 configured to perform pruning of quantized paths to be pruned among the plurality of initial quantized paths to obtain at least one quantized path to be selected;
a target quantization path determining module 740 configured to perform determining a target quantization path from the at least one quantization path to be selected based on the coding performance index corresponding to each of the at least one quantization path to be selected;
The quantization encoding processing module 750 is configured to perform quantization encoding processing on the plurality of original encoding coefficients based on the target quantization path, resulting in encoded data of the image.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient;
the quantization path to be pruned determining module 720 includes:
a first coding coefficient determination unit configured to perform determination of a first coding coefficient having a value size within a preset coefficient section among a plurality of original coding coefficients;
a first quantization path to be pruned determining unit configured to perform, as quantization paths to be pruned, an even quantization path corresponding to the first coding coefficient and a zero value quantization path corresponding to the first coding coefficient.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient;
the quantization path to be pruned determining module 720 includes:
The first quantization processing unit is configured to perform quantization processing on each original coding coefficient in the plurality of original coding coefficients to obtain first pre-quantized data corresponding to each original coding coefficient;
a second coding coefficient determining unit configured to perform determining a second coding coefficient in which corresponding first pre-quantized data is located in a preset quantization coefficient interval among the plurality of original coding coefficients;
and a second quantization path to be pruned determining unit configured to perform, as quantization paths to be pruned, an even quantization path corresponding to the second coding coefficient and a zero value quantization path corresponding to the second coding coefficient.
In an alternative embodiment, the quantization path to be pruned determination module 720 includes:
the first comparison unit is configured to perform comparison between each original coding coefficient in the plurality of original coding coefficients and a preset pixel threshold value to obtain a first comparison result corresponding to each original coding coefficient;
and a third quantization path to be pruned determining unit configured to perform determination of a quantization path to be pruned from the plurality of initial quantization paths based on the first comparison result.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient; the third to-be-pruned quantization path determination unit includes:
A first pruning path determining unit configured to perform, when a first comparison result corresponding to any one of the plurality of original encoding coefficients indicates that the first comparison result is greater than a preset pixel threshold, taking a zero-value quantization path corresponding to a third encoding coefficient as the first pruning path, the third encoding coefficient being an original encoding coefficient greater than the preset pixel threshold among the plurality of original encoding coefficients;
a second pruning path determining unit configured to perform, as a second pruning path, an even quantization path corresponding to a fourth coding coefficient if a first comparison result corresponding to any one of the plurality of original coding coefficients indicates that it is smaller than a preset pixel threshold; the fourth coding coefficient is an original coding coefficient smaller than a preset pixel threshold value in the plurality of original coding coefficients;
a fourth to-be-pruned quantized path determination unit configured to perform the first pruning path and the second pruning path as to-be-pruned quantized paths.
In an alternative embodiment, the quantization path to be pruned determination module 720 includes:
the second quantization processing unit is configured to perform quantization processing on each original coding coefficient in the plurality of original coding coefficients to obtain second pre-quantized data corresponding to each original coding coefficient;
The second comparing unit is configured to perform comparison between second pre-quantized data corresponding to each original coding coefficient in the plurality of original coding coefficients and a preset quantized pixel threshold value to obtain a second comparison result corresponding to each original coding coefficient;
and a fifth quantization path to be pruned determining unit configured to perform determination of a quantization path to be pruned from the plurality of initial quantization paths based on the second comparison result.
In an alternative embodiment, the plurality of initial quantization paths includes a zero value quantization path corresponding to each original coding coefficient, an even quantization path corresponding to each original coding coefficient, and an odd quantization path corresponding to each original coding coefficient; the fifth to-be-pruned quantization path determination unit includes:
a third pruning path determining unit configured to perform, when the second comparison result corresponding to any one of the plurality of original encoding coefficients indicates that the corresponding second pre-quantized data is greater than the preset quantized pixel threshold, taking a zero-value quantized path corresponding to a fifth encoding coefficient as a third pruning path, the fifth encoding coefficient being an original encoding coefficient in which the corresponding second pre-quantized data in the plurality of original encoding coefficients is greater than the preset quantized pixel threshold;
A fourth pruning path determining unit configured to perform, when a second comparison result corresponding to any one of the plurality of original encoding coefficients indicates that the corresponding second pre-quantized data is smaller than a preset quantization pixel threshold, taking an even quantization path corresponding to the sixth encoding coefficient as a fourth pruning path; the sixth coding coefficient is an original coding coefficient of which the corresponding second pre-quantized data in the plurality of original coding coefficients is smaller than a preset quantized pixel threshold value;
a sixth to-be-pruned quantized path determining unit configured to perform the third pruning path and the fourth pruning path as to-be-pruned quantized paths.
In an alternative embodiment, the quantization encoding processing module 750 includes:
the third quantization processing unit is configured to perform quantization processing on the original coding coefficient corresponding to each path node according to a preset quantization state corresponding to each path node in the target quantization path to obtain a quantized coding coefficient;
and an encoding processing unit configured to perform encoding processing based on the quantized encoding coefficients, resulting in encoded data.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 8 is a block diagram illustrating an electronic device for image encoding, which may be a terminal, according to an exemplary embodiment, and an internal structure diagram thereof may be as shown in fig. 8. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an image encoding method. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the electronic equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
Fig. 9 is a block diagram illustrating another electronic device for image encoding, which may be a server, according to an exemplary embodiment, and an internal structure diagram thereof may be as shown in fig. 9. The electronic device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an image encoding method.
Those skilled in the art will appreciate that the structures shown in fig. 8 or 9 are merely block diagrams of partial structures related to the disclosed aspects and do not constitute limitations of the electronic devices to which the disclosed aspects are applied, and that a particular electronic device may include more or fewer components than shown in the drawings, or may combine certain components, or have a different arrangement of components.
In an exemplary embodiment, there is also provided an electronic device including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement an image encoding method as in the embodiments of the present disclosure.
In an exemplary embodiment, a computer-readable storage medium is also provided, which when executed by a processor of an electronic device, enables the electronic device to perform the image encoding method in the embodiments of the present disclosure.
In an exemplary embodiment, a computer program product containing instructions is also provided, which when run on a computer, causes the computer to perform the image encoding method in the embodiments of the present disclosure.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (11)

1. An image encoding method, comprising:
acquiring a plurality of original coding coefficients of an image and a plurality of initial quantization paths corresponding to each original coding coefficient, wherein each initial quantization path is a path connecting a path node of a preset quantization state corresponding to each original coding coefficient with a path node of a preset quantization state corresponding to the next original coding coefficient;
Determining a quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients; the path type of the quantized path to be pruned is matched with the size of each original coding coefficient;
pruning the quantized paths to be pruned in the plurality of initial quantized paths to obtain at least one quantized path to be selected;
determining a target quantization path from the at least one quantization path to be selected based on coding performance indexes corresponding to the at least one quantization path to be selected respectively;
and carrying out quantization coding processing on the plurality of original coding coefficients based on the target quantization path to obtain coded data of the image.
2. The image encoding method according to claim 1, wherein the plurality of initial quantization paths includes a zero value quantization path corresponding to each original encoding coefficient, an even quantization path corresponding to each original encoding coefficient, and an odd quantization path corresponding to each original encoding coefficient;
the determining the quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients comprises:
Determining a first coding coefficient of which the numerical value is in a preset coefficient interval from the plurality of original coding coefficients;
and taking the even quantization path corresponding to the first coding coefficient and the zero value quantization path corresponding to the first coding coefficient as the quantization path to be pruned.
3. The image encoding method according to claim 1, wherein the plurality of initial quantization paths includes a zero value quantization path corresponding to each original encoding coefficient, an even quantization path corresponding to each original encoding coefficient, and an odd quantization path corresponding to each original encoding coefficient;
the determining the quantization path to be pruned in the plurality of initial quantization paths according to the respective sizes of the plurality of original coding coefficients comprises:
carrying out quantization processing on each original coding coefficient in the plurality of original coding coefficients to obtain first pre-quantized data corresponding to each original coding coefficient;
determining a second coding coefficient of the plurality of original coding coefficients, wherein the corresponding first pre-quantized data is located in the preset quantization coefficient interval;
and taking the even quantization path corresponding to the second coding coefficient and the zero value quantization path corresponding to the second coding coefficient as the quantization path to be pruned.
4. The image encoding method according to claim 1, wherein said determining a quantization path to be pruned among the plurality of initial quantization paths according to respective sizes of the plurality of original encoding coefficients comprises:
comparing each original coding coefficient in the plurality of original coding coefficients with the preset pixel threshold value to obtain a first comparison result corresponding to each original coding coefficient;
and determining the quantized paths to be pruned from the plurality of initial quantized paths based on the first comparison result.
5. The image encoding method according to claim 4, wherein the plurality of initial quantization paths includes a zero value quantization path corresponding to each original encoding coefficient, an even quantization path corresponding to each original encoding coefficient, and an odd quantization path corresponding to each original encoding coefficient; the determining the quantization path to be pruned from the plurality of initial quantization paths based on the first comparison result includes:
taking a zero value quantization path corresponding to a third coding coefficient as a first pruning path when a first comparison result corresponding to any one of the plurality of original coding coefficients indicates that the value is larger than a preset pixel threshold value, wherein the third coding coefficient is an original coding coefficient which is larger than the preset pixel threshold value in the plurality of original coding coefficients;
Taking an even quantization path corresponding to a fourth coding coefficient as a second pruning path under the condition that a first comparison result corresponding to any one of the plurality of original coding coefficients indicates that the first comparison result is smaller than the preset pixel threshold value; the fourth coding coefficient is an original coding coefficient smaller than the preset pixel threshold value in the plurality of original coding coefficients;
and taking the first pruning path and the second pruning path as the quantized paths to be pruned.
6. The image encoding method according to claim 1, wherein said determining a quantization path to be pruned among the plurality of initial quantization paths according to respective sizes of the plurality of original encoding coefficients comprises:
carrying out quantization processing on each original coding coefficient in the plurality of original coding coefficients to obtain second pre-quantized data corresponding to each original coding coefficient;
comparing the second pre-quantized data corresponding to each original coding coefficient in the plurality of original coding coefficients with the preset quantized pixel threshold value to obtain a second comparison result corresponding to each original coding coefficient;
and determining the quantized paths to be pruned from the plurality of initial quantized paths based on the second comparison result.
7. The image encoding method according to claim 6, wherein the plurality of initial quantization paths includes a zero value quantization path corresponding to each original encoding coefficient, an even quantization path corresponding to each original encoding coefficient, and an odd quantization path corresponding to each original encoding coefficient; the determining the quantization path to be pruned from the plurality of initial quantization paths based on the second comparison result includes:
taking a zero value quantization path corresponding to a fifth coding coefficient as a third pruning path when a second comparison result corresponding to any one of the plurality of original coding coefficients indicates that the corresponding second pre-quantized data is larger than a preset quantized pixel threshold value, wherein the fifth coding coefficient is an original coding coefficient of which the corresponding second pre-quantized data is larger than the preset quantized pixel threshold value;
taking an even quantization path corresponding to a sixth coding coefficient as a fourth pruning path when a second comparison result corresponding to any one of the plurality of original coding coefficients indicates that the corresponding second pre-quantization data is smaller than the preset quantization pixel threshold value; the sixth coding coefficient is an original coding coefficient of which the corresponding second pre-quantized data in the plurality of original coding coefficients is smaller than the preset quantized pixel threshold value;
And taking the third pruning path and the fourth pruning path as the quantized paths to be pruned.
8. The image encoding method according to any one of claims 1 to 7, wherein performing quantization encoding processing on the plurality of original encoding coefficients based on the target quantization path, to obtain encoded data of the image, comprises:
according to the preset quantization state corresponding to each path node in the target quantization path, performing quantization processing on the original coding coefficient corresponding to each path node to obtain a quantized coding coefficient;
and carrying out coding processing based on the quantized coding coefficients to obtain the coded data.
9. An image encoding device, comprising:
the data acquisition module is configured to execute a plurality of original coding coefficients of an acquired image and a plurality of initial quantization paths corresponding to each original coding coefficient, wherein each initial quantization path is a path connecting a path node of one preset quantization state corresponding to each original coding coefficient with a path node of one preset quantization state corresponding to the next original coding coefficient;
a quantization path to be pruned determining module configured to perform determining a quantization path to be pruned among the plurality of initial quantization paths according to respective sizes of the plurality of original encoding coefficients; the path type of the quantized path to be pruned is matched with the size of each original coding coefficient;
The pruning module is configured to prune the quantized paths to be pruned in the plurality of initial quantized paths to obtain at least one quantized path to be selected;
a target quantization path determining module configured to perform determining a target quantization path from the at least one quantization path to be selected based on coding performance indexes corresponding to the at least one quantization path to be selected, respectively;
and the quantization coding processing module is configured to perform quantization coding processing on the plurality of original coding coefficients based on the target quantization path to obtain coding data of the image.
10. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the image encoding method of any one of claims 1 to 8.
11. A computer readable storage medium, characterized in that instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the image encoding method of any one of claims 1 to 8.
CN202310182725.6A 2023-02-20 2023-02-20 Image encoding method, image encoding device, electronic equipment and storage medium Pending CN116489358A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310182725.6A CN116489358A (en) 2023-02-20 2023-02-20 Image encoding method, image encoding device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310182725.6A CN116489358A (en) 2023-02-20 2023-02-20 Image encoding method, image encoding device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116489358A true CN116489358A (en) 2023-07-25

Family

ID=87225660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310182725.6A Pending CN116489358A (en) 2023-02-20 2023-02-20 Image encoding method, image encoding device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116489358A (en)

Similar Documents

Publication Publication Date Title
JP6928041B2 (en) Methods and equipment for processing video
US11257252B2 (en) Image coding apparatus, probability model generating apparatus and image compression system
WO2022057789A1 (en) Video definition identification method, electronic device, and storage medium
WO2019004749A1 (en) Method and apparatus for performing low complexity computation in transform kernel for video compression
CN114710667A (en) Rapid prediction method and device for CU partition in H.266/VVC screen content frame
CN114501029B (en) Image encoding method, image decoding method, image encoding device, image decoding device, computer device, and storage medium
WO2021022686A1 (en) Video compression method and apparatus, and terminal device
CN111083478A (en) Video frame reconstruction method and device and terminal equipment
CN117095685B (en) Concurrent department platform terminal equipment and control method thereof
CN117649624A (en) Video image quality evaluation method, device, computer equipment and storage medium
CN109474826B (en) Picture compression method and device, electronic equipment and storage medium
CN116489358A (en) Image encoding method, image encoding device, electronic equipment and storage medium
CN111083479A (en) Video frame prediction method and device and terminal equipment
CN110944212A (en) Video frame reconstruction method and device and terminal equipment
CN110740324A (en) Coding control method and related device
CN112738522A (en) Video coding method and device
CN113554719A (en) Image encoding method, decoding method, storage medium and terminal equipment
CN113473154B (en) Video encoding method, video decoding method, video encoding device, video decoding device and storage medium
CN112492305B (en) Data processing method and device and computer readable storage medium
CN118524216B (en) Image coding method, device and computer equipment based on transformation and quantization
CN110933444B (en) Bit width value storage method and device
CN113625965B (en) Data storage method, system and device of distributed storage system and storage medium
CN118381936B (en) Video data processing method, device, equipment and storage medium
CN116980603A (en) Video data processing method, device, computer equipment and storage medium
CN116233448A (en) Image encoding method, image encoding device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination