WO2023279978A1 - Video encoding method and apparatus, device, and storage medium - Google Patents

Video encoding method and apparatus, device, and storage medium Download PDF

Info

Publication number
WO2023279978A1
WO2023279978A1 PCT/CN2022/100805 CN2022100805W WO2023279978A1 WO 2023279978 A1 WO2023279978 A1 WO 2023279978A1 CN 2022100805 W CN2022100805 W CN 2022100805W WO 2023279978 A1 WO2023279978 A1 WO 2023279978A1
Authority
WO
WIPO (PCT)
Prior art keywords
code rate
target
resolution
change information
current video
Prior art date
Application number
PCT/CN2022/100805
Other languages
French (fr)
Chinese (zh)
Inventor
张凯明
要瑞宵
Original Assignee
百果园技术(新加坡)有限公司
张凯明
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 百果园技术(新加坡)有限公司, 张凯明 filed Critical 百果园技术(新加坡)有限公司
Publication of WO2023279978A1 publication Critical patent/WO2023279978A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234363Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the spatial resolution, e.g. for clients with a lower screen resolution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234381Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the temporal resolution, e.g. decreasing the frame rate by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2402Monitoring of the downstream path of the transmission network, e.g. bandwidth available
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440263Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the spatial resolution, e.g. for displaying on a connected PDA
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44209Monitoring of downstream path of the transmission network originating from a server, e.g. bandwidth variations of a wireless network

Definitions

  • the embodiments of the present application relate to the field of computer technologies, and in particular, to a video coding method, device, device, and storage medium.
  • instant messaging technology has penetrated into all aspects of people's daily life and work.
  • video technology has created more diversified instant messaging scenarios, such as video calls, remote conferences, online live broadcasts, online education, and so on.
  • the encoder must adjust the video encoding strategy in real time based on the network quality, so that the bit rate consumed by video encoding conforms to the network bandwidth, so as to avoid playback freezes and playback failures caused by poor network quality.
  • the regulation of video coding strategies is mainly divided into two categories: coder internal code rate regulation and encoder external frame rate/resolution regulation.
  • Encoder internal bit rate control refers to the bit rate adjustment within a certain range in the scene of a fixed frame rate/resolution; when the network quality fluctuates greatly, the external frame rate/resolution control of the encoder is usually performed to Consumed bitrate for smooth video encoding.
  • Embodiments of the present application provide a video encoding method, device, equipment, and storage medium. Described technical scheme is as follows:
  • the embodiment of the present application provides a video encoding method, the method comprising:
  • code rate change information corresponding to current network conditions, where the code rate change information is used to indicate fluctuations of the current network conditions relative to historical network conditions;
  • an embodiment of the present application provides a video encoding device, the device comprising:
  • a code rate information acquisition module configured to obtain code rate change information corresponding to current network conditions, where the code rate change information is used to indicate fluctuations of the current network conditions relative to historical network conditions;
  • a parameter information acquisition module configured to acquire parameter change information corresponding to the current video content, where the parameter change information is used to indicate the content complexity of the current video content;
  • a resolution determination module configured to determine a target resolution based on the code rate change information and the parameter change information
  • a video coding module configured to use the target resolution to code the current video frame.
  • an embodiment of the present application provides a computer device, the computer device includes a processor and a memory, and a computer program is stored in the memory, and the computer program is loaded and executed by the processor to realize the above-mentioned Video encoding method.
  • an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the foregoing video encoding method is implemented.
  • an embodiment of the present application provides a computer program product, which, when the computer program product is run on a computer device, causes the computer device to execute the above video encoding method.
  • the resolution used for encoding the current video frame is determined in combination with the fluctuation of the network quality and the complexity of the video content, so that the resolution can be adjusted more accurately. Since human eyes are more sensitive to changes in picture quality in simple scenes, this application combines the complexity of video content when adjusting the resolution, and considers the sensitivity of human eyes to different content complexity of video content, so that the resolution The regulation is more accurate and comprehensive. Moreover, this application considers the fluctuation of network quality and the complexity of video content when adjusting the resolution. When the network quality fluctuates too frequently, it effectively avoids frequent switching of resolutions, which helps to reduce the video frequency caused by frequent fluctuations in network quality. The resulting breathing effect improves the user's video viewing and calling experience.
  • FIG. 1 is a schematic diagram of an instant messaging scenario provided by an embodiment of the present application
  • FIG. 2 is a flowchart of a video coding method provided by an embodiment of the present application.
  • Fig. 3 is a schematic diagram of key block matching provided by an embodiment of the present application.
  • FIG. 4 is a flowchart of a video encoding method provided by another embodiment of the present application.
  • FIG. 5 is a block diagram of a video encoding device provided by an embodiment of the present application.
  • Fig. 6 is a block diagram of a video encoding device provided by another embodiment of the present application.
  • the encoder internal bit rate control is applicable to the scene of fixed frame rate/resolution.
  • the external frame rate/resolution control of the encoder is usually performed.
  • the frame rate control and resolution control are introduced and explained respectively.
  • Frame rate control The client automatically maintains a frame-level bit rate statistics queue, which is used to cache the actual consumed bit rate of recent encoded frames, and then calculates the frame-level average consumed bit rate of encoded frames, and enters encoding in the current frame Before the processor, by comparing the frame-level average consumption bit rate of the encoded frame with the target frame-level bit rate estimated by using the actual bandwidth, it is judged whether the current frame still has enough bit rate for encoding. If the remaining bit rate is insufficient, directly Discard the current frame and wait for the arrival of the next acquisition frame.
  • the frame-level average bitrate consumption calculation formula of encoded frames is as follows:
  • Rav is the frame-level average consumption code rate of the encoded frame
  • R k is the actual consumption code rate of the kth frame
  • n is the sequence number of the current frame
  • TargteBits is the target frame-level code rate
  • FPS is the set frame rate
  • is a threshold coefficient; if the discard flag is 1, it means that the current frame needs to be discarded; if the discard flag is 0, it means that the current frame does not need to be discarded.
  • Resolution control the code table solution. For videos with different resolutions, set various bit rates in sequence from small to large to encode and decode, get the reconstructed video, and calculate the PSNR (Peak Signal to Noise Ratio) under various bit rates. The PSNR value is higher Larger means better video quality. Through a large amount of experimental data, the most suitable bit rate range for a certain resolution can be obtained. For example, 270P (standard definition) video has the best video quality when the bit rate is 320kbps (kilobits per second) to 500kbps.
  • a code table solution can be formed by integrating the appropriate bit rate ranges of various resolutions.
  • the code table scheme looks like this:
  • level represents different resolution levels, such as 180P (smooth), 270P (standard definition), 360P (high definition); level mr refers to the default resolution level, such as the default resolution is 270P; uplevel and domnlevel represent level respectively
  • the upper and lower bounds of the most suitable bit rate range for mr when the target frame level bit rate exceeds the bounds, it is necessary to switch the resolution according to the above code table scheme. For example, assuming that the above-mentioned level mr is 270P, level mr -1 is 180P, and domnlevel is 350kps, then when TargteBits fluctuates from 400kps to 300kbps, the resolution needs to be switched from 270P to 180P.
  • the frame rate adjustment focuses more on ensuring the video quality, mainly at the expense of the smoothness of the video to obtain the stability of the bit rate.
  • this type of adjustment will cause obvious video freezes, and even freezes in severe cases. Dead, very unfriendly to the user's subjective experience.
  • the control of frame rate control is too strong, which is suitable for extreme situations.
  • Resolution control focuses more on ensuring the fluency of the video, and adjusts the video resolution in real time based on the network quality to achieve the effect of balancing the video bit rate.
  • the resolution control method is relatively gentler, more friendly to the user's subjective experience, and has a wider range of application scenarios.
  • resolution control when the network quality fluctuates too frequently, the resolution switching will also be too frequent, which will produce a significant breathing effect.
  • the human eye is more sensitive to changes in picture quality in simple scenes. At this time, resolution control needs to be more careful to avoid a sharp drop or rise in video picture quality due to excessive resolution control, which will affect users' viewing and viewing experience. call experience.
  • an embodiment of the present application provides a video encoding method, which can more efficiently and flexibly determine the resolution used when encoding the current video frame during the video encoding process.
  • the technical solutions provided by the present application will be described in conjunction with several embodiments.
  • the "instant messaging” mentioned in the following embodiments refers to instant messaging combined with video, such as video calls, teleconferencing, online live broadcast, online education, and so on.
  • the embodiment of the present application does not limit the way of carrying out "instant messaging”. Users can carry out instant messaging through applications, webpages, applets, etc. that have instant messaging functions.
  • the application program with the instant messaging function includes an instant messaging application program, a video playing application program, a live broadcast application program, a game application program, an educational application program, etc., which are not limited in this embodiment of the present application.
  • the embodiment of this application is only for the convenience of explaining the process of video encoding and video decoding, and introduces video encoding and video decoding in the context of instant messaging, but this does not constitute a technical solution of this application. limit.
  • the video encoding method provided by the embodiment of the present application can also be applied in non-instant messaging scenarios, for example, users share the captured video to personal social platforms, webpages and other scenarios, all of which should belong to the scope of protection of the present application within.
  • FIG. 1 shows a schematic diagram of an instant messaging scenario provided by an embodiment of the present application.
  • the instant messaging scenario includes: a video encoding end 110 and a video decoding end 120 .
  • the video encoding end 110 refers to the generation end of video content in the instant messaging scene, which is used to generate video content, encode the generated video content, and send the encoded video content to the video decoding end 120, etc.
  • the video decoding end 120 refers to the receiving end of the video content in the instant messaging scene, and is used for decoding the received video content, playing the decoded video content, and so on.
  • the video encoding end 110 and the video decoding end 120 communicate with each other through a network.
  • the video encoding end 110 and the video decoding end 120 may communicate directly, or communicate indirectly through a server (not shown in FIG. 1 ), for example, the video encoding end 110 sends the encoded video content to the server , and then the server sends the encoded video content to the video decoder 120 .
  • the embodiment of the present application does not limit the device type of the video encoding end 110 and/or the video decoding end 120.
  • the video encoding end 110 and/or the video decoding end 120 is any of the following devices: computer equipment, terminal equipment, Servers, wearable devices, Bluetooth devices, in-vehicle devices, etc.
  • the video encoding end 110 and the video decoding end 120 are of the same device type, or are of different device types.
  • the video encoding end 110 and the video decoding end 120 can be implemented as the same device, that is, the device has both the functions of the video encoding end 110 and the video decoding end 120 .
  • FIG. 1 only illustrates that the video encoding end 110 and the video decoding end 120 are different devices for illustration, but this does not constitute a limitation to the technical solution of the present application.
  • the video encoding end 110 and the video decoding end 120 are distinguished only for the convenience of explaining the process of video encoding and video decoding, but this does not constitute a limitation to the technical solution of the application.
  • the video encoding end 110 can encode and send the video content, and can also receive and decode the video content; the video decoding end 120 can receive the video content and decode it, or Encode the video content and send it.
  • all parties involved in instant messaging can perform steps such as generating and encoding video content, decoding and playing video content generated by other parties, and so on.
  • FIG. 2 shows a flowchart of a video encoding method provided by an embodiment of the present application. This method can be applied to the video encoding end 110 in the instant messaging scene shown in FIG. 1 . As shown in Fig. 2, the method includes the following steps (210-240).
  • step 210 the code rate change information corresponding to the current network condition is acquired, and the code rate change information is used to indicate the fluctuation of the current network condition relative to the historical network condition.
  • Network quality has an important impact on the bit rate and resolution used in the video encoding process.
  • the influence of the parameters From the above content, it can be seen that when the network quality fluctuates greatly and the bit rate control range is exceeded, the frame rate and/or resolution need to be regulated.
  • the frame rate regulation is too strong, it is only applicable to extreme cases, so when the network quality fluctuates greatly, a more moderate resolution regulation method is adopted.
  • the code rate change information is used to indicate the fluctuation of the current network condition relative to the historical network condition.
  • the historical network condition may be the network quality from a certain time before the current time to the current time, or may be the network quality from the start time of encoding the video content to the current time.
  • Step 220 acquiring parameter change information corresponding to the current video content, where the parameter change information is used to indicate the content complexity of the current video content.
  • the video coding method provided by the embodiment of the present application also considers the sensitivity of human eyes to the complexity of different content of video content, so as to avoid drastic changes in video picture quality .
  • the application implements
  • the parameter change information of the quantization parameter is used to indicate the content complexity of the current video content.
  • Step 230 Determine the target resolution based on the code rate change information and the parameter change information.
  • the target resolution used when encoding the current video frame is determined based on the two aspects of information.
  • the video encoding end determines that resolution adjustment is not necessary based on the two aspects of information, and directly uses the original resolution of the current video frame as the target resolution.
  • the video encoding end determines that resolution adjustment is required based on the two aspects of information, and then increases or decreases the original resolution of the current video frame to obtain the target resolution. For other descriptions such as determination of the target resolution, please refer to the following embodiments, and details will not be repeated here.
  • Step 240 encode the current video frame with the target resolution.
  • the video encoding end After the video encoding end determines the target resolution, it can use the target resolution to encode the current video frame, so that the video bit rate matches the network bandwidth, and avoids problems such as video playback freeze or playback failure.
  • the encoding of the current video frame by the video encoding end using the target resolution includes: performing scaling processing on the current video frame by the video encoding end based on the target resolution.
  • encoding the current video frame with the target resolution includes: performing upsampling processing on the current video frame; When the frame resolution matches the target resolution, the target resolution is used to encode the upsampled current video frame.
  • encoding the current video frame with the target resolution includes: performing downsampling processing on the current video frame; When the frame resolution matches the target resolution, the target resolution is used to encode the downsampled current video frame.
  • matching the resolution of the current video frame after the up-sampling process (or the current video frame after the down-sampling process) with the target resolution includes: the current video frame after the up-sampling process (or the current video frame after the down-sampling process)
  • the resolution of the current video frame after upsampling) is equal to the target resolution, or the difference between the resolution of the current video frame after upsampling (or the current video frame after downsampling) and the target resolution is less than set the threshold.
  • the resolution adopted for encoding the current video frame is determined, so as to realize more accurate Adjust the resolution. Since human eyes are more sensitive to changes in picture quality in simple scenes, this application combines the complexity of video content when adjusting the resolution, and considers the sensitivity of human eyes to different content complexity of video content, so that the resolution The regulation is more accurate and comprehensive. Moreover, this application considers the fluctuation of network quality and the complexity of video content when adjusting the resolution. When the network quality fluctuates too frequently, it effectively avoids frequent switching of resolutions, which helps to reduce the video frequency caused by frequent fluctuations in network quality. The resulting breathing effect improves the user's video viewing and calling experience.
  • step 210 includes the following steps (212-216).
  • Step 212 determine the real-time target code rate, where the real-time target code rate is used to indicate the current network condition.
  • the video encoding end uses a bandwidth estimation method to determine the real-time target code rate, and the bandwidth estimation method includes but not limited to: a link delay method, a packet detection bandwidth estimation method, and the like.
  • Step 214 obtaining the historical average code rate, which is used to indicate the historical network conditions.
  • the video encoding end In order to obtain the fluctuation of the current network condition relative to the historical network condition, the video encoding end also needs to determine the historical average bit rate used to indicate the historical network condition.
  • the historical average bit rate is the average bit rate from the start moment of video encoding to the current moment.
  • the historical average bit rate may be when the video call is started The average code rate between the time and the current time; or, the historical average code rate is the average code rate in a period of time before the current time, for example, the historical average code rate is the average code rate within 5 seconds before the current time.
  • the video encoding end needs to maintain a code rate buffer, and the average value in the code rate buffer is the historical average code rate, which is used to indicate historical network conditions.
  • Step 216 Determine code rate change information based on the real-time target code rate and the historical average code rate.
  • the video encoding end After the video encoding end determines the real-time target bit rate and the historical average bit rate, it can compare the real-time target bit rate and the historical average bit rate to determine the bit rate change information.
  • the above step 216 includes: determining a code rate difference between the real-time target code rate and the historical average code rate; and determining code rate change information based on the code rate difference.
  • determining the code rate change information based on the code rate difference includes: when the absolute value of the code rate difference is greater than the first threshold and the code rate difference is a positive number, determining that the code rate change information includes code The code rate changes drastically, and the code rate increases suddenly; when the absolute value of the code rate difference is greater than the first threshold, and the code rate difference is negative, the code rate change information includes that the code rate changes drastically, and the code rate sudden drop; when the absolute value of the code rate difference is smaller than the first threshold, determining that the code rate change information includes that the code rate does not change drastically.
  • the first threshold is a positive number.
  • the real-time target code rate is R
  • the historical average code rate is R av
  • R av avg(buffer_R)
  • buffer_R is the code rate cache maintained by the video encoding end
  • avg( ⁇ ) represents the averaging function
  • the code rate change information includes that the code rate has not changed drastically;
  • the code rate change information includes a drastic change in the code rate, and a sudden increase in the code rate
  • the code rate change information includes that the code rate changes drastically, and the code rate drops sharply.
  • the above step 220 includes the following steps (222-226).
  • Step 222 acquiring a first quantization parameter value, where the first quantization parameter value refers to the quantization parameter value of the previous video frame of the current video frame.
  • the current video frame can be used
  • the content complexity of the previous video frame represents the content complexity of the current video frame. Therefore, in the embodiment of the present application, the video encoding end needs to obtain the quantization parameter value of the previous video frame of the current video frame, that is, the first quantization parameter value.
  • Step 224 acquiring a second quantization parameter value, where the second quantization parameter value refers to an average value of quantization parameter values of at least one historical video frame.
  • the video encoding end also needs to determine the mean value of the quantization parameter values of at least one historical video frame, that is, the second quantization parameter value.
  • at least one historical video frame is all video frames from the start moment of video encoding to the current moment, for example, when the technical solution of the present application is applied to a video call scenario, at least one historical video frame may be a video call All video frames from the moment of opening to the current moment; or, at least one historical video frame is all video frames in a period of time before the current moment; or, at least one historical video frame is N video frames before the current video frame , N is a positive number, optionally, N is 5, 10, 15, etc.
  • the video encoder needs to maintain a quantization parameter value cache, and the average value in the quantization parameter value cache is the second quantization parameter value, which is used to indicate the content complexity of recent video content.
  • the video encoding end maintains a quantization parameter value cache with a length of N, where N is a positive number, for example, N is 10.
  • Step 226 Determine parameter change information based on the first quantization parameter value and the second quantization parameter value.
  • the video encoding end compares the first quantization parameter value and the second quantization parameter value to determine parameter change information.
  • the above step 226 includes: determining a parameter difference between the first quantization parameter value and the second quantization parameter value; and determining parameter change information based on the parameter difference.
  • determining the parameter change information based on the parameter difference includes: when the absolute value of the parameter difference is greater than a second threshold, determining that the parameter change information indicates that the video content is complex; when the absolute value of the parameter difference is smaller than the second threshold In the case of the threshold, the determination parameter change information indicates that the video content is simple.
  • the second threshold is a positive number.
  • the first quantization parameter value is QP
  • the second quantization parameter value is QP av
  • QP av avg(buffer_QP)
  • buffer_QP is the quantization parameter value cache maintained by the video encoder
  • avg( ⁇ ) represents the average value function
  • the parameter difference between the first quantization parameter value and the second quantization parameter value is QP-QP av .
  • the second threshold is Th2
  • the parameter change information has the following situations:
  • the parameter change information indicates that the video content is simple
  • the parameter change information indicates that the video content is complex.
  • the parameter change information in this case can be set
  • the content of the indicated video is simple, and it can also be set that in this case the parameter change information indicates that the content of the video is complex. It should be understood that all these should fall within the protection scope of the present application.
  • the above step 230 includes any one of the following steps (232-238).
  • Step 232 when the code rate change information includes a sudden increase in the code rate, and the parameter change information indicates that the video content is simple, gradually increase the real-time consumption code rate within the target D frame interval; if the real-time consumption code rate exceeds the target D frame interval If it is greater than the real-time target bit rate, the original resolution of the current video frame is determined as the target resolution; if the real-time consumption bit rate is less than the real-time target bit rate after exceeding the target D frame interval, then increase the original resolution of the current video frame to get target resolution.
  • the human eye is more sensitive to changes in picture quality in simple scenes, when the parameter change information indicates that the video content is simple, and the bit rate change information includes a sudden increase in the bit rate, it should be avoided that the resolution control is too large to cause video distortion. Picture quality has risen dramatically. Therefore, in the embodiment of the present application, for the scene where the video content is simple and the code rate increases suddenly, the code rate control is first adopted, and then whether to adopt the resolution control is determined based on the result of the code rate control.
  • the target D frame is the next D frame, and the value of D may be 15. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, and then continue to use resolution control, that is, increase the original resolution of the current video frame to obtain the target resolution.
  • the method of increasing the bit rate in the D frame interval improves the picture quality of the video, and can realize a relatively smooth transition.
  • the code rate change information includes a sudden increase in the code rate
  • the real-time target code rate is at a high level
  • the real-time consumed code rate is at a low level.
  • a waste of code rate may occur.
  • the video encoding end fills redundant error correction packets, for example, resends some data packets of key frames, so as to enhance the error correction capability of key frames.
  • Step 234 when the code rate change information includes a sudden drop in the code rate, and the parameter change information indicates that the video content is simple, gradually reduce the real-time consumption code rate within the target D frame interval; if the real-time consumption code rate exceeds the target D frame interval If it is smaller than the real-time target bit rate, the original resolution of the current video frame is determined as the target resolution; if the real-time consumption bit rate exceeds the target D frame interval and is greater than the real-time target bit rate, then the original resolution of the current video frame is reduced to obtain target resolution.
  • the human eye is more sensitive to changes in picture quality in simple scenes, when the parameter change information indicates that the video content is simple, and the bit rate change information includes a sudden drop in the bit rate, it should be avoided that the resolution control is too strong to cause video distortion. Picture quality drops drastically. Therefore, in the embodiment of the present application, for the scene where the video content is simple and the code rate drops suddenly, the code rate control is first adopted, and then whether to adopt the resolution control is determined based on the result of the code rate control.
  • the target D frame is the next D frame, and the value of D may be 15. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, then continue to use resolution control, that is, reduce the original resolution of the current video frame to obtain the target resolution.
  • the method of reducing the bit rate in the D frame interval reduces the picture quality of the video, and can achieve a relatively smooth transition.
  • Step 236 when the code rate change information includes a sudden increase in the code rate, and the parameter change information indicates that the video content is complex, gradually increase the real-time consumption code rate within the target D frame interval; if the real-time consumption code rate exceeds the target D frame interval If it is greater than the real-time target bit rate, the original resolution of the current video frame is determined as the target resolution; if the real-time consumption bit rate is less than the real-time target bit rate after exceeding the target D frame interval, then increase the original resolution of the current video frame to get target resolution.
  • the code rate control is firstly used to improve the picture quality of the video frame by frame, and then it is determined whether to adopt the resolution control based on the result of the code rate control.
  • the real-time consumption bit rate is gradually increased within the target D frame interval.
  • the target D frame is the next D frame, and the value of D may be 15. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, and then continue to use resolution control, that is, increase the original resolution of the current video frame to obtain the target resolution.
  • the method of increasing the bit rate in the D frame interval improves the picture quality of the video, and can realize a relatively smooth transition.
  • Step 238 if the code rate change information includes a sudden drop in the code rate, and the parameter change information indicates that the video content is complex, reduce the original resolution of the current video frame to obtain the target resolution.
  • the parameter change information indicates that the video content is complex
  • the actual quantization parameter after encoding the historical video frame is relatively large; and because the bit rate change information includes the bit rate drop, the real-time target bit rate is low and the quantization parameter value is large. Therefore, for scenarios where the video content is complex and the bit rate drops suddenly, it is difficult to adjust the bit rate to adapt to the current network conditions.
  • the embodiment of the present application directly adjusts the resolution, that is, reduces the original resolution of the current video frame to obtain the target resolution to ensure the followability of the code rate.
  • the internal code rate control scheme of the encoder can be directly adopted without resolution control, so that the video encoding end directly converts the original
  • the resolution is determined as the target resolution.
  • the technical solutions provided by the embodiments of the present application classify resolution adjustment into multiple types by combining fluctuations in network quality and complexity of video content.
  • the bit rate control method is first used to smooth the picture quality changes of the video.
  • the resolution control method is adopted to effectively avoid the sharp change of the video picture quality.
  • the bit rate drops sharply, directly adjust the resolution to ensure the followability of the bit rate; Avoid drastic changes in picture quality.
  • the embodiment of the present application improves the video playback effect or the video call effect through the above refined resolution control scheme, and brings better video playback or video call experience to the user.
  • the quantization parameter value of the previous video frame of the current video frame is used as the measure of the complexity of the content of the current video frame, which is suitable for the case where the difference between the front and back frames of the video is small Condition. Based on this, it is also necessary to determine whether the scene changes before adopting the resolution control solution introduced in the above embodiment.
  • the above method further includes the following steps.
  • Step 250 detecting the scene change of the current video content relative to the historical video content.
  • the scene change of the current video content relative to the historical video content can be detected first, so as to avoid errors and adverse effects caused by the scene change on the resolution adjustment.
  • the embodiment of the present application does not limit the scene change detection method.
  • the scene change detection method includes: a key block matching algorithm, a full frame matching algorithm, a downsampling frame matching algorithm, and the like.
  • keyblock matching algorithms have low computational complexity. In the following, the process of applying the key block matching algorithm to detect scene changes will be described.
  • the above step 250 includes the following steps (252-256).
  • Step 252 determine at least one key block from the current video frame.
  • the video encoding end determines a key blocks from the current video frame, where a is a positive integer, such as 4, 5, 6, and so on.
  • the size of at least one key block is the same, for example, the size is 16 ⁇ 16 pixels, or 8 ⁇ 8 pixels, or 32 ⁇ 32 pixels, or 4 ⁇ 4 pixels, or are 64 ⁇ 64 pixels; or, the size of at least one key block is not exactly the same, for example, the size of one key block is 16 ⁇ 16 pixels, and the size of another key block is 32 ⁇ 32 pixels, etc.
  • at least one key block is evenly distributed in the current video frame, or at least one key block is concentrated in a certain area in the current video frame, for example, at least one key frame is concentrated in the middle area of the current video frame.
  • the video encoding end determines 5 key blocks from the current video frame, the 5 key blocks are evenly distributed in the current video frame, and the size of the 5 key blocks are all 16 ⁇ 16 pixels.
  • a total of 5 squares with a size of 16 ⁇ 16 pixels are selected as key blocks at the center of the current video frame and its surroundings.
  • the key block at the center of the current video frame is 310, and the key blocks around the center are The block is 320.
  • the horizontal and vertical offsets of each key block 320 from the key block 310 are both 64 pixels, so that the five key blocks are evenly distributed in the current video frame as shown in FIG. 3 .
  • Step 254 For the first key block in the at least one key block, search for a matching block with the target radius as the search radius at the position corresponding to the first key block in the previous video frame of the current video frame.
  • the key blocks are matched.
  • key block matching is performed between the current video frame and the previous video frame of the current video frame, so that, for each key block in at least one key block, it is necessary to select from the previous video frame of the current video frame Do a matching block search.
  • the first key block in at least one key block it is first necessary to determine the corresponding position of the first key block in the previous video frame of the current video frame, and then use the target radius r as the search around the corresponding position Radius to search for matching blocks.
  • the embodiment of the present application does not limit the size of the target radius.
  • the target radius is 1 pixel, or 2 pixels, or 4 pixels, or 8 pixels.
  • Step 256 if there is a block whose mean square error with the first key block is smaller than the target threshold among the searched blocks, determine that the first key block has a matching block in the previous video frame of the current video frame.
  • the block is determined as the first key block A matching block of a key block, that is, a matching block of the first key block exists in the previous video frame of the current video frame.
  • the video encoding end can also use MAD (Mean Absolute Deviation, average absolute error), SAD (Sum of Absolute Difference, absolute error sum), etc. to perform matching block search Search, the embodiment of the present application does not limit the matching criteria used in the matching block search.
  • the size of the matching block and the key block must be the same. For example, assuming that the size of the first key block is 16 ⁇ 16 pixels, the size of the matching block of the first key block is also 16 ⁇ 16 pixels.
  • the mean square error MSE between the searched blocks and key blocks within the search range is:
  • N is the size of the key block, such as N is 16;
  • C ij is the pixel value corresponding to the i -th row and j-th column in the key block of the current video frame;
  • a target threshold Th 0 is set, and when the MSE is smaller than Th 0 , the searched block is considered to be a matching block of the key block.
  • the current video frame when at least one key block has a matching block in the previous video frame of the current video frame, it is considered that the current video frame is similar to the previous video frame, that is, it is determined that the current video frame is relatively similar to the historical video frame There is no scene change; and if there is a certain key block in at least one key block and there is no matching block in the previous video frame of the current video frame, it is determined that the current video frame has a scene change relative to the historical video frame.
  • the above step 230 is implemented as: determining the target resolution based on bit rate change information and parameter change information when the current video content has no scene change relative to the historical video content. That is, when it is detected that the scene does not change, the target resolution is determined by using the resolution control solution provided by the above embodiment, taking into account fluctuations in network quality and complexity of video content.
  • the above step 256 it also includes: when the current video content has a scene change relative to the historical video content, the resolution corresponding to the real-time target bit rate in the target correspondence , determined as the target resolution; wherein, the target correspondence includes at least one set of correspondences between the target bit rate and the resolution. That is, when a scene change is detected, the code table scheme is used to determine the target resolution, and the video encoding end determines the resolution corresponding to the real-time target bit rate from the target correspondence, and takes this resolution as the target resolution.
  • the technical solution provided by the embodiment of the present application detects the scene change of the current video content relative to the historical video content, and combines the fluctuation of the network quality and the complexity of the video content when no scene change is detected. To determine the target resolution, effectively avoiding the impact of bit rate fluctuations on resolution adjustment due to scene changes, and improving the accuracy of resolution adjustment.
  • FIG. 4 shows a flowchart of a video encoding method provided by an embodiment of the present application. This method can be applied to the video encoding end 110 in the instant messaging scene shown in FIG. 1 . As shown in Fig. 4, the method includes the following steps (401 to 412).
  • Step 401 acquire video frame data.
  • the video capture module at the video encoding end can call the camera module to capture video frames at the target frame rate, and transmit the captured video frame data to the video
  • the audio and video processing module at the encoding end performs processing.
  • Step 402 acquiring network quality feedback.
  • the audio and video processing module at the video encoding end can use the bandwidth estimation method to determine the real-time target code rate R, which is used to indicate the current network conditions.
  • this step will maintain a code rate buffer buffer_R, and the code rate buffer buffer_R can be a second-level code rate buffer, such as 5 seconds.
  • the average value R av of the code rate cache is the historical average code rate, which is used to indicate the historical network conditions.
  • Step 403 acquire video content feedback.
  • the quantitative parameter value is used to indicate the content complexity of the video content.
  • the video encoding end obtains the quantization parameter value of the previous video frame of the current video frame, that is, the first quantization parameter value QP.
  • the video encoding end establishes and maintains a buffer_QP of quantization parameter values with a length of N.
  • the value of N is 10.
  • the average value of the quantization parameter value buffer buffer_QP is the second quantization parameter value QP av , which is used to indicate the content complexity of recent video content.
  • Step 404 detecting whether the scene changes.
  • the content complexity of the video content may change greatly, which may cause large bit rate fluctuations. Therefore, the scene change of the current video content relative to the historical video content is detected first, so as to avoid errors and adverse effects caused by the scene change on the resolution adjustment.
  • the video encoding end establishes a frame-level buffer buffer_pre, which is used to store the previous video frame data of the current video frame, so that each time the video encoding end receives the real-time current video frame, it performs key blocks between the current video frame and the previous video frame Match to detect whether the current video content has a scene change relative to the historical video content. If there is no scene change, execute the following step 405; if there is a scene change, execute the following step 411.
  • Step 405 detecting whether the network quality fluctuates.
  • the video encoding end compares the real-time target bit rate R obtained in the above step 402 with the historical average bit rate R av to determine whether the network quality fluctuates greatly. If the code rate difference between the real-time target code rate R and the historical average code rate R av is greater than the first threshold Th1, it is determined that the network quality fluctuates greatly and the code rate changes sharply, and the following step 406 is executed.
  • the code rate difference between the real-time target code rate R and the historical average code rate R av is less than or equal to the first threshold Th1, it is determined that the network quality fluctuation is small, and the original resolution of the current video frame is maintained, that is, the current The original resolution of the video frame is used as the target resolution, and the following step 412 is performed.
  • Step 406 determine the complexity of the content.
  • the video encoder compares the first quantization parameter value QP and the second quantization parameter value QP av obtained in step 403 above to determine the content complexity of the video content. If the absolute value of the parameter difference between the first quantization parameter value QP and the second quantization parameter value QP av is greater than the second threshold Th2, it indicates that the video content is complex; if the first quantization parameter value QP and the second quantization parameter value QP If the absolute value of the parameter difference between av is smaller than the second threshold Th2, it indicates that the video content is simple.
  • Step 407 execute the control scheme in the scenario where the video content is simple and the code rate increases suddenly. At this point, gradually increase the real-time consumption bit rate within the target D frame interval. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, and then continue to use resolution control, that is, increase the original resolution of the current video frame to obtain the target resolution.
  • Step 408 execute the control scheme in the scenario where the video content is simple and the code rate drops suddenly. At this time, gradually reduce the real-time consumption bit rate within the target D frame interval. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, then continue to use resolution control, that is, reduce the original resolution of the current video frame to obtain the target resolution.
  • Step 409 execute the control scheme in the scene where the video content is complex and the code rate increases suddenly. At this point, gradually increase the real-time consumption bit rate within the target D frame interval. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, and then continue to use resolution control, that is, increase the original resolution of the current video frame to obtain the target resolution.
  • Step 410 execute the control scheme in the scenario where the video content is complex and the code rate drops suddenly.
  • the resolution is directly regulated, that is, the original resolution of the current video frame is reduced to obtain the target resolution.
  • Step 411 adopting the code table scheme to regulate the resolution.
  • the control schemes in steps 405 to 410 above are no longer applicable.
  • the code table scheme is adopted to select the resolution corresponding to the real-time target bit rate as the target resolution.
  • this step clears the code rate buffer buffer_R maintained in the above step 402 and the quantization parameter value buffer buffer_QP maintained in the above step 403 to zero.
  • Step 412 encode the current video frame with the target resolution.
  • the video encoding end scales the current video frame based on the target resolution, and after the resolution of the current video frame matches the target resolution, the current video frame is input to the encoder for video encoding.
  • the video encoding end updates the frame-level buffer buffer_pre maintained in step 404 above.
  • FIG. 5 shows a block diagram of a video coding apparatus provided by an embodiment of the present application.
  • the device has the function of realizing the above example of the video coding method, and the function may be realized by hardware, or may be realized by executing corresponding software by the hardware.
  • the device may be the above-mentioned video coding end, or may be set in the above-mentioned video coding end.
  • the apparatus 500 may include: a code rate information acquisition module 510 , a parameter information acquisition module 520 , a resolution determination module 530 and a video encoding module 540 .
  • the code rate information obtaining module 510 is configured to obtain code rate change information corresponding to the current network condition, and the code rate change information is used to indicate the fluctuation of the current network condition relative to the historical network condition.
  • the parameter information obtaining module 520 is configured to obtain parameter change information corresponding to the current video content, and the parameter change information is used to indicate the content complexity of the current video content.
  • a resolution determining module 530 configured to determine a target resolution based on the code rate change information and the parameter change information.
  • a video encoding module 540 configured to encode the current video frame by using the target resolution.
  • the code rate information acquisition module 510 is configured to: determine a real-time target code rate, the real-time target code rate is used to indicate the current network condition; acquire a historical average code rate, the historical average code rate It is used to indicate the historical network condition; and determine the code rate change information based on the real-time target code rate and the historical average code rate.
  • the determining the code rate change information based on the real-time target code rate and the historical average code rate includes: determining the code rate between the real-time target code rate and the historical average code rate Rate difference; when the absolute value of the code rate difference is greater than the first threshold and the code rate difference is a positive number, it is determined that the code rate change information includes a drastic change in the code rate, and the code rate Sudden increase; when the absolute value of the code rate difference is greater than the first threshold and the code rate difference is negative, determining that the code rate change information includes a sharp change in the code rate, and a sudden drop in the code rate ; In a case where the absolute value of the code rate difference is smaller than a first threshold, determining that the code rate change information includes that the code rate has not changed drastically.
  • the parameter information acquiring module 520 is configured to: acquire a first quantization parameter value, where the first quantization parameter value refers to the quantization parameter value of the previous video frame of the current video frame; acquire the second A quantization parameter value, the second quantization parameter value refers to the mean value of the quantization parameter value of at least one historical video frame; based on the first quantization parameter value and the second quantization parameter value, the parameter change information is determined.
  • the determining the parameter change information based on the first quantization parameter value and the second quantization parameter value includes: determining the difference between the first quantization parameter value and the second quantization parameter value The parameter difference between; in the case where the absolute value of the parameter difference is greater than the second threshold, it is determined that the parameter change information indicates that the video content is complex; in the case where the absolute value of the parameter difference is smaller than the second threshold , it is determined that the parameter change information indicates that the video content is simple.
  • the resolution determination module 530 is configured to: step by step within the target D frame interval when the code rate change information includes a sudden increase in code rate, and the parameter change information indicates that the video content is simple Increase the real-time consumption code rate; If the real-time consumption code rate is greater than the real-time target code rate after exceeding the target D frame interval, then determine the original resolution of the current video frame as the target resolution; if the The real-time consumption code rate is less than the real-time target code rate after exceeding the target D frame interval, then increasing the original resolution of the current video frame to obtain the target resolution; when the code rate change information includes a code rate drop, And when the parameter change information indicates that the video content is simple, gradually reduce the real-time consumption code rate within the target D frame interval; if the real-time consumption code rate is less than the real-time target code rate after exceeding the target D frame interval, then The original resolution of the current video frame is determined as the target resolution; if the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame
  • the resolution determination module 530 is further configured to: determine the original resolution of the current video frame as the target when the code rate change information includes that the code rate has not changed drastically resolution.
  • the video encoding module 540 is configured to: perform upsampling processing on the current video frame when the target resolution is greater than the original resolution of the current video frame; When the resolution of the current video frame after the upsampling process matches the target resolution, use the target resolution to encode the current video frame after the upsampling process; When the target resolution is smaller than the original resolution of the current video frame, downsampling is performed on the current video frame; the resolution of the current video frame after the downsampling process is different from the target resolution In the case of rate matching, the target resolution is used to encode the current video frame after the downsampling process.
  • the apparatus 500 further includes: a scene change detection module 550, configured to detect a scene change of the current video content relative to historical video content; the resolution determination module 530, used The target resolution is determined based on the code rate change information and the parameter change information when the current video content has no scene change relative to the historical video content.
  • the scene change detection module 550 is configured to: determine at least one key block from the current video frame; for the first key block in the at least one key block, The position corresponding to the first key block in the previous video frame of the current video frame is searched for matching blocks with the target radius as the search radius; if there is a distance between the searched block and the first key block If the mean square error is less than the target threshold, it is determined that the first key block has a matching block in the previous video frame of the current video frame; wherein, the at least one key block is in the previous video frame of the current video frame If there are matching blocks in a video frame, it is determined that a scene change occurs in the current video content relative to the historical video content.
  • the resolution determination module 530 is further configured to: in the case that the scene of the current video content changes relative to the historical video content, the resolution corresponding to the real-time target bit rate in the target correspondence rate, determined as the target resolution; wherein, the target correspondence includes at least one set of correspondences between target code rates and resolutions.
  • the resolution adopted for encoding the current video frame is determined, so as to realize more accurate Adjust the resolution. Since human eyes are more sensitive to changes in picture quality in simple scenes, this application combines the complexity of video content when adjusting the resolution, and considers the sensitivity of human eyes to different content complexity of video content, so that the resolution The regulation is more accurate and comprehensive. Moreover, this application considers the fluctuation of network quality and the complexity of video content when adjusting the resolution. When the network quality fluctuates too frequently, it effectively avoids frequent switching of resolutions, which helps to reduce the video frequency caused by frequent fluctuations in network quality. The resulting breathing effect improves the user's video viewing and calling experience.
  • the device provided by the above-mentioned embodiments implements its functions, it only uses the division of the above-mentioned functional modules as an example. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs. The internal structure of the system is divided into different functional modules to complete all or part of the functions described above.
  • the device and the method embodiment provided by the above embodiment belong to the same idea, and the specific implementation process thereof is detailed in the method embodiment, and will not be repeated here.
  • a computer device the computer device includes a processor and a memory, and a computer program is stored in the memory, and the computer program is loaded and executed by the processor to realize the above-mentioned Video encoding method.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned video encoding method is implemented.
  • a computer program product is also provided, which, when the computer program product is run on a computer device, causes the computer device to execute the above video encoding method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

