A coding method, apparatus and device based on coding units
By quickly classifying encoding unit types and selecting encoding modes, and combining this with WPP to optimize the encoding process, the problem of high complexity in screen encoding is solved, resulting in a more efficient encoding process.
Patent Information
- Application Number
- CN202211017313.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-23
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2042-08-23
AI Technical Summary
Existing screen encoding methods fail to take into account the overall encoding complexity, resulting in a still high level of encoding complexity for screen content, which is particularly impractical in real-time application scenarios such as video conferencing.
By acquiring the feature information of the coding unit, the coding unit type is quickly classified, and the coding mode and partitioning depth are selected according to the type, reducing rate distortion optimization calculations. When encoding the prediction unit, the optimal block vector is quickly matched based on the size of the coding unit, reducing the IBC coding complexity, and the coding process is optimized through WPP.
It reduces the overall complexity of screen encoding, improves encoding efficiency and mode selection efficiency, reduces unnecessary calculations, and optimizes the encoding process.
Smart Images

Figure CN115442601B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of screen coding, in particular to a coding method, device and equipment based on coding unit. BACKGROUND
[0002] At present, for screen content coding, HEVC-SCC introduces the prediction technology of IBC (Intra Block Copy). The IBC technology uses the correlation of screen content in space, adopts integer pixel accuracy to perform full search in the coded area of the current frame, and obtains the optimal prediction block of the current to-be-coded block.
[0003] The search process in the IBC technology is similar to the motion search in inter-frame prediction coding, and both have the problem of high complexity. In view of this problem, the Hash-based search method is introduced in HEVC-SCC to replace the block matching method with extremely high complexity, but the Hash calculation complexity at full resolution is still very high. In addition, HEVC adopts the block division mode based on quad-tree and rich intra-frame and inter-frame prediction modes, resulting in extremely high complexity of RDO (Rate Distortion Optimization) decision, which is not practical for real-time application scenarios such as video conferencing due to the extremely high coding complexity. In addition, in the original WPP logic of the x265 encoder, the coding thread and the filtering thread are processed in a cross-parallel manner. Since the reference block in IBC is the reconstructed pixel before loop filtering in the current frame, the original WPP logic of the x265 encoder cannot be used for IBC coding.
[0004] The existing screen coding method mainly determines the IBC coding mode and the base coding mode according to the coding block characteristics or the pre-analysis result, or uses the CU (coding unit) characteristics to perform fast CU division and mode selection; the existing scheme only optimizes at a certain stage of screen coding and does not consider the complexity of screen coding as a whole, which has limitations for reducing the complexity of screen content coding. SUMMARY
[0005] The present application provides a coding method, device and equipment for video screen content to solve the technical problem that the existing screen coding scheme does not consider the complexity of screen coding as a whole, and the complexity of screen content coding is still very high.
[0006] In order to solve the above technical problems, in a first aspect, the embodiment of the present application provides a coding method based on coding unit, comprising:
[0007] obtaining a current coding unit, and determining the type of the coding unit according to the characteristic information of the coding unit;
[0008] selecting the coding mode of the intra-frame prediction process according to the type of the coding unit, and determining whether the calculation of the IBC mode is needed.
[0009] If the IBC mode calculation is not needed, the encoding of the coding unit is completed according to the encoding mode, if the IBC mode calculation is needed, the optimal block vector is searched according to the size of the coding unit, and the encoding of the coding unit is completed by the WPP processing logic based on the optimal block vector.
[0010] The present application considers the complexity of the encoding of the coding unit in the screen encoding content as a whole, judges the type of the current coding unit according to the characteristics of the current coding unit when the coding unit is divided, and encodes quickly according to the type to select the encoding mode and the division depth, reduces unnecessary rate-distortion optimization calculation, and improves the mode selection efficiency; during the encoding of the prediction unit, the optimal block vector is quickly matched based on the IBC mode according to the size of the coding unit, the complexity of the IBC encoding is reduced, and the encoding process is optimized by WPP to reduce the encoding complexity.
[0011] Further, the current coding unit is obtained, and the type of the coding unit is determined according to the characteristic information of the coding unit, specifically,
[0012] The horizontal direction smoothness and the vertical direction smoothness of the coding unit are calculated according to the characteristic information, if one of the horizontal direction smoothness or the vertical direction smoothness is 0, the type of the coding unit is determined as PSCU, otherwise, the Roberts gradient of each pixel in the coding unit and the average gradient value of the coding unit are calculated according to the characteristic information, and the type of the coding unit is determined in combination with the number of sharp edge points.
[0013] Further, the type of the coding unit is determined according to the Roberts gradient of each pixel in the coding unit and the average gradient value of the coding unit in combination with the number of sharp edge points according to the characteristic information, specifically,
[0014] The Roberts gradient of each pixel in the coding unit is calculated, and the average gradient value of the coding unit and the number of sharp edge points are calculated;
[0015] If the number of sharp edge points is greater than or equal to a first threshold value, the coding unit is determined as SCCU, if the number of sharp edge points is greater than or equal to 5 times the first threshold value, the coding unit is determined as SCCUC, otherwise, as SCCUM;
[0016] If the number of sharp edge points is less than the first threshold value, the coding unit is determined as NCCU, if the average gradient value is less than or equal to 5, the coding unit is determined as NCCUS, if the average gradient value is greater than 5 and less than 10, the coding unit is determined as NCCUM, and if the average gradient value is greater than 10, the coding unit is determined as NCCUC.
[0017] The present application quickly divides the coding unit type according to the horizontal and vertical smoothness of the coding unit, the number of sharp edge points and the average gradient, classifies the coding unit, and then quickly selects the coding mode.
[0018] Further, the coding mode of the intra prediction process is selected according to the type of the coding unit, and it is determined whether the calculation of the IBC mode is needed, specifically:
[0019] If the type of the coding unit is PSCU, the coding mode is determined as DC mode, Planar mode, horizontal direction mode, vertical direction mode, 45 degree direction mode and 135 degree direction mode; and the calculation of the IBC mode is skipped.
[0020] If the type of the coding unit is SCCUM or SCCUC, the coding mode is determined as the calculation of DC mode, Planar mode, horizontal direction mode, vertical direction mode, 45 degree direction mode and 135 degree direction mode; and the calculation of the IBC mode is performed.
[0021] If the type of the coding unit is NCCU, the NCCU includes NCCUS, NCCUM and NCCUC, the coding mode is determined as all traditional intra prediction modes, the all traditional intra prediction modes include 35 kinds; and the calculation of the IBC mode is skipped.
[0022] The present application quickly selects the coding mode according to the type of the coding unit, reduces unnecessary rate-distortion optimization calculation, reduces the overall coding complexity, and improves the coding efficiency.
[0023] Further, the optimal block vector is searched according to the size of the coding unit, specifically:
[0024] According to the size of the coding unit, the optimal block vector is searched by combining a fast search scheme, the fast search scheme includes candidate MVC search, one-dimensional search, small resolution Hash search and diamond search.
[0025] The present application selects different schemes to search the optimal block vector according to the size of the coding unit, ensures that the rate-distortion performance decreases less, at the same time, reduces the search points and reduces the search complexity.
[0026] Further, the coding of the coding unit is completed by WPP processing logic based on the optimal block vector, specifically:
[0027] The coding range of the IBC mode is limited in the WPP range, the multi-thread processing of the WPP encoder is performed first according to the optimal block vector, and then the multi-thread processing of filtering is performed, and the coding of the coding unit is completed in parallel.
[0028] The present application optimizes the coding process of the IBC mode through the WPP, and completes the coding in parallel by processing the coding multi-thread first and then processing the filtering multi-thread, optimizes the coding process, and improves the coding efficiency.
[0029] Further, after determining the type of the coding unit according to the characteristic information of the coding unit, the method further comprises:
[0030] Determining the optimal coding division depth of the coding unit according to the type of the coding unit.
[0031] The present application reduces unnecessary coding unit size calculation and traversal by quickly dividing the coding unit type and dividing the optimal depth range according to the coding unit type, thereby reducing the complexity of coding.
[0032] In a second aspect, an embodiment of the present application provides a coding method for video screen content, comprising:
[0033] All coding units of the video screen content are obtained, and the coding method based on the coding unit is applied multiple times to complete the coding of each coding unit until the coding of all coding units is completed.
[0034] In a third aspect, an embodiment of the present application provides a coding device based on a coding unit, comprising a coding unit type identification module, a mode selection module and a coding module.
[0035] The coding unit type identification module is configured to obtain a current coding unit, and determine the type of the coding unit according to the characteristic information of the coding unit.
[0036] The mode selection module is configured to select the coding mode of the intra prediction process according to the type of the coding unit, and determine whether the calculation of the IBC mode is needed.
[0037] The coding module is configured to complete the coding of the coding unit according to the coding mode if the calculation of the IBC mode is not needed, search for the optimal block vector according to the size of the coding unit if the calculation of the IBC mode is needed, and complete the coding of the coding unit through the WPP processing logic based on the optimal block vector.
[0038] In a fourth aspect, an embodiment of the present application provides a computer device, comprising a processor, a communication interface and a memory, which are connected with each other, wherein the memory stores executable program code, and the processor is configured to invoke the executable program code to execute the coding method based on a coding unit or the coding method for video screen content. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 A flowchart of the coding method based on a coding unit provided by an embodiment of the present application;
[0040] Figure 2 A flowchart of step 101 provided by an embodiment of the present application;
[0041] Figure 3 A WPP range limitation diagram of step 103 provided by an embodiment of the present application;
[0042] Figure 4 A WPP optimization coding diagram of step 103 provided by an embodiment of the present application;
[0043] Figure 5 A structural diagram of the coding device of a coding unit provided by an embodiment of the present application;
[0044] Figure 6 Another flowchart of the coding method based on a coding unit provided by an embodiment of the present application;
[0045] Figure 7 Another structural diagram of the coding device based on a coding unit provided by an embodiment of the present application. DETAILED DESCRIPTION
[0046] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0047] Embodiment one
[0048] Please refer to Figure 1 , Figure 1 A flowchart of the coding method based on a coding unit provided by an embodiment of the present application, comprising steps 101 to 103, and specifically as follows:
[0049] Step 101: acquiring a current coding unit, and determining the type of the coding unit according to the characteristic information of the coding unit.
[0050] In the embodiment, the current coding unit is a maximum coding unit in video screen coding.
[0051] In the embodiment, the current coding unit is obtained, and the type of the coding unit is determined according to the characteristic information of the coding unit, specifically as follows.
[0052] The horizontal smoothness and the vertical smoothness of the coding unit are calculated according to the characteristic information, and if one of the horizontal smoothness or the vertical smoothness is 0, it is determined that the type of the coding unit is PSCU; otherwise, the Roberts gradient of each pixel in the coding unit and the average gradient value of the coding unit are calculated according to the characteristic information, and the type of the coding unit is determined in combination with the number of sharp edge points.
[0053] In the embodiment, the Roberts gradient of each pixel in the coding unit and the average gradient value of the coding unit are calculated according to the characteristic information, and the type of the coding unit is determined in combination with the number of sharp edge points, specifically as follows.
[0054] The Roberts gradient of each pixel in the coding unit is calculated, and the average gradient value of the coding unit and the number of sharp edge points are calculated.
[0055] If the number of sharp edge points is greater than or equal to a first threshold value, the coding unit is determined to be SCCU; if the number of sharp edge points is greater than or equal to 5 times the first threshold value, the coding unit is determined to be SCCUC, otherwise, the coding unit is determined to be SCCUM.
[0056] If the number of sharp edge points is less than the first threshold value, the coding unit is determined to be NCCU; if the average gradient value is less than or equal to 5, the coding unit is determined to be NCCUS; if the average gradient value is greater than 5 and less than 10, the coding unit is determined to be NCCUM; if the average gradient value is greater than 10, the coding unit is determined to be NCCUC.
[0057] In the embodiment, the horizontal smoothness and the vertical smoothness of the coding unit, the Roberts gradient of each pixel in the coding unit and the average gradient value of the coding unit are calculated according to the characteristic information of the coding unit.
[0058] In the embodiment, the formula for calculating the horizontal smoothness is specifically as follows.
[0059]
[0060] wherein f(x, y) represents the pixel value at position (x, y), and hAct represents the horizontal smoothness of the current coding unit.
[0061] The vertical direction smoothness calculation formula is specifically:
[0062]
[0063] Wherein, f(x, y) represents a pixel value at position (x, y), and vAct represents the vertical direction smoothness of the current coding unit.
[0064] The Roberts gradient operator calculation formula is specifically:
[0065] g x = f(x+1, y) - f(x, y) (3)
[0066] g y = f(x, y+1) - f(x, y) (4)
[0067] G(x, y) = |g x + g y | (5)
[0068] Wherein, f(x, y) represents a pixel value at position (x, y), g x represents a horizontal direction gradient of (x, y), g y represents a vertical direction gradient of (x, y), and G(x, y) represents a gradient at (x, y).
[0069] The average gradient value calculation formula of the coding unit is specifically:
[0070]
[0071] Wherein, G(x, y) represents a gradient at (x, y), and G avg represents the average gradient of the current coding unit.
[0072] In the embodiment, the sharp threshold Thr of the sharp edge is set to 50, if G(x, y) is greater than Thr, (x, y) is recorded as a sharp edge point of the current pixel point, and the number of sharp edge points in the current coding unit is counted and recorded as N;
[0073] The first threshold Thr1 of the sharp edge is calculated in the following manner:
[0074] Thr1 = (width*height) / 64 (7)
[0075] Wherein, width represents the width of the current coding unit, and height represents the height of the current coding unit.
[0076] As a specific example of the embodiment, please refer to Figure 2 ,Figure 2 A flowchart of step 101 provided by the embodiment of the present application includes steps 201 to 205, which are as follows:
[0077] Step 201: Calculate the horizontal smoothness hAct and the vertical smoothness vAct of the coding unit;
[0078] Step 202: If one of hAct or vAct is 0, determine that the coding unit is PSCU; otherwise,
[0079] Step 203: Calculate the Roberts gradient G(x, y) of each pixel in the coding unit, and calculate the average gradient value G of the coding unit avg .
[0080] Step 204: If the number of sharp edge points N is greater than or equal to a first threshold Thr1, determine that the coding unit is SCCU; further, if the number of sharp edge points N is greater than or equal to 5 times Thr1, determine that the coding unit is SCCUC, otherwise, determine that the coding unit is SCCUM.
[0081] Step 205: If the number of sharp edge points N is less than the threshold Thr1, determine that the coding unit is NCCU; further, if the average gradient value G avg is less than or equal to 5, determine that the coding unit is NCCUS; if the average gradient value G avg is greater than 5 and less than 10, determine that the coding unit is NCCUM; if the average gradient value G avg is greater than 10, determine that the coding unit is NCCUC.
[0082] In the embodiment, after determining the type of the coding unit according to the characteristic information of the coding unit, the method further includes:
[0083] Determining the optimal coding partition depth of the coding unit according to the type of the coding unit.
[0084] In the embodiment, the optimal depth range of the coding unit according to the type of the coding unit is [minDepth, maxDepth].
[0085] For PSCU, minDepth is 0 and maxDepth is 1;
[0086] For SCCUM, minDepth is 2 and maxDepth is 3;
[0087] For SCCUC, minDepth is 3 and maxDepth is 3, i.e., only depth 3 is traversed;
[0088] For NCCUS, minDepth is 1, and maxDepth is 2;
[0089] For NCCUM, minDepth is 2, and maxDepth is 3;
[0090] For NCCUC, minDepth is 3, and maxDepth is 3, i.e. only depth 3 is traversed.
[0091] In the embodiment, the optimal depth range of the maximum coding unit in the HEVC coding generally refers to the optimal coding split depth. In the HEVC coding, the coding unit split needs to be recursively split from the maximum size 64x64 to the minimum size 8x8, and in the recursive split process, the rate-distortion cost of each coding unit size needs to be calculated, and the minimum rate-distortion cost is selected from all size combinations as the optimal size. Split depth 0 corresponds to the 64x64 size sub-coding unit, split depth 1 corresponds to the 32x32 size sub-coding unit, split depth 2 corresponds to the 16x16 size sub-coding unit, and split depth 3 corresponds to the 8x8 size sub-coding unit. In the HEVC, the optimal split mode of the current maximum coding unit is determined by using the quad-tree split mode, i.e. from depth 0 to depth 3.
[0092] In the embodiment, the optimal depth range of the maximum coding unit is used to determine the size of the sub-coding unit that needs to be traversed during coding, for example, the optimal depth range of the PSCU in the present application is [0, 1], i.e. the PSCU needs to traverse and calculate the 64x64 size and the 32x32 size.
[0093] In the embodiment, the maximum coding unit level fast sub-coding unit split uses different optimal depth ranges for different maximum coding unit types, reduces unnecessary sub-coding unit size calculation, and thus reduces the overall coding complexity.
[0094] The present application quickly divides the coding unit type according to the horizontal direction smoothness and the vertical direction smoothness, the number of sharp edge points and the average gradient of the coding unit, classifies the coding unit, and then quickly selects the coding mode.
[0095] Step 102: selecting the coding mode of the intra prediction process according to the type of the coding unit, and determining whether the calculation of the IBC mode is needed;
[0096] In the embodiment, the selecting the coding mode of the intra prediction process according to the type of the coding unit, and determining whether the calculation of the IBC mode is needed, is specifically:
[0097] If the type of the coding unit is PSCU, the coding mode is determined as DC mode, Planar mode, horizontal direction mode, vertical direction mode, 45 degree direction mode and 135 degree direction mode; and the calculation of IBC mode is skipped;
[0098] If the type of the coding unit is SCCUM or SCCUC, the coding mode is determined as the calculation of DC mode, Planar mode, horizontal direction mode, vertical direction mode, 45 degree direction mode and 135 degree direction mode; and the calculation of IBC mode is performed.
[0099] If the type of the coding unit is NCCU, the coding mode is determined as all traditional intra prediction modes, the all traditional intra prediction modes including 35 kinds; and the calculation of IBC mode is skipped.
[0100] In the embodiment, the DC mode, the Planar mode, the horizontal direction mode, the vertical direction mode, the 45 degree direction mode and the 135 degree direction mode belong to the prediction direction and mode of the intra prediction process. The DC mode is to use the average value of the left and upper reference pixels as the prediction value, the Planar mode is to use the average value of the horizontal and vertical prediction values, and the horizontal, vertical, 45 degree and 135 degree are angle modes.
[0101] In the embodiment, the application selects the coding mode quickly according to the type of the coding unit, reduces unnecessary rate-distortion optimization calculation, reduces the overall coding complexity and improves the coding efficiency.
[0102] In the embodiment, the IBC coding mode, i.e. Intra Block Copy, uses the correlation of screen content in space, uses the integer pixel accuracy to perform full search in the coded area of the current frame, and obtains the optimal prediction block of the current to-be-coded block.
[0103] In the embodiment, in the IBC prediction coding process, after the calculation of various prediction modes, the rate-distortion cost minimum is selected as the optimal prediction mode. The order of the prediction mode calculation is: IBC SKIP / Merge→IBC 2Nx2N→IBC 2NxN→IBC Nx2N→Intra 2Nx2N→Intra NxN.
[0104] In the embodiment, after IBC mode encoding, if the CBF (Coded Block Flag) of the corresponding optimal mode is 1, it is determined that the current IBC optimal mode has residual, otherwise, it does not have residual. If the optimal IBC mode has residual and the RDcost of the optimal IBC mode is greater than the intra selection threshold intra_thr, the Intra mode selection needs to be performed, otherwise, the calculation of the Intra mode selection is skipped. The intra selection threshold intra_thr is determined according to the type of the current coding unit. If the type of the current coding unit is SCCUM or SCCUC, intra_thr is 1500; otherwise, intra_thr is 200.
[0105] In the embodiment, the RDcost, i.e. the rate-distortion cost value, RDcost=D+lamda*Bit, wherein D represents the sum of squared error SSE (Sum of Squared Error) of the difference between the current CU block and the reconstructed block, which is used to measure the distortion of the encoding in the current mode, Bit represents the number of bits consumed for encoding the current mode, and lamda represents a parameter.
[0106] Step 103: If the IBC mode calculation is not needed, the encoding of the coding unit is completed according to the encoding mode; if the IBC mode calculation is needed, the optimal block vector is searched according to the size of the coding unit; and the encoding of the coding unit is completed by the WPP processing logic based on the optimal block vector.
[0107] In the embodiment, for the coding unit which does not need to perform IBC mode calculation, the intra prediction is performed by the encoding mode to complete the encoding.
[0108] In the embodiment, the searching of the optimal block vector according to the size of the coding unit is specifically:
[0109] The optimal block vector is searched according to the size of the coding unit in combination with the fast search scheme, and the fast search scheme includes candidate MVC search, one-dimensional search, small resolution Hash search and diamond search.
[0110] In the embodiment, the optimal block vector search in the IBC encoding mode is optimized, different search methods are adopted for coding units of different sizes, the search points are reduced as much as possible under the condition of less rate-distortion performance decline, and the complexity of motion estimation is reduced.
[0111] In the embodiment, for the coding unit of 64x64 size, it can be directly divided into a coding unit of 32x32 size for encoding.
[0112] For the 32x32 size of coding unit, only candidate MVC is used in fast BV (block vector) search, which is the optimal BV of the left block, the top block, the top-left block and the top-right block of the optimal motion vector prediction block of the current block.
[0113] For the 16x16 size of coding unit, candidate MVC, one-dimensional search and diamond search are used in fast BV search, the one-dimensional search refers to search in horizontal direction and vertical direction within the current maximum coding unit and the left maximum coding unit, the diamond search is centered on the optimal BV of the one-dimensional search, the search step is 1, and the search is performed on the left, the top, the right and the bottom, respectively, and the maximum iteration number of the diamond search is 16.
[0114] For the 8x8, 8x4 and 4x8 size of coding unit, candidate MVC, one-dimensional search, diamond search and small resolution Hash search are used, the small resolution Hash search refers to Hash search on the 1 / 4 resolution image of the original resolution.
[0115] In the embodiment, a local search range is used in the one-dimensional search, the local search range is the current maximum coding unit and the left first maximum coding unit, and the search step of the one-dimensional search is greater than or equal to 2. In the one-dimensional search process, if the RDcost (rate-distortion cost value) of the current BV is less than a second threshold Thr2, the calculation of the remaining BVs is skipped. According to the x265 full resolution optimal cost statistics, the second threshold Thr2 is determined as 100.
[0116] In the embodiment, different schemes are selected according to the size of the coding unit to perform optimal block vector search, which ensures that the rate-distortion performance decreases less, at the same time, reduces the search points and reduces the search complexity.
[0117] In the embodiment, the encoding of the coding unit is completed by WPP processing logic based on the optimal block vector, specifically:
[0118] The encoding range of the IBC mode is limited in the WPP range, the optimal block vector and the WPP encoder are encoded first, then the filtering multi-thread processing is performed, and the encoding of the coding unit is completed in parallel.
[0119] In the embodiment, in the original WPP logic of the x265 encoder, the encoding thread and the filtering thread are processed in a cross parallel manner. Since the reference block in the IBC is the reconstructed pixel before the loop filtering in the current frame, the original WPP logic of the x265 encoder cannot be used.
[0120] In the embodiment, the WPP range restriction is first added to the IBC coding, and then in the WPP implementation, the encoding multi-thread processing is first performed, and then the filtering multi-thread processing is performed.
[0121] Please refer to Figure 3 , Figure 3 The WPP range restriction diagram of step 103 provided by the embodiment of the application.
[0122] In the embodiment, when the WPP parallel coding is started, the search range of the IBC coding needs to be limited in the gray area in Figure 3 , so that the ability of the WPP parallel processing can be avoided. The reference pixels of the IBC are the current frame, which may have a problem: when the IBC coding of the current frame is performed, the already coded part of the current frame is used as the reference, and the effective motion search area of it will be inevitably limited. In the HEVC-SCC coding, the search area limitation of the IBC is shown in Figure 3 . The white area is the part of the current frame which is neither coded nor decoded, and the gray area is the part which is already reconstructed, and the gray area is the search range available for the IBC mode.
[0123] Please refer to Figure 4 , Figure 4 The WPP optimized coding diagram of step 103 provided by the embodiment of the application.
[0124] In the embodiment, in the WPP, different CTB (coding tree block) rows need to be put into different operation units for processing, and therefore the coding order of the CTBs in different cores needs to be coordinated. The main method of the WPP is that after the CTB (1, 3) coding / decoding is completed, the dependent information required by the CTB (2, 2) has been coded / decoded, and similarly, after the CTB (2, 1) coding / decoding is completed, the coding / decoding information required by the CTB (3, 0) has also been coded / decoded. Therefore, the three CTB blocks of the CTB (1, 4), the CTB (2, 2) and the CTB (3, 0) can be respectively given to three different operation units for simultaneous coding / decoding. Therefore, by using the multi-cpu (central processing unit) core parallel processing of multiple rows, the coding process is accelerated. By using the WPP optimization in the IBC coding, the coding speed is accelerated by at least 50% or more.
[0125] The present application considers the complexity of encoding units in screen encoding content as a whole, judges the type of the current encoding unit according to the characteristics of the current encoding unit when the encoding unit is divided, and quickly selects the encoding mode and the division depth for encoding according to the type, reduces unnecessary rate-distortion optimization calculation, and improves the mode selection efficiency; when the prediction unit is encoded, the optimal block vector is quickly matched based on the IBC mode according to the size of the encoding unit, the complexity of IBC encoding is reduced, and the encoding process is optimized through WPP to reduce the encoding complexity.
[0126] Please refer to Figure 5 , Figure 5 A structural schematic diagram of an encoding device of an encoding unit provided by the embodiment of the present application mainly comprises an encoding unit type identification module 501, a mode selection module 502 and an encoding module 503.
[0127] The encoding unit type identification module 501 is used to acquire the current encoding unit, and determine the type of the encoding unit according to the characteristic information of the encoding unit.
[0128] The mode selection module 502 is used to select the encoding mode of the intra prediction process according to the type of the encoding unit, and determine whether the calculation of the IBC mode is needed.
[0129] The encoding module 503 is used to complete the encoding of the encoding unit according to the encoding mode if the calculation of the IBC mode is not needed, search the optimal block vector according to the size of the encoding unit if the calculation of the IBC mode is needed, and complete the encoding of the encoding unit through the WPP processing logic based on the optimal block vector.
[0130] Please refer to Figure 6 , Figure 6 Another flowchart of an encoding method based on an encoding unit provided by the embodiment of the present application mainly comprises steps 601 to 604, and the details are as follows.
[0131] Step 601: maximum encoding unit / encoding unit type judgment, the type of the maximum encoding unit / encoding unit is judged according to the characteristic information of the maximum encoding unit / encoding unit.
[0132] Step 602: maximum encoding unit level fast division, the optimal depth range of the current maximum encoding unit / encoding unit is determined according to the type of the maximum encoding unit / encoding unit.
[0133] Step 603: fast mode selection at the encoding unit level, the encoding mode is selected according to the type of the current encoding unit.
[0134] Step 604: Intra fast mode selection, the Intra mode is selected according to the type of the current encoding unit.
[0135] Please refer to Figure 7 , Figure 7 Another structure schematic diagram of the coding device based on coding unit provided by the embodiment of the present application, mainly including the fast coding module 701 based on coding unit characteristics, the IBC module fast block vector search module 702 and the WPP optimization module 703.
[0136] The fast coding module 701 based on coding unit characteristics, firstly judges the type of the current coding unit according to the horizontal direction smoothness and the vertical direction smoothness and the Roberts gradient operator, and then carries out the maximum coding unit level fast coding unit division, the coding unit level fast mode selection and the Intra fast mode selection according to the current coding unit type.
[0137] The IBC mode fast block vector search module 702 adopts different fast BV (block vector) search schemes for different coding unit sizes, and the fast BV search schemes include the combination of the candidate MVC, one-dimensional search, small resolution Hash and diamond search. And the search range optimization and the early termination optimization based on RDcost are carried out for the one-dimensional search.
[0138] The WPP optimization module 703 adopts the WPP processing logic in the IBC coding, firstly carries out the coding multi-thread processing, and then carries out the filtering multi-thread processing, further accelerating the IBC coding process.
[0139] The above specific embodiments further explain the purpose, technical scheme and beneficial effects of the present application, and it should be understood that the above only is the specific embodiment of the present application, and is not used to limit the protection scope of the present application. It is particularly pointed out that for the person skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A coding method based on a coding unit, characterized by, The method comprises the following steps: obtaining a current coding unit, determining the type of the coding unit according to the characteristic information of the coding unit; selecting the coding mode of the intra prediction process according to the type of the coding unit, and determining whether the calculation of the IBC mode is needed; if the calculation of the IBC mode is not needed, completing the coding of the coding unit according to the coding mode, if the calculation of the IBC mode is needed, searching the optimal block vector according to the size of the coding unit, and completing the coding of the coding unit through the WPP processing logic based on the optimal block vector, specifically, limiting the coding range of the IBC mode in the WPP range, performing the multi-thread processing of the coding first according to the optimal block vector and the WPP encoder, then performing the multi-thread processing of the filtering, and completing the coding of the coding unit in parallel.
2. The coding method based on a coding unit according to claim 1, characterized by, The method for obtaining the current coding unit and determining the type of the coding unit according to the characteristic information of the coding unit comprises the following steps: calculating the horizontal smoothness and the vertical smoothness of the coding unit according to the characteristic information, if one of the horizontal smoothness or the vertical smoothness is 0, determining that the type of the coding unit is PSCU, otherwise, calculating the Roberts gradient of each pixel in the coding unit and the average gradient value of the coding unit according to the characteristic information, and determining the type of the coding unit in combination with the number of sharp edge points.
3. The coding method based on a coding unit according to claim 2, characterized by, The method for calculating the Roberts gradient of each pixel in the coding unit and the average gradient value of the coding unit according to the characteristic information, and determining the type of the coding unit in combination with the number of sharp edge points comprises the following steps: calculating the Roberts gradient of each pixel in the coding unit, and calculating the average gradient value and the number of sharp edge points of the coding unit; if the number of sharp edge points is greater than or equal to the first threshold value, determining that the coding unit is SCCU, if the number of sharp edge points is greater than or equal to 5 times the first threshold value, determining that the coding unit is SCCUC, otherwise, the coding unit is SCCUM; if the number of sharp edge points is less than the first threshold value, determining that the coding unit is NCCU, if the average gradient value is less than or equal to 5, determining that the coding unit is NCCUS, if the average gradient value is greater than 5 and less than 10, determining that the coding unit is NCCUM, and if the average gradient value is greater than 10, determining that the coding unit is NCCUC.
4. The coding method based on a coding unit according to claim 3, characterized by, The method for selecting the coding mode of the intra prediction process according to the type of the coding unit, and determining whether the calculation of the IBC mode is needed comprises the following steps: if the type of the coding unit is PSCU, the coding mode is determined as DC mode, Planar mode, horizontal direction mode, vertical direction mode, 45-degree direction mode and 135-degree direction mode, and the calculation of the IBC mode is skipped; if the type of the coding unit is SCCUM or SCCUC, the coding mode is determined as DC mode, Planar mode, horizontal direction mode, vertical direction mode, 45-degree direction mode and 135-degree direction mode, and the calculation of the IBC mode is performed. If the type of the coding unit is NCCU, the NCCU includes NCCUS, NCCUM and NCCUC, the coding mode is determined as all traditional intra prediction modes, the all traditional intra prediction modes include 35 kinds; and the calculation of IBC mode is skipped.
5. The coding method based on a coding unit according to Claim 1, characterized by, The optimal block vector is searched according to the size of the coding unit, specifically: The optimal block vector is searched according to the size of the coding unit, in combination with a fast search scheme, the fast search scheme includes candidate MVC search, one-dimensional search, small resolution Hash search and diamond search.
6. The coding method based on a coding unit according to Claim 1, characterized by, After the type of the coding unit is determined according to the feature information of the coding unit, the method further includes: The optimal coding partition depth of the coding unit is determined according to the type of the coding unit.
7. A method for encoding of video screen content, characterized by, The method includes: All coding units of video screen content are acquired, and the coding of each coding unit is completed by applying the coding method based on coding units according to any one of claims 1 to 6 multiple times until the coding of all coding units is completed.
8. An encoding apparatus based on a coding unit, characterized by, The method includes a coding unit type identification module, a mode selection module and a coding module; The coding unit type identification module is configured to acquire a current coding unit, and determine the type of the coding unit according to the feature information of the coding unit; The mode selection module is configured to select a coding mode of an intra prediction process according to the type of the coding unit, and determine whether the calculation of an IBC mode is needed; The coding module is configured to, if the calculation of the IBC mode is not needed, complete the coding of the coding unit according to the coding mode, and if the calculation of the IBC mode is needed, search for an optimal block vector according to the size of the coding unit; and complete the coding of the coding unit by WPP processing logic based on the optimal block vector, specifically: limit the coding range of the IBC mode in the WPP range, perform multi-thread processing of coding according to the optimal block vector and the WPP encoder first, then perform multi-thread processing of filtering, and complete the coding of the coding unit in parallel.
9. A computer device, comprising: The method includes: A processor, a communication interface and a memory, the processor, the communication interface and the memory are connected with each other, wherein the memory stores executable program code, the processor is configured to invoke the executable program code, and execute the coding method based on coding units according to any one of claims 1 to 6, or execute the coding method for video screen content according to claim 7.
Citation Information
Patent Citations
HEVC coding size rapid determining method based on texture complexity
CN103957421A
Fast intra-frame prediction method based on screen content
CN107277509A
Intra-block copy searching
CN107409220A