Video coding device and video coding method

The video encoding device addresses buffer overflow risks by calculating cost values for block size combinations with offset adjustments to favor larger blocks, ensuring efficient data storage and maintaining image quality in detailed scenes.

JP2024115731AActive Publication Date: 2024-08-27NTT INNOVATIVE DEVICES CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2023021544
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-02-15
Publication Date
2024-08-27
Estimated Expiration
2043-02-15

AI Technical Summary

Technical Problem

Conventional CU selection methods in video encoding do not sufficiently reduce the amount of code, leading to a risk of buffer failure during data storage, especially in scenes with detailed pictures where the number of blocks increases, potentially causing storage buffer overflow.

Method used

A video encoding device that calculates cost values for combinations of blocks of different sizes, using an offset value to increase the occurrence of larger block sizes and reduce the number of CUs, thereby minimizing the risk of buffer failure by suppressing the increase in the number of blocks and overall code amount.

Benefits of technology

The method effectively reduces the possibility of buffer failure by favoring larger block sizes, thereby reducing the overall code amount and maintaining acceptable image quality, even in scenes with high detail, thus preventing data overflow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024115731000001_ABST
    Figure 2024115731000001_ABST
Patent Text Reader

Abstract

To improve the possibility of buffer failure occurring when encoding video data.SOLUTION: A video coding device 1 includes: a coding circuit 11 that encodes a video in blocks for each image on the basis of combinations of blocks of different sizes, and calculates the cost value of each of a plurality of candidate combinations in which the blocks are arbitrarily combined; and a buffer circuit 12 that stores coded data for the images encoded in blocks; an offset calculation circuit 13 that calculates an offset value on the basis of the remaining buffer capacity of the buffer circuit and the number of blocks in one image or an index corresponding to the number of blocks in one image; and a block size determination circuit 14 that determines a combination for encoding from among the plurality of candidate combinations on the basis of each of the cost values including the offset value.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to a video encoding device and a video encoding method. [Background technology]

[0002] Video signals are encoded in units of blocks. In H.264, encoding is done in units of 16 x 16 pixels called MB (Macro Block).

[0003] On the other hand, in HEVC (High Efficiency Video Coding), encoding is performed using four types of block sizes called CU (Coding Unit): 64x64 pixels, 32x32 pixels, 16x16 pixels, and 8x8 pixels. Specifically, a video signal is divided into CTUs (Coding Tree Units), and each CTU is divided into CUs of variable sizes. A CTU is expressed as a combination of CUs.

[0004] It is necessary to select an optimal combination of CUs based on the amount of calculation during encoding, the amount of code after encoding, the image quality after encoding, etc. Patent Documents 1 to 4 propose various CU selection methods.

[0005] Patent document 1 discloses a method for selecting a CU by calculating a variance value from the activity of an index that indicates the variation in the luminance values ​​of each pixel, in order from the largest block size of the CU to the smallest block size, and comparing the variance value with a threshold value.

[0006] In Patent Document 2, when calculating the RD (Rate Distortion) cost (a sum of the amount of generated information and flag information), the RD cost is calculated for all block sizes in the past, but the RD cost is calculated only for the block size determined after the processing operation of the pre-processing unit is performed. This reduces the number of processing times for cost calculation, which was previously required multiple times, to one, thereby reducing the amount of calculation required for encoding.

[0007] In Patent Document 3, the coding cost is calculated based on the prediction result of the prediction process, and the combination of the prediction mode and block size that minimizes the coding cost is selected. The coding cost is set to the value "D+λ·R" (D is the amount of distortion, λ is a predetermined value, and R is the amount of code). If it is difficult to calculate this value, the absolute difference or the like is used instead of D, and a provisional estimated amount of code is used for R.

[0008] Furthermore, Patent Document 3 discloses that by setting an offset value to the coding cost, when regions with different image features are mixed in a CTU, it is possible to suppress the mixing of complex regions and flat regions in one CU. In this case, it is shown that the offset value is added to suppress large block sizes and increase the occurrence rate of smaller block sizes, or to promote division into CUs.

[0009] Patent Document 4 discloses that in inter-frame prediction processing, an offset value for cost comparison of block size candidates is determined based on the hierarchical depth (Temporal ID) in the reference structure of the picture to be coded and statistical information on the motion vectors of the coded picture, and the block size candidates are appropriately narrowed down by the cost comparison, thereby reducing the amount of calculation required for motion search.

[0010] In this patent document 4, it is shown that by setting a negative offset value only for a 64x64 block size, a larger block size is more likely to be selected, so that a picture with a large amount of motion can be prevented from having a block size that is too small due to the motion dispersion, and a picture with a large Temporal ID can be expected to reduce the amount of coding by performing motion prediction with larger blocks. The offset value is determined using the Temporal ID. [Prior art documents] [Patent documents]

[0011] [Patent Document 1] JP 2015-109586 A [Patent Document 2] JP 2016-187140 A [Patent Document 3] JP 2017-005505 A [Patent Document 4] JP 2017-028337 A Summary of the Invention [Problem to be solved by the invention]

[0012] However, Patent Document 1 aims to reduce the amount of calculation in the CU selection process, and does not reduce the amount of code sufficiently. In particular, in a scene in which a fine pattern is to be coded, the block size becomes small and the number of blocks to be coded increases, so the overhead of the coded data increases, and the increase in the amount of code cannot be suppressed, which may cause a buffer failure in which the buffer that stores the coded data cannot store all the supplied data.

[0013] Patent Document 2 aims to reduce the number of times of cost calculation for selecting a CU. Even if there is a possibility of buffer overflow, the CU of the block size tentatively determined in pre-processing is maintained and processed as it is, so there are cases where it does not necessarily lead to a reduction in the amount of information, and the possibility of buffer overflow occurs.