A video encoding method and apparatus, a device, and a storage medium, relating to the technical field of computers. The method comprises: acquiring code rate change information corresponding to a current network condition, the code rate change information being used for indicating fluctuation of the current network condition relative to a past network condition (210); acquiring parameter change information corresponding to current video content, the parameter change information being used for indicating a content complexity degree of the current video content (220); determining a target resolution on the basis of the code rate change information and the parameter change information (230); and encoding a current video frame by using the target resolution (240). The fluctuation of network quality and the complexity degree of video content are considered while adjusting and controlling the resolution, such that when the network quality fluctuates too frequently, frequent switching of the resolution is effectively avoided, thereby facilitating reducing the breathing effect caused by frequent fluctuation of the network quality and improving video watching and call experience of users.

Description

视频编码方法、装置、设备及存储介质Video coding method, device, equipment and storage medium
本申请要求于2021年07月09日提交的申请号为202110779065.0、发明名称为“视频编码方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110779065.0 and the title of the invention "Video Coding Method, Device, Equipment, and Storage Medium" filed on July 09, 2021, the entire contents of which are incorporated by reference in this application .
技术领域technical field
本申请实施例涉及计算机技术领域,特别涉及一种视频编码方法、装置、设备及存储介质。The embodiments of the present application relate to the field of computer technologies, and in particular, to a video coding method, device, device, and storage medium.
背景技术Background technique
随着移动互联网的发展,即时通讯技术已经渗透进人们日常生活和工作的方方面面。即时通讯技术与视频技术的结合更是诞生出了更加多样化的即时通讯场景,如视频通话、远程会议、在线直播、网络教育等等。With the development of mobile Internet, instant messaging technology has penetrated into all aspects of people's daily life and work. The combination of instant messaging technology and video technology has created more diversified instant messaging scenarios, such as video calls, remote conferences, online live broadcasts, online education, and so on.
通常,这类与视频相结合的即时通讯场景极度依赖网络质量。在视频编码时,编码器必须基于网络质量实时调控视频编码策略,以使得视频编码的消耗码率符合网络带宽,这样才能避免因为网络质量较差而导致的播放卡顿、播放失败等问题。目前,视频编码策略的调控主要分为两类:编码器内部码率调控以及编码器外部帧率/分辨率调控。编码器内部码率调控是指在固定帧率/分辨率的场景下,进行一定范围内的码率调节;而当网络质量波动较大时,通常进行编码器外部帧率/分辨率调控,以平稳视频编码的消耗码率。Usually, such instant messaging scenarios combined with video rely heavily on network quality. During video encoding, the encoder must adjust the video encoding strategy in real time based on the network quality, so that the bit rate consumed by video encoding conforms to the network bandwidth, so as to avoid playback freezes and playback failures caused by poor network quality. At present, the regulation of video coding strategies is mainly divided into two categories: coder internal code rate regulation and encoder external frame rate/resolution regulation. Encoder internal bit rate control refers to the bit rate adjustment within a certain range in the scene of a fixed frame rate/resolution; when the network quality fluctuates greatly, the external frame rate/resolution control of the encoder is usually performed to Consumed bitrate for smooth video encoding.
发明内容Contents of the invention
本申请实施例提供了一种视频编码方法、装置、设备及存储介质。所述技术方案如下:Embodiments of the present application provide a video encoding method, device, equipment, and storage medium. Described technical scheme is as follows:
一方面,本申请实施例提供了一种视频编码方法,所述方法包括:On the one hand, the embodiment of the present application provides a video encoding method, the method comprising:
获取当前网络条件对应的码率变化信息,所述码率变化信息用于指示所述当前网络条件相对于历史网络条件的波动;Obtain code rate change information corresponding to current network conditions, where the code rate change information is used to indicate fluctuations of the current network conditions relative to historical network conditions;
获取当前视频内容对应的参数变化信息,所述参数变化信息用于指示所述当前视频内容的内容复杂程度;Acquire parameter change information corresponding to the current video content, where the parameter change information is used to indicate the content complexity of the current video content;
基于所述码率变化信息和所述参数变化信息,确定目标分辨率;Determine a target resolution based on the code rate change information and the parameter change information;
采用所述目标分辨率对所述当前视频帧进行编码。Encoding the current video frame by using the target resolution.
另一方面,本申请实施例提供了一种视频编码装置,所述装置包括:On the other hand, an embodiment of the present application provides a video encoding device, the device comprising:
码率信息获取模块,用于获取当前网络条件对应的码率变化信息,所述码率变化信息用于指示所述当前网络条件相对于历史网络条件的波动;A code rate information acquisition module, configured to obtain code rate change information corresponding to current network conditions, where the code rate change information is used to indicate fluctuations of the current network conditions relative to historical network conditions;
参数信息获取模块,用于获取当前视频内容对应的参数变化信息,所述参数变化信息用于指示所述当前视频内容的内容复杂程度;A parameter information acquisition module, configured to acquire parameter change information corresponding to the current video content, where the parameter change information is used to indicate the content complexity of the current video content;
分辨率确定模块,用于基于所述码率变化信息和所述参数变化信息,确定目标分辨率;A resolution determination module, configured to determine a target resolution based on the code rate change information and the parameter change information;
视频编码模块,用于采用所述目标分辨率对所述当前视频帧进行编码。A video coding module, configured to use the target resolution to code the current video frame.
再一方面,本申请实施例提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有计算机程序,所述计算机程序由所述处理器加载并执行以实现如上述视频编码方法。In another aspect, an embodiment of the present application provides a computer device, the computer device includes a processor and a memory, and a computer program is stored in the memory, and the computer program is loaded and executed by the processor to realize the above-mentioned Video encoding method.
又一方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述视频编码方法。In yet another aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the foregoing video encoding method is implemented.
还一方面,本申请实施例提供了一种计算机程序产品,当所述计算机程序产品在计算机设备上运行时,使得计算机设备执行如上述视频编码方法。In another aspect, an embodiment of the present application provides a computer program product, which, when the computer program product is run on a computer device, causes the computer device to execute the above video encoding method.
本申请实施例提供的技术方案可以带来如下有益效果:The technical solutions provided in the embodiments of the present application can bring the following beneficial effects:
通过在视频编码过程中,结合网络质量的波动和视频内容的复杂程度,确定对当前视频帧编码时采用的分辨率,实现了更加准确地进行分辨率的调控。由于人眼会对简单场景下的画面质量变化更加敏感,本申请在调控分辨率时结合了视频内容的复杂程度,考虑了人眼针对视频内容的不同内容复杂程度的敏感情况,从而使得分辨率的调控更加准确和全面。并且,本申请在调控分辨率时同时考虑了网络质量的波动和视频内容的复杂程度,在网络质量波动过于频繁时,有效避免了分辨率的频繁切换,有助于降低由于网络质量频繁波动所产生的呼吸效应,提升用户的视频观看和通话体验。During the video encoding process, the resolution used for encoding the current video frame is determined in combination with the fluctuation of the network quality and the complexity of the video content, so that the resolution can be adjusted more accurately. Since human eyes are more sensitive to changes in picture quality in simple scenes, this application combines the complexity of video content when adjusting the resolution, and considers the sensitivity of human eyes to different content complexity of video content, so that the resolution The regulation is more accurate and comprehensive. Moreover, this application considers the fluctuation of network quality and the complexity of video content when adjusting the resolution. When the network quality fluctuates too frequently, it effectively avoids frequent switching of resolutions, which helps to reduce the video frequency caused by frequent fluctuations in network quality. The resulting breathing effect improves the user's video viewing and calling experience.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.
图1是本申请一个实施例提供的即时通讯场景的示意图;FIG. 1 is a schematic diagram of an instant messaging scenario provided by an embodiment of the present application;
图2是本申请一个实施例提供的视频编码方法的流程图;FIG. 2 is a flowchart of a video coding method provided by an embodiment of the present application;
图3是本申请一个实施例提供的关键块匹配的示意图;Fig. 3 is a schematic diagram of key block matching provided by an embodiment of the present application;
图4是本申请另一个实施例提供的视频编码方法的流程图;FIG. 4 is a flowchart of a video encoding method provided by another embodiment of the present application;
图5是本申请一个实施例提供的视频编码装置的框图;FIG. 5 is a block diagram of a video encoding device provided by an embodiment of the present application;
图6是本申请另一个实施例提供的视频编码装置的框图。Fig. 6 is a block diagram of a video encoding device provided by another embodiment of the present application.
具体实施方式detailed description
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below in conjunction with the accompanying drawings.
由上述背景技术的介绍说明可知,编码器内部码率调控适用于固定帧率/分辨率的场景,当网络质量波动较大时,通常进行的是编码器外部帧率/分辨率调控。下面,针对帧率调控和分辨率调控分别进行介绍说明。It can be seen from the introduction of the above background technology that the encoder internal bit rate control is applicable to the scene of fixed frame rate/resolution. When the network quality fluctuates greatly, the external frame rate/resolution control of the encoder is usually performed. In the following, the frame rate control and resolution control are introduced and explained respectively.
帧率调控:客户端自动维护一个帧级的码率统计队列,用于缓存近期的已编码帧的实际消耗码率,进而计算出已编码帧的帧级平均消耗码率,在当前帧进入编码器之前,通过将已编码帧的帧级平均消耗码率与利用实际带宽估计得到的目标帧级码率进行比较,判断当前帧是否仍有充足码率进行编码,若剩余码率不足,则直接丢弃当前帧,等待下一采集帧的到来。Frame rate control: The client automatically maintains a frame-level bit rate statistics queue, which is used to cache the actual consumed bit rate of recent encoded frames, and then calculates the frame-level average consumed bit rate of encoded frames, and enters encoding in the current frame Before the processor, by comparing the frame-level average consumption bit rate of the encoded frame with the target frame-level bit rate estimated by using the actual bandwidth, it is judged whether the current frame still has enough bit rate for encoding. If the remaining bit rate is insufficient, directly Discard the current frame and wait for the arrival of the next acquisition frame.
在一个示例中,已编码帧的帧级平均消耗码率计算公式如下:In one example, the frame-level average bitrate consumption calculation formula of encoded frames is as follows:
Figure PCTCN2022100805-appb-000001
Figure PCTCN2022100805-appb-000001
则当前帧是否需要丢弃根据如下计算公式确定:Then whether the current frame needs to be discarded is determined according to the following calculation formula:
Figure PCTCN2022100805-appb-000002
Figure PCTCN2022100805-appb-000002
其中,R av为已编码帧的帧级平均消耗码率,R k为第k帧的实际消耗码率,n为当前帧的序号;TargteBits为目标帧级码率;FPS为设定帧率;α为阈值系数;若丢弃标志位为1,则表示当前帧需要丢弃,若丢弃标志位为0,则表示当前帧不需要丢弃。基于上述公式可知,当已编码帧的帧级平均消耗码率与目标帧级码率之间的比值低于一定阈值时,需要丢弃 当前帧来确保码率的平稳。 Wherein, Rav is the frame-level average consumption code rate of the encoded frame, R k is the actual consumption code rate of the kth frame, and n is the sequence number of the current frame; TargteBits is the target frame-level code rate; FPS is the set frame rate; α is a threshold coefficient; if the discard flag is 1, it means that the current frame needs to be discarded; if the discard flag is 0, it means that the current frame does not need to be discarded. Based on the above formula, it can be seen that when the ratio between the frame-level average consumed bit rate of the encoded frame and the target frame-level bit rate is lower than a certain threshold, the current frame needs to be discarded to ensure a stable bit rate.
分辨率调控:即码表方案。针对不同分辨率的视频,从小到大依次设置各种码率进行编解码,得到重建视频,并计算出各种码率下的PSNR(Peak Signal to Noise Ratio,峰值信噪比),PSNR值越大,代表视频质量越好。通过大量的实验数据,可得到某一分辨率最适宜的码率范围,例如,270P(标清)的视频在码率为320kbps(千比特每秒)至500kbps时视频质量最好。将各种分辨率适宜的码率范围进行整合,即可形成码表方案。Resolution control: the code table solution. For videos with different resolutions, set various bit rates in sequence from small to large to encode and decode, get the reconstructed video, and calculate the PSNR (Peak Signal to Noise Ratio) under various bit rates. The PSNR value is higher Larger means better video quality. Through a large amount of experimental data, the most suitable bit rate range for a certain resolution can be obtained. For example, 270P (standard definition) video has the best video quality when the bit rate is 320kbps (kilobits per second) to 500kbps. A code table solution can be formed by integrating the appropriate bit rate ranges of various resolutions.
在一个示例中,码表方案如下所示:In one example, the code table scheme looks like this:
Figure PCTCN2022100805-appb-000003
Figure PCTCN2022100805-appb-000003
其中,level表示不同的分辨率级别,如180P(流畅)、270P(标清)、360P(高清);level mr是指默认的分辨率级别,如默认的分辨率为270P;uplevel和domnlevel分别代表level mr最适宜的码率范围上界和下界,当目标帧级码率越界时,即需要按照上述码表方案切换分辨率。示例性地,假设上述level mr为270P,level mr-1为180P,domnlevel为350kps,则当TargteBits由400kps波动到300kbps时,分辨率就需要从270P切换为180P。 Among them, level represents different resolution levels, such as 180P (smooth), 270P (standard definition), 360P (high definition); level mr refers to the default resolution level, such as the default resolution is 270P; uplevel and domnlevel represent level respectively The upper and lower bounds of the most suitable bit rate range for mr , when the target frame level bit rate exceeds the bounds, it is necessary to switch the resolution according to the above code table scheme. For example, assuming that the above-mentioned level mr is 270P, level mr -1 is 180P, and domnlevel is 350kps, then when TargteBits fluctuates from 400kps to 300kbps, the resolution needs to be switched from 270P to 180P.
从上述介绍可见,帧率调控更加侧重保证视频质量,主要以牺牲视频的流畅度为代价,来获得码率的平稳性,但是,此类调控会使得视频产生明显的卡顿,严重时甚至卡死,对用户的主观体验很不友好。换句话说,帧率调控的调控力度过大,适合极端情况。分辨率调控则更加侧重保证视频的流畅度,基于网络质量实时地调整视频的分辨率,达到平衡视频码率的效果。与帧率调控相比,分辨率调控方法相对比较温和,对用户的主观体验更加友好,应用场景也相对更加广泛。From the above introduction, it can be seen that the frame rate adjustment focuses more on ensuring the video quality, mainly at the expense of the smoothness of the video to obtain the stability of the bit rate. However, this type of adjustment will cause obvious video freezes, and even freezes in severe cases. Dead, very unfriendly to the user's subjective experience. In other words, the control of frame rate control is too strong, which is suitable for extreme situations. Resolution control focuses more on ensuring the fluency of the video, and adjusts the video resolution in real time based on the network quality to achieve the effect of balancing the video bit rate. Compared with frame rate control, the resolution control method is relatively gentler, more friendly to the user's subjective experience, and has a wider range of application scenarios.
然而,采用分辨率调控的情况下,在网络质量波动过于频繁时,分辨率的切换也会过于频繁,从而会产生明显的呼吸效应。另外,人眼会对简单场景下的画面质量变化更加敏感,此时,分辨率调控需要更加小心,避免由于分辨率调控力度过大导致视频的画面质量急剧下降或急剧上升,影响用户的观看和通话体验。However, in the case of resolution control, when the network quality fluctuates too frequently, the resolution switching will also be too frequent, which will produce a significant breathing effect. In addition, the human eye is more sensitive to changes in picture quality in simple scenes. At this time, resolution control needs to be more careful to avoid a sharp drop or rise in video picture quality due to excessive resolution control, which will affect users' viewing and viewing experience. call experience.
基于此,本申请实施例提供了一种视频编码方法,可以更加高效灵活地确定视频编码过程中对当前视频帧进行编码时所采用的分辨率。下面,将结合几个实施例对本申请提供的技术方案进行介绍说明。Based on this, an embodiment of the present application provides a video encoding method, which can more efficiently and flexibly determine the resolution used when encoding the current video frame during the video encoding process. In the following, the technical solutions provided by the present application will be described in conjunction with several embodiments.
需要说明的一点是,以下实施例中所述的“即时通讯”是指与视频相结合的即时通讯,如视频通话、远程会议、在线直播、网络教育等等。本申请实施例对“即时通讯”的开展方式不作限定,用户可以通过具备即时通讯功能的应用程序、网页、小程序等开展即时通讯。可选地,具备即时通讯功能的应用程序包括即时通讯应用程序、视频播放应用程序、直播应用程序、游戏应用程序、教育应用程序等,本申请实施例对此不作限定。It should be noted that the "instant messaging" mentioned in the following embodiments refers to instant messaging combined with video, such as video calls, teleconferencing, online live broadcast, online education, and so on. The embodiment of the present application does not limit the way of carrying out "instant messaging". Users can carry out instant messaging through applications, webpages, applets, etc. that have instant messaging functions. Optionally, the application program with the instant messaging function includes an instant messaging application program, a video playing application program, a live broadcast application program, a game application program, an educational application program, etc., which are not limited in this embodiment of the present application.
还需要说明的一点是,本申请实施例中仅是为了便于说明视频编码和视频解码的过程,而在即时通讯场景下对视频编码和视频解码进行了介绍,但这并不构成对本申请技术方案的限定。实际应用中,本申请实施例提供的视频编码方法也可以应用于非即时通讯场景中,例如,用户将拍摄的视频分享至个人社交平台、网页等场景中,这些均应属于本申请的保护范围之内。It should also be noted that the embodiment of this application is only for the convenience of explaining the process of video encoding and video decoding, and introduces video encoding and video decoding in the context of instant messaging, but this does not constitute a technical solution of this application. limit. In practical applications, the video encoding method provided by the embodiment of the present application can also be applied in non-instant messaging scenarios, for example, users share the captured video to personal social platforms, webpages and other scenarios, all of which should belong to the scope of protection of the present application within.
请参考图1,其示出了本申请一个实施例提供的即时通讯场景的示意图。如图1所示,该即时通讯场景包括:视频编码端110、视频解码端120。Please refer to FIG. 1 , which shows a schematic diagram of an instant messaging scenario provided by an embodiment of the present application. As shown in FIG. 1 , the instant messaging scenario includes: a video encoding end 110 and a video decoding end 120 .
视频编码端110是指即时通讯场景中视频内容的生成端,用于生成视频内容、对生成的 视频内容进行编码、将编码完的视频内容发送至视频解码端120等。视频解码端120是指即时通讯场景中视频内容的接收端,用于对接收到的视频内容进行解码、对解码完的视频内容进行播放等。可选地,视频编码端110和视频解码端120之间通过网络互相通信。在一个示例中,视频编码端110和视频解码端120之间可以直接通信,也可以通过服务器(图1中未示出)间接通信,例如,视频编码端110将编码完的视频内容发送至服务器,再由服务器将编码完的视频内容发送至视频解码端120。The video encoding end 110 refers to the generation end of video content in the instant messaging scene, which is used to generate video content, encode the generated video content, and send the encoded video content to the video decoding end 120, etc. The video decoding end 120 refers to the receiving end of the video content in the instant messaging scene, and is used for decoding the received video content, playing the decoded video content, and so on. Optionally, the video encoding end 110 and the video decoding end 120 communicate with each other through a network. In one example, the video encoding end 110 and the video decoding end 120 may communicate directly, or communicate indirectly through a server (not shown in FIG. 1 ), for example, the video encoding end 110 sends the encoded video content to the server , and then the server sends the encoded video content to the video decoder 120 .
本申请实施例对视频编码端110和/或视频解码端120的设备类型不作限定,在一个示例中,视频编码端110和/或视频解码端120为以下任意一个设备:计算机设备、终端设备、服务器、可穿戴设备、蓝牙设备、车载设备等。在一个示例中,视频编码端110和视频解码端120为相同的设备类型,或者,为不同的设备类型。当然,在实际的即时通讯场景中,视频编码端110和视频解码端120可以实现为同一个设备,即该设备既具备视频编码端110的功能,也具备视频解码端120的功能。图1仅以视频编码端110和视频解码端120为不同的设备进行举例说明,但这并不构成对本申请技术方案的限定。The embodiment of the present application does not limit the device type of the video encoding end 110 and/or the video decoding end 120. In one example, the video encoding end 110 and/or the video decoding end 120 is any of the following devices: computer equipment, terminal equipment, Servers, wearable devices, Bluetooth devices, in-vehicle devices, etc. In an example, the video encoding end 110 and the video decoding end 120 are of the same device type, or are of different device types. Of course, in an actual instant messaging scenario, the video encoding end 110 and the video decoding end 120 can be implemented as the same device, that is, the device has both the functions of the video encoding end 110 and the video decoding end 120 . FIG. 1 only illustrates that the video encoding end 110 and the video decoding end 120 are different devices for illustration, but this does not constitute a limitation to the technical solution of the present application.
需要说明的一点是,本申请实施例中仅是为了便于说明视频编码和视频解码的过程,而区分了视频编码端110和视频解码端120,但这并不构成对本申请技术方案的限定。在实际的即时通讯场景中,视频编码端110既可以对视频内容进行编码并发送出去,也可以接收视频内容并对其进行解码;视频解码端120既可以接收视频内容并对其解码,也可以对视频内容进行编码并发送出去。换句话说,在实际的即时通讯场景中,即时通讯的各方均可以执行产生并编码视频内容、解码并播放他方产生的视频内容等步骤。It should be noted that in this embodiment of the application, the video encoding end 110 and the video decoding end 120 are distinguished only for the convenience of explaining the process of video encoding and video decoding, but this does not constitute a limitation to the technical solution of the application. In an actual instant messaging scenario, the video encoding end 110 can encode and send the video content, and can also receive and decode the video content; the video decoding end 120 can receive the video content and decode it, or Encode the video content and send it. In other words, in an actual instant messaging scenario, all parties involved in instant messaging can perform steps such as generating and encoding video content, decoding and playing video content generated by other parties, and so on.
请参考图2,其示出了本申请一个实施例提供的视频编码方法的流程图。该方法可以应用于图1所示即时通讯场景的视频编码端110中。如图2所示,该方法包括如下几个步骤(210~240)。Please refer to FIG. 2 , which shows a flowchart of a video encoding method provided by an embodiment of the present application. This method can be applied to the video encoding end 110 in the instant messaging scene shown in FIG. 1 . As shown in Fig. 2, the method includes the following steps (210-240).
步骤210,获取当前网络条件对应的码率变化信息,码率变化信息用于指示当前网络条件相对于历史网络条件的波动。In step 210, the code rate change information corresponding to the current network condition is acquired, and the code rate change information is used to indicate the fluctuation of the current network condition relative to the historical network condition.
网络质量对视频编码过程中所采用的码率和分辨率等有着重要的影响,为了实现较好的视频编码效果、确保视频播放的清晰度和流畅度等,需要考虑网络质量对视频编码所采用的参数带来的影响。由上述内容可知,在网络质量波动较大时,超过了码率调控范围,则需要进行帧率和/或分辨率的调控。而在本申请实施例中,由于帧率调控力度过大,仅适用于极端情况,所以在网络质量波动较大的情况下,采用更为温和的分辨率调控方式。Network quality has an important impact on the bit rate and resolution used in the video encoding process. In order to achieve better video encoding effects and ensure the clarity and fluency of video playback, it is necessary to consider the network quality on the video encoding. The influence of the parameters. From the above content, it can be seen that when the network quality fluctuates greatly and the bit rate control range is exceeded, the frame rate and/or resolution need to be regulated. However, in the embodiment of the present application, because the frame rate regulation is too strong, it is only applicable to extreme cases, so when the network quality fluctuates greatly, a more moderate resolution regulation method is adopted.
因此,为了确定是否需要进行分辨率的调控,或者说,为了确定视频编码过程中对当前视频帧所采用的目标分辨率,则需要确定网络质量波动情况,即当前网络条件相对于历史网络条件的波动。由于网络质量通常由网络带宽反映,而码率与网络带宽通常也相关联,因此,本申请实施例中通过码率变化信息来指示当前网络条件相对于历史网络条件的波动。其中,历史网络条件可以是从当前时刻之前的某一时刻至当前时刻之间的网络质量,也可以是对视频内容进行编码的起始时刻至当前时刻之间的网络质量。有关码率变化信息、当前网络条件、历史网络条件等其它介绍说明,请参见下述实施例,此处不多赘述。Therefore, in order to determine whether resolution adjustment is required, or in other words, in order to determine the target resolution adopted for the current video frame in the video encoding process, it is necessary to determine the fluctuation of network quality, that is, the difference between current network conditions and historical network conditions. fluctuation. Because the network quality is usually reflected by the network bandwidth, and the code rate is usually associated with the network bandwidth, therefore, in the embodiment of the present application, the code rate change information is used to indicate the fluctuation of the current network condition relative to the historical network condition. Wherein, the historical network condition may be the network quality from a certain time before the current time to the current time, or may be the network quality from the start time of encoding the video content to the current time. For other descriptions about bit rate change information, current network conditions, historical network conditions, etc., please refer to the following embodiments, and details will not be repeated here.
步骤220,获取当前视频内容对应的参数变化信息,参数变化信息用于指示当前视频内容的内容复杂程度。 Step 220, acquiring parameter change information corresponding to the current video content, where the parameter change information is used to indicate the content complexity of the current video content.
由于人眼会对简单场景下的画面质量变化更加敏感,所以在视频内容简单的情况下,分辨率调控需要更加小心,避免由于分辨率调控力度过大导致视频的画面质量急剧下降或急剧上升。相比于相关技术仅考虑网络质量对视频编码的影响,本申请实施例提供的视频编码方法,还考虑了人眼针对视频内容的不同内容复杂程度的敏感情况,从而避免视频的画面质量急剧变化。Since the human eye is more sensitive to changes in picture quality in simple scenes, resolution control needs to be more careful when the video content is simple, so as to avoid a sharp drop or rise in video picture quality due to excessive resolution control. Compared with related technologies that only consider the impact of network quality on video coding, the video coding method provided by the embodiment of the present application also considers the sensitivity of human eyes to the complexity of different content of video content, so as to avoid drastic changes in video picture quality .
因此,为了确定视频编码过程中对当前视频帧所采用的目标分辨率,还需要确定当前视频内容的内容复杂程度。通常,在码率较为平稳时,视频帧的纹理复杂度越高,编码后的实 际量化参数(Quantization Parameter,QP)就越大,这两者之间呈现正相关的关系,因此,本申请实施例中通过量化参数的参数变化信息来指示当前视频内容的内容复杂程度。有关参数变化信息、内容复杂程度等其它介绍说明,请参见下述实施例,此处不多赘述。Therefore, in order to determine the target resolution adopted for the current video frame during the video encoding process, it is also necessary to determine the content complexity of the current video content. Usually, when the code rate is relatively stable, the higher the texture complexity of the video frame, the larger the actual quantization parameter (Quantization Parameter, QP) after encoding, and there is a positive correlation between the two. Therefore, the application implements In this example, the parameter change information of the quantization parameter is used to indicate the content complexity of the current video content. For other introductions such as parameter change information, content complexity, etc., please refer to the following embodiments, and details will not be repeated here.
步骤230,基于码率变化信息和参数变化信息,确定目标分辨率。Step 230: Determine the target resolution based on the code rate change information and the parameter change information.
在获取到码率变化信息和参数变化信息之后,即基于这两方面的信息确定对当前视频帧进行编码时所采用的目标分辨率。在一个示例中,视频编码端基于这两方面的信息确定无需进行分辨率调控,则直接将当前视频帧的原始分辨率作为目标分辨率。在另一个示例中,视频编码端基于这两方面的信息确定需要进行分辨率调控,则增加或降低当前视频帧的原始分辨率以得到目标分辨率。有关目标分辨率的确定等其它介绍说明,请参见下述实施例,此处不多赘述。After the code rate change information and the parameter change information are acquired, the target resolution used when encoding the current video frame is determined based on the two aspects of information. In an example, the video encoding end determines that resolution adjustment is not necessary based on the two aspects of information, and directly uses the original resolution of the current video frame as the target resolution. In another example, the video encoding end determines that resolution adjustment is required based on the two aspects of information, and then increases or decreases the original resolution of the current video frame to obtain the target resolution. For other descriptions such as determination of the target resolution, please refer to the following embodiments, and details will not be repeated here.
步骤240,采用目标分辨率对当前视频帧进行编码。 Step 240, encode the current video frame with the target resolution.
视频编码端在确定了目标分辨率之后,即可采用目标分辨率对当前视频帧进行编码,以使得视频码率与网络带宽相匹配,避免视频播放卡顿或播放失败等问题。可选地,视频编码端采用目标分辨率对当前视频帧进行编码包括:视频编码端基于目标分辨率对当前视频帧进行缩放处理。After the video encoding end determines the target resolution, it can use the target resolution to encode the current video frame, so that the video bit rate matches the network bandwidth, and avoids problems such as video playback freeze or playback failure. Optionally, the encoding of the current video frame by the video encoding end using the target resolution includes: performing scaling processing on the current video frame by the video encoding end based on the target resolution.
示例性地,在目标分辨率大于当前视频帧的原始分辨率的情况下,采用目标分辨率对当前视频帧进行编码包括:对当前视频帧进行上采样处理;在经过上采样处理后的当前视频帧的分辨率与目标分辨率匹配的情况下,采用目标分辨率对经过上采样处理后的当前视频帧进行编码。Exemplarily, when the target resolution is greater than the original resolution of the current video frame, encoding the current video frame with the target resolution includes: performing upsampling processing on the current video frame; When the frame resolution matches the target resolution, the target resolution is used to encode the upsampled current video frame.
示例性地,在目标分辨率小于当前视频帧的原始分辨率的情况下,采用目标分辨率对当前视频帧进行编码包括:对当前视频帧进行下采样处理;在经过下采样处理后的当前视频帧的分辨率与目标分辨率匹配的情况下,采用目标分辨率对经过下采样处理后的当前视频帧进行编码。Exemplarily, when the target resolution is smaller than the original resolution of the current video frame, encoding the current video frame with the target resolution includes: performing downsampling processing on the current video frame; When the frame resolution matches the target resolution, the target resolution is used to encode the downsampled current video frame.
可选地,经过上采样处理后的当前视频帧(或经过下采样处理后的当前视频帧)的分辨率与目标分辨率匹配包括:经过上采样处理后的当前视频帧(或经过下采样处理后的当前视频帧)的分辨率等于目标分辨率,或者,经过上采样处理后的当前视频帧(或经过下采样处理后的当前视频帧)的分辨率与目标分辨率之间的差值小于设定的阈值。Optionally, matching the resolution of the current video frame after the up-sampling process (or the current video frame after the down-sampling process) with the target resolution includes: the current video frame after the up-sampling process (or the current video frame after the down-sampling process) The resolution of the current video frame after upsampling) is equal to the target resolution, or the difference between the resolution of the current video frame after upsampling (or the current video frame after downsampling) and the target resolution is less than set the threshold.
综上所述,本申请实施例提供的技术方案,通过在视频编码过程中,结合网络质量的波动和视频内容的复杂程度,确定对当前视频帧编码时采用的分辨率,实现了更加准确地进行分辨率的调控。由于人眼会对简单场景下的画面质量变化更加敏感,本申请在调控分辨率时结合了视频内容的复杂程度,考虑了人眼针对视频内容的不同内容复杂程度的敏感情况,从而使得分辨率的调控更加准确和全面。并且,本申请在调控分辨率时同时考虑了网络质量的波动和视频内容的复杂程度,在网络质量波动过于频繁时,有效避免了分辨率的频繁切换,有助于降低由于网络质量频繁波动所产生的呼吸效应,提升用户的视频观看和通话体验。To sum up, in the technical solution provided by the embodiment of the present application, by combining the fluctuation of the network quality and the complexity of the video content in the process of video encoding, the resolution adopted for encoding the current video frame is determined, so as to realize more accurate Adjust the resolution. Since human eyes are more sensitive to changes in picture quality in simple scenes, this application combines the complexity of video content when adjusting the resolution, and considers the sensitivity of human eyes to different content complexity of video content, so that the resolution The regulation is more accurate and comprehensive. Moreover, this application considers the fluctuation of network quality and the complexity of video content when adjusting the resolution. When the network quality fluctuates too frequently, it effectively avoids frequent switching of resolutions, which helps to reduce the video frequency caused by frequent fluctuations in network quality. The resulting breathing effect improves the user's video viewing and calling experience.
下面,针对码率变化信息、参数变化信息和目标分辨率的确定过程的示例性实施方式进行介绍说明。In the following, an introduction will be given to an exemplary implementation of the process of determining the code rate change information, the parameter change information, and the target resolution.
在一个示例中,上述步骤210包括如下几个步骤(212~216)。In an example, the above step 210 includes the following steps (212-216).
步骤212,确定实时目标码率,实时目标码率用于指示当前网络条件。Step 212, determine the real-time target code rate, where the real-time target code rate is used to indicate the current network condition.
为了使得视频编码端编码出的视频帧能够在当前网络条件下发送成功,则需要对当前网络条件进行估计,以得到可供视频编码端参考的编码码率,即用于指示当前网络条件的实时目标码率。可选地,视频编码端采用带宽估计方法确定实时目标码率,该带宽估计方法包括但不限于:链路延时方法、包探测带宽估计方法等。In order to enable the video frame encoded by the video encoding end to be successfully transmitted under the current network conditions, it is necessary to estimate the current network conditions to obtain the encoding bit rate that can be used as a reference for the video encoding end, that is, the real-time frame used to indicate the current network conditions Target bit rate. Optionally, the video encoding end uses a bandwidth estimation method to determine the real-time target code rate, and the bandwidth estimation method includes but not limited to: a link delay method, a packet detection bandwidth estimation method, and the like.
步骤214,获取历史平均码率,历史平均码率用于指示历史网络条件。Step 214, obtaining the historical average code rate, which is used to indicate the historical network conditions.
为了获得当前网络条件相对于历史网络条件的波动,视频编码端还需要确定用于指示历史网络条件的历史平均码率。可选地,历史平均码率是从视频编码的开始时刻至当前时刻之 间的平均码率,例如,在本申请的技术方案应用于视频通话场景下,历史平均码率可以是视频通话开启的时刻至当前时刻之间的平均码率;或者,历史平均码率是当前时刻之前的一段时间内的平均码率,例如,历史平均码率为当前时刻之前的5秒内的平均码率。基于此,视频编码端需要维持一个码率缓存,该码率缓存内的均值即为历史平均码率,以用于指示历史网络条件。In order to obtain the fluctuation of the current network condition relative to the historical network condition, the video encoding end also needs to determine the historical average bit rate used to indicate the historical network condition. Optionally, the historical average bit rate is the average bit rate from the start moment of video encoding to the current moment. For example, when the technical solution of the present application is applied to a video call scenario, the historical average bit rate may be when the video call is started The average code rate between the time and the current time; or, the historical average code rate is the average code rate in a period of time before the current time, for example, the historical average code rate is the average code rate within 5 seconds before the current time. Based on this, the video encoding end needs to maintain a code rate buffer, and the average value in the code rate buffer is the historical average code rate, which is used to indicate historical network conditions.
步骤216,基于实时目标码率和历史平均码率,确定码率变化信息。Step 216: Determine code rate change information based on the real-time target code rate and the historical average code rate.
视频编码端在分别确定了实时目标码率和历史平均码率之后,即可比较实时目标码率和历史平均码率,以确定码率变化信息。在一个示例中,上述步骤216,包括:确定实时目标码率和历史平均码率之间的码率差值;基于码率差值确定码率变化信息。可选地,上述基于码率差值确定码率变化信息,包括:在码率差值的绝对值大于第一阈值,且码率差值为正数的情况下,确定码率变化信息包括码率发生剧烈变化,且码率骤增;在码率差值的绝对值大于第一阈值,且码率差值为负数的情况下,确定码率变化信息包括码率发生剧烈变化,且码率骤降;在码率差值的绝对值小于第一阈值的情况下,确定码率变化信息包括码率未发生剧烈变化。可选地,第一阈值为正数。After the video encoding end determines the real-time target bit rate and the historical average bit rate, it can compare the real-time target bit rate and the historical average bit rate to determine the bit rate change information. In one example, the above step 216 includes: determining a code rate difference between the real-time target code rate and the historical average code rate; and determining code rate change information based on the code rate difference. Optionally, determining the code rate change information based on the code rate difference includes: when the absolute value of the code rate difference is greater than the first threshold and the code rate difference is a positive number, determining that the code rate change information includes code The code rate changes drastically, and the code rate increases suddenly; when the absolute value of the code rate difference is greater than the first threshold, and the code rate difference is negative, the code rate change information includes that the code rate changes drastically, and the code rate sudden drop; when the absolute value of the code rate difference is smaller than the first threshold, determining that the code rate change information includes that the code rate does not change drastically. Optionally, the first threshold is a positive number.
示例性地,实时目标码率为R,历史平均码率为R av,R av=avg(buffer_R),其中,buffer_R为视频编码端维持的码率缓存,avg(·)表示求均值函数;则实时目标码率和历史平均码率之间的码率差值为R-R av。假设第一阈值为Th1,则码率变化信息有如下几种情况: Exemplarily, the real-time target code rate is R, and the historical average code rate is R av , R av =avg(buffer_R), wherein, buffer_R is the code rate cache maintained by the video encoding end, and avg(·) represents the averaging function; then The bit rate difference between the real-time target bit rate and the historical average bit rate is RR av . Assuming that the first threshold is Th1, the code rate change information has the following situations:
在|R-R av|<Th1的情况下,码率变化信息包括码率未发生剧烈变化; In the case of |RR av |<Th1, the code rate change information includes that the code rate has not changed drastically;
在R-R av>Th1的情况下,码率变化信息包括码率发生剧烈变化,且码率骤增; In the case of RR av >Th1, the code rate change information includes a drastic change in the code rate, and a sudden increase in the code rate;
在R av-R>Th1的情况下,码率变化信息包括码率发生剧烈变化,且码率骤减。 In the case of R av -R>Th1, the code rate change information includes that the code rate changes drastically, and the code rate drops sharply.
需要说明的一点是,针对|R-R av|=Th1的情况下码率变化信息的内容,本申请实施例对此不作限定,实际应用中,既可以设定这种情况下码率变化信息包括码率未发生剧烈变化,也可以设定这种情况下码率变化信息发生剧烈变化,并依据R-R av的正负设定码率骤增或码率骤减。应理解,这些均应属于本申请的保护范围之内。 It should be noted that the content of the code rate change information in the case of |RR av |=Th1 is not limited in this embodiment of the application. In practical applications, it can be set that the code rate change information in this case includes code If the rate does not change drastically, it can also be set that the bit rate change information changes drastically in this case, and the bit rate is set to increase or decrease according to the positive or negative value of RR av . It should be understood that all these should fall within the protection scope of the present application.
在一个示例中,上述步骤220包括如下几个步骤(222~226)。In an example, the above step 220 includes the following steps (222-226).
步骤222,获取第一量化参数值,第一量化参数值是指当前视频帧的前一视频帧的量化参数值。Step 222, acquiring a first quantization parameter value, where the first quantization parameter value refers to the quantization parameter value of the previous video frame of the current video frame.
通常,在当前视频内容相对于历史视频内容未发生场景变化的情况下,视频前后帧之间的差异很小,视频内容的内容复杂程度可认为是趋于一致的,因此,可以采用当前视频帧的前一视频帧的内容复杂程度代表当前视频帧的内容复杂程度。因此,本申请实施例中,视频编码端需要获取当前视频帧的前一视频帧的量化参数值,即第一量化参数值。Generally, when the current video content has no scene changes relative to the historical video content, the difference between the front and rear frames of the video is very small, and the content complexity of the video content can be considered to be consistent. Therefore, the current video frame can be used The content complexity of the previous video frame represents the content complexity of the current video frame. Therefore, in the embodiment of the present application, the video encoding end needs to obtain the quantization parameter value of the previous video frame of the current video frame, that is, the first quantization parameter value.
步骤224,获取第二量化参数值,第二量化参数值是指至少一个历史视频帧的量化参数值的均值。Step 224, acquiring a second quantization parameter value, where the second quantization parameter value refers to an average value of quantization parameter values of at least one historical video frame.
为了获得当前视频内容的内容复杂程度,视频编码端还需要确定至少一个历史视频帧的量化参数值的均值,即第二量化参数值。可选地,至少一个历史视频帧是从视频编码的开始时刻至当前时刻之间的所有视频帧,例如,在本申请的技术方案应用于视频通话场景下,至少一个历史视频帧可以是视频通话开启的时刻至当前时刻之间的所有视频帧;或者,至少一个历史视频帧是当前时刻之前的一段时间内的所有视频帧;或者,至少一个历史视频帧是当前视频帧之前的N个视频帧,N为正数,可选地,N为5、10、15等。基于此,视频编码端需要维持一个量化参数值缓存,该量化参数值缓存内的均值即为第二量化参数值,以用于指示近期视频内容的内容复杂程度。可选地,视频编码端维持一个长度为N的量化参数值缓存, N为正数,如N为10。In order to obtain the content complexity of the current video content, the video encoding end also needs to determine the mean value of the quantization parameter values of at least one historical video frame, that is, the second quantization parameter value. Optionally, at least one historical video frame is all video frames from the start moment of video encoding to the current moment, for example, when the technical solution of the present application is applied to a video call scenario, at least one historical video frame may be a video call All video frames from the moment of opening to the current moment; or, at least one historical video frame is all video frames in a period of time before the current moment; or, at least one historical video frame is N video frames before the current video frame , N is a positive number, optionally, N is 5, 10, 15, etc. Based on this, the video encoder needs to maintain a quantization parameter value cache, and the average value in the quantization parameter value cache is the second quantization parameter value, which is used to indicate the content complexity of recent video content. Optionally, the video encoding end maintains a quantization parameter value cache with a length of N, where N is a positive number, for example, N is 10.
步骤226,基于第一量化参数值和第二量化参数值,确定参数变化信息。Step 226: Determine parameter change information based on the first quantization parameter value and the second quantization parameter value.
视频编码端在分别确定了第一量化参数值和第二量化参数值之后,比较第一量化参数值和第二量化参数值,以确定参数变化信息。在一个示例中,上述步骤226,包括:确定第一量化参数值和第二量化参数值之间的参数差值;基于参数差值确定参数变化信息。可选地,上述基于参数差值确定参数变化信息,包括:在参数差值的绝对值大于第二阈值的情况下,确定参数变化信息指示视频内容复杂;在参数差值的绝对值小于第二阈值的情况下,确定参数变化信息指示视频内容简单。可选地,第二阈值为正数。After determining the first quantization parameter value and the second quantization parameter value respectively, the video encoding end compares the first quantization parameter value and the second quantization parameter value to determine parameter change information. In an example, the above step 226 includes: determining a parameter difference between the first quantization parameter value and the second quantization parameter value; and determining parameter change information based on the parameter difference. Optionally, determining the parameter change information based on the parameter difference includes: when the absolute value of the parameter difference is greater than a second threshold, determining that the parameter change information indicates that the video content is complex; when the absolute value of the parameter difference is smaller than the second threshold In the case of the threshold, the determination parameter change information indicates that the video content is simple. Optionally, the second threshold is a positive number.
示例性地,第一量化参数值为QP,第二量化参数值为QP av,其中,QP av=avg(buffer_QP),buffer_QP为视频编码端维持的量化参数值缓存,avg(·)表示求均值函数;则第一量化参数值和第二量化参数值之间的参数差值为QP-QP av。假设第二阈值为Th2,则参数变化信息有如下几种情况: Exemplarily, the first quantization parameter value is QP, and the second quantization parameter value is QP av , wherein, QP av =avg(buffer_QP), buffer_QP is the quantization parameter value cache maintained by the video encoder, and avg(·) represents the average value function; then the parameter difference between the first quantization parameter value and the second quantization parameter value is QP-QP av . Assuming that the second threshold is Th2, the parameter change information has the following situations:
在|QP-QP av|<Th2的情况下,参数变化信息指示视频内容简单; In the case of |QP-QP av |<Th2, the parameter change information indicates that the video content is simple;
在|QP-QP av|>Th2的情况下,参数变化信息指示视频内容复杂。 In the case of |QP-QP av |>Th2, the parameter change information indicates that the video content is complex.
需要说明的一点是,针对|QP-QP av|=Th2的情况下参数变化信息所指示的内容,本申请实施例对此不作限定,实际应用中,既可以设定这种情况下参数变化信息指示视频内容简单,也可以设定这种情况下参数变化信息指示视频内容复杂。应理解,这些均应属于本申请的保护范围之内。 It should be noted that the content indicated by the parameter change information in the case of |QP-QP av |=Th2 is not limited in this embodiment of the present application. In practical applications, the parameter change information in this case can be set The content of the indicated video is simple, and it can also be set that in this case the parameter change information indicates that the content of the video is complex. It should be understood that all these should fall within the protection scope of the present application.
基于上述关于码率变化信息和参数变化信息的介绍,上述步骤230包括以下步骤(232~238)中的任意一个步骤。Based on the above introduction about code rate change information and parameter change information, the above step 230 includes any one of the following steps (232-238).
步骤232,在码率变化信息包括码率骤增,且参数变化信息指示视频内容简单的情况下,在目标D帧间隔内逐步增加实时消耗码率;若实时消耗码率在超过目标D帧间隔后大于实时目标码率,则将当前视频帧的原始分辨率确定为目标分辨率;若实时消耗码率在超过目标D帧间隔后小于实时目标码率,则增加当前视频帧的原始分辨率得到目标分辨率。Step 232, when the code rate change information includes a sudden increase in the code rate, and the parameter change information indicates that the video content is simple, gradually increase the real-time consumption code rate within the target D frame interval; if the real-time consumption code rate exceeds the target D frame interval If it is greater than the real-time target bit rate, the original resolution of the current video frame is determined as the target resolution; if the real-time consumption bit rate is less than the real-time target bit rate after exceeding the target D frame interval, then increase the original resolution of the current video frame to get target resolution.
由于人眼会对简单场景下的画面质量变化更加敏感,所以在参数变化信息指示视频内容简单,且码率变化信息包括码率骤增的情况下,应避免分辨率调控力度过大导致视频的画面质量急剧上升。因此,本申请实施例针对视频内容简单且码率骤增的场景,先采用码率调控,再基于码率调控的结果确定是否采用分辨率调控。Since the human eye is more sensitive to changes in picture quality in simple scenes, when the parameter change information indicates that the video content is simple, and the bit rate change information includes a sudden increase in the bit rate, it should be avoided that the resolution control is too large to cause video distortion. Picture quality has risen dramatically. Therefore, in the embodiment of the present application, for the scene where the video content is simple and the code rate increases suddenly, the code rate control is first adopted, and then whether to adopt the resolution control is determined based on the result of the code rate control.
针对视频内容简单且码率骤增的场景,在目标D帧间隔内逐步增加实时消耗码率。可选地,目标D帧为接下来的D帧,D的取值可以为15。若实时消耗码率在超过目标D帧间隔后大于实时目标码率,则说明码率调控已经可以适应当前网络条件,此时,将当前视频帧的原始分辨率确定为目标分辨率。若实时消耗码率在超过目标D帧间隔后小于实时目标码率,则说明码率调控仍然无法与当前网络条件相适应,则继续采用分辨率调控,即增加当前视频帧的原始分辨率得到目标分辨率。在D帧间隔内采用提高码率的方式使得视频的画面质量有所上升,可以实现较为平滑地过渡。For scenes where the video content is simple and the bit rate increases suddenly, gradually increase the real-time consumption bit rate within the target D frame interval. Optionally, the target D frame is the next D frame, and the value of D may be 15. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, and then continue to use resolution control, that is, increase the original resolution of the current video frame to obtain the target resolution. The method of increasing the bit rate in the D frame interval improves the picture quality of the video, and can realize a relatively smooth transition.
在本示例中,由于码率变化信息包括码率骤增,则在目标D帧间隔内,实时目标码率处于高位,实时消耗码率处于低位,此时,就可能会出现码率的浪费。为了避免码率的浪费,可选地,视频编码端填补冗余纠错包,例如,重发部分关键帧的数据包,以增强关键帧的纠错能力。In this example, since the code rate change information includes a sudden increase in the code rate, within the target D frame interval, the real-time target code rate is at a high level, and the real-time consumed code rate is at a low level. At this time, a waste of code rate may occur. In order to avoid waste of code rate, optionally, the video encoding end fills redundant error correction packets, for example, resends some data packets of key frames, so as to enhance the error correction capability of key frames.
步骤234,在码率变化信息包括码率骤降,且参数变化信息指示视频内容简单的情况下,在目标D帧间隔内逐步降低实时消耗码率;若实时消耗码率在超过目标D帧间隔后小于实时目标码率,则将当前视频帧的原始分辨率确定为目标分辨率;若实时消耗码率在超过目标D帧间隔后大于实时目标码率,则降低当前视频帧的原始分辨率得到目标分辨率。Step 234, when the code rate change information includes a sudden drop in the code rate, and the parameter change information indicates that the video content is simple, gradually reduce the real-time consumption code rate within the target D frame interval; if the real-time consumption code rate exceeds the target D frame interval If it is smaller than the real-time target bit rate, the original resolution of the current video frame is determined as the target resolution; if the real-time consumption bit rate exceeds the target D frame interval and is greater than the real-time target bit rate, then the original resolution of the current video frame is reduced to obtain target resolution.
由于人眼会对简单场景下的画面质量变化更加敏感,所以在参数变化信息指示视频内容简单,且码率变化信息包括码率骤降的情况下,应避免分辨率调控力度过大导致视频的画面质量急剧下降。因此,本申请实施例针对视频内容简单且码率骤降的场景,先采用码率调控,再基于码率调控的结果确定是否采用分辨率调控。Since the human eye is more sensitive to changes in picture quality in simple scenes, when the parameter change information indicates that the video content is simple, and the bit rate change information includes a sudden drop in the bit rate, it should be avoided that the resolution control is too strong to cause video distortion. Picture quality drops drastically. Therefore, in the embodiment of the present application, for the scene where the video content is simple and the code rate drops suddenly, the code rate control is first adopted, and then whether to adopt the resolution control is determined based on the result of the code rate control.
针对视频内容简单且码率骤降的场景,在目标D帧间隔内逐步降低实时消耗码率。可选地,目标D帧为接下来的D帧,D的取值可以为15。若实时消耗码率在超过目标D帧间隔后小于实时目标码率,则说明码率调控已经可以适应当前网络条件,此时,将当前视频帧的原始分辨率确定为目标分辨率。若实时消耗码率在超过目标D帧间隔后大于实时目标码率,则说明码率调控仍然无法与当前网络条件相适应,则继续采用分辨率调控,即降低当前视频帧的原始分辨率得到目标分辨率。在D帧间隔内采用降低码率的方式使得视频的画面质量有所下降,可以实现较为平滑地过渡。For scenes where the video content is simple and the bit rate drops suddenly, gradually reduce the real-time consumption bit rate within the target D frame interval. Optionally, the target D frame is the next D frame, and the value of D may be 15. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, then continue to use resolution control, that is, reduce the original resolution of the current video frame to obtain the target resolution. The method of reducing the bit rate in the D frame interval reduces the picture quality of the video, and can achieve a relatively smooth transition.
步骤236,在码率变化信息包括码率骤增,且参数变化信息指示视频内容复杂的情况下,在目标D帧间隔内逐步增加实时消耗码率;若实时消耗码率在超过目标D帧间隔后大于实时目标码率,则将当前视频帧的原始分辨率确定为目标分辨率;若实时消耗码率在超过目标D帧间隔后小于实时目标码率,则增加当前视频帧的原始分辨率得到目标分辨率。Step 236, when the code rate change information includes a sudden increase in the code rate, and the parameter change information indicates that the video content is complex, gradually increase the real-time consumption code rate within the target D frame interval; if the real-time consumption code rate exceeds the target D frame interval If it is greater than the real-time target bit rate, the original resolution of the current video frame is determined as the target resolution; if the real-time consumption bit rate is less than the real-time target bit rate after exceeding the target D frame interval, then increase the original resolution of the current video frame to get target resolution.
在参数变化信息指示视频内容复杂的情况下,历史视频帧编码后的实际量化参数较大;而由于码率变化信息包括码率骤增,从而实时目标码率较高、量化参数值较小。因此,本申请实施例针对视频内容复杂且码率骤增的场景,先采用码率调控逐帧提升视频的画面质量,再基于码率调控的结果确定是否采用分辨率调控。When the parameter change information indicates that the video content is complex, the actual quantization parameter after encoding the historical video frame is relatively large; and because the bit rate change information includes a sudden increase in the bit rate, the real-time target bit rate is higher and the quantization parameter value is smaller. Therefore, in the embodiment of the present application, aiming at the scene where the video content is complex and the code rate increases rapidly, the code rate control is firstly used to improve the picture quality of the video frame by frame, and then it is determined whether to adopt the resolution control based on the result of the code rate control.
针对视频内容复杂且码率骤增的场景,在目标D帧间隔内逐步增加实时消耗码率。可选地,目标D帧为接下来的D帧,D的取值可以为15。若实时消耗码率在超过目标D帧间隔后大于实时目标码率,则说明码率调控已经可以适应当前网络条件,此时,将当前视频帧的原始分辨率确定为目标分辨率。若实时消耗码率在超过目标D帧间隔后小于实时目标码率,则说明码率调控仍然无法与当前网络条件相适应,则继续采用分辨率调控,即增加当前视频帧的原始分辨率得到目标分辨率。在D帧间隔内采用提高码率的方式使得视频的画面质量有所上升,可以实现较为平滑地过渡。For scenes where the video content is complex and the bit rate increases suddenly, the real-time consumption bit rate is gradually increased within the target D frame interval. Optionally, the target D frame is the next D frame, and the value of D may be 15. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, and then continue to use resolution control, that is, increase the original resolution of the current video frame to obtain the target resolution. The method of increasing the bit rate in the D frame interval improves the picture quality of the video, and can realize a relatively smooth transition.
步骤238,在码率变化信息包括码率骤降,且参数变化信息指示视频内容复杂的情况下,降低当前视频帧的原始分辨率得到目标分辨率。Step 238 , if the code rate change information includes a sudden drop in the code rate, and the parameter change information indicates that the video content is complex, reduce the original resolution of the current video frame to obtain the target resolution.
在参数变化信息指示视频内容复杂的情况下,历史视频帧编码后的实际量化参数较大;而由于码率变化信息包括码率骤降,从而实时目标码率较低、量化参数值较大。因此,针对视频内容复杂且码率骤降的场景,难以通过码率的调控实现与当前网络条件的适应,本申请实施例直接对分辨率进行调控,即降低当前视频帧的原始分辨率得到目标分辨率,以保证码率的跟随性。When the parameter change information indicates that the video content is complex, the actual quantization parameter after encoding the historical video frame is relatively large; and because the bit rate change information includes the bit rate drop, the real-time target bit rate is low and the quantization parameter value is large. Therefore, for scenarios where the video content is complex and the bit rate drops suddenly, it is difficult to adjust the bit rate to adapt to the current network conditions. The embodiment of the present application directly adjusts the resolution, that is, reduces the original resolution of the current video frame to obtain the target resolution to ensure the followability of the code rate.
可选地,在码率变化信息包括码率未发生剧烈变化的情况下,可以直接采用编码器内部的码率调控方案,而无需采用分辨率调控,从而视频编码端直接将当前视频帧的原始分辨率确定为目标分辨率。Optionally, when the code rate change information includes that the code rate has not changed drastically, the internal code rate control scheme of the encoder can be directly adopted without resolution control, so that the video encoding end directly converts the original The resolution is determined as the target resolution.
综上所述,本申请实施例提供的技术方案,通过结合网络质量的波动和视频内容的复杂程度,将分辨率的调控分为多种类型。并且,针对视频内容简单的场景,无论网络质量如何波动,由于人眼对会对简单场景下的画面质量变化更加敏感,所以先采用码率调控的方式平滑视频的画面质量变化,在码率调控无法适应网络质量时,再采用分辨率调控的方式,有效避免了视频的画面质量的急剧变化。另外,针对视频内容复杂的场景,在码率骤降时,直接调控分辨率以确保码率的跟随性;在码率骤增时,先调控码率以优先确保画面质量变化的平滑性,有效避免画面质量的急剧变化。本申请实施例通过上述精细化的分辨率调控方案,提升了视频播放效果或视频通话效果等,为用户带来了更好的视频播放或视频通话体验。To sum up, the technical solutions provided by the embodiments of the present application classify resolution adjustment into multiple types by combining fluctuations in network quality and complexity of video content. In addition, for scenes with simple video content, no matter how the network quality fluctuates, since the human eye is more sensitive to changes in picture quality in simple scenes, the bit rate control method is first used to smooth the picture quality changes of the video. When the network quality cannot be adapted, the resolution control method is adopted to effectively avoid the sharp change of the video picture quality. In addition, for scenes with complex video content, when the bit rate drops sharply, directly adjust the resolution to ensure the followability of the bit rate; Avoid drastic changes in picture quality. The embodiment of the present application improves the video playback effect or the video call effect through the above refined resolution control scheme, and brings better video playback or video call experience to the user.
上述实施例所介绍的分辨率调控方案中,是采用当前视频帧的前一视频帧的量化参数值 作为当前视频帧的内容复杂程度的度量,这适应于视频前后帧之间的差异很小的情况。基于此,在采用上述实施例所介绍的分辨率调控方案之前,还需要确定场景是否发生变化。In the resolution control scheme introduced in the above embodiments, the quantization parameter value of the previous video frame of the current video frame is used as the measure of the complexity of the content of the current video frame, which is suitable for the case where the difference between the front and back frames of the video is small Condition. Based on this, it is also necessary to determine whether the scene changes before adopting the resolution control solution introduced in the above embodiment.
基于此,在一个示例中,上述方法还包括如下步骤。Based on this, in an example, the above method further includes the following steps.
步骤250,检测当前视频内容相对于历史视频内容的场景变化。Step 250, detecting the scene change of the current video content relative to the historical video content.
在视频播放或视频通话等场景中,一旦发生场景变化,则视频内容的内容复杂程度将可能产生较大改变,从而可能会造成较大的码率波动,对上述实施例所介绍的分辨率调控方案产生干扰。因此,本申请实施例可以先检测当前视频内容相对于历史视频内容的场景变化,以避免场景变化对分辨率调控带来的误差和不利影响。本申请实施例对场景变化的检测方法不作限定,可选地,场景变化的检测方法包括:关键块匹配算法、全帧匹配算法、下采样帧匹配算法等。通常,关键块匹配算法的计算复杂度较低。下面,对关键块匹配算法应用于检测场景变化的过程进行介绍说明。In scenarios such as video playback or video calls, once the scene changes, the content complexity of the video content may change greatly, which may cause large bit rate fluctuations. program interferes. Therefore, in the embodiment of the present application, the scene change of the current video content relative to the historical video content can be detected first, so as to avoid errors and adverse effects caused by the scene change on the resolution adjustment. The embodiment of the present application does not limit the scene change detection method. Optionally, the scene change detection method includes: a key block matching algorithm, a full frame matching algorithm, a downsampling frame matching algorithm, and the like. In general, keyblock matching algorithms have low computational complexity. In the following, the process of applying the key block matching algorithm to detect scene changes will be described.
在一个示例中,上述步骤250包括如下几个步骤(252~256)。In an example, the above step 250 includes the following steps (252-256).
步骤252,从当前视频帧中确定至少一个关键块。Step 252, determine at least one key block from the current video frame.
本申请实施例对关键块的选取数量、选取位置、大小等均不作限定。在一个示例中,视频编码端从当前视频帧中确定a个关键块,a为正整数,如4、5、6等。在一个示例中,至少一个关键块的大小均相同,例如,大小均为16×16像素,或均为8×8像素,或均为32×32像素,或均为4×4像素,或均为64×64像素;或者,至少一个关键块的大小不完全相同,如一个关键块的大小为16×16像素,另一个关键块的大小为32×32像素等。在一个示例中,至少一个关键块在当前视频帧中均匀分布,或者,至少一个关键块集中在当前视频帧中的某一区域,例如,至少一个关键帧集中在当前视频帧的中间区域。The embodiment of the present application does not limit the selected number, selected position, size, etc. of the key blocks. In an example, the video encoding end determines a key blocks from the current video frame, where a is a positive integer, such as 4, 5, 6, and so on. In an example, the size of at least one key block is the same, for example, the size is 16×16 pixels, or 8×8 pixels, or 32×32 pixels, or 4×4 pixels, or are 64×64 pixels; or, the size of at least one key block is not exactly the same, for example, the size of one key block is 16×16 pixels, and the size of another key block is 32×32 pixels, etc. In an example, at least one key block is evenly distributed in the current video frame, or at least one key block is concentrated in a certain area in the current video frame, for example, at least one key frame is concentrated in the middle area of the current video frame.
示例性地,视频编码端从当前视频帧中确定5个关键块,这5个关键块在当前视频帧中均匀分布,且这5个关键块的大小均为16×16像素。例如,如图3所示,在当前视频帧的中心位置及其周围共选取5个16×16像素大小的方块作为关键块,当前视频帧的中心位置的关键块为310,中心位置周围的关键块为320。其中,每个关键块320距关键块310的水平偏移和竖直偏移均为64个像素,从而这5个关键块在当前视频帧中呈现如图3所示的均匀分布。Exemplarily, the video encoding end determines 5 key blocks from the current video frame, the 5 key blocks are evenly distributed in the current video frame, and the size of the 5 key blocks are all 16×16 pixels. For example, as shown in Figure 3, a total of 5 squares with a size of 16×16 pixels are selected as key blocks at the center of the current video frame and its surroundings. The key block at the center of the current video frame is 310, and the key blocks around the center are The block is 320. The horizontal and vertical offsets of each key block 320 from the key block 310 are both 64 pixels, so that the five key blocks are evenly distributed in the current video frame as shown in FIG. 3 .
步骤254,针对至少一个关键块中的第一关键块,在当前视频帧的前一视频帧中与第一关键块对应的位置,以目标半径为搜索半径进行匹配块搜索。Step 254: For the first key block in the at least one key block, search for a matching block with the target radius as the search radius at the position corresponding to the first key block in the previous video frame of the current video frame.
在确定完关键块之后,即进行关键块的匹配。本申请实施例中,将当前视频帧与当前视频帧的前一视频帧进行关键块匹配,从而,针对至少一个关键块中的每一关键块,均需从当前视频帧的前一视频帧中进行匹配块搜索。示例性地,针对至少一个关键块中的第一关键块,首先需要确定第一关键块在当前视频帧的前一视频帧中对应的位置,再在该对应的位置周围以目标半径r为搜索半径进行匹配块搜索。本申请实施例对目标半径的大小不作限定,可选地,目标半径为1像素,或2像素,或4像素,或8像素。After the key blocks are determined, the key blocks are matched. In the embodiment of the present application, key block matching is performed between the current video frame and the previous video frame of the current video frame, so that, for each key block in at least one key block, it is necessary to select from the previous video frame of the current video frame Do a matching block search. Exemplarily, for the first key block in at least one key block, it is first necessary to determine the corresponding position of the first key block in the previous video frame of the current video frame, and then use the target radius r as the search around the corresponding position Radius to search for matching blocks. The embodiment of the present application does not limit the size of the target radius. Optionally, the target radius is 1 pixel, or 2 pixels, or 4 pixels, or 8 pixels.
步骤256,若搜索到的方块中存在与第一关键块之间的均方误差小于目标阈值的方块,则确定第一关键块在当前视频帧的前一视频帧中存在匹配块。Step 256, if there is a block whose mean square error with the first key block is smaller than the target threshold among the searched blocks, determine that the first key block has a matching block in the previous video frame of the current video frame.
如果在当前视频帧的前一视频帧的搜索范围内,能够搜索到某一方块与第一关键块之间的均方误差(Mean Square Error,MSE)小于目标阈值,则将该方块确定为第一关键块的匹配块,即当前视频帧的前一视频帧中存在第一关键块的匹配块。可选地,视频编码端除采用均方误差作为匹配块搜索的准则外,还可以采用MAD(Mean Absolute Deviation,平均绝对误差)、SAD(Sum of Absolute Difference,绝对误差和)等进行匹配块的搜索,本申请实施例对匹配块搜索时采用的匹配准则不作限定。可选地,匹配块与关键块的大小需是相同的,例如,假设第一关键块的大小为16×16像素,则第一关键块的匹配块的大小也为16×16像素。If the mean square error (Mean Square Error, MSE) between a block and the first key block can be searched within the search range of the previous video frame of the current video frame is less than the target threshold, then the block is determined as the first key block A matching block of a key block, that is, a matching block of the first key block exists in the previous video frame of the current video frame. Optionally, in addition to using the mean square error as the criterion for matching block search, the video encoding end can also use MAD (Mean Absolute Deviation, average absolute error), SAD (Sum of Absolute Difference, absolute error sum), etc. to perform matching block search Search, the embodiment of the present application does not limit the matching criteria used in the matching block search. Optionally, the size of the matching block and the key block must be the same. For example, assuming that the size of the first key block is 16×16 pixels, the size of the matching block of the first key block is also 16×16 pixels.
示例性地,搜索范围内搜索到的方块与关键块之间的均方误差MSE为:Exemplarily, the mean square error MSE between the searched blocks and key blocks within the search range is:
Figure PCTCN2022100805-appb-000004
Figure PCTCN2022100805-appb-000004
其中,N为关键块的大小,如N为16;C ij为当前视频帧的关键块中第i行第j列对应的像素值;R ij为搜索范围内搜索到的方块中第i行第j列对应的像素值。由上述计算公式计算出的MSE越小,即表示搜索到的方块与关键块之间的相似度越高。本申请实施例中设置了目标阈值Th 0,在MSE小于Th 0时,即认为搜索到的方块为关键块的匹配块。 Among them, N is the size of the key block, such as N is 16; C ij is the pixel value corresponding to the i -th row and j-th column in the key block of the current video frame; The pixel value corresponding to column j. The smaller the MSE calculated by the above calculation formula, the higher the similarity between the searched block and the key block. In the embodiment of the present application, a target threshold Th 0 is set, and when the MSE is smaller than Th 0 , the searched block is considered to be a matching block of the key block.
本申请实施例中,在至少一个关键块在当前视频帧的前一视频帧中均存在匹配块的情况下,认为当前视频帧与前一视频帧相似,即确定当前视频帧相对于历史视频帧未发生场景变化;而若至少一个关键块中存在某一关键块在当前视频帧的前一视频帧中不存在匹配块的情况下,确定当前视频帧相对于历史视频帧发生场景变化。In the embodiment of the present application, when at least one key block has a matching block in the previous video frame of the current video frame, it is considered that the current video frame is similar to the previous video frame, that is, it is determined that the current video frame is relatively similar to the historical video frame There is no scene change; and if there is a certain key block in at least one key block and there is no matching block in the previous video frame of the current video frame, it is determined that the current video frame has a scene change relative to the historical video frame.
当然,在实际应用中,也可以在至少一个关键块中目标数量的关键块在当前视频帧的前一视频帧中存在匹配块的情况下,确定当前视频帧相对于历史视频帧未发生场景变化。例如,在当前视频帧中选取了5个关键块,在这5个关键块中的4个关键块在当前视频帧的前一视频帧中存在匹配块的情况下,确定当前视频帧相对于历史视频帧未发生场景变化。应理解,这些方案也应属于本申请的保护范围之内。Of course, in practical applications, it is also possible to determine that there is no scene change in the current video frame relative to the historical video frame when there are matching blocks in at least one key block of the target number of key blocks in the previous video frame of the current video frame . For example, if 5 key blocks are selected in the current video frame, and 4 key blocks in the 5 key blocks have matching blocks in the previous video frame of the current video frame, determine the current video frame relative to the history There is no scene change in the video frame. It should be understood that these solutions should also fall within the protection scope of the present application.
基于上述场景变化检测,在一个示例中,上述步骤230实现为:在当前视频内容相对于历史视频内容未发生场景变化的情况下,基于码率变化信息和参数变化信息,确定目标分辨率。也即,在检测出场景未发生变化时,采用上述实施例提供的分辨率调控方案,结合网络质量的波动和视频内容的复杂程度来确定目标分辨率。Based on the above scene change detection, in an example, the above step 230 is implemented as: determining the target resolution based on bit rate change information and parameter change information when the current video content has no scene change relative to the historical video content. That is, when it is detected that the scene does not change, the target resolution is determined by using the resolution control solution provided by the above embodiment, taking into account fluctuations in network quality and complexity of video content.
基于上述场景变化检测,在另一个示例中,上述步骤256之后,还包括:在当前视频内容相对于历史视频内容发生场景变化的情况下,将目标对应关系中与实时目标码率对应的分辨率,确定为目标分辨率;其中,目标对应关系包括至少一组目标码率与分辨率之间的对应关系。也即,在检测出场景发生变化时,采用码表方案来确定目标分辨率,视频编码端从目标对应关系中确定实时目标码率对应的分辨率,将该分辨率作为目标分辨率。Based on the above scene change detection, in another example, after the above step 256, it also includes: when the current video content has a scene change relative to the historical video content, the resolution corresponding to the real-time target bit rate in the target correspondence , determined as the target resolution; wherein, the target correspondence includes at least one set of correspondences between the target bit rate and the resolution. That is, when a scene change is detected, the code table scheme is used to determine the target resolution, and the video encoding end determines the resolution corresponding to the real-time target bit rate from the target correspondence, and takes this resolution as the target resolution.
综上所述,本申请实施例提供的技术方案,通过检测当前视频内容相对于历史视频内容的场景变化,在检测到未发生场景变化的情况下,结合网络质量的波动和视频内容的复杂程度来确定目标分辨率,有效避免了由于场景变化所产生的码率波动对分辨率调控的影响,提升了分辨率调控的准确性。To sum up, the technical solution provided by the embodiment of the present application detects the scene change of the current video content relative to the historical video content, and combines the fluctuation of the network quality and the complexity of the video content when no scene change is detected. To determine the target resolution, effectively avoiding the impact of bit rate fluctuations on resolution adjustment due to scene changes, and improving the accuracy of resolution adjustment.
下面,以一个示例性实施例对本申请提供的视频编码方法进行介绍说明。In the following, an exemplary embodiment is used to describe the video encoding method provided in this application.
请参考图4,其示出了本申请一个实施例提供的视频编码方法的流程图。该方法可以应用于图1所示即时通讯场景的视频编码端110中。如图4所示,该方法包括如下几个步骤(401至412)。Please refer to FIG. 4 , which shows a flowchart of a video encoding method provided by an embodiment of the present application. This method can be applied to the video encoding end 110 in the instant messaging scene shown in FIG. 1 . As shown in Fig. 4, the method includes the following steps (401 to 412).
步骤401,获取视频帧数据。在开启视频通话或进行视频播放(如进行视频直播)的情况下,视频编码端的视频采集模块可以调用相机模组以目标帧率进行视频帧的采集,并将采集到的视频帧数据传输至视频编码端的音视频处理模块进行处理。 Step 401, acquire video frame data. In the case of starting a video call or performing video playback (such as live video broadcasting), the video capture module at the video encoding end can call the camera module to capture video frames at the target frame rate, and transmit the captured video frame data to the video The audio and video processing module at the encoding end performs processing.
步骤402,获取网络质量反馈。视频编码端的音视频处理模块可以利用带宽估计方法确定实时目标码率R,用于指示当前网络条件。同时,本步骤会维持一个码率缓存buffer_R,该码率缓存buffer_R可以为秒级的码率缓存,如5秒。码率缓存的均值R av为历史平均码率,用于指示历史网络条件。 Step 402, acquiring network quality feedback. The audio and video processing module at the video encoding end can use the bandwidth estimation method to determine the real-time target code rate R, which is used to indicate the current network conditions. At the same time, this step will maintain a code rate buffer buffer_R, and the code rate buffer buffer_R can be a second-level code rate buffer, such as 5 seconds. The average value R av of the code rate cache is the historical average code rate, which is used to indicate the historical network conditions.
步骤403,获取视频内容反馈。当码率较为平稳时,视频帧的纹理复杂度越高,编码后的实际量化参数值就越大。因此,本步骤采用量化参数值指示视频内容的内容复杂程度。视频编码端获取当前视频帧的前一视频帧的量化参数值,即第一量化参数值QP。同时,视频编码端建立并维护一个长度为N的量化参数值缓存buffer_QP,可选地,N取值为10。该量化参数值缓存buffer_QP的均值为第二量化参数值QP av,用于指示近期视频内容的内容复杂程度。 Step 403, acquire video content feedback. When the bit rate is relatively stable, the higher the texture complexity of the video frame, the larger the actual quantization parameter value after encoding. Therefore, in this step, the quantitative parameter value is used to indicate the content complexity of the video content. The video encoding end obtains the quantization parameter value of the previous video frame of the current video frame, that is, the first quantization parameter value QP. At the same time, the video encoding end establishes and maintains a buffer_QP of quantization parameter values with a length of N. Optionally, the value of N is 10. The average value of the quantization parameter value buffer buffer_QP is the second quantization parameter value QP av , which is used to indicate the content complexity of recent video content.
步骤404,检测场景是否发生变化。一旦发生场景变化,则视频内容的内容复杂程度将可能产生较大改变,从而可能会造成较大的码率波动。因此,先检测当前视频内容相对于历史视频内容的场景变化,以避免场景变化对分辨率调控带来的误差和不利影响。视频编码端建立一个帧级缓存buffer_pre,用于存储当前视频帧的前一视频帧数据,从而,视频编码端每收到实时的当前视频帧时,将当前视频帧与前一视频帧进行关键块匹配,以检测当前视频内容相对于历史视频内容是否发生场景变化。在未发生场景变化的情况下,执行下述步骤405;在发生场景变化的情况下,执行下述步骤411。 Step 404, detecting whether the scene changes. Once the scene changes, the content complexity of the video content may change greatly, which may cause large bit rate fluctuations. Therefore, the scene change of the current video content relative to the historical video content is detected first, so as to avoid errors and adverse effects caused by the scene change on the resolution adjustment. The video encoding end establishes a frame-level buffer buffer_pre, which is used to store the previous video frame data of the current video frame, so that each time the video encoding end receives the real-time current video frame, it performs key blocks between the current video frame and the previous video frame Match to detect whether the current video content has a scene change relative to the historical video content. If there is no scene change, execute the following step 405; if there is a scene change, execute the following step 411.
步骤405,检测网络质量是否波动。视频编码端比较上述步骤402获取的实时目标码率R和历史平均码率R av,以确定网络质量是否产生较大波动。若实时目标码率R和历史平均码率R av之间的码率差值大于第一阈值Th1,则确定网络质量产生较大波动、码率急剧变化,执行下述步骤406。若实时目标码率R和历史平均码率R av之间的码率差值小于或等于第一阈值Th1,则确定网络质量波动较小,保持当前视频帧的原始分辨率,也即,将当前视频帧的原始分辨率作为目标分辨,执行下述步骤412。 Step 405, detecting whether the network quality fluctuates. The video encoding end compares the real-time target bit rate R obtained in the above step 402 with the historical average bit rate R av to determine whether the network quality fluctuates greatly. If the code rate difference between the real-time target code rate R and the historical average code rate R av is greater than the first threshold Th1, it is determined that the network quality fluctuates greatly and the code rate changes sharply, and the following step 406 is executed. If the code rate difference between the real-time target code rate R and the historical average code rate R av is less than or equal to the first threshold Th1, it is determined that the network quality fluctuation is small, and the original resolution of the current video frame is maintained, that is, the current The original resolution of the video frame is used as the target resolution, and the following step 412 is performed.
步骤406,确定内容复杂程度。视频编码端比较上述步骤403获取的第一量化参数值QP和第二量化参数值QP av,以确定视频内容的内容复杂程度。若第一量化参数值QP和第二量化参数值QP av之间的参数差值的绝对值大于第二阈值Th2,则指示视频内容复杂;若第一量化参数值QP和第二量化参数值QP av之间的参数差值的绝对值小于第二阈值Th2,则指示视频内容简单。 Step 406, determine the complexity of the content. The video encoder compares the first quantization parameter value QP and the second quantization parameter value QP av obtained in step 403 above to determine the content complexity of the video content. If the absolute value of the parameter difference between the first quantization parameter value QP and the second quantization parameter value QP av is greater than the second threshold Th2, it indicates that the video content is complex; if the first quantization parameter value QP and the second quantization parameter value QP If the absolute value of the parameter difference between av is smaller than the second threshold Th2, it indicates that the video content is simple.
步骤407,执行视频内容简单且码率骤增场景下的调控方案。此时,在目标D帧间隔内先逐步增加实时消耗码率。若实时消耗码率在超过目标D帧间隔后大于实时目标码率,则说明码率调控已经可以适应当前网络条件,此时,将当前视频帧的原始分辨率确定为目标分辨率。若实时消耗码率在超过目标D帧间隔后小于实时目标码率,则说明码率调控仍然无法与当前网络条件相适应,则继续采用分辨率调控,即增加当前视频帧的原始分辨率得到目标分辨率。 Step 407, execute the control scheme in the scenario where the video content is simple and the code rate increases suddenly. At this point, gradually increase the real-time consumption bit rate within the target D frame interval. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, and then continue to use resolution control, that is, increase the original resolution of the current video frame to obtain the target resolution.
步骤408,执行视频内容简单且码率骤降场景下的调控方案。此时,在目标D帧间隔内先逐步降低实时消耗码率。若实时消耗码率在超过目标D帧间隔后小于实时目标码率,则说明码率调控已经可以适应当前网络条件,此时,将当前视频帧的原始分辨率确定为目标分辨率。若实时消耗码率在超过目标D帧间隔后大于实时目标码率,则说明码率调控仍然无法与当前网络条件相适应,则继续采用分辨率调控,即降低当前视频帧的原始分辨率得到目标分辨率。 Step 408, execute the control scheme in the scenario where the video content is simple and the code rate drops suddenly. At this time, gradually reduce the real-time consumption bit rate within the target D frame interval. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, then continue to use resolution control, that is, reduce the original resolution of the current video frame to obtain the target resolution.
步骤409,执行视频内容复杂且码率骤增场景下的调控方案。此时,在目标D帧间隔内先逐步增加实时消耗码率。若实时消耗码率在超过目标D帧间隔后大于实时目标码率,则说明码率调控已经可以适应当前网络条件,此时,将当前视频帧的原始分辨率确定为目标分辨率。若实时消耗码率在超过目标D帧间隔后小于实时目标码率,则说明码率调控仍然无法与 当前网络条件相适应,则继续采用分辨率调控,即增加当前视频帧的原始分辨率得到目标分辨率。 Step 409, execute the control scheme in the scene where the video content is complex and the code rate increases suddenly. At this point, gradually increase the real-time consumption bit rate within the target D frame interval. If the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate regulation can adapt to the current network conditions. At this time, the original resolution of the current video frame is determined as the target resolution. If the real-time consumption bit rate is lower than the real-time target bit rate after exceeding the target D frame interval, it means that the bit rate control still cannot adapt to the current network conditions, and then continue to use resolution control, that is, increase the original resolution of the current video frame to obtain the target resolution.
步骤410,执行视频内容复杂且码率骤降场景下的调控方案。此时,直接对分辨率进行调控,即降低当前视频帧的原始分辨率得到目标分辨率。 Step 410, execute the control scheme in the scenario where the video content is complex and the code rate drops suddenly. At this point, the resolution is directly regulated, that is, the original resolution of the current video frame is reduced to obtain the target resolution.
步骤411,采用码表方案进行分辨率调控。在发生场景变化的情况下,上述步骤405至步骤410中的调控方案将不再适用,此时,采用码表方案,选择实时目标码率对应的分辨率,作为目标分辨率。同时,本步骤将上述步骤402中维护的码率缓存buffer_R和上述步骤403中维护的量化参数值缓存buffer_QP均清零。 Step 411, adopting the code table scheme to regulate the resolution. In the case of a scene change, the control schemes in steps 405 to 410 above are no longer applicable. At this time, the code table scheme is adopted to select the resolution corresponding to the real-time target bit rate as the target resolution. At the same time, this step clears the code rate buffer buffer_R maintained in the above step 402 and the quantization parameter value buffer buffer_QP maintained in the above step 403 to zero.
步骤412,采用目标分辨率对当前视频帧进行编码。视频编码端基于目标分辨率对当前视频帧进行缩放处理,待当前视频帧的分辨率与目标分辨率匹配后,将当前视频帧输入编码器进行视频编码。同时,视频编码端更新上述步骤404中维护的帧级缓存buffer_pre。 Step 412, encode the current video frame with the target resolution. The video encoding end scales the current video frame based on the target resolution, and after the resolution of the current video frame matches the target resolution, the current video frame is input to the encoder for video encoding. At the same time, the video encoding end updates the frame-level buffer buffer_pre maintained in step 404 above.
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
请参考图5,其示出了本申请一个实施例提供的视频编码装置的框图。该装置具有实现上述视频编码方法示例的功能,所述功能可以由硬件实现,也可以由硬件执行相应的软件实现。该装置可以是上述视频编码端,也可以设置在上述视频编码端中。该装置500可以包括:码率信息获取模块510、参数信息获取模块520、分辨率确定模块530和视频编码模块540。Please refer to FIG. 5 , which shows a block diagram of a video coding apparatus provided by an embodiment of the present application. The device has the function of realizing the above example of the video coding method, and the function may be realized by hardware, or may be realized by executing corresponding software by the hardware. The device may be the above-mentioned video coding end, or may be set in the above-mentioned video coding end. The apparatus 500 may include: a code rate information acquisition module 510 , a parameter information acquisition module 520 , a resolution determination module 530 and a video encoding module 540 .
码率信息获取模块510,用于获取当前网络条件对应的码率变化信息,所述码率变化信息用于指示所述当前网络条件相对于历史网络条件的波动。The code rate information obtaining module 510 is configured to obtain code rate change information corresponding to the current network condition, and the code rate change information is used to indicate the fluctuation of the current network condition relative to the historical network condition.
参数信息获取模块520,用于获取当前视频内容对应的参数变化信息,所述参数变化信息用于指示所述当前视频内容的内容复杂程度。The parameter information obtaining module 520 is configured to obtain parameter change information corresponding to the current video content, and the parameter change information is used to indicate the content complexity of the current video content.
分辨率确定模块530,用于基于所述码率变化信息和所述参数变化信息,确定目标分辨率。A resolution determining module 530, configured to determine a target resolution based on the code rate change information and the parameter change information.
视频编码模块540,用于采用所述目标分辨率对所述当前视频帧进行编码。A video encoding module 540, configured to encode the current video frame by using the target resolution.
在一个示例中,所述码率信息获取模块510,用于:确定实时目标码率,所述实时目标码率用于指示所述当前网络条件;获取历史平均码率,所述历史平均码率用于指示所述历史网络条件;基于所述实时目标码率和所述历史平均码率,确定所述码率变化信息。In an example, the code rate information acquisition module 510 is configured to: determine a real-time target code rate, the real-time target code rate is used to indicate the current network condition; acquire a historical average code rate, the historical average code rate It is used to indicate the historical network condition; and determine the code rate change information based on the real-time target code rate and the historical average code rate.
在一个示例中,所述基于所述实时目标码率和所述历史平均码率,确定所述码率变化信息,包括:确定所述实时目标码率和所述历史平均码率之间的码率差值;在所述码率差值的绝对值大于第一阈值,且所述码率差值为正数的情况下,确定所述码率变化信息包括码率发生剧烈变化,且码率骤增;在所述码率差值的绝对值大于第一阈值,且所述码率差值为负数的情况下,确定所述码率变化信息包括码率发生剧烈变化,且码率骤降;在所述码率差值的绝对值小于第一阈值的情况下,确定所述码率变化信息包括码率未发生剧烈变化。In an example, the determining the code rate change information based on the real-time target code rate and the historical average code rate includes: determining the code rate between the real-time target code rate and the historical average code rate Rate difference; when the absolute value of the code rate difference is greater than the first threshold and the code rate difference is a positive number, it is determined that the code rate change information includes a drastic change in the code rate, and the code rate Sudden increase; when the absolute value of the code rate difference is greater than the first threshold and the code rate difference is negative, determining that the code rate change information includes a sharp change in the code rate, and a sudden drop in the code rate ; In a case where the absolute value of the code rate difference is smaller than a first threshold, determining that the code rate change information includes that the code rate has not changed drastically.
在一个示例中,所述参数信息获取模块520,用于:获取第一量化参数值,所述第一量化参数值是指所述当前视频帧的前一视频帧的量化参数值;获取第二量化参数值,所述第二量化参数值是指至少一个历史视频帧的量化参数值的均值;基于所述第一量化参数值和所述第二量化参数值,确定所述参数变化信息。In an example, the parameter information acquiring module 520 is configured to: acquire a first quantization parameter value, where the first quantization parameter value refers to the quantization parameter value of the previous video frame of the current video frame; acquire the second A quantization parameter value, the second quantization parameter value refers to the mean value of the quantization parameter value of at least one historical video frame; based on the first quantization parameter value and the second quantization parameter value, the parameter change information is determined.
在一个示例中,所述基于所述第一量化参数值和所述第二量化参数值,确定所述参数变化信息,包括:确定所述第一量化参数值和所述第二量化参数值之间的参数差值;在所述参数差值的绝对值大于第二阈值的情况下,确定所述参数变化信息指示视频内容复杂;在所述参数差值的绝对值小于第二阈值的情况下,确定所述参数变化信息指示视频内容简单。In an example, the determining the parameter change information based on the first quantization parameter value and the second quantization parameter value includes: determining the difference between the first quantization parameter value and the second quantization parameter value The parameter difference between; in the case where the absolute value of the parameter difference is greater than the second threshold, it is determined that the parameter change information indicates that the video content is complex; in the case where the absolute value of the parameter difference is smaller than the second threshold , it is determined that the parameter change information indicates that the video content is simple.
在一个示例中,所述分辨率确定模块530,用于:在所述码率变化信息包括码率骤增,且所述参数变化信息指示视频内容简单的情况下,在目标D帧间隔内逐步增加实时消耗码率; 若所述实时消耗码率在超过所述目标D帧间隔后大于实时目标码率,则将所述当前视频帧的原始分辨率确定为所述目标分辨率;若所述实时消耗码率在超过所述目标D帧间隔后小于实时目标码率,则增加所述当前视频帧的原始分辨率得到所述目标分辨率;在所述码率变化信息包括码率骤降,且所述参数变化信息指示视频内容简单的情况下,在目标D帧间隔内逐步降低实时消耗码率;若所述实时消耗码率在超过所述目标D帧间隔后小于实时目标码率,则将所述当前视频帧的原始分辨率确定为所述目标分辨率;若所述实时消耗码率在超过所述目标D帧间隔后大于实时目标码率,则降低所述当前视频帧的原始分辨率得到所述目标分辨率;在所述码率变化信息包括码率骤增,且所述参数变化信息指示视频内容复杂的情况下,在目标D帧间隔内逐步增加实时消耗码率;若所述实时消耗码率在超过所述目标D帧间隔后大于实时目标码率,则将所述当前视频帧的原始分辨率确定为所述目标分辨率;若所述实时消耗码率在超过所述目标D帧间隔后小于实时目标码率,则增加所述当前视频帧的原始分辨率得到所述目标分辨率;在所述码率变化信息包括码率骤降,且所述参数变化信息指示视频内容复杂的情况下,降低所述当前视频帧的原始分辨率得到所述目标分辨率。In an example, the resolution determination module 530 is configured to: step by step within the target D frame interval when the code rate change information includes a sudden increase in code rate, and the parameter change information indicates that the video content is simple Increase the real-time consumption code rate; If the real-time consumption code rate is greater than the real-time target code rate after exceeding the target D frame interval, then determine the original resolution of the current video frame as the target resolution; if the The real-time consumption code rate is less than the real-time target code rate after exceeding the target D frame interval, then increasing the original resolution of the current video frame to obtain the target resolution; when the code rate change information includes a code rate drop, And when the parameter change information indicates that the video content is simple, gradually reduce the real-time consumption code rate within the target D frame interval; if the real-time consumption code rate is less than the real-time target code rate after exceeding the target D frame interval, then The original resolution of the current video frame is determined as the target resolution; if the real-time consumption bit rate is greater than the real-time target bit rate after exceeding the target D frame interval, then reduce the original resolution of the current video frame rate to obtain the target resolution; when the code rate change information includes a sudden increase in the code rate, and the parameter change information indicates that the video content is complex, gradually increase the real-time consumption code rate within the target D frame interval; if the The real-time consumption code rate is greater than the real-time target code rate after exceeding the target D frame interval, then the original resolution of the current video frame is determined as the target resolution; if the real-time consumption code rate exceeds the described After the target D frame interval is less than the real-time target bit rate, then increase the original resolution of the current video frame to obtain the target resolution; the bit rate change information includes a bit rate drop, and the parameter change information indicates video In the case of complex content, reduce the original resolution of the current video frame to obtain the target resolution.
在一个示例中,所述分辨率确定模块530,还用于:在所述码率变化信息包括码率未发生剧烈变化的情况下,将所述当前视频帧的原始分辨率确定为所述目标分辨率。In an example, the resolution determination module 530 is further configured to: determine the original resolution of the current video frame as the target when the code rate change information includes that the code rate has not changed drastically resolution.
在一个示例中,所述视频编码模块540,用于:在所述目标分辨率大于所述当前视频帧的原始分辨率的情况下,对所述当前视频帧进行上采样处理;在经过所述上采样处理后的所述当前视频帧的分辨率与所述目标分辨率匹配的情况下,采用所述目标分辨率对经过所述上采样处理后的所述当前视频帧进行编码;在所述目标分辨率小于所述当前视频帧的原始分辨率的情况下,对所述当前视频帧进行下采样处理;在经过所述下采样处理后的所述当前视频帧的分辨率与所述目标分辨率匹配的情况下,采用所述目标分辨率对经过所述下采样处理后的所述当前视频帧进行编码。In an example, the video encoding module 540 is configured to: perform upsampling processing on the current video frame when the target resolution is greater than the original resolution of the current video frame; When the resolution of the current video frame after the upsampling process matches the target resolution, use the target resolution to encode the current video frame after the upsampling process; When the target resolution is smaller than the original resolution of the current video frame, downsampling is performed on the current video frame; the resolution of the current video frame after the downsampling process is different from the target resolution In the case of rate matching, the target resolution is used to encode the current video frame after the downsampling process.
在一个示例中,如图6所示,所述装置500还包括:场景变化检测模块550,用于检测所述当前视频内容相对于历史视频内容的场景变化;所述分辨率确定模块530,用于在所述当前视频内容相对于所述历史视频内容未发生场景变化的情况下,基于所述码率变化信息和所述参数变化信息,确定所述目标分辨率。In an example, as shown in FIG. 6 , the apparatus 500 further includes: a scene change detection module 550, configured to detect a scene change of the current video content relative to historical video content; the resolution determination module 530, used The target resolution is determined based on the code rate change information and the parameter change information when the current video content has no scene change relative to the historical video content.
在一个示例中,如图6所示,所述场景变化检测模块550,用于:从所述当前视频帧中确定至少一个关键块;针对所述至少一个关键块中的第一关键块,在所述当前视频帧的前一视频帧中与所述第一关键块对应的位置,以目标半径为搜索半径进行匹配块搜索;若搜索到的方块中存在与所述第一关键块之间的均方误差小于目标阈值的方块,则确定所述第一关键块在所述当前视频帧的前一视频帧中存在匹配块;其中,在所述至少一个关键块在所述当前视频帧的前一视频帧中均存在匹配块的情况下,确定所述当前视频内容相对于所述历史视频内容发生场景变化。In one example, as shown in FIG. 6, the scene change detection module 550 is configured to: determine at least one key block from the current video frame; for the first key block in the at least one key block, The position corresponding to the first key block in the previous video frame of the current video frame is searched for matching blocks with the target radius as the search radius; if there is a distance between the searched block and the first key block If the mean square error is less than the target threshold, it is determined that the first key block has a matching block in the previous video frame of the current video frame; wherein, the at least one key block is in the previous video frame of the current video frame If there are matching blocks in a video frame, it is determined that a scene change occurs in the current video content relative to the historical video content.
在一个示例中,所述分辨率确定模块530,还用于:在所述当前视频内容相对于所述历史视频内容发生场景变化的情况下,将目标对应关系中与实时目标码率对应的分辨率,确定为所述目标分辨率;其中,所述目标对应关系包括至少一组目标码率与分辨率之间的对应关系。In an example, the resolution determination module 530 is further configured to: in the case that the scene of the current video content changes relative to the historical video content, the resolution corresponding to the real-time target bit rate in the target correspondence rate, determined as the target resolution; wherein, the target correspondence includes at least one set of correspondences between target code rates and resolutions.
综上所述,本申请实施例提供的技术方案,通过在视频编码过程中,结合网络质量的波动和视频内容的复杂程度,确定对当前视频帧编码时采用的分辨率,实现了更加准确地进行分辨率的调控。由于人眼会对简单场景下的画面质量变化更加敏感,本申请在调控分辨率时结合了视频内容的复杂程度,考虑了人眼针对视频内容的不同内容复杂程度的敏感情况,从而使得分辨率的调控更加准确和全面。并且,本申请在调控分辨率时同时考虑了网络质量的波动和视频内容的复杂程度,在网络质量波动过于频繁时,有效避免了分辨率的频繁切换,有助于降低由于网络质量频繁波动所产生的呼吸效应,提升用户的视频观看和通话体验。To sum up, in the technical solution provided by the embodiment of the present application, by combining the fluctuation of the network quality and the complexity of the video content in the process of video encoding, the resolution adopted for encoding the current video frame is determined, so as to realize more accurate Adjust the resolution. Since human eyes are more sensitive to changes in picture quality in simple scenes, this application combines the complexity of video content when adjusting the resolution, and considers the sensitivity of human eyes to different content complexity of video content, so that the resolution The regulation is more accurate and comprehensive. Moreover, this application considers the fluctuation of network quality and the complexity of video content when adjusting the resolution. When the network quality fluctuates too frequently, it effectively avoids frequent switching of resolutions, which helps to reduce the video frequency caused by frequent fluctuations in network quality. The resulting breathing effect improves the user's video viewing and calling experience.
需要说明的是,上述实施例提供的装置在实现其功能时,仅以上述各功能模块的划分进 行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that when the device provided by the above-mentioned embodiments implements its functions, it only uses the division of the above-mentioned functional modules as an example. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs. The internal structure of the system is divided into different functional modules to complete all or part of the functions described above. In addition, the device and the method embodiment provided by the above embodiment belong to the same idea, and the specific implementation process thereof is detailed in the method embodiment, and will not be repeated here.
在示例性实施例中,还提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有计算机程序,所述计算机程序由所述处理器加载并执行以实现如上述视频编码方法。In an exemplary embodiment, there is also provided a computer device, the computer device includes a processor and a memory, and a computer program is stored in the memory, and the computer program is loaded and executed by the processor to realize the above-mentioned Video encoding method.
在示例性实施例中,还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述视频编码方法。In an exemplary embodiment, there is also provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned video encoding method is implemented.
在示例性实施例中,还提供一种计算机程序产品,当所述计算机程序产品在计算机设备上运行时,使得计算机设备执行如上述视频编码方法。In an exemplary embodiment, a computer program product is also provided, which, when the computer program product is run on a computer device, causes the computer device to execute the above video encoding method.
以上所述仅为本申请的示例性实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only exemplary embodiments of the application, and are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application shall be included in the protection of the application. within range.

