CN108206950B - Code stream length calculation method and device - Google Patents

Code stream length calculation method and device Download PDF

Info

Publication number
CN108206950B
CN108206950B CN201611180999.8A CN201611180999A CN108206950B CN 108206950 B CN108206950 B CN 108206950B CN 201611180999 A CN201611180999 A CN 201611180999A CN 108206950 B CN108206950 B CN 108206950B
Authority
CN
China
Prior art keywords
residual
coefficients
video frame
code stream
length
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
Application number
CN201611180999.8A
Other languages
Chinese (zh)
Other versions
CN108206950A (en
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 Ingenic Semiconductor Co Ltd
Original Assignee
Beijing Ingenic Semiconductor 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 Ingenic Semiconductor Co Ltd filed Critical Beijing Ingenic Semiconductor Co Ltd
Priority to CN201611180999.8A priority Critical patent/CN108206950B/en
Publication of CN108206950A publication Critical patent/CN108206950A/en
Application granted granted Critical
Publication of CN108206950B publication Critical patent/CN108206950B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/189Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
    • H04N19/19Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding using optimisation based on Lagrange multipliers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/436Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation using parallelised computational arrangements

Landscapes

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

Abstract

The invention relates to a code stream length calculation method and equipment, comprising the following steps: in the process of coding a video, acquiring at least two residual error coefficients of a first video frame, wherein the code stream length needs to be calculated through a resolution mode; the first video frame is any one video frame in the video; and calculating the length of the code stream obtained after each residual coefficient in the at least two residual coefficients is coded in parallel. According to the code stream length calculating method provided by the embodiment of the invention, a parallel calculating mode can be adopted when calculating the code stream length obtained after coding the residual-coefficient, and a serial mode is not required, so that the calculating speed can be greatly improved, the time for obtaining the Cost is shortened, and the video coding efficiency is improved. Especially in the real-time encoding process, the method provided by the embodiment of the invention has a great advantage.

Description

Code stream length calculation method and device
Technical Field
The present invention relates to the field of video coding technologies, and in particular, to a method and an apparatus for calculating a code stream length.
Background
In h.264 encoding, for each video frame, in order to select the optimal encoding mode, it is generally necessary to traverse the modes and finally select the optimal mode by comparison. In mode selection, one commonly used selection criterion is Cost, which can be calculated by equation (1):
Cost=Distortion+bit-count*lambda (1)
the discrimination is used to indicate the difference between the compressed image and the image before compression, and the larger the discrimination, the less effective this mode is. The bit-count is a cost for describing the number of bits (bits) needed for writing all information needed for coding into a code stream, that is, the length of the code stream obtained after coding, the more the number of bits needed, the larger the obtained code stream, which is equivalent to the smaller the compression ratio. Lambda is the Lagrangian factor obtained by looking up a table. In general, the larger the value of Cost, the better the corresponding mode.
When computing Cost, the detotation and bit-count need to be computed first, wherein the computation of bit-count is an important part and a part with slower computation speed. Taking the bit-count of the residual coefficient (residual-coefficient) as an example, since the bit-count is calculated serially when calculating the bit-count of the residual-coefficient, if the number of residual-coefficients is large, it is obvious that the calculation process of the bit-count is slow, which results in a long time required for obtaining the code, and reduces the efficiency of video coding.
Disclosure of Invention
The embodiment of the invention provides a code stream length calculation method and device, which are used for simplifying the bit-count calculation process and improving the video coding efficiency.
In a first aspect, a code stream length calculation method is provided, including:
in the process of coding a video, acquiring at least two residual error coefficients of a first video frame, wherein the code stream length needs to be calculated through a resolution mode; the first video frame is any one video frame in the video;
and calculating the length of the code stream obtained after each residual coefficient in the at least two residual coefficients is coded in parallel.
And (4) optional.
Before obtaining at least two residual coefficients of the first video frame, which need to calculate the code stream length by means of a precision mode, the method further comprises the following steps:
acquiring all residual error coefficients of the first video frame;
acquiring at least two residual coefficients of a first video frame, wherein the residual coefficients need to be calculated by a precision mode, and the method comprises the following steps:
and determining the at least two residual coefficients of which the code stream length needs to be calculated through the decision mode according to the number of the residual coefficients of the first video frame.
And (4) optional.
Acquiring at least two residual coefficients of a first video frame, wherein the residual coefficients need to be calculated by a precision mode, and the method comprises the following steps:
acquiring all residual error coefficients of the first video frame, which need to calculate the code stream length through the precision mode;
and calculating the length of a code stream obtained by coding each residual coefficient in the at least two residual coefficients in parallel, wherein the length of the code stream comprises the following steps:
and calculating the length of a code stream obtained after coding each residual coefficient in all the residual coefficients in parallel.
Optionally, after the length of the code stream obtained by encoding each residual coefficient of the at least two residual coefficients is calculated in parallel, the method further includes:
and performing rate distortion optimization calculation on the first video frame according to the length of a code stream obtained after coding each residual coefficient in all residual coefficients included in the first video frame, the difference information between the compressed first video frame and the first video frame before compression, and the Lagrange factor.
Optionally, after performing the rate-distortion optimization calculation on the first video frame, the method further includes:
and selecting an encoding mode for the first video frame according to a rate distortion optimization calculation result of the first video frame.
In a second aspect, a code stream length calculating device is provided, including:
the device comprises an acquisition module, a decision module and a decoding module, wherein the acquisition module is used for acquiring at least two residual error coefficients of a first video frame, which need to calculate the code stream length through a resolution mode, in the process of coding a video; the first video frame is any one video frame in the video;
and the first calculation module is used for calculating the length of a code stream obtained after each residual coefficient in the at least two residual coefficients is coded in parallel.
Alternatively to this, the first and second parts may,
the acquisition module is further configured to:
before acquiring at least two residual coefficients of a first video frame, wherein the length of a code stream needs to be calculated through a precision mode, acquiring all residual coefficients of the first video frame;
the acquiring module is used for acquiring at least two residual error coefficients in the first video frame, wherein the residual error coefficients need to be calculated by a precision mode, and the acquiring module comprises:
and determining the at least two residual coefficients of which the code stream length needs to be calculated through the decision mode according to the number of the residual coefficients of the first video frame.
Alternatively to this, the first and second parts may,
the acquiring module is used for acquiring at least two residual error coefficients in the first video frame, wherein the residual error coefficients need to be calculated by a precision mode, and the acquiring module comprises:
acquiring all residual error coefficients of the first video frame, which need to calculate the code stream length through the precision mode;
the first calculation module is configured to calculate, in parallel, a length of a code stream obtained by encoding each residual coefficient of the at least two residual coefficients, and includes:
and calculating the length of a code stream obtained after coding each residual coefficient in all the residual coefficients in parallel.
Optionally, the apparatus further includes a second calculation module, configured to:
after the first calculation module calculates the length of a code stream obtained after each residual coefficient in the at least two residual coefficients is coded in parallel, rate distortion optimization calculation of the first video frame is carried out according to the obtained length of the code stream obtained after each residual coefficient in all residual coefficients included in the first video frame is coded, difference information between the compressed first video frame and the first video frame before compression and Lagrangian factors.
Optionally, the apparatus further includes a selection module configured to:
and after the second calculation module performs rate distortion optimization calculation on the first video frame, selecting an encoding mode for the first video frame according to a rate distortion optimization calculation result on the first video frame.
According to the code stream length calculating method provided by the embodiment of the invention, a parallel calculating mode can be adopted when calculating the code stream length obtained after coding the residual-coefficient, and a serial mode is not required, so that the calculating speed can be greatly improved, the time for obtaining the Cost is shortened, and the video coding efficiency is improved. Especially in the real-time encoding process, the method provided by the embodiment of the invention has a great advantage.
Drawings
In order to more clearly illustrate 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 code stream length calculation method according to an embodiment of the present invention;
fig. 2 is a hardware schematic diagram related to a video encoding process according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a code stream length calculation device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions in the embodiments of the present invention better understood and make the above objects, features and advantages of the present invention more comprehensible, the technical solutions of the present invention are described in further detail below with reference to the accompanying drawings.
The following is presented as a specific example:
as shown in fig. 1, an embodiment of the present invention provides a code stream length calculation method, where a flow of the method is described as follows:
step 101: in the process of encoding a video, acquiring at least two residual error coefficients of a first video frame, wherein the code stream length needs to be calculated through a resolution mode; the first video frame is any one video frame in the video;
step 102: and calculating the length of the code stream obtained after each residual coefficient in the at least two residual coefficients is coded in parallel.
The code stream length calculation method provided by the embodiment of the invention can be applied to a real-time coding process, for example, a device acquires a video through a sensor (such as a camera), and the device needs to display the acquired video after the video is coded in real time. Of course, the present invention may also be used in a non-real-time encoding process, and the embodiments of the present invention are not limited thereto.
Please refer to fig. 2, which is a hardware diagram of the video encoding process. For example, for a real-time encoding process, the device acquires a video, and displays the video after the video is encoded in real time, so that each module shown in fig. 2 may be located in the device, and the device may be referred to as a video encoding device. The basic principle of video compression is to reduce the amount of information by prediction and then transmit the differentiated part through the codestream, so that Data (Data) in fig. 2 refers to the difference between the predicted value and the original pixel value, taking processing the first video frame as an example, and Data in fig. 2 refers to the difference between the predicted value and the original pixel value of the first video frame. Data is subjected to transformation processing by a transformation module and then subjected to quantization processing by a quantization (Quant) module, and the obtained value is residual-coefficient, wherein the transformation mode adopted by the transformation module can be Discrete Cosine Transform (DCT). And performing inverse quantization processing on the residual-coefficient through an inverse quantization (De-Quant) module, performing inverse transformation processing through an inverse transformation module, adding the result of the inverse transformation and the predicted value to obtain a reconstructed value, and entering a rate distortion optimization module to calculate the Cost. If the transform mode is DCT, the inverse transform mode adopted by the inverse transform module is Inverse Discrete Cosine Transform (IDCT). The reconstruction value refers to a pixel value of an image obtained by lossy compression and decompression of an input image.
As can be seen from FIG. 2, after obtaining the residual-coefficient, the bit-count needs to be calculated by the bit number calculation module. The bit-count calculation described in fig. 2 is only to calculate the bit-count of the residual-coefficient, and actually, in the encoding process, since the syntax element needs to be encoded, the bit-count of the syntax element needs to be calculated, and the residual-coefficient is only a part of the content of the syntax element. Because the bit-count of other parts in the syntax element is generally faster in calculation, which mainly means that the bit-count of residual-coefficient will slow down the overall speed, the method for calculating the bit-count of residual-coefficient is mainly considered in the embodiment of the present invention, and no consideration is given to other parts in the syntax element. That is, when calculating the bit-count of other parts in the syntax element, the calculation method in the prior art can be referred to.
The Cost calculation can be regarded as a rate distortion optimization process, that is, a better coding mode is selected through rate distortion optimization. When the Cost calculation is implemented in hardware design, a common design method is as follows:
after the quantization process is finished, the output residual-coefficient is stored in a Random Access Memory (RAM), and then a process of starting (inverse quantization + inverse transformation) and a process of calculating bit-count of the residual-coefficient are performed in parallel.
The computation of the detotation is generally performed in the process of computing pipelines of inverse transformation in hardware design. The bit-count calculation is complete and the distorsion calculation is also complete before Cost is available. After the Cost of all the coding modes is obtained, comparison can be performed, and the coding mode corresponding to the Cost with the minimum value is determined, wherein the coding mode is the optimal coding mode.
The process of calculating bit-count is also the process of entropy coding. For entropy Coding, the h.264 format supports two entropy Coding methods, namely CABAC (Context-based Adaptive Binary Arithmetic Coding) and CAVLC (Context-based Adaptive Variable Length Coding), wherein CABAC is relatively more advanced and has a higher compression ratio, and thus the embodiments of the present invention mainly discuss the CABAC method.
In the CABAC method, the encoding process is divided into 3 modes, namely, a bypass (bypass) mode, a termination (termination) mode, and a resolution (decision) mode. When calculating bit-count of residual-coefficient, two modes, bypass mode and precision mode, are mainly used. In the two modes, the bypass calculation process can realize parallel calculation, while the precision mode calculation process is complex and needs to perform serial calculation according to the order of residual-coefficient.
For example. A video frame may be divided into a plurality of Macroblocks (MBs), a macroblock being a 16 × 16 Block of data in units of pixels. Theoretically, there is one residual-coefficient per pixel, and there are 16 × 16 residual-coefficients for a macroblock, but now for simplicity, some of them may be 0, i.e. there is no need to calculate the bit-count of these residual-coefficients. In general, it is the bit-count of each residual-coefficient in each macroblock that needs to be computed.
For all residual-coefficients of a video frame, a part of the residual-coefficients may use bypass to calculate bit-count, and the rest of the residual-coefficients use precision to calculate bit-count. If, according to the manner in the prior art, when calculating bit-count in a precision manner, there is a precedence order for residual-coefficient in a macroblock, serial calculation needs to be performed in order, and after calculating a bit-count of a residual-coefficient, a context table (context table) needs to be queried to update a state, and then calculation of a bit-count of the next residual-coefficient is performed, and it is obvious that this process takes a long time to accumulate bit-counts of all residual-coefficients of a video frame after calculating all bit-counts of all residual-coefficients of the video frame.
In the embodiment of the present invention, for example, bit-count of the residual-coefficient of the first video frame is calculated, all the residual-coefficients of the first video frame may be obtained first, and at least two residual-coefficients in which the code stream length needs to be calculated in a precision mode are determined according to the number of the residual-coefficients of the first video frame. For example, if the number of residual-coefficients of the first video frame is large, it is generally specified that bit-counts of residual-coefficients larger than M are calculated by using a decision mode, and bit-counts of other residual-coefficients are calculated by using a bypass mode. M is a positive integer, typically set by the system or encoding rules. At least two residual-coefficients can be selected from the residual-coefficients which need to calculate the code stream length through the precision mode, and for the selected at least two residual-coefficients, a bit-count parallel calculation mode can be adopted, so that the video coding efficiency can be improved.
Preferably, when the residual-coeffient is selected from the residual-coeffients which need to calculate the code stream length by the precision mode, all the residual-coeffients can be selected, that is, for all the residual-coeffients which need to calculate the code stream length by the precision mode, the bit-count of each of the residual-coeffients can be calculated in a parallel mode, so that the time required for calculating the bit-count of the residual-coeffient can be reduced to the greatest extent, and the video coding efficiency is greatly improved. That is to say, when calculating the bit-count of the residual-coefficient, the sequence between the residual-coefficient may not be considered, all the residual-coefficients may be calculated in parallel without adopting a serial manner, and when calculating the bit-count of one residual-coefficient, the state does not need to be modified, so that the context table does not need to be inquired, the time for table lookup and state modification is reduced, and the efficiency is further improved. Specifically, the prior art can be referred to a way of calculating bit-count of residual-coefficient in precision mode.
By adopting the code stream length calculation mode provided by the embodiment of the invention, serial calculation is changed into parallel calculation, the calculation process is simplified, the calculation speed is improved, and the processes of table lookup and state modification are not needed, so that the speed is further improved, and the storage space of hardware is saved. The code stream length calculation method provided by the embodiment of the invention is a quick code stream length calculation method, and the calculation precision may be reduced, but in practical application, the calculation effect can be accepted.
After the bit-count of all residual-coefficients of the first video frame is obtained, rate distortion optimization calculation of the first video frame may be performed according to the length of a code stream obtained after encoding each residual-coefficient of all residual-coefficients included in the first video frame (that is, the bit-count of all residual-coefficients of the first video frame), difference information between the compressed first video frame and the first video frame before compression, and a lagrangian factor. I.e. the calculation of the rate-distortion optimization of the first video frame is performed according to equation (1).
After performing the rate-distortion optimization calculation for the first video frame, an encoding mode may be selected for the first video frame based on the rate-distortion optimization calculation for the first video frame.
The following describes the apparatus provided by the embodiment of the present invention with reference to the drawings.
Referring to fig. 3, an embodiment of the present invention provides a code stream length calculating apparatus, which includes an obtaining module 301 and a first calculating module 302.
The obtaining module 301 is configured to obtain at least two residual coefficients of a first video frame, which require a precision mode to calculate a code stream length, in a process of encoding a video; the first video frame is any one video frame in the video;
the first calculating module 302 is configured to calculate, in parallel, a length of a code stream obtained by encoding each residual coefficient of the at least two residual coefficients.
In a possible embodiment of the method according to the invention,
the obtaining module 301 is further configured to: before acquiring at least two residual coefficients of a first video frame, which need to calculate the code stream length through a precision mode, acquiring all residual coefficients of the first video frame;
the obtaining module 301 is configured to obtain at least two residual coefficients in the first video frame, where the code stream length needs to be calculated through a precision mode, and includes: and determining at least two residual coefficients in which the code stream length needs to be calculated through a precision mode according to the number of the residual coefficients of the first video frame.
In a possible embodiment of the method according to the invention,
the obtaining module 301 is configured to obtain at least two residual coefficients in the first video frame, where the code stream length needs to be calculated through a precision mode, and includes:
acquiring all residual error coefficients of a first video frame, which need to calculate the code stream length through a precision mode;
the first calculating module 302 is configured to calculate, in parallel, a length of a code stream obtained by encoding each residual coefficient of the at least two residual coefficients, and includes:
and calculating the length of the code stream obtained after coding each residual coefficient in all the residual coefficients in parallel.
In a possible implementation manner, the code stream length calculating device further includes a second calculating module, configured to:
after the first calculation module 302 calculates the length of the code stream obtained after encoding each residual coefficient of the at least two residual coefficients in parallel, rate distortion optimization calculation of the first video frame is performed according to the obtained length of the code stream obtained after encoding each residual coefficient of all residual coefficients included in the first video frame, difference information between the compressed first video frame and the first video frame before compression, and a lagrangian factor.
In a possible implementation manner, the code stream length calculating device further includes a selecting module, configured to:
and after the second calculation module performs rate distortion optimization calculation on the first video frame, selecting an encoding mode for the first video frame according to a rate distortion optimization calculation result on the first video frame.
The obtaining module 301 and the first calculating module 302 may be implemented by a bit number calculating module shown in fig. 2, and the second calculating module may be implemented by a rate distortion optimizing module shown in fig. 2.
The codestream length calculation device may be used to execute the method provided by the embodiment shown in fig. 1, for example, the device is a video encoding device as described above. Therefore, for functions and the like that can be realized by each functional module in the device, reference may be made to the description of the embodiment shown in fig. 1, which is not repeated.
According to the code stream length calculating method provided by the embodiment of the invention, a parallel calculating mode can be adopted when calculating the code stream length obtained after coding the residual-coefficient, and a serial mode is not required, so that the calculating speed can be greatly improved, the time for obtaining the Cost is shortened, and the video coding efficiency is improved. Especially in the real-time encoding process, the method provided by the embodiment of the invention has a great advantage.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (8)

1. A code stream length calculation method is characterized by comprising the following steps:
in the process of coding a video, acquiring all residual error coefficients of a first video frame; determining at least two residual coefficients of which the code stream length needs to be calculated through a precision mode according to the number of the residual coefficients of the first video frame; calculating the length of a code stream obtained after each residual coefficient in the at least two residual coefficients is coded in parallel; acquiring the number of residual coefficients of a first video frame, wherein the code stream length needs to be calculated through a resolution mode, a resolution mode is adopted to calculate bit-count when the number of the residual coefficients is greater than M, and a bypass mode is adopted to calculate bit-count when the number of the residual coefficients is less than M;
m is a positive integer and is set by a coding rule;
selecting at least two residual-coefficients from the residual-coefficients for calculating the code stream length by using a decision mode, and adopting a bit-count parallel calculation mode for the selected at least two residual-coefficients.
2. The method of claim 1,
acquiring at least two residual coefficients of a first video frame, wherein the residual coefficients need to be calculated by a precision mode, and the method comprises the following steps:
acquiring all residual error coefficients of the first video frame, which need to calculate the code stream length through the precision mode;
and calculating the length of a code stream obtained by coding each residual coefficient in the at least two residual coefficients in parallel, wherein the length of the code stream comprises the following steps:
and calculating the length of a code stream obtained after coding each residual coefficient in all the residual coefficients in parallel.
3. The method of claim 1, wherein after calculating the length of the code stream obtained by encoding each of the at least two residual coefficients in parallel, further comprising:
and performing rate distortion optimization calculation on the first video frame according to the length of a code stream obtained after coding each residual coefficient in all residual coefficients included in the first video frame, the difference information between the compressed first video frame and the first video frame before compression, and the Lagrange factor.
4. The method of claim 3, wherein after performing the rate-distortion optimization calculation for the first video frame, further comprising:
and selecting an encoding mode for the first video frame according to a rate distortion optimization calculation result of the first video frame.
5. A code stream length calculation device, comprising:
the device comprises an acquisition module, a coding module and a decoding module, wherein the acquisition module is used for acquiring all residual error coefficients of a first video frame in the process of coding a video; determining at least two residual coefficients of which the code stream length needs to be calculated through a precision mode according to the number of the residual coefficients of the first video frame; parallelly calculating the length of a code stream obtained after coding each residual coefficient of the at least two residual coefficients; acquiring the number of residual coefficients of a first video frame, wherein the code stream length needs to be calculated through a resolution mode, a resolution mode is adopted to count bit-count when the number of the residual coefficients is greater than M, and a bypass mode is adopted to count bit-count when the number of the residual coefficients is less than M;
m is a positive integer and is set by a coding rule;
selecting at least two residual-coefficients from the residual-coefficients for calculating the code stream length by using a decision mode, and adopting a bit-count parallel calculation mode for the selected at least two residual-coefficients.
6. The apparatus of claim 5,
the acquiring module is used for acquiring at least two residual error coefficients in the first video frame, wherein the residual error coefficients need to be calculated by a precision mode, and the acquiring module comprises:
acquiring all residual error coefficients of the first video frame, which need to calculate the code stream length through the precision mode;
the first calculation module is used for calculating the length of a code stream obtained after each residual coefficient in the at least two residual coefficients is coded in parallel, and comprises:
and calculating the length of a code stream obtained after coding each residual coefficient in all the residual coefficients in parallel.
7. The device of claim 5, wherein the device further comprises a second computing module to:
after the first calculation module calculates the length of a code stream obtained after each residual coefficient in the at least two residual coefficients is coded in parallel, rate distortion optimization calculation of the first video frame is carried out according to the obtained length of the code stream obtained after each residual coefficient in all residual coefficients included in the first video frame is coded, difference information between the compressed first video frame and the first video frame before compression and a Lagrangian factor.
8. The device of claim 7, wherein the device further comprises a selection module to:
and after the second calculation module performs rate distortion optimization calculation on the first video frame, selecting an encoding mode for the first video frame according to a rate distortion optimization calculation result on the first video frame.
CN201611180999.8A 2016-12-19 2016-12-19 Code stream length calculation method and device Active CN108206950B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611180999.8A CN108206950B (en) 2016-12-19 2016-12-19 Code stream length calculation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611180999.8A CN108206950B (en) 2016-12-19 2016-12-19 Code stream length calculation method and device

Publications (2)

Publication Number Publication Date
CN108206950A CN108206950A (en) 2018-06-26
CN108206950B true CN108206950B (en) 2021-11-12

Family

ID=62602036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611180999.8A Active CN108206950B (en) 2016-12-19 2016-12-19 Code stream length calculation method and device

Country Status (1)

Country Link
CN (1) CN108206950B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1735209A (en) * 2004-08-02 2006-02-15 三星电子株式会社 Use the binary arithmetic decoding apparatus and method of pipeline organization
US8743949B2 (en) * 2001-12-17 2014-06-03 Microsoft Corporation Video coding / decoding with re-oriented transforms and sub-block transform sizes

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU743585B2 (en) * 1994-06-17 2002-01-31 British Broadcasting Corporation, The Video compression
KR100867995B1 (en) * 2006-01-07 2008-11-10 한국전자통신연구원 Method and apparatus for video data encoding and decoding
CN100496118C (en) * 2006-12-28 2009-06-03 武汉大学 Method for encrypting/deciphering residual quotiety amplitude value in H.264 standard video information
US10021409B2 (en) * 2012-05-09 2018-07-10 Integrated Device Technology, Inc. Apparatuses and methods for estimating bitstream bit counts
CN103634606B (en) * 2012-08-21 2015-04-08 腾讯科技(深圳)有限公司 Video encoding method and apparatus
US9319684B2 (en) * 2012-08-21 2016-04-19 Qualcomm Incorporated Alternative transform in scalable video coding

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8743949B2 (en) * 2001-12-17 2014-06-03 Microsoft Corporation Video coding / decoding with re-oriented transforms and sub-block transform sizes
CN1735209A (en) * 2004-08-02 2006-02-15 三星电子株式会社 Use the binary arithmetic decoding apparatus and method of pipeline organization

Also Published As

Publication number Publication date
CN108206950A (en) 2018-06-26

Similar Documents

Publication Publication Date Title
CN110024392B (en) Low complexity symbol prediction for video coding
JP5733590B2 (en) A context modeling technique for encoding transform coefficient levels.
EP3677027B1 (en) Mixing of probabilities for entropy coding in video compression
JP2005348390A5 (en)
KR20130140190A (en) Methods and devices for coding and decoding the position of the last significant coefficient
CA3075491A1 (en) Binary arithmetic coding with progressive modification of adaptation parameters
US20180199058A1 (en) Video encoding and decoding method and device
KR20110019140A (en) Method and apparatus for encoding and decoding image based on flexible orthogonal transform
EP3732882A1 (en) Efficient context model computation design in transform coefficient coding
JP7128580B2 (en) bitplane encoding
CN103843338B (en) The adaptive quantizing of in-frame encoding picture block
CN110324639B (en) Techniques for efficient entropy encoding of video data
CN105453566B (en) Data encoding and data decoding
CN110536133B (en) Video data decoding method and device
EP3673653B1 (en) Embedding information about token tree traversal
EP3369250A1 (en) Parallel arithmetic coding techniques
CN108206950B (en) Code stream length calculation method and device
JP6564315B2 (en) Encoding device, decoding device, and program
CN1848960A (en) Residual coding in compliance with a video standard using non-standardized vector quantization coder
CN116982262A (en) State transition for dependent quantization in video coding
CN110710219B (en) Method and apparatus for context derivation for coefficient coding
US20200142703A1 (en) Gain Control for Multiple Description Coding
WO2022187026A2 (en) Dependent quantization state transition method for video coding
WO2022178405A1 (en) Dependent quantization and residual coding method
CN117896525A (en) Video processing method, model training method, 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
GR01 Patent grant
GR01 Patent grant