. High-Efficient -pass Video Coding Algorithm based on Macroblock Rate-Distortion Kazuya Yokohari, Atsushi Sagata and Kazuto Kamikura In order to achieve high-efficient video coding, -pass video coding algorithms are proposed. In the existing -pass video coding algorithms, To focus on the feature quantity of the coding result in the frame, the video coding efficiency is grown in the frame. In this paper, we focus on the macroblock coding efficiency (rate-distortion). In the proposed algorithm to achieve high-efficient video coding, the quantization parameters which optimize video coding efficiency of each macroblocks are decided based on the -pass encoding result. Using these quantization parameters at the -pass encoding, the video coding efficiency is grown in the macroblock. The proposed algorithm is able to improve the video coding efficiency by about percents. QVGA (3 4) WVGA (8 48) BS 7 48, 44 8, 9 8 ) ) 3 4 5. NTT NTT Cyber Space Laboratories, NTT Corporation c Information Processing Society of Japan
Lagrange D mb R mb = D picture R picture = constant () 3) () () RD RD RD ( D/ R) QP QP-GenBit. 4) PSNR PSNR 5) AVC/H.64 JM 6) GNU GPL AVC/H.64 x64 ) x, y x, y (x, y) = [l(x, y)] α [c(x, y)] β [s(x, y)] γ () l(x, y) = µxµy + C (3) µ x + µ y + C c(x, y) = σ xσ y + C σ x + σ y + C (4) s(x, y) = σxy + C3 (5) σ x σ y + C 3 l(x, y) c(x, y) s(x, y) µ x, µ y, σ x, σ y, σ xy µ x = N x i (6) µ y = y i (7) N { } σ x = (x i µ x) (8) N { } σ y = (y i µ x) (9) N σ xy = N (x i µ x )(y i µ y ) () µ x, µ y σ x, σ y σ xy C, C, C 3, α, β, γ C = 6.55, C = 58.55, C 3 = C /, α = β = γ = 4). RD RD RD QP 5 RD c Information Processing Society of Japan
情報処理学会研究報告 した 結果を図 に示す プロットの形状から y = xn のグラフとの相関が高いことがわか 3.9 る そこで 発生符号量と の関係を表す RD 特性近似曲線を以下の () 式のように 近似する () 発生符号量.7 f (x) = ( x)a ここで x はマクロブロック最大発生符号量 (3bit) で正規化した発生符号量 f (x) は.5 が入り a はマクロブロックごとに異なる値をとる変数である 任意の QP でマクロ.3 ブロックを符号化した結果得られる発生符号量と を () 式へ与えることで a を決定. し当該マクロブロックの RD 特性近似曲線を求めることが出来る. 上で求めた RD 特性近似曲線 f (x) の精度を検証した 検証方法は以下の通りである あるマクロブロックを つの代表 QP 値で符号化した時の発生符号量 を抽出し 3 3 発生符号量 4 5 6 QP (xk, f (xk )) = (M bbit, ) を代入して ak を求める 次に 求められた当該マクロブロッ 図 QP と発生符号量 Fig. QP-Generated Bits 図 RD 特性曲線 Fig. RD Curve クの RD 特性近似曲線 f (x) = ( x)ak の x に QP が から 5 までの時の実発生符 号量を代入し f (x) 近似 を得る 得られた近似 と 実際に QP を か ら 5 までの値の時に得られる について相関係数を求めた あるマクロブロックについて実際の RD 特性曲線と RD 特性近似曲線をプロットしたも QP-MbBits Curve Approx QP-MbBits Curve のを図 3 に示す RD 特性曲線と RD 特性近似曲線を比べると 同様の傾向を持つ曲線と 代表点として3つのマクロブロックを選定し 相関係数を求めたところ最大で.994 最 GenBit [kbit/s] なっていることが確認出来る 小で.975 という結果が得られた いずれも に非常に近い値が相関係数として得られて いるため f (x) は十分 RD 特性曲線の近似式として適用出来ると考えられる.3 QP-発生符号量曲線 QP-Bit 曲線. RD Curve Approx RD Curve 先に求めた RD 特性近似曲線を用いて決定された第二符号化時の各マクロブロックのター ゲット符号量となるような QP を求めるために QP と発生符号量の関係を表す QP-発生. GenBit 3 4 5 QP 符号量曲線 QP-Bit 曲線 の近似式について検討した 図 3 RD 特性近似曲線 Fig. 3 Approx RD Curve RD 特性近似曲線を定義したときと同様に 様々なマクロブロックについて QP を か 図 4 QP-発生符号量曲線 Fig. 4 QP-Generated Bit Curve ら 5 まで設定した時の QP と発生符号量の関係をグラフにプロットし 実際の QP-発生 符号量の関係を確認する 結果を図 に示す プロットの形状からそれぞれの曲線がほと な QP-GenBit 曲線の平均値を求め その平均値と () 式に対して最小自乗法を用いて んど交差することがないことがわかる そこで 代表的な点を用いて QP と発生符号量の α =.9846975, β = 95.79875 と求めた また γ は y 軸切片を表しており曲線への依 関係を表す QP-Bit 曲線を以下の2次方程式で近似する 存性が強い値であると考えられるため γ を変数として任意の QP とマクロブロック発生符 g(x) = αx + βx + γ 号量を () 式へ与えることで 本の QP-GenBit 曲線を決定する すなわち 第一符号化 () 結果を与えることで各マクロブロックの QP-GenBit 曲線を決定する ここで x は QP g(x) はマクロブロック発生符号量が入る 今回は代表的な点として様々 3 c Information Processing Society of Japan
RD QP-Bit g(x) QP MbBit (x l, g(x l )) = (QP, MbBit) γ l QP-MbBits g(x) = αx + βx + γ l x QP 5 QP QP-Bit QP-Bit 4 QP-Bit QP-Bit 3.999.993 QP-Bit RD g(x) QP-Bit 3. RD D/ R D/ R QP-Bit QP QP 5 5.. 3. 4. E pic = D pic/ R pic E pic 5 Fig. 5 Flow chart (AvePicBit) (Ave) AvePicBit Ave () (3) E pic E(x) = f (x) = a( x) a (3) E pic = a pic ( AveP icbit) apic, here (4) ln( f(x)) ln( Ave) a pic = = ln( x) ln( AveP icbit) 5. RD (x i ) () a i RD f(x i ) = ( x i ) a i, here a i = ln( f(x i)) ln( x i ) i i 6. 5. a i RD 4. E pic (T MbBit i ) (3) E(x i) = E pic a = a i T MbBit i (5) 4 c Information Processing Society of Japan
E(x i ) = a i ( x i ) a i E pic = a i( T MbBit i) a i ( Epic ) a i T MbBit i = (6) a i 7. QP () QP-GenBit QP (QP i ) (MbBit i ) γ i QP-GenBit γ i = MbBit i α QPi β QP i (7) QP-GenBit γ i g(x i ) = T MbBit i QP (T QP i ) T QP i QP 5 8. 7. QP (T QP i ) 4. 3 ITE SDTV (7 48 45 I- JM ver. 4. 3 E pic = D pic / R pic (AvePicBit) (Ave) RD (Soccer Action) 6 Soccer Action QP ±8 3% 5. %.9.7 stenc ndenc.5 4 6 8 GenBit [kbit/s] 6 (Soccer Action) Fig. 6 Experimental Result (Soccer Action) ) Yutaka Yokoyama, Satoshi Nogaki, A Rate Control Method with Pre-Analysis for Real-Time MPEG- Video Coding, IEEE CNF, vol. 3, pp. 54-57, 7- Oct.. ) H.64/AVC, x64, http://www.videolan.org/developers/x64.html (), 3) Seishi Takamura, Naoki Kobayashi, MPEG- one-pass variable bit rate control algorithm and its LSI Implementation, Image Processing,. Proceedings. Internatioanl Conf., vol., pp. 94-945, 7- Oct.. 4) Zhou Wang, Alan Conrad Bovik, Hamid Rahim Sheikh, Eero P. Simoncelli, Image Quality Assessment: From Error Visibility to Structural Similarity, IEEE Transactions on Image Processing, vol. 3, no. 4, pp. 6-6, Apr. 4. 5) Huynh-Thu Q, Ghanbari M, Scope of Validity of PSNR in Image/Video Quality Assessment, IEEE Electronics Letters, Vol. 44, Issue. 3, pp. 8-8, June 9 8. 6) Joint Model Reference Software, JM, http://iphome.hhi.de/suehring/tml/ (), 5 c Information Processing Society of Japan