CN115733981A - Code stream control method and device and electronic equipment - Google Patents

Code stream control method and device and electronic equipment Download PDF

Info

Publication number
CN115733981A
CN115733981A CN202211468455.7A CN202211468455A CN115733981A CN 115733981 A CN115733981 A CN 115733981A CN 202211468455 A CN202211468455 A CN 202211468455A CN 115733981 A CN115733981 A CN 115733981A
Authority
CN
China
Prior art keywords
image
data
code stream
stream control
characteristic
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
CN202211468455.7A
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.)
Tiandy Technologies Co Ltd
Original Assignee
Tiandy Technologies 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 Tiandy Technologies Co Ltd filed Critical Tiandy Technologies Co Ltd
Priority to CN202211468455.7A priority Critical patent/CN115733981A/en
Publication of CN115733981A publication Critical patent/CN115733981A/en
Priority to PCT/CN2023/096814 priority patent/WO2024108950A1/en
Pending legal-status Critical Current

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/124Quantisation
    • 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
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • 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
    • 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/423Methods 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 characterised by memory arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast

Landscapes

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

Abstract

The invention provides a code stream control method, a code stream control device and electronic equipment, belongs to the technical field of video coding, and solves the problem that the code stream cannot be reasonably distributed in the prior art. A code stream control method is characterized by comprising the following steps: receiving image data; creating an image cache queue, and caching image data to obtain image cache data; carrying out feature extraction on the image data to obtain image feature data; creating a characteristic cache queue, and caching the image characteristic data to obtain characteristic cache data; caching data according to the characteristics, and updating code stream control parameters in real time; and calling an encoder, and encoding the image cache data by the encoder according to the code stream control parameters to obtain code stream data.

Description

Code stream control method and device and electronic equipment
Technical Field
The present invention relates to the field of video coding technologies, and in particular, to a code stream control method, device and electronic device.
Background
For video monitoring, due to the limited network bandwidth, in order to ensure the full utilization of the channel bandwidth, the control on the video coding code stream is required, and it is desirable to transmit the higher quality video with smaller bandwidth.
The existing code stream control methods are mostly based on historical information before a current coding frame, when a large motion occurs suddenly in a scene due to such a code stream control strategy, such as movement of people or vehicles, the image frame difference is large, so that the code rate is increased suddenly, the limit of the upper limit of the code rate is triggered quickly, the encoder has to adopt a high compression ratio to ensure the stability of the code rate, the image quality is reduced more seriously when the image compression ratio is increased, and the code stream cannot be reasonably distributed, so that the image quality is poor.
Therefore, the prior art has the problem that the code stream cannot be reasonably distributed.
Disclosure of Invention
The invention aims to provide a code stream control method, a code stream control device and electronic equipment, so as to solve the technical problem that the code stream cannot be reasonably distributed in the prior art.
In a first aspect, the present invention provides a code stream control method, including:
receiving image data;
creating an image cache queue, and caching image data to obtain image cache data;
performing feature extraction on the image data to obtain image feature data;
creating a characteristic cache queue, and caching the image characteristic data to obtain characteristic cache data;
caching data according to the characteristics, and updating code stream control parameters in real time;
and calling an encoder, and encoding the image cache data by the encoder according to the code stream control parameters to obtain code stream data.
Further, the step of performing feature extraction on the image data to obtain image feature data includes:
carrying out gray processing on the image data to obtain a gray image;
and extracting the image complexity and the motion complexity of the gray level image to obtain image characteristic data.
Further, the step of extracting the image complexity and the motion complexity of the gray-scale image to obtain the image feature data includes:
calculating the image mean square error of the gray level image to obtain image complexity data;
calculating the frame difference between the current frame and the previous frame of the gray scale image to obtain motion complexity data;
obtaining image feature data based on the image complexity data and the motion complexity data;
the mean square error of the image is calculated as
Figure BDA0003957389740000021
Wherein N is the number of pixels, X i For each pixel value, μ is the mean of the pixel and σ is the image mean square error;
the frame difference is calculated as I diff =I cur -I pre Wherein, I diff Is the difference of image frame, I cur For the current frame picture, I pre Is the previous frame image.
Further, the length of the image buffer queue is the same as that of the feature buffer queue.
Further, the lengths of the image buffer queue and the feature buffer queue are both buf _ len.
Further, the length of the image buffer queue is the length of the image group gop.
Further, before the step of caching data according to the characteristics and updating the code stream control parameters in real time, the method further includes:
judging whether the image buffer queue and the characteristic buffer queue are full;
if yes, executing a step of caching data according to the characteristics and updating the code stream control parameters in real time;
if not, returning to the step of judging whether the image cache queue and the feature cache queue are full.
Further, the code stream control parameter is a compression ratio parameter;
the compression ratio parameter is controlled by adjusting the quantization parameter;
the quantization parameters include frame-level coding parameters and macroblock-level coding parameters.
In a second aspect, the present invention further provides a code stream control apparatus, including:
a receiving module: for receiving image data;
an image caching module: the image caching queue is used for establishing an image caching queue and caching the image data to obtain image caching data;
a feature extraction module: the image processing device is used for extracting the features of the image data to obtain image feature data;
a characteristic caching module: the characteristic cache queue is used for establishing a characteristic cache queue and caching the image characteristic data to obtain characteristic cache data;
and a code stream control module: the code stream control parameter updating module is used for updating the code stream control parameter in real time according to the characteristic cache data;
the coding module: and the encoder is used for encoding the image cache data according to the code stream control parameters to obtain code stream data.
In a third aspect, the present invention further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program operable on the processor, and the processor implements the steps of the method according to the first aspect when executing the computer program.
The invention provides a code stream control method, which comprises the following steps: receiving image data; creating an image cache queue, and caching image data to obtain image cache data; carrying out feature extraction on the image data to obtain image feature data; creating a characteristic cache queue, and caching the image characteristic data to obtain characteristic cache data; caching data according to the characteristics, and updating code stream control parameters in real time; and calling an encoder, and encoding the image cache data by the encoder according to the code stream control parameters to obtain code stream data.
By adopting the code stream control method provided by the invention, the image characteristic data after the current coding frame can be detected in advance by establishing the image cache queue, the image characteristic data is cached by utilizing the characteristic cache queue, the change of the subsequent image queue is predicted in advance, the response is made in advance, the code stream control parameter is updated in real time according to the characteristic cache data, the encoder encodes the image cache data according to the code stream control parameter, and when a large movement suddenly occurs in a scene, the code stream control parameter number can be adjusted in advance (namely the compression rate is increased in advance) according to the characteristic cache data, so that the compression rate of each frame is not overhigh on average, the limited code stream is reasonably distributed to each image frame, the overall image quality is improved, the problem that the code stream cannot be reasonably distributed is effectively solved, and the code stream with constant output quality is ensured.
Correspondingly, the code stream control device and the electronic equipment provided by the invention also have the technical effects.
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, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flow chart of a code stream control method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a code stream control apparatus in an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "comprising" and "having," and any variations thereof, as used in connection with the present embodiments, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The existing code stream control method is mostly based on historical information before a current coding frame, when a large motion occurs suddenly in a scene due to a code stream control strategy, such as movement of characters or vehicles, the image frame difference is large, so that the code rate is increased suddenly, the limit of the upper limit of the code rate is triggered quickly, an encoder has to adopt a high compression ratio to ensure the stability of the code rate, the higher the image compression ratio is increased, the more serious the image quality is reduced, the code stream cannot be distributed reasonably, and the image quality is poor.
Therefore, the prior art has the problem that the code stream cannot be reasonably distributed.
In order to solve the above problem, embodiments of the present invention provide a code stream control method.
As shown in fig. 1, an embodiment of the present invention provides a code stream control method, including:
s1: receiving image data;
s2: creating an image cache queue, and caching image data to obtain image cache data;
s3: carrying out feature extraction on the image data to obtain image feature data;
s4: creating a characteristic cache queue, and caching the image characteristic data to obtain characteristic cache data;
s5: caching data according to the characteristics, and updating code stream control parameters in real time;
s6: and calling an encoder, and encoding the image cache data by the encoder according to the code stream control parameters to obtain code stream data.
By adopting the code stream control method provided by the invention, the image characteristic data after the current coding frame can be detected in advance by establishing the image cache queue, the image characteristic data is cached by utilizing the characteristic cache queue, the change of the subsequent image queue is predicted in advance, the response is made in advance, the code stream control parameter is updated in real time according to the characteristic cache data, the encoder encodes the image cache data according to the code stream control parameter, and when a large movement suddenly occurs in a scene, the code stream control parameter number can be adjusted in advance (namely the compression rate is increased in advance) according to the characteristic cache data, so that the compression rate of each frame is not overhigh on average, the limited code stream is reasonably distributed to each image frame, the overall image quality is improved, the problem that the code stream cannot be reasonably distributed is effectively solved, and the code stream with constant output quality is ensured.
In a possible implementation manner, step S3 specifically includes:
s31: carrying out gray processing on the image data to obtain a gray image;
s32: and extracting the image complexity and the motion complexity of the gray level image to obtain image characteristic data.
And carrying out gray level processing on the image data, reducing the calculation amount of the later extraction image complexity and the motion complexity, sending the gray level image of the image into a feature extraction module, and extracting the image complexity and the motion complexity.
In a possible implementation manner, step S32 specifically includes:
s321: calculating the image mean square error of the gray level image to obtain image complexity data;
s322: calculating the frame difference between the current frame and the previous frame of the gray-scale image to obtain motion complexity data;
s323: obtaining image feature data based on the image complexity data and the motion complexity data;
the mean square error of the image is calculated as
Figure BDA0003957389740000061
Wherein N is the number of pixels, X i For each pixel value, μ is the mean of the pixel and σ is the image mean square error;
the frame difference is calculated as I diff =I cur -I pre Wherein, I diff Is the picture frame difference, I cur For the current frame picture, I pre Is the previous frame image. I is diff Referring to the difference between two frames, each pixel in Idiff can be summed, and this sum can be used as an estimate of the severity of the motion, with the more severe the motion, the larger the sum.
The image complexity can be represented by image mean square error, and the larger the mean square error is, the higher the image complexity is; the motion complexity can be characterized by the frame difference between the current frame and the previous frame, and the larger the frame difference is, the higher the motion complexity is: and generating image characteristic data according to the obtained image complexity value and the obtained motion complexity value, and updating the code stream control parameters in real time according to the characteristic cache data subsequently, wherein the characteristic cache data provides future image information, and can simultaneously take the historical image information and the future image information as basic data to update the code stream control parameters in real time, so that the accuracy of the code stream control parameters is improved, and stable and high-quality images are favorably output.
In one possible embodiment, the image buffer queue is the same length as the feature buffer queue. And after the image buffer queue and the characteristic buffer queue are full, updating the code flow control parameters according to the characteristic buffer data, and at the moment, starting image coding by an H264 or H265 coder and outputting the code stream coded by the coder to the outside.
In one possible implementation, the length of the image buffer queue and the feature buffer queue are both buf _ len. The length of the image buffer queue is the length of the image group gop. An image frame of one gop is cached in a common image caching queue, and a security monitoring video generally has 1 gop of 25 or 50 frames, namely, data of 1-2 seconds is cached in advance, so that the image scene change after 1-2 seconds can be predicted, and the compression rate can be improved or reduced by 1-2 seconds in advance. The advance time is proportional to the length of the buffer queue, and the more data is buffered, the earlier the time can be. The longer the image cache queue is, the richer the image information predicted in advance by the code stream control module is, the more advanced the response is, and the more obvious the improvement degree of the coding quality is. However, this also increases the delay of the code stream, so the length of the image group gop can be generally selected to balance the length selection of the image buffer queue, and in addition, for a scene with low real-time requirement such as video transcoding, the image buffer queue can be selected as long as possible, so that the coding quality can be improved to the maximum.
In a possible implementation manner, before step S5, the method further includes:
s501: judging whether the image buffer queue and the characteristic buffer queue are full;
if yes, executing step S5; if not, the process returns to step S501.
And only when the image cache queue and the feature cache queue are full, executing the step of updating the code stream control parameters in real time according to the feature cache data, namely, only when the feature cache data is completely cached, generating the corresponding code stream control parameters according to all data in the complete feature cache queue.
In one possible implementation, the code stream control parameter is a compression rate parameter; the compression ratio parameter is controlled by adjusting the quantization parameter; the quantization parameters include frame-level coding parameters and macroblock-level coding parameters. The compression rate is the result of the action of all code stream control parameters, the video code rate = image information amount x image compression rate, firstly, we want the video code rate, that is, the size of the video generated per second is constant, or smaller is better, but the image information amount is constantly changed, sometimes relatively larger, sometimes relatively smaller, in order to ensure that the video code rate is fixed, we can only ensure the size of the code stream to be constant by adjusting the image compression rate according to the formula. But the compression rate is high and the image quality is deteriorated. In this case, the subjective quality of the image can be improved by improving the compression rate of the complex region according to the characteristics that human eyes are sensitive to the flat region and insensitive to the complex region. That is, different compression rates are used for different image frames in different areas, and the compression rate is relatively fine. The image coding is mainly divided into four steps of prediction, transformation, quantization and entropy coding, wherein the step of quantization is lossy compression and has precision loss, and other steps are lossless compression. Lossy compression can be greater than lossless compression, although there is a loss of precision. Therefore, the compression rate is generally affected by adjusting the quantization parameters, or all the codestream parameters finally affect the compression rate by adjusting the quantization parameters. The larger the quantization value, the larger the image compression rate, and the smaller the quantization value, the smaller the image compression rate. The quantization parameters are divided into frame-level coding parameters and macroblock-level coding parameters: (1) Frame-level coding parameters, wherein the frame-level coding parameters are used for adjusting the proportion of I frames and P frames, and the larger the I frame is, the smaller the P frame is, the clearer the image is, but the motion scene becomes worse; conversely, the smaller the I frame is, the larger the P frame is, the better the moving image will be, but the I frame quality will be low, and the image will be degraded as a whole. (2) Macroblock-level coding parameters macroblock-level coding is used for adjusting the coding ratio of a flat area to a complex area in the same frame; human eyes are more sensitive to the quality of a flat area than a complex area, and if the complex area in a scene is more, the quality of the complex area can be sacrificed to ensure the coding quality of the flat area.
For example, the codestream parameters commonly used for the fixed-bit rate are as follows:
u32MaxQp frame maximum QP for clamp quality, [12,48]
u32MinQp frame minimum QP for clipping code rate fluctuation, [12,48]
The QP difference of the s32IPQPDelta I frame and the P frame is generally set to 1 or 2, i.e. the I frame is 1 or 2 smaller than the P frame;
u32MaxIQp maximum QP for I frame. Minimum number of bits for control I frame [12,48]
Minimum QP for u32MinIQp I frame. Maximum number of bits for control I frame, [12,48]
The value range of the ratio of the u32MaxIPProp to the maximum IP frame code rate is [5,100].
An embodiment of the present invention further provides a code stream control device, as shown in fig. 2, including:
the receiving module 1: for receiving image data;
the image caching module 2: the image cache queue is used for establishing an image cache queue and caching the image data to obtain image cache data;
the feature extraction module 3: the image processing device is used for extracting the features of the image data to obtain image feature data;
the characteristic caching module 4: the characteristic cache queue is used for establishing a characteristic cache queue and caching the image characteristic data to obtain characteristic cache data;
code flow control module 5: the code stream control parameter updating module is used for updating the code stream control parameter in real time according to the characteristic cache data;
and the encoding module 6: and the encoder is used for encoding the image cache data according to the code stream control parameters to obtain code stream data.
The embodiment of the present invention further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program that can be run on the processor, and the processor implements the steps of the method provided in the above embodiment when executing the computer program.
The code stream control device and the electronic equipment provided by the embodiment of the invention have the same technical characteristics as the code stream control method provided by the embodiment, so that the same technical problems can be solved, and the same technical effect can be achieved.
In accordance with the above method, embodiments of the present invention also provide a computer readable storage medium storing machine executable instructions, which when invoked and executed by a processor, cause the processor to perform the steps of the above method.
The apparatus provided in the embodiment of the present invention may be specific hardware on the device, or software or firmware installed on the device, or the like. The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
For another example, the division of the unit is only one logical function division, and there may be another division in actual implementation, and for another example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided by the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention or a part thereof which substantially contributes to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: those skilled in the art can still make modifications or changes to the embodiments described in the foregoing embodiments, or make equivalent substitutions for some features, within the scope of the disclosure; and the modifications, changes or substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention. Are intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A code stream control method is characterized by comprising the following steps:
receiving image data;
creating an image cache queue, and caching image data to obtain image cache data;
carrying out feature extraction on the image data to obtain image feature data;
creating a characteristic cache queue, and caching the image characteristic data to obtain characteristic cache data;
caching data according to the characteristics, and updating code stream control parameters in real time;
and calling an encoder, and encoding the image cache data by the encoder according to the code stream control parameters to obtain code stream data.
2. The code stream control method according to claim 1, wherein the step of performing feature extraction on the image data to obtain image feature data includes:
carrying out gray level processing on the image data to obtain a gray level image;
and extracting the image complexity and the motion complexity of the gray level image to obtain image characteristic data.
3. The code stream control method according to claim 1, wherein the step of extracting the image complexity and the motion complexity of the gray-scale map to obtain the image feature data comprises:
calculating the image mean square error of the gray level image to obtain image complexity data;
calculating the frame difference between the current frame and the previous frame of the gray-scale image to obtain motion complexity data;
obtaining image feature data based on the image complexity data and the motion complexity data;
the mean square error of the image is calculated as
Figure FDA0003957389730000011
Wherein N is the number of pixels, X i For each pixel value, μ is the mean of the pixel and σ is the image mean square error;
the frame difference is calculated as I diff =I cur -I pre Wherein, I diff Is the difference of image frame, I cur For the current frame picture, I pre Is the previous frame image.
4. The codestream control method according to claim 1, wherein the image buffer queue and the feature buffer queue have the same length.
5. The code stream control method according to claim 4, wherein the lengths of the image buffer queue and the feature buffer queue are both buf _ len.
6. The codestream control method according to claim 1, wherein the length of the image buffer queue is the length of a group of images gop.
7. The code stream control method according to claim 1, wherein before the step of updating the code stream control parameter in real time according to the characteristic cache data, the method further comprises:
judging whether the image buffer queue and the characteristic buffer queue are full;
if yes, executing a step of caching data according to the characteristics and updating the code stream control parameters in real time;
if not, returning to the step of judging whether the image cache queue and the feature cache queue are full.
8. The code stream control method according to claim 1, wherein the code stream control parameter is a compression rate parameter;
the compression ratio parameter is controlled by adjusting the quantization parameter;
the quantization parameters include frame-level coding parameters and macroblock-level coding parameters.
9. A code stream control apparatus, comprising:
a receiving module: for receiving image data;
an image caching module: the image caching queue is used for establishing an image caching queue and caching the image data to obtain image caching data;
a feature extraction module: the image processing device is used for extracting the features of the image data to obtain image feature data;
a characteristic caching module: the characteristic cache queue is used for establishing a characteristic cache queue and caching the image characteristic data to obtain characteristic cache data;
and a code stream control module: the code stream control parameter updating module is used for updating the code stream control parameter in real time according to the characteristic cache data;
the coding module: and the encoder is used for encoding the image cache data according to the code stream control parameters to obtain code stream data.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program operable on the processor, and wherein the processor implements the steps of the method of any of claims 1 to 8 when executing the computer program.
CN202211468455.7A 2022-11-22 2022-11-22 Code stream control method and device and electronic equipment Pending CN115733981A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202211468455.7A CN115733981A (en) 2022-11-22 2022-11-22 Code stream control method and device and electronic equipment
PCT/CN2023/096814 WO2024108950A1 (en) 2022-11-22 2023-05-29 Bitstream control method and apparatus, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211468455.7A CN115733981A (en) 2022-11-22 2022-11-22 Code stream control method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115733981A true CN115733981A (en) 2023-03-03

Family

ID=85297605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211468455.7A Pending CN115733981A (en) 2022-11-22 2022-11-22 Code stream control method and device and electronic equipment

Country Status (2)

Country Link
CN (1) CN115733981A (en)
WO (1) WO2024108950A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024108950A1 (en) * 2022-11-22 2024-05-30 天地伟业技术有限公司 Bitstream control method and apparatus, and electronic device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2661465B2 (en) * 1991-12-18 1997-10-08 日本ビクター株式会社 Video encoding device
KR101069254B1 (en) * 2009-05-29 2011-10-04 서울대학교산학협력단 Method of Rate Control in Frame-level for H.264/AVC
CN101895758B (en) * 2010-07-23 2012-07-18 南京信息工程大学 H.264 code rate control method based on frame complexity
CN101895759B (en) * 2010-07-28 2011-10-05 南京信息工程大学 H.264 code rate control method
CN105744342B (en) * 2016-01-28 2019-04-12 腾讯科技(深圳)有限公司 The data transmission method and device of mobile terminal
CN113473131B (en) * 2021-07-01 2023-12-29 成都国科微电子有限公司 Video coding rate dynamic adjustment method and device, electronic equipment and storage medium
CN114979726B (en) * 2022-06-30 2023-09-26 重庆紫光华山智安科技有限公司 Code rate adjusting method, device, server and storage medium
CN115733981A (en) * 2022-11-22 2023-03-03 天地伟业技术有限公司 Code stream control method and device and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024108950A1 (en) * 2022-11-22 2024-05-30 天地伟业技术有限公司 Bitstream control method and apparatus, and electronic device

