Video encoding method, device, and computing device based on roi region detection
By adaptively adjusting the ROI region information and quantization parameter offset of video frames, the problem of poor ROI region encoding effect in existing technologies is solved, achieving efficient encoding under different bitrate conditions, ensuring the image quality of the ROI region and saving resources.
Patent Information
- Application Number
- CN202211199428.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-09-29
AI Technical Summary
Existing ROI-based video coding methods lack content adaptability, resulting in wasted bitrate at high bitrates and inability to guarantee the image quality of ROI areas at low bitrates, leading to poor coding effect and performance.
By acquiring the ROI region information of video frames, the baseline quantization parameters of the coding blocks are adjusted. Based on the ROI region proportion and intensity parameters, the quantization parameter offset is adaptively adjusted to achieve bitrate allocation for ROI regions and bitrate control for non-ROI regions, ensuring the image quality of ROI regions and reducing resource waste.
At high bitrates, the quality of the ROI region is protected while the bitrate of non-ROI regions is reduced. At low bitrates, bitrate compensation is performed on the ROI region to maintain the image quality, avoid resource waste, and improve encoding performance and effect.
Smart Images

Figure CN115643405B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a video coding method and device based on ROI region detection and a computing device. BACKGROUND
[0002] In the process of watching a video, due to the limited attention of the human eye, all information in the video image cannot be noticed, and only part of the region is more sensitive or more interested in part of the content. After coding the video, the quality of the video picture will decrease, and if the picture quality of the user's interested region decreases, the subjective feeling of the user watching the video will decrease, and the user hardly notices the distortion of the uninterested region.
[0003] A video coding method based on ROI (Region of Interest) region emerges as the times require. The basic idea of this method is to allocate more code rate resources to the ROI region during coding, and to reduce the code rate allocation to the non-ROI region, so as to ensure the picture quality of the ROI region and avoid the waste of code rate in the non-ROI region. By modifying the quantization parameters of the ROI and non-ROI regions, the code rate allocation is adjusted to achieve the coding effect based on the ROI region.
[0004] However, the inventors have found in the implementation of the present application that the existing coding method based on the ROI region lacks content adaptivity, and has the problems of wasting code rate when the code rate is high and being unable to guarantee the picture quality of the ROI region when the code rate is low, resulting in poor coding effect and performance. SUMMARY
[0005] The purpose of the embodiments of the present application is to provide a video coding method and device based on ROI region detection and a computing device to solve the problem of poor coding effect and performance caused by the lack of content adaptivity of the existing technology.
[0006] According to one aspect of the present application, a video coding method based on ROI region detection is provided, comprising:
[0007] Obtaining a video frame to be coded, performing ROI region detection on the video frame, and obtaining ROI region information;
[0008] Reading the coding block of the video frame and the reference quantization parameter corresponding to the coding block;
[0009] Determining a quantization parameter offset according to the reference quantization parameter and the ROI region information;
[0010] Adjusting the reference quantization parameter according to the quantization parameter offset to obtain an adjusted quantization parameter;
[0011] According to the adjusted quantization parameter, the encoding block is encoded.
[0012] Optionally, determining the quantization parameter offset according to the reference quantization parameter and the ROI region information further comprises:
[0013] According to the reference quantization parameter of the encoding block, a quantization parameter offset range is determined.
[0014] According to the ROI region information, a proportion of the ROI region in the encoding block is calculated.
[0015] According to the quantization parameter offset range and the proportion of the ROI region, the quantization parameter offset of the encoding block is calculated.
[0016] Optionally, determining the quantization parameter offset range according to the reference quantization parameter of the encoding block further comprises:
[0017] The reference quantization parameter is compared with a plurality of preset quantization parameter intervals to determine a preset quantization parameter interval corresponding to the reference quantization parameter.
[0018] According to the preset quantization parameter interval corresponding to the reference quantization parameter, a lower limit and an upper limit of the quantization parameter offset range are determined.
[0019] Optionally, the greater the proportion of the ROI region, the closer the quantization parameter offset of the encoding block to the lower limit of the quantization parameter offset range; the smaller the proportion of the ROI region, the closer the quantization parameter offset of the encoding block to the upper limit of the quantization parameter offset range.
[0020] Optionally, the ROI region detection of the video frame to obtain the ROI region information further comprises: the ROI region detection of the video frame to obtain first ROI region information and second ROI region information.
[0021] According to the ROI region information, the proportion of the ROI region in the encoding block is calculated, specifically: according to the first ROI region information and the second ROI region information, the proportion of the first ROI region in the encoding block and the proportion of the second ROI region in the encoding block are calculated.
[0022] According to the quantization parameter offset range and the proportion of the ROI region, the quantization parameter offset of the encoding block is calculated, specifically: according to the quantization parameter offset range, the proportion of the first ROI region and the proportion of the second ROI region, the quantization parameter offset of the encoding block is calculated.
[0023] Optionally, the first ROI region is specifically a human region, and the second ROI region is specifically a face region.
[0024] Optionally, the method further comprises: determining a compensation maximum value of the quantization parameter offset according to the reference quantization parameter of the encoding block.
[0025] The calculating the quantization parameter offset of the coding block according to the quantization parameter offset range, the first ROI area proportion and the second ROI area proportion further comprises:
[0026] The calculating the first quantization parameter offset according to the quantization parameter offset range and the first ROI area proportion;
[0027] The compensating the first quantization parameter offset according to the second ROI area proportion and the compensation maximum value of the quantization parameter offset to obtain the quantization parameter offset of the coding block.
[0028] Optionally, the greater the first ROI area proportion, the closer the first quantization parameter offset to the lower limit of the quantization parameter offset range; the smaller the first ROI area proportion, the closer the first quantization parameter offset to the upper limit of the quantization parameter offset range.
[0029] Optionally, the greater the second ROI area proportion, the greater the amplitude of the compensating; the smaller the second ROI area proportion, the smaller the amplitude of the compensating.
[0030] Optionally, after the quantization parameter offset range is determined, the method further comprises:
[0031] Adjusting the quantization parameter offset range according to the ROI intensity parameter.
[0032] Optionally, after the compensation maximum value of the quantization parameter offset is determined, the method further comprises:
[0033] Adjusting the compensation maximum value of the quantization parameter offset according to the ROI intensity parameter.
[0034] Optionally, after the ROI area information is obtained by detecting the ROI area of the video frame, the method further comprises:
[0035] Calculating the ROI area proportion in the video frame according to the ROI area information;
[0036] Comparing the ROI area proportion in the video frame with a preset threshold, and determining whether to adjust the reference quantization parameter of each coding block of the video frame according to the comparison result.
[0037] According to another aspect of the present application, a structural diagram of a video coding device based on ROI area detection is provided, and the device comprises:
[0038] An area detection module adapted to acquire a video frame to be coded, detect the ROI area of the video frame, and obtain ROI area information;
[0039] A reading module adapted to read the coding block of the video frame and the reference quantization parameter corresponding to the coding block;
[0040] The parameter adjustment module is adapted to determine a quantization parameter offset according to the reference quantization parameter and the ROI region information, and adjust the reference quantization parameter according to the quantization parameter offset to obtain an adjusted quantization parameter.
[0041] The encoding module is adapted to encode the encoding block according to the adjusted quantization parameter.
[0042] Optionally, the parameter adjustment module is further adapted to:
[0043] determine a quantization parameter offset range according to the reference quantization parameter of the encoding block;
[0044] calculate an ROI region proportion in the encoding block according to the ROI region information;
[0045] calculate the quantization parameter offset of the encoding block according to the quantization parameter offset range and the ROI region proportion.
[0046] Optionally, the parameter adjustment module is further adapted to:
[0047] compare the reference quantization parameter with a plurality of preset quantization parameter intervals to determine a preset quantization parameter interval corresponding to the reference quantization parameter;
[0048] determine a lower limit and an upper limit of the quantization parameter offset range according to the preset quantization parameter interval corresponding to the reference quantization parameter.
[0049] Optionally, the greater the ROI region proportion, the closer the quantization parameter offset of the encoding block to the lower limit of the quantization parameter offset range; the smaller the ROI region proportion, the closer the quantization parameter offset of the encoding block to the upper limit of the quantization parameter offset range.
[0050] Optionally, the region detection module is further adapted to detect the ROI region of the video frame to obtain first ROI region information and second ROI region information.
[0051] The parameter adjustment module is further adapted to calculate a first ROI region proportion and a second ROI region proportion in the encoding block according to the first ROI region information and the second ROI region information, and calculate the quantization parameter offset of the encoding block according to the quantization parameter offset range, the first ROI region proportion and the second ROI region proportion.
[0052] Optionally, the first ROI region is specifically a human region, and the second ROI region is specifically a face region.
[0053] Optionally, the parameter adjustment module is further adapted to: determine a compensation maximum of the quantization parameter offset according to the reference quantization parameter of the coding block; calculate the first quantization parameter offset according to the quantization parameter offset range and the first ROI region proportion; and perform compensation processing on the first quantization parameter offset according to the second ROI region proportion and the compensation maximum of the quantization parameter offset, to obtain the quantization parameter offset of the coding block.
[0054] Optionally, the greater the first ROI region proportion, the closer the first quantization parameter offset is to the lower limit of the quantization parameter offset range; and the smaller the first ROI region proportion, the closer the first quantization parameter offset is to the upper limit of the quantization parameter offset range.
[0055] Optionally, the greater the second ROI region proportion, the greater the amplitude of the compensation processing; and the smaller the second ROI region proportion, the smaller the amplitude of the compensation processing.
[0056] Optionally, the parameter adjustment module is further adapted to: adjust the quantization parameter offset range according to the ROI intensity parameter.
[0057] Optionally, the parameter adjustment module is further adapted to: adjust the compensation maximum of the quantization parameter offset according to the ROI intensity parameter.
[0058] Optionally, the apparatus further comprises a comparison module adapted to: calculate the ROI region proportion in the video frame according to the ROI region information; compare the ROI region proportion in the video frame with a preset threshold; and determine whether to adjust the reference quantization parameter of each coding block in the video frame according to a comparison result.
[0059] According to yet another aspect of the present application, a computing device is provided, comprising: a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface complete communication with each other through the communication bus;
[0060] The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the above-mentioned video coding method based on ROI region detection.
[0061] According to still another aspect of the present application, a computer storage medium is provided, and the storage medium stores at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the above-mentioned video coding method based on ROI region detection.
[0062] According to the video coding method, device and computing equipment based on ROI region detection provided in the application, adaptive quantization parameter adjustment based on a reference quantization parameter and content of a coding block can be realized, and the effect and performance of coding processing can be improved. Further, the quality of the ROI region is protected at a high code rate, and the code rate of the non-ROI region is reduced, the code rate is not obviously increased on the premise of keeping the quality unchanged, and the quality of the ROI region is ensured. Further, according to the proportion of the ROI region in the video frame, it is determined whether to adjust the quantization parameter of each coding block of the video frame, the video frame that really needs to adjust the quantization parameter can be accurately identified, resource waste can be avoided, and the coding performance is further improved. Further, the offset strength of the quantization parameter can be adaptively adjusted according to the reference quantization parameter, and the reference quantization parameter is adjusted according to the proportion of the person region, and the quantization parameter is compensated according to the proportion of the face region, that is, the code rate of the person region is compensated in the coding process, and the code rate of the face region is further compensated, and the allocation of the code rate of the background region is reduced, the importance of different types of regions is combined to realize hierarchical adaptive quantization parameter adjustment, the coding complexity is not more than twice the coding, the coding quality between scenes is kept constant, the effect of saving the code rate at a high code rate and avoiding insufficient code rate at a low code rate can be achieved on the premise of ensuring the picture quality.
[0063] The above description is only a summary of the technical scheme of the application. In order to more clearly understand the technical means of the application, the application can be implemented according to the content of the specification, and in order to make the above and other purposes, characteristics and advantages of the application more obvious and easy to understand, the following specific embodiments of the application are described. BRIEF DESCRIPTION OF DRAWINGS
[0064] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments and are not meant to limit the scope of the application. Moreover, the same reference numerals in the attached drawings indicate the same or similar elements. In the drawings:
[0065] Figure 1 A flowchart of a video coding method based on ROI region detection provided by an embodiment of the application is shown;
[0066] Figure 2 A flowchart of a video coding method based on ROI region detection provided by another embodiment of the application is shown;
[0067] Figure 3 A flowchart of a video coding method based on ROI region detection provided by another embodiment of the application is shown;
[0068] Figure 4 A schematic diagram of a video frame provided in an embodiment of the present application is shown;
[0069] Figure 5 A flow chart of a video encoding method based on ROI region detection provided in another embodiment of the present application is shown;
[0070] Figure 6 A structural schematic diagram of a video encoding apparatus based on ROI region detection provided in an embodiment of the present application is shown;
[0071] Figure 7 A structural schematic diagram of a computing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0072] Exemplary embodiments of the present application will be described in detail with reference to the drawings. Although exemplary embodiments of the present application are shown in the drawings, it is understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thoroughly and completely understood, and will fully convey the scope of the application to those skilled in the art.
[0073] First, the nomenclature related to one or more embodiments of the present application is explained.
[0074] Video encoding: refers to the conversion of a file in original video format into another file in another video format through compression technology.
[0075] ROI: the abbreviation of Region of Interest, i.e. region of interest, is a part of an image, which is generated by selecting or using methods such as setting threshold or converting from other files on the image.
[0076] Quantization parameter: Quantization Parameter, abbreviated as QP, is a parameter used to control the quantization step in video encoding, which can be used to control the encoding quality and code rate. For the same image content, the smaller the quantization parameter, the higher the code rate and the better the quality, and vice versa, the larger the quantization parameter, the lower the code rate and the worse the quality.
[0077] Figure 1 A flow chart of a video encoding method based on ROI region detection provided in an embodiment of the present application is shown, which is applied to any device with image encoding capability. As shown in Figure 1 the method comprises the following steps:
[0078] Step S101, obtaining a video frame to be encoded, performing ROI region detection on the video frame to obtain ROI region information.
[0079] The ROI region refers to a region in a video image that is more sensitive or more interesting to human eyes, such as a face region and / or a character region.
[0080] The video to be encoded includes a plurality of video frames, and each video frame is sequentially encoded. For the video frame to be encoded, an ROI region is detected, and position information and size information of the ROI region are obtained, i.e., ROI region information is obtained.
[0081] In step S102, an encoding block of a video frame and a reference quantization parameter corresponding to the encoding block are read.
[0082] Each video frame is divided into a plurality of encoding blocks, and each encoding block is sequentially encoded. The current encoding block of the video frame to be encoded is read, and the reference quantization parameter corresponding to the encoding block is read. The reference quantization parameter is determined by an original encoding algorithm.
[0083] In step S103, a quantization parameter offset is determined according to the reference quantization parameter and the ROI region information.
[0084] The reference quantization parameter can represent a reference code rate to be adjusted, and the ROI region information can represent the picture content of the encoding block. The code rate required in different reference code rate and different picture content scenarios is different, and thus the adjustment manner and adjustment range of the reference quantization parameter are inconsistent. Therefore, in the manner of the embodiment, the reference quantization parameter of the encoding block is adjusted in combination with the reference quantization parameter and the ROI region information in the encoding block.
[0085] For example, low reference quantization parameters and high reference quantization parameters are distinguished, a quantization parameter offset range suitable for a low reference quantization parameter scenario is set, and a quantization parameter offset range suitable for a high reference quantization parameter is set. According to the size of the ROI region proportion, a matching quantization parameter offset is determined in the quantization parameter offset range.
[0086] In step S104, the reference quantization parameter is adjusted according to the quantization parameter offset to obtain an adjusted quantization parameter, and the encoding block is encoded according to the adjusted quantization parameter.
[0087] The reference quantization parameter is added to the quantization parameter offset to obtain the adjusted quantization parameter, and the encoding block is encoded according to the adjusted quantization parameter, so that the code rate is adjusted according to the reference quantization parameter and the content of the encoding block.
[0088] According to the ROI region detection-based video coding method provided in the embodiment, a video frame to be coded is obtained, and ROI region detection is performed on the video frame to obtain ROI region information; an encoding block of the video frame and a reference quantization parameter corresponding to the encoding block are read; a quantization parameter offset is determined according to the reference quantization parameter and the ROI region information; the reference quantization parameter is adjusted according to the quantization parameter offset to obtain an adjusted quantization parameter; and the encoding block is coded according to the adjusted quantization parameter. In this way, adaptive adjustment of the quantization parameter based on the reference quantization parameter and the content of the encoding block can be implemented, and the effect and performance of the coding process can be improved.
[0089] Figure 2 A flowchart of the ROI region detection-based video coding method provided in another embodiment of the application is shown. The method is applied to any device with image coding capability, such as an HEVC encoder, and the method of the embodiment is executed to adjust the reference quantization parameter of a coding tree unit (CTU). As shown in Figure 2 The method includes the following steps:
[0090] In step S201, a video frame to be coded is obtained, and ROI region detection is performed on the video frame to obtain ROI region information.
[0091] The ROI region is specifically a human region and / or a face region. When the video frame to be coded is coded, a target detection algorithm is used to detect the ROI region in the video frame to obtain the size and position information of the ROI region.
[0092] In step S202, the proportion of the ROI region in the video frame is calculated according to the ROI region information; the proportion of the ROI region in the video frame is compared with a preset threshold, and whether the reference quantization parameter of each encoding block of the video frame is adjusted is determined according to the comparison result.
[0093] The proportion of the ROI region in the video frame is calculated by calculating the ratio of the area of the ROI region to the area of the video frame, and then the size relationship between the proportion of the ROI region in the video frame and the preset threshold is compared. If the comparison result indicates that the proportion of the ROI region in the video frame reaches the preset threshold, it is determined that the reference quantization parameter of the encoding block contained in the video frame is adjusted; otherwise, if the comparison result indicates that the proportion of the ROI region in the video frame does not reach the preset threshold, it is determined that the reference quantization parameter of the encoding block contained in the video frame is not adjusted, and the video frame can be coded using the quantization parameter corresponding to the coding algorithm. In this way, the video frame containing a large area of user-interested content is identified for adjustment of the quantization parameter, instead of adjusting the quantization parameter for all video frames. The video frame that truly needs adjustment of the quantization parameter can be accurately identified, so that resource waste can be avoided, and the coding performance can be further improved.
[0094] Step S203, if it is determined to adjust the reference quantization parameter of each coding block of the video frame according to the comparison result, read the coding block of the video frame and the reference quantization parameter corresponding to the coding block.
[0095] If it is determined that the reference quantization parameter of each coding block of the video frame needs to be adjusted, the reference quantization parameter is adjusted for each coding block in turn until the quantization parameters of all coding blocks of the video frame are adjusted. The coding block currently to be encoded is read, and the reference quantization parameter corresponding to the coding block is read.
[0096] Step S204, according to the reference quantization parameter of the coding block, determine the quantization parameter offset range, and according to the ROI region information, calculate the ROI region proportion in the coding block.
[0097] First, according to the reference quantization parameter of the coding block, the quantization parameter offset range is determined, which refers to the value range of the offset used to adjust the reference quantization parameter. Different quantization parameter offset ranges are set for different numerical levels of reference quantization parameters, such as distinguishing between low reference quantization parameters and high reference quantization parameters, setting a quantization parameter offset range suitable for a low reference quantization parameter scenario, and a quantization parameter offset range suitable for a high reference quantization parameter.
[0098] Second, according to the size and position information of the ROI region, the area ratio of the overlapping region of the coding block and the ROI region to the area of the coding block is calculated to obtain the ROI region proportion in the coding block, which is used to determine the quantization parameter offset in combination with the quantization parameter offset range.
[0099] Among them, the reference quantization parameter can represent the reference code rate to be adjusted, and the ROI region proportion can represent the picture content of the coding block. The required code rate is different in different reference code rate and different picture content scenarios, so the adjustment method and adjustment range of the reference quantization parameter are inconsistent. Therefore, in the manner of the embodiment, the reference quantization parameter of the coding block is adjusted in combination with the reference quantization parameter and the ROI region proportion in the coding block.
[0100] In an optional manner, the reference quantization parameter is compared with a plurality of preset quantization parameter intervals to determine the preset quantization parameter interval corresponding to the reference quantization parameter; according to the preset quantization parameter interval corresponding to the reference quantization parameter, the lower limit and the upper limit of the quantization parameter offset range are determined.
[0101] determining a preset quantization parameter interval to which the reference quantization parameter belongs, and determining a lower limit and an upper limit of the quantization parameter offset range according to the preset quantization parameter interval to which the reference quantization parameter belongs. Different preset quantization parameter intervals correspond to different quantization parameter offset ranges, the lower limit of the quantization parameter offset range corresponding to the preset quantization parameter interval is a preset constant or a variable related to the quantization parameter, and the upper limit is a preset constant or a variable related to the quantization parameter. If the lower limit and the upper limit of the quantization parameter offset range corresponding to the current coding block are directly assigned as the preset constant, if the lower limit and the upper limit of the quantization parameter offset range corresponding to the current coding block are calculated according to the reference quantization parameter, the lower limit and / or the upper limit of the quantization parameter offset range corresponding to the current coding block are calculated according to the reference quantization parameter.
[0102] In step S205, the quantization parameter offset of the coding block is calculated according to the quantization parameter offset range and the ROI region proportion.
[0103] The quantization parameter offset of the coding block is determined according to the quantization parameter offset range and the ROI region proportion determined in the above steps, for example, the quantization parameter offset is determined in the quantization parameter offset range according to the size of the ROI region proportion.
[0104] Specifically, the relationship among the quantization parameter offset range, the ROI region proportion, and the quantization parameter offset is as follows: the greater the ROI region proportion, the closer the quantization parameter offset of the coding block to the lower limit of the quantization parameter offset range; the smaller the ROI region proportion, the closer the quantization parameter offset of the coding block to the upper limit of the quantization parameter offset range. That is, the greater the ROI region proportion, the smaller the adjustment range of the reference quantization parameter, thereby controlling the increase range of the code rate, and thereby ensuring the quality of the ROI region. In a specific implementation, a calculation formula of the quantization parameter offset of the coding block satisfying the above relationship is set to calculate the quantization parameter offset of the coding block.
[0105] In addition, when the reference quantization parameter is small, the adjustment range of the quantization parameter of the non-ROI region is large, thereby reducing the code rate of the non-ROI region in a high code rate condition; when the reference quantization parameter is large, the adjustment range of the quantization parameter of the non-ROI region is small, thereby ensuring the code rate of the non-ROI region in a low code rate condition. Since the quantization parameter offset of the coding block is the upper limit of the quantization parameter offset range when the coding block is only the non-ROI region, the upper limit of the corresponding quantization parameter adjustment range decreases with the increase of the reference quantization parameter.
[0106] In step S206, the reference quantization parameter is adjusted according to the quantization parameter offset to obtain an adjusted quantization parameter, and the coding block is encoded according to the adjusted quantization parameter.
[0107] The quantization parameter offset is added to the reference quantization parameter to obtain an adjusted quantization parameter, and the encoding block is encoded according to the adjusted quantization parameter.
[0108] According to the video encoding method based on ROI region detection provided by the embodiment, the reference encoding quantization parameter is adjusted adaptively based on the reference encoding quantization parameter and the picture content of the encoding block, the quality of the ROI region is protected at a high code rate, and the code rate of the non-ROI region is reduced, the code rate is not obviously increased on the premise of keeping the picture quality unchanged, and the quality of the ROI region is ensured; the quality of the non-ROI region is protected at a low code rate, and the code rate of the ROI region is compensated, the quality of the ROI region is ensured on the premise that the code rate is not obviously increased, and the encoding performance is further improved.
[0109] Figure 3 A flowchart of the video encoding method based on ROI region detection provided by another embodiment of the application is shown, and the method is applied to any device with image encoding capability. As shown in Figure 3 The method comprises the following steps:
[0110] In step S301, a video frame to be encoded is obtained, and ROI region detection is performed on the video frame to obtain first ROI region information and second ROI region information.
[0111] In some technical solutions, the screen center region is defined as the ROI region or the face region is defined as the ROI region, but when a user watches a video, the user may be interested in multiple types of targets, and the sensitivity to different ROI targets also differs. For example, in a video containing a person, the background region is usually the most easily ignored place, the human eye first pays attention to the content of the person region, and is more sensitive to the face region in the person region. Therefore, a single ROI region and a way of not distinguishing the importance of different types of ROI regions do not conform to the human eye visual characteristics.
[0112] Based on this, in the embodiments of the present application, the character region and the face region are detected, and the importance of the character region and the face region is combined to adjust the reference quantization parameter subsequently, so that the adjustment manner of the quantization parameter has content adaptivity. The first ROI region refers to the character region, and the second ROI region refers to the face region. The second ROI region is contained in the first ROI region. When encoding the video frame to be encoded, the character region and the face region in the video frame are detected to obtain the size and position information of the character region (i.e., the first ROI region information) and the size and position information of the face region (i.e., the second ROI region information). Specifically, a target detection algorithm is used to realize ROI region detection, for example, a target detection algorithm YOLOv5 based on deep learning.
[0113] In step S302, the encoding block of the video frame and the reference quantization parameter corresponding to the encoding block are read.
[0114] Each video frame is divided into a plurality of encoding blocks, and each encoding block is encoded in turn. The encoding block currently needing to be encoded is read, and the reference quantization parameter corresponding to the encoding block is read. The reference quantization parameter is determined by the original encoding algorithm.
[0115] In step S303, the reference quantization parameter is compared with a plurality of preset quantization parameter intervals to determine the preset quantization parameter interval corresponding to the reference quantization parameter. According to the preset quantization parameter interval corresponding to the reference quantization parameter, the lower limit and the upper limit of the quantization parameter offset range are determined.
[0116] The preset quantization parameter interval to which the reference quantization parameter belongs is determined, and according to the preset quantization parameter interval to which the reference quantization parameter belongs, the lower limit and the upper limit of the quantization parameter offset range are determined.
[0117] Different preset quantization parameter intervals correspond to different quantization parameter offset ranges. The lower limit of the quantization parameter offset range corresponding to the preset quantization parameter interval is a preset constant or a variable related to the quantization parameter, and the upper limit is a preset constant or a variable related to the quantization parameter. If it is a preset constant, it is directly assigned to the lower limit and / or the upper limit of the quantization parameter offset range corresponding to the current encoding block. If it is a variable related to the quantization parameter, the lower limit and / or the upper limit of the quantization parameter offset range corresponding to the current encoding block is calculated according to the reference quantization parameter.
[0118] In an alternative manner, after the quantization parameter offset range is determined, the quantization parameter offset range is adjusted according to an ROI intensity parameter. The ROI intensity parameter is a set parameter, and the greater the ROI intensity parameter is, the more the reference quantization parameter is adjusted, and vice versa, the smaller the intensity parameter is, the less the reference quantization parameter is adjusted. For example, the value range of the ROI intensity parameter is set to 0 to 100, and the default value of the ROI intensity parameter is 50, which represents a medium adjustment intensity. If the user does not specify the ROI intensity parameter, the default ROI intensity parameter is used. In this way, the user's demand for customizing the adjustment intensity can be met.
[0119] In step S304, the first ROI area proportion and the second ROI area proportion in the coding block are calculated according to the first ROI area information and the second ROI area information.
[0120] Figure 4 A schematic diagram of a video frame provided in an embodiment of the present application is shown, in which the person detection result and the face detection result are represented by rectangular frames, and the coding block 41 overlaps the person area 42 (the first ROI area) and the face area 43 (the second ROI area). Assuming that the area of the coding block 41 is A, the area of the overlapping region between the person area 42 and the coding block 41 is B, and the area of the overlapping region between the face area 43 and the coding block 41 is C, then the first ROI area proportion R_person in the coding block is B / A, and the second ROI area proportion R_face in the coding block is C / A.
[0121] In step S305, the quantization parameter offset of the coding block is calculated according to the quantization parameter offset range, the first ROI area proportion, and the second ROI area proportion.
[0122] The quantization parameter offset range and the first ROI area proportion are used to determine the initial value of the quantization parameter offset, and the second ROI area proportion is used to perform compensation processing on the initial value of the quantization parameter offset, in which the compensation processing is to subtract a compensation amplitude from the initial value of the quantization parameter offset. In this manner, the reference quantization parameter is adjusted twice, that is, the quantization parameter offset is adjusted according to the person area proportion and the face area proportion, and the hierarchical adaptive quantization parameter adjustment based on the different importance of the person area and the face area can be realized.
[0123] Specifically, the larger the proportion of the first ROI region, the closer the first quantization parameter offset is to the lower limit of the quantization parameter offset range; conversely, the smaller the proportion of the first ROI region, the closer the first quantization parameter offset is to the upper limit of the quantization parameter offset range. In other words, a larger proportion of the person area results in a smaller first quantization parameter offset, leading to a smaller quantization parameter offset and thus a higher bitrate, ensuring the quality of the person area. Similarly, a larger proportion of the second ROI region results in a larger compensation processing step, while a smaller proportion results in a smaller compensation processing step. In other words, a larger face area requires more compensation, resulting in a smaller quantization parameter offset and a higher bitrate, thus ensuring the quality of the face area.
[0124] Further, the first quantization parameter offset is calculated based on the quantization parameter offset range and the proportion of the first ROI region; the first quantization parameter offset is compensated based on the proportion of the second ROI region and the maximum compensation value of the quantization parameter offset to obtain the quantization parameter offset of the coding block.
[0125] Specifically, the maximum compensation value for the quantization parameter offset is determined based on the reference quantization parameters of the coding block. Optionally, the reference quantization parameters of the coding block are compared with multiple preset quantization parameter ranges, and the maximum compensation value for the quantization parameter offset is determined based on the preset quantization parameter range corresponding to the reference quantization parameters. Different preset quantization parameter ranges correspond to different maximum compensation values for the quantization parameter offset. The relationship between the quantization parameter and the maximum compensation value is as follows: the smaller the quantization parameter, the smaller the maximum compensation value; the larger the quantization parameter, the larger the maximum compensation value.
[0126] In this embodiment, the basic idea for adjusting the baseline quantization parameter is as follows: when the baseline quantization parameter is small, the adjustment of the quantization parameter in the non-ROI region is larger, and the compensation for the quantization parameter in the ROI region is smaller; when the baseline quantization parameter is large, the adjustment of the quantization parameter in the non-ROI region is smaller, and the compensation for the quantization parameter in the ROI region is larger. The quantization parameter offset range and the maximum compensation value corresponding to each preset quantization parameter interval are set.
[0127] In one alternative approach, after determining the maximum compensation value of the quantization parameter offset based on the reference quantization parameters of the coding block, the method further includes: adjusting the maximum compensation value of the quantization parameter offset based on the ROI intensity parameters. In this case, the first quantization parameter offset is compensated based on the proportion of the second ROI region and the adjusted maximum compensation value of the quantization parameter offset during the compensation process.
[0128] In one alternative approach, the quantization parameter offset is calculated using the following formula:
[0129] QP_offset = delta_QP_min + (1 - R_person) * delta_QP_range - (R_face * face_reduce_QP_range)
[0130] Wherein, QP_offset represents the quantization parameter offset, delta_QP_min represents the quantization parameter offset minimum value (i.e. the lower limit of the quantization parameter offset range), R_person represents the first ROI area ratio, i.e. the person area ratio, delta_QP_range represents the quantization parameter adjustment range, i.e. the length of the quantization parameter offset range, R_face represents the second ROI area ratio, i.e. the face area ratio, and face_reduce_QP_range represents the compensation maximum value of the quantization parameter offset.
[0131] The formula indicates that the reference quantization parameter is adjusted twice, the first time according to the person area ratio, the greater the person area ratio, the closer the quantization parameter offset to the offset minimum value, and conversely, the greater the non-person area ratio, the closer the quantization parameter offset to the offset maximum value; the second time according to the face area ratio for compensation, the greater the face area ratio, the greater the compensation processing range, and the smaller the face area ratio, the smaller the compensation processing range.
[0132] Step S306, according to the quantization parameter offset, the reference quantization parameter is adjusted to obtain the adjusted quantization parameter, and the encoding block is encoded according to the adjusted quantization parameter.
[0133] The quantization parameter offset is added to the reference quantization parameter, and the sum is rounded, and then the rounding result is processed by the quantization parameter effective range to obtain the adjusted quantization parameter, and the encoding block is encoded according to the adjusted quantization parameter.
[0134] In an existing scheme, the quantization parameter is adjusted based on the binarization ROI region, which will cause obvious quality difference between the encoded ROI region and the non-ROI region, thereby producing pseudo-contour and affecting the user's subjective feeling; in another existing scheme, a fixed offset is added or subtracted from the reference quantization parameter for adjustment, but this way lacks content adaptivity, resulting in waste of code rate in high code rate condition, and unable to guarantee the quality of the ROI region in low code rate condition.
[0135] According to the video coding method based on ROI region detection provided in the embodiment, the offset strength of the quantization parameter can be adaptively adjusted according to the reference quantization parameter, meanwhile, the quantization parameter is adjusted according to the proportion of the person region, the quantization parameter is compensated according to the proportion of the face region, that is, the coding rate of the person region is compensated first, and then the coding rate of the face region is further compensated, meanwhile, the coding rate of the background region is reduced, so that the adaptive quantization parameter adjustment of different categories of regions can be realized, and the coding complexity is not more than twice the coding; the method of the embodiment can achieve the following effects: in the high coding rate case, the quality of the ROI region is protected, and the coding rate of the non-ROI region is reduced, the coding rate is reduced under the premise of keeping the picture quality unchanged; in the low coding rate case, the quality of the non-ROI region is protected, and the coding rate of the ROI region is compensated, the quality of the ROI region is ensured under the premise that the coding rate is not obviously increased, the coding quality of each scene can be kept constant, and the effects of saving the coding rate in the high coding rate case and avoiding the lack of coding rate in the low coding rate case can be achieved under the premise of ensuring the picture quality.
[0136] Figure 5 The flowchart of the video coding method based on ROI region detection provided in another embodiment of the application is shown as follows: Figure 5 After the coding of the current video frame is started, the specific processing flow is as follows:
[0137] Step S501, person detection and face detection are performed on the video frame, and ROI region information is saved;
[0138] Step S502, it is judged whether all coding blocks are processed; if yes, the coding of the current video frame is ended; if no, step S503 is jumped to;
[0139] Step S503, the next coding block is read, and the reference quantization parameter QP_base is read;
[0140] Step S504, it is judged whether there is an ROI target in the frame; if no, step S505 is jumped to; if yes, step S506 is jumped to;
[0141] Step S505, the current coding block is coded using QP_base, and step S502 is jumped to;
[0142] Step S506, the area proportion R_person and the face area proportion R_face in the current block are calculated respectively;
[0143] Step S507, according to QP_base, the minimum value of QP offset, the QP adjustment range and the maximum compensation value are determined.
[0144] Specifically, according to a preset quantization parameter interval corresponding to the QP_base, a QP offset minimum value, a QP adjustment range and a compensation maximum value are determined, wherein the QP offset minimum value is also the lower limit of the quantization parameter offset range, and the QP adjustment range is also the length of the quantization parameter offset range, that is, the difference between the upper limit and the lower limit of the quantization parameter offset range.
[0145] In one example, the relationship between the quantization parameter interval and the QP offset minimum value, the QP adjustment range and the compensation maximum value is as follows:
[0146] When QP_base is less than or equal to 20, the QP offset minimum value is 0, the QP adjustment range is 4, and the face QP compensation maximum value is 0.
[0147] When QP_base is greater than 20 and less than or equal to 25, the QP offset minimum value is 0, the QP adjustment range decreases linearly with the increase of QP: delta_QP_range = 4-(QP_base-20) / 5, and the face QP compensation maximum value is 1.
[0148] When QP_base is greater than 25 and less than or equal to 30, the QP offset minimum value is calculated by delta_QP_min =-(QP_base-25) / 5, the QP adjustment range is 3, and the face QP compensation maximum value is 1.
[0149] When QP_base is greater than 30 and less than or equal to 40, the QP offset minimum value is calculated by delta_QP_min =-2(QP_base-30) / 10-1, the QP adjustment range is calculated by delta_QP_range = 3+1.5(QP_base-30) / 10, and the face QP compensation maximum value is 2.
[0150] When QP_base is greater than 40, the QP offset minimum value is calculated by delta_QP_min =-5(QP_base-40) / 11-3, the QP adjustment range is calculated by delta_QP_range = 4.5+3.5(QP_base-40) / 11, and the face QP compensation maximum value is 3.
[0151] In step S508, the QP adjustment range and the compensation maximum value are adjusted according to the ROI intensity parameter.
[0152] The specific adjustment method is as follows:
[0153] delta_QP_min = delta_QP_min * roi_strength / 50
[0154] delta_QP_range = delta_QP_range * roi_strength / 50
[0155] face_reduce_QP_range = face_reduce_QP_range * roi_strength / 50
[0156] Wherein, QP_offset represents the quantization parameter offset, delta_QP_min represents the quantization parameter offset minimum value (i.e. the lower limit of the quantization parameter offset range), R_person represents the first ROI area ratio, i.e. the person area ratio, delta_QP_range represents the quantization parameter adjustment range, i.e. the length of the quantization parameter offset range, R_face represents the second ROI area, i.e. the face area ratio, and face_reduce_QP_range represents the compensation maximum value of the quantization parameter offset.
[0157] Step S509, calculate the QP adjustment offset.
[0158] The specific calculation method is as follows:
[0159] QP_offset = delta_QP_min + (1 - R_person) * delta_QP_range - (R_face * face_reduce_QP_range)
[0160] Step S510, calculate the adjusted quantization parameter QP_adjust.
[0161] On the basis of the reference quantization parameter, add the quantization parameter offset, sum and then round, and then process the rounding result through the quantization parameter effective range, to obtain the adjusted quantization parameter.
[0162] The specific calculation method is as follows:
[0163] QP_adjust = round(QP_base + QP_offset)
[0164] QP_adjust = clip(QP_adjust, 0, 51)
[0165] Wherein, QP_adjust represents the adjusted quantization parameter, QP_base represents the reference quantization parameter, QP_offset represents the quantization parameter offset, and the quantization parameter effective range is 0 to 51.
[0166] Step S511, encode the current block using QP_adjust, and jump to step S502.
[0167] Figure 6 A structure schematic diagram of a video coding device based on ROI region detection provided by an embodiment of the present application is shown in FIG. 1. As shown in the figure, the device comprises: Figure 6
[0168] A region detection module 61 adapted to acquire a video frame to be coded, perform ROI region detection on the video frame, and obtain ROI region information;
[0169] A reading module 62 adapted to read a coding block of the video frame and a reference quantization parameter corresponding to the coding block;
[0170] A parameter adjustment module 63 adapted to determine a quantization parameter offset according to the reference quantization parameter and the ROI region information, and adjust the reference quantization parameter according to the quantization parameter offset to obtain an adjusted quantization parameter;
[0171] A coding module 64 adapted to perform coding processing on the coding block according to the adjusted quantization parameter.
[0172] In an optional manner, the parameter adjustment module 63 is further adapted to:
[0173] determine a quantization parameter offset range according to the reference quantization parameter of the coding block;
[0174] calculate an ROI region proportion in the coding block according to the ROI region information;
[0175] calculate the quantization parameter offset of the coding block according to the quantization parameter offset range and the ROI region proportion.
[0176] In an optional manner, the parameter adjustment module 63 is further adapted to:
[0177] compare the reference quantization parameter with a plurality of preset quantization parameter intervals to determine a preset quantization parameter interval corresponding to the reference quantization parameter;
[0178] determine a lower limit and an upper limit of the quantization parameter offset range according to the preset quantization parameter interval corresponding to the reference quantization parameter.
[0179] In an optional manner, the greater the ROI region proportion, the closer the quantization parameter offset of the coding block to the lower limit of the quantization parameter offset range; the smaller the ROI region proportion, the closer the quantization parameter offset of the coding block to the upper limit of the quantization parameter offset range.
[0180] In an optional manner, the region detection module 61 is further adapted to perform ROI region detection on the video frame to obtain first ROI region information and second ROI region information;
[0181] The parameter adjustment module 63 is further adapted to: calculate a first ROI region proportion and a second ROI region proportion in the coding block according to the first ROI region information and the second ROI region information; and calculate the quantization parameter offset of the coding block according to the quantization parameter offset range, the first ROI region proportion and the second ROI region proportion.
[0182] In an optional manner, the first ROI region is specifically a human region, and the second ROI region is specifically a face region.
[0183] In an optional manner, the parameter adjustment module 63 is further adapted to: determine a compensation maximum value of the quantization parameter offset according to the reference quantization parameter of the coding block; calculate a first quantization parameter offset according to the quantization parameter offset range and the first ROI region proportion; and perform compensation processing on the first quantization parameter offset according to the second ROI region proportion and the compensation maximum value of the quantization parameter offset to obtain the quantization parameter offset of the coding block.
[0184] In an optional manner, the greater the first ROI region proportion, the closer the first quantization parameter offset to the lower limit of the quantization parameter offset range; and the smaller the first ROI region proportion, the closer the first quantization parameter offset to the upper limit of the quantization parameter offset range.
[0185] In an optional manner, the greater the second ROI region proportion, the greater the amplitude of the compensation processing; and the smaller the second ROI region proportion, the smaller the amplitude of the compensation processing.
[0186] In an optional manner, the parameter adjustment module 63 is further adapted to: adjust the quantization parameter offset range according to the ROI intensity parameter.
[0187] In an optional manner, the parameter adjustment module 63 is further adapted to: adjust the compensation maximum value of the quantization parameter offset according to the ROI intensity parameter.
[0188] In an optional manner, the apparatus further comprises a comparison module adapted to: calculate an ROI region proportion in the video frame according to the ROI region information; compare the ROI region proportion in the video frame with a preset threshold; and determine whether to adjust the reference quantization parameter of each coding block of the video frame according to a comparison result.
[0189] The embodiment of the present application provides a nonvolatile computer storage medium, which stores at least one executable instruction, and the computer executable instruction can execute the video coding method based on ROI region detection in any method embodiment.
[0190] Figure 7The structural schematic diagram of the computing device embodiment of the present application is shown, and the specific implementation of the computing device is not limited by the specific implementation of the present embodiment.
[0191] As shown in Figure 7 The computing device can include a processor 702, a communications interface 704, a memory 706, and a communications bus 708.
[0192] The processor 702, the communications interface 704, and the memory 706 can communicate with each other through the communications bus 708. The communications interface 704 is configured to communicate with network elements such as clients or other servers. The processor 702 is configured to execute the program 710, and can execute the related steps in the above-mentioned video encoding method embodiment based on ROI region detection for the computing device.
[0193] Specifically, the program 710 can include program codes including computer operation instructions.
[0194] The processor 702 can be a central processing unit CPU, or an application specific integrated circuit ASIC, or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors of the computing device can be the same type of processors, such as one or more CPUs; or can be different types of processors, such as one or more CPUs and one or more ASICs.
[0195] The memory 706 is configured to store the program 710. The memory 706 can include a high-speed RAM memory, and can also include a non-volatile memory such as at least one disk memory.
[0196] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with these teachings, based on the description as set forth above. In addition, the embodiments of the present application are not limited to any particular programming language. It will be appreciated that a variety of programming languages can be used to implement the teachings of the present application described herein, and any references below to specific languages are provided for disclosure of enablement of the best mode of the present application.
[0197] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order not to obscure the understanding of this description.
[0198] Similarly, it is to be understood that the phraseology or terminology employed herein, and not otherwise specifically set forth in this specification, is for the purpose of description only and not of limitation. Rather, the disclosed embodiments will be understood to encompass all modifications, variations and alternatives that fall within the scope of the application as defined by the appended claims. Furthermore, to the extent that the terms "comprises", "comprising", "including", and "having" are used in either the detailed description or the claims, these terms are intended to be inclusive in a manner similar to the term "comprising" as "comprising" is interpreted when employed as a transitional word in a transitional phrase having the same meaning or in like form.
[0199] Those skilled in the art will appreciate that the modules in the apparatuses in the embodiments can be adapted and placed in one or more apparatuses other than the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and further can be divided into more sub-modules or sub-units or sub-components. In addition to such features and / or processes or units of at least some are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstract and drawings) and all processes or units of any method or apparatus disclosed so can be combined in any combination. Unless explicitly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract and drawings) can be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0200] Furthermore, those skilled in the art will appreciate that a combination of features of different embodiments can mean within the scope of the application and form a different embodiment. For example, in the following claims, any one of the claimed embodiments can be used in any combination.
[0201] Various component embodiments of the present application can be implemented in hardware, or as software modules running in one or more processors, or in combinations thereof. As will be appreciated by one skilled in the art, a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the functionality of some or all of the components according to embodiments of the present application. The present application can also be implemented as a program of instructions for performing part or all of the methods described herein, e.g., a computer program and a computer program product. Such program of the present application can be stored on a computer readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or in any other form.
[0202] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that one skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of both hardware and software, and any combination thereof. In a unit claim, several devices can be listed with a conjunction like 'or', but it is to be understood that each of these devices can be implemented by its own hardware item. The use of the word 'at least' followed by a list of one or more members does not preclude the presence of additional such members, nor does it preclude further members. The word 'first' or'second' does not have any order of magnitude. The terms 'first','second', 'third', etc. are used to distinguish elements with the same name. The steps of any of the methods disclosed herein do not have to be performed in the order disclosed, unless otherwise specified.
Claims
1. A video coding method based on ROI region detection, comprising: obtaining a video frame to be coded, and performing ROI region detection on the video frame to obtain ROI region information; reading a coding block of the video frame and a reference quantization parameter corresponding to the coding block; determining a quantization parameter offset according to the reference quantization parameter and the ROI region information; wherein the reference quantization parameter is determined by an original coding algorithm; the quantization parameter offset is determined according to a quantization parameter offset range corresponding to the reference quantization parameter and an ROI region proportion in the coding block; different quantization parameter offset ranges are set for reference quantization parameters of different numerical levels; the greater the ROI region proportion, the closer the quantization parameter offset of the coding block to the lower limit of the quantization parameter offset range; the smaller the ROI region proportion, the closer the quantization parameter offset of the coding block to the upper limit of the quantization parameter offset range; adjusting the reference quantization parameter according to the quantization parameter offset to obtain an adjusted quantization parameter; performing coding processing on the coding block according to the adjusted quantization parameter.
2. The method of claim 1, wherein, The determining of the quantization parameter offset according to the reference quantization parameter and the ROI region information further comprises: determining a quantization parameter offset range according to the reference quantization parameter of the coding block; calculating an ROI region proportion in the coding block according to the ROI region information; calculating the quantization parameter offset of the coding block according to the quantization parameter offset range and the ROI region proportion.
3. The method of claim 2, wherein, The determining of the quantization parameter offset range according to the reference quantization parameter of the coding block further comprises: comparing the reference quantization parameter with a plurality of preset quantization parameter intervals to determine a preset quantization parameter interval corresponding to the reference quantization parameter; determining the lower limit and the upper limit of the quantization parameter offset range according to the preset quantization parameter interval corresponding to the reference quantization parameter.
4. The method of claim 2 or 3, wherein, The ROI region detection on the video frame to obtain the ROI region information further comprises: performing ROI region detection on the video frame to obtain first ROI region information and second ROI region information; The calculating of the ROI region proportion in the coding block according to the ROI region information specifically comprises: calculating a first ROI region proportion and a second ROI region proportion in the coding block according to the first ROI region information and the second ROI region information; The calculating of the quantization parameter offset of the coding block according to the quantization parameter offset range and the ROI region proportion specifically comprises: calculating the quantization parameter offset of the coding block according to the quantization parameter offset range, the first ROI region proportion and the second ROI region proportion.
5. The method of claim 4, wherein, The first ROI region is specifically a human region, and the second ROI region is specifically a face region.
6. The method of claim 4, wherein, The method further comprises: determining a compensation maximum value of the quantization parameter offset according to the reference quantization parameter of the coding block. The calculating the quantization parameter offset of the coding block according to the quantization parameter offset range, the first ROI area proportion and the second ROI area proportion further comprises: calculating a first quantization parameter offset according to the quantization parameter offset range and the first ROI area proportion; compensating the first quantization parameter offset according to the second ROI area proportion and a compensation maximum value of the quantization parameter offset to obtain the quantization parameter offset of the coding block.
7. The method of claim 6, wherein, The greater the first ROI area proportion is, the closer the first quantization parameter offset is to the lower limit of the quantization parameter offset range; the smaller the first ROI area proportion is, the closer the first quantization parameter offset is to the upper limit of the quantization parameter offset range.
8. The method of claim 6, wherein, The greater the second ROI area proportion is, the greater the amplitude of the compensating is; the smaller the second ROI area proportion is, the smaller the amplitude of the compensating is.
9. The method of any one of claims 1-3, wherein, After the determining the quantization parameter offset range, the method further comprises: adjusting the quantization parameter offset range according to an ROI intensity parameter.
10. The method of claim 6, wherein, After the determining the compensation maximum value of the quantization parameter offset, the method further comprises: adjusting the compensation maximum value of the quantization parameter offset according to an ROI intensity parameter.
11. The method of any one of claims 1-3, wherein, After the detecting the ROI area of the video frame to obtain the ROI area information, the method further comprises: calculating the ROI area proportion in the video frame according to the ROI area information; comparing the ROI area proportion in the video frame with a preset threshold value, and determining whether to adjust the reference quantization parameter of each coding block of the video frame according to a comparison result. 12.A video coding device based on ROI area detection, comprising: an area detection module adapted to acquire a video frame to be coded, detect an ROI area of the video frame, and obtain ROI area information; a reading module adapted to read a coding block of the video frame and a reference quantization parameter corresponding to the coding block; a parameter adjustment module adapted to determine a quantization parameter offset according to the reference quantization parameter and the ROI area information; adjust the reference quantization parameter according to the quantization parameter offset to obtain an adjusted quantization parameter; wherein the reference quantization parameter is determined by an original coding algorithm; the quantization parameter offset is determined according to a quantization parameter offset range corresponding to the reference quantization parameter and an ROI area proportion in the coding block; different quantization parameter offset ranges are set for reference quantization parameters with different numerical levels; the greater the ROI area proportion is, the closer the quantization parameter offset of the coding block is to the lower limit of the quantization parameter offset range; the smaller the ROI area proportion is, the closer the quantization parameter offset of the coding block is to the upper limit of the quantization parameter offset range; a coding module adapted to code the coding block according to the adjusted quantization parameter.
13. A computing device comprising: a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface complete communication with each other through the communication bus; The memory is configured to store at least one executable instruction, and the executable instruction is configured to enable the processor to perform operations corresponding to the ROI region detection based video coding method according to any one of claims 1-11.
14. A computer storage medium, having stored therein at least one executable instruction, and the executable instruction is configured to enable a processor to perform operations corresponding to the ROI region detection based video coding method according to any one of claims 1-11.
15. A computer program product, comprising at least one executable instruction, and the executable instruction is configured to enable a processor to perform operations corresponding to the ROI region detection based video coding method according to any one of claims 1-11.
Citation Information
Patent Citations
Video bitrate control device and method
CN102263943A
Video coding method and device, electronic equipment and computer readable storage medium
CN110267037A
Video frame coding method and device, encoding equipment and readable storage medium
CN111698505A
Image quality control method, system and device
CN112153317A