Patent ID: 9350989
Filing Date: 2016-05-24
CPC Classification: H04N

Claim Text:
1. A moving image coding apparatus that codes a moving image signal for forming a frame image including a plurality of macroblocks, and controls an amount of code to be generated in coding the moving image signal, the apparatus comprising: a target code amount setting unit configured to designate the number of said macroblocks in said plurality of macroblocks and set a target code amount as a code amount to be allocated to the designated number of said macroblocks; a quantization parameter determination unit configured to determine a quantization parameter value to be used in quantization performed in coding the moving image signal; and a coding unit configured to code the moving image signal and perform quantization with respect to the moving image signal using the quantization parameter value determined by the quantization parameter determination unit, wherein the coding unit includes a storage unit configured to store at least one previous frame image, and a motion estimate unit configured to obtain a difference image by extracting a reference frame image from the at least one previous frame image stored in the storage unit and calculating a difference between a current macroblock that is a processing target macroblock and an image region of the reference frame image having the same size as the current macroblock, obtain a sum of absolute transformed differences of the obtained difference image, and calculate a motion vector based on the obtained sum of absolute transformed differences, and the quantization parameter determination unit determines the quantization parameter value based on the sum of absolute transformed differences for the current macroblock obtained by the motion estimate unit, and wherein the target code amount setting unit sets a target code amount targetBit as a code amount to be allocated to 2×k1 macroblocks as the designated number of said macroblocks, where k1 is a natural number, and the quantization parameter determination unit includes a FIFO (First In First Out) SATD (Sum of Absolute Transformed Differences) storage configured to store sums of absolute transformed differences for N1 macroblocks, where N1 is a natural number, and store the sum of absolute transformed differences for the current macroblock obtained by the motion estimate unit, a FIFO code amount storage configured to store code amounts for N1 macroblocks, where N1 is a natural number, and store a code amount generated when a macroblock that is one-macroblock previous to the current macroblock is coded, a current code amount calculation unit configured to obtain, from the FIFO SATD storage, a sum of absolute transformed differences recent_SATD for the current macroblock and sums of absolute transformed differences for k1 previous macroblocks in said plurality of macroblocks, where k1 is a natural number and k1≦N1, calculate an average avrg_AllocatedBit of the sums of absolute transformed differences for the k1 previous macroblocks, obtain, from the FIFO code amount storage, code amounts for k1 previous macroblocks in said plurality of macroblocks, where k1 is a natural number and k1≦N1, calculate an average avrg_AllocatedBit of the code amounts for the k1 previous macroblocks, and calculate a total code amount usedBit allocated to the k1 previous macroblocks, and calculate a code amount current_AllocatedBit to be allocated to the current macroblock by using the formulas: where coe is a coefficient, a median-QP-transformed code amount calculation unit configured to obtain, from the FIFO code amount storage, a code amount recent_AllocatedBit for the macroblock that is one-macroblock previous to the current macroblock, and calculate a median-QP-transformed code amount by quantizing the obtained code amount recent_AllocatedBit using a median of possible quantization parameter values in the quantization performed by the coding unit, and a QP calculation unit configured to calculate a quantization parameter value to be used in coding the current macroblock based on the median-QP-transformed code amount calculated by the median-QP-transformed code amount calculation unit for the macroblock that is one-macroblock previous to the current macroblock and the code amount current_AllocatedBit to be allocated to the current macroblock calculated by the current code amount calculation unit.