High-definition video coding acceleration algorithm based on SVT-AV1 encoder
By optimizing the reference dependency relationship of the SVT-AV1 encoder, it allows encoding of subsequent frames to be enabled when the reference frame is not fully encoded, solving the problem of low encoding parallelism, achieving a significant improvement in encoding speed and maintaining high-quality encoding Effect.
Patent Information
- Application Number
- CN202411443687.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-02-11
AI Technical Summary
During the high-definition video encoding process, the existing SVT-AV1 encoder has low encoding parallelism and insufficient encoding speed.
By optimizing the reference dependency of the coded frame, it is allowed to enable the encoding of subsequent frames when the reference frame is not fully encoded, satisfy the conditions for the encoding block within the reference range that have been encoded, and maintain the continuity of the context model during the entropy coding stage.
It improves coding parallelism, significantly improves coding speed, and has almost no impact on the objective quality of coding.
Smart Images

Figure CN119420929A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of video encoding, and in particular relates to a high-definition video encoding acceleration algorithm based on an SVT-AV1 encoder. Background Art
[0002] The Moving Picture Experts Group (MPEG) and the Video Coding Experts Group (VCEG) jointly developed a series of video coding standards, including Advanced Video Coding (AVC, H.264), High Efficiency Video Coding (HEVC, H.265), and a new generation of video coding standards (Versatile Video Coding, VVC, H.266). Each updated generation of coding standards nearly doubles the compression efficiency compared to the previous generation of coding standards, providing effective help for transmitting clearer video content with limited network bandwidth.
[0003] There are two sets of standards for video coding and decoding technology, H.261, H.263 and H.263+ of the International Telecommunication Union (ITU-T), and MPEG-1, MPEG-2, MPEG-4 and so on of the ISO. H.264 / AVC is the latest standard jointly launched by the two major organizations combining the advantages of H.263+ and MPEG-4. The most valuable part is undoubtedly the higher data compression ratio. Under the same image quality conditions, the data compression ratio of H.264 can be 2 times higher than that of H.263 and 1.5 times higher than that of MPEG-4. HEVC is the abbreviation of High Efficiency Video Coding, which is a new video compression standard used to replace the H.264 / AVC coding standard. On January 26, 2013, HEVC officially became an international standard.
[0004] AV1 (AOMedia Video 1) is an open video coding standard developed and maintained by the Alliance for Open Media (AOMedia). AV1 is designed to provide efficient compression performance for a wide range of application scenarios, including streaming, video conferencing, online video platforms, etc. The Alliance for Open Media (AOMedia) was founded in 2015 and is composed of a group of industry-leading companies, including Google, Microsoft, Mozilla, Netflix, Amazon, Cisco, Intel, etc. AOMedia's goal is to develop open and free multimedia formats to reduce dependence on patent-restricted formats (such as H.264, H.265 / HEVC). AV1 is the first video coding standard launched by the organization. Its predecessor is Google's VP8 and VP9 encoders. VP9 is close to H.265 / HEVC in compression performance, but there are still some technical limitations. Based on VP9, AOMedia combined the technical achievements of other member companies (such as Cisco's Thor and Mozilla's Daala) to finally form the AV1 standard. AV1 is currently supported by many mainstream video platforms and browsers, such as YouTube, Netflix, Twitch, as well as Chrome, Firefox and Edge browsers. With the popularization of 5G and ultra-high-definition (such as 8K, 4K) videos, AV1 has gained wide recognition in the industry due to its efficient compression performance, openness and no patent fees. It is regarded as an important direction for the development of future video coding technology and is expected to become the mainstream standard for the next generation of video coding.
[0005] The current open source AV1 encoders mainly include the following three encoders: SVT-AV1, libaom, and RAV1E. The SVT-AV1 encoder is an open source AV1 encoder jointly developed by Intel and Netflix. It has the characteristics of high performance and high efficiency. It supports a variety of scenarios from real-time encoding to high-quality offline encoding; the libaom encoder is the official AV1 encoder implementation of AOMedia. It has the most complete AV1 functions, but the encoding speed is relatively slow. It is more used in research and high-quality encoding scenarios; the RAV1E encoder is an AV1 encoder implemented in the Rust language led by Mozilla. The goal is to provide faster encoding speeds and easy-to-integrate encoder implementations. The decoder implementation mainly includes the efficient AV1 decoder dav1d developed by VideoLAN and FFmpeg, which aims to provide fast and low-memory decoding performance. It is currently widely used on major platforms, as well as the official libaom-supported decoder, which supports complete AV1 features, but the decoding efficiency is not as good as dav1d.
[0006] SVT-AV1 adopts a hybrid coding framework. The entire coding process includes modules such as intra-frame prediction, inter-frame prediction, transform quantization, inverse quantization and inverse transform, deblocking filtering, constrained directional enhancement filtering, loop recovery filtering and entropy coding. For high-definition video application scenarios, SVT-AV1's block partitioning includes four-partition modes (4-partition modes), three-partition modes (T-shaped partition modes) and two-partition modes (2-partition modes). Different partition types are used to adapt to different texture directions to improve coding efficiency. At the same time, SVT-AV1 supports coding blocks of different sizes. The size of its coding blocks supports recursive partitioning from 128x128 to 4x4. The flexible coding block size division is to match the texture complexity of the image itself.
[0007] As the latest generation of coding technology standard, SVT-AV1 has added many key technologies. In addition to more flexible block division, intra-frame prediction adds Smooth mode, CFL mode, Warped model, etc., so as to model more complex image content in spatial and transform domains; inter-frame prediction improves the pixel-by-pixel motion compensation accuracy to 1 / 16 pixel, bidirectional optical flow method and OBMC prediction, and uses 8-tap tap filter to improve quality; a variety of filtering tools are used to improve image quality. In addition to the commonly used deblocking filter (Deblocking Filter), constrained directional enhancement filter (Constrained Directional Enhancement Filter, CDEF) and loop restoration filter (Loop Restoration, LR) are added; for low bit rate conditions, super-resolution (Super-Resolution) technology can improve the perceived quality of decoded images at lower bit rates; for the graininess of movie films, film grain synthesis technology is proposed to effectively simulate the film grain effect and improve the visual quality of the video.
[0008] By modularizing the AV1 encoding process, each module is responsible for the corresponding encoding task and is independent of each other. The high degree of parallelization greatly improves the encoding speed of SVT-AV1. SVT-AV1 assigns different encoding tasks to different kernels. Each kernel can be assigned one or more threads, and the work between kernels is independent of each other. Including picture analysis kernel (PictureAnalysisKernel), mode selection configuration kernel (ModeDecisionConfigurationKernel), rate control kernel (RateControlKernel), picture decision kernel (PictureDecisionKernel), motion estimation kernel (MotionEstimationKernel), mode selection kernel (ModeDecisionKernel), deblocking filter kernel (DeblockingFilterKernel), constraint direction enhancement filter kernel (CDEFKernel), loop recovery filter kernel (RestKernel), entropy coding kernel (EntropyCodingKernel), etc. After receiving the task, each kernel performs the corresponding processing and sends the processing result to the next kernel through the queue for the next step of processing. In this way, the division of labor between each kernel is clear and the degree of parallelism is improved.
[0009] The highly parallel nature of SVT-AV1 accelerates the encoding process of AV1, making SVT-AV1 widely used in low-latency encoding scenarios, such as live sports events and video conferencing scenarios. Due to the AV1 series' requirements for improved encoding performance, many highly complex encoding tools have been added, resulting in the exponential increase in the encoding complexity of AV1. In order to support the real-time live broadcast of high-definition events, in addition to increasing parallelism by kernelizing different tasks and using multi-core servers for encoding, such as the Intel Xeon series, the encoding speed can also be increased by increasing parallelism within the SVT-AV1 algorithm.
[0010] In the SVT-AV1 coding framework, after all coding blocks of the reference frame are encoded, the reconstructed image is obtained according to the mode selection result and sent to the reference frame queue. If the next coding frame needs to start the encoding process, the necessary condition is that all reference frames referenced by the coding frame have been completely encoded and the reconstructed image is in the reference frame queue. Such a reference dependency has the defect of low parallelism. In fact, the reference range of each coding block is limited, which is related to the motion search range of inter-frame prediction. It only needs to ensure that the current coding block has been fully encoded within the search range in the reference frame. The current coding block can start the encoding process without waiting until all coding blocks of the reference frame are encoded.
[0011] Before the current frame starts encoding the first coding block of each row, it searches for the number of coded rows of all reference frames in the reference list. If the motion estimation (ME) search range is met, it indicates that the reference frame has encoded a sufficient number of coding blocks, and the coding block row of the current frame is allowed to start the encoding process. Similarly, after encoding the first row of coding blocks, the current frame is also stored in the reference frame queue, and the coded row number flag is continuously updated during the encoding process to determine whether the subsequent coding frames that refer to this frame meet the encoding conditions. By optimizing the reference relationship of the coding frames and the conditional restrictions for starting the coding of the coding blocks, the encoding parallelism of SVT-AV1 is improved, thereby improving the encoding speed of SVT-AV1.
[0012] SVT-AV1 is one of the open source encoders belonging to the AV1 video coding standard. Its high parallelism makes the encoding speed far exceed the libaom reference encoder. The main application scenario of the SVT-AV1 encoder is a low-latency encoding environment, such as high-definition sports event live broadcasts, video conferencing scenarios, etc. Although the kernelization of different tasks of SVT-AV1 greatly improves the parallelism of the encoder, encoding with multi-core servers, such as the Intel Xeon series, can effectively improve the encoding speed of AV1. However, focusing on the internal encoding logic of SVT-AV1, due to the reference restriction relationship of the current algorithm, the current encoding frame is allowed to start encoding only after all the coding blocks in all reference frames are encoded. In fact, the reference range of each coding block is limited, which is related to the motion estimation search range, that is, whether the coding block of the coding frame can start encoding only needs to meet the encoding conditions when the coding blocks in the search range of the reference frame have been encoded. Therefore, the reference restriction relationship of the current SVT-AV1 encoder determines that the current encoding algorithm is insufficient in parallelism. Summary of the invention
[0013] In view of the above problems, the present invention provides a high-definition video encoding acceleration algorithm based on the SVT-AV1 encoder, which is used to optimize the reference dependency of the SVT-AV1 encoding algorithm, improve the encoding parallelism, and thus increase the encoding speed.
[0014] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0015] A high-definition video encoding acceleration algorithm based on the SVT-AV1 encoder includes the following steps:
[0016] S10, before the coded frame enters the mode selection kernel ModeDecisionKernel, initialize the context model parameters in the mode selection configuration kernel ModeDecisionConfigurationKernel to default values;
[0017] S20, in the mode selection kernel ModeDecisionKernel, before encoding the first super block SB of each line, loop through all reference frames in different reference lists, and calculate the number num_sb_delay of encoding lines that the reference frame needs to lead according to the motion search range area height and the SB size SBSize;
[0018] S30, judging whether the reference frame encodes a sufficient number of SBs according to the calculated num_sb_delay,
[0019] If the reference frame has been coded lines_completed refPic Greater than the current encoding line ySBIdx curPic The sum of num_sb_delay indicates that the reference frame meets the reference restriction condition and continues to judge the next coded frame; if the reference frame has been coded lines_completed refPic Less than or equal to the current encoding line ySBIdx curPic The sum of the reference frame and num_sb_delay indicates that the reference frame has not yet met the reference constraint condition, and then waits until lines_completedr of the reference frame is reached. efPic After updating, the reference restriction condition is satisfied; after all reference frames satisfy the reference restriction condition, the encoding of the SB of this row is started;
[0020] S40, in ModeDecisionKernel, after encoding all SBs of the first line, the encoded SB lines of the current frame are converted to lines_completed curPic Set to 0, which is the index value of the first row, and send the current frame to the reference frame queue so that subsequent coded frames that refer to this frame can enter the coding queue in advance;
[0021] S50, in ModeDecisionKernel, after encoding the last SB of each line, update the encoded line identification bit lines_completed corresponding to the frame curPic , the index value of the current encoding line ySBIdx curpic Assigned to lines_completed curPic Indicates the number of SB lines that have been encoded in the current frame, which is used to refer to the encoding frame of the frame in the subsequent decision whether to start encoding; if all SB lines of the current encoding frame are encoded, the encoded line flag is lines_completedcurPic The value is set to MAX_PIC_LINE_IN_SB, where MAX_PIC_LINE_IN_SB is a constant of 128, indicating that the current frame SB has been fully encoded and meets the reference constraint condition;
[0022] S60, after all SB modes of the coded frame are selected and the entropy coding kernel Entropy Coding Kernel is entered, in order to maintain the continuity of the entropy coding context model, the current frame waits for all its reference frames to be entropy coded, and then copies the context model of the primary reference frame primary_ref_frame of the current coded frame for entropy coding of the current frame and updates the context model parameter values; after the entropy coding and context model update of the current frame are completed, the subsequent coded frames that refer to the frame can start entropy coding.
[0023] In a possible implementation, the context model is a multi-symbol context adaptive arithmetic coding adopted by SVT-AV1 entropy coding, and the context model is a probability distribution that uses known information, namely the context, to predict the current symbol, and is expressed in the form of a cumulative distribution function CDF. These CDFs are used to represent the probability distribution of different coding elements in a given context, and the context model is continuous between frames, that is, the context model of the coded frame is inherited from the reference frame.
[0024] In a possible implementation, the default values of the context model parameters are initialized by the svt_av1_default_coef_probs function.
[0025] In a possible implementation manner, the number of coding lines that the reference frame needs to lead, num_sb_delay, is calculated by adding the sum of the motion search height and the SB size divided by the SB size, that is, right-shifting the number of bits related to the SB size and then adding 1, that is:
[0026] num_sb_delay=((searchAreaHeight+SBSize)>>Log2(SBSize))+1
[0027] Where searchAreaHeight indicates the height of the motion search ME range; SBSize indicates the size of the SB, which can be 64 or 128. The calculation of num_sb_delay indicates how many SB rows the reference frame needs to lead the coded frame by considering the motion search range and the SB size during the encoding process.
[0028] In a possible implementation manner, after the last SB of each line is encoded, the encoded line identification bit lines_completed corresponding to the frame is updated. curPic for:
[0029]
[0030] Among them, lastSBFlag indicates that the current SB is the last coded SB block of the coded frame, and MAX_PIC_LINE_IN_SB is a constant 128, indicating that the current frame SB has been fully coded and meets the reference constraint conditions; ySBIdx curPic Indicates the Index of the current coded line; when the coded SB is the last SB of the non-coded frame, lines_completed curPic The value is the Index of the current encoding line. If the SB is the last SB of the current encoding frame, then lines_completed curPic Use the constant MAX_PIC_LINE_IN_SB to assign the value.
[0031] The present invention has the following beneficial effects:
[0032] (1) Optimizing the reference dependency of the SVT-AV1 coding algorithm: The reference dependency of the original SVT-AV1 coding algorithm determines that the prerequisite for starting coding of a coding frame is that all coding blocks in all reference frames are completely coded, and the corresponding reference frame will be sent to the reference frame list. The coding link is allowed only after judging whether all reference frames are completely coded based on the reference relationship of the coding frame. The technical solution of the present invention optimizes the reference dependency, and sends a row of coding blocks to the reference frame queue after each frame is coded. If the reference frame is not completely coded, the subsequent frame is allowed to start coding, and it only needs to meet the requirement that the coding blocks of the reference frame have been coded within the reference range.
[0033] (2) Improving encoding parallelism, thereby increasing encoding speed: By optimizing the encoding of reference frames and subsequent frames while the encoding of the coding blocks within the reference range is completed, the number of coded frames processed per unit time is increased, the CPU utilization and encoding parallelism are improved, and the encoding speed of SVT-AV1 is further improved.
[0034] (3) Optimizing the update of entropy coding context model: SVT-AV1 entropy coding adopts a multi-symbol context-adaptive arithmetic coding, whose context model is used to predict the probability distribution of symbols, and the context model is continuous between frames, that is, the context model of the coded frame is inherited from the reference frame; in order to improve the parallelism of reference frame coding, the coded frame needs to enter the mode selection for coding before the reference frame is completely encoded; in order to maintain the continuity of the context model, the reference / coded frames are processed in parallel in the mode selection (ModeDecisionKernel) stage, and the context model of each frame is the default initialized context model; in the entropy coding (EntropyCodingKernel) stage, the reference / coded frames are processed in serial order, and the entropy coding of the subsequent frames is entered only after the reference frame is completely entropy encoded to ensure the continuity of the context model. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a flowchart of a high-definition video encoding acceleration algorithm based on the SVT-AV1 encoder according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] See also Figure 1 , which is a flowchart of a high-definition video encoding acceleration algorithm based on an SVT-AV1 encoder according to an embodiment of the present invention, includes the following steps:
[0038] S10, before the coded frame enters the mode selection kernel ModeDecisionKernel, the context model parameters are initialized to default values in the mode selection configuration kernel ModeDecisionConfigurationKernel. For example, the transform block skip mode cumulative probability distribution (Transform Block Skip Cumulative Distribution Function, txb_skip_cdf), the motion mode cumulative probability distribution (Motion Mode Cumulative DistributionFunction, motion_mode_cdf), etc. The default values of these context model parameters are initialized through the svt_av1_default_coef_probs function.
[0039] Among them, the context model is a multi-symbol context-adaptive arithmetic coding adopted by SVT-AV1 entropy coding. Its context model is a probability distribution that uses known information, namely the context, to predict the current symbol. Most of them are expressed in the form of cumulative distribution function (CDF). These CDF tables are used to represent the probability distribution of different coding elements in a given context, and the context model is continuous between frames, that is, the context model of the coded frame is inherited from the reference frame.
[0040] S20, in the mode selection kernel ModeDecisionKernel, before encoding the first super block SB of each line, loop through all reference frames in different reference lists, and calculate the number num_sb_delay of encoding lines that the reference frame needs to lead according to the motion search range area height and the SB size SBSize;
[0041] S30, judging whether the reference frame encodes a sufficient number of SBs according to the calculated num_sb_delay, the judging formula is:
[0042] lines_completed refPic >ySBIdx curPic +num_sb_delay
[0043] where lines_completedr efPic Indicates the number of superblock SB rows that have been encoded in the reference coded frame, that is, the number of rows that have been encoded in the reference frame; ySBIdx curPic Indicates the Index of the current encoding line;
[0044] That is, if the reference frame has coded lines lines_completedr efPic Greater than the current encoding line ySBIdx curPic The sum of num_sb_delay indicates that the reference frame meets the reference restriction condition and continues to judge the next coded frame; if the reference frame has been coded lines_completed refPic Less than or equal to the current encoding line ySBIdx curPic The sum of the reference frame and num_sb_delay indicates that the reference frame has not yet met the reference constraint condition, so it enters the waiting state until lines_completed of the reference frame refPic After updating, the reference restriction condition is satisfied; after all reference frames satisfy the reference restriction condition, the encoding of the SB of this row is started;
[0045] S40, in ModeDecisionKernel, after encoding all SBs of the first line, the encoded SB lines of the current frame are converted to lines_completed curPic Set to 0, which is the index value of the first row, and send the current frame to the reference frame queue so that subsequent coded frames that refer to this frame can enter the coding queue in advance;
[0046] S50, in ModeDecisionKernel, after encoding the last SB of each line, update the encoded line identification bit lines_completed corresponding to the frame curPic , the index value of the current encoding line ySBIdx curPic Assign to lines_completed curPic Indicates the number of SB lines that have been encoded in the current frame, which is used to refer to the encoding frame of the frame in the subsequent decision whether to start encoding; if all SB lines of the current encoding frame are encoded, the encoded line flag is lines_completed curPic The value is set to MAX_PIC_LINE_IN_SB, where MAX_PIC_LINE_IN_SB is a constant of 128, indicating that the current frame SB has been fully encoded and meets the reference constraint condition;
[0047] S60, after all SB modes of the coded frame are selected and the entropy coding kernel Entropy Coding Kernel is entered, in order to maintain the continuity of the entropy coding context model, the current frame waits for all its reference frames to be entropy coded, and then copies the context model of the primary reference frame primary_ref_frame of the current coded frame for entropy coding of the current frame and updates the context model parameter values; after the entropy coding and context model update of the current frame are completed, the subsequent coded frames that refer to the frame can start entropy coding.
[0048] In a high-definition video encoding acceleration algorithm based on an SVT-AV1 encoder according to another embodiment of the present invention, the number of coding lines that the reference frame needs to lead in S20 is calculated as the sum of the motion search height plus the SB size divided by the SB size, that is, right-shifted by the number of bits related to the SB size, and then added by 1, that is:
[0049] num_sb_delay=((searchAreaHeight+SBSize)>>Log2(SBSize))+1
[0050] Where searchAreaHeight indicates the height of the motion search ME range; SBSize indicates the size of the SB, which can be 64 or 128. The calculation of num_sb_delay indicates how many SB rows the reference frame needs to lead the coded frame by considering the motion search range and the SB size during the encoding process.
[0051] Further, in S50, after the last SB of each line is encoded, the encoded line flag lines_completed corresponding to the frame is updated. curPic for:
[0052]
[0053] Among them, lastSBFlag indicates that the current SB is the last coded SB block of the coded frame, and MAX_PIC_LINE_IN_SB is a constant 128, indicating that the current frame SB has been fully coded and meets the reference constraint conditions; ySBIdx curPic Indicates the Index of the current coded line; when the coded SB is the last SB of the non-coded frame, lines_completed curPic The value is the Index of the current encoding line. If the SB is the last SB of the current encoding frame, then lines_completed curPic Use the constant MAX_PIC_LINE_IN_SB to assign the value.
[0054] To verify the effectiveness of the method of the embodiment of the present invention, the method of the embodiment of the present invention is applied to the SVT-AV1 encoder, and the JVET (Joint Video Exploration Team) reference Class B (1920x1080) is used as the test sequence to verify the encoding acceleration effect of the method of the embodiment of the present invention on high-definition video. The hardware configuration of the experimental platform is Intel (R) Xeon (R) Gold 6258R CPU @ 2.70GHz, the server includes 112 CPUs, and the CentOS Linux operating system. The encoding parameters are GOP length = 50, number of B frames = 7, number of reference frames = 2, and encoding level = 12. In order to compare the acceleration effect of the method of the embodiment of the present invention on high-definition video, all 112 CPUs are configured for the encoder, and the encoding sequence is cyclically encoded for a total of 1000 frames to reduce the impact of the read-in data on the encoding speed, so as to objectively compare the encoding speed (Frame Per Second, fps) and objective quality peak signal-to-noise ratio (Peak signal-to-noise ratio, PSNR) of the method of the present invention and the original SVT-AV1 encoder.
[0055] Table 1 Comparison of encoding results between the method of the present invention (Test) and the SVT-AV1 (Anchor) encoder
[0056]
[0057] Table 1 shows the objective quality PSNR and encoding speed comparison of the method (Test) of the embodiment of the present invention compared with the original SVT-AV1 (Anchor) encoder under the ClassB sequence test. It can be seen that the method of the present invention improves the encoding parallelism by optimizing the internal reference relationship of the algorithm while ensuring that the objective quality of the encoding is almost the same, and effectively improves the encoding speed of SVT-AV1 for high-definition video. Specifically, in terms of coding efficiency comparison, after the optimization of the method of the present invention, there is almost no effect on the encoding efficiency of SVT-AV1, and the average bit rate is only increased by 1.03% under the same objective quality; at the same bit rate, the objective quality Y-PSNR only decreases by 0.02db, which shows that the effect of the method of the present invention on the encoding efficiency of SVT-AV1 is almost negligible; in terms of encoding speed, the method of the present invention improves the encoding speed by 327% on average compared with the original SVT-AV1 encoder, and the effect of improving the encoding speed is obvious, and the encoding speed can be increased to more than 200 fps at the conventional bit rate (4 to 8 megabytes) of high-definition video.
[0058] The method of the embodiment of the present invention optimizes the reference dependency of the internal algorithm of the SVT-AV1 encoder so that the coded frames with reference relationships can be encoded in parallel at the same time when the reference relationship is satisfied, instead of the serial coding relationship that requires waiting for the reference frame to be completely encoded before starting the coding, thereby effectively improving the parallelism and coding speed of the SVT-AV1 encoder. In addition, the method of the embodiment of the present invention has almost no impact on the objective quality of the coding while improving the coding speed, and significantly improves the coding speed of the SVT-AV1 encoder while ensuring the same objective quality, which is of high value for the high-definition and low-latency application scenarios of the SVT-AV1 encoder.
[0059] It should be understood that the exemplary embodiments described herein are illustrative rather than restrictive. Although one or more embodiments of the present invention are described in conjunction with the accompanying drawings, it should be understood by those skilled in the art that various changes in form and detail may be made without departing from the spirit and scope of the present invention as defined by the appended claims.
Claims
1. A high-definition video encoding acceleration algorithm based on the SVT-AV1 encoder, characterized in that: The following steps are involved: S10, before the coded frame enters the mode selection kernel ModeDecisionKernel, initialize the context model parameters in the mode selection configuration kernel ModeDecisionConfigurationKernel to default values; S20, in the mode selection kernel ModeDecisionKernel, before encoding the first super block SB of each line, loop through all reference frames in different reference lists, and calculate the number of encoding lines num_sb_delay that the reference frame needs to lead according to the motion search range area height and the SB size SBSize; S30, judging whether the reference frame encodes a sufficient number of SBs according to the calculated num_sb_delay, If the reference frame has been coded lines_completed refPic Greater than the current encoding line ySBIdx curPic The sum of num_sb_delay indicates that the reference frame meets the reference restriction condition and continues to judge the next coded frame; if the reference frame has been coded lines_completed refPic Less than or equal to the current encoding line ySBIdx curPic The sum of the reference frame and num_sb_delay indicates that the reference frame has not yet met the reference constraint condition, so it enters the waiting state until lines_completed of the reference frame refPic After updating, the reference restriction condition is satisfied; after all reference frames satisfy the reference restriction condition, the encoding of the SB of this row is started; S40, in ModeDecisionKernel, after encoding all SBs of the first line, the encoded SB lines of the current frame are converted to lines_completed curPic Set to 0, which is the index value of the first row, and send the current frame to the reference frame queue so that subsequent coded frames that refer to this frame can enter the coding queue in advance; S50, in ModeDecisionKernel, after encoding the last SB of each line, update the encoded line identification bit lines_completed corresponding to the frame curPic , the index value of the current encoding line ySBIdx curPic Assigned to lines_completed curPic Indicates the number of SB lines that have been encoded in the current frame, which is used to refer to the encoding frame of this frame in the subsequent decision of whether to start encoding; If all SB lines of the current coded frame have been coded, the coded line flag will be lines_completed curPic The value is set to MAX_PIC_LINE_IN_SB, where MAX_PIC_LINE_IN_SB is a constant of 128, indicating that the current frame SB has been fully encoded and meets the reference constraint condition; S60, after all SB modes of the coded frame are selected and the entropy coding kernel Entropy Coding Kernel is entered, in order to maintain the continuity of the entropy coding context model, the current frame waits for all its reference frames to be entropy coded, and then copies the context model of the primary reference frame primary_ref_frame of the current coded frame for entropy coding of the current frame and updates the context model parameter values; after the entropy coding and context model update of the current frame are completed, the subsequent coded frames that refer to the frame can start entropy coding.
2. The high-definition video encoding acceleration algorithm based on the SVT-AV1 encoder according to claim 1, characterized in that: The context model is a multi-symbol context-adaptive arithmetic coding adopted by SVT-AV1 entropy coding. The context model is a method of predicting the probability distribution of the current symbol using known information, namely the context, and is expressed in the form of a cumulative distribution function (CDF). These CDFs are used to represent the probability distribution of different coding elements in a given context, and the context model is continuous between frames, that is, the context model of the coded frame is inherited from the reference frame.
3. The high-definition video encoding acceleration algorithm based on the SVT-AV1 encoder according to claim 1 or 2, characterized in that: The default values of the context model parameters are initialized by the svt_av1_default_coef_probs function.
4. The high-definition video encoding acceleration algorithm based on the SVT-AV1 encoder according to claim 1, characterized in that: The number of coding lines that the reference frame needs to lead in calculation, num_sb_delay, is the sum of the motion search height plus the SB size divided by the SB size, that is, right-shifted by the number of bits related to the SB size, and then added 1, that is: num_sb_delay=((searchAreaHeight+SBSize)>>Log2(SBSize))+1 Where searchAreaHeight indicates the height of the motion search ME range; SBSize indicates the size of the SB, which can be 64 or 128. The calculation of num_sb_delay indicates how many SB rows the reference frame needs to lead the coded frame by considering the motion search range and the SB size during the encoding process.
5. The high-definition video encoding acceleration algorithm based on the SVT-AV1 encoder according to claim 4, characterized in that: After the last SB of each line is encoded, the encoded line flag lines_completed corresponding to the frame is updated curPic for: Among them, lastSBFlag indicates that the current SB is the last coded SB block of the coded frame, and MAX_PIC_LINE_IN_SB is a constant 128, indicating that the current frame SB has been fully coded and meets the reference constraint conditions; ySBIdx curPic Indicates the Index of the current coded line; when the coded SB is the last SB of the non-coded frame, lines_completed curPic The value is the Index of the current encoding line. If the SB is the last SB of the current encoding frame, then lines_completed curPic Use the constant MAX_PIC_LINE_IN_SB to assign the value.