JP5409842B2 - Image encoding apparatus, control method therefor, and computer program - Google Patents

Image encoding apparatus, control method therefor, and computer program Download PDF

Info

Publication number
JP5409842B2
JP5409842B2 JP2012116979A JP2012116979A JP5409842B2 JP 5409842 B2 JP5409842 B2 JP 5409842B2 JP 2012116979 A JP2012116979 A JP 2012116979A JP 2012116979 A JP2012116979 A JP 2012116979A JP 5409842 B2 JP5409842 B2 JP 5409842B2
Authority
JP
Japan
Prior art keywords
sn ratio
image
encoding
target
motion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2012116979A
Other languages
Japanese (ja)
Other versions
JP2012182831A (en
Inventor
晃弘 大石
Original Assignee
キヤノン株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by キヤノン株式会社 filed Critical キヤノン株式会社
Priority to JP2012116979A priority Critical patent/JP5409842B2/en
Publication of JP2012182831A publication Critical patent/JP2012182831A/en
Application granted granted Critical
Publication of JP5409842B2 publication Critical patent/JP5409842B2/en
Application status is Expired - Fee Related legal-status Critical
Anticipated expiration legal-status Critical

Links

Images

Description

  The present invention relates to an image encoding device, a control method thereof, and a computer program.

  With the recent development of multimedia, various video compression encoding methods have been proposed. Typical examples are MPEG-1, 2, 4 and H.264. There is something like H.264. In these compression encoding processes, an original image (image) included in a moving image is divided into predetermined regions called blocks, and motion compensation prediction and DCT conversion processing are performed in units of the divided blocks. . In addition, when performing motion compensation prediction, an image obtained by local decoding of already encoded image data is used as a reference image, so that a decoding process is required even when encoding is performed.

  In addition, when compressing and encoding an image in accordance with the MPEG system, the amount of code often varies greatly depending on the spatial frequency characteristics, which are characteristics of the image itself, the scene, and the quantization scale value. An important technique for realizing a decoded image with good image quality in realizing an encoding apparatus having such encoding characteristics is code amount control.

  TM5 (Test Model 5) is generally used as one of the code amount control algorithms. The code amount control algorithm according to TM5 is composed of the following three steps, and the code amount is controlled in the following three steps so that the bit rate is constant for each GOP (Group Of Picture).

(STEP1)
The target code amount of the picture to be encoded from now is determined. Rgop, which is a code amount that can be used in the current GOP, is calculated by the following equation (1).
Rgop = (ni + np + nb) * (bits_rate / picture_rate) (1)
Here, ni, np, and nb are the number of remaining pictures in the current GOP of I, P, and B pictures, bits_rate represents the target bit rate, and picture_rate represents the picture rate.

Further, the complexity of the picture is obtained from the encoding result for each of the I, P, and B pictures by the following equation (2).
Xi = Ri * Qi
Xp = Rp * Qp (2)
Xb = Rb * Qb
Here, Xi, Xp, and Xb are also called complexity. Ri, Rp, and Rb are code amounts obtained as a result of encoding I, P, and B pictures, respectively. Further, Qi, Qp and Qb are average values of Q scales in all macroblocks in the I, P and B pictures, respectively. From the equations (1) and (2), the target code amounts Ti, Tp, and Tb for each of the I, P, and B pictures can be obtained by the following equation (3).
Ti = max {(Rgop / (1+ ((Np * Xp) / (Xi * Kp)) + ((Nb * Xb) / (Xi * Kb))))), (bit_rat
e / (8 * picture_rate))}
Tp = max {(Rgop / (Np + (Nb * Kp * Xb) / (Kb * Xp))), (bit_rate / (8 * picture_rate))}
Tb = max {(Rgop / (Nb + (Np * Kb * Xp) / (Kp * Xb))), (bit_rate / (8 * picture_rate))}
... (3)
Np and Nb are the remaining number of P and B pictures in the current GOP, respectively, and constants Kp = 1.0 and Kb = 1.4.

(STEP2)
Three virtual buffers are used for each of the I, P, and B pictures, and the difference between the target code amount obtained by Expression (3) and the generated code amount is managed. The data accumulation amount of the virtual buffer is fed back, and the reference value of the Q scale is set for the macroblock to be encoded next so that the actual generated code amount approaches the target code amount based on the data accumulation amount. For example, when the current picture type is a P picture, the difference between the target code amount and the generated code amount can be obtained by arithmetic processing according to the following equation (4).
dp, j = dp, 0 + Bp, j−1 − ((Tp * (j−1)) / MB_cnt) (4)
Here, the subscript j is the number of the macroblock in the picture. dp, 0 represents the initial fullness of the virtual buffer, Bp, j represents the total code amount up to the j-th macroblock, and MB_cnt represents the number of macroblocks in the picture. Bp, j represents the total code amount up to the j-th macroblock, and MB_cnt represents the number of macroblocks in the picture.

Next, when the reference value of the Q scale in the j-th macroblock is obtained using dp, j (hereinafter referred to as “dj”), equation (5) is obtained.
Qj = (dj * 31) / r (5)
Where r = 2 * bits_rate / picture_rate (6)
It is.

(STEP3)
A process of finally determining the quantization scale is executed based on the spatial activity of the macroblock to be encoded so that the visual characteristics, that is, the image quality of the decoded image is improved.
ACTj = 1+ min (vblk1, vblk2, ..., vblk8) (7)
In the equation (7), vblk1 to vblk4 indicate spatial activities in 8 × 8 sub-blocks in the macroblock of the frame structure. Further, vblk5 to vblk8 indicate the 8 × 8 sub-block spatial activity in the field-structured macroblock. Here, the calculation of the space activity can be obtained by the following equations (8) and (9).
vblk = Σ (Pi−Pbar) 2 (8)
Pbar = (1/64) * ΣPi (9)
Here, Pi is a pixel value in the i-th macroblock, and Σ in equations (8) and (9) is an operation of i = 1 to 64. Next, ACTj obtained by the equation (7) is normalized by the following equation (10).

N_ACTj = (2 * ACTj + AVG_ACT) / (ACTj + AVG_ACT) (10)
Here, AVG_ACT is a reference value of ACTj in a previously encoded picture, and finally a quantization scale (Q scale value) MQUANTj is obtained by the following equation (11).

MQUANTj = Qj * N_ACTj (11)
According to the above TM5 algorithm, a large amount of code is allocated to the I picture by the processing of STEP1, and the code amount is in a flat portion (low spatial activity) that is visually noticeable in the picture. A lot will be allocated.

  As an encoding method applying such a TM5 method, a method for determining a target code amount so that an SN ratio between an image signal and a locally decoded image is a certain value has been proposed (see Patent Document 1). . This proposed method has the effect of stabilizing the image quality for all pictures by setting a target code amount that keeps the SN ratio constant.

  As an improved method of the proposed method, a method of setting the code amount of each picture of I picture, P picture, and B picture to an optimum value has been proposed (see Patent Document 2). In this improved method, the code amount of each frame (I picture, P picture, B picture) is distributed and controlled so that the SN ratio of the I picture is larger than the SN ratio of the B picture. That is, by controlling the code amount of each frame (I picture, P picture, B picture) so that the coding error of the I picture is smaller than the coding error of the B picture, the image quality of the I picture that is the origin of the GOP There is an effect of improving.

Japanese Patent Laid-Open No. 02-219388 Japanese Patent Laid-Open No. 08-070458

  However, the proposed methods according to Patent Document 1 and Patent Document 2 have the following problems.

  First, in the proposed method according to Patent Document 1, it is possible to maintain a constant image quality by keeping the SN ratio in each picture constant. Also in the proposed method according to Patent Document 2, the SN ratio and the code of each picture are maintained. It is possible to keep a constant image quality by considering the distribution.

  However, in these methods, since the S / N ratio is used as determination information for determining the target code amount, the degree of quantitative deterioration in image quality and human visual characteristics are not sufficiently taken into consideration. That is, it is conceivable that the relationship between the SN ratio and the image quality is not necessarily a proportional relationship.

  Therefore, for example, an image composed of signals with low high-frequency components, such as high-speed panning, is unlikely to cause a significant decrease in the signal-to-noise ratio even if the image quality deteriorates. Likely to happen. Also, in the case of a still image, even if the signal-to-noise ratio is the same as that of other images, the image is not considered to be equivalent because noise is noticeable because the image is still. Accordingly, it is difficult to determine the target code amount with a constant S / N ratio in terms of setting a code amount that matches human visual characteristics.

  As described above, in the proposed method, it is not possible to set the code amount according to the human visual characteristics, and it is impossible to obtain a decoded image with good image quality. Accordingly, an object of the present invention is to obtain a decoded image with good image quality by setting a code amount according to human visual characteristics.

The present invention for solving the above problems is as follows.
An image encoding device for encoding image data,
An encoding unit that orthogonally transforms an encoding target image, performs quantization processing, and encodes;
Decoding means for inversely quantizing the encoded image, performing inverse orthogonal transformation, and decoding;
Motion detection means for detecting motion information between the encoding target image and an image immediately before the encoding target image;
An SN ratio calculating means for calculating an SN ratio using the encoding target image and a decoding result obtained by decoding the encoding result of the encoding target image by the encoding means;
Setting means for setting a target SN ratio indicating a target SN ratio value in the encoding target image;
Rate control means for adjusting the bit rate of the encoded data output from the encoding means in accordance with the magnitude of the difference between the set target SN ratio and the calculated SN ratio;
With
The setting means includes the target SN in a period in which an amount of motion between images indicated by the motion information is less than or equal to a predetermined threshold than an image in which the amount of motion is not less than or equal to the predetermined threshold. The ratio of the target SN ratio in a period in which an image in which the amount of motion between images indicated by the motion information is not less than or equal to a predetermined threshold is greater than an image in which the amount of motion is less than or equal to the predetermined threshold. Also set a large
The rate control means includes
When the calculated SN ratio is larger than the target SN ratio, the difference between the calculated SN ratio and the target SN ratio is compared with a first threshold value, and the difference is larger than the first threshold value. If so, lower the bit rate,
When the calculated SN ratio is not larger than the target SN ratio, the difference between the target SN ratio and the calculated SN ratio is compared with a second threshold value, and the difference is larger than the second threshold value. In this case, the bit rate is increased .

  According to the present invention, the target SN ratio is changed according to the motion of the image, the code amount is set according to the human visual characteristics, and a decoded image with good image quality can be obtained.