[0014] The aim of Patent Document 3 is to prevent complex and flat regions from being mixed in one CU. To achieve this aim, an offset value is set in the cost calculation to increase the ratio of small block sizes and promote division into CUs. However, when the number of CUs is large, this does not necessarily lead to a reduction in the amount of coding, which may cause the buffer to burst.

[0015] Patent Document 4 aims to reduce the amount of processing required for inter-frame prediction processing without reducing encoding efficiency by appropriately narrowing down block size candidates and performing motion search processing. It is said that by setting a negative offset value only to the 64x64 block size during cost calculation, a large block size is more likely to be selected, and the amount of coding can be reduced. However, this is thought to be to suppress an increase in the amount of coding due to a reduction in the amount of processing, and the reduction in the amount of coding is not sufficient (such as the amount of processing required for intra-frame prediction processing), and there is a risk of buffer failure. In addition, the offset value is calculated from the temporal ID and motion vector statistics, so complex calculations are required.

[0016] In other words, the conventional CU selection method for the encoding process of a video signal does not reduce the amount of code sufficiently, so there was a problem that there was a non-negligible possibility of buffer failure in the buffer circuit that temporarily stores the encoded data when the encoded data was output.

[0017] The present disclosure has been made in consideration of the above circumstances, and aims to provide a technique capable of reducing the possibility of buffer failure occurring when encoding video data. [Means for solving the problem]

[0018] A video coding device according to one embodiment of the present disclosure includes a coding circuit that codes video on a block-by-block basis for each image based on a combination of blocks of different sizes and calculates each cost value of a plurality of candidate combinations obtained by arbitrarily combining the blocks; a buffer circuit that stores coded data of the images coded on a block-by-block basis; an offset calculation circuit that calculates an offset value based on the remaining buffer capacity of the buffer circuit and the number of blocks in an image or an index corresponding to the number of blocks in the image; and a block size determination circuit that determines a combination to be used for coding from the plurality of candidate combinations based on the each cost value including the offset value.

[0019] A video coding method according to one embodiment of the present disclosure is a video coding method performed by a video coding device, in which an encoding circuit encodes video on a block-by-block basis for each image based on a combination of blocks of different sizes and calculates cost values ​​for a plurality of candidate combinations that arbitrarily combine the blocks, a buffer circuit stores encoded data of the images encoded on a block-by-block basis, an offset calculation circuit calculates an offset value based on the remaining buffer capacity of the buffer circuit and the number of blocks in an image or an index corresponding to the number of blocks in the image, and a block size determination circuit determines a combination to be used for coding from among the plurality of candidate combinations based on the cost values ​​including the offset value. Effect of the Invention

[0020] According to the present disclosure, it is possible to provide a technique capable of reducing the possibility of a buffer failure occurring when encoding video data. [Brief description of the drawings]

[0021] [Figure 1] FIG. 1 illustrates an example of the configuration of a video encoding device. [Diagram 2] FIG. 2 is a diagram illustrating an example of the configuration of an intra / inter prediction circuit. [Diagram 3] FIG. 11 is a diagram illustrating an example of an example of a comparison of the amount of code depending on the block size; [Figure 4] FIG. 13 is a diagram illustrating an example of the configuration of a block size determination circuit. [Diagram 5] FIG. 1 is a diagram showing a processing flow of a video encoding method. [Figure 6] FIG. 13 is a diagram showing a calculation process flow of an offset value. [Figure 7] FIG. 13 is a diagram showing a process flow for comparing cost values ​​and selecting a combination of block sizes. [Figure 8] FIG. 8 is a diagram illustrating a process image of step S301 shown in FIG. 7. [Figure 9] FIG. 8 is a diagram showing a processing image of step S302 shown in FIG. 7. [Figure 10]FIG. 8 is a diagram showing a processing image of step S303 shown in FIG. 7. [Figure 11] FIG. 13 is a diagram showing the concept of how an offset value is applied. [Figure 12] FIG. 1 illustrates an embodiment of a video encoding device. [Figure 13] FIG. 13 is a diagram showing simulation results of the selection ratio of each block size number before and after the application of the present disclosure. [Figure 14] FIG. 13 is a diagram showing the signal-to-noise ratio before and after application of the present disclosure. [Figure 15] 11A and 11B are diagrams showing remaining buffer capacity before and after the application of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0022] Hereinafter, an embodiment of the present disclosure will be described with reference to the drawings. In the description of the drawings, the same parts are given the same reference numerals and the description will be omitted.

[0023] [Summary of this disclosure] In Patent Document 3, an offset value is set in the coding cost to increase the occurrence rate of small block sizes (increase the number of CUs). In contrast, the present disclosure is characterized in that an offset value is set in the coding cost to increase the occurrence rate of large block sizes (reduce the number of CUs). In this regard, while Patent Document 4 increases the occurrence rate of large block sizes, the present disclosure is characterized in that an offset value is set so as to prevent buffer failure in a buffer circuit that accumulates encoded data.

[0024] Hereinafter, a video encoding device according to this embodiment will be described. The video encoding device according to this embodiment is a video encoding device based on HEVC or a standard conforming to HEVC. In this embodiment, a case where video encoding is performed based on HEVC will be described as an example. However, this is applicable to a video encoding device or video encoding method in which a basic unit of encoding is defined by a plurality of block sizes, such as a CU in HEVC, and the plurality of block sizes are combined to perform video encoding for each picture (image).

[0025] [Example of video encoding device configuration] 1 is a diagram showing an example of the configuration of a video encoding device 1 according to this embodiment. The video encoding device 1 includes an encoding circuit 11, a buffer circuit 12, an offset calculation circuit 13, and a block size determination circuit .

[0026] [Encoding circuit 11] The encoding circuit 11 is a circuit that encodes image data input to the video encoding device 1 for each picture, and further for each CTU into which the picture is divided, in units of CU blocks. The encoding circuit 11 includes a prediction residual generation unit 111, a DCT (Discrete Cosine Transform) conversion unit 112, a quantization unit 113, a variable length encoding unit 114, an inverse quantization unit 115, an inverse DCT unit 116, a decoding unit 117, and an intra / inter prediction circuit 118.

[0027] The prediction residual generation unit 111 generates a prediction residual signal that is a difference between the image data input to the video encoding device 1 and the prediction signal output from the intra / inter prediction circuit 118. Then, the DCT conversion unit 112, the quantization unit 113, and the variable length encoding unit 114 encode the prediction residual signal, and the encoded data is stored in the buffer circuit 12.

[0028] At this time, the decoding unit 117 generates a decoded signal indicating actual video data based on the prediction residual signal restored by the inverse quantization unit 115 and the inverse DCT unit 116 and a prediction signal previously predicted by the intra / inter prediction circuit 118. At this time, a decoded signal for one picture is generated. After that, the intra / inter prediction circuit 118 generates the next prediction signal again based on the decoded signal for that one picture or multiple pictures.

[0029] Note that "prediction" means the time t r The term "prediction signal" refers to predicting an image frame at time t from an image frame at time t. r The image frame at time t is predicted based on the image frame at time t. r"t" refers to a time earlier than time t in the coding order. "Prediction residual signal" is a signal of the difference between a predicted image frame at time t and an image frame at time t. The more accurate the prediction, the smaller the prediction residual signal.

[0030] The above operation is a basic operation of encoding performed in HEVC. The encoding circuit 11 shown in Fig. 1 is a typical example for encoding in HEVC. The encoding circuit 11 is not limited to the configuration shown in Fig. 1, and may have other configurations as long as it can execute HEVC encoding.

[0031] [Buffer circuit 12] The buffer circuit 12 is a circuit that temporarily stores the encoded data encoded for each CTU by the encoding circuit 11 for one picture or multiple pictures, and outputs the stored encoded data for one picture or multiple pictures from the video encoding device 1 to the outside.

[0032] [Intra / inter prediction circuit 118 of encoding circuit 11] A description will now be given of the intra / inter prediction circuit 118 constituting the encoding circuit 11. As described above, the intra / inter prediction circuit 118 is a circuit that generates the next predicted signal again based on a decoded signal for one picture.

[0033] The encoding circuit 11 performs encoding for each CTU obtained by dividing one picture into CTUs. In HEVC, the CTUs are further divided into CUs, and encoding is performed for each CU. The encoded data generated by encoding for each CU is synthesized to become the encoded data for the CTU.

[0034] HEVC specifies four types of CU block sizes: 64×64 pixels, 32×32 pixels, 16×16 pixels, and 8×8 pixels. Hereinafter, these will be expressed as 64×64, 32×32, 16×16, and 8×8, respectively. The division of a CTU into CUs is performed based on the result of the block size determination by the block size determination circuit 14.

[0035] 2 is a diagram showing an example of the configuration of the intra / inter prediction circuit 118. The intra / inter prediction circuit 118 includes a prediction signal candidate generation unit 1181 and a prediction signal determination unit 1182.

[0036] The prediction signal candidate generation unit 1181 generates prediction signal candidates for combinations of block sizes of CUs that can be candidates at the time of prediction by the intra / inter prediction circuit 118, and supplies the generated prediction signal candidates to the prediction signal determination unit 1182. At this time, the prediction signal candidate generation unit 1181 calculates cost values ​​corresponding to each of the generated prediction signal candidates, and supplies the calculated cost value of each prediction signal candidate to the block size determination circuit 14.

[0037] The prediction signal determination unit 1182 selects a prediction signal candidate corresponding to the determined block size determined by the block size determination circuit 14 from the multiple prediction signal candidates supplied from the prediction signal candidate generation unit 1181, and outputs the selected prediction signal candidate as a prediction signal to the prediction residual generation unit 111 and the decoding unit 117.

[0038] [Cost value] The cost value is an index or evaluation value that indicates the video quality, image quality, and code amount of the encoded data. It is the cost related to encoding, and is also called the encoding cost.

[0039] For example, as shown in Patent Document 3, the cost value is calculated as "D+λ·R" (D is the amount of distortion, λ is a predetermined value, and R is the amount of code). Instead of D, the sum of absolute differences (SAD value: Sum of Absolute Difference) or the sum of absolute differences after Hadamard transformation (SATD value: Sum of Absolute Transformed Difference) may be used. For R, a provisional estimated amount of code may be used.

[0040] The cost value is not limited to a value that directly indicates the amount of degradation in video quality or the amount of code, as long as it corresponds to the amount of degradation or the amount of code, and other parameters associated with them may also be used.

[0041] A smaller cost value indicates that encoding can be performed with a smaller amount of code and with less image degradation (higher image quality). Generally, the smaller the block size, the smaller the cost value. Therefore, when the block size determination circuit 14 determines the block size of a CU, it basically selects a combination of block sizes that results in a smaller cost value (smaller block size).

[0042] [How to choose block size] On the other hand, a larger block size (fewer CUs) may have a smaller total code amount. A comparison example of code amount depending on the block size (number of CUs) is shown in Figure 3. Figure 3(a) is a diagram showing the code amount of four 8x8 blocks. Figure 3(b) is a diagram showing the code amount of one 16x16 block. Figure 3(a) shows the case where one 16x16 block is divided into four 8x8 blocks.

[0043] Each code amount is mainly composed of coeff and overhead (OH). coeff is the code amount of the coded data obtained by coding the prediction residual, and directly contributes to the image. OH is auxiliary information that does not directly contribute to the image, and is required for each CU. OH is an almost constant amount regardless of the size of the CU.

[0044] The right side of Fig. 3 also shows a case where coeff is reduced, for example, to 1 / 2, by reducing the amount of code. In this case, OH does not contribute to the reduction in the amount of code. Note that the reduction in the amount of code can be achieved, for example, by increasing the QP (Quantization Parameter) value of the step in the quantization unit 113.

[0045] Generally, the smaller the block size, the smaller the prediction residual, so the coeff tends to be smaller, and the total amount of code, including OH, is smaller for four 8×8 blocks than for one 16×16 block.

[0046] However, if the amount of code for coeff is reduced to, for example, half for each, the total amount of code is smaller for 16x16. This is because when the block size is small (the number of CUs is large), the number of OHs that do not contribute to the reduction in the amount of code increases accordingly, so the overall reduction in the amount of code is smaller. In this case, the effect of reducing the amount of code is greater for larger block sizes.

[0047] Therefore, when the amount of code is reduced, it can be said that a larger block size may result in a smaller total amount of code. Therefore, in a situation where a buffer failure occurs in the buffer circuit 12, it is possible to suppress the buffer failure by selecting a larger block size. Although some degradation in image quality is expected due to the selection of a large block size, it is considered to be within an acceptable range compared to the image quality degradation due to buffer failure.

[0048] Specifically, an offset value that induces an increase in the occurrence ratio of larger block sizes (reduces the number of CUs) is calculated in the offset calculation circuit 13. Then, the block size determination circuit 14 selects a combination of block sizes that minimizes the cost value after adding the offset.

[0049] The offset calculation circuit 13 and the block size determination circuit 14 will now be described.

[0050] [Offset calculation circuit 13] The offset calculation circuit 13 is a circuit that calculates an offset value. Specifically, the offset calculation circuit 13 calculates an offset value for each block size that induces a larger block size (fewer number of CUs) to be selected based on the number of CUs in one picture and the buffer occupancy (remaining buffer amount) of the buffer circuit 12.

[0051] Instead of the number of CUs in one picture, the overhead ratio (OH ratio) of the amount of code in one picture may be used because the OH ratio is associated with the number of CUs as shown in FIG.

[0052] Here is an example to supplement the "number of CUs in one picture" and the "overhead ratio (OH ratio) of the amount of code in one picture." The number of CUs and the OH ratio are calculated for each picture. For example, the number of CUs in the amount of code for four 8x8 frames is 4. The OH ratio in the amount of code for four 8x8 frames is calculated as "amount of data for four OH frames / {amount of data (4 coeffs + 4 OH frames) (=total amount of code)}."

[0053] The offset value is supplied to a block size determination circuit 14. A specific method for calculating the offset value will be described later.

[0054] [Block size determination circuit 14] The block size determination circuit 14 is a circuit that determines a combination of divisions of CTUs into block sizes of CUs. The combination of block sizes of CUs is determined based on the cost value of each combination supplied from the intra / inter prediction circuit 118 and the offset value supplied from the offset calculation circuit 13.

[0055] As described above, the cost value is an evaluation value that indicates the amount of code and image quality (amount of distortion, etc.) when encoding. The smaller the cost value, the lower the amount of code and distortion, and the better the encoding efficiency.

[0056] 4 is a diagram showing an example of the configuration of the block size determination circuit 14. The block size determination circuit 14 includes an addition unit 141 and a size selection unit 142.

[0057] The adder 141 adds the offset value from the offset calculation circuit 13 to the cost value from the intra / inter prediction circuit 118. Note that instead of addition, arithmetic operations such as multiplication or multiplication by a coefficient may be performed.

[0058] The size selection unit 142 compares the cost values ​​after the offset value is added among a plurality of combinations, and selects a combination of block sizes that minimizes the cost value after the offset value is added. The size selection unit 142 supplies the selected combination of block sizes as a determined block size to the prediction signal determination unit 1182. A specific method of comparing the cost values ​​and a method of selecting a combination of block sizes will be described later.

[0059] Adding the offset value to the cost value directs the selection of a combination of block sizes. In this embodiment, the selection is guided to favor larger block sizes. As described above, the offset value is determined based on the number of CUs in one picture and the buffer occupancy (buffer remaining capacity) of the buffer circuit 12. If the number of CUs cannot be obtained, it can be estimated from the OH ratio of the code amount for one picture.

[0060] In this way, by selecting a larger block size, it is possible to suppress two problems: an increase in the number of CUs in one picture, and an increase in the amount of code due to a resulting increase in the number of OHs.

[0061] Generally, the amount of code in the encoding is reduced in the encoding circuit 11. Examples of the amount of code reduction include the above-mentioned method of increasing the QP value of the step in the quantization unit 113, and the method of cutting high frequency components by adjusting the scaling list of the quantization unit 113. However, even if these attempts are made to reduce the amount of code, there are cases in which the amount of code exceeds the storage capacity of the buffer circuit 12, causing a buffer failure in which not all of the encoded data is transmitted from the video encoding device 1.

[0062] On the other hand, in this embodiment, when performing coding after intra / inter prediction, a larger block size is selected when selecting a combination of block sizes of CUs, so that it is possible to suppress an increase in the amount of code due to an increase in the number of CUs or an increase in the OH ratio, and it is possible to eliminate buffer collapse. The video coding device 1 according to this embodiment can be applied to a case where buffer collapse occurs even if the amount of code is reduced.

[0063] [Operation of video encoding device 1] FIG. 5 is a diagram showing a process flow of the video encoding method performed by the video encoding device 1.

[0064] Step S101; First, the encoding circuit 11 encodes the video data for each picture in units of blocks based on the determined block size, and the buffer circuit 12 temporarily stores the encoded data for each picture that has been encoded in units of blocks.

[0065] In this case, the encoding circuit 11 generates a plurality of prediction signal candidates corresponding to a plurality of combination candidates obtained by arbitrarily combining the blocks, calculates cost values ​​corresponding to each of the generated prediction signal candidates, and supplies the calculated cost values ​​of each prediction signal candidate to the block size determination circuit 14.

[0066] Step S102; Next, the offset calculation circuit 13 determines an offset value that is set to a larger value the greater the number of CUs and the greater the buffer occupancy (remaining buffer space) of the buffer circuit 12, as described below, based on the number of CUs in one picture and the buffer occupancy (remaining buffer space), and supplies the determined offset value to the block size determination circuit 14.

[0067] Step S103; Next, the block size determination circuit 14 adds an offset value to the cost value of each prediction signal candidate, compares the cost values ​​after the offset values ​​are added among the multiple prediction signal candidates, selects the prediction signal candidate with the smallest cost value, determines the selected prediction signal candidate as the determined block size (block size combination for encoding), and supplies it to the encoding circuit 11.

[0068] Step S104; Finally, the encoding circuit 11 selects a prediction signal candidate corresponding to the determined block size, uses the selected prediction signal candidate as a prediction signal, generates and encodes the difference between the prediction signal and the image data input to the video encoding device 1 as a prediction residual signal, and stores the encoded encoding data in the buffer circuit 12.

[0069] [Operation of offset calculation circuit 13] 6 is a diagram showing a flow of calculation processing of offset values ​​performed by the offset calculation circuit 13. In the diagram, offset 8, offset 16, offset 32, and offset 64 indicate offset values ​​to be added to each cost value of block sizes 8×8, 16×16, 32×32, and 64×64, respectively. Within one picture, offsets of the same block size can be the same regardless of CTU or CU.

[0070] In addition, four offsets (0, a, b, c) are set for each block size depending on the storage status of the buffer circuit 12 and the status of the number of CUs per picture. The magnitude of the offsets (0, a, b, c) is 0 for the same block size. <a<b<cとする。

[0071] According to the following algorithm, the offset calculation circuit 13 calculates an offset value for each picture from the breakdown state of the buffer circuit 12 and the state of the number of CUs.

[0072] Step S201; First, the offset calculation circuit 13 judges whether or not a buffer failure has occurred in the buffer circuit 12.

[0073] Step S202; Next, if the buffer has not collapsed (buffer remaining capacity≧α), the offset calculation circuit 13 determines whether or not there is a possibility of the buffer collapsing after several seconds.

[0074] Step S203; Next, if there is a possibility of buffer collapse in a few seconds (buffer remaining capacity<β), the offset calculation circuit 13 determines whether the number of CUs is large or not.

[0075] Step S204; When a buffer failure occurs (buffer remaining capacity<α), the offset calculation circuit 13 sets c8 to c64 to offset 8 to offset 64, respectively (setting offset c), regardless of the number of CUs.

[0076] Step S205; If buffer failure has not occurred (buffer remaining capacity ≧α) but there is a possibility of buffer failure in a few seconds (buffer remaining capacity<β) and the number of CUs is large (OH ratio ≧γ), the offset calculation circuit 13 sets b8 to b64 to offset 8 to offset 64, respectively (setting offset b).

[0077] Step S206; If buffer failure has not occurred (buffer remaining capacity ≧α) but there is a possibility of buffer failure in a few seconds (buffer remaining capacity<β) and the number of CUs is small (OH ratio<γ), the offset calculation circuit 13 sets offset 8 to offset 64 to a8 to a64, respectively (setting offset a).

[0078] Step S207; If there is no possibility of buffer collapse after several seconds (buffer remaining capacity ≧β), the offset calculation circuit 13 sets offset 8 to offset 64 to 0 (offset 0 setting) regardless of the number of CUs. Setting offset 0 is the case when no offset is set.

[0079] Note that α, β, and γ are empirically determined values. For example, α can be set to 0 or a value close to 0 (negative values ​​are also possible), β can be set to a value relatively close to 0, and γ can be set to several tens of percent.

[0080] In addition, the number of CUs per picture can be inferred from the ratio of the coding amount of OH to the overall coding amount. Since there is a correlation between the number of CUs and the ratio of OH, the condition of the number of CUs can be replaced with the condition of the ratio of OH. The OH ratio is the proportion of the coding amount of OH in the overall coding amount. Since the coding amount of OH is almost constant regardless of the block size, for example, it can be seen that when the OH ratio is high, the number of CUs tends to be large. From this, the trend of the number of CUs can be inferred. In addition to the OH ratio, if there is a parameter correlated with the number of CUs, it can also be used.

[0081] In the flowchart shown in FIG. 6, the larger the number of CUs and the higher the possibility of buffer overflow, the larger the offset value is set (0 < a < b < c). The smaller the number of CUs and the lower the possibility of buffer overflow, the smaller the offset value is set. That is, when the number of CUs is large (i.e., when the block size is small), the offset value is set relatively large.

[0082] That is, in the block size determination circuit 14, the offset value is added to the cost value, and by making the offset for the smaller block size relatively large, a larger block size is more likely to be selected. Thereby, the possibility of buffer overflow can be reduced.

[0083] Note that the offsets a8 to a64, b8 to b64, and c8 to c64 are set to values smaller than the existing cost value. If a value larger than the existing cost value is set, the offset becomes more dominant than the cost value, exceeding the fine-tuning range which is the original role of the offset.

[0084] [Operation of the size selection unit 142 of the block size determination circuit 14] FIG. 7 is a diagram showing the processing flow of cost value comparison and block size combination selection performed by the size selection unit 142 of the block size determination circuit 14.

[0085] The size selection unit 142 adds the offset determined by the offset calculation circuit 13 to all cost values ​​of the prediction signal candidates for the combination of CU block sizes generated by the prediction signal candidate generation unit 1181 of the intra / inter prediction circuit 118, compares the cost values ​​after adding the offset between the prediction signal candidates, and selects the optimal prediction signal candidate.

[0086] The comparison and selection operation in the size selection unit 142 is performed in the following steps. Here, a case where the CTU is 64×64 and is divided into sixteen 16×16 pieces will be described.

[0087] Step S301; First, the size selection unit 142 compares the cost value + offset value for each of the 16 16x16 patterns divided into four 8x8 patterns and one 16x16 pattern without division. The cost value of the four 8x8 patterns is the sum of the cost value + offset. Then, the CU division pattern with the smaller value is selected. This is performed for the 16 16x16 patterns.

[0088] Step S302; Next, the size selection unit 142 compares the cost value + offset for the 16 CU partition patterns selected in step S301 and a 32x32 pattern without partitioning. The cost value of the 16 CU partition patterns is the total value of the cost value + offset of the pattern selected in step S301. Then, the CU partition pattern with the smaller value is selected. This is performed for the four 32x32 patterns.

[0089] Step S303; Finally, size selection unit 142 compares the cost value + offset for the four CU partition patterns selected in step S302 with a 64 x 64 non-partitioned pattern. The cost value of the four CU partition patterns is the total value of the cost value + offset of the pattern selected in step S302. Then, the CU partition pattern with the smaller value is selected.

[0090] (Operation of step S301) FIG. 8 is a diagram showing a process image of step S301.

[0091] When the larger size is divided into four, the upper left block is indicated as block A, the upper right block is indicated as block B, the lower left block is indicated as block C, and the lower right block is indicated as block D.

[0092] Also, a cost n_M is defined as a cost value of n×n in block M (=A to D) when the block is divided into four of the higher size, and an offset n is defined as an offset with respect to the size n×n in the picture.

[0093] However, even if the cost n_M has the same name, the value will be different if the upper block is different. For example, cost 8_A is the cost value of 8×8 in 16×16 block A, and offset 8 is the offset for size 8×8. However, although the 8×8 in 16×16 block A exists in 32×32 block A and block B, the cost 8_A values ​​are not the same. However, the offset 8 is common.

[0094] As shown in FIG. 8(a), of the four 16×16 blocks, the cost values ​​of block A are compared between a pattern in which it is divided into four 8×8 blocks and a pattern in which it is left undivided as a 16×16 block. The cost value of the four 8×8 blocks is the sum of cost 8_A+offset 8, cost 8_B+offset 8, cost 8_C+offset 8, and cost 8_D+offset 8. In contrast, the cost value of an undivided 16×16 block is cost 16_A+offset 16. Here, the two cost values ​​are compared and the smaller size pattern is selected.

[0095] Similarly, for blocks B, C, and D in Figure 8(b), (c), and (d), the total cost value of the four 8x8 patterns is compared with the cost value of the undivided 16x16 pattern, and the smaller size pattern is selected. This selection situation changes depending on the situation of the image.

[0096] (Operation of step S302) FIG. 9 is a diagram showing a process image of step S302.

[0097] In the operation of step S301 shown in Fig. 7, a selection is made between an 8x8 pattern divided into four parts, or a 16x16 pattern without division. In step S302 shown in Fig. 9, a selection is made between the four divided 16x16 parts being the pattern selected in step S301, or a 32x32 pattern without division. The definitions of cost n_M and offset n are the same as those shown in the explanation of Fig. 8.

[0098] In Fig. 9(a), for block A out of the four 32x32 blocks, the cost values ​​are compared between a pattern in which block A is divided into four 16x16 blocks and a 32x32 pattern without division. The cost value of the four 16x16 blocks is the total sum of the total cost of the pattern of block A selected in step S301, the total cost of the pattern of block B selected in step S301, the total cost of the pattern of block C selected in step S301, and the total cost of the pattern of block D selected in step S301. On the other hand, the cost value of the 32x32 pattern without division is cost 32_A + offset 32. Here, the cost values ​​of both are compared and the smaller size pattern is selected.

[0099] Also, for Figures 9(b), (c), and (d), for blocks B, C, and D out of the four 32x32 patterns, the sum of the cost values ​​of the four 16x16 patterns is similarly compared with the cost value of the undivided 32x32 pattern, and the smaller size pattern is selected.

[0100] (Operation of step S303) FIG. 10 is a diagram showing an image of the process in step S303.

[0101] In the operation of step S302 shown in Fig. 9, a selection is made between a 16x16 pattern divided into four parts, or a 32x32 pattern without division. In step S303 shown in Fig. 10, a selection is made between making each of the four divided 32x32 parts into the pattern selected in step S302, or leaving it as a 64x64 pattern without division. The cost n_M and offset n are the same as those shown in the explanation of Fig. 8.

[0102] In FIG. 10(a), the cost values ​​of a pattern in which 64×64 is divided into four 32×32 patterns and an undivided 64×64 pattern are compared. The cost value of the four 32×32 patterns is the total sum of the total cost of the pattern of block A selected in step S302, the total cost of the pattern of block B selected in step S302, the total cost of the pattern of block C selected in step S302, and the total cost of the pattern of block D selected in step S302. On the other hand, the cost value of an undivided 64×64 pattern is cost 64+offset 64. Here, the two cost values ​​are compared and the smaller size pattern is selected. Note that the cost of 64 does not have "_M" attached because there is no higher size.

[0103] 10(b) shows an example of a finally selected CU partition pattern. In this example, in step S301, four 8×8 patterns are selected for 64×64 block A and its 32×32 block A, a 16×16 pattern is selected for 64×64 block A and its 32×32 blocks B, C, and D, in step S302, 64×64 block A is selected as is, and 32×32 patterns are selected for 64×64 blocks B, C, and D, respectively, and in step S303, 64×64 blocks A, B, C, and D are selected as is. As a result, a smaller CU block size is selected in the upper left direction in 64×64.

[0104] [How offset values ​​are applied] FIG. 11 is a diagram showing the concept of how the offset value is applied.

[0105] When comparing cost values ​​of block sizes within 64x64, if there are multiple 8x8, 16x16, and 32x32, a common offset value is added to each. Also, the same offset value is added to the same block size within a single picture.

[0106] [Example] FIG. 12 is a diagram showing an example of the video encoding device 1 according to the present embodiment.

[0107] Fig. 12 illustrates an example of setting specific cost values ​​and offsets in step S301 shown in Fig. 8. In step S301, the cost value when a 16x16 block A of 32x32 is divided into four 8x8 blocks (blocks A to D) is compared with the cost value of an undivided 16x16 block.

[0108] Fig. 12(a) shows a comparison of only the cost values ​​without adding offset values. Fig. 12(b) shows a comparison of the cost values ​​after adding offset values. Note that the 8x8 cost values, cost8_A to cost8_D, are calculated as 100, which is common to blocks A to D, and the 16x16 cost value, cost16_A, of block A is calculated as 410. Also, offset8, which is the offset of 8x8, is calculated as 5, and offset16, which is the offset of 16x16, is calculated as 3.

[0109] In Fig. 12(a), the sum of the four 8x8 cost values ​​is 100x4=400. When this is compared with the 16x16 cost value 410, the former is smaller. Therefore, in this case, the four 8x8 patterns are selected.

[0110] On the other hand, in Figure 12(b), the sum of the four 8x8 cost values ​​+ offsets is (100 + 5) x 4 = 420. When comparing this with the 16x16 cost value + offset of 410 + 3 = 413, the latter is smaller. Therefore, in this case, the 16x16 pattern is selected.

[0111] In this way, by adding an offset value to the cost value, a larger block size becomes more likely to be selected. The offset value is set according to the algorithm shown in FIG. 6, but the value is empirically determined. Offset values ​​are set in the same manner in other steps. The greater the number of CUs and the greater the possibility of failure of the buffer circuit 12, the larger the offset value is added to the cost value, which leads to a tendency for a larger block size to be selected.

[0112] [Simulation results and effects of the embodiment] 13 is a diagram showing simulation results of the selection ratio of each block size number before and after the application of the present disclosure. Fig. 13(a) shows the selection ratio of block sizes in a conventional video encoding device to which the present disclosure is not applied. Fig. 13(b) shows the selection ratio of block sizes in a video encoding device to which the present disclosure is applied.

[0113] In both cases, the horizontal axis indicates the number of pictures. The vertical axis indicates the ratio of the number of each block size per picture. The number of pictures corresponds to the passage of time. The higher the value on the vertical axis, the more frequently that block size is selected in the target video scene.

[0114] This simulation was performed on the video scene where the marathon starts. In particular, the latter video scene P1 is a scene where confetti falls at the start of the marathon. In the scene where confetti falls, the image patterns are fine, so the block size tends to be small to represent them.

[0115] In Fig. 13(a), where the present disclosure is not applied, in this video scene P1, 16x16 stands out in addition to 32x32, while 64x64 is reduced. There is also some 8x8. On the other hand, in Fig. 13(b), where the present disclosure is applied, in a similar video scene P1, 16x16 and 8x8 are reduced, while 64x64 and 32x32 are increased.

[0116] From this result, it can be seen that in the video encoding device 1 to which the present disclosure is applied, in a scene in which small block sizes are prevalent, if the possibility of failure of the buffer circuit 12 is estimated, a large block size is likely to be selected, which leads to a reduction in the amount of code and the elimination of failure of the buffer circuit 12.

[0117] FIG. 14 is a diagram showing the SNR of the image encoding device before and after the application of the present disclosure.

[0118] Fig. 14(a) shows a case where the present disclosure is not applied. Fig. 14(b) shows a case where the present disclosure is applied. The horizontal axis shows the number of pictures per video scene, i.e., the time course of the video. The vertical axis shows the simulation result of the SNR of the video after encoding. The SNR indicates the signal-to-distortion ratio, and the lower the SNR, the greater the degradation of the image quality.

[0119] When the present disclosure is not applied, the S / N ratio is significantly degraded in the second half of the marathon video scene P2 and in the water polo video scene P3 due to buffer failure of the buffer circuit 12. However, by applying the present disclosure, it can be seen that the S / N ratio is significantly improved in similar video scenes P2 and P3.

[0120] FIG. 15 is a diagram showing the remaining buffer capacity of an image encoding device before and after the application of the present disclosure. Simulation results of the state of the buffer circuit are shown. FIG. 15(a) shows the case where the present disclosure is not applied. FIG. 15(b) shows the case where the present disclosure is applied. The horizontal axis shows the number of pictures, that is, the passage of time of the video. The vertical axis shows the remaining buffer capacity of the buffer circuit 12. In particular, in this example, the portion where the remaining buffer capacity is zero or less is set as a state where the buffer circuit 12 has failed.

[0121] When the present disclosure is not applied, the buffer remaining capacity becomes zero or less and the buffer collapses in the latter video scene P4 as shown in Fig. 15(a). On the other hand, when the present disclosure is applied, the buffer remaining capacity becomes zero or more and the buffer collapse is resolved in the video scene P4 where the buffer collapses in Fig. 15(a) as shown in Fig. 15(b).

[0122] [Means, actions and effects of this embodiment] The video encoding device 1 according to the present disclosure calculates an offset value according to the storage status of encoded data in the buffer circuit 12 and the number of CUs in one picture, adds the calculated offset value to the cost value of each candidate combination of block sizes of CUs, and selects the combination of block sizes that has the smallest cost value after adding the offset value.