Also Published As

Publication number Publication date
WO2024108950A1 (en) 2024-05-30

Similar Documents

Publication Publication Date Title
US11412229B2 (en) Method and apparatus for video encoding and decoding
US11172220B2 (en) Video encoding method, and storage medium thereof
JP3116994B2 (en) Image quality prediction apparatus and method and image quality control apparatus and method
US20200275104A1 (en) System and method for controlling video coding at frame level
CN100571365C (en) Be used for selecting the method and apparatus of scan pattern at dual pass encoding
US11134250B2 (en) System and method for controlling video coding within image frame
JP5164866B2 (en) Method and apparatus for adapting temporal frequency of video image sequences
KR20040011100A (en) Advanced method for rate control and apparatus thereof
CN114466189B (en) Code rate control method, electronic equipment and storage medium
US20220086454A1 (en) System and method for reducing video coding fluctuation
CN110876060A (en) Code rate adjusting method and device in coding process
US11197021B2 (en) Coding resolution control method and terminal
CN110062230B (en) Image coding method and device
CN115733981A (en) Code stream control method and device and electronic equipment
EP1978745A2 (en) Statistical adaptive video rate control
CN101390389A (en) Method and apparatus for selection of bit budget adjustment in dual pass encoding
JPH08172633A (en) Method for limiting moving image band
JP3081383B2 (en) 3D volume data quantization method
JP4942208B2 (en) Encoder
CN112822493A (en) Adaptively encoding video frames based on complexity
US20210274169A1 (en) Moving-image encoding device, moving-image encoding method, and program
JP3200518B2 (en) Image signal encoding device
JP4857243B2 (en) Image encoding apparatus, control method therefor, and computer program
CN116248895B (en) Video cloud transcoding method and system for virtual reality panorama roaming
JPH06113271A (en) Picture signal coding device

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