Claims (15)

  1. 一种视频编码方法,其特征在于,所述方法包括:A video encoding method, characterized in that the method comprises:
    获取当前网络条件对应的码率变化信息,所述码率变化信息用于指示所述当前网络条件相对于历史网络条件的波动;Obtain code rate change information corresponding to current network conditions, where the code rate change information is used to indicate fluctuations of the current network conditions relative to historical network conditions;
    获取当前视频内容对应的参数变化信息,所述参数变化信息用于指示所述当前视频内容的内容复杂程度;Acquire parameter change information corresponding to the current video content, where the parameter change information is used to indicate the content complexity of the current video content;
    基于所述码率变化信息和所述参数变化信息,确定目标分辨率;Determine a target resolution based on the code rate change information and the parameter change information;
    采用所述目标分辨率对所述当前视频帧进行编码。Encoding the current video frame by using the target resolution.
  2. 根据权利要求1所述的方法,其特征在于,所述获取当前网络条件对应的码率变化信息,包括:The method according to claim 1, wherein said obtaining code rate change information corresponding to current network conditions comprises:
    确定实时目标码率,所述实时目标码率用于指示所述当前网络条件;determining a real-time target code rate, where the real-time target code rate is used to indicate the current network condition;
    获取历史平均码率,所述历史平均码率用于指示所述历史网络条件;Obtaining a historical average code rate, where the historical average code rate is used to indicate the historical network condition;
    基于所述实时目标码率和所述历史平均码率,确定所述码率变化信息。Determine the code rate change information based on the real-time target code rate and the historical average code rate.
  3. 根据权利要求2所述的方法,其特征在于,所述基于所述实时目标码率和所述历史平均码率,确定所述码率变化信息,包括:The method according to claim 2, wherein the determining the code rate change information based on the real-time target code rate and the historical average code rate includes:
    确定所述实时目标码率和所述历史平均码率之间的码率差值;determining the code rate difference between the real-time target code rate and the historical average code rate;
    在所述码率差值的绝对值大于第一阈值,且所述码率差值为正数的情况下,确定所述码率变化信息包括码率发生剧烈变化,且码率骤增;When the absolute value of the code rate difference is greater than a first threshold and the code rate difference is a positive number, determining that the code rate change information includes a drastic change in the code rate and a sudden increase in the code rate;
    在所述码率差值的绝对值大于第一阈值,且所述码率差值为负数的情况下,确定所述码率变化信息包括码率发生剧烈变化,且码率骤降;When the absolute value of the code rate difference is greater than a first threshold and the code rate difference is a negative number, determining that the code rate change information includes a drastic change in the code rate and a sudden drop in the code rate;
    在所述码率差值的绝对值小于第一阈值的情况下,确定所述码率变化信息包括码率未发生剧烈变化。In a case where the absolute value of the code rate difference is smaller than the first threshold, it is determined that the code rate change information includes that the code rate does not change drastically.
  4. 根据权利要求1所述的方法,其特征在于,所述获取当前视频内容对应的参数变化信息,包括:The method according to claim 1, wherein said obtaining parameter change information corresponding to the current video content comprises:
    获取第一量化参数值,所述第一量化参数值是指所述当前视频帧的前一视频帧的量化参数值;Obtaining a first quantization parameter value, where the first quantization parameter value refers to the quantization parameter value of the previous video frame of the current video frame;
    获取第二量化参数值,所述第二量化参数值是指至少一个历史视频帧的量化参数值的均值;Obtaining a second quantization parameter value, where the second quantization parameter value refers to the mean value of the quantization parameter values of at least one historical video frame;
    基于所述第一量化参数值和所述第二量化参数值,确定所述参数变化信息。The parameter change information is determined based on the first quantization parameter value and the second quantization parameter value.
  5. 根据权利要求4所述的方法,其特征在于,所述基于所述第一量化参数值和所述第二量化参数值,确定所述参数变化信息,包括:The method according to claim 4, wherein the determining the parameter change information based on the first quantization parameter value and the second quantization parameter value comprises:
    确定所述第一量化参数值和所述第二量化参数值之间的参数差值;determining a parameter difference between the first quantization parameter value and the second quantization parameter value;
    在所述参数差值的绝对值大于第二阈值的情况下,确定所述参数变化信息指示视频内容复杂;When the absolute value of the parameter difference is greater than a second threshold, it is determined that the parameter change information indicates that the video content is complex;
    在所述参数差值的绝对值小于第二阈值的情况下,确定所述参数变化信息指示视频内容简单。In a case where the absolute value of the parameter difference is smaller than the second threshold, it is determined that the parameter change information indicates that the video content is simple.
  6. 根据权利要求1所述的方法,其特征在于,所述基于所述码率变化信息和所述参数变化信息,确定目标分辨率,包括:The method according to claim 1, wherein the determining the target resolution based on the code rate change information and the parameter change information includes:
    在所述码率变化信息包括码率骤增,且所述参数变化信息指示视频内容简单的情况下,在目标D帧间隔内逐步增加实时消耗码率;若所述实时消耗码率在超过所述目标D帧间隔后大于实时目标码率,则将所述当前视频帧的原始分辨率确定为所述目标分辨率;若所述实时 消耗码率在超过所述目标D帧间隔后小于实时目标码率,则增加所述当前视频帧的原始分辨率得到所述目标分辨率;When the code rate change information includes a sudden increase in the code rate, and the parameter change information indicates that the video content is simple, gradually increase the real-time consumption code rate within the target D frame interval; if the real-time consumption code rate exceeds the specified After the target D frame interval is greater than the real-time target code rate, then the original resolution of the current video frame is determined as the target resolution; if the real-time consumption code rate is less than the real-time target after exceeding the target D frame interval code rate, then increase the original resolution of the current video frame to obtain the target resolution;
    在所述码率变化信息包括码率骤降,且所述参数变化信息指示视频内容简单的情况下,在目标D帧间隔内逐步降低实时消耗码率;若所述实时消耗码率在超过所述目标D帧间隔后小于实时目标码率,则将所述当前视频帧的原始分辨率确定为所述目标分辨率;若所述实时消耗码率在超过所述目标D帧间隔后大于实时目标码率,则降低所述当前视频帧的原始分辨率得到所述目标分辨率;When the code rate change information includes a sudden drop in the code rate, and the parameter change information indicates that the video content is simple, gradually reduce the real-time consumption code rate within the target D frame interval; if the real-time consumption code rate exceeds the specified After the target D frame interval is less than the real-time target code rate, then the original resolution of the current video frame is determined as the target resolution; if the real-time consumption code rate is greater than the real-time target after exceeding the target D frame interval bit rate, then reduce the original resolution of the current video frame to obtain the target resolution;
    在所述码率变化信息包括码率骤增,且所述参数变化信息指示视频内容复杂的情况下,在目标D帧间隔内逐步增加实时消耗码率;若所述实时消耗码率在超过所述目标D帧间隔后大于实时目标码率,则将所述当前视频帧的原始分辨率确定为所述目标分辨率;若所述实时消耗码率在超过所述目标D帧间隔后小于实时目标码率,则增加所述当前视频帧的原始分辨率得到所述目标分辨率;When the code rate change information includes a sudden increase in the code rate, and the parameter change information indicates that the video content is complex, gradually increase the real-time consumption code rate within the target D frame interval; if the real-time consumption code rate exceeds the specified After the target D frame interval is greater than the real-time target code rate, then the original resolution of the current video frame is determined as the target resolution; if the real-time consumption code rate is less than the real-time target after exceeding the target D frame interval code rate, then increase the original resolution of the current video frame to obtain the target resolution;
    在所述码率变化信息包括码率骤降,且所述参数变化信息指示视频内容复杂的情况下,降低所述当前视频帧的原始分辨率得到所述目标分辨率。If the code rate change information includes a sudden drop in code rate, and the parameter change information indicates complex video content, reduce the original resolution of the current video frame to obtain the target resolution.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method according to claim 6, further comprising:
    在所述码率变化信息包括码率未发生剧烈变化的情况下,将所述当前视频帧的原始分辨率确定为所述目标分辨率。If the code rate change information includes that the code rate has not changed drastically, the original resolution of the current video frame is determined as the target resolution.
  8. 根据权利要求1所述的方法,其特征在于,所述采用所述目标分辨率对所述当前视频帧进行编码,包括:The method according to claim 1, wherein said encoding said current video frame using said target resolution comprises:
    在所述目标分辨率大于所述当前视频帧的原始分辨率的情况下,对所述当前视频帧进行上采样处理;在经过所述上采样处理后的所述当前视频帧的分辨率与所述目标分辨率匹配的情况下,采用所述目标分辨率对经过所述上采样处理后的所述当前视频帧进行编码;When the target resolution is greater than the original resolution of the current video frame, upsampling is performed on the current video frame; the resolution of the current video frame after the upsampling process is the same as the In the case where the target resolution matches, the target resolution is used to encode the current video frame after the upsampling process;
    在所述目标分辨率小于所述当前视频帧的原始分辨率的情况下,对所述当前视频帧进行下采样处理;在经过所述下采样处理后的所述当前视频帧的分辨率与所述目标分辨率匹配的情况下,采用所述目标分辨率对经过所述下采样处理后的所述当前视频帧进行编码。When the target resolution is smaller than the original resolution of the current video frame, downsampling is performed on the current video frame; the resolution of the current video frame after the downsampling process is the same as the If the target resolution matches the target resolution, the current video frame after the downsampling process is encoded by using the target resolution.
  9. 根据权利要求1至8任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 8, further comprising:
    检测所述当前视频内容相对于历史视频内容的场景变化;Detecting scene changes of the current video content relative to historical video content;
    在所述当前视频内容相对于所述历史视频内容未发生场景变化的情况下,基于所述码率变化信息和所述参数变化信息,确定所述目标分辨率。In a case where the current video content has no scene change relative to the historical video content, the target resolution is determined based on the code rate change information and the parameter change information.
  10. 根据权利要求9所述的方法,其特征在于,所述检测所述当前视频内容相对于历史视频内容的场景变化,包括:The method according to claim 9, wherein the detecting the scene change of the current video content relative to the historical video content comprises:
    从所述当前视频帧中确定至少一个关键块;determining at least one key block from the current video frame;
    针对所述至少一个关键块中的第一关键块,在所述当前视频帧的前一视频帧中与所述第一关键块对应的位置,以目标半径为搜索半径进行匹配块搜索;For the first key block in the at least one key block, at the position corresponding to the first key block in the previous video frame of the current video frame, perform a matching block search with the target radius as the search radius;
    若搜索到的方块中存在与所述第一关键块之间的均方误差小于目标阈值的方块,则确定所述第一关键块在所述当前视频帧的前一视频帧中存在匹配块;If there is a block whose mean square error with the first key block is smaller than the target threshold in the searched block, then it is determined that the first key block has a matching block in the previous video frame of the current video frame;
    其中,在所述至少一个关键块在所述当前视频帧的前一视频帧中均存在匹配块的情况下,确定所述当前视频内容相对于所述历史视频内容发生场景变化。Wherein, in a case where the at least one key block has a matching block in the previous video frame of the current video frame, it is determined that a scene change occurs in the current video content relative to the historical video content.
  11. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method according to claim 9, characterized in that the method further comprises:
    在所述当前视频内容相对于所述历史视频内容发生场景变化的情况下,将目标对应关系中与实时目标码率对应的分辨率,确定为所述目标分辨率;In the case where the current video content has a scene change relative to the historical video content, the resolution corresponding to the real-time target bit rate in the target correspondence is determined as the target resolution;
    其中,所述目标对应关系包括至少一组目标码率与分辨率之间的对应关系。Wherein, the target correspondence includes at least one set of correspondences between target code rates and resolutions.
  12. 一种视频编码装置,其特征在于,所述装置包括:A video encoding device, characterized in that the device comprises:
    码率信息获取模块,用于获取当前网络条件对应的码率变化信息,所述码率变化信息用于指示所述当前网络条件相对于历史网络条件的波动;A code rate information acquisition module, configured to obtain code rate change information corresponding to current network conditions, where the code rate change information is used to indicate fluctuations of the current network conditions relative to historical network conditions;
    参数信息获取模块,用于获取当前视频内容对应的参数变化信息,所述参数变化信息用于指示所述当前视频内容的内容复杂程度;A parameter information acquisition module, configured to acquire parameter change information corresponding to the current video content, where the parameter change information is used to indicate the content complexity of the current video content;
    分辨率确定模块,用于基于所述码率变化信息和所述参数变化信息,确定目标分辨率;A resolution determination module, configured to determine a target resolution based on the code rate change information and the parameter change information;
    视频编码模块,用于采用所述目标分辨率对所述当前视频帧进行编码。A video coding module, configured to use the target resolution to code the current video frame.
  13. 一种计算机设备,其特征在于,所述计算机设备包括处理器和存储器,所述存储器中存储有计算机程序,所述计算机程序由所述处理器加载并执行以实现如权利要求1至11任一项所述的视频编码方法。A computer device, characterized in that the computer device includes a processor and a memory, and a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement any one of claims 1 to 11. The video coding method described in the item.
  14. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至11任一项所述的视频编码方法。A computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the video coding method according to any one of claims 1 to 11 is implemented.
  15. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机设备上运行时,使得所述计算机设备执行如上述权利要求1至11任一项所述的视频编码方法。A computer program product, characterized in that, when the computer program product is run on a computer device, the computer device is made to execute the video coding method according to any one of claims 1 to 11.