[0123] The offset value is set to a larger value as the number of CUs increases and the possibility of buffer failure increases, and the offset value is set to a smaller value as the number of CUs decreases and the possibility of buffer failure decreases. In other words, when the number of CUs is large (i.e., when the block size is small), the offset value is set to a relatively large value.

[0124] Basically, the combination of block sizes is determined so that the cost value is small (the block size is small), but by adding the above offset value to the cost value and making the offset for the smaller block size relatively large, it becomes easier to select a larger block size.

[0125] This makes it possible to induce a larger block size to be selected more easily when there is a high possibility of the buffer circuit 12 bursting, thereby reducing the total amount of code and suppressing the buffer circuit 12 from bursting.

[0126] [Effects of this disclosure] According to the present disclosure, a video encoding device 1 includes an encoding circuit 11 that encodes video on a block-by-block basis for each image based on a combination of blocks of different sizes and calculates each cost value of a plurality of candidate combinations obtained by arbitrarily combining the blocks, a buffer circuit 12 that accumulates encoded data of the image encoded on a block-by-block basis, an offset calculation circuit 13 that calculates an offset value based on the remaining buffer capacity of the buffer circuit and the number of blocks in one image or an index corresponding to the number of blocks in one image, and a block size determination circuit 14 that determines a combination to be used for encoding from among the plurality of candidate combinations based on the each cost value including the offset value, thereby reducing the possibility of buffer failure occurring when encoding video data.

[0127] According to the present disclosure, the index corresponding to the number of blocks in one image is the ratio of the data amount of all overhead of all encoded data to the data amount of all encoded data and the data amount of all overhead of all encoded data in one image, thereby reducing the possibility of buffer failure occurring when encoding video data.

[0128] According to the present disclosure, the offset value is a first value when the buffer remaining amount of the buffer circuit is less than a first threshold, a second value when the buffer remaining amount of the buffer circuit is equal to or greater than the first threshold and less than a second threshold and the number of blocks in the one image is large, a third value when the buffer remaining amount of the buffer circuit is equal to or greater than the first threshold and less than the second threshold and the number of blocks in the one image is small, and a zero value when the buffer remaining amount of the buffer circuit is equal to or greater than the second threshold, the first value being greater than the second value, the second value being greater than the third value, and the third value being greater than the zero, thereby reducing the possibility of a buffer failure occurring when encoding video data.

[0129] According to the present disclosure, since the cost value is a value related to at least one of the code amount and the video quality, it is possible to reduce the possibility of a buffer failure occurring when encoding video data.

[0130] According to the present disclosure, the cost value is a value related to at least one of the amount of code and the amount of distortion of the image, and the block size determination circuit determines the combination candidate having the smallest cost value including the offset value as the combination for encoding, thereby reducing the possibility of a buffer failure occurring when encoding video data. [Explanation of symbols]

[0131] 1. Video Encoding Device 11 Encoding circuit 12 Buffer circuit 13 Offset calculation circuit 14 Block size determination circuit 111 Prediction residual generation unit 112 DCT conversion section 113 Quantization section 114 Variable-length coding section 115 Inverse quantization section 116 Inverse DCT section 117 Decoding section 118 Intra / Inter Prediction Circuit 1181 Prediction signal candidate generation unit 1182 Predictive signal determination unit 141 Addition section 142 Size Selection Section

Claims

1. an encoding circuit that encodes a video image on a block-by-block basis for each image based on a combination of blocks of different sizes, and calculates each cost value of a plurality of candidate combinations of the blocks; a buffer circuit for storing the coded data of the image coded in units of blocks; an offset calculation circuit that calculates an offset value based on a remaining buffer capacity of the buffer circuit and the number of blocks in one image or an index corresponding to the number of blocks in the one image; a block size determination circuit for determining a combination for encoding from among the plurality of combination candidates based on each of the cost values ​​including the offset value; A video encoding device comprising:

2. The index corresponding to the number of blocks in one image is 2. The video encoding device according to claim 1, wherein the ratio is a data amount of all overhead of all encoded data to a data amount of all encoded data and a data amount of all overhead of all encoded data in one image.

3. the offset value is a first value when the buffer remaining amount of the buffer circuit is less than a first threshold, a second value when the buffer remaining amount of the buffer circuit is equal to or greater than the first threshold and less than a second threshold and the number of blocks in the one image is large, a third value when the buffer remaining amount of the buffer circuit is equal to or greater than the first threshold and less than the second threshold and the number of blocks in the one image is small, and a zero value when the buffer remaining amount of the buffer circuit is equal to or greater than the second threshold, the first value is greater than the second value, the second value is greater than the third value, The video encoding device according to claim 1 , wherein the third value is a value greater than zero.

4. The cost value is 2. The video encoding device according to claim 1, wherein the value is related to at least one of an amount of encoded data and video quality.

5. the cost value is a value related to at least one of an amount of code and an amount of distortion of a video; The block size determination circuit includes: The video encoding device according to claim 1 , wherein a combination candidate having the smallest cost value including the offset value is determined as the combination for encoding.

6. In a video encoding method performed by a video encoding device, An encoding circuit encodes the video on a block-by-block basis for each image based on a combination of blocks of different sizes, and calculates each cost value of a plurality of combination candidates that arbitrarily combine the blocks; a buffer circuit for storing the coded data of the image coded in units of blocks; an offset calculation circuit calculates an offset value based on a remaining buffer capacity of the buffer circuit and the number of blocks in one image or an index corresponding to the number of blocks in the one image; a block size determination circuit for determining a combination for encoding from among the plurality of combination candidates based on each of the cost values ​​including the offset value; Video coding method.

Citation Information

Patent Citations

  • Encoder and block size selection method

    JP2015109586A

  • Block size determination method, block size determination device and block size determination program

    JP2016187140A

  • Video encoding device, video encoding method and video encoding program

    JP2017005505A

  • Video coding apparatus and video coding program

    JP2017028337A