It is a figure which shows the structural example of the encoding apparatus which implement | achieves the encoding method corresponding to embodiment of invention. It is a figure which shows an example of image rearrangement corresponding to embodiment of invention. It is a flowchart which shows an example of the process performed by each process part enclosed with the dotted line 120 of the encoding apparatus of FIG. 1 corresponding to embodiment of invention. It is a flowchart which shows an example of the process for determining the bit rate in the rate control part 116 corresponding to the 1st Embodiment of invention. It is a flowchart which shows an example of the process for determining the bit rate in the rate control part 116 corresponding to the 2nd Embodiment of invention.

  Embodiments of the invention will be described below with reference to the accompanying drawings.

[First Embodiment]
A first embodiment of the invention will be described with reference to FIGS. FIG. 1 is a diagram illustrating a configuration example of an encoding device that realizes an encoding method corresponding to an embodiment of the invention. Specifically, the encoding system corresponds to MPEG (Moving Pictures of Experts Group) and H.264 / AVC (Advanced Video Coding). Therefore, the encoding device can be realized as a video / audio signal recording device such as a digital video camera. FIG. 2 is a diagram illustrating an example of image rearrangement. FIG. 3 is a flowchart illustrating an example of processing executed by each processing unit surrounded by a dotted line 120 of the encoding device in FIG. FIG. 4 is a flowchart showing an example of rate control processing corresponding to the embodiment of the invention.

  First, in FIG. 1, an input signal 101 is an input signal to the present encoding device, and corresponds to an image sensor (CCD, CMOS, etc.) provided in the encoding device or a video signal from a line input terminal. The input signal 101 is input in a state of being divided into predetermined blocks. The block is, for example, a block such as 16 × 16 or 8 × 8 in MPEG, and the size is determined according to the encoding method. In this specification, this block is called a “macro block”.

  The image rearrangement unit 102 is a processing unit that changes the order of input images and outputs the images to a subsequent processing unit. The image rearrangement unit 102 includes an internal memory, and images input in the order of # 1, # 2, # 3,... As shown in FIG. .. Managing the memory so that it is output in the order of

  The switch 103 is a switch for switching between the output from the image rearrangement unit 102 and the output from the subtracter 114 in accordance with the picture type of the encoding target image. The DCT unit 104 is a processing unit that performs orthogonal transform (DCT). The quantization unit 105 is a processing unit that performs quantization processing on the orthogonal transform output coefficient output from the DCT unit 104. The variable length coding unit 106 is a processing unit that performs variable length coding processing on the quantization result output from the quantization unit 105.

  The buffer 107 is a buffer for temporarily storing the encoded data output from the variable length encoding unit 106, and outputs the encoded data to the output terminal 118 and the rate control unit 116. The inverse quantization unit 108 is a processing unit that performs an inverse quantization process on the quantization result in the quantization unit 105. The IDCT unit 109 is a processing unit that performs inverse orthogonal transform (IDCT) on the inverse quantization processing result. The adder 110 is an arithmetic unit that adds the decoded data obtained as a decoding result by the inverse orthogonal transform and the predicted image data output from the motion compensation prediction unit 112, and outputs a local decoded image.

  The switch 111 is a switch for supplying predicted image data from the motion compensation prediction unit 112 to the adder 110 according to the picture type of the encoding target image. The motion compensation prediction unit 112 is a processing unit that performs motion compensation prediction and generates predicted image data based on the output from the image rearrangement unit 102 and the output from the adder 110. The SN ratio calculation unit 113 is a processing unit that calculates an SN ratio using the output from the adder 110 and the output from the image rearrangement unit 102.

  The subtractor 114 is a calculation unit that performs a subtraction process between the output from the image rearrangement unit 102 and the predicted image data from the motion compensation prediction unit 112. The frame motion detection unit 115 is a processing unit that detects frame motion based on the input signal 101. The rate control unit 116 is a processing unit that determines the target bit rate of the GOP to be encoded and the target code amount of the picture. The quantization control unit 117 is a processing unit that determines the quantization coefficient of the macroblock based on the target code amount of the picture determined by the rate control unit 116. The output terminal 118 is an output terminal that outputs encoded data temporarily stored in the buffer 107.

  The dotted line region 120 includes a switch 103, a DCT unit 104, a quantization unit 105, an inverse quantization unit 108, an IDCT unit 109, an adder 110, a switch 111, a motion compensation prediction unit 112, an SN ratio calculation unit 113, and a subtractor. 114.

  Next, the operation of each block in the dotted line area 120 of FIG. 1 will be described with reference to FIG.

  First, in step S301, the picture type is determined. If the picture type is an I picture (“YES” in step S301), the process proceeds to step S302 where the switch 103 is set to the A side and the switch 111 is turned OFF. Thereafter, the process proceeds to step S305.

  On the other hand, if the picture type is a B picture or P picture other than the I picture (“NO” in step S301), the process proceeds to step S303, the switch 103 is set to the B side, and the switch 111 is turned ON. In the subsequent step S304, motion compensation prediction unit 112 performs motion search to generate predicted image data, and subtracter 114 performs subtraction processing between the predicted image data and the input image to generate a difference value signal.

  Next, in step S305, orthogonal transformation is performed by the DCT unit 104 on a macroblock basis of the input signal, and the quantization unit 105 uses the quantization scale determined by the quantization control unit 117 to quantize the orthogonal transformation output coefficient. To generate encoded data. Here, the quantization scale, which is a quantization parameter, can be calculated by performing a process corresponding to STEP2 of TM5, and thus description thereof is omitted here.

  In the subsequent step S306, the quantized data generated in step S305 is subjected to inverse transform by the inverse quantization unit 108 and the IDCT unit 109 to generate decoded data as a decoding result. In the case of an I picture, a local decoded image can be obtained by this inverse transformation.

  In subsequent step S307, the picture type is determined in the same manner as in step S301. If the picture type is an I picture (“YES” in step S307), the process proceeds to step S310. On the other hand, if the picture type is a B picture or P picture other than the I picture (“NO” in step S307), the process proceeds to step S308. In step S308, the adder 110 performs an addition process of the predicted image data subtracted by the subtractor 114 and the decoded data obtained by the inverse transformation to generate a local decoded image of P picture or B picture.

  Next, in step S309, it is determined whether or not the picture type is a P picture. If it is a P picture (“YES” in step S309), the process proceeds to step S310. On the other hand, in the case of a B picture (“NO” in step S309), the process proceeds to step S311.

  In subsequent step S310, the generated local decoded image is stored in the motion compensation prediction unit 112 in order to serve as a reference image. In step S311, the SN ratio calculation unit 113 calculates the SN ratio between the input image and the local decoded image. Next, the process proceeds to step S312, and it is determined whether or not the encoding process has been completed for all the pictures. If completed ("YES" in step S312), this process ends. On the other hand, if there are still pictures to be encoded (“YES” in step S312), the process returns to step S301 to continue the processing.

  Returning to FIG. 1, the operation of processing blocks other than the dotted line area 120 will be described. The data output from the quantization unit 105 is input to the variable length encoding unit 106 and subjected to variable length encoding. The variable-length encoded data is input to the buffer 107 and output from the output terminal 118. Also, information such as the generated code amount and quantization coefficient of the encoded picture and the SN ratio calculated by the SN ratio calculation unit 113 are input from the buffer 107 to the rate control unit 116.

  In addition, the frame motion detection unit 115 generates frame motion information indicating how many pixels of motion have occurred between the encoding target image and the immediately preceding image. The frame motion detection unit 115 receives the shake information from the gyro sensor (acceleration sensor) 119 that detects the shake of the image encoding device itself and the motion vector information from the motion compensation prediction unit 112. The gyro sensor 119 detects the angular velocity of the encoding device and outputs it to the frame motion detection unit as shake information. According to the shaking information of the gyro sensor 119, it can be determined how much the entire screen has moved. Further, when using motion vector information, an average vector of motion vector information for each macroblock is obtained, and the average vector is used as the motion of the entire screen. Frame motion information is generated from these pieces of information and input to the rate control unit 116.

  The rate control unit 116 determines a target S / N ratio considering visual characteristics based on the input frame motion information, and sets the bit rate so that the average S / N ratio of 1 GOP is equal to or higher than the target S / N ratio considering the visual characteristics. decide. Details of processing in the rate control unit 116 will be described below with reference to the flowchart of FIG. FIG. 4 is a flowchart showing an example of processing for determining the bit rate in the rate control unit 116.

  First, in step S401, an initial target SN ratio (Tsnr) is set, and further, frame motion information (Move) input from the frame motion detection unit 115 is set. This frame motion information (Move) is a value indicating how many pixels have moved between pictures.

  Next, in step S402, it is determined whether or not the frame motion information (Move) is greater than a third threshold ThM1. If the frame motion information (Move) is larger than the third threshold ThM1 (“YES” in step S402), the process proceeds to step S403. On the other hand, when the frame motion information (Move) is not greater than the third threshold ThM1 (“NO” in step S402), the process proceeds to step S404.

  In step S403, a predetermined value N is added to the initial target SN ratio (Tsnr) to calculate a target SN ratio in consideration of visual characteristics, and the process proceeds to step S404. When the frame motion information (Move) is larger than the third threshold value ThM1, the entire screen moves, so that an image is composed of signals with few high-frequency components, and even if the image quality is deteriorated, the SN ratio is hardly lowered. On the other hand, visually noticeable noise such as block noise tends to occur. Therefore, in this embodiment, the target SN ratio is increased in order to prevent such noise.

  For example, the third threshold ThM1 can be set to “32 pixels”. In this case, when the frame motion information is “40 pixels” and moves more than “32 pixels” of the third threshold ThM1, the initial target SN ratio (Tsnr) may be corrected. In this case, the value of the predetermined value N to be added to the initial target SN ratio is set to N = Move / ThM1 (dB) because the SN ratio does not decrease even when the image quality is deteriorated due to the magnitude of motion.

  Next, in step S404, an average signal-to-noise ratio (Asnr) of 1 GOP is calculated. This average SN ratio (Asnr) can be calculated, for example, as an average of the SN ratios for 1 GOP obtained by the SN ratio calculation unit 113. Further, based on the SN ratio obtained by the SN ratio calculation unit 113 for each picture type, an average SN ratio (Asnr) of 1 GOP can be predicted based on an average of the SN ratio. Note that the calculation method of the average SN ratio itself is not an essential feature of the invention, and therefore the calculation method is not limited to the two methods described above. Therefore, if there is another method that can be used as a method for obtaining the average signal-to-noise ratio of 1 GOP, it can also be used.

  In the subsequent step S405, the target SN ratio (Tsnr) is compared with the average SN ratio (Asnr). If the average SN ratio (Asnr) is larger than the target SN ratio (Tsnr) (“YES” in step S405), the process proceeds to step S406. On the other hand, if the target SN ratio (Tsnr) is equal to or greater than the average SN ratio (Asnr) (“NO” in step S405), the process proceeds to step S408.

  In step S406, it is further determined whether or not the average SN ratio (Asnr) exceeds the target SN ratio (Tsnr) above the first threshold Th1. If the average SN ratio (Asnr) exceeds the target SN ratio (Tsnr) above the first threshold Th1 (“YES” in step S406), the process proceeds to step S407. On the other hand, if the average SN ratio (Asnr) does not exceed the target SN ratio (Tsnr) above the first threshold Th1 ("NO" in step S406), this process ends.

In step S407, (Asnr−Tsnr) × α is subtracted from the current rate (Rate) to calculate a new rate (Rate ), and the process ends. Here, α is an arbitrary coefficient calculated from the average bit rate in VBR (variable bit rate). When the average S / N ratio (Asnr) greatly exceeds the target S / N ratio (Tsnr), the code amount is excessively given, and the target S / N ratio is exceeded even if the rate is lowered. Therefore, in step S407, processing for reducing the rate is performed.

For example, consider the case where Asnr = 45.0 dB, Tsnr = 40.0 dB, Th1 = 2, Rate = 7000000 bps, α = 200000 as numerical values. In this case, the average SN ratio (Asnr) exceeds the target SN ratio (Tsnr) by 5 dB, and this amount is larger than the first threshold Th1. Therefore, by performing the process of lowering the rate by the above calculation, the new rate (Rate -) to the 6000000Bps.

  Next, the process after step S408 is demonstrated. In step S408, it is further determined whether or not the target SN ratio (Tsnr) exceeds the average SN ratio (Asnr) above the second threshold Th2. If the target SN ratio (Tsnr) exceeds the average SN ratio (Asnr) above the second threshold Th2 (“YES” in step S408), the process proceeds to step S409. On the other hand, if the target SN ratio (Tsnr) does not exceed the average SN ratio (Asnr) above the second threshold Th2 (“NO” in step S408), the process is terminated.

In step S409, (Tsnr−Asnr) × β is added to the current rate (Rate), a new rate (Rate + ) is calculated, and the process ends. Here, β is an arbitrary coefficient calculated from the average bit rate in VBR (variable bit rate). When the target S / N ratio (Tsnr) greatly exceeds the average S / N ratio (Asnr), the code amount is insufficient and the target S / N ratio cannot be exceeded unless the rate is increased. Therefore, in step S409, processing for increasing the rate is performed.

For example, consider the case where Asnr = 35.0 dB, Tsnr = 40.0 dB, Th1 = 2, Rate = 7000000 bps, β = 200000. In this case, the target SN ratio (Tsnr) exceeds the average SN ratio (Asnr) by 5 dB, and this amount is larger than the second threshold value Th2. Therefore, the rate is increased by the above calculation, and the new rate (Rate + ) is set to 8000000 bps.

  The bit rate is calculated as described above, and the target code amount can be calculated from the above-described TM5 STEP1. The target code amount is input to the quantization control unit 117, and the quantization unit 105 is controlled by performing STEP2 and STEP3 of TM5.

  The rate calculation formula described above is merely an example, and the rate increase / decrease method is not limited to the above formula. The rate can be controlled by another arithmetic expression using the average SN ratio (Asnr), the target SN ratio (Tsnr), or the frame motion information (Move). Further, although the frame motion detection unit 115 uses information from the gyro sensor 119 and the motion compensation prediction unit 112, only one of them may be used, or other information may be further used.

  By performing the above processing, the target code amount in consideration of the visual characteristics even in a situation where noise is not likely to be significantly reduced but noise is likely to occur as in the case of performing high-speed panning or the like. Can be set, and the image quality can be improved.

[Second Embodiment]
Next, a second embodiment of the invention will be described with reference to FIG. The encoding apparatus corresponding to this embodiment is the same as the configuration shown in FIG. 1, and the processing in the dotted line area 120 is also the same as the flowchart shown in FIG. However, the processing in the rate control unit 116 follows the flowchart shown in FIG. Hereinafter, with reference to FIG. 5, details of processing in the rate control unit 116 corresponding to the present embodiment will be described.

  First, in step S501, an initial target SN ratio (Tsnr) is set, and further, frame motion information (Move) input from the frame motion detector 115 is set.

  In step S502, based on the frame motion information (Move), whether the processing target picture is a picture with a lot of motion between pictures (dynamic picture) or a picture with a little motion (static picture). Determine if there is. In this determination, for example, the value of the frame motion information (Move) is compared with a predetermined fourth threshold ThM2, and when it is larger than the fourth threshold ThM2, it is determined as a dynamic picture, and the fourth threshold ThM2 In the following cases, it can be determined as a static picture.

  If it is determined in this determination that the picture is a static picture (“YES” in step S502), the process proceeds to step S503. On the other hand, when it is determined that the picture is a dynamic picture (“NO” in step S502), the process proceeds to step S504. In step S503, it is determined whether or not a still_count value that is a count value of the number of pictures determined to be a static picture is greater than a predetermined threshold value V. Here, the still_count value is initialized to “0” when encoding is started for a moving image to be encoded. If it is determined to be a static picture, the still_count value is coefficientd one by one and held as a coefficient value. .

  If the still_count value is larger than the threshold value V (“YES” in step S503), the process proceeds to step S507. On the other hand, when the still_count value is equal to or smaller than the threshold value V (“NO” in step S503), the process proceeds to step S505. In step S505, 1 is added to the still_count value and updated in the increasing direction. Next, the process proceeds to step S507.

  If it is determined that the picture is a dynamic picture and the process proceeds to step S504, it is determined in step S504 whether or not the still_count value is zero. If the still_count value is 0 (“YES” in step S504), the process proceeds to step S507. On the other hand, if the still_count value is not 0 (“NO” in step S504), the process proceeds to step S506, where 1 is subtracted from the still_count value and updated in the decreasing direction. Next, the process proceeds to step S507.

  In step S507, in order to set the initial target S / N ratio (Tsnr) to a target S / N ratio considering visual characteristics, the still_count value × W is added to the initial target S / N ratio (Tsnr) to increase the target S / N ratio (Tsnr). Adjust the height.

  If it is determined that the picture to be encoded is a still picture or a picture close to still, even if the SN ratio is the same as other pictures, it is a static picture, so that the same picture is repeatedly viewed. , Noise will be noticeable. This can be prevented by raising the target S / N ratio in step S507.

  However, if the target S / N ratio is rapidly increased to a desired value, the image quality suddenly improves and the image quality becomes uncomfortable. For this reason, in the present embodiment, a sense of incongruity is not caused by adding a step according to the still_count value. For example, when the threshold values V = 9 and W = 0.4, the still_count value takes a value from 0 to 10, and the increase amount of Tsnr can be increased stepwise up to 4 dB in units of 0.4 dB.

  After the process of step S507, it is the same as the process after step S404 of FIG. 4 in 1st Embodiment, and attaches | subjects the corresponding reference number. Therefore, description is abbreviate | omitted in this embodiment.

  As described above, in the present embodiment, even when noise is conspicuous in still images and images close to still images, it is possible to set a target code amount in consideration of visual characteristics and improve image quality.

  The rate calculation formula described above is merely an example, and the rate increase / decrease method is not limited to the above formula. The rate can be controlled by another arithmetic expression using the average SN ratio (Asnr), the target SN ratio (Tsnr), or the frame motion information (Move). Further, although the frame motion detection unit 115 uses information from the gyro sensor 119 and the motion compensation prediction unit 112, only one of them may be used, or other information may be further used.

[Other Embodiments]
Note that the present invention can be applied to a system including a plurality of devices (for example, a host computer, an interface device, a reader, and a printer), and a device (for example, a copying machine and a facsimile device) including a single device. You may apply to.

  The object of the present invention can also be achieved by supplying, to a system, a storage medium that records the code of a computer program that realizes the functions described above, and the system reads and executes the code of the computer program. In this case, the computer program code itself read from the storage medium realizes the functions of the above-described embodiments, and the storage medium storing the computer program code constitutes the present invention. In addition, the operating system (OS) running on the computer performs part or all of the actual processing based on the code instruction of the program, and the above-described functions are realized by the processing. .

  Furthermore, you may implement | achieve with the following forms. That is, the computer program code read from the storage medium is written into a memory provided in a function expansion card inserted into the computer or a function expansion unit connected to the computer. Then, based on the instruction of the code of the computer program, the above-described functions are realized by the CPU or the like provided in the function expansion card or function expansion unit performing part or all of the actual processing.

  When the present invention is applied to the above storage medium, the computer program code corresponding to the flowchart described above is stored in the storage medium.

101 ... Input terminal,
102 ... Image rearrangement unit,
103 ... switch,
104 ... DCT section,
105 Quantizer,
106... Variable length encoding unit,
107... Buffer
108: Inverse quantization unit,
109 ... IDCT section,
110 ... adder,
111 ... switch,
112 ... motion compensation prediction unit,
113 ... SN ratio calculation part,
114 ... subtractor,
115... Frame motion detector,
116: Rate control unit,
117... Quantization control unit,
118 ... Output terminal 119 ... Gyro sensor

Claims (5)

  1. An image encoding device for encoding image data,
    An encoding unit that orthogonally transforms an encoding target image, performs quantization processing, and encodes;
    Decoding means for inversely quantizing the encoded image, performing inverse orthogonal transformation, and decoding;
    Motion detection means for detecting motion information between the encoding target image and an image immediately before the encoding target image;
    An SN ratio calculating means for calculating an SN ratio using the encoding target image and a decoding result obtained by decoding the encoding result of the encoding target image by the encoding means;
    Setting means for setting a target SN ratio indicating a target SN ratio value in the encoding target image;
    Rate control means for adjusting the bit rate of the encoded data output from the encoding means in accordance with the magnitude of the difference between the set target SN ratio and the calculated SN ratio;
    With
    The setting means includes the target SN in a period in which an amount of motion between images indicated by the motion information is less than or equal to a predetermined threshold than an image in which the amount of motion is not less than or equal to the predetermined threshold. The ratio of the target SN ratio in a period in which an image in which the amount of motion between images indicated by the motion information is not less than or equal to a predetermined threshold is greater than an image in which the amount of motion is less than or equal to the predetermined threshold Also set a large
    The rate control means includes
    When the calculated SN ratio is larger than the target SN ratio, the difference between the calculated SN ratio and the target SN ratio is compared with a first threshold value, and the difference is larger than the first threshold value. If so, lower the bit rate,
    When the calculated SN ratio is not larger than the target SN ratio, the difference between the target SN ratio and the calculated SN ratio is compared with a second threshold value, and the difference is larger than the second threshold value. In this case, the bit rate is increased .
  2. Said setting means uses a count value of the motion amount is counted the number of images is the following states the predetermined threshold, according to claim 1, characterized in that adjusting the size of the target SN ratio Image coding apparatus.
  3. Motion compensated prediction means for detecting a motion vector between the encoding target image and a reference image;
    It further comprises at least one of shake detection means for detecting shake of the image encoding device itself including an image pickup device that picks up an image and generating shake information,
    It said motion detection means, the image coding apparatus according to claim 1 or 2, characterized in that to detect the motion information based on at least one of the motion vector and the shake information.
  4. A control method for an image encoding device for encoding image data, comprising:
    An encoding step in which an encoding unit orthogonally transforms an encoding target image, performs quantization processing, and encodes;
    A decoding step in which the decoding means dequantizes the encoded image, performs inverse orthogonal transform, and decodes;
    A motion detection step in which motion detection means detects motion information between the encoding target image and the immediately preceding encoding target image;
    An SN ratio calculating step in which an SN ratio calculating unit calculates an SN ratio using the encoding target image and a decoding result obtained by decoding the encoding result of the encoding target image in the encoding step in the decoding step; ,
    A setting step in which a setting unit sets a target SN ratio indicating a value of an SN ratio targeted in the encoding target image;
    A rate control step in which the rate control means adjusts the bit rate of the encoded data output from the encoding means in accordance with the magnitude of the difference between the set target SN ratio and the calculated SN ratio; ,
    With
    In the setting step, the at greater period than the image motion amount is less state a predetermined threshold, a state wherein the motion amount is not less than the predetermined threshold value image between images indicated by the motion information target The target SN ratio in a period in which an image in which the amount of motion between images indicated by the motion information is not less than or equal to a predetermined threshold is greater than an image in which the amount of motion is less than or equal to the predetermined threshold. It is set to be larger than,
    In the rate control step,
    When the calculated SN ratio is larger than the target SN ratio, the difference between the calculated SN ratio and the target SN ratio is compared with a first threshold value, and the difference is larger than the first threshold value. If so, lower the bit rate,
    When the calculated SN ratio is not larger than the target SN ratio, the difference between the target SN ratio and the calculated SN ratio is compared with a second threshold value, and the difference is larger than the second threshold value. In this case, the bit rate is increased . A method for controlling an image coding apparatus, comprising:
  5.   A computer program for causing a computer to function as the image encoding device according to any one of claims 1 to 3.
JP2012116979A 2012-05-22 2012-05-22 Image encoding apparatus, control method therefor, and computer program Expired - Fee Related JP5409842B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012116979A JP5409842B2 (en) 2012-05-22 2012-05-22 Image encoding apparatus, control method therefor, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012116979A JP5409842B2 (en) 2012-05-22 2012-05-22 Image encoding apparatus, control method therefor, and computer program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2007287852 Division 2007-11-05

Publications (2)

Publication Number Publication Date
JP2012182831A JP2012182831A (en) 2012-09-20
JP5409842B2 true JP5409842B2 (en) 2014-02-05

Family

ID=47013586

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012116979A Expired - Fee Related JP5409842B2 (en) 2012-05-22 2012-05-22 Image encoding apparatus, control method therefor, and computer program

Country Status (1)

Country Link
JP (1) JP5409842B2 (en)

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2536187B2 (en) * 1989-10-09 1996-09-18 沖電気工業株式会社 Moving picture packet encoding and decoding system
JP2934342B2 (en) * 1991-08-05 1999-08-16 沖電気工業 株式会社 Image compression encoder
JPH0965200A (en) * 1995-08-18 1997-03-07 Sony Corp Signal processor and method therefor
JPH09191458A (en) * 1996-01-10 1997-07-22 Nippon Columbia Co Ltd Moving image compression coding method and its device
JPH1013249A (en) * 1996-06-20 1998-01-16 Matsushita Electric Ind Co Ltd Image information compressor
JP2002044621A (en) * 2000-07-26 2002-02-08 Mitsubishi Electric Corp Image transmitting device
JP4259363B2 (en) * 2004-03-19 2009-04-30 沖電気工業株式会社 Video encoding device
US9197912B2 (en) * 2005-03-10 2015-11-24 Qualcomm Incorporated Content classification for multimedia processing
JP4736619B2 (en) * 2005-08-18 2011-07-27 沖電気工業株式会社 Image processing apparatus and image processing method

Also Published As

Publication number Publication date
JP2012182831A (en) 2012-09-20

Similar Documents

Publication Publication Date Title
US8665960B2 (en) Real-time video coding/decoding
DE69829345T2 (en) A method of reducing the processing power requirements of a video decoder
US7653129B2 (en) Method and apparatus for providing intra coding frame bit budget
KR100850705B1 (en) Method for adaptive encoding motion image based on the temperal and spatial complexity and apparatus thereof
EP2129134B1 (en) Time-varying image encoding method and device, and time-varying image decoding device
US7206453B2 (en) Dynamic filtering for lossy compression
JP3854933B2 (en) Video coding method and apparatus having fixed amount of computation
US8363719B2 (en) Encoding apparatus, method of controlling thereof, and computer program
TWI399097B (en) System and method for encoding video, and computer readable medium
US8270473B2 (en) Motion based dynamic resolution multiple bit rate video encoding
JP2006140758A (en) Method, apparatus and program for encoding moving image
EP1347649A1 (en) B picture mode determining method and apparatus in video coding system
JP4007594B2 (en) Moving picture coding apparatus and method, moving picture coding system conversion apparatus and method
CN1110962C (en) Adaptive quantizer for video signal encoding system use
US20070199011A1 (en) System and method for high quality AVC encoding
DE69635369T2 (en) The video coding apparatus
KR100335052B1 (en) Method for controlling frame-level rate
US9277215B2 (en) Method and apparatus for realizing adaptive quantization in process of image coding
JP2001510311A (en) Object-based rate control apparatus and method in the coding scheme
US6819714B2 (en) Video encoding apparatus that adjusts code amount by skipping encoding of image data
JP4624321B2 (en) Transcoder and coded image conversion method
JPH09214963A (en) Method for coding image signal and encoder
JP2007522724A (en) Encoder with adaptive rate control
JP2002514023A (en) Method for reducing breathing artifacts compressed video and equipment
JP4280353B2 (en) Encoding apparatus, image processing apparatus, encoding method, and recording medium

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130716

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130719

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130913

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20131007

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131105

LAPS Cancellation because of no payment of annual fees