• 沒有找到結果。

CHAPTER 5. THEORETICAL ANALYSIS ON SVC RATE-DISTORTION

5.1. T HEORETICAL M ODEL

5.1.1. Theoretical R-D functions of Single-Layer Hybrid Coding

如 Figure 5.1 所示,H.264/AVC 的 Block-Based Hybrid Video Coding 架構在對 Inter mode 進行編碼時,先從 reference frame 取得預測訊號並計算出 residual signal,然後傳 輸 residual signal 經過 DCT 和 quantization 後的 coefficient。我們在理論分析時模擬這些 步驟,5.1.1 中的 Step 1 由於理論分析時不能直接使用實際的 residual signal,但需要 residual 的變異程度,所以這步驟推導了 Inter mode 的 spatial domain residual covariance model,因為需要 DCT domain residual variance,Step 2 介紹 covariance 的 DCT 轉換方法,

Step 3 建立 R-D 間關係,加入 QP 影響,並說明 R-D 計算方法。以 H.264 為基礎延伸的 SVC 在 Inter Prediction 時多了 Inter-Layer Prediction 機制,將在 5.1.2 討論 Inter-Layer Prediction 對 residual covariance model 的影響。在 Table 5.1 定義了理論分析需要的一些

symbol 。

Figure 5.1

( intensity of current frame () intensity of reference frame

*+(s) quantization noise

-/ two dimension -0 block center 123 intensity variance 143 motion variance 153 noise variance 163 noise variance

the correlation between true motion of s the correlation between quantization noise of s the correlation between quantization noise of s 7 - the residual signal

8 - the distortion of s point

39

Inter Prediction 的 residual signal 編碼流程圖

Table 5.1 symbol definition intensity of current frame

intensity of reference frame

uantization noise at point s in current frame in base layer

uantization noise at point s in reference frame in enhancement layer uantization noise at point s in reference frame in base layer

block motion of current MB mode in base layer

block motion of current MB mode in enhancement layer true motion of s point

two dimensions position,si = ( ri , ci ) intensity variance

motion variance

noise variance in Single-Layer noise variance in L Layer

correlation between true motion of si and sj

the correlation between quantization noise of si and sj

the correlation between quantization noise of si in EL and s the residual signal of s point

the distortion of s point

編碼流程圖

current frame in base layer

reference frame in enhancement layer reference frame in base layer

and sj in BL

40

Step 1:

Figure 5.2 H.264/AVC 中 residual signal 取得方法示意圖

由於後面步驟需要計算 Rate-Distortion (R-D)間的關係,所使用的 R-D function 需要 MB 中不同位置的 residual variance,本論文針對 Inter mode 做理論分析,所以利用 Tao et al.[10]所提供的公式推導了 spatial domain residual covariance

1 1 1 2 2 2

41

公式(5.2)中 residual signal 是原始訊號扣去預測訊號的差值,由於 reference frame 提 供的是重建後的 signal,所以需考慮 noise 的影響。公式(5.3)是根據 true motion 的定義。

而 是隨機變數;根據 Law of Total Expectation,第三個等式中先對 intensity 計算 期望值後再對 motion 計算期望值;第四個等式中假設 intensity 和 noise 之間為獨立並根據

因為 motion vector 的期望值為 0,所以可簡化成第四個等式。在公式(5.1)第五個等 式中還有對 s1和 s2兩點 quantization error 之間的 correlation 做假設

|| ||1 2

[ ( i ( )) (c j ( ))]c nsi sj n

E n sɶ +v s n sɶ +v s σɶ (5.7)

42

會做這樣的假設是因為 quantization error 會因為距離而影響相關性,根據以上結果 和觀念可以得到公式(5.1)的結論,而其中的 quantization error 的 variance 假設為

2

2 Q

= 12

n

σ step (5.8)

式子(5.8)在[11]中是 scalar quantizer 在 uniform quantization 時 quantization error 和 Qstep 之間的關係式,雖然和實際情況有所差異,但暫時使用這關係式,未來可能對這 方面作出一些修正。

Step 2:

本論文使用 DCT 而不用最理想的 KLT(Karhunen-Loeve Transform),因為經由公式 (5.1)計算出來的 spatial domain residual covariance 經由這兩種方法轉換後的 frequency domain residual variance,其值非常接近,選擇哪種方法並不影響理論分析,所以我們依 然和 H.264/AVC 一樣使用 DCT 進行理論分析。將 4x4 的 spatial domain residual 和 DCT domain residual 以 raster scan order 表示如下:

spatial domain residual covariance 轉換成 DCT domain residual covariance

43

Single-Layer Coding 編碼需要計算某 QP 時一個 MB 的 Rate 和 Distortion,所以理論 分析也需要一個計算 MB Rate 和 Distortion 的方法,這裡利用倒水定理,倒水定理的內

假設在公式(5.12)中已經知道所有的 ,而調整係數 會隨 coefficient 的 distribution 而改變,這時只要調整 ,就可以改變每個 coefficient 的位元配置,如 Figure 5.3,調整 就如同調整水位線,水位以上的 coefficient 才需要分配位元,水位以下的不分配位元。

得到每個 coefficient 的 Rate 後利用 Rate-Distortion Function 計算相對應的 Distortion,便 可建立 MB Level 的 R-D 關係。

44

上面那段描述了使用倒水定理的方法,接下來依理論分析的需求做一些說明和假設。

理論上,要得到一個 MB 的最佳效能編碼 R-D,可以要求 Distortion 然後對一個 MB 做 位元配置最佳化,這時候被編碼的 coefficient 間必須無相關性,而所期待的最佳化 R-D 關係式如下 DCT domain residual variance。得到 Rate 後需要合適的 Rate-Distortion Function 建立 R-D 關係,這裡假設 DCT coefficient 是 Gaussian distribution,其 Rate-Distortion Function 如下:

2

只要知道 便可在公式(5.13)(5.14)建立單一 DCT coefficient 間的 R-D 關係,所以把 倒水定理中求得的 pixel level 的 DCT coefficient Rate 代入公式(5.14)中,就可以得到 pixel level 的 DCT coefficient 的 Distortion,進而求出 MB Level 的 Rate 和 Distortion。

目前已知如何取得 MB Level 的 Rate 和 Distortion,而 Single-Layer Coding 經由編碼 後可以得到對應 QP 的 Rate 和 Distortion,要使理論分析模擬這樣的情況,能在給定 QP 後得到相對應的 Rate 和 Distortion。因為 QP 通常決定了 Single-Layer Coding 編碼後的 畫質,所以這裡建立 QP 和 Distortion 的關係式,理論上 Distortion 和 quantization error 是一樣的,如以下式子所表示:

Q 2

D = 12

step (5.15)

公式(5.15)知道 QP 和 Distortion 的關係,先指定某 QP 計算 Distortion,然後將倒水 定理 pixel level coefficient 求得的 Rate 帶入公式(5.14)得到 pixel level coefficient 的 Distortion,然後計算平均,如果平均 Distortion 可以和先前 QP 計算得到的 Distortion 一

45

樣,那就表示已經求得這 QP 的 Rate。

46

相關文件