JP4293175B2 - Code amount control method - Google Patents

Code amount control method Download PDF

Info

Publication number
JP4293175B2
JP4293175B2 JP2005294794A JP2005294794A JP4293175B2 JP 4293175 B2 JP4293175 B2 JP 4293175B2 JP 2005294794 A JP2005294794 A JP 2005294794A JP 2005294794 A JP2005294794 A JP 2005294794A JP 4293175 B2 JP4293175 B2 JP 4293175B2
Authority
JP
Japan
Prior art keywords
code amount
segment
quantization
generated
control method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2005294794A
Other languages
Japanese (ja)
Other versions
JP2007104549A (en
Inventor
一博 和気
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2005294794A priority Critical patent/JP4293175B2/en
Publication of JP2007104549A publication Critical patent/JP2007104549A/en
Application granted granted Critical
Publication of JP4293175B2 publication Critical patent/JP4293175B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

本発明は、画像信号を高能率符号化し、記録・伝送する際に用いる高能率符号化方法に関し、画像内の特定の符号量制御単位における発生符号量を一定以下に抑える制御を高速で行う符号量制御方法に関する。   The present invention relates to a high-efficiency encoding method for use in high-efficiency encoding and recording / transmission of an image signal. The present invention relates to a code that performs high-speed control to suppress a generated code amount in a specific code amount control unit in an image to a certain level or less. The present invention relates to a quantity control method.

近年のデジタル圧縮技術の発展により、映像信号を高能率符号化して記録するデジタルVTRが広く普及している。デジタルVTRの特徴としては、
・高画質である
・エラーに強い
・特殊再生が可能で、かつ十分な画質を実現する
ことが挙げられる。これらの条件を満たすために、前述のデジタルVTRにおいて、画像全体を特定の小さな符号量制御単位に分割し、この制御単位で発生する符号量が特定の符号量に収まるような符号量制御方法が採用されている。同方法を採用しているフォーマットの例としてDVフォーマット(IEC−61834)が挙げられる。
With the recent development of digital compression technology, digital VTRs that record video signals with high-efficiency encoding have become widespread. As a feature of digital VTR,
・ High image quality ・ Resistant to errors ・ Special reproduction is possible, and sufficient image quality can be realized. In order to satisfy these conditions, in the above-described digital VTR, there is a code amount control method in which the entire image is divided into specific small code amount control units, and the code amount generated in this control unit falls within the specific code amount. It has been adopted. The DV format (IEC-61834) is an example of a format that employs this method.

DVフォーマットにおいては、符号量制御単位としてセグメントという単位で符号量制御を行っている。以下、図8を用いて、セグメントの構成について詳しく説明する。同図に示すように、1フレームのデータは、DCT演算の基本単位である8×8画素からなるDCTブロックに分割される。輝度信号、色差信号はサンプリング周波数が異なるために、輝度信号は4個のDCTブロック、色差信号は各1個のDCTブロックが画面上の同じ位置、かつ同じ面積に相当する。この6個のDCTブロックをまとめたものをマクロブロックと呼ぶ。同図において、輝度信号のDCTブロック610、611、612、613、色差信号のDCTブロック614、615の計6個のDCTブロックから、マクロブロック600が構成される。   In the DV format, code amount control is performed in units of segments as code amount control units. Hereinafter, the configuration of the segments will be described in detail with reference to FIG. As shown in the figure, one frame of data is divided into DCT blocks composed of 8 × 8 pixels, which are basic units of DCT calculation. Since the luminance signal and the color difference signal have different sampling frequencies, the luminance signal has four DCT blocks, and the color difference signal has one DCT block in the same position and the same area on the screen. A group of these six DCT blocks is called a macro block. In the figure, a macro block 600 is composed of a total of six DCT blocks, namely, DCT blocks 610, 611, 612, and 613 for luminance signals and DCT blocks 614 and 615 for color difference signals.

符号化において1フレームのデータが特定のビット数を超えないように固定長符号化するが、実際には5つのマクロブロック単位で、固定の符号量となるように符号量制御を行う。この5つのマクロブロックをセグメントと呼ぶ。   In encoding, fixed-length encoding is performed so that one frame of data does not exceed a specific number of bits. In practice, however, code amount control is performed so that a fixed code amount is obtained in units of five macroblocks. These five macroblocks are called segments.

セグメント単位で固定の符号量となるように制御する場合、各セグメント間で情報量が均一となることが望ましい。それは、あるセグメントでは極端に情報量が少なく、あるセグメントでは極端に情報量が多いという状況が発生すると、情報量の少ないセグメントは再現性が高い、すなわち圧縮歪が目立たないが、情報量の多いセグメントでは再現性が低い、すなわち圧縮歪が目立つという現象が発生するからである。   When the control is performed so that the code amount is fixed on a segment basis, it is desirable that the information amount be uniform among the segments. That is, when there is a situation where the amount of information is extremely small in a certain segment and the amount of information is extremely large in a certain segment, the segment with a small amount of information is highly reproducible, that is, the compression distortion is not noticeable, but the amount of information is large. This is because the segment has a low reproducibility, that is, a phenomenon in which compression distortion is conspicuous.

画像信号の情報量は、画面に一様に分布しているのではなく、局所的に情報量の多い領域と少ない領域が混在している。そのため、画面上で連続するマクロブロックではなく、図8のように画面上で離れているマクロブロックからセグメントを構成することで、セグメント間の情報量を均一化することができる。   The information amount of the image signal is not uniformly distributed on the screen, but a region with a large amount of information and a region with a small amount of information are mixed locally. Therefore, it is possible to equalize the amount of information between segments by configuring segments from macroblocks that are separated on the screen as shown in FIG. 8 instead of macroblocks that are continuous on the screen.

同図に示すように、マクロブロック600、601、602、603、604の画面上離れた位置にある5つのマクロブロックから、セグメント605を構成する。このような処理を、シャフリングによるセグメント構成と呼ぶ。一方、図6に示すように、画面上で連続するマクロブロックからセグメントを構成することを、ラスタ順によるセグメント構成と呼ぶ。   As shown in the figure, a segment 605 is composed of five macroblocks located at positions on the screen of macroblocks 600, 601, 602, 603, and 604. Such a process is called a segment structure by shuffling. On the other hand, as shown in FIG. 6, configuring a segment from macroblocks continuous on the screen is called a segment configuration in raster order.

次に、図7を用いて従来の符号量制御方法を用いた高能率符号化装置について説明する。図7において、入力部500より入力された1フレーム(または1フィールド)の画像信号はセグメント構成部501に入力される。セグメント構成部501は入力された画像を、8×8画素から成るDCTブロックに分割し、画面上の同位置にあるDCTブロックを6個集めてマクロブロックを構成し、さらにマクロブロックを5個集めて符号量制御単位であるセグメントを構成する。各セグメントは直交変換演算部502に入力される。   Next, a high-efficiency encoding apparatus using a conventional code amount control method will be described with reference to FIG. In FIG. 7, an image signal of one frame (or one field) input from the input unit 500 is input to the segment configuration unit 501. The segment construction unit 501 divides the input image into DCT blocks each consisting of 8 × 8 pixels, collects 6 DCT blocks at the same position on the screen to form a macro block, and further collects 5 macro blocks. Thus, a segment which is a code amount control unit is configured. Each segment is input to the orthogonal transform calculation unit 502.

直交変換演算部502は入力されたセグメントに対しDCTブロック単位で直交変換を行い、直交変換データを出力する。直交変換データは16個の符号化部、すなわち第一の符号化部503、第二の符号化部504、第三の符号化部505、…、第十六の符号化部506に、同時に並行して入力される。   The orthogonal transform calculation unit 502 performs orthogonal transform on the input segment in units of DCT blocks and outputs orthogonal transform data. The orthogonal transform data is simultaneously transmitted to 16 encoding units, that is, the first encoding unit 503, the second encoding unit 504, the third encoding unit 505,..., And the sixteenth encoding unit 506. Is input.

セグメントに対する発生符号量の制御は、量子化処理において行われる。量子化とは直交変換されたDCTブロックの各係数を、量子化ステップと呼ばれる整数値で除算する処理のことである。量子化ステップが大きくなるほど、量子化後のDCT係数の値が小さくなる。特に高周波数域においては0となる係数が多くなることで、発生符号量が小さくなる。逆に量子化ステップが小さいほど発生符号量が大きくなる。   Control of the amount of generated code for a segment is performed in the quantization process. Quantization is a process of dividing each coefficient of an orthogonally transformed DCT block by an integer value called a quantization step. The larger the quantization step, the smaller the value of the DCT coefficient after quantization. In particular, in the high frequency range, the amount of generated codes is reduced by increasing the coefficient that is 0. Conversely, the smaller the quantization step, the larger the generated code amount.

従来の高能率符号化装置においては、16個の符号化部のそれぞれが量子化処理を行うための量子化器を有している。そして、16個の量子化器は、あらかじめそれぞれ異なる量子化ステップを保持している。各量子化器には、量子化番号と呼ばれる量子化器を特定するための番号が与えられている。量子化番号が小さいほど量子化ステップが大きい、すなわち発生符号量が小さくなる。これに対し量子化番号が大きいほど量子化ステップが小さい、すなわち発生符号量が大きくなる。この従来の高能率符号化装置においては、符号化部の番号と量子化番号が等しくなっている。例えば、第一の符号化部における量子化器の量子化番号は1である。   In the conventional high-efficiency encoding device, each of the 16 encoding units has a quantizer for performing quantization processing. The 16 quantizers hold different quantization steps in advance. Each quantizer is given a number for identifying a quantizer called a quantization number. The smaller the quantization number, the larger the quantization step, that is, the smaller the generated code amount. On the other hand, the larger the quantization number, the smaller the quantization step, that is, the larger the generated code amount. In this conventional high-efficiency encoding device, the encoding unit number and the quantization number are equal. For example, the quantization number of the quantizer in the first encoding unit is 1.

各符号化部は、その量子化器を用いて符号量算出を行う。第一の符号化部503は、入力された直交変換データを量子化番号1の量子化器で量子化、さらに可変長符号化を行い、当該ブロックの符号量を算出する。同様の処理をセグメント内の30個のブロックに対して行い、セグメント内での総符号量を算出する。第一の符号化部503で算出した総符号量は最終量子化器決定部507に入力される。ここで、各量子化器においては、量子化番号が大きいほど量子化ステップが小さいことを特徴とする。すなわち、量子化番号が大きいほど、発生符号量が大きくなる。他の符号化部も同様に、発生符号量を算出し、算出した総符号量を最終量子化器決定部507に入力する。   Each encoding unit performs code amount calculation using the quantizer. The first encoding unit 503 quantizes the input orthogonal transform data with a quantizer of quantization number 1 and further performs variable length encoding to calculate the code amount of the block. Similar processing is performed on 30 blocks in the segment, and the total code amount in the segment is calculated. The total code amount calculated by the first encoding unit 503 is input to the final quantizer determining unit 507. Here, in each quantizer, the larger the quantization number, the smaller the quantization step. That is, the larger the quantization number, the larger the generated code amount. Similarly, the other encoding units calculate the generated code amount and input the calculated total code amount to the final quantizer determination unit 507.

こうして得られた16種類の量子化による発生符号量に対し、最終量子化器決定部507は、セグメントに与えるべき特定の目標符号量を超えない最大の符号量に対応する量子化番号を最終量子化番号として、符号化部508に入力する。   The final quantizer determination unit 507 outputs the quantization number corresponding to the maximum code amount not exceeding the specific target code amount to be given to the segment to the generated code amount by 16 types of quantization thus obtained. The serial number is input to the encoding unit 508.

符号化部508は、直交変換演算部502より入力された直交変換データを、最終量子化器決定部507より入力された最終量子化番号に対応した量子化器(最終量子化器)で量子化、さらに可変長符号化を行い、当該セグメントの符号化データを出力する。符号化データは出力部509に出力する。出力部509は入力された符号化データを記録・伝送媒体等に出力する。   The encoding unit 508 quantizes the orthogonal transform data input from the orthogonal transform calculation unit 502 with a quantizer (final quantizer) corresponding to the final quantization number input from the final quantizer determination unit 507. Further, variable length encoding is performed, and encoded data of the segment is output. The encoded data is output to the output unit 509. The output unit 509 outputs the input encoded data to a recording / transmission medium or the like.

このように、従来の高能率符号化装置は、異なる複数の量子化番号に対応する量子化ステップで同時に量子化を行って、最適な量子化番号を得るという処理をハードウェアで実現している(例えば、特許文献1参照。)。   As described above, the conventional high-efficiency encoding apparatus realizes the process of obtaining the optimal quantization number by hardware by simultaneously performing quantization in the quantization steps corresponding to a plurality of different quantization numbers. (For example, refer to Patent Document 1).

CPUの性能向上に伴い、PC上でソフトウェアにより高能率符号化を行うノンリニア編集機器が注目を浴びるようになった。ソフトウェアで符号化処理を行う場合、上述したようなハードウェアにて符号化処理を行う機器と違い並列処理に限りがあるため、同時に複数の量子化処理を行うことは困難であり、高速化を実現するためには演算回数を削減する必要がある。   Along with the improvement in CPU performance, non-linear editing equipment that performs high-efficiency encoding with software on a PC has attracted attention. When performing encoding processing with software, unlike devices that perform encoding processing with hardware as described above, parallel processing is limited, so it is difficult to perform multiple quantization processing at the same time. In order to realize this, it is necessary to reduce the number of operations.

図7に示した従来例における符号量制御処理をソフトウェア処理で実現する場合について説明する。符号量制御処理をソフトウェア処理で実現するためには、異なる複数の量子化番号に対応する量子化ステップで順番に量子化を行い、得られた結果から最適な符号量が得られる量子化番号を得るという処理を行う。以下、この処理についてフローチャートを用いて具体的に説明する。図9は、符号化対象であるセグメントnを符号化するにあたり、発生符号量を制御するために最適な量子化番号を決定するためのフローチャートを示している。関数calc_code(q_a)は、当該セグメントを量子化番号q_aに対応する量子化ステップで量子化、さらに可変長符号化する関数である。なお、量子化番号を変えながら量子化及び符号化処理を行うにあたり、パラメータとして与える量子化番号q_aのことを以下、参照量子化番号と呼ぶ。関数calc_max(code_a)は、16個の量子化番号それぞれに対して算出した発生符号量code_a[i](i=1,2,…,16)の中で、目標符号量を超えない最大の符号量を与える量子化番号を算出する関数である。   A case where the code amount control processing in the conventional example shown in FIG. 7 is realized by software processing will be described. In order to realize the code amount control processing by software processing, quantization is performed sequentially in the quantization steps corresponding to a plurality of different quantization numbers, and the quantization number that can obtain the optimum code amount from the obtained result is obtained. The process of obtaining is performed. Hereinafter, this process will be specifically described with reference to a flowchart. FIG. 9 shows a flowchart for determining the optimum quantization number for controlling the amount of generated code when encoding the segment n to be encoded. The function calc_code (q_a) is a function that quantizes the segment in the quantization step corresponding to the quantization number q_a and further performs variable length coding. Note that the quantization number q_a given as a parameter when performing quantization and encoding processing while changing the quantization number is hereinafter referred to as a reference quantization number. The function calc_max (code_a) is the maximum code that does not exceed the target code amount among the generated code amounts code_a [i] (i = 1, 2,..., 16) calculated for each of the 16 quantization numbers. This is a function for calculating a quantization number giving a quantity.

ステップ700において、参照量子化番号q_aを1で初期化する。ステップ701において、符号化対象であるセグメントnを参照量子化番号q_aで量子化、さらに可変長符号化し、その時の発生符号量をcode_a[q_a]にストアする。ステップ702において、q_aが16より小さければステップ703へ遷移し、q_aが16以上であればステップ704へ遷移する。ステップ703に遷移した場合、q_aの値を1増やし、ステップ701へ遷移する。ステップ704に遷移した場合、関数calc_max(code_a)は目標符号量を超えない最大の量子化番号、すなわち最終量子化番号をq_nに代入し、当該セグメントnの処理を終了する。
特開平6−125537号公報
In step 700, the reference quantization number q_a is initialized with 1. In step 701, the segment n to be encoded is quantized with the reference quantization number q_a and further variable-length encoded, and the generated code amount at that time is stored in code_a [q_a]. In step 702, if q_a is smaller than 16, the process proceeds to step 703, and if q_a is 16 or more, the process proceeds to step 704. When the process proceeds to step 703, the value of q_a is incremented by 1, and the process proceeds to step 701. When the process proceeds to step 704, the function calc_max (code_a) substitutes the maximum quantization number that does not exceed the target code amount, that is, the final quantization number, into q_n, and ends the processing of the segment n.
JP-A-6-125537

しかしながら従来のソフトウェアによる符号量制御方法では、複数の量子化番号に対して総当りで符号化を行い発生符号量を算出しており、並列処理ができないため膨大な演算時間がかかるという問題点があった。   However, the conventional code amount control method using software calculates the generated code amount by performing brute force encoding for a plurality of quantization numbers, and cannot be processed in parallel, so it takes a lot of computation time. there were.

本発明は、このような問題点に鑑み、ソフトウェアによる符号量制御において、演算量を削減することを目的とする。   The present invention has been made in view of such problems, and an object thereof is to reduce the amount of calculation in code amount control by software.

上記問題点を解決するために本発明は、画面上の離れた位置にある複数のブロックを集めてセグメントを構成しセグメント単位で複数段階からなる量子化に関するパラメータのうちからひとつを選択して符号化を行い発生する符号量を制御する符号量制御方法であって、前記画面上のすでに符号化済みのセグメントに対して適用した量子化に関するパラメータを量子化パラメータの初期値とする初期化ステップと、前記量子化パラメータを用いて対象となるセグメントに対して量子化を行って発生符号量を算出する符演算ステップと、前記発生符量を最終符量として採用するかどうかを判断する終了判断ステップと、前記発生符量が目標符に近づくように前記量子化パラメータを変更するパラメータ変更ステップとを有する符量制御方法としたものである。 In order to solve the above problem, the present invention collects a plurality of blocks at distant positions on the screen to form a segment, and selects one of the parameters related to quantization consisting of a plurality of stages for each segment. A code amount control method for controlling a code amount generated by encoding, wherein an initialization step uses a quantization parameter applied to an already encoded segment on the screen as an initial value of a quantization parameter When the sign-calculating step of calculating a generated code amount by performing a quantization on the segment of interest by using the quantization parameter, whether to adopt the generation sign-amount as a final sign-amount determination marks having a termination determination step, and a parameter changing step to change the quantization parameter so that the generated sign-amount approaches the target sign-amount It is obtained by the amount control method.

画面上の離れた位置にあるブロックを集めてセグメントを構成する場合、セグメント内にはエッジ、テクスチャを含む情報量の多い領域、平坦部のような情報量の少ない領域が混在するため、セグメント間での情報量が均等化される。そのため、任意のセグメントの最終量子化番号は、その周囲のセグメントの最終量子化番号と近い値をとることが予想される。本発明では、符号化対象セグメントに対し、符号化済みのセグメントの最終量子化番号を参照量子化番号の初期値として、その周辺から探索を行い、目標符号量を超えない最大の符号量を得る量子化番号である最終量子化番号が見つかった時点で、当該セグメントにおける処理を打ち切る事で、最終量子化番号を算出するために必要な演算量を大幅に削減することができるという利点がある。   When a segment is formed by collecting blocks located at distant locations on the screen, there are areas with a large amount of information including edges and textures, and areas with a small amount of information such as flat areas. The amount of information at is equalized. Therefore, the final quantization number of an arbitrary segment is expected to take a value close to the final quantization number of the surrounding segments. In the present invention, with respect to the encoding target segment, the final quantization number of the encoded segment is used as the initial value of the reference quantization number, and a search is performed from the periphery to obtain the maximum code amount not exceeding the target code amount. When the final quantization number, which is the quantization number, is found, there is an advantage that the calculation amount necessary for calculating the final quantization number can be greatly reduced by terminating the processing in the segment.

図面を用いて本発明の実施の形態について説明する。本発明は、DVフォーマット等のように、画面上の離れた位置にあるブロックを集めてセグメントを構成し、このセグメント単位で符号化処理を行う符号化方法における符号量制御方法である。   Embodiments of the present invention will be described with reference to the drawings. The present invention is a code amount control method in an encoding method in which blocks located at distant positions on a screen are assembled to form a segment and an encoding process is performed in units of segments, such as the DV format.

図1に、本符号量制御方法を実行するためのハードウェアの構成図を示す。本符号量制御方法は、あらかじめプログラム格納手段104に格納されたプログラムを、CPU102が実行することで実現される。映像入力手段100より入力された1フレーム(または1フィールド)の画像信号はメモリ101に入力、格納される。マウス、キーボード等の入力手段103から入力された要求コマンドに基づいて、CPU102は、プログラム格納手段104に格納されたプログラムを実行する。CPU102はプログラムにしたがって、メモリに格納された映像信号に対し符号量制御を含めた符号化処理を行い処理画像を生成し、メモリ101に一旦格納する。映像出力手段105はメモリ101に格納された処理画像を、映像表示手段106に伝送する。映像表示手段106は入力された処理画像をモニタ等の表示デバイスに表示する。   FIG. 1 shows a hardware configuration diagram for executing the present code amount control method. This code amount control method is realized by the CPU 102 executing a program stored in the program storage unit 104 in advance. One frame (or one field) image signal input from the video input means 100 is input to and stored in the memory 101. Based on the request command input from the input unit 103 such as a mouse or a keyboard, the CPU 102 executes the program stored in the program storage unit 104. The CPU 102 performs encoding processing including code amount control on the video signal stored in the memory according to the program, generates a processed image, and temporarily stores the processed image in the memory 101. The video output unit 105 transmits the processed image stored in the memory 101 to the video display unit 106. The video display means 106 displays the input processed image on a display device such as a monitor.

図2は、本発明の符号量制御方法のアルゴリズムを示すフローチャートである。図において、セグメントnの最終量子化番号をq_[n]と表記する。この表記に従うと、(n−1)番目のセグメントの最終量子化番号はq_[n−1]となる。関数calc_code(q_a)は、当該セグメントを参照量子化番号q_aに対応する量子化ステップで量子化、さらに可変長符号化する関数であり、発生符号量code_tを出力する。参照量子化番号q_aは1〜16の値を取る。また、量子化番号が大きいほど対応する量子化ステップが小さくなり、その結果発生符号量が増加するようにしている。すなわち、参照量子化番号を増加させながら関数calc_code()で量子化及び符号化を行うと、発生符号量も増加していくことになる。code_Lはセグメントあたりの目標符号量である。over_flagは符号化セグメントnの最終量子化番号を算出する過程において、発生符号量が目標符号量を超えた事を示すフラグである。under_flagは符号化セグメントの最終量子化番号を算出する過程において、発生符号量が目標符号量を超えなかった事を示すフラグである。q_cは最終量子化番号の候補となる量子化番号である。   FIG. 2 is a flowchart showing an algorithm of the code amount control method of the present invention. In the figure, the final quantization number of segment n is denoted q_ [n]. According to this notation, the final quantization number of the (n−1) -th segment is q_ [n−1]. The function calc_code (q_a) is a function that quantizes the segment in a quantization step corresponding to the reference quantization number q_a and further performs variable length coding, and outputs a generated code amount code_t. The reference quantization number q_a takes a value from 1 to 16. Further, the larger the quantization number, the smaller the corresponding quantization step, and as a result, the generated code amount increases. That is, if quantization and encoding are performed with the function calc_code () while increasing the reference quantization number, the generated code amount also increases. code_L is the target code amount per segment. “over_flag” is a flag indicating that the generated code amount exceeds the target code amount in the process of calculating the final quantization number of the encoded segment n. under_flag is a flag indicating that the generated code amount does not exceed the target code amount in the process of calculating the final quantization number of the encoded segment. q_c is a quantization number that is a candidate for the final quantization number.

以下に、本発明の実施の形態について具体的に説明する。   The embodiment of the present invention will be specifically described below.

ステップ150において、符号化対象であるセグメントnの参照量子化番号q_aの初期値として、すでに符号化済みのセグメント(n−1)の最終量子化番号q_[n−1]を代入する。   In step 150, the final quantization number q_ [n-1] of the already encoded segment (n-1) is substituted as the initial value of the reference quantization number q_a of the segment n to be encoded.

当該セグメントnの発生符号量の状態を示す2つのover_flag、under_flagを定義する。当該セグメントが一度でも目標符号量を超えたことがある場合、over_flagの値を1に設定する。逆に一度も目標符号量を超えたことが無い場合、over_flagを0に設定する。また、当該セグメントが一度でも目標符号量以下になったことがある場合、under_flagの値を1に設定する。逆に一度も目標符号量以下になったことが無い場合、under_flagを0に設定する。   Two over_flags and under_flags indicating the state of the generated code amount of the segment n are defined. If the segment has exceeded the target code amount even once, the value of over_flag is set to 1. Conversely, if the target code amount has never been exceeded, over_flag is set to 0. Also, if the segment has never reached the target code amount even once, the value of under_flag is set to 1. Conversely, if the code amount never falls below the target code amount, under_flag is set to 0.

over_flag、under_flagともに0で初期化する。q_cを1で初期化する。   Both over_flag and under_flag are initialized to 0. q_c is initialized with 1.

ステップ151において、セグメントnを参照量子化番号q_aに対応する量子化ステップで量子化、さらに可変長符号化し、その時の発生符号量code_tを出力する。ステップ152では発生符号量code_tと目標符号量code_Lとを比較し、code_tがcode_Lを超えていなければステップ153へ遷移し、code_tがcode_Lを超えていればステップ157へ遷移する。   In step 151, the segment n is quantized in the quantization step corresponding to the reference quantization number q_a, further variable-length coded, and the generated code amount code_t at that time is output. In step 152, the generated code amount code_t and the target code amount code_L are compared. If code_t does not exceed code_L, the process proceeds to step 153, and if code_t exceeds code_L, the process proceeds to step 157.

ステップ153に遷移した場合、q_tが最終量子化器の候補となるので、これをq_cに代入する。   When the process proceeds to step 153, q_t becomes a candidate for the final quantizer, and is substituted for q_c.

ステップ154において、over_flagの値をチェックし、over_flag==1、すなわち符号化セグメントの最終量子化器を算出する過程において、発生符号量が目標符号量を超えた場合、あるいはq_aが16の場合、ステップ155に遷移する。over_flag==1でなく、かつq_a==16でない場合、ステップ156に遷移する。   In step 154, the value of over_flag is checked, and over_flag == 1, that is, in the process of calculating the final quantizer of the encoded segment, when the generated code amount exceeds the target code amount, or when q_a is 16, Transition to step 155. If it is not over_flag == 1 and q_a == 16, the process proceeds to step 156.

ステップ156に遷移した場合、under_flag=1とし、q_aの値を1増やし、ステップ151へ遷移する。   When the process proceeds to step 156, under_flag = 1 is set, the value of q_a is increased by 1, and the process proceeds to step 151.

ステップ152からステップ157に遷移した場合、under_flagの値をチェックし、under_flag==1、すなわち符号化セグメントの最終量子化番号を算出する過程において、発生符号量が目標符号量を超えなかった場合、あるいはq_a==1の場合、ステップ155に遷移する。これによりunder_flag==1でなく、かつq_a==1でない場合、ステップ158に遷移する。under_flag==1でなく、かつq_a==1である場合、q_cが一度も更新されないため、初期値である1が最終量子化番号になる。   When transitioning from step 152 to step 157, the value of under_flag is checked, and under_flag == 1, that is, in the process of calculating the final quantization number of the encoded segment, if the generated code amount does not exceed the target code amount, Alternatively, when q_a == 1, the process proceeds to step 155. As a result, if under_flag == 1 is not satisfied and q_a == 1 is not satisfied, the process proceeds to step 158. If under_flag == 1 and q_a == 1, q_c is never updated, so the initial value 1 is the final quantization number.

ステップ158に遷移した場合、over_flagの値を1とし、q_aの値を1減らし、ステップ151へ遷移する。   When the process proceeds to step 158, the value of over_flag is set to 1, the value of q_a is decreased by 1, and the process proceeds to step 151.

ステップ155において、q_cを目標符号量を超えない最大の符号量を得る量子化番号である最終量子化番号としてq_nに代入し、当該セグメントnの処理を終了する。   In step 155, q_c is substituted into q_n as a final quantization number which is a quantization number for obtaining the maximum code amount not exceeding the target code amount, and the processing of the segment n is completed.

符号化対象セグメントnの最終量子化番号を決定する過程について、具体例をあげて説明する。   The process of determining the final quantization number of the encoding target segment n will be described with a specific example.

図3に、符号化対象セグメントnに対する最終量子化番号決定の過程の一例を示す。同図において、横軸は量子化番号、縦軸は各量子化番号で符号化対象セグメントnを符号化したときの発生符号量を示している。200は量子化番号9での発生符号量、201は量子化番号10での発生符号量、202は量子化番号11での発生符号量、203は量子化番号12での発生符号量を示し、それぞれ1000、2000、3000、4000ビットとする。204は目標符号量であり、2500ビットとする。   FIG. 3 shows an example of the final quantization number determination process for the encoding target segment n. In the figure, the horizontal axis indicates the quantization number, and the vertical axis indicates the generated code amount when the encoding target segment n is encoded with each quantization number. 200 represents a generated code amount at quantization number 9, 201 represents a generated code amount at quantization number 10, 202 represents a generated code amount at quantization number 11, 203 represents a generated code amount at quantization number 12, The bits are 1000, 2000, 3000, and 4000 bits, respectively. Reference numeral 204 denotes a target code amount, which is 2500 bits.

はじめに参照量子化番号の初期値として、セグメント(n−1)の符号化で適用した量子化番号である10を設定し、1回目の符号量演算を行う。この演算の結果、2000ビットの符号量を算出する。このとき、量子化番号10での発生符号量は目標符号量より小さいため、次回の符合量演算で発生符合量が増加するように量子化番号を1増加させ、再度符合量演算を行う。すなわち、量子化番号をunder_flag=1とし、q_aの値を1増やして11とする。さらにq_c=10とする。   First, as the initial value of the reference quantization number, 10 that is the quantization number applied in the encoding of the segment (n−1) is set, and the first code amount calculation is performed. As a result of this calculation, a code amount of 2000 bits is calculated. At this time, since the generated code amount at the quantization number 10 is smaller than the target code amount, the quantization number is incremented by 1 so that the generated code amount is increased in the next code amount calculation, and the code amount calculation is performed again. That is, the quantization number is set to under_flag = 1, and the value of q_a is increased by 1 to 11. Further, q_c = 10.

続いて参照量子化番号を11として2回目の符号量演算を行い、3000ビットの符号量を算出する。このとき、量子化番号11による発生符号量は目標符号量より大きく、かつunder_flag=1である。すなわち前回は目標符号量を下回っていたが今回の演算では目標符号量を上回ったため、当該セグメントに対する最終量子化番号を10として終了する。この場合の符号量演算回数は2回であり、16回の演算回数を要する従来例と比較して大幅な演算量削減が実現できる。   Subsequently, a code amount calculation of the second time is performed with the reference quantization number as 11, and a code amount of 3000 bits is calculated. At this time, the generated code amount by the quantization number 11 is larger than the target code amount, and under_flag = 1. That is, although it was less than the target code amount last time, it exceeded the target code amount in this calculation, so the final quantization number for the segment is set to 10. In this case, the number of code amount calculations is two, and a large amount of calculation can be realized as compared with the conventional example that requires 16 calculation times.

図4に、符号化対象セグメントnに対する最終量子化番号決定の過程の他の例を示す。同図において、図3と同様に、横軸は量子化番号、縦軸は各量子化番号で符号化対象セグメントnを符号化したときの発生符号量を示している。300は量子化番号9での発生符号量、301は量子化番号10での発生符号量、302は量子化番号11での発生符号量、303は量子化番号12での発生符号量を示し、それぞれ1000、2000、3000、4000ビットとする。304は目標符号量であり、2500ビットとする。   FIG. 4 shows another example of the process of determining the final quantization number for the encoding target segment n. In FIG. 3, as in FIG. 3, the horizontal axis indicates the quantization number, and the vertical axis indicates the generated code amount when the encoding target segment n is encoded with each quantization number. 300 indicates a generated code amount at quantization number 9, 301 indicates a generated code amount at quantization number 10, 302 indicates a generated code amount at quantization number 11, 303 indicates a generated code amount at quantization number 12, The bits are 1000, 2000, 3000, and 4000 bits, respectively. Reference numeral 304 denotes a target code amount, which is 2500 bits.

はじめに参照量子化番号の初期値としてセグメント(n−1)の符号化で適用した量子化番号である12を設定し、1回目の符号量演算を行う。この演算の結果、4000ビットの符号量を算出する。このとき、量子化番号12での発生符号量は目標符号量より大きいため、次回の符合量演算で発生符合量が減少するように量子化番号を1減少させ、再度符合量演算を行う。すなわち、over_flag=1とし、q_aの値を1減らして11とする。   First, 12 which is the quantization number applied in the encoding of the segment (n−1) is set as the initial value of the reference quantization number, and the first code amount calculation is performed. As a result of this calculation, a 4000-bit code amount is calculated. At this time, since the generated code amount at the quantization number 12 is larger than the target code amount, the quantization number is decreased by 1 so that the generated code amount is reduced in the next code amount calculation, and the code amount calculation is performed again. That is, over_flag = 1, and the value of q_a is decreased by 1 to 11.

続いて参照量子化番号を11として2回目の符号量演算を行い、3000ビットの符号量を算出する。このとき、量子化番号11による発生符号量は目標符号量より大きく、かつunder_flag=0であるため、同様にq_aの値を1減らして10とする。   Subsequently, a code amount calculation of the second time is performed with the reference quantization number as 11, and a code amount of 3000 bits is calculated. At this time, since the generated code amount by the quantization number 11 is larger than the target code amount and under_flag = 0, the value of q_a is similarly decreased by 1 to 10.

続いて参照量子化番号を10として3回目の符号量演算を行い、2000ビットの符号量を算出する。このとき、量子化番号10による発生符号量は目標符号量より小さく、かつover_flag=1である。すなわち前回は目標符号量を上回っていたが今回の演算では目標符号量を下回ったため、当該セグメントに対する最終量子化番号を10として終了する。この場合の符号量演算回数は3回であり、16回の演算回数を要する従来例と比較して大幅な演算量削減が実現できる。   Subsequently, the third code amount calculation is performed with the reference quantization number as 10, and a 2000 bit code amount is calculated. At this time, the generated code amount by the quantization number 10 is smaller than the target code amount, and over_flag = 1. That is, the previous code amount exceeded the target code amount, but in the current calculation, the target code amount was less than the target code amount. In this case, the number of code amount calculations is three, and a large amount of calculation can be realized as compared with the conventional example requiring 16 calculation times.

本発明の符号量制御方法は、画面上の離れた位置にあるブロックを集めてセグメントを構成し、このセグメント単位で符号量制御を行うような記録フォーマットでの符号化処理に適用することが前提である。   The code amount control method of the present invention is premised on being applied to an encoding process in a recording format in which blocks located at distant positions on the screen are collected to form a segment and the code amount control is performed in units of segments. It is.

画面上の離れた位置にあるブロックを集めてセグメントを構成する場合、セグメント内にはエッジ、テクスチャを含む情報量の多い領域、平坦部のような情報量の少ない領域が混在するため、セグメント間での情報量が均等化される。本発明の符号量制御方法は、符号化対象セグメントに対し、符号化済みのセグメントの量子化番号を参照量子化番号の初期値として使用し、その周辺から探索を行い、最終量子化番号が見つかった時点で、当該セグメントにおける処理を打ち切る構成としたことにより、最終量子化番号を算出するために必要な演算量を大幅に削減することが可能となる。   When a segment is formed by collecting blocks located at distant locations on the screen, there are areas with a large amount of information including edges and textures, and areas with a small amount of information such as flat areas. The amount of information at is equalized. The code amount control method according to the present invention uses the quantization number of the encoded segment as the initial value of the reference quantization number for the encoding target segment, searches from the surroundings, and finds the final quantization number. At this point, the processing in the segment is aborted, so that it is possible to greatly reduce the amount of calculation necessary for calculating the final quantization number.

図5を用いてセグメントの構成について説明する。400、401、402、403、404はマクロブロックを表し、各々8つのDCTブロックを含む。同図に示すように画面上の離れた位置にある5つのマクロブロックを集め、セグメント1(450)を構成する。同様に410、411、412、413、414はマクロブロックを表し、これらを集めてセグメント2(451)を構成する。   The segment configuration will be described with reference to FIG. Reference numerals 400, 401, 402, 403, and 404 denote macroblocks each including eight DCT blocks. As shown in the figure, five macroblocks located at distant positions on the screen are collected to constitute segment 1 (450). Similarly, 410, 411, 412, 413, and 414 represent macroblocks, and these are collected to constitute segment 2 (451).

セグメント1において、400、404は平坦部で情報量の少ない領域、401、402、403はエッジを含む情報量の多い領域である。セグメント2において、410、414は平坦部で情報量の少ない領域、411、412、413はエッジを含む情報量の多い領域である。セグメント1とセグメント2の情報量が均等化されており、これら二つのセグメントの最終量子化番号は同じ、あるいは近い値をとる事が予想される。そのため、セグメント2を符号化する際に、セグメント1の最終量子化番号を参照量子化番号の初期値とし、その周辺から探索を行うことで、セグメント2の最終量子化番号算出に必要な演算量を大幅に削減する事ができる。   In segment 1, areas 400 and 404 are flat areas with a small amount of information, and areas 401, 402, and 403 are areas with a large amount of information including edges. In segment 2, areas 410 and 414 are flat areas with a small amount of information, and areas 411, 412, and 413 are areas with a large amount of information including edges. The amount of information of segment 1 and segment 2 is equalized, and the final quantization numbers of these two segments are expected to be the same or close. Therefore, when encoding the segment 2, the final quantization number of the segment 1 is set as the initial value of the reference quantization number, and the search is performed from the periphery thereof, thereby calculating the amount of computation necessary for calculating the final quantization number of the segment 2 Can be greatly reduced.

本実施の形態では、q_aの値を更新する場合、1増やす(減らす)としたが、発生符号量と目標符号量との差により、増減の大きさを制御する方式も考えられる。例えば、発生符号量と目標符号量との差がある閾値より大きい場合、2増やす(減らす)、または3増やす(減らす)ことで、最終量子化番号を算出するまでの演算回数をさらに削減する事が可能となる。   In this embodiment, when the value of q_a is updated, it is increased (decreased) by one. However, a method of controlling the magnitude of increase / decrease according to the difference between the generated code amount and the target code amount is also conceivable. For example, when the difference between the generated code amount and the target code amount is larger than a certain threshold, the number of operations until the final quantization number is calculated can be further reduced by increasing (decreasing) by 2 or increasing (decrease) by 3. Is possible.

本発明の符号量制御方法によれば、ソフトウェアによる符号量制御において、演算量を削減することができるので、ソフトウェアにより高能率符号化を行うノンリニア編集機器等にも適用可能である。   According to the code amount control method of the present invention, since the amount of calculation can be reduced in the code amount control by software, it can also be applied to a non-linear editing device or the like that performs high-efficiency encoding by software.

本発明の符号量制御方法のハードウェア構成を示した図The figure which showed the hardware constitutions of the code amount control method of this invention 本発明の符号量制御方法を示したフローチャートThe flowchart which showed the code amount control method of this invention 予測量子化番号と、実際の量子化番号が一致していた場合の動作を示した図Diagram showing the operation when the predicted quantization number matches the actual quantization number 予測量子化番号と、実際の量子化番号が2異なる場合の動作を示した図Diagram showing the operation when the predicted quantization number is different from the actual quantization number シャフリングによるセグメント構成を示した図Diagram showing segment structure by shuffling ラスタ順によるセグメント構成を示した図Diagram showing segment structure in raster order 従来の符号量制御装置のブロック図Block diagram of a conventional code amount control device マクロブロック、セグメント構成を示した図Diagram showing macro block and segment structure 従来の符号量制御方法を示したフローチャートA flowchart showing a conventional code amount control method

符号の説明Explanation of symbols

100 映像入力手段
101 メモリ
102 CPU
103 入力手段
104 プログラム格納手段
105 映像出力手段
106 映像表示手段
400、401、402、403、404、410、411、412、413、414、600、601、602、603、604 マクロブロック
450 セグメント1
451 セグメント2
500 入力部
501 セグメント構成部
502 直交変換演算部
503 第一の符号化部
504 第二の符号化部
505 第三の符号化部
506 第十六の符号化部
507 最終量子化器決定部
508 符号化部
509 出力部
610、611、612、613 同一マクロブロックに属する輝度DCTブロック
614、615 同一マクロブロックに属する色差DCTブロック
100 video input means 101 memory 102 CPU
103 Input means 104 Program storage means 105 Video output means 106 Video display means 400, 401, 402, 403, 404, 410, 411, 412, 413, 414, 600, 601, 602, 603, 604 Macroblock 450 Segment 1
451 Segment 2
500 Input unit 501 Segment configuration unit 502 Orthogonal transform operation unit 503 First encoding unit 504 Second encoding unit 505 Third encoding unit 506 Sixteenth encoding unit 507 Final quantizer determining unit 508 encoding Conversion unit 509 Output unit 610, 611, 612, 613 Luminance DCT block belonging to the same macroblock 614, 615 Color difference DCT block belonging to the same macroblock

Claims (5)

画面上の離れた位置にある複数のブロックを集めてセグメントを構成しセグメント単位で複数段階からなる量子化に関するパラメータのうちからひとつを選択して符号化を行い発生する符号量を制御する符号量制御方法であって、
前記画面上のすでに符号化済みのセグメントに対して適用した量子化に関するパラメータを量子化パラメータの初期値とする初期化ステップと、
前記量子化パラメータを用いて対象となるセグメントに対して量子化を行って発生符号量を算出する符号量演算ステップと、
前記発生符号量を最終符号量として採用するかどうかを判断する終了判断ステップと、
前記発生符号量が目標符号量に近づくように前記量子化パラメータを変更するパラメータ変更ステップと、
を有する符号量制御方法。
A code that controls the amount of code that is generated by collecting multiple blocks located at distant locations on the screen to form a segment , selecting one of the parameters related to quantization in multiple stages , and performing encoding A quantity control method,
An initialization step in which a parameter relating to quantization applied to an already encoded segment on the screen is an initial value of the quantization parameter ;
A code amount calculation step of calculating a generated code amount by performing quantization on a target segment using the quantization parameter ;
An end determination step of determining whether to employ the generated code amount as a final code amount;
A parameter changing step said generated code amount to change the quantization parameter so as to approach the target code amount,
A code amount control method comprising:
前記パラメータ変更ステップは、前記発生符号量が目標符号量に近づくように前記量子化パラメータを1段階ずつ変更する、請求項1記載の符号量制御方法。The code amount control method according to claim 1, wherein the parameter changing step changes the quantization parameter step by step so that the generated code amount approaches a target code amount. 前記パラメータ変更ステップは、前記発生符号量が前記目標符号量を上回るときは符号量が減少するように前記量子化パラメータを1段階変更し、前記発生符号量が目標符号量以下のときは符号量が増加するように前記量子化パラメータを1段階変更する、請求項2記載の符号量制御方法。The parameter changing step changes the quantization parameter by one step so that the code amount decreases when the generated code amount exceeds the target code amount, and the code amount when the generated code amount is equal to or less than the target code amount. The code amount control method according to claim 2, wherein the quantization parameter is changed by one step so as to increase. 前記セグメントは、シャフリングにより構成される、請求項1乃至3のいずれかに記載の符号量制御方法。The code amount control method according to claim 1, wherein the segment is configured by shuffling. 前記終了判断ステップは、選択した前記量子化パラメータに対する前記発生符号量が前記目標符号量を越えない最大の符号量となるときに、前記発生符号量を最終符号量として採用する、請求項1記載の符号量制御方法。2. The termination determination step employs the generated code amount as a final code amount when the generated code amount for the selected quantization parameter is a maximum code amount not exceeding the target code amount. Code amount control method.
JP2005294794A 2005-10-07 2005-10-07 Code amount control method Expired - Fee Related JP4293175B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005294794A JP4293175B2 (en) 2005-10-07 2005-10-07 Code amount control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005294794A JP4293175B2 (en) 2005-10-07 2005-10-07 Code amount control method

Publications (2)

Publication Number Publication Date
JP2007104549A JP2007104549A (en) 2007-04-19
JP4293175B2 true JP4293175B2 (en) 2009-07-08

Family

ID=38031005

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005294794A Expired - Fee Related JP4293175B2 (en) 2005-10-07 2005-10-07 Code amount control method

Country Status (1)

Country Link
JP (1) JP4293175B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009075326A1 (en) * 2007-12-11 2009-06-18 Nippon Telegraph And Telephone Corporation Coding method, decoding method, device using the methods, program, and recording medium

Also Published As

Publication number Publication date
JP2007104549A (en) 2007-04-19

Similar Documents

Publication Publication Date Title
JP5524072B2 (en) Video encoding device
US6697529B2 (en) Data compression method and recording medium with data compression program recorded therein
JP2008527789A (en) Entropy encoding method
JP4746560B2 (en) Moving picture playback method and moving picture playback apparatus
JP4612797B2 (en) Encoding device and encoding method
WO2009087783A1 (en) Data generator for coding, method of generating data for coding, decoder and decoding method
US20040105497A1 (en) Encoding device and method
JP2008193410A (en) Image encoding device, recording device, moving image encoding method, and moving image encoding program
JP2009021775A (en) Coder and coding method
JP4833309B2 (en) Video compression encoding device
US20060071830A1 (en) Decoder and decoding method
JP4293175B2 (en) Code amount control method
JP2012147290A (en) Image coding apparatus, image coding method, program, image decoding apparatus, image decoding method, and program
JP2007300389A (en) Image encoding apparatus and image encoding program
CA2436437A1 (en) Moving picture information compressing method and its system
KR20010110053A (en) Method for compressing dynamic image information and system therefor
CA2640597C (en) Fixed bit rate, intraframe compression and decompression of video
EP1892965A2 (en) Fixed bit rate, intraframe compression and decompression of video
JP4139657B2 (en) Video signal encoding apparatus and decoding apparatus
JPH10224779A (en) Method and device for detecting scene change of moving image
JP3560946B2 (en) Moving image information compression method and system
JP3781012B2 (en) Image data compression method, image data expansion method, and image data expansion circuit
JP4596975B2 (en) Image encoding method and image processing apparatus
JP3958033B2 (en) Method and system for compressing moving picture information
JP2006502673A6 (en) In-stream lossless compression of digital image sensor data

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080630

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080708

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080828

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20090317

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090330

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120417

Year of fee payment: 3

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120417

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees