CN108683915B - Method and device for writing dQP value and electronic equipment - Google Patents
Method and device for writing dQP value and electronic equipment Download PDFInfo
- Publication number
- CN108683915B CN108683915B CN201810451073.0A CN201810451073A CN108683915B CN 108683915 B CN108683915 B CN 108683915B CN 201810451073 A CN201810451073 A CN 201810451073A CN 108683915 B CN108683915 B CN 108683915B
- Authority
- CN
- China
- Prior art keywords
- value
- dqp
- preset
- larger
- area
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 230000001186 cumulative effect Effects 0.000 claims abstract description 22
- 238000004891 communication Methods 0.000 claims description 18
- 238000013139 quantization Methods 0.000 claims description 11
- 238000004364 calculation method Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 7
- 230000008569 process Effects 0.000 description 9
- 230000009471 action Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 239000008186 active pharmaceutical agent Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/625—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/70—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Discrete Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention provides a method and a device for writing a dQP value and electronic equipment, and belongs to the field of computers. And judging whether the cumulative area of the coded block is larger than a preset minimum trigger area or not by acquiring the cumulative area of the coded block, if so, acquiring a non-zero quantized coefficient of the coded block, judging whether the total number of the non-zero quantized coefficients is larger than a preset threshold value or not, and if so, determining and writing a dQP value. By adopting the technical scheme provided by the invention, before writing a dQP value, whether the total number of the non-zero quantized coefficients corresponding to the coded block is greater than a preset threshold value or not is judged, so that the total number of the non-zero quantized coefficients corresponding to one dQP value is greater than the preset threshold value, the frequency of writing the dQP value is reduced, and the coding efficiency is improved.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for writing a dQP value, and an electronic device.
Background
In the currently popular video coding technology based on DCT (Discrete Cosine Transform) hybrid prediction, an image is divided into blocks to be coded, and each block needs to be processed by processes such as block prediction, DCT Transform, quantization, and the like.
For example, in h.265 (a video coding technology standard provided by the international telecommunication union), before entropy coding of a non-zero Quantization coefficient of a current block, the encoder may calculate a spatial predictor of a QP value of the current block from a QP value of a left neighboring block of the current block and a QP value of an upper neighboring block of the current block, and then take a difference between the QP value of the current block and the spatial predictor of the QP value of the current block as the dQP value.
However, the inventor finds that the prior art has at least the following problems in the process of implementing the invention: the mode of writing the dQP value by adopting the prior art is fixed, so that the situation that the number of non-zero quantized coefficients corresponding to one dQP value is less can occur, the resource waste in the encoding process is caused, and the encoding efficiency is limited.
Disclosure of Invention
An embodiment of the invention provides a method, a device and an electronic device for writing a dQP value, so as to improve coding efficiency. The specific technical scheme is as follows:
in a first aspect, a method of writing a quantization parameter difference dQP value is provided, the method comprising:
acquiring the accumulated area of the coded blocks;
judging whether the accumulated area of the coded blocks is larger than a preset minimum trigger area or not;
if the cumulative area of the coded block is larger than a preset minimum trigger area, acquiring a non-zero quantized coefficient of the coded block, and judging whether the total number of the non-zero quantized coefficients is larger than a preset threshold value;
if the total number of non-zero quantized coefficients is greater than a preset threshold, then a dQP value is determined and written.
Optionally, after determining whether the total number of the non-zero quantized coefficients is greater than a preset threshold, the method further includes:
if the total number of the non-zero quantized coefficients is larger than zero and smaller than or equal to the preset threshold, judging whether the cumulative area of the coded blocks is larger than a preset maximum trigger area;
and if the cumulative area of the encoded blocks is larger than the preset maximum trigger area, determining and writing a dQP value.
Optionally, the determining and writing the dQP value includes:
obtaining coordinate values of the coded blocks;
determining an upper adjacent block and a left adjacent block corresponding to the coded block according to the coordinate value;
obtaining a dQP value corresponding to the coded block according to the quantization parameter QP value of the upper adjacent block, the QP value of the left adjacent block and a preset calculation formula;
and entropy coding the dQP value and writing the dQP value into a code stream.
Optionally, the method further includes:
and sending the code stream corresponding to the dQP value to a preset decoder.
In a second aspect, an apparatus for writing a dQP value is provided, the apparatus comprising:
the acquisition module is used for acquiring the accumulated area of the coded blocks;
the first judgment module is used for judging whether the accumulated area of the coded blocks is larger than a preset minimum trigger area or not;
a second judging module, configured to, if the first judging module judges that the cumulative area of the encoded block is larger than a preset minimum trigger area, obtain a non-zero quantized coefficient of the encoded block, and judge whether a total number of the non-zero quantized coefficients is larger than a preset threshold;
a first determining module, configured to determine and write a dQP value if the second determining module determines that the total number of non-zero quantized coefficients is greater than a preset threshold.
Optionally, the apparatus further comprises:
a third determining module, configured to determine whether an accumulated area of the encoded blocks is larger than a preset maximum trigger area if the first determining module determines that the total number of the non-zero quantized coefficients is larger than zero and smaller than or equal to the preset threshold;
and the second determining module is used for determining and writing a dQP value if the third judging module judges that the accumulated area of the coded blocks is larger than the preset maximum trigger area.
Optionally, the first determining module and the second determining module include:
the obtaining submodule is used for obtaining the coordinate value of the coded block;
the determining submodule is used for determining an upper adjacent block and a left adjacent block corresponding to the coded block according to the coordinate value;
the calculation submodule is used for obtaining a dQP value corresponding to the coded block according to the quantization parameter QP value of the upper adjacent block, the QP value of the left adjacent block and a preset calculation formula;
and the write-in sub-module is used for entropy coding the dQP value and writing the dQP value into a code stream.
Optionally, the apparatus further comprises:
and the sending module is used for sending the code stream corresponding to the dQP value to a preset decoder.
In a third aspect, an electronic device is provided, where the electronic device includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement any one of the above method steps for writing a dQP value when executing a program stored in the memory.
In a fourth aspect, the present invention further provides a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to execute any one of the above methods for writing a dQP value.
In a fifth aspect, embodiments of the present invention also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the methods for writing a dQP value described above.
According to the method, the device and the electronic equipment for writing the dQP value, provided by the embodiment of the invention, whether the accumulated area of the coded block is larger than the preset minimum trigger area or not is judged by acquiring the accumulated area of the coded block, if the accumulated area of the coded block is larger than the preset minimum trigger area, the nonzero quantized coefficient of the coded block is acquired, whether the total number of the nonzero quantized coefficients is larger than a preset threshold or not is judged, and the dQP value is determined and written if the total number of the nonzero quantized coefficients is larger than the preset threshold.
By adopting the technical scheme provided by the embodiment of the invention, before writing a dQP value, whether the total number of the non-zero quantized coefficients corresponding to the coded block is greater than a preset threshold value or not is judged, so that the total number of the non-zero quantized coefficients corresponding to one dQP value is greater than the preset threshold value, the frequency of writing the dQP value is reduced, and the coding efficiency is improved. Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart of a method for writing a dQP value according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for writing a dQP value according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for calculating a dQP value according to an embodiment of the present invention;
fig. 4 is a schematic diagram of positions of a coded block, a left neighboring block and an upper neighboring block according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for writing a dQP value according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
According to the method, the device and the electronic equipment for writing the dQP value, before a dQP value is written, whether the total number of the non-zero quantized coefficients corresponding to the coded block is larger than a preset threshold or not is judged, so that the total number of the non-zero quantized coefficients corresponding to one dQP value is larger than the preset threshold, the frequency of writing the dQP value is reduced, and the coding efficiency is improved. The execution body of the embodiment of the present invention may be an encoder.
The method for writing the dQP value according to the embodiment of the present invention will be described first.
As shown in fig. 1, the method for writing a dQP value provided by the embodiment of the present invention may include the following steps:
s110: the cumulative area of the encoded blocks is obtained.
In the embodiment of the present invention, the encoder may divide the picture into blocks, and then sequentially perform processes such as prediction, DCT transformation, quantization, entropy coding, and the like on each block to encode the block and the picture. The encoder may add the areas of the encoded blocks after encoding each block, resulting in an accumulated area of the encoded blocks.
When the encoder counts the cumulative area of the encoded blocks, the statistics is usually performed in units of pictures and blocks, and the coded area of the previous frame picture is not accumulated to the coded area of the next frame picture.
S120: judging whether the accumulated area of the coded blocks is larger than a preset minimum trigger area or not; if the cumulative area of the coded blocks is larger than the preset minimum trigger area, executing S130; and if the cumulative area of the coded blocks is smaller than or equal to the preset minimum trigger area, continuing to code subsequent blocks.
In the embodiment of the invention, the encoder can compare the cumulative area of the encoded blocks with the preset minimum trigger area to judge whether the cumulative area of the encoded blocks is larger than the preset minimum trigger area, wherein the minimum trigger area can be specifically determined according to the encoding precision requirement and an empirical value, the minimum trigger area is smaller when the encoding precision requirement is higher, and for example, the minimum trigger area can be set to be 8 × 8 ("×" represents a multiplication sign).
S130: acquiring a non-zero quantized coefficient of an encoded block, and judging whether the total number of the non-zero quantized coefficients is greater than a preset threshold value or not; if the total number of the non-zero quantized coefficients is greater than the preset threshold, performing S140; if the total number of non-zero quantized coefficients is greater than zero and less than or equal to the preset threshold, S150 is performed.
The encoder can acquire the non-zero quantized coefficients of the encoded blocks, then count the total number of the non-zero quantized coefficients, and compare the total number of the non-zero quantized coefficients with a preset threshold value, so as to judge whether the total number of the non-zero quantized coefficients is greater than the preset threshold value or not.
S140: the dQP value is determined and written.
In the embodiment of the present invention, the encoder may calculate the dQP value corresponding to the encoded block according to a preset calculation formula of the dQP value. The method for calculating the dQP value is not limited in the present invention. For example, the method of calculating the dQP value provided in h.264 or the method of calculating the dQP value provided in h.265 may be employed.
According to the method for writing the dQP value, provided by the embodiment of the invention, before a dQP value is written, whether the total number of the non-zero quantized coefficients corresponding to the coded block is greater than a preset threshold or not is judged, so that the total number of the non-zero quantized coefficients corresponding to one dQP value is greater than the preset threshold, the frequency of writing the dQP value is reduced, and the coding efficiency is improved. The execution body of the embodiment of the present invention may be an encoder.
Optionally, as an implementation manner of the embodiment of the present invention, as shown in fig. 2, S110, S120, S130, and S140 in fig. 2 are the same as corresponding steps in fig. 1, and are not described here again, and after the encoder performs step S130, the following steps may also be performed:
s150: judging whether the accumulated area of the coded blocks is larger than a preset maximum trigger area or not; if the cumulative area of the coded blocks is larger than the preset maximum trigger area, executing S160; and if the accumulated area of the coded blocks is smaller than or equal to the preset maximum trigger area, continuing to code the subsequent blocks.
In the embodiment of the present invention, the encoder may compare the cumulative area of the coded blocks with a preset maximum trigger area to determine whether the cumulative area of the coded blocks is greater than the preset maximum trigger area.
For example, the minimum trigger area may be preset to 8 ×, the maximum trigger area may be preset to 64 ×, and the corresponding preset threshold value for the total number of non-zero quantized coefficients may be preset to 8. if a 16 × block contains four 8 × blocks with the number of non-zero coefficients being 10, 5, 3, and 5, respectively, then after the non-zero coefficients of the first 8 × block are entropy encoded, the encoder needs to write a dQP value, which corresponds to the spatial predictor of the QP value calculated from the QP value of the left neighboring block and the QP value of the upper neighboring block at the coordinate position of the current 8 block 8, after the entropy encoding of the non-zero coefficients of the remaining three 8 × blocks is completed, because their total number of non-zero coefficients is 13, since 13 is greater than 8, a second dQP value needs to be written, which corresponds to the predictor of the spatial predictor may be calculated from the QP value of the left neighboring block at the coordinate position of the current 16 block × block and the QP value of the upper neighboring block, if the consecutive coded blocks are smaller than 4838 blocks, the encoder needs to accumulate the small non-zero quantized coefficients, but the encoder needs to accumulate the small coded blocks to be larger than 3664 blocks.
S160: the dQP value is determined and written.
The process of step S160 is substantially the same as the process of step S140, and is not described herein again.
In the scheme provided by the embodiment of the invention, a maximum trigger area is preset to prevent the overlarge accumulated block areas from sharing a dQP value, thereby ensuring the coding quality and the decoding quality.
Optionally, as an implementation manner of the embodiment of the present invention, as shown in fig. 3, the step S140 may include the following steps:
s141: and acquiring the coordinate value of the coded block.
In the embodiment of the present invention, the encoder may acquire the coordinate value of the encoded block, for example, the encoder may acquire the coordinate value of the preset position of the encoded block as the coordinate value of the encoded block.
S142: and determining an upper adjacent block and a left adjacent block corresponding to the coded block according to the coordinate values.
The encoder may determine an upper neighboring block and a left neighboring block of the coordinate value based on the acquired coordinate value and then treat the two blocks as the upper neighboring block and the left neighboring block of the encoded block.
S143: and obtaining the dQP value corresponding to the coded block according to the quantization parameter QP value of the upper adjacent block, the QP value of the left adjacent block and a preset calculation formula.
As shown in fig. 4, after encoding the current block, the encoder may determine a left neighboring block and an upper neighboring block of the current block according to the coordinate value of the top-left vertex of the current block, and obtain QP values of the two blocks, where the QP value of the current block is QPC, the QP value of the left neighboring block of the current block is QP L, and the QP value of the upper neighboring block of the current block is QPT, and then the spatial prediction value of the QP value of the current block may be calculated by calculating formula QPP ═ QPT + QP L +1 > >1, and then may be calculated by calculating formula dQP ═ QPC-QPP to obtain dQP value.
S144: and entropy coding the dQP value and writing the dQP value into a code stream.
The encoder may convert the dQP value to binary data and then write the binary data into the bitstream.
In the scheme provided by the embodiment of the invention, when the dQP value is calculated, the dQP value is calculated according to the QP value of the upper adjacent block and the QP value of the left adjacent block of the coded block, so that the accuracy of the dQP value is improved.
Optionally, as an implementation manner of the embodiment of the present invention, the encoding may send the code stream corresponding to the dQP value to a preset decoder, so that the decoder decodes the code stream corresponding to the dQP value according to the dQP value. Since the total number of non-zero quantized coefficients corresponding to one dQP value is greater than a preset threshold, the decoding efficiency can be improved.
Based on the same technical concept, the present invention further provides an apparatus for writing a dQP value corresponding to the embodiment of the method illustrated in fig. 1, as illustrated in fig. 5, the apparatus comprising:
an obtaining module 501, configured to obtain an accumulated area of a coded block;
a first determining module 502, configured to determine whether an accumulated area of the coded blocks is greater than a preset minimum trigger area;
a second determining module 503, configured to, if the first determining module 502 determines that the cumulative area of the encoded block is greater than a preset minimum trigger area, obtain a non-zero quantized coefficient of the encoded block, and determine whether a total number of the non-zero quantized coefficients is greater than a preset threshold;
a first determining module 504, configured to determine and write a dQP value if the second determining module 503 determines that the total number of non-zero quantized coefficients is greater than a preset threshold.
According to the method for writing the dQP value, provided by the embodiment of the invention, before a dQP value is written, whether the total number of the non-zero quantized coefficients corresponding to the coded block is greater than a preset threshold or not is judged, so that the total number of the non-zero quantized coefficients corresponding to one dQP value is greater than the preset threshold, the frequency of writing the dQP value is reduced, and the coding efficiency is improved. The execution body of the embodiment of the present invention may be an encoder.
Optionally, the apparatus further comprises:
a third determining module, configured to determine whether the cumulative area of the encoded blocks is larger than a preset maximum trigger area if the first determining module 502 determines that the total number of the non-zero quantized coefficients is larger than zero and smaller than or equal to the preset threshold;
and the second determining module is used for determining and writing a dQP value if the third judging module judges that the accumulated area of the coded blocks is larger than the preset maximum trigger area.
In the scheme provided by the embodiment of the invention, a maximum trigger area is preset to prevent the overlarge accumulated block areas from sharing a dQP value, thereby ensuring the coding quality and the decoding quality.
Optionally, the first determining module 504 and the second determining module include:
the obtaining submodule is used for obtaining the coordinate value of the coded block;
the determining submodule is used for determining an upper adjacent block and a left adjacent block corresponding to the coded block according to the coordinate value;
the calculation submodule is used for obtaining a dQP value corresponding to the coded block according to the quantization parameter QP value of the upper adjacent block, the QP value of the left adjacent block and a preset calculation formula;
and the write-in sub-module is used for entropy coding the dQP value and writing the dQP value into a code stream.
In the scheme provided by the embodiment of the invention, a maximum trigger area is preset to prevent the overlarge accumulated block areas from sharing a dQP value, thereby ensuring the coding quality and the decoding quality.
Optionally, the apparatus further comprises:
and the sending module is used for sending the code stream corresponding to the dQP value to a preset decoder.
In the scheme provided by the embodiment of the invention, the total number of the non-zero quantized coefficients corresponding to one dQP value is greater than the preset threshold value, so that the decoding efficiency can be improved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604;
a memory 603 for storing a computer program;
the processor 601 is configured to implement the following steps when executing the program stored in the memory 603:
acquiring the accumulated area of the coded blocks;
judging whether the accumulated area of the coded blocks is larger than a preset minimum trigger area or not;
if the cumulative area of the coded block is larger than a preset minimum trigger area, acquiring a non-zero quantized coefficient of the coded block, and judging whether the total number of the non-zero quantized coefficients is larger than a preset threshold value;
if the total number of non-zero quantized coefficients is greater than a preset threshold, then a dQP value is determined and written.
According to the electronic device provided by the embodiment of the invention, before a dQP value is written, whether the total number of the non-zero quantized coefficients corresponding to the coded block is greater than a preset threshold value or not is judged, so that the total number of the non-zero quantized coefficients corresponding to one dQP value is greater than the preset threshold value, the frequency of writing the dQP value is reduced, and the coding efficiency is improved. The execution body of the embodiment of the present invention may be an encoder.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment of the present invention, there is also provided a computer readable storage medium having stored therein instructions, which when run on a computer, cause the computer to perform the method of writing a dQP value as described in any of the above embodiments.
According to the readable storage medium provided by the embodiment of the invention, before a dQP value is written, whether the total number of the non-zero quantized coefficients corresponding to the coded block is greater than a preset threshold value or not is judged, so that the total number of the non-zero quantized coefficients corresponding to one dQP value is greater than the preset threshold value, the frequency of writing the dQP value is reduced, and the coding efficiency is improved. The execution body of the embodiment of the present invention may be an encoder.
In yet another embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of writing a dQP value as described in any of the above embodiments.
According to the computer program product provided by the embodiment of the invention, before a dQP value is written, whether the total number of the non-zero quantized coefficients corresponding to the coded block is greater than a preset threshold value or not is judged, so that the total number of the non-zero quantized coefficients corresponding to one dQP value is greater than the preset threshold value, the frequency of writing the dQP value is reduced, and the coding efficiency is improved. The execution body of the embodiment of the present invention may be an encoder.
The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g., from one website site, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DS L)) or wireless (e.g., infrared, wireless, microwave, etc.) manner to another website site, computer, server, or data center.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to some of the description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (9)
1. A method of writing a quantization parameter difference, dQP, value, the method comprising:
acquiring the accumulated area of the coded blocks;
judging whether the accumulated area of the coded blocks is larger than a preset minimum trigger area or not;
if the cumulative area of the coded block is larger than a preset minimum trigger area, acquiring a non-zero quantized coefficient of the coded block, and judging whether the total number of the non-zero quantized coefficients is larger than a preset threshold value;
if the total number of non-zero quantized coefficients is greater than a preset threshold, then a dQP value is determined and written.
2. The method of claim 1, wherein after determining whether the total number of non-zero quantized coefficients is greater than a preset threshold, the method further comprises:
if the total number of the non-zero quantized coefficients is larger than zero and smaller than or equal to the preset threshold, judging whether the cumulative area of the coded blocks is larger than a preset maximum trigger area;
and if the cumulative area of the encoded blocks is larger than the preset maximum trigger area, determining and writing a dQP value.
3. The method of claim 1 or 2, wherein said determining and writing a dQP value comprises:
obtaining coordinate values of the coded blocks;
determining an upper adjacent block and a left adjacent block corresponding to the coded block according to the coordinate value;
obtaining a dQP value corresponding to the coded block according to the quantization parameter QP value of the upper adjacent block, the QP value of the left adjacent block and a preset calculation formula;
and entropy coding the dQP value and writing the dQP value into a code stream.
4. The method of claim 3, further comprising:
and sending the code stream corresponding to the dQP value to a preset decoder.
5. An apparatus for writing a dQP value, the apparatus comprising:
the acquisition module is used for acquiring the accumulated area of the coded blocks;
the first judgment module is used for judging whether the accumulated area of the coded blocks is larger than a preset minimum trigger area or not;
a second judging module, configured to, if the first judging module judges that the cumulative area of the encoded block is larger than a preset minimum trigger area, obtain a non-zero quantized coefficient of the encoded block, and judge whether a total number of the non-zero quantized coefficients is larger than a preset threshold;
a first determining module, configured to determine and write a dQP value if the second determining module determines that the total number of non-zero quantized coefficients is greater than a preset threshold.
6. The apparatus of claim 5, further comprising:
a third determining module, configured to determine whether an accumulated area of the encoded blocks is larger than a preset maximum trigger area if the first determining module determines that the total number of the non-zero quantized coefficients is larger than zero and smaller than or equal to the preset threshold;
and the second determining module is used for determining and writing a dQP value if the third judging module judges that the accumulated area of the coded blocks is larger than the preset maximum trigger area.
7. The apparatus of claim 6, wherein the first and second determining modules comprise:
the obtaining submodule is used for obtaining the coordinate value of the coded block;
the determining submodule is used for determining an upper adjacent block and a left adjacent block corresponding to the coded block according to the coordinate value;
the calculation submodule is used for obtaining a dQP value corresponding to the coded block according to the quantization parameter QP value of the upper adjacent block, the QP value of the left adjacent block and a preset calculation formula;
and the write-in sub-module is used for entropy coding the dQP value and writing the dQP value into a code stream.
8. The apparatus of claim 7, further comprising:
and the sending module is used for sending the code stream corresponding to the dQP value to a preset decoder.
9. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program; the processor, when executing the program stored in the memory, implementing the method steps of any of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810451073.0A CN108683915B (en) | 2018-05-11 | 2018-05-11 | Method and device for writing dQP value and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810451073.0A CN108683915B (en) | 2018-05-11 | 2018-05-11 | Method and device for writing dQP value and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108683915A CN108683915A (en) | 2018-10-19 |
CN108683915B true CN108683915B (en) | 2020-08-07 |
Family
ID=63806072
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810451073.0A Active CN108683915B (en) | 2018-05-11 | 2018-05-11 | Method and device for writing dQP value and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108683915B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111355952B (en) * | 2020-04-13 | 2022-03-04 | 上海富瀚微电子股份有限公司 | Coding coefficient eliminating method and improved HEVC coding method |
CN111770330B (en) * | 2020-06-10 | 2022-11-04 | 北京达佳互联信息技术有限公司 | Image compression method and device and electronic equipment |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050074062A1 (en) * | 2003-10-06 | 2005-04-07 | Sung Chih-Ta Star | Fast DCT method and apparatus for digital video compression |
KR102139199B1 (en) * | 2011-04-22 | 2020-07-29 | 돌비 인터네셔널 에이비 | Method and device for lossy compress-encoding data and corresponding method and device for reconstructing data |
US9112526B2 (en) * | 2011-06-15 | 2015-08-18 | Sony Corporation | Binarization of DQP using separate absolute value and sign (SAVS) in CABAC |
CN103796014A (en) * | 2012-10-31 | 2014-05-14 | 朱洪波 | Adaptive interpolation filter coding determined by the number of coefficients |
CN103796015A (en) * | 2012-10-31 | 2014-05-14 | 朱洪波 | Quantization coefficient differential coding adapted to the number of coefficients |
CN104602030B (en) * | 2014-12-26 | 2018-03-23 | 北京奇艺世纪科技有限公司 | A kind of coding method, code device and server |
-
2018
- 2018-05-11 CN CN201810451073.0A patent/CN108683915B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN108683915A (en) | 2018-10-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107046645B (en) | Image coding and decoding method and device | |
RU2566332C2 (en) | Encoding and decoding process and device | |
CN107809642A (en) | For encoding video pictures and method, encoding device and the decoding device of decoding | |
CN104219522B (en) | Bit rate control method and device in a kind of encoding video pictures | |
CN110636313B (en) | Transformation and quadratic transformation matrix training method, encoder and related device | |
CN109756736B (en) | SAO mode decision method, device, electronic equipment and readable storage medium | |
CN108683915B (en) | Method and device for writing dQP value and electronic equipment | |
CN111669593A (en) | Video encoding method, video encoding device, electronic equipment and storage medium | |
CN108600755B (en) | Image frame coding method and device | |
CN109660806B (en) | Encoding method and device and electronic equipment | |
WO2022252567A1 (en) | Method and device for determining priority order of video encoding and decoding on basis of correlation comparison | |
CN113573066B (en) | Video coding method and device | |
WO2020262012A1 (en) | Image decoding device, image decoding method, and program | |
WO2021056225A1 (en) | Inter-frame prediction method and apparatus, device and storage medium | |
CN113489983B (en) | Method and device for determining block coding parameters based on correlation comparison | |
CN109640081B (en) | An intra-frame prediction method, encoder, electronic equipment and readable storage medium | |
CN109756738B (en) | Method, device, electronic device and storage medium for adding and extracting digital watermark | |
CN113596452B (en) | Encoding method, encoding device, electronic equipment and storage medium | |
CN105872538B (en) | Time domain filtering method and time domain filtering device | |
CN106937168B (en) | Video coding method, electronic equipment and system using long-term reference frame | |
CN108810533B (en) | Method and device for marking reference frame and electronic equipment | |
CN115442617A (en) | Video processing method and device based on video coding | |
CN109688409B (en) | Video coding method and device | |
WO2021263251A1 (en) | State transition for dependent quantization in video coding | |
CN114584779A (en) | Video coding method, device, equipment and medium based on H264 coding algorithm |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |