Video coding method and system based on H265 and electronic equipment

A video coding, H265 technology, applied in the direction of digital video signal modification, electrical components, image communication, etc., can solve the problem of limited computing resources in mobile applications, save video transmission bandwidth and video storage space, high compression rate, high The effect of the application foreground

Pending Publication Date: 2022-03-18
SHENZHEN VIRTUAL CLUSTERS INFORMATION TECH
0 Cites 0 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0006] In order to overcome the problem that the current existing video compression method needs to occupy a large amount of computing resources an...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Method used

It can be understood that in step S5, each block of the mask image segmentation is a grayscale image, and the pixel value size is 0-255. When not normalized, the mask image generated by each frame Pixel values ​​fluctuate. After normalization, the pixel value of the grayscale image is normalized from 0-255 to the interval of 0-1. This operation can eliminate the fluctuation of the pixel value of the mask image. Multiply the normalized pixel value (pixel average) by 5, and multiply the pixel value by 5 to divide the pixel value of the mask image into 5 levels, which is convenient for the H265 encoder to finely control the size of each ROI area of ​​the input video stream The size of the QP value reduces the block effect caused by the large gap between the QP values ​​​​of adjacent ROI areas.
The present invention carries out image quality optimization and QP processing respectively to the image of video frame, and optimizes image a...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Abstract

The invention provides an H265-based video coding method and system and electronic equipment, and the method comprises the steps: carrying out the image quality optimization and QP processing of an image of a video frame, enabling the optimized image and a QP matrix to serve as the input of an H265 encoder, setting the QP value of a corresponding position in an encoder output frame through the H265 encoder according to the specific QP value in the QP matrix, and carrying out the QP processing of the video frame. According to the scheme, image frame quality enhancement is carried out on the basis of a standard H265 encoder, intra-frame distribution is carried out on the output code rate according to a human eye attention mechanism, the compression rate higher than that of the standard H265 video encoder can be achieved, and compared with the prior art, the method has the advantages that the method is easy to implement, and the cost is low. According to the method, the video quality optimization model and the mask generation model can be integrated into a standard H265 coding framework, a deep learning model does not need to be deployed at a decoding end, and the method can be compatible with most of mobile terminal equipment.

Application Domain

Technology Topic

Image

  • Video coding method and system based on H265 and electronic equipment
  • Video coding method and system based on H265 and electronic equipment
  • Video coding method and system based on H265 and electronic equipment

Examples

  • Experimental program(1)

Example Embodiment

[0046] In order to make the objectives, technical solutions and advantages of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are intended to explain the present invention and is not intended to limit the invention.
[0047] See figure 1 The first embodiment of the present invention provides an H265-based video encoding method, including the following steps:
[0048] Step S1: Get the original image corresponding to the video frame;
[0049] Step S2: Optimize the original image to obtain an optimized image;
[0050] Step S3: Mask processing is performed to obtain a mask image on the original image;
[0051] Step S4: Segment the mask image, obtain a plurality of pieces, calculate the pixel mean of each piece, and acquire the maximum mean and minimum mean corresponding to the pixel mean in all tiles;
[0052] Step S5: From the first tile, based on the maximum mean and the minimum mean, the pixel mean of the current tile can be normalized, and the normalized pixel value is multiplied by 5, and the QP setting of the current tile is obtained. Parameters, based on QP setting parameters to get the final QP value;
[0053] Step S6: Treply handle other tiles to get the QP value corresponding to all of the pieces, and integrate the QP matrix;
[0054] Step S7: The QP matrix and optimize the image as the input of the H265 encoder, complete the processing of the current video frame.
[0055] It will be appreciated that in step S1, one video has a plurality of frame number images, start acquiring an image from the first frame in the video to complete the encoding of the entire video.
[0056]It will be appreciated that in step S2, the original image is optimized, and the specifically can be optimized for the original image, and the common manner may include image speaking, image denoising, image deprivence and the like. In the present embodiment, the quality optimization of the original image is based on the MobileNet base model, and the UNET structure is employed. The model consists of the top 5-layer convolutional block, 4-layer Concat layer and 4 layers of 4-layer. The model uses a 3-channel color image as an input, outputs a 3-channel color image with the original image in the same size. Optimized images in step S2 are one of the input objects of the H265 encoder.
[0057] It will be appreciated that in step S3, the mask processing is performed on the original image, and the mask generating model also uses the MobileNet-based UNET structure model, which is different from the basic model of the aforementioned quality optimization, and the quality optimized model output 3 channel color color. The image, and the model used in this step, the model outputs a single-channel gray image, and the pixel value size in the grayscale image is characterized.
[0058] It will be appreciated that in step S4, the mask image is divided into a plurality of dimensions as a plurality of dimensions based on the size of the H265 encoder and the input original image. The pixel mean of each of the tiles is obtained, and a plurality of pixel mean of multiple pieces are obtained, and the maximum value and minimum value are filtered in a plurality of pixel mean.
[0059] It will be appreciated that each of the blocks of the mask image division is a grayscale figure, and the pixel value is 0-255, and when it is not normalized, the pixel value of each frame generated mask image will be Wave fluctuations. After normalization, the pixel value of the gray graph is normalized from 0 to 255 to 0-1, which can eliminate fluctuations of the pixel value of the mask image. The normalized pixel value (pixel mean) is multiplied by 5, and the pixel value is multiplied by 5, and the pixel value of the mask image can be divided into five levels, which is convenient for the H265 encoder fine-time control input video stream per ROI area. The QP value is reduced because the block effect caused by the difference between the neighboring ROI region QP value.
[0060] It will be appreciated that in step S5, the maximum mean Vmax and the minimum mean value VMIN of the pixel value in the mask image, the mask image value domain is [0, 255], and the pixel of the current tablet block based on the maximum mean Vmax and the minimum mean Vmax The mean V1 is normalized to obtain normalized pixel value V2 can be performed based on the following formula:
[0061] V2 = floor ((v1-vmin) / (vmax-vmin))
[0062] Among them, FLOOR is a downward, and the value domain of the pixel value V2 is [0, 1] after normalization.
[0063] It will be appreciated that the normalized pixel value V2 obtained is set as a QP setting parameter, and the final QP is set according to the QP setting parameter, for example, such as figure 2 After the QP setting parameters shown are processed, the final QP value is obtained, and the QP value can be used as a value in the final QP matrix. Since QP processing is a common way, this is not disconnected here.
[0064] It will be appreciated that in step S6, after processing the remaining tiles, the QP value of all the tiles can be obtained, and the final QP matrix is ​​obtained based on the calculated position.
[0065] It will be appreciated that in step S7, the H265 encoder of the present invention is modified to receive an optimized picture and the QP matrix, which can complete the operation of setting different QP values ​​in the input video stream picture.
[0066] See image 3 In step S4, the segmentation of the mask image includes the following steps:
[0067] Step S41: Based on the size of the ROI region in the H265 encoder, the original image is divided, and the ROI region matrix is ​​obtained.
[0068] Step S42: Based on the size of the ROI region matrix, the mask image is divided to obtain a mapping matrix;
[0069] Step S43: Split the mask image based on the size of the mapping matrix, and obtain a plurality of equal sizes.
[0070] It will be appreciated that in step S41, the size of the ROI region in the H265 encoder segments the original image, for example, each ROI area size of the standard H265 encoder is a length width 32 * 32, and the input video stream image is in accordance with 32 pairs of lengths. Width, aliquot, to obtain all ROI area matrices of the original image, such as the original image of the input video stream is 1920 * 1080, respectively, respectively, divided by 32, respectively, the ROI region matrix length width of the original image is 60, respectively, 60 * 33.
[0071] It will be appreciated that in step S42, the mask image is divided according to the size of the obtained ROI region matrix, for example, the mask image length width is 256 * 256, respectively, respectively, divided by the ROI region matrix long and wide 60 * 33, respectively. The mapping matrix length width is 4 * 7, respectively.
[0072] It will be appreciated that in step S43, the mask image is divided based on the size of the mapping matrix, for example, the mask image long width 256 * 256 is divided according to the mapping matrix length width 4 * 7, and the same size is obtained. Due to the mask image as a grayscale, the segmentation obtained is also a grayscale map.
[0073] See Figure 4 The second embodiment of the present invention also provides an H265-based video coding system. The H265-based video encoding system can be implemented in the first embodiment described above.
[0074] The image acquisition unit 1 is used to implement the above-described step S1 for acquiring the original image corresponding to the video frame;
[0075] The image optimization unit 2 is used to implement the above-described step S2 for optimizing the original image to obtain an optimized image;
[0076] The mask processing unit 3 is used to implement the above step S3 for mask the original image to obtain a mask image;
[0077] The image division unit 4 is configured to perform the above step S4 for segmenting the mask image, obtaining a plurality of tiles, calculating the pixel mean of each tile, acquire the maximum mean corresponding to the pixel mean in all tiles. Minimum mean;
[0078] The QP calculation unit 5 is used to implement the above step S5 for normalization of the pixel mean of the current tile block from the first tile, based on the maximum mean and the minimum mean, and will normalize the normalized pixel value. Multipouth 5, get the QP setting parameters of the current tile;
[0079] The matrix acquisition unit 6 is configured to implement the above step S6 for sequentially handling other tiles to obtain the QP setting parameters corresponding to all of the pieces, and integrate the QP matrix;
[0080] The image compression unit 7 is configured to perform the above step S7 for processing the QP matrix and an optimized image as the input of the H265 encoder to complete the current video frame.
[0081] See Figure 5 The image division unit 4 also includes:
[0082] The area matrix acquisition unit 41 is used to implement the above-described step S41 for dividing the original image based on the size of the ROI region in the H265 encoder, and obtains the ROI region matrix;
[0083] The mapping unit 42 is configured to implement the above step S42 for dividing the mask image based on the ROI region matrix, obtain a mapping matrix;
[0084] The tile acquisition unit 43 is configured to perform the above-described step S43 for dividing the mask image, obtain a plurality of equal sizes.
[0085] See Image 6 The third embodiment of the present invention provides an electronic device for performing the above-described H265-based video encoding method, the electronic device including memory 10 and processor 20, which stores a computing machine program in which the computing machine program is stored. The procedure is set to run the steps in any of the H265-based video encoding method embodiments. The processor 20 is configured to perform the steps in any of the H265-based video encoding method embodiments by the computers program.
[0086] Alternatively, in the present embodiment, the electronic device can be located at least one network device in a plurality of network devices of the computing machine network.
[0087] With the prior art, the present invention provides a H265-based video encoding method, system, and electronic device, with the following advantages:
[0088] The present invention passes the image quality optimization and QP processing, respectively, and the Optimized image and the QP matrix are used as the input of the H265 encoder, and the H265 encoder sets the encoder output frame according to the specific QP value in the QP matrix. The QP value of the location is reached to reduce bandwidth in the case of ensuring output image quality. This program performs image frame quality on the basis of the standard H265 encoder and performs intra-compression ratio of the output code rate in accordance with the human eye care mechanism. It can achieve higher compression ratios than the standard H265 video encoder, and with the prior art. In contrast, the present invention can integrate video quality optimization models and mask generating models into standard H265 encoding frames, and no need to deploy deep learning model in decoding ends, which can comply with most mobile devices to save video transmission bandwidths and Video storage space has a high application prospect.
[0089] In particular, according to the embodiment of the present disclosure, the process described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product comprising a computer program carrying on a computer readable medium, which includes program code for performing a flowchart.
[0090] When the computer program is executed by the processor, the above functions defined in the method of the present application are performed. It should be noted that the computer memory described in this application may be a computer readable signal medium or a computer readable storage medium or any combination of the above. Computer memory can be, for example, - but is not limited to, system, magnetic, light, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of any more.
[0091] More specific examples of computer memory can include, but is not limited to, electrical connection, portable computer disks, hard disk, random access memory (RAM), read-only memory (ROM), wiped programmable read-only Memory (EPROM or flash), fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present application, the computer readable signal medium can be any tangible medium containing or stored, which can be used instruction execution system, device, or device or in combination thereof. In the present application, computer readable signal media can include data signals propagated in a baseband or as part of the carrier, which carries computer readable program code. Such propagation data signals can be employed, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can transmit, propagate, or transmit programs for use by instruction execution system, device, or device or in combination thereof. . The program code included on the computer readable medium can be transmitted with any suitable media, including, but not limited to, wireless, wire, cable, RF, or any suitable combination.
[0092] A computer program code for performing the operation of the present application can be written in one or more programming languages ​​or a combination of the program, which includes object-oriented programming languages ​​- such as Java, SmallTalk, C ++, but also routine Process programming language - such as "C" language or similar programming language. The program code can be performed on the user's computer, partially executed on the user's computer, execute as a separate package, partially executed on the remote computer on the remote computer, or on the remote computer or server. In the case involving remote computers, remote computers can connect to user computers by any kind of network, including a local area network (LAN) or WAN (WAN), or, can be connected to an external computer (eg, using the Internet service provider Internet connection).
[0093] The flowcharts and block diagrams in the drawings illustrate the system architecture, function and operation of the system, method, and computer program product according to various embodiments, in accordance with the present application. In this regard, each of the flowcharts or block diagrams can represent a portion of a module, block, or code, a portion of the module, block, or code contains one or more logical functions for implementing a predetermined logic function. Executive instructions. It should also be noted that in some implementation of the replacement, the functions labeled in the box can occur in the order as indicated in the drawings. For example, two coupled blocks can actually be performed in parallel, and they can sometimes be performed in reverse order, which is based on the functions involved. Also note that each block in block diagram and / or flowchart, and a combination of boxes in block diagrams and / or flowcharts, you can implement a dedicated hardware-based system that performs predetermined functions or operations. Or can be implemented with a combination of dedicated hardware to computer instructions.
[0094] The units described in the present application embodiment can be implemented by software, or can be implemented by hardware. The described unit may also be disposed in the processor, for example, can be described as: a processor includes an image acquisition unit, an image optimization unit, a mask processing unit, an image division unit, a QP computing unit, a matrix acquisition unit, and an image compression. unit. Wherein, the name of these units does not constitute a definition of the unit itself, for example, the image acquisition unit can also be described as "a unit that acquires the original image corresponding to the video frame". "
[0095] As another aspect, the present application also provides a computer memory, which may be included in the apparatus described in the above embodiments; may also be present, and not mating in the apparatus. The above computer memory carries there or more programs, when the above or more programs are performed by the apparatus, make the device: obtain the original image corresponding to the video frame; optimize the original image, to obtain an optimized image; The original image is subjected to a mask process, obtain a mask image; segment the mask image, obtain a plurality of pieces, calculate the pixel mean of each piece, get the maximum mean corresponding to the pixel mean in all tiles, and the smallest Average; starting from the first tile, based on the maximum mean and the minimum mean, normalize the pixel mean of the current tile wall, and multiplied the pixel value of the normalized by 5, the QP setting parameters of the current tile Based on the QP setting parameter to obtain the final QP value; handle other tiles, obtain the QP value corresponding to all pieces, integrate the QP matrix; use the QP matrix and optimized image as the input of the H265 encoder, complete the current video frame processing .
[0096] The above is only preferred embodiments of the present invention, and is not intended to limit the invention, any modifications, equivalents, etc., equivalent replacement and improvement, which are made within principles of the present invention, should include the scope of the present invention.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Similar technology patents

Scanning type display device control circuit

ActiveCN102044211AAvoid double deliverySave bandwidthStatic indicating devicesShort cyclePulse-width modulation
Owner:MACROBLOCK INC

Classification and recommendation of technical efficacy words

  • Save bandwidth
  • Improve compression ratio
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products