Enhanced machine learning-based macroblock partitioning for video encoding

A machine-learning-based macroblock partitioning method addresses the computational challenges in video encoding by using decision trees and logistic regression to predict prediction modes, resulting in improved encoding speed and quality across multiple codecs.

WO2025039150A1PCT designated stage expired Publication Date: 2025-02-27INTEL CORP +7
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/113940
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-08-21
Publication Date
2025-02-27

AI Technical Summary

Technical Problem

Current video encoding technologies, such as H.264 and x264, face significant computational challenges in the macroblock mode decision process, particularly due to the complexity of motion estimation and variable block sizes, which hinders efficient encoding speed and compression ratio.

Method used

The implementation of a machine-learning-based macroblock partitioning method that utilizes decision trees and logistic regression to predict intra and inter prediction modes, reducing the need for redundant calculations and improving encoding efficiency across various codecs like AV1, H.264, H.265, and H.266.

Benefits of technology

This approach reduces encoding time by 22.35% while maintaining video quality, and can be applied to various codecs, enhancing encoding speed and reducing bandwidth requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023113940_27022025_PF_FP_ABST
    Figure CN2023113940_27022025_PF_FP_ABST
Patent Text Reader

Abstract

This disclosure describes systems, methods, and devices related to video encoding using macroblock mode prediction. A device may input features of a macroblock of pixels of a video frame to a logistic regression machine learning model trained to predict an encoding cost of a sub-block of the macroblock; generate, based on a logistic regression using the logistic regression machine learning model and the input features, a value indicating that the sub-block is to be used or not used as a partition for the macroblock; generate, using a decision tree machine learning model, a selection of an intra prediction mode for encoding the video frame, wherein a respective node of the decision tree machine learning model selects either to perform or skip a respective intra prediction mode; select an inter prediction mode or an intra prediction mode based on the value and the selection; and encode the video frame.
Need to check novelty before this filing date? Find Prior Art

Description

ENHANCED MACHINE LEARNING-BASED MACROBLOCK PARTITIONING FOR VIDEO ENCODINGTECHNICAL FIELD

[0001] This disclosure generally relates to systems and methods for video coding and, more particularly, to macroblock partitioning using machine learning.BACKGROUND

[0002] Video encoding allows for compressing video data to be transmitted. Some steps of video encoding can be computationally intensive, such as macroblock mode decisions for inter or intra encoding.BRIEF DESCRIPTION OF THE DRAWINGS

[0003] FIG. 1 is an example block diagram of a x264 encoder with machine learning-based macroblock mode partitioning, according to some example embodiments of the present disclosure.

[0004] FIG. 2 illustrates an example decision tree model used for intra mode macroblock prediction in the machine learning-based macroblock mode prediction of FIG. 1, according to some example embodiments of the present disclosure.

[0005] FIG. 3 is an process of macroblock partition using the x264 encoder of FIG. 1, according to some example embodiments of the present disclosure.

[0006] FIG. 4 illustrates an example flow of a process for the machine learning-based macroblock mode prediction of FIG. 1, according to some example embodiments of the present disclosure.

[0007] FIG. 5 illustrates an embodiment of an exemplary system, in accordance with one or more example embodiments of the present disclosure.DETAILED DESCRIPTION

[0008] The following description and the drawings sufficiently illustrate specific embodiments to enable those skilled in the art to practice them. Other embodiments may incorporate structural, logical, electrical, process, algorithm, and other changes. Portions and features of some embodiments may be included in, or substituted for, those of other embodiments. Embodiments set forth in the claims encompass all available equivalents of those claims.

[0009] The presence of media, such as live streaming, video-on-demand, and video chat, has made video codec technology an essential component. The primary goals of video coding technology continue to center around two key objectives: achieving higher encoding quality with a greater compression ratio, and increasing encoding speed while supporting parallel encoding across multiple channels. These goals allow for better visual experiences and / or reduced bandwidth and hardware costs.

[0010] Currently, the most widely adopted video coding algorithm standards are H264, H265, and AV1, with corresponding encoders such as x264 / openh264, x265 / SVT-HEVC, and SVT-AV1. H. 264 and x264 remain the dominant standard and encoder, especially in live streaming scenarios. The motion estimation process takes up to 60%of the encoding time in H. 264, and the macroblock mode decision in intra / inter is the most computationally intensive process due to the use of features such as variable block size, motion estimation, and quarter-pixel motion compensation. In video coding, intra macroblock prediction refers to predicting the pixels of a macroblock based on pixels belonging to macroblocks surrounding the macroblock and that are already encoded. For example, intra 4x4 mode refers to dividing a macroblock into sixteen sub-blocks of 4x4 pixels, and predicting the sub-blocks independently. Inter macroblock prediction refers to predicting the pixels of a macroblock based on temporal redundancy between video frames.

[0011] To reduce the computational complexity of the mode decision process in H. 264 / H. 265 / H. 266, numerous researchers have proposed various fast mode decision algorithms. Some techniques use the sum of absolute transformed differences (SATD) of reconstructed surrounding pixels and prediction directions to eliminate modes with low probability. Codecs like x264 / x265 have implemented fast mode decision algorithms. However, few attempts have been made to evaluate machine learning algorithms in a product-ready implementation from a speed perspective.

[0012] Most machine learning methods such as support vector machines or deep learning may lead to better classification results, but at the cost of high complexity of applying the method itself during encoding, so they cannot replace the existing fast mode decision algorithms in popular codec implementations, such as x264 and x265. Existing machine learning methods typically select demo encoders as a baseline for comparison, which is not suitable for real-time codec scenarios.

[0013] In one or more embodiments, to advance the speed of modern video codecs, the present disclosure provides a machine-learning-based macroblock partition method that outperforms the sum of absolute differences (SAD) and other cost evaluation methods. After being trained  on different codecs with their block partition strategy, the enhanced method can be applied to various codecs, such as AV1, H. 264, H. 265, and H. 266. The present disclosure leverages machine-learning-based methods to accelerate the time-consuming processing of macroblock prediction in video codecs. The enhanced machine learning-based solution herein may reduce bandwidth requirements while maintaining high video quality.

[0014] In one or more embodiments, an objective of the present disclosure is to provide an AI-based mode decision algorithm within a framework that can replace the block partition mode decision and improve intra / inter prediction used in x264 / x265 encoders. The present disclosure proposes a mode decision approach that combines two machine learning methods (e.g., decision trees and logistic regression) while analyzing the limitations of x264 / x265 fast mode prediction. The present disclosure implements a mode decision system that utilizes the variance score and quantization parameters (QP) among the macro-blocks to model the intra / inter frame prediction mode decision effectively. Specifically, a hierarchical decision tree may be employed for intra mode, and a logistic regression may be employed for inter mode, and the same analysis method can be extended to other codecs implementation such as AV1 / H266 and the like.

[0015] Video encoding represents a significant workload for cloud service providers, for example. The enhanced techniques herein can reduce the encoding time by 22.35%without obvious quality sacrifice when compared to other encoders (e.g., x264) . Machine learning-based algorithms can learn from large datasets of video content to identify patterns and features that result in better video quality. By incorporating this knowledge into the encoding process, a graphics processing unit (GPU) can produce higher quality video with fewer artifacts and distortions, and with faster encoding times.

[0016] In one or more embodiments, through macroblock type and intra / inter prediction information obtained from the video codec tool, the proposed modifications herein should be different than x264 / x265’s output. A performance analysis tool can be used to verify the effectiveness of the modified approach herein by examining any changes in the calculation of the intra / inter prediction part compared to the official version of x264 / x265. The proposed modification herein should achieve faster encoding while maintaining almost the same video quality as x264 / x265.

[0017] Intra prediction is an important aspect of H. 264 / H. 265 / H. 266 encoding. In the x264 / x265 implementation, the encoder first searches for the inter prediction mode for each macroblock, followed by the intra prediction mode. The searching algorithm then examines all candidate modes for each macro-block in both inter and intra prediction modes, selecting  the mode with the smallest cost based on real Rate Distortion (RD) costs for each candidate mode. After analyzing various video data sets, including standard competition videos with different resolutions, frame rates, and bit rates, the number of macroblocks that were chosen as the candidate prediction mode in inter is significantly higher than those that were chosen as the candidate prediction mode in intra. The probability of selecting the intra prediction mode for the current macroblock increases when the intra prediction mode is chosen for all the encoded blocks around the current macro-block. Texture complexity, measured by variance and QP, plays a crucial role in selecting inter and intra prediction modes for the current macro-block. Uncomplicated blocks are more likely to be chosen as inter, while complex blocks tend to be chosen as intra. Therefore, inter prediction may be considered more important than intra prediction. However, the weight of intra prediction should be evaluated and adjusted in the right places to reduce the redundant calculation of the prediction mode search. To achieve this goal, the enhanced techniques herein use a machine learning model to predict the prediction mode of the current coding block before searching the intra prediction mode. Based on the prediction results, the enhanced techniques herein may selectively skip the search of intra prediction mode for some macroblocks.

[0018] In one or more embodiments, for intra prediction, a decision tree model may be trained for this task instead of a neural network because decision trees consist of if-else logic, and the calculation required by the model itself is small, resulting in little additional complexity. The usage of a decision tree model is simple to implement and reduces the complexity of an encoder implementation, which is crucial in reducing the complexity of H. 264 / H. 265 / H. 266 / AV1 encoders implementation.

[0019] In H. 264, intra macroblocks (MBs) can be coded using three different block sizes: Intra 16x16, Intra 4x4, or Intra 8x8, each intra mode is associated with a set of prediction modes, with Intra 16x16 having 4 and Intra 4x4 having 9. The selection of the MB mode typically involves an evaluation of both Intra 16x16 and Intra 4x4 modes, along with their respective prediction modes, before making any decisions. The present disclosure proposes a machine learning-based approach that separates the Intra MB mode and Intra prediction mode decisions. Specifically, the enhanced approach herein first determines the Intra MB mode as either Intra 16x16 or Intra 4x4 without evaluating any prediction modes, and subsequently determines the appropriate prediction modes for the selected MB mode. By eliminating the computation of any prediction modes for the non-selected MB mode, the enhanced approach herein can reduce computational complexity. For example, if the MB mode is determined to be Intra 16x16, there is no need to evaluate any prediction modes for the 4x4 sub-blocks.

[0020] In one or more embodiments, uncompressed video may be encoded with H. 264, and the variance of the means of the sub-blocks may be computed. These values together with the MB mode as determined by a H. 264 encoder may be supplied to a decision tree training framework to obtain a decision tree. The decision may then be used in the encoder instead of the actual mode search code used in x264 encoder. The decision trees may use if-else statements with negligible computational complexity. The nodes of the tree may be the decision trees, and the leaves of the tree may be the final decisions. Each node may perform a binary decision, and additional nodes down in the hierarchy may be used to make further classification, if necessary. The MB modes may be classified into Intra16x16, Intra8x8 and Intra 4x4. After each node, the model may early terminate intra mode or step into the intra mode.

[0021] The inter prediction mode of H. 264 / H. 265 / H. 266 can also benefit from decision tree-based approaches for selecting the best prediction mode for each block of pixels. However, there are certain limitations and challenges that must be considered, including: (1) High complexity: Inter prediction involves predicting the motion vector and prediction mode for each block of pixels, which can lead to a high complexity decision tree. This can result in long encoding times, which can be a significant drawback in real-time applications. (2) Limited generalization: As with intra prediction, decision trees are trained on a specific set of training data, and their accuracy may be limited to the data used in training. This can cause decision tree-based methods to underperform when applied to new, unseen data, leading to suboptimal encoding performance. (3) Difficulty in parameter tuning: Inter prediction involves several parameters, including the motion vector and prediction mode. Deciding on the optimal set of parameters for each block of pixels can be challenging and time-consuming, especially in complex scenes with significant motion.

[0022] Based on those disadvantages and our experiments, the enhanced techniques herein may use a logistic regression model for the inter prediction, which can be described as follows. The present disclosure explores whether certain Rate Distortion Optimization (RDO) evaluations can be terminated for a specific block size at a particular stage during the RDO search using a logistic regression model. To improve the modeling of mode decision, a variance score among the macro-blocks may be calculated and used as a feature in the model. In the inter-frame prediction stage, the cost of all blocks from 16x16 to 4x4 needs to be calculated to select the optimal fast partition method with the smallest cost, known as best_cost.

[0023] The H264 video coding standard employs a full rate-distortion (RD) algorithm to achieve optimal trade-off between the rate and distortion, thereby ensuring superior video  quality. However, in x264, the RD optimization (RDO) algorithm is preferred over the full RD algorithm to minimize computation of certain block sizes. This RDO algorithm provides an approximation to the full RD equation, which facilitates faster encoding while maintaining high video quality. The minimum cost required for the current division may be represented by the best_cost, and the RDO equation implemented by x264 can be expressed as follows: Ri=mv_costi+ref_costi.

[0024] Equation (1) incorporates variables i and n, which respectively represent the current partition type and the total number of partition types. The residualcost is utilized to approximate the degree of distortion, and the mv_costi and ref_costi belong to the rate cost component. Specifically, mv_costi denotes cost used by the encoder to select the best motion vector (MV) for a particular macroblock, while ref_costi refers to the cost of referencing a particular frame during the encoding process. The values of mv_costi ref_costi, and λ are determined by the Quantization Parameter (QP) with mapping tables.

[0025] To optimize the encoding efficiency, x264 prioritizes 16x16 and 8x8 block partitions, using 8x8 to predict the result of 16x8, and then comparing it with 16x16 to determine whether 16x8 and 8x16 calculations are still required. The calculation formula is shown as: pred_costp16x8 =best_costp8x8 - (mv_costp8x8 [1] + mv_costp8x8 [2] )

[0026] In one or more embodiments, the preset “medium” may be used as an experimental example, and the block partition selection corresponding to the medium preset will not choose partitions smaller than 8x8 (e.g., 8x4, 4x8, and 4x4) . Therefore, the enhanced machine learning algorithm herein does not need to cover these cases. Despite the reduction in redundant calculations, there are still several disadvantages to the x264 method: (1) It is inaccurate to directly use the residual cost of four 8*8 blocks as the residual cost of two 16*8 blocks, and it is unreasonable to only use the mv costs of the upper left and lower right 8*8 blocks as the mv cost of 16x8, which ignores the lower left and upper right 8*8 blocks. (2) No prediction for 8*16 blocks and no consideration of ref_cost when predicting 16*8 blocks. (3) The relationship between mv_cost / ref_cost and QP is a threshold table, which may not be sufficiently accurate.

[0027] In one or more embodiments, to address the x264 deficiencies noted above, the enhanced techniques herein may use a logistic regression-based fast partition algorithm that enhances sub-block cost prediction accuracy and reduces redundant calculations, thereby improving encoding speed and quality. Benefits of the regression model may include: (1) It prevents misjudgment and avoids skipping some blocks, thereby achieving better encoding quality in most video codec scenarios; and (2) it reduces redundant calculations, leading to faster encoding speed.

[0028] In one or more embodiments, for the regression model, pred_costp16x8&8x16 may be defined as:  costi=mv_costp8x8 [i] + ref_costp8x8 [i] ,

[0029] where ω is a weight, and b is the respective block.

[0030] The enhancements herein improve the accuracy of the sub-block cost prediction process by utilizing a linear mapping between the motion vector cost (mv_cost) and the reference index cost (ref_cost) with respect to the quantization parameter (QP) , which can be used for better fitting: mv_cost =ωmvQP + bmv   (4) ref_cost =ωrefQP + bref.

[0031] Combining the above Equation (3) and Equation (4) results in: pred_costp16x8&8x16 =ωd1best_costp8x8 -ωr1f (QP) +br1  (5) .

[0032] Similarly, the cost of 8*8 partition can also be inferred by 16*16 partition: pred_costp8x8 =ωd2best_costp16x16 -ωr2f (QP) +br2             (6)

[0033] Based on empirical findings, the pixel variance of the 16x16 block has been identified as a suitable feature to represent the texture complexity, and thus, can aid in deciding whether sub-block partition is necessary. To this end, experimentation with multiple metrics such as mean, variance, variance of means, residual absolute sum, and residual mean, among others led to a selection variance as a feature to be incorporated into the prediction model as equation (7):

[0034] where P is the pixel value of each pixel in the block. Combining the above equations results in a formula to estimate the cost of each sub-block: pred_costp16x8&8x16&p8x8 =ωDbest_costp16x1 +ωVVp16x1 -ωRf (QP) +b (8) .

[0035] By comparing the pred_costp16x8&8x16&pBxB with best_costp16x16 , the model may determine whether further sub-block partition should be attempted:

[0036] The proposed method of solving the sub-block partitioning classification problem may be based on logistic regression. The input features include Vp16x1, QP, best_costp16x1 , and the output label is 0 or 1, indicating whether sub-block partitioning should be attempted.

[0037] In one or more embodiments, the logistic regression algorithm may employ the sigmoid function to transform the input variable to a normalized range of 0-1. During the inference stage, the transformed result is evaluated against a threshold value of 0.5 to determine the need for further classification. Specifically, if the result exceeds 0.5, additional classification is deemed necessary, while results below 0.5 indicate otherwise. Moreover, the sigmoid function's output greater than 0.5 is equivalent to a positive comparison result, and hence serves as a boundary plane for class separation:

[0038] To obtain training data, the 5 million+ samples may be randomly down-sampled to balance the number of positive and negative samples. To keep the compression loss minimal, tests with different pre-processing methods were conducted and identified the optimal pre-processing approach, which involves excluding skip mode macroblocks, increasing the weight of positive data, and balancing the dataset. During the training process, a logistic regression package may be used to systematically traverse various parameter combinations and determine the best hyperparameters through cross-validation. Regularization loss and optimized stop conditions may be applied for better training. In experimentation, the loss function for the training was cross-entropy of the Bernoulli distribution. After training four optimal coefficients were obtained, where a=3.75, b=1 / 256, c=-685, and d=10660:

[0039] According to equation (10) , the threshold may be represented by the following equation: AdaptiveThreshold= (685*QP-3.75*best_costp16x16 -10660) *256

[0040] In the middle of inter16x16 and sub-block partition (8x8 / 16x8 / 8x16) in the current block, the features may be input into the model, which may determine whether sub-block partition should be tried after the judgment result.

[0041] The above descriptions are for purposes of illustration and are not meant to be limiting. Numerous other examples, configurations, processes, algorithms, etc., may exist, some of which are described in greater detail below. Example embodiments will now be described with reference to the accompanying figures.

[0042] FIG. 1 is an example block diagram of a x264 encoder 100 with machine learning-based macroblock mode prediction, according to some example embodiments of the present disclosure.

[0043] Referring to FIG. 1, the x264 encoder 100 receives a video signal 102 (e.g., including video frames) , and partitions 104 the video signal into macroblocks (e.g., a video frame may be partitioned into multiple macroblocks) that may be used in intra / inter prediction 106. The intra / inter prediction 106 may select the best prediction mode for a particular block, typically based on bit-cost and other factors. The intra / inter prediction 106 may select an intra-prediction and / or inter-prediction mode when multiple such modes of each may be available. The intra / inter prediction 106 may include an intra machine learning (ML) model 108 and an inter ML model 110. The prediction output of the intra / inter prediction 106 in the form of a prediction block may be provided both to a subtractor 112 to generate a residual 114, which may be transformed and quantized 116. Transform and quantization 116 may generate and quantize transform units whose coefficients 118 may facilitate encoding by a coder (e.g., entropy coder 120) to generate a bit stream 122 representing the encoded video frames of the video signal 102.

[0044] Still referring to FIG. 1, the coefficients 118 may be used for inverse transform and dequantization 124 to inversely quantize (dequantize) the decoded quantized transform coefficient. A filter (e.g., in-loop filter 126 for resizing / cropping, color conversion, de-interlacing, composition / blending, etc. ) may revise reconstructed frames for use in the intra / inter prediction 106.

[0045] The intra / inter prediction 106 may use the inter ML model 110, which may determine whether to use a sub-block inter prediction based on Equation (11) above, and if so (e.g., if AdaptiveThreshold < Vp16x16) , may select a sub-macroblock mode (e.g., 16x8, 8x16, 8x8) to use in the inter prediction (e.g., the block with the smallest cost: best_cost) . The intra / inter prediction 106 also may use the intra ML model 108 as a decision tree model to select a macroblock intra mode. The intra / inter prediction 106 may select the best mode –inter or intra –for macroblock prediction based on the inter and intra mode macroblocks determined as the best macroblocks by the respective ML models.

[0046] FIG. 2 illustrates an example decision tree model 200 used for intra mode macroblock prediction in the machine learning-based macroblock mode prediction of FIG. 1, according to some example embodiments of the present disclosure.

[0047] The decision tree model 200 may represent the intra ML model 108 of FIG. 1 for intra prediction. The nodes of the decision tree model 200 (e.g., ovals) are the decision trees, and the leaves of the decision tree model 200 (e.g., rectangles) are the final decisions. Each node may make a binary decision, and additional nodes down in the hierarchy are used to make further classification if necessary. For example, node 202 may represent the intra model 16x16, and may decide to skip intra at block 204, or to use intra 16x16 at block 206. The decision tree model 200 may stop after the decision by the node 202, or may continue to node 208, representing the intra model 8x8. The node 208 may decide to skip intra at block 210, or to use intra 8x8 at block 212. The decision tree model 200 may stop after the decision by the node 208, or may continue to node 214, representing the intra model 4x4. The node 214 may decide to skip intra at block 216, or to use intra 4x4 at block 218.

[0048] Referring to FIGs. 1 and 2, when the video signal 102 is compressed by the entropy coder 120, the variance of the means of the sub-blocks are determined, and the variances and macroblock prediction mode may be input to the intra ML model 108 to generate the decision tree model 200.

[0049] The intra mode performance evaluation results are presented in Table 1 below. The the BD-rate (Bjontegaard delta rate) method may be used to evaluate the quality impact of optimization algorithms, and the evaluation was conducted on a dataset consisting of six types of video scenes. As Table 1 shows, by utilizing the enhanced Intra model alone, an average increase of 0.22%in bit rate and a 9.12%improvement in processing speed can be observed:

[0050] Table 1: Intra Model Results for Video Streams

[0051] FIG. 3 is a process 300 of macroblock partition using the x264 encoder of FIG. 1, according to some example embodiments of the present disclosure.

[0052] Referring to FIG. 3, the cost of all blocks from 16x16 to 4x4 may need to be calculated to select the optimal fast partition method with the smallest cost (e.g., best_cost) . FIG. 3 shows this process with a 16x16 block, 16x8 block, 8x16 block, 8x8 block, 8x4 block, 4x8 block, and 4x4 block. The best block partition and MV may be identified using the Equations above.

[0053] To optimize the encoding efficiency, x264 prioritizes 16x16 and 8x8 block partitions, using 8x8 to predict the result of 16x8, and then comparing it with 16x16 to determine whether 16x8 and 8x16 calculations are still required. Equation (2) above provides this calcluation.

[0054] The inter ML model 110 of FIG. 1 uses a prediction cost (pred_cost of Equation (3) above, which can be refined to Equation (8) above) . Comparing the prediction cost to the best_cost, the inter ML model 110 may determine whether further sub-block partitioning should be attempted   The input features to the inter ML model 110 may include V_p16x16, QP, best_cost_ (p16x16 ) , and the output label is 0 or 1, indicating whether sub-block partitioning should be attempted. Equation (11) above results in determining whether further sub-block partitioning should be attempted. The logistic regression algorithm employs the sigmoid function to transform the input variable to a normalized range of 0-1. In the middle of inter16x16 and sub-block partition (8x8 / 16x8 / 8x16) in the current block, features may be input into the inter ML model 110, which may determine whether sub-block partition should be tried after the judgment result.

[0055] The inter mode performance evaluation results are presented in Table 2 below. As Table 2 shows, by utilizing the Inter model alone, an average decrease of 0.15%in bit rate and a 13.5%improvement in processing speed can be observed.

[0056] Table 2: Inter Model Results for Video Streams

[0057] FIG. 4 illustrates an example flow of a process 400 for the machine learning-based macroblock mode prediction of FIG. 1, according to some example embodiments of the present disclosure.

[0058] At block 402, the intra / inter prediction 106 (or another intra / inter prediction for a different type of encoder) may make a spatial skip decision of whether or not to skip the prediction mode search for some macroblocks. When the skip decision is to skip the prediction at block 404, the process 400 may proceed to block 406, where the best macroblock prediction mode is to skip the prediction. When the skip decision is not to skip the prediction at block 404, the process 400 may continue to block 408, where the encoder may select a macroblock inter mode (e.g., 16x16) . At block 410, the intra / inter prediction may make a cost skip decision regarding whether to skip the cost analysis between the 16x16 inter mode and a sub-block inter mode. When the decision is to skip the prediction at block 412, the process 400 may continue to block 406. When the decision is not to skip the prediction at block 412, the process 400 may continue to block 414, where the 8x8 inter mode may be selected for sub-block comparison.

[0059] At block 416, the coder may determine whether the predicted cost (e.g., 16x8) is greater than the 16x16 cost to determine whether further sub-block partitioning should be attempted. When the predicted cost is not greater than the 16x16 cost at block 416, the process 400 may continue to block 418, where the coder may select a sub-block inter mode (e.g., 16x8, 8x16) . When the predicted cost is greater than the 16x16 cost at block 416, the process 400 may continue to block 420, where the coder may select a macroblock intra mode (e.g., 16x16, 4x4) , such as by using the decision tree model 200 of FIG. 2.

[0060] At block 422, the coder may determine whether to use inter or intra mode for macroblock prediction. Inter mode may be used at block 424 to use the best macroblock from the inter mode prediction, and intra mode may be used at block 426 to use the best macroblock from the intra mode prediction. The macroblock analysis may end at block 428.

[0061] In the middle of inter16x16 and sub-block partition (8x8 / 16x8 / 8x16) in the current block, features may be input into the inter ML model 110, which may determine whether sub-block partition should be tried after the judgment result. For example, blocks 414-418 may be replaced with blocks 450-458. At block 450, an AI-based decision using the inter ML model 110 may begin, and by solving Equation (11) above, the inter ML model 110 may determine whether to try a sub-block inter model at block 452. If sub-block inter model is to be used at block 456, the process 400 may continue to block 456 for selection of a sub-block inter mode (e.g., 16x8, 8x16, 8x8) . When no sub-block inter mode is used at block 456, or after the sub-block inter mode is used at block 456, the process 400 may continue to block 458, where the AI-based macroblock decision may end (e.g., for the inter ML model 110) .

