WO2011138923A1 - 動画像符号化制御方法,動画像符号化装置および動画像符号化プログラム - Google Patents

動画像符号化制御方法,動画像符号化装置および動画像符号化プログラム Download PDF

Info

Publication number
WO2011138923A1
WO2011138923A1 PCT/JP2011/060364 JP2011060364W WO2011138923A1 WO 2011138923 A1 WO2011138923 A1 WO 2011138923A1 JP 2011060364 W JP2011060364 W JP 2011060364W WO 2011138923 A1 WO2011138923 A1 WO 2011138923A1
Authority
WO
WIPO (PCT)
Prior art keywords
encoding
picture
parameter
retry
code amount
Prior art date
Application number
PCT/JP2011/060364
Other languages
English (en)
French (fr)
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 US13/695,700 priority Critical patent/US9179165B2/en
Priority to RU2012146537/08A priority patent/RU2530313C2/ru
Priority to BR112012028184A priority patent/BR112012028184A2/pt
Priority to CA2798012A priority patent/CA2798012A1/en
Priority to CN201180022113.6A priority patent/CN102986212B/zh
Priority to ES11777442T priority patent/ES2703005T3/es
Priority to EP11777442.2A priority patent/EP2568705B1/en
Priority to JP2012513813A priority patent/JP5295429B2/ja
Priority to KR1020127028798A priority patent/KR101389919B1/ko
Publication of WO2011138923A1 publication Critical patent/WO2011138923A1/ja

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/114Adapting the group of pictures [GOP] structure, e.g. number of B-frames between two anchor frames
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/15Data rate or code amount at the encoder output by monitoring actual compressed data size at the memory before deciding storage at the transmission buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/152Data rate or code amount at the encoder output by measuring the fullness of the transmission buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/177Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a group of pictures [GOP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/189Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
    • H04N19/192Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding the adaptation method, adaptation tool or adaptation type being iterative or recursive
    • H04N19/194Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding the adaptation method, adaptation tool or adaptation type being iterative or recursive involving only two passes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation

Definitions

  • the present invention relates to a moving image code for encoding a video signal so as not to cause a failure of a virtual buffer such as a coded picture buffer (CPB) in a virtual decoder and to prevent deterioration of image quality.
  • a virtual buffer such as a coded picture buffer (CPB) in a virtual decoder
  • CPB coded picture buffer
  • a virtual decoder HRD Hypothetical Reference Decoder
  • the H.264 encoder needs to perform encoding so that the virtual decoder does not fail.
  • the present invention is a technique for suppressing CPB failure of a virtual decoder, specifically, CPB underflow.
  • Figure 1 shows a conceptual diagram of CPB underflow.
  • an encoded stream is input to the CPB at the bit rate as indicated by an arrow A1.
  • the data amount of the encoded stream in the CPB at each time is referred to as “remaining code amount”.
  • the virtual decoder extracts the encoded stream corresponding to each picture from the CPB. In that case, the CPB remaining code amount is instantaneously reduced by the code amount corresponding to the picture.
  • the CPB underflow is a situation in which the coded stream of the picture is insufficient in the CPB when the virtual decoder tries to extract the coded stream of the picture at each time indicated by the arrow A2.
  • the CPB of the virtual decoder is H.264.
  • the following non-patent document 1 describes further details.
  • CPB Video Buffering Verifier
  • VBV Video Buffering Verifier
  • Video signal encoding methods include techniques of 1-pass encoding and multi-pass encoding.
  • the 1-pass encoding generally, pictures of an input video are sequentially encoded.
  • multi-pass encoding an input video is encoded a plurality of times.
  • the second encoding is performed using the result of the first encoding.
  • the conventional technique of 1-pass coding will be described as “conventional technique a”
  • the conventional technique of 2-pass coding will be described as “conventional technique b”.
  • ⁇ Conventional technology b> In the two-pass encoding, all pictures of the input video are encoded, and the code amount of each picture generated at that time is used in the second encoding.
  • the complexity of each part of the video is known at the time of the second encoding, so that it can be expected that CPB underflow can be suppressed while suppressing deterioration in image quality.
  • the complexity of each frame is obtained by the first encoding, and the allocated code amount of each frame is obtained. Then, whether or not CPB underflow occurs with this allocated code amount is verified. If CPB underflow occurs, the allocated code amount is corrected.
  • the allocated code amount can be corrected only when CPB underflow occurs.
  • the CPB underflow is suppressed while suppressing the image quality degradation as compared with the prior art a. Can be suppressed.
  • this method has a problem that the amount of calculation increases because it is necessary to encode all frames of the input video twice.
  • An object of the present invention is to solve the above-described problems and to realize stable image quality while suppressing CPB underflow with a smaller amount of calculation than conventional two-pass coding (conventional technology b).
  • the coding order picture group is a collection of pictures that are composed of a predetermined number of pictures starting from the intra prediction coding picture (I picture) and are consecutive in the coding order.
  • a typical coding order picture group is GOP (Group Of Pictures).
  • FIGS. 2A to 2D Schematic diagrams of the coding order picture group are shown in FIGS. 2A to 2D.
  • I is a picture to be subjected to intra prediction encoding (I picture)
  • P is a picture to be forward predictive encoding (P picture)
  • B is a target of bidirectional predictive encoding. Represents a picture (B picture).
  • the display order of pictures is, for example, I ⁇ B ⁇ P ⁇ B ⁇ P ⁇ B...
  • the coding order picture group is a picture group of I ⁇ P ⁇ B ⁇ P ⁇ ... ⁇ B ⁇ P (immediately before I) as shown in FIG. It becomes.
  • the coding order picture group has a 13 picture configuration
  • 13 pictures consecutive in the coding order as shown in FIG. 2C are the coding order picture group referred to in the present invention.
  • FIG. 2D shows an example in which the coding order picture group has a 20-picture configuration corresponding to 2 GOPs.
  • a group of pictures obtained by dividing a picture sequence of an input video into a picture group that is continuous in a coding order and is configured by a predetermined number is called a coding order picture group.
  • the “picture” is a frame when the video is in the progressive format, and is a frame in which one field or a top field and a bottom field are combined in the case of the interlace format.
  • the encoding of the input video proceeds in units of encoding order pictures.
  • CPB is checked for failure by a predetermined buffer test algorithm. Only when CPB underflow occurs, the encoding parameter is changed so that the generated code amount is reduced. Then, the encoding order picture group being encoded is re-encoded.
  • the trigger for outputting the encoding result from the output buffer is when the encoding of the encoding order picture group is completed.
  • the coding parameters to be changed include, for example, quantization parameters and prefilter strength, and one or more of these are changed.
  • quantization parameters and prefilter strength For example, in the case of a quantization parameter, the step size of the quantization parameter is increased so that the generated code amount of the encoding parameter is reduced.
  • the filter strength of the pre-filter for the input video is changed, the generated code amount can be reduced by changing the blurring degree to be larger.
  • the encoding parameter at the time of normal encoding means an encoding parameter determined when the state is not re-encoding.
  • the encoding parameter is not necessarily returned to the value at the time of normal encoding, but the remaining code amount of the CPB is checked, and the remaining code amount is a predetermined threshold value. Only in the above case, the encoding parameter may be returned to the normal encoding value, and when the remaining code amount is small, the encoding parameter may not be returned to the normal encoding value. In this way, the possibility of continuous re-encoding can be reduced.
  • the encoding parameter is changed from the first picture in the encoding order picture group currently being encoded, and re-encoding is performed. That is, as long as CPB underflow occurs, encoding is repeated a plurality of times for the same encoding order picture group.
  • the value of the retry count is increased when re-encoding occurs, and encoding of the encoding order picture group is completed Decrease the retry count value.
  • the value of the encoding parameter described above is set according to the size of the retry count, and a value that reduces the generated code amount as the retry count increases is used.
  • the encoding parameter is a quantization parameter
  • the step size is increased as the retry count is increased.
  • the encoding parameter is the filter strength of the prefilter, the blurring degree is increased as the retry count is increased.
  • a video to be encoded has a complex part and a simple part. If the encoding order picture group to be re-encoded due to CPB underflow is complex or simple, if re-encoding is performed only once, CPB under-flow is performed by re-encoding once. Since it is necessary to suppress the flow, it is necessary to set an encoding parameter for re-encoding with a larger change amount of the encoding parameter. Then, when re-encoding occurs in a complicated portion of the video that can avoid CPB underflow even if the amount of change in the encoding parameter is small, image quality deterioration is larger than necessary.
  • the complicated amount of video (when many high-frequency components are included or when the correlation in the time direction is small) has a large amount of information, so the amount of code can be reduced by changing the coding parameters a little. In other words, if the amount of change in the encoding parameter is too large, the image quality is wasted.
  • the encoding order picture group is repeatedly encoded, the retry count is managed, and the encoding parameter is set according to the size of the retry count,
  • image quality deterioration can be further reduced by suppressing the change amount of the encoding parameter to be small and encoding with an appropriate encoding parameter.
  • the retry count value when encoding of a coding order picture group is completed, the retry count value is not unconditionally reduced, but when encoding of the coding order picture group is completed.
  • the retry count is reduced only when the CPB remaining code amount is equal to or greater than a predetermined threshold.
  • the value of the encoding parameter described above is set according to the size of the retry count, and a value that reduces the generated code amount as the retry count increases is used.
  • the encoding parameter is a quantization parameter
  • the step size is increased as the retry count is increased.
  • the encoding parameter is the filter strength of the prefilter, the blurring degree is increased as the retry count is increased.
  • a video to be encoded has a complex part and a simple part. If the encoding order picture group to be re-encoded due to CPB underflow is complex or simple, if re-encoding is performed only once, CPB under-flow is performed by re-encoding once. Since it is necessary to suppress the flow, it is necessary to set an encoding parameter for re-encoding with a larger change amount of the encoding parameter. Then, when re-encoding occurs in a complicated portion of the video that can avoid CPB underflow even if the amount of change in the encoding parameter is small, image quality deterioration is larger than necessary.
  • the complicated amount of video (when many high-frequency components are included or when the correlation in the time direction is small) has a large amount of information, so the amount of code can be reduced by changing the coding parameters a little. In other words, if the amount of change in the encoding parameter is too large, the image quality is wasted.
  • the encoding order picture group is repeatedly encoded, the retry count is managed, and the encoding parameter is set according to the size of the retry count, By suppressing the change amount of the encoding parameter to be small and encoding with an appropriate encoding parameter, it is possible to further reduce image quality degradation.
  • the encoding order picture group does not necessarily have to be a GOP, but the leading picture of the encoding order picture group is an intra-picture prediction encoding picture (I picture).
  • the encoding of the input video proceeds in units of encoding order pictures.
  • a predetermined buffer test algorithm is used to check whether CPB fails. If CPB underflow occurs, the encoding parameter is changed so that the generated code amount is reduced.
  • re-encoding is performed from the position of the encoding order picture group set as a retry point (described later).
  • the output result of the encoding result from the output buffer is when the encoding of the encoding-order picture group is completed and it is determined that re-encoding is not performed.
  • the coding parameters to be changed include, for example, quantization parameters and prefilter strength, and one or more of these are changed.
  • quantization parameters and prefilter strength For example, in the case of a quantization parameter, the step size of the quantization parameter is increased so that the generated code amount of the encoding parameter is reduced.
  • the filter strength of the pre-filter for the input video is changed, the generated code amount can be reduced by changing the blurring degree to be larger.
  • the encoding parameter at the time of normal encoding means an encoding parameter determined when the state is not re-encoding.
  • the encoding parameter is not necessarily returned to the value at the time of normal encoding, but the remaining code amount of the CPB is checked, and the remaining code amount is a predetermined threshold value. Only in the above case, the encoding parameter may be returned to the normal encoding value, and when the remaining code amount is small, the encoding parameter may not be returned to the normal encoding value. In this way, the possibility of continuous re-encoding can be reduced.
  • the retry point described above is position information indicating from which picture re-encoding is started when it is necessary to re-encode due to the occurrence of CPB underflow in a certain picture.
  • the retry point is basically the first picture of the encoding order picture group that is currently encoded, but may be the first picture of the encoding order picture group encoded one time before.
  • the opportunity to update the retry point is as follows. (1) If the remaining CPB code amount is equal to or greater than a predetermined threshold when encoding of the encoding order picture group is completed, the retry point is set to the first picture (I picture) of the next encoding order picture group . (2) When the encoding order picture group has been encoded and the CPB residual code amount is smaller than a predetermined threshold, the retry point remains unchanged and the process proceeds to the encoding of the first picture in the next encoding order picture group. . When CPB underflow does not occur in the encoding of the leading picture of the encoding order picture group, the retry point is set to the leading picture of the encoding order picture group that is currently encoded.
  • the reason for setting retry points as described above will be explained. If the retry point is always set at the head of the encoding order picture group that is currently encoded, the processing configuration becomes simpler than the present invention.
  • this technology is referred to as “related technology”. Also in the related art, only when the CPB underflow occurs, the CPB underflow can be suppressed by re-encoding only the coding order picture group in which it occurred, and all of the input video can be suppressed. The amount of calculation is smaller than that in the conventional technique b in which a picture is encoded twice, and effective code amount distribution control can be realized.
  • An object of the present invention is to realize code amount distribution control that reduces the degradation of the image quality of a decoded image by suppressing CPB underflow more effectively than the related art.
  • an I picture has a larger amount of generated code than other picture types. Therefore, if the amount of remaining CPB code at the time when encoding of a certain coding order picture group is small, there is a high possibility that CPB underflow will occur in the first I picture of the next coding order picture group. In such a case, in the related art, since it is necessary to avoid CPB underflow by re-encoding only the first I picture in which CPB underflow has occurred, the image quality of the I picture may be greatly degraded. There is.
  • the frame of the input video is not always encoded twice as in the conventional two-pass encoding. Basically, only when a CPB underflow occurs, only a plurality of pictures are re-encoded.
  • re-encoding is performed retroactively to a certain picture in the encoding order picture group.
  • Which picture is to be re-encoded is determined in advance according to the amount of available memory.
  • the maximum number of pictures that can be traced during re-encoding is defined as “maximum inter-picture distance”.
  • the processing outline of the present embodiment is as follows. First, the maximum number of pictures that can be traced at the time of re-encoding is obtained based on information on the amount of available memory given from the outside, and this value is stored as the maximum inter-picture distance.
  • re-encoding it is necessary to store the video signal of the picture to be encoded in the input buffer, and it is determined that the re-encoding is not performed in the output buffer. It is necessary to hold the encoded stream of the encoding result until the output of the result is completed. If there is a sufficient amount of memory that can be used, the input buffer and the output buffer each have a memory capacity corresponding to the number of pictures in the coding order picture group, so that when CPB underflow occurs. Re-encoding can be performed from the beginning of the encoding order picture group in units of the encoding order picture group.
  • the maximum inter-picture distance which is the maximum number of pictures that can be traced back during re-encoding, is calculated from the amount of memory that can be used in advance.
  • the encoding of the input video proceeds with the encoding order picture group as a unit.
  • CPB is checked for failure by a predetermined buffer test algorithm. Only when CPB underflow occurs, the encoding parameter is changed so that the generated code amount is reduced. Then, the encoding order picture group being encoded is re-encoded. However, as to which picture of the encoding order picture group being encoded, the picture is to be re-encoded to satisfy the following three conditions.
  • Condition 1 Included in a coding order picture group being coded.
  • Condition 2 Included in the maximum inter-picture distance with reference to a picture in which CPB underflow has occurred.
  • Condition 3 A picture farthest from a picture in which CPB underflow has occurred among pictures satisfying conditions 1 and 2.
  • the retry point is, for example, the first picture in the current coding order picture group if the first picture within the maximum inter-picture distance is in the previous coding order picture group, otherwise the maximum The first picture at the inter-picture distance, that is, the oldest coded picture separated by the maximum inter-picture distance.
  • coding parameters to be changed at the time of re-encoding for example, there are quantization parameters and prefilter strength, and one or more of these are changed.
  • quantization parameters and prefilter strength For example, in the case of a quantization parameter, the step size of the quantization parameter is increased so that the generated code amount of the encoding parameter is reduced.
  • the filter strength of the pre-filter for the input video is changed, the generated code amount can be reduced by changing the blurring degree to a greater extent.
  • the image quality degradation is reduced to the next encoding by returning the encoding parameter to the encoding parameter value at the time of normal encoding. Suppresses spreading to the forward picture group.
  • the encoding parameter at the time of normal encoding means an encoding parameter determined when the state is not re-encoding.
  • the encoding parameter is not necessarily returned to the value at the time of normal encoding, but the remaining code amount of the CPB is checked, and the remaining code amount is a predetermined threshold value. Only in the above case, the encoding parameter may be returned to the normal encoding value, and when the remaining code amount is small, the encoding parameter may not be returned to the normal encoding value. In this way, the possibility of continuous re-encoding can be reduced.
  • the first embodiment of the present invention differs from the conventional two-pass coding (conventional technology b) in which all the frames of the input video are coded twice, and the coding order picture group is changed only when CPB underflow occurs. Encode twice. At the time of re-encoding, encoding is performed with an encoding parameter that suppresses CPB underflow. For this reason, it is possible to reduce the amount of calculation compared to the conventional technique b while suppressing the CPB underflow only when necessary as in the conventional technique b.
  • the second and third embodiments of the present invention differ from the conventional two-pass coding (conventional technology b) in which all frames of the input video are coded twice, and only in the case where the CPB underflow occurs.
  • a picture group is encoded multiple times. Similar to the first embodiment, encoding is performed with encoding parameters that suppress CPB underflow during re-encoding. For this reason, it is possible to reduce the amount of calculation compared to the conventional technique b while suppressing the CPB underflow only when necessary as in the conventional technique b.
  • the amount of change in the encoding parameter at the time of re-encoding can be suppressed and CPB underflow can be suppressed. Degradation of image quality due to encoding can be reduced.
  • the encoding parameter is kept the same as that at the time of re-encoding, so that re-encoding occurs. Can be suppressed.
  • the fourth embodiment of the present invention differs from the conventional two-pass coding (conventional technology b) in which all the frames of the input video are coded twice, and only when the CPB underflow occurs, the coding order picture group is changed. Encode twice. At the time of re-encoding, encoding is performed with an encoding parameter that suppresses CPB underflow. For this reason, it is possible to reduce the amount of calculation compared to the conventional technique b while suppressing the CPB underflow only when necessary as in the conventional technique b.
  • the fourth embodiment of the present invention it is possible to effectively suppress the occurrence of CPB underflow in the leading I picture that has a large amount of generated codes in the coding order picture group. It can be prevented from greatly deteriorating.
  • encoding is performed with an encoding parameter that suppresses CPB underflow. For this reason, it is possible to reduce the amount of calculation compared to the conventional technique b while suppressing the CPB underflow only when necessary as in the conventional technique b.
  • the memory can be effectively used.
  • FIG. 3 is a process flowchart showing the moving picture coding control method according to the first embodiment of the present invention.
  • a picture next to a picture that has been encoded in the input video signal is set as an encoding target (step S101).
  • the input picture set as the encoding target is defined as H.264. H.264 and other predetermined encoding methods (step S102). It is determined whether CPB underflow has occurred due to the encoding of the input picture (step S103). If CPB underflow has occurred, the process proceeds to step S107. Whether CPB underflow has occurred is described in, for example, H.B. It can be determined by a method used in the H.264 standard.
  • step S104 it is determined whether or not the encoding of the final picture has been completed. If the encoding has been completed up to the final picture, the encoding process is terminated.
  • step S105 it is determined whether encoding of the encoding order picture group has been completed. If not completed, the process returns to step S101 to continue the encoding process for the next picture.
  • the encoding parameter is changed by re-encoding (retry) of the encoding order picture group, the encoding parameter is returned to the value at the time of normal encoding ( Returning to step S106) and step S101, encoding processing is performed from the first picture of the next encoding order picture group.
  • step S107 it is determined whether or not the current coding-order picture group has been re-encoded. If the retry has been completed, CPB underflow cannot be avoided even if the encoding-order picture group is re-encoded, and therefore encoding is terminated. If the retry has not been completed, the first picture of the current encoding order picture group is set as an encoding target in order to re-encode the current encoding order picture group (step S108).
  • step S109 the encoding order picture group being encoded is re-encoded.
  • the encoding order picture group (for example, GOP) is encoded twice only when CPB underflow occurs.
  • the second encoding encoding is performed with an encoding parameter that suppresses CPB underflow. Only when the CPB underflow occurs, the CPB underflow is suppressed by re-encoding only the coding order picture group in which the CPB underflow has occurred. Therefore, the amount of calculation can be reduced as compared with the conventional technique b in which all the pictures of the input video are encoded twice.
  • FIG. 4 is a process flowchart showing a modification of the moving picture coding control method according to the first embodiment of the present invention.
  • the process in step S106 shown in FIG. 3 can be replaced with the processes in steps S161 to S163 shown in FIG. Processing other than step S106 is the same as that in FIG.
  • step S161 it is determined whether or not the encoding parameter has been changed by retry. If it has not been changed by retry, the process returns to step S101 in FIG. If it has been changed by retry, it is next determined whether or not the CPB remaining code amount is equal to or larger than a predetermined threshold (step S162). If it is less than the predetermined threshold value, the encoding parameter remains in the state used in re-encoding, and the encoding parameter is returned to the original default encoding parameter only when it is equal to or greater than the predetermined threshold value (step S163). After that, the process returns to step S101 in FIG. 3 and proceeds to encoding of the next encoding order picture group.
  • the encoding parameter is set to the value at the time of normal encoding only when the CPB remaining code amount exceeds a predetermined amount when the encoding of the encoding order picture group is completed as described above. Return to value. This is due to the following reason. Even if encoding of the encoding order picture group is completed, if the CPB residual code amount is small, the generated encoding amount increases when the encoding parameter is returned to the value at the time of normal encoding. The possibility of CPB underflow increases in the coding of pictures. In the process of FIG. 4, when the CPB residual code amount is small, the encoding parameter is not changed. Therefore, compared with the process of FIG. As a result, the amount of calculation is further reduced.
  • the encoding parameter is changed during re-encoding.
  • a pre-filter is applied to the input video during encoding, and the encoding parameters to be changed are a quantization parameter and a pre-filter strength. Both of these two encoding parameters may be changed, or only one of them may be changed.
  • Quantization parameters are re-encoded with a larger quantization parameter by adding a predetermined offset value to the quantization parameter value during normal encoding.
  • the Gaussian filter can be created by sampling the Gaussian distribution expressed by the following equation (1) with respect to x and y.
  • the type of low-pass filter is not limited.
  • how to increase the degree of blurring during re-encoding may be arbitrarily determined in advance.
  • the default encoding parameter ⁇ 0 may be changed in accordance with the complexity of each picture, and ⁇ 1 may be a value obtained by adding a predetermined offset to ⁇ 0 .
  • Encoding is H.264. It is assumed that encoding according to the H.264 standard is performed.
  • the encoding order picture group is GOP, and a conceptual diagram of the GOP when encoding is shown in FIG.
  • One GOP is composed of 10 pictures, and B pictures and P pictures are alternately arranged with the I picture at the head in the display order.
  • FIG. 6 shows an apparatus configuration according to the first embodiment of the present invention.
  • the input buffer 110 accumulates the input video signal and outputs the video signal to be encoded to the encoding unit 120. Furthermore, when receiving information (retry information) indicating that CPB underflow occurs and re-encoding is performed from the CPB management unit 140 (to be described later), the input buffer 110 receives video from the first picture of the GOP being encoded. The signal is output again to the encoding unit 120. When the GOP encoding is completed without receiving the retry information, the input buffer 110 discards the stored video signal of the GOP.
  • retry information information indicating that CPB underflow occurs and re-encoding is performed from the CPB management unit 140 (to be described later
  • the encoding unit 120 encodes the video signal input from the input buffer 110 and outputs the encoded stream to the output buffer 130. Further, the code amount (code amount information) generated when the input video signal is encoded is output to the CPB management unit 140. Furthermore, when receiving the retry information from the CPB management unit 140, the encoding unit 120 receives the video signal from the first picture of the GOP being encoded again from the input buffer 110 and re-encodes it from the parameter adjustment unit 150. Since the encoding parameter for encoding is input, re-encoding is performed using the input encoding parameter for re-encoding.
  • the output buffer 130 outputs the encoded stream of the GOP when all the encoded streams of the GOP are accumulated. On the other hand, when receiving the retry information from the CPB management unit 140, the output buffer 130 accumulates the GOP being encoded. Discard the encoded stream.
  • the CPB management unit 140 uses the code amount information input from the encoding unit 120 to obtain the remaining code amount of the CPB that changes with time. That is, the remaining code amount of CPB shown in the conceptual diagram of FIG. 1 is obtained.
  • retry information is output to the input buffer 110, encoding unit 120, parameter adjustment unit 150, and output buffer 130 to notify that CPB underflow has occurred.
  • the parameter adjustment unit 150 When the parameter adjustment unit 150 receives the retry information from the CPB management unit 140, the parameter adjustment unit 150 inputs the encoding parameter for re-encoding to the encoding unit 120 as described above. As a result, the encoding unit 120 encodes the same GOP using an encoding parameter with a small generated code amount at the time of re-encoding.
  • a process for encoding a certain GOP will be described in three cases as follows.
  • default encoding parameters are used, and filtering processing by the prefilter unit 121 is applied to a picture to be encoded with a prefilter strength corresponding to the default encoding parameters, and DCT coefficients generated in the main picture are generated.
  • the CPB management unit 140 calculates the remaining CPB code amount for the picture based on the code amount information input from the encoding unit 120. In this example, no CPB underflow occurs, so no retry information is output. (S103). If the encoding target picture is the last picture in the input video signal, the output buffer 130 outputs the stored encoded stream, and the encoding process is completed (S104). Alternatively, if the encoding target picture is the last picture of the GOP, the output buffer 130 outputs the stored encoded stream, and the input buffer 110 discards the stored picture, and the first GOP of the next GOP is output. The process proceeds to picture coding processing (S105). Here, since re-encoding has not occurred in the GOP, the process proceeds to the encoding process of the first picture of the next GOP without changing the encoding parameter (S106).
  • the CPB management unit 140 calculates the CPB residual code amount for the picture based on the code amount information input from the encoding unit 120. As a result, when the CPB management unit 140 detects a CPB underflow for the picture, the CPB management unit 140 outputs retry information to the encoding unit 120, the parameter adjustment unit 150, the input buffer 110, and the output buffer 130 ( S103).
  • the input buffer 110 When no retry has occurred for the GOP being encoded (S107), the input buffer 110 outputs the accumulated first picture of the GOP being encoded to the encoding unit 120 (S108), and parameter adjustment The unit 150 outputs the encoding parameter for re-encoding to the encoding unit 120 (S109). Further, the output buffer 130 discards the encoded stream of the GOP being encoded. Then, the encoding unit 120 encodes the leading picture of the input GOP using the re-encoding encoding parameter.
  • the encoding parameter for re-encoding is used in encoding, and the pre-filter strength corresponding to the encoding parameter for re-encoding (the blurring degree is greater than the default encoding parameter) is applied to the picture to be encoded.
  • the pre-filtering process by the filter unit 121 is applied, and the DCT coefficient generated in this picture is quantized by a quantization parameter (a quantization step size is larger than the default coding parameter) according to the encoding parameter for re-encoding. Quantized by the unit 122.
  • the pictures of the GOP are sequentially input from the input buffer 110 to the encoding unit 120, and the encoding unit 120 performs the encoding process.
  • the encoded stream of the GOP is output from the output buffer 130, and the encoding unit 120 sets the encoding parameter as a default encoding parameter ( S106), the process proceeds to the next GOP encoding process.
  • the operation when the encoding of the last picture of the input video is completed is the same as the case 1 described above.
  • Fig. 7 shows a conceptual diagram of changing the encoding parameters when re-encoding is performed.
  • a re-encoding encoding parameter that suppresses the generated code amount is set, and the first I picture of GOP2 Is re-encoded. Since the occurrence of CPB underflow is suppressed by the re-encoding, in the next GOP3 encoding, the re-encoding encoding parameter is returned to the default encoding parameter, and the encoding process is continued.
  • FIG. 8 shows a conceptual diagram of the transition of the remaining CPB code amount when re-encoding is performed.
  • the line indicated by the bold line is the CPB remaining code amount after re-encoding.
  • the pre-filter increases the degree of blurring and the quantization parameter is larger than the default encoding parameter, so that the amount of generated code is suppressed, for example, the transition shown in FIG. 8 is performed, and CPB underflow is suppressed. Is done.
  • FIG. 9 is a process flowchart showing a moving picture coding control method according to the second embodiment of the present invention.
  • a picture next to a picture that has been encoded in the input video signal is set as an encoding target (step S201).
  • the input picture set as the encoding target is defined as H.264. H.264 and other predetermined encoding methods (step S202). It is determined whether CPB underflow has occurred due to the encoding of the input picture (step S203). If CPB underflow has occurred, the process proceeds to step S208. Whether CPB underflow has occurred is described in, for example, H.B. It can be determined by a method used in the H.264 standard.
  • step S204 it is determined whether or not the encoding of the final picture has been completed. If the encoding has been completed up to the final picture, the encoding process is terminated.
  • step S205 it is determined whether encoding of the encoding order picture group has been completed. If not completed, the process returns to step S201 to continue the encoding process for the next picture.
  • the retry count is 1 or more, it is decreased by 1 (step S206). Note that the initial value of the retry count is zero.
  • an encoding parameter predetermined according to the retry count is set (step S207), and the process returns to step S201 to perform encoding processing from the first picture in the next encoding order picture group. .
  • step S208 When it is detected in step S203 that a CPB underflow has occurred, it is determined whether or not the current retry count value is a predetermined maximum value (step S208). In this case, since the CPB underflow cannot be avoided even if the encoding-order picture group is re-encoded, the encoding is terminated.
  • the first picture of the current encoding order picture group is set as an encoding target in order to re-encode the current encoding order picture group (step S209). Then, the retry count is increased by 1 (step S210). After that, based on the retry count, change one or more of the two encoding parameters (quantization parameter, prefilter strength) (quantization parameter has a larger step size, and in the case of filter strength, the blurring degree is larger. (Change) (step S211), the process returns to step S202, and the encoding order picture group being encoded is re-encoded.
  • the present invention is basically a one-time encoding process, and only when a CPB underflow occurs (for example, an encoding order picture group (for example, GOP) is repeatedly encoded with the generated code amount being reduced in steps until no CPB underflow occurs.
  • a CPB underflow for example, an encoding order picture group (for example, GOP)
  • encoding is performed with an encoding parameter that suppresses CPB underflow determined according to the retry count. Therefore, it is possible to reduce the amount of calculation compared to the conventional technique b in which all the pictures of the input video are encoded twice, and it is possible to reduce deterioration in image quality due to re-encoding.
  • the encoding parameter is changed according to the retry count at the time of re-encoding.
  • a pre-filter is applied to the input video during encoding, and the encoding parameters to be changed are a quantization parameter and a pre-filter strength. Both of these two encoding parameters may be changed, or only one of them may be changed.
  • a predetermined offset value that increases stepwise according to the retry count is added to the quantization parameter value determined during normal encoding, and re-encoding is performed with a larger quantization parameter.
  • a Gaussian filter is used as in the first embodiment.
  • the Gaussian filter can be created by sampling the Gaussian distribution expressed by the above-described equation (1) with respect to x and y.
  • the type of low-pass filter is not limited.
  • the default encoding parameter ⁇ 0 may be changed according to the complexity of each picture, and ⁇ c may be obtained by adding a predetermined offset to ⁇ c ⁇ 1 .
  • the encoding method is H.264. It is assumed that encoding according to the H.264 standard is performed. Further, the encoding order picture group is GOP, and FIG. 5 shows a conceptual diagram of GOP when encoding. As in the first embodiment, one GOP is composed of 10 pictures, and B pictures and P pictures are alternately arranged with the I picture at the head in the display order.
  • FIG. 10 shows an apparatus configuration example of the second embodiment of the present invention.
  • the input buffer 210 accumulates the input video signal and outputs the video signal to be encoded to the encoding unit 220. Further, when receiving input information (retry information) indicating that CPB underflow occurs and re-encoding is performed from the CPB management unit 240 (to be described later), the input buffer 210 receives video from the first picture of the GOP being encoded. The signal is output again to the encoding unit 220. When the GOP encoding is completed without receiving retry information, the input buffer 210 discards the stored video signal of the GOP.
  • retry information input information indicating that CPB underflow occurs and re-encoding is performed from the CPB management unit 240 (to be described later
  • the encoding unit 220 encodes the video signal input from the input buffer 210 and outputs the encoded stream to the output buffer 230. Also, the code amount (code amount information) generated when the input video signal is encoded is output to the CPB management unit 240. Further, when receiving the retry information from the CPB management unit 240, the encoding unit 220 receives the video signal from the leading picture of the GOP being encoded again from the input buffer 210 and re-encodes it from the parameter adjustment unit 260. Since the encoding parameter for encoding is input, re-encoding is performed using the input encoding parameter for re-encoding.
  • the output buffer 230 outputs the encoded stream of the GOP when all the encoded streams of the GOP are accumulated. On the other hand, when receiving the retry information from the CPB management unit 240, the output buffer 230 stores the GOP being encoded. Discard the encoded stream.
  • the CPB management unit 240 uses the code amount information input from the encoding unit 220 to obtain the remaining code amount of the CPB that changes with time. That is, the remaining code amount of CPB shown in the conceptual diagram of FIG. 1 is obtained.
  • retry information is output to the input buffer 210, the encoding unit 220, the retry count management unit 250, and the output buffer 230 to notify that CPB underflow has occurred.
  • the parameter adjustment unit 260 When the parameter adjustment unit 260 receives the retry count from the retry count management unit 250, the parameter adjustment unit 260 inputs an encoding parameter determined according to the retry count to the encoding unit 220. As a result, the encoding unit 220 performs encoding using an encoding parameter that reduces the generated code amount as the number of repetitions of re-encoding increases for the same GOP.
  • this embodiment introduces the concept of retry count that increases when re-encoding occurs and decreases when GOP encoding is completed, and is managed by the retry count management unit 250.
  • the retry count has a predetermined upper limit value, for example, an upper limit value of “3”, and the same GOP may be re-encoded until the upper limit value is reached.
  • the offset value of the quantization parameter at the time of encoding and the filter strength of the pre-filter change according to the retry count value.
  • re-encoding encoding parameters corresponding to the retry counts 1, 2, and 3 are prepared in advance as an encoding parameter table. Then, the encoding parameter obtained from the encoding parameter table may be used for re-encoding.
  • a process for encoding a certain GOP will be described in three cases as follows.
  • the prefilter unit 221 applies the encoding target picture with the prefilter strength corresponding to the default encoding parameter.
  • the filtering process is applied, and the DCT coefficient generated in this picture is quantized by the quantization unit 222 with the quantization parameter according to the default encoding parameter.
  • the retry count is 1 or more, encoding is performed by pre-filtering and quantization processing based on the filter strength and the quantization parameter determined according to the retry count.
  • the CPB management unit 240 calculates the remaining CPB code amount for the picture based on the code amount information input from the encoding unit 220. In this example, no CPB underflow occurs, so no retry information is output. (S203). If the encoding target picture is the last picture in the input video signal, the output buffer 230 outputs the stored encoded stream, and the encoding process is completed (S204). Alternatively, if the encoding target picture is the last picture of the GOP, the output buffer 230 outputs the stored encoded stream, and the input buffer 210 discards the stored picture, and the first GOP of the next GOP is output. The process proceeds to picture coding processing (S205 to S207).
  • the retry count management unit 250 decrements the value from the current retry count by 1 except when the retry count is 0 (S206). ).
  • the retry count may not be zero when re-encoding occurs in a GOP prior to the GOP that has currently been encoded.
  • the retry count management unit 250 notifies the parameter adjustment unit 260 of the retry count after the change, and the parameter adjustment unit 260 sets the encoding parameter corresponding to the notified retry count in the encoding unit 220 and the next GOP. Encoding of the first picture is started.
  • the input buffer 210 stores the picture and inputs the picture to the encoding unit 220 as an encoding target picture (S201). Then, the encoding unit 220 encodes the picture, outputs the encoded stream to the output buffer 230 (the output buffer 230 does not output the encoded stream but stores it), and sends it to the CPB management unit 240 related to the picture.
  • the code amount information is output (S202).
  • an encoding parameter corresponding to retry count 1 is used.
  • the CPB management unit 240 calculates the remaining CPB code amount for the picture based on the code amount information input from the encoding unit 220. As a result, when the CPB management unit 240 detects a CPB underflow for the picture, the CPB management unit 240 outputs retry information to the encoding unit 220, the retry count management unit 250, the input buffer 210, and the output buffer 230. (S203).
  • the input buffer 210 Since the current retry count is 1 and has not reached the upper limit of 3 (S208), the input buffer 210 outputs the accumulated first picture of the GOP being encoded to the encoding unit 220 (S209). ). On the other hand, the retry count is incremented by 1 in the retry count management unit 250, and the retry count having a value of 2 is output to the parameter adjustment unit 260 (S210).
  • the parameter adjustment unit 260 reads the encoding parameter when the retry count is 2 from the encoding parameter table, and sets the encoding parameter in the encoding unit 220 (S211).
  • the output buffer 230 discards the encoded stream of the GOP being encoded.
  • the encoding unit 220 unless a CPB underflow occurs, GOP pictures are sequentially input from the input buffer 210 and encoded.
  • the retry count is incremented by 1 and becomes 3 by the same processing as described above.
  • the retry count management unit 250 decrements the retry count by 1, sets the retry count to 2, and proceeds with the encoding of the next GOP.
  • the operations of the input buffer 210 and the output buffer 230 at this time are the same as in the above-described example.
  • Fig. 11 shows a conceptual diagram of retry count and coding parameter transition in the case 2 example.
  • the retry count is set to 2 and the retry is performed again.
  • FIG. 8 shows a conceptual diagram of the transition of the remaining CPB code amount when re-encoding is performed. Similar to the first embodiment, the bold line indicates the CPB residual code amount after re-encoding.
  • the pre-filter increases the degree of blurring and the quantization parameter is larger than the default encoding parameter, so that the amount of generated code is suppressed, for example, the transition shown in FIG. 8 is performed, and CPB underflow is suppressed. Is done.
  • FIG. 12 is a process flowchart showing a moving picture coding control method according to the third embodiment of the present invention.
  • a picture next to a picture that has been encoded in the input video signal is set as an encoding target (step S301).
  • the input picture set as the encoding target is defined as H.264.
  • H.264 or other predetermined encoding methods are used (step S302). It is determined whether CPB underflow has occurred due to encoding of the input picture (step S303). If CPB underflow has occurred, the process proceeds to step S308. Whether CPB underflow has occurred is described in, for example, H.B. It can be determined by a method used in the H.264 standard.
  • step S304 it is determined whether or not the encoding of the final picture has been completed. If the encoding has been completed up to the final picture, the encoding process is terminated.
  • step S305 it is determined whether encoding of the encoding order picture group has been completed. If not completed, the process returns to step S301 to continue the encoding process for the next picture.
  • step S306 When encoding of the encoding-order picture group is completed, it is determined whether the following condition is satisfied, and the retry count is decreased by 1 only when the condition is satisfied (step S306).
  • -Condition 1 Retry count is 1 or more.
  • Condition 2 CPB residual code amount is not less than a predetermined threshold. When the retry count is 0, or when the remaining CPB code amount is smaller than a predetermined threshold, the retry count is not decreased and remains unchanged.
  • step S307 an encoding parameter predetermined according to the retry count is set (step S307), and the process returns to step S301 to perform the encoding process from the first picture in the next encoding order picture group. .
  • step S303 When it is detected in step S303 that a CPB underflow has occurred, it is determined whether or not the current retry count value is a predetermined maximum value (step S308). In this case, since the CPB underflow cannot be avoided even if the encoding-order picture group is re-encoded, the encoding is terminated.
  • the first picture of the current encoding order picture group is set as an encoding target in order to re-encode the current encoding order picture group (step S309). Then, the retry count is increased by 1 (step S310). After that, based on the retry count, change one or more of the two encoding parameters (quantization parameter, prefilter strength) (quantization parameter has a larger step size, and in the case of filter strength, the blurring degree is larger. (Change) (step S311), the process returns to step S302, and the encoding order picture group being encoded is re-encoded.
  • the present invention is basically a one-time encoding process, and only when a CPB underflow occurs (for example, an encoding order picture group (for example, GOP) is repeatedly encoded with the generated code amount being reduced in steps until no CPB underflow occurs.
  • a CPB underflow for example, an encoding order picture group (for example, GOP)
  • encoding is performed with an encoding parameter that suppresses CPB underflow determined according to the retry count. Therefore, it is possible to reduce the amount of calculation compared to the conventional technique b in which all the pictures of the input video are encoded twice, and it is possible to reduce deterioration in image quality due to re-encoding.
  • the encoding parameter is changed according to the retry count at the time of re-encoding.
  • a pre-filter is applied to the input video during encoding, and the encoding parameters to be changed are a quantization parameter and a pre-filter strength. Both of these two encoding parameters may be changed, or only one of them may be changed.
  • a predetermined offset value that increases stepwise according to the retry count is added to the quantization parameter value determined during normal encoding, and re-encoding is performed with a larger quantization parameter.
  • a Gaussian filter is used as in the first embodiment.
  • the Gaussian filter can be created by sampling the Gaussian distribution expressed by the above-described equation (1) with respect to x and y.
  • the type of low-pass filter is not limited.
  • the default encoding parameter ⁇ 0 may be changed according to the complexity of each picture, and ⁇ c may be obtained by adding a predetermined offset to ⁇ c ⁇ 1 .
  • the encoding method is H.264. It is assumed that encoding according to the H.264 standard is performed. Further, the encoding order picture group is GOP, and FIG. 5 shows a conceptual diagram of GOP when encoding. As in the first embodiment, one GOP is composed of 10 pictures, and B pictures and P pictures are alternately arranged with the I picture at the head in the display order.
  • FIG. 13 shows an apparatus configuration example according to the third embodiment of the present invention.
  • the input buffer 310 accumulates the input video signal and outputs the video signal to be encoded to the encoding unit 320. Furthermore, when receiving information (retry information) indicating that CPB underflow occurs and re-encoding from the CPB management unit 340, which will be described later, the input buffer 310 receives video from the first picture of the GOP being encoded. The signal is output again to the encoding unit 320. When the GOP encoding is completed without receiving the retry information, the input buffer 310 discards the stored video signal of the GOP.
  • retry information information indicating that CPB underflow occurs and re-encoding from the CPB management unit 340
  • the encoding unit 320 encodes the video signal input from the input buffer 310 and outputs the encoded stream to the output buffer 330. Also, the code amount (code amount information) generated when the input video signal is encoded is output to the CPB management unit 340. Furthermore, when receiving the retry information from the CPB management unit 340, the encoding unit 320 receives the video signal from the first picture of the GOP being encoded again from the input buffer 310 and re-encodes it from the parameter adjustment unit 370. Since the encoding parameter for encoding is input, re-encoding is performed using the input encoding parameter for re-encoding.
  • the output buffer 330 outputs the encoded stream of the GOP when all the encoded streams of the GOP are accumulated. On the other hand, when receiving the retry information from the CPB management unit 340, the output buffer 330 stores the GOP being encoded. Discard the encoded stream.
  • the CPB management unit 340 uses the code amount information input from the encoding unit 320 to obtain the remaining code amount of the CPB that changes with time. That is, the remaining code amount of CPB shown in the conceptual diagram of FIG. 1 is obtained.
  • retry information is output to the input buffer 310, the encoding unit 320, the retry count management unit 350, and the output buffer 330 to notify that CPB underflow has occurred.
  • the CPB state prediction unit 360 is notified of CPB residual code amount information.
  • the retry count management unit 350 When the retry count management unit 350 receives the retry information from the CPB management unit 340, the retry count management unit 350 adds 1 to the current retry count value and notifies the parameter adjustment unit 370 of the updated retry count.
  • the parameter adjustment unit 370 is notified of the retry count. However, if the parameter change presence / absence information notified from the CPB state prediction unit 360 indicates “no parameter change”, even if the retry count is 1 or more, 1 is not subtracted from the retry count. Further, even when the retry count is 0, the current retry count value is notified to the parameter adjustment unit 370 without subtracting 1 from it.
  • the parameter adjustment unit 370 When the parameter adjustment unit 370 receives the retry count from the retry count management unit 350, the parameter adjustment unit 370 inputs an encoding parameter determined according to the retry count to the encoding unit 320. As a result, the encoding unit 320 performs encoding using an encoding parameter in which the amount of generated code decreases as the number of repetitions of re-encoding increases for the same GOP.
  • this embodiment introduces the concept of retry count, which increases when re-encoding occurs and decreases when GOP encoding is completed, and is managed by the retry count management unit 350.
  • the retry count has a predetermined upper limit value, for example, an upper limit value of “3”, and the same GOP may be re-encoded until the upper limit value is reached.
  • the offset value of the quantization parameter at the time of encoding and the filter strength of the pre-filter change according to the retry count value.
  • re-encoding encoding parameters corresponding to the retry counts 1, 2, and 3 are prepared in advance as an encoding parameter table. Then, the encoding parameter obtained from the encoding parameter table may be used for re-encoding.
  • a process for encoding a certain GOP will be described in three cases as follows.
  • the prefilter unit 321 applies the pre-filter strength corresponding to the default encoding parameter to the encoding target picture.
  • the filtering process is applied, and the DCT coefficient generated in this picture is quantized by the quantization unit 322 with the quantization parameter according to the default coding parameter.
  • the retry count is 1 or more, encoding is performed by pre-filtering and quantization processing based on the filter strength and the quantization parameter determined according to the retry count.
  • the CPB management unit 340 calculates the CPB residual code amount for the picture based on the code amount information input from the encoding unit 320. In this example, no CPB underflow occurs, so no retry information is output. (S303). If the encoding target picture is the last picture in the input video signal, the output buffer 330 outputs the stored encoded stream, and the encoding process is completed (S304). Alternatively, if the encoding target picture is the last picture of the GOP, the output buffer 330 outputs the stored encoded stream, and the input buffer 310 discards the stored picture, and the first GOP of the next GOP is output. The process proceeds to a picture encoding process (S305 to S307).
  • the CPB management unit 340 transmits the CPB remaining code amount information to the CPB state prediction unit when the GOP encoding is completed. 360 is notified.
  • the CPB state prediction unit 360 determines whether or not the CPB remaining code amount is larger than a predetermined threshold, and if so, notifies the retry count management unit 350 that the coding parameter is changed as parameter change presence / absence information.
  • the retry count management unit 350 is notified that the coding parameter is not changed as the parameter change presence / absence information.
  • the retry count management unit 350 decrements the value from the current retry count by 1 only when the parameter change presence / absence information indicates that the encoding parameter is to be changed (S306).
  • the retry count may not be 0 when re-encoding occurs in a GOP before the GOP that has been encoded.
  • the retry count management unit 350 changes the retry count according to the notification of the parameter change presence / absence information from the CPB state prediction unit 360 and notifies the parameter adjustment unit 370 of the changed retry count.
  • the parameter adjustment unit 370 sets an encoding parameter corresponding to the notified retry count in the encoding unit 320, and starts encoding the first picture of the next GOP.
  • the input buffer 310 stores the picture and inputs the picture to the encoding unit 320 as an encoding target picture (S301). Then, the encoding unit 320 encodes the picture, outputs the encoded stream to the output buffer 330 (the output buffer 330 does not output the encoded stream but stores it), and sends it to the CPB management unit 340 related to the picture.
  • the code amount information is output (S302).
  • an encoding parameter corresponding to retry count 1 is used.
  • the CPB management unit 340 calculates the remaining CPB code amount for the picture based on the code amount information input from the encoding unit 320. As a result, when the CPB management unit 340 detects a CPB underflow for the picture, the CPB management unit 340 outputs retry information to the encoding unit 320, the retry count management unit 350, the input buffer 310, and the output buffer 330. (S303).
  • the input buffer 310 Since the current retry count is 1 and has not reached the upper limit of 3 (S308), the input buffer 310 outputs the accumulated first picture of the GOP being encoded to the encoding unit 320 (S309). ). On the other hand, the retry count is increased by 1 in the retry count management unit 350, and the retry count having a value of 2 is output to the parameter adjustment unit 370 (S310).
  • the parameter adjustment unit 370 reads the encoding parameter when the retry count is 2 from the encoding parameter table, and sets the encoding parameter in the encoding unit 320 (S311).
  • the output buffer 330 discards the encoded stream of the GOP being encoded.
  • the encoding unit 320 unless a CPB underflow occurs, GOP pictures are sequentially input from the input buffer 310 and encoded.
  • the retry count is incremented by 1 and becomes 3 by the same processing as described above.
  • the CPB management unit 340 notifies the CPB state prediction unit 360 of information on the remaining CPB code amount.
  • the CPB state prediction unit 360 notifies the retry count management unit 350 that the parameter change presence / absence information is “changed” when the CPB state residual code amount is equal to or larger than a predetermined threshold, and “no change” otherwise. To do.
  • the retry count is reduced by 1 by the retry count management unit 350, the retry count becomes 2, and the encoding of the next GOP proceeds.
  • the operations of the input buffer 310 and the output buffer 330 at this time are the same as in the above-described example. If the parameter change presence / absence information is “no change”, the retry count remains 3, and the encoding of the next GOP proceeds.
  • Fig. 11 shows a conceptual diagram of retry count and coding parameter transition in the case 2 example.
  • the second GOP2 is encoded with the retry count being 1
  • a CPB underflow has occurred in the encoding of the sixth picture.
  • the retry count is set to 2
  • FIG. 8 shows a conceptual diagram of the transition of the remaining CPB code amount when re-encoding is performed.
  • the bold line represents the CPB residual code amount after re-encoding.
  • the pre-filter increases the degree of blurring and the quantization parameter is larger than the default encoding parameter, so that the amount of generated code is suppressed, for example, the transition shown in FIG. 8 is performed, and CPB underflow is suppressed. Is done.
  • FIG. 14 is a process flowchart showing a moving picture coding control method according to the fourth embodiment of the present invention.
  • a picture next to a picture that has been encoded in the input video signal is set as an encoding target (step S401).
  • the input picture set as the encoding target is defined as H.264.
  • H.264 or other predetermined encoding method is used (step S402). It is determined whether CPB underflow has occurred due to encoding of the input picture (step S403). If CPB underflow has occurred, the process proceeds to step S411. Whether CPB underflow has occurred is described in, for example, H.B. It can be determined by a method used in the H.264 standard.
  • step S404 it is determined whether or not the encoding of the final picture has been completed. If the encoding has been completed up to the final picture, the encoding process is terminated.
  • step S405 it is determined whether the encoded picture is the first I picture in the encoding order picture group. If the current encoded picture is the first I picture in the encoding order picture group, the I picture is set as a retry point (step S406). This is because, in step S409, which will be described later, when the CPB residual code amount is less than the predetermined threshold, the retry point remains set at the head of the previous coding-order picture group. This is a process for updating the retry point after confirming that no underflow occurs. If a retry point is set in step S410, the retry point is reset at the same position, but there is no inconvenience in processing. Thereafter, the process returns to step S401, and the encoding of the next picture proceeds.
  • step S407 it is next determined whether or not the encoding order picture group has been encoded. If not completed, the process returns to step S401, and the encoding process continues for the next picture.
  • the encoding parameter is changed by re-encoding (retry) of the encoding order picture group, the encoding parameter is returned to the value at the time of normal encoding (Ste S408).
  • step S409 it is determined whether or not the CPB remaining code amount is equal to or larger than a predetermined threshold. If the CPB remaining code amount is equal to or greater than a predetermined threshold, the retry point is set to the first I picture of the next coding order picture group (step S410). Thereafter, the process returns to step S401, and encoding is performed in order from the beginning of the next encoding order picture group.
  • the retry point is not updated, and the process returns to step S401 to proceed to the encoding of the next encoding order picture group.
  • step S431 If it is detected in step S403 that a CPB underflow has occurred, it is determined whether or not the current coding-order picture group has been re-encoded (retry has been completed) (step S411). If the retry has been completed, CPB underflow cannot be avoided even if the encoding-order picture group is re-encoded, and therefore encoding is terminated. If the retry has not been completed, the picture at the retry point is set as an encoding target in order to re-encode the current encoding-order picture group (step S412).
  • step S43 the quantization parameter has a larger step size, and in the case of the filter strength, the blurring degree is changed to be larger.
  • the encoding order picture group (for example, GOP) is encoded twice only when CPB underflow occurs.
  • encoding is performed with an encoding parameter that suppresses CPB underflow. Only when a CPB underflow occurs, only the coding order picture group in which it has occurred is re-encoded (in some cases, the previous coding order picture group may be re-encoded. ), Suppresses CPB underflow. Therefore, the amount of calculation can be reduced as compared with the conventional technique b in which all the pictures of the input video are encoded twice.
  • FIG. 15 is a process flowchart showing a modification of the moving picture coding control method according to the fourth embodiment of the present invention.
  • the present invention can also be implemented by replacing the processing in step S408 shown in FIG. 14 with the processing in steps S481 to S483 shown in FIG. Processes other than step S408 are substantially the same as those in FIG.
  • step S481 it is determined whether the encoding parameter has been changed by retry. If it has not been changed by the retry, the process proceeds to step S409. If it has been changed by retry, it is next determined whether or not the CPB remaining code amount is equal to or greater than a predetermined first threshold (step S482). If it is less than the predetermined threshold value, the encoding parameter remains in the state used in re-encoding, and the encoding parameter is returned to the original default encoding parameter only when it is equal to or greater than the predetermined threshold value (step S483).
  • step S409 it is determined whether or not the CPB remaining code amount is equal to or larger than a predetermined second threshold.
  • This process and the process of step S410 are the same as the processes of steps S409 and S410 shown in FIG. Note that the first threshold value and the second threshold value may be the same value or different values.
  • the encoding parameter is changed during re-encoding.
  • a pre-filter is applied to the input video during encoding, and the encoding parameters to be changed are a quantization parameter and a pre-filter strength. Both of these two encoding parameters may be changed, or only one of them may be changed.
  • Quantization parameters are re-encoded with a larger quantization parameter by adding a predetermined offset value to the quantization parameter value during normal encoding.
  • a Gaussian filter is used as in the first embodiment.
  • the Gaussian filter can be created by sampling the Gaussian distribution expressed by the above-described equation (1) with respect to x and y.
  • the type of low-pass filter is not limited.
  • how to increase the degree of blurring during re-encoding may be arbitrarily determined in advance.
  • the default encoding parameter ⁇ 0 may be changed in accordance with the complexity of each picture, and ⁇ 1 may be a value obtained by adding a predetermined offset to ⁇ 0 .
  • Encoding is H.264. It is assumed that encoding according to the H.264 standard is performed.
  • the encoding order picture group is GOP, and a conceptual diagram of the GOP when encoding is shown in FIG. As in the first embodiment, one GOP is composed of 10 pictures, and B pictures and P pictures are alternately arranged with the I picture at the head in the display order.
  • FIG. 16 shows an apparatus configuration example of the fourth embodiment of the present invention.
  • the input buffer 410 accumulates the input video signal and outputs the video signal to be encoded to the encoding unit 420. Further, when receiving information (retry information) indicating that CPB underflow occurs and re-encoding is performed from the CPB management unit 440 described later, the input buffer 410 starts from the first picture of the GOP set as the retry point. The video signal is output again to the encoding unit 420. When retry point information is input from the retry point management unit 460, the input buffer 410 discards the stored GOP video signal before the retry point.
  • the encoding unit 420 encodes the video signal input from the input buffer 410 and outputs the encoded stream to the output buffer 430. Also, the code amount (code amount information) generated when the input video signal is encoded is output to the CPB management unit 440. Furthermore, when receiving the retry information from the CPB management unit 440, the encoding unit 420 receives the video signal from the first picture of the GOP indicated by the retry point again from the input buffer 410 and re-encodes it from the parameter adjustment unit 470. Since the encoding parameter for encoding is input, re-encoding is performed using the input encoding parameter for re-encoding.
  • the output buffer 430 Based on the retry point information from the retry point management unit 460, the output buffer 430 outputs an encoded stream that is determined to be output, that is, an encoded stream that is determined to be unnecessary to be re-encoded. . On the other hand, when receiving the retry information from the CPB management unit 440, the output buffer 430 discards the encoded stream stored for the GOP being encoded.
  • the CPB management unit 440 uses the code amount information input from the encoding unit 420 to obtain the remaining code amount of the CPB that changes with time. That is, the remaining code amount of CPB shown in the conceptual diagram of FIG. 1 is obtained.
  • retry information is output to the input buffer 410, encoding unit 420, parameter adjustment unit 470, and output buffer 430 to notify that CPB underflow has occurred.
  • CPB management section 440 outputs the CPB remaining code amount at the time when the GOP encoding is completed to CPB state prediction section 450.
  • the CPB state prediction unit 450 determines whether or not the CPB residual code amount is larger than a predetermined threshold value.
  • the retry point management unit 460 determines the retry point of the next GOP as the head of the GOP. Information indicating that this is an I picture is notified as retry point change presence / absence information.
  • the value is smaller than the threshold, information indicating that the retry point of the first picture of the next GOP is the first picture (I picture) of the GOP immediately before the GOP is notified as retry point change presence / absence information.
  • the retry point management unit 460 notifies the input buffer 410 of the retry point.
  • the input buffer 410 is notified that the retry point is set as the first picture of the GOP currently encoded from the encoding of the next picture.
  • the retry point is notified to the input buffer 410 and the output buffer 430.
  • notification information is referred to as retry point information.
  • the input buffer 410 inputs a video signal from the picture based on the retry point information to the encoding unit 420 at the time of re-encoding, and the output buffer 430 is determined to output based on the retry point information. Output only stream.
  • the parameter adjustment unit 470 When the parameter adjustment unit 470 receives retry information from the CPB management unit 440, the parameter adjustment unit 470 inputs the encoding parameter for re-encoding to the encoding unit 420 as described above. As a result, the encoding unit 420 encodes the same GOP using an encoding parameter with a small generated code amount at the time of re-encoding.
  • a process for encoding a certain GOP will be described with the first GOP as GOP 1 and the next GOP as GOP 2 in the following four cases.
  • a default encoding parameter is used, and a filtering process by the prefilter unit 421 is applied to a picture to be encoded with a prefilter strength corresponding to the default encoding parameter, and a DCT coefficient generated in the main picture is generated.
  • the CPB management unit 440 calculates the CPB residual code amount for the picture based on the code amount information input from the encoding unit 420. In this example, no CPB underflow occurs, so no retry information is output. (S403). If the encoding target picture is the final picture in the input video signal, the output buffer 430 outputs the stored encoded stream, and the encoding process is completed (S404).
  • the retry point management unit 460 sets the first picture (I picture) of GOP1 as a retry point (S406), and then the encoding unit 420 continues with the next picture.
  • the encoding of the picture is advanced.
  • the parameter adjustment unit 470 changes the encoding parameter to the default encoding parameter when the encoding parameter for re-encoding is used for re-encoding. (S408).
  • the CPB management unit 440 outputs CPB residual code amount information to the CPB state prediction unit 450, and the CPB state prediction unit 450 determines whether the CPB residual code amount is larger than a predetermined threshold (S409).
  • the determination result is notified to the retry point management unit 460 as the above-described retry point change presence / absence information.
  • the retry point management unit 460 notifies the input buffer 410 that the retry point is the first picture of GOP1 as retry point information. Thereafter, the process proceeds to the encoding process of the first I picture of GOP2 (S402).
  • the retry point management unit 460 When no CPB underflow occurs in the encoding of the I picture (S403), the retry point management unit 460 includes the input buffer 410 and the output buffer. 430 is notified that the retry point is the first picture of GOP2 (S406). That is, when re-encoding occurs in subsequent GOP2 pictures, re-encoding is performed from the first picture of GOP2.
  • retry change presence / absence information indicating that the retry point is to be changed is output from the CPB state prediction unit 450 to the retry point management unit 460. Then, the retry point management unit 460 notifies the input buffer 410 that the retry point is the first picture of GOP2 as retry point information (S410). In this case, even if CPB underflow occurs in any picture of GOP2 next, re-encoding is performed from the first picture of GOP2.
  • the input buffer is based on the retry information from the CPB management unit 440.
  • 410 sequentially inputs pictures into the encoding unit 420 from the first picture of GOP1, and the encoding unit 420 performs re-encoding.
  • the encoding parameter for re-encoding set from the parameter adjustment unit 470 is used (S413).
  • the pre-filter unit 421 applies a pre-filtering process to the encoding target picture with a pre-filter strength corresponding to the encoding parameter for re-encoding (a blurring degree is larger than the default encoding parameter),
  • the DCT coefficient generated in this picture is quantized by the quantization unit 422 with a quantization parameter (a quantization step size is larger than the default encoding parameter) according to the re-encoding encoding parameter.
  • the retry point is set to the first picture of GOP1 or the first picture of GOP2 according to the CPB residual code amount at that time, The encoding process for the first picture proceeds.
  • FIG. 7 shows a conceptual diagram of changing the encoding parameter when re-encoding is performed on an intermediate picture of GOP2.
  • CPB underflow has occurred in the encoding of the sixth picture of GOP2. Therefore, the encoding parameter for re-encoding that suppresses the generated code amount is set, Re-encoding is performed from the first I picture of GOP2. Since the occurrence of CPB underflow is suppressed by the re-encoding, in the next GOP3 encoding, the re-encoding encoding parameter is returned to the default encoding parameter, and the encoding process is continued.
  • FIG. 8 shows a conceptual diagram of the transition of the remaining CPB code amount when re-encoding is performed. Similar to the first to third embodiments, the bold line represents the CPB residual code amount after re-encoding.
  • the pre-filter increases the degree of blurring and the quantization parameter is larger than the default encoding parameter, so that the amount of generated code is suppressed, for example, the transition shown in FIG. 8 is performed, and CPB underflow is suppressed. Is done.
  • FIG. 17 is a process flowchart showing a moving picture coding control method according to the fifth embodiment of the present invention.
  • NM is called the inter-picture distance for the Mth picture and the Nth picture (N> M) in the coding order.
  • the maximum inter-picture distance which is the maximum inter-picture distance that can be traced back within the memory limit at the time of re-encoding, is obtained and stored based on information on the amount of available memory given from the outside (S500).
  • the picture next to the picture that has been encoded in the input video signal (the leading picture of the input video signal at the start of encoding) is set as the encoding target (step S501).
  • the input picture set as the encoding target is defined as H.264.
  • H.264 and other predetermined encoding methods are used (step S502).
  • CPB underflow has occurred due to the encoding of the input picture (step S503). If CPB underflow has occurred, the process proceeds to step S507.
  • Whether CPB underflow has occurred is described in, for example, H.B. It can be determined by a method used in the H.264 standard.
  • step S504 it is determined whether or not the encoding of the last picture has been completed. If the encoding has been completed up to the last picture, the encoding process is terminated.
  • step S505 it is determined whether or not the encoding order picture group has been encoded. If not completed, the process returns to step S501 to continue the encoding process for the next picture.
  • the encoding parameter is changed by re-encoding (retry) of the encoding order picture group, the encoding parameter is returned to the value at the time of normal encoding ( Returning to step S506) and step S501, the encoding process is performed from the head picture of the next encoding order picture group.
  • step S507 it is determined whether the current picture being encoded has been re-encoded (retry has been completed) (step S507). If the retry has been completed, the CPB underflow cannot be avoided even if the pictures in the coding order picture group are re-encoded, and thus the encoding is terminated. If the retry has not been completed, a retry point is set for re-encoding the pictures in the current encoding-order picture group. That is, the farthest picture included in the encoding order picture group being encoded within the range of the maximum inter-picture distance calculated in step S500 is set as an encoding target (step S508).
  • step S509 one or more of the two encoding parameters (quantization parameter, prefilter strength) are changed (the quantization parameter has a larger step size, and in the case of filter strength, the blurring degree is changed to be larger) (step S509). ), The process returns to step S502, and re-encoding is performed from the pictures in the encoding order picture group set as the retry point.
  • the above re-encoding process unlike the conventional technique b in which all frames of the input video are encoded twice, only a plurality of pictures in the encoding-order picture group (for example, GOP) is generated only when CPB underflow occurs. Is encoded twice.
  • encoding is performed with an encoding parameter that suppresses CPB underflow. Only when the CPB underflow occurs, the CPB underflow is suppressed by re-encoding only a plurality of pictures in the coding order picture group in which the CPB underflow has occurred. Therefore, the amount of calculation can be reduced as compared with the conventional technique b in which all the pictures of the input video are encoded twice. Further, the memory required as the input buffer and the output buffer is only required for the predetermined number of pictures, and the memory can be reduced.
  • FIG. 18 is a process flowchart showing a modification of the moving picture coding control method according to the fifth embodiment of the present invention.
  • the present invention can be implemented by replacing the processing in step S506 shown in FIG. 17 with the processing in steps S561 to S563 shown in FIG. Processes other than step S506 are the same as those in FIG.
  • step S561 it is determined whether the encoding parameter has been changed by retry. If it has not been changed by retry, the process returns to step S501 in FIG. If it has been changed by retry, it is next determined whether or not the CPB remaining code amount is equal to or greater than a predetermined threshold (step S562). If it is less than the predetermined threshold, the encoding parameter remains in the state used for re-encoding, and the encoding parameter is returned to the original default encoding parameter only when it is equal to or greater than the predetermined threshold (step S563). Thereafter, the process returns to step S501 in FIG. 17, and the process proceeds to encoding of the next encoding order picture group.
  • the encoding parameter is set at the time of normal encoding. Return to value. This is due to the following reason. Even if encoding of the encoding order picture group is completed, if the CPB residual code amount is small, the generated encoding amount increases when the encoding parameter is returned to the value at the time of normal encoding. The possibility of CPB underflow increases in the coding of pictures. In the process of FIG. 18, when the CPB residual code amount is small, the encoding parameter is not changed. Therefore, compared to the process of FIG. 17, the occurrence of re-encoding is suppressed in encoding of the next encoding order picture group. As a result, the amount of calculation is further reduced.
  • the encoding parameter is changed during re-encoding.
  • a pre-filter is applied to the input video during encoding, and the encoding parameters to be changed are a quantization parameter and a pre-filter strength. Both of these two encoding parameters may be changed, or only one of them may be changed.
  • Quantization parameters are re-encoded with a larger quantization parameter by adding a predetermined offset value to the quantization parameter value during normal encoding.
  • a Gaussian filter is used as in the first embodiment.
  • the Gaussian filter can be created by sampling the Gaussian distribution expressed by the above-described equation (1) with respect to x and y.
  • the type of low-pass filter is not limited.
  • how to increase the degree of blurring during re-encoding may be arbitrarily determined in advance.
  • the default encoding parameter ⁇ 0 may be changed in accordance with the complexity of each picture, and ⁇ 1 may be a value obtained by adding a predetermined offset to ⁇ 0 .
  • Encoding is H.264. It is assumed that encoding according to the H.264 standard is performed.
  • the encoding order picture group is GOP, and a conceptual diagram of the GOP when encoding is shown in FIG. As in the first embodiment, one GOP is composed of 10 pictures, and B pictures and P pictures are alternately arranged with the I picture at the head in the display order.
  • FIG. 19 shows an apparatus configuration example according to the fifth embodiment of the present invention.
  • the maximum inter-picture distance determination unit 600 is notified of the usable memory amount from the outside (usable memory amount information), and obtains the maximum inter-picture distance that can be traced back at the time of re-encoding based on this.
  • the input video signal of the GOP being encoded is stored in the input buffer 510, and the encoded stream of the GOP being encoded is stored in the output buffer 530.
  • the maximum inter-picture distance determination unit 600 starts from the case where the GOP length is set to the maximum inter-picture distance, and reduces the maximum inter-picture distance value while reducing the value of the maximum inter-picture distance in the worst case of the input buffer 510 and the output buffer 530.
  • the inter-picture distance at which the sum of the used memory amounts becomes equal to or less than the usable memory amount is determined, and the maximum inter-picture distance is determined.
  • the required memory amount of the input buffer 510 is as follows.
  • the required memory amount of input buffer (maximum distance between pictures + 1) x (data amount of one picture)
  • the required memory amount of the output buffer 530 is the maximum code amount that can be generated without causing CPB underflow, under the restrictions of the size of the CPB and the bit rate. Specifically, when the CPB residual code amount is equal to the CPB size immediately before the start of the GOP code, and all the data input to the CPB according to the bit rate is used up (the CPB residual code amount is 0 after GOP encoding). Is the maximum amount of code that can be generated. As a calculation formula in terms of the number of bits, the required memory capacity of the output buffer is as follows.
  • Required memory size of output buffer (bit rate / number of pictures per second) ⁇ (maximum inter-picture distance + 1) + (size of CPB in number of bits)
  • H. In the case of H.264, it is necessary to leave the decoded image created during the GOP encoding as a reference image in preparation for re-encoding (if not, it is necessary to encode from the retry point at the time of re-encoding. No reference image). Since pictures in the GOP do not refer to pictures prior to the GOP, the reference picture is stored in the DPB (Decoded Picture Buffer) as long as I and P pictures are presupposed. In all situations, there will be enough memory.
  • DPB Decoded Picture Buffer
  • FIG. 20 shows a conceptual diagram for explaining the required memory amount.
  • the GOP has a 10-picture configuration and the maximum inter-picture distance is 6 as shown in FIG.
  • the maximum number of pictures to be held in the input buffer 510 is seven.
  • the decoded images of the first I picture and the next P picture also need to be held in the memory as reference images.
  • the maximum inter-picture distance is equal to the GOP length
  • the number of pictures to be held in 510 is reduced by three. That is, the smaller the maximum inter-picture distance, the larger the reference image memory amount.
  • the required memory amount decreases when the maximum inter-picture distance is reduced. .
  • a motion vector of a reference image may be referred to, and thus a memory for this may be necessary.
  • the necessary memory is calculated depending on the encoder configuration.
  • the maximum inter-picture distance is determined by obtaining the inter-picture distance whose sum is less than the usable memory amount.
  • the maximum inter-picture distance determination unit 600 is not notified of the amount of available memory from the outside and the maximum inter-picture distance is calculated. You may make it give to the distance determination part 600 between pictures.
  • the maximum inter-picture distance determination unit 600 notifies the retry point management unit 560 of the determined maximum inter-picture distance information.
  • the input buffer 510 stores the input video signal and outputs the video signal to be encoded to the encoding unit 520. Further, the input buffer 510 receives the retry point notified from the retry point management unit 560 when receiving information (retry information) indicating that CPB underflow occurs and re-encoding is performed from the CPB management unit 540 described later. The video signal from the picture is output to the encoding unit 520 again. Further, when the retry point information is notified from the retry point management unit 560, the input buffer 510 discards the stored video signal data corresponding to the pictures before the retry point.
  • the encoding unit 520 encodes the video signal input from the input buffer 510 and outputs the encoded stream to the output buffer 530.
  • the encoding unit 520 outputs the code amount (code amount information) generated when the input video signal is encoded to the CPB management unit 540 when the encoding of the picture is completed, and the retry point.
  • Information indicating that the encoding of the picture has been completed is output to the management unit 560.
  • the encoding unit 520 receives retry information from the CPB management unit 540, the video signal from the picture of the retry point in the GOP being encoded is input again from the input buffer 510 and also from the parameter adjustment unit 550. Since the encoding parameter for re-encoding is input, re-encoding is performed using the input encoding parameter for re-encoding.
  • the output buffer 530 stores the encoded stream that is the GOP encoding result, and when the retry point information is notified from the retry point management unit 560, the output buffer 530 corresponds to the pictures before the retry point stored so far.
  • the encoded stream is output and the data is removed from the output buffer 530.
  • the encoded stream stored for the GOP being encoded is discarded.
  • the CPB management unit 540 uses the code amount information input from the encoding unit 520 to obtain the remaining code amount of the CPB that changes with time. That is, the remaining code amount of CPB shown in the conceptual diagram of FIG. 1 is obtained.
  • retry information is output to the input buffer 510, encoding unit 520, parameter adjustment unit 550, and output buffer 530 to notify that CPB underflow has occurred.
  • the parameter adjustment unit 550 When the parameter adjustment unit 550 receives retry information from the CPB management unit 540, the parameter adjustment unit 550 inputs the encoding parameter for re-encoding to the encoding unit 520 as described above. As a result, the encoding unit 520 encodes the same GOP using an encoding parameter with a small generated code amount at the time of re-encoding.
  • the retry point management unit 560 based on the encoding complete picture information and the maximum inter-picture distance information, specifies retry point information indicating where the retry point becomes when a CPB underflow occurs in encoding the next picture. This is notified to the input buffer 510 and the output buffer 530.
  • a process for encoding a certain GOP will be described in three cases as follows.
  • a default encoding parameter is used, and a filtering process by the prefilter unit 521 is applied to a picture to be encoded with a prefilter strength corresponding to the default encoding parameter, and a DCT coefficient generated in the main picture is generated.
  • the CPB management unit 540 calculates the remaining CPB code amount for the picture based on the code amount information input from the encoding unit 520. In this example, no CPB underflow occurs, so no retry information is output. (S503). If the encoding target picture is the last picture in the input video signal, the output buffer 530 outputs the stored encoded stream, and the encoding process is completed (S504). Alternatively, if the encoding target picture is the last picture of the GOP, the output buffer 530 outputs the stored encoded stream, and the input buffer 510 discards the stored picture, and the first GOP of the next GOP is output. The process proceeds to picture coding processing (S505). Here, since re-encoding has not occurred in the GOP, the process proceeds to the encoding process of the first picture of the next GOP without changing the encoding parameter (S506).
  • the CPB management unit 540 calculates the CPB residual code amount for the picture based on the code amount information input from the encoding unit 520. As a result, when the CPB management unit 540 detects CPB underflow for the picture, the CPB management unit 540 outputs retry information to the encoding unit 520, parameter adjustment unit 550, input buffer 510, and output buffer 530 ( S503).
  • the input buffer 510 When retry has not yet occurred for the GOP being encoded (S507), the input buffer 510 outputs the picture at the position indicated by the retry point in the GOP being encoded to the encoder 520 ( In step S508, the parameter adjustment unit 550 outputs the encoding parameter for re-encoding to the encoding unit 520 (S509). Furthermore, the output buffer 530 discards the encoded stream of the GOP being encoded. Then, the encoding unit 520 encodes the picture after the retry point input using the encoding parameter for re-encoding.
  • the encoding parameter for re-encoding is used in encoding, and the pre-filter strength corresponding to the encoding parameter for re-encoding (the blurring degree is greater than the default encoding parameter) is applied to the picture to be encoded.
  • the pre-filtering process by the filter unit 521 is applied, and the DCT coefficient generated in this picture is quantized with a quantization parameter (a quantization step size is larger than the default encoding parameter) according to the encoding parameter for re-encoding. Quantized by the unit 522.
  • the pictures of the GOP are sequentially input from the input buffer 510 to the encoding unit 520, and the encoding unit 520 performs the encoding process.
  • the encoded stream of the GOP is output from the output buffer 530, and the encoding unit 520 sets the encoding parameter as a default encoding parameter ( S506), the process proceeds to the next GOP encoding process.
  • the operation when the encoding of the last picture of the input video is completed is the same as the case 1 described above.
  • Fig. 7 shows a conceptual diagram of changing the encoding parameters when re-encoding is performed. Similar to the first embodiment, in the example of FIG. 7, since CPB underflow occurred in the encoding of the sixth picture of the second GOP2, a re-encoding encoding parameter that suppresses the generated code amount is set. Thus, re-encoding is performed from the first I picture of GOP2 within the range of the maximum inter-picture distance. Since the occurrence of CPB underflow is suppressed by the re-encoding, in the next GOP3 encoding, the re-encoding encoding parameter is returned to the default encoding parameter, and the encoding process is continued.
  • FIG. 8 shows a conceptual diagram of the transition of the remaining CPB code amount when re-encoding is performed.
  • the bold line represents the CPB residual code amount after re-encoding.
  • the pre-filter increases the degree of blurring and the quantization parameter is larger than the default encoding parameter, so that the amount of generated code is suppressed, for example, the transition shown in FIG. 8 is performed, and CPB underflow is suppressed. Is done.
  • FIG. 21 is a diagram for explaining the memory reduction of the input buffer and the output buffer by limiting the retry point with the maximum inter-picture distance.
  • a retry point is set according to this embodiment will be described as “Case A”.
  • the picture that starts re-encoding when a CPB underflow occurs can always be the first picture of a coding-order picture group (for example, GOP). This is called “Case B”.
  • the currently encoded picture is the ninth P picture of GOP2 ′ as shown in FIG. 21, and the maximum inter-picture distance is “5”.
  • the input buffer 510 corresponding to these pictures and Data in the output buffer 530 need not be retained (can be discarded).
  • case B data corresponding to these pictures are held in the input buffer 510 and the output buffer 530 until encoding of GOP2 from the first picture of GOP2 ′ is completed. This increases the amount of memory required.
  • the memory amount can be reduced as compared with Case B.
  • the video encoding control processing according to the first to fifth embodiments described above can be realized by a computer and a software program, and the program can be recorded on a computer-readable recording medium. It is also possible to provide through.
  • the present invention can be applied to a moving picture coding technique for coding a video signal, and is coded so as to prevent underflow of a virtual buffer such as a coded picture buffer in a virtual decoder. Image quality can be improved.

Abstract

 本発明の動画像符号化制御方法は、GOPなどの符号化順ピクチャ群を単位として,各ピクチャを符号化し,CPBアンダーフローが生じた場合には,量子化パラメータ,プレフィルタのフィルタ強度などの符号化パラメータを発生符号量が減少するように変更し,変更後の符号化パラメータを用いて符号化中の符号化順ピクチャ群の先頭のピクチャから再符号化する。

Description

動画像符号化制御方法,動画像符号化装置および動画像符号化プログラム
 本発明は,仮想デコーダにおける符号化ピクチャバッファ(CPB:Coded Picture Buffer)等の仮想バッファの破綻が生じないように,かつ画質の劣化が大きくならないように映像信号を符号化するための動画像符号化技術に関する。
 本願は、2010年5月7日に日本に出願された特願2010-106851号、特願2010-106852号、特願2010-106853号、特願2010-106854号および特願2010-106855号に基づき優先権を主張し、その内容をここに援用する。
 映像信号の符号化では,デコーダを破綻させないように符号化を行う必要がある。H.264符号化方式では,デコーダをモデル化した仮想デコーダHRD(Hypothetical Reference Decoder)を規定している。H.264の符号化器は,仮想デコーダを破綻させないように符号化をする必要がある。本発明は,仮想デコーダのCPBの破綻,具体的にはCPBのアンダーフローを抑制するための技術である。
 図1に,CPBアンダーフローの概念図を示す。固定ビットレートの場合,矢印A1に示すように、そのビットレートでCPBに符号化ストリームが入力される。各時刻におけるCPB内の符号化ストリームのデータ量を「残符号量」と呼ぶ。仮想デコーダは,各ピクチャに対応した符号化ストリームをCPBから引き抜く。その際には,瞬時に当該ピクチャに対応した符号量分だけCPB残符号量が減少する。固定ビットレートの場合の例を示したが,可変ビットレートの場合も同様である。
 CPBアンダーフローとは,図1に示すように,矢印A2で示す各時刻において仮想デコーダがピクチャの符号化ストリームを引き抜こうとしたときに,CPB内に当該ピクチャの符号化ストリームが不足している状況をいう。H.264に基づく符号化では,符号化を行いながらCPBの状態を検証し,CPBアンダーフローを生じさせないストリームを作成する必要がある。前述のように,仮想デコーダのCPBは,H.264において規格化されており,さらなる詳細は,例えば下記の非特許文献1に記載されている。
 なお,他の符号化標準においてもCPBと同じ概念が規定されており,例えばMPEG-2では,VBV(Video Buffering Verifier)があり,このようなデコーダのバッファモデルを,ここでは「仮想バッファ」と総称する。以下の説明における「CPB」は「仮想バッファ」という言葉で読み替えて,広義に解釈することができる。
 映像信号の符号化方法には,1パス符号化とマルチパス符号化という技術がある。1パス符号化では,一般的に入力映像のピクチャを逐次的に符号化していく。一方でマルチパス符号化では,入力映像を複数回符号化する。2パス符号化では,1回符号化した結果を利用して,2回目の符号化を行う。以下,1パス符号化の従来技術を「従来技術a」,2パス符号化の従来技術を「従来技術b」として説明する。
 <従来技術a>
 1パス符号化では,入力されるピクチャを逐次的に符号化するため,符号化対象ピクチャより未来のピクチャの性質が分からない。従い,1パス符号化でCPBアンダーフローを抑制しようとした場合,必要以上に発生符号量を抑えてしまい,必要以上に大きく画質を劣化させてしまうことがある。例えば,特許文献1の技術では,各ピクチャの符号化前に,過去に符号化した結果から得られた映像の複雑度を,GOPの残りの映像の複雑度の推定値とする。その複雑度の推定値を前提として,GOPの残りの映像の符号化に利用できる最大の符号量を発生させる量子化パラメータを推定し,これを符号化対象ピクチャの符号化の量子化パラメータの下限値として利用する。推定された複雑度と比較して,GOPの残りの映像が複雑でない場合には,必要以上に符号量を抑えてしまい画質劣化を招く問題があることが分かる。
 <従来技術b>
 2パス符号化では,入力映像の全ピクチャを符号化し,その際に発生した各ピクチャの符号量を2回目の符号化で利用する。この方法では,1パス符号化の場合と異なり,2回目の符号化時に映像の各部分の複雑さが分かることから,画質の劣化を抑えつつCPBアンダーフローを抑制できることを期待できる。例えば特許文献2の技術では,1回目の符号化で各フレームの複雑度を求め,各フレームの割り当て符号量を求める。そして,この割り当て符号量でCPBアンダーフローが生じるか否かを検証し,CPBアンダーフローが生じる場合には割り当て符号量を修正する。すなわち,各フレームの複雑度が分かっているため,CPBアンダーフローが生じる場合にのみ割り当て符号量を修正することが可能となり,結果として従来技術aと比較して画質劣化を抑えつつCPBアンダーフローを抑制できる。しかしながら,この方法では,入力映像の全フレームを2回符号化する必要があるため,演算量が多くなるという問題がある。
特開2006-295535号公報 特開2003-018603号公報
角野,菊池,鈴木,"改訂三版H.264/AVC教科書",インプレスR&D発行,2009, pp.189-191.
 前述した従来技術aでは,既に符号化済みの情報のみを利用して符号化制御を行うため,必要以上に発生符号量を抑えて大きな画質劣化が生じることがある。これに対し,従来技術bによれば,画質劣化を抑えつつCPBアンダーフローを抑制することができる。しかしながら,この方法では,入力映像の全フレームを2回符号化する必要があるため,演算量が多くなるという問題がある。
 本発明は,上記課題の解決を図り,従来の2パス符号化(従来技術b)よりも少ない演算量で,CPBアンダーフローを抑制しつつ,安定した画質を実現することを目的とする。
 本発明を説明するにあたり,「符号化順ピクチャ群」を定義する。符号化順ピクチャ群は,画面内予測符号化ピクチャ(Iピクチャ)を先頭とする所定数のピクチャで構成され,符号化順で連続するピクチャの集まりである。典型的な符号化順ピクチャ群の例はGOP(Group Of Pictures) である。
 符号化順ピクチャ群の概念図を図2A~図2Dに示す。図2A~図2Dにおいて,Iは画面内予測符号化の対象となるピクチャ(Iピクチャ),Pは順方向予測符号化の対象となるピクチャ(Pピクチャ),Bは双方向予測符号化の対象となるピクチャ(Bピクチャ)を表している。
 ピクチャの表示順が,例えば図2Aに示すように,I→B→P→B→P→B……の順であったとする。本発明でいう符号化順ピクチャ群をGOPとした場合,符号化順ピクチャ群は,図2Bに示すように,I→P→B→P→…→B→P(Iの直前)のピクチャ群となる。
 例えば,符号化順ピクチャ群を13ピクチャ構成とした場合には,図2Cに示すような符号化順で連続した13ピクチャが本発明でいう符号化順ピクチャ群となる。さらに、図2Dは,符号化順ピクチャ群を2GOP分の20ピクチャ構成とした場合の例を示している。
 以上のように,入力映像のピクチャ列を,符号化順で連続し,所定の枚数で構成されるピクチャ群に分割したピクチャの集まりを符号化順ピクチャ群という。なお,ここで「ピクチャ」とは,映像がプログレッシブ形式の場合にはフレームであり,インターレース形式の場合には,1つのフィールドもしくはトップフィールドとボトムフィールドとを1つにしたフレームである。
 本発明の第1の実施形態では,符号化順ピクチャ群を単位として,入力映像の符号化を進める。ただし,入力ピクチャを符号化するごとに,CPBが破綻しないかを所定のバッファ検定アルゴリズムによってチェックし,CPBアンダーフローが生じた場合にのみ,符号化パラメータを発生符号量が少なくなるように変更して,符号化中の符号化順ピクチャ群を再符号化する。符号化結果の出力バッファからの出力契機は,符号化順ピクチャ群の符号化が完了したときとする。
 変更する符号化パラメータとしては,例えば量子化パラメータやプレフィルタ強度があり,これらの1つ以上を変更する。例えば,量子化パラメータの場合には,量子化パラメータのステップサイズをより大きくして,符号化パラメータを発生符号量が少なくなるようにする。また,入力映像に対するプレフィルタのフィルタ強度を変更する場合,ぼかし度合いをより大きく変更することにより,発生符号量を少なくすることができる。
 符号化順ピクチャ群の再符号化が完了した場合,符号化パラメータを通常の符号化時の符号化パラメータ値に戻すことにより,画質の劣化が次の符号化順ピクチャ群にまで波及するのを抑止する。ここで,通常の符号化時の符号化パラメータとは,再符号化ではない状態のときに定められる符号化パラメータという意味である。
 または,符号化順ピクチャ群の再符号化が完了した場合に,必ず符号化パラメータを通常の符号化時の値に戻すのではなく,CPBの残符号量を調べ,残符号量が所定の閾値以上のときにだけ符号化パラメータを通常の符号化時の値に戻し,残符号量が少ないときには,符号化パラメータを通常の符号化時の値に戻さないようにしてもよい。こうすれば,再符号化が連続して生じる可能性を小さくすることができる。
 さらに本発明の第2の実施形態では,符号化順ピクチャ群の再符号化の際にも,各ピクチャの符号化ごとにCPBアンダーフローが生じたかどうかをチェックし,CPBアンダーフローが生じた場合には,現在符号化中の符号化順ピクチャ群の先頭のピクチャから符号化パラメータを変更して再符号化する。すなわち,CPBアンダーフローが生じる限り,同じ符号化順ピクチャ群について複数回符号化を繰り返す。
 このとき,1つの符号化順ピクチャ群の再符号化回数をリトライカウントというパラメータで管理し,再符号化が生じたらリトライカウントの値を増やし,符号化順ピクチャ群の符号化が完了したときにリトライカウントの値を減らす。前述した符号化パラメータの値は,リトライカウントの大きさに応じて設定し,リトライカウントが大きいほど発生符号量が少なくなる値を用いる。符号化パラメータが量子化パラメータの場合には,リトライカウントが大きいほどステップサイズを大きくし,符号化パラメータがプレフィルタのフィルタ強度の場合には,リトライカウントが大きいほどぼかし度合いを大きくする。
 一般に符号化対象となる映像には,複雑な部分と単純な部分がある。もし,CPBアンダーフローにより再符号化対象となった符号化順ピクチャ群が複雑であっても単純であっても再符号化を1回しか行わないとすると,1回の再符号化でCPBアンダーフローを抑制する必要があるため,符号化パラメータの変化量を大きめにして再符号化の符号化パラメータを設定する必要がある。そうすると,符号化パラメータの変化量が小さくてもCPBアンダーフローを回避できるような映像の複雑な部分で再符号化が生じた場合に,必要以上に大きな画質劣化が生じことになる。すなわち,映像の複雑な部分(高周波数成分を多く含む場合や時間方向の相関が小さい場合)などは,情報の絶対量が多いので,少し符号化パラメータを変更しただけで符号量が多く減ることになり,換言すれば,符号化パラ
メータの変化量が大き過ぎると無駄に画質を劣化させることになる。
 そこで,前述のようにCPBアンダーフローが生じる限り,符号化順ピクチャ群を繰り返し符号化することとし,リトライカウントを管理して,リトライカウントの大きさに応じて符号化パラメータを設定することにより,CPBアンダーフローが生じた場合に,符号化パラメータの変化量を小さく抑えて,適切な符号化パラメータで符号化することにより,画質劣化をより小さくすることができる。
 本発明の第3の実施形態においては、符号化順ピクチャ群の符号化が完了したときにリトライカウントの値を無条件に減らすのではなく,符号化順ピクチャ群の符号化が完了した時点で,CPB残符号量が所定の閾値以上の場合にだけ,リトライカウントを減らす。
 前述した符号化パラメータの値は,リトライカウントの大きさに応じて設定し,リトライカウントが大きいほど発生符号量が少なくなる値を用いる。符号化パラメータが量子化パラメータの場合には,リトライカウントが大きいほどステップサイズを大きくし,符号化パラメータがプレフィルタのフィルタ強度の場合には,リトライカウントが大きいほどぼかし度合いを大きくする。
 一般に符号化対象となる映像には,複雑な部分と単純な部分がある。もし,CPBアンダーフローにより再符号化対象となった符号化順ピクチャ群が複雑であっても単純であっても再符号化を1回しか行わないとすると,1回の再符号化でCPBアンダーフローを抑制する必要があるため,符号化パラメータの変化量を大きめにして再符号化の符号化パラメータを設定する必要がある。そうすると,符号化パラメータの変化量が小さくてもCPBアンダーフローを回避できるような映像の複雑な部分で再符号化が生じた場合に,必要以上に大きな画質劣化が生じことになる。すなわち,映像の複雑な部分(高周波数成分を多く含む場合や時間方向の相関が小さい場合)などは,情報の絶対量が多いので,少し符号化パラメータを変更しただけで符号量が多く減ることになり,換言すれば,符号化パラ
メータの変化量が大き過ぎると無駄に画質を劣化させることになる。
 そこで,前述のようにCPBアンダーフローが生じる限り,符号化順ピクチャ群を繰り返し符号化することとし,リトライカウントを管理して,リトライカウントの大きさに応じて符号化パラメータを設定することにより,符号化パラメータの変化量を小さく抑えて,適切な符号化パラメータで符号化することにより,画質劣化をより小さくすることができる。
 また,再符号化時にリトライカウントを増やして符号化した後,符号化順ピクチャ群の符号化が完了した時点で,基本的にはリトライカウントを減らすことにより,次の符号化順ピクチャ群への画質劣化の影響を少なくするが,CPB残符号量が所定量未満であれば,リトライカウントを減らさないようにすることにより,次の符号化順ピクチャ群の符号化においても再符号化が生じる可能性を小さくする。
 本発明の第4の実施形態において,符号化順ピクチャ群は必ずしもGOPでなくてもよいが,符号化順ピクチャ群の先頭ピクチャは,画面内予測符号化ピクチャ(Iピクチャ)とする。この実施形態では、符号化順ピクチャ群を単位として,入力映像の符号化を進める。ただし,入力ピクチャを符号化するごとに,CPBが破綻しないかを所定のバッファ検定アルゴリズムによってチェックし,CPBアンダーフローが生じた場合には,符号化パラメータを発生符号量が少なくなるように変更して,リトライポイント(後述)として設定された符号化順ピクチャ群の位置から再符号化する。符号化結果の出力バッファからの出力契機は,符号化順ピクチャ群の符号化が完了し,再符号化しないことが確定したときとする。
 変更する符号化パラメータとしては,例えば量子化パラメータやプレフィルタ強度があり,これらの1つ以上を変更する。例えば,量子化パラメータの場合には,量子化パラメータのステップサイズをより大きくして,符号化パラメータを発生符号量が少なくなるようにする。また,入力映像に対するプレフィルタのフィルタ強度を変更する場合,ぼかし度合いをより大きく変更することにより,発生符号量を少なくすることができる。
 符号化順ピクチャ群の再符号化が完了した場合,符号化パラメータを通常の符号化時の符号化パラメータ値に戻すことにより,画質の劣化が次の符号化順ピクチャ群にまで波及するのを抑止する。ここで,通常の符号化時の符号化パラメータとは,再符号化ではない状態のときに定められる符号化パラメータという意味である。
 または,符号化順ピクチャ群の再符号化が完了した場合に,必ず符号化パラメータを通常の符号化時の値に戻すのではなく,CPBの残符号量を調べ,残符号量が所定の閾値以上のときにだけ符号化パラメータを通常の符号化時の値に戻し,残符号量が少ないときには,符号化パラメータを通常の符号化時の値に戻さないようにしてもよい。こうすれば,再符号化が連続して生じる可能性を小さくすることができる。
 前述したリトライポイントとは,あるピクチャでCPBアンダーフローの発生により再符号化する必要が生じた場合に,どのピクチャから再符号化を開始するのかを示す位置情報である。
 リトライポイントは,基本的には現在符号化している符号化順ピクチャ群の先頭ピクチャであるが,1つ前に符号化した符号化順ピクチャ群の先頭ピクチャの場合もある。リトライポイントを更新する契機は,以下のとおりである。
(1)符号化順ピクチャ群の符号化が完了した時点で,CPB残符号量が所定の閾値以上あった場合,リトライポイントを次の符号化順ピクチャ群の先頭ピクチャ(Iピクチャ)に設定する。
(2)符号化順ピクチャ群の符号化が完了した時点で,CPB残符号量が所定の閾値より小さかった場合,リトライポイントはそのままで次の符号化順ピクチャ群の先頭ピクチャの符号化に進む。その符号化順ピクチャ群の先頭ピクチャの符号化でCPBアンダーフローが発生しなかった場合,リトライポイントを現在符号化した符号化順ピクチャ群の先頭ピクチャに設定する。
 以上のようにリトライポイントを設定する理由について説明する。リトライポイントを常に現在符号化している符号化順ピクチャ群の先頭に設定すれば,処理構成が本発明より簡明になる。以下,この技術を「関連技術」という。関連技術の場合にも,CPBアンダーフローが生じた場合に限り,それが生じた符号化順ピクチャ群だけを再符号化することで,CPBアンダーフローを抑制することができ,入力映像の全てのピクチャを2回符号化する従来技術bよりも演算量が少なくなって,効果的な符号量配分の制御を実現できる。本発明は,この関連技術よりもさらに効果的にCPBアンダーフローの抑制による復号画像の画質劣化を軽減する符号量配分の制御を実現することを狙いとしている。
 周知のようにIピクチャは他のピクチャタイプと比較して発生符号量が多い。したがって,ある符号化順ピクチャ群の符号化が完了した時点でのCPB残符号量が少ない場合,次の符号化順ピクチャ群の先頭のIピクチャでCPBアンダーフローが発生する可能性が高い。このような場合,上記関連技術では,CPBアンダーフローが生じた先頭のIピクチャのみを再符号化することで,CPBアンダーフローを回避する必要があるため,当該Iピクチャの画質が大きく劣化するおそれがある。
 そこで,本実施形態では,CPB残符号量が少ない場合,次の符号化順ピクチャ群の先頭のIピクチャでCPBアンダーフローが生じたときには,設定されたリトライポイントにより,その1つ前の符号化順ピクチャ群に戻って,その先頭から再符号化する。したがって,1つのピクチャに大きな画質劣化が生じることを回避することできる。
 本発明の第5の実施形態においては,CPBアンダーフローを抑制するために,従来の2パス符号化のように入力映像のフレームを常に2回符号化するのではなく,原則は1パスの符号化とし,CPBアンダーフローが生じた場合に限り,複数ピクチャだけ遡って再符号化することを基本とする。
 また,本実施形態では,符号化順ピクチャ群のピクチャの符号化においてCPBアンダーフローが生じたときに,符号化順ピクチャ群内のあるピクチャまで遡って再符号化を行う。どのピクチャまで遡って再符号化を行うかは,利用可能なメモリ量によって予め決定される。ここで,再符号化時に遡れる最大のピクチャ数を「最大ピクチャ間距離」と定義して説明する。
 本実施形態の処理概要は,以下のとおりである。最初に,外部から与えられた利用可能なメモリ量の情報に基づき,再符号化時に遡れる最大のピクチャ数を求めて,最大ピクチャ間距離とし,この値を記憶する。
 これは以下の理由による。再符号化のためには,入力バッファに符号化対象のピクチャの映像信号を保存しておく必要があり,また,出力バッファには,再符号化しないことが確定して出力バッファからの符号化結果の出力が終わるまで,符号化結果の符号化ストリームを保持しておく必要がある。もし,使用可能なメモリ量が十分に存在する場合には,入力バッファと出力バッファのそれぞれに符号化順ピクチャ群のピクチャ数分のメモリ容量を持たせておくことにより,CPBアンダーフロー発生時の再符号化を,符号化順ピクチャ群を単位として,符号化順ピクチャ群の先頭から行うことができる。
 しかし,必ずしもメモリが必要なだけ使えるとは限らないので,事前に使用可能なメモリ量から,再符号化時に遡れる最大のピクチャ数である最大ピクチャ間距離を算出しておく。
 本実施形態では,符号化順ピクチャ群を単位として,入力映像の符号化を進める。ただし,入力ピクチャを符号化するごとに,CPBが破綻しないかを所定のバッファ検定アルゴリズムによってチェックし,CPBアンダーフローが生じた場合にのみ,符号化パラメータを発生符号量が少なくなるように変更して,符号化中の符号化順ピクチャ群を再符号化する。ただし,符号化中の符号化順ピクチャ群のどのピクチャまで遡って再符号化するかについては,次の3条件を満たすピクチャとする。
・条件1:符号化中の符号化順ピクチャ群に含まれること。
・条件2:CPBアンダーフローが生じたピクチャを基準として,最大ピクチャ間距離に含まれること。
・条件3:条件1,2を満たすピクチャの中で,CPBアンダーフローが生じたピクチャから最も遠いピクチャであること。
 この再符号化を開始するピクチャをリトライポイントという。リトライポイントは,例えば最大ピクチャ間距離にある先頭のピクチャが1つ前の符号化順ピクチャ群内であれば,現在符号化中の符号化順ピクチャ群の先頭ピクチャであり,そうでなければ最大ピクチャ間距離にある先頭のピクチャ,すなわち最大ピクチャ間距離だけ離れた時間的に最も古く符号化されたピクチャとなる。
 再符号化時に変更する符号化パラメータとしては,例えば量子化パラメータやプレフィルタ強度があり,これらの1つ以上を変更する。例えば,量子化パラメータの場合には,量子化パラメータのステップサイズをより大きくして,符号化パラメータを発生符号量が少なくなるようにする。また,入力映像に対するプレフィルタのフィルタ強度を変更する場合,ぼかし度合いをより大きく変更することにより,発生符号量を少なくすることができる。
 再符号化により,現在符号化中の符号化順ピクチャ群の符号化が完了した場合,符号化パラメータを通常の符号化時の符号化パラメータ値に戻すことにより,画質の劣化が次の符号化順ピクチャ群にまで波及するのを抑止する。ここで,通常の符号化時の符号化パラメータとは,再符号化ではない状態のときに定められる符号化パラメータという意味である。
 または,符号化順ピクチャ群の再符号化が完了した場合に,必ず符号化パラメータを通常の符号化時の値に戻すのではなく,CPBの残符号量を調べ,残符号量が所定の閾値以上のときにだけ符号化パラメータを通常の符号化時の値に戻し,残符号量が少ないときには,符号化パラメータを通常の符号化時の値に戻さないようにしてもよい。こうすれば,再符号化が連続して生じる可能性を小さくすることができる。
 本発明の第1の実施形態は,入力映像の全フレームを2回符号化する従来の2パス符号化(従来技術b)と異なり,CPBアンダーフローが生じた場合に限り符号化順ピクチャ群を2回符号化する。再符号化時にはCPBアンダーフローを抑制する符号化パラメータで符号化を行う。このため,必要な場合だけ従来技術bと同様にCPBアンダーフローを抑制しつつも,従来技術bよりも演算量を削減することができる。
 本発明の第2および第3の実施形態は,入力映像の全フレームを2回符号化する従来の2パス符号化(従来技術b)と異なり,CPBアンダーフローが生じた場合に限り符号化順ピクチャ群を複数回符号化する。第1の実施形態と同様に,再符号化時にはCPBアンダーフローを抑制する符号化パラメータで符号化を行う。このため,必要な場合だけ従来技術bと同様にCPBアンダーフローを抑制しつつも,従来技術bよりも演算量を削減することができる。
 本発明の第2および第3の実施形態においては,リトライカウントを管理することにより,再符号化時における符号化パラメータの変化量を小さく抑えて,CPBアンダーフローを抑制することができるので,再符号化による画質の劣化を小さくすることができる。
 特に,本発明の第3の実施形態によれば,再符号化後のCPB残符号量が少ない場合には,符号化パラメータを再符号化時と同じに保つので,再度の再符号化の発生を抑制することができる。
 本発明の第4の実施形態は,入力映像の全フレームを2回符号化する従来の2パス符号化(従来技術b)と異なり,CPBアンダーフローが生じた場合に限り符号化順ピクチャ群を2回符号化する。再符号化時にはCPBアンダーフローを抑制する符号化パラメータで符号化を行う。このため,必要な場合だけ従来技術bと同様にCPBアンダーフローを抑制しつつも,従来技術bよりも演算量を削減することができる。
 特に本発明の第4の実施形態によれば,符号化順ピクチャ群において発生符号量が多い先頭のIピクチャのCPBアンダーフローの発生を効果的に抑制することができるので,Iピクチャの画質が大きく劣化するのを防ぐことができる。
 本発明の第5の実施形態によれば,入力映像の全フレームを2回符号化する従来の2パス符号化(従来技術b)と異なり,CPBアンダーフローが生じた場合に限り符号化順ピクチャ群内のリトライポイントとして定められたピクチャから再符号化する。再符号化時にはCPBアンダーフローを抑制する符号化パラメータで符号化を行う。このため,必要な場合だけ従来技術bと同様にCPBアンダーフローを抑制しつつも,従来技術bよりも演算量を削減することができる。また,再符号化に必要なメモリ量に応じて定められたリトライポイントから再符号化が行われるため,メモリの有効活用が可能になる。
CPBアンダーフローを説明するためのグラフである。 ピクチャを表示順に示す概念図である GOPとした場合の符号化順ピクチャ群を示す概念図である。 13ピクチャ構成とした場合の符号化順ピクチャ群を示す概念図である。 2GOP分の20ピクチャ構成とした場合の符号化順ピクチャ群を示す概念図である。 本発明の第1の実施例に係る動画像符号化制御方法を示すフローチャートである。 本発明の第1の実施例に係る動画像符号化制御方法の変形例を示すフローチャートである。 GOPの概念図である。 本発明の第1の実施例に係る動画像符号化装置を示すブロック図である。 本発明の実施例によって再符号化が行われた際の符号化パラメータの変更を示す概念図である。 本発明の実施例によって再符号化が行われた際のCPB残符号量の遷移を示すグラフである。 本発明の第2の実施例に係る動画像符号化制御方法を示すフローチャートである。 本発明の第2の実施例に係る動画像符号化装置を示すブロック図である。 本発明の実施例によって行われるリトライカウント,符号化パラメータの推移を示す概念図である。 本発明の第3の実施例に係る動画像符号化制御方法を示すフローチャートである。 本発明の第3の実施例に係る動画像符号化装置を示すブロック図である。 本発明の第4の実施例に係る動画像符号化制御方法を示すフローチャートである。 本発明の第4の実施例に係る動画像符号化制御方法の変形例を示すフローチャートである。 本発明の第4の実施例に係る動画像符号化装置を示すブロック図である。 本発明の第5の実施例に係る動画像符号化制御方法を示すフローチャートである。 本発明の第5の実施例に係る動画像符号化制御方法の変形例を示すフローチャートである。 本発明の第5の実施例に係る動画像符号化装置を示すブロック図である。 本発明の第5の実施例における参照画像用の必要メモリ量を説明する概念図である。 本発明の第5の実施例においてリトライポイントを最大ピクチャ間距離で制限することによる入力バッファと出力バッファとのメモリ削減を説明する図である。
 以下,本発明の実施形態を,図面を用いて詳細に説明する。
<第1の実施例>
 図3は,本発明の第1の実施例に係る動画像符号化制御方法を示す処理フローチャートである。
 まず,入力映像信号における符号化が終了したピクチャの次のピクチャを符号化対象として設定する(ステップS101)。符号化対象として設定した入力ピクチャを,H.264その他の所定の符号化方式により符号化する(ステップS102)。入力ピクチャの符号化により,CPBアンダーフローが生じたかどうかを判定し(ステップS103),CPBアンダーフローが生じた場合には,ステップS107へ進む。なお,CPBアンダーフローが生じたかどうかは,例えばH.264の標準規格などで用いられている方法で判定することができる。
 CPBアンダーフローが生じていなければ,最終ピクチャの符号化が完了したかどうかを判定し(ステップS104),最終ピクチャまで符号化が完了したならば符号化処理を終了する。
 そうでなければ,符号化順ピクチャ群の符号化が完了したかどうかを判定する(ステップS105)。完了していなければ,ステップS101へ戻り,次のピクチャについて同様に符号化処理を続ける。符号化順ピクチャ群の符号化が完了した場合,符号化パラメータが符号化順ピクチャ群の再符号化(リトライ)で変更されていれば,符号化パラメータを通常の符号化時の値に戻し(ステップS106),ステップS101へ戻って,次の符号化順ピクチャ群の先頭のピクチャから符号化処理を行う。
 ステップS103においてCPBアンダーフローが生じたことが検出された場合,現在の符号化順ピクチャ群は再符号化が行われたかどうか(リトライ済みかどうか)を判定する(ステップS107)。リトライ済みの場合,符号化順ピクチャ群を再符号化してもCPBアンダーフローが回避できないので,符号化を終了する。リトライ済みでない場合,現在の符号化順ピクチャ群の再符号化のため,現在の符号化順ピクチャ群の先頭のピクチャを符号化対象として設定する(ステップS108)。そして,2つの符号化パラメータ(量子化パラメータ,プレフィルタ強度)のうち1つ以上を変更し(量子化パラメータはステップサイズをより大きく,フィルタ強度の場合はぼかし度合いをより大きく変更)(ステップS109),ステップS102へ戻って,符号化中の符号化順ピクチャ群を再符号化する。
 すなわち,入力映像の全フレームを2回符号化する従来技術bと異なり,CPBアンダーフローが生じた場合に限り,符号化順ピクチャ群(例えばGOP)を2回符号化する。2回目の符号化時には,CPBアンダーフローを抑制する符号化パラメータで符号化を行う。CPBアンダーフローが生じた場合に限り,それが生じた符号化順ピクチャ群のみを再符号化することでCPBアンダーフローを抑制する。したがって,入力映像の全てのピクチャを2度符号化する従来技術bと比較して演算量を削減できる。
 図4は,本発明の第1の実施例に係る動画像符号化制御方法の変形例を示す処理フローチャートである。本変形例は,図3に示すステップS106の処理を,図4に示すステップS161~S163の処理に置き換えて実施することもできる。ステップS106以外の処理は,図3と同様である。
 図3のステップS105の処理の後,符号化パラメータがリトライで変更されているかどうかを判定する(ステップS161)。リトライで変更されていなければ,図3のステップS101へ戻る。リトライで変更されていれば,次にCPB残符号量が所定の閾値以上かどうかを判定する(ステップS162)。所定の閾値未満であれば,符号化パラメータを再符号化で用いた状態のままとし,所定の閾値以上の場合にだけ符号化パラメータを元のデフォルト符号化パラメータに戻す(ステップS163)。その後に,図3のステップS101へ戻り,次の符号化順ピクチャ群の符号化に移る。
 図4に示す変形例では,以上のように符号化順ピクチャ群の符号化が完了した時点でCPB残符号量が所定量を超えている場合にだけ,符号化パラメータを通常の符号化時の値に戻す。これは次の理由による。符号化順ピクチャ群の符号化が完了したとしても,CPB残符号量が少ない場合,符号化パラメータを通常の符号化時の値に戻すと発生符号量がより多くなるため,次の符号化順ピクチャ群の符号化でCPBアンダーフローが生じる可能性が高まる。図4の処理では,CPB残符号量が少ない場合には,符号化パラメータを変更しないため,図3の処理に比べて,次の符号化順ピクチャ群の符号化における再符号化の発生が抑制され,演算量がさらに削減されることになる。
 以上のように本実施形態では,再符号化時に符号化パラメータを変更する。ここでは,符号化時に入力映像に対してプレフィルタを適用するものとし,変更する符号化パラメータとしては,量子化パラメータとプレフィルタ強度とする。この2つの符号化パラメータの双方を変更してもよいし,いずれか一方だけを変更してもよい。
 量子化パラメータについては,通常の符号化時の量子化パラメータ値に対して,所定のオフセット値を足し,より大きい量子化パラメータで再符号化する。
 プレフィルタについては,本実施例では,ガウシアンフィルタを利用するものとする。ガウシアンフィルタは,次式(1)で示されるガウス分布をx,yについてサンプリングすることによって作成できる。
      g(x, y)={1/(2πσ2 )}×exp{-(x2+y2 )/(2σ2 )} ・・・(1) 
 上記の式(1)から分かるように,σの値が大きいほど,ぼかし度合いが大きくなる。ぼかし度合いが大きいほど,高周波数成分が減るため,符号化時の発生符号量が減ることになる。ガウシアンフィルタの詳細は,例えば以下の参考文献1に記載されている。
〔参考文献1〕:奥富,小沢,清水,堀,“デジタル画像処理”,財団法人画像情報教育振興協会,2006,pp.108-110.
 σ=0の場合には,ガウシアンフィルタをかけないものとし,例えばデフォルト符号化パラメータはσ0 =0,再符号化用符号化パラメータはσ1 >0とする。なお,本発明ではローパスフィルタの種類は問わない。また,再符号化時のぼかし度合いの強め方も予め任意に定めてよい。例えば,デフォルト符号化パラメータのσ0 は,ピクチャごとの複雑度に応じて変更し,σ1 はσ0 に所定のオフセットを足したものであるような構成でもよい。
 符号化は,H.264の規格に従った符号化を行うものとする。また,本実施例では,符号化順ピクチャ群はGOPとし,符号化する際のGOPの概念図を図5に示す。1つのGOPは10ピクチャで構成され,表示順で,Iピクチャを先頭にBピクチャとPピクチャとが交互に並ぶものとする。
 本発明の第1の実施例に係る装置構成を,図6に示す。入力バッファ110は,入力される映像信号を蓄積するとともに,符号化部120に符号化対象の映像信号を出力する。さらに,入力バッファ110は,後述のCPB管理部140から,CPBアンダーフローが生じ,再符号化を行うことを示す情報(リトライ情報)を受けた場合,符号化中のGOPの先頭のピクチャから映像信号を再度,符号化部120に出力する。また,リトライ情報を受けずにGOPの符号化が完了した場合,入力バッファ110は,蓄積していた当該GOPの映像信号を破棄する。
 符号化部120は,入力バッファ110から入力された映像信号を符号化し,符号化ストリームを出力バッファ130に出力する。また,入力された映像信号を符号化した際に発生した符号量(符号量情報)をCPB管理部140に出力する。さらに,符号化部120は,CPB管理部140からリトライ情報を受けた場合,符号化中のGOPの先頭ピクチャからの映像信号が入力バッファ110から再度入力されるとともに,パラメータ調整部150から再符号化用符号化パラメータが入力されるため,入力された再符号化用符号化パラメータを利用して再符号化を行う。
 出力バッファ130は,GOPの符号化ストリームが全て蓄積された段階で,当該GOPの符号化ストリームを出力し,一方で,CPB管理部140からリトライ情報を受けた場合,符号化中のGOPについて蓄積した符号化ストリームを破棄する。
 CPB管理部140は,符号化部120から入力される符号量情報を利用して,時刻とともに変化するCPBの残符号量を求める。すなわち,図1の概念図で示したCPBの残符号量を求める。そして,CPBアンダーフローが生じた場合,リトライ情報を入力バッファ110,符号化部120,パラメータ調整部150,出力バッファ130に出力し,CPBアンダーフローが生じたことを通知する。
 パラメータ調整部150は,CPB管理部140からリトライ情報を受けた場合,前述のように再符号化用符号化パラメータを符号化部120に入力する。これにより,符号化部120は,再符号化時には,同じGOPについて,発生符号量が小さくなる符号化パラメータを用いて符号化をすることになる。
 本実施例における符号化処理の流れについて,図3のフローチャートに沿って説明する。以下の説明では,S101,S102,…といったように,文章中に図3のフローチャートとの対応を記載する。
 あるGOPの符号化を行う処理について,以下のように3つのケースに場合分けをして説明する。
・[ケース1]:GOPの符号化においてCPBアンダーフローが発生しなかった。
・[ケース2]:GOPの符号化においてCPBアンダーフローが発生し,再符号化で回避できた。
・[ケース3]:GOPの符号化においてCPBアンダーフローが発生し,再符号化でも回避できなかった。
 [ケース1の処理例]
 まず,GOPの符号化においてCPBアンダーフローが発生しなかった場合のケース1について説明する。GOPのピクチャが入力バッファ110に入力されると,入力バッファ110は当該ピクチャを蓄積するとともに,符号化部120に当該ピクチャを符号化対象ピクチャとして入力する(S101)。そして,符号化部120は当該ピクチャを符号化し,出力バッファ130に符号化ストリームを出力するとともに(出力バッファ130は当該符号化ストリームは出力せず,蓄積する),当該ピクチャに関するCPB管理部140に符号量情報を出力する(S102)。
 ここで,符号化においてはデフォルト符号化パラメータが利用され,デフォルト符号化パラメータに対応したプレフィルタ強度で符号化対象ピクチャに,プレフィルタ部121によるフィルタリング処理が適用され,本ピクチャで発生したDCT係数は,デフォルト符号化パラメータに従った量子化パラメータで,量子化部122により量子化される。
 CPB管理部140は,当該ピクチャについて,符号化部120から入力された符号量情報をもとにCPB残符号量を計算し,この例ではCPBアンダーフローが発生しないため,リトライ情報の出力はしない(S103)。符号化対象ピクチャが入力映像信号中の最終ピクチャであれば,出力バッファ130は蓄積している符号化ストリームを出力し,符号化処理が完了する(S104)。あるいは,符号化対象ピクチャがGOPの最終ピクチャであれば,出力バッファ130は蓄積していた符号化ストリームを出力するとともに,入力バッファ110は蓄積していたピクチャを破棄し,次のGOPの最初のピクチャの符号化処理に移る(S105)。ここで,当該GOPでは再符号化が生じなかったため,符号化パラメータに変更を加えずに,次のGOPの最初のピクチャの符号化処理に移る(S106)。
 [ケース2の処理例]
 次に,GOPの符号化においてCPBアンダーフローが発生し,再符号化で回避できた場合のケース2について説明する。GOPのピクチャが入力バッファ110に入力されると,入力バッファ110は当該ピクチャを蓄積するとともに,符号化部120に当該ピクチャを符号化対象ピクチャとして入力する(S101)。そして,符号化部120は当該ピクチャを符号化し,出力バッファ130に符号化ストリームを出力するとともに(出力バッファ130は当該符号化ストリームは出力せず,蓄積する),当該ピクチャに関するCPB管理部140に符号量情報を出力する(S102)。ここで,符号化においてはデフォルト符号化パラメータが利用される。
 CPB管理部140は,当該ピクチャについて,符号化部120から入力された符号量情報をもとにCPB残符号量を計算する。この結果,当該ピクチャについて,CPB管理部140がCPBアンダーフローを検知した場合,CPB管理部140は,符号化部120,パラメータ調整部150,入力バッファ110,出力バッファ130にリトライ情報を出力する(S103)。
 符号化中のGOPについてまだリトライが発生していない場合(S107),入力バッファ110は,蓄積していた符号化中のGOPの先頭ピクチャを符号化部120に出力するとともに(S108),パラメータ調整部150は,符号化部120に再符号化用符号化パラメータを出力する(S109)。さらに,出力バッファ130は,符号化中のGOPの符号化ストリームを破棄する。そして,符号化部120は,再符号化用符号化パラメータを利用して入力されたGOPの先頭のピクチャを符号化する。
 ここで,符号化においては再符号化用符号化パラメータが利用され,再符号化用符号化パラメータに対応したプレフィルタ強度(デフォルト符号化パラメータよりぼかし度合いが大きい)で符号化対象ピクチャに,プレフィルタ部121によるプレフィルタリング処理が適用され,本ピクチャで発生したDCT係数は,再符号化用符号化パラメータに従った量子化パラメータ(デフォルト符号化パラメータより量子化ステップサイズが大きい)で,量子化部122により量子化される。
 この後,CPBアンダーフローが生じない限り,当該GOPのピクチャが順次入力バッファ110から符号化部120に入力され,符号化部120により符号化処理が行われる。そして,GOPの最終ピクチャが符号化が完了した場合(S105),出力バッファ130から当該GOPの符号化ストリームが出力されるとともに,符号化部120は符号化パラメータをデフォルト符号化パラメータに設定し(S106),次のGOPの符号化処理に進む。なお,入力映像の最終ピクチャの符号化が完了した場合の動作は前述のケース1の場合と同様に動作する。
 再符号化が行われた際の符号化パラメータの変更の概念図を図7に示す。図7の例では,2番目のGOP2の6ピクチャ目の符号化でCPBアンダーフローが発生したので,発生符号量を抑制する再符号化用符号化パラメータを設定して,GOP2の先頭のIピクチャから再符号化している。再符号化によりCPBアンダーフローの発生が抑止されたので,次のGOP3の符号化では,再符号化用符号化パラメータをデフォルト符号化パラメータに戻し,符号化処理を続ける。
 再符号化が行われた際のCPB残符号量の遷移の概念図を図8に示す。太線で示した線が再符号化後のCPB残符号量である。再符号化では,プレフィルタでぼかし度合いを強め,量子化パラメータもデフォルト符号化パラメータよりも大きくするため,発生符号量が抑えられ,例えば図8のような遷移が行われ,CPBアンダーフローが抑制される。
 [ケース3の処理例]
 最後に,GOPの符号化においてCPBアンダーフローが発生し,再符号化でも回避できなかった場合のケース3について説明する。この場合,CPB管理部140によりCPBアンダーフローが検知され,GOPの再符号化を行う動作はケース2と同様である。このGOPの再符号化中にCPBアンダーフローが生じた場合,符号化を完了する(S107)。なお,符号化を完了するのでなく,コマ落としを許容し,符号化を完了しないで,CPBアンダーフローが生じたピクチャの符号化データを破棄し,次のピクチャを符号化するように処理してもよい。
<第2の実施例>
 以下,本発明の第2の実施例について説明する。図9は,本発明の第2の実施例に係る動画像符号化制御方法を示す処理フローチャートである。
 まず,入力映像信号における符号化が終了したピクチャの次のピクチャを符号化対象として設定する(ステップS201)。符号化対象として設定した入力ピクチャを,H.264その他の所定の符号化方式により符号化する(ステップS202)。入力ピクチャの符号化により,CPBアンダーフローが生じたかどうかを判定し(ステップS203),CPBアンダーフローが生じた場合には,ステップS208へ進む。なお,CPBアンダーフローが生じたかどうかは,例えばH.264の標準規格などで用いられている方法で判定することができる。
 CPBアンダーフローが生じていなければ,最終ピクチャの符号化が完了したかどうかを判定し(ステップS204),最終ピクチャまで符号化が完了したならば符号化処理を終了する。
 そうでなければ,符号化順ピクチャ群の符号化が完了したかどうかを判定する(ステップS205)。完了していなければ,ステップS201へ戻り,次のピクチャについて同様に符号化処理を続ける。符号化順ピクチャ群の符号化が完了した場合,リトライカウントが1以上であれば,1だけ減らす(ステップS206)。なお,リトライカウントの初期値は0である。その後,リトライカウントに基づき,あらかじめリトライカウントに応じて定められた符号化パラメータを設定し(ステップS207),ステップS201へ戻って,次の符号化順ピクチャ群の先頭のピクチャから符号化処理を行う。
 ステップS203においてCPBアンダーフローが生じたことが検出された場合,現在のリトライカウントの値が,あらかじめ定められた最大値になっているかどうかを判定する((ステップS208)。リトライカウントが最大値の場合,符号化順ピクチャ群を再符号化してもCPBアンダーフローが回避できないので,符号化を終了する。
 リトライカウントが最大値に到達していない場合,現在の符号化順ピクチャ群の再符号化のため,現在の符号化順ピクチャ群の先頭のピクチャを符号化対象として設定する(ステップS209)。そして,リトライカウントを1だけ増やす(ステップS210)。その後,リトライカウントに基づき,2つの符号化パラメータ(量子化パラメータ,プレフィルタ強度)のうち1つ以上を変更し(量子化パラメータはステップサイズをより大きく,フィルタ強度の場合はぼかし度合いをより大きく変更)(ステップS211),ステップS202へ戻って,符号化中の符号化順ピクチャ群を再符号化する。
 本発明は,入力映像の全フレームを2回符号化する従来技術bと異なり,基本的には1回の符号化処理とし,CPBアンダーフローが生じた場合に限り,符号化順ピクチャ群(例えばGOP)をCPBアンダーフローが生じなくなるまで発生符号量を段階的に抑えて繰り返し符号化する。2回目以降の符号化時には,リトライカウントに応じて定められたCPBアンダーフローを抑制する符号化パラメータで符号化を行う。したがって,入力映像の全てのピクチャを2度符号化する従来技術bと比較して演算量を削減できるとともに,再符号化による画質の劣化も小さくすることができる。
 以上のように本実施形態では,再符号化時に符号化パラメータをリトライカウントに応じて変更する。ここでは,符号化時に入力映像に対してプレフィルタを適用するものとし,変更する符号化パラメータとしては,量子化パラメータとプレフィルタ強度とする。この2つの符号化パラメータの双方を変更してもよいし,いずれか一方だけを変更してもよい。
 量子化パラメータについては,通常の符号化時に定められる量子化パラメータ値に対して,リトライカウントに応じて段階的に大きくなる所定のオフセット値を足し,より大きい量子化パラメータで再符号化する。
 プレフィルタについては,第1の実施例と同様に,ガウシアンフィルタを利用するものとする。ガウシアンフィルタは,前述した式(1)で示されるガウス分布をx,yについてサンプリングすることによって作成できる。
 式(1)において、σ=0の場合には,ガウシアンフィルタをかけないものとし,例えばデフォルト符号化パラメータはσ0 =0,再符号化用符号化パラメータは,リトライカウントの値をcとすると,σc とする。σc は,cの値が大きいほど大きな値とする。0<σ1 <σ2 <……である。なお,本実施例ではローパスフィルタの種類は問わない。また,例えばデフォルト符号化パラメータのσ0 は,ピクチャごとの複雑度に応じて変更し,σc はσc-1 に所定のオフセットを足したものであるような構成でもよい。
 以下で説明する実施例では,符号化方式として,H.264の規格に従った符号化を行うものとする。また,符号化順ピクチャ群はGOPとし,符号化する際のGOPの概念図を図5に示す。第1の実施例と同様に、1つのGOPは10ピクチャで構成され,表示順で,Iピクチャを先頭にBピクチャとPピクチャとが交互に並ぶものとする。
 本発明の第2の実施例の装置構成例を,図10に示す。入力バッファ210は,入力される映像信号を蓄積するとともに,符号化部220に符号化対象の映像信号を出力する。さらに,入力バッファ210は,後述のCPB管理部240から,CPBアンダーフローが生じ,再符号化を行うことを示す情報(リトライ情報)を受けた場合,符号化中のGOPの先頭のピクチャから映像信号を再度,符号化部220に出力する。また,リトライ情報を受けずにGOPの符号化が完了した場合,入力バッファ210は,蓄積していた当該GOPの映像信号を破棄する。
 符号化部220は,入力バッファ210から入力された映像信号を符号化し,符号化ストリームを出力バッファ230に出力する。また,入力された映像信号を符号化した際に発生した符号量(符号量情報)をCPB管理部240に出力する。さらに,符号化部220は,CPB管理部240からリトライ情報を受けた場合,符号化中のGOPの先頭ピクチャからの映像信号が入力バッファ210から再度入力されるとともに,パラメータ調整部260から再符号化用符号化パラメータが入力されるため,入力された再符号化用符号化パラメータを利用して再符号化を行う。
 出力バッファ230は,GOPの符号化ストリームが全て蓄積された段階で,当該GOPの符号化ストリームを出力し,一方で,CPB管理部240からリトライ情報を受けた場合,符号化中のGOPについて蓄積した符号化ストリームを破棄する。
 CPB管理部240は,符号化部220から入力される符号量情報を利用して,時刻とともに変化するCPBの残符号量を求める。すなわち,図1の概念図で示したCPBの残符号量を求める。そして,CPBアンダーフローが生じた場合,リトライ情報を入力バッファ210,符号化部220,リトライカウント管理部250,出力バッファ230に出力し,CPBアンダーフローが生じたことを通知する。
 リトライカウント管理部250は,CPB管理部240からリトライ情報を受けた場合,現在のリトライカウントの値に1を加算し,更新後のリトライカウントをパラメータ調整部260に通知する。また,CPB管理部240からリトライ情報を受けずに,現在符号化中のGOPの符号化が完了した場合,リトライカウントの値が1以上であれば,リトライカウントの値から1を減算し,そのリトライカウントをパラメータ調整部260に通知する。GOPの符号化が完了したときに,リトライカウントの値が0であれば,リトライカウント=0をパラメータ調整部260に通知する。
 パラメータ調整部260は,リトライカウント管理部250からリトライカウントを受けると,リトライカウントに応じて定められた符号化パラメータを符号化部220に入力する。これにより,符号化部220は,同じGOPについて再符号化の繰り返し回数が多くなるほど,発生符号量が小さくなる符号化パラメータを用いて符号化をすることになる。
 以上のように,本実施例では,再符号化が発生すると値が増加し,GOPの符号化が完了した時点で値が減らされるリトライカウントという概念を導入し,リトライカウント管理部250にて管理する。このリトライカウントには,例えば上限値が「3」というように,所定の上限値があり,上限値に達するまで同じGOPの再符号化を行ってよいものとする。符号化時における量子化パラメータのオフセット値,プレフィルタのフィルタ強度はリトライカウントの値に応じて変化する。
 リトライカウントが0のときには,デフォルト符号化パラメータが利用される。リトライカウントが0以外の場合には,例えばリトライカウントの上限値が3の場合,リトライカウントの1,2,3のそれぞれに対応した再符号化用符号化パラメータを,符号化パラメータテーブルとしてあらかじめ用意しておいて,その符号化パラメータテーブルから得た符号化パラメータを再符号化に利用してもよい。
 本実施例における符号化処理の流れについて,図9のフローチャートに沿って説明する。以下の説明では,S201,S202,…といったように,文章中に図9のフローチャートとの対応を記載する。
 あるGOPの符号化を行う処理について,以下のように3つのケースに場合分けをして説明する。
・[ケース1]:GOPの符号化においてCPBアンダーフローが発生しなかった。
・[ケース2]:GOPの符号化において複数回CPBアンダーフローが発生し,再符号化で回避できた。
・[ケース3]:GOPの符号化において複数回CPBアンダーフローが発生し,リトライカウントが上限値に達して再符号化でも回避できなかった。
 [ケース1の処理例]
 まず,GOPの符号化においてCPBアンダーフローが発生しなかった場合のケース1について説明する。GOPのピクチャが入力バッファ210に入力されると,入力バッファ210は当該ピクチャを蓄積するとともに,符号化部220に当該ピクチャを符号化対象ピクチャとして入力する(S201)。そして,符号化部220は当該ピクチャを符号化し,出力バッファ230に符号化ストリームを出力するとともに(出力バッファ230は当該符号化ストリームは出力せず,蓄積する),当該ピクチャに関するCPB管理部240に符号量情報を出力する(S202)。
 ここで,例えばリトライカウントが初期値の0であるとすると,符号化においてはデフォルト符号化パラメータが利用され,デフォルト符号化パラメータに対応したプレフィルタ強度で符号化対象ピクチャに,プレフィルタ部221によるフィルタリング処理が適用され,本ピクチャで発生したDCT係数は,デフォルト符号化パラメータに従った量子化パラメータで,量子化部222により量子化される。リトライカウントが1以上の場合には,それぞれリトライカウントに応じて定められたフィルタ強度および量子化パラメータによるプレフィルタ,量子化処理で符号化が行われる。
 CPB管理部240は,当該ピクチャについて,符号化部220から入力された符号量情報をもとにCPB残符号量を計算し,この例ではCPBアンダーフローが発生しないため,リトライ情報の出力はしない(S203)。符号化対象ピクチャが入力映像信号中の最終ピクチャであれば,出力バッファ230は蓄積している符号化ストリームを出力し,符号化処理が完了する(S204)。あるいは,符号化対象ピクチャがGOPの最終ピクチャであれば,出力バッファ230は蓄積していた符号化ストリームを出力するとともに,入力バッファ210は蓄積していたピクチャを破棄し,次のGOPの最初のピクチャの符号化処理に移る(S205~S207)。
 このケース1のように,CPBアンダーフローを発生させずにGOPの符号化が完了した場合,リトライカウントが0のときを除き,リトライカウント管理部250が現在のリトライカウントから値を1減らす(S206)。現在符号化が完了したGOPより前のGOPで再符号化が生じている場合に,リトライカウントが0でないことがある。リトライカウント管理部250は変更後のリトライカウントをパラメータ調整部260に通知し,パラメータ調整部260は,通知されたリトライカウントに対応した符号化パラメータを符号化部220に設定し,次のGOPの先頭ピクチャの符号化が開始される。
 [ケース2の処理例]
 次に,GOPの符号化において複数回CPBアンダーフローが発生し,再符号化で回避できた場合のケース2について説明する。ここでは,GOPの符号化を開始する時点でのリトライカウントが1であるとし,同じGOPで2回再符号化が行われた場合を説明する。
 GOPのピクチャが入力バッファ210に入力されると,入力バッファ210は当該ピクチャを蓄積するとともに,符号化部220に当該ピクチャを符号化対象ピクチャとして入力する(S201)。そして,符号化部220は当該ピクチャを符号化し,出力バッファ230に符号化ストリームを出力するとともに(出力バッファ230は当該符号化ストリームは出力せず,蓄積する),当該ピクチャに関するCPB管理部240に符号量情報を出力する(S202)。ここで,符号化においては,リトライカウント1に対応した符号化パラメータが利用される。
 CPB管理部240は,当該ピクチャについて,符号化部220から入力された符号量情報をもとにCPB残符号量を計算する。この結果,当該ピクチャについて,CPB管理部240がCPBアンダーフローを検知した場合,CPB管理部240は,符号化部220,リトライカウント管理部250,入力バッファ210,出力バッファ230にリトライ情報を出力する(S203)。
 現在のリトライカウントは1であり,上限値の3には達していないので(S208),入力バッファ210は,蓄積していた符号化中のGOPの先頭ピクチャを符号化部220に出力する(S209)。一方で,リトライカウント管理部250でリトライカウントが1増加され,値が2となったリトライカウントがパラメータ調整部260に出力される(S210)。
 パラメータ調整部260では,リトライカウントが2のときの符号化パラメータを符号化パラメータテーブルから読み出し,その符号化パラメータを符号化部220に設定する(S211)。出力バッファ230は,符号化中のGOPの符号化ストリームを破棄する。
 符号化部220では,CPBアンダーフローが生じない限り,順次,GOPのピクチャが入力バッファ210から入力されて符号化される。この符号化の際に,同じGOPで再度CPBアンダーフローが生じた場合,前述した処理と同様な処理によって,リトライカウントが1増加し,3になる。これにより,符号化パラメータがリトライカウント=3に対応するものに変更された上で,同じGOPについて再度,先頭ピクチャから符号化が順次行われる。このGOPの符号化において,これ以上CPBアンダーフローが生じなかった場合,リトライカウント管理部250によってリトライカウントが1減らされ,リトライカウントが2となって,次のGOPの符号化が進められる。このときの入力バッファ210および出力バッファ230の動作は,前述した例と同様である。
 このケース2の例におけるリトライカウント,符号化パラメータの推移の概念図を,図11に示す。図11の例では,リトライカウントが1の状態で,2番目のGOP2を符号化しているときに,6ピクチャ目の符号化でCPBアンダーフローが発生したので,リトライカウントを2にし,再度,リトライカウント=2に対応する符号化パラメータでGOP2の先頭のIピクチャから再符号化している。この再符号化でも,7番目のピクチャでCPBアンダーフローが発生し,さらにリトライカウント=3に対応する発生符号量が少ない符号化パラメータで再符号化し,再度の再符号化ではCPBアンダーフローが生じなかったので,GOP2の符号化完了時にリトライカウントから1を減じ,リトライカウントが2の符号化パラメータを用いて,次のGOPの符号化に移行している。
 再符号化が行われた際のCPB残符号量の遷移の概念図を,図8に示す。第1の実施例と同様に、太線で示した線が,再度,再符号化した後のCPB残符号量である。再符号化では,プレフィルタでぼかし度合いを強め,量子化パラメータもデフォルト符号化パラメータよりも大きくするため,発生符号量が抑えられ,例えば図8のような遷移が行われ,CPBアンダーフローが抑制される。
 [ケース3の処理例]
 最後に,同じGOPの符号化において複数回CPBアンダーフローが発生し,リトライカウントが上限値に達して再符号化でも回避できなかった場合のケース3について説明する。あるGOPを符号化中に,ケース2の場合と同様に,リトライカウントが3に達したとする。さらに,同じGOPの符号化において,CPB管理部240によりCPBアンダーフローが検知された場合(S203),リトライカウント管理部250でリトライカウントが上限値に達していることが検知され(S208),符号化が完了する。なお,このような場合に,符号化を完了するのでなく,コマ落としを許容し,符号化を完了しないで,CPBアンダーフローが生じたピクチャの符号化データを破棄し,次のピクチャを符号化するように処理してもよい。
<第3の実施例>
 以下,本発明の第3の実施例について説明する。図12は,本発明の第3の実施例に係る動画像符号化制御方法を示す処理フローチャートである。
 まず,入力映像信号における符号化が終了したピクチャの次のピクチャを符号化対象として設定する(ステップS301)。符号化対象として設定した入力ピクチャを,H.264その他の所定の符号化方式により符号化する(ステップS302)。入力ピクチャの符号化により,CPBアンダーフローが生じたかどうかを判定し(ステップS303),CPBアンダーフローが生じた場合には,ステップS308へ進む。なお,CPBアンダーフローが生じたかどうかは,例えばH.264の標準規格などで用いられている方法で判定することができる。
 CPBアンダーフローが生じていなければ,最終ピクチャの符号化が完了したかどうかを判定し(ステップS304),最終ピクチャまで符号化が完了したならば符号化処理を終了する。
 そうでなければ,符号化順ピクチャ群の符号化が完了したかどうかを判定する(ステップS305)。完了していなければ,ステップS301へ戻り,次のピクチャについて同様に符号化処理を続ける。
 符号化順ピクチャ群の符号化が完了した場合,以下の条件が満たされるかを判定し,条件が満たされ場合にだけ,リトライカウントを1減らす(ステップS306)。
・条件1:リトライカウントが1以上であること。
・条件2:CPB残符号量が所定の閾値以上であること。
リトライカウントが0の場合,またはCPB残符号量が所定の閾値より少ない場合には,リトライカウントは減らさずに,元のままとする。
 その後,リトライカウントに基づき,あらかじめリトライカウントに応じて定められた符号化パラメータを設定し(ステップS307),ステップS301へ戻って,次の符号化順ピクチャ群の先頭のピクチャから符号化処理を行う。
 ステップS303においてCPBアンダーフローが生じたことが検出された場合,現在のリトライカウントの値が,あらかじめ定められた最大値になっているかどうかを判定する((ステップS308)。リトライカウントが最大値の場合,符号化順ピクチャ群を再符号化してもCPBアンダーフローが回避できないので,符号化を終了する。
 リトライカウントが最大値に到達していない場合,現在の符号化順ピクチャ群の再符号化のため,現在の符号化順ピクチャ群の先頭のピクチャを符号化対象として設定する(ステップS309)。そして,リトライカウントを1だけ増やす(ステップS310)。その後,リトライカウントに基づき,2つの符号化パラメータ(量子化パラメータ,プレフィルタ強度)のうち1つ以上を変更し(量子化パラメータはステップサイズをより大きく,フィルタ強度の場合はぼかし度合いをより大きく変更)(ステップS311),ステップS302へ戻って,符号化中の符号化順ピクチャ群を再符号化する。
 本発明は,入力映像の全フレームを2回符号化する従来技術bと異なり,基本的には1回の符号化処理とし,CPBアンダーフローが生じた場合に限り,符号化順ピクチャ群(例えばGOP)をCPBアンダーフローが生じなくなるまで発生符号量を段階的に抑えて繰り返し符号化する。2回目以降の符号化時には,リトライカウントに応じて定められたCPBアンダーフローを抑制する符号化パラメータで符号化を行う。したがって,入力映像の全てのピクチャを2度符号化する従来技術bと比較して演算量を削減できるとともに,再符号化による画質の劣化も小さくすることができる。
 以上のように本実施形態では,再符号化時に符号化パラメータをリトライカウントに応じて変更する。ここでは,符号化時に入力映像に対してプレフィルタを適用するものとし,変更する符号化パラメータとしては,量子化パラメータとプレフィルタ強度とする。この2つの符号化パラメータの双方を変更してもよいし,いずれか一方だけを変更してもよい。
 量子化パラメータについては,通常の符号化時に定められる量子化パラメータ値に対して,リトライカウントに応じて段階的に大きくなる所定のオフセット値を足し,より大きい量子化パラメータで再符号化する。
 プレフィルタについては,第1の実施例と同様に,ガウシアンフィルタを利用するものとする。ガウシアンフィルタは,前述した式(1)で示されるガウス分布をx,yについてサンプリングすることによって作成できる。
 式(1)において、σ=0の場合には,ガウシアンフィルタをかけないものとし,例えばデフォルト符号化パラメータはσ0 =0,再符号化用符号化パラメータは,リトライカウントの値をcとすると,σc とする。σc は,cの値が大きいほど大きな値とする。0<σ1 <σ2 <……である。なお,本実施例ではローパスフィルタの種類は問わない。また,例えばデフォルト符号化パラメータのσ0 は,ピクチャごとの複雑度に応じて変更し,σはσc-1 に所定のオフセットを足したものであるような構成でもよい。
 以下で説明する実施例では,符号化方式として,H.264の規格に従った符号化を行うものとする。また,符号化順ピクチャ群はGOPとし,符号化する際のGOPの概念図を図5に示す。第1の実施例と同様に、1つのGOPは10ピクチャで構成され,表示順で,Iピクチャを先頭にBピクチャとPピクチャとが交互に並ぶものとする。
 本発明の第3の実施例に係る装置構成例を,図13に示す。入力バッファ310は,入力される映像信号を蓄積するとともに,符号化部320に符号化対象の映像信号を出力する。さらに,入力バッファ310は,後述のCPB管理部340から,CPBアンダーフローが生じ,再符号化を行うことを示す情報(リトライ情報)を受けた場合,符号化中のGOPの先頭のピクチャから映像信号を再度,符号化部320に出力する。また,リトライ情報を受けずにGOPの符号化が完了した場合,入力バッファ310は,蓄積していた当該GOPの映像信号を破棄する。
 符号化部320は,入力バッファ310から入力された映像信号を符号化し,符号化ストリームを出力バッファ330に出力する。また,入力された映像信号を符号化した際に発生した符号量(符号量情報)をCPB管理部340に出力する。さらに,符号化部320は,CPB管理部340からリトライ情報を受けた場合,符号化中のGOPの先頭ピクチャからの映像信号が入力バッファ310から再度入力されるとともに,パラメータ調整部370から再符号化用符号化パラメータが入力されるため,入力された再符号化用符号化パラメータを利用して再符号化を行う。
 出力バッファ330は,GOPの符号化ストリームが全て蓄積された段階で,当該GOPの符号化ストリームを出力し,一方で,CPB管理部340からリトライ情報を受けた場合,符号化中のGOPについて蓄積した符号化ストリームを破棄する。
 CPB管理部340は,符号化部320から入力される符号量情報を利用して,時刻とともに変化するCPBの残符号量を求める。すなわち,図1の概念図で示したCPBの残符号量を求める。そして,CPBアンダーフローが生じた場合,リトライ情報を入力バッファ310,符号化部320,リトライカウント管理部350,出力バッファ330に出力し,CPBアンダーフローが生じたことを通知する。また,CPB状態予測部360に,CPB残符号量情報を通知する。
 リトライカウント管理部350は,CPB管理部340からリトライ情報を受けた場合,現在のリトライカウントの値に1を加算し,更新後のリトライカウントをパラメータ調整部370に通知する。
 また,CPB管理部340からリトライ情報を受けずに,現在符号化中のGOPの符号化が完了した場合,リトライカウントの値が1以上であれば,リトライカウントの値から1を減算し,そのリトライカウントをパラメータ調整部370に通知する。ただし,CPB状態予測部360から通知されたパラメータ変更有無情報が「パラメータ変更無し」を示していれば,リトライカウントが1以上であっても,リトライカウントから1を減算しない。また,リトライカウントが0の場合にも1を減算しないで,現在のリトライカウントの値をパラメータ調整部370に通知する。
 パラメータ調整部370は,リトライカウント管理部350からリトライカウントを受けると,リトライカウントに応じて定められた符号化パラメータを符号化部320に入力する。これにより,符号化部320は,同じGOPについて再符号化の繰り返し回数が多くなるほど,発生符号量が小さくなる符号化パラメータを用いて符号化をすることになる。
 以上のように,本実施例では,再符号化が発生すると値が増加し,GOPの符号化が完了した時点で値が減らされるリトライカウントという概念を導入し,リトライカウント管理部350にて管理する。このリトライカウントには,例えば上限値が「3」というように,所定の上限値があり,上限値に達するまで同じGOPの再符号化を行ってよいものとする。符号化時における量子化パラメータのオフセット値,プレフィルタのフィルタ強度はリトライカウントの値に応じて変化する。
 リトライカウントが0のときには,デフォルト符号化パラメータが利用される。リトライカウントが0以外の場合には,例えばリトライカウントの上限値が3の場合,リトライカウントの1,2,3のそれぞれに対応した再符号化用符号化パラメータを,符号化パラメータテーブルとしてあらかじめ用意しておいて,その符号化パラメータテーブルから得た符号化パラメータを再符号化に利用してもよい。
 本実施例における符号化処理の流れについて,図12のフローチャートに沿って説明する。以下の説明では,S301,S302,…といったように,文章中に図12のフローチャートとの対応を記載する。
 あるGOPの符号化を行う処理について,以下のように3つのケースに場合分けをして説明する。
・[ケース1]:GOPの符号化においてCPBアンダーフローが発生しなかった。
・[ケース2]:GOPの符号化において複数回CPBアンダーフローが発生し,再符号化で回避できた。
・[ケース3]:GOPの符号化において複数回CPBアンダーフローが発生し,リトライカウントが上限値に達して再符号化でも回避できなかった。
 [ケース1の処理例]
 まず,GOPの符号化においてCPBアンダーフローが発生しなかった場合のケース1について説明する。GOPのピクチャが入力バッファ310に入力されると,入力バッファ310は当該ピクチャを蓄積するとともに,符号化部320に当該ピクチャを符号化対象ピクチャとして入力する(S301)。そして,符号化部320は当該ピクチャを符号化し,出力バッファ330に符号化ストリームを出力するとともに(出力バッファ330は当該符号化ストリームは出力せず,蓄積する),当該ピクチャに関するCPB管理部340に符号量情報を出力する(S302)。
 ここで,例えばリトライカウントが初期値の0であるとすると,符号化においてはデフォルト符号化パラメータが利用され,デフォルト符号化パラメータに対応したプレフィルタ強度で符号化対象ピクチャに,プレフィルタ部321によるフィルタリング処理が適用され,本ピクチャで発生したDCT係数は,デフォルト符号化パラメータに従った量子化パラメータで,量子化部322により量子化される。リトライカウントが1以上の場合には,それぞれリトライカウントに応じて定められたフィルタ強度および量子化パラメータによるプレフィルタ,量子化処理で符号化が行われる。
 CPB管理部340は,当該ピクチャについて,符号化部320から入力された符号量情報をもとにCPB残符号量を計算し,この例ではCPBアンダーフローが発生しないため,リトライ情報の出力はしない(S303)。符号化対象ピクチャが入力映像信号中の最終ピクチャであれば,出力バッファ330は蓄積している符号化ストリームを出力し,符号化処理が完了する(S304)。あるいは,符号化対象ピクチャがGOPの最終ピクチャであれば,出力バッファ330は蓄積していた符号化ストリームを出力するとともに,入力バッファ310は蓄積していたピクチャを破棄し,次のGOPの最初のピクチャの符号化処理に移る(S305~S307))。
 このケース1のように,CPBアンダーフローを発生させずにGOPの符号化が完了した場合,CPB管理部340は,GOPの符号化が完了した時点で,CPB残符号量情報をCPB状態予測部360に通知する。CPB状態予測部360は,CPB残符号量が所定の閾値より大きいか否かを判定し,大きい場合,パラメータ変更有無情報として符号化パラメータを変更することをリトライカウント管理部350に通知する。一方,CPB残符号量が閾値以下の場合,パラメータ変更有無情報として符号化パラメータを変更しないことをリトライカウント管理部350に通知する。リトライカウント管理部350は,パラメータ変更有無情報が符号化パラメータを変更することを示す場合に限り,現在のリトライカウントから値を1減らす(S306)。
 すなわち,現在符号化が完了したGOPより前のGOPで再符号化が生じている場合に,リトライカウントが0でないことがある。そのとき,リトライカウント管理部350は,CPB状態予測部360からのパラメータ変更有無情報の通知に従って,リトライカウントを変更し,変更後のリトライカウントをパラメータ調整部370に通知する。パラメータ調整部370は,通知されたリトライカウントに対応した符号化パラメータを符号化部320に設定し,次のGOPの先頭ピクチャの符号化が開始される。
 [ケース2の処理例]
 次に,GOPの符号化において複数回CPBアンダーフローが発生し,再符号化で回避できた場合のケース2について説明する。ここでは,GOPの符号化を開始する時点でのリトライカウントが1であるとし,同じGOPで2回再符号化が行われた場合を説明する。
 GOPのピクチャが入力バッファ310に入力されると,入力バッファ310は当該ピクチャを蓄積するとともに,符号化部320に当該ピクチャを符号化対象ピクチャとして入力する(S301)。そして,符号化部320は当該ピクチャを符号化し,出力バッファ330に符号化ストリームを出力するとともに(出力バッファ330は当該符号化ストリームは出力せず,蓄積する),当該ピクチャに関するCPB管理部340に符号量情報を出力する(S302)。ここで,符号化においては,リトライカウント1に対応した符号化パラメータが利用される。
 CPB管理部340は,当該ピクチャについて,符号化部320から入力された符号量情報をもとにCPB残符号量を計算する。この結果,当該ピクチャについて,CPB管理部340がCPBアンダーフローを検知した場合,CPB管理部340は,符号化部320,リトライカウント管理部350,入力バッファ310,出力バッファ330にリトライ情報を出力する(S303)。
 現在のリトライカウントは1であり,上限値の3には達していないので(S308),入力バッファ310は,蓄積していた符号化中のGOPの先頭ピクチャを符号化部320に出力する(S309)。一方で,リトライカウント管理部350でリトライカウントが1増加され,値が2となったリトライカウントがパラメータ調整部370に出力される(S310)。
 パラメータ調整部370では,リトライカウントが2のときの符号化パラメータを符号化パラメータテーブルから読み出し,その符号化パラメータを符号化部320に設定する(S311)。出力バッファ330は,符号化中のGOPの符号化ストリームを破棄する。
 符号化部320では,CPBアンダーフローが生じない限り,順次,GOPのピクチャが入力バッファ310から入力されて符号化される。この符号化の際に,同じGOPで再度CPBアンダーフローが生じた場合,前述した処理と同様な処理によって,リトライカウントが1増加し,3になる。これにより,符号化パラメータがリトライカウント=3に対応するものに変更された上で,同じGOPについて再度,先頭ピクチャから符号化が順次行われる。
 このGOPの符号化において,これ以上CPBアンダーフローが生じなかった場合,CPB管理部340は,CPB残符号量の情報をCPB状態予測部360に通知する。CPB状態予測部360は,CPB状態残符号量が所定の閾値以上の場合,パラメータ変更有無情報を「変更あり」とし,それ以外の場合には「変更なし」として,リトライカウント管理部350に通知する。
 通知されたパラメータ変更有無情報が「変更あり」の場合,リトライカウント管理部350によってリトライカウントが1減らされ,リトライカウントが2となって,次のGOPの符号化が進められる。このときの入力バッファ310および出力バッファ330の動作は,前述した例と同様である。パラメータ変更有無情報が「変更なし」の場合には,リトライカウントが3のままで,次のGOPの符号化が進められる。
 このケース2の例におけるリトライカウント,符号化パラメータの推移の概念図を,図11に示す。図11の例では,第2の実施例と同様に、リトライカウントが1の状態で,2番目のGOP2を符号化しているときに,6ピクチャ目の符号化でCPBアンダーフローが発生したので,リトライカウントを2にし,再度,リトライカウント=2に対応する符号化パラメータでGOP2の先頭のIピクチャから再符号化している。この再符号化でも,7番目のピクチャでCPBアンダーフローが発生し,さらにリトライカウント=3に対応する発生符号量が少ない符号化パラメータで再符号化が行われている。
 再度の再符号化ではCPBアンダーフローが生じなかったので,CPB残符号量が所定の閾値以上かを判定し,ここでCPB残符号量が所定の閾値以上であったので,GOP2の符号化完了時にリトライカウントから1を減じ,リトライカウントが2の符号化パラメータを用いて,次のGOP3の符号化に移行している。
 再符号化が行われた際のCPB残符号量の遷移の概念図を,図8に示す。第1、第2の実施例と同様に、太線で示した線が,再度,再符号化した後のCPB残符号量である。再符号化では,プレフィルタでぼかし度合いを強め,量子化パラメータもデフォルト符号化パラメータよりも大きくするため,発生符号量が抑えられ,例えば図8のような遷移が行われ,CPBアンダーフローが抑制される。
 [ケース3の処理例]
 最後に,同じGOPの符号化において複数回CPBアンダーフローが発生し,リトライカウントが上限値に達して再符号化でも回避できなかった場合のケース3について説明する。あるGOPを符号化中に,ケース2の場合と同様に,リトライカウントが3に達したとする。さらに,同じGOPの符号化において,CPB管理部340によりCPBアンダーフローが検知された場合(S303),リトライカウント管理部350でリトライカウントが上限値に達していることが検知され(S308),符号化が完了する。なお,このような場合に,符号化を完了するのでなく,コマ落としを許容し,符号化を完了しないで,CPBアンダーフローが生じたピクチャの符号化データを破棄し,次のピクチャを符号化するように処理してもよい。
<第4の実施例>
 次に,本発明の第4の実施形態について説明する。図14は,本発明の第4の実施例に係る動画像符号化制御方法を示す処理フローチャートである。
 まず,入力映像信号における符号化が終了したピクチャの次のピクチャを符号化対象として設定する(ステップS401)。符号化対象として設定した入力ピクチャを,H.264その他の所定の符号化方式により符号化する(ステップS402)。入力ピクチャの符号化により,CPBアンダーフローが生じたかどうかを判定し(ステップS403),CPBアンダーフローが生じた場合には,ステップS411へ進む。なお,CPBアンダーフローが生じたかどうかは,例えばH.264の標準規格などで用いられている方法で判定することができる。
 CPBアンダーフローが生じていなければ,最終ピクチャの符号化が完了したかどうかを判定し(ステップS404),最終ピクチャまで符号化が完了したならば符号化処理を終了する。
 そうでなければ,符号化したピクチャは符号化順ピクチャ群の先頭のIピクチャかどうかを判定する(ステップS405)。現在符号化したピクチャが符号化順ピクチャ群の先頭のIピクチャの場合,そのIピクチャをリトライポイントとして設定する(ステップS406)。これは,後述するステップS409において,CPB残符号量が所定の閾値未満の場合に,リトライポイントが1つ前の符号化順ピクチャ群の先頭に設定されたままであるので,次のIピクチャでCPBアンダーフローが生じないことを確認してからリトライポイントを更新するための処理である。なお,ステップS410においてリトライポイントが設定されている場合には,同じ位置にリトライポイントを再設定することになるが,処理上,不都合は生じない。その後,ステップS401へ戻って,次のピクチャの符号化を進める。
 符号化したピクチャが符号化順ピクチャ群の先頭でない場合,次に,符号化順ピクチャ群の符号化が完了したかどうかを判定する(ステップS407)。完了していなければ,ステップS401へ戻り,次のピクチャについて同様に符号化処理を続ける。符号化順ピクチャ群の符号化が完了した場合,符号化パラメータが符号化順ピクチャ群の再符号化(リトライ)で変更されていれば,符号化パラメータを通常の符号化時の値に戻す(ステップS408)。
 また,符号化順ピクチャ群の符号化が完了した時点で,CPB残符号量が所定の閾値以上かどうかを判定する(ステップS409)。CPB残符号量が所定の閾値以上であれば,リトライポイントを,次の符号化順ピクチャ群の先頭のIピクチャに設定する(ステップS410)。その後,ステップS401へ戻って,次の符号化順ピクチャ群の先頭から順番に符号化を行う。
 CPB残符号量が所定の閾値未満の場合には,リトライポイントを更新しないで,ステップS401へ戻り,次の符号化順ピクチャ群の符号化へ進む。
 ステップS403においてCPBアンダーフローが生じたことが検出された場合,現在の符号化順ピクチャ群は再符号化が行われたかどうか(リトライ済みかどうか)を判定する(ステップS411)。リトライ済みの場合,符号化順ピクチャ群を再符号化してもCPBアンダーフローが回避できないので,符号化を終了する。リトライ済みでない場合,現在の符号化順ピクチャ群の再符号化のため,リトライポイントのピクチャを符号化対象として設定する(ステップS412)。そして,2つの符号化パラメータ(量子化パラメータ,プレフィルタ強度)のうち1つ以上を変更し(量子化パラメータはステップサイズをより大きく,フィルタ強度の場合はぼかし度合いをより大きく変更)(ステップS413),ステップS402へ戻って,符号化中の符号化順ピクチャ群を再符号化する。
 すなわち,入力映像の全フレームを2回符号化する従来技術bと異なり,CPBアンダーフローが生じた場合に限り,符号化順ピクチャ群(例えばGOP)を2回符号化する。2回目の符号化時には,CPBアンダーフローを抑制する符号化パラメータで符号化を行う。CPBアンダーフローが生じた場合に限り,それが生じた符号化順ピクチャ群のみを再符号化することで(なお,例外的に1つ前の符号化順ピクチャ群から再符号化することもある),CPBアンダーフローを抑制する。したがって,入力映像の全てのピクチャを2度符号化する従来技術bと比較して演算量を削減できる。
 図15は,本発明の第4の実施例に係る動画像符号化制御方法の変形例を示す処理フローチャートである。本発明は,図14に示すステップS408の処理を,図15に示すステップS481~S483の処理に置き換えて実施することもできる。ステップS408以外の処理は,図14とほぼ同様である。
 図14のステップS407の処理の後,符号化パラメータがリトライで変更されているかどうかを判定する(ステップS481)。リトライで変更されていなければ,ステップS409へ進む。リトライで変更されていれば,次にCPB残符号量が所定の第一の閾値以上かどうかを判定する(ステップS482)。所定の閾値未満であれば,符号化パラメータを再符号化で用いた状態のままとし,所定の閾値以上の場合にだけ符号化パラメータを元のデフォルト符号化パラメータに戻す(ステップS483)。その後,ステップS409へ進み,CPB残符号量が所定の第二の閾値以上かどうかを判定するが,この処理およびステップS410の処理は,図14に示すステップS409,S410の処理と同様である。なお,第一の閾値と第二の閾値とは,同じ値であっても異なる値であってもどちらでもよい。
 図15に示す変形例では,以上のように符号化順ピクチャ群の符号化が完了した時点でCPB残符号量が所定量を超えている場合にだけ,符号化パラメータを通常の符号化時の値に戻す。これは次の理由による。符号化順ピクチャ群の符号化が完了したとしても,CPB残符号量が少ない場合,符号化パラメータを通常の符号化時の値に戻すと発生符号量がより多くなるため,次の符号化順ピクチャ群の符号化でCPBアンダーフローが生じる可能性が高まる。図15の処理では,CPB残符号量が少ない場合には,符号化パラメータを変更しないため,図14の処理に比べて,次の符号化順ピクチャ群の符号化における再符号化の発生が抑制され,演算量がさらに削減されることになる。
 以上のように本実施形態では,再符号化時に符号化パラメータを変更する。ここでは,符号化時に入力映像に対してプレフィルタを適用するものとし,変更する符号化パラメータとしては,量子化パラメータとプレフィルタ強度とする。この2つの符号化パラメータの双方を変更してもよいし,いずれか一方だけを変更してもよい。
 量子化パラメータについては,通常の符号化時の量子化パラメータ値に対して,所定のオフセット値を足し,より大きい量子化パラメータで再符号化する。
 プレフィルタについては,第1の実施例と同様に,ガウシアンフィルタを利用するものとする。ガウシアンフィルタは,前述した式(1)で示されるガウス分布をx,yについてサンプリングすることによって作成できる。
 式(1)において、σ=0の場合には,ガウシアンフィルタをかけないものとし,例えばデフォルト符号化パラメータはσ0 =0,再符号化用符号化パラメータはσ1 >0とする。なお,本発明ではローパスフィルタの種類は問わない。また,再符号化時のぼかし度合いの強め方も予め任意に定めてよい。例えば,デフォルト符号化パラメータのσ0 は,ピクチャごとの複雑度に応じて変更し,σ1 はσ0 に所定のオフセットを足したものであるような構成でもよい。
 符号化は,H.264の規格に従った符号化を行うものとする。また,本実施例では,符号化順ピクチャ群はGOPとし,符号化する際のGOPの概念図を図5に示す。第1の実施例と同様に、1つのGOPは10ピクチャで構成され,表示順で,Iピクチャを先頭にBピクチャとPピクチャとが交互に並ぶものとする。
 本発明の第4の実施例の装置構成例を,図16に示す。入力バッファ410は,入力される映像信号を蓄積するとともに,符号化部420に符号化対象の映像信号を出力する。さらに,入力バッファ410は,後述のCPB管理部440から,CPBアンダーフローが生じ,再符号化を行うことを示す情報(リトライ情報)を受けた場合,リトライポイントとして設定されたGOPの先頭ピクチャから映像信号を再度,符号化部420に出力する。また,リトライポイント管理部460からリトライポイント情報を入力した場合に,入力バッファ410は,リトライポイントより前の蓄積していたGOPの映像信号を破棄する。
 符号化部420は,入力バッファ410から入力された映像信号を符号化し,符号化ストリームを出力バッファ430に出力する。また,入力された映像信号を符号化した際に発生した符号量(符号量情報)をCPB管理部440に出力する。さらに,符号化部420は,CPB管理部440からリトライ情報を受けた場合,リトライポイントが示すGOPの先頭ピクチャからの映像信号が入力バッファ410から再度入力されるとともに,パラメータ調整部470から再符号化用符号化パラメータが入力されるため,入力された再符号化用符号化パラメータを利用して再符号化を行う。
 出力バッファ430は,リトライポイント管理部460からのリトライポイント情報に基づき,出力することが確定した符号化ストリーム,すなわち再符号化の必要がないことが確定した符号化結果の符号化ストリームを出力する。一方で,出力バッファ430は,CPB管理部440からリトライ情報を受けた場合,符号化中のGOPについて蓄積した符号化ストリームを破棄する。
 CPB管理部440は,符号化部420から入力される符号量情報を利用して,時刻とともに変化するCPBの残符号量を求める。すなわち,図1の概念図で示したCPBの残符号量を求める。そして,CPBアンダーフローが生じた場合,リトライ情報を入力バッファ410,符号化部420,パラメータ調整部470,出力バッファ430に出力し,CPBアンダーフローが生じたことを通知する。また,CPB管理部440は,GOPの符号化が完了した時点におけるCPB残符号量を,CPB状態予測部450に出力する。
 CPB状態予測部450は,CPB残符号量が所定の閾値より大きいか否かの判定を行い,閾値より大きい場合には,リトライポイント管理部460に,次のGOPのリトライポイントは当該GOPの先頭のIピクチャであることを示す情報を,リトライポイント変更有無情報として通知する。逆に,閾値より小さい場合には,次のGOPの先頭ピクチャのリトライポイントは当該GOPの直前のGOPの先頭ピクチャ(Iピクチャ)であることを示す情報を,リトライポイント変更有無情報として通知する。
 リトライポイント管理部460は,これから符号化するGOPの先頭ピクチャにおいて,リトライポイントが直前のGOPの先頭ピクチャであることをリトライ変更有無情報が示す場合に,そのリトライポイントを入力バッファ410に通知するとともに,先頭のピクチャの符号化において再符号化が生じなかった場合に,次のピクチャの符号化からリトライポイントを現在符号化しているGOPの先頭ピクチャとすることを,入力バッファ410に通知する。また,リトライポイントがこれから符号化するGOPの先頭ピクチャであることをリトライ変更有無情報が示す場合に,そのリトライポイントを入力バッファ410と出力バッファ430に通知する。ここでは,これらの通知情報をリトライポイント情報という。前述のように,入力バッファ410は,再符号化時にはリトライポイント情報に基づくピクチャから符号化部420に映像信号を入力し,出力バッファ430は,リトライポイント情報に基づき出力することが確定した符号化ストリームのみを出力する。
 パラメータ調整部470は,CPB管理部440からリトライ情報を受けた場合,前述のように再符号化用符号化パラメータを符号化部420に入力する。これにより,符号化部420は,再符号化時には,同じGOPについて,発生符号量が小さくなる符号化パラメータを用いて符号化をすることになる。
 本実施例における符号化処理の流れについて,図14のフローチャートに沿って説明する。以下の説明では,S401,S402,…といったように,文章中に図14のフローチャートとの対応を記載する。
 あるGOPの符号化を行う処理について,最初のGOPをGOP1,次のGOPをGOP2として,以下のように4つのケースに場合分けをして説明する。
・[ケース1]:GOP1の符号化においてCPBアンダーフローが発生しないでGOP1の符号化が完了し,次のGOP2の先頭ピクチャの符号化においてもCPBアンダーフローが発生しなかった。
・[ケース2]:GOP1の符号化が完了し,次のGOP2の先頭ピクチャの符号化においてCPBアンダーフローが発生し,再符号化が必要になった。
・[ケース3]:GOP2の中間のピクチャの符号化においてCPBアンダーフローが発生し,再符号化が必要になった。
・[ケース4]:GOP2の符号化においてCPBアンダーフローが発生し,再符号化でも回避できなかった。
 [ケース1の処理例]
 まず,GOP1の符号化においてCPBアンダーフローが発生しなかった場合のケース1について説明する。GOP1のピクチャが入力バッファ410に入力されると,入力バッファ410は当該ピクチャを蓄積するとともに,符号化部420に当該ピクチャを符号化対象ピクチャとして入力する(S401)。そして,符号化部420は当該ピクチャを符号化し,出力バッファ430に符号化ストリームを出力するとともに(出力バッファ430は当該符号化ストリームは出力せず,蓄積する),当該ピクチャに関するCPB管理部440に符号量情報を出力する(S402)。
 ここで,符号化においてはデフォルト符号化パラメータが利用され,デフォルト符号化パラメータに対応したプレフィルタ強度で符号化対象ピクチャに,プレフィルタ部421によるフィルタリング処理が適用され,本ピクチャで発生したDCT係数は,デフォルト符号化パラメータに従った量子化パラメータで,量子化部422により量子化される。
 CPB管理部440は,当該ピクチャについて,符号化部420から入力された符号量情報をもとにCPB残符号量を計算し,この例ではCPBアンダーフローが発生しないため,リトライ情報の出力はしない(S403)。符号化対象ピクチャが入力映像信号中の最終ピクチャであれば,出力バッファ430は蓄積している符号化ストリームを出力し,符号化処理が完了する(S404)。
 符号化対象ピクチャがGOP1の先頭ピクチャであれば(S405),リトライポイント管理部460は,GOP1の先頭ピクチャ(Iピクチャ)をリトライポイントとして設定し(S406),続いて符号化部420は,次のピクチャの符号化を進める。
 あるいは,符号化対象ピクチャがGOPの最終ピクチャであれば,パラメータ調整部470は,再符号化で再符号化用符号化パラメータが利用されていた場合に,符号化パラメータをデフォルト符号化パラメータに変更する(S408)。
 その一方で,CPB管理部440がCPB残符号量情報をCPB状態予測部450に出力し,CPB状態予測部450は,CPB残符号量が所定の閾値よりも大きいかを判定する(S409)。その判定結果を,前述のリトライポイント変更有無情報として,リトライポイント管理部460に通知する。リトライポイント管理部460は,リトライポイント変更有無情報がリトライポイントを変更しないこと(閾値未満)を示す場合,入力バッファ410にリトライポイントがGOP1の先頭ピクチャであることをリトライポイント情報として通知する。その後,GOP2の先頭のIピクチャの符号化処理に進み(S402),そのIピクチャの符号化でCPBアンダーフローが生じなかった場合(S403),リトライポイント管理部460は,入力バッファ410および出力バッファ430にリトライポイントがGOP2の先頭ピクチャであることを通知する(S406)。すなわち,それ以降のGOP2のピクチャにおいて再符号化が生じた場合,GOP2の先頭ピクチャから再符号化が行われる。
 前述したGOP1の符号化が完了した時点で,CPB残符号量が十分にある場合には,リトライポイントを変更することを示すリトライ変更有無情報がCPB状態予測部450からリトライポイント管理部460へ出力され,リトライポイント管理部460は,入力バッファ410にリトライポイントはGOP2の先頭ピクチャであることをリトライポイント情報として通知する(S410)。この場合,次にGOP2のどのピクチャにおいてCPBアンダーフローが生じても,GOP2の先頭ピクチャから再符号化が行われる。
 [ケース2の処理例]
 次に,GOP2の先頭ピクチャの符号化においてCPBアンダーフローが発生し,再符号化で回避できた場合のケース2について説明する。ケース1と同様に,GOP1の符号化が完了した時点でのリトライポイント変更有無情報が,CPB残符号量が少ないためにリトライポイントを変更しないことを示す場合,リトライポイント管理部460は,入力バッファ410にリトライポイントはGOP1の先頭のIピクチャであることを通知する。
 GOP2の先頭のIピクチャの符号化処理に進み,当該ピクチャでCPB管理部440によりCPBアンダーフローが生じたことが検出された場合(S403),CPB管理部440からのリトライ情報に基づき,入力バッファ410は,GOP1の先頭ピクチャから順次,符号化部420にピクチャを入力させ,符号化部420で再符号化が行われる。このときの符号化パラメータは,パラメータ調整部470から設定された再符号化用符号化パラメータが用いられる(S413)。この再符号化では,プレフィルタ部421により,再符号化用符号化パラメータに対応したプレフィルタ強度(デフォルト符号化パラメータよりぼかし度合いが大きい)で,符号化対象ピクチャにプレフィルタリング処理が適用され,本ピクチャで発生したDCT係数は,再符号化用符号化パラメータに従った量子化パラメータ(デフォルト符号化パラメータより量子化ステップサイズが大きい)で,量子化部422により量子化される。
 このGOP1の再符号化により,GOP1の最終ピクチャまでの符号化が完了した場合,そのときのCPB残符号量によって,リトライポイントがGOP1の先頭ピクチャまたはGOP2の先頭ピクチャに設定され,続いてGOP2の先頭ピクチャの符号化処理が進められる。
 [ケース3の処理例]
 前のケース2では,GOP2の先頭ピクチャの符号化においてCPBアンダーフローが発生し,再符号化が必要になった例を説明したが,GOP2の先頭ピクチャ以外のピクチャでCPBアンダーフローが生じた場合には,同様に再符号化用符号化パラメータを用いて,GOP2の先頭ピクチャから再符号化が行われることになる。
 GOP2の中間のピクチャで再符号化が行われた際の符号化パラメータの変更の概念図を図7に示す。図7の例では,第1の実施例と同様に、GOP2の6ピクチャ目の符号化でCPBアンダーフローが発生したので,発生符号量を抑制する再符号化用符号化パラメータを設定して,GOP2の先頭のIピクチャから再符号化している。再符号化によりCPBアンダーフローの発生が抑止されたので,次のGOP3の符号化では,再符号化用符号化パラメータをデフォルト符号化パラメータに戻し,符号化処理を続ける。
 再符号化が行われた際のCPB残符号量の遷移の概念図を図8に示す。第1~第3の実施例と同様に、太線で示した線が再符号化後のCPB残符号量である。再符号化では,プレフィルタでぼかし度合いを強め,量子化パラメータもデフォルト符号化パラメータよりも大きくするため,発生符号量が抑えられ,例えば図8のような遷移が行われ,CPBアンダーフローが抑制される。
 [ケース4の処理例]
 最後に,GOP2の符号化においてCPBアンダーフローが発生し,再符号化でも回避できなかった場合のケース4について説明する。この場合,CPB管理部440によりCPBアンダーフローが検知され,GOP2の再符号化を行う動作は,前のケース3と同様である。このGOP2の再符号化中にCPBアンダーフローが生じた場合,符号化を完了する(S411)。なお,符号化を完了するのでなく,コマ落としを許容し,符号化を完了しないで,CPBアンダーフローが生じたピクチャの符号化データを破棄し,次のピクチャを符号化するように処理してもよい。
<第5の実施例>
 次に,本発明の第5の実施例について説明する。図17は,本発明の第5の実施例に係る動画像符号化制御方法を示す処理フローチャートである。
 符号化順でM枚目のピクチャとN枚目(N>M)のピクチャに関して,N-Mをピクチャ間距離という。最初に,外部から与えられた利用可能なメモリ量の情報に基づき,再符号化時にメモリ制限内で最大で遡ることができるピクチャ間距離である最大ピクチャ間距離を求め,記憶する(S500)。
 次に,入力映像信号における符号化が終了したピクチャの次のピクチャ(符号化開始時には入力映像信号の先頭ピクチャ)を符号化対象として設定する(ステップS501)。符号化対象として設定した入力ピクチャを,H.264その他の所定の符号化方式により符号化する(ステップS502)。入力ピクチャの符号化により,CPBアンダーフローが生じたかどうかを判定し(ステップS503),CPBアンダーフローが生じた場合には,ステップS507へ進む。なお,CPBアンダーフローが生じたかどうかは,例えばH.264の標準規格などで用いられている方法で判定することができる。
 CPBアンダーフローが生じていなければ,最終ピクチャの符号化が完了したかどうかを判定し(ステップS504),最終ピクチャまで符号化が完了したならば符号化処理を終了する。
 そうでなければ,符号化順ピクチャ群の符号化が完了したかどうかを判定する(ステップS505)。完了していなければ,ステップS501へ戻り,次のピクチャについて同様に符号化処理を続ける。符号化順ピクチャ群の符号化が完了した場合,符号化パラメータが符号化順ピクチャ群の再符号化(リトライ)で変更されていれば,符号化パラメータを通常の符号化時の値に戻し(ステップS506),ステップS501へ戻って,次の符号化順ピクチャ群の先頭のピクチャから符号化処理を行う。
 ステップS503においてCPBアンダーフローが生じたことが検出された場合,現在の符号化中のピクチャは再符号化が行われたかどうか(リトライ済みかどうか)を判定する(ステップS507)。リトライ済みの場合,符号化順ピクチャ群内のピクチャを再符号化してもCPBアンダーフローが回避できないので,符号化を終了する。リトライ済みでない場合,現在の符号化順ピクチャ群内のピクチャの再符号化のため,リトライポイントを設定する。すなわち,ステップS500で算出した最大ピクチャ間距離の範囲内の符号化中の符号化順ピクチャ群に含まれる最も離れたピクチャを,符号化対象として設定する(ステップS508)。そして,2つの符号化パラメータ(量子化パラメータ,プレフィルタ強度)のうち1つ以上を変更し(量子化パラメータはステップサイズをより大きく,フィルタ強度の場合はぼかし度合いをより大きく変更)(ステップS509),ステップS502へ戻って,リトライポイントとして設定した符号化順ピクチャ群のピクチャから再符号化する。
 以上の再符号化処理によれば,入力映像の全フレームを2回符号化する従来技術bと異なり,CPBアンダーフローが生じた場合に限り,符号化順ピクチャ群(例えばGOP)内の複数ピクチャを2回符号化する。2回目の符号化時には,CPBアンダーフローを抑制する符号化パラメータで符号化を行う。CPBアンダーフローが生じた場合に限り,それが生じた符号化順ピクチャ群内の複数ピクチャのみを再符号化することでCPBアンダーフローを抑制する。したがって,入力映像の全てのピクチャを2度符号化する従来技術bと比較して演算量を削減できる。また,入力バッファおよび出力バッファとして必要となるメモリも,所定数のピクチャに相当する分だけでよく,メモリの削減を図ることができる。
 図18は,本発明の第5の実施例に係る動画像符号化制御方法の変形例を示す処理フローチャートである。本発明は,図17に示すステップS506の処理を,図18に示すステップS561~S563の処理に置き換えて実施することもできる。ステップS506以外の処理は,図17と同様である。
 図17のステップS505の処理の後,符号化パラメータがリトライで変更されているかどうかを判定する(ステップS561)。リトライで変更されていなければ,図17のステップS501へ戻る。リトライで変更されていれば,次にCPB残符号量が所定の閾値以上かどうかを判定する(ステップS562)。所定の閾値未満であれば,符号化パラメータを再符号化で用いた状態のままとし,所定の閾値以上の場合にだけ符号化パラメータを元のデフォルト符号化パラメータに戻す(ステップS563)。その後に,図17のステップS501へ戻り,次の符号化順ピクチャ群の符号化に移る。
 図18に示す変形例では,以上のように符号化順ピクチャ群の符号化が完了した時点でCPB残符号量が所定量を超えている場合にだけ,符号化パラメータを通常の符号化時の値に戻す。これは次の理由による。符号化順ピクチャ群の符号化が完了したとしても,CPB残符号量が少ない場合,符号化パラメータを通常の符号化時の値に戻すと発生符号量がより多くなるため,次の符号化順ピクチャ群の符号化でCPBアンダーフローが生じる可能性が高まる。図18の処理では,CPB残符号量が少ない場合には,符号化パラメータを変更しないため,図17の処理に比べて,次の符号化順ピクチャ群の符号化における再符号化の発生が抑制され,演算量がさらに削減されることになる。
 以上のように本実施形態では,再符号化時に符号化パラメータを変更する。ここでは,符号化時に入力映像に対してプレフィルタを適用するものとし,変更する符号化パラメータとしては,量子化パラメータとプレフィルタ強度とする。この2つの符号化パラメータの双方を変更してもよいし,いずれか一方だけを変更してもよい。
 量子化パラメータについては,通常の符号化時の量子化パラメータ値に対して,所定のオフセット値を足し,より大きい量子化パラメータで再符号化する。
 プレフィルタについては,第1の実施例と同様に,ガウシアンフィルタを利用するものとする。ガウシアンフィルタは,前述した式(1)で示されるガウス分布をx,yについてサンプリングすることによって作成できる。
 式(1)において、σ=0の場合には,ガウシアンフィルタをかけないものとし,例えばデフォルト符号化パラメータはσ0 =0,再符号化用符号化パラメータはσ1 >0とする。なお,本発明ではローパスフィルタの種類は問わない。また,再符号化時のぼかし度合いの強め方も予め任意に定めてよい。例えば,デフォルト符号化パラメータのσ0 は,ピクチャごとの複雑度に応じて変更し,σ1 はσ0 に所定のオフセットを足したものであるような構成でもよい。
 符号化は,H.264の規格に従った符号化を行うものとする。また,本実施例では,符号化順ピクチャ群はGOPとし,符号化する際のGOPの概念図を図5に示す。第1の実施例と同様に、1つのGOPは10ピクチャで構成され,表示順で,Iピクチャを先頭にBピクチャとPピクチャとが交互に並ぶものとする。
 本発明の第5の実施例に係る装置構成例を,図19に示す。最大ピクチャ間距離決定部600は,外部から使用可能メモリ量を通知され(使用可能メモリ量情報),これに基づき再符号化時に最大で遡れる最大ピクチャ間距離を求める。本実施例では,再符号化に備えるために,入力バッファ510に符号化中のGOPの入力映像信号,出力バッファ530に符号化中のGOPの符号化ストリームを蓄積しておく。最大ピクチャ間距離決定部600は,GOP長を最大ピクチャ間距離とした場合から始め,最大ピクチャ間距離の値を減らしながら,入力バッファ510および出力バッファ530の最悪のケースでの必要メモリ量および他の利用メモリ量の総和が,使用可能メモリ量以下になるピクチャ間距離を求め,最大ピクチャ間距離を決定する。
 ここで,最大ピクチャ間距離を求める際の必要メモリ量の計算例を示す。まず,入力バッファ510の必要メモリ量は,次のようになる。
  入力バッファの必要メモリ量=(最大ピクチャ間距離+1)×(1ピクチャのデータ量)
 一方で,出力バッファ530の必要メモリ量は,CPBの大きさ,およびビットレートの制限下で,CPBアンダーフローを生じさせずに発生し得る最大の符号量とする。具体的には,GOPの符号開始直前においてCPB残符号量がCPBの大きさと等しい状態で,CPBにビットレートに従って入力されるデータを全て使い切った場合(GOP符号化後にCPB残符号量が0)が,発生し得る最大の符号量となる。ビット数での計算式としては,出力バッファの必要メモリ量は,次式のようになる。
  出力バッファの必要メモリ量=(ビットレート/1秒あたりのピクチャ数)×(最大ピクチャ間距離+1)+(ビット数でのCPBの大きさ)
 さらに,次のようなデータのデータ量も計算する必要がある場合がある。H.264の場合,再符号化に備えてGOPの符号化中に作成された復号画像を,参照画像として残しておく必要がある(残しておかない場合,再符号化時にリトライポイントから符号化する際の参照画像がない状態となる)。GOP内のピクチャは当該GOP以前のピクチャを参照しないため,参照画像としてDPB(Decoded Picture Buffer)に格納するのは,IおよびPピクチャの前提の場合,次のようにメモリを確保しておけば,あらゆる状況においてメモリが足りることになる。
 GOPの最後のピクチャにおいて再符号化が生じた場合に,再符号化を開始するピクチャ(最大ピクチャ間距離のピクチャ)よりも,符号化順において過去である符号化順ピクチャ群内のIおよびPピクチャの数の分だけメモリを持っていればよい。
 図20に,この必要メモリ量を説明する概念図を示す。例えば,図20に示すようにGOPが10ピクチャ構成で,最大ピクチャ間距離が6であるとする。入力バッファ510に保持すべきピクチャ数は最大で7となる。一方,図20の例の場合,再符号化のためには,先頭のIピクチャと次のPピクチャの復号画像についても,参照画像としてメモリに保持しておく必要がある。最大ピクチャ間距離がGOP長と等しい場合と比較すると,図20のような場合に先頭のIピクチャと2番目のPピクチャの2のピクチャ分のDPBを追加で保持する必要があるが,入力バッファ510に保持すべきピクチャ数は3つ減る。すなわち,最大ピクチャ間距離が小さいほど参照画像のメモリ量が増えるが,入力バッファ510に格納すべきピクチャ数の減少量のほうが多いため,最大ピクチャ間距離を小さくすると必要メモリ量が減ることがわかる。
 また,H.264では,参照画像の動きベクトルを参照する場合があるため,これのためのメモリが必要な場合がある。その他,エンコーダの構成等に依存して必要なメモリを計算する。これらの総和が使用可能メモリ量以下にあるピクチャ間距離を求めて最大ピクチャ間距離を決定することになる。
 なお,本発明の実施にあたって,最大ピクチャ間距離決定部600に,外部から使用可能メモリ量を通知して最大ピクチャ間距離を計算するのではなく,外部で最大ピクチャ間距離を計算して,最大ピクチャ間距離決定部600に与えるようにしてもよい。
 最大ピクチャ間距離決定部600は,決定した最大ピクチャ間距離情報をリトライポイント管理部560に通知する。
 入力バッファ510は,入力される映像信号を蓄積するとともに,符号化部520に符号化対象の映像信号を出力する。さらに,入力バッファ510は,後述のCPB管理部540から,CPBアンダーフローが生じ,再符号化を行うことを示す情報(リトライ情報)を受けた場合,リトライポイント管理部560から通知されたリトライポイントのピクチャから映像信号を再度,符号化部520に出力する。また,入力バッファ510は,リトライポイント管理部560からリトライポイント情報を通知されると,蓄積していたリトライポイント以前のピクチャに対応する映像信号のデータを破棄する。
 符号化部520は,入力バッファ510から入力された映像信号を符号化し,符号化ストリームを出力バッファ530に出力する。また,符号化部520は,ピクチャの符号化が完了したときに,入力された映像信号を符号化した際に発生した符号量(符号量情報)をCPB管理部540に出力するとともに,リトライポイント管理部560にピクチャの符号化が完了したこと示す情報(符号化完了ピクチャ情報)を出力する。さらに,符号化部520は,CPB管理部540からリトライ情報を受けた場合,符号化中のGOPにおけるリトライポイントのピクチャからの映像信号が入力バッファ510から再度入力されるとともに,パラメータ調整部550から再符号化用符号化パラメータが入力されるため,入力された再符号化用符号化パラメータを利用して再符号化を行う。
 出力バッファ530は,GOPの符号化結果である符号化ストリームを蓄積するとともに,リトライポイント管理部560からリトライポイント情報を通知されると,それまでに蓄積していたリトライポイント以前のピクチャに対応する符号化ストリームを出力し,そのデータを出力バッファ530から取り除く。また,CPB管理部540からリトライ情報を受けた場合,符号化中のGOPについて蓄積した符号化ストリームを破棄する。
 CPB管理部540は,符号化部520から入力される符号量情報を利用して,時刻とともに変化するCPBの残符号量を求める。すなわち,図1の概念図で示したCPBの残符号量を求める。そして,CPBアンダーフローが生じた場合,リトライ情報を入力バッファ510,符号化部520,パラメータ調整部550,出力バッファ530に出力し,CPBアンダーフローが生じたことを通知する。
 パラメータ調整部550は,CPB管理部540からリトライ情報を受けた場合,前述のように再符号化用符号化パラメータを符号化部520に入力する。これにより,符号化部520は,再符号化時には,同じGOPについて,発生符号量が小さくなる符号化パラメータを用いて符号化をすることになる。
 リトライポイント管理部560は,符号化完了ピクチャ情報および最大ピクチャ間距離情報に基づき,次のピクチャの符号化でCPBアンダーフローが生じた場合に,どこがリトライポイントになるかを示すリトライポイント情報を,入力バッファ510,出力バッファ530に通知する。
 本実施例における符号化処理の流れについて,図17のフローチャートに沿って説明する。以下の説明では,S501,S502,…といったように,文章中に図17のフローチャートとの対応を記載する。
 あるGOPの符号化を行う処理について,以下のように3つのケースに場合分けをして説明する。
・[ケース1]:GOPの符号化においてCPBアンダーフローが発生しなかった。
・[ケース2]:GOPの符号化においてCPBアンダーフローが発生し,再符号化で回避できた。
・[ケース3]:GOPの符号化においてCPBアンダーフローが発生し,再符号化でも回避できなかった。
 [ケース1の処理例]
 まず,GOPの符号化においてCPBアンダーフローが発生しなかった場合のケース1について説明する。GOPのピクチャが入力バッファ510に入力されると,入力バッファ510は当該ピクチャを蓄積するとともに,符号化部520に当該ピクチャを符号化対象ピクチャとして入力する(S501)。そして,符号化部520は当該ピクチャを符号化し,出力バッファ530に符号化ストリームを出力するとともに(出力バッファ530は当該符号化ストリームは出力せず,蓄積する),当該ピクチャに関するCPB管理部540に符号量情報を出力する。また,リトライポイント管理部560に,符号化完了ピクチャ情報を出力する(S502)。
 ここで,符号化においてはデフォルト符号化パラメータが利用され,デフォルト符号化パラメータに対応したプレフィルタ強度で符号化対象ピクチャに,プレフィルタ部521によるフィルタリング処理が適用され,本ピクチャで発生したDCT係数は,デフォルト符号化パラメータに従った量子化パラメータで,量子化部522により量子化される。
 CPB管理部540は,当該ピクチャについて,符号化部520から入力された符号量情報をもとにCPB残符号量を計算し,この例ではCPBアンダーフローが発生しないため,リトライ情報の出力はしない(S503)。符号化対象ピクチャが入力映像信号中の最終ピクチャであれば,出力バッファ530は蓄積している符号化ストリームを出力し,符号化処理が完了する(S504)。あるいは,符号化対象ピクチャがGOPの最終ピクチャであれば,出力バッファ530は蓄積していた符号化ストリームを出力するとともに,入力バッファ510は蓄積していたピクチャを破棄し,次のGOPの最初のピクチャの符号化処理に移る(S505)。ここで,当該GOPでは再符号化が生じなかったため,符号化パラメータに変更を加えずに,次のGOPの最初のピクチャの符号化処理に移る(S506)。
 [ケース2の処理例]
 次に,GOPの符号化においてCPBアンダーフローが発生し,再符号化で回避できた場合のケース2について説明する。GOPのピクチャが入力バッファ510に入力されると,入力バッファ510は当該ピクチャを蓄積するとともに,符号化部520に当該ピクチャを符号化対象ピクチャとして入力する(S501)。そして,符号化部520は当該ピクチャを符号化し,出力バッファ530に符号化ストリームを出力するとともに(出力バッファ530は当該符号化ストリームは出力せず,蓄積する),当該ピクチャに関するCPB管理部540に符号量情報を出力する(S502)。ここで,符号化においてはデフォルト符号化パラメータが利用される。
 CPB管理部540は,当該ピクチャについて,符号化部520から入力された符号量情報をもとにCPB残符号量を計算する。この結果,当該ピクチャについて,CPB管理部540がCPBアンダーフローを検知した場合,CPB管理部540は,符号化部520,パラメータ調整部550,入力バッファ510,出力バッファ530にリトライ情報を出力する(S503)。
 符号化中のGOPについてまだリトライが発生していない場合(S507),入力バッファ510は,蓄積していた符号化中のGOPにおけるリトライポイントが示す位置のピクチャを符号化部520に出力するとともに(S508),パラメータ調整部550は,符号化部520に再符号化用符号化パラメータを出力する(S509)。さらに,出力バッファ530は,符号化中のGOPの符号化ストリームを破棄する。そして,符号化部520は,再符号化用符号化パラメータを利用して入力されたリトライポイント以降のピクチャを符号化する。
 ここで,符号化においては再符号化用符号化パラメータが利用され,再符号化用符号化パラメータに対応したプレフィルタ強度(デフォルト符号化パラメータよりぼかし度合いが大きい)で符号化対象ピクチャに,プレフィルタ部521によるプレフィルタリング処理が適用され,本ピクチャで発生したDCT係数は,再符号化用符号化パラメータに従った量子化パラメータ(デフォルト符号化パラメータより量子化ステップサイズが大きい)で,量子化部522により量子化される。
 この後,CPBアンダーフローが生じない限り,当該GOPのピクチャが順次入力バッファ510から符号化部520に入力され,符号化部520により符号化処理が行われる。そして,GOPの最終ピクチャが符号化が完了した場合(S505),出力バッファ530から当該GOPの符号化ストリームが出力されるとともに,符号化部520は符号化パラメータをデフォルト符号化パラメータに設定し(S506),次のGOPの符号化処理に進む。なお,入力映像の最終ピクチャの符号化が完了した場合の動作は前述のケース1の場合と同様に動作する。
 再符号化が行われた際の符号化パラメータの変更の概念図を図7に示す。第1の実施例と同様に、図7の例では,2番目のGOP2の6ピクチャ目の符号化でCPBアンダーフローが発生したので,発生符号量を抑制する再符号化用符号化パラメータを設定して,最大ピクチャ間距離の範囲内のGOP2の先頭のIピクチャから再符号化している。再符号化によりCPBアンダーフローの発生が抑止されたので,次のGOP3の符号化では,再符号化用符号化パラメータをデフォルト符号化パラメータに戻し,符号化処理を続ける。
 再符号化が行われた際のCPB残符号量の遷移の概念図を図8に示す。第1~第4の実施例と同様に、太線で示した線が再符号化後のCPB残符号量である。再符号化では,プレフィルタでぼかし度合いを強め,量子化パラメータもデフォルト符号化パラメータよりも大きくするため,発生符号量が抑えられ,例えば図8のような遷移が行われ,CPBアンダーフローが抑制される。
 図21は,リトライポイントを最大ピクチャ間距離で制限することによる入力バッファと出力バッファとのメモリ削減を説明する図である。本実施例によりリトライポイントを設定する場合を「ケースA」として説明する。例えば,本実施例とは異なり,CPBアンダーフローが発生したときに再符号化を開始するピクチャを,常に符号化順ピクチャ群(例えばGOP)の先頭ピクチャとすることも考えられる。これを「ケースB」という。ケースAとケースBとを比較すると,例えばケースAでは,現在符号化しているピクチャが,図21に示すようにGOP2’の9番目のPピクチャであり,最大ピクチャ間距離が「5」であったとすると,リトライポイントはGOP2’の4番目のピクチャ(Pピクチャ)となり,それ以前のGOP2’の先頭から3ピクチャA21は,再符号化に用いないため,これらのピクチャに対応した入力バッファ510および出力バッファ530のデータは,保持しておく必要がなくなる(破棄可能)。これに対して,ケースBのような場合には,GOP2’の先頭ピクチャからGOP2の符号化が完了するまで,入力バッファ510および出力バッファ530に,これらのピクチャに対応するデータを保持しておく必要があるため,必要となるメモリ量が増加する。本実施例(ケースA)では,最大ピクチャ間距離を算出してリトライポイントを設定するため,ケースBよりもメモリ量を削減することができる。
 [ケース3の処理例]
 最後に,GOPの符号化においてCPBアンダーフローが発生し,再符号化でも回避できなかった場合のケース3について説明する。この場合,CPB管理部540によりCPBアンダーフローが検知され,GOPの再符号化を行う動作はケース2と同様である。このGOPの再符号化中にCPBアンダーフローが生じた場合,符号化を完了する(S507)。なお,符号化を完了するのでなく,コマ落としを許容し,符号化を完了しないで,CPBアンダーフローが生じたピクチャの符号化データを破棄し,次のピクチャを符号化するように処理してもよい。
 以上説明した第1~第5実施例に係る動画像符号化制御の処理は,コンピュータとソフトウェアプログラムとによっても実現することができ,そのプログラムをコンピュータ読み取り可能な記録媒体に記録することも,ネットワークを通して提供することも可能である。
 本発明は,映像信号を符号化するための動画像符号化技術に適用することができ、仮想デコーダにおける符号化ピクチャバッファ等の仮想バッファのアンダーフローが生じないように,かつ符号化した動画像の画質を改善することができる。
 110,210,310,410,510 入力バッファ
 120,220,320,420,520 符号化部
 121,221,321,421,521 プレフィルタ部
 122,222,322,422,522 量子化部
 130,230,330,430,530 出力バッファ
 140,240,340,440,540 CPB管理部
 150,260,370,470,550 パラメータ調整部
 250,350, リトライカウント管理部
 360,450, CPB状態予測部
 460,560 リトライポイント管理部
 600 最大ピクチャ間距離決定部

Claims (16)

  1.  デコーダにおける仮想バッファが破綻しないように発生符号量を制御して入力映像信号を符号化する動画像符号化制御方法であって,
     所定数のピクチャで構成され,符号化順で連続するピクチャの集まりである符号化順ピクチャ群の各ピクチャについて,所定の符号化パラメータに従って順次符号化するステップと,
     前記各ピクチャの符号化において発生した符号量情報をもとに,前記仮想バッファにアンダーフローが発生したか否かを検査するステップと,
     前記仮想バッファにアンダーフローが発生した場合に,前記符号化パラメータを符号化による発生符号量が減少するように変更し,符号化中の前記符号化順ピクチャ群の先頭のピクチャから変更後の符号化パラメータを用いて再符号化するステップと
     を有する動画像符号化制御方法。
  2.  請求項1記載の動画像符号化制御方法において、
     前記順次符号化するステップでは、前記符号化順ピクチャ群の各ピクチャを,再符号化回数を示すリトライカウントに応じて設定された符号化パラメータに従って順次符号化し,
     前記再符号化するステップでは、前記仮想バッファにアンダーフローが発生した場合に,前記リトライカウントを増加させ,前記符号化パラメータを前記リトライカウントの値が大きいほど符号化による発生符号量が減少する符号化パラメータに変更する
     動画像符号化制御方法。
  3.  請求項2記載の動画像符号化制御方法において、
     前記符号化順ピクチャ群の最終のピクチャの符号化が完了するまで,前記仮想バッファにアンダーフローが発生しなかった場合に,前記仮想バッファの残符号量を調べ,前記残符号量が所定の残符号量閾値未満または前記リトライカウントが0であれば,前記リトライカウントの値を変更せず,前記残符号量が前記残符号量閾値以上かつ前記地露来カウントが0でなければ,前記リトライカウントを減少させるステップを有する
     動画像符号化制御方法。
  4.  請求項2記載の動画像符号化制御方法において,
     前記符号化順ピクチャ群における最終ピクチャの符号化が完了するまで,前記仮想バッファにアンダーフローが発生しなかった場合に,前記リトライカウントを減少させるステップを有する
     動画像符号化制御方法。
  5.  請求項2から請求項4までのいずれか1項に記載の動画像符号化制御方法において,
     前記符号化パラメータは,量子化パラメータもしくは前記入力映像信号に対するプレフィルタのフィルタ強度,またはその双方であり,前記符号化パラメータが前記量子化パラメータの場合には,前記リトライカウントの値が大きいほど,量子化パラメータのステップサイズが大きい符号化パラメータが設定され,前記符号化パラメータが前記プレフィルタの前記フィルタ強度の場合には,前記リトライカウントの値が大きいほど,フィルタリング処理によるぼかし度合いが大きい符号化パラメータが設定される
     動画像符号化制御方法。
  6.  デコーダにおける仮想バッファが破綻しないように発生符号量を制御して入力映像信号を符号化する動画像符号化制御方法であって,
     画面内予測符号化ピクチャを先頭とする所定のピクチャ数で構成され,符号化順で連続するピクチャの集まりである符号化順ピクチャ群の各ピクチャについて,所定の符号化パラメータに従って順次符号化するステップと,
     前記各ピクチャの符号化において発生した符号量情報をもとに,前記仮想バッファにアンダーフローが発生したか否かを検査するステップと,
     前記仮想バッファにアンダーフローが発生した場合に,前記符号化パラメータを符号化による発生符号量が減少するように変更し,リトライポイントとして設定された前記符号化順ピクチャ群の先頭のピクチャから変更後の符号化パラメータを用いて再符号化するステップと,
     前記符号化順ピクチャ群の符号化が完了したときに,前記仮想バッファの残符号量を調べ,前記残符号量が所定の残符号量閾値以上であれば,前記リトライポイントを次の符号化順ピクチャ群の先頭ピクチャに設定し,前記仮想バッファの前記残符号量が前記所定の残符号量閾値未満であれば,前記リトライポイントを変更せず,前記次の符号化順ピクチャ群の前記先頭ピクチャの符号化が前記仮想バッファのアンダーフローを生じさせないで完了した後に,前記リトライポイントを当該符号化順ピクチャ群の先頭ピクチャに設定するステップと
    を有する動画像符号化制御方法。
  7.  デコーダにおける仮想バッファが破綻しないように発生符号量を制御して入力映像信号を符号化する動画像符号化制御方法であって,
     所定数のピクチャで構成され,符号化順で連続するピクチャの集まりである符号化順ピクチャ群の各ピクチャについて,所定の符号化パラメータに従って順次符号化するステップと,
     前記各ピクチャの符号化において発生した符号量情報をもとに,前記仮想バッファにアンダーフローが発生したか否かを検査するステップと,
     前記仮想バッファにアンダーフローが発生した場合に,前記符号化パラメータを符号化による発生符号量が減少するように変更し,符号化中の前記符号化順ピクチャ群においてリトライポイントとして設定されたピクチャから変更後の符号化パラメータを用いて再符号化するステップと,
     再符号化時に,再符号化対象のピクチャとして遡ることができる最大のピクチャ数である最大ピクチャ間距離をもとに,前記再符号化を開始するピクチャの位置を示すリトライポイントを設定するステップと
     を有する動画像符号化制御方法。
  8.  請求項1、請求項6または請求項7に記載の動画像符号化制御方法において,
     前記符号化順ピクチャ群の再符号化において当該符号化順ピクチャ群の最終のピクチャの符号化が完了するまで,前記仮想バッファにアンダーフローが発生しなかった場合に,次の符号化順ピクチャ群の符号化に用いる符号化パラメータを,通常の符号化時の符号化パラメータ値に戻す
     動画像符号化制御方法。
  9.  請求項1、請求項6または請求項7に記載の動画像符号化制御方法において,
     前記符号化順ピクチャ群の再符号化において,当該符号化順ピクチャ群の最終のピクチャの符号化が完了するまで前記仮想バッファにアンダーフローが発生しなかった場合に,前記仮想バッファの残符号量を調べ,前記残符号量が所定の残符号量閾値未満であれば,次の符号化順ピクチャ群の符号化に用いる符号化パラメータを変更せず,前記残符号量が前記所定の残符号量閾値以上であれば,前記符号化パラメータを通常の符号化時の符号化パラメータ値に戻す
     動画像符号化制御方法。
  10.  請求項1、および請求項6から請求項9までのいずれか1項に記載の動画像符号化制御方法において,
     前記符号化パラメータは,量子化パラメータもしくは前記入力映像信号に対するプレフィルタのフィルタ強度,またはその双方であり,前記符号化順ピクチャ群の再符号化時において,前記符号化パラメータが前記量子化パラメータの場合には,再符号化時に量子化パラメータのステップサイズを大きくし,前記符号化パラメータが前記プレフィルタの前記フィルタ強度の場合には,フィルタリング処理によるぼかし度合いを大きく符号化パラメータの変更を行う
     動画像符号化制御方法。
  11.  デコーダにおける仮想バッファが破綻しないように発生符号量を制御して入力映像信号を符号化する動画像符号化装置であって,
     所定数のピクチャで構成され,符号化順で連続するピクチャの集まりである符号化順ピクチャ群の各ピクチャについて,所定の符号化パラメータに従って順次符号化する符号化部と,
     前記各ピクチャの符号化において発生した符号量情報をもとに,前記仮想バッファにアンダーフローが発生したか否かを検査し,前記仮想バッファにアンダーフローが発生したことを検出した場合にリトライ情報を出力するバッファ管理部と,
     前記リトライ情報が出力された場合に,前記符号化パラメータを符号化による発生符号量が減少するように変更し,変更された符号化パラメータを前記符号化部へ通知するパラメータ調整部とを備え,
     前記符号化部は,前記リトライ情報が出力された場合に,符号化中の前記符号化順ピクチャ群の先頭のピクチャから,前記パラメータ調整部が変更した符号化パラメータを用いて前記入力映像信号を再符号化する
     動画像符号化装置。
  12.  請求項11記載の動画像符号化装置において、
     前記符号化部は、前記符号化順ピクチャ群の各ピクチャを,再符号化回数を示すリトライカウントに応じて設定された符号化パラメータに従って順次符号化し,
     前記動画像符号化装置は、前記リトライ情報が出力された場合に,前記リトライカウントを増加させ,前記符号化順ピクチャ群における最終ピクチャの符号化が完了するまでに前記リトライ情報が出力されなかった場合に,前記リトライカウントを減少させるリトライカウント管理部を備え,
     前記パラメータ調整部は、前記リトライカウントに応じて定められた,前記リトライカウントの値が大きいほど符号化による発生符号量が減少する符号化パラメータを設定し,設定された符号化パラメータを前記符号化部へ通知する
     動画像符号化装置。
  13.  請求項12に記載の動画像符号化装置において、
     前記仮想バッファにアンダーフローが発生しないで,前記符号化順ピクチャ群における最終ピクチャの符号化が完了した場合に,前記仮想バッファの残符号量を調べ,前記残符号量が所定の残符号量閾値以上か否かによりパラメータ変更要またはパラメータ変更不要を示すパラメータ変更有無情報を出力するバッファ状態予測部を備え,
     前記リトライカウント管理部は、前記バッファ状態予測部からパラメータ変更有無情報を入力した場合に,前記パラメータ変更有無情報がパラメータ変更不要を示すかまたは前記リトライカウントが0であれば,前記リトライカウントの値を変更せず,前記パラメータ変更有無情報がパラメータ変更要を示しかつ前記リトライカウントが0でなければ,前記リトライカウントを減少させる
     動画像符号化装置。
  14.  デコーダにおける仮想バッファが破綻しないように発生符号量を制御して入力映像信号を符号化する動画像符号化装置であって,
     所定数のピクチャで構成され,符号化順で連続するピクチャの集まりである符号化順ピクチャ群の各ピクチャについて,所定の符号化パラメータに従って順次符号化する符号化部と,
     前記各ピクチャの符号化において発生した符号量情報をもとに,前記仮想バッファにアンダーフローが発生したか否かを検査し,前記仮想バッファにアンダーフローが発生したことを検出した場合にリトライ情報を出力するバッファ管理部と,
     前記リトライ情報が出力された場合に,前記符号化パラメータを符号化による発生符号量が減少するように変更し,変更された符号化パラメータを前記符号化部へ通知するパラメータ調整部と,
     前記符号化順ピクチャ群の符号化が完了したときに,前記仮想バッファの残符号量を調べ,前記残符号量が所定の残符号量閾値以上であるか否かを判定するバッファ状態予測部と,
     前記バッファ状態予測部の判定結果に従って,前記仮想バッファの前記残符号量が前記所定の残符号量閾値以上であれば,前記リトライポイントを次の符号化順ピクチャ群の先頭ピクチャに設定し,前記仮想バッファの前記残符号量が所定の残符号量閾値未満であれば,前記リトライポイントを変更せず,次の符号化順ピクチャ群の先頭ピクチャの符号化が前記仮想バッファのアンダーフローを生じさせないで完了した後に,前記リトライポイントを当該符号化順ピクチャ群の先頭ピクチャに設定するリトライポイント管理部とを備え,
     前記符号化部は,前記リトライ情報が出力された場合に,前記リトライポイントとして設定された符号化順ピクチャ群の先頭のピクチャから,前記パラメータ調整部が変更した符号化パラメータを用いて前記入力映像信号を再符号化する
     動画像符号化装置。
  15.  デコーダにおける仮想バッファが破綻しないように発生符号量を制御して入力映像信号を符号化する動画像符号化装置であって,
     所定数のピクチャで構成され,符号化順で連続するピクチャの集まりである符号化順ピクチャ群の各ピクチャについて,所定の符号化パラメータに従って順次符号化する符号化部と,
     前記各ピクチャの符号化において発生した符号量情報をもとに,前記仮想バッファにアンダーフローが発生したか否かを検査し,前記仮想バッファにアンダーフローが発生したことを検出した場合にリトライ情報を出力するバッファ管理部と,
     前記リトライ情報が出力された場合に,前記符号化パラメータを符号化による発生符号量が減少するように変更し,変更された符号化パラメータを前記符号化部へ通知するパラメータ調整部と,
     再符号化時に,再符号化対象のピクチャとして遡ることができる最大のピクチャ数である最大ピクチャ間距離をもとに,前記再符号化を開始するピクチャの位置を示すリトライポイントを設定するリトライポイント管理部とを備え,
     前記符号化部は,前記リトライ情報が出力された場合に,符号化中の符号化順ピクチャ群において前記リトライポイントとして設定されたピクチャから,前記パラメータ調整部が変更した符号化パラメータを用いて前記入力映像信号を再符号化する
     動画像符号化装置。
  16.  請求項1から請求項10までのいずれか1項に記載の動画像符号化制御方法を,コンピュータに実行させるための動画像符号化プログラム。
PCT/JP2011/060364 2010-05-07 2011-04-28 動画像符号化制御方法,動画像符号化装置および動画像符号化プログラム WO2011138923A1 (ja)

Priority Applications (9)

Application Number Priority Date Filing Date Title
US13/695,700 US9179165B2 (en) 2010-05-07 2011-04-28 Video encoding control method, video encoding apparatus and video encoding program
RU2012146537/08A RU2530313C2 (ru) 2010-05-07 2011-04-28 Способ управления кодированием видео, устройство кодирования видео и программа кодирования видео
BR112012028184A BR112012028184A2 (pt) 2010-05-07 2011-04-28 método de controle de codificação de vídeo, aparelho de codificação de vídeo e programa de codificação de vídeo
CA2798012A CA2798012A1 (en) 2010-05-07 2011-04-28 Video encoding to prevent decoder buffer underflow by re-encoding selected pictures in a video sequence using a retry count or a retry point
CN201180022113.6A CN102986212B (zh) 2010-05-07 2011-04-28 活动图像编码控制方法、活动图像编码装置
ES11777442T ES2703005T3 (es) 2010-05-07 2011-04-28 Método de control de codificación de imágenes animadas, aparato de codificación de imágenes animadas y programa de codificación de imágenes animadas
EP11777442.2A EP2568705B1 (en) 2010-05-07 2011-04-28 Moving image encoding control method, moving image encoding apparatus and moving image encoding program
JP2012513813A JP5295429B2 (ja) 2010-05-07 2011-04-28 動画像符号化制御方法,動画像符号化装置および動画像符号化プログラム
KR1020127028798A KR101389919B1 (ko) 2010-05-07 2011-04-28 동화상 부호화 제어 방법, 동화상 부호화 장치 및 동화상 부호화 프로그램

Applications Claiming Priority (10)

Application Number Priority Date Filing Date Title
JP2010106851 2010-05-07
JP2010106853 2010-05-07
JP2010106854 2010-05-07
JP2010-106855 2010-05-07
JP2010106855 2010-05-07
JP2010-106852 2010-05-07
JP2010-106851 2010-05-07
JP2010-106853 2010-05-07
JP2010106852 2010-05-07
JP2010-106854 2010-05-07

Publications (1)

Publication Number Publication Date
WO2011138923A1 true WO2011138923A1 (ja) 2011-11-10

Family

ID=44903775

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/060364 WO2011138923A1 (ja) 2010-05-07 2011-04-28 動画像符号化制御方法,動画像符号化装置および動画像符号化プログラム

Country Status (11)

Country Link
US (1) US9179165B2 (ja)
EP (1) EP2568705B1 (ja)
JP (1) JP5295429B2 (ja)
KR (1) KR101389919B1 (ja)
CN (1) CN102986212B (ja)
BR (1) BR112012028184A2 (ja)
CA (1) CA2798012A1 (ja)
ES (1) ES2703005T3 (ja)
RU (1) RU2530313C2 (ja)
TW (1) TWI483617B (ja)
WO (1) WO2011138923A1 (ja)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100303155A1 (en) * 2008-01-29 2010-12-02 Yuki Maruyama Image coding device, image coding method, image coding integrated circuit and image coding program
US20140037005A1 (en) * 2012-08-02 2014-02-06 Penne Y. LEE Transcoding video data
US9374585B2 (en) * 2012-12-19 2016-06-21 Qualcomm Incorporated Low-delay buffering model in video coding
CN104243984B (zh) * 2013-06-19 2017-09-19 晨星半导体股份有限公司 应用于数字音视频编解码技术标准系统的解码方法及解码装置
US9524249B2 (en) * 2014-12-23 2016-12-20 Intel Corporation Memory encryption engine integration
CN112738509B (zh) * 2021-03-30 2021-07-09 浙江华创视讯科技有限公司 视频编码方法、视频解码方法、存储介质以及电子设备
CN115103190A (zh) * 2022-06-14 2022-09-23 晶晨芯半导体(成都)有限公司 编码器码率控制方法及模块、芯片、电子设备和存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10304311A (ja) * 1997-04-23 1998-11-13 Matsushita Electric Ind Co Ltd 映像符号化装置及び映像復号化装置
JP2003018603A (ja) 2001-06-29 2003-01-17 Toshiba Corp 動画像符号化方法及び装置
JP2006295535A (ja) 2005-04-11 2006-10-26 Toshiba Corp 動画像符号化装置および方法
JP2008109259A (ja) * 2006-10-24 2008-05-08 Victor Co Of Japan Ltd 動画像符号化装置及び動画像符号化プログラム
JP2008258858A (ja) * 2007-04-04 2008-10-23 Victor Co Of Japan Ltd 動画像符号化装置
JP2009260595A (ja) * 2008-04-16 2009-11-05 Nippon Telegr & Teleph Corp <Ntt> 量子化マトリクス切り換え方法,映像符号化装置,映像符号化プログラムおよびその記録媒体

Family Cites Families (119)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5136371A (en) 1990-03-15 1992-08-04 Thomson Consumer Electronics, Inc. Digital image coding using random scanning
US5134476A (en) * 1990-03-30 1992-07-28 At&T Bell Laboratories Video signal encoding with bit rate control
US5461420A (en) * 1992-09-18 1995-10-24 Sony Corporation Apparatus for coding and decoding a digital video signal derived from a motion picture film source
US5786858A (en) * 1993-01-19 1998-07-28 Sony Corporation Method of encoding image signal, apparatus for encoding image signal, method of decoding image signal, apparatus for decoding image signal, and image signal recording medium
CA2137266C (en) 1993-04-09 2003-07-22 Tsuyoshi Oda Picture encoding method, picture encoding apparatus and picture recording medium
US5589884A (en) 1993-10-01 1996-12-31 Toko Kabushiki Kaisha Adaptive quantization controlled by scene change detection
JP3224465B2 (ja) 1993-12-22 2001-10-29 シャープ株式会社 画像符号化装置
KR950030491A (ko) 1994-04-30 1995-11-24 배순훈 부호화기
JP3911035B2 (ja) 1994-08-31 2007-05-09 ソニー株式会社 動画像符号化方法及び動画像符号化装置
ATE194742T1 (de) 1994-12-28 2000-07-15 Koninkl Philips Electronics Nv Pufferverwaltung in kompressionssystemen mit variabler bitrate
US5606369A (en) * 1994-12-28 1997-02-25 U.S. Philips Corporation Buffering for digital video signal encoders using joint bit-rate control
KR100203637B1 (ko) 1995-09-29 1999-06-15 전주범 동영상을 부호화하는 장치
KR0181067B1 (ko) 1995-10-31 1999-05-01 배순훈 호환성을 갖는 동영상 부호화기
JP4345024B2 (ja) 1996-04-12 2009-10-14 ソニー株式会社 画像符号化装置、画像符号化方法及び画像符号化プログラムを記録した記録媒体
EP0836329A4 (en) 1996-04-12 2002-09-04 Sony Corp IMAGE ENCODER, IMAGE ENCODING METHOD AND RECORDING MEDIUM FOR IMAGE ENCODING PROGRAM
US5864681A (en) 1996-08-09 1999-01-26 U.S. Robotics Access Corp. Video encoder/decoder system
US5805228A (en) 1996-08-09 1998-09-08 U.S. Robotics Access Corp. Video encoder/decoder system
US5831678A (en) 1996-08-09 1998-11-03 U.S. Robotics Access Corp. Video encoder/decoder system
US6072830A (en) 1996-08-09 2000-06-06 U.S. Robotics Access Corp. Method for generating a compressed video signal
JPH10210475A (ja) 1997-01-22 1998-08-07 Matsushita Electric Ind Co Ltd 画像符号化装置
US5982436A (en) * 1997-03-28 1999-11-09 Philips Electronics North America Corp. Method for seamless splicing in a video encoder
US6101195A (en) 1997-05-28 2000-08-08 Sarnoff Corporation Timing correction method and apparatus
JPH1118083A (ja) 1997-06-25 1999-01-22 Sony Corp ディジタル信号符号化方法及び装置、信号記録媒体並びに信号伝送方法
JPH11112601A (ja) 1997-10-07 1999-04-23 Oki Electric Ind Co Ltd 伝送品質の制御方法
US6301428B1 (en) 1997-12-09 2001-10-09 Lsi Logic Corporation Compressed video editor with transition buffer matcher
US6563549B1 (en) 1998-04-03 2003-05-13 Sarnoff Corporation Method and apparatus for adaptively encoding an information stream
US6167088A (en) 1998-04-03 2000-12-26 Sarnoff Corporation Method and apparatus for performing adaptive encoding rate control of a video information stream including 3:2 pull-down video information
US6859496B1 (en) * 1998-05-29 2005-02-22 International Business Machines Corporation Adaptively encoding multiple streams of video data in parallel for multiplexing onto a constant bit rate channel
US6310915B1 (en) * 1998-11-20 2001-10-30 Harmonic Inc. Video transcoder with bitstream look ahead for rate control and statistical multiplexing
JP2000209584A (ja) 1999-01-13 2000-07-28 Nec Eng Ltd こま落とし制御回路
US6493402B1 (en) * 1999-05-27 2002-12-10 Zenith Electronics Corporation Mode control for trellis decoder
US6529558B1 (en) * 1999-05-27 2003-03-04 Zenith Electronics Corporation Coding and decoding a signal modified in accordance with the feedback states of an encoder
KR100634660B1 (ko) 1999-09-13 2006-10-16 마츠시타 덴끼 산교 가부시키가이샤 부호화장치 및 부호화방법
GB2356998A (en) * 1999-12-02 2001-06-06 Sony Uk Ltd Video signal processing
US6754279B2 (en) 1999-12-20 2004-06-22 Texas Instruments Incorporated Digital still camera system and method
US20020135683A1 (en) 1999-12-20 2002-09-26 Hideo Tamama Digital still camera system and method
US6791609B2 (en) 1999-12-20 2004-09-14 Texas Instruments Incorporated Digital still camera system and method
US7330209B2 (en) 1999-12-20 2008-02-12 Texas Instruments Incorporated Digital still camera system and complementary-color-filtered array interpolation method
US6873658B2 (en) 1999-12-20 2005-03-29 Texas Instruments Incorporated Digital still camera system and method
US6933970B2 (en) 1999-12-20 2005-08-23 Texas Instruments Incorporated Digital still camera system and method
US6829016B2 (en) 1999-12-20 2004-12-07 Texas Instruments Incorporated Digital still camera system and method
US6678332B1 (en) 2000-01-04 2004-01-13 Emc Corporation Seamless splicing of encoded MPEG video and audio
US6792047B1 (en) 2000-01-04 2004-09-14 Emc Corporation Real time processing and streaming of spliced encoded MPEG video and associated audio
US6300973B1 (en) * 2000-01-13 2001-10-09 Meir Feder Method and system for multimedia communication control
US6522693B1 (en) 2000-02-23 2003-02-18 International Business Machines Corporation System and method for reencoding segments of buffer constrained video streams
US6674797B1 (en) 2000-03-30 2004-01-06 Lucent Technologies Inc. Ensuring video buffer verifer integrity in MPEG-like encoding
US6553150B1 (en) 2000-04-25 2003-04-22 Hewlett-Packard Development Co., Lp Image sequence compression featuring independently coded regions
JP3889552B2 (ja) 2000-06-09 2007-03-07 パイオニア株式会社 符号量割り当て装置および方法
US6647061B1 (en) 2000-06-09 2003-11-11 General Instrument Corporation Video size conversion and transcoding from MPEG-2 to MPEG-4
JP2002010261A (ja) 2000-06-16 2002-01-11 Nec Corp 画像符号化方式変換装置
US20050210145A1 (en) * 2000-07-24 2005-09-22 Vivcom, Inc. Delivering and processing multimedia bookmark
US20050193408A1 (en) * 2000-07-24 2005-09-01 Vivcom, Inc. Generating, transporting, processing, storing and presenting segmentation information for audio-visual programs
JP4428680B2 (ja) * 2000-11-06 2010-03-10 パナソニック株式会社 映像信号符号化方法および映像信号符号化装置
US6990144B2 (en) 2000-12-11 2006-01-24 Sony Corporation System and method for overrun catch-up in a real-time software
US20030222998A1 (en) 2000-12-20 2003-12-04 Satoru Yamauchi Digital still camera system and method
US7023924B1 (en) 2000-12-28 2006-04-04 Emc Corporation Method of pausing an MPEG coded video stream
EP1231793A1 (en) * 2001-02-09 2002-08-14 STMicroelectronics S.r.l. A process for changing the syntax, resolution and bitrate of MPEG bitstreams, a system and a computer program product therefor
EP1231794A1 (en) * 2001-02-09 2002-08-14 STMicroelectronics S.r.l. A process for changing the resolution of MPEG bitstreams, a system and a computer program product therefor
US8107524B2 (en) 2001-03-30 2012-01-31 Vixs Systems, Inc. Adaptive bandwidth footprint matching for multiple compressed video streams in a fixed bandwidth network
WO2002096120A1 (en) 2001-05-25 2002-11-28 Centre For Signal Processing, Nanyang Technological University Bit rate control for video compression
US6804301B2 (en) * 2001-08-15 2004-10-12 General Instrument Corporation First pass encoding of I and P-frame complexity for compressed digital video
US6950469B2 (en) 2001-09-17 2005-09-27 Nokia Corporation Method for sub-pixel value interpolation
JP4718736B2 (ja) 2001-09-17 2011-07-06 株式会社東芝 動画像符号化装置
JP3836701B2 (ja) 2001-10-10 2006-10-25 株式会社東芝 動画像を符号化する方法及び装置及びプログラム並びに動画像音声多重化の方法及び装置
US7356079B2 (en) * 2001-11-21 2008-04-08 Vixs Systems Inc. Method and system for rate control during video transcoding
KR100895727B1 (ko) 2001-11-30 2009-04-30 파나소닉 주식회사 스트림 변환 방법 및 장치, 데이터 기록 방법 및 장치와,데이터 기록매체
WO2004004359A1 (en) * 2002-07-01 2004-01-08 E G Technology Inc. Efficient compression and transport of video over a network
US8837605B2 (en) * 2006-09-26 2014-09-16 Onmobile Global Limited Method and apparatus for compressed video bitstream conversion with reduced-algorithmic-delay
US20040252758A1 (en) 2002-08-14 2004-12-16 Ioannis Katsavounidis Systems and methods for adaptively filtering discrete cosine transform (DCT) coefficients in a video encoder
MY134659A (en) 2002-11-06 2007-12-31 Nokia Corp Picture buffering for prediction references and display
US8054880B2 (en) 2004-12-10 2011-11-08 Tut Systems, Inc. Parallel rate control for digital video encoder with multi-processor architecture and picture-based look-ahead window
US7099389B1 (en) 2002-12-10 2006-08-29 Tut Systems, Inc. Rate control with picture-based lookahead window
WO2004105253A1 (ja) * 2003-05-21 2004-12-02 Sony Corporation データ処理装置、符号化装置および符号化方法、復号装置および復号方法、並びにプログラム
JP2005072742A (ja) 2003-08-21 2005-03-17 Sony Corp 符号化装置及び符号化方法
JP2005080004A (ja) 2003-09-01 2005-03-24 Sony Corp 動画像符号化装置
US8345754B2 (en) 2003-09-07 2013-01-01 Microsoft Corporation Signaling buffer fullness
US7839930B2 (en) * 2003-11-13 2010-11-23 Microsoft Corporation Signaling valid entry points in a video stream
US7724827B2 (en) * 2003-09-07 2010-05-25 Microsoft Corporation Multi-layer run level encoding and decoding
US7609762B2 (en) * 2003-09-07 2009-10-27 Microsoft Corporation Signaling for entry point frames with predicted first field
US7346106B1 (en) * 2003-12-30 2008-03-18 Apple Inc. Robust multi-pass variable bit rate encoding
US7453938B2 (en) 2004-02-06 2008-11-18 Apple Inc. Target bitrate estimator, picture activity and buffer management in rate control for video coder
US20050201471A1 (en) 2004-02-13 2005-09-15 Nokia Corporation Picture decoding method
KR20050090841A (ko) 2004-03-10 2005-09-14 엘지전자 주식회사 비트율 제어 방법
JP4418762B2 (ja) 2004-05-07 2010-02-24 キヤノン株式会社 画像符号化装置及び画像復号装置及びそれらの制御方法、並びに、コンピュータプログラム及びコンピュータ可読記憶媒体
JP3846488B2 (ja) 2004-05-10 2006-11-15 セイコーエプソン株式会社 画像データ圧縮装置、エンコーダ、電子機器及び画像データ圧縮方法
CN102833538B (zh) * 2004-06-27 2015-04-22 苹果公司 多通路视频编码
US8005139B2 (en) 2004-06-27 2011-08-23 Apple Inc. Encoding with visual masking
US8189679B2 (en) 2004-09-02 2012-05-29 Sony Corporation Content receiving apparatus, method of controlling video-audio output timing and content providing system
CN100579223C (zh) 2004-12-02 2010-01-06 索尼株式会社 编码装置和方法
US7543073B2 (en) 2004-12-10 2009-06-02 Microsoft Corporation System and process for performing an exponentially weighted moving average on streaming data to establish a moving average bit rate
JP2006180036A (ja) 2004-12-21 2006-07-06 Matsushita Electric Ind Co Ltd 動画符号化伝送制御装置および動画符号化伝送制御方法
US7983341B2 (en) 2005-02-24 2011-07-19 Ericsson Television Inc. Statistical content block matching scheme for pre-processing in encoding and transcoding
US20060256868A1 (en) * 2005-05-16 2006-11-16 Ensequence, Inc. Methods and systems for repositioning mpeg image content without recoding
JP4040052B2 (ja) 2005-05-24 2008-01-30 株式会社日立国際電気 画像データ圧縮装置
WO2007005750A2 (en) 2005-07-01 2007-01-11 Sonic Solutions Method, apparatus and system for use in multimedia signal encoding
US20070025441A1 (en) * 2005-07-28 2007-02-01 Nokia Corporation Method, module, device and system for rate control provision for video encoders capable of variable bit rate encoding
JP4492484B2 (ja) * 2005-08-22 2010-06-30 ソニー株式会社 情報処理装置および情報処理方法、記録媒体、並びに、プログラム
US8218655B2 (en) 2005-09-19 2012-07-10 Maxim Integrated Products, Inc. Method, system and device for improving video quality through in-loop temporal pre-filtering
US8879635B2 (en) * 2005-09-27 2014-11-04 Qualcomm Incorporated Methods and device for data alignment with time domain boundary
US8548048B2 (en) 2005-10-27 2013-10-01 Qualcomm Incorporated Video source rate control for video telephony
US8406309B2 (en) 2005-10-21 2013-03-26 Qualcomm Incorporated Video rate adaptation to reverse link conditions
US9071844B2 (en) 2005-12-16 2015-06-30 Texas Instruments Incorporated Motion estimation with motion vector penalty
US7826536B2 (en) * 2005-12-29 2010-11-02 Nokia Corporation Tune in time reduction
JP4254784B2 (ja) 2006-01-31 2009-04-15 Kddi株式会社 動画像符号化装置、方法及びプログラム
JP4795223B2 (ja) * 2006-01-31 2011-10-19 キヤノン株式会社 画像処理装置
JP4584871B2 (ja) * 2006-06-09 2010-11-24 パナソニック株式会社 画像符号化記録装置および画像符号化記録方法
US7804435B2 (en) 2006-08-31 2010-09-28 Ati Technologies Ulc Video decoder with reduced power consumption and method thereof
US9582060B2 (en) 2006-08-31 2017-02-28 Advanced Silicon Technologies Llc Battery-powered device with reduced power consumption based on an application profile data
US8711929B2 (en) * 2006-11-01 2014-04-29 Skyfire Labs, Inc. Network-based dynamic encoding
US20080120676A1 (en) 2006-11-22 2008-05-22 Horizon Semiconductors Ltd. Integrated circuit, an encoder/decoder architecture, and a method for processing a media stream
KR100846512B1 (ko) 2006-12-28 2008-07-17 삼성전자주식회사 영상의 부호화, 복호화 방법 및 장치
CA2679764C (en) 2007-03-14 2014-02-04 Nippon Telegraph And Telephone Corporation Quantization control method and apparatus, program therefor, and storage medium which stores the program
JP2008252562A (ja) 2007-03-30 2008-10-16 Renesas Technology Corp 動画像符号化制御方法および動画像符号化装置
US20090161766A1 (en) * 2007-12-21 2009-06-25 Novafora, Inc. System and Method for Processing Video Content Having Redundant Pixel Values
JP4577357B2 (ja) * 2007-12-27 2010-11-10 ソニー株式会社 符号化装置及び方法、並びにプログラム
US8411168B2 (en) 2008-09-16 2013-04-02 Panasonic Corporation Imaging apparatus and video data creating method
WO2010097946A1 (ja) * 2009-02-27 2010-09-02 富士通株式会社 動画像符号化装置、動画像符号化方法及び動画像符号化用コンピュータプログラム
TWI387314B (zh) 2009-03-10 2013-02-21 Univ Nat Central Image processing apparatus and method thereof
US8879623B2 (en) 2009-09-02 2014-11-04 Sony Computer Entertainment Inc. Picture-level rate control for video encoding a scene-change I picture

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10304311A (ja) * 1997-04-23 1998-11-13 Matsushita Electric Ind Co Ltd 映像符号化装置及び映像復号化装置
JP2003018603A (ja) 2001-06-29 2003-01-17 Toshiba Corp 動画像符号化方法及び装置
JP2006295535A (ja) 2005-04-11 2006-10-26 Toshiba Corp 動画像符号化装置および方法
JP2008109259A (ja) * 2006-10-24 2008-05-08 Victor Co Of Japan Ltd 動画像符号化装置及び動画像符号化プログラム
JP2008258858A (ja) * 2007-04-04 2008-10-23 Victor Co Of Japan Ltd 動画像符号化装置
JP2009260595A (ja) * 2008-04-16 2009-11-05 Nippon Telegr & Teleph Corp <Ntt> 量子化マトリクス切り換え方法,映像符号化装置,映像符号化プログラムおよびその記録媒体

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
KADONO; KIKUCHI; SUZUKI: "H.264/AVC Textbook, Third revised Version", 2009, IMPRESS R & D, pages: 189 - 191
OKUTOMI; OZAWA; SHIMIZU; HORI: "Digital Image Processing", 2006, CORPORATION PICTURE INFORMATION EDUCATION ADVANCEMENT ASSOCIATION, pages: 108 - 110
See also references of EP2568705A4 *

Also Published As

Publication number Publication date
BR112012028184A2 (pt) 2016-08-02
TWI483617B (zh) 2015-05-01
EP2568705A1 (en) 2013-03-13
TW201210347A (en) 2012-03-01
CN102986212A (zh) 2013-03-20
RU2530313C2 (ru) 2014-10-10
JP5295429B2 (ja) 2013-09-18
RU2012146537A (ru) 2014-06-20
EP2568705B1 (en) 2018-09-26
EP2568705A4 (en) 2014-04-09
US20130051456A1 (en) 2013-02-28
ES2703005T3 (es) 2019-03-06
KR20130028093A (ko) 2013-03-18
US9179165B2 (en) 2015-11-03
CN102986212B (zh) 2015-11-25
JPWO2011138923A1 (ja) 2013-07-22
CA2798012A1 (en) 2011-11-10
KR101389919B1 (ko) 2014-04-30

Similar Documents

Publication Publication Date Title
JP5286581B2 (ja) 動画像符号化制御方法,動画像符号化装置および動画像符号化プログラム
JP5295429B2 (ja) 動画像符号化制御方法,動画像符号化装置および動画像符号化プログラム
CN109862359B (zh) 基于分层b帧的码率控制方法、装置和电子设备
US8189660B2 (en) Bit rate control method and apparatus
US9706203B2 (en) Low latency video encoder
US8891892B2 (en) Image encoding method using adaptive preprocessing scheme
KR102424258B1 (ko) 비디오를 인코딩하기 위한 방법 및 인코더 시스템
JP2006295535A (ja) 動画像符号化装置および方法
JP2006352198A (ja) 画像符号化装置及び画像符号化プログラム
JP4942208B2 (ja) 符号化装置
WO2020008858A1 (ja) 動画像符号化装置、動画像符号化方法、プログラム
JP2009246489A (ja) 映像信号切替装置
JP2007020216A (ja) 符号化装置、符号化方法、フィルタ処理装置およびフィルタ処理方法
JP4762860B2 (ja) 動画像符号化装置
WO2013073422A1 (ja) 動画像符号化装置
JP4390009B2 (ja) 符号化装置及び方法、画像処理システム
JP2006352636A (ja) 動画像符号化装置
JP2007006533A (ja) 符号化装置、符号化方法、フィルタ処理装置およびフィルタ処理方法

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180022113.6

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11777442

Country of ref document: EP

Kind code of ref document: A1

DPE2 Request for preliminary examination filed before expiration of 19th month from priority date (pct application filed from 20040101)
WWE Wipo information: entry into national phase

Ref document number: 2012513813

Country of ref document: JP

ENP Entry into the national phase

Ref document number: 2798012

Country of ref document: CA

WWE Wipo information: entry into national phase

Ref document number: 2011777442

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 9260/CHENP/2012

Country of ref document: IN

ENP Entry into the national phase

Ref document number: 20127028798

Country of ref document: KR

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 13695700

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2012146537

Country of ref document: RU

Kind code of ref document: A

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112012028184

Country of ref document: BR

ENP Entry into the national phase

Ref document number: 112012028184

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20121101