Conventionally, when a frame rate at which encoding is possible is different from a frame rate of video input from an imaging device or the like to an encoder, technology which performs conversion into the frame rate at which the encoding is possible by performing a process of dropping the input video is used (see Patent Document 1).
FIG. 5 illustrates a block diagram illustrating a configuration of an apparatus in accordance with the conventional technology. FIG. 6 illustrates a flowchart of a picture dropping determination unit in the conventional technology.
In FIG. 5, an encoder 200 is, for example, an apparatus which encodes input video in accordance with an encoding scheme of H.264 or the like and outputs an encoded video stream. The encoder 200 is provided with: a motion detection unit 203 which performs motion detection for each of blocks obtained by dividing a frame; a prediction unit 204 which performs prediction using a motion vector detected by the motion detection unit 203; an orthogonal transform unit 205 which performs an orthogonal transform on a residual signal between an input signal and a predicted signal in accordance with a discrete cosine transform (DCT) or the like; a quantization unit 206 which quantizes transform coefficients; an inverse quantization unit 207 which inversely quantizes a quantized result; an inverse orthogonal transform unit 208 which performs an inverse orthogonal transform on transform coefficients; a locally decoded picture storage unit 209 which stores a locally decoded picture obtained by adding the predicted signal to an output of the inverse orthogonal transform unit 208; a variable length encoding unit 210 which performs variable length encoding on an output of the quantization unit 206; a multiplexing unit 211 which multiplexes encoding information; a buffer unit 212 which stores encoded information and outputs it as the encoded video stream; and a control unit 213 which performs encoding control on the quantization unit 206 and the other units in accordance with a generated bit amount or the like.
When a frame rate at which encoding by the encoder 200 is possible is different from a frame rate of the video input from an imaging device or the like to the encoder 200 measured by a frame rate measurement unit 202, a picture dropping determination unit 201 performs conversion into the frame rate at which the encoding is possible by performing a process of dropping the input video. The frame rate measurement unit 202 measures the frame rate of the input video and notifies the picture dropping determination unit 201 of the frame rate.
The picture dropping determination unit 201 executes the process illustrated in FIG. 6. First, the encoder 200 sets a frame rate TA capable of being input (step S200), designates the frame rate of the input video as CA (step S201), and calculates a dropped frame interval value n=CA/(CA−TA) from CA (step S202). Next, a picture number i is initially set to 1 and the number of dropped pictures d is initially set to 0 (step S203), and the following process is performed.
A determination as to whether a picture i is to be dropped is made based on whether the picture number i of a determination target picture exceeds a value obtained by multiplying n by the number of dropped pictures d so far. That is, a determination as to whether i≧n×(d+1) is made, and steps S205 and S206 are executed if i is greater than or equal to n×(d+1). In step S205, 1 is added to d; in step S206, the picture i is dropped. If i is less than n×(d+1), the picture i is not dropped. Until processing of the entire video is completed (YES in step S207), the above steps S204 to S207 are iterated while 1 is added to i (step S208).
As described above, in the conventional technology, the number of dropped pictures which represents the number of pictures of the video from which one picture is dropped is calculated from a ratio between an input frame rate for the encoder and the frame rate at which the encoding is possible, and a process of dropping the input video is performed in accordance with the calculated number of dropped pictures.
In order to apply the present technology, the input frame rate CA for the encoder must be known in advance. Thus, it is necessary to measure the frame rate CA of the input video for the encoder using, for example, the frame rate measurement unit 202 illustrated in FIG. 5. However, for example, when the input timing of the input video fluctuates, the frame rate at the time of the measurement may not always be maintained. Thus, a situation in which many pictures are unnecessarily dropped or a situation in which the number of times of dropping is insufficient occurs.