[0062] In this manner, process 400 combines the intra ML model 108 and the inter ML model 110 for macroblock prediction.

[0063] Table 3 below represents the conclusive outcome of our proposed machine learning based fast mode Decision. The evaluation was conducted on a dataset consisting of six types of video scenes, each with 20 videos of different resolutions (4k / 1080P / 720P / 360P) and frame rates (120 / 60 / 30 / 24) . The experimental results indicate that the proposed approach significantly reduces the encoding time across all scenes while maintaining the video quality. By exclusively utilizing both intra-and inter-model, an average increase of 0.39%in bit rate and a 22.35%improvement in processing speed can be observed:

[0064] Table 3: Inter and Intra Model Results for Video Streams

[0065] As used herein, the term “coder” may refer to an encoder and / or a decoder. Similarly, as used herein, the term “coding” may refer to encoding via an encoder and / or decoding via a decoder. A coder, encoder, or decoder may have components of both an encoder and decoder. An encoder may have a decoder loop as described below.

[0066] For example, the x264 encoder 100 of FIG. 1 may be an encoder where current video information in the form of data related to a sequence of video frames may be received to be compressed. By one form, a video sequence is formed of input frames of synthetic screen content such as from, or for, business applications such as word processors, power points, or spread sheets, computers, video games, virtual reality images, and so forth. By other forms, the images may be formed of a combination of synthetic screen content and natural camera captured images. By yet another form, the video sequence only may be natural camera captured video. A partitioner may partition each frame into smaller more manageable units, and then compare the frames to compute a prediction. If a difference or residual is determined between an original block and prediction, that resulting residual is transformed and quantized, and then entropy encoded and transmitted in a bitstream, along with reconstructed frames, out to decoders or storage. To perform these operations, the x264 encoder 100 may receive an input frame from the video signal 102. The input frames may be frames sufficiently pre-processed for encoding.

[0067] The x264 encoder 100 also may manage many encoding aspects including at least the setting of a quantization parameter (QP) but could also include setting bitrate, rate distortion or scene characteristics, prediction and / or transform partition or block sizes, available prediction mode types, and best mode selection parameters to name a few examples.

[0068] The output of the transformed and quantized data may be provided to an inverse transform and quantization to generate the same reference or reconstructed blocks, frames, or other units as would be generated at a decoder. Thus, the prediction unit may use the inverse transform and quantization, adder, and filter to reconstruct the frames.

[0069] The prediction output of the prediction unit in the form of a prediction block may be provided both to the subtractor 112 to generate a residual, and in the decoding loop to an adder to add the prediction to the reconstructed residual from the inverse transform to reconstruct a frame.

[0070] The partitioner 104 or other initial units not shown may place frames in order for encoding and assign classifications to the frames, such as I-frame, B-frame, P-frame and so forth, where I-frames are intra-predicted. Otherwise, frames may be divided into slices (such as an I-slice) where each slice may be predicted differently.

[0071] The prediction unit may select previously decoded reference blocks. Then comparisons may be performed to determine if any of the reference blocks match a current block being reconstructed. Once a match is found with a reference block, the prediction unit may use the image data of the one or more matching reference blocks to select a prediction mode. By one form, previously reconstructed image data of the reference block is provided as the prediction, but alternatively, the original pixel image data of the reference block could be provided as the prediction instead. Either choice may be used regardless of the type of image data that was used to match the blocks.

[0072] The predicted block then may be subtracted at the subtractor 112 from the current block of original image data, and the resulting residual 114 may be partitioned into one or more transform blocks (TUs) so that the transform and quantization 116 can transform the divided residual data into transform coefficients 118 using discrete cosine transform (DCT) for example. Using the quantization parameter (QP) set by the x264 encoder 100, the transform and quantization 116 then uses lossy resampling or quantization on the coefficients 118. The frames and residuals along with supporting or context data block size and intra displacement vectors and so forth may be entropy encoded by the entropy coder 120 and transmitted to decoders.

[0073] In one or more embodiments, the coded data (e.g., the bit stream 122) may include both video and audio data.

[0074] It is understood that the above descriptions are for purposes of illustration and are not meant to be limiting.

[0075] FIG. 5 illustrates an embodiment of an exemplary system 500, in accordance with one or more example embodiments of the present disclosure.

[0076] In various embodiments, the computing system 500 may comprise or be implemented as part of an electronic device.

[0077] In some embodiments, the computing system 500 may be representative, for example, of a computer system that implements one or more components of FIG. 1.

[0078] The embodiments are not limited in this context. More generally, the computing system 500 is configured to implement all logic, systems, processes, logic flows, methods, equations, apparatuses, and functionality described herein and with reference to FIGS. 1-4.

[0079] The system 500 may be a computer system with multiple processor cores such as a distributed computing system, supercomputer, high-performance computing system, computing cluster, mainframe computer, mini-computer, client-server system, personal computer (PC) , workstation, server, portable computer, laptop computer, tablet computer, a handheld device such as a personal digital assistant (PDA) , or other devices for processing, displaying, or transmitting information. Similar embodiments may comprise, e.g., entertainment devices such as a portable music player or a portable video player, a smart phone or other cellular phones, a telephone, a digital video camera, a digital still camera, an external storage device, or the like. Further embodiments implement larger scale server configurations. In other embodiments, the system 500 may have a single processor with one core or more than one processor. Note that the term “processor” refers to a processor with a single core or a processor package with multiple processor cores.

[0080] As used in this application, the terms “system” and “component” and “module” are intended to refer to a computer-related entity, either hardware, a combination of hardware and software, software, or software in execution, examples of which are provided by the exemplary system 500. For example, a component can be, but is not limited to being, a process running on a processor, a processor, a hard disk drive, multiple storage drives (of optical and / or magnetic storage medium) , an object, an executable, a thread of execution, a program, and / or a computer.

[0081] By way of illustration, both an application running on a server and the server can be a component. One or more components can reside within a process and / or thread of execution,  and a component can be localized on one computer and / or distributed between two or more computers. Further, components may be communicatively coupled to each other by various types of communications media to coordinate operations. The coordination may involve the uni-directional or bi-directional exchange of information. For instance, the components may communicate information in the form of signals communicated over the communications media. The information can be implemented as signals allocated to various signal lines. In such allocations, each message is a signal. Further embodiments, however, may alternatively employ data messages. Such data messages may be sent across various connections. Exemplary connections include parallel interfaces, serial interfaces, and bus interfaces.

[0082] As shown in this figure, system 500 comprises a motherboard 505 for mounting platform components. The motherboard 505 is a point-to-point interconnect platform that includes a processor 510, a processor 530 coupled via a point-to-point interconnects as an Ultra Path Interconnect (UPI) , and an encoder device 519 (e.g., capable of performing the functions of FIGs. 1-4) . In other embodiments, the system 500 may be of another bus architecture, such as a multi-drop bus. Furthermore, each of processors 510 and 530 may be processor packages with multiple processor cores. As an example, processors 510 and 530 are shown to include processor core (s) 520 and 540, respectively. While the system 500 is an example of a two-socket (2S) platform, other embodiments may include more than two sockets or one socket. For example, some embodiments may include a four-socket (4S) platform or an eight-socket (8S) platform. Each socket is a mount for a processor and may have a socket identifier. Note that the term platform refers to the motherboard with certain components mounted such as the processors 510 and the chipset 560. Some platforms may include additional components and some platforms may only include sockets to mount the processors and / or the chipset.

[0083] The processors 510 and 530 can be any of various commercially available processors, including without limitation an Core (2)  and processors;  and processors;  application, embedded and secure processors;  and and processors; IBM and Cell processors; and similar processors. Dual microprocessors, multi-core processors, and other multi-processor architectures may also be employed as the processors 510, and 530.

[0084] The processor 510 includes an integrated memory controller (IMC) 514 and point-to-point (P-P) interfaces 518 and 552. Similarly, the processor 530 includes an IMC 534 and P-P interfaces 538 and 554. The IMC’s 514 and 534 couple the processors 510 and 530, respectively, to respective memories, a memory 512 and a memory 532. The memories 512  and 532 may be portions of the main memory (e.g., a dynamic random-access memory (DRAM) ) for the platform such as double data rate type 3 (DDR3) or type 4 (DDR4) synchronous DRAM (SDRAM) . In the present embodiment, the memories 512 and 532 locally attach to the respective processors 510 and 530.

[0085] In addition to the processors 510 and 530, the system 500 may include the encoder device 519, which may represent the x264 encoder 100 of FIG. 1 or another type of encoder using inter / intra macroblock mode prediction. The encoder device 519 may be connected to chipset 560 by means of P-P interfaces 529 and 569. The encoder device 519 may also be connected to a memory 539. In some embodiments, the encoder device 519 may be connected to at least one of the processors 510 and 530. In other embodiments, the memories 512, 532, and 539 may couple with the processor 510 and 530, and the encoder device 519 via a bus and shared memory hub.

[0086] System 500 includes chipset 560 coupled to processors 510 and 530. Furthermore, chipset 560 can be coupled to storage medium 503, for example, via an interface (I / F) 566. The I / F 566 may be, for example, a Peripheral Component Interconnect-enhanced (PCI-e) . The processors 510, 530, and the encoder device 519 may access the storage medium 503 through chipset 560.

[0087] Storage medium 503 may comprise any non-transitory computer-readable storage medium or machine-readable storage medium, such as an optical, magnetic or semiconductor storage medium. In various embodiments, storage medium 503 may comprise an article of manufacture. In some embodiments, storage medium 503 may store computer-executable instructions, such as computer-executable instructions 502 to implement one or more of processes or operations described herein, (e.g., process 400 of FIG. 4) . The storage medium 503 may store computer-executable instructions for any equations depicted above. The storage medium 503 may further store computer-executable instructions for models and / or networks described herein, such as a neural network or the like. Examples of a computer-readable storage medium or machine-readable storage medium may include any tangible media capable of storing electronic data, including volatile memory or non-volatile memory, removable or non-removable memory, erasable or non-erasable memory, writeable or re-writeable memory, and so forth. Examples of computer-executable instructions may include any suitable types of code, such as source code, compiled code, interpreted code, executable code, static code, dynamic code, object-oriented code, visual code, and the like. It should be understood that the embodiments are not limited in this context.

[0088] The processor 510 couples to a chipset 560 via P-P interfaces 552 and 562 and the processor 530 couples to a chipset 560 via P-P interfaces 554 and 564. Direct Media Interfaces (DMIs) may couple the P-P interfaces 552 and 562 and the P-P interfaces 554 and 564, respectively. The DMI may be a high-speed interconnect that facilitates, e.g., eight Giga Transfers per second (GT / s) such as DMI 3.0. In other embodiments, the processors 510 and 530 may interconnect via a bus.

[0089] The chipset 560 may comprise a controller hub such as a platform controller hub (PCH) . The chipset 560 may include a system clock to perform clocking functions and include interfaces for an I / O bus such as a universal serial bus (USB) , peripheral component interconnects (PCIs) , serial peripheral interconnects (SPIs) , integrated interconnects (I2Cs) , and the like, to facilitate connection of peripheral devices on the platform. In other embodiments, the chipset 560 may comprise more than one controller hub such as a chipset with a memory controller hub, a graphics controller hub, and an input / output (I / O) controller hub.

[0090] In the present embodiment, the chipset 560 couples with a trusted platform module (TPM) 572 and the UEFI, BIOS, Flash component 574 via an interface (I / F) 570. The TPM 572 is a dedicated microcontroller designed to secure hardware by integrating cryptographic keys into devices. The UEFI, BIOS, Flash component 574 may provide pre-boot code.

[0091] Furthermore, chipset 560 includes the I / F 566 to couple chipset 560 with a high-performance graphics engine, a graphics card 565 (e.g., which may include the x264 encoder 100 of FIG. 1 or another encoder with inter / intra macroblock mode prediction) . In other embodiments, the system 500 may include a flexible display interface (FDI) between the processors 510 and 530 and the chipset 560. The FDI interconnects a graphics processor core in a processor with the chipset 560.

[0092] Various I / O devices 592 couple to the bus 581, along with a bus bridge 580 which couples the bus 581 to a second bus 591 and an I / F 868 that connects the bus 581 with the chipset 560. In one embodiment, the second bus 591 may be a low pin count (LPC) bus. Various devices may couple to the second bus 591 including, for example, a keyboard 582, a mouse 584, communication devices 586, a storage medium 501, and an audio I / O 590.

[0093] The artificial intelligence (AI) accelerator 567 may be circuitry arranged to perform computations related to AI. The AI accelerator 567 may be connected to storage medium 503 and chipset 560. The AI accelerator 567 may deliver the processing power and energy efficiency needed to enable abundant-data computing. The AI accelerator 567 is a class of specialized hardware accelerators or computer systems designed to accelerate artificial  intelligence and machine learning applications, including artificial neural networks and machine vision. The AI accelerator 567 may be applicable to algorithms for robotics, internet of things, other data-intensive and / or sensor-driven tasks.

[0094] Many of the I / O devices 592, communication devices 586, and the storage medium 501 may reside on the motherboard 505 while the keyboard 582 and the mouse 584 may be add-on peripherals. In other embodiments, some or all the I / O devices 592, communication devices 586, and the storage medium 501 are add-on peripherals and do not reside on the motherboard 505.

[0095] Some examples may be described using the expression “in one example” or “an example” along with their derivatives. These terms mean that a particular feature, structure, or characteristic described in connection with the example is included in at least one example. The appearances of the phrase “in one example” in various places in the specification are not necessarily all referring to the same example.

[0096] Some examples may be described using the expression “coupled” and “connected” along with their derivatives. These terms are not necessarily intended as synonyms for each other. For example, descriptions using the terms “connected” and / or “coupled” may indicate that two or more elements are in direct physical or electrical contact with each other. The term “coupled, ” however, may also mean that two or more elements are not in direct contact with each other, yet still co-operate or interact with each other.

[0097] In addition, in the foregoing Detailed Description, various features are grouped together in a single example to streamline the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed examples require more features than are expressly recited in each claim. Rather, as the following claims reflect, the inventive subject matter lies in less than all features of a single disclosed example. Thus, the following claims are hereby incorporated into the Detailed Description, with each claim standing on its own as a separate example. In the appended claims, the terms “including” and “in which” are used as the plain-English equivalents of the respective terms “comprising” and “wherein, ” respectively. Moreover, the terms “first, ” “second, ” “third, ” and so forth, are used merely as labels and are not intended to impose numerical requirements on their objects.

[0098] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

[0099] A data processing system suitable for storing and / or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories that provide temporary storage of at least some program code to reduce the number of times code must be retrieved from bulk storage during execution. The term “code” covers a broad range of software components and constructs, including applications, drivers, processes, routines, methods, modules, firmware, microcode, and subprograms. Thus, the term “code” may be used to refer to any collection of instructions that, when executed by a processing system, perform a desired operation or operations.

[0100] Logic circuitry, devices, and interfaces herein described may perform functions implemented in hardware and implemented with code executed on one or more processors. Logic circuitry refers to the hardware or the hardware and code that implements one or more logical functions. Circuitry is hardware and may refer to one or more circuits. Each circuit may perform a particular function. A circuit of the circuitry may comprise discrete electrical components interconnected with one or more conductors, an integrated circuit, a chip package, a chipset, memory, or the like. Integrated circuits include circuits created on a substrate such as a silicon wafer and may comprise components. Integrated circuits, processor packages, chip packages, and chipsets may comprise one or more processors.

[0101] Processors may receive signals such as instructions and / or data at the input (s) and process the signals to generate at least one output. While executing code, the code changes the physical states and characteristics of transistors that make up a processor pipeline. The physical states of the transistors translate into logical bits of ones and zeros stored in registers within the processor. The processor can transfer the physical states of the transistors into registers and transfer the physical states of the transistors to another storage medium.

[0102] A processor may comprise circuits to perform one or more sub-functions implemented to perform the overall function of the processor. One example of a processor is a state machine or an application-specific integrated circuit (ASIC) that includes at least one input and at least one output. A state machine may manipulate the at least one input to generate the at least one output by performing a predetermined series of serial and / or parallel manipulations or transformations on the at least one input.

[0103] The logic as described above may be part of the design for an integrated circuit chip. The chip design is created in a graphical computer programming language, and stored in a computer storage medium or data storage medium (such as a disk, tape, physical hard drive, or  virtual hard drive such as in a storage access network) . If the designer does not fabricate chips or the photolithographic masks used to fabricate chips, the designer transmits the resulting design by physical means (e.g., by providing a copy of the storage medium storing the design) or electronically (e.g., through the Internet) to such entities, directly or indirectly. The stored design is then converted into the appropriate format (e.g., GDSII) for the fabrication.

[0104] The resulting integrated circuit chips can be distributed by the fabricator in raw wafer form (that is, as a single wafer that has multiple unpackaged chips) , as a bare die, or in a packaged form. In the latter case, the chip is mounted in a single chip package (such as a plastic carrier, with leads that are affixed to a motherboard or other higher-level carrier) or in a multichip package (such as a ceramic carrier that has either or both surface interconnections or buried interconnections) . In any case, the chip is then integrated with other chips, discrete circuit elements, and / or other signal processing devices as part of either (a) an intermediate product, such as a processor board, a server platform, or a motherboard, or (b) an end product.

[0105] The word “exemplary” is used herein to mean “serving as an example, instance, or illustration. ” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments. The terms “computing device, ” “user device, ” “communication station, ” “station, ” “handheld device, ” “mobile device, ” “wireless device” and “user equipment” (UE) as used herein refers to a wireless communication device such as a cellular telephone, a smartphone, a tablet, a netbook, a wireless terminal, a laptop computer, a femtocell, a high data rate (HDR) subscriber station, an access point, a printer, a point of sale device, an access terminal, or other personal communication system (PCS) device. The device may be either mobile or stationary.

[0106] As used within this document, the term “communicate” is intended to include transmitting, or receiving, or both transmitting and receiving. This may be particularly useful in claims when describing the organization of data that is being transmitted by one device and received by another, but only the functionality of one of those devices is required to infringe the claim. Similarly, the bidirectional exchange of data between two devices (both devices transmit and receive during the exchange) may be described as “communicating, ” when only the functionality of one of those devices is being claimed. The term “communicating” as used herein with respect to a wireless communication signal includes transmitting the wireless communication signal and / or receiving the wireless communication signal. For example, a wireless communication unit, which is capable of communicating a wireless communication signal, may include a wireless transmitter to transmit the wireless communication signal to at  least one other wireless communication unit, and / or a wireless communication receiver to receive the wireless communication signal from at least one other wireless communication unit.

[0107] As used herein, unless otherwise specified, the use of the ordinal adjectives “first, ” “second, ” “third, ” etc., to describe a common object, merely indicates that different instances of like objects are being referred to and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.

[0108] Some embodiments may be used in conjunction with various devices and systems, for example, a personal computer (PC) , a desktop computer, a mobile computer, a laptop computer, a notebook computer, a tablet computer, a server computer, a handheld computer, a handheld device, a personal digital assistant (PDA) device, a handheld PDA device, an on-board device, an off-board device, a hybrid device, a vehicular device, a non-vehicular device, a mobile or portable device, a consumer device, a non-mobile or non-portable device, a wireless communication station, a wireless communication device, a wireless access point (AP) , a wired or wireless router, a wired or wireless modem, a video device, an audio device, an audio-video (A / V) device, a wired or wireless network, a wireless area network, a wireless video area network (WVAN) , a local area network (LAN) , a wireless LAN (WLAN) , a personal area network (PAN) , a wireless PAN (WPAN) , and the like.

[0109] Some embodiments may be used in conjunction with one way and / or two-way radio communication systems, cellular radio-telephone communication systems, a mobile phone, a cellular telephone, a wireless telephone, a personal communication system (PCS) device, a PDA device which incorporates a wireless communication device, a mobile or portable global positioning system (GPS) device, a device which incorporates a GPS receiver or transceiver or chip, a device which incorporates an RFID element or chip, a multiple input multiple output (MIMO) transceiver or device, a single input multiple output (SIMO) transceiver or device, a multiple input single output (MISO) transceiver or device, a device having one or more internal antennas and / or external antennas, digital video broadcast (DVB) devices or systems, multi-standard radio devices or systems, a wired or wireless handheld device, e.g., a smartphone, a wireless application protocol (WAP) device, or the like.

[0110] Some embodiments may be used in conjunction with one or more types of wireless communication signals and / or systems following one or more wireless communication protocols, for example, radio frequency (RF) , infrared (IR) , frequency-division multiplexing (FDM) , orthogonal FDM (OFDM) , time-division multiplexing (TDM) , time-division multiple access (TDMA) , extended TDMA (E-TDMA) , general packet radio service (GPRS) , extended GPRS, code-division multiple access (CDMA) , wideband CDMA (WCDMA) , CDMA 2000,  single-carrier CDMA, multi-carrier CDMA, multi-carrier modulation (MDM) , discrete multi-tone (DMT) ,  global positioning system (GPS) , Wi-Fi, Wi-Max, ZigBee, ultra-wideband (UWB) , global system for mobile communications (GSM) , 2G, 2.5G, 3G, 3.5G, 4G, fifth generation (5G) mobile networks, 3GPP, long term evolution (LTE) , LTE advanced, enhanced data rates for GSM Evolution (EDGE) , or the like. Other embodiments may be used in various other devices, systems, and / or networks.

[0111] The following examples pertain to further embodiments.

[0112] Example 1 may include an apparatus for encoding video data using macroblock mode prediction, the apparatus comprising graphics processing circuitry coupled to memory, the graphics processing circuitry configured to: input features of a macroblock of pixels of a video frame to a logistic regression machine learning model trained to predict an encoding cost of a sub-block of the macroblock; generate, based on a logistic regression using the logistic regression machine learning model and the input features, a value indicating that the sub-block is to be used or not used as a partition for the macroblock; generate, using a decision tree machine learning model, a selection of an intra prediction mode for encoding the video frame, wherein a respective node of the decision tree machine learning model selects either to perform or skip a respective intra prediction mode; select an inter prediction mode or an intra prediction mode based on the value and the selection; and encode the video frame, based on the selected inter prediction mode or intra prediction mode, for a bitstream.

[0113] Example 2 may include the apparatus of example 1 and / or any other example herein, wherein the graphics processing circuitry is further configured to: generate, based on rate distortion, a best encoding cost estimate for the macroblock, using the logistic regression machine learning model; and generate, based on the best encoding cost and quantization parameters, an adaptive threshold using the logistic regression machine learning model, wherein to generate the value is based on a comparison of the adaptive threshold to a pixel variance associated with the macroblock, and wherein the features comprise the pixel variance.

[0114] Example 3 may include the apparatus of example 2 and / or any other example herein, wherein the best encoding cost is a minimum of a sum of a residual encoding cost associated with the macroblock and a sum of a motion vector encoding cost associated with the macroblock and a reference encoding cost associated with the macroblock.

[0115] Example 4 may include the apparatus of example 2 and / or any other examples herein, wherein the graphics processing circuitry is further configured to: generate, using the logistic regression machine learning model, a predicted encoding cost of using the sub-block as the  partition, based on a sum of a first motion vector cost of a first sub-block of the sub-block and a second motion vector cost of a second sub-block of the sub-block, subtracted from a best encoding cost estimate of the first sub-block or the second sub-block.

[0116] Example 5 may include the apparatus of any of examples 1-4 and / or any other example herein, wherein the value indicates that the sub-block is not to be used as the partition for the macroblock, and wherein the graphics processing circuitry is further configured to: select the macroblock for the inter prediction mode.

[0117] Example 6 may include the apparatus of any of examples 1-4 and / or any other example herein, wherein the value indicates that the sub-block is to be used as the partition for the macroblock, and wherein the graphics processing circuitry is further configured to: select the sub-block for the inter prediction mode.

[0118] Example 7 may include the apparatus of any of examples 1-4 and / or any other examples herein, wherein the macroblock is 16x16 pixels, and wherein the sub-block is 16x8 pixels, 8x16 pixels, or 8x8 pixels.

[0119] Example 8 may include the apparatus of any of examples 1-4 and / or any other example herein, wherein the features are input to the logistic regression machine learning model during an inter prediction mode of the macroblock.

[0120] Example 9 may include the apparatus of any of examples 1-4 and / or any other examples herein, wherein the graphics processing circuitry is further configured to: determine, using the decision tree machine learning model, to perform a 16x16 intra prediction mode or skip the 16x16 intra prediction mode at a first node; determine, using the decision tree machine learning model, to perform a 8x8 intra prediction mode or skip the 8x8 intra prediction mode at a second node; and determine, using the decision tree machine learning model, to perform a 4x4 intra prediction mode or skip the 4x4 intra prediction mode at a third node.

[0121] Example 10 may include a computer-readable storage medium comprising instructions to cause graphics processing circuitry of a device for encoding video data encoded using macroblock mode prediction, upon execution of the instructions by the graphics processing circuitry, to: input features of a macroblock of pixels of a video frame to a logistic regression machine learning model trained to predict an encoding cost of a sub-block of the macroblock; generate, based on a logistic regression using the logistic regression machine learning model and the input features, a value indicating that the sub-block is to be used or not used as a partition for the macroblock; generate, using a decision tree machine learning model, a selection of an intra prediction mode for encoding the video frame, wherein a respective node of the decision tree machine learning model selects either to perform or skip a respective intra  prediction mode; select an inter prediction mode or an intra prediction mode based on the value and the selection; and encode the video frame, based on the selected inter prediction mode or intra prediction mode, for a bitstream.

[0122] Example 11 may include the computer-readable storage medium of example 10 and / or any other examples herein, wherein execution of the instructions further causes the graphics processing circuitry to: generate, based on rate distortion, a best encoding cost estimate for the macroblock, using the logistic regression machine learning model; and generate, based on the best encoding cost and quantization parameters, an adaptive threshold using the logistic regression machine learning model, wherein to generate the value is based on a comparison of the adaptive threshold to a pixel variance associated with the macroblock, and wherein the features comprise the pixel variance.

[0123] Example 12 may include the computer-readable storage medium of example 11 and / or any other example herein, wherein the best encoding cost is a minimum of a sum of a residual encoding cost associated with the macroblock and a sum of a motion vector encoding cost associated with the macroblock and a reference encoding cost associated with the macroblock.

[0124] Example 13 may include the computer-readable storage medium of example 11 and / or any other examples herein, wherein execution of the instructions further causes the graphics processing circuitry to: generate, using the logistic regression machine learning model, a predicted encoding cost of using the sub-block as the partition, based on a sum of a first motion vector cost of a first sub-block of the sub-block and a second motion vector cost of a second sub-block of the sub-block, subtracted from a best encoding cost estimate of the first sub-block or the second sub-block.

[0125] Example 14 may include the computer-readable storage medium of any of examples 10-13 and / or any other example herein, wherein the value indicates that the sub-block is not to be used as the partition for the macroblock, and wherein execution of the instructions further causes the graphics processing circuitry to: select the macroblock for the inter prediction mode.

[0126] Example 15 may include the computer-readable storage medium of any of examples 10-13 and / or any other example herein, wherein the value indicates that the sub-block is to be used as the partition for the macroblock, and wherein execution of the instructions further causes the graphics processing circuitry to: select the sub-block for the inter prediction mode.

[0127] Example 16 may include the computer-readable storage medium of any of examples 10-13 and / or any other example herein, wherein the macroblock is 16x16 pixels, and wherein the sub-block is 16x8 pixels, 8x16 pixels, or 8x8 pixels.

[0128] Example 17 may include the computer-readable storage medium of any of examples 10-13 and / or any other example herein, wherein the features are input to the logistic regression machine learning model during an inter prediction mode of the macroblock.

[0129] Example 18 may include the computer-readable storage medium of any of examples 10-13 and / or any other example herein, wherein the graphics processing circuitry is further configured to: determine, using the decision tree machine learning model, to perform a 16x16 intra prediction mode or skip the 16x16 intra prediction mode at a first node; determine, using the decision tree machine learning model, to perform a 8x8 intra prediction mode or skip the 8x8 intra prediction mode at a second node; and determine, using the decision tree machine learning model, to perform a 4x4 intra prediction mode or skip the 4x4 intra prediction mode at a third node.

[0130] Example 19 may include a method for encoding video data encoded using macroblock mode prediction, the method comprising: inputting, by graphics processing circuitry, features of a macroblock of pixels of a video frame to a logistic regression machine learning model trained to predict an encoding cost of a sub-block of the macroblock; generating, by the graphics processing circuitry, based on a logistic regression using the logistic regression machine learning model and the input features, a value indicating that the sub-block is to be used or not used as a partition for the macroblock; generating, by the graphics processing circuitry, using a decision tree machine learning model, a selection of an intra prediction mode for encoding the video frame, wherein a respective node of the decision tree machine learning model selects either to perform or skip a respective intra prediction mode; selecting, by the graphics processing circuitry, an inter prediction mode or an intra prediction mode based on the value and the selection; and encoding, by the graphics processing circuitry, the video frame, based on the selected inter prediction mode or intra prediction mode, for a bitstream.

[0131] Example 20 may include the method of example 19 and / or any other example herein, further comprising: generating, based on rate distortion, a best encoding cost estimate for the macroblock, using the logistic regression machine learning model; and generating, based on the best encoding cost and quantization parameters, an adaptive threshold using the logistic regression machine learning model, wherein generating the value is based on a comparison of the adaptive threshold to a pixel variance associated with the macroblock, and wherein the features comprise the pixel variance.

[0132] Example 21 may include the method of example 20 and / or any other example herein, wherein the best encoding cost is a minimum of a sum of a residual encoding cost associated  with the macroblock and a sum of a motion vector encoding cost associated with the macroblock and a reference encoding cost associated with the macroblock.

[0133] Example 22 may include the method of example 20 and / or any other example herein, further comprising: generating, using the logistic regression machine learning model, a predicted encoding cost of using the sub-block as the partition, based on a sum of a first motion vector cost of a first sub-block of the sub-block and a second motion vector cost of a second sub-block of the sub-block, subtracted from a best encoding cost estimate of the first sub-block or the second sub-block.

[0134] Example 23 may include the method of any of examples 19-22 and / or any other example herein, wherein the value indicates that the sub-block is not to be used as the partition for the macroblock, the method further comprising: selecting the macroblock for the inter prediction mode.

[0135] Example 24 may include the method of any of examples 19-22 and / or any other examples herein, wherein the value indicates that the sub-block is to be used as the partition for the macroblock, the method further comprising: selecting the sub-block for the inter prediction mode.

[0136] Example 25 may include an apparatus comprising means for: inputting features of a macroblock of pixels of a video frame to a logistic regression machine learning model trained to predict an encoding cost of a sub-block of the macroblock; generating, based on a logistic regression using the logistic regression machine learning model and the input features, a value indicating that the sub-block is to be used or not used as a partition for the macroblock; generating, using a decision tree machine learning model, a selection of an intra prediction mode for encoding the video frame, wherein a respective node of the decision tree machine learning model selects either to perform or skip a respective intra prediction mode; selecting an inter prediction mode or an intra prediction mode based on the value and the selection; and encoding the video frame, based on the selected inter prediction mode or intra prediction mode, for a bitstream.

[0137] Embodiments according to the disclosure are in particular disclosed in the attached claims directed to a method, a storage medium, a device and a computer program product, wherein any feature mentioned in one claim category, e.g., method, can be claimed in another claim category, e.g., system, as well. The dependencies or references back in the attached claims are chosen for formal reasons only. However, any subject matter resulting from a deliberate reference back to any previous claims (in particular multiple dependencies) can be claimed as well, so that any combination of claims and the features thereof are disclosed  and can be claimed regardless of the dependencies chosen in the attached claims. The subject-matter which can be claimed comprises not only the combinations of features as set out in the attached claims but also any other combination of features in the claims, wherein each feature mentioned in the claims can be combined with any other feature or combination of other features in the claims. Furthermore, any of the embodiments and features described or depicted herein can be claimed in a separate claim and / or in any combination with any embodiment or feature described or depicted herein or with any of the features of the attached claims.

[0138] The foregoing description of one or more implementations provides illustration and description, but is not intended to be exhaustive or to limit the scope of embodiments to the precise form disclosed. Modifications and variations are possible in light of the above teachings or may be acquired from practice of various embodiments.

[0139] Certain aspects of the disclosure are described above with reference to block and flow diagrams of systems, methods, apparatuses, and / or computer program products according to various implementations. It will be understood that one or more blocks of the block diagrams and flow diagrams, and combinations of blocks in the block diagrams and the flow diagrams, respectively, may be implemented by computer-executable program instructions. Likewise, some blocks of the block diagrams and flow diagrams may not necessarily need to be performed in the order presented, or may not necessarily need to be performed at all, according to some implementations.

[0140] These computer-executable program instructions may be loaded onto a special-purpose computer or other particular machine, a processor, or other programmable data processing apparatus to produce a particular machine, such that the instructions that execute on the computer, processor, or other programmable data processing apparatus create means for implementing one or more functions specified in the flow diagram block or blocks. These computer program instructions may also be stored in a computer-readable storage media or memory that may direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable storage media produce an article of manufacture including instruction means that implement one or more functions specified in the flow diagram block or blocks. As an example, certain implementations may provide for a computer program product, comprising a computer-readable storage medium having a computer-readable program code or program instructions implemented therein, said computer-readable program code adapted to be executed to implement one or more functions specified in the flow diagram block or blocks. The computer program instructions may also be loaded onto a computer or other programmable data  processing apparatus to cause a series of operational elements or steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions that execute on the computer or other programmable apparatus provide elements or steps for implementing the functions specified in the flow diagram block or blocks.

[0141] Accordingly, blocks of the block diagrams and flow diagrams support combinations of means for performing the specified functions, combinations of elements or steps for performing the specified functions and program instruction means for performing the specified functions. It will also be understood that each block of the block diagrams and flow diagrams, and combinations of blocks in the block diagrams and flow diagrams, may be implemented by special-purpose, hardware-based computer systems that perform the specified functions, elements or steps, or combinations of special-purpose hardware and computer instructions.

[0142] Conditional language, such as, among others, “can, ” “could, ” “might, ” or “may, ” unless specifically stated otherwise, or otherwise understood within the context as used, is generally intended to convey that certain implementations could include, while other implementations do not include, certain features, elements, and / or operations. Thus, such conditional language is not generally intended to imply that features, elements, and / or operations are in any way required for one or more implementations or that one or more implementations necessarily include logic for deciding, with or without user input or prompting, whether these features, elements, and / or operations are included or are to be performed in any particular implementation.

[0143] Many modifications and other implementations of the disclosure set forth herein will be apparent having the benefit of the teachings presented in the foregoing descriptions and the associated drawings. Therefore, it is to be understood that the disclosure is not to be limited to the specific implementations disclosed and that modifications and other implementations are intended to be included within the scope of the appended claims. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.

Claims

1.An apparatus for encoding video data using macroblock mode prediction, the apparatus comprising graphics processing circuitry coupled to memory, the graphics processing circuitry configured to:input features of a macroblock of pixels of a video frame to a logistic regression machine learning model trained to predict an encoding cost of a sub-block of the macroblock;generate, based on a logistic regression using the logistic regression machine learning model and the input features, a value indicating that the sub-block is to be used or not used as a partition for the macroblock;generate, using a decision tree machine learning model, a selection of an intra prediction mode for encoding the video frame, wherein a respective node of the decision tree machine learning model selects either to perform or skip a respective intra prediction mode;select an inter prediction mode or an intra prediction mode based on the value and the selection; andencode the video frame, based on the selected inter prediction mode or intra prediction mode, for a bitstream.2.The apparatus of claim 1, wherein the graphics processing circuitry is further configured to:generate, based on rate distortion, a best encoding cost estimate for the macroblock, using the logistic regression machine learning model; andgenerate, based on the best encoding cost and quantization parameters, an adaptive threshold using the logistic regression machine learning model,wherein to generate the value is based on a comparison of the adaptive threshold to a pixel variance associated with the macroblock, andwherein the features comprise the pixel variance.3.The apparatus of claim 2, wherein the best encoding cost is a minimum of a sum of a residual encoding cost associated with the macroblock and a sum of a motion vector encoding cost associated with the macroblock and a reference encoding cost associated with the macroblock.4.The apparatus of claim 2, wherein the graphics processing circuitry is further configured to:generate, using the logistic regression machine learning model, a predicted encoding cost of using the sub-block as the partition, based on a sum of a first motion vector cost of a first sub-block of the sub-block and a second motion vector cost of a second sub-block of the sub-block, subtracted from a best encoding cost estimate of the first sub-block or the second sub-block.5.The apparatus of any of claims 1-4, wherein the value indicates that the sub-block is not to be used as the partition for the macroblock, and wherein the graphics processing circuitry is further configured to:select the macroblock for the inter prediction mode.6.The apparatus of any of claims 1-4, wherein the value indicates that the sub-block is to be used as the partition for the macroblock, and wherein the graphics processing circuitry is further configured to:select the sub-block for the inter prediction mode.7.The apparatus of any of claims 1-4, wherein the macroblock is 16x16 pixels, and wherein the sub-block is 16x8 pixels, 8x16 pixels, or 8x8 pixels.8.The apparatus of any of claims 1-4, wherein the features are input to the logistic regression machine learning model during an inter prediction mode of the macroblock.9.The apparatus of any of claims 1-4, wherein the graphics processing circuitry is further configured to:determine, using the decision tree machine learning model, to perform a 16x16 intra prediction mode or skip the 16x16 intra prediction mode at a first node;determine, using the decision tree machine learning model, to perform a 8x8 intra prediction mode or skip the 8x8 intra prediction mode at a second node; anddetermine, using the decision tree machine learning model, to perform a 4x4 intra prediction mode or skip the 4x4 intra prediction mode at a third node.10.A computer-readable storage medium comprising instructions to cause graphics processing circuitry of a device for encoding video data encoded using macroblock mode prediction, upon execution of the instructions by the graphics processing circuitry, to:input features of a macroblock of pixels of a video frame to a logistic regression machine learning model trained to predict an encoding cost of a sub-block of the macroblock;generate, based on a logistic regression using the logistic regression machine learning model and the input features, a value indicating that the sub-block is to be used or not used as a partition for the macroblock;generate, using a decision tree machine learning model, a selection of an intra prediction mode for encoding the video frame, wherein a respective node of the decision tree machine learning model selects either to perform or skip a respective intra prediction mode;select an inter prediction mode or an intra prediction mode based on the value and the selection; andencode the video frame, based on the selected inter prediction mode or intra prediction mode, for a bitstream.11.The computer-readable storage medium of claim 10, wherein execution of the instructions further causes the graphics processing circuitry to:generate, based on rate distortion, a best encoding cost estimate for the macroblock, using the logistic regression machine learning model; andgenerate, based on the best encoding cost and quantization parameters, an adaptive threshold using the logistic regression machine learning model,wherein to generate the value is based on a comparison of the adaptive threshold to a pixel variance associated with the macroblock, andwherein the features comprise the pixel variance.12.The computer-readable storage medium of claim 11, wherein the best encoding cost is a minimum of a sum of a residual encoding cost associated with the macroblock and a sum of a motion vector encoding cost associated with the macroblock and a reference encoding cost associated with the macroblock.13.The computer-readable storage medium of claim 11, wherein execution of the instructions further causes the graphics processing circuitry to:generate, using the logistic regression machine learning model, a predicted encoding cost of using the sub-block as the partition, based on a sum of a first motion vector cost of a first sub-block of the sub-block and a second motion vector cost of a second sub-block of the sub-block, subtracted from a best encoding cost estimate of the first sub-block or the second sub-block.14.The computer-readable storage medium of any of claims 10-13, wherein the value indicates that the sub-block is not to be used as the partition for the macroblock, and wherein execution of the instructions further causes the graphics processing circuitry to:select the macroblock for the inter prediction mode.15.The computer-readable storage medium of any of claims 10-13, wherein the value indicates that the sub-block is to be used as the partition for the macroblock, and wherein execution of the instructions further causes the graphics processing circuitry to:select the sub-block for the inter prediction mode.16.The computer-readable storage medium of any of claims 10-13, wherein the macroblock is 16x16 pixels, and wherein the sub-block is 16x8 pixels, 8x16 pixels, or 8x8 pixels.17.The computer-readable storage medium of any of claims 10-13, wherein the features are input to the logistic regression machine learning model during an inter prediction mode of the macroblock.18.The computer-readable storage medium of any of claims 10-13, wherein the graphics processing circuitry is further configured to:determine, using the decision tree machine learning model, to perform a 16x16 intra prediction mode or skip the 16x16 intra prediction mode at a first node;determine, using the decision tree machine learning model, to perform a 8x8 intra prediction mode or skip the 8x8 intra prediction mode at a second node; anddetermine, using the decision tree machine learning model, to perform a 4x4 intra prediction mode or skip the 4x4 intra prediction mode at a third node.19.A method for encoding video data encoded using macroblock mode prediction, the method comprising:inputting, by graphics processing circuitry, features of a macroblock of pixels of a video frame to a logistic regression machine learning model trained to predict an encoding cost of a sub-block of the macroblock;generating, by the graphics processing circuitry, based on a logistic regression using the logistic regression machine learning model and the input features, a value indicating that the sub-block is to be used or not used as a partition for the macroblock;generating, by the graphics processing circuitry, using a decision tree machine learning model, a selection of an intra prediction mode for encoding the video frame, wherein a respective node of the decision tree machine learning model selects either to perform or skip a respective intra prediction mode;selecting, by the graphics processing circuitry, an inter prediction mode or an intra prediction mode based on the value and the selection; andencoding, by the graphics processing circuitry, the video frame, based on the selected inter prediction mode or intra prediction mode, for a bitstream.20.The method of claim 19, further comprising:generating, based on rate distortion, a best encoding cost estimate for the macroblock, using the logistic regression machine learning model; andgenerating, based on the best encoding cost and quantization parameters, an adaptive threshold using the logistic regression machine learning model,wherein generating the value is based on a comparison of the adaptive threshold to a pixel variance associated with the macroblock, andwherein the features comprise the pixel variance.21.The method of claim 20, wherein the best encoding cost is a minimum of a sum of a residual encoding cost associated with the macroblock and a sum of a motion vector encoding cost associated with the macroblock and a reference encoding cost associated with the macroblock.22.The method of claim 20, further comprising:generating, using the logistic regression machine learning model, a predicted encoding cost of using the sub-block as the partition, based on a sum of a first motion vector cost of a first sub-block of the sub-block and a second motion vector cost of a second sub-block of the sub-block, subtracted from a best encoding cost estimate of the first sub-block or the second sub-block.23.The method of any of claims 19-22, wherein the value indicates that the sub-block is not to be used as the partition for the macroblock, the method further comprising:selecting the macroblock for the inter prediction mode.24.The method of any of claims 19-22, wherein the value indicates that the sub-block is to be used as the partition for the macroblock, the method further comprising:selecting the sub-block for the inter prediction mode.25.An apparatus comprising means for performing any of the methods of claims 19-24.

Citation Information

Patent Citations

  • Inter-intra prediction with implicit model

    CN115699752A

  • Video encoding with reduced complexity

    US20080205515A1

  • Skip modes for inter-layer residual video coding and decoding

    US20100061447A1

  • Alternating block constrained decision mode coding

    US20160142726A1

  • Multi-level Machine Learning-based Early Termination in Partition Search for Video Encoding

    US20180227585A1