PCT/CN2022/100805 2021-07-09 2022-06-23 Video encoding method and apparatus, device, and storage medium WO2023279978A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110779065.0 2021-07-09
CN202110779065.0A CN113573101B (en) 2021-07-09 2021-07-09 Video coding method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2023279978A1 true WO2023279978A1 (en) 2023-01-12

Family

ID=78164256

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/100805 WO2023279978A1 (en) 2021-07-09 2022-06-23 Video encoding method and apparatus, device, and storage medium

Country Status (2)

Country Link
CN (1) CN113573101B (en)
WO (1) WO2023279978A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116886880A (en) * 2023-09-08 2023-10-13 中移(杭州)信息技术有限公司 Method, device, equipment and computer program product for adjusting surveillance video
CN117440209A (en) * 2023-12-15 2024-01-23 牡丹江师范学院 Implementation method and system based on singing scene

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113573101B (en) * 2021-07-09 2023-11-28 百果园技术(新加坡)有限公司 Video coding method, device, equipment and storage medium
CN115225928B (en) * 2022-05-11 2023-07-25 北京广播电视台 Multi-type audio and video mixed broadcasting system and method
CN115396729B (en) * 2022-08-26 2023-12-08 百果园技术(新加坡)有限公司 Video target frame determining method, device, equipment and storage medium
CN117014608A (en) * 2022-09-07 2023-11-07 腾讯科技(深圳)有限公司 Video stream code rate adjusting method, device, computer equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1285691A (en) * 1999-08-20 2001-02-28 三星电子株式会社 Apparatus of self-adaptive controlling data transmission rate according to network bandwidth
CN101345867A (en) * 2008-08-22 2009-01-14 四川长虹电器股份有限公司 Code rate control method based on frame complexity
CN103974060A (en) * 2013-01-31 2014-08-06 华为技术有限公司 Method and device for adjusting video quality
CN105959700A (en) * 2016-05-31 2016-09-21 腾讯科技(深圳)有限公司 Video image coding method and device
CN109561310A (en) * 2017-09-26 2019-04-02 腾讯科技(深圳)有限公司 Video coding processing method, device, equipment and storage medium
CN110650370A (en) * 2019-10-18 2020-01-03 北京达佳互联信息技术有限公司 Video coding parameter determination method and device, electronic equipment and storage medium
US20210127180A1 (en) * 2017-05-25 2021-04-29 Samsung Electronics Co., Ltd. Methods and systems for saving data while streaming video
CN113573101A (en) * 2021-07-09 2021-10-29 百果园技术(新加坡)有限公司 Video encoding method, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105635734B (en) * 2014-11-03 2019-04-12 掌赢信息科技(上海)有限公司 Adaptive video coding method and device based on video calling scene
US20180063549A1 (en) * 2016-08-24 2018-03-01 Ati Technologies Ulc System and method for dynamically changing resolution based on content
CN107659827A (en) * 2017-09-25 2018-02-02 北京小鱼易连科技有限公司 Desktop video code control system based on content analysis

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1285691A (en) * 1999-08-20 2001-02-28 三星电子株式会社 Apparatus of self-adaptive controlling data transmission rate according to network bandwidth
CN101345867A (en) * 2008-08-22 2009-01-14 四川长虹电器股份有限公司 Code rate control method based on frame complexity
CN103974060A (en) * 2013-01-31 2014-08-06 华为技术有限公司 Method and device for adjusting video quality
CN105959700A (en) * 2016-05-31 2016-09-21 腾讯科技(深圳)有限公司 Video image coding method and device
US20210127180A1 (en) * 2017-05-25 2021-04-29 Samsung Electronics Co., Ltd. Methods and systems for saving data while streaming video
CN109561310A (en) * 2017-09-26 2019-04-02 腾讯科技(深圳)有限公司 Video coding processing method, device, equipment and storage medium
CN110650370A (en) * 2019-10-18 2020-01-03 北京达佳互联信息技术有限公司 Video coding parameter determination method and device, electronic equipment and storage medium
CN113573101A (en) * 2021-07-09 2021-10-29 百果园技术(新加坡)有限公司 Video encoding method, device, equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116886880A (en) * 2023-09-08 2023-10-13 中移(杭州)信息技术有限公司 Method, device, equipment and computer program product for adjusting surveillance video
CN116886880B (en) * 2023-09-08 2023-12-26 中移(杭州)信息技术有限公司 Method, device, equipment and computer program product for adjusting surveillance video
CN117440209A (en) * 2023-12-15 2024-01-23 牡丹江师范学院 Implementation method and system based on singing scene
CN117440209B (en) * 2023-12-15 2024-03-01 牡丹江师范学院 Implementation method and system based on singing scene

Also Published As

Publication number Publication date
CN113573101A (en) 2021-10-29
CN113573101B (en) 2023-11-28

Similar Documents

Publication Publication Date Title
WO2023279978A1 (en) Video encoding method and apparatus, device, and storage medium
CN107211193B (en) Intelligent adaptive video streaming method and system driven by perception experience quality estimation
US5903673A (en) Digital video signal encoder and encoding method
US6118817A (en) Digital video signal encoder and encoding method having adjustable quantization
US8681866B1 (en) Method and apparatus for encoding video by downsampling frame resolution
US9210436B2 (en) Distributed video coding/decoding method, distributed video coding/decoding apparatus, and transcoding apparatus
US11363298B2 (en) Video processing apparatus and processing method of video stream
US9826260B2 (en) Video encoding device and video encoding method
US10171829B2 (en) Picture encoding device and picture encoding method
US9049420B1 (en) Relative quality score for video transcoding
EP2727344B1 (en) Frame encoding selection based on frame similarities and visual quality and interests
US8253776B2 (en) Image rectification method and related device for a video device
US10609440B1 (en) Timing data anomaly detection and correction
US9369706B1 (en) Method and apparatus for encoding video using granular downsampling of frame resolution
US20210409724A1 (en) Method and device for bitrate adjustment in encoding process
WO2020244328A1 (en) Image processing method and apparatus
US11184415B2 (en) Media feed prioritization for multi-party conferencing
WO2015085873A1 (en) Video code stream obtaining method and apparatus
Menon et al. Content-adaptive variable framerate encoding scheme for green live streaming
CN111654660B (en) Video conference system coding transmission method based on image segmentation
Nguyen et al. A QoS-adaptive framework for screen sharing over Internet
US20220303555A1 (en) Combining high-quality foreground with enhanced low-quality background
US20230136314A1 (en) Deep learning based white balance correction of video frames
CN113160342B (en) Encoding method and device based on feedback, storage medium and electronic equipment
WO2023051705A1 (en) Video communication method and apparatus, electronic device, and computer readable medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22836732

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE